tmex-cli 0.9.2 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/dist/runtime/server.js +1407 -127
  2. package/package.json +1 -1
  3. package/resources/fe-dist/assets/{DevicePage-RqH-pnZX.js → DevicePage-5vkaNOjl.js} +2 -2
  4. package/resources/fe-dist/assets/DevicesPage-CKnRUGQm.js +2 -0
  5. package/resources/fe-dist/assets/FilePage-Dj0cszD4.css +1 -0
  6. package/resources/fe-dist/assets/FilePage-Uj-tzGW7.js +283 -0
  7. package/resources/fe-dist/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  8. package/resources/fe-dist/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  9. package/resources/fe-dist/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  10. package/resources/fe-dist/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  11. package/resources/fe-dist/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  12. package/resources/fe-dist/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  13. package/resources/fe-dist/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  14. package/resources/fe-dist/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  15. package/resources/fe-dist/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  16. package/resources/fe-dist/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  17. package/resources/fe-dist/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  18. package/resources/fe-dist/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  19. package/resources/fe-dist/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  20. package/resources/fe-dist/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  21. package/resources/fe-dist/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  22. package/resources/fe-dist/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  23. package/resources/fe-dist/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  24. package/resources/fe-dist/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  25. package/resources/fe-dist/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  26. package/resources/fe-dist/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  27. package/resources/fe-dist/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  28. package/resources/fe-dist/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  29. package/resources/fe-dist/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  30. package/resources/fe-dist/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  31. package/resources/fe-dist/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  32. package/resources/fe-dist/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  33. package/resources/fe-dist/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  34. package/resources/fe-dist/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  35. package/resources/fe-dist/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  36. package/resources/fe-dist/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  37. package/resources/fe-dist/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  38. package/resources/fe-dist/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  39. package/resources/fe-dist/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  40. package/resources/fe-dist/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  41. package/resources/fe-dist/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  42. package/resources/fe-dist/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  43. package/resources/fe-dist/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  44. package/resources/fe-dist/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  45. package/resources/fe-dist/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  46. package/resources/fe-dist/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  47. package/resources/fe-dist/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  48. package/resources/fe-dist/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  49. package/resources/fe-dist/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  50. package/resources/fe-dist/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  51. package/resources/fe-dist/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  52. package/resources/fe-dist/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  53. package/resources/fe-dist/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  54. package/resources/fe-dist/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  55. package/resources/fe-dist/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  56. package/resources/fe-dist/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  57. package/resources/fe-dist/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  58. package/resources/fe-dist/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  59. package/resources/fe-dist/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  60. package/resources/fe-dist/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  61. package/resources/fe-dist/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  62. package/resources/fe-dist/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  63. package/resources/fe-dist/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  64. package/resources/fe-dist/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  65. package/resources/fe-dist/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  66. package/resources/fe-dist/assets/SettingsPage-Cfzr_Phh.js +22 -0
  67. package/resources/fe-dist/assets/arc-Wv219fq_.js +2 -0
  68. package/resources/fe-dist/assets/architectureDiagram-3BPJPVTR-DkPPo2hY.js +37 -0
  69. package/resources/fe-dist/assets/blockDiagram-GPEHLZMM-DPAThozG.js +133 -0
  70. package/resources/fe-dist/assets/c4Diagram-AAUBKEIU-DBs_N-_p.js +11 -0
  71. package/resources/fe-dist/assets/card-Dl0HC88A.js +2 -0
  72. package/resources/fe-dist/assets/channel-DyLhDM_y.js +2 -0
  73. package/resources/fe-dist/assets/chunk-2J33WTMH-D3mrUPCp.js +2 -0
  74. package/resources/fe-dist/assets/chunk-4BX2VUAB-C0DRv58j.js +2 -0
  75. package/resources/fe-dist/assets/chunk-55IACEB6-DheUp7iQ.js +2 -0
  76. package/resources/fe-dist/assets/chunk-727SXJPM-Cvew2yIJ.js +207 -0
  77. package/resources/fe-dist/assets/chunk-AQP2D5EJ-DUoa4Wdg.js +232 -0
  78. package/resources/fe-dist/assets/chunk-FMBD7UC4-Bt9Oi52P.js +16 -0
  79. package/resources/fe-dist/assets/chunk-ND2GUHAM-DlWpyDaS.js +2 -0
  80. package/resources/fe-dist/assets/chunk-QZHKN3VN-BZtXwgRW.js +2 -0
  81. package/resources/fe-dist/assets/classDiagram-4FO5ZUOK-DA8DiM06.js +2 -0
  82. package/resources/fe-dist/assets/classDiagram-v2-Q7XG4LA2-DA8DiM06.js +2 -0
  83. package/resources/fe-dist/assets/cose-bilkent-S5V4N54A-yKy6sTY_.js +2 -0
  84. package/resources/fe-dist/assets/cytoscape.esm-DTSO7Bv0.js +332 -0
  85. package/resources/fe-dist/assets/dagre-BM42HDAG-DL4fpno6.js +5 -0
  86. package/resources/fe-dist/assets/defaultLocale-DX6XiGOO.js +2 -0
  87. package/resources/fe-dist/assets/diagram-2AECGRRQ-BueYws-9.js +44 -0
  88. package/resources/fe-dist/assets/diagram-5GNKFQAL-GQEQSUeb.js +11 -0
  89. package/resources/fe-dist/assets/diagram-KO2AKTUF-LE3yI4ed.js +4 -0
  90. package/resources/fe-dist/assets/diagram-LMA3HP47-BkHjYrU4.js +25 -0
  91. package/resources/fe-dist/assets/diagram-OG6HWLK6-DrnHic-P.js +25 -0
  92. package/resources/fe-dist/assets/erDiagram-TEJ5UH35-BCwWv-rO.js +86 -0
  93. package/resources/fe-dist/assets/flowDiagram-I6XJVG4X-DEC2Z_fh.js +163 -0
  94. package/resources/fe-dist/assets/ganttDiagram-6RSMTGT7-H1T5bCsY.js +293 -0
  95. package/resources/fe-dist/assets/gitGraphDiagram-PVQCEYII-DmZUfKfl.js +107 -0
  96. package/resources/fe-dist/assets/graph-CAnANduQ.js +2 -0
  97. package/resources/fe-dist/assets/index-OpBFduyh.js +466 -0
  98. package/resources/fe-dist/assets/index-yMgNjHUH.css +1 -0
  99. package/resources/fe-dist/assets/infoDiagram-5YYISTIA-fDOg9Qr5.js +3 -0
  100. package/resources/fe-dist/assets/init-Gi6I4Gst.js +2 -0
  101. package/resources/fe-dist/assets/ishikawaDiagram-YF4QCWOH-QIvSJI3q.js +71 -0
  102. package/resources/fe-dist/assets/journeyDiagram-JHISSGLW-Iz7u4iH8.js +140 -0
  103. package/resources/fe-dist/assets/kanban-definition-UN3LZRKU-BYiFSFgn.js +90 -0
  104. package/resources/fe-dist/assets/layout-DGIYPm2g.js +2 -0
  105. package/resources/fe-dist/assets/linear-DNHZFKop.js +2 -0
  106. package/resources/fe-dist/assets/mermaid.core-DUipsjFg.js +310 -0
  107. package/resources/fe-dist/assets/mindmap-definition-RKZ34NQL-tPbrKC3m.js +97 -0
  108. package/resources/fe-dist/assets/ordinal-BENe2yWM.js +2 -0
  109. package/resources/fe-dist/assets/pieDiagram-4H26LBE5-26o8qBzb.js +31 -0
  110. package/resources/fe-dist/assets/quadrantDiagram-W4KKPZXB-BgpGo9Ak.js +8 -0
  111. package/resources/fe-dist/assets/{refresh-cw-D0LYIwxc.js → refresh-cw-DdcimDhs.js} +3 -3
  112. package/resources/fe-dist/assets/requirementDiagram-4Y6WPE33-BEfrxsDZ.js +85 -0
  113. package/resources/fe-dist/assets/sankeyDiagram-5OEKKPKP-BuIeHyjh.js +41 -0
  114. package/resources/fe-dist/assets/sequenceDiagram-3UESZ5HK-CL0sinOn.js +163 -0
  115. package/resources/fe-dist/assets/stateDiagram-AJRCARHV-BCq5X6hO.js +2 -0
  116. package/resources/fe-dist/assets/stateDiagram-v2-BHNVJYJU-DH2ctCND.js +2 -0
  117. package/resources/fe-dist/assets/timeline-definition-PNZ67QCA-CnqqA91O.js +121 -0
  118. package/resources/fe-dist/assets/vennDiagram-CIIHVFJN-BqFG3JXB.js +35 -0
  119. package/resources/fe-dist/assets/wardley-L42UT6IY-DvfZKNwT.js +174 -0
  120. package/resources/fe-dist/assets/wardleyDiagram-YWT4CUSO-DlABpMGt.js +79 -0
  121. package/resources/fe-dist/assets/xychartDiagram-2RQKCTM6-BDiyUuus.js +8 -0
  122. package/resources/fe-dist/index.html +2 -2
  123. package/resources/gateway-drizzle/0007_fearless_pestilence.sql +8 -0
  124. package/resources/gateway-drizzle/0008_perfect_ozymandias.sql +7 -0
  125. package/resources/gateway-drizzle/meta/_journal.json +14 -0
  126. package/resources/fe-dist/assets/DevicesPage-BPLJu-5J.js +0 -2
  127. package/resources/fe-dist/assets/SettingsPage-CKP305BP.js +0 -22
  128. package/resources/fe-dist/assets/card-X35xwXzW.js +0 -2
  129. package/resources/fe-dist/assets/index-CKQEHZcV.css +0 -1
  130. package/resources/fe-dist/assets/index-O2a9149K.js +0 -400
@@ -0,0 +1,466 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SettingsPage-Cfzr_Phh.js","assets/card-Dl0HC88A.js","assets/refresh-cw-DdcimDhs.js","assets/DevicesPage-CKnRUGQm.js","assets/DevicePage-5vkaNOjl.js","assets/FilePage-Uj-tzGW7.js","assets/FilePage-Dj0cszD4.css"])))=>i.map(i=>d[i]);
2
+ var eL=Object.defineProperty;var pC=e=>{throw TypeError(e)};var tL=(e,t,n)=>t in e?eL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var at=(e,t,n)=>tL(e,typeof t!="symbol"?t+"":t,n),Uy=(e,t,n)=>t.has(e)||pC("Cannot "+n);var re=(e,t,n)=>(Uy(e,t,"read from private field"),n?n.call(e):t.get(e)),pt=(e,t,n)=>t.has(e)?pC("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Qe=(e,t,n,r)=>(Uy(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Bt=(e,t,n)=>(Uy(e,t,"access private method"),n);var xh=(e,t,n,r)=>({set _(a){Qe(e,t,a,n)},get _(){return re(e,t,r)}});function nL(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const o=Object.getOwnPropertyDescriptor(r,a);o&&Object.defineProperty(e,a,o.get?o:{enumerable:!0,get:()=>r[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const o of a)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(a){const o={};return a.integrity&&(o.integrity=a.integrity),a.referrerPolicy&&(o.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?o.credentials="include":a.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(a){if(a.ep)return;a.ep=!0;const o=n(a);fetch(a.href,o)}})();const rL="modulepreload",iL=function(e){return"/"+e},mC={},Kp=function(t,n,r){let a=Promise.resolve();if(n&&n.length>0){let l=function(d){return Promise.all(d.map(m=>Promise.resolve(m).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),f=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));a=l(n.map(d=>{if(d=iL(d),d in mC)return;mC[d]=!0;const m=d.endsWith(".css"),h=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${h}`))return;const y=document.createElement("link");if(y.rel=m?"stylesheet":rL,m||(y.as="script"),y.crossOrigin="",y.href=d,f&&y.setAttribute("nonce",f),document.head.appendChild(y),m)return new Promise((g,w)=>{y.addEventListener("load",g),y.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${d}`)))})}))}function o(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return a.then(l=>{for(const c of l||[])c.status==="rejected"&&o(c.reason);return t().catch(o)})};function Gp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var qy={exports:{}},Nu={};/**
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 gC;function aL(){if(gC)return Nu;gC=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,a,o){var l=null;if(o!==void 0&&(l=""+o),a.key!==void 0&&(l=""+a.key),"key"in a){o={};for(var c in a)c!=="key"&&(o[c]=a[c])}else o=a;return a=o.ref,{$$typeof:e,type:r,key:l,ref:a!==void 0?a:null,props:o}}return Nu.Fragment=t,Nu.jsx=n,Nu.jsxs=n,Nu}var yC;function oL(){return yC||(yC=1,qy.exports=aL()),qy.exports}var S=oL(),Mc=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(){}},sL={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},ko,Mx,lM,lL=(lM=class{constructor(){pt(this,ko,sL);pt(this,Mx,!1)}setTimeoutProvider(e){Qe(this,ko,e)}setTimeout(e,t){return re(this,ko).setTimeout(e,t)}clearTimeout(e){re(this,ko).clearTimeout(e)}setInterval(e,t){return re(this,ko).setInterval(e,t)}clearInterval(e){re(this,ko).clearInterval(e)}},ko=new WeakMap,Mx=new WeakMap,lM),Cs=new lL;function cL(e){setTimeout(e,0)}var Bs=typeof window>"u"||"Deno"in globalThis;function Tr(){}function uL(e,t){return typeof e=="function"?e(t):e}function av(e){return typeof e=="number"&&e>=0&&e!==1/0}function vM(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Fo(e,t){return typeof e=="function"?e(t):e}function bi(e,t){return typeof e=="function"?e(t):e}function bC(e,t){const{type:n="all",exact:r,fetchStatus:a,predicate:o,queryKey:l,stale:c}=e;if(l){if(r){if(t.queryHash!==Ox(l,t.options))return!1}else if(!gd(t.queryKey,l))return!1}if(n!=="all"){const f=t.isActive();if(n==="active"&&!f||n==="inactive"&&f)return!1}return!(typeof c=="boolean"&&t.isStale()!==c||a&&a!==t.state.fetchStatus||o&&!o(t))}function vC(e,t){const{exact:n,status:r,predicate:a,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(Hs(t.options.mutationKey)!==Hs(o))return!1}else if(!gd(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||a&&!a(t))}function Ox(e,t){return((t==null?void 0:t.queryKeyHashFn)||Hs)(e)}function Hs(e){return JSON.stringify(e,(t,n)=>ov(n)?Object.keys(n).sort().reduce((r,a)=>(r[a]=n[a],r),{}):n)}function gd(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>gd(e[n],t[n])):!1}var dL=Object.prototype.hasOwnProperty;function xM(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=xC(e)&&xC(t);if(!r&&!(ov(e)&&ov(t)))return t;const o=(r?e:Object.keys(e)).length,l=r?t:Object.keys(t),c=l.length,f=r?new Array(c):{};let d=0;for(let m=0;m<c;m++){const h=r?m:l[m],y=e[h],g=t[h];if(y===g){f[h]=y,(r?m<o:dL.call(e,h))&&d++;continue}if(y===null||g===null||typeof y!="object"||typeof g!="object"){f[h]=g;continue}const w=xM(y,g,n+1);f[h]=w,w===y&&d++}return o===c&&d===o?e:f}function gp(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 xC(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ov(e){if(!wC(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!wC(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function wC(e){return Object.prototype.toString.call(e)==="[object Object]"}function fL(e){return new Promise(t=>{Cs.setTimeout(t,e)})}function sv(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?xM(e,t):t}function hL(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function pL(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Ax=Symbol();function wM(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Ax?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Nx(e,t){return typeof e=="function"?e(...t):!!e}function mL(e,t,n){let r=!1,a;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(a??(a=t()),r||(r=!0,a.aborted?n():a.addEventListener("abort",n,{once:!0})),a)}),e}var Ms,Mo,sc,cM,gL=(cM=class extends Mc{constructor(){super();pt(this,Ms);pt(this,Mo);pt(this,sc);Qe(this,sc,t=>{if(!Bs&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){re(this,Mo)||this.setEventListener(re(this,sc))}onUnsubscribe(){var t;this.hasListeners()||((t=re(this,Mo))==null||t.call(this),Qe(this,Mo,void 0))}setEventListener(t){var n;Qe(this,sc,t),(n=re(this,Mo))==null||n.call(this),Qe(this,Mo,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){re(this,Ms)!==t&&(Qe(this,Ms,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof re(this,Ms)=="boolean"?re(this,Ms):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Ms=new WeakMap,Mo=new WeakMap,sc=new WeakMap,cM),Dx=new gL;function lv(){let e,t;const n=new Promise((a,o)=>{e=a,t=o});n.status="pending",n.catch(()=>{});function r(a){Object.assign(n,a),delete n.resolve,delete n.reject}return n.resolve=a=>{r({status:"fulfilled",value:a}),e(a)},n.reject=a=>{r({status:"rejected",reason:a}),t(a)},n}var yL=cL;function bL(){let e=[],t=0,n=c=>{c()},r=c=>{c()},a=yL;const o=c=>{t?e.push(c):a(()=>{n(c)})},l=()=>{const c=e;e=[],c.length&&a(()=>{r(()=>{c.forEach(f=>{n(f)})})})};return{batch:c=>{let f;t++;try{f=c()}finally{t--,t||l()}return f},batchCalls:c=>(...f)=>{o(()=>{c(...f)})},schedule:o,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{a=c}}}var Xn=bL(),lc,Oo,cc,uM,vL=(uM=class extends Mc{constructor(){super();pt(this,lc,!0);pt(this,Oo);pt(this,cc);Qe(this,cc,t=>{if(!Bs&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){re(this,Oo)||this.setEventListener(re(this,cc))}onUnsubscribe(){var t;this.hasListeners()||((t=re(this,Oo))==null||t.call(this),Qe(this,Oo,void 0))}setEventListener(t){var n;Qe(this,cc,t),(n=re(this,Oo))==null||n.call(this),Qe(this,Oo,t(this.setOnline.bind(this)))}setOnline(t){re(this,lc)!==t&&(Qe(this,lc,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return re(this,lc)}},lc=new WeakMap,Oo=new WeakMap,cc=new WeakMap,uM),yp=new vL;function xL(e){return Math.min(1e3*2**e,3e4)}function SM(e){return(e??"online")==="online"?yp.isOnline():!0}var cv=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function EM(e){let t=!1,n=0,r;const a=lv(),o=()=>a.status!=="pending",l=C=>{var T;if(!o()){const E=new cv(C);y(E),(T=e.onCancel)==null||T.call(e,E)}},c=()=>{t=!0},f=()=>{t=!1},d=()=>Dx.isFocused()&&(e.networkMode==="always"||yp.isOnline())&&e.canRun(),m=()=>SM(e.networkMode)&&e.canRun(),h=C=>{o()||(r==null||r(),a.resolve(C))},y=C=>{o()||(r==null||r(),a.reject(C))},g=()=>new Promise(C=>{var T;r=E=>{(o()||d())&&C(E)},(T=e.onPause)==null||T.call(e)}).then(()=>{var C;r=void 0,o()||(C=e.onContinue)==null||C.call(e)}),w=()=>{if(o())return;let C;const T=n===0?e.initialPromise:void 0;try{C=T??e.fn()}catch(E){C=Promise.reject(E)}Promise.resolve(C).then(h).catch(E=>{var O;if(o())return;const R=e.retry??(Bs?0:3),k=e.retryDelay??xL,M=typeof k=="function"?k(n,E):k,D=R===!0||typeof R=="number"&&n<R||typeof R=="function"&&R(n,E);if(t||!D){y(E);return}n++,(O=e.onFail)==null||O.call(e,n,E),fL(M).then(()=>d()?void 0:g()).then(()=>{t?y(E):w()})})};return{promise:a,status:()=>a.status,cancel:l,continue:()=>(r==null||r(),a),cancelRetry:c,continueRetry:f,canStart:m,start:()=>(m()?w():g().then(w),a)}}var Os,dM,CM=(dM=class{constructor(){pt(this,Os)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),av(this.gcTime)&&Qe(this,Os,Cs.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Bs?1/0:300*1e3))}clearGcTimeout(){re(this,Os)&&(Cs.clearTimeout(re(this,Os)),Qe(this,Os,void 0))}},Os=new WeakMap,dM),As,uc,gi,Ns,ar,Dd,Ds,Li,Da,fM,wL=(fM=class extends CM{constructor(t){super();pt(this,Li);pt(this,As);pt(this,uc);pt(this,gi);pt(this,Ns);pt(this,ar);pt(this,Dd);pt(this,Ds);Qe(this,Ds,!1),Qe(this,Dd,t.defaultOptions),this.setOptions(t.options),this.observers=[],Qe(this,Ns,t.client),Qe(this,gi,re(this,Ns).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Qe(this,As,EC(this.options)),this.state=t.state??re(this,As),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=re(this,ar))==null?void 0:t.promise}setOptions(t){if(this.options={...re(this,Dd),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=EC(this.options);n.data!==void 0&&(this.setState(SC(n.data,n.dataUpdatedAt)),Qe(this,As,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&re(this,gi).remove(this)}setData(t,n){const r=sv(this.state.data,t,this.options);return Bt(this,Li,Da).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Bt(this,Li,Da).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,a;const n=(r=re(this,ar))==null?void 0:r.promise;return(a=re(this,ar))==null||a.cancel(t),n?n.then(Tr).catch(Tr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(re(this,As))}isActive(){return this.observers.some(t=>bi(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ax||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Fo(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:!vM(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=re(this,ar))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=re(this,ar))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),re(this,gi).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(re(this,ar)&&(re(this,Ds)?re(this,ar).cancel({revert:!0}):re(this,ar).cancelRetry()),this.scheduleGc()),re(this,gi).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Bt(this,Li,Da).call(this,{type:"invalidate"})}async fetch(t,n){var f,d,m,h,y,g,w,C,T,E,R,k;if(this.state.fetchStatus!=="idle"&&((f=re(this,ar))==null?void 0:f.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(re(this,ar))return re(this,ar).continueRetry(),re(this,ar).promise}if(t&&this.setOptions(t),!this.options.queryFn){const M=this.observers.find(D=>D.options.queryFn);M&&this.setOptions(M.options)}const r=new AbortController,a=M=>{Object.defineProperty(M,"signal",{enumerable:!0,get:()=>(Qe(this,Ds,!0),r.signal)})},o=()=>{const M=wM(this.options,n),O=(()=>{const A={client:re(this,Ns),queryKey:this.queryKey,meta:this.meta};return a(A),A})();return Qe(this,Ds,!1),this.options.persister?this.options.persister(M,O,this):M(O)},c=(()=>{const M={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:re(this,Ns),state:this.state,fetchFn:o};return a(M),M})();(d=this.options.behavior)==null||d.onFetch(c,this),Qe(this,uc,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((m=c.fetchOptions)==null?void 0:m.meta))&&Bt(this,Li,Da).call(this,{type:"fetch",meta:(h=c.fetchOptions)==null?void 0:h.meta}),Qe(this,ar,EM({initialPromise:n==null?void 0:n.initialPromise,fn:c.fetchFn,onCancel:M=>{M instanceof cv&&M.revert&&this.setState({...re(this,uc),fetchStatus:"idle"}),r.abort()},onFail:(M,D)=>{Bt(this,Li,Da).call(this,{type:"failed",failureCount:M,error:D})},onPause:()=>{Bt(this,Li,Da).call(this,{type:"pause"})},onContinue:()=>{Bt(this,Li,Da).call(this,{type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0}));try{const M=await re(this,ar).start();if(M===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(M),(g=(y=re(this,gi).config).onSuccess)==null||g.call(y,M,this),(C=(w=re(this,gi).config).onSettled)==null||C.call(w,M,this.state.error,this),M}catch(M){if(M instanceof cv){if(M.silent)return re(this,ar).promise;if(M.revert){if(this.state.data===void 0)throw M;return this.state.data}}throw Bt(this,Li,Da).call(this,{type:"error",error:M}),(E=(T=re(this,gi).config).onError)==null||E.call(T,M,this),(k=(R=re(this,gi).config).onSettled)==null||k.call(R,this.state.data,M,this),M}finally{this.scheduleGc()}}},As=new WeakMap,uc=new WeakMap,gi=new WeakMap,Ns=new WeakMap,ar=new WeakMap,Dd=new WeakMap,Ds=new WeakMap,Li=new WeakSet,Da=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...TM(r.data,this.options),fetchMeta:t.meta??null};case"success":const a={...r,...SC(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Qe(this,uc,t.manual?a:void 0),a;case"error":const o=t.error;return{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Xn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),re(this,gi).notify({query:this,type:"updated",action:t})})},fM);function TM(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:SM(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function SC(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function EC(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var jr,nn,Id,Cr,Is,dc,ja,Ao,Pd,fc,hc,Ps,Ls,No,pc,pn,Wu,uv,dv,fv,hv,pv,mv,gv,RM,hM,SL=(hM=class extends Mc{constructor(t,n){super();pt(this,pn);pt(this,jr);pt(this,nn);pt(this,Id);pt(this,Cr);pt(this,Is);pt(this,dc);pt(this,ja);pt(this,Ao);pt(this,Pd);pt(this,fc);pt(this,hc);pt(this,Ps);pt(this,Ls);pt(this,No);pt(this,pc,new Set);this.options=n,Qe(this,jr,t),Qe(this,Ao,null),Qe(this,ja,lv()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(re(this,nn).addObserver(this),CC(re(this,nn),this.options)?Bt(this,pn,Wu).call(this):this.updateResult(),Bt(this,pn,hv).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return yv(re(this,nn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return yv(re(this,nn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Bt(this,pn,pv).call(this),Bt(this,pn,mv).call(this),re(this,nn).removeObserver(this)}setOptions(t){const n=this.options,r=re(this,nn);if(this.options=re(this,jr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof bi(this.options.enabled,re(this,nn))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Bt(this,pn,gv).call(this),re(this,nn).setOptions(this.options),n._defaulted&&!gp(this.options,n)&&re(this,jr).getQueryCache().notify({type:"observerOptionsUpdated",query:re(this,nn),observer:this});const a=this.hasListeners();a&&TC(re(this,nn),r,this.options,n)&&Bt(this,pn,Wu).call(this),this.updateResult(),a&&(re(this,nn)!==r||bi(this.options.enabled,re(this,nn))!==bi(n.enabled,re(this,nn))||Fo(this.options.staleTime,re(this,nn))!==Fo(n.staleTime,re(this,nn)))&&Bt(this,pn,uv).call(this);const o=Bt(this,pn,dv).call(this);a&&(re(this,nn)!==r||bi(this.options.enabled,re(this,nn))!==bi(n.enabled,re(this,nn))||o!==re(this,No))&&Bt(this,pn,fv).call(this,o)}getOptimisticResult(t){const n=re(this,jr).getQueryCache().build(re(this,jr),t),r=this.createResult(n,t);return CL(this,r)&&(Qe(this,Cr,r),Qe(this,dc,this.options),Qe(this,Is,re(this,nn).state)),r}getCurrentResult(){return re(this,Cr)}trackResult(t,n){return new Proxy(t,{get:(r,a)=>(this.trackProp(a),n==null||n(a),a==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&re(this,ja).status==="pending"&&re(this,ja).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,a))})}trackProp(t){re(this,pc).add(t)}getCurrentQuery(){return re(this,nn)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=re(this,jr).defaultQueryOptions(t),r=re(this,jr).getQueryCache().build(re(this,jr),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Bt(this,pn,Wu).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),re(this,Cr)))}createResult(t,n){var q;const r=re(this,nn),a=this.options,o=re(this,Cr),l=re(this,Is),c=re(this,dc),d=t!==r?t.state:re(this,Id),{state:m}=t;let h={...m},y=!1,g;if(n._optimisticResults){const F=this.hasListeners(),W=!F&&CC(t,n),_=F&&TC(t,r,n,a);(W||_)&&(h={...h,...TM(m.data,t.options)}),n._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:w,errorUpdatedAt:C,status:T}=h;g=h.data;let E=!1;if(n.placeholderData!==void 0&&g===void 0&&T==="pending"){let F;o!=null&&o.isPlaceholderData&&n.placeholderData===(c==null?void 0:c.placeholderData)?(F=o.data,E=!0):F=typeof n.placeholderData=="function"?n.placeholderData((q=re(this,hc))==null?void 0:q.state.data,re(this,hc)):n.placeholderData,F!==void 0&&(T="success",g=sv(o==null?void 0:o.data,F,n),y=!0)}if(n.select&&g!==void 0&&!E)if(o&&g===(l==null?void 0:l.data)&&n.select===re(this,Pd))g=re(this,fc);else try{Qe(this,Pd,n.select),g=n.select(g),g=sv(o==null?void 0:o.data,g,n),Qe(this,fc,g),Qe(this,Ao,null)}catch(F){Qe(this,Ao,F)}re(this,Ao)&&(w=re(this,Ao),g=re(this,fc),C=Date.now(),T="error");const R=h.fetchStatus==="fetching",k=T==="pending",M=T==="error",D=k&&R,O=g!==void 0,L={status:T,fetchStatus:h.fetchStatus,isPending:k,isSuccess:T==="success",isError:M,isInitialLoading:D,isLoading:D,data:g,dataUpdatedAt:h.dataUpdatedAt,error:w,errorUpdatedAt:C,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>d.dataUpdateCount||h.errorUpdateCount>d.errorUpdateCount,isFetching:R,isRefetching:R&&!k,isLoadingError:M&&!O,isPaused:h.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:M&&O,isStale:Ix(t,n),refetch:this.refetch,promise:re(this,ja),isEnabled:bi(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const F=L.data!==void 0,W=L.status==="error"&&!F,_=B=>{W?B.reject(L.error):F&&B.resolve(L.data)},V=()=>{const B=Qe(this,ja,L.promise=lv());_(B)},$=re(this,ja);switch($.status){case"pending":t.queryHash===r.queryHash&&_($);break;case"fulfilled":(W||L.data!==$.value)&&V();break;case"rejected":(!W||L.error!==$.reason)&&V();break}}return L}updateResult(){const t=re(this,Cr),n=this.createResult(re(this,nn),this.options);if(Qe(this,Is,re(this,nn).state),Qe(this,dc,this.options),re(this,Is).data!==void 0&&Qe(this,hc,re(this,nn)),gp(n,t))return;Qe(this,Cr,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:a}=this.options,o=typeof a=="function"?a():a;if(o==="all"||!o&&!re(this,pc).size)return!0;const l=new Set(o??re(this,pc));return this.options.throwOnError&&l.add("error"),Object.keys(re(this,Cr)).some(c=>{const f=c;return re(this,Cr)[f]!==t[f]&&l.has(f)})};Bt(this,pn,RM).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Bt(this,pn,hv).call(this)}},jr=new WeakMap,nn=new WeakMap,Id=new WeakMap,Cr=new WeakMap,Is=new WeakMap,dc=new WeakMap,ja=new WeakMap,Ao=new WeakMap,Pd=new WeakMap,fc=new WeakMap,hc=new WeakMap,Ps=new WeakMap,Ls=new WeakMap,No=new WeakMap,pc=new WeakMap,pn=new WeakSet,Wu=function(t){Bt(this,pn,gv).call(this);let n=re(this,nn).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Tr)),n},uv=function(){Bt(this,pn,pv).call(this);const t=Fo(this.options.staleTime,re(this,nn));if(Bs||re(this,Cr).isStale||!av(t))return;const r=vM(re(this,Cr).dataUpdatedAt,t)+1;Qe(this,Ps,Cs.setTimeout(()=>{re(this,Cr).isStale||this.updateResult()},r))},dv=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(re(this,nn)):this.options.refetchInterval)??!1},fv=function(t){Bt(this,pn,mv).call(this),Qe(this,No,t),!(Bs||bi(this.options.enabled,re(this,nn))===!1||!av(re(this,No))||re(this,No)===0)&&Qe(this,Ls,Cs.setInterval(()=>{(this.options.refetchIntervalInBackground||Dx.isFocused())&&Bt(this,pn,Wu).call(this)},re(this,No)))},hv=function(){Bt(this,pn,uv).call(this),Bt(this,pn,fv).call(this,Bt(this,pn,dv).call(this))},pv=function(){re(this,Ps)&&(Cs.clearTimeout(re(this,Ps)),Qe(this,Ps,void 0))},mv=function(){re(this,Ls)&&(Cs.clearInterval(re(this,Ls)),Qe(this,Ls,void 0))},gv=function(){const t=re(this,jr).getQueryCache().build(re(this,jr),this.options);if(t===re(this,nn))return;const n=re(this,nn);Qe(this,nn,t),Qe(this,Id,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},RM=function(t){Xn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(re(this,Cr))}),re(this,jr).getQueryCache().notify({query:re(this,nn),type:"observerResultsUpdated"})})},hM);function EL(e,t){return bi(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function CC(e,t){return EL(e,t)||e.state.data!==void 0&&yv(e,t,t.refetchOnMount)}function yv(e,t,n){if(bi(t.enabled,e)!==!1&&Fo(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Ix(e,t)}return!1}function TC(e,t,n,r){return(e!==t||bi(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Ix(e,n)}function Ix(e,t){return bi(t.enabled,e)!==!1&&e.isStaleByTime(Fo(t.staleTime,e))}function CL(e,t){return!gp(e.getCurrentResult(),t)}function RC(e){return{onFetch:(t,n)=>{var m,h,y,g,w;const r=t.options,a=(y=(h=(m=t.fetchOptions)==null?void 0:m.meta)==null?void 0:h.fetchMore)==null?void 0:y.direction,o=((g=t.state.data)==null?void 0:g.pages)||[],l=((w=t.state.data)==null?void 0:w.pageParams)||[];let c={pages:[],pageParams:[]},f=0;const d=async()=>{let C=!1;const T=k=>{mL(k,()=>t.signal,()=>C=!0)},E=wM(t.options,t.fetchOptions),R=async(k,M,D)=>{if(C)return Promise.reject();if(M==null&&k.pages.length)return Promise.resolve(k);const A=(()=>{const W={client:t.client,queryKey:t.queryKey,pageParam:M,direction:D?"backward":"forward",meta:t.options.meta};return T(W),W})(),L=await E(A),{maxPages:q}=t.options,F=D?pL:hL;return{pages:F(k.pages,L,q),pageParams:F(k.pageParams,M,q)}};if(a&&o.length){const k=a==="backward",M=k?TL:kC,D={pages:o,pageParams:l},O=M(r,D);c=await R(D,O,k)}else{const k=e??o.length;do{const M=f===0?l[0]??r.initialPageParam:kC(r,c);if(f>0&&M==null)break;c=await R(c,M),f++}while(f<k)}return c};t.options.persister?t.fetchFn=()=>{var C,T;return(T=(C=t.options).persister)==null?void 0:T.call(C,d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=d}}}function kC(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function TL(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Ld,Qi,gr,_s,Zi,So,pM,RL=(pM=class extends CM{constructor(t){super();pt(this,Zi);pt(this,Ld);pt(this,Qi);pt(this,gr);pt(this,_s);Qe(this,Ld,t.client),this.mutationId=t.mutationId,Qe(this,gr,t.mutationCache),Qe(this,Qi,[]),this.state=t.state||kM(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){re(this,Qi).includes(t)||(re(this,Qi).push(t),this.clearGcTimeout(),re(this,gr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Qe(this,Qi,re(this,Qi).filter(n=>n!==t)),this.scheduleGc(),re(this,gr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){re(this,Qi).length||(this.state.status==="pending"?this.scheduleGc():re(this,gr).remove(this))}continue(){var t;return((t=re(this,_s))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var l,c,f,d,m,h,y,g,w,C,T,E,R,k,M,D,O,A;const n=()=>{Bt(this,Zi,So).call(this,{type:"continue"})},r={client:re(this,Ld),meta:this.options.meta,mutationKey:this.options.mutationKey};Qe(this,_s,EM({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(L,q)=>{Bt(this,Zi,So).call(this,{type:"failed",failureCount:L,error:q})},onPause:()=>{Bt(this,Zi,So).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>re(this,gr).canRun(this)}));const a=this.state.status==="pending",o=!re(this,_s).canStart();try{if(a)n();else{Bt(this,Zi,So).call(this,{type:"pending",variables:t,isPaused:o}),re(this,gr).config.onMutate&&await re(this,gr).config.onMutate(t,this,r);const q=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t,r));q!==this.state.context&&Bt(this,Zi,So).call(this,{type:"pending",context:q,variables:t,isPaused:o})}const L=await re(this,_s).start();return await((d=(f=re(this,gr).config).onSuccess)==null?void 0:d.call(f,L,t,this.state.context,this,r)),await((h=(m=this.options).onSuccess)==null?void 0:h.call(m,L,t,this.state.context,r)),await((g=(y=re(this,gr).config).onSettled)==null?void 0:g.call(y,L,null,this.state.variables,this.state.context,this,r)),await((C=(w=this.options).onSettled)==null?void 0:C.call(w,L,null,t,this.state.context,r)),Bt(this,Zi,So).call(this,{type:"success",data:L}),L}catch(L){try{await((E=(T=re(this,gr).config).onError)==null?void 0:E.call(T,L,t,this.state.context,this,r))}catch(q){Promise.reject(q)}try{await((k=(R=this.options).onError)==null?void 0:k.call(R,L,t,this.state.context,r))}catch(q){Promise.reject(q)}try{await((D=(M=re(this,gr).config).onSettled)==null?void 0:D.call(M,void 0,L,this.state.variables,this.state.context,this,r))}catch(q){Promise.reject(q)}try{await((A=(O=this.options).onSettled)==null?void 0:A.call(O,void 0,L,t,this.state.context,r))}catch(q){Promise.reject(q)}throw Bt(this,Zi,So).call(this,{type:"error",error:L}),L}finally{re(this,gr).runNext(this)}}},Ld=new WeakMap,Qi=new WeakMap,gr=new WeakMap,_s=new WeakMap,Zi=new WeakSet,So=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Xn.batch(()=>{re(this,Qi).forEach(r=>{r.onMutationUpdate(t)}),re(this,gr).notify({mutation:this,type:"updated",action:t})})},pM);function kM(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var za,_i,_d,mM,kL=(mM=class extends Mc{constructor(t={}){super();pt(this,za);pt(this,_i);pt(this,_d);this.config=t,Qe(this,za,new Set),Qe(this,_i,new Map),Qe(this,_d,0)}build(t,n,r){const a=new RL({client:t,mutationCache:this,mutationId:++xh(this,_d)._,options:t.defaultMutationOptions(n),state:r});return this.add(a),a}add(t){re(this,za).add(t);const n=wh(t);if(typeof n=="string"){const r=re(this,_i).get(n);r?r.push(t):re(this,_i).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(re(this,za).delete(t)){const n=wh(t);if(typeof n=="string"){const r=re(this,_i).get(n);if(r)if(r.length>1){const a=r.indexOf(t);a!==-1&&r.splice(a,1)}else r[0]===t&&re(this,_i).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=wh(t);if(typeof n=="string"){const r=re(this,_i).get(n),a=r==null?void 0:r.find(o=>o.state.status==="pending");return!a||a===t}else return!0}runNext(t){var r;const n=wh(t);if(typeof n=="string"){const a=(r=re(this,_i).get(n))==null?void 0:r.find(o=>o!==t&&o.state.isPaused);return(a==null?void 0:a.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Xn.batch(()=>{re(this,za).forEach(t=>{this.notify({type:"removed",mutation:t})}),re(this,za).clear(),re(this,_i).clear()})}getAll(){return Array.from(re(this,za))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>vC(n,r))}findAll(t={}){return this.getAll().filter(n=>vC(t,n))}notify(t){Xn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Xn.batch(()=>Promise.all(t.map(n=>n.continue().catch(Tr))))}},za=new WeakMap,_i=new WeakMap,_d=new WeakMap,mM);function wh(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Fa,Do,zr,Ba,Ua,Xh,bv,gM,ML=(gM=class extends Mc{constructor(n,r){super();pt(this,Ua);pt(this,Fa);pt(this,Do);pt(this,zr);pt(this,Ba);Qe(this,Fa,n),this.setOptions(r),this.bindMethods(),Bt(this,Ua,Xh).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var a;const r=this.options;this.options=re(this,Fa).defaultMutationOptions(n),gp(this.options,r)||re(this,Fa).getMutationCache().notify({type:"observerOptionsUpdated",mutation:re(this,zr),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Hs(r.mutationKey)!==Hs(this.options.mutationKey)?this.reset():((a=re(this,zr))==null?void 0:a.state.status)==="pending"&&re(this,zr).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=re(this,zr))==null||n.removeObserver(this)}onMutationUpdate(n){Bt(this,Ua,Xh).call(this),Bt(this,Ua,bv).call(this,n)}getCurrentResult(){return re(this,Do)}reset(){var n;(n=re(this,zr))==null||n.removeObserver(this),Qe(this,zr,void 0),Bt(this,Ua,Xh).call(this),Bt(this,Ua,bv).call(this)}mutate(n,r){var a;return Qe(this,Ba,r),(a=re(this,zr))==null||a.removeObserver(this),Qe(this,zr,re(this,Fa).getMutationCache().build(re(this,Fa),this.options)),re(this,zr).addObserver(this),re(this,zr).execute(n)}},Fa=new WeakMap,Do=new WeakMap,zr=new WeakMap,Ba=new WeakMap,Ua=new WeakSet,Xh=function(){var r;const n=((r=re(this,zr))==null?void 0:r.state)??kM();Qe(this,Do,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},bv=function(n){Xn.batch(()=>{var r,a,o,l,c,f,d,m;if(re(this,Ba)&&this.hasListeners()){const h=re(this,Do).variables,y=re(this,Do).context,g={client:re(this,Fa),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(a=(r=re(this,Ba)).onSuccess)==null||a.call(r,n.data,h,y,g)}catch(w){Promise.reject(w)}try{(l=(o=re(this,Ba)).onSettled)==null||l.call(o,n.data,null,h,y,g)}catch(w){Promise.reject(w)}}else if((n==null?void 0:n.type)==="error"){try{(f=(c=re(this,Ba)).onError)==null||f.call(c,n.error,h,y,g)}catch(w){Promise.reject(w)}try{(m=(d=re(this,Ba)).onSettled)==null||m.call(d,void 0,n.error,h,y,g)}catch(w){Promise.reject(w)}}}this.listeners.forEach(h=>{h(re(this,Do))})})},gM),Ji,yM,OL=(yM=class extends Mc{constructor(t={}){super();pt(this,Ji);this.config=t,Qe(this,Ji,new Map)}build(t,n,r){const a=n.queryKey,o=n.queryHash??Ox(a,n);let l=this.get(o);return l||(l=new wL({client:t,queryKey:a,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(a)}),this.add(l)),l}add(t){re(this,Ji).has(t.queryHash)||(re(this,Ji).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=re(this,Ji).get(t.queryHash);n&&(t.destroy(),n===t&&re(this,Ji).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Xn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return re(this,Ji).get(t)}getAll(){return[...re(this,Ji).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>bC(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>bC(t,r)):n}notify(t){Xn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Xn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Xn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Ji=new WeakMap,yM),zn,Io,Po,mc,gc,Lo,yc,bc,bM,AL=(bM=class{constructor(e={}){pt(this,zn);pt(this,Io);pt(this,Po);pt(this,mc);pt(this,gc);pt(this,Lo);pt(this,yc);pt(this,bc);Qe(this,zn,e.queryCache||new OL),Qe(this,Io,e.mutationCache||new kL),Qe(this,Po,e.defaultOptions||{}),Qe(this,mc,new Map),Qe(this,gc,new Map),Qe(this,Lo,0)}mount(){xh(this,Lo)._++,re(this,Lo)===1&&(Qe(this,yc,Dx.subscribe(async e=>{e&&(await this.resumePausedMutations(),re(this,zn).onFocus())})),Qe(this,bc,yp.subscribe(async e=>{e&&(await this.resumePausedMutations(),re(this,zn).onOnline())})))}unmount(){var e,t;xh(this,Lo)._--,re(this,Lo)===0&&((e=re(this,yc))==null||e.call(this),Qe(this,yc,void 0),(t=re(this,bc))==null||t.call(this),Qe(this,bc,void 0))}isFetching(e){return re(this,zn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return re(this,Io).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=re(this,zn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=re(this,zn).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Fo(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return re(this,zn).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),a=re(this,zn).get(r.queryHash),o=a==null?void 0:a.state.data,l=uL(t,o);if(l!==void 0)return re(this,zn).build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return Xn.batch(()=>re(this,zn).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=re(this,zn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=re(this,zn);Xn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=re(this,zn);return Xn.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Xn.batch(()=>re(this,zn).findAll(e).map(a=>a.cancel(n)));return Promise.all(r).then(Tr).catch(Tr)}invalidateQueries(e,t={}){return Xn.batch(()=>(re(this,zn).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Xn.batch(()=>re(this,zn).findAll(e).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let o=a.fetch(void 0,n);return n.throwOnError||(o=o.catch(Tr)),a.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Tr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=re(this,zn).build(this,t);return n.isStaleByTime(Fo(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Tr).catch(Tr)}fetchInfiniteQuery(e){return e.behavior=RC(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Tr).catch(Tr)}ensureInfiniteQueryData(e){return e.behavior=RC(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return yp.isOnline()?re(this,Io).resumePausedMutations():Promise.resolve()}getQueryCache(){return re(this,zn)}getMutationCache(){return re(this,Io)}getDefaultOptions(){return re(this,Po)}setDefaultOptions(e){Qe(this,Po,e)}setQueryDefaults(e,t){re(this,mc).set(Hs(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...re(this,mc).values()],n={};return t.forEach(r=>{gd(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){re(this,gc).set(Hs(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...re(this,gc).values()],n={};return t.forEach(r=>{gd(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...re(this,Po).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Ox(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===Ax&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...re(this,Po).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){re(this,zn).clear(),re(this,Io).clear()}},zn=new WeakMap,Io=new WeakMap,Po=new WeakMap,mc=new WeakMap,gc=new WeakMap,Lo=new WeakMap,yc=new WeakMap,bc=new WeakMap,bM),Vy={exports:{}},Pt={};/**
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 MC;function NL(){if(MC)return Pt;MC=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),h=Symbol.for("react.activity"),y=Symbol.iterator;function g(U){return U===null||typeof U!="object"?null:(U=y&&U[y]||U["@@iterator"],typeof U=="function"?U:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,T={};function E(U,G,I){this.props=U,this.context=G,this.refs=T,this.updater=I||w}E.prototype.isReactComponent={},E.prototype.setState=function(U,G){if(typeof U!="object"&&typeof U!="function"&&U!=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,U,G,"setState")},E.prototype.forceUpdate=function(U){this.updater.enqueueForceUpdate(this,U,"forceUpdate")};function R(){}R.prototype=E.prototype;function k(U,G,I){this.props=U,this.context=G,this.refs=T,this.updater=I||w}var M=k.prototype=new R;M.constructor=k,C(M,E.prototype),M.isPureReactComponent=!0;var D=Array.isArray;function O(){}var A={H:null,A:null,T:null,S:null},L=Object.prototype.hasOwnProperty;function q(U,G,I){var Q=I.ref;return{$$typeof:e,type:U,key:G,ref:Q!==void 0?Q:null,props:I}}function F(U,G){return q(U.type,G,U.props)}function W(U){return typeof U=="object"&&U!==null&&U.$$typeof===e}function _(U){var G={"=":"=0",":":"=2"};return"$"+U.replace(/[=:]/g,function(I){return G[I]})}var V=/\/+/g;function $(U,G){return typeof U=="object"&&U!==null&&U.key!=null?_(""+U.key):G.toString(36)}function B(U){switch(U.status){case"fulfilled":return U.value;case"rejected":throw U.reason;default:switch(typeof U.status=="string"?U.then(O,O):(U.status="pending",U.then(function(G){U.status==="pending"&&(U.status="fulfilled",U.value=G)},function(G){U.status==="pending"&&(U.status="rejected",U.reason=G)})),U.status){case"fulfilled":return U.value;case"rejected":throw U.reason}}throw U}function j(U,G,I,Q,le){var ae=typeof U;(ae==="undefined"||ae==="boolean")&&(U=null);var Z=!1;if(U===null)Z=!0;else switch(ae){case"bigint":case"string":case"number":Z=!0;break;case"object":switch(U.$$typeof){case e:case t:Z=!0;break;case m:return Z=U._init,j(Z(U._payload),G,I,Q,le)}}if(Z)return le=le(U),Z=Q===""?"."+$(U,0):Q,D(le)?(I="",Z!=null&&(I=Z.replace(V,"$&/")+"/"),j(le,G,I,"",function(Se){return Se})):le!=null&&(W(le)&&(le=F(le,I+(le.key==null||U&&U.key===le.key?"":(""+le.key).replace(V,"$&/")+"/")+Z)),G.push(le)),1;Z=0;var ue=Q===""?".":Q+":";if(D(U))for(var ve=0;ve<U.length;ve++)Q=U[ve],ae=ue+$(Q,ve),Z+=j(Q,G,I,ae,le);else if(ve=g(U),typeof ve=="function")for(U=ve.call(U),ve=0;!(Q=U.next()).done;)Q=Q.value,ae=ue+$(Q,ve++),Z+=j(Q,G,I,ae,le);else if(ae==="object"){if(typeof U.then=="function")return j(B(U),G,I,Q,le);throw G=String(U),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(U).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return Z}function z(U,G,I){if(U==null)return U;var Q=[],le=0;return j(U,Q,"","",function(ae){return G.call(I,ae,le++)}),Q}function H(U){if(U._status===-1){var G=U._result;G=G(),G.then(function(I){(U._status===0||U._status===-1)&&(U._status=1,U._result=I)},function(I){(U._status===0||U._status===-1)&&(U._status=2,U._result=I)}),U._status===-1&&(U._status=0,U._result=G)}if(U._status===1)return U._result.default;throw U._result}var K=typeof reportError=="function"?reportError:function(U){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof U=="object"&&U!==null&&typeof U.message=="string"?String(U.message):String(U),error:U});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",U);return}console.error(U)},P={map:z,forEach:function(U,G,I){z(U,function(){G.apply(this,arguments)},I)},count:function(U){var G=0;return z(U,function(){G++}),G},toArray:function(U){return z(U,function(G){return G})||[]},only:function(U){if(!W(U))throw Error("React.Children.only expected to receive a single React element child.");return U}};return Pt.Activity=h,Pt.Children=P,Pt.Component=E,Pt.Fragment=n,Pt.Profiler=a,Pt.PureComponent=k,Pt.StrictMode=r,Pt.Suspense=f,Pt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=A,Pt.__COMPILER_RUNTIME={__proto__:null,c:function(U){return A.H.useMemoCache(U)}},Pt.cache=function(U){return function(){return U.apply(null,arguments)}},Pt.cacheSignal=function(){return null},Pt.cloneElement=function(U,G,I){if(U==null)throw Error("The argument must be a React element, but you passed "+U+".");var Q=C({},U.props),le=U.key;if(G!=null)for(ae in G.key!==void 0&&(le=""+G.key),G)!L.call(G,ae)||ae==="key"||ae==="__self"||ae==="__source"||ae==="ref"&&G.ref===void 0||(Q[ae]=G[ae]);var ae=arguments.length-2;if(ae===1)Q.children=I;else if(1<ae){for(var Z=Array(ae),ue=0;ue<ae;ue++)Z[ue]=arguments[ue+2];Q.children=Z}return q(U.type,le,Q)},Pt.createContext=function(U){return U={$$typeof:l,_currentValue:U,_currentValue2:U,_threadCount:0,Provider:null,Consumer:null},U.Provider=U,U.Consumer={$$typeof:o,_context:U},U},Pt.createElement=function(U,G,I){var Q,le={},ae=null;if(G!=null)for(Q in G.key!==void 0&&(ae=""+G.key),G)L.call(G,Q)&&Q!=="key"&&Q!=="__self"&&Q!=="__source"&&(le[Q]=G[Q]);var Z=arguments.length-2;if(Z===1)le.children=I;else if(1<Z){for(var ue=Array(Z),ve=0;ve<Z;ve++)ue[ve]=arguments[ve+2];le.children=ue}if(U&&U.defaultProps)for(Q in Z=U.defaultProps,Z)le[Q]===void 0&&(le[Q]=Z[Q]);return q(U,ae,le)},Pt.createRef=function(){return{current:null}},Pt.forwardRef=function(U){return{$$typeof:c,render:U}},Pt.isValidElement=W,Pt.lazy=function(U){return{$$typeof:m,_payload:{_status:-1,_result:U},_init:H}},Pt.memo=function(U,G){return{$$typeof:d,type:U,compare:G===void 0?null:G}},Pt.startTransition=function(U){var G=A.T,I={};A.T=I;try{var Q=U(),le=A.S;le!==null&&le(I,Q),typeof Q=="object"&&Q!==null&&typeof Q.then=="function"&&Q.then(O,K)}catch(ae){K(ae)}finally{G!==null&&I.types!==null&&(G.types=I.types),A.T=G}},Pt.unstable_useCacheRefresh=function(){return A.H.useCacheRefresh()},Pt.use=function(U){return A.H.use(U)},Pt.useActionState=function(U,G,I){return A.H.useActionState(U,G,I)},Pt.useCallback=function(U,G){return A.H.useCallback(U,G)},Pt.useContext=function(U){return A.H.useContext(U)},Pt.useDebugValue=function(){},Pt.useDeferredValue=function(U,G){return A.H.useDeferredValue(U,G)},Pt.useEffect=function(U,G){return A.H.useEffect(U,G)},Pt.useEffectEvent=function(U){return A.H.useEffectEvent(U)},Pt.useId=function(){return A.H.useId()},Pt.useImperativeHandle=function(U,G,I){return A.H.useImperativeHandle(U,G,I)},Pt.useInsertionEffect=function(U,G){return A.H.useInsertionEffect(U,G)},Pt.useLayoutEffect=function(U,G){return A.H.useLayoutEffect(U,G)},Pt.useMemo=function(U,G){return A.H.useMemo(U,G)},Pt.useOptimistic=function(U,G){return A.H.useOptimistic(U,G)},Pt.useReducer=function(U,G,I){return A.H.useReducer(U,G,I)},Pt.useRef=function(U){return A.H.useRef(U)},Pt.useState=function(U){return A.H.useState(U)},Pt.useSyncExternalStore=function(U,G,I){return A.H.useSyncExternalStore(U,G,I)},Pt.useTransition=function(){return A.H.useTransition()},Pt.version="19.2.4",Pt}var OC;function jd(){return OC||(OC=1,Vy.exports=NL()),Vy.exports}var v=jd();const Fe=Gp(v),Px=nL({__proto__:null,default:Fe},[v]);var MM=v.createContext(void 0),el=e=>{const t=v.useContext(MM);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},DL=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),S.jsx(MM.Provider,{value:e,children:t})),OM=v.createContext(!1),IL=()=>v.useContext(OM);OM.Provider;function PL(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var LL=v.createContext(PL()),_L=()=>v.useContext(LL),jL=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?Nx(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},zL=e=>{v.useEffect(()=>{e.clearReset()},[e])},FL=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(a&&e.data===void 0||Nx(n,[e.error,r])),BL=e=>{if(e.suspense){const n=a=>a==="static"?a:Math.max(a??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...a)=>n(r(...a)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},HL=(e,t)=>e.isLoading&&e.isFetching&&!t,UL=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,AC=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function qL(e,t,n){var y,g,w,C;const r=IL(),a=_L(),o=el(),l=o.defaultQueryOptions(e);(g=(y=o.getDefaultOptions().queries)==null?void 0:y._experimental_beforeQuery)==null||g.call(y,l);const c=o.getQueryCache().get(l.queryHash);l._optimisticResults=r?"isRestoring":"optimistic",BL(l),jL(l,a,c),zL(a);const f=!o.getQueryCache().get(l.queryHash),[d]=v.useState(()=>new t(o,l)),m=d.getOptimisticResult(l),h=!r&&e.subscribed!==!1;if(v.useSyncExternalStore(v.useCallback(T=>{const E=h?d.subscribe(Xn.batchCalls(T)):Tr;return d.updateResult(),E},[d,h]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),v.useEffect(()=>{d.setOptions(l)},[l,d]),UL(l,m))throw AC(l,d,a);if(FL({result:m,errorResetBoundary:a,throwOnError:l.throwOnError,query:c,suspense:l.suspense}))throw m.error;if((C=(w=o.getDefaultOptions().queries)==null?void 0:w._experimental_afterQuery)==null||C.call(w,l,m),l.experimental_prefetchInRender&&!Bs&&HL(m,r)){const T=f?AC(l,d,a):c==null?void 0:c.promise;T==null||T.catch(Tr).finally(()=>{d.updateResult()})}return l.notifyOnChangeProps?m:d.trackResult(m)}function Ei(e,t){return qL(e,SL)}function VL(e,t){const n=el(),r=n.getQueryCache();return v.useSyncExternalStore(v.useCallback(a=>r.subscribe(Xn.batchCalls(a)),[r]),()=>n.isFetching(e),()=>n.isFetching(e))}function yd(e,t){const n=el(),[r]=v.useState(()=>new ML(n,e));v.useEffect(()=>{r.setOptions(e)},[r,e]);const a=v.useSyncExternalStore(v.useCallback(l=>r.subscribe(Xn.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=v.useCallback((l,c)=>{r.mutate(l,c).catch(Tr)},[r]);if(a.error&&Nx(r.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:o,mutateAsync:a.mutate}}var $y={exports:{}},Du={},Yy={exports:{}},Wy={};/**
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 NC;function $L(){return NC||(NC=1,(function(e){function t(j,z){var H=j.length;j.push(z);e:for(;0<H;){var K=H-1>>>1,P=j[K];if(0<a(P,z))j[K]=z,j[H]=P,H=K;else break e}}function n(j){return j.length===0?null:j[0]}function r(j){if(j.length===0)return null;var z=j[0],H=j.pop();if(H!==z){j[0]=H;e:for(var K=0,P=j.length,U=P>>>1;K<U;){var G=2*(K+1)-1,I=j[G],Q=G+1,le=j[Q];if(0>a(I,H))Q<P&&0>a(le,I)?(j[K]=le,j[Q]=H,K=Q):(j[K]=I,j[G]=H,K=G);else if(Q<P&&0>a(le,H))j[K]=le,j[Q]=H,K=Q;else break e}}return z}function a(j,z){var H=j.sortIndex-z.sortIndex;return H!==0?H:j.id-z.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var l=Date,c=l.now();e.unstable_now=function(){return l.now()-c}}var f=[],d=[],m=1,h=null,y=3,g=!1,w=!1,C=!1,T=!1,E=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function M(j){for(var z=n(d);z!==null;){if(z.callback===null)r(d);else if(z.startTime<=j)r(d),z.sortIndex=z.expirationTime,t(f,z);else break;z=n(d)}}function D(j){if(C=!1,M(j),!w)if(n(f)!==null)w=!0,O||(O=!0,_());else{var z=n(d);z!==null&&B(D,z.startTime-j)}}var O=!1,A=-1,L=5,q=-1;function F(){return T?!0:!(e.unstable_now()-q<L)}function W(){if(T=!1,O){var j=e.unstable_now();q=j;var z=!0;try{e:{w=!1,C&&(C=!1,R(A),A=-1),g=!0;var H=y;try{t:{for(M(j),h=n(f);h!==null&&!(h.expirationTime>j&&F());){var K=h.callback;if(typeof K=="function"){h.callback=null,y=h.priorityLevel;var P=K(h.expirationTime<=j);if(j=e.unstable_now(),typeof P=="function"){h.callback=P,M(j),z=!0;break t}h===n(f)&&r(f),M(j)}else r(f);h=n(f)}if(h!==null)z=!0;else{var U=n(d);U!==null&&B(D,U.startTime-j),z=!1}}break e}finally{h=null,y=H,g=!1}z=void 0}}finally{z?_():O=!1}}}var _;if(typeof k=="function")_=function(){k(W)};else if(typeof MessageChannel<"u"){var V=new MessageChannel,$=V.port2;V.port1.onmessage=W,_=function(){$.postMessage(null)}}else _=function(){E(W,0)};function B(j,z){A=E(function(){j(e.unstable_now())},z)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(j){j.callback=null},e.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<j?Math.floor(1e3/j):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(j){switch(y){case 1:case 2:case 3:var z=3;break;default:z=y}var H=y;y=z;try{return j()}finally{y=H}},e.unstable_requestPaint=function(){T=!0},e.unstable_runWithPriority=function(j,z){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var H=y;y=j;try{return z()}finally{y=H}},e.unstable_scheduleCallback=function(j,z,H){var K=e.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?K+H:K):H=K,j){case 1:var P=-1;break;case 2:P=250;break;case 5:P=1073741823;break;case 4:P=1e4;break;default:P=5e3}return P=H+P,j={id:m++,callback:z,priorityLevel:j,startTime:H,expirationTime:P,sortIndex:-1},H>K?(j.sortIndex=H,t(d,j),n(f)===null&&j===n(d)&&(C?(R(A),A=-1):C=!0,B(D,H-K))):(j.sortIndex=P,t(f,j),w||g||(w=!0,O||(O=!0,_()))),j},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(j){var z=y;return function(){var H=y;y=z;try{return j.apply(this,arguments)}finally{y=H}}}})(Wy)),Wy}var DC;function YL(){return DC||(DC=1,Yy.exports=$L()),Yy.exports}var Ky={exports:{}},mr={};/**
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 IC;function WL(){if(IC)return mr;IC=1;var e=jd();function t(f){var d="https://react.dev/errors/"+f;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)d+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+f+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},a=Symbol.for("react.portal");function o(f,d,m){var h=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:h==null?null:""+h,children:f,containerInfo:d,implementation:m}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(f,d){if(f==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return mr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,mr.createPortal=function(f,d){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(t(299));return o(f,d,null,m)},mr.flushSync=function(f){var d=l.T,m=r.p;try{if(l.T=null,r.p=2,f)return f()}finally{l.T=d,r.p=m,r.d.f()}},mr.preconnect=function(f,d){typeof f=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,r.d.C(f,d))},mr.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},mr.preinit=function(f,d){if(typeof f=="string"&&d&&typeof d.as=="string"){var m=d.as,h=c(m,d.crossOrigin),y=typeof d.integrity=="string"?d.integrity:void 0,g=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;m==="style"?r.d.S(f,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:h,integrity:y,fetchPriority:g}):m==="script"&&r.d.X(f,{crossOrigin:h,integrity:y,fetchPriority:g,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},mr.preinitModule=function(f,d){if(typeof f=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var m=c(d.as,d.crossOrigin);r.d.M(f,{crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&r.d.M(f)},mr.preload=function(f,d){if(typeof f=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var m=d.as,h=c(m,d.crossOrigin);r.d.L(f,m,{crossOrigin:h,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},mr.preloadModule=function(f,d){if(typeof f=="string")if(d){var m=c(d.as,d.crossOrigin);r.d.m(f,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else r.d.m(f)},mr.requestFormReset=function(f){r.d.r(f)},mr.unstable_batchedUpdates=function(f,d){return f(d)},mr.useFormState=function(f,d,m){return l.H.useFormState(f,d,m)},mr.useFormStatus=function(){return l.H.useHostTransitionStatus()},mr.version="19.2.4",mr}var PC;function AM(){if(PC)return Ky.exports;PC=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(),Ky.exports=WL(),Ky.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 LC;function KL(){if(LC)return Du;LC=1;var e=YL(),t=jd(),n=AM();function r(i){var s="https://react.dev/errors/"+i;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)s+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+i+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function o(i){var s=i,u=i;if(i.alternate)for(;s.return;)s=s.return;else{i=s;do s=i,(s.flags&4098)!==0&&(u=s.return),i=s.return;while(i)}return s.tag===3?u:null}function l(i){if(i.tag===13){var s=i.memoizedState;if(s===null&&(i=i.alternate,i!==null&&(s=i.memoizedState)),s!==null)return s.dehydrated}return null}function c(i){if(i.tag===31){var s=i.memoizedState;if(s===null&&(i=i.alternate,i!==null&&(s=i.memoizedState)),s!==null)return s.dehydrated}return null}function f(i){if(o(i)!==i)throw Error(r(188))}function d(i){var s=i.alternate;if(!s){if(s=o(i),s===null)throw Error(r(188));return s!==i?null:i}for(var u=i,p=s;;){var b=u.return;if(b===null)break;var x=b.alternate;if(x===null){if(p=b.return,p!==null){u=p;continue}break}if(b.child===x.child){for(x=b.child;x;){if(x===u)return f(b),i;if(x===p)return f(b),s;x=x.sibling}throw Error(r(188))}if(u.return!==p.return)u=b,p=x;else{for(var N=!1,Y=b.child;Y;){if(Y===u){N=!0,u=b,p=x;break}if(Y===p){N=!0,p=b,u=x;break}Y=Y.sibling}if(!N){for(Y=x.child;Y;){if(Y===u){N=!0,u=x,p=b;break}if(Y===p){N=!0,p=x,u=b;break}Y=Y.sibling}if(!N)throw Error(r(189))}}if(u.alternate!==p)throw Error(r(190))}if(u.tag!==3)throw Error(r(188));return u.stateNode.current===u?i:s}function m(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i;for(i=i.child;i!==null;){if(s=m(i),s!==null)return s;i=i.sibling}return null}var h=Object.assign,y=Symbol.for("react.element"),g=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),k=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),q=Symbol.for("react.activity"),F=Symbol.for("react.memo_cache_sentinel"),W=Symbol.iterator;function _(i){return i===null||typeof i!="object"?null:(i=W&&i[W]||i["@@iterator"],typeof i=="function"?i:null)}var V=Symbol.for("react.client.reference");function $(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===V?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case C:return"Fragment";case E:return"Profiler";case T:return"StrictMode";case D:return"Suspense";case O:return"SuspenseList";case q:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case w:return"Portal";case k:return i.displayName||"Context";case R:return(i._context.displayName||"Context")+".Consumer";case M:var s=i.render;return i=i.displayName,i||(i=s.displayName||s.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case A:return s=i.displayName||null,s!==null?s:$(i.type)||"Memo";case L:s=i._payload,i=i._init;try{return $(i(s))}catch{}}return null}var B=Array.isArray,j=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H={pending:!1,data:null,method:null,action:null},K=[],P=-1;function U(i){return{current:i}}function G(i){0>P||(i.current=K[P],K[P]=null,P--)}function I(i,s){P++,K[P]=i.current,i.current=s}var Q=U(null),le=U(null),ae=U(null),Z=U(null);function ue(i,s){switch(I(ae,s),I(le,i),I(Q,null),s.nodeType){case 9:case 11:i=(i=s.documentElement)&&(i=i.namespaceURI)?jE(i):0;break;default:if(i=s.tagName,s=s.namespaceURI)s=jE(s),i=zE(s,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}G(Q),I(Q,i)}function ve(){G(Q),G(le),G(ae)}function Se(i){i.memoizedState!==null&&I(Z,i);var s=Q.current,u=zE(s,i.type);s!==u&&(I(le,i),I(Q,u))}function Le(i){le.current===i&&(G(Q),G(le)),Z.current===i&&(G(Z),ku._currentValue=H)}var te,he;function ye(i){if(te===void 0)try{throw Error()}catch(u){var s=u.stack.trim().match(/\n( *(at )?)/);te=s&&s[1]||"",he=-1<u.stack.indexOf(`
43
+ at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
44
+ `+te+i+he}var _e=!1;function Oe(i,s){if(!i||_e)return"";_e=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var p={DetermineComponentFrameRoot:function(){try{if(s){var Ie=function(){throw Error()};if(Object.defineProperty(Ie.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ie,[])}catch(we){var be=we}Reflect.construct(i,[],Ie)}else{try{Ie.call()}catch(we){be=we}i.call(Ie.prototype)}}else{try{throw Error()}catch(we){be=we}(Ie=i())&&typeof Ie.catch=="function"&&Ie.catch(function(){})}}catch(we){if(we&&be&&typeof we.stack=="string")return[we.stack,be.stack]}return[null,null]}};p.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var b=Object.getOwnPropertyDescriptor(p.DetermineComponentFrameRoot,"name");b&&b.configurable&&Object.defineProperty(p.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=p.DetermineComponentFrameRoot(),N=x[0],Y=x[1];if(N&&Y){var ne=N.split(`
45
+ `),ge=Y.split(`
46
+ `);for(b=p=0;p<ne.length&&!ne[p].includes("DetermineComponentFrameRoot");)p++;for(;b<ge.length&&!ge[b].includes("DetermineComponentFrameRoot");)b++;if(p===ne.length||b===ge.length)for(p=ne.length-1,b=ge.length-1;1<=p&&0<=b&&ne[p]!==ge[b];)b--;for(;1<=p&&0<=b;p--,b--)if(ne[p]!==ge[b]){if(p!==1||b!==1)do if(p--,b--,0>b||ne[p]!==ge[b]){var Me=`
47
+ `+ne[p].replace(" at new "," at ");return i.displayName&&Me.includes("<anonymous>")&&(Me=Me.replace("<anonymous>",i.displayName)),Me}while(1<=p&&0<=b);break}}}finally{_e=!1,Error.prepareStackTrace=u}return(u=i?i.displayName||i.name:"")?ye(u):""}function Ce(i,s){switch(i.tag){case 26:case 27:case 5:return ye(i.type);case 16:return ye("Lazy");case 13:return i.child!==s&&s!==null?ye("Suspense Fallback"):ye("Suspense");case 19:return ye("SuspenseList");case 0:case 15:return Oe(i.type,!1);case 11:return Oe(i.type.render,!1);case 1:return Oe(i.type,!0);case 31:return ye("Activity");default:return""}}function Re(i){try{var s="",u=null;do s+=Ce(i,u),u=i,i=i.return;while(i);return s}catch(p){return`
48
+ Error generating stack: `+p.message+`
49
+ `+p.stack}}var J=Object.prototype.hasOwnProperty,Ee=e.unstable_scheduleCallback,xe=e.unstable_cancelCallback,Be=e.unstable_shouldYield,Ve=e.unstable_requestPaint,De=e.unstable_now,ut=e.unstable_getCurrentPriorityLevel,pe=e.unstable_ImmediatePriority,Te=e.unstable_UserBlockingPriority,ee=e.unstable_NormalPriority,fe=e.unstable_LowPriority,Ae=e.unstable_IdlePriority,He=e.log,$e=e.unstable_setDisableYieldValue,et=null,ze=null;function Ze(i){if(typeof He=="function"&&$e(i),ze&&typeof ze.setStrictMode=="function")try{ze.setStrictMode(et,i)}catch{}}var tt=Math.clz32?Math.clz32:yt,Tt=Math.log,zt=Math.LN2;function yt(i){return i>>>=0,i===0?32:31-(Tt(i)/zt|0)|0}var At=256,it=262144,ft=4194304;function bt(i){var s=i&42;if(s!==0)return s;switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function Ke(i,s,u){var p=i.pendingLanes;if(p===0)return 0;var b=0,x=i.suspendedLanes,N=i.pingedLanes;i=i.warmLanes;var Y=p&134217727;return Y!==0?(p=Y&~x,p!==0?b=bt(p):(N&=Y,N!==0?b=bt(N):u||(u=Y&~i,u!==0&&(b=bt(u))))):(Y=p&~x,Y!==0?b=bt(Y):N!==0?b=bt(N):u||(u=p&~i,u!==0&&(b=bt(u)))),b===0?0:s!==0&&s!==b&&(s&x)===0&&(x=b&-b,u=s&-s,x>=u||x===32&&(u&4194048)!==0)?s:b}function kt(i,s){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&s)===0}function _t(i,s){switch(i){case 1:case 2:case 4:case 8:case 64:return s+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 s+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 Rt(){var i=ft;return ft<<=1,(ft&62914560)===0&&(ft=4194304),i}function dn(i){for(var s=[],u=0;31>u;u++)s.push(i);return s}function Ut(i,s){i.pendingLanes|=s,s!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function Je(i,s,u,p,b,x){var N=i.pendingLanes;i.pendingLanes=u,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=u,i.entangledLanes&=u,i.errorRecoveryDisabledLanes&=u,i.shellSuspendCounter=0;var Y=i.entanglements,ne=i.expirationTimes,ge=i.hiddenUpdates;for(u=N&~u;0<u;){var Me=31-tt(u),Ie=1<<Me;Y[Me]=0,ne[Me]=-1;var be=ge[Me];if(be!==null)for(ge[Me]=null,Me=0;Me<be.length;Me++){var we=be[Me];we!==null&&(we.lane&=-536870913)}u&=~Ie}p!==0&&Mt(i,p,0),x!==0&&b===0&&i.tag!==0&&(i.suspendedLanes|=x&~(N&~s))}function Mt(i,s,u){i.pendingLanes|=s,i.suspendedLanes&=~s;var p=31-tt(s);i.entangledLanes|=s,i.entanglements[p]=i.entanglements[p]|1073741824|u&261930}function X(i,s){var u=i.entangledLanes|=s;for(i=i.entanglements;u;){var p=31-tt(u),b=1<<p;b&s|i[p]&s&&(i[p]|=s),u&=~b}}function ie(i,s){var u=s&-s;return u=(u&42)!==0?1:de(u),(u&(i.suspendedLanes|s))!==0?0:u}function de(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function ke(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function je(){var i=z.p;return i!==0?i:(i=window.event,i===void 0?32:sC(i.type))}function rt(i,s){var u=z.p;try{return z.p=i,s()}finally{z.p=u}}var nt=Math.random().toString(36).slice(2),We="__reactFiber$"+nt,Xe="__reactProps$"+nt,ot="__reactContainer$"+nt,Et="__reactEvents$"+nt,ht="__reactListeners$"+nt,Lt="__reactHandles$"+nt,$t="__reactResources$"+nt,Nn="__reactMarker$"+nt;function Pn(i){delete i[We],delete i[Xe],delete i[Et],delete i[ht],delete i[Lt]}function Ln(i){var s=i[We];if(s)return s;for(var u=i.parentNode;u;){if(s=u[ot]||u[We]){if(u=s.alternate,s.child!==null||u!==null&&u.child!==null)for(i=$E(i);i!==null;){if(u=i[We])return u;i=$E(i)}return s}i=u,u=i.parentNode}return null}function Zt(i){if(i=i[We]||i[ot]){var s=i.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return i}return null}function rr(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i.stateNode;throw Error(r(33))}function Or(i){var s=i[$t];return s||(s=i[$t]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function On(i){i[Nn]=!0}var ki=new Set,$r={};function Mi(i,s){oi(i,s),oi(i+"Capture",s)}function oi(i,s){for($r[i]=s,i=0;i<s.length;i++)ki.add(s[i])}var ha=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]*$"),es={},ts={};function Jt(i){return J.call(ts,i)?!0:J.call(es,i)?!1:ha.test(i)?ts[i]=!0:(es[i]=!0,!1)}function Un(i,s,u){if(Jt(s))if(u===null)i.removeAttribute(s);else{switch(typeof u){case"undefined":case"function":case"symbol":i.removeAttribute(s);return;case"boolean":var p=s.toLowerCase().slice(0,5);if(p!=="data-"&&p!=="aria-"){i.removeAttribute(s);return}}i.setAttribute(s,""+u)}}function Oi(i,s,u){if(u===null)i.removeAttribute(s);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(s);return}i.setAttribute(s,""+u)}}function lr(i,s,u,p){if(p===null)i.removeAttribute(u);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(u);return}i.setAttributeNS(s,u,""+p)}}function en(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function ns(i){var s=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function cf(i,s,u){var p=Object.getOwnPropertyDescriptor(i.constructor.prototype,s);if(!i.hasOwnProperty(s)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var b=p.get,x=p.set;return Object.defineProperty(i,s,{configurable:!0,get:function(){return b.call(this)},set:function(N){u=""+N,x.call(this,N)}}),Object.defineProperty(i,s,{enumerable:p.enumerable}),{getValue:function(){return u},setValue:function(N){u=""+N},stopTracking:function(){i._valueTracker=null,delete i[s]}}}}function qc(i){if(!i._valueTracker){var s=ns(i)?"checked":"value";i._valueTracker=cf(i,s,""+i[s])}}function Aw(i){if(!i)return!1;var s=i._valueTracker;if(!s)return!0;var u=s.getValue(),p="";return i&&(p=ns(i)?i.checked?"true":"false":i.value),i=p,i!==u?(s.setValue(i),!0):!1}function uf(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var KD=/[\n"\\]/g;function si(i){return i.replace(KD,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function _m(i,s,u,p,b,x,N,Y){i.name="",N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?i.type=N:i.removeAttribute("type"),s!=null?N==="number"?(s===0&&i.value===""||i.value!=s)&&(i.value=""+en(s)):i.value!==""+en(s)&&(i.value=""+en(s)):N!=="submit"&&N!=="reset"||i.removeAttribute("value"),s!=null?jm(i,N,en(s)):u!=null?jm(i,N,en(u)):p!=null&&i.removeAttribute("value"),b==null&&x!=null&&(i.defaultChecked=!!x),b!=null&&(i.checked=b&&typeof b!="function"&&typeof b!="symbol"),Y!=null&&typeof Y!="function"&&typeof Y!="symbol"&&typeof Y!="boolean"?i.name=""+en(Y):i.removeAttribute("name")}function Nw(i,s,u,p,b,x,N,Y){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(i.type=x),s!=null||u!=null){if(!(x!=="submit"&&x!=="reset"||s!=null)){qc(i);return}u=u!=null?""+en(u):"",s=s!=null?""+en(s):u,Y||s===i.value||(i.value=s),i.defaultValue=s}p=p??b,p=typeof p!="function"&&typeof p!="symbol"&&!!p,i.checked=Y?i.checked:!!p,i.defaultChecked=!!p,N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(i.name=N),qc(i)}function jm(i,s,u){s==="number"&&uf(i.ownerDocument)===i||i.defaultValue===""+u||(i.defaultValue=""+u)}function al(i,s,u,p){if(i=i.options,s){s={};for(var b=0;b<u.length;b++)s["$"+u[b]]=!0;for(u=0;u<i.length;u++)b=s.hasOwnProperty("$"+i[u].value),i[u].selected!==b&&(i[u].selected=b),b&&p&&(i[u].defaultSelected=!0)}else{for(u=""+en(u),s=null,b=0;b<i.length;b++){if(i[b].value===u){i[b].selected=!0,p&&(i[b].defaultSelected=!0);return}s!==null||i[b].disabled||(s=i[b])}s!==null&&(s.selected=!0)}}function Dw(i,s,u){if(s!=null&&(s=""+en(s),s!==i.value&&(i.value=s),u==null)){i.defaultValue!==s&&(i.defaultValue=s);return}i.defaultValue=u!=null?""+en(u):""}function Iw(i,s,u,p){if(s==null){if(p!=null){if(u!=null)throw Error(r(92));if(B(p)){if(1<p.length)throw Error(r(93));p=p[0]}u=p}u==null&&(u=""),s=u}u=en(s),i.defaultValue=u,p=i.textContent,p===u&&p!==""&&p!==null&&(i.value=p),qc(i)}function ol(i,s){if(s){var u=i.firstChild;if(u&&u===i.lastChild&&u.nodeType===3){u.nodeValue=s;return}}i.textContent=s}var GD=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 Pw(i,s,u){var p=s.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?p?i.setProperty(s,""):s==="float"?i.cssFloat="":i[s]="":p?i.setProperty(s,u):typeof u!="number"||u===0||GD.has(s)?s==="float"?i.cssFloat=u:i[s]=(""+u).trim():i[s]=u+"px"}function Lw(i,s,u){if(s!=null&&typeof s!="object")throw Error(r(62));if(i=i.style,u!=null){for(var p in u)!u.hasOwnProperty(p)||s!=null&&s.hasOwnProperty(p)||(p.indexOf("--")===0?i.setProperty(p,""):p==="float"?i.cssFloat="":i[p]="");for(var b in s)p=s[b],s.hasOwnProperty(b)&&u[b]!==p&&Pw(i,b,p)}else for(var x in s)s.hasOwnProperty(x)&&Pw(i,x,s[x])}function zm(i){if(i.indexOf("-")===-1)return!1;switch(i){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var XD=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"]]),QD=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function df(i){return QD.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function pa(){}var Fm=null;function Bm(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var sl=null,ll=null;function _w(i){var s=Zt(i);if(s&&(i=s.stateNode)){var u=i[Xe]||null;e:switch(i=s.stateNode,s.type){case"input":if(_m(i,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),s=u.name,u.type==="radio"&&s!=null){for(u=i;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+si(""+s)+'"][type="radio"]'),s=0;s<u.length;s++){var p=u[s];if(p!==i&&p.form===i.form){var b=p[Xe]||null;if(!b)throw Error(r(90));_m(p,b.value,b.defaultValue,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name)}}for(s=0;s<u.length;s++)p=u[s],p.form===i.form&&Aw(p)}break e;case"textarea":Dw(i,u.value,u.defaultValue);break e;case"select":s=u.value,s!=null&&al(i,!!u.multiple,s,!1)}}}var Hm=!1;function jw(i,s,u){if(Hm)return i(s,u);Hm=!0;try{var p=i(s);return p}finally{if(Hm=!1,(sl!==null||ll!==null)&&(Zf(),sl&&(s=sl,i=ll,ll=sl=null,_w(s),i)))for(s=0;s<i.length;s++)_w(i[s])}}function Vc(i,s){var u=i.stateNode;if(u===null)return null;var p=u[Xe]||null;if(p===null)return null;u=p[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(p=!p.disabled)||(i=i.type,p=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!p;break e;default:i=!1}if(i)return null;if(u&&typeof u!="function")throw Error(r(231,s,typeof u));return u}var ma=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Um=!1;if(ma)try{var $c={};Object.defineProperty($c,"passive",{get:function(){Um=!0}}),window.addEventListener("test",$c,$c),window.removeEventListener("test",$c,$c)}catch{Um=!1}var Xa=null,qm=null,ff=null;function zw(){if(ff)return ff;var i,s=qm,u=s.length,p,b="value"in Xa?Xa.value:Xa.textContent,x=b.length;for(i=0;i<u&&s[i]===b[i];i++);var N=u-i;for(p=1;p<=N&&s[u-p]===b[x-p];p++);return ff=b.slice(i,1<p?1-p:void 0)}function hf(i){var s=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&s===13&&(i=13)):i=s,i===10&&(i=13),32<=i||i===13?i:0}function pf(){return!0}function Fw(){return!1}function Ar(i){function s(u,p,b,x,N){this._reactName=u,this._targetInst=b,this.type=p,this.nativeEvent=x,this.target=N,this.currentTarget=null;for(var Y in i)i.hasOwnProperty(Y)&&(u=i[Y],this[Y]=u?u(x):x[Y]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?pf:Fw,this.isPropagationStopped=Fw,this}return h(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=pf)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=pf)},persist:function(){},isPersistent:pf}),s}var rs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},mf=Ar(rs),Yc=h({},rs,{view:0,detail:0}),ZD=Ar(Yc),Vm,$m,Wc,gf=h({},Yc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Wm,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==Wc&&(Wc&&i.type==="mousemove"?(Vm=i.screenX-Wc.screenX,$m=i.screenY-Wc.screenY):$m=Vm=0,Wc=i),Vm)},movementY:function(i){return"movementY"in i?i.movementY:$m}}),Bw=Ar(gf),JD=h({},gf,{dataTransfer:0}),eI=Ar(JD),tI=h({},Yc,{relatedTarget:0}),Ym=Ar(tI),nI=h({},rs,{animationName:0,elapsedTime:0,pseudoElement:0}),rI=Ar(nI),iI=h({},rs,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),aI=Ar(iI),oI=h({},rs,{data:0}),Hw=Ar(oI),sI={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},lI={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"},cI={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function uI(i){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(i):(i=cI[i])?!!s[i]:!1}function Wm(){return uI}var dI=h({},Yc,{key:function(i){if(i.key){var s=sI[i.key]||i.key;if(s!=="Unidentified")return s}return i.type==="keypress"?(i=hf(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?lI[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Wm,charCode:function(i){return i.type==="keypress"?hf(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?hf(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),fI=Ar(dI),hI=h({},gf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Uw=Ar(hI),pI=h({},Yc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Wm}),mI=Ar(pI),gI=h({},rs,{propertyName:0,elapsedTime:0,pseudoElement:0}),yI=Ar(gI),bI=h({},gf,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),vI=Ar(bI),xI=h({},rs,{newState:0,oldState:0}),wI=Ar(xI),SI=[9,13,27,32],Km=ma&&"CompositionEvent"in window,Kc=null;ma&&"documentMode"in document&&(Kc=document.documentMode);var EI=ma&&"TextEvent"in window&&!Kc,qw=ma&&(!Km||Kc&&8<Kc&&11>=Kc),Vw=" ",$w=!1;function Yw(i,s){switch(i){case"keyup":return SI.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ww(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var cl=!1;function CI(i,s){switch(i){case"compositionend":return Ww(s);case"keypress":return s.which!==32?null:($w=!0,Vw);case"textInput":return i=s.data,i===Vw&&$w?null:i;default:return null}}function TI(i,s){if(cl)return i==="compositionend"||!Km&&Yw(i,s)?(i=zw(),ff=qm=Xa=null,cl=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return qw&&s.locale!=="ko"?null:s.data;default:return null}}var RI={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 Kw(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s==="input"?!!RI[i.type]:s==="textarea"}function Gw(i,s,u,p){sl?ll?ll.push(p):ll=[p]:sl=p,s=ah(s,"onChange"),0<s.length&&(u=new mf("onChange","change",null,u,p),i.push({event:u,listeners:s}))}var Gc=null,Xc=null;function kI(i){NE(i,0)}function yf(i){var s=rr(i);if(Aw(s))return i}function Xw(i,s){if(i==="change")return s}var Qw=!1;if(ma){var Gm;if(ma){var Xm="oninput"in document;if(!Xm){var Zw=document.createElement("div");Zw.setAttribute("oninput","return;"),Xm=typeof Zw.oninput=="function"}Gm=Xm}else Gm=!1;Qw=Gm&&(!document.documentMode||9<document.documentMode)}function Jw(){Gc&&(Gc.detachEvent("onpropertychange",eS),Xc=Gc=null)}function eS(i){if(i.propertyName==="value"&&yf(Xc)){var s=[];Gw(s,Xc,i,Bm(i)),jw(kI,s)}}function MI(i,s,u){i==="focusin"?(Jw(),Gc=s,Xc=u,Gc.attachEvent("onpropertychange",eS)):i==="focusout"&&Jw()}function OI(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return yf(Xc)}function AI(i,s){if(i==="click")return yf(s)}function NI(i,s){if(i==="input"||i==="change")return yf(s)}function DI(i,s){return i===s&&(i!==0||1/i===1/s)||i!==i&&s!==s}var Yr=typeof Object.is=="function"?Object.is:DI;function Qc(i,s){if(Yr(i,s))return!0;if(typeof i!="object"||i===null||typeof s!="object"||s===null)return!1;var u=Object.keys(i),p=Object.keys(s);if(u.length!==p.length)return!1;for(p=0;p<u.length;p++){var b=u[p];if(!J.call(s,b)||!Yr(i[b],s[b]))return!1}return!0}function tS(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function nS(i,s){var u=tS(i);i=0;for(var p;u;){if(u.nodeType===3){if(p=i+u.textContent.length,i<=s&&p>=s)return{node:u,offset:s-i};i=p}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=tS(u)}}function rS(i,s){return i&&s?i===s?!0:i&&i.nodeType===3?!1:s&&s.nodeType===3?rS(i,s.parentNode):"contains"in i?i.contains(s):i.compareDocumentPosition?!!(i.compareDocumentPosition(s)&16):!1:!1}function iS(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var s=uf(i.document);s instanceof i.HTMLIFrameElement;){try{var u=typeof s.contentWindow.location.href=="string"}catch{u=!1}if(u)i=s.contentWindow;else break;s=uf(i.document)}return s}function Qm(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s&&(s==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||s==="textarea"||i.contentEditable==="true")}var II=ma&&"documentMode"in document&&11>=document.documentMode,ul=null,Zm=null,Zc=null,Jm=!1;function aS(i,s,u){var p=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Jm||ul==null||ul!==uf(p)||(p=ul,"selectionStart"in p&&Qm(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),Zc&&Qc(Zc,p)||(Zc=p,p=ah(Zm,"onSelect"),0<p.length&&(s=new mf("onSelect","select",null,s,u),i.push({event:s,listeners:p}),s.target=ul)))}function is(i,s){var u={};return u[i.toLowerCase()]=s.toLowerCase(),u["Webkit"+i]="webkit"+s,u["Moz"+i]="moz"+s,u}var dl={animationend:is("Animation","AnimationEnd"),animationiteration:is("Animation","AnimationIteration"),animationstart:is("Animation","AnimationStart"),transitionrun:is("Transition","TransitionRun"),transitionstart:is("Transition","TransitionStart"),transitioncancel:is("Transition","TransitionCancel"),transitionend:is("Transition","TransitionEnd")},eg={},oS={};ma&&(oS=document.createElement("div").style,"AnimationEvent"in window||(delete dl.animationend.animation,delete dl.animationiteration.animation,delete dl.animationstart.animation),"TransitionEvent"in window||delete dl.transitionend.transition);function as(i){if(eg[i])return eg[i];if(!dl[i])return i;var s=dl[i],u;for(u in s)if(s.hasOwnProperty(u)&&u in oS)return eg[i]=s[u];return i}var sS=as("animationend"),lS=as("animationiteration"),cS=as("animationstart"),PI=as("transitionrun"),LI=as("transitionstart"),_I=as("transitioncancel"),uS=as("transitionend"),dS=new Map,tg="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(" ");tg.push("scrollEnd");function Ai(i,s){dS.set(i,s),Mi(s,[i])}var bf=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},li=[],fl=0,ng=0;function vf(){for(var i=fl,s=ng=fl=0;s<i;){var u=li[s];li[s++]=null;var p=li[s];li[s++]=null;var b=li[s];li[s++]=null;var x=li[s];if(li[s++]=null,p!==null&&b!==null){var N=p.pending;N===null?b.next=b:(b.next=N.next,N.next=b),p.pending=b}x!==0&&fS(u,b,x)}}function xf(i,s,u,p){li[fl++]=i,li[fl++]=s,li[fl++]=u,li[fl++]=p,ng|=p,i.lanes|=p,i=i.alternate,i!==null&&(i.lanes|=p)}function rg(i,s,u,p){return xf(i,s,u,p),wf(i)}function os(i,s){return xf(i,null,null,s),wf(i)}function fS(i,s,u){i.lanes|=u;var p=i.alternate;p!==null&&(p.lanes|=u);for(var b=!1,x=i.return;x!==null;)x.childLanes|=u,p=x.alternate,p!==null&&(p.childLanes|=u),x.tag===22&&(i=x.stateNode,i===null||i._visibility&1||(b=!0)),i=x,x=x.return;return i.tag===3?(x=i.stateNode,b&&s!==null&&(b=31-tt(u),i=x.hiddenUpdates,p=i[b],p===null?i[b]=[s]:p.push(s),s.lane=u|536870912),x):null}function wf(i){if(50<xu)throw xu=0,fy=null,Error(r(185));for(var s=i.return;s!==null;)i=s,s=i.return;return i.tag===3?i.stateNode:null}var hl={};function jI(i,s,u,p){this.tag=i,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Wr(i,s,u,p){return new jI(i,s,u,p)}function ig(i){return i=i.prototype,!(!i||!i.isReactComponent)}function ga(i,s){var u=i.alternate;return u===null?(u=Wr(i.tag,s,i.key,i.mode),u.elementType=i.elementType,u.type=i.type,u.stateNode=i.stateNode,u.alternate=i,i.alternate=u):(u.pendingProps=s,u.type=i.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=i.flags&65011712,u.childLanes=i.childLanes,u.lanes=i.lanes,u.child=i.child,u.memoizedProps=i.memoizedProps,u.memoizedState=i.memoizedState,u.updateQueue=i.updateQueue,s=i.dependencies,u.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},u.sibling=i.sibling,u.index=i.index,u.ref=i.ref,u.refCleanup=i.refCleanup,u}function hS(i,s){i.flags&=65011714;var u=i.alternate;return u===null?(i.childLanes=0,i.lanes=s,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=u.childLanes,i.lanes=u.lanes,i.child=u.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=u.memoizedProps,i.memoizedState=u.memoizedState,i.updateQueue=u.updateQueue,i.type=u.type,s=u.dependencies,i.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),i}function Sf(i,s,u,p,b,x){var N=0;if(p=i,typeof i=="function")ig(i)&&(N=1);else if(typeof i=="string")N=UP(i,u,Q.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case q:return i=Wr(31,u,s,b),i.elementType=q,i.lanes=x,i;case C:return ss(u.children,b,x,s);case T:N=8,b|=24;break;case E:return i=Wr(12,u,s,b|2),i.elementType=E,i.lanes=x,i;case D:return i=Wr(13,u,s,b),i.elementType=D,i.lanes=x,i;case O:return i=Wr(19,u,s,b),i.elementType=O,i.lanes=x,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case k:N=10;break e;case R:N=9;break e;case M:N=11;break e;case A:N=14;break e;case L:N=16,p=null;break e}N=29,u=Error(r(130,i===null?"null":typeof i,"")),p=null}return s=Wr(N,u,s,b),s.elementType=i,s.type=p,s.lanes=x,s}function ss(i,s,u,p){return i=Wr(7,i,p,s),i.lanes=u,i}function ag(i,s,u){return i=Wr(6,i,null,s),i.lanes=u,i}function pS(i){var s=Wr(18,null,null,0);return s.stateNode=i,s}function og(i,s,u){return s=Wr(4,i.children!==null?i.children:[],i.key,s),s.lanes=u,s.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},s}var mS=new WeakMap;function ci(i,s){if(typeof i=="object"&&i!==null){var u=mS.get(i);return u!==void 0?u:(s={value:i,source:s,stack:Re(s)},mS.set(i,s),s)}return{value:i,source:s,stack:Re(s)}}var pl=[],ml=0,Ef=null,Jc=0,ui=[],di=0,Qa=null,$i=1,Yi="";function ya(i,s){pl[ml++]=Jc,pl[ml++]=Ef,Ef=i,Jc=s}function gS(i,s,u){ui[di++]=$i,ui[di++]=Yi,ui[di++]=Qa,Qa=i;var p=$i;i=Yi;var b=32-tt(p)-1;p&=~(1<<b),u+=1;var x=32-tt(s)+b;if(30<x){var N=b-b%5;x=(p&(1<<N)-1).toString(32),p>>=N,b-=N,$i=1<<32-tt(s)+b|u<<b|p,Yi=x+i}else $i=1<<x|u<<b|p,Yi=i}function sg(i){i.return!==null&&(ya(i,1),gS(i,1,0))}function lg(i){for(;i===Ef;)Ef=pl[--ml],pl[ml]=null,Jc=pl[--ml],pl[ml]=null;for(;i===Qa;)Qa=ui[--di],ui[di]=null,Yi=ui[--di],ui[di]=null,$i=ui[--di],ui[di]=null}function yS(i,s){ui[di++]=$i,ui[di++]=Yi,ui[di++]=Qa,$i=s.id,Yi=s.overflow,Qa=i}var cr=null,Tn=null,tn=!1,Za=null,fi=!1,cg=Error(r(519));function Ja(i){var s=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw eu(ci(s,i)),cg}function bS(i){var s=i.stateNode,u=i.type,p=i.memoizedProps;switch(s[We]=i,s[Xe]=p,u){case"dialog":Wt("cancel",s),Wt("close",s);break;case"iframe":case"object":case"embed":Wt("load",s);break;case"video":case"audio":for(u=0;u<Su.length;u++)Wt(Su[u],s);break;case"source":Wt("error",s);break;case"img":case"image":case"link":Wt("error",s),Wt("load",s);break;case"details":Wt("toggle",s);break;case"input":Wt("invalid",s),Nw(s,p.value,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name,!0);break;case"select":Wt("invalid",s);break;case"textarea":Wt("invalid",s),Iw(s,p.value,p.defaultValue,p.children)}u=p.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||s.textContent===""+u||p.suppressHydrationWarning===!0||LE(s.textContent,u)?(p.popover!=null&&(Wt("beforetoggle",s),Wt("toggle",s)),p.onScroll!=null&&Wt("scroll",s),p.onScrollEnd!=null&&Wt("scrollend",s),p.onClick!=null&&(s.onclick=pa),s=!0):s=!1,s||Ja(i,!0)}function vS(i){for(cr=i.return;cr;)switch(cr.tag){case 5:case 31:case 13:fi=!1;return;case 27:case 3:fi=!0;return;default:cr=cr.return}}function gl(i){if(i!==cr)return!1;if(!tn)return vS(i),tn=!0,!1;var s=i.tag,u;if((u=s!==3&&s!==27)&&((u=s===5)&&(u=i.type,u=!(u!=="form"&&u!=="button")||ky(i.type,i.memoizedProps)),u=!u),u&&Tn&&Ja(i),vS(i),s===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));Tn=VE(i)}else if(s===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));Tn=VE(i)}else s===27?(s=Tn,po(i.type)?(i=Dy,Dy=null,Tn=i):Tn=s):Tn=cr?pi(i.stateNode.nextSibling):null;return!0}function ls(){Tn=cr=null,tn=!1}function ug(){var i=Za;return i!==null&&(Pr===null?Pr=i:Pr.push.apply(Pr,i),Za=null),i}function eu(i){Za===null?Za=[i]:Za.push(i)}var dg=U(null),cs=null,ba=null;function eo(i,s,u){I(dg,s._currentValue),s._currentValue=u}function va(i){i._currentValue=dg.current,G(dg)}function fg(i,s,u){for(;i!==null;){var p=i.alternate;if((i.childLanes&s)!==s?(i.childLanes|=s,p!==null&&(p.childLanes|=s)):p!==null&&(p.childLanes&s)!==s&&(p.childLanes|=s),i===u)break;i=i.return}}function hg(i,s,u,p){var b=i.child;for(b!==null&&(b.return=i);b!==null;){var x=b.dependencies;if(x!==null){var N=b.child;x=x.firstContext;e:for(;x!==null;){var Y=x;x=b;for(var ne=0;ne<s.length;ne++)if(Y.context===s[ne]){x.lanes|=u,Y=x.alternate,Y!==null&&(Y.lanes|=u),fg(x.return,u,i),p||(N=null);break e}x=Y.next}}else if(b.tag===18){if(N=b.return,N===null)throw Error(r(341));N.lanes|=u,x=N.alternate,x!==null&&(x.lanes|=u),fg(N,u,i),N=null}else N=b.child;if(N!==null)N.return=b;else for(N=b;N!==null;){if(N===i){N=null;break}if(b=N.sibling,b!==null){b.return=N.return,N=b;break}N=N.return}b=N}}function yl(i,s,u,p){i=null;for(var b=s,x=!1;b!==null;){if(!x){if((b.flags&524288)!==0)x=!0;else if((b.flags&262144)!==0)break}if(b.tag===10){var N=b.alternate;if(N===null)throw Error(r(387));if(N=N.memoizedProps,N!==null){var Y=b.type;Yr(b.pendingProps.value,N.value)||(i!==null?i.push(Y):i=[Y])}}else if(b===Z.current){if(N=b.alternate,N===null)throw Error(r(387));N.memoizedState.memoizedState!==b.memoizedState.memoizedState&&(i!==null?i.push(ku):i=[ku])}b=b.return}i!==null&&hg(s,i,u,p),s.flags|=262144}function Cf(i){for(i=i.firstContext;i!==null;){if(!Yr(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function us(i){cs=i,ba=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function ur(i){return xS(cs,i)}function Tf(i,s){return cs===null&&us(i),xS(i,s)}function xS(i,s){var u=s._currentValue;if(s={context:s,memoizedValue:u,next:null},ba===null){if(i===null)throw Error(r(308));ba=s,i.dependencies={lanes:0,firstContext:s},i.flags|=524288}else ba=ba.next=s;return u}var zI=typeof AbortController<"u"?AbortController:function(){var i=[],s=this.signal={aborted:!1,addEventListener:function(u,p){i.push(p)}};this.abort=function(){s.aborted=!0,i.forEach(function(u){return u()})}},FI=e.unstable_scheduleCallback,BI=e.unstable_NormalPriority,$n={$$typeof:k,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function pg(){return{controller:new zI,data:new Map,refCount:0}}function tu(i){i.refCount--,i.refCount===0&&FI(BI,function(){i.controller.abort()})}var nu=null,mg=0,bl=0,vl=null;function HI(i,s){if(nu===null){var u=nu=[];mg=0,bl=by(),vl={status:"pending",value:void 0,then:function(p){u.push(p)}}}return mg++,s.then(wS,wS),s}function wS(){if(--mg===0&&nu!==null){vl!==null&&(vl.status="fulfilled");var i=nu;nu=null,bl=0,vl=null;for(var s=0;s<i.length;s++)(0,i[s])()}}function UI(i,s){var u=[],p={status:"pending",value:null,reason:null,then:function(b){u.push(b)}};return i.then(function(){p.status="fulfilled",p.value=s;for(var b=0;b<u.length;b++)(0,u[b])(s)},function(b){for(p.status="rejected",p.reason=b,b=0;b<u.length;b++)(0,u[b])(void 0)}),p}var SS=j.S;j.S=function(i,s){aE=De(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&HI(i,s),SS!==null&&SS(i,s)};var ds=U(null);function gg(){var i=ds.current;return i!==null?i:wn.pooledCache}function Rf(i,s){s===null?I(ds,ds.current):I(ds,s.pool)}function ES(){var i=gg();return i===null?null:{parent:$n._currentValue,pool:i}}var xl=Error(r(460)),yg=Error(r(474)),kf=Error(r(542)),Mf={then:function(){}};function CS(i){return i=i.status,i==="fulfilled"||i==="rejected"}function TS(i,s,u){switch(u=i[u],u===void 0?i.push(s):u!==s&&(s.then(pa,pa),s=u),s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,kS(i),i;default:if(typeof s.status=="string")s.then(pa,pa);else{if(i=wn,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=s,i.status="pending",i.then(function(p){if(s.status==="pending"){var b=s;b.status="fulfilled",b.value=p}},function(p){if(s.status==="pending"){var b=s;b.status="rejected",b.reason=p}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,kS(i),i}throw hs=s,xl}}function fs(i){try{var s=i._init;return s(i._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(hs=u,xl):u}}var hs=null;function RS(){if(hs===null)throw Error(r(459));var i=hs;return hs=null,i}function kS(i){if(i===xl||i===kf)throw Error(r(483))}var wl=null,ru=0;function Of(i){var s=ru;return ru+=1,wl===null&&(wl=[]),TS(wl,i,s)}function iu(i,s){s=s.props.ref,i.ref=s!==void 0?s:null}function Af(i,s){throw s.$$typeof===y?Error(r(525)):(i=Object.prototype.toString.call(s),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":i)))}function MS(i){function s(ce,oe){if(i){var me=ce.deletions;me===null?(ce.deletions=[oe],ce.flags|=16):me.push(oe)}}function u(ce,oe){if(!i)return null;for(;oe!==null;)s(ce,oe),oe=oe.sibling;return null}function p(ce){for(var oe=new Map;ce!==null;)ce.key!==null?oe.set(ce.key,ce):oe.set(ce.index,ce),ce=ce.sibling;return oe}function b(ce,oe){return ce=ga(ce,oe),ce.index=0,ce.sibling=null,ce}function x(ce,oe,me){return ce.index=me,i?(me=ce.alternate,me!==null?(me=me.index,me<oe?(ce.flags|=67108866,oe):me):(ce.flags|=67108866,oe)):(ce.flags|=1048576,oe)}function N(ce){return i&&ce.alternate===null&&(ce.flags|=67108866),ce}function Y(ce,oe,me,Ne){return oe===null||oe.tag!==6?(oe=ag(me,ce.mode,Ne),oe.return=ce,oe):(oe=b(oe,me),oe.return=ce,oe)}function ne(ce,oe,me,Ne){var mt=me.type;return mt===C?Me(ce,oe,me.props.children,Ne,me.key):oe!==null&&(oe.elementType===mt||typeof mt=="object"&&mt!==null&&mt.$$typeof===L&&fs(mt)===oe.type)?(oe=b(oe,me.props),iu(oe,me),oe.return=ce,oe):(oe=Sf(me.type,me.key,me.props,null,ce.mode,Ne),iu(oe,me),oe.return=ce,oe)}function ge(ce,oe,me,Ne){return oe===null||oe.tag!==4||oe.stateNode.containerInfo!==me.containerInfo||oe.stateNode.implementation!==me.implementation?(oe=og(me,ce.mode,Ne),oe.return=ce,oe):(oe=b(oe,me.children||[]),oe.return=ce,oe)}function Me(ce,oe,me,Ne,mt){return oe===null||oe.tag!==7?(oe=ss(me,ce.mode,Ne,mt),oe.return=ce,oe):(oe=b(oe,me),oe.return=ce,oe)}function Ie(ce,oe,me){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return oe=ag(""+oe,ce.mode,me),oe.return=ce,oe;if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case g:return me=Sf(oe.type,oe.key,oe.props,null,ce.mode,me),iu(me,oe),me.return=ce,me;case w:return oe=og(oe,ce.mode,me),oe.return=ce,oe;case L:return oe=fs(oe),Ie(ce,oe,me)}if(B(oe)||_(oe))return oe=ss(oe,ce.mode,me,null),oe.return=ce,oe;if(typeof oe.then=="function")return Ie(ce,Of(oe),me);if(oe.$$typeof===k)return Ie(ce,Tf(ce,oe),me);Af(ce,oe)}return null}function be(ce,oe,me,Ne){var mt=oe!==null?oe.key:null;if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return mt!==null?null:Y(ce,oe,""+me,Ne);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case g:return me.key===mt?ne(ce,oe,me,Ne):null;case w:return me.key===mt?ge(ce,oe,me,Ne):null;case L:return me=fs(me),be(ce,oe,me,Ne)}if(B(me)||_(me))return mt!==null?null:Me(ce,oe,me,Ne,null);if(typeof me.then=="function")return be(ce,oe,Of(me),Ne);if(me.$$typeof===k)return be(ce,oe,Tf(ce,me),Ne);Af(ce,me)}return null}function we(ce,oe,me,Ne,mt){if(typeof Ne=="string"&&Ne!==""||typeof Ne=="number"||typeof Ne=="bigint")return ce=ce.get(me)||null,Y(oe,ce,""+Ne,mt);if(typeof Ne=="object"&&Ne!==null){switch(Ne.$$typeof){case g:return ce=ce.get(Ne.key===null?me:Ne.key)||null,ne(oe,ce,Ne,mt);case w:return ce=ce.get(Ne.key===null?me:Ne.key)||null,ge(oe,ce,Ne,mt);case L:return Ne=fs(Ne),we(ce,oe,me,Ne,mt)}if(B(Ne)||_(Ne))return ce=ce.get(me)||null,Me(oe,ce,Ne,mt,null);if(typeof Ne.then=="function")return we(ce,oe,me,Of(Ne),mt);if(Ne.$$typeof===k)return we(ce,oe,me,Tf(oe,Ne),mt);Af(oe,Ne)}return null}function st(ce,oe,me,Ne){for(var mt=null,ln=null,dt=oe,Ft=oe=0,Xt=null;dt!==null&&Ft<me.length;Ft++){dt.index>Ft?(Xt=dt,dt=null):Xt=dt.sibling;var cn=be(ce,dt,me[Ft],Ne);if(cn===null){dt===null&&(dt=Xt);break}i&&dt&&cn.alternate===null&&s(ce,dt),oe=x(cn,oe,Ft),ln===null?mt=cn:ln.sibling=cn,ln=cn,dt=Xt}if(Ft===me.length)return u(ce,dt),tn&&ya(ce,Ft),mt;if(dt===null){for(;Ft<me.length;Ft++)dt=Ie(ce,me[Ft],Ne),dt!==null&&(oe=x(dt,oe,Ft),ln===null?mt=dt:ln.sibling=dt,ln=dt);return tn&&ya(ce,Ft),mt}for(dt=p(dt);Ft<me.length;Ft++)Xt=we(dt,ce,Ft,me[Ft],Ne),Xt!==null&&(i&&Xt.alternate!==null&&dt.delete(Xt.key===null?Ft:Xt.key),oe=x(Xt,oe,Ft),ln===null?mt=Xt:ln.sibling=Xt,ln=Xt);return i&&dt.forEach(function(vo){return s(ce,vo)}),tn&&ya(ce,Ft),mt}function wt(ce,oe,me,Ne){if(me==null)throw Error(r(151));for(var mt=null,ln=null,dt=oe,Ft=oe=0,Xt=null,cn=me.next();dt!==null&&!cn.done;Ft++,cn=me.next()){dt.index>Ft?(Xt=dt,dt=null):Xt=dt.sibling;var vo=be(ce,dt,cn.value,Ne);if(vo===null){dt===null&&(dt=Xt);break}i&&dt&&vo.alternate===null&&s(ce,dt),oe=x(vo,oe,Ft),ln===null?mt=vo:ln.sibling=vo,ln=vo,dt=Xt}if(cn.done)return u(ce,dt),tn&&ya(ce,Ft),mt;if(dt===null){for(;!cn.done;Ft++,cn=me.next())cn=Ie(ce,cn.value,Ne),cn!==null&&(oe=x(cn,oe,Ft),ln===null?mt=cn:ln.sibling=cn,ln=cn);return tn&&ya(ce,Ft),mt}for(dt=p(dt);!cn.done;Ft++,cn=me.next())cn=we(dt,ce,Ft,cn.value,Ne),cn!==null&&(i&&cn.alternate!==null&&dt.delete(cn.key===null?Ft:cn.key),oe=x(cn,oe,Ft),ln===null?mt=cn:ln.sibling=cn,ln=cn);return i&&dt.forEach(function(JP){return s(ce,JP)}),tn&&ya(ce,Ft),mt}function xn(ce,oe,me,Ne){if(typeof me=="object"&&me!==null&&me.type===C&&me.key===null&&(me=me.props.children),typeof me=="object"&&me!==null){switch(me.$$typeof){case g:e:{for(var mt=me.key;oe!==null;){if(oe.key===mt){if(mt=me.type,mt===C){if(oe.tag===7){u(ce,oe.sibling),Ne=b(oe,me.props.children),Ne.return=ce,ce=Ne;break e}}else if(oe.elementType===mt||typeof mt=="object"&&mt!==null&&mt.$$typeof===L&&fs(mt)===oe.type){u(ce,oe.sibling),Ne=b(oe,me.props),iu(Ne,me),Ne.return=ce,ce=Ne;break e}u(ce,oe);break}else s(ce,oe);oe=oe.sibling}me.type===C?(Ne=ss(me.props.children,ce.mode,Ne,me.key),Ne.return=ce,ce=Ne):(Ne=Sf(me.type,me.key,me.props,null,ce.mode,Ne),iu(Ne,me),Ne.return=ce,ce=Ne)}return N(ce);case w:e:{for(mt=me.key;oe!==null;){if(oe.key===mt)if(oe.tag===4&&oe.stateNode.containerInfo===me.containerInfo&&oe.stateNode.implementation===me.implementation){u(ce,oe.sibling),Ne=b(oe,me.children||[]),Ne.return=ce,ce=Ne;break e}else{u(ce,oe);break}else s(ce,oe);oe=oe.sibling}Ne=og(me,ce.mode,Ne),Ne.return=ce,ce=Ne}return N(ce);case L:return me=fs(me),xn(ce,oe,me,Ne)}if(B(me))return st(ce,oe,me,Ne);if(_(me)){if(mt=_(me),typeof mt!="function")throw Error(r(150));return me=mt.call(me),wt(ce,oe,me,Ne)}if(typeof me.then=="function")return xn(ce,oe,Of(me),Ne);if(me.$$typeof===k)return xn(ce,oe,Tf(ce,me),Ne);Af(ce,me)}return typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint"?(me=""+me,oe!==null&&oe.tag===6?(u(ce,oe.sibling),Ne=b(oe,me),Ne.return=ce,ce=Ne):(u(ce,oe),Ne=ag(me,ce.mode,Ne),Ne.return=ce,ce=Ne),N(ce)):u(ce,oe)}return function(ce,oe,me,Ne){try{ru=0;var mt=xn(ce,oe,me,Ne);return wl=null,mt}catch(dt){if(dt===xl||dt===kf)throw dt;var ln=Wr(29,dt,null,ce.mode);return ln.lanes=Ne,ln.return=ce,ln}finally{}}}var ps=MS(!0),OS=MS(!1),to=!1;function bg(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function vg(i,s){i=i.updateQueue,s.updateQueue===i&&(s.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function no(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function ro(i,s,u){var p=i.updateQueue;if(p===null)return null;if(p=p.shared,(fn&2)!==0){var b=p.pending;return b===null?s.next=s:(s.next=b.next,b.next=s),p.pending=s,s=wf(i),fS(i,null,u),s}return xf(i,p,s,u),wf(i)}function au(i,s,u){if(s=s.updateQueue,s!==null&&(s=s.shared,(u&4194048)!==0)){var p=s.lanes;p&=i.pendingLanes,u|=p,s.lanes=u,X(i,u)}}function xg(i,s){var u=i.updateQueue,p=i.alternate;if(p!==null&&(p=p.updateQueue,u===p)){var b=null,x=null;if(u=u.firstBaseUpdate,u!==null){do{var N={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};x===null?b=x=N:x=x.next=N,u=u.next}while(u!==null);x===null?b=x=s:x=x.next=s}else b=x=s;u={baseState:p.baseState,firstBaseUpdate:b,lastBaseUpdate:x,shared:p.shared,callbacks:p.callbacks},i.updateQueue=u;return}i=u.lastBaseUpdate,i===null?u.firstBaseUpdate=s:i.next=s,u.lastBaseUpdate=s}var wg=!1;function ou(){if(wg){var i=vl;if(i!==null)throw i}}function su(i,s,u,p){wg=!1;var b=i.updateQueue;to=!1;var x=b.firstBaseUpdate,N=b.lastBaseUpdate,Y=b.shared.pending;if(Y!==null){b.shared.pending=null;var ne=Y,ge=ne.next;ne.next=null,N===null?x=ge:N.next=ge,N=ne;var Me=i.alternate;Me!==null&&(Me=Me.updateQueue,Y=Me.lastBaseUpdate,Y!==N&&(Y===null?Me.firstBaseUpdate=ge:Y.next=ge,Me.lastBaseUpdate=ne))}if(x!==null){var Ie=b.baseState;N=0,Me=ge=ne=null,Y=x;do{var be=Y.lane&-536870913,we=be!==Y.lane;if(we?(Gt&be)===be:(p&be)===be){be!==0&&be===bl&&(wg=!0),Me!==null&&(Me=Me.next={lane:0,tag:Y.tag,payload:Y.payload,callback:null,next:null});e:{var st=i,wt=Y;be=s;var xn=u;switch(wt.tag){case 1:if(st=wt.payload,typeof st=="function"){Ie=st.call(xn,Ie,be);break e}Ie=st;break e;case 3:st.flags=st.flags&-65537|128;case 0:if(st=wt.payload,be=typeof st=="function"?st.call(xn,Ie,be):st,be==null)break e;Ie=h({},Ie,be);break e;case 2:to=!0}}be=Y.callback,be!==null&&(i.flags|=64,we&&(i.flags|=8192),we=b.callbacks,we===null?b.callbacks=[be]:we.push(be))}else we={lane:be,tag:Y.tag,payload:Y.payload,callback:Y.callback,next:null},Me===null?(ge=Me=we,ne=Ie):Me=Me.next=we,N|=be;if(Y=Y.next,Y===null){if(Y=b.shared.pending,Y===null)break;we=Y,Y=we.next,we.next=null,b.lastBaseUpdate=we,b.shared.pending=null}}while(!0);Me===null&&(ne=Ie),b.baseState=ne,b.firstBaseUpdate=ge,b.lastBaseUpdate=Me,x===null&&(b.shared.lanes=0),lo|=N,i.lanes=N,i.memoizedState=Ie}}function AS(i,s){if(typeof i!="function")throw Error(r(191,i));i.call(s)}function NS(i,s){var u=i.callbacks;if(u!==null)for(i.callbacks=null,i=0;i<u.length;i++)AS(u[i],s)}var Sl=U(null),Nf=U(0);function DS(i,s){i=Ma,I(Nf,i),I(Sl,s),Ma=i|s.baseLanes}function Sg(){I(Nf,Ma),I(Sl,Sl.current)}function Eg(){Ma=Nf.current,G(Sl),G(Nf)}var Kr=U(null),hi=null;function io(i){var s=i.alternate;I(qn,qn.current&1),I(Kr,i),hi===null&&(s===null||Sl.current!==null||s.memoizedState!==null)&&(hi=i)}function Cg(i){I(qn,qn.current),I(Kr,i),hi===null&&(hi=i)}function IS(i){i.tag===22?(I(qn,qn.current),I(Kr,i),hi===null&&(hi=i)):ao()}function ao(){I(qn,qn.current),I(Kr,Kr.current)}function Gr(i){G(Kr),hi===i&&(hi=null),G(qn)}var qn=U(0);function Df(i){for(var s=i;s!==null;){if(s.tag===13){var u=s.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||Ay(u)||Ny(u)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var xa=0,jt=null,bn=null,Yn=null,If=!1,El=!1,ms=!1,Pf=0,lu=0,Cl=null,qI=0;function _n(){throw Error(r(321))}function Tg(i,s){if(s===null)return!1;for(var u=0;u<s.length&&u<i.length;u++)if(!Yr(i[u],s[u]))return!1;return!0}function Rg(i,s,u,p,b,x){return xa=x,jt=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,j.H=i===null||i.memoizedState===null?g1:Hg,ms=!1,x=u(p,b),ms=!1,El&&(x=LS(s,u,p,b)),PS(i),x}function PS(i){j.H=du;var s=bn!==null&&bn.next!==null;if(xa=0,Yn=bn=jt=null,If=!1,lu=0,Cl=null,s)throw Error(r(300));i===null||Wn||(i=i.dependencies,i!==null&&Cf(i)&&(Wn=!0))}function LS(i,s,u,p){jt=i;var b=0;do{if(El&&(Cl=null),lu=0,El=!1,25<=b)throw Error(r(301));if(b+=1,Yn=bn=null,i.updateQueue!=null){var x=i.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}j.H=y1,x=s(u,p)}while(El);return x}function VI(){var i=j.H,s=i.useState()[0];return s=typeof s.then=="function"?cu(s):s,i=i.useState()[0],(bn!==null?bn.memoizedState:null)!==i&&(jt.flags|=1024),s}function kg(){var i=Pf!==0;return Pf=0,i}function Mg(i,s,u){s.updateQueue=i.updateQueue,s.flags&=-2053,i.lanes&=~u}function Og(i){if(If){for(i=i.memoizedState;i!==null;){var s=i.queue;s!==null&&(s.pending=null),i=i.next}If=!1}xa=0,Yn=bn=jt=null,El=!1,lu=Pf=0,Cl=null}function Sr(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Yn===null?jt.memoizedState=Yn=i:Yn=Yn.next=i,Yn}function Vn(){if(bn===null){var i=jt.alternate;i=i!==null?i.memoizedState:null}else i=bn.next;var s=Yn===null?jt.memoizedState:Yn.next;if(s!==null)Yn=s,bn=i;else{if(i===null)throw jt.alternate===null?Error(r(467)):Error(r(310));bn=i,i={memoizedState:bn.memoizedState,baseState:bn.baseState,baseQueue:bn.baseQueue,queue:bn.queue,next:null},Yn===null?jt.memoizedState=Yn=i:Yn=Yn.next=i}return Yn}function Lf(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function cu(i){var s=lu;return lu+=1,Cl===null&&(Cl=[]),i=TS(Cl,i,s),s=jt,(Yn===null?s.memoizedState:Yn.next)===null&&(s=s.alternate,j.H=s===null||s.memoizedState===null?g1:Hg),i}function _f(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return cu(i);if(i.$$typeof===k)return ur(i)}throw Error(r(438,String(i)))}function Ag(i){var s=null,u=jt.updateQueue;if(u!==null&&(s=u.memoCache),s==null){var p=jt.alternate;p!==null&&(p=p.updateQueue,p!==null&&(p=p.memoCache,p!=null&&(s={data:p.data.map(function(b){return b.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),u===null&&(u=Lf(),jt.updateQueue=u),u.memoCache=s,u=s.data[s.index],u===void 0)for(u=s.data[s.index]=Array(i),p=0;p<i;p++)u[p]=F;return s.index++,u}function wa(i,s){return typeof s=="function"?s(i):s}function jf(i){var s=Vn();return Ng(s,bn,i)}function Ng(i,s,u){var p=i.queue;if(p===null)throw Error(r(311));p.lastRenderedReducer=u;var b=i.baseQueue,x=p.pending;if(x!==null){if(b!==null){var N=b.next;b.next=x.next,x.next=N}s.baseQueue=b=x,p.pending=null}if(x=i.baseState,b===null)i.memoizedState=x;else{s=b.next;var Y=N=null,ne=null,ge=s,Me=!1;do{var Ie=ge.lane&-536870913;if(Ie!==ge.lane?(Gt&Ie)===Ie:(xa&Ie)===Ie){var be=ge.revertLane;if(be===0)ne!==null&&(ne=ne.next={lane:0,revertLane:0,gesture:null,action:ge.action,hasEagerState:ge.hasEagerState,eagerState:ge.eagerState,next:null}),Ie===bl&&(Me=!0);else if((xa&be)===be){ge=ge.next,be===bl&&(Me=!0);continue}else Ie={lane:0,revertLane:ge.revertLane,gesture:null,action:ge.action,hasEagerState:ge.hasEagerState,eagerState:ge.eagerState,next:null},ne===null?(Y=ne=Ie,N=x):ne=ne.next=Ie,jt.lanes|=be,lo|=be;Ie=ge.action,ms&&u(x,Ie),x=ge.hasEagerState?ge.eagerState:u(x,Ie)}else be={lane:Ie,revertLane:ge.revertLane,gesture:ge.gesture,action:ge.action,hasEagerState:ge.hasEagerState,eagerState:ge.eagerState,next:null},ne===null?(Y=ne=be,N=x):ne=ne.next=be,jt.lanes|=Ie,lo|=Ie;ge=ge.next}while(ge!==null&&ge!==s);if(ne===null?N=x:ne.next=Y,!Yr(x,i.memoizedState)&&(Wn=!0,Me&&(u=vl,u!==null)))throw u;i.memoizedState=x,i.baseState=N,i.baseQueue=ne,p.lastRenderedState=x}return b===null&&(p.lanes=0),[i.memoizedState,p.dispatch]}function Dg(i){var s=Vn(),u=s.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=i;var p=u.dispatch,b=u.pending,x=s.memoizedState;if(b!==null){u.pending=null;var N=b=b.next;do x=i(x,N.action),N=N.next;while(N!==b);Yr(x,s.memoizedState)||(Wn=!0),s.memoizedState=x,s.baseQueue===null&&(s.baseState=x),u.lastRenderedState=x}return[x,p]}function _S(i,s,u){var p=jt,b=Vn(),x=tn;if(x){if(u===void 0)throw Error(r(407));u=u()}else u=s();var N=!Yr((bn||b).memoizedState,u);if(N&&(b.memoizedState=u,Wn=!0),b=b.queue,Lg(FS.bind(null,p,b,i),[i]),b.getSnapshot!==s||N||Yn!==null&&Yn.memoizedState.tag&1){if(p.flags|=2048,Tl(9,{destroy:void 0},zS.bind(null,p,b,u,s),null),wn===null)throw Error(r(349));x||(xa&127)!==0||jS(p,s,u)}return u}function jS(i,s,u){i.flags|=16384,i={getSnapshot:s,value:u},s=jt.updateQueue,s===null?(s=Lf(),jt.updateQueue=s,s.stores=[i]):(u=s.stores,u===null?s.stores=[i]:u.push(i))}function zS(i,s,u,p){s.value=u,s.getSnapshot=p,BS(s)&&HS(i)}function FS(i,s,u){return u(function(){BS(s)&&HS(i)})}function BS(i){var s=i.getSnapshot;i=i.value;try{var u=s();return!Yr(i,u)}catch{return!0}}function HS(i){var s=os(i,2);s!==null&&Lr(s,i,2)}function Ig(i){var s=Sr();if(typeof i=="function"){var u=i;if(i=u(),ms){Ze(!0);try{u()}finally{Ze(!1)}}}return s.memoizedState=s.baseState=i,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:wa,lastRenderedState:i},s}function US(i,s,u,p){return i.baseState=u,Ng(i,bn,typeof p=="function"?p:wa)}function $I(i,s,u,p,b){if(Bf(i))throw Error(r(485));if(i=s.action,i!==null){var x={payload:b,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(N){x.listeners.push(N)}};j.T!==null?u(!0):x.isTransition=!1,p(x),u=s.pending,u===null?(x.next=s.pending=x,qS(s,x)):(x.next=u.next,s.pending=u.next=x)}}function qS(i,s){var u=s.action,p=s.payload,b=i.state;if(s.isTransition){var x=j.T,N={};j.T=N;try{var Y=u(b,p),ne=j.S;ne!==null&&ne(N,Y),VS(i,s,Y)}catch(ge){Pg(i,s,ge)}finally{x!==null&&N.types!==null&&(x.types=N.types),j.T=x}}else try{x=u(b,p),VS(i,s,x)}catch(ge){Pg(i,s,ge)}}function VS(i,s,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(p){$S(i,s,p)},function(p){return Pg(i,s,p)}):$S(i,s,u)}function $S(i,s,u){s.status="fulfilled",s.value=u,YS(s),i.state=u,s=i.pending,s!==null&&(u=s.next,u===s?i.pending=null:(u=u.next,s.next=u,qS(i,u)))}function Pg(i,s,u){var p=i.pending;if(i.pending=null,p!==null){p=p.next;do s.status="rejected",s.reason=u,YS(s),s=s.next;while(s!==p)}i.action=null}function YS(i){i=i.listeners;for(var s=0;s<i.length;s++)(0,i[s])()}function WS(i,s){return s}function KS(i,s){if(tn){var u=wn.formState;if(u!==null){e:{var p=jt;if(tn){if(Tn){t:{for(var b=Tn,x=fi;b.nodeType!==8;){if(!x){b=null;break t}if(b=pi(b.nextSibling),b===null){b=null;break t}}x=b.data,b=x==="F!"||x==="F"?b:null}if(b){Tn=pi(b.nextSibling),p=b.data==="F!";break e}}Ja(p)}p=!1}p&&(s=u[0])}}return u=Sr(),u.memoizedState=u.baseState=s,p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:WS,lastRenderedState:s},u.queue=p,u=h1.bind(null,jt,p),p.dispatch=u,p=Ig(!1),x=Bg.bind(null,jt,!1,p.queue),p=Sr(),b={state:s,dispatch:null,action:i,pending:null},p.queue=b,u=$I.bind(null,jt,b,x,u),b.dispatch=u,p.memoizedState=i,[s,u,!1]}function GS(i){var s=Vn();return XS(s,bn,i)}function XS(i,s,u){if(s=Ng(i,s,WS)[0],i=jf(wa)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var p=cu(s)}catch(N){throw N===xl?kf:N}else p=s;s=Vn();var b=s.queue,x=b.dispatch;return u!==s.memoizedState&&(jt.flags|=2048,Tl(9,{destroy:void 0},YI.bind(null,b,u),null)),[p,x,i]}function YI(i,s){i.action=s}function QS(i){var s=Vn(),u=bn;if(u!==null)return XS(s,u,i);Vn(),s=s.memoizedState,u=Vn();var p=u.queue.dispatch;return u.memoizedState=i,[s,p,!1]}function Tl(i,s,u,p){return i={tag:i,create:u,deps:p,inst:s,next:null},s=jt.updateQueue,s===null&&(s=Lf(),jt.updateQueue=s),u=s.lastEffect,u===null?s.lastEffect=i.next=i:(p=u.next,u.next=i,i.next=p,s.lastEffect=i),i}function ZS(){return Vn().memoizedState}function zf(i,s,u,p){var b=Sr();jt.flags|=i,b.memoizedState=Tl(1|s,{destroy:void 0},u,p===void 0?null:p)}function Ff(i,s,u,p){var b=Vn();p=p===void 0?null:p;var x=b.memoizedState.inst;bn!==null&&p!==null&&Tg(p,bn.memoizedState.deps)?b.memoizedState=Tl(s,x,u,p):(jt.flags|=i,b.memoizedState=Tl(1|s,x,u,p))}function JS(i,s){zf(8390656,8,i,s)}function Lg(i,s){Ff(2048,8,i,s)}function WI(i){jt.flags|=4;var s=jt.updateQueue;if(s===null)s=Lf(),jt.updateQueue=s,s.events=[i];else{var u=s.events;u===null?s.events=[i]:u.push(i)}}function e1(i){var s=Vn().memoizedState;return WI({ref:s,nextImpl:i}),function(){if((fn&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}function t1(i,s){return Ff(4,2,i,s)}function n1(i,s){return Ff(4,4,i,s)}function r1(i,s){if(typeof s=="function"){i=i();var u=s(i);return function(){typeof u=="function"?u():s(null)}}if(s!=null)return i=i(),s.current=i,function(){s.current=null}}function i1(i,s,u){u=u!=null?u.concat([i]):null,Ff(4,4,r1.bind(null,s,i),u)}function _g(){}function a1(i,s){var u=Vn();s=s===void 0?null:s;var p=u.memoizedState;return s!==null&&Tg(s,p[1])?p[0]:(u.memoizedState=[i,s],i)}function o1(i,s){var u=Vn();s=s===void 0?null:s;var p=u.memoizedState;if(s!==null&&Tg(s,p[1]))return p[0];if(p=i(),ms){Ze(!0);try{i()}finally{Ze(!1)}}return u.memoizedState=[p,s],p}function jg(i,s,u){return u===void 0||(xa&1073741824)!==0&&(Gt&261930)===0?i.memoizedState=s:(i.memoizedState=u,i=sE(),jt.lanes|=i,lo|=i,u)}function s1(i,s,u,p){return Yr(u,s)?u:Sl.current!==null?(i=jg(i,u,p),Yr(i,s)||(Wn=!0),i):(xa&42)===0||(xa&1073741824)!==0&&(Gt&261930)===0?(Wn=!0,i.memoizedState=u):(i=sE(),jt.lanes|=i,lo|=i,s)}function l1(i,s,u,p,b){var x=z.p;z.p=x!==0&&8>x?x:8;var N=j.T,Y={};j.T=Y,Bg(i,!1,s,u);try{var ne=b(),ge=j.S;if(ge!==null&&ge(Y,ne),ne!==null&&typeof ne=="object"&&typeof ne.then=="function"){var Me=UI(ne,p);uu(i,s,Me,Zr(i))}else uu(i,s,p,Zr(i))}catch(Ie){uu(i,s,{then:function(){},status:"rejected",reason:Ie},Zr())}finally{z.p=x,N!==null&&Y.types!==null&&(N.types=Y.types),j.T=N}}function KI(){}function zg(i,s,u,p){if(i.tag!==5)throw Error(r(476));var b=c1(i).queue;l1(i,b,s,H,u===null?KI:function(){return u1(i),u(p)})}function c1(i){var s=i.memoizedState;if(s!==null)return s;s={memoizedState:H,baseState:H,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:wa,lastRenderedState:H},next:null};var u={};return s.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:wa,lastRenderedState:u},next:null},i.memoizedState=s,i=i.alternate,i!==null&&(i.memoizedState=s),s}function u1(i){var s=c1(i);s.next===null&&(s=i.alternate.memoizedState),uu(i,s.next.queue,{},Zr())}function Fg(){return ur(ku)}function d1(){return Vn().memoizedState}function f1(){return Vn().memoizedState}function GI(i){for(var s=i.return;s!==null;){switch(s.tag){case 24:case 3:var u=Zr();i=no(u);var p=ro(s,i,u);p!==null&&(Lr(p,s,u),au(p,s,u)),s={cache:pg()},i.payload=s;return}s=s.return}}function XI(i,s,u){var p=Zr();u={lane:p,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Bf(i)?p1(s,u):(u=rg(i,s,u,p),u!==null&&(Lr(u,i,p),m1(u,s,p)))}function h1(i,s,u){var p=Zr();uu(i,s,u,p)}function uu(i,s,u,p){var b={lane:p,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(Bf(i))p1(s,b);else{var x=i.alternate;if(i.lanes===0&&(x===null||x.lanes===0)&&(x=s.lastRenderedReducer,x!==null))try{var N=s.lastRenderedState,Y=x(N,u);if(b.hasEagerState=!0,b.eagerState=Y,Yr(Y,N))return xf(i,s,b,0),wn===null&&vf(),!1}catch{}finally{}if(u=rg(i,s,b,p),u!==null)return Lr(u,i,p),m1(u,s,p),!0}return!1}function Bg(i,s,u,p){if(p={lane:2,revertLane:by(),gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},Bf(i)){if(s)throw Error(r(479))}else s=rg(i,u,p,2),s!==null&&Lr(s,i,2)}function Bf(i){var s=i.alternate;return i===jt||s!==null&&s===jt}function p1(i,s){El=If=!0;var u=i.pending;u===null?s.next=s:(s.next=u.next,u.next=s),i.pending=s}function m1(i,s,u){if((u&4194048)!==0){var p=s.lanes;p&=i.pendingLanes,u|=p,s.lanes=u,X(i,u)}}var du={readContext:ur,use:_f,useCallback:_n,useContext:_n,useEffect:_n,useImperativeHandle:_n,useLayoutEffect:_n,useInsertionEffect:_n,useMemo:_n,useReducer:_n,useRef:_n,useState:_n,useDebugValue:_n,useDeferredValue:_n,useTransition:_n,useSyncExternalStore:_n,useId:_n,useHostTransitionStatus:_n,useFormState:_n,useActionState:_n,useOptimistic:_n,useMemoCache:_n,useCacheRefresh:_n};du.useEffectEvent=_n;var g1={readContext:ur,use:_f,useCallback:function(i,s){return Sr().memoizedState=[i,s===void 0?null:s],i},useContext:ur,useEffect:JS,useImperativeHandle:function(i,s,u){u=u!=null?u.concat([i]):null,zf(4194308,4,r1.bind(null,s,i),u)},useLayoutEffect:function(i,s){return zf(4194308,4,i,s)},useInsertionEffect:function(i,s){zf(4,2,i,s)},useMemo:function(i,s){var u=Sr();s=s===void 0?null:s;var p=i();if(ms){Ze(!0);try{i()}finally{Ze(!1)}}return u.memoizedState=[p,s],p},useReducer:function(i,s,u){var p=Sr();if(u!==void 0){var b=u(s);if(ms){Ze(!0);try{u(s)}finally{Ze(!1)}}}else b=s;return p.memoizedState=p.baseState=b,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:b},p.queue=i,i=i.dispatch=XI.bind(null,jt,i),[p.memoizedState,i]},useRef:function(i){var s=Sr();return i={current:i},s.memoizedState=i},useState:function(i){i=Ig(i);var s=i.queue,u=h1.bind(null,jt,s);return s.dispatch=u,[i.memoizedState,u]},useDebugValue:_g,useDeferredValue:function(i,s){var u=Sr();return jg(u,i,s)},useTransition:function(){var i=Ig(!1);return i=l1.bind(null,jt,i.queue,!0,!1),Sr().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,s,u){var p=jt,b=Sr();if(tn){if(u===void 0)throw Error(r(407));u=u()}else{if(u=s(),wn===null)throw Error(r(349));(Gt&127)!==0||jS(p,s,u)}b.memoizedState=u;var x={value:u,getSnapshot:s};return b.queue=x,JS(FS.bind(null,p,x,i),[i]),p.flags|=2048,Tl(9,{destroy:void 0},zS.bind(null,p,x,u,s),null),u},useId:function(){var i=Sr(),s=wn.identifierPrefix;if(tn){var u=Yi,p=$i;u=(p&~(1<<32-tt(p)-1)).toString(32)+u,s="_"+s+"R_"+u,u=Pf++,0<u&&(s+="H"+u.toString(32)),s+="_"}else u=qI++,s="_"+s+"r_"+u.toString(32)+"_";return i.memoizedState=s},useHostTransitionStatus:Fg,useFormState:KS,useActionState:KS,useOptimistic:function(i){var s=Sr();s.memoizedState=s.baseState=i;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=u,s=Bg.bind(null,jt,!0,u),u.dispatch=s,[i,s]},useMemoCache:Ag,useCacheRefresh:function(){return Sr().memoizedState=GI.bind(null,jt)},useEffectEvent:function(i){var s=Sr(),u={impl:i};return s.memoizedState=u,function(){if((fn&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}},Hg={readContext:ur,use:_f,useCallback:a1,useContext:ur,useEffect:Lg,useImperativeHandle:i1,useInsertionEffect:t1,useLayoutEffect:n1,useMemo:o1,useReducer:jf,useRef:ZS,useState:function(){return jf(wa)},useDebugValue:_g,useDeferredValue:function(i,s){var u=Vn();return s1(u,bn.memoizedState,i,s)},useTransition:function(){var i=jf(wa)[0],s=Vn().memoizedState;return[typeof i=="boolean"?i:cu(i),s]},useSyncExternalStore:_S,useId:d1,useHostTransitionStatus:Fg,useFormState:GS,useActionState:GS,useOptimistic:function(i,s){var u=Vn();return US(u,bn,i,s)},useMemoCache:Ag,useCacheRefresh:f1};Hg.useEffectEvent=e1;var y1={readContext:ur,use:_f,useCallback:a1,useContext:ur,useEffect:Lg,useImperativeHandle:i1,useInsertionEffect:t1,useLayoutEffect:n1,useMemo:o1,useReducer:Dg,useRef:ZS,useState:function(){return Dg(wa)},useDebugValue:_g,useDeferredValue:function(i,s){var u=Vn();return bn===null?jg(u,i,s):s1(u,bn.memoizedState,i,s)},useTransition:function(){var i=Dg(wa)[0],s=Vn().memoizedState;return[typeof i=="boolean"?i:cu(i),s]},useSyncExternalStore:_S,useId:d1,useHostTransitionStatus:Fg,useFormState:QS,useActionState:QS,useOptimistic:function(i,s){var u=Vn();return bn!==null?US(u,bn,i,s):(u.baseState=i,[i,u.queue.dispatch])},useMemoCache:Ag,useCacheRefresh:f1};y1.useEffectEvent=e1;function Ug(i,s,u,p){s=i.memoizedState,u=u(p,s),u=u==null?s:h({},s,u),i.memoizedState=u,i.lanes===0&&(i.updateQueue.baseState=u)}var qg={enqueueSetState:function(i,s,u){i=i._reactInternals;var p=Zr(),b=no(p);b.payload=s,u!=null&&(b.callback=u),s=ro(i,b,p),s!==null&&(Lr(s,i,p),au(s,i,p))},enqueueReplaceState:function(i,s,u){i=i._reactInternals;var p=Zr(),b=no(p);b.tag=1,b.payload=s,u!=null&&(b.callback=u),s=ro(i,b,p),s!==null&&(Lr(s,i,p),au(s,i,p))},enqueueForceUpdate:function(i,s){i=i._reactInternals;var u=Zr(),p=no(u);p.tag=2,s!=null&&(p.callback=s),s=ro(i,p,u),s!==null&&(Lr(s,i,u),au(s,i,u))}};function b1(i,s,u,p,b,x,N){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(p,x,N):s.prototype&&s.prototype.isPureReactComponent?!Qc(u,p)||!Qc(b,x):!0}function v1(i,s,u,p){i=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(u,p),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(u,p),s.state!==i&&qg.enqueueReplaceState(s,s.state,null)}function gs(i,s){var u=s;if("ref"in s){u={};for(var p in s)p!=="ref"&&(u[p]=s[p])}if(i=i.defaultProps){u===s&&(u=h({},u));for(var b in i)u[b]===void 0&&(u[b]=i[b])}return u}function x1(i){bf(i)}function w1(i){console.error(i)}function S1(i){bf(i)}function Hf(i,s){try{var u=i.onUncaughtError;u(s.value,{componentStack:s.stack})}catch(p){setTimeout(function(){throw p})}}function E1(i,s,u){try{var p=i.onCaughtError;p(u.value,{componentStack:u.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(b){setTimeout(function(){throw b})}}function Vg(i,s,u){return u=no(u),u.tag=3,u.payload={element:null},u.callback=function(){Hf(i,s)},u}function C1(i){return i=no(i),i.tag=3,i}function T1(i,s,u,p){var b=u.type.getDerivedStateFromError;if(typeof b=="function"){var x=p.value;i.payload=function(){return b(x)},i.callback=function(){E1(s,u,p)}}var N=u.stateNode;N!==null&&typeof N.componentDidCatch=="function"&&(i.callback=function(){E1(s,u,p),typeof b!="function"&&(co===null?co=new Set([this]):co.add(this));var Y=p.stack;this.componentDidCatch(p.value,{componentStack:Y!==null?Y:""})})}function QI(i,s,u,p,b){if(u.flags|=32768,p!==null&&typeof p=="object"&&typeof p.then=="function"){if(s=u.alternate,s!==null&&yl(s,u,b,!0),u=Kr.current,u!==null){switch(u.tag){case 31:case 13:return hi===null?Jf():u.alternate===null&&jn===0&&(jn=3),u.flags&=-257,u.flags|=65536,u.lanes=b,p===Mf?u.flags|=16384:(s=u.updateQueue,s===null?u.updateQueue=new Set([p]):s.add(p),my(i,p,b)),!1;case 22:return u.flags|=65536,p===Mf?u.flags|=16384:(s=u.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([p])},u.updateQueue=s):(u=s.retryQueue,u===null?s.retryQueue=new Set([p]):u.add(p)),my(i,p,b)),!1}throw Error(r(435,u.tag))}return my(i,p,b),Jf(),!1}if(tn)return s=Kr.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=b,p!==cg&&(i=Error(r(422),{cause:p}),eu(ci(i,u)))):(p!==cg&&(s=Error(r(423),{cause:p}),eu(ci(s,u))),i=i.current.alternate,i.flags|=65536,b&=-b,i.lanes|=b,p=ci(p,u),b=Vg(i.stateNode,p,b),xg(i,b),jn!==4&&(jn=2)),!1;var x=Error(r(520),{cause:p});if(x=ci(x,u),vu===null?vu=[x]:vu.push(x),jn!==4&&(jn=2),s===null)return!0;p=ci(p,u),u=s;do{switch(u.tag){case 3:return u.flags|=65536,i=b&-b,u.lanes|=i,i=Vg(u.stateNode,p,i),xg(u,i),!1;case 1:if(s=u.type,x=u.stateNode,(u.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(co===null||!co.has(x))))return u.flags|=65536,b&=-b,u.lanes|=b,b=C1(b),T1(b,i,u,p),xg(u,b),!1}u=u.return}while(u!==null);return!1}var $g=Error(r(461)),Wn=!1;function dr(i,s,u,p){s.child=i===null?OS(s,null,u,p):ps(s,i.child,u,p)}function R1(i,s,u,p,b){u=u.render;var x=s.ref;if("ref"in p){var N={};for(var Y in p)Y!=="ref"&&(N[Y]=p[Y])}else N=p;return us(s),p=Rg(i,s,u,N,x,b),Y=kg(),i!==null&&!Wn?(Mg(i,s,b),Sa(i,s,b)):(tn&&Y&&sg(s),s.flags|=1,dr(i,s,p,b),s.child)}function k1(i,s,u,p,b){if(i===null){var x=u.type;return typeof x=="function"&&!ig(x)&&x.defaultProps===void 0&&u.compare===null?(s.tag=15,s.type=x,M1(i,s,x,p,b)):(i=Sf(u.type,null,p,s,s.mode,b),i.ref=s.ref,i.return=s,s.child=i)}if(x=i.child,!Jg(i,b)){var N=x.memoizedProps;if(u=u.compare,u=u!==null?u:Qc,u(N,p)&&i.ref===s.ref)return Sa(i,s,b)}return s.flags|=1,i=ga(x,p),i.ref=s.ref,i.return=s,s.child=i}function M1(i,s,u,p,b){if(i!==null){var x=i.memoizedProps;if(Qc(x,p)&&i.ref===s.ref)if(Wn=!1,s.pendingProps=p=x,Jg(i,b))(i.flags&131072)!==0&&(Wn=!0);else return s.lanes=i.lanes,Sa(i,s,b)}return Yg(i,s,u,p,b)}function O1(i,s,u,p){var b=p.children,x=i!==null?i.memoizedState:null;if(i===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),p.mode==="hidden"){if((s.flags&128)!==0){if(x=x!==null?x.baseLanes|u:u,i!==null){for(p=s.child=i.child,b=0;p!==null;)b=b|p.lanes|p.childLanes,p=p.sibling;p=b&~x}else p=0,s.child=null;return A1(i,s,x,u,p)}if((u&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},i!==null&&Rf(s,x!==null?x.cachePool:null),x!==null?DS(s,x):Sg(),IS(s);else return p=s.lanes=536870912,A1(i,s,x!==null?x.baseLanes|u:u,u,p)}else x!==null?(Rf(s,x.cachePool),DS(s,x),ao(),s.memoizedState=null):(i!==null&&Rf(s,null),Sg(),ao());return dr(i,s,b,u),s.child}function fu(i,s){return i!==null&&i.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function A1(i,s,u,p,b){var x=gg();return x=x===null?null:{parent:$n._currentValue,pool:x},s.memoizedState={baseLanes:u,cachePool:x},i!==null&&Rf(s,null),Sg(),IS(s),i!==null&&yl(i,s,p,!0),s.childLanes=b,null}function Uf(i,s){return s=Vf({mode:s.mode,children:s.children},i.mode),s.ref=i.ref,i.child=s,s.return=i,s}function N1(i,s,u){return ps(s,i.child,null,u),i=Uf(s,s.pendingProps),i.flags|=2,Gr(s),s.memoizedState=null,i}function ZI(i,s,u){var p=s.pendingProps,b=(s.flags&128)!==0;if(s.flags&=-129,i===null){if(tn){if(p.mode==="hidden")return i=Uf(s,p),s.lanes=536870912,fu(null,i);if(Cg(s),(i=Tn)?(i=qE(i,fi),i=i!==null&&i.data==="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:Qa!==null?{id:$i,overflow:Yi}:null,retryLane:536870912,hydrationErrors:null},u=pS(i),u.return=s,s.child=u,cr=s,Tn=null)):i=null,i===null)throw Ja(s);return s.lanes=536870912,null}return Uf(s,p)}var x=i.memoizedState;if(x!==null){var N=x.dehydrated;if(Cg(s),b)if(s.flags&256)s.flags&=-257,s=N1(i,s,u);else if(s.memoizedState!==null)s.child=i.child,s.flags|=128,s=null;else throw Error(r(558));else if(Wn||yl(i,s,u,!1),b=(u&i.childLanes)!==0,Wn||b){if(p=wn,p!==null&&(N=ie(p,u),N!==0&&N!==x.retryLane))throw x.retryLane=N,os(i,N),Lr(p,i,N),$g;Jf(),s=N1(i,s,u)}else i=x.treeContext,Tn=pi(N.nextSibling),cr=s,tn=!0,Za=null,fi=!1,i!==null&&yS(s,i),s=Uf(s,p),s.flags|=4096;return s}return i=ga(i.child,{mode:p.mode,children:p.children}),i.ref=s.ref,s.child=i,i.return=s,i}function qf(i,s){var u=s.ref;if(u===null)i!==null&&i.ref!==null&&(s.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(r(284));(i===null||i.ref!==u)&&(s.flags|=4194816)}}function Yg(i,s,u,p,b){return us(s),u=Rg(i,s,u,p,void 0,b),p=kg(),i!==null&&!Wn?(Mg(i,s,b),Sa(i,s,b)):(tn&&p&&sg(s),s.flags|=1,dr(i,s,u,b),s.child)}function D1(i,s,u,p,b,x){return us(s),s.updateQueue=null,u=LS(s,p,u,b),PS(i),p=kg(),i!==null&&!Wn?(Mg(i,s,x),Sa(i,s,x)):(tn&&p&&sg(s),s.flags|=1,dr(i,s,u,x),s.child)}function I1(i,s,u,p,b){if(us(s),s.stateNode===null){var x=hl,N=u.contextType;typeof N=="object"&&N!==null&&(x=ur(N)),x=new u(p,x),s.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=qg,s.stateNode=x,x._reactInternals=s,x=s.stateNode,x.props=p,x.state=s.memoizedState,x.refs={},bg(s),N=u.contextType,x.context=typeof N=="object"&&N!==null?ur(N):hl,x.state=s.memoizedState,N=u.getDerivedStateFromProps,typeof N=="function"&&(Ug(s,u,N,p),x.state=s.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(N=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),N!==x.state&&qg.enqueueReplaceState(x,x.state,null),su(s,p,x,b),ou(),x.state=s.memoizedState),typeof x.componentDidMount=="function"&&(s.flags|=4194308),p=!0}else if(i===null){x=s.stateNode;var Y=s.memoizedProps,ne=gs(u,Y);x.props=ne;var ge=x.context,Me=u.contextType;N=hl,typeof Me=="object"&&Me!==null&&(N=ur(Me));var Ie=u.getDerivedStateFromProps;Me=typeof Ie=="function"||typeof x.getSnapshotBeforeUpdate=="function",Y=s.pendingProps!==Y,Me||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(Y||ge!==N)&&v1(s,x,p,N),to=!1;var be=s.memoizedState;x.state=be,su(s,p,x,b),ou(),ge=s.memoizedState,Y||be!==ge||to?(typeof Ie=="function"&&(Ug(s,u,Ie,p),ge=s.memoizedState),(ne=to||b1(s,u,ne,p,be,ge,N))?(Me||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(s.flags|=4194308)):(typeof x.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=p,s.memoizedState=ge),x.props=p,x.state=ge,x.context=N,p=ne):(typeof x.componentDidMount=="function"&&(s.flags|=4194308),p=!1)}else{x=s.stateNode,vg(i,s),N=s.memoizedProps,Me=gs(u,N),x.props=Me,Ie=s.pendingProps,be=x.context,ge=u.contextType,ne=hl,typeof ge=="object"&&ge!==null&&(ne=ur(ge)),Y=u.getDerivedStateFromProps,(ge=typeof Y=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(N!==Ie||be!==ne)&&v1(s,x,p,ne),to=!1,be=s.memoizedState,x.state=be,su(s,p,x,b),ou();var we=s.memoizedState;N!==Ie||be!==we||to||i!==null&&i.dependencies!==null&&Cf(i.dependencies)?(typeof Y=="function"&&(Ug(s,u,Y,p),we=s.memoizedState),(Me=to||b1(s,u,Me,p,be,we,ne)||i!==null&&i.dependencies!==null&&Cf(i.dependencies))?(ge||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(p,we,ne),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(p,we,ne)),typeof x.componentDidUpdate=="function"&&(s.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof x.componentDidUpdate!="function"||N===i.memoizedProps&&be===i.memoizedState||(s.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||N===i.memoizedProps&&be===i.memoizedState||(s.flags|=1024),s.memoizedProps=p,s.memoizedState=we),x.props=p,x.state=we,x.context=ne,p=Me):(typeof x.componentDidUpdate!="function"||N===i.memoizedProps&&be===i.memoizedState||(s.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||N===i.memoizedProps&&be===i.memoizedState||(s.flags|=1024),p=!1)}return x=p,qf(i,s),p=(s.flags&128)!==0,x||p?(x=s.stateNode,u=p&&typeof u.getDerivedStateFromError!="function"?null:x.render(),s.flags|=1,i!==null&&p?(s.child=ps(s,i.child,null,b),s.child=ps(s,null,u,b)):dr(i,s,u,b),s.memoizedState=x.state,i=s.child):i=Sa(i,s,b),i}function P1(i,s,u,p){return ls(),s.flags|=256,dr(i,s,u,p),s.child}var Wg={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Kg(i){return{baseLanes:i,cachePool:ES()}}function Gg(i,s,u){return i=i!==null?i.childLanes&~u:0,s&&(i|=Qr),i}function L1(i,s,u){var p=s.pendingProps,b=!1,x=(s.flags&128)!==0,N;if((N=x)||(N=i!==null&&i.memoizedState===null?!1:(qn.current&2)!==0),N&&(b=!0,s.flags&=-129),N=(s.flags&32)!==0,s.flags&=-33,i===null){if(tn){if(b?io(s):ao(),(i=Tn)?(i=qE(i,fi),i=i!==null&&i.data!=="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:Qa!==null?{id:$i,overflow:Yi}:null,retryLane:536870912,hydrationErrors:null},u=pS(i),u.return=s,s.child=u,cr=s,Tn=null)):i=null,i===null)throw Ja(s);return Ny(i)?s.lanes=32:s.lanes=536870912,null}var Y=p.children;return p=p.fallback,b?(ao(),b=s.mode,Y=Vf({mode:"hidden",children:Y},b),p=ss(p,b,u,null),Y.return=s,p.return=s,Y.sibling=p,s.child=Y,p=s.child,p.memoizedState=Kg(u),p.childLanes=Gg(i,N,u),s.memoizedState=Wg,fu(null,p)):(io(s),Xg(s,Y))}var ne=i.memoizedState;if(ne!==null&&(Y=ne.dehydrated,Y!==null)){if(x)s.flags&256?(io(s),s.flags&=-257,s=Qg(i,s,u)):s.memoizedState!==null?(ao(),s.child=i.child,s.flags|=128,s=null):(ao(),Y=p.fallback,b=s.mode,p=Vf({mode:"visible",children:p.children},b),Y=ss(Y,b,u,null),Y.flags|=2,p.return=s,Y.return=s,p.sibling=Y,s.child=p,ps(s,i.child,null,u),p=s.child,p.memoizedState=Kg(u),p.childLanes=Gg(i,N,u),s.memoizedState=Wg,s=fu(null,p));else if(io(s),Ny(Y)){if(N=Y.nextSibling&&Y.nextSibling.dataset,N)var ge=N.dgst;N=ge,p=Error(r(419)),p.stack="",p.digest=N,eu({value:p,source:null,stack:null}),s=Qg(i,s,u)}else if(Wn||yl(i,s,u,!1),N=(u&i.childLanes)!==0,Wn||N){if(N=wn,N!==null&&(p=ie(N,u),p!==0&&p!==ne.retryLane))throw ne.retryLane=p,os(i,p),Lr(N,i,p),$g;Ay(Y)||Jf(),s=Qg(i,s,u)}else Ay(Y)?(s.flags|=192,s.child=i.child,s=null):(i=ne.treeContext,Tn=pi(Y.nextSibling),cr=s,tn=!0,Za=null,fi=!1,i!==null&&yS(s,i),s=Xg(s,p.children),s.flags|=4096);return s}return b?(ao(),Y=p.fallback,b=s.mode,ne=i.child,ge=ne.sibling,p=ga(ne,{mode:"hidden",children:p.children}),p.subtreeFlags=ne.subtreeFlags&65011712,ge!==null?Y=ga(ge,Y):(Y=ss(Y,b,u,null),Y.flags|=2),Y.return=s,p.return=s,p.sibling=Y,s.child=p,fu(null,p),p=s.child,Y=i.child.memoizedState,Y===null?Y=Kg(u):(b=Y.cachePool,b!==null?(ne=$n._currentValue,b=b.parent!==ne?{parent:ne,pool:ne}:b):b=ES(),Y={baseLanes:Y.baseLanes|u,cachePool:b}),p.memoizedState=Y,p.childLanes=Gg(i,N,u),s.memoizedState=Wg,fu(i.child,p)):(io(s),u=i.child,i=u.sibling,u=ga(u,{mode:"visible",children:p.children}),u.return=s,u.sibling=null,i!==null&&(N=s.deletions,N===null?(s.deletions=[i],s.flags|=16):N.push(i)),s.child=u,s.memoizedState=null,u)}function Xg(i,s){return s=Vf({mode:"visible",children:s},i.mode),s.return=i,i.child=s}function Vf(i,s){return i=Wr(22,i,null,s),i.lanes=0,i}function Qg(i,s,u){return ps(s,i.child,null,u),i=Xg(s,s.pendingProps.children),i.flags|=2,s.memoizedState=null,i}function _1(i,s,u){i.lanes|=s;var p=i.alternate;p!==null&&(p.lanes|=s),fg(i.return,s,u)}function Zg(i,s,u,p,b,x){var N=i.memoizedState;N===null?i.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:p,tail:u,tailMode:b,treeForkCount:x}:(N.isBackwards=s,N.rendering=null,N.renderingStartTime=0,N.last=p,N.tail=u,N.tailMode=b,N.treeForkCount=x)}function j1(i,s,u){var p=s.pendingProps,b=p.revealOrder,x=p.tail;p=p.children;var N=qn.current,Y=(N&2)!==0;if(Y?(N=N&1|2,s.flags|=128):N&=1,I(qn,N),dr(i,s,p,u),p=tn?Jc:0,!Y&&i!==null&&(i.flags&128)!==0)e:for(i=s.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&_1(i,u,s);else if(i.tag===19)_1(i,u,s);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===s)break e;for(;i.sibling===null;){if(i.return===null||i.return===s)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(b){case"forwards":for(u=s.child,b=null;u!==null;)i=u.alternate,i!==null&&Df(i)===null&&(b=u),u=u.sibling;u=b,u===null?(b=s.child,s.child=null):(b=u.sibling,u.sibling=null),Zg(s,!1,b,u,x,p);break;case"backwards":case"unstable_legacy-backwards":for(u=null,b=s.child,s.child=null;b!==null;){if(i=b.alternate,i!==null&&Df(i)===null){s.child=b;break}i=b.sibling,b.sibling=u,u=b,b=i}Zg(s,!0,u,null,x,p);break;case"together":Zg(s,!1,null,null,void 0,p);break;default:s.memoizedState=null}return s.child}function Sa(i,s,u){if(i!==null&&(s.dependencies=i.dependencies),lo|=s.lanes,(u&s.childLanes)===0)if(i!==null){if(yl(i,s,u,!1),(u&s.childLanes)===0)return null}else return null;if(i!==null&&s.child!==i.child)throw Error(r(153));if(s.child!==null){for(i=s.child,u=ga(i,i.pendingProps),s.child=u,u.return=s;i.sibling!==null;)i=i.sibling,u=u.sibling=ga(i,i.pendingProps),u.return=s;u.sibling=null}return s.child}function Jg(i,s){return(i.lanes&s)!==0?!0:(i=i.dependencies,!!(i!==null&&Cf(i)))}function JI(i,s,u){switch(s.tag){case 3:ue(s,s.stateNode.containerInfo),eo(s,$n,i.memoizedState.cache),ls();break;case 27:case 5:Se(s);break;case 4:ue(s,s.stateNode.containerInfo);break;case 10:eo(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,Cg(s),null;break;case 13:var p=s.memoizedState;if(p!==null)return p.dehydrated!==null?(io(s),s.flags|=128,null):(u&s.child.childLanes)!==0?L1(i,s,u):(io(s),i=Sa(i,s,u),i!==null?i.sibling:null);io(s);break;case 19:var b=(i.flags&128)!==0;if(p=(u&s.childLanes)!==0,p||(yl(i,s,u,!1),p=(u&s.childLanes)!==0),b){if(p)return j1(i,s,u);s.flags|=128}if(b=s.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),I(qn,qn.current),p)break;return null;case 22:return s.lanes=0,O1(i,s,u,s.pendingProps);case 24:eo(s,$n,i.memoizedState.cache)}return Sa(i,s,u)}function z1(i,s,u){if(i!==null)if(i.memoizedProps!==s.pendingProps)Wn=!0;else{if(!Jg(i,u)&&(s.flags&128)===0)return Wn=!1,JI(i,s,u);Wn=(i.flags&131072)!==0}else Wn=!1,tn&&(s.flags&1048576)!==0&&gS(s,Jc,s.index);switch(s.lanes=0,s.tag){case 16:e:{var p=s.pendingProps;if(i=fs(s.elementType),s.type=i,typeof i=="function")ig(i)?(p=gs(i,p),s.tag=1,s=I1(null,s,i,p,u)):(s.tag=0,s=Yg(null,s,i,p,u));else{if(i!=null){var b=i.$$typeof;if(b===M){s.tag=11,s=R1(null,s,i,p,u);break e}else if(b===A){s.tag=14,s=k1(null,s,i,p,u);break e}}throw s=$(i)||i,Error(r(306,s,""))}}return s;case 0:return Yg(i,s,s.type,s.pendingProps,u);case 1:return p=s.type,b=gs(p,s.pendingProps),I1(i,s,p,b,u);case 3:e:{if(ue(s,s.stateNode.containerInfo),i===null)throw Error(r(387));p=s.pendingProps;var x=s.memoizedState;b=x.element,vg(i,s),su(s,p,null,u);var N=s.memoizedState;if(p=N.cache,eo(s,$n,p),p!==x.cache&&hg(s,[$n],u,!0),ou(),p=N.element,x.isDehydrated)if(x={element:p,isDehydrated:!1,cache:N.cache},s.updateQueue.baseState=x,s.memoizedState=x,s.flags&256){s=P1(i,s,p,u);break e}else if(p!==b){b=ci(Error(r(424)),s),eu(b),s=P1(i,s,p,u);break e}else{switch(i=s.stateNode.containerInfo,i.nodeType){case 9:i=i.body;break;default:i=i.nodeName==="HTML"?i.ownerDocument.body:i}for(Tn=pi(i.firstChild),cr=s,tn=!0,Za=null,fi=!0,u=OS(s,null,p,u),s.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(ls(),p===b){s=Sa(i,s,u);break e}dr(i,s,p,u)}s=s.child}return s;case 26:return qf(i,s),i===null?(u=GE(s.type,null,s.pendingProps,null))?s.memoizedState=u:tn||(u=s.type,i=s.pendingProps,p=oh(ae.current).createElement(u),p[We]=s,p[Xe]=i,fr(p,u,i),On(p),s.stateNode=p):s.memoizedState=GE(s.type,i.memoizedProps,s.pendingProps,i.memoizedState),null;case 27:return Se(s),i===null&&tn&&(p=s.stateNode=YE(s.type,s.pendingProps,ae.current),cr=s,fi=!0,b=Tn,po(s.type)?(Dy=b,Tn=pi(p.firstChild)):Tn=b),dr(i,s,s.pendingProps.children,u),qf(i,s),i===null&&(s.flags|=4194304),s.child;case 5:return i===null&&tn&&((b=p=Tn)&&(p=OP(p,s.type,s.pendingProps,fi),p!==null?(s.stateNode=p,cr=s,Tn=pi(p.firstChild),fi=!1,b=!0):b=!1),b||Ja(s)),Se(s),b=s.type,x=s.pendingProps,N=i!==null?i.memoizedProps:null,p=x.children,ky(b,x)?p=null:N!==null&&ky(b,N)&&(s.flags|=32),s.memoizedState!==null&&(b=Rg(i,s,VI,null,null,u),ku._currentValue=b),qf(i,s),dr(i,s,p,u),s.child;case 6:return i===null&&tn&&((i=u=Tn)&&(u=AP(u,s.pendingProps,fi),u!==null?(s.stateNode=u,cr=s,Tn=null,i=!0):i=!1),i||Ja(s)),null;case 13:return L1(i,s,u);case 4:return ue(s,s.stateNode.containerInfo),p=s.pendingProps,i===null?s.child=ps(s,null,p,u):dr(i,s,p,u),s.child;case 11:return R1(i,s,s.type,s.pendingProps,u);case 7:return dr(i,s,s.pendingProps,u),s.child;case 8:return dr(i,s,s.pendingProps.children,u),s.child;case 12:return dr(i,s,s.pendingProps.children,u),s.child;case 10:return p=s.pendingProps,eo(s,s.type,p.value),dr(i,s,p.children,u),s.child;case 9:return b=s.type._context,p=s.pendingProps.children,us(s),b=ur(b),p=p(b),s.flags|=1,dr(i,s,p,u),s.child;case 14:return k1(i,s,s.type,s.pendingProps,u);case 15:return M1(i,s,s.type,s.pendingProps,u);case 19:return j1(i,s,u);case 31:return ZI(i,s,u);case 22:return O1(i,s,u,s.pendingProps);case 24:return us(s),p=ur($n),i===null?(b=gg(),b===null&&(b=wn,x=pg(),b.pooledCache=x,x.refCount++,x!==null&&(b.pooledCacheLanes|=u),b=x),s.memoizedState={parent:p,cache:b},bg(s),eo(s,$n,b)):((i.lanes&u)!==0&&(vg(i,s),su(s,null,null,u),ou()),b=i.memoizedState,x=s.memoizedState,b.parent!==p?(b={parent:p,cache:p},s.memoizedState=b,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=b),eo(s,$n,p)):(p=x.cache,eo(s,$n,p),p!==b.cache&&hg(s,[$n],u,!0))),dr(i,s,s.pendingProps.children,u),s.child;case 29:throw s.pendingProps}throw Error(r(156,s.tag))}function Ea(i){i.flags|=4}function ey(i,s,u,p,b){if((s=(i.mode&32)!==0)&&(s=!1),s){if(i.flags|=16777216,(b&335544128)===b)if(i.stateNode.complete)i.flags|=8192;else if(dE())i.flags|=8192;else throw hs=Mf,yg}else i.flags&=-16777217}function F1(i,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!eC(s))if(dE())i.flags|=8192;else throw hs=Mf,yg}function $f(i,s){s!==null&&(i.flags|=4),i.flags&16384&&(s=i.tag!==22?Rt():536870912,i.lanes|=s,Ol|=s)}function hu(i,s){if(!tn)switch(i.tailMode){case"hidden":s=i.tail;for(var u=null;s!==null;)s.alternate!==null&&(u=s),s=s.sibling;u===null?i.tail=null:u.sibling=null;break;case"collapsed":u=i.tail;for(var p=null;u!==null;)u.alternate!==null&&(p=u),u=u.sibling;p===null?s||i.tail===null?i.tail=null:i.tail.sibling=null:p.sibling=null}}function Rn(i){var s=i.alternate!==null&&i.alternate.child===i.child,u=0,p=0;if(s)for(var b=i.child;b!==null;)u|=b.lanes|b.childLanes,p|=b.subtreeFlags&65011712,p|=b.flags&65011712,b.return=i,b=b.sibling;else for(b=i.child;b!==null;)u|=b.lanes|b.childLanes,p|=b.subtreeFlags,p|=b.flags,b.return=i,b=b.sibling;return i.subtreeFlags|=p,i.childLanes=u,s}function eP(i,s,u){var p=s.pendingProps;switch(lg(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Rn(s),null;case 1:return Rn(s),null;case 3:return u=s.stateNode,p=null,i!==null&&(p=i.memoizedState.cache),s.memoizedState.cache!==p&&(s.flags|=2048),va($n),ve(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(i===null||i.child===null)&&(gl(s)?Ea(s):i===null||i.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,ug())),Rn(s),null;case 26:var b=s.type,x=s.memoizedState;return i===null?(Ea(s),x!==null?(Rn(s),F1(s,x)):(Rn(s),ey(s,b,null,p,u))):x?x!==i.memoizedState?(Ea(s),Rn(s),F1(s,x)):(Rn(s),s.flags&=-16777217):(i=i.memoizedProps,i!==p&&Ea(s),Rn(s),ey(s,b,i,p,u)),null;case 27:if(Le(s),u=ae.current,b=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==p&&Ea(s);else{if(!p){if(s.stateNode===null)throw Error(r(166));return Rn(s),null}i=Q.current,gl(s)?bS(s):(i=YE(b,p,u),s.stateNode=i,Ea(s))}return Rn(s),null;case 5:if(Le(s),b=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==p&&Ea(s);else{if(!p){if(s.stateNode===null)throw Error(r(166));return Rn(s),null}if(x=Q.current,gl(s))bS(s);else{var N=oh(ae.current);switch(x){case 1:x=N.createElementNS("http://www.w3.org/2000/svg",b);break;case 2:x=N.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;default:switch(b){case"svg":x=N.createElementNS("http://www.w3.org/2000/svg",b);break;case"math":x=N.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;case"script":x=N.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof p.is=="string"?N.createElement("select",{is:p.is}):N.createElement("select"),p.multiple?x.multiple=!0:p.size&&(x.size=p.size);break;default:x=typeof p.is=="string"?N.createElement(b,{is:p.is}):N.createElement(b)}}x[We]=s,x[Xe]=p;e:for(N=s.child;N!==null;){if(N.tag===5||N.tag===6)x.appendChild(N.stateNode);else if(N.tag!==4&&N.tag!==27&&N.child!==null){N.child.return=N,N=N.child;continue}if(N===s)break e;for(;N.sibling===null;){if(N.return===null||N.return===s)break e;N=N.return}N.sibling.return=N.return,N=N.sibling}s.stateNode=x;e:switch(fr(x,b,p),b){case"button":case"input":case"select":case"textarea":p=!!p.autoFocus;break e;case"img":p=!0;break e;default:p=!1}p&&Ea(s)}}return Rn(s),ey(s,s.type,i===null?null:i.memoizedProps,s.pendingProps,u),null;case 6:if(i&&s.stateNode!=null)i.memoizedProps!==p&&Ea(s);else{if(typeof p!="string"&&s.stateNode===null)throw Error(r(166));if(i=ae.current,gl(s)){if(i=s.stateNode,u=s.memoizedProps,p=null,b=cr,b!==null)switch(b.tag){case 27:case 5:p=b.memoizedProps}i[We]=s,i=!!(i.nodeValue===u||p!==null&&p.suppressHydrationWarning===!0||LE(i.nodeValue,u)),i||Ja(s,!0)}else i=oh(i).createTextNode(p),i[We]=s,s.stateNode=i}return Rn(s),null;case 31:if(u=s.memoizedState,i===null||i.memoizedState!==null){if(p=gl(s),u!==null){if(i===null){if(!p)throw Error(r(318));if(i=s.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[We]=s}else ls(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Rn(s),i=!1}else u=ug(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=u),i=!0;if(!i)return s.flags&256?(Gr(s),s):(Gr(s),null);if((s.flags&128)!==0)throw Error(r(558))}return Rn(s),null;case 13:if(p=s.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(b=gl(s),p!==null&&p.dehydrated!==null){if(i===null){if(!b)throw Error(r(318));if(b=s.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(r(317));b[We]=s}else ls(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Rn(s),b=!1}else b=ug(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=b),b=!0;if(!b)return s.flags&256?(Gr(s),s):(Gr(s),null)}return Gr(s),(s.flags&128)!==0?(s.lanes=u,s):(u=p!==null,i=i!==null&&i.memoizedState!==null,u&&(p=s.child,b=null,p.alternate!==null&&p.alternate.memoizedState!==null&&p.alternate.memoizedState.cachePool!==null&&(b=p.alternate.memoizedState.cachePool.pool),x=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(x=p.memoizedState.cachePool.pool),x!==b&&(p.flags|=2048)),u!==i&&u&&(s.child.flags|=8192),$f(s,s.updateQueue),Rn(s),null);case 4:return ve(),i===null&&Sy(s.stateNode.containerInfo),Rn(s),null;case 10:return va(s.type),Rn(s),null;case 19:if(G(qn),p=s.memoizedState,p===null)return Rn(s),null;if(b=(s.flags&128)!==0,x=p.rendering,x===null)if(b)hu(p,!1);else{if(jn!==0||i!==null&&(i.flags&128)!==0)for(i=s.child;i!==null;){if(x=Df(i),x!==null){for(s.flags|=128,hu(p,!1),i=x.updateQueue,s.updateQueue=i,$f(s,i),s.subtreeFlags=0,i=u,u=s.child;u!==null;)hS(u,i),u=u.sibling;return I(qn,qn.current&1|2),tn&&ya(s,p.treeForkCount),s.child}i=i.sibling}p.tail!==null&&De()>Xf&&(s.flags|=128,b=!0,hu(p,!1),s.lanes=4194304)}else{if(!b)if(i=Df(x),i!==null){if(s.flags|=128,b=!0,i=i.updateQueue,s.updateQueue=i,$f(s,i),hu(p,!0),p.tail===null&&p.tailMode==="hidden"&&!x.alternate&&!tn)return Rn(s),null}else 2*De()-p.renderingStartTime>Xf&&u!==536870912&&(s.flags|=128,b=!0,hu(p,!1),s.lanes=4194304);p.isBackwards?(x.sibling=s.child,s.child=x):(i=p.last,i!==null?i.sibling=x:s.child=x,p.last=x)}return p.tail!==null?(i=p.tail,p.rendering=i,p.tail=i.sibling,p.renderingStartTime=De(),i.sibling=null,u=qn.current,I(qn,b?u&1|2:u&1),tn&&ya(s,p.treeForkCount),i):(Rn(s),null);case 22:case 23:return Gr(s),Eg(),p=s.memoizedState!==null,i!==null?i.memoizedState!==null!==p&&(s.flags|=8192):p&&(s.flags|=8192),p?(u&536870912)!==0&&(s.flags&128)===0&&(Rn(s),s.subtreeFlags&6&&(s.flags|=8192)):Rn(s),u=s.updateQueue,u!==null&&$f(s,u.retryQueue),u=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),p=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(p=s.memoizedState.cachePool.pool),p!==u&&(s.flags|=2048),i!==null&&G(ds),null;case 24:return u=null,i!==null&&(u=i.memoizedState.cache),s.memoizedState.cache!==u&&(s.flags|=2048),va($n),Rn(s),null;case 25:return null;case 30:return null}throw Error(r(156,s.tag))}function tP(i,s){switch(lg(s),s.tag){case 1:return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 3:return va($n),ve(),i=s.flags,(i&65536)!==0&&(i&128)===0?(s.flags=i&-65537|128,s):null;case 26:case 27:case 5:return Le(s),null;case 31:if(s.memoizedState!==null){if(Gr(s),s.alternate===null)throw Error(r(340));ls()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 13:if(Gr(s),i=s.memoizedState,i!==null&&i.dehydrated!==null){if(s.alternate===null)throw Error(r(340));ls()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 19:return G(qn),null;case 4:return ve(),null;case 10:return va(s.type),null;case 22:case 23:return Gr(s),Eg(),i!==null&&G(ds),i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 24:return va($n),null;case 25:return null;default:return null}}function B1(i,s){switch(lg(s),s.tag){case 3:va($n),ve();break;case 26:case 27:case 5:Le(s);break;case 4:ve();break;case 31:s.memoizedState!==null&&Gr(s);break;case 13:Gr(s);break;case 19:G(qn);break;case 10:va(s.type);break;case 22:case 23:Gr(s),Eg(),i!==null&&G(ds);break;case 24:va($n)}}function pu(i,s){try{var u=s.updateQueue,p=u!==null?u.lastEffect:null;if(p!==null){var b=p.next;u=b;do{if((u.tag&i)===i){p=void 0;var x=u.create,N=u.inst;p=x(),N.destroy=p}u=u.next}while(u!==b)}}catch(Y){yn(s,s.return,Y)}}function oo(i,s,u){try{var p=s.updateQueue,b=p!==null?p.lastEffect:null;if(b!==null){var x=b.next;p=x;do{if((p.tag&i)===i){var N=p.inst,Y=N.destroy;if(Y!==void 0){N.destroy=void 0,b=s;var ne=u,ge=Y;try{ge()}catch(Me){yn(b,ne,Me)}}}p=p.next}while(p!==x)}}catch(Me){yn(s,s.return,Me)}}function H1(i){var s=i.updateQueue;if(s!==null){var u=i.stateNode;try{NS(s,u)}catch(p){yn(i,i.return,p)}}}function U1(i,s,u){u.props=gs(i.type,i.memoizedProps),u.state=i.memoizedState;try{u.componentWillUnmount()}catch(p){yn(i,s,p)}}function mu(i,s){try{var u=i.ref;if(u!==null){switch(i.tag){case 26:case 27:case 5:var p=i.stateNode;break;case 30:p=i.stateNode;break;default:p=i.stateNode}typeof u=="function"?i.refCleanup=u(p):u.current=p}}catch(b){yn(i,s,b)}}function Wi(i,s){var u=i.ref,p=i.refCleanup;if(u!==null)if(typeof p=="function")try{p()}catch(b){yn(i,s,b)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(b){yn(i,s,b)}else u.current=null}function q1(i){var s=i.type,u=i.memoizedProps,p=i.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":u.autoFocus&&p.focus();break e;case"img":u.src?p.src=u.src:u.srcSet&&(p.srcset=u.srcSet)}}catch(b){yn(i,i.return,b)}}function ty(i,s,u){try{var p=i.stateNode;EP(p,i.type,u,s),p[Xe]=s}catch(b){yn(i,i.return,b)}}function V1(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&po(i.type)||i.tag===4}function ny(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||V1(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&po(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function ry(i,s,u){var p=i.tag;if(p===5||p===6)i=i.stateNode,s?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(i,s):(s=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,s.appendChild(i),u=u._reactRootContainer,u!=null||s.onclick!==null||(s.onclick=pa));else if(p!==4&&(p===27&&po(i.type)&&(u=i.stateNode,s=null),i=i.child,i!==null))for(ry(i,s,u),i=i.sibling;i!==null;)ry(i,s,u),i=i.sibling}function Yf(i,s,u){var p=i.tag;if(p===5||p===6)i=i.stateNode,s?u.insertBefore(i,s):u.appendChild(i);else if(p!==4&&(p===27&&po(i.type)&&(u=i.stateNode),i=i.child,i!==null))for(Yf(i,s,u),i=i.sibling;i!==null;)Yf(i,s,u),i=i.sibling}function $1(i){var s=i.stateNode,u=i.memoizedProps;try{for(var p=i.type,b=s.attributes;b.length;)s.removeAttributeNode(b[0]);fr(s,p,u),s[We]=i,s[Xe]=u}catch(x){yn(i,i.return,x)}}var Ca=!1,Kn=!1,iy=!1,Y1=typeof WeakSet=="function"?WeakSet:Set,ir=null;function nP(i,s){if(i=i.containerInfo,Ty=hh,i=iS(i),Qm(i)){if("selectionStart"in i)var u={start:i.selectionStart,end:i.selectionEnd};else e:{u=(u=i.ownerDocument)&&u.defaultView||window;var p=u.getSelection&&u.getSelection();if(p&&p.rangeCount!==0){u=p.anchorNode;var b=p.anchorOffset,x=p.focusNode;p=p.focusOffset;try{u.nodeType,x.nodeType}catch{u=null;break e}var N=0,Y=-1,ne=-1,ge=0,Me=0,Ie=i,be=null;t:for(;;){for(var we;Ie!==u||b!==0&&Ie.nodeType!==3||(Y=N+b),Ie!==x||p!==0&&Ie.nodeType!==3||(ne=N+p),Ie.nodeType===3&&(N+=Ie.nodeValue.length),(we=Ie.firstChild)!==null;)be=Ie,Ie=we;for(;;){if(Ie===i)break t;if(be===u&&++ge===b&&(Y=N),be===x&&++Me===p&&(ne=N),(we=Ie.nextSibling)!==null)break;Ie=be,be=Ie.parentNode}Ie=we}u=Y===-1||ne===-1?null:{start:Y,end:ne}}else u=null}u=u||{start:0,end:0}}else u=null;for(Ry={focusedElem:i,selectionRange:u},hh=!1,ir=s;ir!==null;)if(s=ir,i=s.child,(s.subtreeFlags&1028)!==0&&i!==null)i.return=s,ir=i;else for(;ir!==null;){switch(s=ir,x=s.alternate,i=s.flags,s.tag){case 0:if((i&4)!==0&&(i=s.updateQueue,i=i!==null?i.events:null,i!==null))for(u=0;u<i.length;u++)b=i[u],b.ref.impl=b.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&x!==null){i=void 0,u=s,b=x.memoizedProps,x=x.memoizedState,p=u.stateNode;try{var st=gs(u.type,b);i=p.getSnapshotBeforeUpdate(st,x),p.__reactInternalSnapshotBeforeUpdate=i}catch(wt){yn(u,u.return,wt)}}break;case 3:if((i&1024)!==0){if(i=s.stateNode.containerInfo,u=i.nodeType,u===9)Oy(i);else if(u===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":Oy(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(r(163))}if(i=s.sibling,i!==null){i.return=s.return,ir=i;break}ir=s.return}}function W1(i,s,u){var p=u.flags;switch(u.tag){case 0:case 11:case 15:Ra(i,u),p&4&&pu(5,u);break;case 1:if(Ra(i,u),p&4)if(i=u.stateNode,s===null)try{i.componentDidMount()}catch(N){yn(u,u.return,N)}else{var b=gs(u.type,s.memoizedProps);s=s.memoizedState;try{i.componentDidUpdate(b,s,i.__reactInternalSnapshotBeforeUpdate)}catch(N){yn(u,u.return,N)}}p&64&&H1(u),p&512&&mu(u,u.return);break;case 3:if(Ra(i,u),p&64&&(i=u.updateQueue,i!==null)){if(s=null,u.child!==null)switch(u.child.tag){case 27:case 5:s=u.child.stateNode;break;case 1:s=u.child.stateNode}try{NS(i,s)}catch(N){yn(u,u.return,N)}}break;case 27:s===null&&p&4&&$1(u);case 26:case 5:Ra(i,u),s===null&&p&4&&q1(u),p&512&&mu(u,u.return);break;case 12:Ra(i,u);break;case 31:Ra(i,u),p&4&&X1(i,u);break;case 13:Ra(i,u),p&4&&Q1(i,u),p&64&&(i=u.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(u=dP.bind(null,u),NP(i,u))));break;case 22:if(p=u.memoizedState!==null||Ca,!p){s=s!==null&&s.memoizedState!==null||Kn,b=Ca;var x=Kn;Ca=p,(Kn=s)&&!x?ka(i,u,(u.subtreeFlags&8772)!==0):Ra(i,u),Ca=b,Kn=x}break;case 30:break;default:Ra(i,u)}}function K1(i){var s=i.alternate;s!==null&&(i.alternate=null,K1(s)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(s=i.stateNode,s!==null&&Pn(s)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var An=null,Nr=!1;function Ta(i,s,u){for(u=u.child;u!==null;)G1(i,s,u),u=u.sibling}function G1(i,s,u){if(ze&&typeof ze.onCommitFiberUnmount=="function")try{ze.onCommitFiberUnmount(et,u)}catch{}switch(u.tag){case 26:Kn||Wi(u,s),Ta(i,s,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:Kn||Wi(u,s);var p=An,b=Nr;po(u.type)&&(An=u.stateNode,Nr=!1),Ta(i,s,u),Cu(u.stateNode),An=p,Nr=b;break;case 5:Kn||Wi(u,s);case 6:if(p=An,b=Nr,An=null,Ta(i,s,u),An=p,Nr=b,An!==null)if(Nr)try{(An.nodeType===9?An.body:An.nodeName==="HTML"?An.ownerDocument.body:An).removeChild(u.stateNode)}catch(x){yn(u,s,x)}else try{An.removeChild(u.stateNode)}catch(x){yn(u,s,x)}break;case 18:An!==null&&(Nr?(i=An,HE(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,u.stateNode),jl(i)):HE(An,u.stateNode));break;case 4:p=An,b=Nr,An=u.stateNode.containerInfo,Nr=!0,Ta(i,s,u),An=p,Nr=b;break;case 0:case 11:case 14:case 15:oo(2,u,s),Kn||oo(4,u,s),Ta(i,s,u);break;case 1:Kn||(Wi(u,s),p=u.stateNode,typeof p.componentWillUnmount=="function"&&U1(u,s,p)),Ta(i,s,u);break;case 21:Ta(i,s,u);break;case 22:Kn=(p=Kn)||u.memoizedState!==null,Ta(i,s,u),Kn=p;break;default:Ta(i,s,u)}}function X1(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{jl(i)}catch(u){yn(s,s.return,u)}}}function Q1(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{jl(i)}catch(u){yn(s,s.return,u)}}function rP(i){switch(i.tag){case 31:case 13:case 19:var s=i.stateNode;return s===null&&(s=i.stateNode=new Y1),s;case 22:return i=i.stateNode,s=i._retryCache,s===null&&(s=i._retryCache=new Y1),s;default:throw Error(r(435,i.tag))}}function Wf(i,s){var u=rP(i);s.forEach(function(p){if(!u.has(p)){u.add(p);var b=fP.bind(null,i,p);p.then(b,b)}})}function Dr(i,s){var u=s.deletions;if(u!==null)for(var p=0;p<u.length;p++){var b=u[p],x=i,N=s,Y=N;e:for(;Y!==null;){switch(Y.tag){case 27:if(po(Y.type)){An=Y.stateNode,Nr=!1;break e}break;case 5:An=Y.stateNode,Nr=!1;break e;case 3:case 4:An=Y.stateNode.containerInfo,Nr=!0;break e}Y=Y.return}if(An===null)throw Error(r(160));G1(x,N,b),An=null,Nr=!1,x=b.alternate,x!==null&&(x.return=null),b.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)Z1(s,i),s=s.sibling}var Ni=null;function Z1(i,s){var u=i.alternate,p=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:Dr(s,i),Ir(i),p&4&&(oo(3,i,i.return),pu(3,i),oo(5,i,i.return));break;case 1:Dr(s,i),Ir(i),p&512&&(Kn||u===null||Wi(u,u.return)),p&64&&Ca&&(i=i.updateQueue,i!==null&&(p=i.callbacks,p!==null&&(u=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=u===null?p:u.concat(p))));break;case 26:var b=Ni;if(Dr(s,i),Ir(i),p&512&&(Kn||u===null||Wi(u,u.return)),p&4){var x=u!==null?u.memoizedState:null;if(p=i.memoizedState,u===null)if(p===null)if(i.stateNode===null){e:{p=i.type,u=i.memoizedProps,b=b.ownerDocument||b;t:switch(p){case"title":x=b.getElementsByTagName("title")[0],(!x||x[Nn]||x[We]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=b.createElement(p),b.head.insertBefore(x,b.querySelector("head > title"))),fr(x,p,u),x[We]=i,On(x),p=x;break e;case"link":var N=ZE("link","href",b).get(p+(u.href||""));if(N){for(var Y=0;Y<N.length;Y++)if(x=N[Y],x.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&x.getAttribute("rel")===(u.rel==null?null:u.rel)&&x.getAttribute("title")===(u.title==null?null:u.title)&&x.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){N.splice(Y,1);break t}}x=b.createElement(p),fr(x,p,u),b.head.appendChild(x);break;case"meta":if(N=ZE("meta","content",b).get(p+(u.content||""))){for(Y=0;Y<N.length;Y++)if(x=N[Y],x.getAttribute("content")===(u.content==null?null:""+u.content)&&x.getAttribute("name")===(u.name==null?null:u.name)&&x.getAttribute("property")===(u.property==null?null:u.property)&&x.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&x.getAttribute("charset")===(u.charSet==null?null:u.charSet)){N.splice(Y,1);break t}}x=b.createElement(p),fr(x,p,u),b.head.appendChild(x);break;default:throw Error(r(468,p))}x[We]=i,On(x),p=x}i.stateNode=p}else JE(b,i.type,i.stateNode);else i.stateNode=QE(b,p,i.memoizedProps);else x!==p?(x===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):x.count--,p===null?JE(b,i.type,i.stateNode):QE(b,p,i.memoizedProps)):p===null&&i.stateNode!==null&&ty(i,i.memoizedProps,u.memoizedProps)}break;case 27:Dr(s,i),Ir(i),p&512&&(Kn||u===null||Wi(u,u.return)),u!==null&&p&4&&ty(i,i.memoizedProps,u.memoizedProps);break;case 5:if(Dr(s,i),Ir(i),p&512&&(Kn||u===null||Wi(u,u.return)),i.flags&32){b=i.stateNode;try{ol(b,"")}catch(st){yn(i,i.return,st)}}p&4&&i.stateNode!=null&&(b=i.memoizedProps,ty(i,b,u!==null?u.memoizedProps:b)),p&1024&&(iy=!0);break;case 6:if(Dr(s,i),Ir(i),p&4){if(i.stateNode===null)throw Error(r(162));p=i.memoizedProps,u=i.stateNode;try{u.nodeValue=p}catch(st){yn(i,i.return,st)}}break;case 3:if(ch=null,b=Ni,Ni=sh(s.containerInfo),Dr(s,i),Ni=b,Ir(i),p&4&&u!==null&&u.memoizedState.isDehydrated)try{jl(s.containerInfo)}catch(st){yn(i,i.return,st)}iy&&(iy=!1,J1(i));break;case 4:p=Ni,Ni=sh(i.stateNode.containerInfo),Dr(s,i),Ir(i),Ni=p;break;case 12:Dr(s,i),Ir(i);break;case 31:Dr(s,i),Ir(i),p&4&&(p=i.updateQueue,p!==null&&(i.updateQueue=null,Wf(i,p)));break;case 13:Dr(s,i),Ir(i),i.child.flags&8192&&i.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(Gf=De()),p&4&&(p=i.updateQueue,p!==null&&(i.updateQueue=null,Wf(i,p)));break;case 22:b=i.memoizedState!==null;var ne=u!==null&&u.memoizedState!==null,ge=Ca,Me=Kn;if(Ca=ge||b,Kn=Me||ne,Dr(s,i),Kn=Me,Ca=ge,Ir(i),p&8192)e:for(s=i.stateNode,s._visibility=b?s._visibility&-2:s._visibility|1,b&&(u===null||ne||Ca||Kn||ys(i)),u=null,s=i;;){if(s.tag===5||s.tag===26){if(u===null){ne=u=s;try{if(x=ne.stateNode,b)N=x.style,typeof N.setProperty=="function"?N.setProperty("display","none","important"):N.display="none";else{Y=ne.stateNode;var Ie=ne.memoizedProps.style,be=Ie!=null&&Ie.hasOwnProperty("display")?Ie.display:null;Y.style.display=be==null||typeof be=="boolean"?"":(""+be).trim()}}catch(st){yn(ne,ne.return,st)}}}else if(s.tag===6){if(u===null){ne=s;try{ne.stateNode.nodeValue=b?"":ne.memoizedProps}catch(st){yn(ne,ne.return,st)}}}else if(s.tag===18){if(u===null){ne=s;try{var we=ne.stateNode;b?UE(we,!0):UE(ne.stateNode,!1)}catch(st){yn(ne,ne.return,st)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===i)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break e;for(;s.sibling===null;){if(s.return===null||s.return===i)break e;u===s&&(u=null),s=s.return}u===s&&(u=null),s.sibling.return=s.return,s=s.sibling}p&4&&(p=i.updateQueue,p!==null&&(u=p.retryQueue,u!==null&&(p.retryQueue=null,Wf(i,u))));break;case 19:Dr(s,i),Ir(i),p&4&&(p=i.updateQueue,p!==null&&(i.updateQueue=null,Wf(i,p)));break;case 30:break;case 21:break;default:Dr(s,i),Ir(i)}}function Ir(i){var s=i.flags;if(s&2){try{for(var u,p=i.return;p!==null;){if(V1(p)){u=p;break}p=p.return}if(u==null)throw Error(r(160));switch(u.tag){case 27:var b=u.stateNode,x=ny(i);Yf(i,x,b);break;case 5:var N=u.stateNode;u.flags&32&&(ol(N,""),u.flags&=-33);var Y=ny(i);Yf(i,Y,N);break;case 3:case 4:var ne=u.stateNode.containerInfo,ge=ny(i);ry(i,ge,ne);break;default:throw Error(r(161))}}catch(Me){yn(i,i.return,Me)}i.flags&=-3}s&4096&&(i.flags&=-4097)}function J1(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var s=i;J1(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),i=i.sibling}}function Ra(i,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)W1(i,s.alternate,s),s=s.sibling}function ys(i){for(i=i.child;i!==null;){var s=i;switch(s.tag){case 0:case 11:case 14:case 15:oo(4,s,s.return),ys(s);break;case 1:Wi(s,s.return);var u=s.stateNode;typeof u.componentWillUnmount=="function"&&U1(s,s.return,u),ys(s);break;case 27:Cu(s.stateNode);case 26:case 5:Wi(s,s.return),ys(s);break;case 22:s.memoizedState===null&&ys(s);break;case 30:ys(s);break;default:ys(s)}i=i.sibling}}function ka(i,s,u){for(u=u&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var p=s.alternate,b=i,x=s,N=x.flags;switch(x.tag){case 0:case 11:case 15:ka(b,x,u),pu(4,x);break;case 1:if(ka(b,x,u),p=x,b=p.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(ge){yn(p,p.return,ge)}if(p=x,b=p.updateQueue,b!==null){var Y=p.stateNode;try{var ne=b.shared.hiddenCallbacks;if(ne!==null)for(b.shared.hiddenCallbacks=null,b=0;b<ne.length;b++)AS(ne[b],Y)}catch(ge){yn(p,p.return,ge)}}u&&N&64&&H1(x),mu(x,x.return);break;case 27:$1(x);case 26:case 5:ka(b,x,u),u&&p===null&&N&4&&q1(x),mu(x,x.return);break;case 12:ka(b,x,u);break;case 31:ka(b,x,u),u&&N&4&&X1(b,x);break;case 13:ka(b,x,u),u&&N&4&&Q1(b,x);break;case 22:x.memoizedState===null&&ka(b,x,u),mu(x,x.return);break;case 30:break;default:ka(b,x,u)}s=s.sibling}}function ay(i,s){var u=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),i=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(i=s.memoizedState.cachePool.pool),i!==u&&(i!=null&&i.refCount++,u!=null&&tu(u))}function oy(i,s){i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&tu(i))}function Di(i,s,u,p){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)eE(i,s,u,p),s=s.sibling}function eE(i,s,u,p){var b=s.flags;switch(s.tag){case 0:case 11:case 15:Di(i,s,u,p),b&2048&&pu(9,s);break;case 1:Di(i,s,u,p);break;case 3:Di(i,s,u,p),b&2048&&(i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&tu(i)));break;case 12:if(b&2048){Di(i,s,u,p),i=s.stateNode;try{var x=s.memoizedProps,N=x.id,Y=x.onPostCommit;typeof Y=="function"&&Y(N,s.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(ne){yn(s,s.return,ne)}}else Di(i,s,u,p);break;case 31:Di(i,s,u,p);break;case 13:Di(i,s,u,p);break;case 23:break;case 22:x=s.stateNode,N=s.alternate,s.memoizedState!==null?x._visibility&2?Di(i,s,u,p):gu(i,s):x._visibility&2?Di(i,s,u,p):(x._visibility|=2,Rl(i,s,u,p,(s.subtreeFlags&10256)!==0||!1)),b&2048&&ay(N,s);break;case 24:Di(i,s,u,p),b&2048&&oy(s.alternate,s);break;default:Di(i,s,u,p)}}function Rl(i,s,u,p,b){for(b=b&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var x=i,N=s,Y=u,ne=p,ge=N.flags;switch(N.tag){case 0:case 11:case 15:Rl(x,N,Y,ne,b),pu(8,N);break;case 23:break;case 22:var Me=N.stateNode;N.memoizedState!==null?Me._visibility&2?Rl(x,N,Y,ne,b):gu(x,N):(Me._visibility|=2,Rl(x,N,Y,ne,b)),b&&ge&2048&&ay(N.alternate,N);break;case 24:Rl(x,N,Y,ne,b),b&&ge&2048&&oy(N.alternate,N);break;default:Rl(x,N,Y,ne,b)}s=s.sibling}}function gu(i,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var u=i,p=s,b=p.flags;switch(p.tag){case 22:gu(u,p),b&2048&&ay(p.alternate,p);break;case 24:gu(u,p),b&2048&&oy(p.alternate,p);break;default:gu(u,p)}s=s.sibling}}var yu=8192;function kl(i,s,u){if(i.subtreeFlags&yu)for(i=i.child;i!==null;)tE(i,s,u),i=i.sibling}function tE(i,s,u){switch(i.tag){case 26:kl(i,s,u),i.flags&yu&&i.memoizedState!==null&&qP(u,Ni,i.memoizedState,i.memoizedProps);break;case 5:kl(i,s,u);break;case 3:case 4:var p=Ni;Ni=sh(i.stateNode.containerInfo),kl(i,s,u),Ni=p;break;case 22:i.memoizedState===null&&(p=i.alternate,p!==null&&p.memoizedState!==null?(p=yu,yu=16777216,kl(i,s,u),yu=p):kl(i,s,u));break;default:kl(i,s,u)}}function nE(i){var s=i.alternate;if(s!==null&&(i=s.child,i!==null)){s.child=null;do s=i.sibling,i.sibling=null,i=s;while(i!==null)}}function bu(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var u=0;u<s.length;u++){var p=s[u];ir=p,iE(p,i)}nE(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)rE(i),i=i.sibling}function rE(i){switch(i.tag){case 0:case 11:case 15:bu(i),i.flags&2048&&oo(9,i,i.return);break;case 3:bu(i);break;case 12:bu(i);break;case 22:var s=i.stateNode;i.memoizedState!==null&&s._visibility&2&&(i.return===null||i.return.tag!==13)?(s._visibility&=-3,Kf(i)):bu(i);break;default:bu(i)}}function Kf(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var u=0;u<s.length;u++){var p=s[u];ir=p,iE(p,i)}nE(i)}for(i=i.child;i!==null;){switch(s=i,s.tag){case 0:case 11:case 15:oo(8,s,s.return),Kf(s);break;case 22:u=s.stateNode,u._visibility&2&&(u._visibility&=-3,Kf(s));break;default:Kf(s)}i=i.sibling}}function iE(i,s){for(;ir!==null;){var u=ir;switch(u.tag){case 0:case 11:case 15:oo(8,u,s);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var p=u.memoizedState.cachePool.pool;p!=null&&p.refCount++}break;case 24:tu(u.memoizedState.cache)}if(p=u.child,p!==null)p.return=u,ir=p;else e:for(u=i;ir!==null;){p=ir;var b=p.sibling,x=p.return;if(K1(p),p===u){ir=null;break e}if(b!==null){b.return=x,ir=b;break e}ir=x}}}var iP={getCacheForType:function(i){var s=ur($n),u=s.data.get(i);return u===void 0&&(u=i(),s.data.set(i,u)),u},cacheSignal:function(){return ur($n).controller.signal}},aP=typeof WeakMap=="function"?WeakMap:Map,fn=0,wn=null,Yt=null,Gt=0,gn=0,Xr=null,so=!1,Ml=!1,sy=!1,Ma=0,jn=0,lo=0,bs=0,ly=0,Qr=0,Ol=0,vu=null,Pr=null,cy=!1,Gf=0,aE=0,Xf=1/0,Qf=null,co=null,Zn=0,uo=null,Al=null,Oa=0,uy=0,dy=null,oE=null,xu=0,fy=null;function Zr(){return(fn&2)!==0&&Gt!==0?Gt&-Gt:j.T!==null?by():je()}function sE(){if(Qr===0)if((Gt&536870912)===0||tn){var i=it;it<<=1,(it&3932160)===0&&(it=262144),Qr=i}else Qr=536870912;return i=Kr.current,i!==null&&(i.flags|=32),Qr}function Lr(i,s,u){(i===wn&&(gn===2||gn===9)||i.cancelPendingCommit!==null)&&(Nl(i,0),fo(i,Gt,Qr,!1)),Ut(i,u),((fn&2)===0||i!==wn)&&(i===wn&&((fn&2)===0&&(bs|=u),jn===4&&fo(i,Gt,Qr,!1)),Ki(i))}function lE(i,s,u){if((fn&6)!==0)throw Error(r(327));var p=!u&&(s&127)===0&&(s&i.expiredLanes)===0||kt(i,s),b=p?lP(i,s):py(i,s,!0),x=p;do{if(b===0){Ml&&!p&&fo(i,s,0,!1);break}else{if(u=i.current.alternate,x&&!oP(u)){b=py(i,s,!1),x=!1;continue}if(b===2){if(x=s,i.errorRecoveryDisabledLanes&x)var N=0;else N=i.pendingLanes&-536870913,N=N!==0?N:N&536870912?536870912:0;if(N!==0){s=N;e:{var Y=i;b=vu;var ne=Y.current.memoizedState.isDehydrated;if(ne&&(Nl(Y,N).flags|=256),N=py(Y,N,!1),N!==2){if(sy&&!ne){Y.errorRecoveryDisabledLanes|=x,bs|=x,b=4;break e}x=Pr,Pr=b,x!==null&&(Pr===null?Pr=x:Pr.push.apply(Pr,x))}b=N}if(x=!1,b!==2)continue}}if(b===1){Nl(i,0),fo(i,s,0,!0);break}e:{switch(p=i,x=b,x){case 0:case 1:throw Error(r(345));case 4:if((s&4194048)!==s)break;case 6:fo(p,s,Qr,!so);break e;case 2:Pr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((s&62914560)===s&&(b=Gf+300-De(),10<b)){if(fo(p,s,Qr,!so),Ke(p,0,!0)!==0)break e;Oa=s,p.timeoutHandle=FE(cE.bind(null,p,u,Pr,Qf,cy,s,Qr,bs,Ol,so,x,"Throttled",-0,0),b);break e}cE(p,u,Pr,Qf,cy,s,Qr,bs,Ol,so,x,null,-0,0)}}break}while(!0);Ki(i)}function cE(i,s,u,p,b,x,N,Y,ne,ge,Me,Ie,be,we){if(i.timeoutHandle=-1,Ie=s.subtreeFlags,Ie&8192||(Ie&16785408)===16785408){Ie={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:pa},tE(s,x,Ie);var st=(x&62914560)===x?Gf-De():(x&4194048)===x?aE-De():0;if(st=VP(Ie,st),st!==null){Oa=x,i.cancelPendingCommit=st(yE.bind(null,i,s,x,u,p,b,N,Y,ne,Me,Ie,null,be,we)),fo(i,x,N,!ge);return}}yE(i,s,x,u,p,b,N,Y,ne)}function oP(i){for(var s=i;;){var u=s.tag;if((u===0||u===11||u===15)&&s.flags&16384&&(u=s.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var p=0;p<u.length;p++){var b=u[p],x=b.getSnapshot;b=b.value;try{if(!Yr(x(),b))return!1}catch{return!1}}if(u=s.child,s.subtreeFlags&16384&&u!==null)u.return=s,s=u;else{if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function fo(i,s,u,p){s&=~ly,s&=~bs,i.suspendedLanes|=s,i.pingedLanes&=~s,p&&(i.warmLanes|=s),p=i.expirationTimes;for(var b=s;0<b;){var x=31-tt(b),N=1<<x;p[x]=-1,b&=~N}u!==0&&Mt(i,u,s)}function Zf(){return(fn&6)===0?(wu(0),!1):!0}function hy(){if(Yt!==null){if(gn===0)var i=Yt.return;else i=Yt,ba=cs=null,Og(i),wl=null,ru=0,i=Yt;for(;i!==null;)B1(i.alternate,i),i=i.return;Yt=null}}function Nl(i,s){var u=i.timeoutHandle;u!==-1&&(i.timeoutHandle=-1,RP(u)),u=i.cancelPendingCommit,u!==null&&(i.cancelPendingCommit=null,u()),Oa=0,hy(),wn=i,Yt=u=ga(i.current,null),Gt=s,gn=0,Xr=null,so=!1,Ml=kt(i,s),sy=!1,Ol=Qr=ly=bs=lo=jn=0,Pr=vu=null,cy=!1,(s&8)!==0&&(s|=s&32);var p=i.entangledLanes;if(p!==0)for(i=i.entanglements,p&=s;0<p;){var b=31-tt(p),x=1<<b;s|=i[b],p&=~x}return Ma=s,vf(),u}function uE(i,s){jt=null,j.H=du,s===xl||s===kf?(s=RS(),gn=3):s===yg?(s=RS(),gn=4):gn=s===$g?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,Xr=s,Yt===null&&(jn=1,Hf(i,ci(s,i.current)))}function dE(){var i=Kr.current;return i===null?!0:(Gt&4194048)===Gt?hi===null:(Gt&62914560)===Gt||(Gt&536870912)!==0?i===hi:!1}function fE(){var i=j.H;return j.H=du,i===null?du:i}function hE(){var i=j.A;return j.A=iP,i}function Jf(){jn=4,so||(Gt&4194048)!==Gt&&Kr.current!==null||(Ml=!0),(lo&134217727)===0&&(bs&134217727)===0||wn===null||fo(wn,Gt,Qr,!1)}function py(i,s,u){var p=fn;fn|=2;var b=fE(),x=hE();(wn!==i||Gt!==s)&&(Qf=null,Nl(i,s)),s=!1;var N=jn;e:do try{if(gn!==0&&Yt!==null){var Y=Yt,ne=Xr;switch(gn){case 8:hy(),N=6;break e;case 3:case 2:case 9:case 6:Kr.current===null&&(s=!0);var ge=gn;if(gn=0,Xr=null,Dl(i,Y,ne,ge),u&&Ml){N=0;break e}break;default:ge=gn,gn=0,Xr=null,Dl(i,Y,ne,ge)}}sP(),N=jn;break}catch(Me){uE(i,Me)}while(!0);return s&&i.shellSuspendCounter++,ba=cs=null,fn=p,j.H=b,j.A=x,Yt===null&&(wn=null,Gt=0,vf()),N}function sP(){for(;Yt!==null;)pE(Yt)}function lP(i,s){var u=fn;fn|=2;var p=fE(),b=hE();wn!==i||Gt!==s?(Qf=null,Xf=De()+500,Nl(i,s)):Ml=kt(i,s);e:do try{if(gn!==0&&Yt!==null){s=Yt;var x=Xr;t:switch(gn){case 1:gn=0,Xr=null,Dl(i,s,x,1);break;case 2:case 9:if(CS(x)){gn=0,Xr=null,mE(s);break}s=function(){gn!==2&&gn!==9||wn!==i||(gn=7),Ki(i)},x.then(s,s);break e;case 3:gn=7;break e;case 4:gn=5;break e;case 7:CS(x)?(gn=0,Xr=null,mE(s)):(gn=0,Xr=null,Dl(i,s,x,7));break;case 5:var N=null;switch(Yt.tag){case 26:N=Yt.memoizedState;case 5:case 27:var Y=Yt;if(N?eC(N):Y.stateNode.complete){gn=0,Xr=null;var ne=Y.sibling;if(ne!==null)Yt=ne;else{var ge=Y.return;ge!==null?(Yt=ge,eh(ge)):Yt=null}break t}}gn=0,Xr=null,Dl(i,s,x,5);break;case 6:gn=0,Xr=null,Dl(i,s,x,6);break;case 8:hy(),jn=6;break e;default:throw Error(r(462))}}cP();break}catch(Me){uE(i,Me)}while(!0);return ba=cs=null,j.H=p,j.A=b,fn=u,Yt!==null?0:(wn=null,Gt=0,vf(),jn)}function cP(){for(;Yt!==null&&!Be();)pE(Yt)}function pE(i){var s=z1(i.alternate,i,Ma);i.memoizedProps=i.pendingProps,s===null?eh(i):Yt=s}function mE(i){var s=i,u=s.alternate;switch(s.tag){case 15:case 0:s=D1(u,s,s.pendingProps,s.type,void 0,Gt);break;case 11:s=D1(u,s,s.pendingProps,s.type.render,s.ref,Gt);break;case 5:Og(s);default:B1(u,s),s=Yt=hS(s,Ma),s=z1(u,s,Ma)}i.memoizedProps=i.pendingProps,s===null?eh(i):Yt=s}function Dl(i,s,u,p){ba=cs=null,Og(s),wl=null,ru=0;var b=s.return;try{if(QI(i,b,s,u,Gt)){jn=1,Hf(i,ci(u,i.current)),Yt=null;return}}catch(x){if(b!==null)throw Yt=b,x;jn=1,Hf(i,ci(u,i.current)),Yt=null;return}s.flags&32768?(tn||p===1?i=!0:Ml||(Gt&536870912)!==0?i=!1:(so=i=!0,(p===2||p===9||p===3||p===6)&&(p=Kr.current,p!==null&&p.tag===13&&(p.flags|=16384))),gE(s,i)):eh(s)}function eh(i){var s=i;do{if((s.flags&32768)!==0){gE(s,so);return}i=s.return;var u=eP(s.alternate,s,Ma);if(u!==null){Yt=u;return}if(s=s.sibling,s!==null){Yt=s;return}Yt=s=i}while(s!==null);jn===0&&(jn=5)}function gE(i,s){do{var u=tP(i.alternate,i);if(u!==null){u.flags&=32767,Yt=u;return}if(u=i.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!s&&(i=i.sibling,i!==null)){Yt=i;return}Yt=i=u}while(i!==null);jn=6,Yt=null}function yE(i,s,u,p,b,x,N,Y,ne){i.cancelPendingCommit=null;do th();while(Zn!==0);if((fn&6)!==0)throw Error(r(327));if(s!==null){if(s===i.current)throw Error(r(177));if(x=s.lanes|s.childLanes,x|=ng,Je(i,u,x,N,Y,ne),i===wn&&(Yt=wn=null,Gt=0),Al=s,uo=i,Oa=u,uy=x,dy=b,oE=p,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,hP(ee,function(){return SE(),null})):(i.callbackNode=null,i.callbackPriority=0),p=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||p){p=j.T,j.T=null,b=z.p,z.p=2,N=fn,fn|=4;try{nP(i,s,u)}finally{fn=N,z.p=b,j.T=p}}Zn=1,bE(),vE(),xE()}}function bE(){if(Zn===1){Zn=0;var i=uo,s=Al,u=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||u){u=j.T,j.T=null;var p=z.p;z.p=2;var b=fn;fn|=4;try{Z1(s,i);var x=Ry,N=iS(i.containerInfo),Y=x.focusedElem,ne=x.selectionRange;if(N!==Y&&Y&&Y.ownerDocument&&rS(Y.ownerDocument.documentElement,Y)){if(ne!==null&&Qm(Y)){var ge=ne.start,Me=ne.end;if(Me===void 0&&(Me=ge),"selectionStart"in Y)Y.selectionStart=ge,Y.selectionEnd=Math.min(Me,Y.value.length);else{var Ie=Y.ownerDocument||document,be=Ie&&Ie.defaultView||window;if(be.getSelection){var we=be.getSelection(),st=Y.textContent.length,wt=Math.min(ne.start,st),xn=ne.end===void 0?wt:Math.min(ne.end,st);!we.extend&&wt>xn&&(N=xn,xn=wt,wt=N);var ce=nS(Y,wt),oe=nS(Y,xn);if(ce&&oe&&(we.rangeCount!==1||we.anchorNode!==ce.node||we.anchorOffset!==ce.offset||we.focusNode!==oe.node||we.focusOffset!==oe.offset)){var me=Ie.createRange();me.setStart(ce.node,ce.offset),we.removeAllRanges(),wt>xn?(we.addRange(me),we.extend(oe.node,oe.offset)):(me.setEnd(oe.node,oe.offset),we.addRange(me))}}}}for(Ie=[],we=Y;we=we.parentNode;)we.nodeType===1&&Ie.push({element:we,left:we.scrollLeft,top:we.scrollTop});for(typeof Y.focus=="function"&&Y.focus(),Y=0;Y<Ie.length;Y++){var Ne=Ie[Y];Ne.element.scrollLeft=Ne.left,Ne.element.scrollTop=Ne.top}}hh=!!Ty,Ry=Ty=null}finally{fn=b,z.p=p,j.T=u}}i.current=s,Zn=2}}function vE(){if(Zn===2){Zn=0;var i=uo,s=Al,u=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||u){u=j.T,j.T=null;var p=z.p;z.p=2;var b=fn;fn|=4;try{W1(i,s.alternate,s)}finally{fn=b,z.p=p,j.T=u}}Zn=3}}function xE(){if(Zn===4||Zn===3){Zn=0,Ve();var i=uo,s=Al,u=Oa,p=oE;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?Zn=5:(Zn=0,Al=uo=null,wE(i,i.pendingLanes));var b=i.pendingLanes;if(b===0&&(co=null),ke(u),s=s.stateNode,ze&&typeof ze.onCommitFiberRoot=="function")try{ze.onCommitFiberRoot(et,s,void 0,(s.current.flags&128)===128)}catch{}if(p!==null){s=j.T,b=z.p,z.p=2,j.T=null;try{for(var x=i.onRecoverableError,N=0;N<p.length;N++){var Y=p[N];x(Y.value,{componentStack:Y.stack})}}finally{j.T=s,z.p=b}}(Oa&3)!==0&&th(),Ki(i),b=i.pendingLanes,(u&261930)!==0&&(b&42)!==0?i===fy?xu++:(xu=0,fy=i):xu=0,wu(0)}}function wE(i,s){(i.pooledCacheLanes&=s)===0&&(s=i.pooledCache,s!=null&&(i.pooledCache=null,tu(s)))}function th(){return bE(),vE(),xE(),SE()}function SE(){if(Zn!==5)return!1;var i=uo,s=uy;uy=0;var u=ke(Oa),p=j.T,b=z.p;try{z.p=32>u?32:u,j.T=null,u=dy,dy=null;var x=uo,N=Oa;if(Zn=0,Al=uo=null,Oa=0,(fn&6)!==0)throw Error(r(331));var Y=fn;if(fn|=4,rE(x.current),eE(x,x.current,N,u),fn=Y,wu(0,!1),ze&&typeof ze.onPostCommitFiberRoot=="function")try{ze.onPostCommitFiberRoot(et,x)}catch{}return!0}finally{z.p=b,j.T=p,wE(i,s)}}function EE(i,s,u){s=ci(u,s),s=Vg(i.stateNode,s,2),i=ro(i,s,2),i!==null&&(Ut(i,2),Ki(i))}function yn(i,s,u){if(i.tag===3)EE(i,i,u);else for(;s!==null;){if(s.tag===3){EE(s,i,u);break}else if(s.tag===1){var p=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(co===null||!co.has(p))){i=ci(u,i),u=C1(2),p=ro(s,u,2),p!==null&&(T1(u,p,s,i),Ut(p,2),Ki(p));break}}s=s.return}}function my(i,s,u){var p=i.pingCache;if(p===null){p=i.pingCache=new aP;var b=new Set;p.set(s,b)}else b=p.get(s),b===void 0&&(b=new Set,p.set(s,b));b.has(u)||(sy=!0,b.add(u),i=uP.bind(null,i,s,u),s.then(i,i))}function uP(i,s,u){var p=i.pingCache;p!==null&&p.delete(s),i.pingedLanes|=i.suspendedLanes&u,i.warmLanes&=~u,wn===i&&(Gt&u)===u&&(jn===4||jn===3&&(Gt&62914560)===Gt&&300>De()-Gf?(fn&2)===0&&Nl(i,0):ly|=u,Ol===Gt&&(Ol=0)),Ki(i)}function CE(i,s){s===0&&(s=Rt()),i=os(i,s),i!==null&&(Ut(i,s),Ki(i))}function dP(i){var s=i.memoizedState,u=0;s!==null&&(u=s.retryLane),CE(i,u)}function fP(i,s){var u=0;switch(i.tag){case 31:case 13:var p=i.stateNode,b=i.memoizedState;b!==null&&(u=b.retryLane);break;case 19:p=i.stateNode;break;case 22:p=i.stateNode._retryCache;break;default:throw Error(r(314))}p!==null&&p.delete(s),CE(i,u)}function hP(i,s){return Ee(i,s)}var nh=null,Il=null,gy=!1,rh=!1,yy=!1,ho=0;function Ki(i){i!==Il&&i.next===null&&(Il===null?nh=Il=i:Il=Il.next=i),rh=!0,gy||(gy=!0,mP())}function wu(i,s){if(!yy&&rh){yy=!0;do for(var u=!1,p=nh;p!==null;){if(i!==0){var b=p.pendingLanes;if(b===0)var x=0;else{var N=p.suspendedLanes,Y=p.pingedLanes;x=(1<<31-tt(42|i)+1)-1,x&=b&~(N&~Y),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(u=!0,ME(p,x))}else x=Gt,x=Ke(p,p===wn?x:0,p.cancelPendingCommit!==null||p.timeoutHandle!==-1),(x&3)===0||kt(p,x)||(u=!0,ME(p,x));p=p.next}while(u);yy=!1}}function pP(){TE()}function TE(){rh=gy=!1;var i=0;ho!==0&&TP()&&(i=ho);for(var s=De(),u=null,p=nh;p!==null;){var b=p.next,x=RE(p,s);x===0?(p.next=null,u===null?nh=b:u.next=b,b===null&&(Il=u)):(u=p,(i!==0||(x&3)!==0)&&(rh=!0)),p=b}Zn!==0&&Zn!==5||wu(i),ho!==0&&(ho=0)}function RE(i,s){for(var u=i.suspendedLanes,p=i.pingedLanes,b=i.expirationTimes,x=i.pendingLanes&-62914561;0<x;){var N=31-tt(x),Y=1<<N,ne=b[N];ne===-1?((Y&u)===0||(Y&p)!==0)&&(b[N]=_t(Y,s)):ne<=s&&(i.expiredLanes|=Y),x&=~Y}if(s=wn,u=Gt,u=Ke(i,i===s?u:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),p=i.callbackNode,u===0||i===s&&(gn===2||gn===9)||i.cancelPendingCommit!==null)return p!==null&&p!==null&&xe(p),i.callbackNode=null,i.callbackPriority=0;if((u&3)===0||kt(i,u)){if(s=u&-u,s===i.callbackPriority)return s;switch(p!==null&&xe(p),ke(u)){case 2:case 8:u=Te;break;case 32:u=ee;break;case 268435456:u=Ae;break;default:u=ee}return p=kE.bind(null,i),u=Ee(u,p),i.callbackPriority=s,i.callbackNode=u,s}return p!==null&&p!==null&&xe(p),i.callbackPriority=2,i.callbackNode=null,2}function kE(i,s){if(Zn!==0&&Zn!==5)return i.callbackNode=null,i.callbackPriority=0,null;var u=i.callbackNode;if(th()&&i.callbackNode!==u)return null;var p=Gt;return p=Ke(i,i===wn?p:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),p===0?null:(lE(i,p,s),RE(i,De()),i.callbackNode!=null&&i.callbackNode===u?kE.bind(null,i):null)}function ME(i,s){if(th())return null;lE(i,s,!0)}function mP(){kP(function(){(fn&6)!==0?Ee(pe,pP):TE()})}function by(){if(ho===0){var i=bl;i===0&&(i=At,At<<=1,(At&261888)===0&&(At=256)),ho=i}return ho}function OE(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:df(""+i)}function AE(i,s){var u=s.ownerDocument.createElement("input");return u.name=s.name,u.value=s.value,i.id&&u.setAttribute("form",i.id),s.parentNode.insertBefore(u,s),i=new FormData(i),u.parentNode.removeChild(u),i}function gP(i,s,u,p,b){if(s==="submit"&&u&&u.stateNode===b){var x=OE((b[Xe]||null).action),N=p.submitter;N&&(s=(s=N[Xe]||null)?OE(s.formAction):N.getAttribute("formAction"),s!==null&&(x=s,N=null));var Y=new mf("action","action",null,p,b);i.push({event:Y,listeners:[{instance:null,listener:function(){if(p.defaultPrevented){if(ho!==0){var ne=N?AE(b,N):new FormData(b);zg(u,{pending:!0,data:ne,method:b.method,action:x},null,ne)}}else typeof x=="function"&&(Y.preventDefault(),ne=N?AE(b,N):new FormData(b),zg(u,{pending:!0,data:ne,method:b.method,action:x},x,ne))},currentTarget:b}]})}}for(var vy=0;vy<tg.length;vy++){var xy=tg[vy],yP=xy.toLowerCase(),bP=xy[0].toUpperCase()+xy.slice(1);Ai(yP,"on"+bP)}Ai(sS,"onAnimationEnd"),Ai(lS,"onAnimationIteration"),Ai(cS,"onAnimationStart"),Ai("dblclick","onDoubleClick"),Ai("focusin","onFocus"),Ai("focusout","onBlur"),Ai(PI,"onTransitionRun"),Ai(LI,"onTransitionStart"),Ai(_I,"onTransitionCancel"),Ai(uS,"onTransitionEnd"),oi("onMouseEnter",["mouseout","mouseover"]),oi("onMouseLeave",["mouseout","mouseover"]),oi("onPointerEnter",["pointerout","pointerover"]),oi("onPointerLeave",["pointerout","pointerover"]),Mi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Mi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Mi("onBeforeInput",["compositionend","keypress","textInput","paste"]),Mi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Mi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Mi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Su="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(" "),vP=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Su));function NE(i,s){s=(s&4)!==0;for(var u=0;u<i.length;u++){var p=i[u],b=p.event;p=p.listeners;e:{var x=void 0;if(s)for(var N=p.length-1;0<=N;N--){var Y=p[N],ne=Y.instance,ge=Y.currentTarget;if(Y=Y.listener,ne!==x&&b.isPropagationStopped())break e;x=Y,b.currentTarget=ge;try{x(b)}catch(Me){bf(Me)}b.currentTarget=null,x=ne}else for(N=0;N<p.length;N++){if(Y=p[N],ne=Y.instance,ge=Y.currentTarget,Y=Y.listener,ne!==x&&b.isPropagationStopped())break e;x=Y,b.currentTarget=ge;try{x(b)}catch(Me){bf(Me)}b.currentTarget=null,x=ne}}}}function Wt(i,s){var u=s[Et];u===void 0&&(u=s[Et]=new Set);var p=i+"__bubble";u.has(p)||(DE(s,i,2,!1),u.add(p))}function wy(i,s,u){var p=0;s&&(p|=4),DE(u,i,p,s)}var ih="_reactListening"+Math.random().toString(36).slice(2);function Sy(i){if(!i[ih]){i[ih]=!0,ki.forEach(function(u){u!=="selectionchange"&&(vP.has(u)||wy(u,!1,i),wy(u,!0,i))});var s=i.nodeType===9?i:i.ownerDocument;s===null||s[ih]||(s[ih]=!0,wy("selectionchange",!1,s))}}function DE(i,s,u,p){switch(sC(s)){case 2:var b=WP;break;case 8:b=KP;break;default:b=jy}u=b.bind(null,s,u,i),b=void 0,!Um||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(b=!0),p?b!==void 0?i.addEventListener(s,u,{capture:!0,passive:b}):i.addEventListener(s,u,!0):b!==void 0?i.addEventListener(s,u,{passive:b}):i.addEventListener(s,u,!1)}function Ey(i,s,u,p,b){var x=p;if((s&1)===0&&(s&2)===0&&p!==null)e:for(;;){if(p===null)return;var N=p.tag;if(N===3||N===4){var Y=p.stateNode.containerInfo;if(Y===b)break;if(N===4)for(N=p.return;N!==null;){var ne=N.tag;if((ne===3||ne===4)&&N.stateNode.containerInfo===b)return;N=N.return}for(;Y!==null;){if(N=Ln(Y),N===null)return;if(ne=N.tag,ne===5||ne===6||ne===26||ne===27){p=x=N;continue e}Y=Y.parentNode}}p=p.return}jw(function(){var ge=x,Me=Bm(u),Ie=[];e:{var be=dS.get(i);if(be!==void 0){var we=mf,st=i;switch(i){case"keypress":if(hf(u)===0)break e;case"keydown":case"keyup":we=fI;break;case"focusin":st="focus",we=Ym;break;case"focusout":st="blur",we=Ym;break;case"beforeblur":case"afterblur":we=Ym;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":we=Bw;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":we=eI;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":we=mI;break;case sS:case lS:case cS:we=rI;break;case uS:we=yI;break;case"scroll":case"scrollend":we=ZD;break;case"wheel":we=vI;break;case"copy":case"cut":case"paste":we=aI;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":we=Uw;break;case"toggle":case"beforetoggle":we=wI}var wt=(s&4)!==0,xn=!wt&&(i==="scroll"||i==="scrollend"),ce=wt?be!==null?be+"Capture":null:be;wt=[];for(var oe=ge,me;oe!==null;){var Ne=oe;if(me=Ne.stateNode,Ne=Ne.tag,Ne!==5&&Ne!==26&&Ne!==27||me===null||ce===null||(Ne=Vc(oe,ce),Ne!=null&&wt.push(Eu(oe,Ne,me))),xn)break;oe=oe.return}0<wt.length&&(be=new we(be,st,null,u,Me),Ie.push({event:be,listeners:wt}))}}if((s&7)===0){e:{if(be=i==="mouseover"||i==="pointerover",we=i==="mouseout"||i==="pointerout",be&&u!==Fm&&(st=u.relatedTarget||u.fromElement)&&(Ln(st)||st[ot]))break e;if((we||be)&&(be=Me.window===Me?Me:(be=Me.ownerDocument)?be.defaultView||be.parentWindow:window,we?(st=u.relatedTarget||u.toElement,we=ge,st=st?Ln(st):null,st!==null&&(xn=o(st),wt=st.tag,st!==xn||wt!==5&&wt!==27&&wt!==6)&&(st=null)):(we=null,st=ge),we!==st)){if(wt=Bw,Ne="onMouseLeave",ce="onMouseEnter",oe="mouse",(i==="pointerout"||i==="pointerover")&&(wt=Uw,Ne="onPointerLeave",ce="onPointerEnter",oe="pointer"),xn=we==null?be:rr(we),me=st==null?be:rr(st),be=new wt(Ne,oe+"leave",we,u,Me),be.target=xn,be.relatedTarget=me,Ne=null,Ln(Me)===ge&&(wt=new wt(ce,oe+"enter",st,u,Me),wt.target=me,wt.relatedTarget=xn,Ne=wt),xn=Ne,we&&st)t:{for(wt=xP,ce=we,oe=st,me=0,Ne=ce;Ne;Ne=wt(Ne))me++;Ne=0;for(var mt=oe;mt;mt=wt(mt))Ne++;for(;0<me-Ne;)ce=wt(ce),me--;for(;0<Ne-me;)oe=wt(oe),Ne--;for(;me--;){if(ce===oe||oe!==null&&ce===oe.alternate){wt=ce;break t}ce=wt(ce),oe=wt(oe)}wt=null}else wt=null;we!==null&&IE(Ie,be,we,wt,!1),st!==null&&xn!==null&&IE(Ie,xn,st,wt,!0)}}e:{if(be=ge?rr(ge):window,we=be.nodeName&&be.nodeName.toLowerCase(),we==="select"||we==="input"&&be.type==="file")var ln=Xw;else if(Kw(be))if(Qw)ln=NI;else{ln=OI;var dt=MI}else we=be.nodeName,!we||we.toLowerCase()!=="input"||be.type!=="checkbox"&&be.type!=="radio"?ge&&zm(ge.elementType)&&(ln=Xw):ln=AI;if(ln&&(ln=ln(i,ge))){Gw(Ie,ln,u,Me);break e}dt&&dt(i,be,ge),i==="focusout"&&ge&&be.type==="number"&&ge.memoizedProps.value!=null&&jm(be,"number",be.value)}switch(dt=ge?rr(ge):window,i){case"focusin":(Kw(dt)||dt.contentEditable==="true")&&(ul=dt,Zm=ge,Zc=null);break;case"focusout":Zc=Zm=ul=null;break;case"mousedown":Jm=!0;break;case"contextmenu":case"mouseup":case"dragend":Jm=!1,aS(Ie,u,Me);break;case"selectionchange":if(II)break;case"keydown":case"keyup":aS(Ie,u,Me)}var Ft;if(Km)e:{switch(i){case"compositionstart":var Xt="onCompositionStart";break e;case"compositionend":Xt="onCompositionEnd";break e;case"compositionupdate":Xt="onCompositionUpdate";break e}Xt=void 0}else cl?Yw(i,u)&&(Xt="onCompositionEnd"):i==="keydown"&&u.keyCode===229&&(Xt="onCompositionStart");Xt&&(qw&&u.locale!=="ko"&&(cl||Xt!=="onCompositionStart"?Xt==="onCompositionEnd"&&cl&&(Ft=zw()):(Xa=Me,qm="value"in Xa?Xa.value:Xa.textContent,cl=!0)),dt=ah(ge,Xt),0<dt.length&&(Xt=new Hw(Xt,i,null,u,Me),Ie.push({event:Xt,listeners:dt}),Ft?Xt.data=Ft:(Ft=Ww(u),Ft!==null&&(Xt.data=Ft)))),(Ft=EI?CI(i,u):TI(i,u))&&(Xt=ah(ge,"onBeforeInput"),0<Xt.length&&(dt=new Hw("onBeforeInput","beforeinput",null,u,Me),Ie.push({event:dt,listeners:Xt}),dt.data=Ft)),gP(Ie,i,ge,u,Me)}NE(Ie,s)})}function Eu(i,s,u){return{instance:i,listener:s,currentTarget:u}}function ah(i,s){for(var u=s+"Capture",p=[];i!==null;){var b=i,x=b.stateNode;if(b=b.tag,b!==5&&b!==26&&b!==27||x===null||(b=Vc(i,u),b!=null&&p.unshift(Eu(i,b,x)),b=Vc(i,s),b!=null&&p.push(Eu(i,b,x))),i.tag===3)return p;i=i.return}return[]}function xP(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function IE(i,s,u,p,b){for(var x=s._reactName,N=[];u!==null&&u!==p;){var Y=u,ne=Y.alternate,ge=Y.stateNode;if(Y=Y.tag,ne!==null&&ne===p)break;Y!==5&&Y!==26&&Y!==27||ge===null||(ne=ge,b?(ge=Vc(u,x),ge!=null&&N.unshift(Eu(u,ge,ne))):b||(ge=Vc(u,x),ge!=null&&N.push(Eu(u,ge,ne)))),u=u.return}N.length!==0&&i.push({event:s,listeners:N})}var wP=/\r\n?/g,SP=/\u0000|\uFFFD/g;function PE(i){return(typeof i=="string"?i:""+i).replace(wP,`
50
+ `).replace(SP,"")}function LE(i,s){return s=PE(s),PE(i)===s}function vn(i,s,u,p,b,x){switch(u){case"children":typeof p=="string"?s==="body"||s==="textarea"&&p===""||ol(i,p):(typeof p=="number"||typeof p=="bigint")&&s!=="body"&&ol(i,""+p);break;case"className":Oi(i,"class",p);break;case"tabIndex":Oi(i,"tabindex",p);break;case"dir":case"role":case"viewBox":case"width":case"height":Oi(i,u,p);break;case"style":Lw(i,p,x);break;case"data":if(s!=="object"){Oi(i,"data",p);break}case"src":case"href":if(p===""&&(s!=="a"||u!=="href")){i.removeAttribute(u);break}if(p==null||typeof p=="function"||typeof p=="symbol"||typeof p=="boolean"){i.removeAttribute(u);break}p=df(""+p),i.setAttribute(u,p);break;case"action":case"formAction":if(typeof p=="function"){i.setAttribute(u,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof x=="function"&&(u==="formAction"?(s!=="input"&&vn(i,s,"name",b.name,b,null),vn(i,s,"formEncType",b.formEncType,b,null),vn(i,s,"formMethod",b.formMethod,b,null),vn(i,s,"formTarget",b.formTarget,b,null)):(vn(i,s,"encType",b.encType,b,null),vn(i,s,"method",b.method,b,null),vn(i,s,"target",b.target,b,null)));if(p==null||typeof p=="symbol"||typeof p=="boolean"){i.removeAttribute(u);break}p=df(""+p),i.setAttribute(u,p);break;case"onClick":p!=null&&(i.onclick=pa);break;case"onScroll":p!=null&&Wt("scroll",i);break;case"onScrollEnd":p!=null&&Wt("scrollend",i);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(u=p.__html,u!=null){if(b.children!=null)throw Error(r(60));i.innerHTML=u}}break;case"multiple":i.multiple=p&&typeof p!="function"&&typeof p!="symbol";break;case"muted":i.muted=p&&typeof p!="function"&&typeof p!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(p==null||typeof p=="function"||typeof p=="boolean"||typeof p=="symbol"){i.removeAttribute("xlink:href");break}u=df(""+p),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":p!=null&&typeof p!="function"&&typeof p!="symbol"?i.setAttribute(u,""+p):i.removeAttribute(u);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":p&&typeof p!="function"&&typeof p!="symbol"?i.setAttribute(u,""):i.removeAttribute(u);break;case"capture":case"download":p===!0?i.setAttribute(u,""):p!==!1&&p!=null&&typeof p!="function"&&typeof p!="symbol"?i.setAttribute(u,p):i.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":p!=null&&typeof p!="function"&&typeof p!="symbol"&&!isNaN(p)&&1<=p?i.setAttribute(u,p):i.removeAttribute(u);break;case"rowSpan":case"start":p==null||typeof p=="function"||typeof p=="symbol"||isNaN(p)?i.removeAttribute(u):i.setAttribute(u,p);break;case"popover":Wt("beforetoggle",i),Wt("toggle",i),Un(i,"popover",p);break;case"xlinkActuate":lr(i,"http://www.w3.org/1999/xlink","xlink:actuate",p);break;case"xlinkArcrole":lr(i,"http://www.w3.org/1999/xlink","xlink:arcrole",p);break;case"xlinkRole":lr(i,"http://www.w3.org/1999/xlink","xlink:role",p);break;case"xlinkShow":lr(i,"http://www.w3.org/1999/xlink","xlink:show",p);break;case"xlinkTitle":lr(i,"http://www.w3.org/1999/xlink","xlink:title",p);break;case"xlinkType":lr(i,"http://www.w3.org/1999/xlink","xlink:type",p);break;case"xmlBase":lr(i,"http://www.w3.org/XML/1998/namespace","xml:base",p);break;case"xmlLang":lr(i,"http://www.w3.org/XML/1998/namespace","xml:lang",p);break;case"xmlSpace":lr(i,"http://www.w3.org/XML/1998/namespace","xml:space",p);break;case"is":Un(i,"is",p);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=XD.get(u)||u,Un(i,u,p))}}function Cy(i,s,u,p,b,x){switch(u){case"style":Lw(i,p,x);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(u=p.__html,u!=null){if(b.children!=null)throw Error(r(60));i.innerHTML=u}}break;case"children":typeof p=="string"?ol(i,p):(typeof p=="number"||typeof p=="bigint")&&ol(i,""+p);break;case"onScroll":p!=null&&Wt("scroll",i);break;case"onScrollEnd":p!=null&&Wt("scrollend",i);break;case"onClick":p!=null&&(i.onclick=pa);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!$r.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(b=u.endsWith("Capture"),s=u.slice(2,b?u.length-7:void 0),x=i[Xe]||null,x=x!=null?x[u]:null,typeof x=="function"&&i.removeEventListener(s,x,b),typeof p=="function")){typeof x!="function"&&x!==null&&(u in i?i[u]=null:i.hasAttribute(u)&&i.removeAttribute(u)),i.addEventListener(s,p,b);break e}u in i?i[u]=p:p===!0?i.setAttribute(u,""):Un(i,u,p)}}}function fr(i,s,u){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Wt("error",i),Wt("load",i);var p=!1,b=!1,x;for(x in u)if(u.hasOwnProperty(x)){var N=u[x];if(N!=null)switch(x){case"src":p=!0;break;case"srcSet":b=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:vn(i,s,x,N,u,null)}}b&&vn(i,s,"srcSet",u.srcSet,u,null),p&&vn(i,s,"src",u.src,u,null);return;case"input":Wt("invalid",i);var Y=x=N=b=null,ne=null,ge=null;for(p in u)if(u.hasOwnProperty(p)){var Me=u[p];if(Me!=null)switch(p){case"name":b=Me;break;case"type":N=Me;break;case"checked":ne=Me;break;case"defaultChecked":ge=Me;break;case"value":x=Me;break;case"defaultValue":Y=Me;break;case"children":case"dangerouslySetInnerHTML":if(Me!=null)throw Error(r(137,s));break;default:vn(i,s,p,Me,u,null)}}Nw(i,x,Y,ne,ge,N,b,!1);return;case"select":Wt("invalid",i),p=N=x=null;for(b in u)if(u.hasOwnProperty(b)&&(Y=u[b],Y!=null))switch(b){case"value":x=Y;break;case"defaultValue":N=Y;break;case"multiple":p=Y;default:vn(i,s,b,Y,u,null)}s=x,u=N,i.multiple=!!p,s!=null?al(i,!!p,s,!1):u!=null&&al(i,!!p,u,!0);return;case"textarea":Wt("invalid",i),x=b=p=null;for(N in u)if(u.hasOwnProperty(N)&&(Y=u[N],Y!=null))switch(N){case"value":p=Y;break;case"defaultValue":b=Y;break;case"children":x=Y;break;case"dangerouslySetInnerHTML":if(Y!=null)throw Error(r(91));break;default:vn(i,s,N,Y,u,null)}Iw(i,p,b,x);return;case"option":for(ne in u)if(u.hasOwnProperty(ne)&&(p=u[ne],p!=null))switch(ne){case"selected":i.selected=p&&typeof p!="function"&&typeof p!="symbol";break;default:vn(i,s,ne,p,u,null)}return;case"dialog":Wt("beforetoggle",i),Wt("toggle",i),Wt("cancel",i),Wt("close",i);break;case"iframe":case"object":Wt("load",i);break;case"video":case"audio":for(p=0;p<Su.length;p++)Wt(Su[p],i);break;case"image":Wt("error",i),Wt("load",i);break;case"details":Wt("toggle",i);break;case"embed":case"source":case"link":Wt("error",i),Wt("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ge in u)if(u.hasOwnProperty(ge)&&(p=u[ge],p!=null))switch(ge){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:vn(i,s,ge,p,u,null)}return;default:if(zm(s)){for(Me in u)u.hasOwnProperty(Me)&&(p=u[Me],p!==void 0&&Cy(i,s,Me,p,u,void 0));return}}for(Y in u)u.hasOwnProperty(Y)&&(p=u[Y],p!=null&&vn(i,s,Y,p,u,null))}function EP(i,s,u,p){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var b=null,x=null,N=null,Y=null,ne=null,ge=null,Me=null;for(we in u){var Ie=u[we];if(u.hasOwnProperty(we)&&Ie!=null)switch(we){case"checked":break;case"value":break;case"defaultValue":ne=Ie;default:p.hasOwnProperty(we)||vn(i,s,we,null,p,Ie)}}for(var be in p){var we=p[be];if(Ie=u[be],p.hasOwnProperty(be)&&(we!=null||Ie!=null))switch(be){case"type":x=we;break;case"name":b=we;break;case"checked":ge=we;break;case"defaultChecked":Me=we;break;case"value":N=we;break;case"defaultValue":Y=we;break;case"children":case"dangerouslySetInnerHTML":if(we!=null)throw Error(r(137,s));break;default:we!==Ie&&vn(i,s,be,we,p,Ie)}}_m(i,N,Y,ne,ge,Me,x,b);return;case"select":we=N=Y=be=null;for(x in u)if(ne=u[x],u.hasOwnProperty(x)&&ne!=null)switch(x){case"value":break;case"multiple":we=ne;default:p.hasOwnProperty(x)||vn(i,s,x,null,p,ne)}for(b in p)if(x=p[b],ne=u[b],p.hasOwnProperty(b)&&(x!=null||ne!=null))switch(b){case"value":be=x;break;case"defaultValue":Y=x;break;case"multiple":N=x;default:x!==ne&&vn(i,s,b,x,p,ne)}s=Y,u=N,p=we,be!=null?al(i,!!u,be,!1):!!p!=!!u&&(s!=null?al(i,!!u,s,!0):al(i,!!u,u?[]:"",!1));return;case"textarea":we=be=null;for(Y in u)if(b=u[Y],u.hasOwnProperty(Y)&&b!=null&&!p.hasOwnProperty(Y))switch(Y){case"value":break;case"children":break;default:vn(i,s,Y,null,p,b)}for(N in p)if(b=p[N],x=u[N],p.hasOwnProperty(N)&&(b!=null||x!=null))switch(N){case"value":be=b;break;case"defaultValue":we=b;break;case"children":break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(r(91));break;default:b!==x&&vn(i,s,N,b,p,x)}Dw(i,be,we);return;case"option":for(var st in u)if(be=u[st],u.hasOwnProperty(st)&&be!=null&&!p.hasOwnProperty(st))switch(st){case"selected":i.selected=!1;break;default:vn(i,s,st,null,p,be)}for(ne in p)if(be=p[ne],we=u[ne],p.hasOwnProperty(ne)&&be!==we&&(be!=null||we!=null))switch(ne){case"selected":i.selected=be&&typeof be!="function"&&typeof be!="symbol";break;default:vn(i,s,ne,be,p,we)}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 wt in u)be=u[wt],u.hasOwnProperty(wt)&&be!=null&&!p.hasOwnProperty(wt)&&vn(i,s,wt,null,p,be);for(ge in p)if(be=p[ge],we=u[ge],p.hasOwnProperty(ge)&&be!==we&&(be!=null||we!=null))switch(ge){case"children":case"dangerouslySetInnerHTML":if(be!=null)throw Error(r(137,s));break;default:vn(i,s,ge,be,p,we)}return;default:if(zm(s)){for(var xn in u)be=u[xn],u.hasOwnProperty(xn)&&be!==void 0&&!p.hasOwnProperty(xn)&&Cy(i,s,xn,void 0,p,be);for(Me in p)be=p[Me],we=u[Me],!p.hasOwnProperty(Me)||be===we||be===void 0&&we===void 0||Cy(i,s,Me,be,p,we);return}}for(var ce in u)be=u[ce],u.hasOwnProperty(ce)&&be!=null&&!p.hasOwnProperty(ce)&&vn(i,s,ce,null,p,be);for(Ie in p)be=p[Ie],we=u[Ie],!p.hasOwnProperty(Ie)||be===we||be==null&&we==null||vn(i,s,Ie,be,p,we)}function _E(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function CP(){if(typeof performance.getEntriesByType=="function"){for(var i=0,s=0,u=performance.getEntriesByType("resource"),p=0;p<u.length;p++){var b=u[p],x=b.transferSize,N=b.initiatorType,Y=b.duration;if(x&&Y&&_E(N)){for(N=0,Y=b.responseEnd,p+=1;p<u.length;p++){var ne=u[p],ge=ne.startTime;if(ge>Y)break;var Me=ne.transferSize,Ie=ne.initiatorType;Me&&_E(Ie)&&(ne=ne.responseEnd,N+=Me*(ne<Y?1:(Y-ge)/(ne-ge)))}if(--p,s+=8*(x+N)/(b.duration/1e3),i++,10<i)break}}if(0<i)return s/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var Ty=null,Ry=null;function oh(i){return i.nodeType===9?i:i.ownerDocument}function jE(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function zE(i,s){if(i===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&s==="foreignObject"?0:i}function ky(i,s){return i==="textarea"||i==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var My=null;function TP(){var i=window.event;return i&&i.type==="popstate"?i===My?!1:(My=i,!0):(My=null,!1)}var FE=typeof setTimeout=="function"?setTimeout:void 0,RP=typeof clearTimeout=="function"?clearTimeout:void 0,BE=typeof Promise=="function"?Promise:void 0,kP=typeof queueMicrotask=="function"?queueMicrotask:typeof BE<"u"?function(i){return BE.resolve(null).then(i).catch(MP)}:FE;function MP(i){setTimeout(function(){throw i})}function po(i){return i==="head"}function HE(i,s){var u=s,p=0;do{var b=u.nextSibling;if(i.removeChild(u),b&&b.nodeType===8)if(u=b.data,u==="/$"||u==="/&"){if(p===0){i.removeChild(b),jl(s);return}p--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")p++;else if(u==="html")Cu(i.ownerDocument.documentElement);else if(u==="head"){u=i.ownerDocument.head,Cu(u);for(var x=u.firstChild;x;){var N=x.nextSibling,Y=x.nodeName;x[Nn]||Y==="SCRIPT"||Y==="STYLE"||Y==="LINK"&&x.rel.toLowerCase()==="stylesheet"||u.removeChild(x),x=N}}else u==="body"&&Cu(i.ownerDocument.body);u=b}while(u);jl(s)}function UE(i,s){var u=i;i=0;do{var p=u.nextSibling;if(u.nodeType===1?s?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(s?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),p&&p.nodeType===8)if(u=p.data,u==="/$"){if(i===0)break;i--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||i++;u=p}while(u)}function Oy(i){var s=i.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var u=s;switch(s=s.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":Oy(u),Pn(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}i.removeChild(u)}}function OP(i,s,u,p){for(;i.nodeType===1;){var b=u;if(i.nodeName.toLowerCase()!==s.toLowerCase()){if(!p&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(p){if(!i[Nn])switch(s){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(x=i.getAttribute("rel"),x==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(x!==b.rel||i.getAttribute("href")!==(b.href==null||b.href===""?null:b.href)||i.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin)||i.getAttribute("title")!==(b.title==null?null:b.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(x=i.getAttribute("src"),(x!==(b.src==null?null:b.src)||i.getAttribute("type")!==(b.type==null?null:b.type)||i.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin))&&x&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(s==="input"&&i.type==="hidden"){var x=b.name==null?null:""+b.name;if(b.type==="hidden"&&i.getAttribute("name")===x)return i}else return i;if(i=pi(i.nextSibling),i===null)break}return null}function AP(i,s,u){if(s==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!u||(i=pi(i.nextSibling),i===null))return null;return i}function qE(i,s){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!s||(i=pi(i.nextSibling),i===null))return null;return i}function Ay(i){return i.data==="$?"||i.data==="$~"}function Ny(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function NP(i,s){var u=i.ownerDocument;if(i.data==="$~")i._reactRetry=s;else if(i.data!=="$?"||u.readyState!=="loading")s();else{var p=function(){s(),u.removeEventListener("DOMContentLoaded",p)};u.addEventListener("DOMContentLoaded",p),i._reactRetry=p}}function pi(i){for(;i!=null;i=i.nextSibling){var s=i.nodeType;if(s===1||s===3)break;if(s===8){if(s=i.data,s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return i}var Dy=null;function VE(i){i=i.nextSibling;for(var s=0;i;){if(i.nodeType===8){var u=i.data;if(u==="/$"||u==="/&"){if(s===0)return pi(i.nextSibling);s--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||s++}i=i.nextSibling}return null}function $E(i){i=i.previousSibling;for(var s=0;i;){if(i.nodeType===8){var u=i.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(s===0)return i;s--}else u!=="/$"&&u!=="/&"||s++}i=i.previousSibling}return null}function YE(i,s,u){switch(s=oh(u),i){case"html":if(i=s.documentElement,!i)throw Error(r(452));return i;case"head":if(i=s.head,!i)throw Error(r(453));return i;case"body":if(i=s.body,!i)throw Error(r(454));return i;default:throw Error(r(451))}}function Cu(i){for(var s=i.attributes;s.length;)i.removeAttributeNode(s[0]);Pn(i)}var mi=new Map,WE=new Set;function sh(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var Aa=z.d;z.d={f:DP,r:IP,D:PP,C:LP,L:_P,m:jP,X:FP,S:zP,M:BP};function DP(){var i=Aa.f(),s=Zf();return i||s}function IP(i){var s=Zt(i);s!==null&&s.tag===5&&s.type==="form"?u1(s):Aa.r(i)}var Pl=typeof document>"u"?null:document;function KE(i,s,u){var p=Pl;if(p&&typeof s=="string"&&s){var b=si(s);b='link[rel="'+i+'"][href="'+b+'"]',typeof u=="string"&&(b+='[crossorigin="'+u+'"]'),WE.has(b)||(WE.add(b),i={rel:i,crossOrigin:u,href:s},p.querySelector(b)===null&&(s=p.createElement("link"),fr(s,"link",i),On(s),p.head.appendChild(s)))}}function PP(i){Aa.D(i),KE("dns-prefetch",i,null)}function LP(i,s){Aa.C(i,s),KE("preconnect",i,s)}function _P(i,s,u){Aa.L(i,s,u);var p=Pl;if(p&&i&&s){var b='link[rel="preload"][as="'+si(s)+'"]';s==="image"&&u&&u.imageSrcSet?(b+='[imagesrcset="'+si(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(b+='[imagesizes="'+si(u.imageSizes)+'"]')):b+='[href="'+si(i)+'"]';var x=b;switch(s){case"style":x=Ll(i);break;case"script":x=_l(i)}mi.has(x)||(i=h({rel:"preload",href:s==="image"&&u&&u.imageSrcSet?void 0:i,as:s},u),mi.set(x,i),p.querySelector(b)!==null||s==="style"&&p.querySelector(Tu(x))||s==="script"&&p.querySelector(Ru(x))||(s=p.createElement("link"),fr(s,"link",i),On(s),p.head.appendChild(s)))}}function jP(i,s){Aa.m(i,s);var u=Pl;if(u&&i){var p=s&&typeof s.as=="string"?s.as:"script",b='link[rel="modulepreload"][as="'+si(p)+'"][href="'+si(i)+'"]',x=b;switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=_l(i)}if(!mi.has(x)&&(i=h({rel:"modulepreload",href:i},s),mi.set(x,i),u.querySelector(b)===null)){switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Ru(x)))return}p=u.createElement("link"),fr(p,"link",i),On(p),u.head.appendChild(p)}}}function zP(i,s,u){Aa.S(i,s,u);var p=Pl;if(p&&i){var b=Or(p).hoistableStyles,x=Ll(i);s=s||"default";var N=b.get(x);if(!N){var Y={loading:0,preload:null};if(N=p.querySelector(Tu(x)))Y.loading=5;else{i=h({rel:"stylesheet",href:i,"data-precedence":s},u),(u=mi.get(x))&&Iy(i,u);var ne=N=p.createElement("link");On(ne),fr(ne,"link",i),ne._p=new Promise(function(ge,Me){ne.onload=ge,ne.onerror=Me}),ne.addEventListener("load",function(){Y.loading|=1}),ne.addEventListener("error",function(){Y.loading|=2}),Y.loading|=4,lh(N,s,p)}N={type:"stylesheet",instance:N,count:1,state:Y},b.set(x,N)}}}function FP(i,s){Aa.X(i,s);var u=Pl;if(u&&i){var p=Or(u).hoistableScripts,b=_l(i),x=p.get(b);x||(x=u.querySelector(Ru(b)),x||(i=h({src:i,async:!0},s),(s=mi.get(b))&&Py(i,s),x=u.createElement("script"),On(x),fr(x,"link",i),u.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},p.set(b,x))}}function BP(i,s){Aa.M(i,s);var u=Pl;if(u&&i){var p=Or(u).hoistableScripts,b=_l(i),x=p.get(b);x||(x=u.querySelector(Ru(b)),x||(i=h({src:i,async:!0,type:"module"},s),(s=mi.get(b))&&Py(i,s),x=u.createElement("script"),On(x),fr(x,"link",i),u.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},p.set(b,x))}}function GE(i,s,u,p){var b=(b=ae.current)?sh(b):null;if(!b)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(s=Ll(u.href),u=Or(b).hoistableStyles,p=u.get(s),p||(p={type:"style",instance:null,count:0,state:null},u.set(s,p)),p):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){i=Ll(u.href);var x=Or(b).hoistableStyles,N=x.get(i);if(N||(b=b.ownerDocument||b,N={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(i,N),(x=b.querySelector(Tu(i)))&&!x._p&&(N.instance=x,N.state.loading=5),mi.has(i)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},mi.set(i,u),x||HP(b,i,u,N.state))),s&&p===null)throw Error(r(528,""));return N}if(s&&p!==null)throw Error(r(529,""));return null;case"script":return s=u.async,u=u.src,typeof u=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=_l(u),u=Or(b).hoistableScripts,p=u.get(s),p||(p={type:"script",instance:null,count:0,state:null},u.set(s,p)),p):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function Ll(i){return'href="'+si(i)+'"'}function Tu(i){return'link[rel="stylesheet"]['+i+"]"}function XE(i){return h({},i,{"data-precedence":i.precedence,precedence:null})}function HP(i,s,u,p){i.querySelector('link[rel="preload"][as="style"]['+s+"]")?p.loading=1:(s=i.createElement("link"),p.preload=s,s.addEventListener("load",function(){return p.loading|=1}),s.addEventListener("error",function(){return p.loading|=2}),fr(s,"link",u),On(s),i.head.appendChild(s))}function _l(i){return'[src="'+si(i)+'"]'}function Ru(i){return"script[async]"+i}function QE(i,s,u){if(s.count++,s.instance===null)switch(s.type){case"style":var p=i.querySelector('style[data-href~="'+si(u.href)+'"]');if(p)return s.instance=p,On(p),p;var b=h({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return p=(i.ownerDocument||i).createElement("style"),On(p),fr(p,"style",b),lh(p,u.precedence,i),s.instance=p;case"stylesheet":b=Ll(u.href);var x=i.querySelector(Tu(b));if(x)return s.state.loading|=4,s.instance=x,On(x),x;p=XE(u),(b=mi.get(b))&&Iy(p,b),x=(i.ownerDocument||i).createElement("link"),On(x);var N=x;return N._p=new Promise(function(Y,ne){N.onload=Y,N.onerror=ne}),fr(x,"link",p),s.state.loading|=4,lh(x,u.precedence,i),s.instance=x;case"script":return x=_l(u.src),(b=i.querySelector(Ru(x)))?(s.instance=b,On(b),b):(p=u,(b=mi.get(x))&&(p=h({},u),Py(p,b)),i=i.ownerDocument||i,b=i.createElement("script"),On(b),fr(b,"link",p),i.head.appendChild(b),s.instance=b);case"void":return null;default:throw Error(r(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(p=s.instance,s.state.loading|=4,lh(p,u.precedence,i));return s.instance}function lh(i,s,u){for(var p=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),b=p.length?p[p.length-1]:null,x=b,N=0;N<p.length;N++){var Y=p[N];if(Y.dataset.precedence===s)x=Y;else if(x!==b)break}x?x.parentNode.insertBefore(i,x.nextSibling):(s=u.nodeType===9?u.head:u,s.insertBefore(i,s.firstChild))}function Iy(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.title==null&&(i.title=s.title)}function Py(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.integrity==null&&(i.integrity=s.integrity)}var ch=null;function ZE(i,s,u){if(ch===null){var p=new Map,b=ch=new Map;b.set(u,p)}else b=ch,p=b.get(u),p||(p=new Map,b.set(u,p));if(p.has(i))return p;for(p.set(i,null),u=u.getElementsByTagName(i),b=0;b<u.length;b++){var x=u[b];if(!(x[Nn]||x[We]||i==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var N=x.getAttribute(s)||"";N=i+N;var Y=p.get(N);Y?Y.push(x):p.set(N,[x])}}return p}function JE(i,s,u){i=i.ownerDocument||i,i.head.insertBefore(u,s==="title"?i.querySelector("head > title"):null)}function UP(i,s,u){if(u===1||s.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;switch(s.rel){case"stylesheet":return i=s.disabled,typeof s.precedence=="string"&&i==null;default:return!0}case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function eC(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function qP(i,s,u,p){if(u.type==="stylesheet"&&(typeof p.media!="string"||matchMedia(p.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var b=Ll(p.href),x=s.querySelector(Tu(b));if(x){s=x._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(i.count++,i=uh.bind(i),s.then(i,i)),u.state.loading|=4,u.instance=x,On(x);return}x=s.ownerDocument||s,p=XE(p),(b=mi.get(b))&&Iy(p,b),x=x.createElement("link"),On(x);var N=x;N._p=new Promise(function(Y,ne){N.onload=Y,N.onerror=ne}),fr(x,"link",p),u.instance=x}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(u,s),(s=u.state.preload)&&(u.state.loading&3)===0&&(i.count++,u=uh.bind(i),s.addEventListener("load",u),s.addEventListener("error",u))}}var Ly=0;function VP(i,s){return i.stylesheets&&i.count===0&&fh(i,i.stylesheets),0<i.count||0<i.imgCount?function(u){var p=setTimeout(function(){if(i.stylesheets&&fh(i,i.stylesheets),i.unsuspend){var x=i.unsuspend;i.unsuspend=null,x()}},6e4+s);0<i.imgBytes&&Ly===0&&(Ly=62500*CP());var b=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&fh(i,i.stylesheets),i.unsuspend)){var x=i.unsuspend;i.unsuspend=null,x()}},(i.imgBytes>Ly?50:800)+s);return i.unsuspend=u,function(){i.unsuspend=null,clearTimeout(p),clearTimeout(b)}}:null}function uh(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)fh(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var dh=null;function fh(i,s){i.stylesheets=null,i.unsuspend!==null&&(i.count++,dh=new Map,s.forEach($P,i),dh=null,uh.call(i))}function $P(i,s){if(!(s.state.loading&4)){var u=dh.get(i);if(u)var p=u.get(null);else{u=new Map,dh.set(i,u);for(var b=i.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<b.length;x++){var N=b[x];(N.nodeName==="LINK"||N.getAttribute("media")!=="not all")&&(u.set(N.dataset.precedence,N),p=N)}p&&u.set(null,p)}b=s.instance,N=b.getAttribute("data-precedence"),x=u.get(N)||p,x===p&&u.set(null,b),u.set(N,b),this.count++,p=uh.bind(this),b.addEventListener("load",p),b.addEventListener("error",p),x?x.parentNode.insertBefore(b,x.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(b,i.firstChild)),s.state.loading|=4}}var ku={$$typeof:k,Provider:null,Consumer:null,_currentValue:H,_currentValue2:H,_threadCount:0};function YP(i,s,u,p,b,x,N,Y,ne){this.tag=1,this.containerInfo=i,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=dn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=dn(0),this.hiddenUpdates=dn(null),this.identifierPrefix=p,this.onUncaughtError=b,this.onCaughtError=x,this.onRecoverableError=N,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ne,this.incompleteTransitions=new Map}function tC(i,s,u,p,b,x,N,Y,ne,ge,Me,Ie){return i=new YP(i,s,u,N,ne,ge,Me,Ie,Y),s=1,x===!0&&(s|=24),x=Wr(3,null,null,s),i.current=x,x.stateNode=i,s=pg(),s.refCount++,i.pooledCache=s,s.refCount++,x.memoizedState={element:p,isDehydrated:u,cache:s},bg(x),i}function nC(i){return i?(i=hl,i):hl}function rC(i,s,u,p,b,x){b=nC(b),p.context===null?p.context=b:p.pendingContext=b,p=no(s),p.payload={element:u},x=x===void 0?null:x,x!==null&&(p.callback=x),u=ro(i,p,s),u!==null&&(Lr(u,i,s),au(u,i,s))}function iC(i,s){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var u=i.retryLane;i.retryLane=u!==0&&u<s?u:s}}function _y(i,s){iC(i,s),(i=i.alternate)&&iC(i,s)}function aC(i){if(i.tag===13||i.tag===31){var s=os(i,67108864);s!==null&&Lr(s,i,67108864),_y(i,67108864)}}function oC(i){if(i.tag===13||i.tag===31){var s=Zr();s=de(s);var u=os(i,s);u!==null&&Lr(u,i,s),_y(i,s)}}var hh=!0;function WP(i,s,u,p){var b=j.T;j.T=null;var x=z.p;try{z.p=2,jy(i,s,u,p)}finally{z.p=x,j.T=b}}function KP(i,s,u,p){var b=j.T;j.T=null;var x=z.p;try{z.p=8,jy(i,s,u,p)}finally{z.p=x,j.T=b}}function jy(i,s,u,p){if(hh){var b=zy(p);if(b===null)Ey(i,s,p,ph,u),lC(i,p);else if(XP(b,i,s,u,p))p.stopPropagation();else if(lC(i,p),s&4&&-1<GP.indexOf(i)){for(;b!==null;){var x=Zt(b);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var N=bt(x.pendingLanes);if(N!==0){var Y=x;for(Y.pendingLanes|=2,Y.entangledLanes|=2;N;){var ne=1<<31-tt(N);Y.entanglements[1]|=ne,N&=~ne}Ki(x),(fn&6)===0&&(Xf=De()+500,wu(0))}}break;case 31:case 13:Y=os(x,2),Y!==null&&Lr(Y,x,2),Zf(),_y(x,2)}if(x=zy(p),x===null&&Ey(i,s,p,ph,u),x===b)break;b=x}b!==null&&p.stopPropagation()}else Ey(i,s,p,null,u)}}function zy(i){return i=Bm(i),Fy(i)}var ph=null;function Fy(i){if(ph=null,i=Ln(i),i!==null){var s=o(i);if(s===null)i=null;else{var u=s.tag;if(u===13){if(i=l(s),i!==null)return i;i=null}else if(u===31){if(i=c(s),i!==null)return i;i=null}else if(u===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;i=null}else s!==i&&(i=null)}}return ph=i,null}function sC(i){switch(i){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ut()){case pe:return 2;case Te:return 8;case ee:case fe:return 32;case Ae:return 268435456;default:return 32}default:return 32}}var By=!1,mo=null,go=null,yo=null,Mu=new Map,Ou=new Map,bo=[],GP="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 lC(i,s){switch(i){case"focusin":case"focusout":mo=null;break;case"dragenter":case"dragleave":go=null;break;case"mouseover":case"mouseout":yo=null;break;case"pointerover":case"pointerout":Mu.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ou.delete(s.pointerId)}}function Au(i,s,u,p,b,x){return i===null||i.nativeEvent!==x?(i={blockedOn:s,domEventName:u,eventSystemFlags:p,nativeEvent:x,targetContainers:[b]},s!==null&&(s=Zt(s),s!==null&&aC(s)),i):(i.eventSystemFlags|=p,s=i.targetContainers,b!==null&&s.indexOf(b)===-1&&s.push(b),i)}function XP(i,s,u,p,b){switch(s){case"focusin":return mo=Au(mo,i,s,u,p,b),!0;case"dragenter":return go=Au(go,i,s,u,p,b),!0;case"mouseover":return yo=Au(yo,i,s,u,p,b),!0;case"pointerover":var x=b.pointerId;return Mu.set(x,Au(Mu.get(x)||null,i,s,u,p,b)),!0;case"gotpointercapture":return x=b.pointerId,Ou.set(x,Au(Ou.get(x)||null,i,s,u,p,b)),!0}return!1}function cC(i){var s=Ln(i.target);if(s!==null){var u=o(s);if(u!==null){if(s=u.tag,s===13){if(s=l(u),s!==null){i.blockedOn=s,rt(i.priority,function(){oC(u)});return}}else if(s===31){if(s=c(u),s!==null){i.blockedOn=s,rt(i.priority,function(){oC(u)});return}}else if(s===3&&u.stateNode.current.memoizedState.isDehydrated){i.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}i.blockedOn=null}function mh(i){if(i.blockedOn!==null)return!1;for(var s=i.targetContainers;0<s.length;){var u=zy(i.nativeEvent);if(u===null){u=i.nativeEvent;var p=new u.constructor(u.type,u);Fm=p,u.target.dispatchEvent(p),Fm=null}else return s=Zt(u),s!==null&&aC(s),i.blockedOn=u,!1;s.shift()}return!0}function uC(i,s,u){mh(i)&&u.delete(s)}function QP(){By=!1,mo!==null&&mh(mo)&&(mo=null),go!==null&&mh(go)&&(go=null),yo!==null&&mh(yo)&&(yo=null),Mu.forEach(uC),Ou.forEach(uC)}function gh(i,s){i.blockedOn===s&&(i.blockedOn=null,By||(By=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,QP)))}var yh=null;function dC(i){yh!==i&&(yh=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){yh===i&&(yh=null);for(var s=0;s<i.length;s+=3){var u=i[s],p=i[s+1],b=i[s+2];if(typeof p!="function"){if(Fy(p||u)===null)continue;break}var x=Zt(u);x!==null&&(i.splice(s,3),s-=3,zg(x,{pending:!0,data:b,method:u.method,action:p},p,b))}}))}function jl(i){function s(ne){return gh(ne,i)}mo!==null&&gh(mo,i),go!==null&&gh(go,i),yo!==null&&gh(yo,i),Mu.forEach(s),Ou.forEach(s);for(var u=0;u<bo.length;u++){var p=bo[u];p.blockedOn===i&&(p.blockedOn=null)}for(;0<bo.length&&(u=bo[0],u.blockedOn===null);)cC(u),u.blockedOn===null&&bo.shift();if(u=(i.ownerDocument||i).$$reactFormReplay,u!=null)for(p=0;p<u.length;p+=3){var b=u[p],x=u[p+1],N=b[Xe]||null;if(typeof x=="function")N||dC(u);else if(N){var Y=null;if(x&&x.hasAttribute("formAction")){if(b=x,N=x[Xe]||null)Y=N.formAction;else if(Fy(b)!==null)continue}else Y=N.action;typeof Y=="function"?u[p+1]=Y:(u.splice(p,3),p-=3),dC(u)}}}function fC(){function i(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:function(){return new Promise(function(N){return b=N})},focusReset:"manual",scroll:"manual"})}function s(){b!==null&&(b(),b=null),p||setTimeout(u,20)}function u(){if(!p&&!navigation.transition){var x=navigation.currentEntry;x&&x.url!=null&&navigation.navigate(x.url,{state:x.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var p=!1,b=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(u,100),function(){p=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),b!==null&&(b(),b=null)}}}function Hy(i){this._internalRoot=i}bh.prototype.render=Hy.prototype.render=function(i){var s=this._internalRoot;if(s===null)throw Error(r(409));var u=s.current,p=Zr();rC(u,p,i,s,null,null)},bh.prototype.unmount=Hy.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var s=i.containerInfo;rC(i.current,2,null,i,null,null),Zf(),s[ot]=null}};function bh(i){this._internalRoot=i}bh.prototype.unstable_scheduleHydration=function(i){if(i){var s=je();i={blockedOn:null,target:i,priority:s};for(var u=0;u<bo.length&&s!==0&&s<bo[u].priority;u++);bo.splice(u,0,i),u===0&&cC(i)}};var hC=t.version;if(hC!=="19.2.4")throw Error(r(527,hC,"19.2.4"));z.findDOMNode=function(i){var s=i._reactInternals;if(s===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=d(s),i=i!==null?m(i):null,i=i===null?null:i.stateNode,i};var ZP={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:j,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var vh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!vh.isDisabled&&vh.supportsFiber)try{et=vh.inject(ZP),ze=vh}catch{}}return Du.createRoot=function(i,s){if(!a(i))throw Error(r(299));var u=!1,p="",b=x1,x=w1,N=S1;return s!=null&&(s.unstable_strictMode===!0&&(u=!0),s.identifierPrefix!==void 0&&(p=s.identifierPrefix),s.onUncaughtError!==void 0&&(b=s.onUncaughtError),s.onCaughtError!==void 0&&(x=s.onCaughtError),s.onRecoverableError!==void 0&&(N=s.onRecoverableError)),s=tC(i,1,!1,null,null,u,p,null,b,x,N,fC),i[ot]=s.current,Sy(i),new Hy(s)},Du.hydrateRoot=function(i,s,u){if(!a(i))throw Error(r(299));var p=!1,b="",x=x1,N=w1,Y=S1,ne=null;return u!=null&&(u.unstable_strictMode===!0&&(p=!0),u.identifierPrefix!==void 0&&(b=u.identifierPrefix),u.onUncaughtError!==void 0&&(x=u.onUncaughtError),u.onCaughtError!==void 0&&(N=u.onCaughtError),u.onRecoverableError!==void 0&&(Y=u.onRecoverableError),u.formState!==void 0&&(ne=u.formState)),s=tC(i,1,!0,s,u??null,p,b,ne,x,N,Y,fC),s.context=nC(null),u=s.current,p=Zr(),p=de(p),b=no(p),b.callback=null,ro(u,b,p),u=p,s.current.lanes=u,Ut(s,u),Ki(s),i[ot]=s.current,Sy(i),new bh(s)},Du.version="19.2.4",Du}var _C;function GL(){if(_C)return $y.exports;_C=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(),$y.exports=KL(),$y.exports}var XL=GL();/**
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 NM=e=>{throw TypeError(e)},QL=(e,t,n)=>t.has(e)||NM("Cannot "+n),Gy=(e,t,n)=>(QL(e,t,"read from private field"),n?n.call(e):t.get(e)),ZL=(e,t,n)=>t.has(e)?NM("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),jC="popstate";function JL(e={}){function t(r,a){let{pathname:o,search:l,hash:c}=r.location;return bd("",{pathname:o,search:l,hash:c},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function n(r,a){return typeof a=="string"?a:aa(a)}return t_(t,n,null,e)}function Vt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Qn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function e_(){return Math.random().toString(36).substring(2,10)}function zC(e,t){return{usr:e.state,key:e.key,idx:t}}function bd(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Yo(t):t,state:n,key:t&&t.key||r||e_()}}function aa({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 Yo(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function t_(e,t,n,r={}){let{window:a=document.defaultView,v5Compat:o=!1}=r,l=a.history,c="POP",f=null,d=m();d==null&&(d=0,l.replaceState({...l.state,idx:d},""));function m(){return(l.state||{idx:null}).idx}function h(){c="POP";let T=m(),E=T==null?null:T-d;d=T,f&&f({action:c,location:C.location,delta:E})}function y(T,E){c="PUSH";let R=bd(C.location,T,E);d=m()+1;let k=zC(R,d),M=C.createHref(R);try{l.pushState(k,"",M)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;a.location.assign(M)}o&&f&&f({action:c,location:C.location,delta:1})}function g(T,E){c="REPLACE";let R=bd(C.location,T,E);d=m();let k=zC(R,d),M=C.createHref(R);l.replaceState(k,"",M),o&&f&&f({action:c,location:C.location,delta:0})}function w(T){return DM(T)}let C={get action(){return c},get location(){return e(a,l)},listen(T){if(f)throw new Error("A history only accepts one active listener");return a.addEventListener(jC,h),f=T,()=>{a.removeEventListener(jC,h),f=null}},createHref(T){return t(a,T)},createURL:w,encodeLocation(T){let E=w(T);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:y,replace:g,go(T){return l.go(T)}};return C}function DM(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Vt(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:aa(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}var Ku,FC=class{constructor(e){if(ZL(this,Ku,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(Gy(this,Ku).has(e))return Gy(this,Ku).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){Gy(this,Ku).set(e,t)}};Ku=new WeakMap;var n_=new Set(["lazy","caseSensitive","path","id","index","children"]);function r_(e){return n_.has(e)}var i_=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function a_(e){return i_.has(e)}function o_(e){return e.index===!0}function vd(e,t,n=[],r={},a=!1){return e.map((o,l)=>{let c=[...n,String(l)],f=typeof o.id=="string"?o.id:c.join("-");if(Vt(o.index!==!0||!o.children,"Cannot specify children on an index route"),Vt(a||!r[f],`Found a route id collision on id "${f}". Route id's must be globally unique within Data Router usages`),o_(o)){let d={...o,id:f};return r[f]=BC(d,t(d)),d}else{let d={...o,id:f,children:void 0};return r[f]=BC(d,t(d)),o.children&&(d.children=vd(o.children,t,c,r,a)),d}})}function BC(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function To(e,t,n="/"){return Gu(e,t,n,!1)}function Gu(e,t,n,r){let a=typeof t=="string"?Yo(t):t,o=Ci(a.pathname||"/",n);if(o==null)return null;let l=IM(e);l_(l);let c=null;for(let f=0;c==null&&f<l.length;++f){let d=LM(o);c=y_(l[f],d,r)}return c}function s_(e,t){let{route:n,pathname:r,params:a}=e;return{id:n.id,pathname:r,params:a,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function IM(e,t=[],n=[],r="",a=!1){let o=(l,c,f=a,d)=>{let m={relativePath:d===void 0?l.path||"":d,caseSensitive:l.caseSensitive===!0,childrenIndex:c,route:l};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(r)&&f)return;Vt(m.relativePath.startsWith(r),`Absolute route path "${m.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(r.length)}let h=na([r,m.relativePath]),y=n.concat(m);l.children&&l.children.length>0&&(Vt(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),IM(l.children,t,y,h,f)),!(l.path==null&&!l.index)&&t.push({path:h,score:m_(h,l.index),routesMeta:y})};return e.forEach((l,c)=>{var f;if(l.path===""||!((f=l.path)!=null&&f.includes("?")))o(l,c);else for(let d of PM(l.path))o(l,c,!0,d)}),t}function PM(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return a?[o,""]:[o];let l=PM(r.join("/")),c=[];return c.push(...l.map(f=>f===""?o:[o,f].join("/"))),a&&c.push(...l),c.map(f=>e.startsWith("/")&&f===""?"/":f)}function l_(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:g_(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var c_=/^:[\w-]+$/,u_=3,d_=2,f_=1,h_=10,p_=-2,HC=e=>e==="*";function m_(e,t){let n=e.split("/"),r=n.length;return n.some(HC)&&(r+=p_),t&&(r+=d_),n.filter(a=>!HC(a)).reduce((a,o)=>a+(c_.test(o)?u_:o===""?f_:h_),r)}function g_(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function y_(e,t,n=!1){let{routesMeta:r}=e,a={},o="/",l=[];for(let c=0;c<r.length;++c){let f=r[c],d=c===r.length-1,m=o==="/"?t:t.slice(o.length)||"/",h=Us({path:f.relativePath,caseSensitive:f.caseSensitive,end:d},m),y=f.route;if(!h&&d&&n&&!r[r.length-1].route.index&&(h=Us({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},m)),!h)return null;Object.assign(a,h.params),l.push({params:a,pathname:na([o,h.pathname]),pathnameBase:w_(na([o,h.pathnameBase])),route:y}),h.pathnameBase!=="/"&&(o=na([o,h.pathnameBase]))}return l}function Us(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=b_(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let o=a[0],l=o.replace(/(.)\/+$/,"$1"),c=a.slice(1);return{params:r.reduce((d,{paramName:m,isOptional:h},y)=>{if(m==="*"){let w=c[y]||"";l=o.slice(0,o.length-w.length).replace(/(.)\/+$/,"$1")}const g=c[y];return h&&!g?d[m]=void 0:d[m]=(g||"").replace(/%2F/g,"/"),d},{}),pathname:o,pathnameBase:l,pattern:e}}function b_(e,t=!1,n=!0){Qn(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,c,f)=>(r.push({paramName:c,isOptional:f!=null}),f?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function LM(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Qn(!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 Ci(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function v_({basename:e,pathname:t}){return t==="/"?e:na([e,t])}var _M=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Lx=e=>_M.test(e);function x_(e,t="/"){let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?Yo(e):e,o;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?o=UC(n.substring(1),"/"):o=UC(n,t)):o=t,{pathname:o,search:S_(r),hash:E_(a)}}function UC(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function Xy(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function jM(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function _x(e){let t=jM(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function jx(e,t,n,r=!1){let a;typeof e=="string"?a=Yo(e):(a={...e},Vt(!a.pathname||!a.pathname.includes("?"),Xy("?","pathname","search",a)),Vt(!a.pathname||!a.pathname.includes("#"),Xy("#","pathname","hash",a)),Vt(!a.search||!a.search.includes("#"),Xy("#","search","hash",a)));let o=e===""||a.pathname==="",l=o?"/":a.pathname,c;if(l==null)c=n;else{let h=t.length-1;if(!r&&l.startsWith("..")){let y=l.split("/");for(;y[0]==="..";)y.shift(),h-=1;a.pathname=y.join("/")}c=h>=0?t[h]:"/"}let f=x_(a,c),d=l&&l!=="/"&&l.endsWith("/"),m=(o||l===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(d||m)&&(f.pathname+="/"),f}var na=e=>e.join("/").replace(/\/\/+/g,"/"),w_=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),S_=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,E_=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,zd=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function xd(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function Fd(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var zM=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function FM(e,t){let n=e;if(typeof n!="string"||!_M.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,a=!1;if(zM)try{let o=new URL(window.location.href),l=n.startsWith("//")?new URL(o.protocol+n):new URL(n),c=Ci(l.pathname,t);l.origin===o.origin&&c!=null?n=c+l.search+l.hash:a=!0}catch{Qn(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:a,to:n}}var _o=Symbol("Uninstrumented");function C_(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(a=>a({id:t.id,index:t.index,path:t.path,instrument(o){let l=Object.keys(n);for(let c of l)o[c]&&n[c].push(o[c])}}));let r={};if(typeof t.lazy=="function"&&n.lazy.length>0){let a=Kl(n.lazy,t.lazy,()=>{});a&&(r.lazy=a)}if(typeof t.lazy=="object"){let a=t.lazy;["middleware","loader","action"].forEach(o=>{let l=a[o],c=n[`lazy.${o}`];if(typeof l=="function"&&c.length>0){let f=Kl(c,l,()=>{});f&&(r.lazy=Object.assign(r.lazy||{},{[o]:f}))}})}return["loader","action"].forEach(a=>{let o=t[a];if(typeof o=="function"&&n[a].length>0){let l=o[_o]??o,c=Kl(n[a],l,(...f)=>qC(f[0]));c&&(a==="loader"&&l.hydrate===!0&&(c.hydrate=!0),c[_o]=l,r[a]=c)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(a=>{let o=a[_o]??a,l=Kl(n.middleware,o,(...c)=>qC(c[0]));return l?(l[_o]=o,l):a})),r}function T_(e,t){let n={navigate:[],fetch:[]};if(t.forEach(r=>r({instrument(a){let o=Object.keys(a);for(let l of o)a[l]&&n[l].push(a[l])}})),n.navigate.length>0){let r=e.navigate[_o]??e.navigate,a=Kl(n.navigate,r,(...o)=>{let[l,c]=o;return{to:typeof l=="number"||typeof l=="string"?l:l?aa(l):".",...VC(e,c??{})}});a&&(a[_o]=r,e.navigate=a)}if(n.fetch.length>0){let r=e.fetch[_o]??e.fetch,a=Kl(n.fetch,r,(...o)=>{let[l,,c,f]=o;return{href:c??".",fetcherKey:l,...VC(e,f??{})}});a&&(a[_o]=r,e.fetch=a)}return e}function Kl(e,t,n){return e.length===0?null:async(...r)=>{let a=await BM(e,n(...r),()=>t(...r),e.length-1);if(a.type==="error")throw a.value;return a.value}}async function BM(e,t,n,r){let a=e[r],o;if(a){let l,c=async()=>(l?console.error("You cannot call instrumented handlers more than once"):l=BM(e,t,n,r-1),o=await l,Vt(o,"Expected a result"),o.type==="error"&&o.value instanceof Error?{status:"error",error:o.value}:{status:"success",error:void 0});try{await a(c,t)}catch(f){console.error("An instrumentation function threw an error:",f)}l||await c(),await l}else try{o={type:"success",value:await n()}}catch(l){o={type:"error",value:l}}return o||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function qC(e){let{request:t,context:n,params:r,unstable_pattern:a}=e;return{request:R_(t),params:{...r},unstable_pattern:a,context:k_(n)}}function VC(e,t){return{currentUrl:aa(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 R_(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function k_(e){if(O_(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var M_=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function O_(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")===M_}var HM=["POST","PUT","PATCH","DELETE"],A_=new Set(HM),N_=["GET",...HM],D_=new Set(N_),UM=new Set([301,302,303,307,308]),I_=new Set([307,308]),Qy={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},P_={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Iu={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},L_=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),qM="remix-router-transitions",VM=Symbol("ResetLoaderData");function __(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";Vt(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=e.hydrationRouteProperties||[],a=e.mapRouteProperties||L_,o=a;if(e.unstable_instrumentations){let X=e.unstable_instrumentations;o=ie=>({...a(ie),...C_(X.map(de=>de.route).filter(Boolean),ie)})}let l={},c=vd(e.routes,o,void 0,l),f,d=e.basename||"/";d.startsWith("/")||(d=`/${d}`);let m=e.dataStrategy||H_,h={...e.future},y=null,g=new Set,w=null,C=null,T=null,E=e.hydrationData!=null,R=To(c,e.history.location,d),k=!1,M=null,D;if(R==null&&!e.patchRoutesOnNavigation){let X=yi(404,{pathname:e.history.location.pathname}),{matches:ie,route:de}=Sh(c);D=!0,R=ie,M={[de.id]:X}}else if(R&&!e.hydrationData&&Rt(R,c,e.history.location.pathname).active&&(R=null),R)if(R.some(X=>X.route.lazy))D=!1;else if(!R.some(X=>zx(X.route)))D=!0;else{let X=e.hydrationData?e.hydrationData.loaderData:null,ie=e.hydrationData?e.hydrationData.errors:null;if(ie){let de=R.findIndex(ke=>ie[ke.route.id]!==void 0);D=R.slice(0,de+1).every(ke=>!xv(ke.route,X,ie))}else D=R.every(de=>!xv(de.route,X,ie))}else{D=!1,R=[];let X=Rt(null,c,e.history.location.pathname);X.active&&X.matches&&(k=!0,R=X.matches)}let O,A={historyAction:e.history.action,location:e.history.location,matches:R,initialized:D,navigation:Qy,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||M,fetchers:new Map,blockers:new Map},L="POP",q=null,F=!1,W,_=!1,V=new Map,$=null,B=!1,j=!1,z=new Set,H=new Map,K=0,P=-1,U=new Map,G=new Set,I=new Map,Q=new Map,le=new Set,ae=new Map,Z,ue=null;function ve(){if(y=e.history.listen(({action:X,location:ie,delta:de})=>{if(Z){Z(),Z=void 0;return}Qn(ae.size===0||de!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let ke=it({currentLocation:A.location,nextLocation:ie,historyAction:X});if(ke&&de!=null){let je=new Promise(rt=>{Z=rt});e.history.go(de*-1),At(ke,{state:"blocked",location:ie,proceed(){At(ke,{state:"proceeding",proceed:void 0,reset:void 0,location:ie}),je.then(()=>e.history.go(de))},reset(){let rt=new Map(A.blockers);rt.set(ke,Iu),te({blockers:rt})}}),q==null||q.resolve(),q=null;return}return Oe(X,ie)}),n){aj(t,V);let X=()=>oj(t,V);t.addEventListener("pagehide",X),$=()=>t.removeEventListener("pagehide",X)}return A.initialized||Oe("POP",A.location,{initialHydration:!0}),O}function Se(){y&&y(),$&&$(),g.clear(),W&&W.abort(),A.fetchers.forEach((X,ie)=>$e(ie)),A.blockers.forEach((X,ie)=>yt(ie))}function Le(X){return g.add(X),()=>g.delete(X)}function te(X,ie={}){X.matches&&(X.matches=X.matches.map(je=>{let rt=l[je.route.id],nt=je.route;return nt.element!==rt.element||nt.errorElement!==rt.errorElement||nt.hydrateFallbackElement!==rt.hydrateFallbackElement?{...je,route:rt}:je})),A={...A,...X};let de=[],ke=[];A.fetchers.forEach((je,rt)=>{je.state==="idle"&&(le.has(rt)?de.push(rt):ke.push(rt))}),le.forEach(je=>{!A.fetchers.has(je)&&!H.has(je)&&de.push(je)}),[...g].forEach(je=>je(A,{deletedFetchers:de,newErrors:X.errors??null,viewTransitionOpts:ie.viewTransitionOpts,flushSync:ie.flushSync===!0})),de.forEach(je=>$e(je)),ke.forEach(je=>A.fetchers.delete(je))}function he(X,ie,{flushSync:de}={}){var Et,ht;let ke=A.actionData!=null&&A.navigation.formMethod!=null&&yr(A.navigation.formMethod)&&A.navigation.state==="loading"&&((Et=X.state)==null?void 0:Et._isRedirect)!==!0,je;ie.actionData?Object.keys(ie.actionData).length>0?je=ie.actionData:je=null:ke?je=A.actionData:je=null;let rt=ie.loaderData?eT(A.loaderData,ie.loaderData,ie.matches||[],ie.errors):A.loaderData,nt=A.blockers;nt.size>0&&(nt=new Map(nt),nt.forEach((Lt,$t)=>nt.set($t,Iu)));let We=B?!1:_t(X,ie.matches||A.matches),Xe=F===!0||A.navigation.formMethod!=null&&yr(A.navigation.formMethod)&&((ht=X.state)==null?void 0:ht._isRedirect)!==!0;f&&(c=f,f=void 0),B||L==="POP"||(L==="PUSH"?e.history.push(X,X.state):L==="REPLACE"&&e.history.replace(X,X.state));let ot;if(L==="POP"){let Lt=V.get(A.location.pathname);Lt&&Lt.has(X.pathname)?ot={currentLocation:A.location,nextLocation:X}:V.has(X.pathname)&&(ot={currentLocation:X,nextLocation:A.location})}else if(_){let Lt=V.get(A.location.pathname);Lt?Lt.add(X.pathname):(Lt=new Set([X.pathname]),V.set(A.location.pathname,Lt)),ot={currentLocation:A.location,nextLocation:X}}te({...ie,actionData:je,loaderData:rt,historyAction:L,location:X,initialized:!0,navigation:Qy,revalidation:"idle",restoreScrollPosition:We,preventScrollReset:Xe,blockers:nt},{viewTransitionOpts:ot,flushSync:de===!0}),L="POP",F=!1,_=!1,B=!1,j=!1,q==null||q.resolve(),q=null,ue==null||ue.resolve(),ue=null}async function ye(X,ie){if(q==null||q.resolve(),q=null,typeof X=="number"){q||(q=iT());let $t=q.promise;return e.history.go(X),$t}let de=vv(A.location,A.matches,d,X,ie==null?void 0:ie.fromRouteId,ie==null?void 0:ie.relative),{path:ke,submission:je,error:rt}=$C(!1,de,ie),nt=A.location,We=bd(A.location,ke,ie&&ie.state);We={...We,...e.history.encodeLocation(We)};let Xe=ie&&ie.replace!=null?ie.replace:void 0,ot="PUSH";Xe===!0?ot="REPLACE":Xe===!1||je!=null&&yr(je.formMethod)&&je.formAction===A.location.pathname+A.location.search&&(ot="REPLACE");let Et=ie&&"preventScrollReset"in ie?ie.preventScrollReset===!0:void 0,ht=(ie&&ie.flushSync)===!0,Lt=it({currentLocation:nt,nextLocation:We,historyAction:ot});if(Lt){At(Lt,{state:"blocked",location:We,proceed(){At(Lt,{state:"proceeding",proceed:void 0,reset:void 0,location:We}),ye(X,ie)},reset(){let $t=new Map(A.blockers);$t.set(Lt,Iu),te({blockers:$t})}});return}await Oe(ot,We,{submission:je,pendingError:rt,preventScrollReset:Et,replace:ie&&ie.replace,enableViewTransition:ie&&ie.viewTransition,flushSync:ht,callSiteDefaultShouldRevalidate:ie&&ie.unstable_defaultShouldRevalidate})}function _e(){ue||(ue=iT()),Te(),te({revalidation:"loading"});let X=ue.promise;return A.navigation.state==="submitting"?X:A.navigation.state==="idle"?(Oe(A.historyAction,A.location,{startUninterruptedRevalidation:!0}),X):(Oe(L||A.historyAction,A.navigation.location,{overrideNavigation:A.navigation,enableViewTransition:_===!0}),X)}async function Oe(X,ie,de){W&&W.abort(),W=null,L=X,B=(de&&de.startUninterruptedRevalidation)===!0,kt(A.location,A.matches),F=(de&&de.preventScrollReset)===!0,_=(de&&de.enableViewTransition)===!0;let ke=f||c,je=de&&de.overrideNavigation,rt=de!=null&&de.initialHydration&&A.matches&&A.matches.length>0&&!k?A.matches:To(ke,ie,d),nt=(de&&de.flushSync)===!0;if(rt&&A.initialized&&!j&&G_(A.location,ie)&&!(de&&de.submission&&yr(de.submission.formMethod))){he(ie,{matches:rt},{flushSync:nt});return}let We=Rt(rt,ke,ie.pathname);if(We.active&&We.matches&&(rt=We.matches),!rt){let{error:Pn,notFoundMatches:Ln,route:Zt}=ft(ie.pathname);he(ie,{matches:Ln,loaderData:{},errors:{[Zt.id]:Pn}},{flushSync:nt});return}W=new AbortController;let Xe=$l(e.history,ie,W.signal,de&&de.submission),ot=e.getContext?await e.getContext():new FC,Et;if(de&&de.pendingError)Et=[Ro(rt).route.id,{type:"error",error:de.pendingError}];else if(de&&de.submission&&yr(de.submission.formMethod)){let Pn=await Ce(Xe,ie,de.submission,rt,ot,We.active,de&&de.initialHydration===!0,{replace:de.replace,flushSync:nt});if(Pn.shortCircuited)return;if(Pn.pendingActionResult){let[Ln,Zt]=Pn.pendingActionResult;if(ei(Zt)&&xd(Zt.error)&&Zt.error.status===404){W=null,he(ie,{matches:Pn.matches,loaderData:{},errors:{[Ln]:Zt.error}});return}}rt=Pn.matches||rt,Et=Pn.pendingActionResult,je=Zy(ie,de.submission),nt=!1,We.active=!1,Xe=$l(e.history,Xe.url,Xe.signal)}let{shortCircuited:ht,matches:Lt,loaderData:$t,errors:Nn}=await Re(Xe,ie,rt,ot,We.active,je,de&&de.submission,de&&de.fetcherSubmission,de&&de.replace,de&&de.initialHydration===!0,nt,Et,de&&de.callSiteDefaultShouldRevalidate);ht||(W=null,he(ie,{matches:Lt||rt,...tT(Et),loaderData:$t,errors:Nn}))}async function Ce(X,ie,de,ke,je,rt,nt,We={}){Te();let Xe=rj(ie,de);if(te({navigation:Xe},{flushSync:We.flushSync===!0}),rt){let ht=await dn(ke,ie.pathname,X.signal);if(ht.type==="aborted")return{shortCircuited:!0};if(ht.type==="error"){if(ht.partialMatches.length===0){let{matches:$t,route:Nn}=Sh(c);return{matches:$t,pendingActionResult:[Nn.id,{type:"error",error:ht.error}]}}let Lt=Ro(ht.partialMatches).route.id;return{matches:ht.partialMatches,pendingActionResult:[Lt,{type:"error",error:ht.error}]}}else if(ht.matches)ke=ht.matches;else{let{notFoundMatches:Lt,error:$t,route:Nn}=ft(ie.pathname);return{matches:Lt,pendingActionResult:[Nn.id,{type:"error",error:$t}]}}}let ot,Et=Qh(ke,ie);if(!Et.route.action&&!Et.route.lazy)ot={type:"error",error:yi(405,{method:X.method,pathname:ie.pathname,routeId:Et.route.id})};else{let ht=Xl(o,l,X,ke,Et,nt?[]:r,je),Lt=await ut(X,ht,je,null);if(ot=Lt[Et.route.id],!ot){for(let $t of ke)if(Lt[$t.route.id]){ot=Lt[$t.route.id];break}}if(X.signal.aborted)return{shortCircuited:!0}}if(Ts(ot)){let ht;return We&&We.replace!=null?ht=We.replace:ht=QC(ot.response.headers.get("Location"),new URL(X.url),d,e.history)===A.location.pathname+A.location.search,await De(X,ot,!0,{submission:de,replace:ht}),{shortCircuited:!0}}if(ei(ot)){let ht=Ro(ke,Et.route.id);return(We&&We.replace)!==!0&&(L="PUSH"),{matches:ke,pendingActionResult:[ht.route.id,ot,Et.route.id]}}return{matches:ke,pendingActionResult:[Et.route.id,ot]}}async function Re(X,ie,de,ke,je,rt,nt,We,Xe,ot,Et,ht,Lt){let $t=rt||Zy(ie,nt),Nn=nt||We||rT($t),Pn=!B&&!ot;if(je){if(Pn){let Un=J(ht);te({navigation:$t,...Un!==void 0?{actionData:Un}:{}},{flushSync:Et})}let Jt=await dn(de,ie.pathname,X.signal);if(Jt.type==="aborted")return{shortCircuited:!0};if(Jt.type==="error"){if(Jt.partialMatches.length===0){let{matches:Oi,route:lr}=Sh(c);return{matches:Oi,loaderData:{},errors:{[lr.id]:Jt.error}}}let Un=Ro(Jt.partialMatches).route.id;return{matches:Jt.partialMatches,loaderData:{},errors:{[Un]:Jt.error}}}else if(Jt.matches)de=Jt.matches;else{let{error:Un,notFoundMatches:Oi,route:lr}=ft(ie.pathname);return{matches:Oi,loaderData:{},errors:{[lr.id]:Un}}}}let Ln=f||c,{dsMatches:Zt,revalidatingFetchers:rr}=YC(X,ke,o,l,e.history,A,de,Nn,ie,ot?[]:r,ot===!0,j,z,le,I,G,Ln,d,e.patchRoutesOnNavigation!=null,ht,Lt);if(P=++K,!e.dataStrategy&&!Zt.some(Jt=>Jt.shouldLoad)&&!Zt.some(Jt=>Jt.route.middleware&&Jt.route.middleware.length>0)&&rr.length===0){let Jt=tt();return he(ie,{matches:de,loaderData:{},errors:ht&&ei(ht[1])?{[ht[0]]:ht[1].error}:null,...tT(ht),...Jt?{fetchers:new Map(A.fetchers)}:{}},{flushSync:Et}),{shortCircuited:!0}}if(Pn){let Jt={};if(!je){Jt.navigation=$t;let Un=J(ht);Un!==void 0&&(Jt.actionData=Un)}rr.length>0&&(Jt.fetchers=Ee(rr)),te(Jt,{flushSync:Et})}rr.forEach(Jt=>{ze(Jt.key),Jt.controller&&H.set(Jt.key,Jt.controller)});let Or=()=>rr.forEach(Jt=>ze(Jt.key));W&&W.signal.addEventListener("abort",Or);let{loaderResults:On,fetcherResults:ki}=await pe(Zt,rr,X,ke);if(X.signal.aborted)return{shortCircuited:!0};W&&W.signal.removeEventListener("abort",Or),rr.forEach(Jt=>H.delete(Jt.key));let $r=Eh(On);if($r)return await De(X,$r.result,!0,{replace:Xe}),{shortCircuited:!0};if($r=Eh(ki),$r)return G.add($r.key),await De(X,$r.result,!0,{replace:Xe}),{shortCircuited:!0};let{loaderData:Mi,errors:oi}=JC(A,de,On,ht,rr,ki);ot&&A.errors&&(oi={...A.errors,...oi});let ha=tt(),es=Tt(P),ts=ha||es||rr.length>0;return{matches:de,loaderData:Mi,errors:oi,...ts?{fetchers:new Map(A.fetchers)}:{}}}function J(X){if(X&&!ei(X[1]))return{[X[0]]:X[1].data};if(A.actionData)return Object.keys(A.actionData).length===0?null:A.actionData}function Ee(X){return X.forEach(ie=>{let de=A.fetchers.get(ie.key),ke=Pu(void 0,de?de.data:void 0);A.fetchers.set(ie.key,ke)}),new Map(A.fetchers)}async function xe(X,ie,de,ke){ze(X);let je=(ke&&ke.flushSync)===!0,rt=f||c,nt=vv(A.location,A.matches,d,de,ie,ke==null?void 0:ke.relative),We=To(rt,nt,d),Xe=Rt(We,rt,nt);if(Xe.active&&Xe.matches&&(We=Xe.matches),!We){fe(X,ie,yi(404,{pathname:nt}),{flushSync:je});return}let{path:ot,submission:Et,error:ht}=$C(!0,nt,ke);if(ht){fe(X,ie,ht,{flushSync:je});return}let Lt=e.getContext?await e.getContext():new FC,$t=(ke&&ke.preventScrollReset)===!0;if(Et&&yr(Et.formMethod)){await Be(X,ie,ot,We,Lt,Xe.active,je,$t,Et,ke&&ke.unstable_defaultShouldRevalidate);return}I.set(X,{routeId:ie,path:ot}),await Ve(X,ie,ot,We,Lt,Xe.active,je,$t,Et)}async function Be(X,ie,de,ke,je,rt,nt,We,Xe,ot){Te(),I.delete(X);let Et=A.fetchers.get(X);ee(X,ij(Xe,Et),{flushSync:nt});let ht=new AbortController,Lt=$l(e.history,de,ht.signal,Xe);if(rt){let en=await dn(ke,new URL(Lt.url).pathname,Lt.signal,X);if(en.type==="aborted")return;if(en.type==="error"){fe(X,ie,en.error,{flushSync:nt});return}else if(en.matches)ke=en.matches;else{fe(X,ie,yi(404,{pathname:de}),{flushSync:nt});return}}let $t=Qh(ke,de);if(!$t.route.action&&!$t.route.lazy){let en=yi(405,{method:Xe.formMethod,pathname:de,routeId:ie});fe(X,ie,en,{flushSync:nt});return}H.set(X,ht);let Nn=K,Pn=Xl(o,l,Lt,ke,$t,r,je),Ln=await ut(Lt,Pn,je,X),Zt=Ln[$t.route.id];if(!Zt){for(let en of Pn)if(Ln[en.route.id]){Zt=Ln[en.route.id];break}}if(Lt.signal.aborted){H.get(X)===ht&&H.delete(X);return}if(le.has(X)){if(Ts(Zt)||ei(Zt)){ee(X,Ia(void 0));return}}else{if(Ts(Zt))if(H.delete(X),P>Nn){ee(X,Ia(void 0));return}else return G.add(X),ee(X,Pu(Xe)),De(Lt,Zt,!1,{fetcherSubmission:Xe,preventScrollReset:We});if(ei(Zt)){fe(X,ie,Zt.error);return}}let rr=A.navigation.location||A.location,Or=$l(e.history,rr,ht.signal),On=f||c,ki=A.navigation.state!=="idle"?To(On,A.navigation.location,d):A.matches;Vt(ki,"Didn't find any matches after fetcher action");let $r=++K;U.set(X,$r);let Mi=Pu(Xe,Zt.data);A.fetchers.set(X,Mi);let{dsMatches:oi,revalidatingFetchers:ha}=YC(Or,je,o,l,e.history,A,ki,Xe,rr,r,!1,j,z,le,I,G,On,d,e.patchRoutesOnNavigation!=null,[$t.route.id,Zt],ot);ha.filter(en=>en.key!==X).forEach(en=>{let ns=en.key,cf=A.fetchers.get(ns),qc=Pu(void 0,cf?cf.data:void 0);A.fetchers.set(ns,qc),ze(ns),en.controller&&H.set(ns,en.controller)}),te({fetchers:new Map(A.fetchers)});let es=()=>ha.forEach(en=>ze(en.key));ht.signal.addEventListener("abort",es);let{loaderResults:ts,fetcherResults:Jt}=await pe(oi,ha,Or,je);if(ht.signal.aborted)return;if(ht.signal.removeEventListener("abort",es),U.delete(X),H.delete(X),ha.forEach(en=>H.delete(en.key)),A.fetchers.has(X)){let en=Ia(Zt.data);A.fetchers.set(X,en)}let Un=Eh(ts);if(Un)return De(Or,Un.result,!1,{preventScrollReset:We});if(Un=Eh(Jt),Un)return G.add(Un.key),De(Or,Un.result,!1,{preventScrollReset:We});let{loaderData:Oi,errors:lr}=JC(A,ki,ts,void 0,ha,Jt);Tt($r),A.navigation.state==="loading"&&$r>P?(Vt(L,"Expected pending action"),W&&W.abort(),he(A.navigation.location,{matches:ki,loaderData:Oi,errors:lr,fetchers:new Map(A.fetchers)})):(te({errors:lr,loaderData:eT(A.loaderData,Oi,ki,lr),fetchers:new Map(A.fetchers)}),j=!1)}async function Ve(X,ie,de,ke,je,rt,nt,We,Xe){let ot=A.fetchers.get(X);ee(X,Pu(Xe,ot?ot.data:void 0),{flushSync:nt});let Et=new AbortController,ht=$l(e.history,de,Et.signal);if(rt){let Zt=await dn(ke,new URL(ht.url).pathname,ht.signal,X);if(Zt.type==="aborted")return;if(Zt.type==="error"){fe(X,ie,Zt.error,{flushSync:nt});return}else if(Zt.matches)ke=Zt.matches;else{fe(X,ie,yi(404,{pathname:de}),{flushSync:nt});return}}let Lt=Qh(ke,de);H.set(X,Et);let $t=K,Nn=Xl(o,l,ht,ke,Lt,r,je),Ln=(await ut(ht,Nn,je,X))[Lt.route.id];if(H.get(X)===Et&&H.delete(X),!ht.signal.aborted){if(le.has(X)){ee(X,Ia(void 0));return}if(Ts(Ln))if(P>$t){ee(X,Ia(void 0));return}else{G.add(X),await De(ht,Ln,!1,{preventScrollReset:We});return}if(ei(Ln)){fe(X,ie,Ln.error);return}ee(X,Ia(Ln.data))}}async function De(X,ie,de,{submission:ke,fetcherSubmission:je,preventScrollReset:rt,replace:nt}={}){de||(q==null||q.resolve(),q=null),ie.response.headers.has("X-Remix-Revalidate")&&(j=!0);let We=ie.response.headers.get("Location");Vt(We,"Expected a Location header on the redirect Response"),We=QC(We,new URL(X.url),d,e.history);let Xe=bd(A.location,We,{_isRedirect:!0});if(n){let Nn=!1;if(ie.response.headers.has("X-Remix-Reload-Document"))Nn=!0;else if(Lx(We)){const Pn=DM(We,!0);Nn=Pn.origin!==t.location.origin||Ci(Pn.pathname,d)==null}if(Nn){nt?t.location.replace(We):t.location.assign(We);return}}W=null;let ot=nt===!0||ie.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Et,formAction:ht,formEncType:Lt}=A.navigation;!ke&&!je&&Et&&ht&&Lt&&(ke=rT(A.navigation));let $t=ke||je;if(I_.has(ie.response.status)&&$t&&yr($t.formMethod))await Oe(ot,Xe,{submission:{...$t,formAction:We},preventScrollReset:rt||F,enableViewTransition:de?_:void 0});else{let Nn=Zy(Xe,ke);await Oe(ot,Xe,{overrideNavigation:Nn,fetcherSubmission:je,preventScrollReset:rt||F,enableViewTransition:de?_:void 0})}}async function ut(X,ie,de,ke){var nt;let je,rt={};try{je=await q_(m,X,ie,ke,de,!1)}catch(We){return ie.filter(Xe=>Xe.shouldLoad).forEach(Xe=>{rt[Xe.route.id]={type:"error",error:We}}),rt}if(X.signal.aborted)return rt;if(!yr(X.method))for(let We of ie){if(((nt=je[We.route.id])==null?void 0:nt.type)==="error")break;!je.hasOwnProperty(We.route.id)&&!A.loaderData.hasOwnProperty(We.route.id)&&(!A.errors||!A.errors.hasOwnProperty(We.route.id))&&We.shouldCallHandler()&&(je[We.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${We.route.id}`)})}for(let[We,Xe]of Object.entries(je))if(J_(Xe)){let ot=Xe.result;rt[We]={type:"redirect",response:W_(ot,X,We,ie,d)}}else rt[We]=await Y_(Xe);return rt}async function pe(X,ie,de,ke){let je=ut(de,X,ke,null),rt=Promise.all(ie.map(async Xe=>{if(Xe.matches&&Xe.match&&Xe.request&&Xe.controller){let Et=(await ut(Xe.request,Xe.matches,ke,Xe.key))[Xe.match.route.id];return{[Xe.key]:Et}}else return Promise.resolve({[Xe.key]:{type:"error",error:yi(404,{pathname:Xe.path})}})})),nt=await je,We=(await rt).reduce((Xe,ot)=>Object.assign(Xe,ot),{});return{loaderResults:nt,fetcherResults:We}}function Te(){j=!0,I.forEach((X,ie)=>{H.has(ie)&&z.add(ie),ze(ie)})}function ee(X,ie,de={}){A.fetchers.set(X,ie),te({fetchers:new Map(A.fetchers)},{flushSync:(de&&de.flushSync)===!0})}function fe(X,ie,de,ke={}){let je=Ro(A.matches,ie);$e(X),te({errors:{[je.route.id]:de},fetchers:new Map(A.fetchers)},{flushSync:(ke&&ke.flushSync)===!0})}function Ae(X){return Q.set(X,(Q.get(X)||0)+1),le.has(X)&&le.delete(X),A.fetchers.get(X)||P_}function He(X,ie){ze(X,ie==null?void 0:ie.reason),ee(X,Ia(null))}function $e(X){let ie=A.fetchers.get(X);H.has(X)&&!(ie&&ie.state==="loading"&&U.has(X))&&ze(X),I.delete(X),U.delete(X),G.delete(X),le.delete(X),z.delete(X),A.fetchers.delete(X)}function et(X){let ie=(Q.get(X)||0)-1;ie<=0?(Q.delete(X),le.add(X)):Q.set(X,ie),te({fetchers:new Map(A.fetchers)})}function ze(X,ie){let de=H.get(X);de&&(de.abort(ie),H.delete(X))}function Ze(X){for(let ie of X){let de=Ae(ie),ke=Ia(de.data);A.fetchers.set(ie,ke)}}function tt(){let X=[],ie=!1;for(let de of G){let ke=A.fetchers.get(de);Vt(ke,`Expected fetcher: ${de}`),ke.state==="loading"&&(G.delete(de),X.push(de),ie=!0)}return Ze(X),ie}function Tt(X){let ie=[];for(let[de,ke]of U)if(ke<X){let je=A.fetchers.get(de);Vt(je,`Expected fetcher: ${de}`),je.state==="loading"&&(ze(de),U.delete(de),ie.push(de))}return Ze(ie),ie.length>0}function zt(X,ie){let de=A.blockers.get(X)||Iu;return ae.get(X)!==ie&&ae.set(X,ie),de}function yt(X){A.blockers.delete(X),ae.delete(X)}function At(X,ie){let de=A.blockers.get(X)||Iu;Vt(de.state==="unblocked"&&ie.state==="blocked"||de.state==="blocked"&&ie.state==="blocked"||de.state==="blocked"&&ie.state==="proceeding"||de.state==="blocked"&&ie.state==="unblocked"||de.state==="proceeding"&&ie.state==="unblocked",`Invalid blocker state transition: ${de.state} -> ${ie.state}`);let ke=new Map(A.blockers);ke.set(X,ie),te({blockers:ke})}function it({currentLocation:X,nextLocation:ie,historyAction:de}){if(ae.size===0)return;ae.size>1&&Qn(!1,"A router only supports one blocker at a time");let ke=Array.from(ae.entries()),[je,rt]=ke[ke.length-1],nt=A.blockers.get(je);if(!(nt&&nt.state==="proceeding")&&rt({currentLocation:X,nextLocation:ie,historyAction:de}))return je}function ft(X){let ie=yi(404,{pathname:X}),de=f||c,{matches:ke,route:je}=Sh(de);return{notFoundMatches:ke,route:je,error:ie}}function bt(X,ie,de){if(w=X,T=ie,C=de||null,!E&&A.navigation===Qy){E=!0;let ke=_t(A.location,A.matches);ke!=null&&te({restoreScrollPosition:ke})}return()=>{w=null,T=null,C=null}}function Ke(X,ie){return C&&C(X,ie.map(ke=>s_(ke,A.loaderData)))||X.key}function kt(X,ie){if(w&&T){let de=Ke(X,ie);w[de]=T()}}function _t(X,ie){if(w){let de=Ke(X,ie),ke=w[de];if(typeof ke=="number")return ke}return null}function Rt(X,ie,de){if(e.patchRoutesOnNavigation)if(X){if(Object.keys(X[0].params).length>0)return{active:!0,matches:Gu(ie,de,d,!0)}}else return{active:!0,matches:Gu(ie,de,d,!0)||[]};return{active:!1,matches:null}}async function dn(X,ie,de,ke){if(!e.patchRoutesOnNavigation)return{type:"success",matches:X};let je=X;for(;;){let rt=f==null,nt=f||c,We=l;try{await e.patchRoutesOnNavigation({signal:de,path:ie,matches:je,fetcherKey:ke,patch:(Et,ht)=>{de.aborted||WC(Et,ht,nt,We,o,!1)}})}catch(Et){return{type:"error",error:Et,partialMatches:je}}finally{rt&&!de.aborted&&(c=[...c])}if(de.aborted)return{type:"aborted"};let Xe=To(nt,ie,d),ot=null;if(Xe){if(Object.keys(Xe[0].params).length===0)return{type:"success",matches:Xe};if(ot=Gu(nt,ie,d,!0),!(ot&&je.length<ot.length&&Ut(je,ot.slice(0,je.length))))return{type:"success",matches:Xe}}if(ot||(ot=Gu(nt,ie,d,!0)),!ot||Ut(je,ot))return{type:"success",matches:null};je=ot}}function Ut(X,ie){return X.length===ie.length&&X.every((de,ke)=>de.route.id===ie[ke].route.id)}function Je(X){l={},f=vd(X,o,void 0,l)}function Mt(X,ie,de=!1){let ke=f==null;WC(X,ie,f||c,l,o,de),ke&&(c=[...c],te({}))}return O={get basename(){return d},get future(){return h},get state(){return A},get routes(){return c},get window(){return t},initialize:ve,subscribe:Le,enableScrollRestoration:bt,navigate:ye,fetch:xe,revalidate:_e,createHref:X=>e.history.createHref(X),encodeLocation:X=>e.history.encodeLocation(X),getFetcher:Ae,resetFetcher:He,deleteFetcher:et,dispose:Se,getBlocker:zt,deleteBlocker:yt,patchRoutes:Mt,_internalFetchControllers:H,_internalSetRoutes:Je,_internalSetStateDoNotUseOrYouWillBreakYourApp(X){te(X)}},e.unstable_instrumentations&&(O=T_(O,e.unstable_instrumentations.map(X=>X.router).filter(Boolean))),O}function j_(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function vv(e,t,n,r,a,o){let l,c;if(a){l=[];for(let d of t)if(l.push(d),d.route.id===a){c=d;break}}else l=t,c=t[t.length-1];let f=jx(r||".",_x(l),Ci(e.pathname,n)||e.pathname,o==="path");if(r==null&&(f.search=e.search,f.hash=e.hash),(r==null||r===""||r===".")&&c){let d=Bx(f.search);if(c.route.index&&!d)f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index";else if(!c.route.index&&d){let m=new URLSearchParams(f.search),h=m.getAll("index");m.delete("index"),h.filter(g=>g).forEach(g=>m.append("index",g));let y=m.toString();f.search=y?`?${y}`:""}}return n!=="/"&&(f.pathname=v_({basename:n,pathname:f.pathname})),aa(f)}function $C(e,t,n){if(!n||!j_(n))return{path:t};if(n.formMethod&&!nj(n.formMethod))return{path:t,error:yi(405,{method:n.formMethod})};let r=()=>({path:t,error:yi(400,{type:"invalid-body"})}),o=(n.formMethod||"get").toUpperCase(),l=XM(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!yr(o))return r();let h=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((y,[g,w])=>`${y}${g}=${w}
60
+ `,""):String(n.body);return{path:t,submission:{formMethod:o,formAction:l,formEncType:n.formEncType,formData:void 0,json:void 0,text:h}}}else if(n.formEncType==="application/json"){if(!yr(o))return r();try{let h=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:o,formAction:l,formEncType:n.formEncType,formData:void 0,json:h,text:void 0}}}catch{return r()}}}Vt(typeof FormData=="function","FormData is not available in this environment");let c,f;if(n.formData)c=Sv(n.formData),f=n.formData;else if(n.body instanceof FormData)c=Sv(n.body),f=n.body;else if(n.body instanceof URLSearchParams)c=n.body,f=ZC(c);else if(n.body==null)c=new URLSearchParams,f=new FormData;else try{c=new URLSearchParams(n.body),f=ZC(c)}catch{return r()}let d={formMethod:o,formAction:l,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:f,json:void 0,text:void 0};if(yr(d.formMethod))return{path:t,submission:d};let m=Yo(t);return e&&m.search&&Bx(m.search)&&c.append("index",""),m.search=`?${c}`,{path:aa(m),submission:d}}function YC(e,t,n,r,a,o,l,c,f,d,m,h,y,g,w,C,T,E,R,k,M){var B;let D=k?ei(k[1])?k[1].error:k[1].data:void 0,O=a.createURL(o.location),A=a.createURL(f),L;if(m&&o.errors){let j=Object.keys(o.errors)[0];L=l.findIndex(z=>z.route.id===j)}else if(k&&ei(k[1])){let j=k[0];L=l.findIndex(z=>z.route.id===j)-1}let q=k?k[1].statusCode:void 0,F=q&&q>=400,W={currentUrl:O,currentParams:((B=o.matches[0])==null?void 0:B.params)||{},nextUrl:A,nextParams:l[0].params,...c,actionResult:D,actionStatus:q},_=Fd(l),V=l.map((j,z)=>{let{route:H}=j,K=null;if(L!=null&&z>L?K=!1:H.lazy?K=!0:zx(H)?m?K=xv(H,o.loaderData,o.errors):z_(o.loaderData,o.matches[z],j)&&(K=!0):K=!1,K!==null)return wv(n,r,e,_,j,d,t,K);let P=!1;typeof M=="boolean"?P=M:F?P=!1:(h||O.pathname+O.search===A.pathname+A.search||O.search!==A.search||F_(o.matches[z],j))&&(P=!0);let U={...W,defaultShouldRevalidate:P},G=ed(j,U);return wv(n,r,e,_,j,d,t,G,U,M)}),$=[];return w.forEach((j,z)=>{if(m||!l.some(le=>le.route.id===j.routeId)||g.has(z))return;let H=o.fetchers.get(z),K=H&&H.state!=="idle"&&H.data===void 0,P=To(T,j.path,E);if(!P){if(R&&K)return;$.push({key:z,routeId:j.routeId,path:j.path,matches:null,match:null,request:null,controller:null});return}if(C.has(z))return;let U=Qh(P,j.path),G=new AbortController,I=$l(a,j.path,G.signal),Q=null;if(y.has(z))y.delete(z),Q=Xl(n,r,I,P,U,d,t);else if(K)h&&(Q=Xl(n,r,I,P,U,d,t));else{let le;typeof M=="boolean"?le=M:F?le=!1:le=h;let ae={...W,defaultShouldRevalidate:le};ed(U,ae)&&(Q=Xl(n,r,I,P,U,d,t,ae))}Q&&$.push({key:z,routeId:j.routeId,path:j.path,matches:Q,match:U,request:I,controller:G})}),{dsMatches:V,revalidatingFetchers:$}}function zx(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function xv(e,t,n){if(e.lazy)return!0;if(!zx(e))return!1;let r=t!=null&&e.id in t,a=n!=null&&n[e.id]!==void 0;return!r&&a?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!a}function z_(e,t,n){let r=!t||n.route.id!==t.route.id,a=!e.hasOwnProperty(n.route.id);return r||a}function F_(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function ed(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function WC(e,t,n,r,a,o){let l;if(e){let d=r[e];Vt(d,`No route found to patch children into: routeId = ${e}`),d.children||(d.children=[]),l=d.children}else l=n;let c=[],f=[];if(t.forEach(d=>{let m=l.find(h=>$M(d,h));m?f.push({existingRoute:m,newRoute:d}):c.push(d)}),c.length>0){let d=vd(c,a,[e||"_","patch",String((l==null?void 0:l.length)||"0")],r);l.push(...d)}if(o&&f.length>0)for(let d=0;d<f.length;d++){let{existingRoute:m,newRoute:h}=f[d],y=m,[g]=vd([h],a,[],{},!0);Object.assign(y,{element:g.element?g.element:y.element,errorElement:g.errorElement?g.errorElement:y.errorElement,hydrateFallbackElement:g.hydrateFallbackElement?g.hydrateFallbackElement:y.hydrateFallbackElement})}}function $M(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>{var a;return(a=t.children)==null?void 0:a.some(o=>$M(n,o))}):!1}var KC=new WeakMap,YM=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let a=n[t.id];if(Vt(a,"No route found in manifest"),!a.lazy||typeof a.lazy!="object")return;let o=a.lazy[e];if(!o)return;let l=KC.get(a);l||(l={},KC.set(a,l));let c=l[e];if(c)return c;let f=(async()=>{let d=r_(e),h=a[e]!==void 0&&e!=="hasErrorBoundary";if(d)Qn(!d,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),l[e]=Promise.resolve();else if(h)Qn(!1,`Route "${a.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let y=await o();y!=null&&(Object.assign(a,{[e]:y}),Object.assign(a,r(a)))}typeof a.lazy=="object"&&(a.lazy[e]=void 0,Object.values(a.lazy).every(y=>y===void 0)&&(a.lazy=void 0))})();return l[e]=f,f},GC=new WeakMap;function B_(e,t,n,r,a){let o=n[e.id];if(Vt(o,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let m=GC.get(o);if(m)return{lazyRoutePromise:m,lazyHandlerPromise:m};let h=(async()=>{Vt(typeof e.lazy=="function","No lazy route function found");let y=await e.lazy(),g={};for(let w in y){let C=y[w];if(C===void 0)continue;let T=a_(w),R=o[w]!==void 0&&w!=="hasErrorBoundary";T?Qn(!T,"Route property "+w+" is not a supported property to be returned from a lazy route function. This property will be ignored."):R?Qn(!R,`Route "${o.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.`):g[w]=C}Object.assign(o,g),Object.assign(o,{...r(o),lazy:void 0})})();return GC.set(o,h),h.catch(()=>{}),{lazyRoutePromise:h,lazyHandlerPromise:h}}let l=Object.keys(e.lazy),c=[],f;for(let m of l){if(a&&a.includes(m))continue;let h=YM({key:m,route:e,manifest:n,mapRouteProperties:r});h&&(c.push(h),m===t&&(f=h))}let d=c.length>0?Promise.all(c).then(()=>{}):void 0;return d==null||d.catch(()=>{}),f==null||f.catch(()=>{}),{lazyRoutePromise:d,lazyHandlerPromise:f}}async function XC(e){let t=e.matches.filter(a=>a.shouldLoad),n={};return(await Promise.all(t.map(a=>a.resolve()))).forEach((a,o)=>{n[t[o].route.id]=a}),n}async function H_(e){return e.matches.some(t=>t.route.middleware)?WM(e,()=>XC(e)):XC(e)}function WM(e,t){return U_(e,t,r=>{if(tj(r))throw r;return r},Q_,n);function n(r,a,o){if(o)return Promise.resolve(Object.assign(o.value,{[a]:{type:"error",result:r}}));{let{matches:l}=e,c=Math.min(Math.max(l.findIndex(d=>d.route.id===a),0),Math.max(l.findIndex(d=>d.shouldCallHandler()),0)),f=Ro(l,l[c].route.id).route.id;return Promise.resolve({[f]:{type:"error",result:r}})}}}async function U_(e,t,n,r,a){let{matches:o,request:l,params:c,context:f,unstable_pattern:d}=e,m=o.flatMap(y=>y.route.middleware?y.route.middleware.map(g=>[y.route.id,g]):[]);return await KM({request:l,params:c,context:f,unstable_pattern:d},m,t,n,r,a)}async function KM(e,t,n,r,a,o,l=0){let{request:c}=e;if(c.signal.aborted)throw c.signal.reason??new Error(`Request aborted: ${c.method} ${c.url}`);let f=t[l];if(!f)return await n();let[d,m]=f,h,y=async()=>{if(h)throw new Error("You may only call `next()` once per middleware");try{return h={value:await KM(e,t,n,r,a,o,l+1)},h.value}catch(g){return h={value:await o(g,d,h)},h.value}};try{let g=await m(e,y),w=g!=null?r(g):void 0;return a(w)?w:h?w??h.value:(h={value:await y()},h.value)}catch(g){return await o(g,d,h)}}function GM(e,t,n,r,a){let o=YM({key:"middleware",route:r.route,manifest:t,mapRouteProperties:e}),l=B_(r.route,yr(n.method)?"action":"loader",t,e,a);return{middleware:o,route:l.lazyRoutePromise,handler:l.lazyHandlerPromise}}function wv(e,t,n,r,a,o,l,c,f=null,d){let m=!1,h=GM(e,t,n,a,o);return{...a,_lazyPromises:h,shouldLoad:c,shouldRevalidateArgs:f,shouldCallHandler(y){return m=!0,f?typeof d=="boolean"?ed(a,{...f,defaultShouldRevalidate:d}):typeof y=="boolean"?ed(a,{...f,defaultShouldRevalidate:y}):ed(a,f):c},resolve(y){let{lazy:g,loader:w,middleware:C}=a.route,T=m||c||y&&!yr(n.method)&&(g||w),E=C&&C.length>0&&!w&&!g;return T&&(yr(n.method)||!E)?V_({request:n,unstable_pattern:r,match:a,lazyHandlerPromise:h==null?void 0:h.handler,lazyRoutePromise:h==null?void 0:h.route,handlerOverride:y,scopedContext:l}):Promise.resolve({type:"data",result:void 0})}}}function Xl(e,t,n,r,a,o,l,c=null){return r.map(f=>f.route.id!==a.route.id?{...f,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:GM(e,t,n,f,o),resolve:()=>Promise.resolve({type:"data",result:void 0})}:wv(e,t,n,Fd(r),f,o,l,!0,c))}async function q_(e,t,n,r,a,o){n.some(d=>{var m;return(m=d._lazyPromises)==null?void 0:m.middleware})&&await Promise.all(n.map(d=>{var m;return(m=d._lazyPromises)==null?void 0:m.middleware}));let l={request:t,unstable_pattern:Fd(n),params:n[0].params,context:a,matches:n},f=await e({...l,fetcherKey:r,runClientMiddleware:d=>{let m=l;return WM(m,()=>d({...m,fetcherKey:r,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(n.flatMap(d=>{var m,h;return[(m=d._lazyPromises)==null?void 0:m.handler,(h=d._lazyPromises)==null?void 0:h.route]}))}catch{}return f}async function V_({request:e,unstable_pattern:t,match:n,lazyHandlerPromise:r,lazyRoutePromise:a,handlerOverride:o,scopedContext:l}){let c,f,d=yr(e.method),m=d?"action":"loader",h=y=>{let g,w=new Promise((E,R)=>g=R);f=()=>g(),e.signal.addEventListener("abort",f);let C=E=>typeof y!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${m}" [routeId: ${n.route.id}]`)):y({request:e,unstable_pattern:t,params:n.params,context:l},...E!==void 0?[E]:[]),T=(async()=>{try{return{type:"data",result:await(o?o(R=>C(R)):C())}}catch(E){return{type:"error",result:E}}})();return Promise.race([T,w])};try{let y=d?n.route.action:n.route.loader;if(r||a)if(y){let g,[w]=await Promise.all([h(y).catch(C=>{g=C}),r,a]);if(g!==void 0)throw g;c=w}else{await r;let g=d?n.route.action:n.route.loader;if(g)[c]=await Promise.all([h(g),a]);else if(m==="action"){let w=new URL(e.url),C=w.pathname+w.search;throw yi(405,{method:e.method,pathname:C,routeId:n.route.id})}else return{type:"data",result:void 0}}else if(y)c=await h(y);else{let g=new URL(e.url),w=g.pathname+g.search;throw yi(404,{pathname:w})}}catch(y){return{type:"error",result:y}}finally{f&&e.signal.removeEventListener("abort",f)}return c}async function $_(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 Y_(e){var r,a,o,l,c;let{result:t,type:n}=e;if(Fx(t)){let f;try{f=await $_(t)}catch(d){return{type:"error",error:d}}return n==="error"?{type:"error",error:new zd(t.status,t.statusText,f),statusCode:t.status,headers:t.headers}:{type:"data",data:f,statusCode:t.status,headers:t.headers}}return n==="error"?nT(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:(r=t.init)==null?void 0:r.status,headers:(a=t.init)!=null&&a.headers?new Headers(t.init.headers):void 0}:{type:"error",error:X_(t),statusCode:xd(t)?t.status:void 0,headers:(o=t.init)!=null&&o.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:xd(t)?t.status:void 0}:nT(t)?{type:"data",data:t.data,statusCode:(l=t.init)==null?void 0:l.status,headers:(c=t.init)!=null&&c.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function W_(e,t,n,r,a){let o=e.headers.get("Location");if(Vt(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!Lx(o)){let l=r.slice(0,r.findIndex(c=>c.route.id===n)+1);o=vv(new URL(t.url),l,a,o),e.headers.set("Location",o)}return e}function QC(e,t,n,r){let a=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(Lx(e)){let o=e,l=o.startsWith("//")?new URL(t.protocol+o):new URL(o);if(a.includes(l.protocol))throw new Error("Invalid redirect location");let c=Ci(l.pathname,n)!=null;if(l.origin===t.origin&&c)return l.pathname+l.search+l.hash}try{let o=r.createURL(e);if(a.includes(o.protocol))throw new Error("Invalid redirect location")}catch{}return e}function $l(e,t,n,r){let a=e.createURL(XM(t)).toString(),o={signal:n};if(r&&yr(r.formMethod)){let{formMethod:l,formEncType:c}=r;o.method=l.toUpperCase(),c==="application/json"?(o.headers=new Headers({"Content-Type":c}),o.body=JSON.stringify(r.json)):c==="text/plain"?o.body=r.text:c==="application/x-www-form-urlencoded"&&r.formData?o.body=Sv(r.formData):o.body=r.formData}return new Request(a,o)}function Sv(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function ZC(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function K_(e,t,n,r=!1,a=!1){let o={},l=null,c,f=!1,d={},m=n&&ei(n[1])?n[1].error:void 0;return e.forEach(h=>{if(!(h.route.id in t))return;let y=h.route.id,g=t[y];if(Vt(!Ts(g),"Cannot handle redirect results in processLoaderData"),ei(g)){let w=g.error;if(m!==void 0&&(w=m,m=void 0),l=l||{},a)l[y]=w;else{let C=Ro(e,y);l[C.route.id]==null&&(l[C.route.id]=w)}r||(o[y]=VM),f||(f=!0,c=xd(g.error)?g.error.status:500),g.headers&&(d[y]=g.headers)}else o[y]=g.data,g.statusCode&&g.statusCode!==200&&!f&&(c=g.statusCode),g.headers&&(d[y]=g.headers)}),m!==void 0&&n&&(l={[n[0]]:m},n[2]&&(o[n[2]]=void 0)),{loaderData:o,errors:l,statusCode:c||200,loaderHeaders:d}}function JC(e,t,n,r,a,o){let{loaderData:l,errors:c}=K_(t,n,r);return a.filter(f=>!f.matches||f.matches.some(d=>d.shouldLoad)).forEach(f=>{let{key:d,match:m,controller:h}=f;if(h&&h.signal.aborted)return;let y=o[d];if(Vt(y,"Did not find corresponding fetcher result"),ei(y)){let g=Ro(e.matches,m==null?void 0:m.route.id);c&&c[g.route.id]||(c={...c,[g.route.id]:y.error}),e.fetchers.delete(d)}else if(Ts(y))Vt(!1,"Unhandled fetcher revalidation redirect");else{let g=Ia(y.data);e.fetchers.set(d,g)}}),{loaderData:l,errors:c}}function eT(e,t,n,r){let a=Object.entries(t).filter(([,o])=>o!==VM).reduce((o,[l,c])=>(o[l]=c,o),{});for(let o of n){let l=o.route.id;if(!t.hasOwnProperty(l)&&e.hasOwnProperty(l)&&o.route.loader&&(a[l]=e[l]),r&&r.hasOwnProperty(l))break}return a}function tT(e){return e?ei(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Ro(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function Sh(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 yi(e,{pathname:t,routeId:n,method:r,type:a,message:o}={}){let l="Unknown Server Error",c="Unknown @remix-run/router error";return e===400?(l="Bad Request",r&&t&&n?c=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:a==="invalid-body"&&(c="Unable to encode submission body")):e===403?(l="Forbidden",c=`Route "${n}" does not match URL "${t}"`):e===404?(l="Not Found",c=`No route matches URL "${t}"`):e===405&&(l="Method Not Allowed",r&&t&&n?c=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(c=`Invalid request method "${r.toUpperCase()}"`)),new zd(e||500,l,new Error(c),!0)}function Eh(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,a]=t[n];if(Ts(a))return{key:r,result:a}}}function XM(e){let t=typeof e=="string"?Yo(e):e;return aa({...t,hash:""})}function G_(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function X_(e){var t,n;return new zd(((t=e.init)==null?void 0:t.status)??500,((n=e.init)==null?void 0:n.statusText)??"Internal Server Error",e.data)}function Q_(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&Z_(n))}function Z_(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function J_(e){return Fx(e.result)&&UM.has(e.result.status)}function ei(e){return e.type==="error"}function Ts(e){return(e&&e.type)==="redirect"}function nT(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function Fx(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function ej(e){return UM.has(e)}function tj(e){return Fx(e)&&ej(e.status)&&e.headers.has("Location")}function nj(e){return D_.has(e.toUpperCase())}function yr(e){return A_.has(e.toUpperCase())}function Bx(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Qh(e,t){let n=typeof t=="string"?Yo(t).search:t.search;if(e[e.length-1].route.index&&Bx(n||""))return e[e.length-1];let r=jM(e);return r[r.length-1]}function rT(e){let{formMethod:t,formAction:n,formEncType:r,text:a,formData:o,json:l}=e;if(!(!t||!n||!r)){if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:a};if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:o,json:void 0,text:void 0};if(l!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:l,text:void 0}}}function Zy(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 rj(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 Pu(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 ij(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 Ia(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 aj(e,t){try{let n=e.sessionStorage.getItem(qM);if(n){let r=JSON.parse(n);for(let[a,o]of Object.entries(r||{}))o&&Array.isArray(o)&&t.set(a,new Set(o||[]))}}catch{}}function oj(e,t){if(t.size>0){let n={};for(let[r,a]of t)n[r]=[...a];try{e.sessionStorage.setItem(qM,JSON.stringify(n))}catch(r){Qn(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function iT(){let e,t,n=new Promise((r,a)=>{e=async o=>{r(o);try{await n}catch{}},t=async o=>{a(o);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var tl=v.createContext(null);tl.displayName="DataRouter";var Bd=v.createContext(null);Bd.displayName="DataRouterState";var QM=v.createContext(!1);function sj(){return v.useContext(QM)}var Hx=v.createContext({isTransitioning:!1});Hx.displayName="ViewTransition";var ZM=v.createContext(new Map);ZM.displayName="Fetchers";var lj=v.createContext(null);lj.displayName="Await";var Ri=v.createContext(null);Ri.displayName="Navigation";var Xp=v.createContext(null);Xp.displayName="Location";var Ui=v.createContext({outlet:null,matches:[],isDataRoute:!1});Ui.displayName="Route";var Ux=v.createContext(null);Ux.displayName="RouteError";var JM="REACT_ROUTER_ERROR",cj="REDIRECT",uj="ROUTE_ERROR_RESPONSE";function dj(e){if(e.startsWith(`${JM}:${cj}:{`))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 fj(e){if(e.startsWith(`${JM}:${uj}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new zd(t.status,t.statusText,t.data)}catch{}}function hj(e,{relative:t}={}){Vt(Oc(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=v.useContext(Ri),{hash:a,pathname:o,search:l}=Ud(e,{relative:t}),c=o;return n!=="/"&&(c=o==="/"?n:na([n,o])),r.createHref({pathname:c,search:l,hash:a})}function Oc(){return v.useContext(Xp)!=null}function qi(){return Vt(Oc(),"useLocation() may be used only in the context of a <Router> component."),v.useContext(Xp).location}function pj(e){Vt(Oc(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:t}=qi();return v.useMemo(()=>Us(e,LM(t)),[t,e])}var e2="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function t2(e){v.useContext(Ri).static||v.useLayoutEffect(e)}function Hd(){let{isDataRoute:e}=v.useContext(Ui);return e?Aj():mj()}function mj(){Vt(Oc(),"useNavigate() may be used only in the context of a <Router> component.");let e=v.useContext(tl),{basename:t,navigator:n}=v.useContext(Ri),{matches:r}=v.useContext(Ui),{pathname:a}=qi(),o=JSON.stringify(_x(r)),l=v.useRef(!1);return t2(()=>{l.current=!0}),v.useCallback((f,d={})=>{if(Qn(l.current,e2),!l.current)return;if(typeof f=="number"){n.go(f);return}let m=jx(f,JSON.parse(o),a,d.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:na([t,m.pathname])),(d.replace?n.replace:n.push)(m,d.state,d)},[t,n,o,a,e])}var gj=v.createContext(null);function yj(e){let t=v.useContext(Ui).outlet;return v.useMemo(()=>t&&v.createElement(gj.Provider,{value:e},t),[t,e])}function bj(){let{matches:e}=v.useContext(Ui),t=e[e.length-1];return t?t.params:{}}function Ud(e,{relative:t}={}){let{matches:n}=v.useContext(Ui),{pathname:r}=qi(),a=JSON.stringify(_x(n));return v.useMemo(()=>jx(e,JSON.parse(a),r,t==="path"),[e,a,r,t])}function vj(e,t,n,r,a){Vt(Oc(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=v.useContext(Ri),{matches:l}=v.useContext(Ui),c=l[l.length-1],f=c?c.params:{},d=c?c.pathname:"/",m=c?c.pathnameBase:"/",h=c&&c.route;{let R=h&&h.path||"";r2(d,!h||R.endsWith("*")||R.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${d}" (under <Route path="${R}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
61
+
62
+ Please change the parent <Route path="${R}"> to <Route path="${R==="/"?"*":`${R}/*`}">.`)}let y=qi(),g;g=y;let w=g.pathname||"/",C=w;if(m!=="/"){let R=m.replace(/^\//,"").split("/");C="/"+w.replace(/^\//,"").split("/").slice(R.length).join("/")}let T=To(e,{pathname:C});return Qn(h||T!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),Qn(T==null||T[T.length-1].route.element!==void 0||T[T.length-1].route.Component!==void 0||T[T.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),Cj(T&&T.map(R=>Object.assign({},R,{params:Object.assign({},f,R.params),pathname:na([m,o.encodeLocation?o.encodeLocation(R.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathname]),pathnameBase:R.pathnameBase==="/"?m:na([m,o.encodeLocation?o.encodeLocation(R.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathnameBase])})),l,n,r,a)}function xj(){let e=Oj(),t=xd(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:r},o={padding:"2px 4px",backgroundColor:r},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=v.createElement(v.Fragment,null,v.createElement("p",null,"💿 Hey developer 👋"),v.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",v.createElement("code",{style:o},"ErrorBoundary")," or"," ",v.createElement("code",{style:o},"errorElement")," prop on your route.")),v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},t),n?v.createElement("pre",{style:a},n):null,l)}var wj=v.createElement(xj,null),n2=class extends v.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=fj(e.digest);n&&(e=n)}let t=e!==void 0?v.createElement(Ui.Provider,{value:this.props.routeContext},v.createElement(Ux.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?v.createElement(Sj,{error:e},t):t}};n2.contextType=QM;var Jy=new WeakMap;function Sj({children:e,error:t}){let{basename:n}=v.useContext(Ri);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=dj(t.digest);if(r){let a=Jy.get(t);if(a)throw a;let o=FM(r.location,n);if(zM&&!Jy.get(t))if(o.isExternal||r.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:r.replace}));throw Jy.set(t,l),l}return v.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function Ej({routeContext:e,match:t,children:n}){let r=v.useContext(tl);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),v.createElement(Ui.Provider,{value:e},n)}function Cj(e,t=[],n=null,r=null,a=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,l=n==null?void 0:n.errors;if(l!=null){let m=o.findIndex(h=>h.route.id&&(l==null?void 0:l[h.route.id])!==void 0);Vt(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),o=o.slice(0,Math.min(o.length,m+1))}let c=!1,f=-1;if(n)for(let m=0;m<o.length;m++){let h=o[m];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(f=m),h.route.id){let{loaderData:y,errors:g}=n,w=h.route.loader&&!y.hasOwnProperty(h.route.id)&&(!g||g[h.route.id]===void 0);if(h.route.lazy||w){c=!0,f>=0?o=o.slice(0,f+1):o=[o[0]];break}}}let d=n&&r?(m,h)=>{var y,g;r(m,{location:n.location,params:((g=(y=n.matches)==null?void 0:y[0])==null?void 0:g.params)??{},unstable_pattern:Fd(n.matches),errorInfo:h})}:void 0;return o.reduceRight((m,h,y)=>{let g,w=!1,C=null,T=null;n&&(g=l&&h.route.id?l[h.route.id]:void 0,C=h.route.errorElement||wj,c&&(f<0&&y===0?(r2("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,T=null):f===y&&(w=!0,T=h.route.hydrateFallbackElement||null)));let E=t.concat(o.slice(0,y+1)),R=()=>{let k;return g?k=C:w?k=T:h.route.Component?k=v.createElement(h.route.Component,null):h.route.element?k=h.route.element:k=m,v.createElement(Ej,{match:h,routeContext:{outlet:m,matches:E,isDataRoute:n!=null},children:k})};return n&&(h.route.ErrorBoundary||h.route.errorElement||y===0)?v.createElement(n2,{location:n.location,revalidation:n.revalidation,component:C,error:g,children:R(),routeContext:{outlet:null,matches:E,isDataRoute:!0},onError:d}):R()},null)}function qx(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Tj(e){let t=v.useContext(tl);return Vt(t,qx(e)),t}function Rj(e){let t=v.useContext(Bd);return Vt(t,qx(e)),t}function kj(e){let t=v.useContext(Ui);return Vt(t,qx(e)),t}function Vx(e){let t=kj(e),n=t.matches[t.matches.length-1];return Vt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Mj(){return Vx("useRouteId")}function Oj(){var r;let e=v.useContext(Ux),t=Rj("useRouteError"),n=Vx("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function Aj(){let{router:e}=Tj("useNavigate"),t=Vx("useNavigate"),n=v.useRef(!1);return t2(()=>{n.current=!0}),v.useCallback(async(a,o={})=>{Qn(n.current,e2),n.current&&(typeof a=="number"?await e.navigate(a):await e.navigate(a,{fromRouteId:t,...o}))},[e,t])}var aT={};function r2(e,t,n){!t&&!aT[e]&&(aT[e]=!0,Qn(!1,n))}var oT={};function sT(e,t){!e&&!oT[t]&&(oT[t]=!0,console.warn(t))}var Nj="useOptimistic",lT=Px[Nj],Dj=()=>{};function Ij(e){return lT?lT(e):[e,Dj]}function Pj(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&Qn(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:v.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&Qn(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:v.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&Qn(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:v.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var Lj=["HydrateFallback","hydrateFallbackElement"],_j=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 jj({router:e,flushSync:t,onError:n,unstable_useTransitions:r}){r=sj()||r;let[o,l]=v.useState(e.state),[c,f]=Ij(o),[d,m]=v.useState(),[h,y]=v.useState({isTransitioning:!1}),[g,w]=v.useState(),[C,T]=v.useState(),[E,R]=v.useState(),k=v.useRef(new Map),M=v.useCallback((L,{deletedFetchers:q,newErrors:F,flushSync:W,viewTransitionOpts:_})=>{F&&n&&Object.values(F).forEach($=>{var B;return n($,{location:L.location,params:((B=L.matches[0])==null?void 0:B.params)??{},unstable_pattern:Fd(L.matches)})}),L.fetchers.forEach(($,B)=>{$.data!==void 0&&k.current.set(B,$.data)}),q.forEach($=>k.current.delete($)),sT(W===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let V=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(sT(_==null||V,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!_||!V){t&&W?t(()=>l(L)):r===!1?l(L):v.startTransition(()=>{r===!0&&f($=>cT($,L)),l(L)});return}if(t&&W){t(()=>{C&&(g==null||g.resolve(),C.skipTransition()),y({isTransitioning:!0,flushSync:!0,currentLocation:_.currentLocation,nextLocation:_.nextLocation})});let $=e.window.document.startViewTransition(()=>{t(()=>l(L))});$.finished.finally(()=>{t(()=>{w(void 0),T(void 0),m(void 0),y({isTransitioning:!1})})}),t(()=>T($));return}C?(g==null||g.resolve(),C.skipTransition(),R({state:L,currentLocation:_.currentLocation,nextLocation:_.nextLocation})):(m(L),y({isTransitioning:!0,flushSync:!1,currentLocation:_.currentLocation,nextLocation:_.nextLocation}))},[e.window,t,C,g,r,f,n]);v.useLayoutEffect(()=>e.subscribe(M),[e,M]),v.useEffect(()=>{h.isTransitioning&&!h.flushSync&&w(new _j)},[h]),v.useEffect(()=>{if(g&&d&&e.window){let L=d,q=g.promise,F=e.window.document.startViewTransition(async()=>{r===!1?l(L):v.startTransition(()=>{r===!0&&f(W=>cT(W,L)),l(L)}),await q});F.finished.finally(()=>{w(void 0),T(void 0),m(void 0),y({isTransitioning:!1})}),T(F)}},[d,g,e.window,r,f]),v.useEffect(()=>{g&&d&&c.location.key===d.location.key&&g.resolve()},[g,C,c.location,d]),v.useEffect(()=>{!h.isTransitioning&&E&&(m(E.state),y({isTransitioning:!0,flushSync:!1,currentLocation:E.currentLocation,nextLocation:E.nextLocation}),R(void 0))},[h.isTransitioning,E]);let D=v.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:L=>e.navigate(L),push:(L,q,F)=>e.navigate(L,{state:q,preventScrollReset:F==null?void 0:F.preventScrollReset}),replace:(L,q,F)=>e.navigate(L,{replace:!0,state:q,preventScrollReset:F==null?void 0:F.preventScrollReset})}),[e]),O=e.basename||"/",A=v.useMemo(()=>({router:e,navigator:D,static:!1,basename:O,onError:n}),[e,D,O,n]);return v.createElement(v.Fragment,null,v.createElement(tl.Provider,{value:A},v.createElement(Bd.Provider,{value:c},v.createElement(ZM.Provider,{value:k.current},v.createElement(Hx.Provider,{value:h},v.createElement(Hj,{basename:O,location:c.location,navigationType:c.historyAction,navigator:D,unstable_useTransitions:r},v.createElement(zj,{routes:e.routes,future:e.future,state:c,onError:n})))))),null)}function cT(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 zj=v.memo(Fj);function Fj({routes:e,future:t,state:n,onError:r}){return vj(e,void 0,n,r,t)}function Bj(e){return yj(e.context)}function Hj({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:a,static:o=!1,unstable_useTransitions:l}){Vt(!Oc(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),f=v.useMemo(()=>({basename:c,navigator:a,static:o,unstable_useTransitions:l,future:{}}),[c,a,o,l]);typeof n=="string"&&(n=Yo(n));let{pathname:d="/",search:m="",hash:h="",state:y=null,key:g="default"}=n,w=v.useMemo(()=>{let C=Ci(d,c);return C==null?null:{location:{pathname:C,search:m,hash:h,state:y,key:g},navigationType:r}},[c,d,m,h,y,g,r]);return Qn(w!=null,`<Router basename="${c}"> is not able to match the URL "${d}${m}${h}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:v.createElement(Ri.Provider,{value:f},v.createElement(Xp.Provider,{children:t,value:w}))}var Zh="get",Jh="application/x-www-form-urlencoded";function Qp(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function Uj(e){return Qp(e)&&e.tagName.toLowerCase()==="button"}function qj(e){return Qp(e)&&e.tagName.toLowerCase()==="form"}function Vj(e){return Qp(e)&&e.tagName.toLowerCase()==="input"}function $j(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Yj(e,t){return e.button===0&&(!t||t==="_self")&&!$j(e)}var Ch=null;function Wj(){if(Ch===null)try{new FormData(document.createElement("form"),0),Ch=!1}catch{Ch=!0}return Ch}var Kj=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function eb(e){return e!=null&&!Kj.has(e)?(Qn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Jh}"`),null):e}function Gj(e,t){let n,r,a,o,l;if(qj(e)){let c=e.getAttribute("action");r=c?Ci(c,t):null,n=e.getAttribute("method")||Zh,a=eb(e.getAttribute("enctype"))||Jh,o=new FormData(e)}else if(Uj(e)||Vj(e)&&(e.type==="submit"||e.type==="image")){let c=e.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=e.getAttribute("formaction")||c.getAttribute("action");if(r=f?Ci(f,t):null,n=e.getAttribute("formmethod")||c.getAttribute("method")||Zh,a=eb(e.getAttribute("formenctype"))||eb(c.getAttribute("enctype"))||Jh,o=new FormData(c,e),!Wj()){let{name:d,type:m,value:h}=e;if(m==="image"){let y=d?`${d}.`:"";o.append(`${y}x`,"0"),o.append(`${y}y`,"0")}else d&&o.append(d,h)}}else{if(Qp(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Zh,r=null,a=Jh,l=e}return o&&a==="text/plain"&&(l=o,o=void 0),{action:r,method:n.toLowerCase(),encType:a,formData:o,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function $x(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Xj(e,t,n,r){let a=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?a.pathname.endsWith("/")?a.pathname=`${a.pathname}_.${r}`:a.pathname=`${a.pathname}.${r}`:a.pathname==="/"?a.pathname=`_root.${r}`:t&&Ci(a.pathname,t)==="/"?a.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:a.pathname=`${a.pathname.replace(/\/$/,"")}.${r}`,a}async function Qj(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 Zj(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 Jj(e,t,n){let r=await Promise.all(e.map(async a=>{let o=t.routes[a.route.id];if(o){let l=await Qj(o,n);return l.links?l.links():[]}return[]}));return rz(r.flat(1).filter(Zj).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function uT(e,t,n,r,a,o){let l=(f,d)=>n[d]?f.route.id!==n[d].route.id:!0,c=(f,d)=>{var m;return n[d].pathname!==f.pathname||((m=n[d].route.path)==null?void 0:m.endsWith("*"))&&n[d].params["*"]!==f.params["*"]};return o==="assets"?t.filter((f,d)=>l(f,d)||c(f,d)):o==="data"?t.filter((f,d)=>{var h;let m=r.routes[f.route.id];if(!m||!m.hasLoader)return!1;if(l(f,d)||c(f,d))return!0;if(f.route.shouldRevalidate){let y=f.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:((h=n[0])==null?void 0:h.params)||{},nextUrl:new URL(e,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function ez(e,t,{includeHydrateFallback:n}={}){return tz(e.map(r=>{let a=t.routes[r.route.id];if(!a)return[];let o=[a.module];return a.clientActionModule&&(o=o.concat(a.clientActionModule)),a.clientLoaderModule&&(o=o.concat(a.clientLoaderModule)),n&&a.hydrateFallbackModule&&(o=o.concat(a.hydrateFallbackModule)),a.imports&&(o=o.concat(a.imports)),o}).flat(1))}function tz(e){return[...new Set(e)]}function nz(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function rz(e,t){let n=new Set;return new Set(t),e.reduce((r,a)=>{let o=JSON.stringify(nz(a));return n.has(o)||(n.add(o),r.push({key:o,link:a})),r},[])}function i2(){let e=v.useContext(tl);return $x(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function iz(){let e=v.useContext(Bd);return $x(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Yx=v.createContext(void 0);Yx.displayName="FrameworkContext";function a2(){let e=v.useContext(Yx);return $x(e,"You must render this element inside a <HydratedRouter> element"),e}function az(e,t){let n=v.useContext(Yx),[r,a]=v.useState(!1),[o,l]=v.useState(!1),{onFocus:c,onBlur:f,onMouseEnter:d,onMouseLeave:m,onTouchStart:h}=t,y=v.useRef(null);v.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let C=E=>{E.forEach(R=>{l(R.isIntersecting)})},T=new IntersectionObserver(C,{threshold:.5});return y.current&&T.observe(y.current),()=>{T.disconnect()}}},[e]),v.useEffect(()=>{if(r){let C=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(C)}}},[r]);let g=()=>{a(!0)},w=()=>{a(!1),l(!1)};return n?e!=="intent"?[o,y,{}]:[o,y,{onFocus:Lu(c,g),onBlur:Lu(f,w),onMouseEnter:Lu(d,g),onMouseLeave:Lu(m,w),onTouchStart:Lu(h,g)}]:[!1,y,{}]}function Lu(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function oz({page:e,...t}){let{router:n}=i2(),r=v.useMemo(()=>To(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?v.createElement(lz,{page:e,matches:r,...t}):null}function sz(e){let{manifest:t,routeModules:n}=a2(),[r,a]=v.useState([]);return v.useEffect(()=>{let o=!1;return Jj(e,t,n).then(l=>{o||a(l)}),()=>{o=!0}},[e,t,n]),r}function lz({page:e,matches:t,...n}){let r=qi(),{future:a,manifest:o,routeModules:l}=a2(),{basename:c}=i2(),{loaderData:f,matches:d}=iz(),m=v.useMemo(()=>uT(e,t,d,o,r,"data"),[e,t,d,o,r]),h=v.useMemo(()=>uT(e,t,d,o,r,"assets"),[e,t,d,o,r]),y=v.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let C=new Set,T=!1;if(t.forEach(R=>{var M;let k=o.routes[R.route.id];!k||!k.hasLoader||(!m.some(D=>D.route.id===R.route.id)&&R.route.id in f&&((M=l[R.route.id])!=null&&M.shouldRevalidate)||k.hasClientLoader?T=!0:C.add(R.route.id))}),C.size===0)return[];let E=Xj(e,c,a.unstable_trailingSlashAwareDataRequests,"data");return T&&C.size>0&&E.searchParams.set("_routes",t.filter(R=>C.has(R.route.id)).map(R=>R.route.id).join(",")),[E.pathname+E.search]},[c,a.unstable_trailingSlashAwareDataRequests,f,r,o,m,t,e,l]),g=v.useMemo(()=>ez(h,o),[h,o]),w=sz(h);return v.createElement(v.Fragment,null,y.map(C=>v.createElement("link",{key:C,rel:"prefetch",as:"fetch",href:C,...n})),g.map(C=>v.createElement("link",{key:C,rel:"modulepreload",href:C,...n})),w.map(({key:C,link:T})=>v.createElement("link",{key:C,nonce:n.nonce,...T,crossOrigin:T.crossOrigin??n.crossOrigin})))}function cz(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var uz=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{uz&&(window.__reactRouterVersion="7.13.0")}catch{}function dz(e,t){return __({basename:t==null?void 0:t.basename,getContext:t==null?void 0:t.getContext,future:t==null?void 0:t.future,history:JL({window:t==null?void 0:t.window}),hydrationData:fz(),routes:e,mapRouteProperties:Pj,hydrationRouteProperties:Lj,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 fz(){let e=window==null?void 0:window.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:hz(e.errors)}),e}function hz(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,a]of t)if(a&&a.__type==="RouteErrorResponse")n[r]=new zd(a.status,a.statusText,a.data,a.internal===!0);else if(a&&a.__type==="Error"){if(a.__subType){let o=window[a.__subType];if(typeof o=="function")try{let l=new o(a.message);l.stack="",n[r]=l}catch{}}if(n[r]==null){let o=new Error(a.message);o.stack="",n[r]=o}}else n[r]=a;return n}var o2=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Wx=v.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:a,reloadDocument:o,replace:l,state:c,target:f,to:d,preventScrollReset:m,viewTransition:h,unstable_defaultShouldRevalidate:y,...g},w){let{basename:C,unstable_useTransitions:T}=v.useContext(Ri),E=typeof d=="string"&&o2.test(d),R=FM(d,C);d=R.to;let k=hj(d,{relative:a}),[M,D,O]=az(r,g),A=yz(d,{replace:l,state:c,target:f,preventScrollReset:m,relative:a,viewTransition:h,unstable_defaultShouldRevalidate:y,unstable_useTransitions:T});function L(F){t&&t(F),F.defaultPrevented||A(F)}let q=v.createElement("a",{...g,...O,href:R.absoluteURL||k,onClick:R.isExternal||o?t:L,ref:cz(w,D),target:f,"data-discover":!E&&n==="render"?"true":void 0});return M&&!E?v.createElement(v.Fragment,null,q,v.createElement(oz,{page:k})):q});Wx.displayName="Link";var pz=v.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:a=!1,style:o,to:l,viewTransition:c,children:f,...d},m){let h=Ud(l,{relative:d.relative}),y=qi(),g=v.useContext(Bd),{navigator:w,basename:C}=v.useContext(Ri),T=g!=null&&Sz(h)&&c===!0,E=w.encodeLocation?w.encodeLocation(h).pathname:h.pathname,R=y.pathname,k=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;n||(R=R.toLowerCase(),k=k?k.toLowerCase():null,E=E.toLowerCase()),k&&C&&(k=Ci(k,C)||k);const M=E!=="/"&&E.endsWith("/")?E.length-1:E.length;let D=R===E||!a&&R.startsWith(E)&&R.charAt(M)==="/",O=k!=null&&(k===E||!a&&k.startsWith(E)&&k.charAt(E.length)==="/"),A={isActive:D,isPending:O,isTransitioning:T},L=D?t:void 0,q;typeof r=="function"?q=r(A):q=[r,D?"active":null,O?"pending":null,T?"transitioning":null].filter(Boolean).join(" ");let F=typeof o=="function"?o(A):o;return v.createElement(Wx,{...d,"aria-current":L,className:q,ref:m,style:F,to:l,viewTransition:c},typeof f=="function"?f(A):f)});pz.displayName="NavLink";var mz=v.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:a,state:o,method:l=Zh,action:c,onSubmit:f,relative:d,preventScrollReset:m,viewTransition:h,unstable_defaultShouldRevalidate:y,...g},w)=>{let{unstable_useTransitions:C}=v.useContext(Ri),T=xz(),E=wz(c,{relative:d}),R=l.toLowerCase()==="get"?"get":"post",k=typeof c=="string"&&o2.test(c),M=D=>{if(f&&f(D),D.defaultPrevented)return;D.preventDefault();let O=D.nativeEvent.submitter,A=(O==null?void 0:O.getAttribute("formmethod"))||l,L=()=>T(O||D.currentTarget,{fetcherKey:t,method:A,navigate:n,replace:a,state:o,relative:d,preventScrollReset:m,viewTransition:h,unstable_defaultShouldRevalidate:y});C&&n!==!1?v.startTransition(()=>L()):L()};return v.createElement("form",{ref:w,method:R,action:E,onSubmit:r?f:M,...g,"data-discover":!k&&e==="render"?"true":void 0})});mz.displayName="Form";function gz(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function s2(e){let t=v.useContext(tl);return Vt(t,gz(e)),t}function yz(e,{target:t,replace:n,state:r,preventScrollReset:a,relative:o,viewTransition:l,unstable_defaultShouldRevalidate:c,unstable_useTransitions:f}={}){let d=Hd(),m=qi(),h=Ud(e,{relative:o});return v.useCallback(y=>{if(Yj(y,t)){y.preventDefault();let g=n!==void 0?n:aa(m)===aa(h),w=()=>d(e,{replace:g,state:r,preventScrollReset:a,relative:o,viewTransition:l,unstable_defaultShouldRevalidate:c});f?v.startTransition(()=>w()):w()}},[m,d,h,n,r,t,e,a,o,l,c,f])}var bz=0,vz=()=>`__${String(++bz)}__`;function xz(){let{router:e}=s2("useSubmit"),{basename:t}=v.useContext(Ri),n=Mj(),r=e.fetch,a=e.navigate;return v.useCallback(async(o,l={})=>{let{action:c,method:f,encType:d,formData:m,body:h}=Gj(o,t);if(l.navigate===!1){let y=l.fetcherKey||vz();await r(y,n,l.action||c,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:m,body:h,formMethod:l.method||f,formEncType:l.encType||d,flushSync:l.flushSync})}else await a(l.action||c,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:m,body:h,formMethod:l.method||f,formEncType:l.encType||d,replace:l.replace,state:l.state,fromRouteId:n,flushSync:l.flushSync,viewTransition:l.viewTransition})},[r,a,t,n])}function wz(e,{relative:t}={}){let{basename:n}=v.useContext(Ri),r=v.useContext(Ui);Vt(r,"useFormAction must be used inside a RouteContext");let[a]=r.matches.slice(-1),o={...Ud(e||".",{relative:t})},l=qi();if(e==null){o.search=l.search;let c=new URLSearchParams(o.search),f=c.getAll("index");if(f.some(m=>m==="")){c.delete("index"),f.filter(h=>h).forEach(h=>c.append("index",h));let m=c.toString();o.search=m?`?${m}`:""}}return(!e||e===".")&&a.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:na([n,o.pathname])),aa(o)}function Sz(e,{relative:t}={}){let n=v.useContext(Hx);Vt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=s2("useViewTransitionState"),a=Ud(e,{relative:t});if(!n.isTransitioning)return!1;let o=Ci(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=Ci(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Us(a.pathname,l)!=null||Us(a.pathname,o)!=null}var pr=AM();const Ez=Gp(pr);function Cz(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 Tz=e=>{switch(e){case"success":return Mz;case"info":return Az;case"warning":return Oz;case"error":return Nz;default:return null}},Rz=Array(12).fill(0),kz=({visible:e,className:t})=>Fe.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Fe.createElement("div",{className:"sonner-spinner"},Rz.map((n,r)=>Fe.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Mz=Fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Fe.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"})),Oz=Fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Fe.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"})),Az=Fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Fe.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"})),Nz=Fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Fe.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"})),Dz=Fe.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"},Fe.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Fe.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Iz=()=>{const[e,t]=Fe.useState(document.hidden);return Fe.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let Ev=1;class Pz{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...a}=t,o=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:Ev++,l=this.toasts.find(f=>f.id===o),c=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),l?this.toasts=this.toasts.map(f=>f.id===o?(this.publish({...f,...t,id:o,title:r}),{...f,...t,id:o,dismissible:c,title:r}):f):this.addToast({title:r,...a,dismissible:c,id:o}),o},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const a=Promise.resolve(t instanceof Function?t():t);let o=r!==void 0,l;const c=a.then(async d=>{if(l=["resolve",d],Fe.isValidElement(d))o=!1,this.create({id:r,type:"default",message:d});else if(_z(d)&&!d.ok){o=!1;const h=typeof n.error=="function"?await n.error(`HTTP error! status: ${d.status}`):n.error,y=typeof n.description=="function"?await n.description(`HTTP error! status: ${d.status}`):n.description,w=typeof h=="object"&&!Fe.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:y,...w})}else if(d instanceof Error){o=!1;const h=typeof n.error=="function"?await n.error(d):n.error,y=typeof n.description=="function"?await n.description(d):n.description,w=typeof h=="object"&&!Fe.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:y,...w})}else if(n.success!==void 0){o=!1;const h=typeof n.success=="function"?await n.success(d):n.success,y=typeof n.description=="function"?await n.description(d):n.description,w=typeof h=="object"&&!Fe.isValidElement(h)?h:{message:h};this.create({id:r,type:"success",description:y,...w})}}).catch(async d=>{if(l=["reject",d],n.error!==void 0){o=!1;const m=typeof n.error=="function"?await n.error(d):n.error,h=typeof n.description=="function"?await n.description(d):n.description,g=typeof m=="object"&&!Fe.isValidElement(m)?m:{message:m};this.create({id:r,type:"error",description:h,...g})}}).finally(()=>{o&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),f=()=>new Promise((d,m)=>c.then(()=>l[0]==="reject"?m(l[1]):d(l[1])).catch(m));return typeof r!="string"&&typeof r!="number"?{unwrap:f}:Object.assign(r,{unwrap:f})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||Ev++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Fr=new Pz,Lz=(e,t)=>{const n=(t==null?void 0:t.id)||Ev++;return Fr.addToast({title:e,...t,id:n}),n},_z=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",jz=Lz,zz=()=>Fr.toasts,Fz=()=>Fr.getActiveToasts(),sn=Object.assign(jz,{success:Fr.success,info:Fr.info,warning:Fr.warning,error:Fr.error,custom:Fr.custom,message:Fr.message,promise:Fr.promise,dismiss:Fr.dismiss,loading:Fr.loading},{getHistory:zz,getToasts:Fz});Cz("[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 Th(e){return e.label!==void 0}const Bz=3,Hz="24px",Uz="16px",dT=4e3,qz=356,Vz=14,$z=45,Yz=200;function Gi(...e){return e.filter(Boolean).join(" ")}function Wz(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const Kz=e=>{var t,n,r,a,o,l,c,f,d;const{invert:m,toast:h,unstyled:y,interacting:g,setHeights:w,visibleToasts:C,heights:T,index:E,toasts:R,expanded:k,removeToast:M,defaultRichColors:D,closeButton:O,style:A,cancelButtonStyle:L,actionButtonStyle:q,className:F="",descriptionClassName:W="",duration:_,position:V,gap:$,expandByDefault:B,classNames:j,icons:z,closeButtonAriaLabel:H="Close toast"}=e,[K,P]=Fe.useState(null),[U,G]=Fe.useState(null),[I,Q]=Fe.useState(!1),[le,ae]=Fe.useState(!1),[Z,ue]=Fe.useState(!1),[ve,Se]=Fe.useState(!1),[Le,te]=Fe.useState(!1),[he,ye]=Fe.useState(0),[_e,Oe]=Fe.useState(0),Ce=Fe.useRef(h.duration||_||dT),Re=Fe.useRef(null),J=Fe.useRef(null),Ee=E===0,xe=E+1<=C,Be=h.type,Ve=h.dismissible!==!1,De=h.className||"",ut=h.descriptionClassName||"",pe=Fe.useMemo(()=>T.findIndex(Ke=>Ke.toastId===h.id)||0,[T,h.id]),Te=Fe.useMemo(()=>{var Ke;return(Ke=h.closeButton)!=null?Ke:O},[h.closeButton,O]),ee=Fe.useMemo(()=>h.duration||_||dT,[h.duration,_]),fe=Fe.useRef(0),Ae=Fe.useRef(0),He=Fe.useRef(0),$e=Fe.useRef(null),[et,ze]=V.split("-"),Ze=Fe.useMemo(()=>T.reduce((Ke,kt,_t)=>_t>=pe?Ke:Ke+kt.height,0),[T,pe]),tt=Iz(),Tt=h.invert||m,zt=Be==="loading";Ae.current=Fe.useMemo(()=>pe*$+Ze,[pe,Ze]),Fe.useEffect(()=>{Ce.current=ee},[ee]),Fe.useEffect(()=>{Q(!0)},[]),Fe.useEffect(()=>{const Ke=J.current;if(Ke){const kt=Ke.getBoundingClientRect().height;return Oe(kt),w(_t=>[{toastId:h.id,height:kt,position:h.position},..._t]),()=>w(_t=>_t.filter(Rt=>Rt.toastId!==h.id))}},[w,h.id]),Fe.useLayoutEffect(()=>{if(!I)return;const Ke=J.current,kt=Ke.style.height;Ke.style.height="auto";const _t=Ke.getBoundingClientRect().height;Ke.style.height=kt,Oe(_t),w(Rt=>Rt.find(Ut=>Ut.toastId===h.id)?Rt.map(Ut=>Ut.toastId===h.id?{...Ut,height:_t}:Ut):[{toastId:h.id,height:_t,position:h.position},...Rt])},[I,h.title,h.description,w,h.id,h.jsx,h.action,h.cancel]);const yt=Fe.useCallback(()=>{ae(!0),ye(Ae.current),w(Ke=>Ke.filter(kt=>kt.toastId!==h.id)),setTimeout(()=>{M(h)},Yz)},[h,M,w,Ae]);Fe.useEffect(()=>{if(h.promise&&Be==="loading"||h.duration===1/0||h.type==="loading")return;let Ke;return k||g||tt?(()=>{if(He.current<fe.current){const Rt=new Date().getTime()-fe.current;Ce.current=Ce.current-Rt}He.current=new Date().getTime()})():(()=>{Ce.current!==1/0&&(fe.current=new Date().getTime(),Ke=setTimeout(()=>{h.onAutoClose==null||h.onAutoClose.call(h,h),yt()},Ce.current))})(),()=>clearTimeout(Ke)},[k,g,h,Be,tt,yt]),Fe.useEffect(()=>{h.delete&&(yt(),h.onDismiss==null||h.onDismiss.call(h,h))},[yt,h.delete]);function At(){var Ke;if(z!=null&&z.loading){var kt;return Fe.createElement("div",{className:Gi(j==null?void 0:j.loader,h==null||(kt=h.classNames)==null?void 0:kt.loader,"sonner-loader"),"data-visible":Be==="loading"},z.loading)}return Fe.createElement(kz,{className:Gi(j==null?void 0:j.loader,h==null||(Ke=h.classNames)==null?void 0:Ke.loader),visible:Be==="loading"})}const it=h.icon||(z==null?void 0:z[Be])||Tz(Be);var ft,bt;return Fe.createElement("li",{tabIndex:0,ref:J,className:Gi(F,De,j==null?void 0:j.toast,h==null||(t=h.classNames)==null?void 0:t.toast,j==null?void 0:j.default,j==null?void 0:j[Be],h==null||(n=h.classNames)==null?void 0:n[Be]),"data-sonner-toast":"","data-rich-colors":(ft=h.richColors)!=null?ft:D,"data-styled":!(h.jsx||h.unstyled||y),"data-mounted":I,"data-promise":!!h.promise,"data-swiped":Le,"data-removed":le,"data-visible":xe,"data-y-position":et,"data-x-position":ze,"data-index":E,"data-front":Ee,"data-swiping":Z,"data-dismissible":Ve,"data-type":Be,"data-invert":Tt,"data-swipe-out":ve,"data-swipe-direction":U,"data-expanded":!!(k||B&&I),"data-testid":h.testId,style:{"--index":E,"--toasts-before":E,"--z-index":R.length-E,"--offset":`${le?he:Ae.current}px`,"--initial-height":B?"auto":`${_e}px`,...A,...h.style},onDragEnd:()=>{ue(!1),P(null),$e.current=null},onPointerDown:Ke=>{Ke.button!==2&&(zt||!Ve||(Re.current=new Date,ye(Ae.current),Ke.target.setPointerCapture(Ke.pointerId),Ke.target.tagName!=="BUTTON"&&(ue(!0),$e.current={x:Ke.clientX,y:Ke.clientY})))},onPointerUp:()=>{var Ke,kt,_t;if(ve||!Ve)return;$e.current=null;const Rt=Number(((Ke=J.current)==null?void 0:Ke.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),dn=Number(((kt=J.current)==null?void 0:kt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ut=new Date().getTime()-((_t=Re.current)==null?void 0:_t.getTime()),Je=K==="x"?Rt:dn,Mt=Math.abs(Je)/Ut;if(Math.abs(Je)>=$z||Mt>.11){ye(Ae.current),h.onDismiss==null||h.onDismiss.call(h,h),G(K==="x"?Rt>0?"right":"left":dn>0?"down":"up"),yt(),Se(!0);return}else{var X,ie;(X=J.current)==null||X.style.setProperty("--swipe-amount-x","0px"),(ie=J.current)==null||ie.style.setProperty("--swipe-amount-y","0px")}te(!1),ue(!1),P(null)},onPointerMove:Ke=>{var kt,_t,Rt;if(!$e.current||!Ve||((kt=window.getSelection())==null?void 0:kt.toString().length)>0)return;const Ut=Ke.clientY-$e.current.y,Je=Ke.clientX-$e.current.x;var Mt;const X=(Mt=e.swipeDirections)!=null?Mt:Wz(V);!K&&(Math.abs(Je)>1||Math.abs(Ut)>1)&&P(Math.abs(Je)>Math.abs(Ut)?"x":"y");let ie={x:0,y:0};const de=ke=>1/(1.5+Math.abs(ke)/20);if(K==="y"){if(X.includes("top")||X.includes("bottom"))if(X.includes("top")&&Ut<0||X.includes("bottom")&&Ut>0)ie.y=Ut;else{const ke=Ut*de(Ut);ie.y=Math.abs(ke)<Math.abs(Ut)?ke:Ut}}else if(K==="x"&&(X.includes("left")||X.includes("right")))if(X.includes("left")&&Je<0||X.includes("right")&&Je>0)ie.x=Je;else{const ke=Je*de(Je);ie.x=Math.abs(ke)<Math.abs(Je)?ke:Je}(Math.abs(ie.x)>0||Math.abs(ie.y)>0)&&te(!0),(_t=J.current)==null||_t.style.setProperty("--swipe-amount-x",`${ie.x}px`),(Rt=J.current)==null||Rt.style.setProperty("--swipe-amount-y",`${ie.y}px`)}},Te&&!h.jsx&&Be!=="loading"?Fe.createElement("button",{"aria-label":H,"data-disabled":zt,"data-close-button":!0,onClick:zt||!Ve?()=>{}:()=>{yt(),h.onDismiss==null||h.onDismiss.call(h,h)},className:Gi(j==null?void 0:j.closeButton,h==null||(r=h.classNames)==null?void 0:r.closeButton)},(bt=z==null?void 0:z.close)!=null?bt:Dz):null,(Be||h.icon||h.promise)&&h.icon!==null&&((z==null?void 0:z[Be])!==null||h.icon)?Fe.createElement("div",{"data-icon":"",className:Gi(j==null?void 0:j.icon,h==null||(a=h.classNames)==null?void 0:a.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||At():null,h.type!=="loading"?it:null):null,Fe.createElement("div",{"data-content":"",className:Gi(j==null?void 0:j.content,h==null||(o=h.classNames)==null?void 0:o.content)},Fe.createElement("div",{"data-title":"",className:Gi(j==null?void 0:j.title,h==null||(l=h.classNames)==null?void 0:l.title)},h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title),h.description?Fe.createElement("div",{"data-description":"",className:Gi(W,ut,j==null?void 0:j.description,h==null||(c=h.classNames)==null?void 0:c.description)},typeof h.description=="function"?h.description():h.description):null),Fe.isValidElement(h.cancel)?h.cancel:h.cancel&&Th(h.cancel)?Fe.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||L,onClick:Ke=>{Th(h.cancel)&&Ve&&(h.cancel.onClick==null||h.cancel.onClick.call(h.cancel,Ke),yt())},className:Gi(j==null?void 0:j.cancelButton,h==null||(f=h.classNames)==null?void 0:f.cancelButton)},h.cancel.label):null,Fe.isValidElement(h.action)?h.action:h.action&&Th(h.action)?Fe.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||q,onClick:Ke=>{Th(h.action)&&(h.action.onClick==null||h.action.onClick.call(h.action,Ke),!Ke.defaultPrevented&&yt())},className:Gi(j==null?void 0:j.actionButton,h==null||(d=h.classNames)==null?void 0:d.actionButton)},h.action.label):null)};function fT(){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 Gz(e,t){const n={};return[e,t].forEach((r,a)=>{const o=a===1,l=o?"--mobile-offset":"--offset",c=o?Uz:Hz;function f(d){["top","right","bottom","left"].forEach(m=>{n[`${l}-${m}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?f(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${l}-${d}`]=c:n[`${l}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):f(c)}),n}const Xz=Fe.forwardRef(function(t,n){const{id:r,invert:a,position:o="bottom-right",hotkey:l=["altKey","KeyT"],expand:c,closeButton:f,className:d,offset:m,mobileOffset:h,theme:y="light",richColors:g,duration:w,style:C,visibleToasts:T=Bz,toastOptions:E,dir:R=fT(),gap:k=Vz,icons:M,containerAriaLabel:D="Notifications"}=t,[O,A]=Fe.useState([]),L=Fe.useMemo(()=>r?O.filter(I=>I.toasterId===r):O.filter(I=>!I.toasterId),[O,r]),q=Fe.useMemo(()=>Array.from(new Set([o].concat(L.filter(I=>I.position).map(I=>I.position)))),[L,o]),[F,W]=Fe.useState([]),[_,V]=Fe.useState(!1),[$,B]=Fe.useState(!1),[j,z]=Fe.useState(y!=="system"?y:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),H=Fe.useRef(null),K=l.join("+").replace(/Key/g,"").replace(/Digit/g,""),P=Fe.useRef(null),U=Fe.useRef(!1),G=Fe.useCallback(I=>{A(Q=>{var le;return(le=Q.find(ae=>ae.id===I.id))!=null&&le.delete||Fr.dismiss(I.id),Q.filter(({id:ae})=>ae!==I.id)})},[]);return Fe.useEffect(()=>Fr.subscribe(I=>{if(I.dismiss){requestAnimationFrame(()=>{A(Q=>Q.map(le=>le.id===I.id?{...le,delete:!0}:le))});return}setTimeout(()=>{Ez.flushSync(()=>{A(Q=>{const le=Q.findIndex(ae=>ae.id===I.id);return le!==-1?[...Q.slice(0,le),{...Q[le],...I},...Q.slice(le+1)]:[I,...Q]})})})}),[O]),Fe.useEffect(()=>{if(y!=="system"){z(y);return}if(y==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?z("dark"):z("light")),typeof window>"u")return;const I=window.matchMedia("(prefers-color-scheme: dark)");try{I.addEventListener("change",({matches:Q})=>{z(Q?"dark":"light")})}catch{I.addListener(({matches:le})=>{try{z(le?"dark":"light")}catch(ae){console.error(ae)}})}},[y]),Fe.useEffect(()=>{O.length<=1&&V(!1)},[O]),Fe.useEffect(()=>{const I=Q=>{var le;if(l.every(ue=>Q[ue]||Q.code===ue)){var Z;V(!0),(Z=H.current)==null||Z.focus()}Q.code==="Escape"&&(document.activeElement===H.current||(le=H.current)!=null&&le.contains(document.activeElement))&&V(!1)};return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[l]),Fe.useEffect(()=>{if(H.current)return()=>{P.current&&(P.current.focus({preventScroll:!0}),P.current=null,U.current=!1)}},[H.current]),Fe.createElement("section",{ref:n,"aria-label":`${D} ${K}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},q.map((I,Q)=>{var le;const[ae,Z]=I.split("-");return L.length?Fe.createElement("ol",{key:I,dir:R==="auto"?fT():R,tabIndex:-1,ref:H,className:d,"data-sonner-toaster":!0,"data-sonner-theme":j,"data-y-position":ae,"data-x-position":Z,style:{"--front-toast-height":`${((le=F[0])==null?void 0:le.height)||0}px`,"--width":`${qz}px`,"--gap":`${k}px`,...C,...Gz(m,h)},onBlur:ue=>{U.current&&!ue.currentTarget.contains(ue.relatedTarget)&&(U.current=!1,P.current&&(P.current.focus({preventScroll:!0}),P.current=null))},onFocus:ue=>{ue.target instanceof HTMLElement&&ue.target.dataset.dismissible==="false"||U.current||(U.current=!0,P.current=ue.relatedTarget)},onMouseEnter:()=>V(!0),onMouseMove:()=>V(!0),onMouseLeave:()=>{$||V(!1)},onDragEnd:()=>V(!1),onPointerDown:ue=>{ue.target instanceof HTMLElement&&ue.target.dataset.dismissible==="false"||B(!0)},onPointerUp:()=>B(!1)},L.filter(ue=>!ue.position&&Q===0||ue.position===I).map((ue,ve)=>{var Se,Le;return Fe.createElement(Kz,{key:ue.id,icons:M,index:ve,toast:ue,defaultRichColors:g,duration:(Se=E==null?void 0:E.duration)!=null?Se:w,className:E==null?void 0:E.className,descriptionClassName:E==null?void 0:E.descriptionClassName,invert:a,visibleToasts:T,closeButton:(Le=E==null?void 0:E.closeButton)!=null?Le:f,interacting:$,position:I,style:E==null?void 0:E.style,unstyled:E==null?void 0:E.unstyled,classNames:E==null?void 0:E.classNames,cancelButtonStyle:E==null?void 0:E.cancelButtonStyle,actionButtonStyle:E==null?void 0:E.actionButtonStyle,closeButtonAriaLabel:E==null?void 0:E.closeButtonAriaLabel,removeToast:G,toasts:L.filter(te=>te.position==ue.position),heights:F.filter(te=>te.position==ue.position),setHeights:W,expandByDefault:c,gap:k,expanded:_,swipeDirections:t.swipeDirections})})):null}))}),Ot=e=>typeof e=="string",_u=()=>{let e,t;const n=new Promise((r,a)=>{e=r,t=a});return n.resolve=e,n.reject=t,n},hT=e=>e==null?"":""+e,Qz=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},Zz=/###/g,pT=e=>e&&e.indexOf("###")>-1?e.replace(Zz,"."):e,mT=e=>!e||Ot(e),td=(e,t,n)=>{const r=Ot(t)?t.split("."):t;let a=0;for(;a<r.length-1;){if(mT(e))return{};const o=pT(r[a]);!e[o]&&n&&(e[o]=new n),Object.prototype.hasOwnProperty.call(e,o)?e=e[o]:e={},++a}return mT(e)?{}:{obj:e,k:pT(r[a])}},gT=(e,t,n)=>{const{obj:r,k:a}=td(e,t,Object);if(r!==void 0||t.length===1){r[a]=n;return}let o=t[t.length-1],l=t.slice(0,t.length-1),c=td(e,l,Object);for(;c.obj===void 0&&l.length;)o=`${l[l.length-1]}.${o}`,l=l.slice(0,l.length-1),c=td(e,l,Object),c!=null&&c.obj&&typeof c.obj[`${c.k}.${o}`]<"u"&&(c.obj=void 0);c.obj[`${c.k}.${o}`]=n},Jz=(e,t,n,r)=>{const{obj:a,k:o}=td(e,t,Object);a[o]=a[o]||[],a[o].push(n)},bp=(e,t)=>{const{obj:n,k:r}=td(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},e4=(e,t,n)=>{const r=bp(e,n);return r!==void 0?r:bp(t,n)},l2=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?Ot(e[r])||e[r]instanceof String||Ot(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):l2(e[r],t[r],n):e[r]=t[r]);return e},zl=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var t4={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const n4=e=>Ot(e)?e.replace(/[&<>"'\/]/g,t=>t4[t]):e;class r4{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const i4=[" ",",","?","!",";"],a4=new r4(20),o4=(e,t,n)=>{t=t||"",n=n||"";const r=i4.filter(l=>t.indexOf(l)<0&&n.indexOf(l)<0);if(r.length===0)return!0;const a=a4.getRegExp(`(${r.map(l=>l==="?"?"\\?":l).join("|")})`);let o=!a.test(e);if(!o){const l=e.indexOf(n);l>0&&!a.test(e.substring(0,l))&&(o=!0)}return o},Cv=(e,t,n=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const r=t.split(n);let a=e;for(let o=0;o<r.length;){if(!a||typeof a!="object")return;let l,c="";for(let f=o;f<r.length;++f)if(f!==o&&(c+=n),c+=r[f],l=a[c],l!==void 0){if(["string","number","boolean"].indexOf(typeof l)>-1&&f<r.length-1)continue;o+=f-o+1;break}a=l}return a},wd=e=>e==null?void 0:e.replace("_","-"),s4={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){var n,r;(r=(n=console==null?void 0:console[e])==null?void 0:n.apply)==null||r.call(n,console,t)}};class vp{constructor(t,n={}){this.init(t,n)}init(t,n={}){this.prefix=n.prefix||"i18next:",this.logger=t||s4,this.options=n,this.debug=n.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,a){return a&&!this.debug?null:(Ot(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new vp(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new vp(this.logger,t)}}var ta=new vp;class Zp{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const a=this.observers[r].get(n)||0;this.observers[r].set(n,a+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t,...n){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([a,o])=>{for(let l=0;l<o;l++)a(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([a,o])=>{for(let l=0;l<o;l++)a.apply(a,[t,...n])})}}class yT extends Zp{constructor(t,n={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r,a={}){var d,m;const o=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,l=a.ignoreJSONStructure!==void 0?a.ignoreJSONStructure:this.options.ignoreJSONStructure;let c;t.indexOf(".")>-1?c=t.split("."):(c=[t,n],r&&(Array.isArray(r)?c.push(...r):Ot(r)&&o?c.push(...r.split(o)):c.push(r)));const f=bp(this.data,c);return!f&&!n&&!r&&t.indexOf(".")>-1&&(t=c[0],n=c[1],r=c.slice(2).join(".")),f||!l||!Ot(r)?f:Cv((m=(d=this.data)==null?void 0:d[t])==null?void 0:m[n],r,o)}addResource(t,n,r,a,o={silent:!1}){const l=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let c=[t,n];r&&(c=c.concat(l?r.split(l):r)),t.indexOf(".")>-1&&(c=t.split("."),a=n,n=c[1]),this.addNamespaces(n),gT(this.data,c,a),o.silent||this.emit("added",t,n,r,a)}addResources(t,n,r,a={silent:!1}){for(const o in r)(Ot(r[o])||Array.isArray(r[o]))&&this.addResource(t,n,o,r[o],{silent:!0});a.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,a,o,l={silent:!1,skipCopy:!1}){let c=[t,n];t.indexOf(".")>-1&&(c=t.split("."),a=r,r=n,n=c[1]),this.addNamespaces(n);let f=bp(this.data,c)||{};l.skipCopy||(r=JSON.parse(JSON.stringify(r))),a?l2(f,r,o):f={...f,...r},gT(this.data,c,f),l.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(a=>n[a]&&Object.keys(n[a]).length>0)}toJSON(){return this.data}}var c2={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,a){return e.forEach(o=>{var l;t=((l=this.processors[o])==null?void 0:l.process(t,n,r,a))??t}),t}};const u2=Symbol("i18next/PATH_KEY");function l4(){const e=[],t=Object.create(null);let n;return t.get=(r,a)=>{var o;return(o=n==null?void 0:n.revoke)==null||o.call(n),a===u2?e:(e.push(a),n=Proxy.revocable(r,t),n.proxy)},Proxy.revocable(Object.create(null),t).proxy}function Tv(e,t){const{[u2]:n}=e(l4());return n.join((t==null?void 0:t.keySeparator)??".")}const bT={},tb=e=>!Ot(e)&&typeof e!="boolean"&&typeof e!="number";class xp extends Zp{constructor(t,n={}){super(),Qz(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=ta.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,n={interpolation:{}}){const r={...n};if(t==null)return!1;const a=this.resolve(t,r);if((a==null?void 0:a.res)===void 0)return!1;const o=tb(a.res);return!(r.returnObjects===!1&&o)}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const a=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let o=n.ns||this.options.defaultNS||[];const l=r&&t.indexOf(r)>-1,c=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!o4(t,r,a);if(l&&!c){const f=t.match(this.interpolator.nestingRegexp);if(f&&f.length>0)return{key:t,namespaces:Ot(o)?[o]:o};const d=t.split(r);(r!==a||r===a&&this.options.ns.indexOf(d[0])>-1)&&(o=d.shift()),t=d.join(a)}return{key:t,namespaces:Ot(o)?[o]:o}}translate(t,n,r){let a=typeof n=="object"?{...n}:n;if(typeof a!="object"&&this.options.overloadTranslationOptionHandler&&(a=this.options.overloadTranslationOptionHandler(arguments)),typeof a=="object"&&(a={...a}),a||(a={}),t==null)return"";typeof t=="function"&&(t=Tv(t,{...this.options,...a})),Array.isArray(t)||(t=[String(t)]);const o=a.returnDetails!==void 0?a.returnDetails:this.options.returnDetails,l=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,{key:c,namespaces:f}=this.extractFromKey(t[t.length-1],a),d=f[f.length-1];let m=a.nsSeparator!==void 0?a.nsSeparator:this.options.nsSeparator;m===void 0&&(m=":");const h=a.lng||this.language,y=a.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((h==null?void 0:h.toLowerCase())==="cimode")return y?o?{res:`${d}${m}${c}`,usedKey:c,exactUsedKey:c,usedLng:h,usedNS:d,usedParams:this.getUsedParamsDetails(a)}:`${d}${m}${c}`:o?{res:c,usedKey:c,exactUsedKey:c,usedLng:h,usedNS:d,usedParams:this.getUsedParamsDetails(a)}:c;const g=this.resolve(t,a);let w=g==null?void 0:g.res;const C=(g==null?void 0:g.usedKey)||c,T=(g==null?void 0:g.exactUsedKey)||c,E=["[object Number]","[object Function]","[object RegExp]"],R=a.joinArrays!==void 0?a.joinArrays:this.options.joinArrays,k=!this.i18nFormat||this.i18nFormat.handleAsObject,M=a.count!==void 0&&!Ot(a.count),D=xp.hasDefaultValue(a),O=M?this.pluralResolver.getSuffix(h,a.count,a):"",A=a.ordinal&&M?this.pluralResolver.getSuffix(h,a.count,{ordinal:!1}):"",L=M&&!a.ordinal&&a.count===0,q=L&&a[`defaultValue${this.options.pluralSeparator}zero`]||a[`defaultValue${O}`]||a[`defaultValue${A}`]||a.defaultValue;let F=w;k&&!w&&D&&(F=q);const W=tb(F),_=Object.prototype.toString.apply(F);if(k&&F&&W&&E.indexOf(_)<0&&!(Ot(R)&&Array.isArray(F))){if(!a.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const V=this.options.returnedObjectHandler?this.options.returnedObjectHandler(C,F,{...a,ns:f}):`key '${c} (${this.language})' returned an object instead of string.`;return o?(g.res=V,g.usedParams=this.getUsedParamsDetails(a),g):V}if(l){const V=Array.isArray(F),$=V?[]:{},B=V?T:C;for(const j in F)if(Object.prototype.hasOwnProperty.call(F,j)){const z=`${B}${l}${j}`;D&&!w?$[j]=this.translate(z,{...a,defaultValue:tb(q)?q[j]:void 0,joinArrays:!1,ns:f}):$[j]=this.translate(z,{...a,joinArrays:!1,ns:f}),$[j]===z&&($[j]=F[j])}w=$}}else if(k&&Ot(R)&&Array.isArray(w))w=w.join(R),w&&(w=this.extendTranslation(w,t,a,r));else{let V=!1,$=!1;!this.isValidLookup(w)&&D&&(V=!0,w=q),this.isValidLookup(w)||($=!0,w=c);const j=(a.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&$?void 0:w,z=D&&q!==w&&this.options.updateMissing;if($||V||z){if(this.logger.log(z?"updateKey":"missingKey",h,d,c,z?q:w),l){const U=this.resolve(c,{...a,keySeparator:!1});U&&U.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let H=[];const K=this.languageUtils.getFallbackCodes(this.options.fallbackLng,a.lng||this.language);if(this.options.saveMissingTo==="fallback"&&K&&K[0])for(let U=0;U<K.length;U++)H.push(K[U]);else this.options.saveMissingTo==="all"?H=this.languageUtils.toResolveHierarchy(a.lng||this.language):H.push(a.lng||this.language);const P=(U,G,I)=>{var le;const Q=D&&I!==w?I:j;this.options.missingKeyHandler?this.options.missingKeyHandler(U,d,G,Q,z,a):(le=this.backendConnector)!=null&&le.saveMissing&&this.backendConnector.saveMissing(U,d,G,Q,z,a),this.emit("missingKey",U,d,G,w)};this.options.saveMissing&&(this.options.saveMissingPlurals&&M?H.forEach(U=>{const G=this.pluralResolver.getSuffixes(U,a);L&&a[`defaultValue${this.options.pluralSeparator}zero`]&&G.indexOf(`${this.options.pluralSeparator}zero`)<0&&G.push(`${this.options.pluralSeparator}zero`),G.forEach(I=>{P([U],c+I,a[`defaultValue${I}`]||q)})}):P(H,c,q))}w=this.extendTranslation(w,t,a,g,r),$&&w===c&&this.options.appendNamespaceToMissingKey&&(w=`${d}${m}${c}`),($||V)&&this.options.parseMissingKeyHandler&&(w=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${d}${m}${c}`:c,V?w:void 0,a))}return o?(g.res=w,g.usedParams=this.getUsedParamsDetails(a),g):w}extendTranslation(t,n,r,a,o){var f,d;if((f=this.i18nFormat)!=null&&f.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||a.usedLng,a.usedNS,a.usedKey,{resolved:a});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const m=Ot(t)&&(((d=r==null?void 0:r.interpolation)==null?void 0:d.skipOnVariables)!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let h;if(m){const g=t.match(this.interpolator.nestingRegexp);h=g&&g.length}let y=r.replace&&!Ot(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(y={...this.options.interpolation.defaultVariables,...y}),t=this.interpolator.interpolate(t,y,r.lng||this.language||a.usedLng,r),m){const g=t.match(this.interpolator.nestingRegexp),w=g&&g.length;h<w&&(r.nest=!1)}!r.lng&&a&&a.res&&(r.lng=this.language||a.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,(...g)=>(o==null?void 0:o[0])===g[0]&&!r.context?(this.logger.warn(`It seems you are nesting recursively key: ${g[0]} in key: ${n[0]}`),null):this.translate(...g,n),r)),r.interpolation&&this.interpolator.reset()}const l=r.postProcess||this.options.postProcess,c=Ot(l)?[l]:l;return t!=null&&(c!=null&&c.length)&&r.applyPostProcessor!==!1&&(t=c2.handle(c,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...a,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t,n={}){let r,a,o,l,c;return Ot(t)&&(t=[t]),t.forEach(f=>{if(this.isValidLookup(r))return;const d=this.extractFromKey(f,n),m=d.key;a=m;let h=d.namespaces;this.options.fallbackNS&&(h=h.concat(this.options.fallbackNS));const y=n.count!==void 0&&!Ot(n.count),g=y&&!n.ordinal&&n.count===0,w=n.context!==void 0&&(Ot(n.context)||typeof n.context=="number")&&n.context!=="",C=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);h.forEach(T=>{var E,R;this.isValidLookup(r)||(c=T,!bT[`${C[0]}-${T}`]&&((E=this.utils)!=null&&E.hasLoadedNamespace)&&!((R=this.utils)!=null&&R.hasLoadedNamespace(c))&&(bT[`${C[0]}-${T}`]=!0,this.logger.warn(`key "${a}" for languages "${C.join(", ")}" won't get resolved as namespace "${c}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),C.forEach(k=>{var O;if(this.isValidLookup(r))return;l=k;const M=[m];if((O=this.i18nFormat)!=null&&O.addLookupKeys)this.i18nFormat.addLookupKeys(M,m,k,T,n);else{let A;y&&(A=this.pluralResolver.getSuffix(k,n.count,n));const L=`${this.options.pluralSeparator}zero`,q=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(y&&(n.ordinal&&A.indexOf(q)===0&&M.push(m+A.replace(q,this.options.pluralSeparator)),M.push(m+A),g&&M.push(m+L)),w){const F=`${m}${this.options.contextSeparator||"_"}${n.context}`;M.push(F),y&&(n.ordinal&&A.indexOf(q)===0&&M.push(F+A.replace(q,this.options.pluralSeparator)),M.push(F+A),g&&M.push(F+L))}}let D;for(;D=M.pop();)this.isValidLookup(r)||(o=D,r=this.getResource(k,T,D,n))}))})}),{res:r,usedKey:a,exactUsedKey:o,usedLng:l,usedNS:c}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r,a={}){var o;return(o=this.i18nFormat)!=null&&o.getResource?this.i18nFormat.getResource(t,n,r,a):this.resourceStore.getResource(t,n,r,a)}getUsedParamsDetails(t={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&!Ot(t.replace);let a=r?t.replace:t;if(r&&typeof t.count<"u"&&(a.count=t.count),this.options.interpolation.defaultVariables&&(a={...this.options.interpolation.defaultVariables,...a}),!r){a={...a};for(const o of n)delete a[o]}return a}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}class vT{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ta.create("languageUtils")}getScriptPartFromCode(t){if(t=wd(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=wd(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(Ot(t)&&t.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(t)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const a=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(a))&&(n=a)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const a=this.getScriptPartFromCode(r);if(this.isSupportedCode(a))return n=a;const o=this.getLanguagePartFromCode(r);if(this.isSupportedCode(o))return n=o;n=this.options.supportedLngs.find(l=>{if(l===o)return l;if(!(l.indexOf("-")<0&&o.indexOf("-")<0)&&(l.indexOf("-")>0&&o.indexOf("-")<0&&l.substring(0,l.indexOf("-"))===o||l.indexOf(o)===0&&o.length>1))return l})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),Ot(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],t),a=[],o=l=>{l&&(this.isSupportedCode(l)?a.push(l):this.logger.warn(`rejecting language code not found in supportedLngs: ${l}`))};return Ot(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(t))):Ot(t)&&o(this.formatLanguageCode(t)),r.forEach(l=>{a.indexOf(l)<0&&o(this.formatLanguageCode(l))}),a}}const xT={zero:0,one:1,two:2,few:3,many:4,other:5},wT={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class c4{constructor(t,n={}){this.languageUtils=t,this.options=n,this.logger=ta.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,n={}){const r=wd(t==="dev"?"en":t),a=n.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:r,type:a});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let l;try{l=new Intl.PluralRules(r,{type:a})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),wT;if(!t.match(/-|_/))return wT;const f=this.languageUtils.getLanguagePartFromCode(t);l=this.getRule(f,n)}return this.pluralRulesCache[o]=l,l}needsPlural(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),(r==null?void 0:r.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(t,n,r={}){return this.getSuffixes(t,r).map(a=>`${n}${a}`)}getSuffixes(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((a,o)=>xT[a]-xT[o]).map(a=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${a}`):[]}getSuffix(t,n,r={}){const a=this.getRule(t,r);return a?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${a.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,r))}}const ST=(e,t,n,r=".",a=!0)=>{let o=e4(e,t,n);return!o&&a&&Ot(n)&&(o=Cv(e,n,r),o===void 0&&(o=Cv(t,n,r))),o},nb=e=>e.replace(/\$/g,"$$$$");class ET{constructor(t={}){var n;this.logger=ta.create("interpolator"),this.options=t,this.format=((n=t==null?void 0:t.interpolation)==null?void 0:n.format)||(r=>r),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:a,prefix:o,prefixEscaped:l,suffix:c,suffixEscaped:f,formatSeparator:d,unescapeSuffix:m,unescapePrefix:h,nestingPrefix:y,nestingPrefixEscaped:g,nestingSuffix:w,nestingSuffixEscaped:C,nestingOptionsSeparator:T,maxReplaces:E,alwaysFormat:R}=t.interpolation;this.escape=n!==void 0?n:n4,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=a!==void 0?a:!1,this.prefix=o?zl(o):l||"{{",this.suffix=c?zl(c):f||"}}",this.formatSeparator=d||",",this.unescapePrefix=m?"":h||"-",this.unescapeSuffix=this.unescapePrefix?"":m||"",this.nestingPrefix=y?zl(y):g||zl("$t("),this.nestingSuffix=w?zl(w):C||zl(")"),this.nestingOptionsSeparator=T||",",this.maxReplaces=E||1e3,this.alwaysFormat=R!==void 0?R:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>(n==null?void 0:n.source)===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,n,r,a){var g;let o,l,c;const f=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},d=w=>{if(w.indexOf(this.formatSeparator)<0){const R=ST(n,f,w,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(R,void 0,r,{...a,...n,interpolationkey:w}):R}const C=w.split(this.formatSeparator),T=C.shift().trim(),E=C.join(this.formatSeparator).trim();return this.format(ST(n,f,T,this.options.keySeparator,this.options.ignoreJSONStructure),E,r,{...a,...n,interpolationkey:T})};this.resetRegExp();const m=(a==null?void 0:a.missingInterpolationHandler)||this.options.missingInterpolationHandler,h=((g=a==null?void 0:a.interpolation)==null?void 0:g.skipOnVariables)!==void 0?a.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:w=>nb(w)},{regex:this.regexp,safeValue:w=>this.escapeValue?nb(this.escape(w)):nb(w)}].forEach(w=>{for(c=0;o=w.regex.exec(t);){const C=o[1].trim();if(l=d(C),l===void 0)if(typeof m=="function"){const E=m(t,o,a);l=Ot(E)?E:""}else if(a&&Object.prototype.hasOwnProperty.call(a,C))l="";else if(h){l=o[0];continue}else this.logger.warn(`missed to pass in variable ${C} for interpolating ${t}`),l="";else!Ot(l)&&!this.useRawValueToEscape&&(l=hT(l));const T=w.safeValue(l);if(t=t.replace(o[0],T),h?(w.regex.lastIndex+=l.length,w.regex.lastIndex-=o[0].length):w.regex.lastIndex=0,c++,c>=this.maxReplaces)break}}),t}nest(t,n,r={}){let a,o,l;const c=(f,d)=>{const m=this.nestingOptionsSeparator;if(f.indexOf(m)<0)return f;const h=f.split(new RegExp(`${m}[ ]*{`));let y=`{${h[1]}`;f=h[0],y=this.interpolate(y,l);const g=y.match(/'/g),w=y.match(/"/g);(((g==null?void 0:g.length)??0)%2===0&&!w||w.length%2!==0)&&(y=y.replace(/'/g,'"'));try{l=JSON.parse(y),d&&(l={...d,...l})}catch(C){return this.logger.warn(`failed parsing options string in nesting for key ${f}`,C),`${f}${m}${y}`}return l.defaultValue&&l.defaultValue.indexOf(this.prefix)>-1&&delete l.defaultValue,f};for(;a=this.nestingRegexp.exec(t);){let f=[];l={...r},l=l.replace&&!Ot(l.replace)?l.replace:l,l.applyPostProcessor=!1,delete l.defaultValue;const d=/{.*}/.test(a[1])?a[1].lastIndexOf("}")+1:a[1].indexOf(this.formatSeparator);if(d!==-1&&(f=a[1].slice(d).split(this.formatSeparator).map(m=>m.trim()).filter(Boolean),a[1]=a[1].slice(0,d)),o=n(c.call(this,a[1].trim(),l),l),o&&a[0]===t&&!Ot(o))return o;Ot(o)||(o=hT(o)),o||(this.logger.warn(`missed to resolve ${a[1]} for nesting ${t}`),o=""),f.length&&(o=f.reduce((m,h)=>this.format(m,h,r.lng,{...r,interpolationkey:a[1].trim()}),o.trim())),t=t.replace(a[0],o),this.regexp.lastIndex=0}return t}}const u4=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const a=r[1].substring(0,r[1].length-1);t==="currency"&&a.indexOf(":")<0?n.currency||(n.currency=a.trim()):t==="relativetime"&&a.indexOf(":")<0?n.range||(n.range=a.trim()):a.split(";").forEach(l=>{if(l){const[c,...f]=l.split(":"),d=f.join(":").trim().replace(/^'+|'+$/g,""),m=c.trim();n[m]||(n[m]=d),d==="false"&&(n[m]=!1),d==="true"&&(n[m]=!0),isNaN(d)||(n[m]=parseInt(d,10))}})}return{formatName:t,formatOptions:n}},CT=e=>{const t={};return(n,r,a)=>{let o=a;a&&a.interpolationkey&&a.formatParams&&a.formatParams[a.interpolationkey]&&a[a.interpolationkey]&&(o={...o,[a.interpolationkey]:void 0});const l=r+JSON.stringify(o);let c=t[l];return c||(c=e(wd(r),a),t[l]=c),c(n)}},d4=e=>(t,n,r)=>e(wd(n),r)(t);class f4{constructor(t={}){this.logger=ta.create("formatter"),this.options=t,this.init(t)}init(t,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const r=n.cacheInBuiltFormats?CT:d4;this.formats={number:r((a,o)=>{const l=new Intl.NumberFormat(a,{...o});return c=>l.format(c)}),currency:r((a,o)=>{const l=new Intl.NumberFormat(a,{...o,style:"currency"});return c=>l.format(c)}),datetime:r((a,o)=>{const l=new Intl.DateTimeFormat(a,{...o});return c=>l.format(c)}),relativetime:r((a,o)=>{const l=new Intl.RelativeTimeFormat(a,{...o});return c=>l.format(c,o.range||"day")}),list:r((a,o)=>{const l=new Intl.ListFormat(a,{...o});return c=>l.format(c)})}}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=CT(n)}format(t,n,r,a={}){const o=n.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(c=>c.indexOf(")")>-1)){const c=o.findIndex(f=>f.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,c)].join(this.formatSeparator)}return o.reduce((c,f)=>{var h;const{formatName:d,formatOptions:m}=u4(f);if(this.formats[d]){let y=c;try{const g=((h=a==null?void 0:a.formatParams)==null?void 0:h[a.interpolationkey])||{},w=g.locale||g.lng||a.locale||a.lng||r;y=this.formats[d](c,w,{...m,...a,...g})}catch(g){this.logger.warn(g)}return y}else this.logger.warn(`there was no format function for ${d}`);return c},t)}}const h4=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class p4 extends Zp{constructor(t,n,r,a={}){var o,l;super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=a,this.logger=ta.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=a.maxParallelReads||10,this.readingCalls=0,this.maxRetries=a.maxRetries>=0?a.maxRetries:5,this.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,this.state={},this.queue=[],(l=(o=this.backend)==null?void 0:o.init)==null||l.call(o,r,a.backend,a)}queueLoad(t,n,r,a){const o={},l={},c={},f={};return t.forEach(d=>{let m=!0;n.forEach(h=>{const y=`${d}|${h}`;!r.reload&&this.store.hasResourceBundle(d,h)?this.state[y]=2:this.state[y]<0||(this.state[y]===1?l[y]===void 0&&(l[y]=!0):(this.state[y]=1,m=!1,l[y]===void 0&&(l[y]=!0),o[y]===void 0&&(o[y]=!0),f[h]===void 0&&(f[h]=!0)))}),m||(c[d]=!0)}),(Object.keys(o).length||Object.keys(l).length)&&this.queue.push({pending:l,pendingCount:Object.keys(l).length,loaded:{},errors:[],callback:a}),{toLoad:Object.keys(o),pending:Object.keys(l),toLoadLanguages:Object.keys(c),toLoadNamespaces:Object.keys(f)}}loaded(t,n,r){const a=t.split("|"),o=a[0],l=a[1];n&&this.emit("failedLoading",o,l,n),!n&&r&&this.store.addResourceBundle(o,l,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const c={};this.queue.forEach(f=>{Jz(f.loaded,[o],l),h4(f,t),n&&f.errors.push(n),f.pendingCount===0&&!f.done&&(Object.keys(f.loaded).forEach(d=>{c[d]||(c[d]={});const m=f.loaded[d];m.length&&m.forEach(h=>{c[d][h]===void 0&&(c[d][h]=!0)})}),f.done=!0,f.errors.length?f.callback(f.errors):f.callback())}),this.emit("loaded",c),this.queue=this.queue.filter(f=>!f.done)}read(t,n,r,a=0,o=this.retryTimeout,l){if(!t.length)return l(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:a,wait:o,callback:l});return}this.readingCalls++;const c=(d,m)=>{if(this.readingCalls--,this.waitingReads.length>0){const h=this.waitingReads.shift();this.read(h.lng,h.ns,h.fcName,h.tried,h.wait,h.callback)}if(d&&m&&a<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,r,a+1,o*2,l)},o);return}l(d,m)},f=this.backend[r].bind(this.backend);if(f.length===2){try{const d=f(t,n);d&&typeof d.then=="function"?d.then(m=>c(null,m)).catch(c):c(null,d)}catch(d){c(d)}return}return f(t,n,c)}prepareLoading(t,n,r={},a){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),a&&a();Ot(t)&&(t=this.languageUtils.toResolveHierarchy(t)),Ot(n)&&(n=[n]);const o=this.queueLoad(t,n,r,a);if(!o.toLoad.length)return o.pending.length||a(),null;o.toLoad.forEach(l=>{this.loadOne(l)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t,n=""){const r=t.split("|"),a=r[0],o=r[1];this.read(a,o,"read",void 0,void 0,(l,c)=>{l&&this.logger.warn(`${n}loading namespace ${o} for language ${a} failed`,l),!l&&c&&this.logger.log(`${n}loaded namespace ${o} for language ${a}`,c),this.loaded(t,l,c)})}saveMissing(t,n,r,a,o,l={},c=()=>{}){var f,d,m,h,y;if((d=(f=this.services)==null?void 0:f.utils)!=null&&d.hasLoadedNamespace&&!((h=(m=this.services)==null?void 0:m.utils)!=null&&h.hasLoadedNamespace(n))){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if((y=this.backend)!=null&&y.create){const g={...l,isUpdate:o},w=this.backend.create.bind(this.backend);if(w.length<6)try{let C;w.length===5?C=w(t,n,r,a,g):C=w(t,n,r,a),C&&typeof C.then=="function"?C.then(T=>c(null,T)).catch(c):c(null,C)}catch(C){c(C)}else w(t,n,r,a,c,g)}!t||!t[0]||this.store.addResource(t[0],n,r,a)}}}const rb=()=>({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]),Ot(e[1])&&(t.defaultValue=e[1]),Ot(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),TT=e=>{var t,n;return Ot(e.ns)&&(e.ns=[e.ns]),Ot(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Ot(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},Rh=()=>{},m4=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})},g4=e=>{var t,n,r,a,o,l,c,f,d;return!!(((r=(n=(t=e==null?void 0:e.modules)==null?void 0:t.backend)==null?void 0:n.name)==null?void 0:r.indexOf("Locize"))>0||((c=(l=(o=(a=e==null?void 0:e.modules)==null?void 0:a.backend)==null?void 0:o.constructor)==null?void 0:l.name)==null?void 0:c.indexOf("Locize"))>0||(d=(f=e==null?void 0:e.options)==null?void 0:f.backend)!=null&&d.backends&&e.options.backend.backends.some(m=>{var h,y,g;return((h=m==null?void 0:m.name)==null?void 0:h.indexOf("Locize"))>0||((g=(y=m==null?void 0:m.constructor)==null?void 0:y.name)==null?void 0:g.indexOf("Locize"))>0}))};class nd extends Zp{constructor(t={},n){if(super(),this.options=TT(t),this.services={},this.logger=ta,this.modules={external:[]},m4(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&&(Ot(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const r=rb();this.options={...r,...this.options,...TT(t)},this.options.interpolation={...r.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=r.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!g4(this)&&typeof console<"u"&&typeof console.info<"u"&&console.info("🌐 i18next is maintained with support from locize.com — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙");const a=d=>d?typeof d=="function"?new d:d:null;if(!this.options.isClone){this.modules.logger?ta.init(a(this.modules.logger),this.options):ta.init(null,this.options);let d;this.modules.formatter?d=this.modules.formatter:d=f4;const m=new vT(this.options);this.store=new yT(this.options.resources,this.options);const h=this.services;h.logger=ta,h.resourceStore=this.store,h.languageUtils=m,h.pluralResolver=new c4(m,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),d&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(h.formatter=a(d),h.formatter.init&&h.formatter.init(h,this.options),this.options.interpolation.format=h.formatter.format.bind(h.formatter)),h.interpolator=new ET(this.options),h.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},h.backendConnector=new p4(a(this.modules.backend),h.resourceStore,h,this.options),h.backendConnector.on("*",(g,...w)=>{this.emit(g,...w)}),this.modules.languageDetector&&(h.languageDetector=a(this.modules.languageDetector),h.languageDetector.init&&h.languageDetector.init(h,this.options.detection,this.options)),this.modules.i18nFormat&&(h.i18nFormat=a(this.modules.i18nFormat),h.i18nFormat.init&&h.i18nFormat.init(this)),this.translator=new xp(this.services,this.options),this.translator.on("*",(g,...w)=>{this.emit(g,...w)}),this.modules.external.forEach(g=>{g.init&&g.init(this)})}if(this.format=this.options.interpolation.format,n||(n=Rh),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const d=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);d.length>0&&d[0]!=="dev"&&(this.options.lng=d[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(d=>{this[d]=(...m)=>this.store[d](...m)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(d=>{this[d]=(...m)=>(this.store[d](...m),this)});const c=_u(),f=()=>{const d=(m,h)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),c.resolve(h),n(m,h)};if(this.languages&&!this.isInitialized)return d(null,this.t.bind(this));this.changeLanguage(this.options.lng,d)};return this.options.resources||!this.options.initAsync?f():setTimeout(f,0),c}loadResources(t,n=Rh){var o,l;let r=n;const a=Ot(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if((a==null?void 0:a.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const c=[],f=d=>{if(!d||d==="cimode")return;this.services.languageUtils.toResolveHierarchy(d).forEach(h=>{h!=="cimode"&&c.indexOf(h)<0&&c.push(h)})};a?f(a):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(m=>f(m)),(l=(o=this.options.preload)==null?void 0:o.forEach)==null||l.call(o,d=>f(d)),this.services.backendConnector.load(c,this.options.ns,d=>{!d&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(d)})}else r(null)}reloadResources(t,n,r){const a=_u();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=Rh),this.services.backendConnector.reload(t,n,o=>{a.resolve(),r(o)}),a}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&c2.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1)){for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}!this.resolvedLanguage&&this.languages.indexOf(t)<0&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,n){this.isLanguageChangingTo=t;const r=_u();this.emit("languageChanging",t);const a=c=>{this.language=c,this.languages=this.services.languageUtils.toResolveHierarchy(c),this.resolvedLanguage=void 0,this.setResolvedLanguage(c)},o=(c,f)=>{f?this.isLanguageChangingTo===t&&(a(f),this.translator.changeLanguage(f),this.isLanguageChangingTo=void 0,this.emit("languageChanged",f),this.logger.log("languageChanged",f)):this.isLanguageChangingTo=void 0,r.resolve((...d)=>this.t(...d)),n&&n(c,(...d)=>this.t(...d))},l=c=>{var m,h;!t&&!c&&this.services.languageDetector&&(c=[]);const f=Ot(c)?c:c&&c[0],d=this.store.hasLanguageSomeTranslations(f)?f:this.services.languageUtils.getBestMatchFromCodes(Ot(c)?[c]:c);d&&(this.language||a(d),this.translator.language||this.translator.changeLanguage(d),(h=(m=this.services.languageDetector)==null?void 0:m.cacheUserLanguage)==null||h.call(m,d)),this.loadResources(d,y=>{o(y,d)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?l(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(l):this.services.languageDetector.detect(l):l(t),r}getFixedT(t,n,r){const a=(o,l,...c)=>{let f;typeof l!="object"?f=this.options.overloadTranslationOptionHandler([o,l].concat(c)):f={...l},f.lng=f.lng||a.lng,f.lngs=f.lngs||a.lngs,f.ns=f.ns||a.ns,f.keyPrefix!==""&&(f.keyPrefix=f.keyPrefix||r||a.keyPrefix);const d=this.options.keySeparator||".";let m;return f.keyPrefix&&Array.isArray(o)?m=o.map(h=>(typeof h=="function"&&(h=Tv(h,{...this.options,...l})),`${f.keyPrefix}${d}${h}`)):(typeof o=="function"&&(o=Tv(o,{...this.options,...l})),m=f.keyPrefix?`${f.keyPrefix}${d}${o}`:o),this.t(m,f)};return Ot(t)?a.lng=t:a.lngs=t,a.ns=n,a.keyPrefix=r,a}t(...t){var n;return(n=this.translator)==null?void 0:n.translate(...t)}exists(...t){var n;return(n=this.translator)==null?void 0:n.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,n={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],a=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const l=(c,f)=>{const d=this.services.backendConnector.state[`${c}|${f}`];return d===-1||d===0||d===2};if(n.precheck){const c=n.precheck(this,l);if(c!==void 0)return c}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||l(r,t)&&(!a||l(o,t)))}loadNamespaces(t,n){const r=_u();return this.options.ns?(Ot(t)&&(t=[t]),t.forEach(a=>{this.options.ns.indexOf(a)<0&&this.options.ns.push(a)}),this.loadResources(a=>{r.resolve(),n&&n(a)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=_u();Ot(t)&&(t=[t]);const a=this.options.preload||[],o=t.filter(l=>a.indexOf(l)<0&&this.services.languageUtils.isSupportedCode(l));return o.length?(this.options.preload=a.concat(o),this.loadResources(l=>{r.resolve(),n&&n(l)}),r):(n&&n(),Promise.resolve())}dir(t){var a,o;if(t||(t=this.resolvedLanguage||(((a=this.languages)==null?void 0:a.length)>0?this.languages[0]:this.language)),!t)return"rtl";try{const l=new Intl.Locale(t);if(l&&l.getTextInfo){const c=l.getTextInfo();if(c&&c.direction)return c.direction}}catch{}const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=((o=this.services)==null?void 0:o.languageUtils)||new vT(rb());return t.toLowerCase().indexOf("-latn")>1?"ltr":n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},n){const r=new nd(t,n);return r.createInstance=nd.createInstance,r}cloneInstance(t={},n=Rh){const r=t.forkResourceStore;r&&delete t.forkResourceStore;const a={...this.options,...t,isClone:!0},o=new nd(a);if((t.debug!==void 0||t.prefix!==void 0)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(c=>{o[c]=this[c]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},r){const c=Object.keys(this.store.data).reduce((f,d)=>(f[d]={...this.store.data[d]},f[d]=Object.keys(f[d]).reduce((m,h)=>(m[h]={...f[d][h]},m),f[d]),f),{});o.store=new yT(c,a),o.services.resourceStore=o.store}if(t.interpolation){const f={...rb().interpolation,...this.options.interpolation,...t.interpolation},d={...a,interpolation:f};o.services.interpolator=new ET(d)}return o.translator=new xp(o.services,a),o.translator.on("*",(c,...f)=>{o.emit(c,...f)}),o.init(a,n),o.translator.options=a,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const hn=nd.createInstance();hn.createInstance;hn.dir;hn.init;hn.loadResources;hn.reloadResources;hn.use;hn.changeLanguage;hn.getFixedT;hn.t;hn.exists;hn.setDefaultNamespace;hn.hasLoadedNamespace;hn.loadNamespaces;hn.loadLanguages;const y4=(e,t,n,r)=>{var o,l,c,f;const a=[n,{code:t,...r||{}}];if((l=(o=e==null?void 0:e.services)==null?void 0:o.logger)!=null&&l.forward)return e.services.logger.forward(a,"warn","react-i18next::",!0);qs(a[0])&&(a[0]=`react-i18next:: ${a[0]}`),(f=(c=e==null?void 0:e.services)==null?void 0:c.logger)!=null&&f.warn?e.services.logger.warn(...a):console!=null&&console.warn&&console.warn(...a)},RT={},d2=(e,t,n,r)=>{qs(n)&&RT[n]||(qs(n)&&(RT[n]=new Date),y4(e,t,n,r))},f2=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},Rv=(e,t,n)=>{e.loadNamespaces(t,f2(e,n))},kT=(e,t,n,r)=>{if(qs(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return Rv(e,n,r);n.forEach(a=>{e.options.ns.indexOf(a)<0&&e.options.ns.push(a)}),e.loadLanguages(t,f2(e,r))},b4=(e,t,n={})=>!t.languages||!t.languages.length?(d2(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(r,a)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!a(r.isLanguageChangingTo,e))return!1}}),qs=e=>typeof e=="string",v4=e=>typeof e=="object"&&e!==null,x4=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,w4={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},S4=e=>w4[e],E4=e=>e.replace(x4,S4);let kv={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:E4,transDefaultProps:void 0};const C4=(e={})=>{kv={...kv,...e}},T4=()=>kv;let h2;const R4=e=>{h2=e},k4=()=>h2,M4={type:"3rdParty",init(e){C4(e.options.react),R4(e)}},O4=v.createContext();class A4{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var ib={exports:{}},ab={};/**
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 MT;function N4(){if(MT)return ab;MT=1;var e=jd();function t(h,y){return h===y&&(h!==0||1/h===1/y)||h!==h&&y!==y}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,a=e.useEffect,o=e.useLayoutEffect,l=e.useDebugValue;function c(h,y){var g=y(),w=r({inst:{value:g,getSnapshot:y}}),C=w[0].inst,T=w[1];return o(function(){C.value=g,C.getSnapshot=y,f(C)&&T({inst:C})},[h,g,y]),a(function(){return f(C)&&T({inst:C}),h(function(){f(C)&&T({inst:C})})},[h]),l(g),g}function f(h){var y=h.getSnapshot;h=h.value;try{var g=y();return!n(h,g)}catch{return!0}}function d(h,y){return y()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:c;return ab.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,ab}var OT;function p2(){return OT||(OT=1,ib.exports=N4()),ib.exports}var Kx=p2();const D4=(e,t)=>qs(t)?t:v4(t)&&qs(t.defaultValue)?t.defaultValue:Array.isArray(e)?e[e.length-1]:e,I4={t:D4,ready:!1},P4=()=>()=>{},mn=(e,t={})=>{var q,F,W;const{i18n:n}=t,{i18n:r,defaultNS:a}=v.useContext(O4)||{},o=n||r||k4();o&&!o.reportNamespaces&&(o.reportNamespaces=new A4),o||d2(o,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const l=v.useMemo(()=>{var _;return{...T4(),...(_=o==null?void 0:o.options)==null?void 0:_.react,...t}},[o,t]),{useSuspense:c,keyPrefix:f}=l,d=a||((q=o==null?void 0:o.options)==null?void 0:q.defaultNS),m=qs(d)?[d]:d||["translation"],h=v.useMemo(()=>m,m);(W=(F=o==null?void 0:o.reportNamespaces)==null?void 0:F.addUsedNamespaces)==null||W.call(F,h);const y=v.useRef(0),g=v.useCallback(_=>{if(!o)return P4;const{bindI18n:V,bindI18nStore:$}=l,B=()=>{y.current+=1,_()};return V&&o.on(V,B),$&&o.store.on($,B),()=>{V&&V.split(" ").forEach(j=>o.off(j,B)),$&&$.split(" ").forEach(j=>o.store.off(j,B))}},[o,l]),w=v.useRef(),C=v.useCallback(()=>{if(!o)return I4;const _=!!(o.isInitialized||o.initializedStoreOnce)&&h.every(H=>b4(H,o,l)),V=t.lng||o.language,$=y.current,B=w.current;if(B&&B.ready===_&&B.lng===V&&B.keyPrefix===f&&B.revision===$)return B;const z={t:o.getFixedT(V,l.nsMode==="fallback"?h:h[0],f),ready:_,lng:V,keyPrefix:f,revision:$};return w.current=z,z},[o,h,f,l,t.lng]),[T,E]=v.useState(0),{t:R,ready:k}=Kx.useSyncExternalStore(g,C,C);v.useEffect(()=>{if(o&&!k&&!c){const _=()=>E(V=>V+1);t.lng?kT(o,t.lng,h,_):Rv(o,h,_)}},[o,t.lng,h,k,c,T]);const M=o||{},D=v.useRef(null),O=v.useRef(),A=_=>{const V=Object.getOwnPropertyDescriptors(_);V.__original&&delete V.__original;const $=Object.create(Object.getPrototypeOf(_),V);if(!Object.prototype.hasOwnProperty.call($,"__original"))try{Object.defineProperty($,"__original",{value:_,writable:!1,enumerable:!1,configurable:!1})}catch{}return $},L=v.useMemo(()=>{const _=M,V=_==null?void 0:_.language;let $=_;_&&(D.current&&D.current.__original===_?O.current!==V?($=A(_),D.current=$,O.current=V):$=D.current:($=A(_),D.current=$,O.current=V));const B=[R,$,k];return B.t=R,B.i18n=$,B.ready=k,B},[R,M,k,M.resolvedLanguage,M.language,M.languages]);if(o&&c&&!k)throw new Promise(_=>{const V=()=>_();t.lng?kT(o,t.lng,h,V):Rv(o,h,V)});return L},L4={en_US:{translation:{common:{loading:"Loading...",save:"Save",saving:"Saving...",cancel:"Cancel",add:"Add",delete:"Delete",edit:"Edit",confirm:"Confirm",close:"Close",expand:"Expand",collapse:"Collapse",refresh:"Refresh",test:"Test",send:"Send",success:"Success",error:"Error",warning:"Warning",info:"Info",yes:"Yes",no:"No",enabled:"Enabled",disabled:"Disabled",pending:"Pending",authorized:"Authorized",unknown:"Unknown",empty:"Empty",none:"None",default:"Default",optional:"Optional",required:"Required",pwaInstallTitle:"Install as app",pwaInstallHintIOSSafari:'iOS Safari does not show an automatic install prompt. Tap Share, then "Add to Home Screen".',pwaInstallHintIOSChrome:'iOS Chrome does not show an automatic install prompt. Tap Share, then "Add to Home Screen".'},nav:{manageDevices:"Manage Devices",settings:"Settings",sidebarExpand:"Expand Sidebar",sidebarCollapse:"Collapse Sidebar",openSidebar:"Open Sidebar",closeSidebar:"Close Sidebar",jumpToLatest:"Jump to Latest",switchToEditor:"Switch to Editor Input",switchToDirect:"Switch to Direct Input",refreshPage:"Refresh Page",refreshPageConfirm:"Are you sure you want to refresh the page? Unsaved content will be lost."},device:{title:"Device Management",devices:"Devices",addDevice:"Add Device",addDeviceDescription:"Fill in device details and choose a connection method",addFirstDevice:"Add First Device",editDevice:"Edit Device",editDeviceDescription:"Update device configuration",sectionBasic:"Basic Info",sectionConnection:"Connection",sectionAuth:"Authentication",noDevices:"No Devices",noDevicesDescription:"Add a local or SSH device to get started",name:"Device Name",namePlaceholder:"e.g., My Server",type:"Type",typeLocal:"Local Device",typeSSH:"SSH Remote Device",typeSSHBadge:"SSH",host:"Host",hostPlaceholder:"example.com",port:"Port",username:"Username",usernamePlaceholder:"root",session:"Tmux Session Name",sessionPlaceholder:"tmex",sessionHint:'Leave empty to use default "tmex"',authMode:"Authentication Mode",authPassword:"Password",authKey:"Private Key",authAgent:"SSH Agent",authConfigRef:"SSH Config",password:"Password",privateKey:"Private Key",privateKeyPlaceholder:"-----BEGIN OPENSSH PRIVATE KEY-----",privateKeyPassphrase:"Private Key Passphrase (Optional)",passphrase:"Passphrase",connect:"Connect",connected:"Connected",disconnect:"Disconnect",disconnected:"Disconnected",connecting:"Connecting...",dragHandle:"Drag to reorder device",reorderFailed:"Failed to reorder devices",deleteConfirm:"Delete this device?",deleteDescription:'Device "{{name}}" will be permanently removed. This action cannot be undone.',deleteSuccess:"Device deleted",createSuccess:"Device created",updateSuccess:"Device updated",deleteFailed:"Failed to delete device",createFailed:"Failed to create device",updateFailed:"Failed to update device",loadFailed:"Failed to load devices",localDevice:"Local Device",subtitle:"{{username}}@{{host}}:{{port}}",modify:"Modify Device",delete:"Delete"},terminal:{initializing:"Initializing terminal...",connecting:"Connecting to device...",initFailed:"Terminal initialization failed",inputPlaceholder:"Type command here...",clear:"Clear",deviceError:"Device Error",deviceErrorWithType:"[{{type}}] Device Error",noDeviceSelected:"No device selected",windowClosed:"Current window has been closed, please select a window from the sidebar.",paneClosed:"Current pane has been closed, please select a pane from the sidebar.",bellNotification:"Terminal Bell Notification",bellDescription:"Window {{window}} · Pane {{pane}}",bellFallback:"Received tmux bell",paneTitle:"Pane {{index}}",activePane:"Current Pane",activeWindow:"Current Window",editorPlaceholder:"Enter commands here...",editorClear:"Clear",editorSendWithEnter:"Send with Enter",editorSendLineByLine:"Send Line by Line",editorSend:"Send",sendShortcut:"Send {{key}}",inputModeDirect:"Direct Input",inputModeEditor:"Editor",newWindow:"New Window",closeWindow:"Close Window",closePane:"Close Pane",copy:"Copy",paste:"Paste",copied:"Copied to clipboard",copyFailed:"Copy failed",pasteFailed:"Could not read clipboard, check browser permissions",clearSelection:"Dismiss selection"},settings:{title:"System Settings",siteSettings:"Site Settings",siteName:"Site Name",siteNamePlaceholder:"tmex",siteUrl:"Site URL",siteUrlPlaceholder:"http://localhost:3000",bellThrottle:"Bell Throttle (seconds)",notificationThrottle:"Notification Throttle (seconds)",enableBrowserBellToast:"Enable Browser Bell Toast",enableBrowserNotificationToast:"Enable Browser Notification Toast",enableTelegramBellPush:"Enable Telegram Bell Push",enableTelegramNotificationPush:"Enable Telegram Notification Push",sshReconnectRetries:"SSH Reconnect Retries",sshReconnectDelay:"SSH Reconnect Delay (seconds)",language:"Language",languagePlaceholder:"Select language",language_en_US:"English",language_zh_CN:"简体中文",language_ja_JP:"日本語",theme:"Theme",themeLight:"Light",themeDark:"Dark",siteTab:"Site",notificationsTab:"Notifications",refreshToApply:"Refresh to apply language change",saveSettings:"Save Settings",settingsSaved:"Settings saved",saveFailed:"Failed to save settings",loadFailed:"Failed to load settings",restartGateway:"Restart Gateway",restartScheduled:"Gateway restart scheduled",restartConfirm:"Are you sure you want to restart Gateway? This will interrupt all active connections.",restartFailed:"Failed to restart gateway",sshReconnectMaxRetries:"SSH Reconnect Retries",llm:{title:"LLM Providers",name:"Name",namePlaceholder:"e.g. OpenAI",baseUrl:"Base URL",baseUrlPlaceholder:"https://api.openai.com",baseUrlHint:"Adds /v1 automatically; end with / to keep the path as-is",protocol:"Protocol",apiKey:"API Key",apiKeyPlaceholder:"Enter API key",apiKeySetPlaceholder:"Already set, leave blank to keep",addProvider:"Add Provider",editProvider:"Edit Provider",formHint:"Configure the provider connection",models:"Models",modelsTitle:"Models for {{name}}",modelsHint:"Manage the available models for this provider: toggle and add manually",modelManual:"Manual",addModelPlaceholder:"Add a model ID",empty:"No providers yet",refreshModels:"Refresh Models",modelsCount:"{{total}} models",modelsNotFetched:"Models not fetched yet",modelsFetchFailed:"Failed to fetch models: {{error}}",deleteProvider:"Delete Provider",deleteConfirm:'Delete provider "{{name}}"?',defaults:"Global Defaults",defaultProvider:"Default Provider",defaultProviderNone:"Not set",defaultModel:"Default Model",defaultModelPlaceholder:"Type or pick a model ID",saveDefaults:"Save Defaults",loadFailed:"Failed to load LLM providers",createFailed:"Failed to create provider",updateFailed:"Failed to update provider",deleteFailed:"Failed to delete provider",refreshModelsFailed:"Failed to refresh models",settingsLoadFailed:"Failed to load LLM settings",settingsSaveFailed:"Failed to save LLM settings"},search:{title:"Search",provider:"Search Provider",providerNone:"Disabled",tavilyApiKey:"Tavily API Key",braveApiKey:"Brave API Key",keyPlaceholder:"Enter API key",keySetPlaceholder:"Already set, leave blank to keep",clearKey:"Clear",clearKeyConfirm:"Clear this API key? You will need to enter it again.",loadFailed:"Failed to load search settings",saveFailed:"Failed to save search settings"},files:{title:"Files",description:"Per-device directories browsable in the Files tab. Local devices read directly; SSH devices use rsync.",addRoot:"Add directory",roots:"Directories",empty:"No directories configured",missing:"Device missing",modalAddTitle:"Add directory",modalEditTitle:"Edit directory",device:"Device",devicePlaceholder:"Select a device",noDevices:"No devices yet — add one first",path:"Path",pathPlaceholder:"/absolute/path/to/directory",pathHint:"Absolute path on the selected device.",enabled:"Enabled",addFailed:"Failed to add directory",updateFailed:"Failed to update directory",deleteFailed:"Failed to remove directory",toggleFailed:"Failed to update directory",deleteTitle:"Remove directory?",deleteDesc:'Remove "{{path}}" from the whitelist? Files under it will no longer be accessible.'}},telegram:{title:"Telegram Bot Management",botName:"Bot Name",botNamePlaceholder:"e.g., ops-bot",botToken:"Bot Token",botTokenPlaceholder:"123456:AA...",addBot:"Add Bot",enableBot:"Enable Bot",allowAuthRequests:"Allow Authorization Requests",pendingChats:"Pending Authorization",chats:"Authorized Chats",authorizedChats:"Authorized",noPendingChats:"No pending chats",noAuthorizedChats:"No authorized chats",approve:"Approve",authorize:"Authorize",reject:"Reject",revokeAuth:"Revoke Authorization",testMessage:"Test Message",sendTestMessage:"Send Test Message",deleteBot:"Delete Bot",tokenOptional:"Token (leave empty to keep unchanged)",tokenPlaceholder:"Enter new token",botCreated:"Bot created",botUpdated:"Bot updated",botDeleted:"Bot deleted",authApproved:"Authorization approved",chatRemoved:"Chat removed",testMessageSent:"Test message sent",createFailed:"Failed to create bot",updateFailed:"Failed to update bot",deleteFailed:"Failed to delete bot",approveFailed:"Failed to approve authorization",removeFailed:"Failed to remove chat",testMessageFailed:"Failed to send test message",loadBotsFailed:"Failed to load bot list",loadChatsFailed:"Failed to load chat list",noBots:"No bots yet, add one first.",expand:"Expand",collapse:"Collapse",authCount:"{{authorized}} authorized / {{pending}} pending (max 8)",chatId:"Chat ID",applyTime:"Application Time",gatewayOnline:"🟢 Gateway online @ {{siteName}}",deviceConnectionError:`🔴 {{siteName}}: Connection error on device "{{deviceName}}" ({{host}}) [{{category}}]
71
+ {{error}}`,agentCredentialWarning:'⚠️ {{siteName}}: A message in agent session "{{sessionTitle}}" appears to contain credentials ({{types}}). It will be sent to the LLM and stored — risk of leakage.',authSuccess:"✅ Authorized. You will now receive notifications.",authPending:"⏳ Authorization request received. Please approve in tmex settings.",authFailed:"❌ Authorization request failed. Please contact administrator.",testMessageTemplate:`🧪 Test Message
72
+ Site: {{siteName}}
73
+ Time: {{time}}`,approveMessageTemplate:`✅ Authorized via tmex.
74
+ Bot: {{botName}}
75
+ Time: {{time}}`,botNotFound:"Bot not found or unavailable",botNotRunning:"Bot is not running or unavailable"},webhook:{title:"Webhooks",url:"Webhook URL",secret:"Secret",secretPlaceholder:"Used to sign payloads (HMAC-SHA256)",enabled:"Enabled",eventMask:"Events",add:"Add Webhook",empty:"No webhooks yet.",createFailed:"Failed to create webhook",deleteFailed:"Failed to delete webhook",loadFailed:"Failed to load webhooks"},sshError:{sshConfigRefNotSupported:"SSH Config reference is not supported in this version. Please use host + username with Agent/Key/Password authentication.",configRefNotSupported:"SSH Config reference is not supported in this version. Please use host + username with Agent/Key/Password authentication.",agentUnavailable:"SSH Agent unavailable: SSH_AUTH_SOCK not detected. Please check agent environment.",agentNoIdentity:"SSH Agent has no available keys. Please run ssh-add first.",agentNoIdentities:"SSH Agent has no available keys. Please run ssh-add first.",authFailed:"Authentication failed: incorrect username, password, or key. Please check device configuration.",authFailedGeneric:"Authentication failed: incorrect username, password, or key. Please check device configuration.",networkUnreachable:"Network unreachable: Please check routing, firewall, or VPN configuration.",connectionRefused:"Connection refused: Unable to connect to target host. Please check host address and port.",timeout:"Connection timeout: Unable to connect to device. Please check network or firewall settings.",connectionTimeout:"Connection timeout: Unable to connect to device. Please check network or firewall settings.",hostNotFound:"Host not found: Unable to resolve hostname. Please check DNS or hostname configuration.",handshakeFailed:"Handshake failed: Unable to establish secure connection. Possibly incompatible key exchange algorithm.",tmuxUnavailable:"Remote tmux unavailable or failed to start. Please ensure tmux is installed and available in the remote shell PATH.",connectionClosed:"Connection closed, attempting to reconnect",unknown:"Connection failed: {{message}}",reconnecting:"Connection interrupted, reconnecting in {{delay}} seconds ({{attempt}}/{{maxRetries}})",reconnectFailed:"Auto-reconnect failed, please retry manually",reconnected:"Device reconnected automatically"},deviceStatus:{reconnecting:"Reconnecting {{delay}}s",offline:"Offline",errorBadge:{authFailed:"Auth failed",agentUnavailable:"Agent unavailable",agentNoIdentity:"Agent has no keys",configRefNotSupported:"SSH Config unsupported",networkUnreachable:"Network unreachable",connectionRefused:"Refused",timeout:"Timeout",hostNotFound:"Host not found",handshakeFailed:"Handshake failed",tmuxUnavailable:"Tmux unavailable",connectionClosed:"Disconnected",unknown:"Connection error"}},websocket:{error:"WebSocket connection error",checkGateway:"Please check Gateway status",upgradeFailed:"Upgrade failed",invalidMessage:"Invalid message format"},wsError:{checkGateway:"Please check Gateway status"},apiError:{siteNameRequired:"Site name cannot be empty",siteUrlInvalid:"Site URL must start with http:// or https://",bellThrottleInvalid:"Bell throttle seconds must be between 0-300",sshRetriesInvalid:"SSH reconnect retries must be between 0-20",sshDelayInvalid:"SSH reconnect delay must be between 1-300 seconds",languageInvalid:"Language must be one of the supported locales",botNameRequired:"Bot name cannot be empty",botTokenRequired:"Bot token cannot be empty",missingFields:"Missing required fields",sshRequiresHost:"SSH device requires host or sshConfigRef",invalidRequest:"Invalid request",deviceNotFound:"Device not found",botNotFound:"Bot not found",chatNotFound:"Chat not found",urlAndSecretRequired:"URL and secret are required",notFound:"Not found",llmProviderNameRequired:"Provider name cannot be empty",llmProviderProtocolInvalid:"Protocol must be openai-chat or openai-responses",llmProviderBaseUrlInvalid:"Base URL must start with http:// or https://",llmProviderApiKeyRequired:"API key cannot be empty",llmProviderNotFound:"LLM provider not found",llmProviderDisabled:"LLM provider {{name}} is disabled",llmNoDefaultProvider:"No LLM provider specified and no default provider configured",llmNoDefaultModel:"No model specified and no default model configured",llmDefaultProviderNotFound:"Default provider does not exist",llmSearchProviderInvalid:"Search provider must be none, tavily or brave",llmFetchModelsFailed:"Failed to fetch model list: {{detail}}",agentSessionNotFound:"Agent session not found",agentSessionBusy:"Agent session is currently running, stop it or wait for completion",agentSessionAwaitingConfirmation:"Agent session has pending confirmations, resolve them first",agentDeviceRequired:"Device is required",agentPaneRequired:"Terminal pane is required",agentWriteModeInvalid:"Write mode must be confirm or auto",agentMaxStepsInvalid:"Max steps per turn must be between 1 and 100",agentProviderWebSearchRequiresResponses:"Provider built-in web search requires the openai-responses protocol",agentHostedToolUnknown:"Unknown hosted tool: {{name}}",agentHostedToolRequiresResponses:"Provider hosted tools require the openai-responses protocol",agentSessionOrphaned:"This agent session is orphaned (its terminal is gone) and is read-only",agentQueuedMessageNotFound:"Queued message not found",agentConfirmationNotFound:"Confirmation not found",agentConfirmationAlreadyDecided:"Confirmation has already been decided",agentMessageTextRequired:"Message text is required",watchRuleNotFound:"Watch rule not found",watchNameRequired:"Rule name is required",watchTriggerTypeInvalid:"Trigger type must be match, unchanged or llm",watchPatternRequired:"match/unchanged rules require a regular expression",watchPatternInvalid:"Invalid regular expression: {{detail}}",watchUnchangedMinutesInvalid:"unchanged rules require unchangedMinutes greater than 0",watchExtractGroupInvalid:"Capture group index must be an integer >= 0",watchConditionPromptRequired:"llm rules require a condition prompt",watchIntervalInvalid:"Sampling interval must be at least {{min}} seconds",watchNoMatchBehaviorInvalid:"No-match behavior must be reset or ignore",watchFireModeInvalid:"Fire mode must be once or repeat",watchCooldownInvalid:"Cooldown seconds must be an integer >= 0",watchAssistDescriptionRequired:"Please describe what to match",watchAssistModelUnavailable:"Model call failed: {{detail}}",fileRootInvalid:"Path must be an absolute, existing directory",fileOutsideRoots:"Path is outside the allowed directories",fileNotADirectory:"Not a directory",fileTooLarge:"File is too large",fileBinary:"Binary files are not supported",fileRootDeviceInvalid:"Invalid or unknown device",fileRootDuplicate:"This directory is already added for the device"},notification:{clickToJump:"Click to jump to corresponding pane",eventType:{terminal_bell:"🔔 Terminal Bell",terminal_notification:"🔔 Terminal Notification",tmux_window_close:"🪟 Window Closed",tmux_pane_close:"📱 Pane Closed",device_tmux_missing:"⚠️ Tmux Missing",device_disconnect:"🔌 Device Disconnected",session_created:"🆕 Session Created",session_closed:"🚪 Session Closed",agent_confirmation_pending:"🤖 Agent Confirmation Pending",agent_turn_finished:"🤖 Agent Turn Finished",agent_error:"🤖 Agent Error",watch_triggered:"👁️ Watch Rule Triggered",watch_model_unavailable:"👁️ Watch Model Unavailable",watch_rule_error:"👁️ Watch Rule Error"},site:"Site",device:"Device",window:"Window",pane:"Pane",time:"Time",directLink:"Direct Link",message:"Message",paneTitle:"Title",process:"Process",telegramBell:{title:"🔔 Bell from {{siteName}}: {{terminalTopbarLabel}}",viewLink:"Click to view",terminalTopbarLabel:"Window {{window}} · Pane {{pane}} @ {{device}}"},telegramNotification:{},agent:{confirmationPending:'Agent "{{title}}" requests to run tool {{toolName}}, awaiting confirmation',turnFinished:'Agent "{{title}}" turn finished',error:'Agent "{{title}}" error: {{message}}'},watch:{matchTriggered:'Watch "{{name}}" matched: {{text}}',unchangedTriggered:'Watch "{{name}}" value "{{value}}" has been unchanged for {{minutes}} minutes',llmTriggered:'Watch "{{name}}" condition met: {{reason}}',summaryTriggered:'Watch "{{name}}": {{summary}}',unconfirmedSuffix:" (model unavailable, not LLM-confirmed)",modelUnavailable:'Watch "{{name}}" model call failed: {{message}}',ruleError:'Watch "{{name}}" failed {{count}} times in a row and has been disabled: {{message}}',paneGone:'Watch "{{name}}" pane ({{paneId}}) was destroyed; the rule has been removed'}},sidebar:{noWindows:"No windows",noDevices:"No devices",addDeviceLink:"Add Device",openSettingsLink:"Open Settings",openSettings:"Open Settings",manageDevices:"Manage Devices",settings:"Settings",currentWindow:"Current Window",currentPane:"Current Pane",newWindow:"Create Window",closeWindow:"Close Window",closePane:"Close Pane",addDevice:"Add Device",tab:{panes:"Panes",agent:"Agent",files:"Files"},orphanedSessions:"Orphaned sessions"},agent:{error:{streamStalled:"The model stopped responding (upstream stream stalled). Please retry."},model:{select:"Select model",placeholder:"Model",noProviders:"No models — configure a provider in Settings"},queue:{title:"Queued ({{count}})",steer:"Steer now",steerHint:"Interrupt the current step and inject the queue now",withdraw:"Withdraw"},orphan:{readonly:"This session is orphaned (its terminal is gone) — read-only",title:"Orphaned",process:"Process",startedAt:"Started"},files:{comingSoon:"Coming Soon"},panel:{title:"Agent",empty:"Select or create a session",inputPlaceholder:"Type a message…",send:"Send",stop:"Stop",retry:"Retry",scrollToBottom:"Scroll to bottom"},welcome:{title:"New Agent chat",subtitle:"Describe your task to start working in the selected terminal"},session:{none:"No session selected",new:"New agent session",switch:"Switch session",selectPaneHint:"Select a pane in the Panes tab to start a session",noSessions:"No sessions yet",showAll:"Show all sessions",rename:"Rename session",renameTitle:"Rename session",renamePlaceholder:"Session title",save:"Save",cancel:"Cancel",delete:"Delete session",deleteTitle:"Delete this session?",deleteDesc:'"{{title}}" and all its messages will be permanently deleted.',deleteConfirm:"Delete",createDisabledNoPane:"Open a terminal pane to create a session",privacyNotice:"Sessions send terminal screen content to the configured LLM service."},binding:{invalid:"Pane unavailable",mismatchTitle:"This session is bound to a different pane",goTo:"Go to pane",rebind:"Rebind here"},writeMode:{confirm:"Confirm writes",auto:"Auto execute"},confirm:{title:"Approval required",approve:"Allow",deny:"Deny"},tool:{input:"Input",result:"Result",screen:"Screen capture",send_input:"Send input",read_screen:"Read screen",web_search:"Web search",fetch_url:"Fetch URL",denied:"Denied"},reasoning:{title:"Reasoning"},toast:{errorTitle:'Agent "{{title}}" error',credentialWarningTitle:"Message may contain credentials",credentialWarningDescription:"Detected {{types}}. The content is not modified, but it will be sent to the LLM and stored — risk of leakage."}},window:{noWindows:"No windows",new:"New Window",close:"Close window",closePane:"Close pane",closeConfirmTitle:"Close this window?",closePaneConfirmTitle:"Close this pane?",closeConfirmDesc:'Processes running in "{{name}}" will be terminated. This action cannot be undone.',menu:"Window actions",dragHandle:"Drag to reorder window",dragHandlePane:"Drag to reorder pane",rename:"Rename window",renamePlaceholder:"Enter a name",renameDesc:"The custom name overrides the title set by the terminal and is kept until the gateway restarts.",renameReset:"Use automatic name"},watch:{title:"Watch rules",dialogDesc:"Monitor this pane's screen and get notified when conditions are met",openMonitor:"Watch this pane",rules:{empty:"No watch rules for this pane yet",addRule:"New rule",edit:"Edit",delete:"Delete",viewState:"Status",lastTriggered:"Last triggered: {{time}}",neverTriggered:"Never triggered",deleteTitle:"Delete this rule?",deleteDesc:'"{{name}}" will be permanently deleted.',deleteConfirm:"Delete"},type:{match:"Match",unchanged:"Stuck",llm:"LLM"},typeDesc:{match:"Trigger when a regex matches the screen",unchanged:"Trigger when an extracted value stays unchanged for N minutes (e.g. stalled download)",llm:"An LLM periodically checks the screen against a natural-language condition"},form:{createTitle:"New watch rule",editTitle:"Edit watch rule",name:"Rule name",namePlaceholder:"e.g. Download stalled",triggerType:"Trigger type",pattern:"Regular expression",patternPlaceholder:"e.g. (\\d+)%",flags:"Flags",flagsPlaceholder:"e.g. i",extractGroup:"Capture group index",extractGroupHint:"0 = whole match; the group value is tracked over time",unchangedMinutes:"Unchanged for (minutes)",noMatchBehavior:"When nothing matches",noMatchReset:"Reset timer (progress line gone = task done)",noMatchIgnore:"Ignore (keep last value)",conditionPrompt:"Condition (natural language)",conditionPromptPlaceholder:"e.g. The build has failed with a compile error",model:"Model",followGlobalDefault:"Follow global default",modelPlaceholder:"Model ID",modelRequiredHint:"This rule calls an LLM. Make sure the selected (or global default) model is available.",confirmWithLlm:"LLM double-check before notifying",confirmWithLlmDesc:"Reduce false positives; fails open if the model is unavailable",summarizeWithLlm:"LLM notification summary",summarizeWithLlmDesc:"Summarize the screen into the notification text",intervalSeconds:"Sampling interval (seconds)",intervalHint:"Minimum {{min}}s",fireMode:"Fire mode",fireOnce:"Once (auto-disable after firing)",fireRepeat:"Repeat",cooldownSeconds:"Cooldown (seconds)",enabled:"Enabled",assistLabel:"Generate regex from a description",assistPlaceholder:"e.g. match the download progress percentage",assistButton:"Generate",assistExplanation:"Explanation",assistPreview:"Matches on current screen",assistPreviewEmpty:"No matches on the current screen sample",create:"Create",save:"Save",providerUnavailable:"Original provider unavailable",providerDisabled:"disabled"},validation:{nameRequired:"Rule name is required",patternRequired:"Regular expression is required",patternInvalid:"Invalid regular expression: {{detail}}",unchangedMinutesInvalid:"Unchanged minutes must be greater than 0",conditionPromptRequired:"Condition prompt is required",intervalMin:"Sampling interval must be at least {{min}} seconds"},state:{title:"Rule status",back:"Back",lastSampledAt:"Last sampled",lastValue:"Last value",lastValueChangedAt:"Value last changed",lastTriggeredAt:"Last triggered",consecutiveErrors:"Consecutive errors",lastError:"Last error",samples:"Recent samples",samplesEmpty:"No samples yet",hit:"hit",none:"—"},toast:{created:"Watch rule created",updated:"Watch rule updated",deleted:"Watch rule deleted",triggeredTitle:"Watch triggered",openTerminal:"Open terminal",modelUnavailableTitle:"Watch model unavailable",modelUnavailableHint:"The rule keeps running with degraded behavior.",ruleErrorTitle:"Watch rule auto-disabled"},notifPermission:{title:"Enable browser notifications?",desc:"Get notified when watch rules trigger, even when this tab is in the background.",enable:"Enable",dismiss:"Not now"}},validation:{deviceNameRequired:"Device name is required",hostRequired:"Host is required for SSH devices"},files:{title:"Files",refresh:"Refresh file list",noRoots:"No accessible directories. Add one in Settings → Files.",emptyDir:"Empty",truncated:"Too many items — list truncated",download:"Download",error:{invalid:"Invalid request",outside_roots:"Path is outside the allowed directory",not_found:"No longer exists",not_a_directory:"Not a directory",is_directory:"This is a directory",too_large:"File is too large to preview",binary:"Binary file cannot be previewed",permission_denied:"Permission denied",device_not_found:"Device not found",root_not_found:"Directory entry not found",root_disabled:"This directory is disabled",connection_failed:"Failed to connect to the device",auth_unsupported:"Device auth method unsupported for files (use key or ssh-agent)",rsync_missing_local:"rsync is not installed on the server",rsync_missing_remote:"rsync is not installed on the remote device",timeout:"Timed out",unknown:"Failed to load"},retry:"Retry (collapse then expand)",install:{button:"Install rsync",scopeLocal:"server",scopeRemote:"remote",connectFailed:"Failed to connect to the device",windowFailed:"Failed to create a window",prompt:"rsync is not installed on {{device}} ({{scope}}). Please install rsync using the appropriate command for this system (e.g. `brew install rsync`, `sudo apt-get install -y rsync`, or `sudo yum install -y rsync`), then reply once it is done."}},file:{invalidRef:"Invalid file reference",notFound:"File no longer exists",accessDenied:"Access denied",loadFailed:"Failed to load file",isDirectory:"This is a directory",notPreviewable:"Preview is not available for this file type",tooLarge:"File is too large to preview",binary:"Binary file cannot be previewed",download:"Download",openRaw:"Open raw"}}},zh_CN:{translation:{common:{loading:"加载中...",save:"保存",saving:"保存中...",cancel:"取消",add:"添加",delete:"删除",edit:"修改",confirm:"确认",close:"关闭",expand:"展开",collapse:"收起",refresh:"刷新",test:"测试",send:"发送",success:"成功",error:"错误",warning:"警告",info:"信息",yes:"是",no:"否",enabled:"已启用",disabled:"已禁用",pending:"待授权",authorized:"已授权",unknown:"未知",empty:"空",none:"无",default:"默认",optional:"可选",required:"必填",pwaInstallTitle:"安装为应用",pwaInstallHintIOSSafari:"iOS Safari 不会自动弹出安装提示。请点击「分享」,再选择「添加到主屏幕」。",pwaInstallHintIOSChrome:"iOS Chrome 不会自动弹出安装提示。请点击「分享」,再选择「添加到主屏幕」"},nav:{manageDevices:"管理设备",settings:"设置",sidebarExpand:"展开侧边栏",sidebarCollapse:"收起侧边栏",openSidebar:"打开侧边栏",closeSidebar:"关闭侧边栏",jumpToLatest:"跳转到最新",switchToEditor:"切换到编辑器输入",switchToDirect:"切换到直接输入",refreshPage:"刷新页面",refreshPageConfirm:"确定要刷新页面吗?未保存的内容将会丢失。"},device:{title:"设备管理",devices:"设备",addDevice:"添加设备",addDeviceDescription:"填写设备信息并选择连接方式",addFirstDevice:"添加第一个设备",editDevice:"修改设备",editDeviceDescription:"更新设备配置",sectionBasic:"基本信息",sectionConnection:"连接信息",sectionAuth:"认证信息",noDevices:"暂无设备",noDevicesDescription:"添加本地或 SSH 设备开始使用",name:"设备名称",namePlaceholder:"例如:我的服务器",type:"类型",typeLocal:"本地设备",typeSSH:"SSH 远程设备",typeSSHBadge:"SSH",host:"主机",hostPlaceholder:"example.com",port:"端口",username:"用户名",usernamePlaceholder:"root",session:"Tmux 会话名称",sessionPlaceholder:"tmex",sessionHint:'留空将使用默认值 "tmex"',authMode:"认证方式",authPassword:"密码",authKey:"私钥",authAgent:"SSH Agent",authConfigRef:"SSH Config",password:"密码",privateKey:"私钥",privateKeyPlaceholder:"-----BEGIN OPENSSH PRIVATE KEY-----",privateKeyPassphrase:"私钥密码(可选)",passphrase:"私钥密码(可选)",connect:"连接",connected:"已连接",disconnect:"断开",disconnected:"已断开",connecting:"连接中...",dragHandle:"拖动以调整设备顺序",reorderFailed:"设备排序失败",deleteConfirm:"删除此设备?",deleteDescription:'设备 "{{name}}" 将被永久移除,此操作无法撤销。',deleteSuccess:"设备已删除",createSuccess:"设备已创建",updateSuccess:"设备已更新",deleteFailed:"删除设备失败",createFailed:"创建设备失败",updateFailed:"更新设备失败",loadFailed:"加载设备列表失败",localDevice:"本地设备",subtitle:"{{username}}@{{host}}:{{port}}",modify:"修改设备",delete:"删除"},terminal:{initializing:"初始化终端...",connecting:"连接设备...",initFailed:"终端初始化失败",inputPlaceholder:"在此输入命令...",clear:"清空",deviceError:"设备错误",deviceErrorWithType:"[{{type}}] 设备错误",noDeviceSelected:"未选择设备",windowClosed:"当前窗口已关闭,请在侧边栏重新选择窗口。",paneClosed:"当前 Pane 已关闭,请在侧边栏重新选择 Pane。",bellNotification:"终端 Bell 提醒",bellDescription:"窗口 {{window}} · Pane {{pane}}",bellFallback:"收到 tmux bell",paneTitle:"Pane {{index}}",activePane:"当前 pane",activeWindow:"当前窗口",editorPlaceholder:"在此输入命令...",editorClear:"清空",editorSendWithEnter:"发送附带回车",editorSendLineByLine:"逐行发送",editorSend:"发送",sendShortcut:"发送 {{key}}",inputModeDirect:"直接输入",inputModeEditor:"编辑器",newWindow:"新建窗口",closeWindow:"关闭窗口",closePane:"关闭 pane",copy:"复制",paste:"粘贴",copied:"已复制到剪贴板",copyFailed:"复制失败",pasteFailed:"无法读取剪贴板,请检查浏览器权限",clearSelection:"取消选择"},settings:{title:"系统设置",siteSettings:"站点设置",siteName:"站点名称",siteNamePlaceholder:"tmex",siteUrl:"站点访问 URL",siteUrlPlaceholder:"http://localhost:3000",bellThrottle:"Bell 频控(秒)",notificationThrottle:"通知频控(秒)",enableBrowserBellToast:"开启浏览器 Bell Toast",enableBrowserNotificationToast:"开启浏览器通知 Toast",enableTelegramBellPush:"开启 Telegram Bell 推送",enableTelegramNotificationPush:"开启 Telegram 通知推送",sshReconnectRetries:"SSH 重连次数",sshReconnectDelay:"SSH 重连等待(秒)",language:"语言",languagePlaceholder:"选择语言",language_en_US:"English",language_zh_CN:"简体中文",language_ja_JP:"日本語",theme:"主题",themeLight:"浅色",themeDark:"深色",siteTab:"站点",notificationsTab:"通知",refreshToApply:"刷新后生效",saveSettings:"保存设置",settingsSaved:"站点设置已保存",saveFailed:"保存设置失败",loadFailed:"加载设置失败",restartGateway:"重启 Gateway",restartScheduled:"Gateway 重启请求已发送",restartConfirm:"确定要重启 Gateway 吗?这将中断所有活动连接。",restartFailed:"重启请求失败",sshReconnectMaxRetries:"SSH 重连次数",llm:{title:"LLM 提供商",name:"名称",namePlaceholder:"如 OpenAI",baseUrl:"Base URL",baseUrlPlaceholder:"https://api.openai.com",baseUrlHint:"默认自动补全 /v1;以 / 结尾则按原路径不补 /v1",protocol:"协议",apiKey:"API Key",apiKeyPlaceholder:"输入 API Key",apiKeySetPlaceholder:"已设置,留空不修改",addProvider:"添加提供商",editProvider:"编辑供应商",formHint:"配置供应商连接信息",models:"模型",modelsTitle:"{{name}} 的模型",modelsHint:"管理该供应商可用的模型,启停与手动添加",modelManual:"手动",addModelPlaceholder:"添加模型 ID",empty:"暂无提供商",refreshModels:"刷新模型",modelsCount:"{{total}} 个模型",modelsNotFetched:"尚未获取模型列表",modelsFetchFailed:"模型列表获取失败:{{error}}",deleteProvider:"删除提供商",deleteConfirm:"确定要删除提供商「{{name}}」吗?",defaults:"全局默认",defaultProvider:"默认提供商",defaultProviderNone:"未设置",defaultModel:"默认模型",defaultModelPlaceholder:"输入或选择模型 ID",saveDefaults:"保存默认设置",loadFailed:"加载 LLM 提供商失败",createFailed:"创建提供商失败",updateFailed:"更新提供商失败",deleteFailed:"删除提供商失败",refreshModelsFailed:"刷新模型失败",settingsLoadFailed:"加载 LLM 设置失败",settingsSaveFailed:"保存 LLM 设置失败"},search:{title:"搜索",provider:"搜索提供商",providerNone:"不启用",tavilyApiKey:"Tavily API Key",braveApiKey:"Brave API Key",keyPlaceholder:"输入 API Key",keySetPlaceholder:"已设置,留空不修改",clearKey:"清除",clearKeyConfirm:"确定要清除此 API Key 吗?清除后需要重新填写。",loadFailed:"加载搜索设置失败",saveFailed:"保存搜索设置失败"},files:{title:"文件",description:"配置各设备下可在「文件」标签页浏览的目录。本地设备直接读取,SSH 设备走 rsync。",addRoot:"添加目录",roots:"目录",empty:"尚未配置任何目录",missing:"设备已失效",modalAddTitle:"添加目录",modalEditTitle:"编辑目录",device:"设备",devicePlaceholder:"选择设备",noDevices:"还没有设备,请先添加设备",path:"路径",pathPlaceholder:"/绝对路径/到/目录",pathHint:"所选设备上的绝对路径。",enabled:"启用",addFailed:"添加目录失败",updateFailed:"更新目录失败",deleteFailed:"移除目录失败",toggleFailed:"更新目录失败",deleteTitle:"移除目录?",deleteDesc:"将「{{path}}」移出白名单?该目录下的文件将不再可访问。"}},telegram:{title:"Telegram Bot 管理",botName:"Bot 名称",botNamePlaceholder:"如:ops-bot",botToken:"Bot Token",botTokenPlaceholder:"123456:AA...",addBot:"新增 Bot",enableBot:"启用 Bot",allowAuthRequests:"允许申请授权",pendingChats:"待授权",chats:"已授权",authorizedChats:"已授权",noPendingChats:"暂无待授权 chat",noAuthorizedChats:"暂无已授权 chat",approve:"批准",authorize:"授权",reject:"拒绝",revokeAuth:"撤销授权",testMessage:"测试消息",sendTestMessage:"发送测试消息",deleteBot:"删除 Bot",tokenOptional:"Token(留空不改)",tokenPlaceholder:"输入新 token",botCreated:"Bot 已创建",botUpdated:"Bot 已更新",botDeleted:"Bot 已删除",authApproved:"授权已批准",chatRemoved:"chat 已移除",testMessageSent:"测试消息已发送",createFailed:"新增 Bot 失败",updateFailed:"更新 Bot 失败",deleteFailed:"删除 Bot 失败",approveFailed:"批准授权失败",removeFailed:"删除 chat 失败",testMessageFailed:"发送测试消息失败",loadBotsFailed:"加载 Bot 列表失败",loadChatsFailed:"加载 chat 列表失败",noBots:"暂无 Bot,先添加一个。",expand:"展开",collapse:"收起",authCount:"已授权 {{authorized}} / 待授权 {{pending}}(总上限 8)",chatId:"chatId",applyTime:"申请时间",gatewayOnline:"🟢 Gateway online @ {{siteName}}",deviceConnectionError:`🔴 {{siteName}}:设备「{{deviceName}}」({{host}}) 连接异常 [{{category}}]
76
+ {{error}}`,agentCredentialWarning:"⚠️ {{siteName}}:Agent 会话「{{sessionTitle}}」的一条消息疑似包含凭证({{types}})。该内容将发送至 LLM 并存储,存在泄露风险。",authSuccess:"✅ 已授权,可接收通知。",authPending:"⏳ 已收到授权申请,请在 tmex 设置页审批。",authFailed:"❌ 授权申请失败,请联系管理员。",testMessageTemplate:`🧪 测试消息
77
+ 站点:{{siteName}}
78
+ 时间:{{time}}`,approveMessageTemplate:`✅ 已通过 tmex 授权。
79
+ Bot:{{botName}}
80
+ 时间:{{time}}`,botNotFound:"Bot 未启动或不可用",botNotRunning:"Bot 未启动或不可用"},webhook:{title:"Webhooks",url:"Webhook 地址",secret:"密钥",secretPlaceholder:"用于签名(HMAC-SHA256)",enabled:"启用",eventMask:"事件",add:"添加 Webhook",empty:"暂无 Webhook。",createFailed:"创建 Webhook 失败",deleteFailed:"删除 Webhook 失败",loadFailed:"加载 Webhook 失败"},sshError:{sshConfigRefNotSupported:"当前版本暂不支持 SSH Config 引用,请改为填写 host + username,并选择 Agent/私钥/密码认证",configRefNotSupported:"当前版本暂不支持 SSH Config 引用,请改为填写 host + username,并选择 Agent/私钥/密码认证",agentUnavailable:"SSH Agent 不可用:未检测到 SSH_AUTH_SOCK,请检查 agent 环境",agentNoIdentity:"SSH Agent 未加载可用密钥,请先执行 ssh-add",agentNoIdentities:"SSH Agent 未加载可用密钥,请先执行 ssh-add",authFailed:"认证失败:用户名、密码或密钥不正确,请检查设备配置",authFailedGeneric:"认证失败:用户名、密码或密钥不正确,请检查设备配置",networkUnreachable:"网络不可达:请检查路由、防火墙或 VPN 配置",connectionRefused:"连接被拒绝:无法连接到目标主机,请检查主机地址和端口是否正确",timeout:"连接超时:无法连接到设备,请检查网络或防火墙设置",connectionTimeout:"连接超时:无法连接到设备,请检查网络或防火墙设置",hostNotFound:"主机未找到:无法解析主机地址,请检查 DNS 或主机名是否正确",handshakeFailed:"握手失败:无法建立安全连接,可能是密钥交换算法不兼容",tmuxUnavailable:"远端 tmux 不可用或启动失败,请检查远端是否已安装 tmux,且远端 shell PATH 可找到 tmux",connectionClosed:"连接已断开,尝试重连中",unknown:"连接失败:{{message}}",reconnecting:"连接中断,{{delay}} 秒后自动重连({{attempt}}/{{maxRetries}})",reconnectFailed:"自动重连失败,请手动重试",reconnected:"设备已自动重连"},deviceStatus:{reconnecting:"重连中 {{delay}}s",offline:"离线",errorBadge:{authFailed:"认证失败",agentUnavailable:"Agent 不可用",agentNoIdentity:"Agent 无密钥",configRefNotSupported:"不支持 SSH Config",networkUnreachable:"网络不可达",connectionRefused:"连接被拒",timeout:"连接超时",hostNotFound:"主机未找到",handshakeFailed:"握手失败",tmuxUnavailable:"tmux 不可用",connectionClosed:"连接已断开",unknown:"连接异常"}},websocket:{error:"WebSocket 连接错误",checkGateway:"请检查 Gateway 状态",upgradeFailed:"Upgrade failed",invalidMessage:"Invalid message format"},wsError:{checkGateway:"请检查 Gateway 状态"},apiError:{siteNameRequired:"站点名称不能为空",siteUrlInvalid:"站点 URL 必须以 http:// 或 https:// 开头",bellThrottleInvalid:"Bell 频控秒数需在 0-300 之间",sshRetriesInvalid:"SSH 重连次数需在 0-20 之间",sshDelayInvalid:"SSH 重连等待时间需在 1-300 秒之间",languageInvalid:"语言必须是受支持的区域设置之一",botNameRequired:"Bot 名称不能为空",botTokenRequired:"Bot token 不能为空",missingFields:"缺少必填字段",sshRequiresHost:"SSH 设备需要 host 或 sshConfigRef",invalidRequest:"请求无效",deviceNotFound:"Device not found",botNotFound:"Bot 不存在",chatNotFound:"Chat 不存在",urlAndSecretRequired:"URL and secret required",notFound:"Not found",llmProviderNameRequired:"Provider 名称不能为空",llmProviderProtocolInvalid:"协议必须是 openai-chat 或 openai-responses",llmProviderBaseUrlInvalid:"Base URL 必须以 http:// 或 https:// 开头",llmProviderApiKeyRequired:"API key 不能为空",llmProviderNotFound:"LLM provider 不存在",llmProviderDisabled:"LLM provider {{name}} 已被禁用",llmNoDefaultProvider:"未指定 LLM provider 且未配置默认 provider",llmNoDefaultModel:"未指定模型且未配置默认模型",llmDefaultProviderNotFound:"默认 provider 不存在",llmSearchProviderInvalid:"搜索服务必须是 none、tavily 或 brave",llmFetchModelsFailed:"拉取模型列表失败:{{detail}}",agentSessionNotFound:"Agent 会话不存在",agentSessionBusy:"Agent 会话正在运行中,请先停止或等待完成",agentSessionAwaitingConfirmation:"Agent 会话有待处理的确认请求,请先处理",agentDeviceRequired:"必须指定设备",agentPaneRequired:"必须指定终端 pane",agentWriteModeInvalid:"写入模式必须是 confirm 或 auto",agentMaxStepsInvalid:"每回合最大步数必须在 1-100 之间",agentProviderWebSearchRequiresResponses:"Provider 内置搜索仅支持 openai-responses 协议",agentHostedToolUnknown:"未知的 hosted 工具:{{name}}",agentHostedToolRequiresResponses:"Provider hosted 工具仅支持 openai-responses 协议",agentSessionOrphaned:"该 Agent 会话已孤立(绑定终端已不存在),仅可只读查看",agentQueuedMessageNotFound:"排队消息不存在",agentConfirmationNotFound:"确认请求不存在",agentConfirmationAlreadyDecided:"确认请求已被处理",agentMessageTextRequired:"消息内容不能为空",watchRuleNotFound:"Watch 规则不存在",watchNameRequired:"规则名称不能为空",watchTriggerTypeInvalid:"触发类型必须是 match、unchanged 或 llm",watchPatternRequired:"match/unchanged 规则必须提供正则表达式",watchPatternInvalid:"正则表达式无效:{{detail}}",watchUnchangedMinutesInvalid:"unchanged 规则的未变化分钟数必须大于 0",watchExtractGroupInvalid:"捕获组序号必须是不小于 0 的整数",watchConditionPromptRequired:"llm 规则必须提供条件描述",watchIntervalInvalid:"采样间隔不能小于 {{min}} 秒",watchNoMatchBehaviorInvalid:"无命中行为必须是 reset 或 ignore",watchFireModeInvalid:"触发模式必须是 once 或 repeat",watchCooldownInvalid:"冷却秒数必须是不小于 0 的整数",watchAssistDescriptionRequired:"请描述要匹配的内容",watchAssistModelUnavailable:"模型调用失败:{{detail}}",fileRootInvalid:"路径必须是已存在的绝对目录",fileOutsideRoots:"路径不在允许的目录范围内",fileNotADirectory:"不是目录",fileTooLarge:"文件过大",fileBinary:"不支持二进制文件",fileRootDeviceInvalid:"无效或未知的设备",fileRootDuplicate:"该设备下已添加过此目录"},notification:{clickToJump:"点击跳转到对应 Pane",eventType:{terminal_bell:"🔔 终端 Bell",terminal_notification:"🔔 终端通知",tmux_window_close:"🪟 窗口关闭",tmux_pane_close:"📱 Pane 关闭",device_tmux_missing:"⚠️ Tmux 不可用",device_disconnect:"🔌 设备断开",session_created:"🆕 会话创建",session_closed:"🚪 会话关闭",agent_confirmation_pending:"🤖 Agent 等待确认",agent_turn_finished:"🤖 Agent 回合完成",agent_error:"🤖 Agent 错误",watch_triggered:"👁️ Watch 规则触发",watch_model_unavailable:"👁️ Watch 模型不可用",watch_rule_error:"👁️ Watch 规则错误"},site:"站点",device:"设备",window:"窗口",pane:"Pane",time:"时间",directLink:"直达",message:"信息",paneTitle:"标题",process:"进程",telegramBell:{title:"🔔 来自 {{siteName}} 的 Bell:{{terminalTopbarLabel}}",viewLink:"点击查看",terminalTopbarLabel:"窗口 {{window}} · Pane {{pane}} @ {{device}}"},telegramNotification:{},agent:{confirmationPending:"Agent「{{title}}」请求执行工具 {{toolName}},等待确认",turnFinished:"Agent「{{title}}」回合完成",error:"Agent「{{title}}」出错:{{message}}"},watch:{matchTriggered:"监控「{{name}}」命中:{{text}}",unchangedTriggered:"监控「{{name}}」的值「{{value}}」已 {{minutes}} 分钟未变化",llmTriggered:"监控「{{name}}」条件满足:{{reason}}",summaryTriggered:"监控「{{name}}」:{{summary}}",unconfirmedSuffix:"(模型不可用,未经 LLM 二次确认)",modelUnavailable:"监控「{{name}}」模型调用失败:{{message}}",ruleError:"监控「{{name}}」连续失败 {{count}} 次,已自动停用:{{message}}",paneGone:"监控「{{name}}」的 Pane({{paneId}})已销毁,规则已自动删除"}},sidebar:{noWindows:"暂无窗口",noDevices:"暂无设备",addDeviceLink:"添加设备",openSettingsLink:"打开设置",openSettings:"打开设置",manageDevices:"管理设备",settings:"设置",currentWindow:"当前窗口",currentPane:"当前 pane",newWindow:"新建窗口",closeWindow:"关闭窗口",closePane:"关闭 pane",addDevice:"添加设备",tab:{panes:"Panes",agent:"Agent",files:"Files"},orphanedSessions:"孤立会话"},agent:{error:{streamStalled:"模型停止响应(上游流无响应),请重试。"},model:{select:"选择模型",placeholder:"模型",noProviders:"暂无模型 — 请先在设置中配置供应商"},queue:{title:"队列({{count}})",steer:"立即注入",steerHint:"中断当前步骤并立即注入队列",withdraw:"撤回"},orphan:{readonly:"该会话已孤立(绑定终端已不存在),仅可只读查看",title:"孤立会话",process:"进程",startedAt:"创建于"},files:{comingSoon:"Coming Soon"},panel:{title:"Agent",empty:"选择或创建一个会话",inputPlaceholder:"输入消息…",send:"发送",stop:"停止",retry:"重试",scrollToBottom:"回到底部"},welcome:{title:"新建 Agent 对话",subtitle:"向 Agent 描述你的需求,开始在所选终端中协作"},session:{none:"未选择会话",new:"新建 Agent 会话",switch:"切换会话",selectPaneHint:"请在 Panes 标签中选择一个 pane 来开启会话",noSessions:"暂无会话",showAll:"显示全部会话",rename:"重命名会话",renameTitle:"重命名会话",renamePlaceholder:"会话标题",save:"保存",cancel:"取消",delete:"删除会话",deleteTitle:"删除此会话?",deleteDesc:"“{{title}}”及其全部消息将被永久删除。",deleteConfirm:"删除",createDisabledNoPane:"请先打开一个终端 pane 再创建会话",privacyNotice:"会话将把终端屏幕内容发送给配置的 LLM 服务。"},binding:{invalid:"已失效",mismatchTitle:"此会话绑定的 pane 与当前终端不一致",goTo:"跳转过去",rebind:"重绑到当前"},writeMode:{confirm:"写入需确认",auto:"自动执行"},confirm:{title:"等待确认",approve:"允许",deny:"拒绝"},tool:{input:"输入",result:"结果",screen:"屏幕快照",send_input:"发送输入",read_screen:"读取屏幕",web_search:"网络搜索",fetch_url:"抓取网页",denied:"已拒绝"},reasoning:{title:"思考过程"},toast:{errorTitle:"Agent“{{title}}”出错",credentialWarningTitle:"消息疑似包含凭证",credentialWarningDescription:"检测到 {{types}}。内容不会被修改,但会发送至 LLM 并存储,存在泄露风险。"}},window:{noWindows:"暂无窗口",new:"新建窗口",close:"关闭窗口",closePane:"关闭面板",closeConfirmTitle:"关闭此窗口?",closePaneConfirmTitle:"关闭此面板?",closeConfirmDesc:'"{{name}}" 中运行的进程将被终止,此操作无法撤销。',menu:"窗口操作",dragHandle:"拖动以调整窗口顺序",dragHandlePane:"拖动以调整 pane 顺序",rename:"重命名窗口",renamePlaceholder:"输入名称",renameDesc:"自定义名称会覆盖终端设置的标题,并保留至 gateway 重启。",renameReset:"恢复自动名称"},watch:{title:"监控规则",dialogDesc:"监控该终端屏幕,条件满足时发送通知",openMonitor:"监控此终端",rules:{empty:"该终端还没有监控规则",addRule:"新建规则",edit:"编辑",delete:"删除",viewState:"状态",lastTriggered:"最近触发:{{time}}",neverTriggered:"从未触发",deleteTitle:"删除该规则?",deleteDesc:"“{{name}}”将被永久删除。",deleteConfirm:"删除"},type:{match:"匹配",unchanged:"卡住",llm:"LLM"},typeDesc:{match:"正则命中屏幕内容时触发",unchanged:"提取值连续 N 分钟不变时触发(如下载卡住)",llm:"由 LLM 周期查看屏幕并判断自然语言条件"},form:{createTitle:"新建监控规则",editTitle:"编辑监控规则",name:"规则名称",namePlaceholder:"如:下载卡住提醒",triggerType:"触发类型",pattern:"正则表达式",patternPlaceholder:"如:(\\d+)%",flags:"标志",flagsPlaceholder:"如:i",extractGroup:"捕获组序号",extractGroupHint:"0 = 整个匹配;该组的值将被持续跟踪",unchangedMinutes:"不变持续(分钟)",noMatchBehavior:"无命中时",noMatchReset:"重置计时(进度行消失视为任务结束)",noMatchIgnore:"忽略(保留上次值)",conditionPrompt:"条件(自然语言)",conditionPromptPlaceholder:"如:构建因编译错误而失败",model:"模型",followGlobalDefault:"跟随全局默认",modelPlaceholder:"模型 ID",modelRequiredHint:"该规则会调用 LLM,请确保所选(或全局默认)模型可用。",confirmWithLlm:"通知前 LLM 二次确认",confirmWithLlmDesc:"减少误报;模型不可用时直接通知",summarizeWithLlm:"LLM 生成通知摘要",summarizeWithLlmDesc:"由模型总结屏幕内容作为通知正文",intervalSeconds:"采样间隔(秒)",intervalHint:"最低 {{min}} 秒",fireMode:"触发模式",fireOnce:"单次(触发后自动停用)",fireRepeat:"重复",cooldownSeconds:"冷却时间(秒)",enabled:"启用",assistLabel:"用描述生成正则",assistPlaceholder:"如:匹配下载进度百分比",assistButton:"生成",assistExplanation:"说明",assistPreview:"当前屏幕命中",assistPreviewEmpty:"当前屏幕样本无命中",create:"创建",save:"保存",providerUnavailable:"原提供商已不可用",providerDisabled:"已禁用"},validation:{nameRequired:"规则名称不能为空",patternRequired:"正则表达式不能为空",patternInvalid:"正则表达式无效:{{detail}}",unchangedMinutesInvalid:"不变持续分钟数必须大于 0",conditionPromptRequired:"条件描述不能为空",intervalMin:"采样间隔不能低于 {{min}} 秒"},state:{title:"规则状态",back:"返回",lastSampledAt:"最近采样",lastValue:"最近值",lastValueChangedAt:"值最近变化",lastTriggeredAt:"最近触发",consecutiveErrors:"连续错误次数",lastError:"最近错误",samples:"近期样本",samplesEmpty:"暂无样本",hit:"命中",none:"—"},toast:{created:"监控规则已创建",updated:"监控规则已更新",deleted:"监控规则已删除",triggeredTitle:"监控触发",openTerminal:"打开终端",modelUnavailableTitle:"监控模型不可用",modelUnavailableHint:"规则将以降级方式继续运行。",ruleErrorTitle:"监控规则已自动停用"},notifPermission:{title:"启用浏览器通知?",desc:"即使页面在后台,监控触发时也能收到通知。",enable:"启用",dismiss:"暂不"}},validation:{deviceNameRequired:"设备名称为必填项",hostRequired:"SSH 设备需要填写主机地址"},files:{title:"文件",refresh:"刷新文件列表",noRoots:"没有可访问的目录。请在「设置 → 文件」中添加。",emptyDir:"空目录",truncated:"条目过多,列表已截断",download:"下载",error:{invalid:"无效请求",outside_roots:"路径超出允许的目录范围",not_found:"已不存在",not_a_directory:"不是目录",is_directory:"这是一个目录",too_large:"文件过大,无法预览",binary:"二进制文件无法预览",permission_denied:"无访问权限",device_not_found:"设备不存在",root_not_found:"目录项不存在",root_disabled:"该目录已禁用",connection_failed:"连接设备失败",auth_unsupported:"该设备的认证方式不支持文件访问(请用密钥或 ssh-agent)",rsync_missing_local:"服务器上未安装 rsync",rsync_missing_remote:"远程设备上未安装 rsync",timeout:"已超时",unknown:"加载失败"},retry:"重试(收起后再展开)",install:{button:"安装 rsync",scopeLocal:"服务器",scopeRemote:"远程",connectFailed:"连接设备失败",windowFailed:"创建窗口失败",prompt:"设备 {{device}}({{scope}})上未检测到 rsync。请根据系统选择合适的命令安装 rsync(例如 `brew install rsync`、`sudo apt-get install -y rsync` 或 `sudo yum install -y rsync`),安装完成后回复我。"}},file:{invalidRef:"无效的文件引用",notFound:"文件已不存在",accessDenied:"无访问权限",loadFailed:"加载文件失败",isDirectory:"这是一个目录",notPreviewable:"该文件类型不支持预览",tooLarge:"文件过大,无法预览",binary:"二进制文件无法预览",download:"下载",openRaw:"打开原始文件"}}},ja_JP:{translation:{common:{loading:"読み込み中...",save:"保存",saving:"保存中...",cancel:"キャンセル",add:"追加",delete:"削除",edit:"編集",confirm:"確認",close:"閉じる",expand:"展開",collapse:"折りたたむ",refresh:"更新",test:"テスト",send:"送信",success:"成功",error:"エラー",warning:"警告",info:"情報",yes:"はい",no:"いいえ",enabled:"有効",disabled:"無効",pending:"保留中",authorized:"承認済み",unknown:"不明",empty:"空",none:"なし",default:"デフォルト",optional:"任意",required:"必須",pwaInstallTitle:"アプリとしてインストール",pwaInstallHintIOSSafari:"iOS Safari では自動的にインストールプロンプトが表示されません。共有ボタンをタップし、「ホーム画面に追加」を選択してください。",pwaInstallHintIOSChrome:"iOS Chrome では自動的にインストールプロンプトが表示されません。共有ボタンをタップし、「ホーム画面に追加」を選択してください。"},nav:{manageDevices:"デバイス管理",settings:"設定",sidebarExpand:"サイドバーを展開",sidebarCollapse:"サイドバーを折りたたむ",openSidebar:"サイドバーを開く",closeSidebar:"サイドバーを閉じる",jumpToLatest:"最新にジャンプ",switchToEditor:"エディタ入力に切り替え",switchToDirect:"直接入力に切り替え",refreshPage:"ページを更新",refreshPageConfirm:"ページを更新してもよろしいですか?保存されていない内容は失われます。"},device:{title:"デバイス管理",devices:"デバイス",addDevice:"デバイスを追加",addDeviceDescription:"デバイス情報を入力し、接続方法を選択してください",addFirstDevice:"最初のデバイスを追加",editDevice:"デバイスを編集",editDeviceDescription:"デバイス設定を更新",sectionBasic:"基本情報",sectionConnection:"接続情報",sectionAuth:"認証情報",noDevices:"デバイスがありません",noDevicesDescription:"ローカルまたは SSH デバイスを追加して開始",name:"デバイス名",namePlaceholder:"例:My Server",type:"タイプ",typeLocal:"ローカルデバイス",typeSSH:"SSH リモートデバイス",typeSSHBadge:"SSH",host:"ホスト",hostPlaceholder:"example.com",port:"ポート",username:"ユーザー名",usernamePlaceholder:"root",session:"Tmux セッション名",sessionPlaceholder:"tmex",sessionHint:"空の場合、デフォルトの「tmex」が使用されます",authMode:"認証モード",authPassword:"パスワード",authKey:"秘密鍵",authAgent:"SSH Agent",authConfigRef:"SSH Config",password:"パスワード",privateKey:"秘密鍵",privateKeyPlaceholder:"-----BEGIN OPENSSH PRIVATE KEY-----",privateKeyPassphrase:"秘密鍵のパスフレーズ(任意)",passphrase:"パスフレーズ",connect:"接続",connected:"接続済み",disconnect:"切断",disconnected:"切断済み",connecting:"接続中...",dragHandle:"ドラッグしてデバイスを並べ替え",reorderFailed:"デバイスの並べ替えに失敗しました",deleteConfirm:"このデバイスを削除しますか?",deleteDescription:"デバイス「{{name}}」は完全に削除されます。この操作は取り消せません。",deleteSuccess:"デバイスを削除しました",createSuccess:"デバイスを作成しました",updateSuccess:"デバイスを更新しました",deleteFailed:"デバイスの削除に失敗しました",createFailed:"デバイスの作成に失敗しました",updateFailed:"デバイスの更新に失敗しました",loadFailed:"デバイス一覧の読み込みに失敗しました",localDevice:"ローカルデバイス",subtitle:"{{username}}@{{host}}:{{port}}",modify:"デバイスを変更",delete:"削除"},terminal:{initializing:"ターミナルを初期化中...",connecting:"デバイスに接続中...",initFailed:"ターミナルの初期化に失敗しました",inputPlaceholder:"ここにコマンドを入力...",clear:"クリア",deviceError:"デバイスエラー",deviceErrorWithType:"[{{type}}] デバイスエラー",noDeviceSelected:"デバイスが選択されていません",windowClosed:"現在のウィンドウは閉じられました。サイドバーからウィンドウを選択してください。",paneClosed:"現在のペインは閉じられました。サイドバーからペインを選択してください。",bellNotification:"ターミナルベル通知",bellDescription:"ウィンドウ {{window}} · ペイン {{pane}}",bellFallback:"tmux ベルを受信",paneTitle:"ペイン {{index}}",activePane:"現在のペイン",activeWindow:"現在のウィンドウ",editorPlaceholder:"ここにコマンドを入力...",editorClear:"クリア",editorSendWithEnter:"Enter で送信",editorSendLineByLine:"1行ずつ送信",editorSend:"送信",sendShortcut:"{{key}} を送信",inputModeDirect:"直接入力",inputModeEditor:"エディタ",newWindow:"新規ウィンドウ",closeWindow:"ウィンドウを閉じる",closePane:"ペインを閉じる",copy:"コピー",paste:"貼り付け",copied:"クリップボードにコピーしました",copyFailed:"コピーに失敗しました",pasteFailed:"クリップボードを読み取れません。ブラウザの権限を確認してください",clearSelection:"選択を解除"},settings:{title:"システム設定",siteSettings:"サイト設定",siteName:"サイト名",siteNamePlaceholder:"tmex",siteUrl:"サイト URL",siteUrlPlaceholder:"http://localhost:3000",bellThrottle:"ベル制限(秒)",notificationThrottle:"通知制限(秒)",enableBrowserBellToast:"ブラウザベル Toast を有効にする",enableBrowserNotificationToast:"ブラウザ通知 Toast を有効にする",enableTelegramBellPush:"Telegram ベルプッシュを有効にする",enableTelegramNotificationPush:"Telegram 通知プッシュを有効にする",sshReconnectRetries:"SSH 再接続試行回数",sshReconnectDelay:"SSH 再接続待機(秒)",language:"言語",languagePlaceholder:"言語を選択",language_en_US:"English",language_zh_CN:"简体中文",language_ja_JP:"日本語",theme:"テーマ",themeLight:"ライト",themeDark:"ダーク",siteTab:"サイト",notificationsTab:"通知",refreshToApply:"言語変更を適用するには更新してください",saveSettings:"設定を保存",settingsSaved:"設定を保存しました",saveFailed:"設定の保存に失敗しました",loadFailed:"設定の読み込みに失敗しました",restartGateway:"Gateway を再起動",restartScheduled:"Gateway の再起動が予定されました",restartConfirm:"Gateway を再起動してもよろしいですか?すべてのアクティブ接続が中断されます。",restartFailed:"Gateway の再起動に失敗しました",sshReconnectMaxRetries:"SSH 再接続試行回数",llm:{title:"LLM プロバイダー",name:"名前",namePlaceholder:"例: OpenAI",baseUrl:"Base URL",baseUrlPlaceholder:"https://api.openai.com",baseUrlHint:"デフォルトで /v1 を自動補完。/ で終わるとパスをそのまま使用",protocol:"プロトコル",apiKey:"API キー",apiKeyPlaceholder:"API キーを入力",apiKeySetPlaceholder:"設定済み、空欄の場合は変更されません",addProvider:"プロバイダーを追加",editProvider:"プロバイダーを編集",formHint:"プロバイダーの接続を設定",models:"モデル",modelsTitle:"{{name}} のモデル",modelsHint:"このプロバイダーで利用するモデルを管理(有効化と手動追加)",modelManual:"手動",addModelPlaceholder:"モデル ID を追加",empty:"プロバイダーはまだありません",refreshModels:"モデルを更新",modelsCount:"{{total}} 個のモデル",modelsNotFetched:"モデル一覧は未取得です",modelsFetchFailed:"モデル一覧の取得に失敗しました:{{error}}",deleteProvider:"プロバイダーを削除",deleteConfirm:"プロバイダー「{{name}}」を削除しますか?",defaults:"グローバル既定",defaultProvider:"既定プロバイダー",defaultProviderNone:"未設定",defaultModel:"既定モデル",defaultModelPlaceholder:"モデル ID を入力または選択",saveDefaults:"既定を保存",loadFailed:"LLM プロバイダーの読み込みに失敗しました",createFailed:"プロバイダーの作成に失敗しました",updateFailed:"プロバイダーの更新に失敗しました",deleteFailed:"プロバイダーの削除に失敗しました",refreshModelsFailed:"モデルの更新に失敗しました",settingsLoadFailed:"LLM 設定の読み込みに失敗しました",settingsSaveFailed:"LLM 設定の保存に失敗しました"},search:{title:"検索",provider:"検索プロバイダー",providerNone:"無効",tavilyApiKey:"Tavily API キー",braveApiKey:"Brave API キー",keyPlaceholder:"API キーを入力",keySetPlaceholder:"設定済み、空欄の場合は変更されません",clearKey:"クリア",clearKeyConfirm:"この API キーをクリアしますか?再度入力が必要になります。",loadFailed:"検索設定の読み込みに失敗しました",saveFailed:"検索設定の保存に失敗しました"},files:{title:"ファイル",description:"「ファイル」タブで閲覧できるデバイスごとのディレクトリを設定します。ローカルは直接読み取り、SSH は rsync を使用。",addRoot:"ディレクトリを追加",roots:"ディレクトリ",empty:"ディレクトリが設定されていません",missing:"デバイスが見つかりません",modalAddTitle:"ディレクトリを追加",modalEditTitle:"ディレクトリを編集",device:"デバイス",devicePlaceholder:"デバイスを選択",noDevices:"デバイスがありません。先に追加してください",path:"パス",pathPlaceholder:"/絶対パス/ディレクトリ",pathHint:"選択したデバイス上の絶対パス。",enabled:"有効",addFailed:"ディレクトリの追加に失敗しました",updateFailed:"ディレクトリの更新に失敗しました",deleteFailed:"ディレクトリの削除に失敗しました",toggleFailed:"ディレクトリの更新に失敗しました",deleteTitle:"ディレクトリを削除しますか?",deleteDesc:"「{{path}}」をホワイトリストから削除しますか?配下のファイルにアクセスできなくなります。"}},telegram:{title:"Telegram Bot 管理",botName:"Bot 名",botNamePlaceholder:"例:ops-bot",botToken:"Bot Token",botTokenPlaceholder:"123456:AA...",addBot:"Bot を追加",enableBot:"Bot を有効にする",allowAuthRequests:"認証リクエストを許可",pendingChats:"承認待ち",chats:"承認済み",authorizedChats:"承認済み",noPendingChats:"承認待ちのチャットはありません",noAuthorizedChats:"承認済みのチャットはありません",approve:"承認",authorize:"認証",reject:"拒否",revokeAuth:"認証を取り消す",testMessage:"テストメッセージ",sendTestMessage:"テストメッセージを送信",deleteBot:"Bot を削除",tokenOptional:"Token(変更しない場合は空)",tokenPlaceholder:"新しい token を入力",botCreated:"Bot を作成しました",botUpdated:"Bot を更新しました",botDeleted:"Bot を削除しました",authApproved:"認証が承認されました",chatRemoved:"チャットを削除しました",testMessageSent:"テストメッセージを送信しました",createFailed:"Bot の作成に失敗しました",updateFailed:"Bot の更新に失敗しました",deleteFailed:"Bot の削除に失敗しました",approveFailed:"認証の承認に失敗しました",removeFailed:"チャットの削除に失敗しました",testMessageFailed:"テストメッセージの送信に失敗しました",loadBotsFailed:"Bot 一覧の読み込みに失敗しました",loadChatsFailed:"チャット一覧の読み込みに失敗しました",noBots:"Bot がありません。まず追加してください。",expand:"展開",collapse:"折りたたむ",authCount:"承認済み {{authorized}} / 承認待ち {{pending}}(最大 8)",chatId:"Chat ID",applyTime:"申請時間",gatewayOnline:"🟢 Gateway online @ {{siteName}}",deviceConnectionError:`🔴 {{siteName}}:デバイス「{{deviceName}}」({{host}}) で接続エラー [{{category}}]
81
+ {{error}}`,agentCredentialWarning:"⚠️ {{siteName}}:Agent セッション「{{sessionTitle}}」のメッセージに認証情報が含まれている可能性があります({{types}})。LLM に送信され保存されるため、漏洩のリスクがあります。",authSuccess:"✅ 承認されました。通知を受信できます。",authPending:"⏳ 認証リクエストを受信しました。tmex 設定ページで承認してください。",authFailed:"❌ 認証リクエストに失敗しました。管理者に連絡してください。",testMessageTemplate:`🧪 テストメッセージ
82
+ サイト:{{siteName}}
83
+ 時間:{{time}}`,approveMessageTemplate:`✅ tmex で承認されました。
84
+ Bot:{{botName}}
85
+ 時間:{{time}}`,botNotFound:"Bot が見つからないか利用できません",botNotRunning:"Bot が起動していないか利用できません"},webhook:{title:"Webhooks",url:"Webhook URL",secret:"シークレット",secretPlaceholder:"署名に使用(HMAC-SHA256)",enabled:"有効",eventMask:"イベント",add:"Webhook を追加",empty:"Webhook がありません。",createFailed:"Webhook の作成に失敗しました",deleteFailed:"Webhook の削除に失敗しました",loadFailed:"Webhook の読み込みに失敗しました"},sshError:{sshConfigRefNotSupported:"このバージョンでは SSH Config 参照はサポートされていません。host + username を使用し、Agent/秘密鍵/パスワード認証を選択してください。",configRefNotSupported:"このバージョンでは SSH Config 参照はサポートされていません。host + username を使用し、Agent/秘密鍵/パスワード認証を選択してください。",agentUnavailable:"SSH Agent が利用できません:SSH_AUTH_SOCK が検出されません。agent 環境を確認してください。",agentNoIdentity:"SSH Agent に利用可能な鍵がありません。ssh-add を実行してください。",agentNoIdentities:"SSH Agent に利用可能な鍵がありません。ssh-add を実行してください。",authFailed:"認証に失敗しました:ユーザー名、パスワード、または鍵が正しくありません。デバイス設定を確認してください。",authFailedGeneric:"認証に失敗しました:ユーザー名、パスワード、または鍵が正しくありません。デバイス設定を確認してください。",networkUnreachable:"ネットワークに到達できません:ルーティング、ファイアウォール、または VPN 設定を確認してください。",connectionRefused:"接続が拒否されました:ターゲットホストに接続できません。ホストアドレスとポートを確認してください。",timeout:"接続タイムアウト:デバイスに接続できません。ネットワークまたはファイアウォール設定を確認してください。",connectionTimeout:"接続タイムアウト:デバイスに接続できません。ネットワークまたはファイアウォール設定を確認してください。",hostNotFound:"ホストが見つかりません:ホスト名を解決できません。DNS またはホスト名設定を確認してください。",handshakeFailed:"ハンドシェイクに失敗しました:安全な接続を確立できません。キー交換アルゴリズムが互換性がない可能性があります。",tmuxUnavailable:"リモート tmux が利用できないか起動に失敗しました。tmux がインストールされ、リモート shell の PATH から参照できることを確認してください。",connectionClosed:"接続が切断されました。再接続を試みています",unknown:"接続に失敗しました:{{message}}",reconnecting:"接続が中断されました。{{delay}} 秒後に再接続します({{attempt}}/{{maxRetries}})",reconnectFailed:"自動再接続に失敗しました。手動で再試行してください",reconnected:"デバイスが自動的に再接続されました"},deviceStatus:{reconnecting:"再接続中 {{delay}}s",offline:"オフライン",errorBadge:{authFailed:"認証失敗",agentUnavailable:"Agent 利用不可",agentNoIdentity:"Agent に鍵なし",configRefNotSupported:"SSH Config 非対応",networkUnreachable:"ネットワーク不可達",connectionRefused:"接続拒否",timeout:"タイムアウト",hostNotFound:"ホスト未検出",handshakeFailed:"ハンドシェイク失敗",tmuxUnavailable:"tmux 利用不可",connectionClosed:"切断",unknown:"接続エラー"}},websocket:{error:"WebSocket 接続エラー",checkGateway:"Gateway 状態を確認してください",upgradeFailed:"アップグレードに失敗しました",invalidMessage:"無効なメッセージ形式"},wsError:{checkGateway:"Gateway 状態を確認してください"},apiError:{siteNameRequired:"サイト名は空にできません",siteUrlInvalid:"サイト URL は http:// または https:// で始まる必要があります",bellThrottleInvalid:"ベル制限秒数は 0-300 の間である必要があります",sshRetriesInvalid:"SSH 再接続試行回数は 0-20 の間である必要があります",sshDelayInvalid:"SSH 再接続待機時間は 1-300 秒の間である必要があります",languageInvalid:"言語はサポートされているロケールのいずれかである必要があります",botNameRequired:"Bot 名は空にできません",botTokenRequired:"Bot token は空にできません",missingFields:"必須フィールドがありません",sshRequiresHost:"SSH デバイスには host または sshConfigRef が必要です",invalidRequest:"無効なリクエスト",deviceNotFound:"デバイスが見つかりません",botNotFound:"Bot が見つかりません",chatNotFound:"チャットが見つかりません",urlAndSecretRequired:"URL とシークレットが必要です",notFound:"見つかりません",llmProviderNameRequired:"プロバイダー名は空にできません",llmProviderProtocolInvalid:"プロトコルは openai-chat または openai-responses である必要があります",llmProviderBaseUrlInvalid:"Base URL は http:// または https:// で始まる必要があります",llmProviderApiKeyRequired:"API key は空にできません",llmProviderNotFound:"LLM プロバイダーが見つかりません",llmProviderDisabled:"LLM プロバイダー {{name}} は無効化されています",llmNoDefaultProvider:"LLM プロバイダーが指定されておらず、デフォルトプロバイダーも設定されていません",llmNoDefaultModel:"モデルが指定されておらず、デフォルトモデルも設定されていません",llmDefaultProviderNotFound:"デフォルトプロバイダーが存在しません",llmSearchProviderInvalid:"検索プロバイダーは none、tavily、brave のいずれかである必要があります",llmFetchModelsFailed:"モデル一覧の取得に失敗しました:{{detail}}",agentSessionNotFound:"Agent セッションが存在しません",agentSessionBusy:"Agent セッションは実行中です。停止するか完了をお待ちください",agentSessionAwaitingConfirmation:"Agent セッションに未処理の確認リクエストがあります。先に処理してください",agentDeviceRequired:"デバイスを指定してください",agentPaneRequired:"ターミナル pane を指定してください",agentWriteModeInvalid:"書き込みモードは confirm または auto である必要があります",agentMaxStepsInvalid:"1 ターンあたりの最大ステップ数は 1〜100 の範囲で指定してください",agentProviderWebSearchRequiresResponses:"プロバイダ内蔵の Web 検索は openai-responses プロトコルのみ対応しています",agentHostedToolUnknown:"不明な hosted ツール: {{name}}",agentHostedToolRequiresResponses:"プロバイダの hosted ツールは openai-responses プロトコルのみ対応しています",agentSessionOrphaned:"この Agent セッションは孤立しており(端末が存在しません)、読み取り専用です",agentQueuedMessageNotFound:"キューのメッセージが存在しません",agentConfirmationNotFound:"確認リクエストが存在しません",agentConfirmationAlreadyDecided:"確認リクエストは既に処理済みです",agentMessageTextRequired:"メッセージ内容を入力してください",watchRuleNotFound:"Watch ルールが存在しません",watchNameRequired:"ルール名を入力してください",watchTriggerTypeInvalid:"トリガー種別は match、unchanged、llm のいずれかです",watchPatternRequired:"match/unchanged ルールには正規表現が必要です",watchPatternInvalid:"正規表現が無効です:{{detail}}",watchUnchangedMinutesInvalid:"unchanged ルールには 0 より大きい未変化分数が必要です",watchExtractGroupInvalid:"キャプチャグループ番号は 0 以上の整数で指定してください",watchConditionPromptRequired:"llm ルールには条件の説明が必要です",watchIntervalInvalid:"サンプリング間隔は {{min}} 秒以上で指定してください",watchNoMatchBehaviorInvalid:"非マッチ時の挙動は reset または ignore です",watchFireModeInvalid:"発火モードは once または repeat です",watchCooldownInvalid:"クールダウン秒数は 0 以上の整数で指定してください",watchAssistDescriptionRequired:"マッチさせたい内容を記述してください",watchAssistModelUnavailable:"モデル呼び出しに失敗しました:{{detail}}",fileRootInvalid:"絶対パスかつ既存のディレクトリを指定してください",fileOutsideRoots:"許可されたディレクトリの範囲外です",fileNotADirectory:"ディレクトリではありません",fileTooLarge:"ファイルが大きすぎます",fileBinary:"バイナリファイルはサポートされていません",fileRootDeviceInvalid:"無効または不明なデバイス",fileRootDuplicate:"このディレクトリはこのデバイスに既に追加されています"},notification:{clickToJump:"対応するペインにジャンプ",eventType:{terminal_bell:"🔔 ターミナルベル",terminal_notification:"🔔 ターミナル通知",tmux_window_close:"🪟 ウィンドウ閉じる",tmux_pane_close:"📱 ペイン閉じる",device_tmux_missing:"⚠️ Tmux がありません",device_disconnect:"🔌 デバイス切断",session_created:"🆕 セッション作成",session_closed:"🚪 セッション閉じる",agent_confirmation_pending:"🤖 エージェント確認待ち",agent_turn_finished:"🤖 エージェントターン完了",agent_error:"🤖 エージェントエラー",watch_triggered:"👁️ Watch ルール発動",watch_model_unavailable:"👁️ Watch モデル利用不可",watch_rule_error:"👁️ Watch ルールエラー"},site:"サイト",device:"デバイス",window:"ウィンドウ",pane:"ペイン",time:"時間",directLink:"直接リンク",message:"メッセージ",paneTitle:"タイトル",process:"プロセス",telegramBell:{title:"🔔 {{siteName}} からのベル:{{terminalTopbarLabel}}",viewLink:"表示",terminalTopbarLabel:"ウィンドウ {{window}} · ペイン {{pane}} @ {{device}}"},telegramNotification:{},agent:{confirmationPending:"Agent「{{title}}」がツール {{toolName}} の実行確認を求めています",turnFinished:"Agent「{{title}}」のターンが完了しました",error:"Agent「{{title}}」でエラーが発生しました:{{message}}"},watch:{matchTriggered:"Watch「{{name}}」がマッチしました:{{text}}",unchangedTriggered:"Watch「{{name}}」の値「{{value}}」が {{minutes}} 分間変化していません",llmTriggered:"Watch「{{name}}」の条件を満たしました:{{reason}}",summaryTriggered:"Watch「{{name}}」:{{summary}}",unconfirmedSuffix:"(モデル利用不可のため LLM 未確認)",modelUnavailable:"Watch「{{name}}」のモデル呼び出しに失敗しました:{{message}}",ruleError:"Watch「{{name}}」が {{count}} 回連続で失敗したため自動停止しました:{{message}}",paneGone:"Watch「{{name}}」のペイン({{paneId}})が破棄されたため、ルールを削除しました"}},sidebar:{noWindows:"ウィンドウがありません",noDevices:"デバイスがありません",addDeviceLink:"デバイスを追加",openSettingsLink:"設定を開く",openSettings:"設定を開く",manageDevices:"デバイス管理",settings:"設定",currentWindow:"現在のウィンドウ",currentPane:"現在のペイン",newWindow:"ウィンドウを作成",closeWindow:"ウィンドウを閉じる",closePane:"ペインを閉じる",addDevice:"デバイスを追加",tab:{panes:"Panes",agent:"Agent",files:"Files"},orphanedSessions:"孤立セッション"},agent:{error:{streamStalled:"モデルが応答を停止しました(上流ストリームが停止)。再試行してください。"},model:{select:"モデルを選択",placeholder:"モデル",noProviders:"モデルがありません — 設定でプロバイダーを構成してください"},queue:{title:"キュー({{count}})",steer:"今すぐ注入",steerHint:"現在のステップを中断してキューを今すぐ注入",withdraw:"取り消し"},orphan:{readonly:"このセッションは孤立しており(端末が存在しません)、読み取り専用です",title:"孤立セッション",process:"プロセス",startedAt:"作成日時"},files:{comingSoon:"Coming Soon"},panel:{title:"Agent",empty:"セッションを選択または作成してください",inputPlaceholder:"メッセージを入力…",send:"送信",stop:"停止",retry:"再試行",scrollToBottom:"最下部へ"},welcome:{title:"新しい Agent チャット",subtitle:"タスクを入力して、選択した端末での作業を始めましょう"},session:{none:"セッション未選択",new:"新規エージェントセッション",switch:"セッションを切り替え",selectPaneHint:"Panes タブでペインを選択してセッションを開始してください",noSessions:"セッションがありません",showAll:"すべてのセッションを表示",rename:"セッション名を変更",renameTitle:"セッション名を変更",renamePlaceholder:"セッション名",save:"保存",cancel:"キャンセル",delete:"セッションを削除",deleteTitle:"このセッションを削除しますか?",deleteDesc:"「{{title}}」とそのメッセージはすべて完全に削除されます。",deleteConfirm:"削除",createDisabledNoPane:"ターミナル pane を開いてからセッションを作成してください",privacyNotice:"セッションはターミナル画面の内容を設定済みの LLM サービスへ送信します。"},binding:{invalid:"無効",mismatchTitle:"このセッションは別の pane にバインドされています",goTo:"移動",rebind:"現在の pane に再バインド"},writeMode:{confirm:"書き込み確認",auto:"自動実行"},confirm:{title:"承認待ち",approve:"許可",deny:"拒否"},tool:{input:"入力",result:"結果",screen:"画面キャプチャ",send_input:"入力送信",read_screen:"画面読み取り",web_search:"Web 検索",fetch_url:"URL 取得",denied:"拒否されました"},reasoning:{title:"思考プロセス"},toast:{errorTitle:"Agent「{{title}}」でエラー",credentialWarningTitle:"メッセージに認証情報が含まれる可能性",credentialWarningDescription:"{{types}} を検出しました。内容は変更されませんが、LLM に送信され保存されるため、漏洩のリスクがあります。"}},window:{noWindows:"ウィンドウがありません",new:"新規ウィンドウ",close:"ウィンドウを閉じる",closePane:"ペインを閉じる",closeConfirmTitle:"このウィンドウを閉じますか?",closePaneConfirmTitle:"このペインを閉じますか?",closeConfirmDesc:'"{{name}}" で実行中のプロセスは終了されます。この操作は取り消せません。',menu:"ウィンドウ操作",dragHandle:"ドラッグしてウィンドウを並べ替え",dragHandlePane:"ドラッグしてペインを並べ替え",rename:"ウィンドウ名を変更",renamePlaceholder:"名前を入力",renameDesc:"カスタム名はターミナルが設定したタイトルを上書きし、ゲートウェイが再起動するまで保持されます。",renameReset:"自動名に戻す"},watch:{title:"監視ルール",dialogDesc:"このペインの画面を監視し、条件を満たしたら通知します",openMonitor:"このターミナルを監視",rules:{empty:"このペインにはまだ監視ルールがありません",addRule:"新規ルール",edit:"編集",delete:"削除",viewState:"状態",lastTriggered:"最終トリガー:{{time}}",neverTriggered:"未トリガー",deleteTitle:"このルールを削除しますか?",deleteDesc:"「{{name}}」は完全に削除されます。",deleteConfirm:"削除"},type:{match:"マッチ",unchanged:"停滞",llm:"LLM"},typeDesc:{match:"正規表現が画面にマッチしたらトリガー",unchanged:"抽出した値が N 分間変化しない場合にトリガー(例:ダウンロード停滞)",llm:"LLM が定期的に画面を確認し自然言語の条件を判定"},form:{createTitle:"監視ルールを作成",editTitle:"監視ルールを編集",name:"ルール名",namePlaceholder:"例:ダウンロード停滞アラート",triggerType:"トリガー種別",pattern:"正規表現",patternPlaceholder:"例:(\\d+)%",flags:"フラグ",flagsPlaceholder:"例:i",extractGroup:"キャプチャグループ番号",extractGroupHint:"0 = マッチ全体。このグループの値を追跡します",unchangedMinutes:"変化なし継続(分)",noMatchBehavior:"マッチしない場合",noMatchReset:"タイマーをリセット(進捗行の消失 = タスク完了)",noMatchIgnore:"無視(前回値を保持)",conditionPrompt:"条件(自然言語)",conditionPromptPlaceholder:"例:コンパイルエラーでビルドが失敗した",model:"モデル",followGlobalDefault:"グローバル既定に従う",modelPlaceholder:"モデル ID",modelRequiredHint:"このルールは LLM を呼び出します。選択した(またはグローバル既定の)モデルが利用可能か確認してください。",confirmWithLlm:"通知前に LLM で再確認",confirmWithLlmDesc:"誤検知を低減。モデル利用不可時はそのまま通知",summarizeWithLlm:"LLM による通知要約",summarizeWithLlmDesc:"画面内容をモデルが要約して通知本文にします",intervalSeconds:"サンプリング間隔(秒)",intervalHint:"最小 {{min}} 秒",fireMode:"発火モード",fireOnce:"一回(発火後に自動停止)",fireRepeat:"繰り返し",cooldownSeconds:"クールダウン(秒)",enabled:"有効",assistLabel:"説明から正規表現を生成",assistPlaceholder:"例:ダウンロード進捗のパーセンテージにマッチ",assistButton:"生成",assistExplanation:"説明",assistPreview:"現在の画面でのマッチ",assistPreviewEmpty:"現在の画面サンプルにマッチなし",create:"作成",save:"保存",providerUnavailable:"元のプロバイダーは利用できません",providerDisabled:"無効"},validation:{nameRequired:"ルール名は必須です",patternRequired:"正規表現は必須です",patternInvalid:"正規表現が無効です:{{detail}}",unchangedMinutesInvalid:"変化なし継続分は 0 より大きい必要があります",conditionPromptRequired:"条件の説明は必須です",intervalMin:"サンプリング間隔は {{min}} 秒以上にしてください"},state:{title:"ルール状態",back:"戻る",lastSampledAt:"最終サンプリング",lastValue:"最新値",lastValueChangedAt:"値の最終変化",lastTriggeredAt:"最終トリガー",consecutiveErrors:"連続エラー回数",lastError:"最新エラー",samples:"直近サンプル",samplesEmpty:"サンプルなし",hit:"ヒット",none:"—"},toast:{created:"監視ルールを作成しました",updated:"監視ルールを更新しました",deleted:"監視ルールを削除しました",triggeredTitle:"監視トリガー",openTerminal:"ターミナルを開く",modelUnavailableTitle:"監視モデル利用不可",modelUnavailableHint:"ルールは縮退動作で継続します。",ruleErrorTitle:"監視ルールを自動停止しました"},notifPermission:{title:"ブラウザ通知を有効にしますか?",desc:"タブがバックグラウンドでも監視トリガー時に通知を受け取れます。",enable:"有効にする",dismiss:"今はしない"}},validation:{deviceNameRequired:"デバイス名は必須です",hostRequired:"SSH デバイスにはホストアドレスが必要です"},files:{title:"ファイル",refresh:"ファイル一覧を更新",noRoots:"アクセス可能なディレクトリがありません。「設定 → ファイル」で追加してください。",emptyDir:"空のディレクトリ",truncated:"項目が多すぎるため一覧を省略しました",download:"ダウンロード",error:{invalid:"不正なリクエスト",outside_roots:"許可されたディレクトリの範囲外です",not_found:"すでに存在しません",not_a_directory:"ディレクトリではありません",is_directory:"これはディレクトリです",too_large:"ファイルが大きすぎてプレビューできません",binary:"バイナリファイルはプレビューできません",permission_denied:"アクセスが拒否されました",device_not_found:"デバイスが見つかりません",root_not_found:"ディレクトリ項目が見つかりません",root_disabled:"このディレクトリは無効です",connection_failed:"デバイスへの接続に失敗しました",auth_unsupported:"このデバイスの認証方式はファイルアクセスに非対応です(鍵か ssh-agent を使用)",rsync_missing_local:"サーバーに rsync がインストールされていません",rsync_missing_remote:"リモートデバイスに rsync がインストールされていません",timeout:"タイムアウトしました",unknown:"読み込みに失敗しました"},retry:"再試行(折りたたんで再展開)",install:{button:"rsync をインストール",scopeLocal:"サーバー",scopeRemote:"リモート",connectFailed:"デバイスへの接続に失敗しました",windowFailed:"ウィンドウの作成に失敗しました",prompt:"{{device}}({{scope}})に rsync が見つかりません。システムに合わせた方法で rsync をインストールし(例: `brew install rsync`、`sudo apt-get install -y rsync`、`sudo yum install -y rsync`)、完了したら返信してください。"}},file:{invalidRef:"無効なファイル参照です",notFound:"ファイルは存在しません",accessDenied:"アクセスが拒否されました",loadFailed:"ファイルの読み込みに失敗しました",isDirectory:"これはディレクトリです",notPreviewable:"このファイル形式はプレビューできません",tooLarge:"ファイルが大きすぎてプレビューできません",binary:"バイナリファイルはプレビューできません",download:"ダウンロード",openRaw:"元ファイルを開く"}}}},Gx="en_US",Pte={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 m2(e){return e.replace("_","-")}var ob={},vs={},xs={},AT;function _4(){if(AT)return xs;AT=1,Object.defineProperty(xs,"__esModule",{value:!0}),xs.BinaryReader=xs.BinaryWriter=void 0;class e{constructor(r=1024){at(this,"buffer");at(this,"view");at(this,"offset",0);this.buffer=new Uint8Array(r),this.view=new DataView(this.buffer.buffer)}ensureCapacity(r){const a=this.offset+r;if(a<=this.buffer.length)return;let o=this.buffer.length;for(;o<a;)o*=2;const l=new Uint8Array(o);l.set(this.buffer),this.buffer=l,this.view=new DataView(this.buffer.buffer)}writeUint8(r){this.ensureCapacity(1),this.view.setUint8(this.offset,r),this.offset+=1}writeUint16(r){this.ensureCapacity(2),this.view.setUint16(this.offset,r,!0),this.offset+=2}writeUint32(r){this.ensureCapacity(4),this.view.setUint32(this.offset,r,!0),this.offset+=4}writeUint64(r){this.ensureCapacity(8),this.view.setBigUint64(this.offset,r,!0),this.offset+=8}writeUint128(r){this.ensureCapacity(16);const a=r&BigInt("0xFFFFFFFFFFFFFFFF"),o=r>>BigInt(64);this.writeUint64(a),this.writeUint64(o)}writeInt8(r){this.ensureCapacity(1),this.view.setInt8(this.offset,r),this.offset+=1}writeInt16(r){this.ensureCapacity(2),this.view.setInt16(this.offset,r,!0),this.offset+=2}writeInt32(r){this.ensureCapacity(4),this.view.setInt32(this.offset,r,!0),this.offset+=4}writeInt64(r){this.ensureCapacity(8),this.view.setBigInt64(this.offset,r,!0),this.offset+=8}writeInt128(r){this.ensureCapacity(16);const a=r&BigInt("0xFFFFFFFFFFFFFFFF"),o=r>>BigInt(64);this.writeInt64(a),this.writeInt64(o)}writeFloat32(r){this.ensureCapacity(4),this.view.setFloat32(this.offset,r,!0),this.offset+=4}writeFloat64(r){this.ensureCapacity(8),this.view.setFloat64(this.offset,r,!0),this.offset+=8}writeBool(r){this.writeUint8(r?1:0)}writeString(r){const a=new TextEncoder().encode(r);this.writeUint32(a.length),this.ensureCapacity(a.length),this.buffer.set(a,this.offset),this.offset+=a.length}getBuffer(){return this.buffer.slice(0,this.offset)}}xs.BinaryWriter=e;class t{constructor(r){at(this,"buffer");at(this,"view");at(this,"offset",0);this.buffer=r,this.view=new DataView(r.buffer,r.byteOffset,r.byteLength)}readUint8(){const r=this.view.getUint8(this.offset);return this.offset+=1,r}readUint16(){const r=this.view.getUint16(this.offset,!0);return this.offset+=2,r}readUint32(){const r=this.view.getUint32(this.offset,!0);return this.offset+=4,r}readUint64(){const r=this.view.getBigUint64(this.offset,!0);return this.offset+=8,r}readUint128(){const r=this.readUint64();return this.readUint64()<<BigInt(64)|r}readInt8(){const r=this.view.getInt8(this.offset);return this.offset+=1,r}readInt16(){const r=this.view.getInt16(this.offset,!0);return this.offset+=2,r}readInt32(){const r=this.view.getInt32(this.offset,!0);return this.offset+=4,r}readInt64(){const r=this.view.getBigInt64(this.offset,!0);return this.offset+=8,r}readInt128(){const r=this.readUint64();return this.readInt64()<<BigInt(64)|r}readFloat32(){const r=this.view.getFloat32(this.offset,!0);return this.offset+=4,r}readFloat64(){const r=this.view.getFloat64(this.offset,!0);return this.offset+=8,r}readBool(){return!!this.readUint8()}readString(){const r=this.readUint32(),a=this.buffer.slice(this.offset,this.offset+r);return this.offset+=r,new TextDecoder().decode(a)}getOffset(){return this.offset}}return xs.BinaryReader=t,xs}var sb={},NT;function j4(){return NT||(NT=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.registry=e.TypeRegistry=void 0;class t{constructor(){at(this,"handlers",new Map)}register(r,a){this.handlers.set(r,a)}getHandler(r){const a=this.handlers.get(r);if(!a)throw new Error(`No handler registered for type: ${r}`);return a}}e.TypeRegistry=t,e.registry=new t,e.registry.register("u8",{write:(n,r)=>{if(r<0||r>255||!Number.isInteger(r))throw new Error("Value out of range for u8");n.writeUint8(r)},read:n=>n.readUint8()}),e.registry.register("u16",{write:(n,r)=>{if(r<0||r>65535||!Number.isInteger(r))throw new Error("Value out of range for u16");n.writeUint16(r)},read:n=>n.readUint16()}),e.registry.register("u32",{write:(n,r)=>{if(r<0||r>4294967295||!Number.isInteger(r))throw new Error("Value out of range for u32");n.writeUint32(r)},read:n=>n.readUint32()}),e.registry.register("u64",{write:(n,r)=>{if(r<0n||r>18446744073709551615n)throw new Error("Value out of range for u64");n.writeUint64(r)},read:n=>n.readUint64()}),e.registry.register("u128",{write:(n,r)=>{if(r<0n||r>340282366920938463463374607431768211455n)throw new Error("Value out of range for u128");n.writeUint128(r)},read:n=>n.readUint128()}),e.registry.register("i8",{write:(n,r)=>{if(r<-128||r>127||!Number.isInteger(r))throw new Error("Value out of range for i8");n.writeInt8(r)},read:n=>n.readInt8()}),e.registry.register("i16",{write:(n,r)=>{if(r<-32768||r>32767||!Number.isInteger(r))throw new Error("Value out of range for i16");n.writeInt16(r)},read:n=>n.readInt16()}),e.registry.register("i32",{write:(n,r)=>{if(r<-2147483648||r>2147483647||!Number.isInteger(r))throw new Error("Value out of range for i32");n.writeInt32(r)},read:n=>n.readInt32()}),e.registry.register("i64",{write:(n,r)=>{if(r<-9223372036854775808n||r>9223372036854775807n)throw new Error("Value out of range for i64");n.writeInt64(r)},read:n=>n.readInt64()}),e.registry.register("i128",{write:(n,r)=>{if(r<-170141183460469231731687303715884105728n||r>170141183460469231731687303715884105727n)throw new Error("Value out of range for i128");n.writeInt128(r)},read:n=>n.readInt128()}),e.registry.register("f32",{write:(n,r)=>n.writeFloat32(r),read:n=>n.readFloat32()}),e.registry.register("f64",{write:(n,r)=>{if(Number.isNaN(r))throw new Error("For portability reasons we do not allow serializing NaN values.");n.writeFloat64(r)},read:n=>n.readFloat64()}),e.registry.register("bool",{write:(n,r)=>n.writeBool(r),read:n=>n.readBool()}),e.registry.register("string",{write:(n,r)=>n.writeString(r),read:n=>n.readString()}),e.registry.register("unit",{write:()=>{},read:()=>({})}),e.registry.register("struct",{write:(n,r,a)=>{if(a)for(const[o,l]of Object.entries(a))e.registry.getHandler(l.type).write(n,r[o],l.options)},read:(n,r)=>{if(!r)return{};const a={};for(const[o,l]of Object.entries(r)){const c=e.registry.getHandler(l.type);a[o]=c.read(n,l.options)}return a}}),e.registry.register("vec",{write:(n,r,a)=>{if(!a)return;const{elementType:o,elementOptions:l}=a,c=(ArrayBuffer.isView(r),r.length);n.writeUint32(c);const f=e.registry.getHandler(o);if(ArrayBuffer.isView(r))for(let d=0;d<c;d++)f.write(n,r[d],l);else for(const d of r)f.write(n,d,l)},read:(n,r)=>{if(!r)return[];const{elementType:a,elementOptions:o}=r,l=n.readUint32(),c=e.registry.getHandler(a),f=Array.from({length:l},()=>c.read(n,o));switch(a){case"u8":return new Uint8Array(f);case"u16":return new Uint16Array(f);case"u32":return new Uint32Array(f);case"i8":return new Int8Array(f);case"i16":return new Int16Array(f);case"i32":return new Int32Array(f);case"i64":return new BigInt64Array(f);case"f32":return new Float32Array(f);case"f64":return new Float64Array(f);default:return f}}}),e.registry.register("set",{write:(n,r,a)=>{if(!a)return;const{elementType:o,elementOptions:l}=a,c=Array.from(r).sort();n.writeUint32(c.length);const f=e.registry.getHandler(o);for(const d of c)f.write(n,d,l)},read:(n,r)=>{if(!r)return new Set;const{elementType:a,elementOptions:o}=r,l=n.readUint32(),c=e.registry.getHandler(a),f=Array.from({length:l},()=>c.read(n,o));return new Set(f)}}),e.registry.register("map",{write:(n,r,a)=>{if(!a)return;const{keyType:o,keyOptions:l,valueType:c,valueOptions:f}=a,d=Array.from(r.entries()).sort();n.writeUint32(d.length);const m=e.registry.getHandler(o),h=e.registry.getHandler(c);for(const[y,g]of d)m.write(n,y,l),h.write(n,g,f)},read:(n,r)=>{if(!r)return new Map;const{keyType:a,keyOptions:o,valueType:l,valueOptions:c}=r,f=n.readUint32(),d=e.registry.getHandler(a),m=e.registry.getHandler(l),h=Array.from({length:f},()=>{const y=d.read(n,o),g=m.read(n,c);return[y,g]});return new Map(h)}}),e.registry.register("option",{write:(n,r,a)=>{if(!a)return;const{valueType:o,valueOptions:l}=a,c=r!==null;n.writeUint8(c?1:0),c&&e.registry.getHandler(o).write(n,r,l)},read:(n,r)=>{if(!r)return null;const{valueType:a,valueOptions:o}=r;return n.readUint8()===1?e.registry.getHandler(a).read(n,o):null}}),e.registry.register("enum",{write:(n,r,a)=>{if(!a)return;const o=Object.keys(r)[0],l=r[o],c=a.variants.find(f=>f.name===o);if(!c)throw new Error(`Unknown enum variant: ${o}`);n.writeUint8(c.index),c.type!=="unit"&&e.registry.getHandler(c.type).write(n,l,c.options)},read:(n,r)=>{if(!r)return{};const a=n.readUint8(),o=r.variants.find(f=>f.index===a);if(!o)throw new Error(`Unknown enum variant index: ${a}`);if(o.type==="unit")return{[o.name]:{}};const c=e.registry.getHandler(o.type).read(n,o.options);return{[o.name]:c}}}),e.registry.register("tuple",{write:(n,r,a)=>{if(a){if(r.length!==a.length)throw new Error(`Tuple length mismatch: expected ${a.length}, got ${r.length}`);for(let o=0;o<a.length;o++){const l=a[o];if(!l)throw new Error(`Missing type information for tuple element at index ${o}`);e.registry.getHandler(l.type).write(n,r[o],l.options)}}},read:(n,r)=>{if(!r)return[];const a=[];for(const o of r){const l=e.registry.getHandler(o.type);a.push(l.read(n,o.options))}return a}}),e.registry.register("array",{write:(n,r,a)=>{if(!a)return;const{elementType:o,elementOptions:l,length:c}=a;if(r.length!==c)throw new Error(`Array length mismatch: expected ${c}, got ${r.length}`);const f=e.registry.getHandler(o);for(const d of r)f.write(n,d,l)},read:(n,r)=>{if(!r)return[];const{elementType:a,elementOptions:o,length:l}=r,c=e.registry.getHandler(a);return Array.from({length:l},()=>c.read(n,o))}}),e.registry.register("bytes",{write:(n,r,a)=>{const o=r.length;if((a==null?void 0:a.length)!=null){if(o!==a.length)throw new Error(`Bytes length mismatch: expected ${a.length}, got ${o}`);for(let l=0;l<o;l++)n.writeUint8(r[l])}else{n.writeUint32(o);for(let l=0;l<o;l++)n.writeUint8(r[l])}},read:(n,r)=>{const a=(r==null?void 0:r.length)!=null?r.length:n.readUint32(),o=new Uint8Array(a);for(let l=0;l<a;l++)o[l]=n.readUint8();return o}}),e.registry.register("nativeEnum",{write:(n,r,a)=>{if(!a)return;const{valueToIndexMap:o}=a,l=r,c=o.get(l);if(c===void 0)throw new Error(`Invalid enum value: ${String(r)}`);n.writeUint8(c)},read:(n,r)=>{if(!r)return null;const{indexToValueMap:a}=r,o=n.readUint8(),l=a.get(o);if(l===void 0)throw new Error(`Invalid enum index: ${o}`);return l}})})(sb)),sb}var DT;function z4(){if(DT)return vs;DT=1,Object.defineProperty(vs,"__esModule",{value:!0}),vs.b=vs.Schema=void 0;const e=_4(),t=j4();class n{constructor(a,o,l){at(this,"type");at(this,"options");at(this,"registry");this.type=a,this.options=o,this.registry=l}serialize(a){const o=new e.BinaryWriter;return this.registry.getHandler(this.type).write(o,a,this.options),o.getBuffer()}deserialize(a){const o=new e.BinaryReader(a);return this.registry.getHandler(this.type).read(o,this.options)}}return vs.Schema=n,vs.b={u8:()=>new n("u8",null,t.registry),u16:()=>new n("u16",null,t.registry),u32:()=>new n("u32",null,t.registry),u64:()=>new n("u64",null,t.registry),u128:()=>new n("u128",null,t.registry),i8:()=>new n("i8",null,t.registry),i16:()=>new n("i16",null,t.registry),i32:()=>new n("i32",null,t.registry),i64:()=>new n("i64",null,t.registry),i128:()=>new n("i128",null,t.registry),f32:()=>new n("f32",null,t.registry),f64:()=>new n("f64",null,t.registry),bool:()=>new n("bool",null,t.registry),string:()=>new n("string",null,t.registry),unit:()=>new n("unit",null,t.registry),vec:r=>new n("vec",{elementType:r.type,elementOptions:r.options},t.registry),hashSet:r=>new n("set",{elementType:r.type,elementOptions:r.options},t.registry),hashMap:(r,a)=>new n("map",{keyType:r.type,keyOptions:r.options,valueType:a.type,valueOptions:a.options},t.registry),option:r=>new n("option",{valueType:r.type,valueOptions:r.options},t.registry),array:(r,a)=>new n("array",{elementType:r.type,elementOptions:r.options,length:a},t.registry),bytes:r=>new n("bytes",r!=null?{length:r}:{},t.registry),enum:r=>{const a=Object.entries(r).map(([o,l],c)=>({index:c,name:o,type:l.type,options:l.options}));return new n("enum",{variants:a},t.registry)},struct:r=>{const a=Object.fromEntries(Object.entries(r).map(([o,l])=>[o,{type:l.type,options:l.options}]));return new n("struct",a,t.registry)},tuple:(...r)=>{const a=r.map(o=>({type:o.type,options:o.options}));return new n("tuple",a,t.registry)},nativeEnum:r=>{const a=Object.entries(r).filter(([m])=>typeof m=="string"&&Number.isNaN(Number(m))),o=a.map(([m,h])=>h),l=o.some(m=>typeof m=="string"),c=o.some(m=>typeof m=="number");if(l&&c)throw new Error("Mixed string/numeric enums are not supported");const f=new Map,d=new Map;if(a.forEach(([m,h],y)=>{f.set(h,y),d.set(y,h)}),a.length>255)throw new Error("Borsh only supports enums with up to 255 variants");return new n("nativeEnum",{enumObj:r,valueToIndexMap:f,indexToValueMap:d},t.registry)}},vs}var IT;function F4(){return IT||(IT=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Schema=e.b=void 0;var t=z4();Object.defineProperty(e,"b",{enumerable:!0,get:function(){return t.b}}),Object.defineProperty(e,"Schema",{enumerable:!0,get:function(){return t.Schema}})})(ob)),ob}var se=F4();const B4=1,H4=2,U4=3,q4=4,V4=5,$4=257,Y4=258,W4=259,K4=260,G4=261,X4=513,Q4=514,Z4=515,J4=516,e3=517,t3=518,n3=519,r3=520,i3=522,a3=523,o3=524,s3=769,l3=770,c3=771,u3=772,d3=773,f3=774,h3=1025,p3=1026,m3=1281,g3=1537,y3=1538,b3=1539,v3=1793,x3=1,w3=2,S3=3,E3=4,C3=5,T3=6,R3=7,k3=8,M3=9,O3=10,A3=11,N3=12,D3=13,I3=1,P3=2,L3=3,_3=1001,ea=1002,j3=1003,g2=1004,ep=1005,z3=1101,F3=1102,B3=1201,H3=1202,U3=1301,q3=1302,V3=1401,$3={[_3]:"Unsupported protocol version",[ea]:"Invalid frame format",[j3]:"Unknown message kind",[g2]:"Failed to decode payload",[ep]:"Frame exceeds maximum size",[z3]:"Device not found",[F3]:"Failed to connect device",[B3]:"Tmux target not found",[H3]:"Tmux not ready",[U3]:"Select conflict",[q3]:"Select token mismatch",[V3]:"Internal server error"};function Y3(e){return $3[e]??`Unknown error code: ${e}`}class ti extends Error{constructor(t,n=!1,r){super(r??Y3(t)),this.code=t,this.retryable=n,this.name="WsBorshError"}}const y2=se.b.struct({magic:se.b.bytes(2),version:se.b.u16(),kind:se.b.u16(),flags:se.b.u16(),seq:se.b.u32(),payload:se.b.bytes()}),W3=se.b.option(se.b.u32()),vc=se.b.option(se.b.u16()),Mr=se.b.option(se.b.string()),K3=se.b.struct({clientImpl:se.b.string(),clientVersion:se.b.string(),maxFrameBytes:se.b.u32(),supportsCompression:se.b.bool(),supportsDiffSnapshot:se.b.bool()}),G3=se.b.struct({serverImpl:se.b.string(),serverVersion:se.b.string(),selectedVersion:se.b.u16(),maxFrameBytes:se.b.u32(),heartbeatIntervalMs:se.b.u32(),capabilities:se.b.vec(se.b.string())}),X3=se.b.struct({nonce:se.b.u32(),timeMs:se.b.u64()});se.b.struct({refSeq:W3,code:se.b.u16(),message:se.b.string(),retryable:se.b.bool()});const Q3=se.b.struct({deviceId:se.b.string()}),Z3=se.b.struct({deviceId:se.b.string()}),J3=se.b.struct({deviceId:se.b.string()}),e5=se.b.struct({deviceId:se.b.string()}),t5=se.b.struct({deviceId:se.b.string(),eventType:se.b.u8(),errorType:Mr,message:Mr,rawMessage:Mr}),n5=se.b.struct({deviceId:se.b.string(),windowId:Mr,paneId:Mr,selectToken:se.b.bytes(16),wantHistory:se.b.bool(),cols:vc,rows:vc}),r5=se.b.struct({deviceId:se.b.string(),windowId:se.b.string()}),i5=se.b.struct({deviceId:se.b.string(),name:Mr}),a5=se.b.struct({deviceId:se.b.string(),windowId:se.b.string()}),o5=se.b.struct({deviceId:se.b.string(),paneId:se.b.string()}),s5=se.b.struct({deviceId:se.b.string(),windowId:se.b.string(),name:se.b.string()}),l5=se.b.struct({deviceId:se.b.string(),style:se.b.string()}),c5=se.b.struct({deviceId:se.b.string(),windowIds:se.b.vec(se.b.string())}),u5=se.b.struct({deviceId:se.b.string(),windowId:se.b.string(),paneIds:se.b.vec(se.b.string())}),d5=se.b.struct({deviceId:se.b.string(),eventType:se.b.u8(),eventData:se.b.bytes()}),f5=se.b.struct({deviceId:se.b.string(),paneId:se.b.string(),encoding:se.b.u8(),data:se.b.bytes(),isComposing:se.b.bool()}),h5=se.b.struct({deviceId:se.b.string(),paneId:se.b.string(),encoding:se.b.u8(),data:se.b.bytes(),isComposing:se.b.bool()}),b2=se.b.struct({deviceId:se.b.string(),paneId:se.b.string(),cols:se.b.u16(),rows:se.b.u16()}),p5=b2,m5=se.b.struct({deviceId:se.b.string(),paneId:se.b.string(),encoding:se.b.u8(),data:se.b.bytes()}),g5=se.b.struct({deviceId:se.b.string(),paneId:se.b.string(),selectToken:se.b.bytes(16),encoding:se.b.u8(),alternateScreen:se.b.bool(),data:se.b.bytes()}),y5=se.b.struct({deviceId:se.b.string(),windowId:se.b.string(),paneId:se.b.string(),selectToken:se.b.bytes(16)}),b5=se.b.struct({deviceId:se.b.string(),paneId:se.b.string(),selectToken:se.b.bytes(16)}),v2=se.b.struct({chunkStreamId:se.b.u32(),originalKind:se.b.u16(),originalSeq:se.b.u32(),totalChunks:se.b.u16(),chunkIndex:se.b.u16(),data:se.b.bytes()}),v5=se.b.struct({id:se.b.string(),windowId:se.b.string(),index:se.b.u16(),title:Mr,active:se.b.bool(),width:se.b.u16(),height:se.b.u16()}),x5=se.b.struct({id:se.b.string(),name:se.b.string(),customName:Mr,index:se.b.u16(),active:se.b.bool(),panes:se.b.vec(v5)}),w5=se.b.struct({id:se.b.string(),name:se.b.string(),windows:se.b.vec(x5)}),S5=se.b.struct({deviceId:se.b.string(),session:se.b.option(w5)});se.b.struct({deviceId:se.b.string(),baseRevision:se.b.u32(),revision:se.b.u32(),diffFormat:se.b.u8(),diffBytes:se.b.bytes()});const E5=se.b.struct({sessionId:se.b.string()}),C5=se.b.struct({sessionId:se.b.string()}),T5=se.b.struct({sessionId:se.b.string(),seq:se.b.u32(),eventType:se.b.u8(),payload:se.b.bytes()}),R5=se.b.struct({ruleId:se.b.string(),deviceId:se.b.string(),paneId:se.b.string(),eventType:se.b.u8(),payload:se.b.bytes()}),k5=se.b.struct({windowId:se.b.string()}),M5=se.b.struct({windowId:se.b.string()}),O5=se.b.struct({windowId:se.b.string(),name:se.b.string()}),A5=se.b.struct({windowId:se.b.string()}),N5=se.b.struct({paneId:se.b.string(),windowId:se.b.string()}),D5=se.b.struct({paneId:se.b.string()}),I5=se.b.struct({windowId:se.b.string(),paneId:se.b.string()}),P5=se.b.struct({windowId:se.b.string(),layout:se.b.string()}),L5=se.b.struct({windowId:Mr,paneId:Mr,windowIndex:vc,paneIndex:vc,paneUrl:Mr}),_5=se.b.struct({source:se.b.u8(),title:Mr,body:se.b.string(),windowId:Mr,paneId:Mr,windowIndex:vc,paneIndex:vc,paneUrl:Mr}),Sd=new Uint8Array([84,88]),j5=1;function tp(e,t,n,r=0,a=j5){const o={magic:Sd,version:a,kind:e,flags:r,seq:n,payload:t};return y2.serialize(o)}function tr(e,t){return e.serialize(t)}function z5(e){if(e.length<12)throw new ti(ea,!1,"Envelope too small");if(e[0]!==Sd[0]||e[1]!==Sd[1])throw new ti(ea,!1,"Invalid magic bytes");try{return y2.deserialize(e)}catch(t){throw new ti(ea,!1,t instanceof Error?t.message:"Failed to decode envelope")}}function _a(e,t){try{return e.deserialize(t)}catch(n){throw new ti(g2,!1,n instanceof Error?n.message:"Failed to decode payload")}}function F5(e,t){const n=v2.serialize(e);return tp(1281,n,t)}function B5(e){return v2.deserialize(e)}function H5(e){return e.length>=2&&e[0]===Sd[0]&&e[1]===Sd[1]}const U5=5e3,PT=100,Mv=1e3;class q5{constructor(){at(this,"streams",new Map);at(this,"lastCleanup",Date.now())}addChunk(t){if(this.cleanup(),t.totalChunks>Mv)throw new ti(ea,!1,`Too many chunks: ${t.totalChunks} > ${Mv}`);if(t.chunkIndex>=t.totalChunks)throw new ti(ea,!1,`Chunk index out of bounds: ${t.chunkIndex} >= ${t.totalChunks}`);let n=this.streams.get(t.chunkStreamId);if(!n){if(this.streams.size>=PT&&(this.cleanup(!0),this.streams.size>=PT))throw new ti(ea,!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 ti(ea,!1,"Chunk total count mismatch");if(n.chunks.has(t.chunkIndex))throw new ti(ea,!1,`Duplicate chunk index: ${t.chunkIndex}`);return n.chunks.set(t.chunkIndex,t),n.chunks.size===n.totalChunks?this.reassemble(t.chunkStreamId,n):null}reassemble(t,n){const r=[];let a=0;for(let c=0;c<n.totalChunks;c++){const f=n.chunks.get(c);if(!f)throw this.streams.delete(t),new ti(ea,!1,`Missing chunk index: ${c}`);r.push(f.data),a+=f.data.length}const o=new Uint8Array(a);let l=0;for(const c of r)o.set(c,l),l+=c.length;return this.streams.delete(t),{kind:n.originalKind,seq:n.originalSeq,payload:o}}cleanup(t=!1){const n=Date.now();if(!t&&n-this.lastCleanup<5e3)return;this.lastCleanup=n;const r=n-U5;for(const[a,o]of this.streams)o.createdAt<r&&this.streams.delete(a)}getActiveStreamCount(){return this.streams.size}clear(){this.streams.clear()}}function V5(e,t,n,r){const{maxFrameBytes:a,chunkStreamId:o}=r,l=16,c=18,f=a-l;if(f<=0)throw new ti(ep,!1,`maxFrameBytes too small: ${a}`);if(e.length<=f)return{chunks:[],totalChunks:0};const d=a-l-c;if(d<=0)throw new ti(ep,!1,`maxFrameBytes too small for chunking: ${a}`);const m=Math.ceil(e.length/d);if(m>Mv)throw new ti(ep,!1,`Too many chunks: ${m}`);const h=[];for(let y=0;y<m;y++){const g=y*d,w=Math.min(g+d,e.length);h.push({chunkStreamId:o,originalKind:t,originalSeq:n,totalChunks:m,chunkIndex:y,data:e.slice(g,w)})}return{chunks:h,totalChunks:m}}let lb=1;function $5(){const e=lb;return lb=lb%4294967295+1,e}const Y5={1:"osc9",2:"osc777",3:"osc1337",4:"osc99"};function W5(e){const t=t5.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 K5(e){const t=d5.deserialize(e),r={1:"window-add",2:"window-close",3:"window-renamed",4:"window-active",5:"pane-add",6:"pane-close",7:"pane-active",8:"layout-change",9:"bell",10:"output",11:"notification"}[t.eventType];if(!r)throw new Error(`Unknown tmux event type: ${t.eventType}`);return{deviceId:t.deviceId,type:r,data:G5(r,t.eventData)}}function G5(e,t){if(t.length===0)return{};try{switch(e){case"window-add":return k5.deserialize(t);case"window-close":return M5.deserialize(t);case"window-renamed":return O5.deserialize(t);case"window-active":return A5.deserialize(t);case"pane-add":return N5.deserialize(t);case"pane-close":return D5.deserialize(t);case"pane-active":return I5.deserialize(t);case"layout-change":return P5.deserialize(t);case"bell":{const n=L5.deserialize(t);return{windowId:n.windowId??void 0,paneId:n.paneId??void 0,windowIndex:n.windowIndex??void 0,paneIndex:n.paneIndex??void 0,paneUrl:n.paneUrl??void 0}}case"notification":{const n=_5.deserialize(t);return{source:Y5[n.source]??"osc9",title:n.title??void 0,body:n.body,windowId:n.windowId??void 0,paneId:n.paneId??void 0,windowIndex:n.windowIndex??void 0,paneIndex:n.paneIndex??void 0,paneUrl:n.paneUrl??void 0}}default:return{}}}catch{return{}}}function X5(e){const t=S5.deserialize(e);return{deviceId:t.deviceId,session:t.session?Q5(t.session):null}}function Q5(e){return{id:e.id,name:e.name,windows:e.windows.map(Z5)}}function Z5(e){return{id:e.id,name:e.name,customName:e.customName??void 0,index:e.index,active:e.active,panes:e.panes.map(J5)}}function J5(e){return{id:e.id,windowId:e.windowId,index:e.index,title:e.title??void 0,active:e.active,width:e.width,height:e.height}}function eF(){const e=navigator.language;return e.startsWith("zh")?"zh_CN":e.startsWith("ja")?"ja_JP":Gx}hn.use(M4).init({resources:L4,lng:eF(),fallbackLng:Gx,interpolation:{escapeValue:!1},returnNull:!1});function Ov(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}const rd={};function Ti(e,t,n,r,a){let o={...Av(e,rd)};return t&&(o=Xu(o,t)),n&&(o=Xu(o,n)),r&&(o=Xu(o,r)),a&&(o=Xu(o,a)),o}function tF(e){if(e.length===0)return rd;if(e.length===1)return Av(e[0],rd);let t={...Av(e[0],rd)};for(let n=1;n<e.length;n+=1)t=Xu(t,e[n]);return t}function Xu(e,t){return x2(t)?t(e):nF(e,t)}function nF(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":{e[n]=Ov(e.style,r);break}case"className":{e[n]=w2(e.className,r);break}default:rF(n,r)?e[n]=iF(e[n],r):e[n]=r}}return e}function rF(e,t){const n=e.charCodeAt(0),r=e.charCodeAt(1),a=e.charCodeAt(2);return n===111&&r===110&&a>=65&&a<=90&&(typeof t=="function"||typeof t>"u")}function x2(e){return typeof e=="function"}function Av(e,t){return x2(e)?e(t):e??rd}function iF(e,t){return t?e?n=>{if(aF(n)){const a=n;Nv(a);const o=t(a);return a.baseUIHandlerPrevented||e==null||e(a),o}const r=t(n);return e==null||e(n),r}:t:e}function Nv(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function w2(e,t){return t?e?t+" "+e:t:e}function aF(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Cn(e,...t){const n=new URL("https://base-ui.com/production-error");return n.searchParams.set("code",e.toString()),t.forEach(r=>n.searchParams.append("args[]",r)),`Base UI error #${e}; visit ${n} for the full message.`}const LT={};function nr(e,t){const n=v.useRef(LT);return n.current===LT&&(n.current=e(t)),n}function zi(e,t,n,r){const a=nr(S2).current;return sF(a,e,t,n,r)&&E2(a,[e,t,n,r]),a.callback}function oF(e){const t=nr(S2).current;return lF(t,e)&&E2(t,e),t.callback}function S2(){return{callback:null,cleanup:null,refs:[]}}function sF(e,t,n,r,a){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==a}function lF(e,t){return e.refs.length!==t.length||e.refs.some((n,r)=>n!==t[r])}function E2(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const r=Array(t.length).fill(null);for(let a=0;a<t.length;a+=1){const o=t[a];if(o!=null)switch(typeof o){case"function":{const l=o(n);typeof l=="function"&&(r[a]=l);break}case"object":{o.current=n;break}}}e.cleanup=()=>{for(let a=0;a<t.length;a+=1){const o=t[a];if(o!=null)switch(typeof o){case"function":{const l=r[a];typeof l=="function"?l():o(null);break}case"object":{o.current=null;break}}}}}}}const cF=parseInt(v.version,10);function Xx(e){return cF>=e}function _T(e){if(!v.isValidElement(e))return null;const t=e,n=t.props;return(Xx(19)?n==null?void 0:n.ref:t.ref)??null}function uF(e,t){const n={};for(const r in e){const a=e[r];if(t!=null&&t.hasOwnProperty(r)){const o=t[r](a);o!=null&&Object.assign(n,o);continue}a===!0?n[`data-${r.toLowerCase()}`]="":a&&(n[`data-${r.toLowerCase()}`]=a.toString())}return n}function dF(e,t){return typeof e=="function"?e(t):e}function fF(e,t){return typeof e=="function"?e(t):e}function Br(){}const Vo=Object.freeze([]),In=Object.freeze({}),hF=500,pF=500,mF={style:{transition:"none"}},gF="data-base-ui-click-trigger",C2={fallbackAxisSide:"none"},T2={fallbackAxisSide:"end"},yF={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function It(e,t,n={}){const r=t.render,a=bF(t,n);if(n.enabled===!1)return null;const o=n.state??In;return xF(e,r,a,o)}function bF(e,t={}){const{className:n,style:r,render:a}=e,{state:o=In,ref:l,props:c,stateAttributesMapping:f,enabled:d=!0}=t,m=d?dF(n,o):void 0,h=d?fF(r,o):void 0,y=d?uF(o,f):In,g=d?Ov(y,Array.isArray(c)?tF(c):c)??In:In;return typeof document<"u"&&(d?Array.isArray(l)?g.ref=oF([g.ref,_T(a),...l]):g.ref=zi(g.ref,_T(a),l):zi(null,null)),d?(m!==void 0&&(g.className=w2(g.className,m)),h!==void 0&&(g.style=Ov(g.style,h)),g):In}const vF=Symbol.for("react.lazy");function xF(e,t,n,r){if(t){if(typeof t=="function")return t(n,r);const a=Ti(n,t.props);a.ref=n.ref;let o=t;return(o==null?void 0:o.$$typeof)===vF&&(o=v.Children.toArray(t)[0]),v.cloneElement(o,a)}if(e&&typeof e=="string")return wF(e,n);throw new Error(Cn(8))}function wF(e,t){return e==="button"?v.createElement("button",{type:"button",...t,key:t.key}):e==="img"?v.createElement("img",{alt:"",...t,key:t.key}):v.createElement(e,t)}function Jp(e){return It(e.defaultTagName??"div",e,e)}function R2(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=R2(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function k2(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=R2(e))&&(r&&(r+=" "),r+=t);return r}const jT=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,zT=k2,em=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return zT(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:a,defaultVariants:o}=t,l=Object.keys(a).map(d=>{const m=n==null?void 0:n[d],h=o==null?void 0:o[d];if(m===null)return null;const y=jT(m)||jT(h);return a[d][y]}),c=n&&Object.entries(n).reduce((d,m)=>{let[h,y]=m;return y===void 0||(d[h]=y),d},{}),f=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,m)=>{let{class:h,className:y,...g}=m;return Object.entries(g).every(w=>{let[C,T]=w;return Array.isArray(T)?T.includes({...o,...c}[C]):{...o,...c}[C]===T})?[...d,h,y]:d},[]);return zT(e,l,f,n==null?void 0:n.class,n==null?void 0:n.className)},cb=768;function SF(){const[e,t]=v.useState(void 0);return v.useEffect(()=>{const n=window.matchMedia(`(max-width: ${cb-1}px)`),r=()=>{t(window.innerWidth<cb)};return n.addEventListener("change",r),t(window.innerWidth<cb),()=>n.removeEventListener("change",r)},[]),!!e}const EF=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},CF=(e,t)=>({classGroupId:e,validator:t}),M2=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),wp="-",FT=[],TF="arbitrary..",RF=e=>{const t=MF(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return kF(l);const c=l.split(wp),f=c[0]===""&&c.length>1?1:0;return O2(c,f,t)},getConflictingClassGroupIds:(l,c)=>{if(c){const f=r[l],d=n[l];return f?d?EF(d,f):f:d||FT}return n[l]||FT}}},O2=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const a=e[t],o=n.nextPart.get(a);if(o){const d=O2(e,t+1,o);if(d)return d}const l=n.validators;if(l===null)return;const c=t===0?e.join(wp):e.slice(t).join(wp),f=l.length;for(let d=0;d<f;d++){const m=l[d];if(m.validator(c))return m.classGroupId}},kF=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?TF+r:void 0})(),MF=e=>{const{theme:t,classGroups:n}=e;return OF(n,t)},OF=(e,t)=>{const n=M2();for(const r in e){const a=e[r];Qx(a,n,r,t)}return n},Qx=(e,t,n,r)=>{const a=e.length;for(let o=0;o<a;o++){const l=e[o];AF(l,t,n,r)}},AF=(e,t,n,r)=>{if(typeof e=="string"){NF(e,t,n);return}if(typeof e=="function"){DF(e,t,n,r);return}IF(e,t,n,r)},NF=(e,t,n)=>{const r=e===""?t:A2(t,e);r.classGroupId=n},DF=(e,t,n,r)=>{if(PF(e)){Qx(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(CF(n,e))},IF=(e,t,n,r)=>{const a=Object.entries(e),o=a.length;for(let l=0;l<o;l++){const[c,f]=a[l];Qx(f,A2(t,c),n,r)}},A2=(e,t)=>{let n=e;const r=t.split(wp),a=r.length;for(let o=0;o<a;o++){const l=r[o];let c=n.nextPart.get(l);c||(c=M2(),n.nextPart.set(l,c)),n=c}return n},PF=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,LF=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const a=(o,l)=>{n[o]=l,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(o){let l=n[o];if(l!==void 0)return l;if((l=r[o])!==void 0)return a(o,l),l},set(o,l){o in n?n[o]=l:a(o,l)}}},Dv="!",BT=":",_F=[],HT=(e,t,n,r,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:a}),jF=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=a=>{const o=[];let l=0,c=0,f=0,d;const m=a.length;for(let C=0;C<m;C++){const T=a[C];if(l===0&&c===0){if(T===BT){o.push(a.slice(f,C)),f=C+1;continue}if(T==="/"){d=C;continue}}T==="["?l++:T==="]"?l--:T==="("?c++:T===")"&&c--}const h=o.length===0?a:a.slice(f);let y=h,g=!1;h.endsWith(Dv)?(y=h.slice(0,-1),g=!0):h.startsWith(Dv)&&(y=h.slice(1),g=!0);const w=d&&d>f?d-f:void 0;return HT(o,g,y,w)};if(t){const a=t+BT,o=r;r=l=>l.startsWith(a)?o(l.slice(a.length)):HT(_F,!1,l,void 0,!0)}if(n){const a=r;r=o=>n({className:o,parseClassName:a})}return r},zF=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let a=[];for(let o=0;o<n.length;o++){const l=n[o],c=l[0]==="[",f=t.has(l);c||f?(a.length>0&&(a.sort(),r.push(...a),a=[]),r.push(l)):a.push(l)}return a.length>0&&(a.sort(),r.push(...a)),r}},FF=e=>({cache:LF(e.cacheSize),parseClassName:jF(e),sortModifiers:zF(e),...RF(e)}),BF=/\s+/,HF=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:o}=t,l=[],c=e.trim().split(BF);let f="";for(let d=c.length-1;d>=0;d-=1){const m=c[d],{isExternal:h,modifiers:y,hasImportantModifier:g,baseClassName:w,maybePostfixModifierPosition:C}=n(m);if(h){f=m+(f.length>0?" "+f:f);continue}let T=!!C,E=r(T?w.substring(0,C):w);if(!E){if(!T){f=m+(f.length>0?" "+f:f);continue}if(E=r(w),!E){f=m+(f.length>0?" "+f:f);continue}T=!1}const R=y.length===0?"":y.length===1?y[0]:o(y).join(":"),k=g?R+Dv:R,M=k+E;if(l.indexOf(M)>-1)continue;l.push(M);const D=a(E,T);for(let O=0;O<D.length;++O){const A=D[O];l.push(k+A)}f=m+(f.length>0?" "+f:f)}return f},UF=(...e)=>{let t=0,n,r,a="";for(;t<e.length;)(n=e[t++])&&(r=N2(n))&&(a&&(a+=" "),a+=r);return a},N2=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=N2(e[r]))&&(n&&(n+=" "),n+=t);return n},qF=(e,...t)=>{let n,r,a,o;const l=f=>{const d=t.reduce((m,h)=>h(m),e());return n=FF(d),r=n.cache.get,a=n.cache.set,o=c,c(f)},c=f=>{const d=r(f);if(d)return d;const m=HF(f,n);return a(f,m),m};return o=l,(...f)=>o(UF(...f))},VF=[],Jn=e=>{const t=n=>n[e]||VF;return t.isThemeGetter=!0,t},D2=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,I2=/^\((?:(\w[\w-]*):)?(.+)\)$/i,$F=/^\d+\/\d+$/,YF=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,WF=/\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$/,KF=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,GF=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,XF=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Fl=e=>$F.test(e),qt=e=>!!e&&!Number.isNaN(Number(e)),xo=e=>!!e&&Number.isInteger(Number(e)),ub=e=>e.endsWith("%")&&qt(e.slice(0,-1)),Na=e=>YF.test(e),QF=()=>!0,ZF=e=>WF.test(e)&&!KF.test(e),P2=()=>!1,JF=e=>GF.test(e),eB=e=>XF.test(e),tB=e=>!lt(e)&&!ct(e),nB=e=>Ac(e,j2,P2),lt=e=>D2.test(e),ws=e=>Ac(e,z2,ZF),db=e=>Ac(e,sB,qt),UT=e=>Ac(e,L2,P2),rB=e=>Ac(e,_2,eB),kh=e=>Ac(e,F2,JF),ct=e=>I2.test(e),ju=e=>Nc(e,z2),iB=e=>Nc(e,lB),qT=e=>Nc(e,L2),aB=e=>Nc(e,j2),oB=e=>Nc(e,_2),Mh=e=>Nc(e,F2,!0),Ac=(e,t,n)=>{const r=D2.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Nc=(e,t,n=!1)=>{const r=I2.exec(e);return r?r[1]?t(r[1]):n:!1},L2=e=>e==="position"||e==="percentage",_2=e=>e==="image"||e==="url",j2=e=>e==="length"||e==="size"||e==="bg-size",z2=e=>e==="length",sB=e=>e==="number",lB=e=>e==="family-name",F2=e=>e==="shadow",cB=()=>{const e=Jn("color"),t=Jn("font"),n=Jn("text"),r=Jn("font-weight"),a=Jn("tracking"),o=Jn("leading"),l=Jn("breakpoint"),c=Jn("container"),f=Jn("spacing"),d=Jn("radius"),m=Jn("shadow"),h=Jn("inset-shadow"),y=Jn("text-shadow"),g=Jn("drop-shadow"),w=Jn("blur"),C=Jn("perspective"),T=Jn("aspect"),E=Jn("ease"),R=Jn("animate"),k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...M(),ct,lt],O=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto","contain","none"],L=()=>[ct,lt,f],q=()=>[Fl,"full","auto",...L()],F=()=>[xo,"none","subgrid",ct,lt],W=()=>["auto",{span:["full",xo,ct,lt]},xo,ct,lt],_=()=>[xo,"auto",ct,lt],V=()=>["auto","min","max","fr",ct,lt],$=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],B=()=>["start","end","center","stretch","center-safe","end-safe"],j=()=>["auto",...L()],z=()=>[Fl,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...L()],H=()=>[e,ct,lt],K=()=>[...M(),qT,UT,{position:[ct,lt]}],P=()=>["no-repeat",{repeat:["","x","y","space","round"]}],U=()=>["auto","cover","contain",aB,nB,{size:[ct,lt]}],G=()=>[ub,ju,ws],I=()=>["","none","full",d,ct,lt],Q=()=>["",qt,ju,ws],le=()=>["solid","dashed","dotted","double"],ae=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Z=()=>[qt,ub,qT,UT],ue=()=>["","none",w,ct,lt],ve=()=>["none",qt,ct,lt],Se=()=>["none",qt,ct,lt],Le=()=>[qt,ct,lt],te=()=>[Fl,"full",...L()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Na],breakpoint:[Na],color:[QF],container:[Na],"drop-shadow":[Na],ease:["in","out","in-out"],font:[tB],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Na],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Na],shadow:[Na],spacing:["px",qt],text:[Na],"text-shadow":[Na],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Fl,lt,ct,T]}],container:["container"],columns:[{columns:[qt,lt,ct,c]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:D()}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:q()}],"inset-x":[{"inset-x":q()}],"inset-y":[{"inset-y":q()}],start:[{start:q()}],end:[{end:q()}],top:[{top:q()}],right:[{right:q()}],bottom:[{bottom:q()}],left:[{left:q()}],visibility:["visible","invisible","collapse"],z:[{z:[xo,"auto",ct,lt]}],basis:[{basis:[Fl,"full","auto",c,...L()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[qt,Fl,"auto","initial","none",lt]}],grow:[{grow:["",qt,ct,lt]}],shrink:[{shrink:["",qt,ct,lt]}],order:[{order:[xo,"first","last","none",ct,lt]}],"grid-cols":[{"grid-cols":F()}],"col-start-end":[{col:W()}],"col-start":[{"col-start":_()}],"col-end":[{"col-end":_()}],"grid-rows":[{"grid-rows":F()}],"row-start-end":[{row:W()}],"row-start":[{"row-start":_()}],"row-end":[{"row-end":_()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":V()}],"auto-rows":[{"auto-rows":V()}],gap:[{gap:L()}],"gap-x":[{"gap-x":L()}],"gap-y":[{"gap-y":L()}],"justify-content":[{justify:[...$(),"normal"]}],"justify-items":[{"justify-items":[...B(),"normal"]}],"justify-self":[{"justify-self":["auto",...B()]}],"align-content":[{content:["normal",...$()]}],"align-items":[{items:[...B(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...B(),{baseline:["","last"]}]}],"place-content":[{"place-content":$()}],"place-items":[{"place-items":[...B(),"baseline"]}],"place-self":[{"place-self":["auto",...B()]}],p:[{p:L()}],px:[{px:L()}],py:[{py:L()}],ps:[{ps:L()}],pe:[{pe:L()}],pt:[{pt:L()}],pr:[{pr:L()}],pb:[{pb:L()}],pl:[{pl:L()}],m:[{m:j()}],mx:[{mx:j()}],my:[{my:j()}],ms:[{ms:j()}],me:[{me:j()}],mt:[{mt:j()}],mr:[{mr:j()}],mb:[{mb:j()}],ml:[{ml:j()}],"space-x":[{"space-x":L()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":L()}],"space-y-reverse":["space-y-reverse"],size:[{size:z()}],w:[{w:[c,"screen",...z()]}],"min-w":[{"min-w":[c,"screen","none",...z()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[l]},...z()]}],h:[{h:["screen","lh",...z()]}],"min-h":[{"min-h":["screen","lh","none",...z()]}],"max-h":[{"max-h":["screen","lh",...z()]}],"font-size":[{text:["base",n,ju,ws]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ct,db]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ub,lt]}],"font-family":[{font:[iB,lt,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,ct,lt]}],"line-clamp":[{"line-clamp":[qt,"none",ct,db]}],leading:[{leading:[o,...L()]}],"list-image":[{"list-image":["none",ct,lt]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ct,lt]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:H()}],"text-color":[{text:H()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...le(),"wavy"]}],"text-decoration-thickness":[{decoration:[qt,"from-font","auto",ct,ws]}],"text-decoration-color":[{decoration:H()}],"underline-offset":[{"underline-offset":[qt,"auto",ct,lt]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ct,lt]}],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",ct,lt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:K()}],"bg-repeat":[{bg:P()}],"bg-size":[{bg:U()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},xo,ct,lt],radial:["",ct,lt],conic:[xo,ct,lt]},oB,rB]}],"bg-color":[{bg:H()}],"gradient-from-pos":[{from:G()}],"gradient-via-pos":[{via:G()}],"gradient-to-pos":[{to:G()}],"gradient-from":[{from:H()}],"gradient-via":[{via:H()}],"gradient-to":[{to:H()}],rounded:[{rounded:I()}],"rounded-s":[{"rounded-s":I()}],"rounded-e":[{"rounded-e":I()}],"rounded-t":[{"rounded-t":I()}],"rounded-r":[{"rounded-r":I()}],"rounded-b":[{"rounded-b":I()}],"rounded-l":[{"rounded-l":I()}],"rounded-ss":[{"rounded-ss":I()}],"rounded-se":[{"rounded-se":I()}],"rounded-ee":[{"rounded-ee":I()}],"rounded-es":[{"rounded-es":I()}],"rounded-tl":[{"rounded-tl":I()}],"rounded-tr":[{"rounded-tr":I()}],"rounded-br":[{"rounded-br":I()}],"rounded-bl":[{"rounded-bl":I()}],"border-w":[{border:Q()}],"border-w-x":[{"border-x":Q()}],"border-w-y":[{"border-y":Q()}],"border-w-s":[{"border-s":Q()}],"border-w-e":[{"border-e":Q()}],"border-w-t":[{"border-t":Q()}],"border-w-r":[{"border-r":Q()}],"border-w-b":[{"border-b":Q()}],"border-w-l":[{"border-l":Q()}],"divide-x":[{"divide-x":Q()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Q()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...le(),"hidden","none"]}],"divide-style":[{divide:[...le(),"hidden","none"]}],"border-color":[{border:H()}],"border-color-x":[{"border-x":H()}],"border-color-y":[{"border-y":H()}],"border-color-s":[{"border-s":H()}],"border-color-e":[{"border-e":H()}],"border-color-t":[{"border-t":H()}],"border-color-r":[{"border-r":H()}],"border-color-b":[{"border-b":H()}],"border-color-l":[{"border-l":H()}],"divide-color":[{divide:H()}],"outline-style":[{outline:[...le(),"none","hidden"]}],"outline-offset":[{"outline-offset":[qt,ct,lt]}],"outline-w":[{outline:["",qt,ju,ws]}],"outline-color":[{outline:H()}],shadow:[{shadow:["","none",m,Mh,kh]}],"shadow-color":[{shadow:H()}],"inset-shadow":[{"inset-shadow":["none",h,Mh,kh]}],"inset-shadow-color":[{"inset-shadow":H()}],"ring-w":[{ring:Q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:H()}],"ring-offset-w":[{"ring-offset":[qt,ws]}],"ring-offset-color":[{"ring-offset":H()}],"inset-ring-w":[{"inset-ring":Q()}],"inset-ring-color":[{"inset-ring":H()}],"text-shadow":[{"text-shadow":["none",y,Mh,kh]}],"text-shadow-color":[{"text-shadow":H()}],opacity:[{opacity:[qt,ct,lt]}],"mix-blend":[{"mix-blend":[...ae(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ae()}],"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":[qt]}],"mask-image-linear-from-pos":[{"mask-linear-from":Z()}],"mask-image-linear-to-pos":[{"mask-linear-to":Z()}],"mask-image-linear-from-color":[{"mask-linear-from":H()}],"mask-image-linear-to-color":[{"mask-linear-to":H()}],"mask-image-t-from-pos":[{"mask-t-from":Z()}],"mask-image-t-to-pos":[{"mask-t-to":Z()}],"mask-image-t-from-color":[{"mask-t-from":H()}],"mask-image-t-to-color":[{"mask-t-to":H()}],"mask-image-r-from-pos":[{"mask-r-from":Z()}],"mask-image-r-to-pos":[{"mask-r-to":Z()}],"mask-image-r-from-color":[{"mask-r-from":H()}],"mask-image-r-to-color":[{"mask-r-to":H()}],"mask-image-b-from-pos":[{"mask-b-from":Z()}],"mask-image-b-to-pos":[{"mask-b-to":Z()}],"mask-image-b-from-color":[{"mask-b-from":H()}],"mask-image-b-to-color":[{"mask-b-to":H()}],"mask-image-l-from-pos":[{"mask-l-from":Z()}],"mask-image-l-to-pos":[{"mask-l-to":Z()}],"mask-image-l-from-color":[{"mask-l-from":H()}],"mask-image-l-to-color":[{"mask-l-to":H()}],"mask-image-x-from-pos":[{"mask-x-from":Z()}],"mask-image-x-to-pos":[{"mask-x-to":Z()}],"mask-image-x-from-color":[{"mask-x-from":H()}],"mask-image-x-to-color":[{"mask-x-to":H()}],"mask-image-y-from-pos":[{"mask-y-from":Z()}],"mask-image-y-to-pos":[{"mask-y-to":Z()}],"mask-image-y-from-color":[{"mask-y-from":H()}],"mask-image-y-to-color":[{"mask-y-to":H()}],"mask-image-radial":[{"mask-radial":[ct,lt]}],"mask-image-radial-from-pos":[{"mask-radial-from":Z()}],"mask-image-radial-to-pos":[{"mask-radial-to":Z()}],"mask-image-radial-from-color":[{"mask-radial-from":H()}],"mask-image-radial-to-color":[{"mask-radial-to":H()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":M()}],"mask-image-conic-pos":[{"mask-conic":[qt]}],"mask-image-conic-from-pos":[{"mask-conic-from":Z()}],"mask-image-conic-to-pos":[{"mask-conic-to":Z()}],"mask-image-conic-from-color":[{"mask-conic-from":H()}],"mask-image-conic-to-color":[{"mask-conic-to":H()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:K()}],"mask-repeat":[{mask:P()}],"mask-size":[{mask:U()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ct,lt]}],filter:[{filter:["","none",ct,lt]}],blur:[{blur:ue()}],brightness:[{brightness:[qt,ct,lt]}],contrast:[{contrast:[qt,ct,lt]}],"drop-shadow":[{"drop-shadow":["","none",g,Mh,kh]}],"drop-shadow-color":[{"drop-shadow":H()}],grayscale:[{grayscale:["",qt,ct,lt]}],"hue-rotate":[{"hue-rotate":[qt,ct,lt]}],invert:[{invert:["",qt,ct,lt]}],saturate:[{saturate:[qt,ct,lt]}],sepia:[{sepia:["",qt,ct,lt]}],"backdrop-filter":[{"backdrop-filter":["","none",ct,lt]}],"backdrop-blur":[{"backdrop-blur":ue()}],"backdrop-brightness":[{"backdrop-brightness":[qt,ct,lt]}],"backdrop-contrast":[{"backdrop-contrast":[qt,ct,lt]}],"backdrop-grayscale":[{"backdrop-grayscale":["",qt,ct,lt]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[qt,ct,lt]}],"backdrop-invert":[{"backdrop-invert":["",qt,ct,lt]}],"backdrop-opacity":[{"backdrop-opacity":[qt,ct,lt]}],"backdrop-saturate":[{"backdrop-saturate":[qt,ct,lt]}],"backdrop-sepia":[{"backdrop-sepia":["",qt,ct,lt]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":L()}],"border-spacing-x":[{"border-spacing-x":L()}],"border-spacing-y":[{"border-spacing-y":L()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ct,lt]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[qt,"initial",ct,lt]}],ease:[{ease:["linear","initial",E,ct,lt]}],delay:[{delay:[qt,ct,lt]}],animate:[{animate:["none",R,ct,lt]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,ct,lt]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:ve()}],"rotate-x":[{"rotate-x":ve()}],"rotate-y":[{"rotate-y":ve()}],"rotate-z":[{"rotate-z":ve()}],scale:[{scale:Se()}],"scale-x":[{"scale-x":Se()}],"scale-y":[{"scale-y":Se()}],"scale-z":[{"scale-z":Se()}],"scale-3d":["scale-3d"],skew:[{skew:Le()}],"skew-x":[{"skew-x":Le()}],"skew-y":[{"skew-y":Le()}],transform:[{transform:[ct,lt,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:te()}],"translate-x":[{"translate-x":te()}],"translate-y":[{"translate-y":te()}],"translate-z":[{"translate-z":te()}],"translate-none":["translate-none"],accent:[{accent:H()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:H()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ct,lt]}],"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":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"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",ct,lt]}],fill:[{fill:["none",...H()]}],"stroke-w":[{stroke:[qt,ju,ws,db]}],stroke:[{stroke:["none",...H()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},uB=qF(cB);function Pe(...e){return uB(k2(e))}function tm(){return typeof window<"u"}function Wo(e){return Zx(e)?(e.nodeName||"").toLowerCase():"#document"}function Hn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ca(e){var t;return(t=(Zx(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Zx(e){return tm()?e instanceof Node||e instanceof Hn(e).Node:!1}function un(e){return tm()?e instanceof Element||e instanceof Hn(e).Element:!1}function Mn(e){return tm()?e instanceof HTMLElement||e instanceof Hn(e).HTMLElement:!1}function Iv(e){return!tm()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Hn(e).ShadowRoot}const dB=new Set(["inline","contents"]);function Ko(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=ai(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!dB.has(a)}const fB=new Set(["table","td","th"]);function hB(e){return fB.has(Wo(e))}const pB=[":popover-open",":modal"];function nm(e){return pB.some(t=>{try{return e.matches(t)}catch{return!1}})}const mB=["transform","translate","scale","rotate","perspective"],gB=["transform","translate","scale","rotate","perspective","filter"],yB=["paint","layout","strict","content"];function Jx(e){const t=rm(),n=un(e)?ai(e):e;return mB.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||gB.some(r=>(n.willChange||"").includes(r))||yB.some(r=>(n.contain||"").includes(r))}function bB(e){let t=oa(e);for(;Mn(t)&&!ra(t);){if(Jx(t))return t;if(nm(t))return null;t=oa(t)}return null}function rm(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const vB=new Set(["html","body","#document"]);function ra(e){return vB.has(Wo(e))}function ai(e){return Hn(e).getComputedStyle(e)}function im(e){return un(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function oa(e){if(Wo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Iv(e)&&e.host||ca(e);return Iv(t)?t.host:t}function B2(e){const t=oa(e);return ra(t)?e.ownerDocument?e.ownerDocument.body:e.body:Mn(t)&&Ko(t)?t:B2(t)}function Bo(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=B2(e),o=a===((r=e.ownerDocument)==null?void 0:r.body),l=Hn(a);if(o){const c=Pv(l);return t.concat(l,l.visualViewport||[],Ko(a)?a:[],c&&n?Bo(c):[])}return t.concat(a,Bo(a,[],n))}function Pv(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const fb=Px[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],xB=fb&&fb!==v.useLayoutEffect?fb:e=>e();function Ye(e){const t=nr(wB).current;return t.next=e,xB(t.effect),t.trampoline}function wB(){const e={next:void 0,callback:SB,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function SB(){}const EB={...Px},CB=()=>{},qe=typeof document<"u"?v.useLayoutEffect:CB,H2=v.createContext(void 0);function e0(e=!1){const t=v.useContext(H2);if(t===void 0&&!e)throw new Error(Cn(16));return t}function TB(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:a=0,isNativeButton:o}=e,l=r&&t!==!1,c=r&&t===!1;return{props:v.useMemo(()=>{const d={onKeyDown(m){n&&t&&m.key!=="Tab"&&m.preventDefault()}};return r||(d.tabIndex=a,!o&&n&&(d.tabIndex=t?a:-1)),(o&&(t||l)||!o&&n)&&(d["aria-disabled"]=n),o&&(!t||c)&&(d.disabled=n),d},[r,n,t,l,c,o,a])}}function $a(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:a=!0}=e,o=v.useRef(null),l=e0(!0)!==void 0,c=Ye(()=>{const y=o.current;return!!((y==null?void 0:y.tagName)==="A"&&(y!=null&&y.href))}),{props:f}=TB({focusableWhenDisabled:n,disabled:t,composite:l,tabIndex:r,isNativeButton:a}),d=v.useCallback(()=>{const y=o.current;RB(y)&&l&&t&&f.disabled===void 0&&y.disabled&&(y.disabled=!1)},[t,f.disabled,l]);qe(d,[d]);const m=v.useCallback((y={})=>{const{onClick:g,onMouseDown:w,onKeyUp:C,onKeyDown:T,onPointerDown:E,...R}=y;return Ti({type:a?"button":void 0,onClick(M){if(t){M.preventDefault();return}g==null||g(M)},onMouseDown(M){t||w==null||w(M)},onKeyDown(M){if(t||(Nv(M),T==null||T(M)),M.baseUIHandlerPrevented)return;const D=M.target===M.currentTarget&&!a&&!c()&&!t,O=M.key==="Enter",A=M.key===" ";D&&((A||O)&&M.preventDefault(),O&&(g==null||g(M)))},onKeyUp(M){t||(Nv(M),C==null||C(M)),!M.baseUIHandlerPrevented&&M.target===M.currentTarget&&!a&&!t&&M.key===" "&&(g==null||g(M))},onPointerDown(M){if(t){M.preventDefault();return}E==null||E(M)}},a?void 0:{role:"button"},f,R)},[t,f,a,c]),h=Ye(y=>{o.current=y,d()});return{getButtonProps:m,buttonRef:h}}function RB(e){return Mn(e)&&e.tagName==="BUTTON"}const kB=v.forwardRef(function(t,n){const{render:r,className:a,disabled:o=!1,focusableWhenDisabled:l=!1,nativeButton:c=!0,...f}=t,{getButtonProps:d,buttonRef:m}=$a({disabled:o,focusableWhenDisabled:l,native:c});return It("button",t,{state:{disabled:o},ref:[n,m],props:[f,d]})}),MB=em("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 Ht({className:e,variant:t="default",size:n="default",...r}){return S.jsx(kB,{"data-slot":"button",className:Pe(MB({variant:t,size:n,className:e})),...r})}let VT=(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 OB={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},t0={valid(e){return e===null?null:e?{[VT.valid]:""}:{[VT.invalid]:""}}},AB=v.createContext({invalid:void 0,name:void 0,validityData:{state:OB,errors:[],error:"",value:"",initialValue:null},setValidityData:Br,disabled:void 0,touched:!1,setTouched:Br,dirty:!1,setDirty:Br,filled:!1,setFilled:Br,focused:!1,setFocused:Br,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=In)=>e,getInputValidationProps:(e=In)=>e,inputRef:{current:null},commit:async()=>{}}});function Dc(e=!0){const t=v.useContext(AB);if(t.setValidityData===Br&&!e)throw new Error(Cn(28));return t}const NB=v.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Br,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function n0(){return v.useContext(NB)}let $T=0;function DB(e,t="mui"){const[n,r]=v.useState(e),a=e||n;return v.useEffect(()=>{n==null&&($T+=1,r(`${t}-${$T}`))},[n,t]),a}const YT=EB.useId;function nl(e,t){if(YT!==void 0){const n=YT();return e??(t?`${t}-${n}`:n)}return DB(e,t)}function Vi(e){return nl(e,"base-ui")}const IB=v.createContext({controlId:void 0,registerControlId:Br,labelId:void 0,setLabelId:Br,messageIds:[],setMessageIds:Br,getDescriptionProps:e=>e});function am(){return v.useContext(IB)}const PB=[];function om(e){v.useEffect(e,PB)}const zu=0;class sa{constructor(){at(this,"currentId",zu);at(this,"clear",()=>{this.currentId!==zu&&(clearTimeout(this.currentId),this.currentId=zu)});at(this,"disposeEffect",()=>this.clear)}static create(){return new sa}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=zu,n()},t)}isStarted(){return this.currentId!==zu}}function Bn(){const e=nr(sa.create).current;return om(e.disposeEffect),e}function LB(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}function Qt(e){return(e==null?void 0:e.ownerDocument)||document}const Ic=typeof navigator<"u",hb=jB(),U2=FB(),q2=zB(),sm=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),V2=hb.platform==="MacIntel"&&hb.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(hb.platform),$2=Ic&&/apple/i.test(navigator.vendor),Lv=Ic&&/android/i.test(U2)||/android/i.test(q2),_B=Ic&&U2.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,Y2=q2.includes("jsdom/");function jB(){if(!Ic)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 zB(){if(!Ic)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function FB(){if(!Ic)return"";const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform??""}const _v="data-base-ui-focusable",W2="active",K2="selected",G2="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Ho="ArrowLeft",Uo="ArrowRight",r0="ArrowUp",qd="ArrowDown";function ni(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 Dt(e,t){var r;if(!e||!t)return!1;const n=(r=t.getRootNode)==null?void 0:r.call(t);if(e.contains(t))return!0;if(n&&Iv(n)){let a=t;for(;a;){if(e===a)return!0;a=a.parentNode||a.host}}return!1}function Sp(e,t){if(!un(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,r]of t.entries())if(Dt(r,n))return!r.hasAttribute("data-trigger-disabled");return!1}function Rr(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Ii(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 BB(e){return e.matches("html,body")}function lm(e){return Mn(e)&&e.matches(G2)}function jv(e){return e?e.getAttribute("role")==="combobox"&&lm(e):!1}function HB(e){if(!e||Y2)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function Ed(e){return e?e.hasAttribute(_v)?e:e.querySelector(`[${_v}]`)||e:null}function js(e,t,n=!0){return e.filter(a=>{var o;return a.parentId===t&&(!n||((o=a.context)==null?void 0:o.open))}).flatMap(a=>[a,...js(e,a.id,n)])}function WT(e,t){var a;let n=[],r=(a=e.find(o=>o.id===t))==null?void 0:a.parentId;for(;r;){const o=e.find(l=>l.id===r);r=o==null?void 0:o.parentId,o&&(n=n.concat(o))}return n}function br(e){e.preventDefault(),e.stopPropagation()}function UB(e){return"nativeEvent"in e}function X2(e){return e.pointerType===""&&e.isTrusted?!0:Lv&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Q2(e){return Y2?!1:!Lv&&e.width===0&&e.height===0||Lv&&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 Vs(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Z2(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const qB=["top","right","bottom","left"],xc=Math.min,ri=Math.max,Ep=Math.round,Gl=Math.floor,ia=e=>({x:e,y:e}),VB={left:"right",right:"left",bottom:"top",top:"bottom"},$B={start:"end",end:"start"};function zv(e,t,n){return ri(e,xc(t,n))}function qa(e,t){return typeof e=="function"?e(t):e}function Hr(e){return e.split("-")[0]}function Go(e){return e.split("-")[1]}function i0(e){return e==="x"?"y":"x"}function a0(e){return e==="y"?"height":"width"}const YB=new Set(["top","bottom"]);function wi(e){return YB.has(Hr(e))?"y":"x"}function o0(e){return i0(wi(e))}function WB(e,t,n){n===void 0&&(n=!1);const r=Go(e),a=o0(e),o=a0(a);let l=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(l=Cp(l)),[l,Cp(l)]}function KB(e){const t=Cp(e);return[Fv(e),t,Fv(t)]}function Fv(e){return e.replace(/start|end/g,t=>$B[t])}const KT=["left","right"],GT=["right","left"],GB=["top","bottom"],XB=["bottom","top"];function QB(e,t,n){switch(e){case"top":case"bottom":return n?t?GT:KT:t?KT:GT;case"left":case"right":return t?GB:XB;default:return[]}}function ZB(e,t,n,r){const a=Go(e);let o=QB(Hr(e),n==="start",r);return a&&(o=o.map(l=>l+"-"+a),t&&(o=o.concat(o.map(Fv)))),o}function Cp(e){return e.replace(/left|right|bottom|top/g,t=>VB[t])}function JB(e){return{top:0,right:0,bottom:0,left:0,...e}}function J2(e){return typeof e!="number"?JB(e):{top:e,right:e,bottom:e,left:e}}function Tp(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function Oh(e,t,n){return Math.floor(e/t)!==n}function Ql(e,t){return t<0||t>=e.current.length}function np(e,t){return hr(e,{disabledIndices:t})}function Bv(e,t){return hr(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function hr(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:a=1}={}){let o=t;do o+=n?-a:a;while(o>=0&&o<=e.current.length-1&&qo(e,o,r));return o}function eO(e,{event:t,orientation:n,loopFocus:r,rtl:a,cols:o,disabledIndices:l,minIndex:c,maxIndex:f,prevIndex:d,stopEvent:m=!1}){let h=d;const y=[],g={};let w=!1;{let E=null,R=-1;e.current.forEach((k,M)=>{if(k==null)return;const D=k.closest('[role="row"]');D&&(w=!0),(D!==E||R===-1)&&(E=D,R+=1,y[R]=[]),y[R].push(M),g[M]=R})}const C=w&&y.length>0&&y.some(E=>E.length!==o);function T(E){if(!C||d===-1)return;const R=g[d];if(R==null)return;const k=y[R].indexOf(d);let M=E==="up"?R-1:R+1;r&&(M<0?M=y.length-1:M>=y.length&&(M=0));const D=new Set;for(;M>=0&&M<y.length&&!D.has(M);){D.add(M);const O=y[M];if(O.length===0){M=E==="up"?M-1:M+1;continue}const A=Math.min(k,O.length-1);for(let L=A;L>=0;L-=1){const q=O[L];if(!qo(e,q,l))return q}M=E==="up"?M-1:M+1,r&&(M<0?M=y.length-1:M>=y.length&&(M=0))}}if(t.key===r0){const E=T("up");if(E!==void 0)m&&br(t),h=E;else{if(m&&br(t),d===-1)h=f;else if(h=hr(e,{startingIndex:h,amount:o,decrement:!0,disabledIndices:l}),r&&(d-o<c||h<0)){const R=d%o,k=f%o,M=f-(k-R);k===R?h=f:h=k>R?M:M-o}Ql(e,h)&&(h=d)}}if(t.key===qd){const E=T("down");E!==void 0?(m&&br(t),h=E):(m&&br(t),d===-1?h=c:(h=hr(e,{startingIndex:d,amount:o,disabledIndices:l}),r&&d+o>f&&(h=hr(e,{startingIndex:d%o-o,amount:o,disabledIndices:l}))),Ql(e,h)&&(h=d))}if(n==="both"){const E=Gl(d/o);t.key===(a?Ho:Uo)&&(m&&br(t),d%o!==o-1?(h=hr(e,{startingIndex:d,disabledIndices:l}),r&&Oh(h,o,E)&&(h=hr(e,{startingIndex:d-d%o-1,disabledIndices:l}))):r&&(h=hr(e,{startingIndex:d-d%o-1,disabledIndices:l})),Oh(h,o,E)&&(h=d)),t.key===(a?Uo:Ho)&&(m&&br(t),d%o!==0?(h=hr(e,{startingIndex:d,decrement:!0,disabledIndices:l}),r&&Oh(h,o,E)&&(h=hr(e,{startingIndex:d+(o-d%o),decrement:!0,disabledIndices:l}))):r&&(h=hr(e,{startingIndex:d+(o-d%o),decrement:!0,disabledIndices:l})),Oh(h,o,E)&&(h=d));const R=Gl(f/o)===E;Ql(e,h)&&(r&&R?h=t.key===(a?Uo:Ho)?f:hr(e,{startingIndex:d-d%o-1,disabledIndices:l}):h=d)}return h}function tO(e,t,n){const r=[];let a=0;return e.forEach(({width:o,height:l},c)=>{let f=!1;for(n&&(a=0);!f;){const d=[];for(let m=0;m<o;m+=1)for(let h=0;h<l;h+=1)d.push(a+m+h*t);a%t+o<=t&&d.every(m=>r[m]==null)?(d.forEach(m=>{r[m]=c}),f=!0):a+=1}}),[...r]}function nO(e,t,n,r,a){if(e===-1)return-1;const o=n.indexOf(e),l=t[e];switch(a){case"tl":return o;case"tr":return l?o+l.width-1:o;case"bl":return l?o+(l.height-1)*r:o;case"br":return n.lastIndexOf(e);default:return-1}}function rO(e,t){return t.flatMap((n,r)=>e.includes(n)?[r]:[])}function qo(e,t,n){if(typeof n=="function")return n(t);if(n)return n.includes(t);const r=e.current[t];return r?r.hasAttribute("disabled")||r.getAttribute("aria-disabled")==="true":!1}/*!
86
+ * tabbable 6.4.0
87
+ * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
88
+ */var eH=["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] *)"],Rp=eH.join(","),iO=typeof Element>"u",wc=iO?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,kp=!iO&&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},Mp=function(t,n){var r;n===void 0&&(n=!0);var a=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),o=a===""||a==="true",l=o||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):Mp(t.parentNode));return l},tH=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},aO=function(t,n,r){if(Mp(t))return[];var a=Array.prototype.slice.apply(t.querySelectorAll(Rp));return n&&wc.call(t,Rp)&&a.unshift(t),a=a.filter(r),a},Op=function(t,n,r){for(var a=[],o=Array.from(t);o.length;){var l=o.shift();if(!Mp(l,!1))if(l.tagName==="SLOT"){var c=l.assignedElements(),f=c.length?c:l.children,d=Op(f,!0,r);r.flatten?a.push.apply(a,d):a.push({scopeParent:l,candidates:d})}else{var m=wc.call(l,Rp);m&&r.filter(l)&&(n||!t.includes(l))&&a.push(l);var h=l.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(l),y=!Mp(h,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(l));if(h&&y){var g=Op(h===!0?l.children:h.children,!0,r);r.flatten?a.push.apply(a,g):a.push({scopeParent:l,candidates:g})}else o.unshift.apply(o,l.children)}}return a},oO=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},sO=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||tH(t))&&!oO(t)?0:t.tabIndex},nH=function(t,n){var r=sO(t);return r<0&&n&&!oO(t)?0:r},rH=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},lO=function(t){return t.tagName==="INPUT"},iH=function(t){return lO(t)&&t.type==="hidden"},aH=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},oH=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},sH=function(t){if(!t.name)return!0;var n=t.form||kp(t),r=function(c){return n.querySelectorAll('input[type="radio"][name="'+c+'"]')},a;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")a=r(window.CSS.escape(t.name));else try{a=r(t.name)}catch(l){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",l.message),!1}var o=oH(a,t.form);return!o||o===t},lH=function(t){return lO(t)&&t.type==="radio"},cH=function(t){return lH(t)&&!sH(t)},uH=function(t){var n,r=t&&kp(t),a=(n=r)===null||n===void 0?void 0:n.host,o=!1;if(r&&r!==t){var l,c,f;for(o=!!((l=a)!==null&&l!==void 0&&(c=l.ownerDocument)!==null&&c!==void 0&&c.contains(a)||t!=null&&(f=t.ownerDocument)!==null&&f!==void 0&&f.contains(t));!o&&a;){var d,m,h;r=kp(a),a=(d=r)===null||d===void 0?void 0:d.host,o=!!((m=a)!==null&&m!==void 0&&(h=m.ownerDocument)!==null&&h!==void 0&&h.contains(a))}}return o},XT=function(t){var n=t.getBoundingClientRect(),r=n.width,a=n.height;return r===0&&a===0},dH=function(t,n){var r=n.displayCheck,a=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var o=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!o}if(getComputedStyle(t).visibility==="hidden")return!0;var l=wc.call(t,"details>summary:first-of-type"),c=l?t.parentElement:t;if(wc.call(c,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof a=="function"){for(var f=t;t;){var d=t.parentElement,m=kp(t);if(d&&!d.shadowRoot&&a(d)===!0)return XT(t);t.assignedSlot?t=t.assignedSlot:!d&&m!==t.ownerDocument?t=m.host:t=d}t=f}if(uH(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return XT(t);return!1},fH=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var a=n.children.item(r);if(a.tagName==="LEGEND")return wc.call(n,"fieldset[disabled] *")?!0:!a.contains(t)}return!0}n=n.parentElement}return!1},Hv=function(t,n){return!(n.disabled||iH(n)||dH(n,t)||aH(n)||fH(n))},Uv=function(t,n){return!(cH(n)||sO(n)<0||!Hv(t,n))},hH=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},cO=function(t){var n=[],r=[];return t.forEach(function(a,o){var l=!!a.scopeParent,c=l?a.scopeParent:a,f=nH(c,l),d=l?cO(a.candidates):c;f===0?l?n.push.apply(n,d):n.push(c):r.push({documentOrder:o,tabIndex:f,item:a,isScope:l,content:d})}),r.sort(rH).reduce(function(a,o){return o.isScope?a.push.apply(a,o.content):a.push(o.content),a},[]).concat(n)},Vd=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Op([t],n.includeContainer,{filter:Uv.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:hH}):r=aO(t,n.includeContainer,Uv.bind(null,n)),cO(r)},pH=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Op([t],n.includeContainer,{filter:Hv.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=aO(t,n.includeContainer,Hv.bind(null,n)),r},uO=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return wc.call(t,Rp)===!1?!1:Uv(n,t)};const Pc=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function dO(e,t){const n=Vd(e,Pc()),r=n.length;if(r===0)return;const a=ni(Qt(e)),o=n.indexOf(a),l=o===-1?t===1?0:r-1:o+t;return n[l]}function s0(e){return dO(Qt(e).body,1)||e}function fO(e){return dO(Qt(e).body,-1)||e}function hO(e,t){if(!e)return null;const n=Vd(Qt(e).body,Pc()),r=n.length;if(r===0)return null;const a=n.indexOf(e);if(a===-1)return null;const o=(a+t+r)%r;return n[o]}function mH(e){return hO(e,1)}function gH(e){return hO(e,-1)}function Zl(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Dt(n,r)}function yH(e){Vd(e,Pc()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function QT(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const Ah=null;class bH{constructor(){at(this,"callbacks",[]);at(this,"callbacksCount",0);at(this,"nextId",1);at(this,"startId",1);at(this,"isScheduled",!1);at(this,"tick",t=>{var a;this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let o=0;o<n.length;o+=1)(a=n[o])==null||a.call(n,t)})}request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,(!this.isScheduled||!1)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const Nh=new bH;class Fn{constructor(){at(this,"currentId",Ah);at(this,"cancel",()=>{this.currentId!==Ah&&(Nh.cancel(this.currentId),this.currentId=Ah)});at(this,"disposeEffect",()=>this.cancel)}static create(){return new Fn}static request(t){return Nh.request(t)}static cancel(t){return Nh.cancel(t)}request(t){this.cancel(),this.currentId=Nh.request(()=>{this.currentId=Ah,t()})}}function $d(){const e=nr(Fn.create).current;return om(e.disposeEffect),e}function Pa(e){return e==null?e:"current"in e?e.current:e}let $s=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const vH={[$s.startingStyle]:""},xH={[$s.endingStyle]:""},Ya={transitionStatus(e){return e==="starting"?vH:e==="ending"?xH:null}};function pO(e,t=!1,n=!0){const r=$d();return Ye((a,o=null)=>{r.cancel();function l(){pr.flushSync(a)}const c=Pa(e);if(c==null)return;const f=c;if(typeof f.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)a();else{let d=function(){const h=$s.startingStyle;if(!f.hasAttribute(h)){r.request(m);return}const y=new MutationObserver(()=>{f.hasAttribute(h)||(y.disconnect(),m())});y.observe(f,{attributes:!0,attributeFilter:[h]}),o==null||o.addEventListener("abort",()=>y.disconnect(),{once:!0})},m=function(){Promise.all(f.getAnimations().map(h=>h.finished)).then(()=>{o!=null&&o.aborted||l()}).catch(()=>{const h=f.getAnimations();if(n){if(o!=null&&o.aborted)return;l()}else h.length>0&&h.some(y=>y.pending||y.playState!=="finished")&&m()})};if(t){d();return}r.request(m)}})}function Wa(e){const{enabled:t=!0,open:n,ref:r,onComplete:a}=e,o=Ye(a),l=pO(r,n,!1);v.useEffect(()=>{if(!t)return;const c=new AbortController;return l(o,c.signal),()=>{c.abort()}},[t,n,o,l])}function Yd(e,t=!1,n=!1){const[r,a]=v.useState(e&&t?"idle":void 0),[o,l]=v.useState(e);return e&&!o&&(l(!0),a("starting")),!e&&o&&r!=="ending"&&!n&&a("ending"),!e&&!o&&r==="ending"&&a(void 0),qe(()=>{if(!e&&o&&r!=="ending"&&n){const c=Fn.request(()=>{a("ending")});return()=>{Fn.cancel(c)}}},[e,o,r,n]),qe(()=>{if(!e||t)return;const c=Fn.request(()=>{a(void 0)});return()=>{Fn.cancel(c)}},[t,e]),qe(()=>{if(!e||!t)return;e&&o&&r!=="idle"&&a("starting");const c=Fn.request(()=>{a("idle")});return()=>{Fn.cancel(c)}},[t,e,o,a,r]),v.useMemo(()=>({mounted:o,setMounted:l,transitionStatus:r}),[o,r])}function Sc({controlled:e,default:t,name:n,state:r="value"}){const{current:a}=v.useRef(e!==void 0),[o,l]=v.useState(t),c=a?e:o,f=v.useCallback(d=>{a||l(d)},[]);return[c,f]}function cm(e={}){const{id:t,implicit:n=!1,controlRef:r}=e,{controlId:a,registerControlId:o}=am(),l=Vi(t),c=n?a:void 0,f=nr(()=>Symbol("labelable-control")),d=v.useRef(!1),m=v.useRef(t!=null),h=Ye(()=>{!d.current||o===Br||(d.current=!1,o(f.current,void 0))});return qe(()=>{if(o===Br)return;let y;if(n){const g=r==null?void 0:r.current;un(g)&&g.closest("label")!=null?y=t??null:y=c??l}else if(t!=null)m.current=!0,y=t;else if(m.current)y=l;else{h();return}if(y===void 0){h();return}d.current=!0,o(f.current,y)},[t,r,c,o,n,l,f,h]),v.useEffect(()=>h,[h]),a??l}function l0(e){const{enabled:t=!0,value:n,id:r,name:a,controlRef:o,commit:l}=e,{formRef:c}=n0(),{invalid:f,markedDirtyRef:d,validityData:m,setValidityData:h}=Dc(),y=Ye(e.getValue);qe(()=>{if(!t)return;let g=n;g===void 0&&(g=y()),m.initialValue===null&&g!==null&&h(w=>({...w,initialValue:g}))},[t,h,n,m.initialValue,y]),qe(()=>{!t||!r||c.current.fields.set(r,{getValue:y,name:a,controlRef:o,validityData:LB(m,f),validate(g=!0){let w=n;w===void 0&&(w=y()),d.current=!0,g?pr.flushSync(()=>l(w)):l(w)}})},[l,o,t,c,y,r,f,d,a,m,n]),qe(()=>{const g=c.current.fields;return()=>{r&&g.delete(r)}},[c,r])}const Fi="none",Ys="trigger-press",vr="trigger-hover",Jl="trigger-focus",um="outside-press",id="item-press",wH="close-press",Ws="focus-out",dm="escape-key",rp="list-navigation",mO="cancel-open",ip="sibling-open",SH="disabled",c0="imperative-action",EH="window-resize";function xt(e,t,n,r){let a=!1,o=!1;const l=r??In;return{reason:e,event:t??new Event("base-ui"),cancel(){a=!0},allowPropagation(){o=!0},get isCanceled(){return a},get isPropagationAllowed(){return o},trigger:n,...l}}const CH=v.forwardRef(function(t,n){const{render:r,className:a,id:o,name:l,value:c,disabled:f=!1,onValueChange:d,defaultValue:m,autoFocus:h=!1,...y}=t,{state:g,name:w,disabled:C,setTouched:T,setDirty:E,validityData:R,setFocused:k,setFilled:M,validationMode:D,validation:O}=Dc(),A=C||f,L=w??l,q={...g,disabled:A},{labelId:F}=am(),W=cm({id:o});qe(()=>{var H;const z=c!=null;(H=O.inputRef.current)!=null&&H.value||z&&c!==""?M(!0):z&&c===""&&M(!1)},[O.inputRef,M,c]);const _=v.useRef(null);qe(()=>{h&&_.current===ni(Qt(_.current))&&k(!0)},[h,k]);const[V]=Sc({controlled:c,default:m,name:"FieldControl",state:"value"}),$=c!==void 0,B=$?V:void 0;return l0({id:W,name:L,commit:O.commit,value:B,getValue:()=>{var z;return(z=O.inputRef.current)==null?void 0:z.value},controlRef:O.inputRef}),It("input",t,{ref:[n,_],state:q,props:[{id:W,disabled:A,name:L,ref:O.inputRef,"aria-labelledby":F,autoFocus:h,...$?{value:B}:{defaultValue:m},onChange(z){const H=z.currentTarget.value;d==null||d(H,xt(Fi,z.nativeEvent)),E(H!==R.initialValue),M(H!=="")},onFocus(){k(!0)},onBlur(z){T(!0),k(!1),D==="onBlur"&&O.commit(z.currentTarget.value)},onKeyDown(z){z.currentTarget.tagName==="INPUT"&&z.key==="Enter"&&(T(!0),O.commit(z.currentTarget.value))}},O.getInputValidationProps(),y],stateAttributesMapping:t0})}),TH=v.forwardRef(function(t,n){return S.jsx(CH,{ref:n,...t})});function Pi({className:e,type:t,...n}){return S.jsx(TH,{type:t,"data-slot":"input",className:Pe("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 gO=v.forwardRef(function(t,n){const{className:r,render:a,orientation:o="horizontal",...l}=t;return It("div",t,{state:{orientation:o},ref:n,props:[{role:"separator","aria-orientation":o},l]})});function RH({className:e,orientation:t="horizontal",...n}){return S.jsx(gO,{"data-slot":"separator",orientation:t,className:Pe("bg-border shrink-0 data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",e),...n})}const u0=v.createContext(void 0);function Xo(e){const t=v.useContext(u0);if(e===!1&&t===void 0)throw new Error(Cn(27));return t}let Rs=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=$s.startingStyle]="startingStyle",e[e.endingStyle=$s.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),Ap=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const kH={[Ap.popupOpen]:""},MH={[Ap.popupOpen]:"",[Ap.pressed]:""},OH={[Rs.open]:""},AH={[Rs.closed]:""},NH={[Rs.anchorHidden]:""},yO={open(e){return e?kH:null}},qv={open(e){return e?MH:null}},ua={open(e){return e?OH:AH},anchorHidden(e){return e?NH:null}},DH={...ua,...Ya},d0=v.forwardRef(function(t,n){const{render:r,className:a,forceRender:o=!1,...l}=t,{store:c}=Xo(),f=c.useState("open"),d=c.useState("nested"),m=c.useState("mounted"),h=c.useState("transitionStatus");return It("div",t,{state:{open:f,transitionStatus:h},ref:[c.context.backdropRef,n],stateAttributesMapping:DH,props:[{role:"presentation",hidden:!m,style:{userSelect:"none",WebkitUserSelect:"none"}},l],enabled:o||!d})}),fm=v.forwardRef(function(t,n){const{render:r,className:a,disabled:o=!1,nativeButton:l=!0,...c}=t,{store:f}=Xo(),d=f.useState("open");function m(w){d&&f.setOpen(!1,xt(wH,w.nativeEvent))}const{getButtonProps:h,buttonRef:y}=$a({disabled:o,native:l});return It("button",t,{state:{disabled:o},ref:[n,y],props:[{onClick:m},c,h]})}),f0=v.forwardRef(function(t,n){const{render:r,className:a,id:o,...l}=t,{store:c}=Xo(),f=Vi(o);return c.useSyncedValueWithCleanup("descriptionElementId",f),It("p",t,{ref:n,props:[{id:f},l]})});function sr(e){const t=nr(IH,e).current;return t.next=e,qe(t.effect),t}function IH(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function bO(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(a=>a(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}class h0{constructor(){at(this,"nodesRef",{current:[]});at(this,"events",bO())}addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(r=>r===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const vO=v.createContext(null),xO=v.createContext(null),Ka=()=>{var e;return((e=v.useContext(vO))==null?void 0:e.id)||null},Qo=e=>{const t=v.useContext(xO);return e??t};function wO(e){const t=nl(),n=Qo(e),r=Ka();return qe(()=>{if(!t)return;const a={id:t,parentId:r};return n==null||n.addNode(a),()=>{n==null||n.removeNode(a)}},[n,t,r]),t}function PH(e){const{children:t,id:n}=e,r=Ka();return S.jsx(vO.Provider,{value:v.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function LH(e){const{children:t,externalTree:n}=e,r=nr(()=>n??new h0).current;return S.jsx(xO.Provider,{value:r,children:t})}function Ec(e){return`data-base-ui-${e}`}function ap(e,t,n){if(n&&!Vs(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const r=e();return typeof r=="number"?r:r==null?void 0:r[t]}return e==null?void 0:e[t]}const _H=v.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new sa,currentIdRef:{current:null},currentContextRef:{current:null}});function jH(e,t={open:!1}){const n="rootStore"in e?e.rootStore:e,r=n.useState("floatingId"),{open:a}=t,o=v.useContext(_H),{currentIdRef:l,delayRef:c,timeoutMs:f,initialDelayRef:d,currentContextRef:m,hasProvider:h,timeout:y}=o,[g,w]=v.useState(!1);return qe(()=>{function C(){var T;w(!1),(T=m.current)==null||T.setIsInstantPhase(!1),l.current=null,m.current=null,c.current=d.current}if(l.current&&!a&&l.current===r){if(w(!1),f){const T=r;return y.start(f,()=>{n.select("open")||l.current&&l.current!==T||C()}),()=>{y.clear()}}C()}},[a,r,l,c,f,d,m,y,n]),qe(()=>{if(!a)return;const C=m.current,T=l.current;y.clear(),m.current={onOpenChange:n.setOpen,setIsInstantPhase:w},l.current=r,c.current={open:0,close:ap(d.current,"close")},T!==null&&T!==r?(w(!0),C==null||C.setIsInstantPhase(!0),C==null||C.onOpenChange(!1,xt(Fi))):(w(!1),C==null||C.setIsInstantPhase(!1))},[a,r,n,l,c,f,d,m,y]),qe(()=>()=>{m.current=null},[m]),v.useMemo(()=>({hasProvider:h,delayRef:c,isInstantPhase:g}),[h,c,g])}const SO={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},hm={...SO,position:"fixed",top:0,left:0},EO={...SO,position:"absolute"},Cc=v.forwardRef(function(t,n){const[r,a]=v.useState();qe(()=>{$2&&a("button")},[]);const o={tabIndex:0,role:r};return S.jsx("span",{...t,ref:n,style:hm,"aria-hidden":r?void 0:!0,...o,"data-base-ui-focus-guard":""})});let ZT=0;function ad(e,t={}){const{preventScroll:n=!1,cancelPrevious:r=!0,sync:a=!1}=t;r&&cancelAnimationFrame(ZT);const o=()=>e==null?void 0:e.focus({preventScroll:n});a?o():ZT=requestAnimationFrame(o)}const ec={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function JT(e){return e==="inert"?ec.inert:e==="aria-hidden"?ec["aria-hidden"]:ec.none}let Dh=new WeakSet,Ih={},pb=0;const CO=e=>e&&(e.host||CO(e.parentNode)),zH=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=CO(n);return e.contains(r)?r:null}).filter(n=>n!=null);function FH(e,t,n,r){const a="data-base-ui-inert",o=r?"inert":n?"aria-hidden":null,l=zH(t,e),c=new Set,f=new Set(l),d=[];Ih[a]||(Ih[a]=new WeakMap);const m=Ih[a];l.forEach(h),y(t),c.clear();function h(g){!g||c.has(g)||(c.add(g),g.parentNode&&h(g.parentNode))}function y(g){!g||f.has(g)||[].forEach.call(g.children,w=>{if(Wo(w)!=="script")if(c.has(w))y(w);else{const C=o?w.getAttribute(o):null,T=C!==null&&C!=="false",E=JT(o),R=(E.get(w)||0)+1,k=(m.get(w)||0)+1;E.set(w,R),m.set(w,k),d.push(w),R===1&&T&&Dh.add(w),k===1&&w.setAttribute(a,""),!T&&o&&w.setAttribute(o,o==="inert"?"":"true")}})}return pb+=1,()=>{d.forEach(g=>{const w=JT(o),T=(w.get(g)||0)-1,E=(m.get(g)||0)-1;w.set(g,T),m.set(g,E),T||(!Dh.has(g)&&o&&g.removeAttribute(o),Dh.delete(g)),E||g.removeAttribute(a)}),pb-=1,pb||(ec.inert=new WeakMap,ec["aria-hidden"]=new WeakMap,ec.none=new WeakMap,Dh=new WeakSet,Ih={})}}function BH(e,t=!1,n=!1){const r=Qt(e[0]).body;return FH(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const TO=v.createContext(null),RO=()=>v.useContext(TO),HH=Ec("portal");function kO(e={}){const{ref:t,container:n,componentProps:r=In,elementProps:a}=e,o=nl(),l=RO(),c=l==null?void 0:l.portalNode,[f,d]=v.useState(null),[m,h]=v.useState(null),y=Ye(T=>{T!==null&&h(T)}),g=v.useRef(null);qe(()=>{if(n===null){g.current&&(g.current=null,h(null),d(null));return}if(o==null)return;const T=(n&&(Zx(n)?n:n.current))??c??document.body;if(T==null){g.current&&(g.current=null,h(null),d(null));return}g.current!==T&&(g.current=T,h(null),d(T))},[n,c,o]);const w=It("div",r,{ref:[t,y],props:[{id:o,[HH]:""},a]});return{portalNode:m,portalSubtree:f&&w?pr.createPortal(w,f):null}}const p0=v.forwardRef(function(t,n){const{children:r,container:a,className:o,render:l,renderGuards:c,...f}=t,{portalNode:d,portalSubtree:m}=kO({container:a,ref:n,componentProps:t,elementProps:f}),h=v.useRef(null),y=v.useRef(null),g=v.useRef(null),w=v.useRef(null),[C,T]=v.useState(null),E=C==null?void 0:C.modal,R=C==null?void 0:C.open,k=typeof c=="boolean"?c:!!C&&!C.modal&&C.open&&!!d;v.useEffect(()=>{if(!d||E)return;function D(O){d&&O.relatedTarget&&Zl(O)&&(O.type==="focusin"?QT:yH)(d)}return d.addEventListener("focusin",D,!0),d.addEventListener("focusout",D,!0),()=>{d.removeEventListener("focusin",D,!0),d.removeEventListener("focusout",D,!0)}},[d,E]),v.useEffect(()=>{!d||R||QT(d)},[R,d]);const M=v.useMemo(()=>({beforeOutsideRef:h,afterOutsideRef:y,beforeInsideRef:g,afterInsideRef:w,portalNode:d,setFocusManagerState:T}),[d]);return S.jsxs(v.Fragment,{children:[m,S.jsxs(TO.Provider,{value:M,children:[k&&d&&S.jsx(Cc,{"data-type":"outside",ref:h,onFocus:D=>{var O;if(Zl(D,d))(O=g.current)==null||O.focus();else{const A=C?C.domReference:null,L=fO(A);L==null||L.focus()}}}),k&&d&&S.jsx("span",{"aria-owns":d.id,style:yF}),d&&pr.createPortal(r,d),k&&d&&S.jsx(Cc,{"data-type":"outside",ref:y,onFocus:D=>{var O;if(Zl(D,d))(O=w.current)==null||O.focus();else{const A=C?C.domReference:null,L=s0(A);L==null||L.focus(),C!=null&&C.closeOnFocusOut&&(C==null||C.onOpenChange(!1,xt(Ws,D.nativeEvent)))}}})]})]})});function UH(e,t){const n=Hn(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 eR=20;let jo=[];function m0(){jo=jo.filter(e=>{var t;return(t=e.deref())==null?void 0:t.isConnected})}function qH(e){m0(),e&&Wo(e)!=="body"&&(jo.push(new WeakRef(e)),jo.length>eR&&(jo=jo.slice(-eR)))}function mb(){var e;return m0(),(e=jo[jo.length-1])==null?void 0:e.deref()}function VH(e){if(!e)return null;const t=Pc();return uO(e,t)?e:Vd(e,t)[0]||e}function $H(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():ai(e).display!=="none"}function tR(e,t){var l;if(!t.current.includes("floating")&&!((l=e.getAttribute("role"))!=null&&l.includes("dialog")))return;const n=Pc(),a=pH(e,n).filter(c=>{const f=c.getAttribute("data-tabindex")||"";return uO(c,n)||c.hasAttribute("data-tabindex")&&!f.startsWith("-")}),o=e.getAttribute("tabindex");t.current.includes("floating")||a.length===0?o!=="0"&&e.setAttribute("tabindex","0"):(o!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function g0(e){const{context:t,children:n,disabled:r=!1,initialFocus:a=!0,returnFocus:o=!0,restoreFocus:l=!1,modal:c=!0,closeOnFocusOut:f=!0,openInteractionType:d="",nextFocusableElement:m,previousFocusableElement:h,beforeContentFocusGuardRef:y,externalTree:g}=e,w="rootStore"in t?t.rootStore:t,C=w.useState("open"),T=w.useState("domReferenceElement"),E=w.useState("floatingElement"),{events:R,dataRef:k}=w.context,M=Ye(()=>{var he;return(he=k.current.floatingContext)==null?void 0:he.nodeId}),D=a===!1,O=jv(T)&&D,A=v.useRef(["content"]),L=sr(a),q=sr(o),F=sr(d),W=Qo(g),_=RO(),V=v.useRef(null),$=v.useRef(null),B=v.useRef(!1),j=v.useRef(!1),z=v.useRef(!1),H=v.useRef(-1),K=v.useRef(""),P=v.useRef(""),U=v.useRef(null),G=v.useRef(null),I=zi(U,y,_==null?void 0:_.beforeInsideRef),Q=zi(G,_==null?void 0:_.afterInsideRef),le=Bn(),ae=Bn(),Z=$d(),ue=_!=null,ve=Ed(E),Se=Ye((he=ve)=>he?Vd(he,Pc()):[]),Le=Ye(he=>{const ye=Se(he);return A.current.map(()=>ye).filter(Boolean).flat()});v.useEffect(()=>{if(r||!c)return;function he(_e){_e.key==="Tab"&&Dt(ve,ni(Qt(ve)))&&Se().length===0&&!O&&br(_e)}const ye=Qt(ve);return ye.addEventListener("keydown",he),()=>{ye.removeEventListener("keydown",he)}},[r,T,ve,c,A,O,Se,Le]),v.useEffect(()=>{if(r||!C)return;const he=Qt(ve);function ye(){z.current=!1}function _e(Ce){const Re=Rr(Ce),J=Dt(E,Re)||Dt(T,Re)||Dt(_==null?void 0:_.portalNode,Re);z.current=!J,P.current=Ce.pointerType||"keyboard",Re!=null&&Re.closest(`[${gF}]`)&&(j.current=!0)}function Oe(){P.current="keyboard"}return he.addEventListener("pointerdown",_e,!0),he.addEventListener("pointerup",ye,!0),he.addEventListener("pointercancel",ye,!0),he.addEventListener("keydown",Oe,!0),()=>{he.removeEventListener("pointerdown",_e,!0),he.removeEventListener("pointerup",ye,!0),he.removeEventListener("pointercancel",ye,!0),he.removeEventListener("keydown",Oe,!0)}},[r,E,T,ve,C,_]),v.useEffect(()=>{if(r||!f)return;const he=Qt(ve);function ye(){j.current=!0,ae.start(0,()=>{j.current=!1})}function _e(Ee){const xe=Rr(Ee),Ve=Se().indexOf(xe);Ve!==-1&&(H.current=Ve)}function Oe(Ee){const xe=Ee.relatedTarget,Be=Ee.currentTarget,Ve=Rr(Ee);queueMicrotask(()=>{const De=M(),ut=w.context.triggerElements,pe=(xe==null?void 0:xe.hasAttribute(Ec("focus-guard")))&&[U.current,G.current,_==null?void 0:_.beforeInsideRef.current,_==null?void 0:_.afterInsideRef.current,_==null?void 0:_.beforeOutsideRef.current,_==null?void 0:_.afterOutsideRef.current,Pa(h),Pa(m)].includes(xe),Te=!(Dt(T,xe)||Dt(E,xe)||Dt(xe,E)||Dt(_==null?void 0:_.portalNode,xe)||xe!=null&&ut.hasElement(xe)||ut.hasMatchingElement(ee=>Dt(ee,xe))||pe||W&&(js(W.nodesRef.current,De).find(ee=>{var fe,Ae;return Dt((fe=ee.context)==null?void 0:fe.elements.floating,xe)||Dt((Ae=ee.context)==null?void 0:Ae.elements.domReference,xe)})||WT(W.nodesRef.current,De).find(ee=>{var fe,Ae,He;return[(fe=ee.context)==null?void 0:fe.elements.floating,Ed((Ae=ee.context)==null?void 0:Ae.elements.floating)].includes(xe)||((He=ee.context)==null?void 0:He.elements.domReference)===xe})));if(Be===T&&ve&&tR(ve,A),l&&Be!==T&&!$H(Ve)&&ni(he)===he.body){if(Mn(ve)&&(ve.focus(),l==="popup")){Z.request(()=>{ve.focus()});return}const ee=H.current,fe=Se(),Ae=fe[ee]||fe[fe.length-1]||ve;Mn(Ae)&&Ae.focus()}if(k.current.insideReactTree){k.current.insideReactTree=!1;return}(O||!c)&&xe&&Te&&!j.current&&(O||xe!==mb())&&(B.current=!0,w.setOpen(!1,xt(Ws,Ee)))})}function Ce(){z.current||(k.current.insideReactTree=!0,le.start(0,()=>{k.current.insideReactTree=!1}))}const Re=Mn(T)?T:null,J=[];if(!(!E&&!Re))return Re&&(Re.addEventListener("focusout",Oe),Re.addEventListener("pointerdown",ye),J.push(()=>{Re.removeEventListener("focusout",Oe),Re.removeEventListener("pointerdown",ye)})),E&&(E.addEventListener("focusin",_e),E.addEventListener("focusout",Oe),_&&(E.addEventListener("focusout",Ce,!0),J.push(()=>{E.removeEventListener("focusout",Ce,!0)})),J.push(()=>{E.removeEventListener("focusin",_e),E.removeEventListener("focusout",Oe)})),()=>{J.forEach(Ee=>{Ee()})}},[r,T,E,ve,c,W,_,w,f,l,Se,O,M,A,k,le,ae,Z,m,h]),v.useEffect(()=>{var Ce,Re,J;if(r||!E||!C)return;const he=Array.from(((Ce=_==null?void 0:_.portalNode)==null?void 0:Ce.querySelectorAll(`[${Ec("portal")}]`))||[]),_e=(J=(Re=(W?WT(W.nodesRef.current,M()):[]).find(Ee=>{var xe;return jv(((xe=Ee.context)==null?void 0:xe.elements.domReference)||null)}))==null?void 0:Re.context)==null?void 0:J.elements.domReference,Oe=[E,_e,...he,V.current,$.current,U.current,G.current,_==null?void 0:_.beforeOutsideRef.current,_==null?void 0:_.afterOutsideRef.current,Pa(h),Pa(m),O?T:null].filter(Ee=>Ee!=null);return BH(Oe,c||O)},[C,r,T,E,c,A,_,O,W,M,m,h]),qe(()=>{if(!C||r||!Mn(ve))return;const he=Qt(ve),ye=ni(he);queueMicrotask(()=>{const _e=Le(ve),Oe=L.current,Ce=typeof Oe=="function"?Oe(F.current||""):Oe;if(Ce===void 0||Ce===!1)return;let Re;Ce===!0||Ce===null?Re=_e[0]||ve:Re=Pa(Ce),Re=Re||_e[0]||ve,!Dt(ve,ye)&&ad(Re,{preventScroll:Re===ve})})},[r,C,ve,D,Le,L,F]),qe(()=>{if(r||!ve)return;const he=Qt(ve),ye=ni(he);qH(ye);function _e(Re){if(Re.open||(K.current=UH(Re.nativeEvent,P.current)),Re.reason===vr&&Re.nativeEvent.type==="mouseleave"&&(B.current=!0),Re.reason===um)if(Re.nested)B.current=!1;else if(X2(Re.nativeEvent)||Q2(Re.nativeEvent))B.current=!1;else{let J=!1;document.createElement("div").focus({get preventScroll(){return J=!0,!1}}),J?B.current=!1:B.current=!0}}R.on("openchange",_e);const Oe=he.createElement("span");Oe.setAttribute("tabindex","-1"),Oe.setAttribute("aria-hidden","true"),Object.assign(Oe.style,hm),ue&&T&&T.insertAdjacentElement("afterend",Oe);function Ce(){const Re=q.current;let J=typeof Re=="function"?Re(K.current):Re;if(J===void 0||J===!1)return null;if(J===null&&(J=!0),typeof J=="boolean"){const xe=T||mb();return xe&&xe.isConnected?xe:Oe}const Ee=T||mb()||Oe;return Pa(J)||Ee}return()=>{R.off("openchange",_e);const Re=ni(he),J=Dt(E,Re)||W&&js(W.nodesRef.current,M(),!1).some(xe=>{var Be;return Dt((Be=xe.context)==null?void 0:Be.elements.floating,Re)}),Ee=Ce();queueMicrotask(()=>{const xe=VH(Ee),Be=typeof q.current!="boolean";q.current&&!B.current&&Mn(xe)&&(!(!Be&&xe!==Re&&Re!==he.body)||J)&&xe.focus({preventScroll:!0}),Oe.remove(),B.current=!1})}},[r,E,ve,q,k,R,W,ue,T,M]),qe(()=>{if(!sm||C||!E)return;const he=ni(Qt(E));!Mn(he)||!lm(he)||Dt(E,he)&&he.blur()},[C,E]),qe(()=>{if(!(r||!_))return _.setFocusManagerState({modal:c,closeOnFocusOut:f,open:C,onOpenChange:w.setOpen,domReference:T}),()=>{_.setFocusManagerState(null)}},[r,_,c,C,w,f,T]),qe(()=>{if(!(r||!ve))return tR(ve,A),()=>{queueMicrotask(m0)}},[r,ve,A]);const te=!r&&(c?!O:!0)&&(ue||c);return S.jsxs(v.Fragment,{children:[te&&S.jsx(Cc,{"data-type":"inside",ref:I,onFocus:he=>{var ye;if(c){const _e=Le();ad(_e[_e.length-1])}else if(_!=null&&_.portalNode)if(B.current=!1,Zl(he,_.portalNode)){const _e=s0(T);_e==null||_e.focus()}else(ye=Pa(h??_.beforeOutsideRef))==null||ye.focus()}}),n,te&&S.jsx(Cc,{"data-type":"inside",ref:Q,onFocus:he=>{var ye;if(c)ad(Le()[0]);else if(_!=null&&_.portalNode)if(f&&(B.current=!0),Zl(he,_.portalNode)){const _e=fO(T);_e==null||_e.focus()}else(ye=Pa(m??_.afterOutsideRef))==null||ye.focus()}})]})}function MO(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.context.dataRef,{enabled:a=!0,event:o="click",toggle:l=!0,ignoreMouse:c=!1,stickIfOpen:f=!0,touchOpenDelay:d=0,reason:m=Ys}=t,h=v.useRef(void 0),y=$d(),g=Bn(),w=v.useMemo(()=>({onPointerDown(C){h.current=C.pointerType},onMouseDown(C){const T=h.current,E=C.nativeEvent,R=n.select("open");if(C.button!==0||o==="click"||Vs(T,!0)&&c)return;const k=r.current.openEvent,M=k==null?void 0:k.type,D=n.select("domReferenceElement")!==C.currentTarget,O=R&&D||!(R&&l&&(!(k&&f)||M==="click"||M==="mousedown"));if(lm(E.target)){const L=xt(m,E,E.target);O&&T==="touch"&&d>0?g.start(d,()=>{n.setOpen(!0,L)}):n.setOpen(O,L);return}const A=C.currentTarget;y.request(()=>{const L=xt(m,E,A);O&&T==="touch"&&d>0?g.start(d,()=>{n.setOpen(!0,L)}):n.setOpen(O,L)})},onClick(C){if(o==="mousedown-only")return;const T=h.current;if(o==="mousedown"&&T){h.current=void 0;return}if(Vs(T,!0)&&c)return;const E=n.select("open"),R=r.current.openEvent,k=n.select("domReferenceElement")!==C.currentTarget,M=E&&k||!(E&&l&&(!(R&&f)||Z2(R))),D=xt(m,C.nativeEvent,C.currentTarget);M&&T==="touch"&&d>0?g.start(d,()=>{n.setOpen(!0,D)}):n.setOpen(M,D)},onKeyDown(){h.current=void 0}}),[r,o,c,n,f,l,y,g,d,m]);return v.useMemo(()=>a?{reference:w}:In,[a,w])}function YH(e,t){let n=null,r=null,a=!1;return{contextElement:e||void 0,getBoundingClientRect(){var g;const o=(e==null?void 0:e.getBoundingClientRect())||{width:0,height:0,x:0,y:0},l=t.axis==="x"||t.axis==="both",c=t.axis==="y"||t.axis==="both",f=["mouseenter","mousemove"].includes(((g=t.dataRef.current.openEvent)==null?void 0:g.type)||"")&&t.pointerType!=="touch";let d=o.width,m=o.height,h=o.x,y=o.y;return n==null&&t.x&&l&&(n=o.x-t.x),r==null&&t.y&&c&&(r=o.y-t.y),h-=n||0,y-=r||0,d=0,m=0,!a||f?(d=t.axis==="y"?o.width:0,m=t.axis==="x"?o.height:0,h=l&&t.x!=null?t.x:h,y=c&&t.y!=null?t.y:y):a&&!f&&(m=t.axis==="x"?o.height:m,d=t.axis==="y"?o.width:d),a=!0,{width:d,height:m,x:h,y,top:y,right:h+d,bottom:y+m,left:h}}}}function nR(e){return e!=null&&e.clientX!=null}function WH(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),a=n.useState("floatingElement"),o=n.useState("domReferenceElement"),l=n.context.dataRef,{enabled:c=!0,axis:f="both"}=t,d=v.useRef(!1),m=v.useRef(null),[h,y]=v.useState(),[g,w]=v.useState([]),C=Ye((M,D,O)=>{d.current||l.current.openEvent&&!nR(l.current.openEvent)||n.set("positionReference",YH(O??o,{x:M,y:D,axis:f,dataRef:l,pointerType:h}))}),T=Ye(M=>{r?m.current||w([]):C(M.clientX,M.clientY,M.currentTarget)}),E=Vs(h)?a:r,R=v.useCallback(()=>{if(!E||!c)return;const M=Hn(a);function D(O){const A=Rr(O);Dt(a,A)?(M.removeEventListener("mousemove",D),m.current=null):C(O.clientX,O.clientY)}if(!l.current.openEvent||nR(l.current.openEvent)){M.addEventListener("mousemove",D);const O=()=>{M.removeEventListener("mousemove",D),m.current=null};return m.current=O,O}n.set("positionReference",o)},[E,c,a,l,o,n,C]);v.useEffect(()=>R(),[R,g]),v.useEffect(()=>{c&&!a&&(d.current=!1)},[c,a]),v.useEffect(()=>{!c&&r&&(d.current=!0)},[c,r]);const k=v.useMemo(()=>{function M(D){y(D.pointerType)}return{onPointerDown:M,onPointerEnter:M,onMouseMove:T,onMouseEnter:T}},[T]);return v.useMemo(()=>c?{reference:k,trigger:k}:{},[c,k])}function rR(e,t,n){let{reference:r,floating:a}=e;const o=wi(t),l=o0(t),c=a0(l),f=Hr(t),d=o==="y",m=r.x+r.width/2-a.width/2,h=r.y+r.height/2-a.height/2,y=r[c]/2-a[c]/2;let g;switch(f){case"top":g={x:m,y:r.y-a.height};break;case"bottom":g={x:m,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:h};break;case"left":g={x:r.x-a.width,y:h};break;default:g={x:r.x,y:r.y}}switch(Go(t)){case"start":g[l]-=y*(n&&d?-1:1);break;case"end":g[l]+=y*(n&&d?-1:1);break}return g}async function KH(e,t){var n;t===void 0&&(t={});const{x:r,y:a,platform:o,rects:l,elements:c,strategy:f}=e,{boundary:d="clippingAncestors",rootBoundary:m="viewport",elementContext:h="floating",altBoundary:y=!1,padding:g=0}=qa(t,e),w=J2(g),T=c[y?h==="floating"?"reference":"floating":h],E=Tp(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(T)))==null||n?T:T.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(c.floating)),boundary:d,rootBoundary:m,strategy:f})),R=h==="floating"?{x:r,y:a,width:l.floating.width,height:l.floating.height}:l.reference,k=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c.floating)),M=await(o.isElement==null?void 0:o.isElement(k))?await(o.getScale==null?void 0:o.getScale(k))||{x:1,y:1}:{x:1,y:1},D=Tp(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:R,offsetParent:k,strategy:f}):R);return{top:(E.top-D.top+w.top)/M.y,bottom:(D.bottom-E.bottom+w.bottom)/M.y,left:(E.left-D.left+w.left)/M.x,right:(D.right-E.right+w.right)/M.x}}const GH=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:o=[],platform:l}=n,c=o.filter(Boolean),f=await(l.isRTL==null?void 0:l.isRTL(t));let d=await l.getElementRects({reference:e,floating:t,strategy:a}),{x:m,y:h}=rR(d,r,f),y=r,g={},w=0;for(let T=0;T<c.length;T++){var C;const{name:E,fn:R}=c[T],{x:k,y:M,data:D,reset:O}=await R({x:m,y:h,initialPlacement:r,placement:y,strategy:a,middlewareData:g,rects:d,platform:{...l,detectOverflow:(C=l.detectOverflow)!=null?C:KH},elements:{reference:e,floating:t}});m=k??m,h=M??h,g={...g,[E]:{...g[E],...D}},O&&w<=50&&(w++,typeof O=="object"&&(O.placement&&(y=O.placement),O.rects&&(d=O.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:a}):O.rects),{x:m,y:h}=rR(d,y,f)),T=-1)}return{x:m,y:h,placement:y,strategy:a,middlewareData:g}},XH=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:o,rects:l,initialPlacement:c,platform:f,elements:d}=t,{mainAxis:m=!0,crossAxis:h=!0,fallbackPlacements:y,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:C=!0,...T}=qa(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const E=Hr(a),R=wi(c),k=Hr(c)===c,M=await(f.isRTL==null?void 0:f.isRTL(d.floating)),D=y||(k||!C?[Cp(c)]:KB(c)),O=w!=="none";!y&&O&&D.push(...ZB(c,C,w,M));const A=[c,...D],L=await f.detectOverflow(t,T),q=[];let F=((r=o.flip)==null?void 0:r.overflows)||[];if(m&&q.push(L[E]),h){const $=WB(a,l,M);q.push(L[$[0]],L[$[1]])}if(F=[...F,{placement:a,overflows:q}],!q.every($=>$<=0)){var W,_;const $=(((W=o.flip)==null?void 0:W.index)||0)+1,B=A[$];if(B&&(!(h==="alignment"?R!==wi(B):!1)||F.every(H=>wi(H.placement)===R?H.overflows[0]>0:!0)))return{data:{index:$,overflows:F},reset:{placement:B}};let j=(_=F.filter(z=>z.overflows[0]<=0).sort((z,H)=>z.overflows[1]-H.overflows[1])[0])==null?void 0:_.placement;if(!j)switch(g){case"bestFit":{var V;const z=(V=F.filter(H=>{if(O){const K=wi(H.placement);return K===R||K==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(K=>K>0).reduce((K,P)=>K+P,0)]).sort((H,K)=>H[1]-K[1])[0])==null?void 0:V[0];z&&(j=z);break}case"initialPlacement":j=c;break}if(a!==j)return{reset:{placement:j}}}return{}}}};function iR(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function aR(e){return qB.some(t=>e[t]>=0)}const QH=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:a="referenceHidden",...o}=qa(e,t);switch(a){case"referenceHidden":{const l=await r.detectOverflow(t,{...o,elementContext:"reference"}),c=iR(l,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:aR(c)}}}case"escaped":{const l=await r.detectOverflow(t,{...o,altBoundary:!0}),c=iR(l,n.floating);return{data:{escapedOffsets:c,escaped:aR(c)}}}default:return{}}}}},OO=new Set(["left","top"]);async function ZH(e,t){const{placement:n,platform:r,elements:a}=e,o=await(r.isRTL==null?void 0:r.isRTL(a.floating)),l=Hr(n),c=Go(n),f=wi(n)==="y",d=OO.has(l)?-1:1,m=o&&f?-1:1,h=qa(t,e);let{mainAxis:y,crossAxis:g,alignmentAxis:w}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return c&&typeof w=="number"&&(g=c==="end"?w*-1:w),f?{x:g*m,y:y*d}:{x:y*d,y:g*m}}const JH=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:o,placement:l,middlewareData:c}=t,f=await ZH(t,e);return l===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:a+f.x,y:o+f.y,data:{...f,placement:l}}}}},eU=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a,platform:o}=t,{mainAxis:l=!0,crossAxis:c=!1,limiter:f={fn:E=>{let{x:R,y:k}=E;return{x:R,y:k}}},...d}=qa(e,t),m={x:n,y:r},h=await o.detectOverflow(t,d),y=wi(Hr(a)),g=i0(y);let w=m[g],C=m[y];if(l){const E=g==="y"?"top":"left",R=g==="y"?"bottom":"right",k=w+h[E],M=w-h[R];w=zv(k,w,M)}if(c){const E=y==="y"?"top":"left",R=y==="y"?"bottom":"right",k=C+h[E],M=C-h[R];C=zv(k,C,M)}const T=f.fn({...t,[g]:w,[y]:C});return{...T,data:{x:T.x-n,y:T.y-r,enabled:{[g]:l,[y]:c}}}}}},tU=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:o,middlewareData:l}=t,{offset:c=0,mainAxis:f=!0,crossAxis:d=!0}=qa(e,t),m={x:n,y:r},h=wi(a),y=i0(h);let g=m[y],w=m[h];const C=qa(c,t),T=typeof C=="number"?{mainAxis:C,crossAxis:0}:{mainAxis:0,crossAxis:0,...C};if(f){const k=y==="y"?"height":"width",M=o.reference[y]-o.floating[k]+T.mainAxis,D=o.reference[y]+o.reference[k]-T.mainAxis;g<M?g=M:g>D&&(g=D)}if(d){var E,R;const k=y==="y"?"width":"height",M=OO.has(Hr(a)),D=o.reference[h]-o.floating[k]+(M&&((E=l.offset)==null?void 0:E[h])||0)+(M?0:T.crossAxis),O=o.reference[h]+o.reference[k]+(M?0:((R=l.offset)==null?void 0:R[h])||0)-(M?T.crossAxis:0);w<D?w=D:w>O&&(w=O)}return{[y]:g,[h]:w}}}},nU=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:a,rects:o,platform:l,elements:c}=t,{apply:f=()=>{},...d}=qa(e,t),m=await l.detectOverflow(t,d),h=Hr(a),y=Go(a),g=wi(a)==="y",{width:w,height:C}=o.floating;let T,E;h==="top"||h==="bottom"?(T=h,E=y===(await(l.isRTL==null?void 0:l.isRTL(c.floating))?"start":"end")?"left":"right"):(E=h,T=y==="end"?"top":"bottom");const R=C-m.top-m.bottom,k=w-m.left-m.right,M=xc(C-m[T],R),D=xc(w-m[E],k),O=!t.middlewareData.shift;let A=M,L=D;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(L=k),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(A=R),O&&!y){const F=ri(m.left,0),W=ri(m.right,0),_=ri(m.top,0),V=ri(m.bottom,0);g?L=w-2*(F!==0||W!==0?F+W:ri(m.left,m.right)):A=C-2*(_!==0||V!==0?_+V:ri(m.top,m.bottom))}await f({...t,availableWidth:L,availableHeight:A});const q=await l.getDimensions(c.floating);return w!==q.width||C!==q.height?{reset:{rects:!0}}:{}}}};function AO(e){const t=ai(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=Mn(e),o=a?e.offsetWidth:n,l=a?e.offsetHeight:r,c=Ep(n)!==o||Ep(r)!==l;return c&&(n=o,r=l),{width:n,height:r,$:c}}function y0(e){return un(e)?e:e.contextElement}function tc(e){const t=y0(e);if(!Mn(t))return ia(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:o}=AO(t);let l=(o?Ep(n.width):n.width)/r,c=(o?Ep(n.height):n.height)/a;return(!l||!Number.isFinite(l))&&(l=1),(!c||!Number.isFinite(c))&&(c=1),{x:l,y:c}}const rU=ia(0);function NO(e){const t=Hn(e);return!rm()||!t.visualViewport?rU:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function iU(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Hn(e)?!1:t}function Ks(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),o=y0(e);let l=ia(1);t&&(r?un(r)&&(l=tc(r)):l=tc(e));const c=iU(o,n,r)?NO(o):ia(0);let f=(a.left+c.x)/l.x,d=(a.top+c.y)/l.y,m=a.width/l.x,h=a.height/l.y;if(o){const y=Hn(o),g=r&&un(r)?Hn(r):r;let w=y,C=Pv(w);for(;C&&r&&g!==w;){const T=tc(C),E=C.getBoundingClientRect(),R=ai(C),k=E.left+(C.clientLeft+parseFloat(R.paddingLeft))*T.x,M=E.top+(C.clientTop+parseFloat(R.paddingTop))*T.y;f*=T.x,d*=T.y,m*=T.x,h*=T.y,f+=k,d+=M,w=Hn(C),C=Pv(w)}}return Tp({width:m,height:h,x:f,y:d})}function pm(e,t){const n=im(e).scrollLeft;return t?t.left+n:Ks(ca(e)).left+n}function DO(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-pm(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function aU(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const o=a==="fixed",l=ca(r),c=t?nm(t.floating):!1;if(r===l||c&&o)return n;let f={scrollLeft:0,scrollTop:0},d=ia(1);const m=ia(0),h=Mn(r);if((h||!h&&!o)&&((Wo(r)!=="body"||Ko(l))&&(f=im(r)),Mn(r))){const g=Ks(r);d=tc(r),m.x=g.x+r.clientLeft,m.y=g.y+r.clientTop}const y=l&&!h&&!o?DO(l,f):ia(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-f.scrollLeft*d.x+m.x+y.x,y:n.y*d.y-f.scrollTop*d.y+m.y+y.y}}function oU(e){return Array.from(e.getClientRects())}function sU(e){const t=ca(e),n=im(e),r=e.ownerDocument.body,a=ri(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=ri(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+pm(e);const c=-n.scrollTop;return ai(r).direction==="rtl"&&(l+=ri(t.clientWidth,r.clientWidth)-a),{width:a,height:o,x:l,y:c}}const oR=25;function lU(e,t){const n=Hn(e),r=ca(e),a=n.visualViewport;let o=r.clientWidth,l=r.clientHeight,c=0,f=0;if(a){o=a.width,l=a.height;const m=rm();(!m||m&&t==="fixed")&&(c=a.offsetLeft,f=a.offsetTop)}const d=pm(r);if(d<=0){const m=r.ownerDocument,h=m.body,y=getComputedStyle(h),g=m.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,w=Math.abs(r.clientWidth-h.clientWidth-g);w<=oR&&(o-=w)}else d<=oR&&(o+=d);return{width:o,height:l,x:c,y:f}}const cU=new Set(["absolute","fixed"]);function uU(e,t){const n=Ks(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,o=Mn(e)?tc(e):ia(1),l=e.clientWidth*o.x,c=e.clientHeight*o.y,f=a*o.x,d=r*o.y;return{width:l,height:c,x:f,y:d}}function sR(e,t,n){let r;if(t==="viewport")r=lU(e,n);else if(t==="document")r=sU(ca(e));else if(un(t))r=uU(t,n);else{const a=NO(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Tp(r)}function IO(e,t){const n=oa(e);return n===t||!un(n)||ra(n)?!1:ai(n).position==="fixed"||IO(n,t)}function dU(e,t){const n=t.get(e);if(n)return n;let r=Bo(e,[],!1).filter(c=>un(c)&&Wo(c)!=="body"),a=null;const o=ai(e).position==="fixed";let l=o?oa(e):e;for(;un(l)&&!ra(l);){const c=ai(l),f=Jx(l);!f&&c.position==="fixed"&&(a=null),(o?!f&&!a:!f&&c.position==="static"&&!!a&&cU.has(a.position)||Ko(l)&&!f&&IO(e,l))?r=r.filter(m=>m!==l):a=c,l=oa(l)}return t.set(e,r),r}function fU(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const l=[...n==="clippingAncestors"?nm(t)?[]:dU(t,this._c):[].concat(n),r],c=l[0],f=l.reduce((d,m)=>{const h=sR(t,m,a);return d.top=ri(h.top,d.top),d.right=xc(h.right,d.right),d.bottom=xc(h.bottom,d.bottom),d.left=ri(h.left,d.left),d},sR(t,c,a));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function hU(e){const{width:t,height:n}=AO(e);return{width:t,height:n}}function pU(e,t,n){const r=Mn(t),a=ca(t),o=n==="fixed",l=Ks(e,!0,o,t);let c={scrollLeft:0,scrollTop:0};const f=ia(0);function d(){f.x=pm(a)}if(r||!r&&!o)if((Wo(t)!=="body"||Ko(a))&&(c=im(t)),r){const g=Ks(t,!0,o,t);f.x=g.x+t.clientLeft,f.y=g.y+t.clientTop}else a&&d();o&&!r&&a&&d();const m=a&&!r&&!o?DO(a,c):ia(0),h=l.left+c.scrollLeft-f.x-m.x,y=l.top+c.scrollTop-f.y-m.y;return{x:h,y,width:l.width,height:l.height}}function gb(e){return ai(e).position==="static"}function lR(e,t){if(!Mn(e)||ai(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ca(e)===n&&(n=n.ownerDocument.body),n}function PO(e,t){const n=Hn(e);if(nm(e))return n;if(!Mn(e)){let a=oa(e);for(;a&&!ra(a);){if(un(a)&&!gb(a))return a;a=oa(a)}return n}let r=lR(e,t);for(;r&&hB(r)&&gb(r);)r=lR(r,t);return r&&ra(r)&&gb(r)&&!Jx(r)?n:r||bB(e)||n}const mU=async function(e){const t=this.getOffsetParent||PO,n=this.getDimensions,r=await n(e.floating);return{reference:pU(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function gU(e){return ai(e).direction==="rtl"}const yU={convertOffsetParentRelativeRectToViewportRelativeRect:aU,getDocumentElement:ca,getClippingRect:fU,getOffsetParent:PO,getElementRects:mU,getClientRects:oU,getDimensions:hU,getScale:tc,isElement:un,isRTL:gU};function LO(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function bU(e,t){let n=null,r;const a=ca(e);function o(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function l(c,f){c===void 0&&(c=!1),f===void 0&&(f=1),o();const d=e.getBoundingClientRect(),{left:m,top:h,width:y,height:g}=d;if(c||t(),!y||!g)return;const w=Gl(h),C=Gl(a.clientWidth-(m+y)),T=Gl(a.clientHeight-(h+g)),E=Gl(m),k={rootMargin:-w+"px "+-C+"px "+-T+"px "+-E+"px",threshold:ri(0,xc(1,f))||1};let M=!0;function D(O){const A=O[0].intersectionRatio;if(A!==f){if(!M)return l();A?l(!1,A):r=setTimeout(()=>{l(!1,1e-7)},1e3)}A===1&&!LO(d,e.getBoundingClientRect())&&l(),M=!1}try{n=new IntersectionObserver(D,{...k,root:a.ownerDocument})}catch{n=new IntersectionObserver(D,k)}n.observe(e)}return l(!0),o}function cR(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,d=y0(e),m=a||o?[...d?Bo(d):[],...Bo(t)]:[];m.forEach(E=>{a&&E.addEventListener("scroll",n,{passive:!0}),o&&E.addEventListener("resize",n)});const h=d&&c?bU(d,n):null;let y=-1,g=null;l&&(g=new ResizeObserver(E=>{let[R]=E;R&&R.target===d&&g&&(g.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var k;(k=g)==null||k.observe(t)})),n()}),d&&!f&&g.observe(d),g.observe(t));let w,C=f?Ks(e):null;f&&T();function T(){const E=Ks(e);C&&!LO(C,E)&&n(),C=E,w=requestAnimationFrame(T)}return n(),()=>{var E;m.forEach(R=>{a&&R.removeEventListener("scroll",n),o&&R.removeEventListener("resize",n)}),h==null||h(),(E=g)==null||E.disconnect(),g=null,f&&cancelAnimationFrame(w)}}const vU=JH,xU=eU,wU=XH,SU=nU,EU=QH,CU=tU,TU=(e,t,n)=>{const r=new Map,a={platform:yU,...n},o={...a.platform,_c:r};return GH(e,t,{...a,platform:o})};var RU=typeof document<"u",kU=function(){},op=RU?v.useLayoutEffect:kU;function Np(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Np(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const o=a[r];if(!(o==="_owner"&&e.$$typeof)&&!Np(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function _O(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function uR(e,t){const n=_O(e);return Math.round(t*n)/n}function yb(e){const t=v.useRef(e);return op(()=>{t.current=e}),t}function MU(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:o,floating:l}={},transform:c=!0,whileElementsMounted:f,open:d}=e,[m,h]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[y,g]=v.useState(r);Np(y,r)||g(r);const[w,C]=v.useState(null),[T,E]=v.useState(null),R=v.useCallback(H=>{H!==O.current&&(O.current=H,C(H))},[]),k=v.useCallback(H=>{H!==A.current&&(A.current=H,E(H))},[]),M=o||w,D=l||T,O=v.useRef(null),A=v.useRef(null),L=v.useRef(m),q=f!=null,F=yb(f),W=yb(a),_=yb(d),V=v.useCallback(()=>{if(!O.current||!A.current)return;const H={placement:t,strategy:n,middleware:y};W.current&&(H.platform=W.current),TU(O.current,A.current,H).then(K=>{const P={...K,isPositioned:_.current!==!1};$.current&&!Np(L.current,P)&&(L.current=P,pr.flushSync(()=>{h(P)}))})},[y,t,n,W,_]);op(()=>{d===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,h(H=>({...H,isPositioned:!1})))},[d]);const $=v.useRef(!1);op(()=>($.current=!0,()=>{$.current=!1}),[]),op(()=>{if(M&&(O.current=M),D&&(A.current=D),M&&D){if(F.current)return F.current(M,D,V);V()}},[M,D,V,F,q]);const B=v.useMemo(()=>({reference:O,floating:A,setReference:R,setFloating:k}),[R,k]),j=v.useMemo(()=>({reference:M,floating:D}),[M,D]),z=v.useMemo(()=>{const H={position:n,left:0,top:0};if(!j.floating)return H;const K=uR(j.floating,m.x),P=uR(j.floating,m.y);return c?{...H,transform:"translate("+K+"px, "+P+"px)",..._O(j.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:K,top:P}},[n,c,j.floating,m.x,m.y]);return v.useMemo(()=>({...m,update:V,refs:B,elements:j,floatingStyles:z}),[m,V,B,j,z])}const OU=(e,t)=>({...vU(e),options:[e,t]}),AU=(e,t)=>({...xU(e),options:[e,t]}),NU=(e,t)=>({...CU(e),options:[e,t]}),DU=(e,t)=>({...wU(e),options:[e,t]}),IU=(e,t)=>({...SU(e),options:[e,t]}),PU=(e,t)=>({...EU(e),options:[e,t]}),LU={intentional:"onClick",sloppy:"onPointerDown"};function _U(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 mm(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),a=n.useState("floatingElement"),o=n.useState("referenceElement"),l=n.useState("domReferenceElement"),{onOpenChange:c,dataRef:f}=n.context,{enabled:d=!0,escapeKey:m=!0,outsidePress:h=!0,outsidePressEvent:y="sloppy",referencePress:g=!1,referencePressEvent:w="sloppy",ancestorScroll:C=!1,bubbles:T,externalTree:E}=t,R=Qo(E),k=Ye(typeof h=="function"?h:()=>!1),M=typeof h=="function"?k:h,D=v.useRef(!1),{escapeKey:O,outsidePress:A}=_U(T),L=v.useRef(null),q=Bn(),F=Bn(),W=Ye(()=>{F.clear(),f.current.insideReactTree=!1}),_=v.useRef(!1),V=v.useRef(""),$=Ye(te=>{V.current=te.pointerType}),B=Ye(()=>{const te=V.current,he=te==="pen"||!te?"mouse":te,ye=typeof y=="function"?y():y;return typeof ye=="string"?ye:ye[he]}),j=Ye(te=>{var Ce;if(!r||!d||!m||te.key!=="Escape"||_.current)return;const he=(Ce=f.current.floatingContext)==null?void 0:Ce.nodeId,ye=R?js(R.nodesRef.current,he):[];if(!O&&ye.length>0){let Re=!0;if(ye.forEach(J=>{var Ee;(Ee=J.context)!=null&&Ee.open&&!J.context.dataRef.current.__escapeKeyBubbles&&(Re=!1)}),!Re)return}const _e=UB(te)?te.nativeEvent:te,Oe=xt(dm,_e);n.setOpen(!1,Oe),!O&&!Oe.isPropagationAllowed&&te.stopPropagation()}),z=Ye(te=>{const he=B();return he==="intentional"&&te.type!=="click"||he==="sloppy"&&te.type==="click"}),H=Ye(()=>{f.current.insideReactTree=!0,F.start(0,W)}),K=Ye((te,he=!1)=>{var Be;if(z(te)){W();return}if(f.current.insideReactTree){W();return}if(B()==="intentional"&&he||typeof M=="function"&&!M(te))return;const ye=Rr(te),_e=`[${Ec("inert")}]`,Oe=Qt(n.select("floatingElement")).querySelectorAll(_e),Ce=n.context.triggerElements;if(ye&&(Ce.hasElement(ye)||Ce.hasMatchingElement(Ve=>Dt(Ve,ye))))return;let Re=un(ye)?ye:null;for(;Re&&!ra(Re);){const Ve=oa(Re);if(ra(Ve)||!un(Ve))break;Re=Ve}if(Oe.length&&un(ye)&&!BB(ye)&&!Dt(ye,n.select("floatingElement"))&&Array.from(Oe).every(Ve=>!Dt(Re,Ve)))return;if(Mn(ye)&&!("touches"in te)){const Ve=ra(ye),De=ai(ye),ut=/auto|scroll/,pe=Ve||ut.test(De.overflowX),Te=Ve||ut.test(De.overflowY),ee=pe&&ye.clientWidth>0&&ye.scrollWidth>ye.clientWidth,fe=Te&&ye.clientHeight>0&&ye.scrollHeight>ye.clientHeight,Ae=De.direction==="rtl",He=fe&&(Ae?te.offsetX<=ye.offsetWidth-ye.clientWidth:te.offsetX>ye.clientWidth),$e=ee&&te.offsetY>ye.clientHeight;if(He||$e)return}const J=(Be=f.current.floatingContext)==null?void 0:Be.nodeId,Ee=R&&js(R.nodesRef.current,J).some(Ve=>{var De;return Ii(te,(De=Ve.context)==null?void 0:De.elements.floating)});if(Ii(te,n.select("floatingElement"))||Ii(te,n.select("domReferenceElement"))||Ee)return;const xe=R?js(R.nodesRef.current,J):[];if(xe.length>0){let Ve=!0;if(xe.forEach(De=>{var ut;(ut=De.context)!=null&&ut.open&&!De.context.dataRef.current.__outsidePressBubbles&&(Ve=!1)}),!Ve)return}n.setOpen(!1,xt(um,te)),W()}),P=Ye(te=>{B()!=="sloppy"||te.pointerType==="touch"||!n.select("open")||!d||Ii(te,n.select("floatingElement"))||Ii(te,n.select("domReferenceElement"))||K(te)}),U=Ye(te=>{if(B()!=="sloppy"||!n.select("open")||!d||Ii(te,n.select("floatingElement"))||Ii(te,n.select("domReferenceElement")))return;const he=te.touches[0];he&&(L.current={startTime:Date.now(),startX:he.clientX,startY:he.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},q.start(1e3,()=>{L.current&&(L.current.dismissOnTouchEnd=!1,L.current.dismissOnMouseDown=!1)}))}),G=Ye(te=>{const he=Rr(te);function ye(){U(te),he==null||he.removeEventListener(te.type,ye)}he==null||he.addEventListener(te.type,ye)}),I=Ye(te=>{const he=D.current;if(D.current=!1,q.clear(),te.type==="mousedown"&&L.current&&!L.current.dismissOnMouseDown)return;const ye=Rr(te);function _e(){te.type==="pointerdown"?P(te):K(te,he),ye==null||ye.removeEventListener(te.type,_e)}ye==null||ye.addEventListener(te.type,_e)}),Q=Ye(te=>{if(B()!=="sloppy"||!L.current||Ii(te,n.select("floatingElement"))||Ii(te,n.select("domReferenceElement")))return;const he=te.touches[0];if(!he)return;const ye=Math.abs(he.clientX-L.current.startX),_e=Math.abs(he.clientY-L.current.startY),Oe=Math.sqrt(ye*ye+_e*_e);Oe>5&&(L.current.dismissOnTouchEnd=!0),Oe>10&&(K(te),q.clear(),L.current=null)}),le=Ye(te=>{const he=Rr(te);function ye(){Q(te),he==null||he.removeEventListener(te.type,ye)}he==null||he.addEventListener(te.type,ye)}),ae=Ye(te=>{B()!=="sloppy"||!L.current||Ii(te,n.select("floatingElement"))||Ii(te,n.select("domReferenceElement"))||(L.current.dismissOnTouchEnd&&K(te),q.clear(),L.current=null)}),Z=Ye(te=>{const he=Rr(te);function ye(){ae(te),he==null||he.removeEventListener(te.type,ye)}he==null||he.addEventListener(te.type,ye)});v.useEffect(()=>{if(!r||!d)return;f.current.__escapeKeyBubbles=O,f.current.__outsidePressBubbles=A;const te=new sa;function he(Re){n.setOpen(!1,xt(Fi,Re))}function ye(){te.clear(),_.current=!0}function _e(){te.start(rm()?5:0,()=>{_.current=!1})}const Oe=Qt(a);Oe.addEventListener("pointerdown",$,!0),m&&(Oe.addEventListener("keydown",j),Oe.addEventListener("compositionstart",ye),Oe.addEventListener("compositionend",_e)),M&&(Oe.addEventListener("click",I,!0),Oe.addEventListener("pointerdown",I,!0),Oe.addEventListener("touchstart",G,!0),Oe.addEventListener("touchmove",le,!0),Oe.addEventListener("touchend",Z,!0),Oe.addEventListener("mousedown",I,!0));let Ce=[];return C&&(un(l)&&(Ce=Bo(l)),un(a)&&(Ce=Ce.concat(Bo(a))),!un(o)&&o&&o.contextElement&&(Ce=Ce.concat(Bo(o.contextElement)))),Ce=Ce.filter(Re=>{var J;return Re!==((J=Oe.defaultView)==null?void 0:J.visualViewport)}),Ce.forEach(Re=>{Re.addEventListener("scroll",he,{passive:!0})}),()=>{Oe.removeEventListener("pointerdown",$,!0),m&&(Oe.removeEventListener("keydown",j),Oe.removeEventListener("compositionstart",ye),Oe.removeEventListener("compositionend",_e)),M&&(Oe.removeEventListener("click",I,!0),Oe.removeEventListener("pointerdown",I,!0),Oe.removeEventListener("touchstart",G,!0),Oe.removeEventListener("touchmove",le,!0),Oe.removeEventListener("touchend",Z,!0),Oe.removeEventListener("mousedown",I,!0)),Ce.forEach(Re=>{Re.removeEventListener("scroll",he)}),te.clear(),D.current=!1}},[f,a,o,l,m,M,r,c,C,d,O,A,j,K,I,P,G,le,Z,$,n]),v.useEffect(W,[M,W]);const ue=v.useMemo(()=>({onKeyDown:j,...g&&{[LU[w]]:te=>{n.setOpen(!1,xt(Ys,te.nativeEvent))},...w!=="intentional"&&{onClick(te){n.setOpen(!1,xt(Ys,te.nativeEvent))}}}}),[j,n,g,w]),ve=Ye(te=>{const he=Rr(te.nativeEvent);!Dt(n.select("floatingElement"),he)||te.button!==0||(D.current=!0)}),Se=Ye(te=>{!r||!d||te.button!==0||(D.current=!0)}),Le=v.useMemo(()=>({onKeyDown:j,onPointerDown:ve,onMouseDown:ve,onMouseUp:ve,onClickCapture:H,onMouseDownCapture(te){H(),Se(te)},onPointerDownCapture(te){H(),Se(te)},onMouseUpCapture:H,onTouchEndCapture:H,onTouchMoveCapture:H}),[j,ve,H,Se]);return v.useMemo(()=>d?{reference:ue,floating:Le,trigger:ue}:{},[d,ue,Le])}var Dp=Symbol("NOT_FOUND");function jU(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function zU(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function FU(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var dR=e=>Array.isArray(e)?e:[e];function BU(e){const t=Array.isArray(e[0])?e[0]:e;return FU(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function HU(e,t){const n=[],{length:r}=e;for(let a=0;a<r;a++)n.push(e[a].apply(null,t));return n}function UU(e){let t;return{get(n){return t&&e(t.key,n)?t.value:Dp},put(n,r){t={key:n,value:r}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function qU(e,t){let n=[];function r(c){const f=n.findIndex(d=>t(c,d.key));if(f>-1){const d=n[f];return f>0&&(n.splice(f,1),n.unshift(d)),d.value}return Dp}function a(c,f){r(c)===Dp&&(n.unshift({key:c,value:f}),n.length>e&&n.pop())}function o(){return n}function l(){n=[]}return{get:r,put:a,getEntries:o,clear:l}}var VU=(e,t)=>e===t;function $U(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;const{length:a}=n;for(let o=0;o<a;o++)if(!e(n[o],r[o]))return!1;return!0}}function YU(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:r=VU,maxSize:a=1,resultEqualityCheck:o}=n,l=$U(r);let c=0;const f=a<=1?UU(l):qU(a,l);function d(){let m=f.get(arguments);if(m===Dp){if(m=e.apply(null,arguments),c++,o){const y=f.getEntries().find(g=>o(g.value,m));y&&(m=y.value,c!==0&&c--)}f.put(arguments,m)}return m}return d.clearCache=()=>{f.clear(),d.resetResultsCount()},d.resultsCount=()=>c,d.resetResultsCount=()=>{c=0},d}var WU=class{constructor(e){this.value=e}deref(){return this.value}},KU=typeof WeakRef<"u"?WeakRef:WU,GU=0,fR=1;function Ph(){return{s:GU,v:void 0,o:null,p:null}}function jO(e,t={}){let n=Ph();const{resultEqualityCheck:r}=t;let a,o=0;function l(){var h;let c=n;const{length:f}=arguments;for(let y=0,g=f;y<g;y++){const w=arguments[y];if(typeof w=="function"||typeof w=="object"&&w!==null){let C=c.o;C===null&&(c.o=C=new WeakMap);const T=C.get(w);T===void 0?(c=Ph(),C.set(w,c)):c=T}else{let C=c.p;C===null&&(c.p=C=new Map);const T=C.get(w);T===void 0?(c=Ph(),C.set(w,c)):c=T}}const d=c;let m;if(c.s===fR)m=c.v;else if(m=e.apply(null,arguments),o++,r){const y=((h=a==null?void 0:a.deref)==null?void 0:h.call(a))??a;y!=null&&r(y,m)&&(m=y,o!==0&&o--),a=typeof m=="object"&&m!==null||typeof m=="function"?new KU(m):m}return d.s=fR,d.v=m,m}return l.clearCache=()=>{n=Ph(),l.resetResultsCount()},l.resultsCount=()=>o,l.resetResultsCount=()=>{o=0},l}function zO(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...a)=>{let o=0,l=0,c,f={},d=a.pop();typeof d=="object"&&(f=d,d=a.pop()),jU(d,`createSelector expects an output function after the inputs, but received: [${typeof d}]`);const m={...n,...f},{memoize:h,memoizeOptions:y=[],argsMemoize:g=jO,argsMemoizeOptions:w=[]}=m,C=dR(y),T=dR(w),E=BU(a),R=h(function(){return o++,d.apply(null,arguments)},...C),k=g(function(){l++;const D=HU(E,arguments);return c=R.apply(null,D),c},...T);return Object.assign(k,{resultFunc:d,memoizedResultFunc:R,dependencies:E,dependencyRecomputations:()=>l,resetDependencyRecomputations:()=>{l=0},lastResult:()=>c,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:h,argsMemoize:g})};return Object.assign(r,{withTypes:()=>r}),r}var XU=zO(jO),QU=Object.assign((e,t=XU)=>{zU(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(o=>e[o]);return t(r,(...o)=>o.reduce((l,c,f)=>(l[n[f]]=c,l),{}))},{withTypes:()=>QU});zO({memoize:YU,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const Ge=(e,t,n,r,a,o,...l)=>{if(l.length>0)throw new Error(Cn(1));let c;if(e)c=e;else throw new Error("Missing arguments");return c};var bb={exports:{}},vb={};/**
89
+ * @license React
90
+ * use-sync-external-store-shim/with-selector.production.js
91
+ *
92
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
93
+ *
94
+ * This source code is licensed under the MIT license found in the
95
+ * LICENSE file in the root directory of this source tree.
96
+ */var hR;function ZU(){if(hR)return vb;hR=1;var e=jd(),t=p2();function n(d,m){return d===m&&(d!==0||1/d===1/m)||d!==d&&m!==m}var r=typeof Object.is=="function"?Object.is:n,a=t.useSyncExternalStore,o=e.useRef,l=e.useEffect,c=e.useMemo,f=e.useDebugValue;return vb.useSyncExternalStoreWithSelector=function(d,m,h,y,g){var w=o(null);if(w.current===null){var C={hasValue:!1,value:null};w.current=C}else C=w.current;w=c(function(){function E(O){if(!R){if(R=!0,k=O,O=y(O),g!==void 0&&C.hasValue){var A=C.value;if(g(A,O))return M=A}return M=O}if(A=M,r(k,O))return A;var L=y(O);return g!==void 0&&g(A,L)?(k=O,A):(k=O,M=L)}var R=!1,k,M,D=h===void 0?null:h;return[function(){return E(m())},D===null?void 0:function(){return E(D())}]},[m,h,y,g]);var T=a(d,w[0],w[1]);return l(function(){C.hasValue=!0,C.value=T},[T]),f(T),T},vb}var pR;function JU(){return pR||(pR=1,bb.exports=ZU()),bb.exports}var e6=JU();const Vv=[];let $v;function t6(){return $v}function n6(e){Vv.push(e)}function b0(e){const t=(n,r)=>{const a=nr(r6).current;let o;try{$v=a;for(const l of Vv)l.before(a);o=e(n,r);for(const l of Vv)l.after(a);a.didInitialize=!0}finally{$v=void 0}return o};return t.displayName=e.displayName||e.name,t}function FO(e){return v.forwardRef(b0(e))}function r6(){return{didInitialize:!1}}const i6=Xx(19),a6=i6?s6:l6;function Ct(e,t,n,r,a){return a6(e,t,n,r,a)}function o6(e,t,n,r,a){const o=v.useCallback(()=>t(e.getSnapshot(),n,r,a),[e,t,n,r,a]);return Kx.useSyncExternalStore(e.subscribe,o,o)}n6({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){const r=e.syncHooks[n],a=r.selector(r.store.state,r.a1,r.a2,r.a3);(r.didChange||!Object.is(r.value,a))&&(t=!0,r.value=a,r.didChange=!1)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{const n=new Set;for(const a of e.syncHooks)n.add(a.store);const r=[];for(const a of n)r.push(a.subscribe(t));return()=>{for(const a of r)a()}}),Kx.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function s6(e,t,n,r,a){const o=t6();if(!o)return o6(e,t,n,r,a);const l=o.syncIndex;o.syncIndex+=1;let c;return o.didInitialize?(c=o.syncHooks[l],(c.store!==e||c.selector!==t||!Object.is(c.a1,n)||!Object.is(c.a2,r)||!Object.is(c.a3,a))&&(c.store!==e&&(o.didChangeStore=!0),c.store=e,c.selector=t,c.a1=n,c.a2=r,c.a3=a,c.didChange=!0)):(c={store:e,selector:t,a1:n,a2:r,a3:a,value:t(e.getSnapshot(),n,r,a),didChange:!1},o.syncHooks.push(c)),c.value}function l6(e,t,n,r,a){return e6.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,o=>t(o,n,r,a))}class BO{constructor(t){at(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));at(this,"getSnapshot",()=>this.state);this.state=t,this.listeners=new Set,this.updateTick=0}setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,r,a){return Ct(this,t,n,r,a)}}class gm extends BO{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}useSyncedValue(t,n){v.useDebugValue(t),qe(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){const r=this;qe(()=>(r.state[t]!==n&&r.set(t,n),()=>{r.set(t,void 0)}),[r,t,n])}useSyncedValues(t){const n=this,r=Object.values(t);qe(()=>{n.update(t)},[n,...r])}useControlledProp(t,n){v.useDebugValue(t);const r=n!==void 0;qe(()=>{r&&!Object.is(this.state[t],n)&&super.setState({...this.state,[t]:n})},[t,n,r])}select(t,n,r,a){const o=this.selectors[t];return o(this.state,n,r,a)}useState(t,n,r,a){return v.useDebugValue(t),Ct(this,this.selectors[t],n,r,a)}useContextCallback(t,n){v.useDebugValue(t);const r=Ye(n??Br);this.context[t]=r}useStateSetter(t){const n=v.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(t,r)}),n.current}observe(t,n){let r;typeof t=="function"?r=t:r=this.selectors[t];let a=r(this.state);return n(a,a,this),this.subscribe(o=>{const l=r(o);if(!Object.is(a,l)){const c=a;a=l,n(l,c,this)}})}}const c6={open:Ge(e=>e.open),domReferenceElement:Ge(e=>e.domReferenceElement),referenceElement:Ge(e=>e.positionReference??e.referenceElement),floatingElement:Ge(e=>e.floatingElement),floatingId:Ge(e=>e.floatingId)};class v0 extends gm{constructor(n){const{nested:r,noEmit:a,onOpenChange:o,triggerElements:l,...c}=n;super({...c,positionReference:c.referenceElement,domReferenceElement:c.referenceElement},{onOpenChange:o,dataRef:{current:{}},events:bO(),nested:r,noEmit:a,triggerElements:l},c6);at(this,"setOpen",(n,r)=>{var a,o;if((!n||!this.state.open||Z2(r.event))&&(this.context.dataRef.current.openEvent=n?r.event:void 0),!this.context.noEmit){const l={open:n,reason:r.reason,nativeEvent:r.event,nested:this.context.nested,triggerElement:r.trigger};this.context.events.emit("openchange",l)}(o=(a=this.context).onOpenChange)==null||o.call(a,n,r)})}}function u6(e,t){const n=v.useRef(null),r=v.useRef(null);return v.useCallback(a=>{if(e!==void 0){if(n.current!==null){const o=n.current,l=r.current,c=t.context.triggerElements.getById(o);l&&c===l&&t.context.triggerElements.delete(o),n.current=null,r.current=null}a!==null&&(n.current=e,r.current=a,t.context.triggerElements.add(e,a))}},[t,e])}function HO(e,t,n,r){const a=n.useState("isMountedByTrigger",e),o=u6(e,n),l=Ye(c=>{if(o(c),!c||!n.select("open"))return;const f=n.select("activeTriggerId");if(f===e){n.update({activeTriggerElement:c,...r});return}f==null&&n.update({activeTriggerId:e,activeTriggerElement:c,...r})});return qe(()=>{a&&n.update({activeTriggerElement:t.current,...r})},[a,n,t,...Object.values(r)]),{registerTrigger:l,isMountedByThisTrigger:a}}function x0(e){const t=e.useState("open");qe(()=>{if(t&&!e.select("activeTriggerId")&&e.context.triggerElements.size===1){const n=e.context.triggerElements.entries().next();if(!n.done){const[r,a]=n.value;e.update({activeTriggerId:r,activeTriggerElement:a})}}},[t,e])}function w0(e,t,n){const{mounted:r,setMounted:a,transitionStatus:o}=Yd(e);t.useSyncedValues({mounted:r,transitionStatus:o});const l=Ye(()=>{var f,d;a(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n==null||n(),(d=(f=t.context).onOpenChangeComplete)==null||d.call(f,!1)}),c=t.useState("preventUnmountingOnClose");return Wa({enabled:!c,open:e,ref:t.context.popupRef,onComplete(){e||l()}}),{forceUnmount:l,transitionStatus:o}}class Wd{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(t,n){const r=this.idMap.get(t);r!==n&&(r!==void 0&&this.elementsSet.delete(r),this.elementsSet.add(n),this.idMap.set(t,n))}delete(t){const n=this.idMap.get(t);n&&(this.elementsSet.delete(n),this.idMap.delete(t))}hasElement(t){return this.elementsSet.has(t)}hasMatchingElement(t){for(const n of this.elementsSet)if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}}function d6(){return new v0({open:!1,floatingElement:null,referenceElement:null,triggerElements:new Wd,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function S0(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:"idle",floatingRootContext:d6(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:In,inactiveTriggerProps:In,popupProps:In}}const Lh=Ge(e=>e.triggerIdProp??e.activeTriggerId),E0={open:Ge(e=>e.openProp??e.open),mounted:Ge(e=>e.mounted),transitionStatus:Ge(e=>e.transitionStatus),floatingRootContext:Ge(e=>e.floatingRootContext),preventUnmountingOnClose:Ge(e=>e.preventUnmountingOnClose),payload:Ge(e=>e.payload),activeTriggerId:Lh,activeTriggerElement:Ge(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:Ge((e,t)=>t!==void 0&&Lh(e)===t),isOpenedByTrigger:Ge((e,t)=>t!==void 0&&Lh(e)===t&&e.open),isMountedByTrigger:Ge((e,t)=>t!==void 0&&Lh(e)===t&&e.mounted),triggerProps:Ge((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:Ge(e=>e.popupProps),popupElement:Ge(e=>e.popupElement),positionerElement:Ge(e=>e.positionerElement)};function UO(e){const{open:t=!1,onOpenChange:n,elements:r={}}=e,a=nl(),o=Ka()!=null,l=nr(()=>new v0({open:t,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new Wd,floatingId:a,nested:o,noEmit:!1})).current;return qe(()=>{const c={open:t,floatingId:a};r.reference!==void 0&&(c.referenceElement=r.reference,c.domReferenceElement=un(r.reference)?r.reference:null),r.floating!==void 0&&(c.floatingElement=r.floating),l.update(c)},[t,a,r.reference,r.floating,l]),l.context.onOpenChange=n,l.context.nested=o,l.context.noEmit=!1,l}function f6(e={}){const{nodeId:t,externalTree:n}=e,r=UO(e),a=e.rootContext||r,o={reference:a.useState("referenceElement"),floating:a.useState("floatingElement"),domReference:a.useState("domReferenceElement")},[l,c]=v.useState(null),f=v.useRef(null),d=Qo(n);qe(()=>{o.domReference&&(f.current=o.domReference)},[o.domReference]);const m=MU({...e,elements:{...o,...l&&{reference:l}}}),h=v.useCallback(A=>{const L=un(A)?{getBoundingClientRect:()=>A.getBoundingClientRect(),getClientRects:()=>A.getClientRects(),contextElement:A}:A;c(L),m.refs.setReference(L)},[m.refs]),[y,g]=v.useState(null),[w,C]=v.useState(null);a.useSyncedValue("referenceElement",y),a.useSyncedValue("domReferenceElement",un(y)?y:null),a.useSyncedValue("floatingElement",w);const T=v.useCallback(A=>{(un(A)||A===null)&&(f.current=A,g(A)),(un(m.refs.reference.current)||m.refs.reference.current===null||A!==null&&!un(A))&&m.refs.setReference(A)},[m.refs,g]),E=v.useCallback(A=>{C(A),m.refs.setFloating(A)},[m.refs]),R=v.useMemo(()=>({...m.refs,setReference:T,setFloating:E,setPositionReference:h,domReference:f}),[m.refs,T,E,h]),k=v.useMemo(()=>({...m.elements,domReference:o.domReference}),[m.elements,o.domReference]),M=a.useState("open"),D=a.useState("floatingId"),O=v.useMemo(()=>({...m,dataRef:a.context.dataRef,open:M,onOpenChange:a.setOpen,events:a.context.events,floatingId:D,refs:R,elements:k,nodeId:t,rootStore:a}),[m,R,k,t,a,M,D]);return qe(()=>{a.context.dataRef.current.floatingContext=O;const A=d==null?void 0:d.nodesRef.current.find(L=>L.id===t);A&&(A.context=O)}),v.useMemo(()=>({...m,context:O,refs:R,elements:k,rootStore:a}),[m,R,k,O,a])}function C0(e){const{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:r=!1,onOpenChange:a}=e,o=nl(),l=Ka()!=null,c=t.useState("open"),f=t.useState("activeTriggerElement"),d=t.useState(r?"popupElement":"positionerElement"),m=t.context.triggerElements,h=nr(()=>new v0({open:c,referenceElement:f,floatingElement:d,triggerElements:m,onOpenChange:a,floatingId:o,nested:l,noEmit:n})).current;return qe(()=>{const y={open:c,floatingId:o,referenceElement:f,floatingElement:d};un(f)&&(y.domReferenceElement=f),h.state.positionReference===h.state.referenceElement&&(y.positionReference=f),h.update(y)},[c,o,f,d,h]),h.context.onOpenChange=a,h.context.nested=l,h.context.noEmit=n,h}const xb=_B&&$2;function qO(e,t={}){const n="rootStore"in e?e.rootStore:e,{events:r,dataRef:a}=n.context,{enabled:o=!0,delay:l}=t,c=v.useRef(!1),f=v.useRef(null),d=Bn(),m=v.useRef(!0);v.useEffect(()=>{const y=n.select("domReferenceElement");if(!o)return;const g=Hn(y);function w(){const E=n.select("domReferenceElement");!n.select("open")&&Mn(E)&&E===ni(Qt(E))&&(c.current=!0)}function C(){m.current=!0}function T(){m.current=!1}return g.addEventListener("blur",w),xb&&(g.addEventListener("keydown",C,!0),g.addEventListener("pointerdown",T,!0)),()=>{g.removeEventListener("blur",w),xb&&(g.removeEventListener("keydown",C,!0),g.removeEventListener("pointerdown",T,!0))}},[n,o]),v.useEffect(()=>{if(!o)return;function y(g){if(g.reason===Ys||g.reason===dm){const w=n.select("domReferenceElement");un(w)&&(f.current=w,c.current=!0)}}return r.on("openchange",y),()=>{r.off("openchange",y)}},[r,o,n]);const h=v.useMemo(()=>({onMouseLeave(){c.current=!1,f.current=null},onFocus(y){const g=y.currentTarget;if(c.current){if(f.current===g)return;c.current=!1,f.current=null}const w=Rr(y.nativeEvent);if(un(w)){if(xb&&!y.relatedTarget){if(!m.current&&!lm(w))return}else if(!HB(w))return}const C=Sp(y.relatedTarget,n.context.triggerElements),{nativeEvent:T,currentTarget:E}=y,R=typeof l=="function"?l():l;if(n.select("open")&&C||R===0||R===void 0){n.setOpen(!0,xt(Jl,T,E));return}d.start(R,()=>{c.current||n.setOpen(!0,xt(Jl,T,E))})},onBlur(y){c.current=!1,f.current=null;const g=y.relatedTarget,w=y.nativeEvent,C=un(g)&&g.hasAttribute(Ec("focus-guard"))&&g.getAttribute("data-type")==="outside";d.start(0,()=>{var k;const T=n.select("domReferenceElement"),E=ni(T?T.ownerDocument:document);!g&&E===T||Dt((k=a.current.floatingContext)==null?void 0:k.refs.floating.current,E)||Dt(T,E)||C||Sp(g??E,n.context.triggerElements)||n.setOpen(!1,xt(Jl,w))})}}),[a,n,d,l]);return v.useMemo(()=>o?{reference:h,trigger:h}:{},[o,h])}const Yv=Ec("safe-polygon"),h6=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${G2}`;function p6(e){return e?!!e.closest(h6):!1}class T0{constructor(){at(this,"dispose",()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()});at(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 sa,this.restTimeout=new sa,this.handleCloseOptions=void 0}static create(){return new T0}}function VO(e){const t=nr(T0.create).current,n=e.context.dataRef.current;return n.hoverInteractionState||(n.hoverInteractionState=t),om(n.hoverInteractionState.disposeEffect),n.hoverInteractionState}const m6=new Set(["click","mousedown"]);function $O(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),a=n.useState("floatingElement"),o=n.useState("domReferenceElement"),{dataRef:l}=n.context,{enabled:c=!0,closeDelay:f=0}=t,d=VO(n),m=Qo(),h=Ka(),y=Ye(()=>d.interactedInside?!0:l.current.openEvent?m6.has(l.current.openEvent.type):!1),g=Ye(()=>{var M;const k=(M=l.current.openEvent)==null?void 0:M.type;return(k==null?void 0:k.includes("mouse"))&&k!=="mousedown"}),w=Ye(k=>Sp(k,n.context.triggerElements)),C=v.useCallback((k,M=!0)=>{const D=g6(f,d.pointerType);D&&!d.handler?d.openChangeTimeout.start(D,()=>n.setOpen(!1,xt(vr,k))):M&&(d.openChangeTimeout.clear(),n.setOpen(!1,xt(vr,k)))},[f,n,d]),T=Ye(()=>{d.unbindMouseMove(),d.handler=void 0}),E=Ye(()=>{if(d.performedPointerEventsMutation){const k=Qt(a).body;k.style.pointerEvents="",k.removeAttribute(Yv),d.performedPointerEventsMutation=!1}}),R=Ye(k=>{const M=Rr(k);if(!p6(M)){d.interactedInside=!1;return}d.interactedInside=!0});qe(()=>{r||(d.pointerType=void 0,d.restTimeoutPending=!1,d.interactedInside=!1,T(),E())},[r,d,T,E]),v.useEffect(()=>()=>{T()},[T]),v.useEffect(()=>E,[E]),qe(()=>{var k,M,D;if(c&&r&&(k=d.handleCloseOptions)!=null&&k.blockPointerEvents&&g()&&un(o)&&a){d.performedPointerEventsMutation=!0;const O=Qt(a).body;O.setAttribute(Yv,"");const A=o,L=a,q=(D=(M=m==null?void 0:m.nodesRef.current.find(F=>F.id===h))==null?void 0:M.context)==null?void 0:D.elements.floating;return q&&(q.style.pointerEvents=""),O.style.pointerEvents="none",A.style.pointerEvents="auto",L.style.pointerEvents="auto",()=>{O.style.pointerEvents="",A.style.pointerEvents="",L.style.pointerEvents=""}}},[c,r,o,a,d,g,m,h]),v.useEffect(()=>{if(!c)return;function k(A){y()||!l.current.floatingContext||!n.select("open")||w(A.relatedTarget)||(E(),T(),y()||C(A))}function M(A){var L;d.openChangeTimeout.clear(),E(),(L=d.handler)==null||L.call(d,A),T()}function D(A){y()||C(A,!1)}const O=a;return O&&(O.addEventListener("mouseleave",k),O.addEventListener("mouseenter",M),O.addEventListener("mouseleave",D),O.addEventListener("pointerdown",R,!0)),()=>{O&&(O.removeEventListener("mouseleave",k),O.removeEventListener("mouseenter",M),O.removeEventListener("mouseleave",D),O.removeEventListener("pointerdown",R,!0))}},[c,a,n,l,y,w,C,E,T,R,d])}function g6(e,t){return t&&!Vs(t)?0:typeof e=="function"?e():e}function wb(e){return typeof e=="function"?e():e}const y6={current:null};function YO(e,t={}){var F;const n="rootStore"in e?e.rootStore:e,{dataRef:r,events:a}=n.context,{enabled:o=!0,delay:l=0,handleClose:c=null,mouseOnly:f=!1,restMs:d=0,move:m=!0,triggerElementRef:h=y6,externalTree:y,isActiveTrigger:g=!0}=t,w=Qo(y),C=VO(n),T=sr(c),E=sr(l),R=sr(d),k=sr(o);g&&(C.handleCloseOptions=(F=T.current)==null?void 0:F.__options);const M=Ye(()=>C.interactedInside?!0:r.current.openEvent?["click","mousedown"].includes(r.current.openEvent.type):!1),D=Ye(W=>Sp(W,n.context.triggerElements)),O=v.useCallback((W,_=!0)=>{const V=ap(E.current,"close",C.pointerType);V&&!C.handler?C.openChangeTimeout.start(V,()=>n.setOpen(!1,xt(vr,W))):_&&(C.openChangeTimeout.clear(),n.setOpen(!1,xt(vr,W)))},[E,n,C]),A=Ye(()=>{C.unbindMouseMove(),C.handler=void 0}),L=Ye(()=>{if(C.performedPointerEventsMutation){const W=Qt(n.select("domReferenceElement")).body;W.style.pointerEvents="",W.removeAttribute(Yv),C.performedPointerEventsMutation=!1}});v.useEffect(()=>{if(!o)return;function W(_){_.open||(C.openChangeTimeout.clear(),C.restTimeout.clear(),C.blockMouseMove=!0,C.restTimeoutPending=!1)}return a.on("openchange",W),()=>{a.off("openchange",W)}},[o,a,C]);const q=Ye(W=>{var V;if(M()||!r.current.floatingContext||D(W.relatedTarget))return;const _=h.current;(V=T.current)==null||V.call(T,{...r.current.floatingContext,tree:w,x:W.clientX,y:W.clientY,onClose(){L(),A(),!M()&&_===n.select("domReferenceElement")&&O(W)}})(W)});return v.useEffect(()=>{if(!o)return;const W=h.current??(g?n.select("domReferenceElement"):null);if(!un(W))return;function _(B){if(C.openChangeTimeout.clear(),C.blockMouseMove=!1,f&&!Vs(C.pointerType)||wb(R.current)>0&&!ap(E.current,"open"))return;const j=ap(E.current,"open",C.pointerType),z=n.select("domReferenceElement"),H=n.context.triggerElements,K=(H.hasElement(B.target)||H.hasMatchingElement(I=>Dt(I,B.target)))&&(!z||!Dt(z,B.target)),P=B.currentTarget??null,U=n.select("open"),G=!U||K;K&&U?n.setOpen(!0,xt(vr,B,P)):j?C.openChangeTimeout.start(j,()=>{G&&n.setOpen(!0,xt(vr,B,P))}):G&&n.setOpen(!0,xt(vr,B,P))}function V(B){if(M()){L();return}C.unbindMouseMove();const j=n.select("domReferenceElement"),z=Qt(j);if(C.restTimeout.clear(),C.restTimeoutPending=!1,D(B.relatedTarget))return;if(T.current&&r.current.floatingContext){n.select("open")||C.openChangeTimeout.clear();const K=h.current;C.handler=T.current({...r.current.floatingContext,tree:w,x:B.clientX,y:B.clientY,onClose(){L(),A(),k.current&&!M()&&K===n.select("domReferenceElement")&&O(B,!0)}});const P=C.handler;P(B),z.addEventListener("mousemove",P),C.unbindMouseMove=()=>{z.removeEventListener("mousemove",P)};return}(C.pointerType==="touch"?!Dt(n.select("floatingElement"),B.relatedTarget):!0)&&O(B)}function $(B){q(B)}return n.select("open")&&W.addEventListener("mouseleave",$),m&&W.addEventListener("mousemove",_,{once:!0}),W.addEventListener("mouseenter",_),W.addEventListener("mouseleave",V),()=>{W.removeEventListener("mouseleave",$),m&&W.removeEventListener("mousemove",_),W.removeEventListener("mouseenter",_),W.removeEventListener("mouseleave",V)}},[A,L,r,E,O,n,o,T,q,C,g,M,D,f,m,R,h,w,k]),v.useMemo(()=>{if(!o)return;function W(_){C.pointerType=_.pointerType}return{onPointerDown:W,onPointerEnter:W,onMouseMove(_){const{nativeEvent:V}=_,$=_.currentTarget,B=n.select("domReferenceElement"),j=n.context.triggerElements,z=n.select("open"),H=(j.hasElement(_.target)||j.hasMatchingElement(P=>Dt(P,_.target)))&&(!B||!Dt(B,_.target));if(f&&!Vs(C.pointerType)||z&&!H||wb(R.current)===0||!H&&C.restTimeoutPending&&_.movementX**2+_.movementY**2<2)return;C.restTimeout.clear();function K(){if(C.restTimeoutPending=!1,M())return;const P=n.select("open");!C.blockMouseMove&&(!P||H)&&n.setOpen(!0,xt(vr,V,$))}C.pointerType==="touch"?pr.flushSync(()=>{K()}):H&&z?K():(C.restTimeoutPending=!0,C.restTimeout.start(wb(R.current),K))}}},[o,C,M,f,n,R])}function Kd(e=[]){const t=e.map(d=>d==null?void 0:d.reference),n=e.map(d=>d==null?void 0:d.floating),r=e.map(d=>d==null?void 0:d.item),a=e.map(d=>d==null?void 0:d.trigger),o=v.useCallback(d=>_h(d,e,"reference"),t),l=v.useCallback(d=>_h(d,e,"floating"),n),c=v.useCallback(d=>_h(d,e,"item"),r),f=v.useCallback(d=>_h(d,e,"trigger"),a);return v.useMemo(()=>({getReferenceProps:o,getFloatingProps:l,getItemProps:c,getTriggerProps:f}),[o,l,c,f])}function _h(e,t,n){var l;const r=new Map,a=n==="item",o={};n==="floating"&&(o.tabIndex=-1,o[_v]="");for(const c in e)a&&e&&(c===W2||c===K2)||(o[c]=e[c]);for(let c=0;c<t.length;c+=1){let f;const d=(l=t[c])==null?void 0:l[n];typeof d=="function"?f=e?d(e):null:f=d,f&&mR(o,f,a,r)}return mR(o,e,a,r),o}function mR(e,t,n,r){var a;for(const o in t){const l=t[o];n&&(o===W2||o===K2)||(o.startsWith("on")?(r.has(o)||r.set(o,[]),typeof l=="function"&&((a=r.get(o))==null||a.push(l),e[o]=(...c)=>{var f;return(f=r.get(o))==null?void 0:f.map(d=>d(...c)).find(d=>d!==void 0)})):e[o]=l)}}const b6="Escape";function ym(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function jh(e,t){return ym(t,e===r0||e===qd,e===Ho||e===Uo)}function Sb(e,t,n){return ym(t,e===qd,n?e===Ho:e===Uo)||e==="Enter"||e===" "||e===""}function v6(e,t,n){return ym(t,n?e===Ho:e===Uo,e===qd)}function x6(e,t,n,r){const a=n?e===Uo:e===Ho,o=e===r0;return t==="both"||t==="horizontal"&&r&&r>1?e===b6:ym(t,a,o)}function WO(e,t){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),a=n.useState("floatingElement"),o=n.useState("domReferenceElement"),l=n.context.dataRef,{listRef:c,activeIndex:f,onNavigate:d=()=>{},enabled:m=!0,selectedIndex:h=null,allowEscape:y=!1,loopFocus:g=!1,nested:w=!1,rtl:C=!1,virtual:T=!1,focusItemOnOpen:E="auto",focusItemOnHover:R=!0,openOnArrowKeyDown:k=!0,disabledIndices:M=void 0,orientation:D="vertical",parentOrientation:O,cols:A=1,id:L,resetOnPointerLeave:q=!0,externalTree:F}=t,W=Ed(a),_=sr(W),V=Ka(),$=Qo(F);qe(()=>{l.current.orientation=D},[l,D]);const B=jv(o),j=v.useRef(E),z=v.useRef(h??-1),H=v.useRef(null),K=v.useRef(!0),P=Ye(J=>{d(z.current===-1?null:z.current,J)}),U=v.useRef(P),G=v.useRef(!!a),I=v.useRef(r),Q=v.useRef(!1),le=v.useRef(!1),ae=sr(M),Z=sr(r),ue=sr(h),ve=sr(q),Se=Ye(()=>{function J(Ve){T?$==null||$.events.emit("virtualfocus",Ve):ad(Ve,{sync:Q.current,preventScroll:!0})}const Ee=c.current[z.current],xe=le.current;Ee&&J(Ee),(Q.current?Ve=>Ve():requestAnimationFrame)(()=>{var ut;const Ve=c.current[z.current]||Ee;if(!Ve)return;Ee||J(Ve),te&&(xe||!K.current)&&((ut=Ve.scrollIntoView)==null||ut.call(Ve,{block:"nearest",inline:"nearest"}))})});qe(()=>{m&&(r&&a?(z.current=h??-1,j.current&&h!=null&&(le.current=!0,P())):G.current&&(z.current=-1,U.current()))},[m,r,a,h,P]),qe(()=>{if(m){if(!r){Q.current=!1;return}if(a)if(f==null){if(Q.current=!1,ue.current!=null)return;if(G.current&&(z.current=-1,Se()),(!I.current||!G.current)&&j.current&&(H.current!=null||j.current===!0&&H.current==null)){let J=0;const Ee=()=>{c.current[0]==null?(J<2&&(J?requestAnimationFrame:queueMicrotask)(Ee),J+=1):(z.current=H.current==null||Sb(H.current,D,C)||w?np(c):Bv(c),H.current=null,P())};Ee()}}else Ql(c,f)||(z.current=f,Se(),le.current=!1)}},[m,r,a,f,ue,w,c,D,C,P,Se,ae]),qe(()=>{var Ve,De;if(!m||a||!$||T||!G.current)return;const J=$.nodesRef.current,Ee=(De=(Ve=J.find(ut=>ut.id===V))==null?void 0:Ve.context)==null?void 0:De.elements.floating,xe=ni(Qt(a)),Be=J.some(ut=>ut.context&&Dt(ut.context.elements.floating,xe));Ee&&!Be&&K.current&&Ee.focus({preventScroll:!0})},[m,a,$,V,T]),qe(()=>{U.current=P,I.current=r,G.current=!!a}),qe(()=>{r||(H.current=null,j.current=E)},[r,E]);const Le=f!=null,te=v.useMemo(()=>{function J(xe){if(!Z.current)return;const Be=c.current.indexOf(xe.currentTarget);Be!==-1&&z.current!==Be&&(z.current=Be,P(xe))}return{onFocus(xe){Q.current=!0,J(xe)},onClick:({currentTarget:xe})=>xe.focus({preventScroll:!0}),onMouseMove(xe){Q.current=!0,le.current=!1,R&&J(xe)},onPointerLeave(xe){var Ve;if(!Z.current||!K.current||xe.pointerType==="touch")return;Q.current=!0;const Be=xe.relatedTarget;!R||c.current.includes(Be)||ve.current&&(ad(null,{sync:!0}),z.current=-1,P(xe),T||(Ve=_.current)==null||Ve.focus({preventScroll:!0}))}}},[Z,_,R,c,P,ve,T]),he=v.useCallback(()=>{var J,Ee,xe;return O??((xe=(Ee=(J=$==null?void 0:$.nodesRef.current.find(Be=>Be.id===V))==null?void 0:J.context)==null?void 0:Ee.dataRef)==null?void 0:xe.current.orientation)},[V,$,O]),ye=Ye(J=>{if(K.current=!1,Q.current=!0,J.which===229||!Z.current&&J.currentTarget===_.current)return;if(w&&x6(J.key,D,C,A)){jh(J.key,he())||br(J),n.setOpen(!1,xt(rp,J.nativeEvent)),Mn(o)&&(T?$==null||$.events.emit("virtualfocus",o):o.focus());return}const Ee=z.current,xe=np(c,M),Be=Bv(c,M);if(B||(J.key==="Home"&&(br(J),z.current=xe,P(J)),J.key==="End"&&(br(J),z.current=Be,P(J))),A>1){const Ve=Array.from({length:c.current.length},()=>({width:1,height:1})),De=tO(Ve,A,!1),ut=De.findIndex(ee=>ee!=null&&!qo(c,ee,M)),pe=De.reduce((ee,fe,Ae)=>fe!=null&&!qo(c,fe,M)?Ae:ee,-1),Te=De[eO({current:De.map(ee=>ee!=null?c.current[ee]:null)},{event:J,orientation:D,loopFocus:g,rtl:C,cols:A,disabledIndices:rO([...(typeof M!="function"?M:null)||c.current.map((ee,fe)=>qo(c,fe,M)?fe:void 0),void 0],De),minIndex:ut,maxIndex:pe,prevIndex:nO(z.current>Be?xe:z.current,Ve,De,A,J.key===qd?"bl":J.key===(C?Ho:Uo)?"tr":"tl"),stopEvent:!0})];if(Te!=null&&(z.current=Te,P(J)),D==="both")return}if(jh(J.key,D)){if(br(J),r&&!T&&ni(J.currentTarget.ownerDocument)===J.currentTarget){z.current=Sb(J.key,D,C)?xe:Be,P(J);return}Sb(J.key,D,C)?g?Ee>=Be?y&&Ee!==c.current.length?z.current=-1:(Q.current=!1,z.current=xe):z.current=hr(c,{startingIndex:Ee,disabledIndices:M}):z.current=Math.min(Be,hr(c,{startingIndex:Ee,disabledIndices:M})):g?Ee<=xe?y&&Ee!==-1?z.current=c.current.length:(Q.current=!1,z.current=Be):z.current=hr(c,{startingIndex:Ee,decrement:!0,disabledIndices:M}):z.current=Math.max(xe,hr(c,{startingIndex:Ee,decrement:!0,disabledIndices:M})),Ql(c,z.current)&&(z.current=-1),P(J)}}),_e=v.useMemo(()=>T&&r&&Le&&{"aria-activedescendant":`${L}-${f}`},[T,r,Le,L,f]),Oe=v.useMemo(()=>({"aria-orientation":D==="both"?void 0:D,...B?{}:_e,onKeyDown(J){if(J.key==="Tab"&&J.shiftKey&&r&&!T){const Ee=Rr(J.nativeEvent);if(Ee&&!Dt(_.current,Ee))return;br(J),n.setOpen(!1,xt(Ws,J.nativeEvent)),Mn(o)&&o.focus();return}ye(J)},onPointerMove(){K.current=!0}}),[_e,ye,_,D,B,n,r,T,o]),Ce=v.useMemo(()=>{function J(xe){E==="auto"&&X2(xe.nativeEvent)&&(j.current=!T)}function Ee(xe){j.current=E,E==="auto"&&Q2(xe.nativeEvent)&&(j.current=!0)}return{onKeyDown(xe){const Be=n.select("open");K.current=!1;const Ve=xe.key.startsWith("Arrow"),De=v6(xe.key,he(),C),ut=jh(xe.key,D),pe=(w?De:ut)||xe.key==="Enter"||xe.key.trim()==="";if(T&&Be)return ye(xe);if(!(!Be&&!k&&Ve)){if(pe){const Te=jh(xe.key,he());H.current=w&&Te?null:xe.key}if(w){De&&(br(xe),Be?(z.current=np(c,ae.current),P(xe)):n.setOpen(!0,xt(rp,xe.nativeEvent,xe.currentTarget)));return}ut&&(ue.current!=null&&(z.current=ue.current),br(xe),!Be&&k?n.setOpen(!0,xt(rp,xe.nativeEvent,xe.currentTarget)):ye(xe),Be&&P(xe))}},onFocus(xe){n.select("open")&&!T&&(z.current=-1,P(xe))},onPointerDown:Ee,onPointerEnter:Ee,onMouseDown:J,onClick:J}},[ye,ae,E,c,w,P,n,k,D,he,C,ue,T]),Re=v.useMemo(()=>({..._e,...Ce}),[_e,Ce]);return v.useMemo(()=>m?{reference:Re,floating:Oe,item:te,trigger:Ce}:{},[m,Re,Oe,Ce,te])}const w6=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function KO(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),a=n.useState("floatingId"),o=n.useState("domReferenceElement"),l=n.useState("floatingElement"),{role:c="dialog"}=t,f=nl(),d=(o==null?void 0:o.id)||f,m=v.useMemo(()=>{var R;return((R=Ed(l))==null?void 0:R.id)||a},[l,a]),h=w6.get(c)??c,g=Ka()!=null,w=v.useMemo(()=>h==="tooltip"||c==="label"?In:{"aria-haspopup":h==="alertdialog"?"dialog":h,"aria-expanded":"false",...h==="listbox"&&{role:"combobox"},...h==="menu"&&g&&{role:"menuitem"},...c==="select"&&{"aria-autocomplete":"none"},...c==="combobox"&&{"aria-autocomplete":"list"}},[h,g,c]),C=v.useMemo(()=>h==="tooltip"||c==="label"?{[`aria-${c==="label"?"labelledby":"describedby"}`]:r?m:void 0}:{...w,"aria-expanded":r?"true":"false","aria-controls":r?m:void 0,...h==="menu"&&{id:d}},[h,m,r,d,c,w]),T=v.useMemo(()=>{const R={id:m,...h&&{role:h}};return h==="tooltip"||c==="label"?R:{...R,...h==="menu"&&{"aria-labelledby":d}}},[h,m,d,c]),E=v.useCallback(({active:R,selected:k})=>{const M={role:"option",...R&&{id:`${m}-fui-option`}};switch(c){case"select":case"combobox":return{...M,"aria-selected":k}}return{}},[m,c]);return v.useMemo(()=>({reference:C,floating:T,item:E,trigger:w}),[C,T,w,E])}function GO(e,t){const n="rootStore"in e?e.rootStore:e,r=n.context.dataRef,a=n.useState("open"),{listRef:o,activeIndex:l,onMatch:c,onTypingChange:f,enabled:d=!0,resetMs:m=750,selectedIndex:h=null}=t,y=Bn(),g=v.useRef(""),w=v.useRef(h??l??-1),C=v.useRef(null);qe(()=>{!a&&h!==null||(y.clear(),C.current=null,g.current!==""&&(g.current=""))},[a,h,y]),qe(()=>{a&&g.current===""&&(w.current=h??l??-1)},[a,h,l]);const T=Ye(D=>{D?r.current.typing||(r.current.typing=D,f==null||f(D)):r.current.typing&&(r.current.typing=D,f==null||f(D))}),E=Ye(D=>{function O(_,V,$){const B=V.find(j=>(j==null?void 0:j.toLocaleLowerCase().indexOf($.toLocaleLowerCase()))===0);return B?_.indexOf(B):-1}const A=o.current;if(g.current.length>0&&g.current[0]!==" "&&(O(A,A,g.current)===-1?T(!1):D.key===" "&&br(D)),A==null||D.key.length!==1||D.ctrlKey||D.metaKey||D.altKey)return;a&&D.key!==" "&&(br(D),T(!0));const L=g.current==="";L&&(w.current=h??l??-1),A.every(_=>{var V,$;return _?((V=_[0])==null?void 0:V.toLocaleLowerCase())!==(($=_[1])==null?void 0:$.toLocaleLowerCase()):!0})&&g.current===D.key&&(g.current="",w.current=C.current),g.current+=D.key,y.start(m,()=>{g.current="",w.current=C.current,T(!1)});const F=L?h??l??-1:w.current,W=O(A,[...A.slice((F||0)+1),...A.slice(0,(F||0)+1)],g.current);W!==-1?(c==null||c(W),C.current=W):D.key!==" "&&(g.current="",T(!1))}),R=Ye(D=>{const O=D.relatedTarget,A=n.select("domReferenceElement"),L=n.select("floatingElement"),q=Dt(A,O),F=Dt(L,O);q||F||(y.clear(),g.current="",w.current=C.current,T(!1))}),k=v.useMemo(()=>({onKeyDown:E,onBlur:R}),[E,R]),M=v.useMemo(()=>({onKeyDown:E,onKeyUp(D){D.key===" "&&T(!1)},onBlur:R}),[E,R,T]);return v.useMemo(()=>d?{reference:k,floating:M}:{},[d,k,M])}function gR(e,t){const[n,r]=e;let a=!1;const o=t.length;for(let l=0,c=o-1;l<o;c=l++){const[f,d]=t[l]||[0,0],[m,h]=t[c]||[0,0];d>=r!=h>=r&&n<=(m-f)*(r-d)/(h-d)+f&&(a=!a)}return a}function S6(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function XO(e={}){const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,a=new sa;let o=!1,l=null,c=null,f=typeof performance<"u"?performance.now():0;function d(h,y){const g=performance.now(),w=g-f;if(l===null||c===null||w===0)return l=h,c=y,f=g,null;const C=h-l,T=y-c,R=Math.sqrt(C*C+T*T)/w;return l=h,c=y,f=g,R}const m=({x:h,y,placement:g,elements:w,onClose:C,nodeId:T,tree:E})=>function(k){function M(){a.clear(),C()}if(a.clear(),!w.domReference||!w.floating||g==null||h==null||y==null)return;const{clientX:D,clientY:O}=k,A=[D,O],L=Rr(k),q=k.type==="mouseleave",F=Dt(w.floating,L),W=Dt(w.domReference,L),_=w.domReference.getBoundingClientRect(),V=w.floating.getBoundingClientRect(),$=g.split("-")[0],B=h>V.right-V.width/2,j=y>V.bottom-V.height/2,z=S6(A,_),H=V.width>_.width,K=V.height>_.height,P=(H?_:V).left,U=(H?_:V).right,G=(K?_:V).top,I=(K?_:V).bottom;if(F&&(o=!0,!q))return;if(W&&(o=!1),W&&!q){o=!0;return}if(q&&un(k.relatedTarget)&&Dt(w.floating,k.relatedTarget)||E&&js(E.nodesRef.current,T).some(({context:ae})=>ae==null?void 0:ae.open))return;if($==="top"&&y>=_.bottom-1||$==="bottom"&&y<=_.top+1||$==="left"&&h>=_.right-1||$==="right"&&h<=_.left+1)return M();let Q=[];switch($){case"top":Q=[[P,_.top+1],[P,V.bottom-1],[U,V.bottom-1],[U,_.top+1]];break;case"bottom":Q=[[P,V.top+1],[P,_.bottom-1],[U,_.bottom-1],[U,V.top+1]];break;case"left":Q=[[V.right-1,I],[V.right-1,G],[_.left+1,G],[_.left+1,I]];break;case"right":Q=[[_.right-1,I],[_.right-1,G],[V.left+1,G],[V.left+1,I]];break}function le([ae,Z]){switch($){case"top":{const ue=[H?ae+t/2:B?ae+t*4:ae-t*4,Z+t+1],ve=[H?ae-t/2:B?ae+t*4:ae-t*4,Z+t+1],Se=[[V.left,B||H?V.bottom-t:V.top],[V.right,B?H?V.bottom-t:V.top:V.bottom-t]];return[ue,ve,...Se]}case"bottom":{const ue=[H?ae+t/2:B?ae+t*4:ae-t*4,Z-t],ve=[H?ae-t/2:B?ae+t*4:ae-t*4,Z-t],Se=[[V.left,B||H?V.top+t:V.bottom],[V.right,B?H?V.top+t:V.bottom:V.top+t]];return[ue,ve,...Se]}case"left":{const ue=[ae+t+1,K?Z+t/2:j?Z+t*4:Z-t*4],ve=[ae+t+1,K?Z-t/2:j?Z+t*4:Z-t*4];return[...[[j||K?V.right-t:V.left,V.top],[j?K?V.right-t:V.left:V.right-t,V.bottom]],ue,ve]}case"right":{const ue=[ae-t,K?Z+t/2:j?Z+t*4:Z-t*4],ve=[ae-t,K?Z-t/2:j?Z+t*4:Z-t*4],Se=[[j||K?V.left+t:V.right,V.top],[j?K?V.left+t:V.right:V.left+t,V.bottom]];return[ue,ve,...Se]}default:return[]}}if(!gR([D,O],Q)){if(o&&!z)return M();if(!q&&r){const ae=d(k.clientX,k.clientY);if(ae!==null&&ae<.1)return M()}gR([D,O],le([h,y]))?!o&&r&&a.start(40,M):M()}};return m.__options={blockPointerEvents:n},m}let E6=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),C6=(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 QO=v.createContext(void 0);function T6(){const e=v.useContext(QO);if(e===void 0)throw new Error(Cn(26));return e}const nc="ArrowUp",ks="ArrowDown",Cd="ArrowLeft",rc="ArrowRight",Gd="Home",Xd="End",ZO=new Set([Cd,rc]),R6=new Set([Cd,rc,Gd,Xd]),JO=new Set([nc,ks]),k6=new Set([nc,ks,Gd,Xd]),eA=new Set([...ZO,...JO]),M6=new Set([...eA,Gd,Xd]),R0=new Set([nc,ks,Cd,rc,Gd,Xd]),O6="Shift",A6="Control",N6="Alt",D6="Meta",I6=new Set([O6,A6,N6,D6]);function P6(e){return Mn(e)&&e.tagName==="INPUT"}function yR(e){return!!(P6(e)&&e.selectionStart!=null||Mn(e)&&e.tagName==="TEXTAREA")}function bR(e,t,n,r){if(!e||!t||!t.scrollTo)return;let a=e.scrollLeft,o=e.scrollTop;const l=e.clientWidth<e.scrollWidth,c=e.clientHeight<e.scrollHeight;if(l&&r!=="vertical"){const f=vR(e,t,"left"),d=zh(e),m=zh(t);n==="ltr"&&(f+t.offsetWidth+m.scrollMarginRight>e.scrollLeft+e.clientWidth-d.scrollPaddingRight?a=f+t.offsetWidth+m.scrollMarginRight-e.clientWidth+d.scrollPaddingRight:f-m.scrollMarginLeft<e.scrollLeft+d.scrollPaddingLeft&&(a=f-m.scrollMarginLeft-d.scrollPaddingLeft)),n==="rtl"&&(f-m.scrollMarginRight<e.scrollLeft+d.scrollPaddingLeft?a=f-m.scrollMarginLeft-d.scrollPaddingLeft:f+t.offsetWidth+m.scrollMarginRight>e.scrollLeft+e.clientWidth-d.scrollPaddingRight&&(a=f+t.offsetWidth+m.scrollMarginRight-e.clientWidth+d.scrollPaddingRight))}if(c&&r!=="horizontal"){const f=vR(e,t,"top"),d=zh(e),m=zh(t);f-m.scrollMarginTop<e.scrollTop+d.scrollPaddingTop?o=f-m.scrollMarginTop-d.scrollPaddingTop:f+t.offsetHeight+m.scrollMarginBottom>e.scrollTop+e.clientHeight-d.scrollPaddingBottom&&(o=f+t.offsetHeight+m.scrollMarginBottom-e.clientHeight+d.scrollPaddingBottom)}e.scrollTo({left:a,top:o,behavior:"auto"})}function vR(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let a=0;for(;t.offsetParent&&(a+=t[r],t.offsetParent!==e);)t=t.offsetParent;return a}function zh(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 L6={...ua,...Ya,nestedDialogOpen(e){return e?{[C6.nestedDialogOpen]:""}:null}},k0=v.forwardRef(function(t,n){const{className:r,finalFocus:a,initialFocus:o,render:l,...c}=t,{store:f}=Xo(),d=f.useState("descriptionElementId"),m=f.useState("disablePointerDismissal"),h=f.useState("floatingRootContext"),y=f.useState("popupProps"),g=f.useState("modal"),w=f.useState("mounted"),C=f.useState("nested"),T=f.useState("nestedOpenDialogCount"),E=f.useState("open"),R=f.useState("openMethod"),k=f.useState("titleElementId"),M=f.useState("transitionStatus"),D=f.useState("role");T6(),Wa({open:E,ref:f.context.popupRef,onComplete(){var W,_;E&&((_=(W=f.context).onOpenChangeComplete)==null||_.call(W,!0))}});function O(W){return W==="touch"?f.context.popupRef.current:!0}const A=o===void 0?O:o,L=T>0,F=It("div",t,{state:{open:E,nested:C,transitionStatus:M,nestedDialogOpen:L},props:[y,{"aria-labelledby":k??void 0,"aria-describedby":d??void 0,role:D,tabIndex:-1,hidden:!w,onKeyDown(W){R0.has(W.key)&&W.stopPropagation()},style:{[E6.nestedDialogs]:T}},c],ref:[n,f.context.popupRef,f.useStateSetter("popupElement")],stateAttributesMapping:L6});return S.jsx(g0,{context:h,openInteractionType:R,disabled:!w,closeOnFocusOut:!m,initialFocus:A,returnFocus:a,modal:g!==!1,restoreFocus:"popup",children:F})});function M0(e){return Xx(19)?e:e?"true":void 0}const O0=v.forwardRef(function(t,n){const{cutout:r,...a}=t;let o;if(r){const l=r==null?void 0:r.getBoundingClientRect();o=`polygon(
97
+ 0% 0%,
98
+ 100% 0%,
99
+ 100% 100%,
100
+ 0% 100%,
101
+ 0% 0%,
102
+ ${l.left}px ${l.top}px,
103
+ ${l.left}px ${l.bottom}px,
104
+ ${l.right}px ${l.bottom}px,
105
+ ${l.right}px ${l.top}px,
106
+ ${l.left}px ${l.top}px
107
+ )`}return S.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...a,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:o}})}),A0=v.forwardRef(function(t,n){const{keepMounted:r=!1,...a}=t,{store:o}=Xo(),l=o.useState("mounted"),c=o.useState("modal"),f=o.useState("open");return l||r?S.jsx(QO.Provider,{value:r,children:S.jsxs(p0,{ref:n,...a,children:[l&&c===!0&&S.jsx(O0,{ref:o.context.internalBackdropRef,inert:M0(!f)}),t.children]})}):null});function bm(e){const t=v.useRef(!0);t.current&&(t.current=!1,e())}let xR={},wR={},SR="";function _6(e){if(typeof document>"u")return!1;const t=Qt(e);return Hn(t).innerWidth-t.documentElement.clientWidth>0}function j6(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=Qt(e),r=n.documentElement,a=n.body,o=Ko(r)?r:a,l=o.style.overflowY,c=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",o.style.overflowY="scroll";const f=o.offsetWidth;o.style.overflowY="hidden";const d=o.offsetWidth;return o.style.overflowY=l,r.style.scrollbarGutter=c,f===d}function z6(e){const t=Qt(e),n=t.documentElement,r=t.body,a=Ko(n)?n:r,o={overflowY:a.style.overflowY,overflowX:a.style.overflowX};return Object.assign(a.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(a.style,o)}}function F6(e){var y;const t=Qt(e),n=t.documentElement,r=t.body,a=Hn(n);let o=0,l=0,c=!1;const f=Fn.create();if(sm&&(((y=a.visualViewport)==null?void 0:y.scale)??1)!==1)return()=>{};function d(){const g=a.getComputedStyle(n),w=a.getComputedStyle(r),E=(g.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";o=n.scrollTop,l=n.scrollLeft,xR={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},SR=n.style.scrollBehavior,wR={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const R=n.scrollHeight>n.clientHeight,k=n.scrollWidth>n.clientWidth,M=g.overflowY==="scroll"||w.overflowY==="scroll",D=g.overflowX==="scroll"||w.overflowX==="scroll",O=Math.max(0,a.innerWidth-r.clientWidth),A=Math.max(0,a.innerHeight-r.clientHeight),L=parseFloat(w.marginTop)+parseFloat(w.marginBottom),q=parseFloat(w.marginLeft)+parseFloat(w.marginRight),F=Ko(n)?n:r;if(c=j6(e),c){n.style.scrollbarGutter=E,F.style.overflowY="hidden",F.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:E,overflowY:"hidden",overflowX:"hidden"}),(R||M)&&(n.style.overflowY="scroll"),(k||D)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:L||A?`calc(100dvh - ${L+A}px)`:"100dvh",width:q||O?`calc(100vw - ${q+O}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),r.scrollTop=o,r.scrollLeft=l,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function m(){Object.assign(n.style,xR),Object.assign(r.style,wR),c||(n.scrollTop=o,n.scrollLeft=l,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=SR)}function h(){m(),f.request(d)}return d(),a.addEventListener("resize",h),()=>{f.cancel(),m(),typeof a.removeEventListener=="function"&&a.removeEventListener("resize",h)}}class B6{constructor(){at(this,"lockCount",0);at(this,"restore",null);at(this,"timeoutLock",sa.create());at(this,"timeoutUnlock",sa.create());at(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});at(this,"unlock",()=>{var t;this.lockCount===0&&this.restore&&((t=this.restore)==null||t.call(this),this.restore=null)})}acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}lock(t){if(this.lockCount===0||this.restore!==null)return;const r=Qt(t).documentElement,a=Hn(r).getComputedStyle(r).overflowY;if(a==="hidden"||a==="clip"){this.restore=Br;return}const o=V2||!_6(t);this.restore=o?z6(t):F6(t)}}const H6=new B6;function N0(e=!0,t=null){qe(()=>{if(e)return H6.acquire(t)},[e,t])}function U6(e){const t=v.useRef(""),n=v.useCallback(a=>{a.defaultPrevented||(t.current=a.pointerType,e(a,a.pointerType))},[e]);return{onClick:v.useCallback(a=>{if(a.detail===0){e(a,"keyboard");return}"pointerType"in a?e(a,a.pointerType):e(a,t.current),t.current=""},[e]),onPointerDown:n}}function D0(e){const[t,n]=v.useState(null),r=Ye((c,f)=>{e||n(f||(V2?"touch":""))}),a=v.useCallback(()=>{n(null)},[]),{onClick:o,onPointerDown:l}=U6(r);return v.useMemo(()=>({openMethod:t,reset:a,triggerProps:{onClick:o,onPointerDown:l}}),[t,a,o,l])}function tA(e){const{store:t,parentContext:n,actionsRef:r}=e,a=t.useState("open"),o=t.useState("disablePointerDismissal"),l=t.useState("modal"),c=t.useState("popupElement"),{openMethod:f,triggerProps:d,reset:m}=D0(a);x0(t);const{forceUnmount:h}=w0(a,t,()=>{m()}),y=Ye(F=>{const W=xt(F);return W.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},W}),g=v.useCallback(()=>{t.setOpen(!1,y(c0))},[t,y]);v.useImperativeHandle(r,()=>({unmount:h,close:g}),[h,g]);const w=C0({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[C,T]=v.useState(0),E=C===0,R=KO(w),k=mm(w,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:l==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(F){if(!t.context.outsidePressEnabledRef.current||"button"in F&&F.button!==0||"touches"in F&&F.touches.length!==1)return!1;const W=Rr(F);if(E&&!o){const _=W;return l&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===_||t.context.backdropRef.current===_||Dt(_,c)&&!(_!=null&&_.hasAttribute("data-base-ui-portal")):!0}return!1},escapeKey:E});N0(a&&l===!0,c);const{getReferenceProps:M,getFloatingProps:D,getTriggerProps:O}=Kd([R,k]);t.useContextCallback("onNestedDialogOpen",F=>{T(F+1)}),t.useContextCallback("onNestedDialogClose",()=>{T(0)}),v.useEffect(()=>(n!=null&&n.onNestedDialogOpen&&a&&n.onNestedDialogOpen(C),n!=null&&n.onNestedDialogClose&&!a&&n.onNestedDialogClose(),()=>{n!=null&&n.onNestedDialogClose&&a&&n.onNestedDialogClose()}),[a,n,C]);const A=v.useMemo(()=>M(d),[M,d]),L=v.useMemo(()=>O(d),[O,d]),q=v.useMemo(()=>D(),[D]);t.useSyncedValues({openMethod:f,activeTriggerProps:A,inactiveTriggerProps:L,popupProps:q,floatingRootContext:w,nestedOpenDialogCount:C})}const q6={...E0,modal:Ge(e=>e.modal),nested:Ge(e=>e.nested),nestedOpenDialogCount:Ge(e=>e.nestedOpenDialogCount),disablePointerDismissal:Ge(e=>e.disablePointerDismissal),openMethod:Ge(e=>e.openMethod),descriptionElementId:Ge(e=>e.descriptionElementId),titleElementId:Ge(e=>e.titleElementId),viewportElement:Ge(e=>e.viewportElement),role:Ge(e=>e.role)};class nA extends gm{constructor(n){super(V6(n),{popupRef:v.createRef(),backdropRef:v.createRef(),internalBackdropRef:v.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new Wd,onOpenChange:void 0,onOpenChangeComplete:void 0},q6);at(this,"setOpen",(n,r)=>{var c,f,d,m;if(r.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!n&&r.trigger==null&&this.state.activeTriggerId!=null&&(r.trigger=this.state.activeTriggerElement??void 0),(f=(c=this.context).onOpenChange)==null||f.call(c,n,r),r.isCanceled)return;const a={open:n,nativeEvent:r.event,reason:r.reason,nested:this.state.nested};(d=this.state.floatingRootContext.context.events)==null||d.emit("openchange",a);const o={open:n},l=((m=r.trigger)==null?void 0:m.id)??null;(l||n)&&(o.activeTriggerId=l,o.activeTriggerElement=r.trigger??null),this.update(o)})}}function V6(e={}){return{...S0(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...e}}function rA(e){const{children:t,open:n,defaultOpen:r=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:l=!1,modal:c=!0,actionsRef:f,handle:d,triggerId:m,defaultTriggerId:h=null}=e,y=Xo(!0),g=!!y,w=nr(()=>(d==null?void 0:d.store)??new nA({open:r,openProp:n,activeTriggerId:h,triggerIdProp:m,modal:c,disablePointerDismissal:l,nested:g})).current;bm(()=>{n===void 0&&w.state.open===!1&&r===!0&&w.update({open:!0,activeTriggerId:h})}),w.useControlledProp("openProp",n),w.useControlledProp("triggerIdProp",m),w.useSyncedValues({disablePointerDismissal:l,nested:g,modal:c}),w.useContextCallback("onOpenChange",a),w.useContextCallback("onOpenChangeComplete",o);const C=w.useState("payload");tA({store:w,actionsRef:f,parentContext:y==null?void 0:y.store.context});const T=v.useMemo(()=>({store:w}),[w]);return S.jsx(u0.Provider,{value:T,children:typeof t=="function"?t({payload:C}):t})}const I0=v.forwardRef(function(t,n){const{render:r,className:a,id:o,...l}=t,{store:c}=Xo(),f=Vi(o);return c.useSyncedValueWithCleanup("titleElementId",f),It("h2",t,{ref:n,props:[{id:f},l]})});/**
108
+ * @license lucide-react v0.564.0 - ISC
109
+ *
110
+ * This source code is licensed under the ISC license.
111
+ * See the LICENSE file in the root directory of this source tree.
112
+ */const iA=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
113
+ * @license lucide-react v0.564.0 - ISC
114
+ *
115
+ * This source code is licensed under the ISC license.
116
+ * See the LICENSE file in the root directory of this source tree.
117
+ */const $6=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
118
+ * @license lucide-react v0.564.0 - ISC
119
+ *
120
+ * This source code is licensed under the ISC license.
121
+ * See the LICENSE file in the root directory of this source tree.
122
+ */const Y6=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
123
+ * @license lucide-react v0.564.0 - ISC
124
+ *
125
+ * This source code is licensed under the ISC license.
126
+ * See the LICENSE file in the root directory of this source tree.
127
+ */const ER=e=>{const t=Y6(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
128
+ * @license lucide-react v0.564.0 - ISC
129
+ *
130
+ * This source code is licensed under the ISC license.
131
+ * See the LICENSE file in the root directory of this source tree.
132
+ */var W6={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"};/**
133
+ * @license lucide-react v0.564.0 - ISC
134
+ *
135
+ * This source code is licensed under the ISC license.
136
+ * See the LICENSE file in the root directory of this source tree.
137
+ */const K6=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
138
+ * @license lucide-react v0.564.0 - ISC
139
+ *
140
+ * This source code is licensed under the ISC license.
141
+ * See the LICENSE file in the root directory of this source tree.
142
+ */const G6=v.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:o,iconNode:l,...c},f)=>v.createElement("svg",{ref:f,...W6,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:iA("lucide",a),...!o&&!K6(c)&&{"aria-hidden":"true"},...c},[...l.map(([d,m])=>v.createElement(d,m)),...Array.isArray(o)?o:[o]]));/**
143
+ * @license lucide-react v0.564.0 - ISC
144
+ *
145
+ * This source code is licensed under the ISC license.
146
+ * See the LICENSE file in the root directory of this source tree.
147
+ */const gt=(e,t)=>{const n=v.forwardRef(({className:r,...a},o)=>v.createElement(G6,{ref:o,iconNode:t,className:iA(`lucide-${$6(ER(e))}`,`lucide-${e}`,r),...a}));return n.displayName=ER(e),n};/**
148
+ * @license lucide-react v0.564.0 - ISC
149
+ *
150
+ * This source code is licensed under the ISC license.
151
+ * See the LICENSE file in the root directory of this source tree.
152
+ */const X6=[["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"}]],Q6=gt("activity",X6);/**
153
+ * @license lucide-react v0.564.0 - ISC
154
+ *
155
+ * This source code is licensed under the ISC license.
156
+ * See the LICENSE file in the root directory of this source tree.
157
+ */const Z6=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],J6=gt("arrow-down",Z6);/**
158
+ * @license lucide-react v0.564.0 - ISC
159
+ *
160
+ * This source code is licensed under the ISC license.
161
+ * See the LICENSE file in the root directory of this source tree.
162
+ */const e8=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],t8=gt("arrow-left",e8);/**
163
+ * @license lucide-react v0.564.0 - ISC
164
+ *
165
+ * This source code is licensed under the ISC license.
166
+ * See the LICENSE file in the root directory of this source tree.
167
+ */const n8=[["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"}]],r8=gt("bell",n8);/**
168
+ * @license lucide-react v0.564.0 - ISC
169
+ *
170
+ * This source code is licensed under the ISC license.
171
+ * See the LICENSE file in the root directory of this source tree.
172
+ */const i8=[["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"}]],P0=gt("bot",i8);/**
173
+ * @license lucide-react v0.564.0 - ISC
174
+ *
175
+ * This source code is licensed under the ISC license.
176
+ * See the LICENSE file in the root directory of this source tree.
177
+ */const a8=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],o8=gt("brain",a8);/**
178
+ * @license lucide-react v0.564.0 - ISC
179
+ *
180
+ * This source code is licensed under the ISC license.
181
+ * See the LICENSE file in the root directory of this source tree.
182
+ */const s8=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Ip=gt("check",s8);/**
183
+ * @license lucide-react v0.564.0 - ISC
184
+ *
185
+ * This source code is licensed under the ISC license.
186
+ * See the LICENSE file in the root directory of this source tree.
187
+ */const l8=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],aA=gt("chevron-down",l8);/**
188
+ * @license lucide-react v0.564.0 - ISC
189
+ *
190
+ * This source code is licensed under the ISC license.
191
+ * See the LICENSE file in the root directory of this source tree.
192
+ */const c8=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Qd=gt("chevron-right",c8);/**
193
+ * @license lucide-react v0.564.0 - ISC
194
+ *
195
+ * This source code is licensed under the ISC license.
196
+ * See the LICENSE file in the root directory of this source tree.
197
+ */const u8=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],d8=gt("chevron-up",u8);/**
198
+ * @license lucide-react v0.564.0 - ISC
199
+ *
200
+ * This source code is licensed under the ISC license.
201
+ * See the LICENSE file in the root directory of this source tree.
202
+ */const f8=[["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"}]],od=gt("circle-alert",f8);/**
203
+ * @license lucide-react v0.564.0 - ISC
204
+ *
205
+ * This source code is licensed under the ISC license.
206
+ * See the LICENSE file in the root directory of this source tree.
207
+ */const h8=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],p8=gt("download",h8);/**
208
+ * @license lucide-react v0.564.0 - ISC
209
+ *
210
+ * This source code is licensed under the ISC license.
211
+ * See the LICENSE file in the root directory of this source tree.
212
+ */const m8=[["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"}]],oA=gt("ellipsis-vertical",m8);/**
213
+ * @license lucide-react v0.564.0 - ISC
214
+ *
215
+ * This source code is licensed under the ISC license.
216
+ * See the LICENSE file in the root directory of this source tree.
217
+ */const g8=[["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"}]],y8=gt("ellipsis",g8);/**
218
+ * @license lucide-react v0.564.0 - ISC
219
+ *
220
+ * This source code is licensed under the ISC license.
221
+ * See the LICENSE file in the root directory of this source tree.
222
+ */const b8=[["path",{d:"M13.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v11.5",key:"4pqfef"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M8 12v-1",key:"1ej8lb"}],["path",{d:"M8 18v-2",key:"qcmpov"}],["path",{d:"M8 7V6",key:"1nbb54"}],["circle",{cx:"8",cy:"20",r:"2",key:"ckkr5m"}]],v8=gt("file-archive",b8);/**
223
+ * @license lucide-react v0.564.0 - ISC
224
+ *
225
+ * This source code is licensed under the ISC license.
226
+ * See the LICENSE file in the root directory of this source tree.
227
+ */const x8=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]],w8=gt("file-braces",x8);/**
228
+ * @license lucide-react v0.564.0 - ISC
229
+ *
230
+ * This source code is licensed under the ISC license.
231
+ * See the LICENSE file in the root directory of this source tree.
232
+ */const S8=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],E8=gt("file-code",S8);/**
233
+ * @license lucide-react v0.564.0 - ISC
234
+ *
235
+ * This source code is licensed under the ISC license.
236
+ * See the LICENSE file in the root directory of this source tree.
237
+ */const C8=[["path",{d:"M4 6.835V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-.343",key:"1vfytu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M2 19a2 2 0 0 1 4 0v1a2 2 0 0 1-4 0v-4a6 6 0 0 1 12 0v4a2 2 0 0 1-4 0v-1a2 2 0 0 1 4 0",key:"1etmh7"}]],T8=gt("file-headphone",C8);/**
238
+ * @license lucide-react v0.564.0 - ISC
239
+ *
240
+ * This source code is licensed under the ISC license.
241
+ * See the LICENSE file in the root directory of this source tree.
242
+ */const R8=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["circle",{cx:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]],k8=gt("file-image",R8);/**
243
+ * @license lucide-react v0.564.0 - ISC
244
+ *
245
+ * This source code is licensed under the ISC license.
246
+ * See the LICENSE file in the root directory of this source tree.
247
+ */const M8=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M15.033 13.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56v-4.704a.645.645 0 0 1 .967-.56z",key:"1tzo1f"}]],O8=gt("file-play",M8);/**
248
+ * @license lucide-react v0.564.0 - ISC
249
+ *
250
+ * This source code is licensed under the ISC license.
251
+ * See the LICENSE file in the root directory of this source tree.
252
+ */const A8=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Eb=gt("file-text",A8);/**
253
+ * @license lucide-react v0.564.0 - ISC
254
+ *
255
+ * This source code is licensed under the ISC license.
256
+ * See the LICENSE file in the root directory of this source tree.
257
+ */const N8=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],D8=gt("file",N8);/**
258
+ * @license lucide-react v0.564.0 - ISC
259
+ *
260
+ * This source code is licensed under the ISC license.
261
+ * See the LICENSE file in the root directory of this source tree.
262
+ */const I8=[["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"}]],P8=gt("folder-closed",I8);/**
263
+ * @license lucide-react v0.564.0 - ISC
264
+ *
265
+ * This source code is licensed under the ISC license.
266
+ * See the LICENSE file in the root directory of this source tree.
267
+ */const L8=[["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"}]],_8=gt("folder-open",L8);/**
268
+ * @license lucide-react v0.564.0 - ISC
269
+ *
270
+ * This source code is licensed under the ISC license.
271
+ * See the LICENSE file in the root directory of this source tree.
272
+ */const j8=[["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"}]],z8=gt("folder",j8);/**
273
+ * @license lucide-react v0.564.0 - ISC
274
+ *
275
+ * This source code is licensed under the ISC license.
276
+ * See the LICENSE file in the root directory of this source tree.
277
+ */const F8=[["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"}]],L0=gt("globe",F8);/**
278
+ * @license lucide-react v0.564.0 - ISC
279
+ *
280
+ * This source code is licensed under the ISC license.
281
+ * See the LICENSE file in the root directory of this source tree.
282
+ */const B8=[["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"}]],_0=gt("grip-vertical",B8);/**
283
+ * @license lucide-react v0.564.0 - ISC
284
+ *
285
+ * This source code is licensed under the ISC license.
286
+ * See the LICENSE file in the root directory of this source tree.
287
+ */const H8=[["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"}]],U8=gt("history",H8);/**
288
+ * @license lucide-react v0.564.0 - ISC
289
+ *
290
+ * This source code is licensed under the ISC license.
291
+ * See the LICENSE file in the root directory of this source tree.
292
+ */const q8=[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]],V8=gt("keyboard",q8);/**
293
+ * @license lucide-react v0.564.0 - ISC
294
+ *
295
+ * This source code is licensed under the ISC license.
296
+ * See the LICENSE file in the root directory of this source tree.
297
+ */const $8=[["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"M3 10a2 2 0 0 0 2 2h3",key:"1npucw"}],["path",{d:"M3 5v12a2 2 0 0 0 2 2h3",key:"x1gjn2"}]],Y8=gt("list-tree",$8);/**
298
+ * @license lucide-react v0.564.0 - ISC
299
+ *
300
+ * This source code is licensed under the ISC license.
301
+ * See the LICENSE file in the root directory of this source tree.
302
+ */const W8=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Gs=gt("loader-circle",W8);/**
303
+ * @license lucide-react v0.564.0 - ISC
304
+ *
305
+ * This source code is licensed under the ISC license.
306
+ * See the LICENSE file in the root directory of this source tree.
307
+ */const K8=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],G8=gt("menu",K8);/**
308
+ * @license lucide-react v0.564.0 - ISC
309
+ *
310
+ * This source code is licensed under the ISC license.
311
+ * See the LICENSE file in the root directory of this source tree.
312
+ */const X8=[["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"}]],vm=gt("monitor",X8);/**
313
+ * @license lucide-react v0.564.0 - ISC
314
+ *
315
+ * This source code is licensed under the ISC license.
316
+ * See the LICENSE file in the root directory of this source tree.
317
+ */const Q8=[["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"}]],Z8=gt("moon",Q8);/**
318
+ * @license lucide-react v0.564.0 - ISC
319
+ *
320
+ * This source code is licensed under the ISC license.
321
+ * See the LICENSE file in the root directory of this source tree.
322
+ */const J8=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],e9=gt("panel-left",J8);/**
323
+ * @license lucide-react v0.564.0 - ISC
324
+ *
325
+ * This source code is licensed under the ISC license.
326
+ * See the LICENSE file in the root directory of this source tree.
327
+ */const t9=[["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"}]],n9=gt("panels-top-left",t9);/**
328
+ * @license lucide-react v0.564.0 - ISC
329
+ *
330
+ * This source code is licensed under the ISC license.
331
+ * See the LICENSE file in the root directory of this source tree.
332
+ */const r9=[["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"}]],xm=gt("pencil",r9);/**
333
+ * @license lucide-react v0.564.0 - ISC
334
+ *
335
+ * This source code is licensed under the ISC license.
336
+ * See the LICENSE file in the root directory of this source tree.
337
+ */const i9=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],wm=gt("plus",i9);/**
338
+ * @license lucide-react v0.564.0 - ISC
339
+ *
340
+ * This source code is licensed under the ISC license.
341
+ * See the LICENSE file in the root directory of this source tree.
342
+ */const a9=[["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"}]],o9=gt("power-off",a9);/**
343
+ * @license lucide-react v0.564.0 - ISC
344
+ *
345
+ * This source code is licensed under the ISC license.
346
+ * See the LICENSE file in the root directory of this source tree.
347
+ */const s9=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],l9=gt("power",s9);/**
348
+ * @license lucide-react v0.564.0 - ISC
349
+ *
350
+ * This source code is licensed under the ISC license.
351
+ * See the LICENSE file in the root directory of this source tree.
352
+ */const c9=[["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"}]],u9=gt("radar",c9);/**
353
+ * @license lucide-react v0.564.0 - ISC
354
+ *
355
+ * This source code is licensed under the ISC license.
356
+ * See the LICENSE file in the root directory of this source tree.
357
+ */const d9=[["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"}]],f9=gt("refresh-ccw",d9);/**
358
+ * @license lucide-react v0.564.0 - ISC
359
+ *
360
+ * This source code is licensed under the ISC license.
361
+ * See the LICENSE file in the root directory of this source tree.
362
+ */const h9=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],sA=gt("rotate-cw",h9);/**
363
+ * @license lucide-react v0.564.0 - ISC
364
+ *
365
+ * This source code is licensed under the ISC license.
366
+ * See the LICENSE file in the root directory of this source tree.
367
+ */const p9=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],m9=gt("search",p9);/**
368
+ * @license lucide-react v0.564.0 - ISC
369
+ *
370
+ * This source code is licensed under the ISC license.
371
+ * See the LICENSE file in the root directory of this source tree.
372
+ */const g9=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],CR=gt("send",g9);/**
373
+ * @license lucide-react v0.564.0 - ISC
374
+ *
375
+ * This source code is licensed under the ISC license.
376
+ * See the LICENSE file in the root directory of this source tree.
377
+ */const y9=[["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"}]],b9=gt("settings",y9);/**
378
+ * @license lucide-react v0.564.0 - ISC
379
+ *
380
+ * This source code is licensed under the ISC license.
381
+ * See the LICENSE file in the root directory of this source tree.
382
+ */const v9=[["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"}]],lA=gt("sparkles",v9);/**
383
+ * @license lucide-react v0.564.0 - ISC
384
+ *
385
+ * This source code is licensed under the ISC license.
386
+ * See the LICENSE file in the root directory of this source tree.
387
+ */const x9=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],w9=gt("square",x9);/**
388
+ * @license lucide-react v0.564.0 - ISC
389
+ *
390
+ * This source code is licensed under the ISC license.
391
+ * See the LICENSE file in the root directory of this source tree.
392
+ */const S9=[["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"}]],E9=gt("sun",S9);/**
393
+ * @license lucide-react v0.564.0 - ISC
394
+ *
395
+ * This source code is licensed under the ISC license.
396
+ * See the LICENSE file in the root directory of this source tree.
397
+ */const C9=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],T9=gt("terminal",C9);/**
398
+ * @license lucide-react v0.564.0 - ISC
399
+ *
400
+ * This source code is licensed under the ISC license.
401
+ * See the LICENSE file in the root directory of this source tree.
402
+ */const R9=[["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"}]],cA=gt("trash-2",R9);/**
403
+ * @license lucide-react v0.564.0 - ISC
404
+ *
405
+ * This source code is licensed under the ISC license.
406
+ * See the LICENSE file in the root directory of this source tree.
407
+ */const k9=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],M9=gt("triangle-alert",k9);/**
408
+ * @license lucide-react v0.564.0 - ISC
409
+ *
410
+ * This source code is licensed under the ISC license.
411
+ * See the LICENSE file in the root directory of this source tree.
412
+ */const O9=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],A9=gt("wrench",O9);/**
413
+ * @license lucide-react v0.564.0 - ISC
414
+ *
415
+ * This source code is licensed under the ISC license.
416
+ * See the LICENSE file in the root directory of this source tree.
417
+ */const N9=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Va=gt("x",N9);/**
418
+ * @license lucide-react v0.564.0 - ISC
419
+ *
420
+ * This source code is licensed under the ISC license.
421
+ * See the LICENSE file in the root directory of this source tree.
422
+ */const D9=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],uA=gt("zap",D9);function I9({...e}){return S.jsx(rA,{"data-slot":"sheet",...e})}function P9({...e}){return S.jsx(A0,{"data-slot":"sheet-portal",...e})}function L9({className:e,...t}){return S.jsx(d0,{"data-slot":"sheet-overlay",className:Pe("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 _9="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 j9({className:e,children:t,side:n="right",showCloseButton:r=!0,animation:a="slide",...o}){return S.jsxs(P9,{children:[S.jsx(L9,{}),S.jsxs(k0,{"data-slot":"sheet-content","data-side":n,className:Pe("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",a==="slide"&&_9,a==="bottom-up"&&"data-open:slide-in-from-bottom-16 data-closed:slide-out-to-bottom-16",a==="top-down"&&"data-open:slide-in-from-top-16 data-closed:slide-out-to-top-16",e),...o,children:[t,r&&S.jsxs(fm,{"data-slot":"sheet-close",render:S.jsx(Ht,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm"}),children:[S.jsx(Va,{}),S.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function z9({className:e,...t}){return S.jsx("div",{"data-slot":"sheet-header",className:Pe("gap-0.5 p-4 flex flex-col",e),...t})}function F9({className:e,...t}){return S.jsx(I0,{"data-slot":"sheet-title",className:Pe("text-foreground text-base font-medium",e),...t})}function B9({className:e,...t}){return S.jsx(f0,{"data-slot":"sheet-description",className:Pe("text-muted-foreground text-sm",e),...t})}const dA=v.createContext(void 0);function Zd(e){const t=v.useContext(dA);if(t===void 0&&!e)throw new Error(Cn(72));return t}const H9={...E0,disabled:Ge(e=>e.disabled),instantType:Ge(e=>e.instantType),isInstantPhase:Ge(e=>e.isInstantPhase),trackCursorAxis:Ge(e=>e.trackCursorAxis),disableHoverablePopup:Ge(e=>e.disableHoverablePopup),lastOpenChangeReason:Ge(e=>e.openChangeReason),closeDelay:Ge(e=>e.closeDelay),hasViewport:Ge(e=>e.hasViewport)};class j0 extends gm{constructor(n){super({...U9(),...n},{popupRef:v.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new Wd},H9);at(this,"setOpen",(n,r)=>{var d,m;const a=r.reason,o=a===vr,l=n&&a===Jl,c=!n&&(a===Ys||a===dm);if(r.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},(m=(d=this.context).onOpenChange)==null||m.call(d,n,r),r.isCanceled)return;const f=()=>{var g;const h={open:n,openChangeReason:a};l?h.instantType="focus":c?h.instantType="dismiss":a===vr&&(h.instantType=void 0);const y=((g=r.trigger)==null?void 0:g.id)??null;(y||n)&&(h.activeTriggerId=y,h.activeTriggerElement=r.trigger??null),this.update(h)};o?pr.flushSync(f):f()})}static useStore(n,r){const a=nr(()=>new j0(r)).current,o=n??a,l=C0({popupStore:o,onOpenChange:o.setOpen});return o.state.floatingRootContext=l,o}}function U9(){return{...S0(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeDelay:0,hasViewport:!1}}const q9=b0(function(t){const{disabled:n=!1,defaultOpen:r=!1,open:a,disableHoverablePopup:o=!1,trackCursorAxis:l="none",actionsRef:c,onOpenChange:f,onOpenChangeComplete:d,handle:m,triggerId:h,defaultTriggerId:y=null,children:g}=t,w=j0.useStore(m==null?void 0:m.store,{open:r,openProp:a,activeTriggerId:y,triggerIdProp:h});bm(()=>{a===void 0&&w.state.open===!1&&r===!0&&w.update({open:!0,activeTriggerId:y})}),w.useControlledProp("openProp",a),w.useControlledProp("triggerIdProp",h),w.useContextCallback("onOpenChange",f),w.useContextCallback("onOpenChangeComplete",d);const C=w.useState("open"),T=!n&&C,E=w.useState("activeTriggerId"),R=w.useState("payload");w.useSyncedValues({trackCursorAxis:l,disableHoverablePopup:o}),qe(()=>{C&&n&&w.setOpen(!1,xt(SH))},[C,n,w]),w.useSyncedValue("disabled",n),x0(w);const{forceUnmount:k,transitionStatus:M}=w0(T,w),D=w.useState("isInstantPhase"),O=w.useState("instantType"),A=w.useState("lastOpenChangeReason"),L=v.useRef(null);qe(()=>{M==="ending"&&A===Fi||M!=="ending"&&D?(O!=="delay"&&(L.current=O),w.set("instantType","delay")):L.current!==null&&(w.set("instantType",L.current),L.current=null)},[M,D,A,O,w]),qe(()=>{T&&E==null&&w.set("payload",void 0)},[w,E,T]);const q=v.useCallback(()=>{w.setOpen(!1,V9(w,c0))},[w]);v.useImperativeHandle(c,()=>({unmount:k,close:q}),[k,q]);const F=w.useState("floatingRootContext"),W=mm(F,{enabled:!n,referencePress:!0}),_=WH(F,{enabled:!n&&l!=="none",axis:l==="none"?void 0:l}),{getReferenceProps:V,getFloatingProps:$,getTriggerProps:B}=Kd([W,_]),j=v.useMemo(()=>V(),[V]),z=v.useMemo(()=>B(),[B]),H=v.useMemo(()=>$(),[$]);return w.useSyncedValues({activeTriggerProps:j,inactiveTriggerProps:z,popupProps:H}),S.jsx(dA.Provider,{value:w,children:typeof g=="function"?g({payload:R}):g})});function V9(e,t){const n=xt(t);return n.preventUnmountOnClose=()=>{e.set("preventUnmountingOnClose",!0)},n}const $9=v.createContext(void 0);function Y9(){return v.useContext($9)}let W9=(function(e){return e[e.popupOpen=Ap.popupOpen]="popupOpen",e.triggerDisabled="data-trigger-disabled",e})({});const K9=600,G9=FO(function(t,n){const{className:r,render:a,handle:o,payload:l,disabled:c,delay:f,closeDelay:d,id:m,...h}=t,y=Zd(!0),g=(o==null?void 0:o.store)??y;if(!g)throw new Error(Cn(82));const w=Vi(m),C=g.useState("isTriggerActive",w),T=g.useState("isOpenedByTrigger",w),E=g.useState("floatingRootContext"),R=v.useRef(null),k=f??K9,M=d??0,{registerTrigger:D,isMountedByThisTrigger:O}=HO(w,R,g,{payload:l,closeDelay:M}),A=Y9(),{delayRef:L,isInstantPhase:q,hasProvider:F}=jH(E,{open:T});g.useSyncedValue("isInstantPhase",q);const W=g.useState("disabled"),_=c??W,V=g.useState("trackCursorAxis"),$=g.useState("disableHoverablePopup"),B=YO(E,{enabled:!_,mouseOnly:!0,move:!1,handleClose:!$&&V!=="both"?XO():null,restMs(){const P=A==null?void 0:A.delay,U=typeof L.current=="object"?L.current.open:void 0;let G=k;return F&&(U!==0?G=f??P??k:G=0),G},delay(){const P=typeof L.current=="object"?L.current.close:void 0;let U=M;return d==null&&F&&(U=P),{close:U}},triggerElementRef:R,isActiveTrigger:C}),j=qO(E,{enabled:!_}).reference,z={open:T},H=g.useState("triggerProps",O);return It("button",t,{state:z,ref:[n,D,R],props:[B,j,H,{id:w,[W9.triggerDisabled]:_?"":void 0},h],stateAttributesMapping:yO})}),fA=v.createContext(void 0);function X9(){const e=v.useContext(fA);if(e===void 0)throw new Error(Cn(70));return e}const Q9=v.forwardRef(function(t,n){const{children:r,container:a,className:o,render:l,...c}=t,{portalNode:f,portalSubtree:d}=kO({container:a,ref:n,componentProps:t,elementProps:c});return!d&&!f?null:S.jsxs(v.Fragment,{children:[d,f&&pr.createPortal(r,f)]})}),Z9=v.forwardRef(function(t,n){const{keepMounted:r=!1,...a}=t;return Zd().useState("mounted")||r?S.jsx(fA.Provider,{value:r,children:S.jsx(Q9,{ref:n,...a})}):null}),hA=v.createContext(void 0);function pA(){const e=v.useContext(hA);if(e===void 0)throw new Error(Cn(71));return e}const J9=v.createContext(void 0);function Lc(){const e=v.useContext(J9);return(e==null?void 0:e.direction)??"ltr"}const eq=e=>({name:"arrow",options:e,async fn(t){var K,P;const{x:n,y:r,placement:a,rects:o,platform:l,elements:c,middlewareData:f}=t,{element:d,padding:m=0,offsetParent:h="real"}=qa(e,t)||{};if(d==null)return{};const y=J2(m),g={x:n,y:r},w=o0(a),C=a0(w),T=await l.getDimensions(d),E=w==="y",R=E?"top":"left",k=E?"bottom":"right",M=E?"clientHeight":"clientWidth",D=o.reference[C]+o.reference[w]-g[w]-o.floating[C],O=g[w]-o.reference[w],A=h==="real"?await((K=l.getOffsetParent)==null?void 0:K.call(l,d)):c.floating;let L=c.floating[M]||o.floating[C];(!L||!await((P=l.isElement)==null?void 0:P.call(l,A)))&&(L=c.floating[M]||o.floating[C]);const q=D/2-O/2,F=L/2-T[C]/2-1,W=Math.min(y[R],F),_=Math.min(y[k],F),V=W,$=L-T[C]-_,B=L/2-T[C]/2+q,j=zv(V,B,$),z=!f.arrow&&Go(a)!=null&&B!==j&&o.reference[C]/2-(B<V?W:_)-T[C]/2<0,H=z?B<V?B-V:B-$:0;return{[w]:g[w]+H,data:{[w]:j,centerOffset:B-j-H,...z&&{alignmentOffset:H}},reset:z}}}),tq=(e,t)=>({...eq(e),options:[e,t]}),nq={name:"hide",async fn(e){var c;const{width:t,height:n,x:r,y:a}=e.rects.reference,o=t===0&&n===0&&r===0&&a===0;return{data:{referenceHidden:((c=(await PU().fn(e)).data)==null?void 0:c.referenceHidden)||o}}}},sp={sideX:"left",sideY:"top"},rq={name:"adaptiveOrigin",async fn(e){var R,k;const{x:t,y:n,rects:{floating:r},elements:{floating:a},platform:o,strategy:l,placement:c}=e,f=Hn(a),d=f.getComputedStyle(a);if(!(d.transitionDuration!=="0s"&&d.transitionDuration!==""))return{x:t,y:n,data:sp};const h=await((R=o.getOffsetParent)==null?void 0:R.call(o,a));let y={width:0,height:0};if(l==="fixed"&&(f!=null&&f.visualViewport))y={width:f.visualViewport.width,height:f.visualViewport.height};else if(h===f){const M=Qt(a);y={width:M.documentElement.clientWidth,height:M.documentElement.clientHeight}}else await((k=o.isElement)==null?void 0:k.call(o,h))&&(y=await o.getDimensions(h));const g=Hr(c);let w=t,C=n;g==="left"&&(w=y.width-(t+r.width)),g==="top"&&(C=y.height-(n+r.height));const T=g==="left"?"right":sp.sideX,E=g==="top"?"bottom":sp.sideY;return{x:w,y:C,data:{sideX:T,sideY:E}}}};function mA(e,t,n){const r=e==="inline-start"||e==="inline-end";return{top:"top",right:r?n?"inline-start":"inline-end":"right",bottom:"bottom",left:r?n?"inline-end":"inline-start":"left"}[t]}function TR(e,t,n){const{rects:r,placement:a}=e;return{side:mA(t,Hr(a),n),align:Go(a)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function z0(e){var Tt,zt;const{anchor:t,positionMethod:n="absolute",side:r="bottom",sideOffset:a=0,align:o="center",alignOffset:l=0,collisionBoundary:c,collisionPadding:f=5,sticky:d=!1,arrowPadding:m=5,disableAnchorTracking:h=!1,keepMounted:y=!1,floatingRootContext:g,mounted:w,collisionAvoidance:C,shiftCrossAxis:T=!1,nodeId:E,adaptiveOrigin:R,lazyFlip:k=!1,externalTree:M}=e,[D,O]=v.useState(null);!w&&D!==null&&O(null);const A=C.side||"flip",L=C.align||"flip",q=C.fallbackAxisSide||"end",F=typeof t=="function"?t:void 0,W=Ye(F),_=F?W:t,V=sr(t),B=Lc()==="rtl",j=D||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":B?"left":"right","inline-start":B?"right":"left"}[r],z=o==="center"?j:`${j}-${o}`;let H=f;const K=1,P=r==="bottom"?K:0,U=r==="top"?K:0,G=r==="right"?K:0,I=r==="left"?K:0;typeof H=="number"?H={top:H+P,right:H+I,bottom:H+U,left:H+G}:H&&(H={top:(H.top||0)+P,right:(H.right||0)+I,bottom:(H.bottom||0)+U,left:(H.left||0)+G});const Q={boundary:c==="clipping-ancestors"?"clippingAncestors":c,padding:H},le=v.useRef(null),ae=sr(a),Z=sr(l),Se=[OU(yt=>{const At=TR(yt,r,B),it=typeof ae.current=="function"?ae.current(At):ae.current,ft=typeof Z.current=="function"?Z.current(At):Z.current;return{mainAxis:it,crossAxis:ft,alignmentAxis:ft}},[typeof a!="function"?a:0,typeof l!="function"?l:0,B,r])],Le=L==="none"&&A!=="shift",te=!Le&&(d||T||A==="shift"),he=A==="none"?null:DU({...Q,padding:{top:H.top+K,right:H.right+K,bottom:H.bottom+K,left:H.left+K},mainAxis:!T&&A==="flip",crossAxis:L==="flip"?"alignment":!1,fallbackAxisSideDirection:q}),ye=Le?null:AU(yt=>{const At=Qt(yt.elements.floating).documentElement;return{...Q,rootBoundary:T?{x:0,y:0,width:At.clientWidth,height:At.clientHeight}:void 0,mainAxis:L!=="none",crossAxis:te,limiter:d||T?void 0:NU(it=>{if(!le.current)return{};const{width:ft,height:bt}=le.current.getBoundingClientRect(),Ke=wi(Hr(it.placement)),kt=Ke==="y"?ft:bt,_t=Ke==="y"?H.left+H.right:H.top+H.bottom;return{offset:kt/2+_t/2}})}},[Q,d,T,H,L]);A==="shift"||L==="shift"||o==="center"?Se.push(ye,he):Se.push(he,ye),Se.push(IU({...Q,apply({elements:{floating:yt},rects:{reference:At},availableWidth:it,availableHeight:ft}){const bt=yt.style;bt.setProperty("--available-width",`${it}px`),bt.setProperty("--available-height",`${ft}px`),bt.setProperty("--anchor-width",`${At.width}px`),bt.setProperty("--anchor-height",`${At.height}px`)}}),tq(()=>({element:le.current||document.createElement("div"),padding:m,offsetParent:"floating"}),[m]),{name:"transformOrigin",fn(yt){var Xe,ot,Et;const{elements:At,middlewareData:it,placement:ft,rects:bt,y:Ke}=yt,kt=Hr(ft),_t=wi(kt),Rt=le.current,dn=((Xe=it.arrow)==null?void 0:Xe.x)||0,Ut=((ot=it.arrow)==null?void 0:ot.y)||0,Je=(Rt==null?void 0:Rt.clientWidth)||0,Mt=(Rt==null?void 0:Rt.clientHeight)||0,X=dn+Je/2,ie=Ut+Mt/2,de=Math.abs(((Et=it.shift)==null?void 0:Et.y)||0),ke=bt.reference.height/2,je=typeof a=="function"?a(TR(yt,r,B)):a,rt=de>je,nt={top:`${X}px calc(100% + ${je}px)`,bottom:`${X}px ${-je}px`,left:`calc(100% + ${je}px) ${ie}px`,right:`${-je}px ${ie}px`}[kt],We=`${X}px ${bt.reference.y+ke-Ke}px`;return At.floating.style.setProperty("--transform-origin",te&&_t==="y"&&rt?We:nt),{}}},nq,R),qe(()=>{!w&&g&&g.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[w,g]);const _e=v.useMemo(()=>({elementResize:!h&&typeof ResizeObserver<"u",layoutShift:!h&&typeof IntersectionObserver<"u"}),[h]),{refs:Oe,elements:Ce,x:Re,y:J,middlewareData:Ee,update:xe,placement:Be,context:Ve,isPositioned:De,floatingStyles:ut}=f6({rootContext:g,placement:z,middleware:Se,strategy:n,whileElementsMounted:y?void 0:(...yt)=>cR(...yt,_e),nodeId:E,externalTree:M}),{sideX:pe,sideY:Te}=Ee.adaptiveOrigin||sp,ee=De?n:"fixed",fe=v.useMemo(()=>{const yt=R?{position:ee,[pe]:Re,[Te]:J}:{position:ee,...ut};return De||(yt.opacity=0),yt},[R,ee,pe,Re,Te,J,ut,De]),Ae=v.useRef(null);qe(()=>{if(!w)return;const yt=V.current,At=typeof yt=="function"?yt():yt,ft=(RR(At)?At.current:At)||null||null;ft!==Ae.current&&(Oe.setPositionReference(ft),Ae.current=ft)},[w,Oe,_,V]),v.useEffect(()=>{if(!w)return;const yt=V.current;typeof yt!="function"&&RR(yt)&&yt.current!==Ae.current&&(Oe.setPositionReference(yt.current),Ae.current=yt.current)},[w,Oe,_,V]),v.useEffect(()=>{if(y&&w&&Ce.domReference&&Ce.floating)return cR(Ce.domReference,Ce.floating,xe,_e)},[y,w,Ce,xe,_e]);const He=Hr(Be),$e=mA(r,He,B),et=Go(Be)||"center",ze=!!((Tt=Ee.hide)!=null&&Tt.referenceHidden);qe(()=>{k&&w&&De&&O(He)},[k,w,De,He]);const Ze=v.useMemo(()=>{var yt,At;return{position:"absolute",top:(yt=Ee.arrow)==null?void 0:yt.y,left:(At=Ee.arrow)==null?void 0:At.x}},[Ee.arrow]),tt=((zt=Ee.arrow)==null?void 0:zt.centerOffset)!==0;return v.useMemo(()=>({positionerStyles:fe,arrowStyles:Ze,arrowRef:le,arrowUncentered:tt,side:$e,align:et,physicalSide:He,anchorHidden:ze,refs:Oe,context:Ve,isPositioned:De,update:xe}),[fe,Ze,le,tt,$e,et,He,ze,Oe,Ve,De,xe])}function RR(e){return e!=null&&"current"in e}function _c(e){return e==="starting"?mF:In}const iq=v.forwardRef(function(t,n){const{render:r,className:a,anchor:o,positionMethod:l="absolute",side:c="top",align:f="center",sideOffset:d=0,alignOffset:m=0,collisionBoundary:h="clipping-ancestors",collisionPadding:y=5,arrowPadding:g=5,sticky:w=!1,disableAnchorTracking:C=!1,collisionAvoidance:T=T2,...E}=t,R=Zd(),k=X9(),M=R.useState("open"),D=R.useState("mounted"),O=R.useState("trackCursorAxis"),A=R.useState("disableHoverablePopup"),L=R.useState("floatingRootContext"),q=R.useState("instantType"),F=R.useState("transitionStatus"),W=R.useState("hasViewport"),_=z0({anchor:o,positionMethod:l,floatingRootContext:L,mounted:D,side:c,sideOffset:d,align:f,alignOffset:m,collisionBoundary:h,collisionPadding:y,sticky:w,arrowPadding:g,disableAnchorTracking:C,keepMounted:k,collisionAvoidance:T,adaptiveOrigin:W?rq:void 0}),V=v.useMemo(()=>{const z={};return(!M||O==="both"||A)&&(z.pointerEvents="none"),{role:"presentation",hidden:!D,style:{..._.positionerStyles,...z}}},[M,O,A,D,_.positionerStyles]),$=v.useMemo(()=>({open:M,side:_.side,align:_.align,anchorHidden:_.anchorHidden,instant:O!=="none"?"tracking-cursor":q}),[M,_.side,_.align,_.anchorHidden,O,q]),B=v.useMemo(()=>({...$,arrowRef:_.arrowRef,arrowStyles:_.arrowStyles,arrowUncentered:_.arrowUncentered}),[$,_.arrowRef,_.arrowStyles,_.arrowUncentered]),j=It("div",t,{state:$,props:[V,_c(F),E],ref:[n,R.useStateSetter("positionerElement")],stateAttributesMapping:ua});return S.jsx(hA.Provider,{value:B,children:j})}),aq={...ua,...Ya},oq=v.forwardRef(function(t,n){const{className:r,render:a,...o}=t,l=Zd(),{side:c,align:f}=pA(),d=l.useState("open"),m=l.useState("instantType"),h=l.useState("transitionStatus"),y=l.useState("popupProps"),g=l.useState("floatingRootContext");Wa({open:d,ref:l.context.popupRef,onComplete(){var R,k;d&&((k=(R=l.context).onOpenChangeComplete)==null||k.call(R,!0))}});const w=l.useState("disabled"),C=l.useState("closeDelay");return $O(g,{enabled:!w,closeDelay:C}),It("div",t,{state:{open:d,side:c,align:f,instant:m,transitionStatus:h},ref:[n,l.context.popupRef,l.useStateSetter("popupElement")],props:[y,_c(h),o],stateAttributesMapping:aq})}),sq=v.forwardRef(function(t,n){const{className:r,render:a,...o}=t,c=Zd().useState("instantType"),{open:f,arrowRef:d,side:m,align:h,arrowUncentered:y,arrowStyles:g}=pA();return It("div",t,{state:{open:f,side:m,align:h,uncentered:y,instant:c},ref:[n,d],props:[{style:g,"aria-hidden":!0},o],stateAttributesMapping:ua})});function lq({...e}){return S.jsx(q9,{"data-slot":"tooltip",...e})}function cq({...e}){return S.jsx(G9,{"data-slot":"tooltip-trigger",...e})}function uq({className:e,side:t="top",sideOffset:n=4,align:r="center",alignOffset:a=0,children:o,...l}){return S.jsx(Z9,{children:S.jsx(iq,{align:r,alignOffset:a,side:t,sideOffset:n,className:"isolate z-50",children:S.jsxs(oq,{"data-slot":"tooltip-content",className:Pe("data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 rounded-md px-3 py-1.5 text-xs data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 bg-foreground text-background z-50 w-fit max-w-xs origin-(--transform-origin)",e),...l,children:[o,S.jsx(sq,{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 dq="sidebar_state",fq=3600*24*7,Cb="100vw",hq="3rem",pq="b",Fu=320,Pp=320,mq=450,Tb="tmex_sidebar_width";function gq(){const e=typeof window>"u"?Number.POSITIVE_INFINITY:window.innerWidth;return Math.max(Pp,e-mq)}function Fh(e){return Math.min(gq(),Math.max(Pp,Math.round(e)))}const gA=v.createContext(null);function Ur(){const e=v.useContext(gA);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function yq({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:a,children:o,...l}){const c=SF(),[f,d]=v.useState(!1),m=v.useRef(Fu),[h,y]=v.useState(()=>{if(typeof window>"u")return Fu;const L=Number(window.localStorage.getItem(Tb)),q=Number.isFinite(L)&&L>0?Math.max(Pp,Math.round(L)):Fu;return m.current=q,Fh(q)}),[g,w]=v.useState(!1),C=v.useCallback(L=>{const q=Math.max(Pp,Math.round(L));m.current=q,y(Fh(L)),window.localStorage.setItem(Tb,String(q))},[]),T=v.useCallback(()=>{m.current=Fu,y(Fh(Fu)),window.localStorage.removeItem(Tb)},[]);v.useEffect(()=>{const L=()=>{y(Fh(m.current))};return window.addEventListener("resize",L),()=>window.removeEventListener("resize",L)},[]);const[E,R]=v.useState(e),k=t??E,M=v.useCallback(L=>{const q=typeof L=="function"?L(k):L;n?n(q):R(q),document.cookie=`${dq}=${q}; path=/; max-age=${fq}`},[n,k]),D=v.useCallback(()=>c?d(L=>!L):M(L=>!L),[c,M,d]);v.useEffect(()=>{const L=q=>{q.defaultPrevented||q.target instanceof HTMLElement&&q.target.closest(".xterm")||q.key===pq&&(q.metaKey||q.ctrlKey)&&(q.preventDefault(),D())};return window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)},[D]);const O=k?"expanded":"collapsed",A=v.useMemo(()=>({state:O,open:k,setOpen:M,isMobile:c,openMobile:f,setOpenMobile:d,toggleSidebar:D,width:h,setWidth:C,resetWidth:T,isResizing:g,setIsResizing:w}),[O,k,M,c,f,d,D,h,C,T,g]);return S.jsx(gA.Provider,{value:A,children:S.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":`${h}px`,"--sidebar-width-icon":hq,...a},className:Pe("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",r),...l,children:o})})}function bq({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:a,dir:o,...l}){const{isMobile:c,state:f,openMobile:d,setOpenMobile:m,isResizing:h}=Ur();return n==="none"?S.jsx("div",{"data-slot":"sidebar",className:Pe("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",r),...l,children:a}):c?S.jsx(I9,{open:d,onOpenChange:m,...l,children:S.jsxs(j9,{dir:o,"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":Cb,width:Cb,maxWidth:Cb},side:e,animation:"top-down",children:[S.jsxs(z9,{className:"sr-only",children:[S.jsx(F9,{children:"Sidebar"}),S.jsx(B9,{children:"Displays the mobile sidebar."})]}),S.jsx("div",{className:"flex h-full w-full flex-col","data-testid":"sidebar",style:{paddingBottom:"var(--tmex-safe-area-bottom)"},children:a})]})}):S.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":f,"data-collapsible":f==="collapsed"?n:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[S.jsx("div",{"data-slot":"sidebar-gap",className:Pe(!h&&"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)")}),S.jsxs("div",{"data-slot":"sidebar-container","data-side":e,className:Pe(!h&&"transition-[left,right,width] duration-200 ease-linear","fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...l,children:[S.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner","data-testid":"sidebar",className:"bg-sidebar group-data-[variant=floating]:ring-sidebar-border group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 flex size-full flex-col",style:{paddingBottom:"var(--tmex-safe-area-bottom)"},children:a}),f==="expanded"&&S.jsx(vq,{side:e})]})]})}function vq({side:e}){const{width:t,setWidth:n,resetWidth:r,setIsResizing:a}=Ur(),o=v.useRef(null);return S.jsx("div",{"data-slot":"sidebar-resizer","data-testid":"sidebar-resizer","aria-hidden":"true",className:Pe("absolute inset-y-0 z-30 w-2 cursor-col-resize touch-none select-none","after:absolute after:inset-y-0 after:w-[2px] after:bg-transparent hover:after:bg-sidebar-border active:after:bg-sidebar-border",e==="left"?"-right-1 after:right-[3px]":"-left-1 after:left-[3px]"),onPointerDown:l=>{l.preventDefault(),o.current={pointerId:l.pointerId,startX:l.clientX,startWidth:t},l.currentTarget.setPointerCapture(l.pointerId),a(!0)},onPointerMove:l=>{const c=o.current;if(!c||c.pointerId!==l.pointerId)return;const f=l.clientX-c.startX;n(c.startWidth+(e==="left"?f:-f))},onPointerUp:l=>{var c;((c=o.current)==null?void 0:c.pointerId)===l.pointerId&&(o.current=null,a(!1))},onPointerCancel:l=>{var c;((c=o.current)==null?void 0:c.pointerId)===l.pointerId&&(o.current=null,a(!1))},onDoubleClick:r})}function xq({className:e,onClick:t,...n}){const{toggleSidebar:r,isMobile:a}=Ur();return S.jsxs(Ht,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon-sm",className:Pe(e),onClick:o=>{t==null||t(o),r()},...n,children:[a?S.jsx(G8,{}):S.jsx(e9,{}),S.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function wq({className:e,...t}){return S.jsx("main",{"data-slot":"sidebar-inset",className:Pe("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 Sq({className:e,...t}){return S.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:Pe("gap-2 p-2 flex flex-col",e),...t})}function Eq({className:e,...t}){return S.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:Pe("gap-2 p-2 flex flex-col",e),...t})}function Cq({className:e,...t}){return S.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:Pe("no-scrollbar gap-0 flex min-h-0 flex-1 flex-col overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function F0({className:e,...t}){return S.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:Pe("p-2 relative flex w-full min-w-0 flex-col",e),...t})}function Tq({className:e,...t}){return S.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:Pe("gap-0 flex w-full min-w-0 flex-col",e),...t})}function Rq({className:e,...t}){return S.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:Pe("group/menu-item relative",e),...t})}const kq=em("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 Mq({render:e,isActive:t=!1,variant:n="default",size:r="default",tooltip:a,className:o,...l}){const{isMobile:c,state:f}=Ur(),d=Jp({defaultTagName:"button",props:Ti({className:Pe(kq({variant:n,size:r}),o)},l),render:a?cq:e,state:{slot:"sidebar-menu-button",sidebar:"menu-button",size:r,active:t}});return a?(typeof a=="string"&&(a={children:a}),S.jsxs(lq,{children:[d,S.jsx(uq,{side:"right",align:"center",hidden:f!=="collapsed"||c,...a})]})):d}function Oq({className:e,render:t,showOnHover:n=!1,...r}){return Jp({defaultTagName:"button",props:Ti({className:Pe("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 aspect-square w-5 rounded-md p-0 peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 focus-visible:ring-2 [&>svg]:size-4 flex items-center justify-center outline-hidden transition-transform group-data-[collapsible=icon]:hidden after:absolute after:-inset-2 md:after:hidden [&>svg]:shrink-0",n&&"peer-data-active/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 aria-expanded:opacity-100 md:opacity-0",e)},r),render:t,state:{slot:"sidebar-menu-action",sidebar:"menu-action"}})}function Aq({className:e,...t}){return S.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:Pe("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 Nq({className:e,...t}){return S.jsx("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:Pe("group/menu-sub-item relative",e),...t})}function Dq({render:e,size:t="md",isActive:n=!1,className:r,...a}){return Jp({defaultTagName:"a",props:Ti({className:Pe("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground h-7 gap-2 rounded-md px-2 focus-visible:ring-2 data-[size=md]:text-sm data-[size=sm]:text-xs [&>svg]:size-4 flex min-w-0 -translate-x-px items-center overflow-hidden outline-hidden group-data-[collapsible=icon]:hidden disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:shrink-0",r)},a),render:e,state:{slot:"sidebar-menu-sub-button",sidebar:"menu-sub-button",size:t,active:n}})}let lp=null;function kR(e){lp=e}function Iq(e,t){lp==null||lp(e,t)}let Qu=null;function MR(e){Qu=e}function Pq(){Qu!=null&&Qu.isMobile&&Qu.setOpenMobile(!0)}function Lq(){const e=Hd(),{isMobile:t,setOpenMobile:n}=Ur();return v.useEffect(()=>(kR((r,a)=>e(r,a??{})),()=>kR(null)),[e]),v.useEffect(()=>(MR({isMobile:t,setOpenMobile:n}),()=>MR(null)),[t,n]),null}const _q={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"},jq={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 zq(e){const t=e==="light"?_q:jq;return`fg=${t.foreground},bg=${t.background}`}const yA=["GeistMonoTmex","NotoSansSymbols2Tmex"],Lte=`${yA.join(", ")}, monospace`;let Bl=null;function _te(){var t;if(Bl)return Bl;const e=(t=globalThis.document)==null?void 0:t.fonts;return e!=null&&e.load?(Bl=Promise.all(yA.flatMap(n=>[e.load(`13px ${n}`),e.load(`bold 13px ${n}`)])).then(()=>{}).catch(()=>{}),Bl):(Bl=Promise.resolve(),Bl)}const Fq=`${typeof window<"u"&&window.location.protocol==="https:"?"wss:":"ws:"}//${typeof window<"u"?window.location.host:""}/ws`,Bq={clientImpl:"tmex-fe",clientVersion:"0.1.0",maxFrameBytes:1048576,reconnectDelayMs:1e3,maxReconnectAttempts:5,heartbeatIntervalMs:15e3};class Hq{constructor(t={}){at(this,"ws",null);at(this,"options");at(this,"state","IDLE");at(this,"seq",0);at(this,"chunkReassembler",new q5);at(this,"reconnectAttempts",0);at(this,"reconnectTimer",null);at(this,"heartbeatTimer",null);at(this,"messageHandlers",new Set);at(this,"stateChangeHandlers",new Set);at(this,"errorHandlers",new Set);at(this,"pendingMessages",[]);at(this,"maxPendingMessages",100);this.options={...Bq,...t}}setState(t){if(this.state!==t){console.log(`[borsh-client] State: ${this.state} -> ${t}`),this.state=t;for(const n of this.stateChangeHandlers)try{n(t)}catch(r){console.error("[borsh-client] State change handler error:",r)}t==="READY"&&this.flushPendingMessages()}}getState(){return this.state}isReady(){return this.state==="READY"}onMessage(t){return this.messageHandlers.add(t),()=>this.messageHandlers.delete(t)}onStateChange(t){return this.stateChangeHandlers.add(t),()=>this.stateChangeHandlers.delete(t)}onError(t){return this.errorHandlers.add(t),()=>this.errorHandlers.delete(t)}connect(){var t,n;if(!(((t=this.ws)==null?void 0:t.readyState)===WebSocket.OPEN||((n=this.ws)==null?void 0:n.readyState)===WebSocket.CONNECTING)){this.setState("WS_CONNECTING");try{this.ws=new WebSocket(Fq),this.ws.binaryType="arraybuffer",this.ws.onopen=()=>{this.sendHello()},this.ws.onmessage=r=>{this.handleMessage(r.data)},this.ws.onclose=()=>{this.handleClose()},this.ws.onerror=()=>{this.handleError(new Error("WebSocket error"))}}catch(r){this.handleError(r instanceof Error?r:new Error(String(r)))}}}disconnect(){this.setState("CLOSED"),this.clearTimers(),this.ws&&(this.ws.close(),this.ws=null)}handleMessage(t){if(typeof t=="string")return;const n=new Uint8Array(t);if(!H5(n)){console.warn("[borsh-client] Received message without magic, ignoring");return}try{const r=z5(n);if(r.kind===m3){const a=B5(r.payload),o=this.chunkReassembler.addChunk(a);o&&this.dispatchMessage({kind:o.kind,seq:o.seq,payload:o.payload});return}if(r.kind===H4){this.handleHelloS2C(r.payload);return}if(r.kind===q4)return;this.dispatchMessage({kind:r.kind,seq:r.seq,payload:r.payload})}catch(r){console.error("[borsh-client] Failed to decode message:",r)}}dispatchMessage(t){for(const n of this.messageHandlers)try{n(t)}catch(r){console.error("[borsh-client] Message handler error:",r)}}handleHelloS2C(t){try{const n=_a(G3,t);console.log("[borsh-client] HELLO_S2C received:",n),this.setState("READY"),this.startHeartbeat(),this.reconnectAttempts=0}catch(n){console.error("[borsh-client] Failed to decode HELLO_S2C:",n),this.handleError(new Error("HELLO negotiation failed"))}}handleClose(){this.stopHeartbeat(),this.state!=="CLOSED"&&(this.reconnectAttempts<this.options.maxReconnectAttempts?this.scheduleReconnect():(this.setState("CLOSED"),this.handleError(new Error("Max reconnection attempts reached"))))}handleError(t){console.error("[borsh-client] Error:",t);for(const n of this.errorHandlers)try{n(t)}catch(r){console.error("[borsh-client] Error handler error:",r)}}sendHello(){const t={clientImpl:this.options.clientImpl,clientVersion:this.options.clientVersion,maxFrameBytes:this.options.maxFrameBytes,supportsCompression:!1,supportsDiffSnapshot:!1},n=tr(K3,t),r=this.nextSeq(),a=tp(B4,n,r);this.sendRaw(a),this.setState("HELLO_NEGOTIATING")}send(t,n){if(!this.isReady())return this.pendingMessages.length<this.maxPendingMessages&&this.pendingMessages.push({kind:t,payload:n}),!1;const r=this.nextSeq(),a=V5(n,t,r,{maxFrameBytes:this.options.maxFrameBytes,chunkStreamId:$5()});if(a.totalChunks===0){const o=tp(t,n,r);this.sendRaw(o)}else for(const o of a.chunks){const l=F5(o,this.nextSeq());this.sendRaw(l)}return!0}sendRaw(t){var n;((n=this.ws)==null?void 0:n.readyState)===WebSocket.OPEN&&this.ws.send(t)}flushPendingMessages(){for(;this.pendingMessages.length>0;){const t=this.pendingMessages.shift();t&&this.send(t.kind,t.payload)}}startHeartbeat(){this.stopHeartbeat(),this.heartbeatTimer=setInterval(()=>{this.sendPing()},this.options.heartbeatIntervalMs)}stopHeartbeat(){this.heartbeatTimer&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null)}sendPing(){if(!this.isReady())return;const t={nonce:Math.floor(Math.random()*4294967295),timeMs:BigInt(Date.now())},n=tr(X3,t),r=this.nextSeq(),a=tp(U4,n,r);this.sendRaw(a)}scheduleReconnect(){if(this.reconnectTimer)return;this.reconnectAttempts++,this.setState("RECONNECT_BACKOFF");const t=Math.min(this.options.reconnectDelayMs*2**(this.reconnectAttempts-1),3e4);console.log(`[borsh-client] Reconnecting in ${t}ms (attempt ${this.reconnectAttempts})`),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},t)}clearTimers(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.stopHeartbeat()}nextSeq(){return this.seq=(this.seq+1)%4294967295,this.seq}}let Rb=null;function Dn(){return Rb||(Rb=new Hq),Rb}class Uq{constructor(t={}){at(this,"transactions",new Map);at(this,"outputGates",new Map);at(this,"deferredResets",new Set);at(this,"deferredHistories",new Map);at(this,"deferredFlushes",new Map);at(this,"deferredOutputs",new Map);at(this,"callbacks");at(this,"ackTimeoutMs",1500);at(this,"liveResumeTimeoutMs",2e3);at(this,"timers",new Map);this.callbacks=t}setCallbacks(t){this.callbacks=t;for(const n of this.transactions.keys())this.replayDeferred(n);for(const n of this.deferredResets)this.replayDeferred(n);for(const n of this.deferredHistories.keys())this.replayDeferred(n);for(const n of this.deferredFlushes.keys())this.replayDeferred(n);for(const n of this.deferredOutputs.keys())this.replayDeferred(n)}getTransaction(t){return this.transactions.get(t)}getState(t){var n;return((n=this.transactions.get(t))==null?void 0:n.state)??"STABLE"}isStable(t){return this.getState(t)==="STABLE"}isBuffering(t){var n;return((n=this.outputGates.get(t))==null?void 0:n.state)==="BUFFERING"}dispatch(t){switch(t.type){case"SELECT_START":this.handleSelectStart(t);break;case"SWITCH_ACK":this.handleSwitchAck(t);break;case"HISTORY":this.handleHistory(t);break;case"LIVE_RESUME":this.handleLiveResume(t);break;case"OUTPUT":this.handleOutput(t);break;case"SELECT_FAILED":this.handleSelectFailed(t);break}}handleSelectStart(t){const{deviceId:n,windowId:r,paneId:a,selectToken:o,wantHistory:l}=t;this.cancelTransaction(n),this.clearDeferred(n);const c={state:"SELECTING",deviceId:n,windowId:r,paneId:a,selectToken:new Uint8Array(o),wantHistory:l,startedAt:Date.now()};this.transactions.set(n,c),this.startOutputBuffering(n),this.setTimer(n,()=>{this.handleTimeout(n,"ack")},this.ackTimeoutMs)}handleSwitchAck(t){const{deviceId:n,selectToken:r}=t,a=this.transactions.get(n);!a||!this.validateToken(a.selectToken,r)||a.state==="SELECTING"&&(this.clearTimer(n),a.state="ACKED",this.callbacks.onResetTerminal?this.callbacks.onResetTerminal(n):this.deferredResets.add(n),this.setTimer(n,()=>{this.handleTimeout(n,"live")},this.liveResumeTimeoutMs))}handleHistory(t){const{deviceId:n,selectToken:r,data:a}=t,o=this.transactions.get(n);!o||!this.validateToken(o.selectToken,r)||o.state==="ACKED"&&(o.state="HISTORY_APPLIED",this.callbacks.onApplyHistory?this.callbacks.onApplyHistory(n,a,t.alternateScreen):this.deferredHistories.set(n,{data:a,alternateScreen:t.alternateScreen}),this.setTimer(n,()=>{this.handleTimeout(n,"live")},this.liveResumeTimeoutMs))}handleLiveResume(t){const{deviceId:n,selectToken:r}=t,a=this.transactions.get(n);if(!a||!this.validateToken(a.selectToken,r)||a.state!=="ACKED"&&a.state!=="HISTORY_APPLIED")return;this.clearTimer(n),a.state="LIVE";const o=this.stopOutputBuffering(n);this.completeTransaction(n),this.callbacks.onFlushBuffer?this.callbacks.onFlushBuffer(n,o):o.length>0&&this.deferredFlushes.set(n,o),this.replayDeferred(n)}handleOutput(t){const{deviceId:n,paneId:r,data:a}=t,o=this.transactions.get(n);if(o&&o.paneId!==r)return;if(this.isBuffering(n)){this.bufferOutput(n,a);return}if(this.callbacks.onOutput){this.callbacks.onOutput(n,r,a);return}const l=this.deferredOutputs.get(n)??[];l.push({paneId:r,data:new Uint8Array(a)}),this.deferredOutputs.set(n,l)}handleSelectFailed(t){const{deviceId:n}=t;this.failTransaction(n)}handleTimeout(t,n){console.warn(`[select-sm] Timeout at ${n} for ${t}`),this.failTransaction(t)}completeTransaction(t){const n=this.transactions.get(t);n&&(n.state="STABLE",this.transactions.delete(t))}failTransaction(t){var r,a;const n=this.transactions.get(t);n&&(n.state="SELECT_FAILED",this.stopOutputBuffering(t),(a=(r=this.callbacks).onSelectFailed)==null||a.call(r,t),this.transactions.delete(t),this.clearTimer(t),this.clearDeferred(t))}cancelTransaction(t){this.transactions.get(t)&&(this.stopOutputBuffering(t),this.transactions.delete(t),this.clearTimer(t),this.clearDeferred(t))}startOutputBuffering(t){this.outputGates.set(t,{state:"BUFFERING",buffer:[]})}stopOutputBuffering(t){const n=this.outputGates.get(t);if(!n)return[];const r=[...n.buffer];return this.outputGates.delete(t),r}bufferOutput(t,n){const r=this.outputGates.get(t);r&&(r.buffer.length>=1e3&&r.buffer.shift(),r.buffer.push(new Uint8Array(n)))}validateToken(t,n){if(t.length!==n.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==n[r])return!1;return!0}replayDeferred(t){var o,l;this.deferredResets.has(t)&&(this.deferredResets.delete(t),(l=(o=this.callbacks).onResetTerminal)==null||l.call(o,t));const n=this.deferredHistories.get(t);n!==void 0&&this.callbacks.onApplyHistory&&(this.callbacks.onApplyHistory(t,n.data,n.alternateScreen),this.deferredHistories.delete(t));const r=this.deferredFlushes.get(t);r&&this.callbacks.onFlushBuffer&&(this.callbacks.onFlushBuffer(t,r),this.deferredFlushes.delete(t));const a=this.deferredOutputs.get(t);if(a&&this.callbacks.onOutput){for(const c of a)this.callbacks.onOutput(t,c.paneId,c.data);this.deferredOutputs.delete(t)}}clearDeferred(t){this.deferredResets.delete(t),this.deferredHistories.delete(t),this.deferredFlushes.delete(t),this.deferredOutputs.delete(t)}setTimer(t,n,r){this.clearTimer(t);const a=setTimeout(n,r);this.timers.set(t,a)}clearTimer(t){const n=this.timers.get(t);n&&(clearTimeout(n),this.timers.delete(t))}cleanup(t){this.cancelTransaction(t),this.outputGates.delete(t),this.clearDeferred(t)}cleanupAll(){for(const t of this.transactions.keys())this.cleanup(t);this.transactions.clear(),this.outputGates.clear(),this.deferredResets.clear(),this.deferredHistories.clear(),this.deferredFlushes.clear(),this.deferredOutputs.clear();for(const t of this.timers.values())clearTimeout(t);this.timers.clear()}}let Bu=null;function Td(e){return Bu?(e&&Bu.setCallbacks(e),Bu):(Bu=new Uq(e),Bu)}function qq(){return crypto.getRandomValues(new Uint8Array(16))}function bA(e){const t=tr(Q3,{deviceId:e});return{kind:$4,payload:t}}function Vq(e){const t=tr(J3,{deviceId:e});return{kind:W4,payload:t}}function $q(e){const t=tr(n5,{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:X4,payload:t}}function Yq(e,t){const n=tr(r5,{deviceId:e,windowId:t});return{kind:Q4,payload:n}}function Wq(e,t){const n=tr(i5,{deviceId:e,name:t??null});return{kind:Z4,payload:n}}function Kq(e,t){const n=tr(a5,{deviceId:e,windowId:t});return{kind:J4,payload:n}}function Gq(e,t){const n=tr(o5,{deviceId:e,paneId:t});return{kind:e3,payload:n}}function Xq(e,t,n){const r=tr(s5,{deviceId:e,windowId:t,name:n});return{kind:t3,payload:r}}function Qq(e,t){const n=tr(l5,{deviceId:e,style:t});return{kind:i3,payload:n}}function Zq(e,t){const n=tr(c5,{deviceId:e,windowIds:t});return{kind:a3,payload:n}}function Jq(e,t,n){const r=tr(u5,{deviceId:e,windowId:t,paneIds:n});return{kind:o3,payload:r}}function eV(e,t,n,r=!1){const a=new TextEncoder,o=tr(f5,{deviceId:e,paneId:t,encoding:2,data:a.encode(n),isComposing:r});return{kind:s3,payload:o}}function tV(e,t,n){const r=new TextEncoder,a=tr(h5,{deviceId:e,paneId:t,encoding:2,data:r.encode(n),isComposing:!1});return{kind:l3,payload:a}}function nV(e,t,n,r){const a=tr(b2,{deviceId:e,paneId:t,cols:n,rows:r});return{kind:c3,payload:a}}function rV(e,t,n,r){const a=tr(p5,{deviceId:e,paneId:t,cols:n,rows:r});return{kind:u3,payload:a}}function iV(e){const t=tr(E5,{sessionId:e});return{kind:g3,payload:t}}function aV(e){const t=tr(C5,{sessionId:e});return{kind:y3,payload:t}}const OR=e=>{let t;const n=new Set,r=(d,m)=>{const h=typeof d=="function"?d(t):d;if(!Object.is(h,t)){const y=t;t=m??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(g=>g(t,y))}},a=()=>t,c={setState:r,getState:a,getInitialState:()=>f,subscribe:d=>(n.add(d),()=>n.delete(d))},f=t=e(r,a,c);return c},oV=(e=>e?OR(e):OR),sV=e=>e;function lV(e,t=sV){const n=Fe.useSyncExternalStore(e.subscribe,Fe.useCallback(()=>t(e.getState()),[e,t]),Fe.useCallback(()=>t(e.getInitialState()),[e,t]));return Fe.useDebugValue(n),n}const AR=e=>{const t=oV(e),n=r=>lV(t,r);return Object.assign(n,t),n},Jd=(e=>e?AR(e):AR),kb={siteName:"tmex",siteUrl:typeof window<"u"?window.location.origin:"http://localhost:9663",bellThrottleSeconds:6,notificationThrottleSeconds:3,enableBrowserBellToast:!0,enableBrowserNotificationToast:!0,enableTelegramBellPush:!0,enableTelegramNotificationPush:!0,sshReconnectMaxRetries:2,sshReconnectDelaySeconds:10,language:Gx,updatedAt:new Date(0).toISOString()};async function NR(){const e=await fetch("/api/settings/site");if(!e.ok)throw new Error("Failed to load site settings");return(await e.json()).settings}const Xs=Jd((e,t)=>({settings:null,loading:!1,fetchSettings:async()=>{const n=t().settings;if(n)return n;e({loading:!0});try{const r=await NR();return e({settings:r,loading:!1}),hn.changeLanguage(r.language),r}catch(r){return console.error("[site] failed to fetch settings:",r),e({settings:kb,loading:!1}),hn.changeLanguage(kb.language),kb}},refreshSettings:async()=>{e({loading:!0});try{const n=await NR();return e({settings:n,loading:!1}),hn.changeLanguage(n.language),n}catch(n){throw console.error("[site] failed to refresh settings:",n),e({loading:!1}),n}}}));function cV(e){const t=typeof e.windowIndex=="number"?`Window ${e.windowIndex}`:typeof e.windowId=="string"&&e.windowId?`Window ${e.windowId}`:"",n=typeof e.paneIndex=="number"?`Pane ${e.paneIndex}`:typeof e.paneId=="string"&&e.paneId?`Pane ${e.paneId}`:"";return[t,n].filter(Boolean).join(" · ")}function uV(e){const t=typeof e.title=="string"&&e.title?e.title:"Terminal Notification",n=cV(e),r=typeof e.body=="string"&&e.body?e.body:typeof e.source=="string"&&e.source?`From ${e.source}`:"Terminal notification";return{title:t,description:n?`${n}
423
+ ${r}`:r}}function dV(e,t){let n;try{n=e()}catch{return}return{getItem:a=>{var o;const l=f=>f===null?null:JSON.parse(f,void 0),c=(o=n.getItem(a))!=null?o:null;return c instanceof Promise?c.then(l):l(c)},setItem:(a,o)=>n.setItem(a,JSON.stringify(o,void 0)),removeItem:a=>n.removeItem(a)}}const Wv=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return Wv(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return Wv(r)(n)}}}},fV=(e,t)=>(n,r,a)=>{let o={storage:dV(()=>window.localStorage),partialize:T=>T,version:0,merge:(T,E)=>({...E,...T}),...t},l=!1,c=0;const f=new Set,d=new Set;let m=o.storage;if(!m)return e((...T)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...T)},r,a);const h=()=>{const T=o.partialize({...r()});return m.setItem(o.name,{state:T,version:o.version})},y=a.setState;a.setState=(T,E)=>(y(T,E),h());const g=e((...T)=>(n(...T),h()),r,a);a.getInitialState=()=>g;let w;const C=()=>{var T,E;if(!m)return;const R=++c;l=!1,f.forEach(M=>{var D;return M((D=r())!=null?D:g)});const k=((E=o.onRehydrateStorage)==null?void 0:E.call(o,(T=r())!=null?T:g))||void 0;return Wv(m.getItem.bind(m))(o.name).then(M=>{if(M)if(typeof M.version=="number"&&M.version!==o.version){if(o.migrate){const D=o.migrate(M.state,M.version);return D instanceof Promise?D.then(O=>[!0,O]):[!0,D]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,M.state];return[!1,void 0]}).then(M=>{var D;if(R!==c)return;const[O,A]=M;if(w=o.merge(A,(D=r())!=null?D:g),n(w,!0),O)return h()}).then(()=>{R===c&&(k==null||k(w,void 0),w=r(),l=!0,d.forEach(M=>M(w)))}).catch(M=>{R===c&&(k==null||k(void 0,M))})};return a.persist={setOptions:T=>{o={...o,...T},T.storage&&(m=T.storage)},clearStorage:()=>{m==null||m.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>C(),hasHydrated:()=>l,onHydrate:T=>(f.add(T),()=>{f.delete(T)}),onFinishHydration:T=>(d.add(T),()=>{d.delete(T)})},o.skipHydration||C(),w||g},B0=fV,Bi=Jd()(B0(e=>({sidebarCollapsed:!1,sidebarTab:"panes",inputMode:"direct",editorSendWithEnter:!0,theme:"dark",editorHistory:[],editorDrafts:{},setSidebarCollapsed:t=>e({sidebarCollapsed:t}),setSidebarTab:t=>e({sidebarTab:t}),setInputMode:t=>e({inputMode:t}),setEditorSendWithEnter:t=>e({editorSendWithEnter:t}),setTheme:t=>e({theme:t}),addEditorHistory:t=>e(n=>({editorHistory:[t,...n.editorHistory.slice(0,49)]})),setEditorDraft:(t,n)=>e(r=>({editorDrafts:{...r.editorDrafts,[t]:n}})),removeEditorDraft:t=>e(n=>{if(!(t in n.editorDrafts))return n;const r={...n.editorDrafts};return delete r[t],{editorDrafts:r}})}),{name:"tmex-ui",partialize:e=>({sidebarCollapsed:e.sidebarCollapsed,inputMode:e.inputMode,editorSendWithEnter:e.editorSendWithEnter,theme:e.theme,editorHistory:e.editorHistory,editorDrafts:e.editorDrafts}),merge:(e,t)=>{const{sidebarTab:n,...r}=e??{};return{...t,...r}}})),hV=500,DR=new Map,Mb=new Map;function vA(e){const t=Date.now(),n=DR.get(e);return n!==void 0&&t-n<hV?!0:(DR.set(e,t),!1)}let IR=!1;function Ob(e){const t=zq(Bi.getState().theme),n=Qq(e,t);Dn().send(n.kind,n.payload)}function Ab(e,t){if(typeof e!="number"||typeof t!="number")return null;const n=Math.max(2,Math.floor(e)),r=Math.max(2,Math.floor(t));return{cols:n,rows:r}}function pV(e,t){if(IR)return;IR=!0;const n=Dn(),r=o=>{const l=t().selectedPanes[o];!l||Td().getTransaction(o)||t().selectPane(o,l.windowId,l.paneId)};n.onStateChange(o=>{e({socketReady:o==="READY"})}),n.onMessage(o=>{const l=Td();switch(o.kind){case Y4:{const c=_a(Z3,o.payload);e(f=>({deviceConnected:{...f.deviceConnected,[c.deviceId]:!0},deviceErrors:{...f.deviceErrors,[c.deviceId]:void 0},deviceReconnecting:{...f.deviceReconnecting,[c.deviceId]:void 0}})),Ob(c.deviceId),r(c.deviceId);return}case K4:{const c=_a(e5,o.payload);l.cleanup(c.deviceId),e(f=>({deviceConnected:{...f.deviceConnected,[c.deviceId]:!1}}));return}case G4:{const c=W5(o.payload);mV(e,c),c.type==="reconnected"&&(Ob(c.deviceId),r(c.deviceId));return}case r3:{const c=X5(o.payload);e(f=>({snapshots:{...f.snapshots,[c.deviceId]:c}}));return}case n3:{const c=K5(o.payload);gV(e,c);return}case h3:{const c=_a(y5,o.payload);l.dispatch({type:"SWITCH_ACK",deviceId:c.deviceId,selectToken:c.selectToken});return}case f3:{const c=_a(g5,o.payload),f=new TextDecoder().decode(c.data);l.dispatch({type:"HISTORY",deviceId:c.deviceId,selectToken:c.selectToken,data:f,alternateScreen:c.alternateScreen});return}case p3:{const c=_a(b5,o.payload);l.dispatch({type:"LIVE_RESUME",deviceId:c.deviceId,selectToken:c.selectToken});return}case d3:{const c=_a(m5,o.payload);l.dispatch({type:"OUTPUT",deviceId:c.deviceId,paneId:c.paneId,data:c.data});return}case V4:return}}),n.onError(o=>{console.error("[tmux] borsh ws error:",o),e({socketReady:!1}),sn.error("WebSocket Connection Error",{description:"Please check Gateway status"})}),n.onStateChange(o=>{if(o!=="READY")return;const l=t().connectedDevices;for(const c of l){if(vA(c))continue;const f=bA(c);n.send(f.kind,f.payload)}});let a=Bi.getState().theme;Bi.subscribe(o=>{if(o.theme===a)return;a=o.theme;const l=t();for(const c of l.connectedDevices)l.deviceConnected[c]&&Ob(c)})}function mV(e,t){if(t.type==="error"){const n=t.message??"Device Error",r=t.errorType??"unknown";if(r==="reconnecting"){e(a=>({deviceReconnecting:{...a.deviceReconnecting,[t.deviceId]:{message:n,at:Date.now()}}}));return}e(a=>{const o=a.deviceErrors[t.deviceId];return(!o||o.type!==r)&&sn.error(n),{deviceErrors:{...a.deviceErrors,[t.deviceId]:{message:n,type:r,rawMessage:t.rawMessage,at:Date.now()}},deviceReconnecting:{...a.deviceReconnecting,[t.deviceId]:void 0}}});return}if(t.type==="disconnected"){Td().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 gV(e,t){if(t.type==="bell"){console.log("[tmex] bell",t.data);const n=Xs.getState().settings;if((n==null?void 0:n.enableBrowserBellToast)===!1)return;const r=t.data??{},a="Terminal Bell",o=[typeof r.windowIndex=="number"?`Window ${r.windowIndex}`:void 0,typeof r.paneIndex=="number"?`Pane ${r.paneIndex}`:void 0].filter(Boolean).join(" · "),l=typeof r.paneUrl=="string"?r.paneUrl:void 0;sn(a,{description:o||"Received tmux bell",action:l?{label:"Open",onClick:()=>{window.location.href=l}}:void 0})}if(t.type==="notification"){console.log("[tmex] notification",t.data);const n=Xs.getState().settings;if((n==null?void 0:n.enableBrowserNotificationToast)===!1)return;const r=t.data??{},{title:a,description:o}=uV(r),l=typeof r.paneUrl=="string"?r.paneUrl:void 0;sn(a,{description:o,action:l?{label:"Open",onClick:()=>{window.location.href=l}}:void 0})}if(t.type==="pane-active"){const n=t.data;n!=null&&n.windowId&&(n!=null&&n.paneId)&&e(r=>({activePaneFromEvent:{...r.activePaneFromEvent,[t.deviceId]:{windowId:n.windowId,paneId:n.paneId}}}))}}const kn=Jd((e,t)=>({socketReady:!1,snapshots:{},connectedDevices:new Set,deviceConnected:{},deviceErrors:{},deviceReconnecting:{},selectedPanes:{},activePaneFromEvent:{},pendingCreateWindowAt:{},ensureSocketConnected(){pV(e,t),Dn().connect()},connectDevice(n){if(!n||(e(a=>{const o=new Set(a.connectedDevices);return o.add(n),{connectedDevices:o}}),t().ensureSocketConnected(),vA(n)))return;const r=bA(n);Dn().send(r.kind,r.payload)},disconnectDevice(n){if(!n)return;e(a=>{const o=new Set(a.connectedDevices);return o.delete(n),{connectedDevices:o}}),Td().cleanup(n);const r=Vq(n);Dn().send(r.kind,r.payload)},clearDeviceError(n){e(r=>({deviceErrors:{...r.deviceErrors,[n]:void 0},deviceReconnecting:{...r.deviceReconnecting,[n]:void 0}}))},hydrateDeviceErrors(n){e(r=>{const a={...r.deviceErrors};for(const o of n)a[o.deviceId]||!o.lastError||!o.lastErrorType||(a[o.deviceId]={message:o.lastError,type:o.lastErrorType,at:0});return{deviceErrors:a}})},selectPane(n,r,a,o){if(!n||!r||!a)return;e(m=>({selectedPanes:{...m.selectedPanes,[n]:{windowId:r,paneId:a}}}));const l=qq(),c=!0;Td().dispatch({type:"SELECT_START",deviceId:n,windowId:r,paneId:a,selectToken:l,wantHistory:c});const f=Ab(o==null?void 0:o.cols,o==null?void 0:o.rows)??Mb.get(n)??null,d=$q({deviceId:n,windowId:r,paneId:a,selectToken:l,wantHistory:c,cols:f==null?void 0:f.cols,rows:f==null?void 0:f.rows});Dn().send(d.kind,d.payload)},selectWindow(n,r){if(!n||!r)return;const a=Yq(n,r);Dn().send(a.kind,a.payload)},sendInput(n,r,a,o=!1){if(!n||!r)return;const l=eV(n,r,a,o);Dn().send(l.kind,l.payload)},resizePane(n,r,a,o){if(!n||!r)return;const l=Ab(a,o);l&&Mb.set(n,{...l,at:Date.now()});const c=nV(n,r,a,o);Dn().send(c.kind,c.payload)},syncPaneSize(n,r,a,o){if(!n||!r)return;const l=Ab(a,o);l&&Mb.set(n,{...l,at:Date.now()});const c=rV(n,r,a,o);Dn().send(c.kind,c.payload)},paste(n,r,a){if(!n||!r)return;const o=tV(n,r,a);Dn().send(o.kind,o.payload)},createWindow(n,r){if(!n)return;const a=Wq(n,r);Dn().send(a.kind,a.payload),e(o=>({pendingCreateWindowAt:{...o.pendingCreateWindowAt,[n]:Date.now()}}))},clearPendingCreateWindow(n){n&&e(r=>{if(r.pendingCreateWindowAt[n]===void 0)return r;const a={...r.pendingCreateWindowAt};return delete a[n],{pendingCreateWindowAt:a}})},closeWindow(n,r){if(!n||!r)return;const a=Kq(n,r);Dn().send(a.kind,a.payload)},closePane(n,r){if(!n||!r)return;const a=Gq(n,r);Dn().send(a.kind,a.payload)},renameWindow(n,r,a){if(!n||!r)return;const o=Xq(n,r,a);Dn().send(o.kind,o.payload)},reorderWindows(n,r){if(!n||r.length===0)return;e(o=>{const l=o.snapshots[n],c=l==null?void 0:l.session;if(!c)return{};const f=new Map(c.windows.map(h=>[h.id,h])),d=r.map(h=>f.get(h)).filter(h=>h!==void 0),m=c.windows.filter(h=>!r.includes(h.id));return{snapshots:{...o.snapshots,[n]:{...l,session:{...c,windows:[...d,...m]}}}}});const a=Zq(n,r);Dn().send(a.kind,a.payload)},reorderPanes(n,r,a){if(!n||!r||a.length===0)return;e(l=>{const c=l.snapshots[n],f=c==null?void 0:c.session;if(!f)return{};const d=f.windows.map(m=>{if(m.id!==r)return m;const h=new Map(m.panes.map(w=>[w.id,w])),y=a.map(w=>h.get(w)).filter(w=>w!==void 0),g=m.panes.filter(w=>!a.includes(w.id));return{...m,panes:[...y,...g]}});return{snapshots:{...l.snapshots,[n]:{...c,session:{...f,windows:d}}}}});const o=Jq(n,r,a);Dn().send(o.kind,o.payload)}})),PR="tmex:connectedDevices",xA=v.createContext(null);function yV(){const e=v.useContext(xA);if(!e)throw new Error("useGlobalDevice must be used within GlobalDeviceProvider");return e}function bV({children:e}){const t=qi(),[n,r]=v.useState(()=>{try{const h=localStorage.getItem(PR);if(h){const y=JSON.parse(h);return new Set(y)}}catch{}return new Set}),a=kn(h=>h.connectDevice),o=kn(h=>h.disconnectDevice),l=kn(h=>h.connectedDevices);v.useEffect(()=>{try{localStorage.setItem(PR,JSON.stringify([...n]))}catch{}},[n]),v.useEffect(()=>{const h=t.pathname.match(/^\/devices\/([^/]+)/),y=h==null?void 0:h[1];y&&!l.has(y)&&a(y)},[t.pathname,l,a]);const c=v.useCallback(h=>{r(y=>{const g=new Set(y);return g.add(h),g}),l.has(h)||a(h)},[l,a]),f=v.useCallback(h=>{r(y=>{const g=new Set(y);return g.delete(h),g}),l.has(h)&&o(h)},[l,o]),d=v.useCallback((h,y)=>{y?f(h):c(h)},[c,f]),m=v.useMemo(()=>({persistedDevices:n,connectDevice:c,disconnectDevice:f,toggleDevice:d}),[n,c,f,d]);return S.jsx(xA.Provider,{value:m,children:e})}const wA=v.createContext(void 0);function vV(){const e=v.useContext(wA);if(e===void 0)throw new Error(Cn(63));return e}let LR=(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 SA={...t0,checked(e){return e?{[LR.checked]:""}:{[LR.unchecked]:""}}};function EA(e,t){const n=v.useRef(e),r=Ye(t);qe(()=>{n.current!==e&&r(n.current)},[e,r]),qe(()=>{n.current=e},[e])}const xV=v.forwardRef(function(t,n){const{checked:r,className:a,defaultChecked:o,id:l,inputRef:c,name:f,nativeButton:d=!1,onCheckedChange:m,readOnly:h=!1,required:y=!1,disabled:g=!1,render:w,uncheckedValue:C,value:T,...E}=t,{clearErrors:R}=n0(),{state:k,setTouched:M,setDirty:D,validityData:O,setFilled:A,setFocused:L,shouldValidateOnChange:q,validationMode:F,disabled:W,name:_,validation:V}=Dc(),{labelId:$}=am(),B=W||g,j=_??f,z=Ye(m),H=v.useRef(null),K=zi(H,c,V.inputRef),P=v.useRef(null),U=Vi(),G=cm({id:l,implicit:!1,controlRef:P}),I=d?void 0:G,[Q,le]=Sc({controlled:r,default:!!o,name:"Switch",state:"checked"});l0({id:U,commit:V.commit,value:Q,controlRef:P,name:j,getValue:()=>Q}),qe(()=>{H.current&&A(H.current.checked)},[H,A]),EA(Q,()=>{R(j),D(Q!==O.initialValue),A(Q),q()?V.commit(Q):V.commit(Q,!0)});const{getButtonProps:ae,buttonRef:Z}=$a({disabled:B,native:d}),ue={id:d?G:U,role:"switch","aria-checked":Q,"aria-readonly":h||void 0,"aria-required":y||void 0,"aria-labelledby":$,onFocus(){B||L(!0)},onBlur(){const te=H.current;!te||B||(M(!0),L(!1),F==="onBlur"&&V.commit(te.checked))},onClick(te){var he;h||B||(te.preventDefault(),(he=H.current)==null||he.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:te.shiftKey,ctrlKey:te.ctrlKey,altKey:te.altKey,metaKey:te.metaKey})))}},ve=v.useMemo(()=>Ti({checked:Q,disabled:B,id:I,name:j,required:y,style:j?EO:hm,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:K,onChange(te){if(te.nativeEvent.defaultPrevented)return;const he=te.target.checked,ye=xt(Fi,te.nativeEvent);z==null||z(he,ye),!ye.isCanceled&&le(he)},onFocus(){var te;(te=P.current)==null||te.focus()}},V.getInputValidationProps,T!==void 0?{value:T}:In),[Q,B,K,I,j,z,y,le,V,T]),Se=v.useMemo(()=>({...k,checked:Q,disabled:B,readOnly:h,required:y}),[k,Q,B,h,y]),Le=It("span",t,{state:Se,ref:[n,P,Z],props:[ue,V.getValidationProps,E,ae],stateAttributesMapping:SA});return S.jsxs(wA.Provider,{value:Se,children:[Le,!Q&&j&&C!==void 0&&S.jsx("input",{type:"hidden",name:j,value:C}),S.jsx("input",{...ve})]})}),wV=v.forwardRef(function(t,n){const{render:r,className:a,...o}=t,{state:l}=Dc(),c=vV(),f={...l,...c};return It("span",t,{state:f,ref:n,stateAttributesMapping:SA,props:o})});function Lp({className:e,size:t="default",...n}){return S.jsx(xV,{"data-slot":"switch","data-size":t,className:Pe("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:S.jsx(wV,{"data-slot":"switch-thumb",className:"bg-background dark:data-unchecked:bg-foreground dark:data-checked:bg-primary-foreground rounded-full group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 pointer-events-none block ring-0 transition-transform"})})}function H0({className:e,...t}){return S.jsx("textarea",{"data-slot":"textarea",className:Pe("border-input dark:bg-input/30 focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 disabled:bg-input/50 dark:disabled:bg-input/80 rounded-lg border bg-transparent px-2.5 py-2 text-base transition-colors focus-visible:ring-2 aria-invalid:ring-2 md:text-sm placeholder:text-muted-foreground flex field-sizing-content min-h-16 w-full outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t})}function Zu(){return{texts:[],reasonings:[],toolCalls:[],staleBarrier:!1}}function ic(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function CA(e){if(ic(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 TA(e){return typeof e=="string"?e:Array.isArray(e)?e.map(t=>ic(t)&&typeof t.text=="string"?t.text:"").filter(Boolean).join(`
424
+ `):""}function SV(e){const t=[],n=new Map;for(const r of e){const a=ic(r.content)?r.content:null;if(!a)continue;const o=a.content;switch(r.role){case"user":{const l=TA(o);l&&t.push({kind:"user",key:`m${r.seq}`,text:l});break}case"assistant":{if(typeof o=="string"){o&&t.push({kind:"assistant-text",key:`m${r.seq}`,text:o,streaming:!1});break}if(!Array.isArray(o))break;o.forEach((l,c)=>{if(!ic(l))return;const f=`m${r.seq}p${c}`;if(l.type==="text"&&typeof l.text=="string"&&l.text){t.push({kind:"assistant-text",key:f,text:l.text,streaming:!1});return}if(l.type==="reasoning"&&typeof l.text=="string"&&l.text){t.push({kind:"reasoning",key:f,text:l.text,streaming:!1});return}if(l.type==="tool-call"&&typeof l.toolCallId=="string"){const d={toolCallId:l.toolCallId,toolName:typeof l.toolName=="string"?l.toolName:"unknown",input:l.input,isError:!1,denied:!1,resolved:!1};n.set(d.toolCallId,d),t.push({kind:"tool-call",key:f,call:d})}});break}case"tool":{if(!Array.isArray(o))break;for(const l of o){if(!ic(l)||l.type!=="tool-result")continue;const c=typeof l.toolCallId=="string"?l.toolCallId:"",f=n.get(c),{value:d,isError:m,denied:h}=CA(l.output);f&&(f.output=d,f.isError=m,f.denied=h,f.resolved=!0)}break}}}return{blocks:t,toolBlocksById:n}}function EV(e,t){const{blocks:n,toolBlocksById:r}=SV(e??[]);if(!t)return n;for(const a of t.toolCalls){const o=r.get(a.toolCallId);if(o){!o.resolved&&a.resolved&&(o.output=a.output,o.isError=a.isError,o.denied=a.denied,o.resolved=!0);continue}n.push({kind:"tool-call",key:`live-tool-${a.toolCallId}`,call:a})}for(const a of t.reasonings)a.text&&n.push({kind:"reasoning",key:`live-reasoning-${a.messageId}`,text:a.text,streaming:!0});for(const a of t.texts)a.text&&n.push({kind:"assistant-text",key:`live-text-${a.messageId}`,text:a.text,streaming:!0});return n}function Kv(e){return!e||e.length===0?-1:e[e.length-1].seq}function CV(e){if(!e)return null;for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.role!=="user")continue;const r=ic(n.content)?n.content:null,a=r?TA(r.content):"";if(a)return a}return null}async function Er(e,t){try{return(await e.json()).error??t}catch{return t}}function Hu(e){return Object.values(e).filter(t=>!!t).sort((t,n)=>t.updatedAt<n.updatedAt?1:-1).map(t=>t.id)}function _R(e,t){if(!e||e.length===0)return[...t].sort((r,a)=>r.seq-a.seq);const n=new Map;for(const r of e)n.set(r.seq,r);for(const r of t)n.set(r.seq,r);return[...n.values()].sort((r,a)=>r.seq-a.seq)}let jR=!1;const Eo=new Set,TV=40,zs=new Map;let Uu=null;const RV=120,sd=new Map,Nb=new Set,Gv=new Set;function kV(e){const t=sd.get(e);t&&(clearTimeout(t),sd.delete(e)),zs.delete(e),Gv.delete(e)}function Xv(e){const t=iV(e);Dn().send(t.kind,t.payload)}function zR(e){const t=aV(e);Dn().send(t.kind,t.payload)}function FR(e,t,n,r){let a=zs.get(e);a||(a={texts:new Map,reasonings:new Map},zs.set(e,a));const o=a[t];o.set(n,(o.get(n)??"")+r)}function MV(e){const t=()=>{if(Uu&&(clearTimeout(Uu),Uu=null),zs.size===0)return;const r=new Map(zs);zs.clear(),e(a=>{const o={...a.inProgress};for(const[l,c]of r){const f=o[l]??Zu(),d={...f,texts:[...f.texts],reasonings:[...f.reasonings]};for(const m of["texts","reasonings"])for(const[h,y]of c[m]){const g=d[m],w=g.findIndex(C=>C.messageId===h);w>=0?g[w]={...g[w],text:g[w].text+y}:g.push({messageId:h,text:y,stale:!1})}o[l]=d}return{inProgress:o}})};return{flush:t,schedule:()=>{Uu||(Uu=setTimeout(t,TV))}}}function OV(e,t){if(jR)return;jR=!0;const n=Dn(),r=MV(e),a=T=>{sd.get(T)||sd.set(T,setTimeout(()=>{sd.delete(T),t().loadHistory(T)},RV))},o=(T,E)=>{zs.delete(T),e(k=>{const M=k.sessions[T],D=Zu();return E.inProgressText&&D.texts.push({messageId:"__sync__",text:E.inProgressText,stale:!1}),E.inProgressReasoning&&D.reasonings.push({messageId:"__sync_reasoning__",text:E.inProgressReasoning,stale:!1}),{sessions:M?{...k.sessions,[T]:{...M,status:E.status,lastError:E.lastError}}:k.sessions,inProgress:{...k.inProgress,[T]:D},pendingConfirmations:{...k.pendingConfirmations,[T]:E.pendingConfirmations.map(O=>({id:O.confirmationId,toolCallId:O.toolCallId,toolName:O.toolName,input:O.input,createdAt:O.createdAt}))},queued:{...k.queued,[T]:E.queuedMessages.map(O=>({id:O.id,sessionId:T,seq:O.seq,text:O.text,createdAt:O.createdAt}))}}});const R=t();(E.lastMessageSeq>Kv(R.messages[T])||!R.historyLoaded[T])&&R.loadHistory(T)},l=(T,E)=>{const R=!!t().sessions[T];if(e(k=>{const M=k.sessions[T];return M?{sessions:{...k.sessions,[T]:{...M,status:E.status,lastError:E.lastError!==void 0?E.lastError:M.lastError}}}:k}),!R){t().loadSessions();return}t().refreshSession(T)},c=(T,E)=>{r.flush(),e(R=>{const k=R.inProgress[T]??Zu(),M=[...k.toolCalls],D=M.findIndex(A=>A.toolCallId===E.toolCallId),O={toolCallId:E.toolCallId,toolName:E.toolName,input:E.input,isError:!1,denied:!1,resolved:!1,stale:!1};return D>=0?M[D]={...M[D],...O}:M.push(O),{inProgress:{...R.inProgress,[T]:{...k,toolCalls:M}}}})},f=(T,E)=>{r.flush();const{value:R,isError:k,denied:M}=CA(E.output);e(D=>{const O=D.inProgress[T]??Zu(),A=[...O.toolCalls],L=A.findIndex(q=>q.toolCallId===E.toolCallId);return L>=0?A[L]={...A[L],output:R,isError:!!E.isError||k,denied:M,resolved:!0}:A.push({toolCallId:E.toolCallId,toolName:E.toolName,input:void 0,output:R,isError:!!E.isError||k,denied:M,resolved:!0,stale:O.staleBarrier}),{inProgress:{...D.inProgress,[T]:{...O,toolCalls:A}}}})},d=(T,E)=>{e(R=>{const k=R.pendingConfirmations[T]??[];return k.some(M=>M.id===E.confirmationId)?R:{pendingConfirmations:{...R.pendingConfirmations,[T]:[...k,{id:E.confirmationId,toolCallId:E.toolCallId,toolName:E.toolName,input:E.input,createdAt:new Date().toISOString()}]}}})},m=(T,E)=>{e(R=>{const k=R.pendingConfirmations[T];return!k||!k.some(M=>M.id===E.confirmationId)?R:{pendingConfirmations:{...R.pendingConfirmations,[T]:k.filter(M=>M.id!==E.confirmationId)}}})},h=(T,E)=>{r.flush(),(E.role==="assistant"||E.role==="tool")&&e(R=>{const k=R.inProgress[T];return k?{inProgress:{...R.inProgress,[T]:{texts:k.texts.map(M=>({...M,stale:!0})),reasonings:k.reasonings.map(M=>({...M,stale:!0})),toolCalls:k.toolCalls.map(M=>M.resolved?{...M,stale:!0}:M),staleBarrier:!0}}}:R}),a(T)},y=(T,E)=>{r.flush(),e(R=>{const k=R.sessions[T];return{sessions:k?{...R.sessions,[T]:{...k,status:E.sessionStatus}}:R.sessions,inProgress:{...R.inProgress,[T]:Zu()}}}),E.lastMessageSeq>Kv(t().messages[T])&&a(T)},g=(T,E)=>{const R=t().sessions[T];sn.error(hn.t("agent.toast.errorTitle",{title:(R==null?void 0:R.title)??"Agent"}),{description:E.message})},w=(T,E)=>{sn.warning(hn.t("agent.toast.credentialWarningTitle"),{description:hn.t("agent.toast.credentialWarningDescription",{types:E.types.join(", ")}),duration:1e4})},C=(T,E)=>{e(R=>({queued:{...R.queued,[T]:E.queued.map(k=>({id:k.id,sessionId:T,seq:k.seq,text:k.text,createdAt:k.createdAt}))}}))};n.onMessage(T=>{if(T.kind!==b3)return;let E;try{E=_a(T5,T.payload)}catch(M){console.error("[agent] failed to decode AGENT_EVENT:",M);return}let R;try{R=JSON.parse(new TextDecoder().decode(E.payload))}catch(M){console.error("[agent] failed to parse AGENT_EVENT payload:",M);return}const k=E.sessionId;switch(E.eventType){case x3:o(k,R);return;case w3:l(k,R);return;case S3:{const M=R;FR(k,"texts",M.messageId,M.delta),r.schedule();return}case E3:{const M=R;FR(k,"reasonings",M.messageId,M.delta),r.schedule();return}case C3:c(k,R);return;case T3:f(k,R);return;case R3:d(k,R);return;case k3:m(k,R);return;case M3:h(k,R);return;case O3:g(k,R);return;case A3:y(k,R);return;case N3:w(k,R);return;case D3:C(k,R);return;default:return}}),n.onStateChange(T=>{if(T!=="READY")return;for(const R of Eo)Xv(R);const E=t().activeSessionId;E&&t().loadHistory(E)})}const an=Jd()(B0((e,t)=>({sessions:{},sessionOrder:[],sessionsLoaded:!1,activeSessionId:null,messages:{},historyLoaded:{},inProgress:{},pendingConfirmations:{},queued:{},sending:{},draft:null,defaultWriteMode:"confirm",ensureInitialized(){OV(e,t),Dn().connect();const n=t().activeSessionId;n&&!Eo.has(n)&&(Eo.add(n),Xv(n))},async loadSessions(){try{const n=await fetch("/api/agent/sessions");if(!n.ok)throw new Error(await Er(n,"Failed to load agent sessions"));const r=await n.json();e(()=>{const o={};for(const l of r.sessions)o[l.id]=l;return{sessions:o,sessionOrder:Hu(o),sessionsLoaded:!0}});const a=t();a.activeSessionId&&!a.sessions[a.activeSessionId]&&a.setActiveSession(null)}catch(n){console.error("[agent] loadSessions failed:",n)}},async refreshSession(n){try{const r=await fetch(`/api/agent/sessions/${n}`);if(r.status===404){await t().loadSessions();return}if(!r.ok)throw new Error(await Er(r,"Failed to load agent session"));const a=await r.json();e(o=>{const l={...o.sessions,[n]:a.session};return{sessions:l,sessionOrder:Hu(l)}})}catch(r){console.error("[agent] refreshSession failed:",r)}},setActiveSession(n){const r=t().activeSessionId;r!==n&&(r&&Eo.has(r)&&(Eo.delete(r),zR(r)),e({activeSessionId:n,draft:null}),n&&(Eo.add(n),Xv(n),t().historyLoaded[n]||t().loadHistory(n)))},async createSession(n,r,a){try{const o=await fetch("/api/agent/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceId:n,paneId:r,...(a==null?void 0:a.providerId)!==void 0?{providerId:a.providerId}:{},...(a==null?void 0:a.modelId)!==void 0&&a.modelId!==null?{modelId:a.modelId}:{},...(a==null?void 0:a.providerHostedTools)!==void 0?{providerHostedTools:a.providerHostedTools}:{},...(a==null?void 0:a.originPaneTitle)!==void 0?{originPaneTitle:a.originPaneTitle}:{},writeMode:(a==null?void 0:a.writeMode)??t().defaultWriteMode})});if(!o.ok)throw new Error(await Er(o,"Failed to create agent session"));const c=(await o.json()).session;return e(f=>{const d={...f.sessions,[c.id]:c};return{sessions:d,sessionOrder:Hu(d),messages:{...f.messages,[c.id]:[]},historyLoaded:{...f.historyLoaded,[c.id]:!0}}}),t().setActiveSession(c.id),c}catch(o){return sn.error(o instanceof Error?o.message:String(o)),null}},async renameSession(n,r){try{const a=await fetch(`/api/agent/sessions/${n}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:r})});if(!a.ok)throw new Error(await Er(a,"Failed to rename agent session"));const o=await a.json();return e(l=>{const c={...l.sessions,[n]:o.session};return{sessions:c,sessionOrder:Hu(c)}}),!0}catch(a){return sn.error(a instanceof Error?a.message:String(a)),!1}},async deleteSession(n){try{const r=await fetch(`/api/agent/sessions/${n}`,{method:"DELETE"});if(!r.ok)throw new Error(await Er(r,"Failed to delete agent session"));return t().activeSessionId===n&&t().setActiveSession(null),kV(n),e(a=>{const o={...a.sessions};delete o[n];const l={...a.messages};delete l[n];const c={...a.historyLoaded};delete c[n];const f={...a.inProgress};delete f[n];const d={...a.pendingConfirmations};delete d[n];const m={...a.queued};return delete m[n],{sessions:o,sessionOrder:Hu(o),messages:l,historyLoaded:c,inProgress:f,pendingConfirmations:d,queued:m}}),!0}catch(r){return sn.error(r instanceof Error?r.message:String(r)),!1}},async setWriteMode(n,r){try{const a=await fetch(`/api/agent/sessions/${n}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({writeMode:r})});if(!a.ok)throw new Error(await Er(a,"Failed to update write mode"));const o=await a.json();e(l=>({sessions:{...l.sessions,[n]:o.session}}))}catch(a){sn.error(a instanceof Error?a.message:String(a))}},setDefaultWriteMode(n){e({defaultWriteMode:n})},async setSessionModel(n,r,a){try{const o=await fetch(`/api/agent/sessions/${n}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerId:r,modelId:a})});if(!o.ok)throw new Error(await Er(o,"Failed to update model"));const l=await o.json();e(c=>({sessions:{...c.sessions,[n]:l.session}}))}catch(o){sn.error(o instanceof Error?o.message:String(o))}},async rebindPane(n,r){try{const a=await fetch(`/api/agent/sessions/${n}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({paneId:r})});if(!a.ok)throw new Error(await Er(a,"Failed to rebind pane"));const o=await a.json();e(l=>({sessions:{...l.sessions,[n]:o.session}}))}catch(a){sn.error(a instanceof Error?a.message:String(a))}},async loadHistory(n){if(Nb.has(n)){Gv.add(n);return}Nb.add(n);try{const r=t(),a=r.historyLoaded[n]?Kv(r.messages[n]):-1,o=a>=0?`?afterSeq=${a}`:"",l=await fetch(`/api/agent/sessions/${n}/messages${o}`);if(!l.ok)throw new Error(await Er(l,"Failed to load agent messages"));const c=await l.json();e(f=>{const d=_R(a>=0?f.messages[n]:void 0,c.messages),m=f.inProgress[n],h=m&&{texts:m.texts.filter(y=>!y.stale),reasonings:m.reasonings.filter(y=>!y.stale),toolCalls:m.toolCalls.filter(y=>!y.stale),staleBarrier:!1};return{messages:{...f.messages,[n]:d},historyLoaded:{...f.historyLoaded,[n]:!0},inProgress:h?{...f.inProgress,[n]:h}:f.inProgress}})}catch(r){console.error("[agent] loadHistory failed:",r)}finally{Nb.delete(n),Gv.delete(n)&&t().loadHistory(n)}},async sendMessage(n,r){e(a=>({sending:{...a.sending,[n]:!0}}));try{const a=await fetch(`/api/agent/sessions/${n}/messages`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:r})});if(!a.ok)throw new Error(await Er(a,"Failed to send message"));const o=await a.json();if(o.message){const l=o.message;e(c=>{const f=c.sessions[n];return{messages:{...c.messages,[n]:_R(c.messages[n],[l])},sessions:f?{...c.sessions,[n]:{...f,status:"running",lastError:null}}:c.sessions}})}return!0}catch(a){return sn.error(a instanceof Error?a.message:String(a)),!1}finally{e(a=>({sending:{...a.sending,[n]:!1}}))}},async enqueueMessage(n,r,a=!1){try{const o=await fetch(`/api/agent/sessions/${n}/queue`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:r,steer:a})});if(!o.ok)throw new Error(await Er(o,"Failed to queue message"))}catch(o){sn.error(o instanceof Error?o.message:String(o))}},async editQueuedMessage(n,r,a){try{const o=await fetch(`/api/agent/queue/${r}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:a})});if(!o.ok)throw new Error(await Er(o,"Failed to edit queued message"))}catch(o){sn.error(o instanceof Error?o.message:String(o))}},async withdrawQueuedMessage(n,r){try{const a=await fetch(`/api/agent/queue/${r}`,{method:"DELETE"});if(!a.ok)throw new Error(await Er(a,"Failed to withdraw queued message"))}catch(a){sn.error(a instanceof Error?a.message:String(a))}},startDraft(n,r,a,o){const l=t().activeSessionId;l&&Eo.has(l)&&(Eo.delete(l),zR(l)),e({activeSessionId:null,draft:{deviceId:n,paneId:r,providerId:null,modelId:null,paneTitle:a,prompt:o??null}})},updateDraft(n){e(r=>r.draft?{draft:{...r.draft,...n}}:r)},clearDraft(){e({draft:null})},async materializeDraft(){const n=t().draft;return n?await t().createSession(n.deviceId,n.paneId,{providerId:n.providerId,modelId:n.modelId,originPaneTitle:n.paneTitle}):null},async stopSession(n){try{const r=await fetch(`/api/agent/sessions/${n}/stop`,{method:"POST"});if(!r.ok)throw new Error(await Er(r,"Failed to stop agent session"));const a=await r.json();if(a.session){const o=a.session;e(l=>({sessions:{...l.sessions,[n]:o}}))}}catch(r){sn.error(r instanceof Error?r.message:String(r))}},async decideConfirmation(n,r,a,o){const l=()=>{e(c=>{const f=c.pendingConfirmations[n];return f?{pendingConfirmations:{...c.pendingConfirmations,[n]:f.filter(d=>d.id!==r)}}:c})};try{const c=await fetch(`/api/agent/confirmations/${r}/decide`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o===void 0?{approved:a}:{approved:a,reason:o})});if(c.status===409){l();try{const f=await fetch(`/api/agent/sessions/${n}/confirmations`);if(f.ok){const d=await f.json();e(m=>({pendingConfirmations:{...m.pendingConfirmations,[n]:d.confirmations.map(h=>({id:h.id,toolCallId:h.toolCallId,toolName:h.toolName,input:h.input,createdAt:h.createdAt}))}}))}}catch{}return}if(!c.ok)throw new Error(await Er(c,"Failed to decide confirmation"));l()}catch(c){sn.error(c instanceof Error?c.message:String(c))}}}),{name:"tmex-agent",partialize:e=>({activeSessionId:e.activeSessionId,defaultWriteMode:e.defaultWriteMode})}));function AV(){const e=Xs.getState().settings;return(e==null?void 0:e.siteName)||"tmex"}function BR(e){const t=e==null?void 0:e.trim();return t&&t.length>0?t:"?"}function NV({paneIdx:e,windowIdx:t,paneTitle:n,windowName:r,windowCustomName:a,deviceName:o}){const l=t??"?",c=e??"?",f=BR(a??n??r),d=BR(o);return`${l}/${c}: ${f}@${d}`}function U0(e){var c,f;const t=(c=e.customName)==null?void 0:c.trim(),n=e.panes.find(d=>d.active)??e.panes[0],r=e.name.trim(),a=(f=n==null?void 0:n.title)==null?void 0:f.trim(),o=t||a||r;return{title:o,processName:!!r&&r!==o?r:void 0}}function DV(e){const{title:t,processName:n}=U0(e);return n?`${n}: ${t}`:t}function jte(e){const t=AV();return e!=null&&e.trim()?`[${t}]${e}`:t}function zte(){}function Fte(e){const t=[],n=String(e||"");let r=n.indexOf(","),a=0,o=!1;for(;!o;){r===-1&&(r=n.length,o=!0);const l=n.slice(a,r).trim();(l||!o)&&t.push(l),a=r+1,r=n.indexOf(",",a)}return t}function IV(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const PV=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,LV=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,_V={};function HR(e,t){return(_V.jsx?LV:PV).test(e)}const jV=/[ \t\n\f\r]/g;function zV(e){return typeof e=="object"?e.type==="text"?UR(e.value):!1:UR(e)}function UR(e){return e.replace(jV,"")===""}class ef{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}ef.prototype.normal={};ef.prototype.property={};ef.prototype.space=void 0;function RA(e,t){const n={},r={};for(const a of e)Object.assign(n,a.property),Object.assign(r,a.normal);return new ef(n,r,t)}function Qv(e){return e.toLowerCase()}class qr{constructor(t,n){this.attribute=n,this.property=t}}qr.prototype.attribute="";qr.prototype.booleanish=!1;qr.prototype.boolean=!1;qr.prototype.commaOrSpaceSeparated=!1;qr.prototype.commaSeparated=!1;qr.prototype.defined=!1;qr.prototype.mustUseProperty=!1;qr.prototype.number=!1;qr.prototype.overloadedBoolean=!1;qr.prototype.property="";qr.prototype.spaceSeparated=!1;qr.prototype.space=void 0;let FV=0;const Nt=rl(),Gn=rl(),Zv=rl(),Ue=rl(),Sn=rl(),Fs=rl(),Jr=rl();function rl(){return 2**++FV}const Jv=Object.freeze(Object.defineProperty({__proto__:null,boolean:Nt,booleanish:Gn,commaOrSpaceSeparated:Jr,commaSeparated:Fs,number:Ue,overloadedBoolean:Zv,spaceSeparated:Sn},Symbol.toStringTag,{value:"Module"})),Db=Object.keys(Jv);class q0 extends qr{constructor(t,n,r,a){let o=-1;if(super(t,n),qR(this,"space",a),typeof r=="number")for(;++o<Db.length;){const l=Db[o];qR(this,Db[o],(r&Jv[l])===Jv[l])}}}q0.prototype.defined=!0;function qR(e,t,n){n&&(e[t]=n)}function jc(e){const t={},n={};for(const[r,a]of Object.entries(e.properties)){const o=new q0(r,e.transform(e.attributes||{},r),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[Qv(r)]=r,n[Qv(o.attribute)]=r}return new ef(t,n,e.space)}const kA=jc({properties:{ariaActiveDescendant:null,ariaAtomic:Gn,ariaAutoComplete:null,ariaBusy:Gn,ariaChecked:Gn,ariaColCount:Ue,ariaColIndex:Ue,ariaColSpan:Ue,ariaControls:Sn,ariaCurrent:null,ariaDescribedBy:Sn,ariaDetails:null,ariaDisabled:Gn,ariaDropEffect:Sn,ariaErrorMessage:null,ariaExpanded:Gn,ariaFlowTo:Sn,ariaGrabbed:Gn,ariaHasPopup:null,ariaHidden:Gn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Sn,ariaLevel:Ue,ariaLive:null,ariaModal:Gn,ariaMultiLine:Gn,ariaMultiSelectable:Gn,ariaOrientation:null,ariaOwns:Sn,ariaPlaceholder:null,ariaPosInSet:Ue,ariaPressed:Gn,ariaReadOnly:Gn,ariaRelevant:null,ariaRequired:Gn,ariaRoleDescription:Sn,ariaRowCount:Ue,ariaRowIndex:Ue,ariaRowSpan:Ue,ariaSelected:Gn,ariaSetSize:Ue,ariaSort:null,ariaValueMax:Ue,ariaValueMin:Ue,ariaValueNow:Ue,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function MA(e,t){return t in e?e[t]:t}function OA(e,t){return MA(e,t.toLowerCase())}const BV=jc({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Fs,acceptCharset:Sn,accessKey:Sn,action:null,allow:null,allowFullScreen:Nt,allowPaymentRequest:Nt,allowUserMedia:Nt,alpha:Nt,alt:null,as:null,async:Nt,autoCapitalize:null,autoComplete:Sn,autoFocus:Nt,autoPlay:Nt,blocking:Sn,capture:null,charSet:null,checked:Nt,cite:null,className:Sn,closedBy:null,colorSpace:null,cols:Ue,colSpan:Ue,command:null,commandFor:null,content:null,contentEditable:Gn,controls:Nt,controlsList:Sn,coords:Ue|Fs,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Nt,defer:Nt,dir:null,dirName:null,disabled:Nt,download:Zv,draggable:Gn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Nt,formTarget:null,headers:Sn,height:Ue,hidden:Zv,high:Ue,href:null,hrefLang:null,htmlFor:Sn,httpEquiv:Sn,id:null,imageSizes:null,imageSrcSet:null,inert:Nt,inputMode:null,integrity:null,is:null,isMap:Nt,itemId:null,itemProp:Sn,itemRef:Sn,itemScope:Nt,itemType:Sn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Nt,low:Ue,manifest:null,max:null,maxLength:Ue,media:null,method:null,min:null,minLength:Ue,multiple:Nt,muted:Nt,name:null,nonce:null,noModule:Nt,noValidate:Nt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Nt,optimum:Ue,pattern:null,ping:Sn,placeholder:null,playsInline:Nt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Nt,referrerPolicy:null,rel:Sn,required:Nt,reversed:Nt,rows:Ue,rowSpan:Ue,sandbox:Sn,scope:null,scoped:Nt,seamless:Nt,selected:Nt,shadowRootClonable:Nt,shadowRootCustomElementRegistry:Nt,shadowRootDelegatesFocus:Nt,shadowRootMode:null,shadowRootSerializable:Nt,shape:null,size:Ue,sizes:null,slot:null,span:Ue,spellCheck:Gn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ue,step:null,style:null,tabIndex:Ue,target:null,title:null,translate:null,type:null,typeMustMatch:Nt,useMap:null,value:Gn,width:Ue,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Sn,axis:null,background:null,bgColor:null,border:Ue,borderColor:null,bottomMargin:Ue,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Nt,declare:Nt,event:null,face:null,frame:null,frameBorder:null,hSpace:Ue,leftMargin:Ue,link:null,longDesc:null,lowSrc:null,marginHeight:Ue,marginWidth:Ue,noResize:Nt,noHref:Nt,noShade:Nt,noWrap:Nt,object:null,profile:null,prompt:null,rev:null,rightMargin:Ue,rules:null,scheme:null,scrolling:Gn,standby:null,summary:null,text:null,topMargin:Ue,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ue,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Nt,disablePictureInPicture:Nt,disableRemotePlayback:Nt,exportParts:Fs,part:Sn,prefix:null,property:null,results:Ue,security:null,unselectable:null},space:"html",transform:OA}),HV=jc({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Jr,accentHeight:Ue,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ue,amplitude:Ue,arabicForm:null,ascent:Ue,attributeName:null,attributeType:null,azimuth:Ue,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ue,by:null,calcMode:null,capHeight:Ue,className:Sn,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Ue,diffuseConstant:Ue,direction:null,display:null,dur:null,divisor:Ue,dominantBaseline:null,download:Nt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ue,enableBackground:null,end:null,event:null,exponent:Ue,externalResourcesRequired:null,fill:null,fillOpacity:Ue,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Fs,g2:Fs,glyphName:Fs,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ue,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ue,horizOriginX:Ue,horizOriginY:Ue,id:null,ideographic:Ue,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ue,k:Ue,k1:Ue,k2:Ue,k3:Ue,k4:Ue,kernelMatrix:Jr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ue,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Ue,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Ue,overlineThickness:Ue,paintOrder:null,panose1:null,path:null,pathLength:Ue,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Sn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ue,pointsAtY:Ue,pointsAtZ:Ue,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Jr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Jr,rev:Jr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Jr,requiredFeatures:Jr,requiredFonts:Jr,requiredFormats:Jr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Ue,specularExponent:Ue,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ue,strikethroughThickness:Ue,string:null,stroke:null,strokeDashArray:Jr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ue,strokeOpacity:Ue,strokeWidth:null,style:null,surfaceScale:Ue,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Jr,tabIndex:Ue,tableValues:null,target:null,targetX:Ue,targetY:Ue,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Jr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ue,underlineThickness:Ue,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ue,values:null,vAlphabetic:Ue,vMathematical:Ue,vectorEffect:null,vHanging:Ue,vIdeographic:Ue,version:null,vertAdvY:Ue,vertOriginX:Ue,vertOriginY:Ue,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ue,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:MA}),AA=jc({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),NA=jc({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:OA}),DA=jc({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),UV={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},qV=/[A-Z]/g,VR=/-[a-z]/g,VV=/^data[-\w.:]+$/i;function $V(e,t){const n=Qv(t);let r=t,a=qr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&VV.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(VR,WV);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!VR.test(o)){let l=o.replace(qV,YV);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}a=q0}return new a(r,t)}function YV(e){return"-"+e.toLowerCase()}function WV(e){return e.charAt(1).toUpperCase()}const KV=RA([kA,BV,AA,NA,DA],"html"),V0=RA([kA,HV,AA,NA,DA],"svg");function Bte(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function GV(e){return e.join(" ").trim()}var Hl={},Ib,$R;function XV(){if($R)return Ib;$R=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,c=/^\s+|\s+$/g,f=`
425
+ `,d="/",m="*",h="",y="comment",g="declaration";function w(T,E){if(typeof T!="string")throw new TypeError("First argument must be a string");if(!T)return[];E=E||{};var R=1,k=1;function M($){var B=$.match(t);B&&(R+=B.length);var j=$.lastIndexOf(f);k=~j?$.length-j:k+$.length}function D(){var $={line:R,column:k};return function(B){return B.position=new O($),q(),B}}function O($){this.start=$,this.end={line:R,column:k},this.source=E.source}O.prototype.content=T;function A($){var B=new Error(E.source+":"+R+":"+k+": "+$);if(B.reason=$,B.filename=E.source,B.line=R,B.column=k,B.source=T,!E.silent)throw B}function L($){var B=$.exec(T);if(B){var j=B[0];return M(j),T=T.slice(j.length),B}}function q(){L(n)}function F($){var B;for($=$||[];B=W();)B!==!1&&$.push(B);return $}function W(){var $=D();if(!(d!=T.charAt(0)||m!=T.charAt(1))){for(var B=2;h!=T.charAt(B)&&(m!=T.charAt(B)||d!=T.charAt(B+1));)++B;if(B+=2,h===T.charAt(B-1))return A("End of comment missing");var j=T.slice(2,B-2);return k+=2,M(j),T=T.slice(B),k+=2,$({type:y,comment:j})}}function _(){var $=D(),B=L(r);if(B){if(W(),!L(a))return A("property missing ':'");var j=L(o),z=$({type:g,property:C(B[0].replace(e,h)),value:j?C(j[0].replace(e,h)):h});return L(l),z}}function V(){var $=[];F($);for(var B;B=_();)B!==!1&&($.push(B),F($));return $}return q(),V()}function C(T){return T?T.replace(c,h):h}return Ib=w,Ib}var YR;function QV(){if(YR)return Hl;YR=1;var e=Hl&&Hl.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Hl,"__esModule",{value:!0}),Hl.default=n;const t=e(XV());function n(r,a){let o=null;if(!r||typeof r!="string")return o;const l=(0,t.default)(r),c=typeof a=="function";return l.forEach(f=>{if(f.type!=="declaration")return;const{property:d,value:m}=f;c?a(d,m,f):m&&(o=o||{},o[d]=m)}),o}return Hl}var qu={},WR;function ZV(){if(WR)return qu;WR=1,Object.defineProperty(qu,"__esModule",{value:!0}),qu.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(d){return!d||n.test(d)||e.test(d)},l=function(d,m){return m.toUpperCase()},c=function(d,m){return"".concat(m,"-")},f=function(d,m){return m===void 0&&(m={}),o(d)?d:(d=d.toLowerCase(),m.reactCompat?d=d.replace(a,c):d=d.replace(r,c),d.replace(t,l))};return qu.camelCase=f,qu}var Vu,KR;function JV(){if(KR)return Vu;KR=1;var e=Vu&&Vu.__importDefault||function(a){return a&&a.__esModule?a:{default:a}},t=e(QV()),n=ZV();function r(a,o){var l={};return!a||typeof a!="string"||(0,t.default)(a,function(c,f){c&&f&&(l[(0,n.camelCase)(c,o)]=f)}),l}return r.default=r,Vu=r,Vu}var e7=JV();const t7=Gp(e7),IA=PA("end"),$0=PA("start");function PA(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function n7(e){const t=$0(e),n=IA(e);if(t&&n)return{start:t,end:n}}function ld(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?GR(e.position):"start"in e||"end"in e?GR(e):"line"in e||"column"in e?ex(e):""}function ex(e){return XR(e&&e.line)+":"+XR(e&&e.column)}function GR(e){return ex(e&&e.start)+"-"+ex(e&&e.end)}function XR(e){return e&&typeof e=="number"?e:1}class wr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let a="",o={},l=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?a=t:!o.cause&&t&&(l=!0,a=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const f=r.indexOf(":");f===-1?o.ruleId=r:(o.source=r.slice(0,f),o.ruleId=r.slice(f+1))}if(!o.place&&o.ancestors&&o.ancestors){const f=o.ancestors[o.ancestors.length-1];f&&(o.place=f.position)}const c=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=a,this.line=c?c.line:void 0,this.name=ld(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}wr.prototype.file="";wr.prototype.name="";wr.prototype.reason="";wr.prototype.message="";wr.prototype.stack="";wr.prototype.column=void 0;wr.prototype.line=void 0;wr.prototype.ancestors=void 0;wr.prototype.cause=void 0;wr.prototype.fatal=void 0;wr.prototype.place=void 0;wr.prototype.ruleId=void 0;wr.prototype.source=void 0;const Y0={}.hasOwnProperty,r7=new Map,i7=/[A-Z]/g,a7=new Set(["table","tbody","thead","tfoot","tr"]),o7=new Set(["td","th"]),LA="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function s7(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=m7(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=p7(n,t.jsx,t.jsxs)}const a={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?V0:KV,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=_A(a,e,void 0);return o&&typeof o!="string"?o:a.create(e,a.Fragment,{children:o||void 0},void 0)}function _A(e,t,n){if(t.type==="element")return l7(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return c7(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return d7(e,t,n);if(t.type==="mdxjsEsm")return u7(e,t);if(t.type==="root")return f7(e,t,n);if(t.type==="text")return h7(e,t)}function l7(e,t,n){const r=e.schema;let a=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(a=V0,e.schema=a),e.ancestors.push(t);const o=zA(e,t.tagName,!1),l=g7(e,t);let c=K0(e,t);return a7.has(t.tagName)&&(c=c.filter(function(f){return typeof f=="string"?!zV(f):!0})),jA(e,l,o,t),W0(l,c),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function c7(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Rd(e,t.position)}function u7(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Rd(e,t.position)}function d7(e,t,n){const r=e.schema;let a=r;t.name==="svg"&&r.space==="html"&&(a=V0,e.schema=a),e.ancestors.push(t);const o=t.name===null?e.Fragment:zA(e,t.name,!0),l=y7(e,t),c=K0(e,t);return jA(e,l,o,t),W0(l,c),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function f7(e,t,n){const r={};return W0(r,K0(e,t)),e.create(t,e.Fragment,r,n)}function h7(e,t){return t.value}function jA(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function W0(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function p7(e,t,n){return r;function r(a,o,l,c){const d=Array.isArray(l.children)?n:t;return c?d(o,l,c):d(o,l)}}function m7(e,t){return n;function n(r,a,o,l){const c=Array.isArray(o.children),f=$0(r);return t(a,o,l,c,{columnNumber:f?f.column-1:void 0,fileName:e,lineNumber:f?f.line:void 0},void 0)}}function g7(e,t){const n={};let r,a;for(a in t.properties)if(a!=="children"&&Y0.call(t.properties,a)){const o=b7(e,a,t.properties[a]);if(o){const[l,c]=o;e.tableCellAlignToStyle&&l==="align"&&typeof c=="string"&&o7.has(t.tagName)?r=c:n[l]=c}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function y7(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const l=o.expression;l.type;const c=l.properties[0];c.type,Object.assign(n,e.evaluater.evaluateExpression(c.argument))}else Rd(e,t.position);else{const a=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const c=r.value.data.estree.body[0];c.type,o=e.evaluater.evaluateExpression(c.expression)}else Rd(e,t.position);else o=r.value===null?!0:r.value;n[a]=o}return n}function K0(e,t){const n=[];let r=-1;const a=e.passKeys?new Map:r7;for(;++r<t.children.length;){const o=t.children[r];let l;if(e.passKeys){const f=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(f){const d=a.get(f)||0;l=f+"-"+d,a.set(f,d+1)}}const c=_A(e,o,l);c!==void 0&&n.push(c)}return n}function b7(e,t,n){const r=$V(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?IV(n):GV(n)),r.property==="style"){let a=typeof n=="object"?n:v7(e,String(n));return e.stylePropertyNameCase==="css"&&(a=x7(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&r.space?UV[r.property]||r.property:r.attribute,n]}}function v7(e,t){try{return t7(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,a=new wr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=LA+"#cannot-parse-style-attribute",a}}function zA(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const a=t.split(".");let o=-1,l;for(;++o<a.length;){const c=HR(a[o])?{type:"Identifier",name:a[o]}:{type:"Literal",value:a[o]};l=l?{type:"MemberExpression",object:l,property:c,computed:!!(o&&c.type==="Literal"),optional:!1}:c}r=l}else r=HR(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const a=r.value;return Y0.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(r);Rd(e)}function Rd(e,t){const n=new wr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=LA+"#cannot-handle-mdx-estrees-without-createevaluater",n}function x7(e){const t={};let n;for(n in e)Y0.call(e,n)&&(t[w7(n)]=e[n]);return t}function w7(e){let t=e.replace(i7,S7);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function S7(e){return"-"+e.toLowerCase()}const Pb={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},E7={};function G0(e,t){const n=E7,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return FA(e,r,a)}function FA(e,t,n){if(C7(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return QR(e.children,t,n)}return Array.isArray(e)?QR(e,t,n):""}function QR(e,t,n){const r=[];let a=-1;for(;++a<e.length;)r[a]=FA(e[a],t,n);return r.join("")}function C7(e){return!!(e&&typeof e=="object")}const ZR=document.createElement("i");function X0(e){const t="&"+e+";";ZR.innerHTML=t;const n=ZR.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ii(e,t,n,r){const a=e.length;let o=0,l;if(t<0?t=-t>a?0:a+t:t=t>a?a:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);o<r.length;)l=r.slice(o,o+1e4),l.unshift(t,0),e.splice(...l),o+=1e4,t+=1e4}function xi(e,t){return e.length>0?(ii(e,e.length,0,t),e):t}const JR={}.hasOwnProperty;function BA(e){const t={};let n=-1;for(;++n<e.length;)T7(t,e[n]);return t}function T7(e,t){let n;for(n in t){const a=(JR.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let l;if(o)for(l in o){JR.call(a,l)||(a[l]=[]);const c=o[l];R7(a[l],Array.isArray(c)?c:c?[c]:[])}}}function R7(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);ii(e,0,0,r)}function HA(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function ji(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const kr=Zo(/[A-Za-z]/),xr=Zo(/[\dA-Za-z]/),k7=Zo(/[#-'*+\--9=?A-Z^-~]/);function _p(e){return e!==null&&(e<32||e===127)}const tx=Zo(/\d/),M7=Zo(/[\dA-Fa-f]/),O7=Zo(/[!-/:-@[-`{-~]/);function vt(e){return e!==null&&e<-2}function En(e){return e!==null&&(e<0||e===32)}function Kt(e){return e===-2||e===-1||e===32}const Sm=Zo(new RegExp("\\p{P}|\\p{S}","u")),Qs=Zo(/\s/);function Zo(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function zc(e){const t=[];let n=-1,r=0,a=0;for(;++n<e.length;){const o=e.charCodeAt(n);let l="";if(o===37&&xr(e.charCodeAt(n+1))&&xr(e.charCodeAt(n+2)))a=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(l=String.fromCharCode(o));else if(o>55295&&o<57344){const c=e.charCodeAt(n+1);o<56320&&c>56319&&c<57344?(l=String.fromCharCode(o,c),a=1):l="�"}else l=String.fromCharCode(o);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+a+1,l=""),a&&(n+=a,a=0)}return t.join("")+e.slice(r)}function on(e,t,n,r){const a=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(f){return Kt(f)?(e.enter(n),c(f)):t(f)}function c(f){return Kt(f)&&o++<a?(e.consume(f),c):(e.exit(n),t(f))}}const A7={tokenize:N7};function N7(e){const t=e.attempt(this.parser.constructs.contentInitial,r,a);let n;return t;function r(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),on(e,t,"linePrefix")}function a(c){return e.enter("paragraph"),o(c)}function o(c){const f=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=f),n=f,l(c)}function l(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return vt(c)?(e.consume(c),e.exit("chunkText"),o):(e.consume(c),l)}}const D7={tokenize:I7},ek={tokenize:P7};function I7(e){const t=this,n=[];let r=0,a,o,l;return c;function c(k){if(r<n.length){const M=n[r];return t.containerState=M[1],e.attempt(M[0].continuation,f,d)(k)}return d(k)}function f(k){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&R();const M=t.events.length;let D=M,O;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){O=t.events[D][1].end;break}E(r);let A=M;for(;A<t.events.length;)t.events[A][1].end={...O},A++;return ii(t.events,D+1,0,t.events.slice(M)),t.events.length=A,d(k)}return c(k)}function d(k){if(r===n.length){if(!a)return y(k);if(a.currentConstruct&&a.currentConstruct.concrete)return w(k);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(ek,m,h)(k)}function m(k){return a&&R(),E(r),y(k)}function h(k){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,w(k)}function y(k){return t.containerState={},e.attempt(ek,g,w)(k)}function g(k){return r++,n.push([t.currentConstruct,t.containerState]),y(k)}function w(k){if(k===null){a&&R(),E(0),e.consume(k);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:o}),C(k)}function C(k){if(k===null){T(e.exit("chunkFlow"),!0),E(0),e.consume(k);return}return vt(k)?(e.consume(k),T(e.exit("chunkFlow")),r=0,t.interrupt=void 0,c):(e.consume(k),C)}function T(k,M){const D=t.sliceStream(k);if(M&&D.push(null),k.previous=o,o&&(o.next=k),o=k,a.defineSkip(k.start),a.write(D),t.parser.lazy[k.start.line]){let O=a.events.length;for(;O--;)if(a.events[O][1].start.offset<l&&(!a.events[O][1].end||a.events[O][1].end.offset>l))return;const A=t.events.length;let L=A,q,F;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){if(q){F=t.events[L][1].end;break}q=!0}for(E(r),O=A;O<t.events.length;)t.events[O][1].end={...F},O++;ii(t.events,L+1,0,t.events.slice(A)),t.events.length=O}}function E(k){let M=n.length;for(;M-- >k;){const D=n[M];t.containerState=D[1],D[0].exit.call(t,e)}n.length=k}function R(){a.write([null]),o=void 0,a=void 0,t.containerState._closeFlow=void 0}}function P7(e,t,n){return on(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Tc(e){if(e===null||En(e)||Qs(e))return 1;if(Sm(e))return 2}function Em(e,t,n){const r=[];let a=-1;for(;++a<e.length;){const o=e[a].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const nx={name:"attention",resolveAll:L7,tokenize:_7};function L7(e,t){let n=-1,r,a,o,l,c,f,d,m;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;f=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const h={...e[r][1].end},y={...e[n][1].start};tk(h,-f),tk(y,f),l={type:f>1?"strongSequence":"emphasisSequence",start:h,end:{...e[r][1].end}},c={type:f>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:y},o={type:f>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},a={type:f>1?"strong":"emphasis",start:{...l.start},end:{...c.end}},e[r][1].end={...l.start},e[n][1].start={...c.end},d=[],e[r][1].end.offset-e[r][1].start.offset&&(d=xi(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=xi(d,[["enter",a,t],["enter",l,t],["exit",l,t],["enter",o,t]]),d=xi(d,Em(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=xi(d,[["exit",o,t],["enter",c,t],["exit",c,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(m=2,d=xi(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):m=0,ii(e,r-1,n-r+3,d),n=r+d.length-m-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function _7(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,a=Tc(r);let o;return l;function l(f){return o=f,e.enter("attentionSequence"),c(f)}function c(f){if(f===o)return e.consume(f),c;const d=e.exit("attentionSequence"),m=Tc(f),h=!m||m===2&&a||n.includes(f),y=!a||a===2&&m||n.includes(r);return d._open=!!(o===42?h:h&&(a||!y)),d._close=!!(o===42?y:y&&(m||!h)),t(f)}}function tk(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const j7={name:"autolink",tokenize:z7};function z7(e,t,n){let r=0;return a;function a(g){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(g){return kr(g)?(e.consume(g),l):g===64?n(g):d(g)}function l(g){return g===43||g===45||g===46||xr(g)?(r=1,c(g)):d(g)}function c(g){return g===58?(e.consume(g),r=0,f):(g===43||g===45||g===46||xr(g))&&r++<32?(e.consume(g),c):(r=0,d(g))}function f(g){return g===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.exit("autolink"),t):g===null||g===32||g===60||_p(g)?n(g):(e.consume(g),f)}function d(g){return g===64?(e.consume(g),m):k7(g)?(e.consume(g),d):n(g)}function m(g){return xr(g)?h(g):n(g)}function h(g){return g===46?(e.consume(g),r=0,m):g===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.exit("autolink"),t):y(g)}function y(g){if((g===45||xr(g))&&r++<63){const w=g===45?y:h;return e.consume(g),w}return n(g)}}const tf={partial:!0,tokenize:F7};function F7(e,t,n){return r;function r(o){return Kt(o)?on(e,a,"linePrefix")(o):a(o)}function a(o){return o===null||vt(o)?t(o):n(o)}}const UA={continuation:{tokenize:H7},exit:U7,name:"blockQuote",tokenize:B7};function B7(e,t,n){const r=this;return a;function a(l){if(l===62){const c=r.containerState;return c.open||(e.enter("blockQuote",{_container:!0}),c.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),o}return n(l)}function o(l){return Kt(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function H7(e,t,n){const r=this;return a;function a(l){return Kt(l)?on(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):o(l)}function o(l){return e.attempt(UA,t,n)(l)}}function U7(e){e.exit("blockQuote")}const qA={name:"characterEscape",tokenize:q7};function q7(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),a}function a(o){return O7(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const VA={name:"characterReference",tokenize:V7};function V7(e,t,n){const r=this;let a=0,o,l;return c;function c(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),f}function f(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),o=31,l=xr,m(h))}function d(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,l=M7,m):(e.enter("characterReferenceValue"),o=7,l=tx,m(h))}function m(h){if(h===59&&a){const y=e.exit("characterReferenceValue");return l===xr&&!X0(r.sliceSerialize(y))?n(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(h)&&a++<o?(e.consume(h),m):n(h)}}const nk={partial:!0,tokenize:Y7},rk={concrete:!0,name:"codeFenced",tokenize:$7};function $7(e,t,n){const r=this,a={partial:!0,tokenize:D};let o=0,l=0,c;return f;function f(O){return d(O)}function d(O){const A=r.events[r.events.length-1];return o=A&&A[1].type==="linePrefix"?A[2].sliceSerialize(A[1],!0).length:0,c=O,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m(O)}function m(O){return O===c?(l++,e.consume(O),m):l<3?n(O):(e.exit("codeFencedFenceSequence"),Kt(O)?on(e,h,"whitespace")(O):h(O))}function h(O){return O===null||vt(O)?(e.exit("codeFencedFence"),r.interrupt?t(O):e.check(nk,C,M)(O)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(O))}function y(O){return O===null||vt(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(O)):Kt(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),on(e,g,"whitespace")(O)):O===96&&O===c?n(O):(e.consume(O),y)}function g(O){return O===null||vt(O)?h(O):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),w(O))}function w(O){return O===null||vt(O)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(O)):O===96&&O===c?n(O):(e.consume(O),w)}function C(O){return e.attempt(a,M,T)(O)}function T(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),E}function E(O){return o>0&&Kt(O)?on(e,R,"linePrefix",o+1)(O):R(O)}function R(O){return O===null||vt(O)?e.check(nk,C,M)(O):(e.enter("codeFlowValue"),k(O))}function k(O){return O===null||vt(O)?(e.exit("codeFlowValue"),R(O)):(e.consume(O),k)}function M(O){return e.exit("codeFenced"),t(O)}function D(O,A,L){let q=0;return F;function F(B){return O.enter("lineEnding"),O.consume(B),O.exit("lineEnding"),W}function W(B){return O.enter("codeFencedFence"),Kt(B)?on(O,_,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):_(B)}function _(B){return B===c?(O.enter("codeFencedFenceSequence"),V(B)):L(B)}function V(B){return B===c?(q++,O.consume(B),V):q>=l?(O.exit("codeFencedFenceSequence"),Kt(B)?on(O,$,"whitespace")(B):$(B)):L(B)}function $(B){return B===null||vt(B)?(O.exit("codeFencedFence"),A(B)):L(B)}}}function Y7(e,t,n){const r=this;return a;function a(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const Lb={name:"codeIndented",tokenize:K7},W7={partial:!0,tokenize:G7};function K7(e,t,n){const r=this;return a;function a(d){return e.enter("codeIndented"),on(e,o,"linePrefix",5)(d)}function o(d){const m=r.events[r.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?l(d):n(d)}function l(d){return d===null?f(d):vt(d)?e.attempt(W7,l,f)(d):(e.enter("codeFlowValue"),c(d))}function c(d){return d===null||vt(d)?(e.exit("codeFlowValue"),l(d)):(e.consume(d),c)}function f(d){return e.exit("codeIndented"),t(d)}}function G7(e,t,n){const r=this;return a;function a(l){return r.parser.lazy[r.now().line]?n(l):vt(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a):on(e,o,"linePrefix",5)(l)}function o(l){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):vt(l)?a(l):n(l)}}const X7={name:"codeText",previous:Z7,resolve:Q7,tokenize:J7};function Q7(e){let t=e.length-4,n=3,r,a;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)a===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(a=r):(r===t||e[r][1].type==="lineEnding")&&(e[a][1].type="codeTextData",r!==a+2&&(e[a][1].end=e[r-1][1].end,e.splice(a+2,r-a-2),t-=r-a-2,r=a+2),a=void 0);return e}function Z7(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function J7(e,t,n){let r=0,a,o;return l;function l(h){return e.enter("codeText"),e.enter("codeTextSequence"),c(h)}function c(h){return h===96?(e.consume(h),r++,c):(e.exit("codeTextSequence"),f(h))}function f(h){return h===null?n(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),f):h===96?(o=e.enter("codeTextSequence"),a=0,m(h)):vt(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),f):(e.enter("codeTextData"),d(h))}function d(h){return h===null||h===32||h===96||vt(h)?(e.exit("codeTextData"),f(h)):(e.consume(h),d)}function m(h){return h===96?(e.consume(h),a++,m):a===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(o.type="codeTextData",d(h))}}class e${constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const a=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return r&&$u(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),$u(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),$u(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);$u(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);$u(this.left,n.reverse())}}}function $u(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function $A(e){const t={};let n=-1,r,a,o,l,c,f,d;const m=new e$(e);for(;++n<m.length;){for(;n in t;)n=t[n];if(r=m.get(n),n&&r[1].type==="chunkFlow"&&m.get(n-1)[1].type==="listItemPrefix"&&(f=r[1]._tokenizer.events,o=0,o<f.length&&f[o][1].type==="lineEndingBlank"&&(o+=2),o<f.length&&f[o][1].type==="content"))for(;++o<f.length&&f[o][1].type!=="content";)f[o][1].type==="chunkText"&&(f[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,t$(m,n)),n=t[n],d=!0);else if(r[1]._container){for(o=n,a=void 0;o--;)if(l=m.get(o),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(a&&(m.get(a)[1].type="lineEndingBlank"),l[1].type="lineEnding",a=o);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;a&&(r[1].end={...m.get(a)[1].start},c=m.slice(a,n),c.unshift(r),m.splice(a,n-a+1,c))}}return ii(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!d}function t$(e,t){const n=e.get(t)[1],r=e.get(t)[2];let a=t-1;const o=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const c=l.events,f=[],d={};let m,h,y=-1,g=n,w=0,C=0;const T=[C];for(;g;){for(;e.get(++a)[1]!==g;);o.push(a),g._tokenizer||(m=r.sliceStream(g),g.next||m.push(null),h&&l.defineSkip(g.start),g._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(m),g._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),h=g,g=g.next}for(g=n;++y<c.length;)c[y][0]==="exit"&&c[y-1][0]==="enter"&&c[y][1].type===c[y-1][1].type&&c[y][1].start.line!==c[y][1].end.line&&(C=y+1,T.push(C),g._tokenizer=void 0,g.previous=void 0,g=g.next);for(l.events=[],g?(g._tokenizer=void 0,g.previous=void 0):T.pop(),y=T.length;y--;){const E=c.slice(T[y],T[y+1]),R=o.pop();f.push([R,R+E.length-1]),e.splice(R,2,E)}for(f.reverse(),y=-1;++y<f.length;)d[w+f[y][0]]=w+f[y][1],w+=f[y][1]-f[y][0]-1;return d}const n$={resolve:i$,tokenize:a$},r$={partial:!0,tokenize:o$};function i$(e){return $A(e),e}function a$(e,t){let n;return r;function r(c){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),a(c)}function a(c){return c===null?o(c):vt(c)?e.check(r$,l,o)(c):(e.consume(c),a)}function o(c){return e.exit("chunkContent"),e.exit("content"),t(c)}function l(c){return e.consume(c),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,a}}function o$(e,t,n){const r=this;return a;function a(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),on(e,o,"linePrefix")}function o(l){if(l===null||vt(l))return n(l);const c=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function YA(e,t,n,r,a,o,l,c,f){const d=f||Number.POSITIVE_INFINITY;let m=0;return h;function h(E){return E===60?(e.enter(r),e.enter(a),e.enter(o),e.consume(E),e.exit(o),y):E===null||E===32||E===41||_p(E)?n(E):(e.enter(r),e.enter(l),e.enter(c),e.enter("chunkString",{contentType:"string"}),C(E))}function y(E){return E===62?(e.enter(o),e.consume(E),e.exit(o),e.exit(a),e.exit(r),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),g(E))}function g(E){return E===62?(e.exit("chunkString"),e.exit(c),y(E)):E===null||E===60||vt(E)?n(E):(e.consume(E),E===92?w:g)}function w(E){return E===60||E===62||E===92?(e.consume(E),g):g(E)}function C(E){return!m&&(E===null||E===41||En(E))?(e.exit("chunkString"),e.exit(c),e.exit(l),e.exit(r),t(E)):m<d&&E===40?(e.consume(E),m++,C):E===41?(e.consume(E),m--,C):E===null||E===32||E===40||_p(E)?n(E):(e.consume(E),E===92?T:C)}function T(E){return E===40||E===41||E===92?(e.consume(E),C):C(E)}}function WA(e,t,n,r,a,o){const l=this;let c=0,f;return d;function d(g){return e.enter(r),e.enter(a),e.consume(g),e.exit(a),e.enter(o),m}function m(g){return c>999||g===null||g===91||g===93&&!f||g===94&&!c&&"_hiddenFootnoteSupport"in l.parser.constructs?n(g):g===93?(e.exit(o),e.enter(a),e.consume(g),e.exit(a),e.exit(r),t):vt(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),h(g))}function h(g){return g===null||g===91||g===93||vt(g)||c++>999?(e.exit("chunkString"),m(g)):(e.consume(g),f||(f=!Kt(g)),g===92?y:h)}function y(g){return g===91||g===92||g===93?(e.consume(g),c++,h):h(g)}}function KA(e,t,n,r,a,o){let l;return c;function c(y){return y===34||y===39||y===40?(e.enter(r),e.enter(a),e.consume(y),e.exit(a),l=y===40?41:y,f):n(y)}function f(y){return y===l?(e.enter(a),e.consume(y),e.exit(a),e.exit(r),t):(e.enter(o),d(y))}function d(y){return y===l?(e.exit(o),f(l)):y===null?n(y):vt(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),on(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===l||y===null||vt(y)?(e.exit("chunkString"),d(y)):(e.consume(y),y===92?h:m)}function h(y){return y===l||y===92?(e.consume(y),m):m(y)}}function cd(e,t){let n;return r;function r(a){return vt(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,r):Kt(a)?on(e,r,n?"linePrefix":"lineSuffix")(a):t(a)}}const s$={name:"definition",tokenize:c$},l$={partial:!0,tokenize:u$};function c$(e,t,n){const r=this;let a;return o;function o(g){return e.enter("definition"),l(g)}function l(g){return WA.call(r,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(g)}function c(g){return a=ji(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),f):n(g)}function f(g){return En(g)?cd(e,d)(g):d(g)}function d(g){return YA(e,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function m(g){return e.attempt(l$,h,h)(g)}function h(g){return Kt(g)?on(e,y,"whitespace")(g):y(g)}function y(g){return g===null||vt(g)?(e.exit("definition"),r.parser.defined.push(a),t(g)):n(g)}}function u$(e,t,n){return r;function r(c){return En(c)?cd(e,a)(c):n(c)}function a(c){return KA(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function o(c){return Kt(c)?on(e,l,"whitespace")(c):l(c)}function l(c){return c===null||vt(c)?t(c):n(c)}}const d$={name:"hardBreakEscape",tokenize:f$};function f$(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),a}function a(o){return vt(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const h$={name:"headingAtx",resolve:p$,tokenize:m$};function p$(e,t){let n=e.length-2,r=3,a,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(a={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},ii(e,r,n-r+1,[["enter",a,t],["enter",o,t],["exit",o,t],["exit",a,t]])),e}function m$(e,t,n){let r=0;return a;function a(m){return e.enter("atxHeading"),o(m)}function o(m){return e.enter("atxHeadingSequence"),l(m)}function l(m){return m===35&&r++<6?(e.consume(m),l):m===null||En(m)?(e.exit("atxHeadingSequence"),c(m)):n(m)}function c(m){return m===35?(e.enter("atxHeadingSequence"),f(m)):m===null||vt(m)?(e.exit("atxHeading"),t(m)):Kt(m)?on(e,c,"whitespace")(m):(e.enter("atxHeadingText"),d(m))}function f(m){return m===35?(e.consume(m),f):(e.exit("atxHeadingSequence"),c(m))}function d(m){return m===null||m===35||En(m)?(e.exit("atxHeadingText"),c(m)):(e.consume(m),d)}}const g$=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],ik=["pre","script","style","textarea"],y$={concrete:!0,name:"htmlFlow",resolveTo:x$,tokenize:w$},b$={partial:!0,tokenize:E$},v$={partial:!0,tokenize:S$};function x$(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function w$(e,t,n){const r=this;let a,o,l,c,f;return d;function d(I){return m(I)}function m(I){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(I),h}function h(I){return I===33?(e.consume(I),y):I===47?(e.consume(I),o=!0,C):I===63?(e.consume(I),a=3,r.interrupt?t:P):kr(I)?(e.consume(I),l=String.fromCharCode(I),T):n(I)}function y(I){return I===45?(e.consume(I),a=2,g):I===91?(e.consume(I),a=5,c=0,w):kr(I)?(e.consume(I),a=4,r.interrupt?t:P):n(I)}function g(I){return I===45?(e.consume(I),r.interrupt?t:P):n(I)}function w(I){const Q="CDATA[";return I===Q.charCodeAt(c++)?(e.consume(I),c===Q.length?r.interrupt?t:_:w):n(I)}function C(I){return kr(I)?(e.consume(I),l=String.fromCharCode(I),T):n(I)}function T(I){if(I===null||I===47||I===62||En(I)){const Q=I===47,le=l.toLowerCase();return!Q&&!o&&ik.includes(le)?(a=1,r.interrupt?t(I):_(I)):g$.includes(l.toLowerCase())?(a=6,Q?(e.consume(I),E):r.interrupt?t(I):_(I)):(a=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(I):o?R(I):k(I))}return I===45||xr(I)?(e.consume(I),l+=String.fromCharCode(I),T):n(I)}function E(I){return I===62?(e.consume(I),r.interrupt?t:_):n(I)}function R(I){return Kt(I)?(e.consume(I),R):F(I)}function k(I){return I===47?(e.consume(I),F):I===58||I===95||kr(I)?(e.consume(I),M):Kt(I)?(e.consume(I),k):F(I)}function M(I){return I===45||I===46||I===58||I===95||xr(I)?(e.consume(I),M):D(I)}function D(I){return I===61?(e.consume(I),O):Kt(I)?(e.consume(I),D):k(I)}function O(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),f=I,A):Kt(I)?(e.consume(I),O):L(I)}function A(I){return I===f?(e.consume(I),f=null,q):I===null||vt(I)?n(I):(e.consume(I),A)}function L(I){return I===null||I===34||I===39||I===47||I===60||I===61||I===62||I===96||En(I)?D(I):(e.consume(I),L)}function q(I){return I===47||I===62||Kt(I)?k(I):n(I)}function F(I){return I===62?(e.consume(I),W):n(I)}function W(I){return I===null||vt(I)?_(I):Kt(I)?(e.consume(I),W):n(I)}function _(I){return I===45&&a===2?(e.consume(I),j):I===60&&a===1?(e.consume(I),z):I===62&&a===4?(e.consume(I),U):I===63&&a===3?(e.consume(I),P):I===93&&a===5?(e.consume(I),K):vt(I)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(b$,G,V)(I)):I===null||vt(I)?(e.exit("htmlFlowData"),V(I)):(e.consume(I),_)}function V(I){return e.check(v$,$,G)(I)}function $(I){return e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),B}function B(I){return I===null||vt(I)?V(I):(e.enter("htmlFlowData"),_(I))}function j(I){return I===45?(e.consume(I),P):_(I)}function z(I){return I===47?(e.consume(I),l="",H):_(I)}function H(I){if(I===62){const Q=l.toLowerCase();return ik.includes(Q)?(e.consume(I),U):_(I)}return kr(I)&&l.length<8?(e.consume(I),l+=String.fromCharCode(I),H):_(I)}function K(I){return I===93?(e.consume(I),P):_(I)}function P(I){return I===62?(e.consume(I),U):I===45&&a===2?(e.consume(I),P):_(I)}function U(I){return I===null||vt(I)?(e.exit("htmlFlowData"),G(I)):(e.consume(I),U)}function G(I){return e.exit("htmlFlow"),t(I)}}function S$(e,t,n){const r=this;return a;function a(l){return vt(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):n(l)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function E$(e,t,n){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(tf,t,n)}}const C$={name:"htmlText",tokenize:T$};function T$(e,t,n){const r=this;let a,o,l;return c;function c(P){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(P),f}function f(P){return P===33?(e.consume(P),d):P===47?(e.consume(P),D):P===63?(e.consume(P),k):kr(P)?(e.consume(P),L):n(P)}function d(P){return P===45?(e.consume(P),m):P===91?(e.consume(P),o=0,w):kr(P)?(e.consume(P),R):n(P)}function m(P){return P===45?(e.consume(P),g):n(P)}function h(P){return P===null?n(P):P===45?(e.consume(P),y):vt(P)?(l=h,z(P)):(e.consume(P),h)}function y(P){return P===45?(e.consume(P),g):h(P)}function g(P){return P===62?j(P):P===45?y(P):h(P)}function w(P){const U="CDATA[";return P===U.charCodeAt(o++)?(e.consume(P),o===U.length?C:w):n(P)}function C(P){return P===null?n(P):P===93?(e.consume(P),T):vt(P)?(l=C,z(P)):(e.consume(P),C)}function T(P){return P===93?(e.consume(P),E):C(P)}function E(P){return P===62?j(P):P===93?(e.consume(P),E):C(P)}function R(P){return P===null||P===62?j(P):vt(P)?(l=R,z(P)):(e.consume(P),R)}function k(P){return P===null?n(P):P===63?(e.consume(P),M):vt(P)?(l=k,z(P)):(e.consume(P),k)}function M(P){return P===62?j(P):k(P)}function D(P){return kr(P)?(e.consume(P),O):n(P)}function O(P){return P===45||xr(P)?(e.consume(P),O):A(P)}function A(P){return vt(P)?(l=A,z(P)):Kt(P)?(e.consume(P),A):j(P)}function L(P){return P===45||xr(P)?(e.consume(P),L):P===47||P===62||En(P)?q(P):n(P)}function q(P){return P===47?(e.consume(P),j):P===58||P===95||kr(P)?(e.consume(P),F):vt(P)?(l=q,z(P)):Kt(P)?(e.consume(P),q):j(P)}function F(P){return P===45||P===46||P===58||P===95||xr(P)?(e.consume(P),F):W(P)}function W(P){return P===61?(e.consume(P),_):vt(P)?(l=W,z(P)):Kt(P)?(e.consume(P),W):q(P)}function _(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(e.consume(P),a=P,V):vt(P)?(l=_,z(P)):Kt(P)?(e.consume(P),_):(e.consume(P),$)}function V(P){return P===a?(e.consume(P),a=void 0,B):P===null?n(P):vt(P)?(l=V,z(P)):(e.consume(P),V)}function $(P){return P===null||P===34||P===39||P===60||P===61||P===96?n(P):P===47||P===62||En(P)?q(P):(e.consume(P),$)}function B(P){return P===47||P===62||En(P)?q(P):n(P)}function j(P){return P===62?(e.consume(P),e.exit("htmlTextData"),e.exit("htmlText"),t):n(P)}function z(P){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),H}function H(P){return Kt(P)?on(e,K,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):K(P)}function K(P){return e.enter("htmlTextData"),l(P)}}const Q0={name:"labelEnd",resolveAll:O$,resolveTo:A$,tokenize:N$},R$={tokenize:D$},k$={tokenize:I$},M$={tokenize:P$};function O$(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const a=r.type==="labelImage"?4:2;r.type="data",t+=a}}return e.length!==n.length&&ii(e,0,e.length,n),e}function A$(e,t){let n=e.length,r=0,a,o,l,c;for(;n--;)if(a=e[n][1],o){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;e[n][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(o=n,a.type!=="labelLink")){r=2;break}}else a.type==="labelEnd"&&(l=n);const f={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[o][1].start},end:{...e[l][1].end}},m={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[l-2][1].start}};return c=[["enter",f,t],["enter",d,t]],c=xi(c,e.slice(o+1,o+r+3)),c=xi(c,[["enter",m,t]]),c=xi(c,Em(t.parser.constructs.insideSpan.null,e.slice(o+r+4,l-3),t)),c=xi(c,[["exit",m,t],e[l-2],e[l-1],["exit",d,t]]),c=xi(c,e.slice(l+1)),c=xi(c,[["exit",f,t]]),ii(e,o,e.length,c),e}function N$(e,t,n){const r=this;let a=r.events.length,o,l;for(;a--;)if((r.events[a][1].type==="labelImage"||r.events[a][1].type==="labelLink")&&!r.events[a][1]._balanced){o=r.events[a][1];break}return c;function c(y){return o?o._inactive?h(y):(l=r.parser.defined.includes(ji(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),f):n(y)}function f(y){return y===40?e.attempt(R$,m,l?m:h)(y):y===91?e.attempt(k$,m,l?d:h)(y):l?m(y):h(y)}function d(y){return e.attempt(M$,m,h)(y)}function m(y){return t(y)}function h(y){return o._balanced=!0,n(y)}}function D$(e,t,n){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),a}function a(h){return En(h)?cd(e,o)(h):o(h)}function o(h){return h===41?m(h):YA(e,l,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function l(h){return En(h)?cd(e,f)(h):m(h)}function c(h){return n(h)}function f(h){return h===34||h===39||h===40?KA(e,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):m(h)}function d(h){return En(h)?cd(e,m)(h):m(h)}function m(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function I$(e,t,n){const r=this;return a;function a(c){return WA.call(r,e,o,l,"reference","referenceMarker","referenceString")(c)}function o(c){return r.parser.defined.includes(ji(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function l(c){return n(c)}}function P$(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),a}function a(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const L$={name:"labelStartImage",resolveAll:Q0.resolveAll,tokenize:_$};function _$(e,t,n){const r=this;return a;function a(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),o}function o(c){return c===91?(e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelImage"),l):n(c)}function l(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(c):t(c)}}const j$={name:"labelStartLink",resolveAll:Q0.resolveAll,tokenize:z$};function z$(e,t,n){const r=this;return a;function a(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),o}function o(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const _b={name:"lineEnding",tokenize:F$};function F$(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),on(e,t,"linePrefix")}}const cp={name:"thematicBreak",tokenize:B$};function B$(e,t,n){let r=0,a;return o;function o(d){return e.enter("thematicBreak"),l(d)}function l(d){return a=d,c(d)}function c(d){return d===a?(e.enter("thematicBreakSequence"),f(d)):r>=3&&(d===null||vt(d))?(e.exit("thematicBreak"),t(d)):n(d)}function f(d){return d===a?(e.consume(d),r++,f):(e.exit("thematicBreakSequence"),Kt(d)?on(e,c,"whitespace")(d):c(d))}}const _r={continuation:{tokenize:V$},exit:Y$,name:"list",tokenize:q$},H$={partial:!0,tokenize:W$},U$={partial:!0,tokenize:$$};function q$(e,t,n){const r=this,a=r.events[r.events.length-1];let o=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,l=0;return c;function c(g){const w=r.containerState.type||(g===42||g===43||g===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||g===r.containerState.marker:tx(g)){if(r.containerState.type||(r.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),g===42||g===45?e.check(cp,n,d)(g):d(g);if(!r.interrupt||g===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),f(g)}return n(g)}function f(g){return tx(g)&&++l<10?(e.consume(g),f):(!r.interrupt||l<2)&&(r.containerState.marker?g===r.containerState.marker:g===41||g===46)?(e.exit("listItemValue"),d(g)):n(g)}function d(g){return e.enter("listItemMarker"),e.consume(g),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||g,e.check(tf,r.interrupt?n:m,e.attempt(H$,y,h))}function m(g){return r.containerState.initialBlankLine=!0,o++,y(g)}function h(g){return Kt(g)?(e.enter("listItemPrefixWhitespace"),e.consume(g),e.exit("listItemPrefixWhitespace"),y):n(g)}function y(g){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(g)}}function V$(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(tf,a,o);function a(c){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,on(e,t,"listItemIndent",r.containerState.size+1)(c)}function o(c){return r.containerState.furtherBlankLines||!Kt(c)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(c)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(U$,t,l)(c))}function l(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,on(e,e.attempt(_r,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function $$(e,t,n){const r=this;return on(e,a,"listItemIndent",r.containerState.size+1);function a(o){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(o):n(o)}}function Y$(e){e.exit(this.containerState.type)}function W$(e,t,n){const r=this;return on(e,a,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(o){const l=r.events[r.events.length-1];return!Kt(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const ak={name:"setextUnderline",resolveTo:K$,tokenize:G$};function K$(e,t){let n=e.length,r,a,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(a=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type="setextHeadingText",o?(e.splice(a,0,["enter",l,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function G$(e,t,n){const r=this;let a;return o;function o(d){let m=r.events.length,h;for(;m--;)if(r.events[m][1].type!=="lineEnding"&&r.events[m][1].type!=="linePrefix"&&r.events[m][1].type!=="content"){h=r.events[m][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),a=d,l(d)):n(d)}function l(d){return e.enter("setextHeadingLineSequence"),c(d)}function c(d){return d===a?(e.consume(d),c):(e.exit("setextHeadingLineSequence"),Kt(d)?on(e,f,"lineSuffix")(d):f(d))}function f(d){return d===null||vt(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const X$={tokenize:Q$};function Q$(e){const t=this,n=e.attempt(tf,r,e.attempt(this.parser.constructs.flowInitial,a,on(e,e.attempt(this.parser.constructs.flow,a,e.attempt(n$,a)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function a(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Z$={resolveAll:XA()},J$=GA("string"),eY=GA("text");function GA(e){return{resolveAll:XA(e==="text"?tY:void 0),tokenize:t};function t(n){const r=this,a=this.parser.constructs[e],o=n.attempt(a,l,c);return l;function l(m){return d(m)?o(m):c(m)}function c(m){if(m===null){n.consume(m);return}return n.enter("data"),n.consume(m),f}function f(m){return d(m)?(n.exit("data"),o(m)):(n.consume(m),f)}function d(m){if(m===null)return!0;const h=a[m];let y=-1;if(h)for(;++y<h.length;){const g=h[y];if(!g.previous||g.previous.call(r,r.previous))return!0}return!1}}}function XA(e){return t;function t(n,r){let a=-1,o;for(;++a<=n.length;)o===void 0?n[a]&&n[a][1].type==="data"&&(o=a,a++):(!n[a]||n[a][1].type!=="data")&&(a!==o+2&&(n[o][1].end=n[a-1][1].end,n.splice(o+2,a-o-2),a=o+2),o=void 0);return e?e(n,r):n}}function tY(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],a=t.sliceStream(r);let o=a.length,l=-1,c=0,f;for(;o--;){const d=a[o];if(typeof d=="string"){for(l=d.length;d.charCodeAt(l-1)===32;)c++,l--;if(l)break;l=-1}else if(d===-2)f=!0,c++;else if(d!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const d={type:n===e.length||f||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?l:r.start._bufferIndex+l,_index:r.start._index+o,line:r.end.line,column:r.end.column-c,offset:r.end.offset-c},end:{...r.end}};r.end={...d.start},r.start.offset===r.end.offset?Object.assign(r,d):(e.splice(n,0,["enter",d,t],["exit",d,t]),n+=2)}n++}return e}const nY={42:_r,43:_r,45:_r,48:_r,49:_r,50:_r,51:_r,52:_r,53:_r,54:_r,55:_r,56:_r,57:_r,62:UA},rY={91:s$},iY={[-2]:Lb,[-1]:Lb,32:Lb},aY={35:h$,42:cp,45:[ak,cp],60:y$,61:ak,95:cp,96:rk,126:rk},oY={38:VA,92:qA},sY={[-5]:_b,[-4]:_b,[-3]:_b,33:L$,38:VA,42:nx,60:[j7,C$],91:j$,92:[d$,qA],93:Q0,95:nx,96:X7},lY={null:[nx,Z$]},cY={null:[42,95]},uY={null:[]},dY=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:cY,contentInitial:rY,disable:uY,document:nY,flow:aY,flowInitial:iY,insideSpan:lY,string:oY,text:sY},Symbol.toStringTag,{value:"Module"}));function fY(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const a={},o=[];let l=[],c=[];const f={attempt:A(D),check:A(O),consume:R,enter:k,exit:M,interrupt:A(O,{interrupt:!0})},d={code:null,containerState:{},defineSkip:C,events:[],now:w,parser:e,previous:null,sliceSerialize:y,sliceStream:g,write:h};let m=t.tokenize.call(d,f);return t.resolveAll&&o.push(t),d;function h(W){return l=xi(l,W),T(),l[l.length-1]!==null?[]:(L(t,0),d.events=Em(o,d.events,d),d.events)}function y(W,_){return pY(g(W),_)}function g(W){return hY(l,W)}function w(){const{_bufferIndex:W,_index:_,line:V,column:$,offset:B}=r;return{_bufferIndex:W,_index:_,line:V,column:$,offset:B}}function C(W){a[W.line]=W.column,F()}function T(){let W;for(;r._index<l.length;){const _=l[r._index];if(typeof _=="string")for(W=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===W&&r._bufferIndex<_.length;)E(_.charCodeAt(r._bufferIndex));else E(_)}}function E(W){m=m(W)}function R(W){vt(W)?(r.line++,r.column=1,r.offset+=W===-3?2:1,F()):W!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=W}function k(W,_){const V=_||{};return V.type=W,V.start=w(),d.events.push(["enter",V,d]),c.push(V),V}function M(W){const _=c.pop();return _.end=w(),d.events.push(["exit",_,d]),_}function D(W,_){L(W,_.from)}function O(W,_){_.restore()}function A(W,_){return V;function V($,B,j){let z,H,K,P;return Array.isArray($)?G($):"tokenize"in $?G([$]):U($);function U(ae){return Z;function Z(ue){const ve=ue!==null&&ae[ue],Se=ue!==null&&ae.null,Le=[...Array.isArray(ve)?ve:ve?[ve]:[],...Array.isArray(Se)?Se:Se?[Se]:[]];return G(Le)(ue)}}function G(ae){return z=ae,H=0,ae.length===0?j:I(ae[H])}function I(ae){return Z;function Z(ue){return P=q(),K=ae,ae.partial||(d.currentConstruct=ae),ae.name&&d.parser.constructs.disable.null.includes(ae.name)?le():ae.tokenize.call(_?Object.assign(Object.create(d),_):d,f,Q,le)(ue)}}function Q(ae){return W(K,P),B}function le(ae){return P.restore(),++H<z.length?I(z[H]):j}}}function L(W,_){W.resolveAll&&!o.includes(W)&&o.push(W),W.resolve&&ii(d.events,_,d.events.length-_,W.resolve(d.events.slice(_),d)),W.resolveTo&&(d.events=W.resolveTo(d.events,d))}function q(){const W=w(),_=d.previous,V=d.currentConstruct,$=d.events.length,B=Array.from(c);return{from:$,restore:j};function j(){r=W,d.previous=_,d.currentConstruct=V,d.events.length=$,c=B,F()}}function F(){r.line in a&&r.column<2&&(r.column=a[r.line],r.offset+=a[r.line]-1)}}function hY(e,t){const n=t.start._index,r=t.start._bufferIndex,a=t.end._index,o=t.end._bufferIndex;let l;if(n===a)l=[e[n].slice(r,o)];else{if(l=e.slice(n,a),r>-1){const c=l[0];typeof c=="string"?l[0]=c.slice(r):l.shift()}o>0&&l.push(e[a].slice(0,o))}return l}function pY(e,t){let n=-1;const r=[];let a;for(;++n<e.length;){const o=e[n];let l;if(typeof o=="string")l=o;else switch(o){case-5:{l="\r";break}case-4:{l=`
426
+ `;break}case-3:{l=`\r
427
+ `;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&a)continue;l=" ";break}default:l=String.fromCharCode(o)}a=o===-2,r.push(l)}return r.join("")}function mY(e){const r={constructs:BA([dY,...(e||{}).extensions||[]]),content:a(A7),defined:[],document:a(D7),flow:a(X$),lazy:{},string:a(J$),text:a(eY)};return r;function a(o){return l;function l(c){return fY(r,o,c)}}}function gY(e){for(;!$A(e););return e}const ok=/[\0\t\n\r]/g;function yY(){let e=1,t="",n=!0,r;return a;function a(o,l,c){const f=[];let d,m,h,y,g;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(l||void 0).decode(o)),h=0,t="",n&&(o.charCodeAt(0)===65279&&h++,n=void 0);h<o.length;){if(ok.lastIndex=h,d=ok.exec(o),y=d&&d.index!==void 0?d.index:o.length,g=o.charCodeAt(y),!d){t=o.slice(h);break}if(g===10&&h===y&&r)f.push(-3),r=void 0;else switch(r&&(f.push(-5),r=void 0),h<y&&(f.push(o.slice(h,y)),e+=y-h),g){case 0:{f.push(65533),e++;break}case 9:{for(m=Math.ceil(e/4)*4,f.push(-2);e++<m;)f.push(-1);break}case 10:{f.push(-4),e=1;break}default:r=!0,e=1}h=y+1}return c&&(r&&f.push(-5),t&&f.push(t),f.push(null)),f}}const bY=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function vY(e){return e.replace(bY,xY)}function xY(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),o=a===120||a===88;return HA(n.slice(o?2:1),o?16:10)}return X0(n)||e}const QA={}.hasOwnProperty;function wY(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),SY(n)(gY(mY(n).document().write(yY()(e,t,!0))))}function SY(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(J),autolinkProtocol:q,autolinkEmail:q,atxHeading:o(_e),blockQuote:o(Se),characterEscape:q,characterReference:q,codeFenced:o(Le),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:o(Le,l),codeText:o(te,l),codeTextData:q,data:q,codeFlowValue:q,definition:o(he),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:o(ye),hardBreakEscape:o(Oe),hardBreakTrailing:o(Oe),htmlFlow:o(Ce,l),htmlFlowData:q,htmlText:o(Ce,l),htmlTextData:q,image:o(Re),label:l,link:o(J),listItem:o(xe),listItemValue:y,listOrdered:o(Ee,h),listUnordered:o(Ee),paragraph:o(Be),reference:I,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:o(_e),strong:o(Ve),thematicBreak:o(ut)},exit:{atxHeading:f(),atxHeadingSequence:D,autolink:f(),autolinkEmail:ve,autolinkProtocol:ue,blockQuote:f(),characterEscapeValue:F,characterReferenceMarkerHexadecimal:le,characterReferenceMarkerNumeric:le,characterReferenceValue:ae,characterReference:Z,codeFenced:f(T),codeFencedFence:C,codeFencedFenceInfo:g,codeFencedFenceMeta:w,codeFlowValue:F,codeIndented:f(E),codeText:f(B),codeTextData:F,data:F,definition:f(),definitionDestinationString:M,definitionLabelString:R,definitionTitleString:k,emphasis:f(),hardBreakEscape:f(_),hardBreakTrailing:f(_),htmlFlow:f(V),htmlFlowData:F,htmlText:f($),htmlTextData:F,image:f(z),label:K,labelText:H,lineEnding:W,link:f(j),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:Q,resourceDestinationString:P,resourceTitleString:U,resource:G,setextHeading:f(L),setextHeadingLineSequence:A,setextHeadingText:O,strong:f(),thematicBreak:f()}};ZA(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(pe){let Te={type:"root",children:[]};const ee={stack:[Te],tokenStack:[],config:t,enter:c,exit:d,buffer:l,resume:m,data:n},fe=[];let Ae=-1;for(;++Ae<pe.length;)if(pe[Ae][1].type==="listOrdered"||pe[Ae][1].type==="listUnordered")if(pe[Ae][0]==="enter")fe.push(Ae);else{const He=fe.pop();Ae=a(pe,He,Ae)}for(Ae=-1;++Ae<pe.length;){const He=t[pe[Ae][0]];QA.call(He,pe[Ae][1].type)&&He[pe[Ae][1].type].call(Object.assign({sliceSerialize:pe[Ae][2].sliceSerialize},ee),pe[Ae][1])}if(ee.tokenStack.length>0){const He=ee.tokenStack[ee.tokenStack.length-1];(He[1]||sk).call(ee,void 0,He[0])}for(Te.position={start:wo(pe.length>0?pe[0][1].start:{line:1,column:1,offset:0}),end:wo(pe.length>0?pe[pe.length-2][1].end:{line:1,column:1,offset:0})},Ae=-1;++Ae<t.transforms.length;)Te=t.transforms[Ae](Te)||Te;return Te}function a(pe,Te,ee){let fe=Te-1,Ae=-1,He=!1,$e,et,ze,Ze;for(;++fe<=ee;){const tt=pe[fe];switch(tt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{tt[0]==="enter"?Ae++:Ae--,Ze=void 0;break}case"lineEndingBlank":{tt[0]==="enter"&&($e&&!Ze&&!Ae&&!ze&&(ze=fe),Ze=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ze=void 0}if(!Ae&&tt[0]==="enter"&&tt[1].type==="listItemPrefix"||Ae===-1&&tt[0]==="exit"&&(tt[1].type==="listUnordered"||tt[1].type==="listOrdered")){if($e){let Tt=fe;for(et=void 0;Tt--;){const zt=pe[Tt];if(zt[1].type==="lineEnding"||zt[1].type==="lineEndingBlank"){if(zt[0]==="exit")continue;et&&(pe[et][1].type="lineEndingBlank",He=!0),zt[1].type="lineEnding",et=Tt}else if(!(zt[1].type==="linePrefix"||zt[1].type==="blockQuotePrefix"||zt[1].type==="blockQuotePrefixWhitespace"||zt[1].type==="blockQuoteMarker"||zt[1].type==="listItemIndent"))break}ze&&(!et||ze<et)&&($e._spread=!0),$e.end=Object.assign({},et?pe[et][1].start:tt[1].end),pe.splice(et||fe,0,["exit",$e,tt[2]]),fe++,ee++}if(tt[1].type==="listItemPrefix"){const Tt={type:"listItem",_spread:!1,start:Object.assign({},tt[1].start),end:void 0};$e=Tt,pe.splice(fe,0,["enter",Tt,tt[2]]),fe++,ee++,ze=void 0,Ze=!0}}}return pe[Te][1]._spread=He,ee}function o(pe,Te){return ee;function ee(fe){c.call(this,pe(fe),fe),Te&&Te.call(this,fe)}}function l(){this.stack.push({type:"fragment",children:[]})}function c(pe,Te,ee){this.stack[this.stack.length-1].children.push(pe),this.stack.push(pe),this.tokenStack.push([Te,ee||void 0]),pe.position={start:wo(Te.start),end:void 0}}function f(pe){return Te;function Te(ee){pe&&pe.call(this,ee),d.call(this,ee)}}function d(pe,Te){const ee=this.stack.pop(),fe=this.tokenStack.pop();if(fe)fe[0].type!==pe.type&&(Te?Te.call(this,pe,fe[0]):(fe[1]||sk).call(this,pe,fe[0]));else throw new Error("Cannot close `"+pe.type+"` ("+ld({start:pe.start,end:pe.end})+"): it’s not open");ee.position.end=wo(pe.end)}function m(){return G0(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function y(pe){if(this.data.expectingFirstListItemValue){const Te=this.stack[this.stack.length-2];Te.start=Number.parseInt(this.sliceSerialize(pe),10),this.data.expectingFirstListItemValue=void 0}}function g(){const pe=this.resume(),Te=this.stack[this.stack.length-1];Te.lang=pe}function w(){const pe=this.resume(),Te=this.stack[this.stack.length-1];Te.meta=pe}function C(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function T(){const pe=this.resume(),Te=this.stack[this.stack.length-1];Te.value=pe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){const pe=this.resume(),Te=this.stack[this.stack.length-1];Te.value=pe.replace(/(\r?\n|\r)$/g,"")}function R(pe){const Te=this.resume(),ee=this.stack[this.stack.length-1];ee.label=Te,ee.identifier=ji(this.sliceSerialize(pe)).toLowerCase()}function k(){const pe=this.resume(),Te=this.stack[this.stack.length-1];Te.title=pe}function M(){const pe=this.resume(),Te=this.stack[this.stack.length-1];Te.url=pe}function D(pe){const Te=this.stack[this.stack.length-1];if(!Te.depth){const ee=this.sliceSerialize(pe).length;Te.depth=ee}}function O(){this.data.setextHeadingSlurpLineEnding=!0}function A(pe){const Te=this.stack[this.stack.length-1];Te.depth=this.sliceSerialize(pe).codePointAt(0)===61?1:2}function L(){this.data.setextHeadingSlurpLineEnding=void 0}function q(pe){const ee=this.stack[this.stack.length-1].children;let fe=ee[ee.length-1];(!fe||fe.type!=="text")&&(fe=De(),fe.position={start:wo(pe.start),end:void 0},ee.push(fe)),this.stack.push(fe)}function F(pe){const Te=this.stack.pop();Te.value+=this.sliceSerialize(pe),Te.position.end=wo(pe.end)}function W(pe){const Te=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ee=Te.children[Te.children.length-1];ee.position.end=wo(pe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Te.type)&&(q.call(this,pe),F.call(this,pe))}function _(){this.data.atHardBreak=!0}function V(){const pe=this.resume(),Te=this.stack[this.stack.length-1];Te.value=pe}function $(){const pe=this.resume(),Te=this.stack[this.stack.length-1];Te.value=pe}function B(){const pe=this.resume(),Te=this.stack[this.stack.length-1];Te.value=pe}function j(){const pe=this.stack[this.stack.length-1];if(this.data.inReference){const Te=this.data.referenceType||"shortcut";pe.type+="Reference",pe.referenceType=Te,delete pe.url,delete pe.title}else delete pe.identifier,delete pe.label;this.data.referenceType=void 0}function z(){const pe=this.stack[this.stack.length-1];if(this.data.inReference){const Te=this.data.referenceType||"shortcut";pe.type+="Reference",pe.referenceType=Te,delete pe.url,delete pe.title}else delete pe.identifier,delete pe.label;this.data.referenceType=void 0}function H(pe){const Te=this.sliceSerialize(pe),ee=this.stack[this.stack.length-2];ee.label=vY(Te),ee.identifier=ji(Te).toLowerCase()}function K(){const pe=this.stack[this.stack.length-1],Te=this.resume(),ee=this.stack[this.stack.length-1];if(this.data.inReference=!0,ee.type==="link"){const fe=pe.children;ee.children=fe}else ee.alt=Te}function P(){const pe=this.resume(),Te=this.stack[this.stack.length-1];Te.url=pe}function U(){const pe=this.resume(),Te=this.stack[this.stack.length-1];Te.title=pe}function G(){this.data.inReference=void 0}function I(){this.data.referenceType="collapsed"}function Q(pe){const Te=this.resume(),ee=this.stack[this.stack.length-1];ee.label=Te,ee.identifier=ji(this.sliceSerialize(pe)).toLowerCase(),this.data.referenceType="full"}function le(pe){this.data.characterReferenceType=pe.type}function ae(pe){const Te=this.sliceSerialize(pe),ee=this.data.characterReferenceType;let fe;ee?(fe=HA(Te,ee==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):fe=X0(Te);const Ae=this.stack[this.stack.length-1];Ae.value+=fe}function Z(pe){const Te=this.stack.pop();Te.position.end=wo(pe.end)}function ue(pe){F.call(this,pe);const Te=this.stack[this.stack.length-1];Te.url=this.sliceSerialize(pe)}function ve(pe){F.call(this,pe);const Te=this.stack[this.stack.length-1];Te.url="mailto:"+this.sliceSerialize(pe)}function Se(){return{type:"blockquote",children:[]}}function Le(){return{type:"code",lang:null,meta:null,value:""}}function te(){return{type:"inlineCode",value:""}}function he(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ye(){return{type:"emphasis",children:[]}}function _e(){return{type:"heading",depth:0,children:[]}}function Oe(){return{type:"break"}}function Ce(){return{type:"html",value:""}}function Re(){return{type:"image",title:null,url:"",alt:null}}function J(){return{type:"link",title:null,url:"",children:[]}}function Ee(pe){return{type:"list",ordered:pe.type==="listOrdered",start:null,spread:pe._spread,children:[]}}function xe(pe){return{type:"listItem",spread:pe._spread,checked:null,children:[]}}function Be(){return{type:"paragraph",children:[]}}function Ve(){return{type:"strong",children:[]}}function De(){return{type:"text",value:""}}function ut(){return{type:"thematicBreak"}}}function wo(e){return{line:e.line,column:e.column,offset:e.offset}}function ZA(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?ZA(e,r):EY(e,r)}}function EY(e,t){let n;for(n in t)if(QA.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function sk(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+ld({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ld({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+ld({start:t.start,end:t.end})+") is still open")}function CY(e){const t=this;t.parser=n;function n(r){return wY(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function TY(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function RY(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
428
+ `}]}function kY(e,t){const n=t.value?t.value+`
429
+ `:"",r={},a=t.lang?t.lang.split(/\s+/):[];a.length>0&&(r.className=["language-"+a[0]]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function MY(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function OY(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function AY(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),a=zc(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let l,c=e.footnoteCounts.get(r);c===void 0?(c=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=o+1,c+=1,e.footnoteCounts.set(r,c);const f={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+a,id:n+"fnref-"+a+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,f);const d={type:"element",tagName:"sup",properties:{},children:[f]};return e.patch(t,d),e.applyData(t,d)}function NY(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function DY(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function JA(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const a=e.all(t),o=a[0];o&&o.type==="text"?o.value="["+o.value:a.unshift({type:"text",value:"["});const l=a[a.length-1];return l&&l.type==="text"?l.value+=r:a.push({type:"text",value:r}),a}function IY(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return JA(e,t);const a={src:zc(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(a.title=r.title);const o={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,o),e.applyData(t,o)}function PY(e,t){const n={src:zc(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function LY(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function _Y(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return JA(e,t);const a={href:zc(r.url||"")};r.title!==null&&r.title!==void 0&&(a.title=r.title);const o={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function jY(e,t){const n={href:zc(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function zY(e,t,n){const r=e.all(t),a=n?FY(n):eN(t),o={},l=[];if(typeof t.checked=="boolean"){const m=r[0];let h;m&&m.type==="element"&&m.tagName==="p"?h=m:(h={type:"element",tagName:"p",properties:{},children:[]},r.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let c=-1;for(;++c<r.length;){const m=r[c];(a||c!==0||m.type!=="element"||m.tagName!=="p")&&l.push({type:"text",value:`
430
+ `}),m.type==="element"&&m.tagName==="p"&&!a?l.push(...m.children):l.push(m)}const f=r[r.length-1];f&&(a||f.type!=="element"||f.tagName!=="p")&&l.push({type:"text",value:`
431
+ `});const d={type:"element",tagName:"li",properties:o,children:l};return e.patch(t,d),e.applyData(t,d)}function FY(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=eN(n[r])}return t}function eN(e){const t=e.spread;return t??e.children.length>1}function BY(e,t){const n={},r=e.all(t);let a=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++a<r.length;){const l=r[a];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function HY(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function UY(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function qY(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function VY(e,t){const n=e.all(t),r=n.shift(),a=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],l),a.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},c=$0(t.children[1]),f=IA(t.children[t.children.length-1]);c&&f&&(l.position={start:c,end:f}),a.push(l)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(a,!0)};return e.patch(t,o),e.applyData(t,o)}function $Y(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,c=l?l.length:t.children.length;let f=-1;const d=[];for(;++f<c;){const h=t.children[f],y={},g=l?l[f]:void 0;g&&(y.align=g);let w={type:"element",tagName:o,properties:y,children:[]};h&&(w.children=e.all(h),e.patch(h,w),w=e.applyData(h,w)),d.push(w)}const m={type:"element",tagName:"tr",properties:{},children:e.wrap(d,!0)};return e.patch(t,m),e.applyData(t,m)}function YY(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const lk=9,ck=32;function WY(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),a=0;const o=[];for(;r;)o.push(uk(t.slice(a,r.index),a>0,!0),r[0]),a=r.index+r[0].length,r=n.exec(t);return o.push(uk(t.slice(a),a>0,!1)),o.join("")}function uk(e,t,n){let r=0,a=e.length;if(t){let o=e.codePointAt(r);for(;o===lk||o===ck;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(a-1);for(;o===lk||o===ck;)a--,o=e.codePointAt(a-1)}return a>r?e.slice(r,a):""}function KY(e,t){const n={type:"text",value:WY(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function GY(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const XY={blockquote:TY,break:RY,code:kY,delete:MY,emphasis:OY,footnoteReference:AY,heading:NY,html:DY,imageReference:IY,image:PY,inlineCode:LY,linkReference:_Y,link:jY,listItem:zY,list:BY,paragraph:HY,root:UY,strong:qY,table:VY,tableCell:YY,tableRow:$Y,text:KY,thematicBreak:GY,toml:Bh,yaml:Bh,definition:Bh,footnoteDefinition:Bh};function Bh(){}const tN=-1,Cm=0,ud=1,jp=2,Z0=3,J0=4,ew=5,tw=6,nN=7,rN=8,QY=typeof self=="object"?self:globalThis,dk=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new QY[e](t)},ZY=(e,t)=>{const n=(a,o)=>(e.set(o,a),a),r=a=>{if(e.has(a))return e.get(a);const[o,l]=t[a];switch(o){case Cm:case tN:return n(l,a);case ud:{const c=n([],a);for(const f of l)c.push(r(f));return c}case jp:{const c=n({},a);for(const[f,d]of l)c[r(f)]=r(d);return c}case Z0:return n(new Date(l),a);case J0:{const{source:c,flags:f}=l;return n(new RegExp(c,f),a)}case ew:{const c=n(new Map,a);for(const[f,d]of l)c.set(r(f),r(d));return c}case tw:{const c=n(new Set,a);for(const f of l)c.add(r(f));return c}case nN:{const{name:c,message:f}=l;return n(dk(c,f),a)}case rN:return n(BigInt(l),a);case"BigInt":return n(Object(BigInt(l)),a);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:c}=new Uint8Array(l);return n(new DataView(c),l)}}return n(dk(o,l),a)};return r},fk=e=>ZY(new Map,e)(0),Ul="",{toString:JY}={},{keys:eW}=Object,Yu=e=>{const t=typeof e;if(t!=="object"||!e)return[Cm,t];const n=JY.call(e).slice(8,-1);switch(n){case"Array":return[ud,Ul];case"Object":return[jp,Ul];case"Date":return[Z0,Ul];case"RegExp":return[J0,Ul];case"Map":return[ew,Ul];case"Set":return[tw,Ul];case"DataView":return[ud,n]}return n.includes("Array")?[ud,n]:n.includes("Error")?[nN,n]:[jp,n]},Hh=([e,t])=>e===Cm&&(t==="function"||t==="symbol"),tW=(e,t,n,r)=>{const a=(l,c)=>{const f=r.push(l)-1;return n.set(c,f),f},o=l=>{if(n.has(l))return n.get(l);let[c,f]=Yu(l);switch(c){case Cm:{let m=l;switch(f){case"bigint":c=rN,m=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+f);m=null;break;case"undefined":return a([tN],l)}return a([c,m],l)}case ud:{if(f){let y=l;return f==="DataView"?y=new Uint8Array(l.buffer):f==="ArrayBuffer"&&(y=new Uint8Array(l)),a([f,[...y]],l)}const m=[],h=a([c,m],l);for(const y of l)m.push(o(y));return h}case jp:{if(f)switch(f){case"BigInt":return a([f,l.toString()],l);case"Boolean":case"Number":case"String":return a([f,l.valueOf()],l)}if(t&&"toJSON"in l)return o(l.toJSON());const m=[],h=a([c,m],l);for(const y of eW(l))(e||!Hh(Yu(l[y])))&&m.push([o(y),o(l[y])]);return h}case Z0:return a([c,l.toISOString()],l);case J0:{const{source:m,flags:h}=l;return a([c,{source:m,flags:h}],l)}case ew:{const m=[],h=a([c,m],l);for(const[y,g]of l)(e||!(Hh(Yu(y))||Hh(Yu(g))))&&m.push([o(y),o(g)]);return h}case tw:{const m=[],h=a([c,m],l);for(const y of l)(e||!Hh(Yu(y)))&&m.push(o(y));return h}}const{message:d}=l;return a([c,{name:f,message:d}],l)};return o},hk=(e,{json:t,lossy:n}={})=>{const r=[];return tW(!(t||n),!!t,new Map,r)(e),r},zp=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?fk(hk(e,t)):structuredClone(e):(e,t)=>fk(hk(e,t));function nW(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function rW(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function iW(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||nW,r=e.options.footnoteBackLabel||rW,a=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let f=-1;for(;++f<e.footnoteOrder.length;){const d=e.footnoteById.get(e.footnoteOrder[f]);if(!d)continue;const m=e.all(d),h=String(d.identifier).toUpperCase(),y=zc(h.toLowerCase());let g=0;const w=[],C=e.footnoteCounts.get(h);for(;C!==void 0&&++g<=C;){w.length>0&&w.push({type:"text",value:" "});let R=typeof n=="string"?n:n(f,g);typeof R=="string"&&(R={type:"text",value:R}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+y+(g>1?"-"+g:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(f,g),className:["data-footnote-backref"]},children:Array.isArray(R)?R:[R]})}const T=m[m.length-1];if(T&&T.type==="element"&&T.tagName==="p"){const R=T.children[T.children.length-1];R&&R.type==="text"?R.value+=" ":T.children.push({type:"text",value:" "}),T.children.push(...w)}else m.push(...w);const E={type:"element",tagName:"li",properties:{id:t+"fn-"+y},children:e.wrap(m,!0)};e.patch(d,E),c.push(E)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...zp(l),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:`
432
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
433
+ `}]}}const Tm=(function(e){if(e==null)return lW;if(typeof e=="function")return Rm(e);if(typeof e=="object")return Array.isArray(e)?aW(e):oW(e);if(typeof e=="string")return sW(e);throw new Error("Expected function, string, or object as test")});function aW(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Tm(e[n]);return Rm(r);function r(...a){let o=-1;for(;++o<t.length;)if(t[o].apply(this,a))return!0;return!1}}function oW(e){const t=e;return Rm(n);function n(r){const a=r;let o;for(o in e)if(a[o]!==t[o])return!1;return!0}}function sW(e){return Rm(t);function t(n){return n&&n.type===e}}function Rm(e){return t;function t(n,r,a){return!!(cW(n)&&e.call(this,n,typeof r=="number"?r:void 0,a||void 0))}}function lW(){return!0}function cW(e){return e!==null&&typeof e=="object"&&"type"in e}const iN=[],uW=!0,rx=!1,dW="skip";function aN(e,t,n,r){let a;typeof t=="function"&&typeof n!="function"?(r=n,n=t):a=t;const o=Tm(a),l=r?-1:1;c(e,void 0,[])();function c(f,d,m){const h=f&&typeof f=="object"?f:{};if(typeof h.type=="string"){const g=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(f.type+(g?"<"+g+">":""))+")"})}return y;function y(){let g=iN,w,C,T;if((!t||o(f,d,m[m.length-1]||void 0))&&(g=fW(n(f,m)),g[0]===rx))return g;if("children"in f&&f.children){const E=f;if(E.children&&g[0]!==dW)for(C=(r?E.children.length:-1)+l,T=m.concat(E);C>-1&&C<E.children.length;){const R=E.children[C];if(w=c(R,C,T)(),w[0]===rx)return w;C=typeof w[1]=="number"?w[1]:C+l}}return g}}}function fW(e){return Array.isArray(e)?e:typeof e=="number"?[uW,e]:e==null?iN:[e]}function nw(e,t,n,r){let a,o,l;typeof t=="function"&&typeof n!="function"?(o=void 0,l=t,a=n):(o=t,l=n,a=r),aN(e,o,c,a);function c(f,d){const m=d[d.length-1],h=m?m.children.indexOf(f):void 0;return l(f,h,m)}}const ix={}.hasOwnProperty,hW={};function pW(e,t){const n=t||hW,r=new Map,a=new Map,o=new Map,l={...XY,...n.handlers},c={all:d,applyData:gW,definitionById:r,footnoteById:a,footnoteCounts:o,footnoteOrder:[],handlers:l,one:f,options:n,patch:mW,wrap:bW};return nw(e,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const h=m.type==="definition"?r:a,y=String(m.identifier).toUpperCase();h.has(y)||h.set(y,m)}}),c;function f(m,h){const y=m.type,g=c.handlers[y];if(ix.call(c.handlers,y)&&g)return g(c,m,h);if(c.options.passThrough&&c.options.passThrough.includes(y)){if("children"in m){const{children:C,...T}=m,E=zp(T);return E.children=c.all(m),E}return zp(m)}return(c.options.unknownHandler||yW)(c,m,h)}function d(m){const h=[];if("children"in m){const y=m.children;let g=-1;for(;++g<y.length;){const w=c.one(y[g],m);if(w){if(g&&y[g-1].type==="break"&&(!Array.isArray(w)&&w.type==="text"&&(w.value=pk(w.value)),!Array.isArray(w)&&w.type==="element")){const C=w.children[0];C&&C.type==="text"&&(C.value=pk(C.value))}Array.isArray(w)?h.push(...w):h.push(w)}}}return h}}function mW(e,t){e.position&&(t.position=n7(e))}function gW(e,t){let n=t;if(e&&e.data){const r=e.data.hName,a=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const l="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:l}}n.type==="element"&&o&&Object.assign(n.properties,zp(o)),"children"in n&&n.children&&a!==null&&a!==void 0&&(n.children=a)}return n}function yW(e,t){const n=t.data||{},r="value"in t&&!(ix.call(n,"hProperties")||ix.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function bW(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
434
+ `});++r<e.length;)r&&n.push({type:"text",value:`
435
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
436
+ `}),n}function pk(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function mk(e,t){const n=pW(e,t),r=n.one(e,void 0),a=iW(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return a&&o.children.push({type:"text",value:`
437
+ `},a),o}function vW(e,t){return e&&"run"in e?async function(n,r){const a=mk(n,{file:r,...t});await e.run(a,r)}:function(n,r){return mk(n,{file:r,...e||t})}}function gk(e){if(e)throw e}var jb,yk;function xW(){if(yk)return jb;yk=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,a=function(d){return typeof Array.isArray=="function"?Array.isArray(d):t.call(d)==="[object Array]"},o=function(d){if(!d||t.call(d)!=="[object Object]")return!1;var m=e.call(d,"constructor"),h=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!m&&!h)return!1;var y;for(y in d);return typeof y>"u"||e.call(d,y)},l=function(d,m){n&&m.name==="__proto__"?n(d,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):d[m.name]=m.newValue},c=function(d,m){if(m==="__proto__")if(e.call(d,m)){if(r)return r(d,m).value}else return;return d[m]};return jb=function f(){var d,m,h,y,g,w,C=arguments[0],T=1,E=arguments.length,R=!1;for(typeof C=="boolean"&&(R=C,C=arguments[1]||{},T=2),(C==null||typeof C!="object"&&typeof C!="function")&&(C={});T<E;++T)if(d=arguments[T],d!=null)for(m in d)h=c(C,m),y=c(d,m),C!==y&&(R&&y&&(o(y)||(g=a(y)))?(g?(g=!1,w=h&&a(h)?h:[]):w=h&&o(h)?h:{},l(C,{name:m,newValue:f(R,w,y)})):typeof y<"u"&&l(C,{name:m,newValue:y}));return C},jb}var wW=xW();const zb=Gp(wW);function ax(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function SW(){const e=[],t={run:n,use:r};return t;function n(...a){let o=-1;const l=a.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);c(null,...a);function c(f,...d){const m=e[++o];let h=-1;if(f){l(f);return}for(;++h<a.length;)(d[h]===null||d[h]===void 0)&&(d[h]=a[h]);a=d,m?EW(m,c)(...d):l(null,...d)}}function r(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return e.push(a),t}}function EW(e,t){let n;return r;function r(...l){const c=e.length>l.length;let f;c&&l.push(a);try{f=e.apply(this,l)}catch(d){const m=d;if(c&&n)throw m;return a(m)}c||(f&&f.then&&typeof f.then=="function"?f.then(o,a):f instanceof Error?a(f):o(f))}function a(l,...c){n||(n=!0,t(l,...c))}function o(l){a(null,l)}}const Xi={basename:CW,dirname:TW,extname:RW,join:kW,sep:"/"};function CW(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');nf(e);let n=0,r=-1,a=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;a--;)if(e.codePointAt(a)===47){if(o){n=a+1;break}}else r<0&&(o=!0,r=a+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,c=t.length-1;for(;a--;)if(e.codePointAt(a)===47){if(o){n=a+1;break}}else l<0&&(o=!0,l=a+1),c>-1&&(e.codePointAt(a)===t.codePointAt(c--)?c<0&&(r=a):(c=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function TW(e){if(nf(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function RW(e){nf(e);let t=e.length,n=-1,r=0,a=-1,o=0,l;for(;t--;){const c=e.codePointAt(t);if(c===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),c===46?a<0?a=t:o!==1&&(o=1):a>-1&&(o=-1)}return a<0||n<0||o===0||o===1&&a===n-1&&a===r+1?"":e.slice(a,n)}function kW(...e){let t=-1,n;for(;++t<e.length;)nf(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":MW(n)}function MW(e){nf(e);const t=e.codePointAt(0)===47;let n=OW(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function OW(e,t){let n="",r=0,a=-1,o=0,l=-1,c,f;for(;++l<=e.length;){if(l<e.length)c=e.codePointAt(l);else{if(c===47)break;c=47}if(c===47){if(!(a===l-1||o===1))if(a!==l-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(f=n.lastIndexOf("/"),f!==n.length-1){f<0?(n="",r=0):(n=n.slice(0,f),r=n.length-1-n.lastIndexOf("/")),a=l,o=0;continue}}else if(n.length>0){n="",r=0,a=l,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(a+1,l):n=e.slice(a+1,l),r=l-a-1;a=l,o=0}else c===46&&o>-1?o++:o=-1}return n}function nf(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const AW={cwd:NW};function NW(){return"/"}function ox(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function DW(e){if(typeof e=="string")e=new URL(e);else if(!ox(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return IW(e)}function IW(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const a=new TypeError("File URL path must not include encoded / characters");throw a.code="ERR_INVALID_FILE_URL_PATH",a}}return decodeURIComponent(t)}const Fb=["history","path","basename","stem","extname","dirname"];class oN{constructor(t){let n;t?ox(t)?n={path:t}:typeof t=="string"||PW(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":AW.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Fb.length;){const o=Fb[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let a;for(a in n)Fb.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?Xi.basename(this.path):void 0}set basename(t){Hb(t,"basename"),Bb(t,"basename"),this.path=Xi.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Xi.dirname(this.path):void 0}set dirname(t){bk(this.basename,"dirname"),this.path=Xi.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Xi.extname(this.path):void 0}set extname(t){if(Bb(t,"extname"),bk(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Xi.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){ox(t)&&(t=DW(t)),Hb(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Xi.basename(this.path,this.extname):void 0}set stem(t){Hb(t,"stem"),Bb(t,"stem"),this.path=Xi.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const a=this.message(t,n,r);throw a.fatal=!0,a}info(t,n,r){const a=this.message(t,n,r);return a.fatal=void 0,a}message(t,n,r){const a=new wr(t,n,r);return this.path&&(a.name=this.path+":"+a.name,a.file=this.path),a.fatal=!1,this.messages.push(a),a}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Bb(e,t){if(e&&e.includes(Xi.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Xi.sep+"`")}function Hb(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function bk(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function PW(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const LW=(function(e){const r=this.constructor.prototype,a=r[e],o=function(){return a.apply(o,arguments)};return Object.setPrototypeOf(o,r),o}),_W={}.hasOwnProperty;class rw extends LW{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=SW()}copy(){const t=new rw;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(zb(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Vb("data",this.frozen),this.namespace[t]=n,this):_W.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Vb("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const a=n.call(t,...r);typeof a=="function"&&this.transformers.use(a)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Uh(t),r=this.parser||this.Parser;return Ub("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Ub("process",this.parser||this.Parser),qb("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(o,l){const c=Uh(t),f=r.parse(c);r.run(f,c,function(m,h,y){if(m||!h||!y)return d(m);const g=h,w=r.stringify(g,y);FW(w)?y.value=w:y.result=w,d(m,y)});function d(m,h){m||!h?l(m):o?o(h):n(void 0,h)}}}processSync(t){let n=!1,r;return this.freeze(),Ub("processSync",this.parser||this.Parser),qb("processSync",this.compiler||this.Compiler),this.process(t,a),xk("processSync","process",n),r;function a(o,l){n=!0,gk(o),r=l}}run(t,n,r){vk(t),this.freeze();const a=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(l,c){const f=Uh(n);a.run(t,f,d);function d(m,h,y){const g=h||t;m?c(m):l?l(g):r(void 0,g,y)}}}runSync(t,n){let r=!1,a;return this.run(t,n,o),xk("runSync","run",r),a;function o(l,c){gk(l),a=c,r=!0}}stringify(t,n){this.freeze();const r=Uh(n),a=this.compiler||this.Compiler;return qb("stringify",a),vk(t),a(t,r)}use(t,...n){const r=this.attachers,a=this.namespace;if(Vb("use",this.frozen),t!=null)if(typeof t=="function")f(t,n);else if(typeof t=="object")Array.isArray(t)?c(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(d){if(typeof d=="function")f(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[m,...h]=d;f(m,h)}else l(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function l(d){if(!("plugins"in d)&&!("settings"in d))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");c(d.plugins),d.settings&&(a.settings=zb(!0,a.settings,d.settings))}function c(d){let m=-1;if(d!=null)if(Array.isArray(d))for(;++m<d.length;){const h=d[m];o(h)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function f(d,m){let h=-1,y=-1;for(;++h<r.length;)if(r[h][0]===d){y=h;break}if(y===-1)r.push([d,...m]);else if(m.length>0){let[g,...w]=m;const C=r[y][1];ax(C)&&ax(g)&&(g=zb(!0,C,g)),r[y]=[d,g,...w]}}}}const jW=new rw().freeze();function Ub(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function qb(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Vb(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function vk(e){if(!ax(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function xk(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Uh(e){return zW(e)?e:new oN(e)}function zW(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function FW(e){return typeof e=="string"||BW(e)}function BW(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const HW="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",wk=[],Sk={allowDangerousHtml:!0},UW=/^(https?|ircs?|mailto|xmpp)$/i,qW=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function VW(e){const t=$W(e),n=YW(e);return WW(t.runSync(t.parse(n),n),e)}function $W(e){const t=e.rehypePlugins||wk,n=e.remarkPlugins||wk,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Sk}:Sk;return jW().use(CY).use(n).use(vW,r).use(t)}function YW(e){const t=e.children||"",n=new oN;return typeof t=="string"&&(n.value=t),n}function WW(e,t){const n=t.allowedElements,r=t.allowElement,a=t.components,o=t.disallowedElements,l=t.skipHtml,c=t.unwrapDisallowed,f=t.urlTransform||KW;for(const m of qW)Object.hasOwn(t,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+HW+m.id,void 0);return nw(e,d),s7(e,{Fragment:S.Fragment,components:a,ignoreInvalidStyle:!0,jsx:S.jsx,jsxs:S.jsxs,passKeys:!0,passNode:!0});function d(m,h,y){if(m.type==="raw"&&y&&typeof h=="number")return l?y.children.splice(h,1):y.children[h]={type:"text",value:m.value},h;if(m.type==="element"){let g;for(g in Pb)if(Object.hasOwn(Pb,g)&&Object.hasOwn(m.properties,g)){const w=m.properties[g],C=Pb[g];(C===null||C.includes(m.tagName))&&(m.properties[g]=f(String(w||""),g,m))}}if(m.type==="element"){let g=n?!n.includes(m.tagName):o?o.includes(m.tagName):!1;if(!g&&r&&typeof h=="number"&&(g=!r(m,h,y)),g&&y&&typeof h=="number")return c&&m.children?y.children.splice(h,1,...m.children):y.children.splice(h,1),h}}}function KW(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),a=e.indexOf("/");return t===-1||a!==-1&&t>a||n!==-1&&t>n||r!==-1&&t>r||UW.test(e.slice(0,t))?e:""}function Ek(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,a=n.indexOf(t);for(;a!==-1;)r++,a=n.indexOf(t,a+t.length);return r}function GW(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function XW(e,t,n){const a=Tm((n||{}).ignore||[]),o=QW(t);let l=-1;for(;++l<o.length;)aN(e,"text",c);function c(d,m){let h=-1,y;for(;++h<m.length;){const g=m[h],w=y?y.children:void 0;if(a(g,w?w.indexOf(g):void 0,y))return;y=g}if(y)return f(d,m)}function f(d,m){const h=m[m.length-1],y=o[l][0],g=o[l][1];let w=0;const T=h.children.indexOf(d);let E=!1,R=[];y.lastIndex=0;let k=y.exec(d.value);for(;k;){const M=k.index,D={index:k.index,input:k.input,stack:[...m,d]};let O=g(...k,D);if(typeof O=="string"&&(O=O.length>0?{type:"text",value:O}:void 0),O===!1?y.lastIndex=M+1:(w!==M&&R.push({type:"text",value:d.value.slice(w,M)}),Array.isArray(O)?R.push(...O):O&&R.push(O),w=M+k[0].length,E=!0),!y.global)break;k=y.exec(d.value)}return E?(w<d.value.length&&R.push({type:"text",value:d.value.slice(w)}),h.children.splice(T,1,...R)):R=[d],T+R.length}}function QW(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const a=n[r];t.push([ZW(a[0]),JW(a[1])])}return t}function ZW(e){return typeof e=="string"?new RegExp(GW(e),"g"):e}function JW(e){return typeof e=="function"?e:function(){return e}}const $b="phrasing",Yb=["autolink","link","image","label"];function eK(){return{transforms:[sK],enter:{literalAutolink:nK,literalAutolinkEmail:Wb,literalAutolinkHttp:Wb,literalAutolinkWww:Wb},exit:{literalAutolink:oK,literalAutolinkEmail:aK,literalAutolinkHttp:rK,literalAutolinkWww:iK}}}function tK(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:$b,notInConstruct:Yb},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:$b,notInConstruct:Yb},{character:":",before:"[ps]",after:"\\/",inConstruct:$b,notInConstruct:Yb}]}}function nK(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Wb(e){this.config.enter.autolinkProtocol.call(this,e)}function rK(e){this.config.exit.autolinkProtocol.call(this,e)}function iK(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function aK(e){this.config.exit.autolinkEmail.call(this,e)}function oK(e){this.exit(e)}function sK(e){XW(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,lK],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),cK]],{ignore:["link","linkReference"]})}function lK(e,t,n,r,a){let o="";if(!sN(a)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!uK(n)))return!1;const l=dK(n+r);if(!l[0])return!1;const c={type:"link",title:null,url:o+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[c,{type:"text",value:l[1]}]:c}function cK(e,t,n,r){return!sN(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function uK(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function dK(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const a=Ek(e,"(");let o=Ek(e,")");for(;r!==-1&&a>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function sN(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Qs(n)||Sm(n))&&(!t||n!==47)}lN.peek=xK;function fK(){this.buffer()}function hK(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function pK(){this.buffer()}function mK(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function gK(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ji(this.sliceSerialize(e)).toLowerCase(),n.label=t}function yK(e){this.exit(e)}function bK(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ji(this.sliceSerialize(e)).toLowerCase(),n.label=t}function vK(e){this.exit(e)}function xK(){return"["}function lN(e,t,n,r){const a=n.createTracker(r);let o=a.move("[^");const l=n.enter("footnoteReference"),c=n.enter("reference");return o+=a.move(n.safe(n.associationId(e),{after:"]",before:o})),c(),l(),o+=a.move("]"),o}function wK(){return{enter:{gfmFootnoteCallString:fK,gfmFootnoteCall:hK,gfmFootnoteDefinitionLabelString:pK,gfmFootnoteDefinition:mK},exit:{gfmFootnoteCallString:gK,gfmFootnoteCall:yK,gfmFootnoteDefinitionLabelString:bK,gfmFootnoteDefinition:vK}}}function SK(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:lN},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,a,o,l){const c=o.createTracker(l);let f=c.move("[^");const d=o.enter("footnoteDefinition"),m=o.enter("label");return f+=c.move(o.safe(o.associationId(r),{before:f,after:"]"})),m(),f+=c.move("]:"),r.children&&r.children.length>0&&(c.shift(4),f+=c.move((t?`
438
+ `:" ")+o.indentLines(o.containerFlow(r,c.current()),t?cN:EK))),d(),f}}function EK(e,t,n){return t===0?e:cN(e,t,n)}function cN(e,t,n){return(n?"":" ")+e}const CK=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];uN.peek=OK;function TK(){return{canContainEols:["delete"],enter:{strikethrough:kK},exit:{strikethrough:MK}}}function RK(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:CK}],handlers:{delete:uN}}}function kK(e){this.enter({type:"delete",children:[]},e)}function MK(e){this.exit(e)}function uN(e,t,n,r){const a=n.createTracker(r),o=n.enter("strikethrough");let l=a.move("~~");return l+=n.containerPhrasing(e,{...a.current(),before:l,after:"~"}),l+=a.move("~~"),o(),l}function OK(){return"~"}function AK(e){return e.length}function NK(e,t){const n=t||{},r=(n.align||[]).concat(),a=n.stringLength||AK,o=[],l=[],c=[],f=[];let d=0,m=-1;for(;++m<e.length;){const C=[],T=[];let E=-1;for(e[m].length>d&&(d=e[m].length);++E<e[m].length;){const R=DK(e[m][E]);if(n.alignDelimiters!==!1){const k=a(R);T[E]=k,(f[E]===void 0||k>f[E])&&(f[E]=k)}C.push(R)}l[m]=C,c[m]=T}let h=-1;if(typeof r=="object"&&"length"in r)for(;++h<d;)o[h]=Ck(r[h]);else{const C=Ck(r);for(;++h<d;)o[h]=C}h=-1;const y=[],g=[];for(;++h<d;){const C=o[h];let T="",E="";C===99?(T=":",E=":"):C===108?T=":":C===114&&(E=":");let R=n.alignDelimiters===!1?1:Math.max(1,f[h]-T.length-E.length);const k=T+"-".repeat(R)+E;n.alignDelimiters!==!1&&(R=T.length+R+E.length,R>f[h]&&(f[h]=R),g[h]=R),y[h]=k}l.splice(1,0,y),c.splice(1,0,g),m=-1;const w=[];for(;++m<l.length;){const C=l[m],T=c[m];h=-1;const E=[];for(;++h<d;){const R=C[h]||"";let k="",M="";if(n.alignDelimiters!==!1){const D=f[h]-(T[h]||0),O=o[h];O===114?k=" ".repeat(D):O===99?D%2?(k=" ".repeat(D/2+.5),M=" ".repeat(D/2-.5)):(k=" ".repeat(D/2),M=k):M=" ".repeat(D)}n.delimiterStart!==!1&&!h&&E.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&R==="")&&(n.delimiterStart!==!1||h)&&E.push(" "),n.alignDelimiters!==!1&&E.push(k),E.push(R),n.alignDelimiters!==!1&&E.push(M),n.padding!==!1&&E.push(" "),(n.delimiterEnd!==!1||h!==d-1)&&E.push("|")}w.push(n.delimiterEnd===!1?E.join("").replace(/ +$/,""):E.join(""))}return w.join(`
439
+ `)}function DK(e){return e==null?"":String(e)}function Ck(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function IK(e,t,n,r){const a=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const l=n.indentLines(n.containerFlow(e,o.current()),PK);return a(),l}function PK(e,t,n){return">"+(n?"":" ")+e}function LK(e,t){return Tk(e,t.inConstruct,!0)&&!Tk(e,t.notInConstruct,!1)}function Tk(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Rk(e,t,n,r){let a=-1;for(;++a<n.unsafe.length;)if(n.unsafe[a].character===`
440
+ `&&LK(n.stack,n.unsafe[a]))return/[ \t]/.test(r.before)?"":" ";return`\\
441
+ `}function _K(e,t){const n=String(e);let r=n.indexOf(t),a=r,o=0,l=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===a?++o>l&&(l=o):o=1,a=r+t.length,r=n.indexOf(t,a);return l}function jK(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function zK(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function FK(e,t,n,r){const a=zK(n),o=e.value||"",l=a==="`"?"GraveAccent":"Tilde";if(jK(e,n)){const h=n.enter("codeIndented"),y=n.indentLines(o,BK);return h(),y}const c=n.createTracker(r),f=a.repeat(Math.max(_K(o,a)+1,3)),d=n.enter("codeFenced");let m=c.move(f);if(e.lang){const h=n.enter(`codeFencedLang${l}`);m+=c.move(n.safe(e.lang,{before:m,after:" ",encode:["`"],...c.current()})),h()}if(e.lang&&e.meta){const h=n.enter(`codeFencedMeta${l}`);m+=c.move(" "),m+=c.move(n.safe(e.meta,{before:m,after:`
442
+ `,encode:["`"],...c.current()})),h()}return m+=c.move(`
443
+ `),o&&(m+=c.move(o+`
444
+ `)),m+=c.move(f),d(),m}function BK(e,t,n){return(n?"":" ")+e}function iw(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function HK(e,t,n,r){const a=iw(n),o=a==='"'?"Quote":"Apostrophe",l=n.enter("definition");let c=n.enter("label");const f=n.createTracker(r);let d=f.move("[");return d+=f.move(n.safe(n.associationId(e),{before:d,after:"]",...f.current()})),d+=f.move("]: "),c(),!e.url||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),d+=f.move("<"),d+=f.move(n.safe(e.url,{before:d,after:">",...f.current()})),d+=f.move(">")):(c=n.enter("destinationRaw"),d+=f.move(n.safe(e.url,{before:d,after:e.title?" ":`
445
+ `,...f.current()}))),c(),e.title&&(c=n.enter(`title${o}`),d+=f.move(" "+a),d+=f.move(n.safe(e.title,{before:d,after:a,...f.current()})),d+=f.move(a),c()),l(),d}function UK(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function kd(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Fp(e,t,n){const r=Tc(e),a=Tc(t);return r===void 0?a===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}dN.peek=qK;function dN(e,t,n,r){const a=UK(n),o=n.enter("emphasis"),l=n.createTracker(r),c=l.move(a);let f=l.move(n.containerPhrasing(e,{after:a,before:c,...l.current()}));const d=f.charCodeAt(0),m=Fp(r.before.charCodeAt(r.before.length-1),d,a);m.inside&&(f=kd(d)+f.slice(1));const h=f.charCodeAt(f.length-1),y=Fp(r.after.charCodeAt(0),h,a);y.inside&&(f=f.slice(0,-1)+kd(h));const g=l.move(a);return o(),n.attentionEncodeSurroundingInfo={after:y.outside,before:m.outside},c+f+g}function qK(e,t,n){return n.options.emphasis||"*"}function VK(e,t){let n=!1;return nw(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,rx}),!!((!e.depth||e.depth<3)&&G0(e)&&(t.options.setext||n))}function $K(e,t,n,r){const a=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(VK(e,n)){const m=n.enter("headingSetext"),h=n.enter("phrasing"),y=n.containerPhrasing(e,{...o.current(),before:`
446
+ `,after:`
447
+ `});return h(),m(),y+`
448
+ `+(a===1?"=":"-").repeat(y.length-(Math.max(y.lastIndexOf("\r"),y.lastIndexOf(`
449
+ `))+1))}const l="#".repeat(a),c=n.enter("headingAtx"),f=n.enter("phrasing");o.move(l+" ");let d=n.containerPhrasing(e,{before:"# ",after:`
450
+ `,...o.current()});return/^[\t ]/.test(d)&&(d=kd(d.charCodeAt(0))+d.slice(1)),d=d?l+" "+d:l,n.options.closeAtx&&(d+=" "+l),f(),c(),d}fN.peek=YK;function fN(e){return e.value||""}function YK(){return"<"}hN.peek=WK;function hN(e,t,n,r){const a=iw(n),o=a==='"'?"Quote":"Apostrophe",l=n.enter("image");let c=n.enter("label");const f=n.createTracker(r);let d=f.move("![");return d+=f.move(n.safe(e.alt,{before:d,after:"]",...f.current()})),d+=f.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),d+=f.move("<"),d+=f.move(n.safe(e.url,{before:d,after:">",...f.current()})),d+=f.move(">")):(c=n.enter("destinationRaw"),d+=f.move(n.safe(e.url,{before:d,after:e.title?" ":")",...f.current()}))),c(),e.title&&(c=n.enter(`title${o}`),d+=f.move(" "+a),d+=f.move(n.safe(e.title,{before:d,after:a,...f.current()})),d+=f.move(a),c()),d+=f.move(")"),l(),d}function WK(){return"!"}pN.peek=KK;function pN(e,t,n,r){const a=e.referenceType,o=n.enter("imageReference");let l=n.enter("label");const c=n.createTracker(r);let f=c.move("![");const d=n.safe(e.alt,{before:f,after:"]",...c.current()});f+=c.move(d+"]["),l();const m=n.stack;n.stack=[],l=n.enter("reference");const h=n.safe(n.associationId(e),{before:f,after:"]",...c.current()});return l(),n.stack=m,o(),a==="full"||!d||d!==h?f+=c.move(h+"]"):a==="shortcut"?f=f.slice(0,-1):f+=c.move("]"),f}function KK(){return"!"}mN.peek=GK;function mN(e,t,n){let r=e.value||"",a="`",o=-1;for(;new RegExp("(^|[^`])"+a+"([^`]|$)").test(r);)a+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){const l=n.unsafe[o],c=n.compilePattern(l);let f;if(l.atBreak)for(;f=c.exec(r);){let d=f.index;r.charCodeAt(d)===10&&r.charCodeAt(d-1)===13&&d--,r=r.slice(0,d)+" "+r.slice(f.index+1)}}return a+r+a}function GK(){return"`"}function gN(e,t){const n=G0(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}yN.peek=XK;function yN(e,t,n,r){const a=iw(n),o=a==='"'?"Quote":"Apostrophe",l=n.createTracker(r);let c,f;if(gN(e,n)){const m=n.stack;n.stack=[],c=n.enter("autolink");let h=l.move("<");return h+=l.move(n.containerPhrasing(e,{before:h,after:">",...l.current()})),h+=l.move(">"),c(),n.stack=m,h}c=n.enter("link"),f=n.enter("label");let d=l.move("[");return d+=l.move(n.containerPhrasing(e,{before:d,after:"](",...l.current()})),d+=l.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),d+=l.move("<"),d+=l.move(n.safe(e.url,{before:d,after:">",...l.current()})),d+=l.move(">")):(f=n.enter("destinationRaw"),d+=l.move(n.safe(e.url,{before:d,after:e.title?" ":")",...l.current()}))),f(),e.title&&(f=n.enter(`title${o}`),d+=l.move(" "+a),d+=l.move(n.safe(e.title,{before:d,after:a,...l.current()})),d+=l.move(a),f()),d+=l.move(")"),c(),d}function XK(e,t,n){return gN(e,n)?"<":"["}bN.peek=QK;function bN(e,t,n,r){const a=e.referenceType,o=n.enter("linkReference");let l=n.enter("label");const c=n.createTracker(r);let f=c.move("[");const d=n.containerPhrasing(e,{before:f,after:"]",...c.current()});f+=c.move(d+"]["),l();const m=n.stack;n.stack=[],l=n.enter("reference");const h=n.safe(n.associationId(e),{before:f,after:"]",...c.current()});return l(),n.stack=m,o(),a==="full"||!d||d!==h?f+=c.move(h+"]"):a==="shortcut"?f=f.slice(0,-1):f+=c.move("]"),f}function QK(){return"["}function aw(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function ZK(e){const t=aw(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function JK(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function vN(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function eG(e,t,n,r){const a=n.enter("list"),o=n.bulletCurrent;let l=e.ordered?JK(n):aw(n);const c=e.ordered?l==="."?")":".":ZK(n);let f=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const m=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&m&&(!m.children||!m.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(f=!0),vN(n)===l&&m){let h=-1;for(;++h<e.children.length;){const y=e.children[h];if(y&&y.type==="listItem"&&y.children&&y.children[0]&&y.children[0].type==="thematicBreak"){f=!0;break}}}}f&&(l=c),n.bulletCurrent=l;const d=n.containerFlow(e,r);return n.bulletLastUsed=l,n.bulletCurrent=o,a(),d}function tG(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function nG(e,t,n,r){const a=tG(n);let o=n.bulletCurrent||aw(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let l=o.length+1;(a==="tab"||a==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);const c=n.createTracker(r);c.move(o+" ".repeat(l-o.length)),c.shift(l);const f=n.enter("listItem"),d=n.indentLines(n.containerFlow(e,c.current()),m);return f(),d;function m(h,y,g){return y?(g?"":" ".repeat(l))+h:(g?o:o+" ".repeat(l-o.length))+h}}function rG(e,t,n,r){const a=n.enter("paragraph"),o=n.enter("phrasing"),l=n.containerPhrasing(e,r);return o(),a(),l}const iG=Tm(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function aG(e,t,n,r){return(e.children.some(function(l){return iG(l)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function oG(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}xN.peek=sG;function xN(e,t,n,r){const a=oG(n),o=n.enter("strong"),l=n.createTracker(r),c=l.move(a+a);let f=l.move(n.containerPhrasing(e,{after:a,before:c,...l.current()}));const d=f.charCodeAt(0),m=Fp(r.before.charCodeAt(r.before.length-1),d,a);m.inside&&(f=kd(d)+f.slice(1));const h=f.charCodeAt(f.length-1),y=Fp(r.after.charCodeAt(0),h,a);y.inside&&(f=f.slice(0,-1)+kd(h));const g=l.move(a+a);return o(),n.attentionEncodeSurroundingInfo={after:y.outside,before:m.outside},c+f+g}function sG(e,t,n){return n.options.strong||"*"}function lG(e,t,n,r){return n.safe(e.value,r)}function cG(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function uG(e,t,n){const r=(vN(n)+(n.options.ruleSpaces?" ":"")).repeat(cG(n));return n.options.ruleSpaces?r.slice(0,-1):r}const wN={blockquote:IK,break:Rk,code:FK,definition:HK,emphasis:dN,hardBreak:Rk,heading:$K,html:fN,image:hN,imageReference:pN,inlineCode:mN,link:yN,linkReference:bN,list:eG,listItem:nG,paragraph:rG,root:aG,strong:xN,text:lG,thematicBreak:uG};function dG(){return{enter:{table:fG,tableData:kk,tableHeader:kk,tableRow:pG},exit:{codeText:mG,table:hG,tableData:Kb,tableHeader:Kb,tableRow:Kb}}}function fG(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function hG(e){this.exit(e),this.data.inTable=void 0}function pG(e){this.enter({type:"tableRow",children:[]},e)}function Kb(e){this.exit(e)}function kk(e){this.enter({type:"tableCell",children:[]},e)}function mG(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,gG));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function gG(e,t){return t==="|"?t:e}function yG(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,a=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
451
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:y,table:l,tableCell:f,tableRow:c}};function l(g,w,C,T){return d(m(g,C,T),g.align)}function c(g,w,C,T){const E=h(g,C,T),R=d([E]);return R.slice(0,R.indexOf(`
452
+ `))}function f(g,w,C,T){const E=C.enter("tableCell"),R=C.enter("phrasing"),k=C.containerPhrasing(g,{...T,before:o,after:o});return R(),E(),k}function d(g,w){return NK(g,{align:w,alignDelimiters:r,padding:n,stringLength:a})}function m(g,w,C){const T=g.children;let E=-1;const R=[],k=w.enter("table");for(;++E<T.length;)R[E]=h(T[E],w,C);return k(),R}function h(g,w,C){const T=g.children;let E=-1;const R=[],k=w.enter("tableRow");for(;++E<T.length;)R[E]=f(T[E],g,w,C);return k(),R}function y(g,w,C){let T=wN.inlineCode(g,w,C);return C.stack.includes("tableCell")&&(T=T.replace(/\|/g,"\\$&")),T}}function bG(){return{exit:{taskListCheckValueChecked:Mk,taskListCheckValueUnchecked:Mk,paragraph:xG}}}function vG(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:wG}}}function Mk(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function xG(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const a=t.children;let o=-1,l;for(;++o<a.length;){const c=a[o];if(c.type==="paragraph"){l=c;break}}l===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function wG(e,t,n,r){const a=e.children[0],o=typeof e.checked=="boolean"&&a&&a.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",c=n.createTracker(r);o&&c.move(l);let f=wN.listItem(e,t,n,{...r,...c.current()});return o&&(f=f.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),f;function d(m){return m+l}}function SG(){return[eK(),wK(),TK(),dG(),bG()]}function EG(e){return{extensions:[tK(),SK(e),RK(),yG(e),vG()]}}const CG={tokenize:AG,partial:!0},SN={tokenize:NG,partial:!0},EN={tokenize:DG,partial:!0},CN={tokenize:IG,partial:!0},TG={tokenize:PG,partial:!0},TN={name:"wwwAutolink",tokenize:MG,previous:kN},RN={name:"protocolAutolink",tokenize:OG,previous:MN},Ga={name:"emailAutolink",tokenize:kG,previous:ON},da={};function RG(){return{text:da}}let Ss=48;for(;Ss<123;)da[Ss]=Ga,Ss++,Ss===58?Ss=65:Ss===91&&(Ss=97);da[43]=Ga;da[45]=Ga;da[46]=Ga;da[95]=Ga;da[72]=[Ga,RN];da[104]=[Ga,RN];da[87]=[Ga,TN];da[119]=[Ga,TN];function kG(e,t,n){const r=this;let a,o;return l;function l(h){return!sx(h)||!ON.call(r,r.previous)||ow(r.events)?n(h):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(h))}function c(h){return sx(h)?(e.consume(h),c):h===64?(e.consume(h),f):n(h)}function f(h){return h===46?e.check(TG,m,d)(h):h===45||h===95||xr(h)?(o=!0,e.consume(h),f):m(h)}function d(h){return e.consume(h),a=!0,f}function m(h){return o&&a&&kr(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(h)):n(h)}}function MG(e,t,n){const r=this;return a;function a(l){return l!==87&&l!==119||!kN.call(r,r.previous)||ow(r.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(CG,e.attempt(SN,e.attempt(EN,o),n),n)(l))}function o(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function OG(e,t,n){const r=this;let a="",o=!1;return l;function l(h){return(h===72||h===104)&&MN.call(r,r.previous)&&!ow(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),a+=String.fromCodePoint(h),e.consume(h),c):n(h)}function c(h){if(kr(h)&&a.length<5)return a+=String.fromCodePoint(h),e.consume(h),c;if(h===58){const y=a.toLowerCase();if(y==="http"||y==="https")return e.consume(h),f}return n(h)}function f(h){return h===47?(e.consume(h),o?d:(o=!0,f)):n(h)}function d(h){return h===null||_p(h)||En(h)||Qs(h)||Sm(h)?n(h):e.attempt(SN,e.attempt(EN,m),n)(h)}function m(h){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(h)}}function AG(e,t,n){let r=0;return a;function a(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),a):l===46&&r===3?(e.consume(l),o):n(l)}function o(l){return l===null?n(l):t(l)}}function NG(e,t,n){let r,a,o;return l;function l(d){return d===46||d===95?e.check(CN,f,c)(d):d===null||En(d)||Qs(d)||d!==45&&Sm(d)?f(d):(o=!0,e.consume(d),l)}function c(d){return d===95?r=!0:(a=r,r=void 0),e.consume(d),l}function f(d){return a||r||!o?n(d):t(d)}}function DG(e,t){let n=0,r=0;return a;function a(l){return l===40?(n++,e.consume(l),a):l===41&&r<n?o(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(CN,t,o)(l):l===null||En(l)||Qs(l)?t(l):(e.consume(l),a)}function o(l){return l===41&&r++,e.consume(l),a}}function IG(e,t,n){return r;function r(c){return c===33||c===34||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===63||c===95||c===126?(e.consume(c),r):c===38?(e.consume(c),o):c===93?(e.consume(c),a):c===60||c===null||En(c)||Qs(c)?t(c):n(c)}function a(c){return c===null||c===40||c===91||En(c)||Qs(c)?t(c):r(c)}function o(c){return kr(c)?l(c):n(c)}function l(c){return c===59?(e.consume(c),r):kr(c)?(e.consume(c),l):n(c)}}function PG(e,t,n){return r;function r(o){return e.consume(o),a}function a(o){return xr(o)?n(o):t(o)}}function kN(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||En(e)}function MN(e){return!kr(e)}function ON(e){return!(e===47||sx(e))}function sx(e){return e===43||e===45||e===46||e===95||xr(e)}function ow(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const LG={tokenize:qG,partial:!0};function _G(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:BG,continuation:{tokenize:HG},exit:UG}},text:{91:{name:"gfmFootnoteCall",tokenize:FG},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:jG,resolveTo:zG}}}}function jG(e,t,n){const r=this;let a=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;a--;){const f=r.events[a][1];if(f.type==="labelImage"){l=f;break}if(f.type==="gfmFootnoteCall"||f.type==="labelLink"||f.type==="label"||f.type==="image"||f.type==="link")break}return c;function c(f){if(!l||!l._balanced)return n(f);const d=ji(r.sliceSerialize({start:l.end,end:r.now()}));return d.codePointAt(0)!==94||!o.includes(d.slice(1))?n(f):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),t(f))}}function zG(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},a={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};a.end.column++,a.end.offset++,a.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},a.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},c=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",a,t],["exit",a,t],["enter",o,t],["enter",l,t],["exit",l,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...c),e}function FG(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,l;return c;function c(h){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),f}function f(h){return h!==94?n(h):(e.enter("gfmFootnoteCallMarker"),e.consume(h),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(h){if(o>999||h===93&&!l||h===null||h===91||En(h))return n(h);if(h===93){e.exit("chunkString");const y=e.exit("gfmFootnoteCallString");return a.includes(ji(r.sliceSerialize(y)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(h)}return En(h)||(l=!0),o++,e.consume(h),h===92?m:d}function m(h){return h===91||h===92||h===93?(e.consume(h),o++,d):d(h)}}function BG(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,l=0,c;return f;function f(w){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(w){return w===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",m):n(w)}function m(w){if(l>999||w===93&&!c||w===null||w===91||En(w))return n(w);if(w===93){e.exit("chunkString");const C=e.exit("gfmFootnoteDefinitionLabelString");return o=ji(r.sliceSerialize(C)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),y}return En(w)||(c=!0),l++,e.consume(w),w===92?h:m}function h(w){return w===91||w===92||w===93?(e.consume(w),l++,m):m(w)}function y(w){return w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),a.includes(o)||a.push(o),on(e,g,"gfmFootnoteDefinitionWhitespace")):n(w)}function g(w){return t(w)}}function HG(e,t,n){return e.check(tf,t,e.attempt(LG,t,n))}function UG(e){e.exit("gfmFootnoteDefinition")}function qG(e,t,n){const r=this;return on(e,a,"gfmFootnoteDefinitionIndent",5);function a(o){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(o):n(o)}}function VG(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:a};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function a(l,c){let f=-1;for(;++f<l.length;)if(l[f][0]==="enter"&&l[f][1].type==="strikethroughSequenceTemporary"&&l[f][1]._close){let d=f;for(;d--;)if(l[d][0]==="exit"&&l[d][1].type==="strikethroughSequenceTemporary"&&l[d][1]._open&&l[f][1].end.offset-l[f][1].start.offset===l[d][1].end.offset-l[d][1].start.offset){l[f][1].type="strikethroughSequence",l[d][1].type="strikethroughSequence";const m={type:"strikethrough",start:Object.assign({},l[d][1].start),end:Object.assign({},l[f][1].end)},h={type:"strikethroughText",start:Object.assign({},l[d][1].end),end:Object.assign({},l[f][1].start)},y=[["enter",m,c],["enter",l[d][1],c],["exit",l[d][1],c],["enter",h,c]],g=c.parser.constructs.insideSpan.null;g&&ii(y,y.length,0,Em(g,l.slice(d+1,f),c)),ii(y,y.length,0,[["exit",h,c],["enter",l[f][1],c],["exit",l[f][1],c],["exit",m,c]]),ii(l,d-1,f-d+3,y),f=d+y.length-2;break}}for(f=-1;++f<l.length;)l[f][1].type==="strikethroughSequenceTemporary"&&(l[f][1].type="data");return l}function o(l,c,f){const d=this.previous,m=this.events;let h=0;return y;function y(w){return d===126&&m[m.length-1][1].type!=="characterEscape"?f(w):(l.enter("strikethroughSequenceTemporary"),g(w))}function g(w){const C=Tc(d);if(w===126)return h>1?f(w):(l.consume(w),h++,g);if(h<2&&!n)return f(w);const T=l.exit("strikethroughSequenceTemporary"),E=Tc(w);return T._open=!E||E===2&&!!C,T._close=!C||C===2&&!!E,c(w)}}}class $G{constructor(){this.map=[]}add(t,n,r){YG(this,t,n,r)}consume(t){if(this.map.sort(function(o,l){return o[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let a=r.pop();for(;a;){for(const o of a)t.push(o);a=r.pop()}this.map.length=0}}function YG(e,t,n,r){let a=0;if(!(n===0&&r.length===0)){for(;a<e.map.length;){if(e.map[a][0]===t){e.map[a][1]+=n,e.map[a][2].push(...r);return}a+=1}e.map.push([t,n,r])}}function WG(e,t){let n=!1;const r=[];for(;t<e.length;){const a=e[t];if(n){if(a[0]==="enter")a[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(a[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(a[1].type==="tableDelimiterRow")break}else a[0]==="enter"&&a[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function KG(){return{flow:{null:{name:"table",tokenize:GG,resolveAll:XG}}}}function GG(e,t,n){const r=this;let a=0,o=0,l;return c;function c(F){let W=r.events.length-1;for(;W>-1;){const $=r.events[W][1].type;if($==="lineEnding"||$==="linePrefix")W--;else break}const _=W>-1?r.events[W][1].type:null,V=_==="tableHead"||_==="tableRow"?O:f;return V===O&&r.parser.lazy[r.now().line]?n(F):V(F)}function f(F){return e.enter("tableHead"),e.enter("tableRow"),d(F)}function d(F){return F===124||(l=!0,o+=1),m(F)}function m(F){return F===null?n(F):vt(F)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(F),e.exit("lineEnding"),g):n(F):Kt(F)?on(e,m,"whitespace")(F):(o+=1,l&&(l=!1,a+=1),F===124?(e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),l=!0,m):(e.enter("data"),h(F)))}function h(F){return F===null||F===124||En(F)?(e.exit("data"),m(F)):(e.consume(F),F===92?y:h)}function y(F){return F===92||F===124?(e.consume(F),h):h(F)}function g(F){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(F):(e.enter("tableDelimiterRow"),l=!1,Kt(F)?on(e,w,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):w(F))}function w(F){return F===45||F===58?T(F):F===124?(l=!0,e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),C):D(F)}function C(F){return Kt(F)?on(e,T,"whitespace")(F):T(F)}function T(F){return F===58?(o+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(F),e.exit("tableDelimiterMarker"),E):F===45?(o+=1,E(F)):F===null||vt(F)?M(F):D(F)}function E(F){return F===45?(e.enter("tableDelimiterFiller"),R(F)):D(F)}function R(F){return F===45?(e.consume(F),R):F===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(F),e.exit("tableDelimiterMarker"),k):(e.exit("tableDelimiterFiller"),k(F))}function k(F){return Kt(F)?on(e,M,"whitespace")(F):M(F)}function M(F){return F===124?w(F):F===null||vt(F)?!l||a!==o?D(F):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(F)):D(F)}function D(F){return n(F)}function O(F){return e.enter("tableRow"),A(F)}function A(F){return F===124?(e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),A):F===null||vt(F)?(e.exit("tableRow"),t(F)):Kt(F)?on(e,A,"whitespace")(F):(e.enter("data"),L(F))}function L(F){return F===null||F===124||En(F)?(e.exit("data"),A(F)):(e.consume(F),F===92?q:L)}function q(F){return F===92||F===124?(e.consume(F),L):L(F)}}function XG(e,t){let n=-1,r=!0,a=0,o=[0,0,0,0],l=[0,0,0,0],c=!1,f=0,d,m,h;const y=new $G;for(;++n<e.length;){const g=e[n],w=g[1];g[0]==="enter"?w.type==="tableHead"?(c=!1,f!==0&&(Ok(y,t,f,d,m),m=void 0,f=0),d={type:"table",start:Object.assign({},w.start),end:Object.assign({},w.end)},y.add(n,0,[["enter",d,t]])):w.type==="tableRow"||w.type==="tableDelimiterRow"?(r=!0,h=void 0,o=[0,0,0,0],l=[0,n+1,0,0],c&&(c=!1,m={type:"tableBody",start:Object.assign({},w.start),end:Object.assign({},w.end)},y.add(n,0,[["enter",m,t]])),a=w.type==="tableDelimiterRow"?2:m?3:1):a&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(o[1]!==0&&(l[0]=l[1],h=qh(y,t,o,a,void 0,h),o=[0,0,0,0]),l[2]=n)):w.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(l[0]=l[1],h=qh(y,t,o,a,void 0,h)),o=l,l=[o[1],n,0,0])):w.type==="tableHead"?(c=!0,f=n):w.type==="tableRow"||w.type==="tableDelimiterRow"?(f=n,o[1]!==0?(l[0]=l[1],h=qh(y,t,o,a,n,h)):l[1]!==0&&(h=qh(y,t,l,a,n,h)),a=0):a&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")&&(l[3]=n)}for(f!==0&&Ok(y,t,f,d,m),y.consume(t.events),n=-1;++n<t.events.length;){const g=t.events[n];g[0]==="enter"&&g[1].type==="table"&&(g[1]._align=WG(t.events,n))}return e}function qh(e,t,n,r,a,o){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(o.end=Object.assign({},Yl(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const f=Yl(t.events,n[1]);if(o={type:l,start:Object.assign({},f),end:Object.assign({},f)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const d=Yl(t.events,n[2]),m=Yl(t.events,n[3]),h={type:c,start:Object.assign({},d),end:Object.assign({},m)};if(e.add(n[2],0,[["enter",h,t]]),r!==2){const y=t.events[n[2]],g=t.events[n[3]];if(y[1].end=Object.assign({},g[1].end),y[1].type="chunkText",y[1].contentType="text",n[3]>n[2]+1){const w=n[2]+1,C=n[3]-n[2]-1;e.add(w,C,[])}}e.add(n[3]+1,0,[["exit",h,t]])}return a!==void 0&&(o.end=Object.assign({},Yl(t.events,a)),e.add(a,0,[["exit",o,t]]),o=void 0),o}function Ok(e,t,n,r,a){const o=[],l=Yl(t.events,n);a&&(a.end=Object.assign({},l),o.push(["exit",a,t])),r.end=Object.assign({},l),o.push(["exit",r,t]),e.add(n+1,0,o)}function Yl(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const QG={name:"tasklistCheck",tokenize:JG};function ZG(){return{text:{91:QG}}}function JG(e,t,n){const r=this;return a;function a(f){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(f):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),o)}function o(f){return En(f)?(e.enter("taskListCheckValueUnchecked"),e.consume(f),e.exit("taskListCheckValueUnchecked"),l):f===88||f===120?(e.enter("taskListCheckValueChecked"),e.consume(f),e.exit("taskListCheckValueChecked"),l):n(f)}function l(f){return f===93?(e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),c):n(f)}function c(f){return vt(f)?t(f):Kt(f)?e.check({tokenize:eX},t,n)(f):n(f)}}function eX(e,t,n){return on(e,r,"whitespace");function r(a){return a===null?n(a):t(a)}}function tX(e){return BA([RG(),_G(),VG(e),KG(),ZG()])}const nX={};function rX(e){const t=this,n=e||nX,r=t.data(),a=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);a.push(tX(n)),o.push(SG()),l.push(EG(n))}function iX(e){const t=e.split(`
453
+ `),n=[];let r=[],a=!1;const o=()=>{const l=r.join(`
454
+ `);l.trim()&&n.push(l),r=[]};for(const l of t){if(/^\s*(```|~~~)/.test(l)){a=!a,r.push(l);continue}if(!a&&l.trim()===""){o();continue}r.push(l)}return o(),n}const aX={a:({node:e,...t})=>S.jsx("a",{...t,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline underline-offset-2 break-all"}),pre:({node:e,...t})=>S.jsx("pre",{...t,className:"bg-muted overflow-x-auto rounded-md p-2 font-mono text-xs leading-relaxed"}),code:({node:e,className:t,...n})=>S.jsx("code",{...n,className:Pe("bg-muted rounded px-1 font-mono text-xs",t)}),ul:({node:e,...t})=>S.jsx("ul",{...t,className:"list-disc pl-5"}),ol:({node:e,...t})=>S.jsx("ol",{...t,className:"list-decimal pl-5"}),blockquote:({node:e,...t})=>S.jsx("blockquote",{...t,className:"border-border text-muted-foreground border-l-2 pl-2"}),h1:({node:e,...t})=>S.jsx("h1",{...t,className:"text-base font-semibold"}),h2:({node:e,...t})=>S.jsx("h2",{...t,className:"text-sm font-semibold"}),h3:({node:e,...t})=>S.jsx("h3",{...t,className:"text-sm font-semibold"}),table:({node:e,...t})=>S.jsx("div",{className:"overflow-x-auto",children:S.jsx("table",{...t,className:"border-border w-full border-collapse border text-xs"})}),th:({node:e,...t})=>S.jsx("th",{...t,className:"border-border bg-muted border px-2 py-1 text-left"}),td:({node:e,...t})=>S.jsx("td",{...t,className:"border-border border px-2 py-1"})},oX=v.memo(function({content:t}){return S.jsx(VW,{remarkPlugins:[rX],components:aX,children:t})});function sX({text:e,streaming:t=!1,className:n}){const r=v.useMemo(()=>iX(e),[e]);return S.jsxs("div",{className:Pe("flex min-w-0 flex-col gap-2 text-sm leading-relaxed",n),children:[r.map((a,o)=>S.jsx(oX,{content:a},o)),t&&S.jsx("span",{"data-testid":"agent-streaming-cursor",className:"bg-foreground inline-block h-4 w-2 animate-pulse self-start"})]})}function lX({text:e,streaming:t=!1,className:n}){return S.jsx("div",{"data-testid":"agent-assistant-message",className:Pe("min-w-0 max-w-full self-start",n),children:S.jsx(sX,{text:e,streaming:t})})}function cX(e){const{open:t,defaultOpen:n,onOpenChange:r,disabled:a}=e,o=t!==void 0,[l,c]=Sc({controlled:t,default:n,name:"Collapsible",state:"open"}),{mounted:f,setMounted:d,transitionStatus:m}=Yd(l,!0,!0),[h,y]=v.useState(l),[{height:g,width:w},C]=v.useState({height:void 0,width:void 0}),T=Vi(),[E,R]=v.useState(),k=E??T,[M,D]=v.useState(!1),[O,A]=v.useState(!1),L=v.useRef(null),q=v.useRef(null),F=v.useRef(null),W=v.useRef(null),_=pO(W,!1),V=Ye($=>{const B=!l,j=xt(Ys,$.nativeEvent);if(r(B,j),j.isCanceled)return;const z=W.current;q.current==="css-animation"&&z!=null&&z.style.removeProperty("animation-name"),!M&&!O&&(q.current!=null&&q.current!=="css-animation"&&!f&&B&&d(!0),q.current==="css-animation"&&(!h&&B&&y(!0),!f&&B&&d(!0))),c(B),q.current==="none"&&f&&!B&&d(!1)});return qe(()=>{o&&q.current==="none"&&!O&&!l&&d(!1)},[o,O,l,t,d]),v.useMemo(()=>({abortControllerRef:L,animationTypeRef:q,disabled:a,handleTrigger:V,height:g,mounted:f,open:l,panelId:k,panelRef:W,runOnceAnimationsFinish:_,setDimensions:C,setHiddenUntilFound:D,setKeepMounted:A,setMounted:d,setOpen:c,setPanelIdState:R,setVisible:y,transitionDimensionRef:F,transitionStatus:m,visible:h,width:w}),[L,q,a,V,g,f,l,k,W,_,C,D,A,d,c,y,F,m,h,w])}const AN=v.createContext(void 0);function NN(){const e=v.useContext(AN);if(e===void 0)throw new Error(Cn(15));return e}let dd=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=$s.startingStyle]="startingStyle",e[e.endingStyle=$s.endingStyle]="endingStyle",e})({}),uX=(function(e){return e.panelOpen="data-panel-open",e})({});const dX={[dd.open]:""},fX={[dd.closed]:""},hX={open(e){return e?{[uX.panelOpen]:""}:null}},pX={open(e){return e?dX:fX}},DN={...pX,...Ya},mX=v.forwardRef(function(t,n){const{render:r,className:a,defaultOpen:o=!1,disabled:l=!1,onOpenChange:c,open:f,...d}=t,m=Ye(c),h=cX({open:f,defaultOpen:o,onOpenChange:m,disabled:l}),y=v.useMemo(()=>({open:h.open,disabled:h.disabled,transitionStatus:h.transitionStatus}),[h.open,h.disabled,h.transitionStatus]),g=v.useMemo(()=>({...h,onOpenChange:m,state:y}),[h,m,y]),w=It("div",t,{state:y,ref:n,props:d,stateAttributesMapping:DN});return S.jsx(AN.Provider,{value:g,children:w})}),gX={...hX,...Ya},yX=v.forwardRef(function(t,n){const{panelId:r,open:a,handleTrigger:o,state:l,disabled:c}=NN(),{className:f,disabled:d=c,id:m,render:h,nativeButton:y=!0,...g}=t,{getButtonProps:w,buttonRef:C}=$a({disabled:d,focusableWhenDisabled:!0,native:y}),T=v.useMemo(()=>({"aria-controls":a?r:void 0,"aria-expanded":a,onClick:o}),[r,a,o]);return It("button",t,{state:l,ref:[n,C],props:[T,g,w],stateAttributesMapping:gX})});let bX=(function(e){return e.disabled="data-disabled",e.orientation="data-orientation",e})({});function vX(e){const{abortControllerRef:t,animationTypeRef:n,externalRef:r,height:a,hiddenUntilFound:o,keepMounted:l,id:c,mounted:f,onOpenChange:d,open:m,panelRef:h,runOnceAnimationsFinish:y,setDimensions:g,setMounted:w,setOpen:C,setVisible:T,transitionDimensionRef:E,visible:R,width:k}=e,M=v.useRef(!1),D=v.useRef(null),O=v.useRef(m),A=v.useRef(m),L=$d(),q=v.useMemo(()=>n.current==="css-animation"?!R:!m&&!f,[m,f,R,n]),F=Ye(_=>{if(!_)return;if(n.current==null||E.current==null){const B=getComputedStyle(_),j=B.animationName!=="none"&&B.animationName!=="",z=B.transitionDuration!=="0s"&&B.transitionDuration!=="";j&&z||(B.animationName==="none"&&B.transitionDuration!=="0s"?n.current="css-transition":B.animationName!=="none"&&B.transitionDuration==="0s"?n.current="css-animation":n.current="none"),_.getAttribute(bX.orientation)==="horizontal"||B.transitionProperty.indexOf("width")>-1?E.current="width":E.current="height"}if(n.current!=="css-transition")return;(a===void 0||k===void 0)&&(g({height:_.scrollHeight,width:_.scrollWidth}),A.current&&_.style.setProperty("transition-duration","0s"));let V=-1,$=-1;return V=Fn.request(()=>{A.current=!1,$=Fn.request(()=>{setTimeout(()=>{_.style.removeProperty("transition-duration")})})}),()=>{Fn.cancel(V),Fn.cancel($)}}),W=zi(r,h,F);return qe(()=>{if(n.current!=="css-transition")return;const _=h.current;if(!_)return;let V=-1;if(t.current!=null&&(t.current.abort(),t.current=null),m){const $={"justify-content":_.style.justifyContent,"align-items":_.style.alignItems,"align-content":_.style.alignContent,"justify-items":_.style.justifyItems};Object.keys($).forEach(B=>{_.style.setProperty(B,"initial","important")}),!A.current&&!l&&_.setAttribute(dd.startingStyle,""),g({height:_.scrollHeight,width:_.scrollWidth}),V=Fn.request(()=>{Object.entries($).forEach(([B,j])=>{j===""?_.style.removeProperty(B):_.style.setProperty(B,j)})})}else{if(_.scrollHeight===0&&_.scrollWidth===0)return;g({height:_.scrollHeight,width:_.scrollWidth});const $=new AbortController;t.current=$;const B=$.signal;let j=null;const z=dd.endingStyle;return j=new MutationObserver(H=>{H.some(P=>P.type==="attributes"&&P.attributeName===z)&&(j==null||j.disconnect(),j=null,y(()=>{g({height:0,width:0}),_.style.removeProperty("content-visibility"),w(!1),t.current===$&&(t.current=null)},B))}),j.observe(_,{attributes:!0,attributeFilter:[z]}),()=>{j==null||j.disconnect(),L.cancel(),t.current===$&&($.abort(),t.current=null)}}return()=>{Fn.cancel(V)}},[t,n,L,o,l,f,m,h,y,g,w]),qe(()=>{if(n.current!=="css-animation")return;const _=h.current;_&&(D.current=_.style.animationName||D.current,_.style.setProperty("animation-name","none"),g({height:_.scrollHeight,width:_.scrollWidth}),!O.current&&!M.current&&_.style.removeProperty("animation-name"),m?(t.current!=null&&(t.current.abort(),t.current=null),w(!0),T(!0)):(t.current=new AbortController,y(()=>{w(!1),T(!1),t.current=null},t.current.signal)))},[t,n,m,h,y,g,w,T,R]),om(()=>{const _=Fn.request(()=>{O.current=!1});return()=>Fn.cancel(_)}),qe(()=>{if(!o)return;const _=h.current;if(!_)return;let V=-1,$=-1;return m&&M.current&&(_.style.transitionDuration="0s",g({height:_.scrollHeight,width:_.scrollWidth}),V=Fn.request(()=>{M.current=!1,$=Fn.request(()=>{setTimeout(()=>{_.style.removeProperty("transition-duration")})})})),()=>{Fn.cancel(V),Fn.cancel($)}},[o,m,h,g]),qe(()=>{const _=h.current;_&&o&&q&&(_.setAttribute("hidden","until-found"),n.current==="css-transition"&&_.setAttribute(dd.startingStyle,""))},[o,q,n,h]),v.useEffect(function(){const V=h.current;if(!V)return;function $(B){M.current=!0,C(!0),d(!0,xt(Fi,B))}return V.addEventListener("beforematch",$),()=>{V.removeEventListener("beforematch",$)}},[d,h,C]),v.useMemo(()=>({props:{hidden:q,id:c,ref:W}}),[q,c,W])}let Ak=(function(e){return e.collapsiblePanelHeight="--collapsible-panel-height",e.collapsiblePanelWidth="--collapsible-panel-width",e})({});const xX=v.forwardRef(function(t,n){const{className:r,hiddenUntilFound:a,keepMounted:o,render:l,id:c,...f}=t,{abortControllerRef:d,animationTypeRef:m,height:h,mounted:y,onOpenChange:g,open:w,panelId:C,panelRef:T,runOnceAnimationsFinish:E,setDimensions:R,setHiddenUntilFound:k,setKeepMounted:M,setMounted:D,setPanelIdState:O,setOpen:A,setVisible:L,state:q,transitionDimensionRef:F,visible:W,width:_,transitionStatus:V}=NN(),$=a??!1,B=o??!1;qe(()=>{if(c)return O(c),()=>{O(void 0)}},[c,O]),qe(()=>{k($)},[k,$]),qe(()=>{M(B)},[M,B]);const{props:j}=vX({abortControllerRef:d,animationTypeRef:m,externalRef:n,height:h,hiddenUntilFound:$,id:C,keepMounted:B,mounted:y,onOpenChange:g,open:w,panelRef:T,runOnceAnimationsFinish:E,setDimensions:R,setMounted:D,setOpen:A,setVisible:L,transitionDimensionRef:F,visible:W,width:_});Wa({open:w&&V==="idle",ref:T,onComplete(){w&&R({height:void 0,width:void 0})}});const z=v.useMemo(()=>({...q,transitionStatus:V}),[q,V]),H=It("div",t,{state:z,ref:[n,T],props:[j,{style:{[Ak.collapsiblePanelHeight]:h===void 0?"auto":`${h}px`,[Ak.collapsiblePanelWidth]:_===void 0?"auto":`${_}px`}},f],stateAttributesMapping:DN});return B||$||!B&&y?H:null});function km({...e}){return S.jsx(mX,{"data-slot":"collapsible",...e})}function Mm({...e}){return S.jsx(yX,{"data-slot":"collapsible-trigger",...e})}function Om({...e}){return S.jsx(xX,{"data-slot":"collapsible-content",...e})}function wX({text:e,streaming:t=!1,className:n}){const{t:r}=mn();return S.jsxs(km,{"data-testid":"agent-reasoning-block",className:Pe("min-w-0 max-w-full self-start",n),children:[S.jsxs(Mm,{className:"text-muted-foreground hover:text-foreground group flex items-center gap-1 text-xs",children:[S.jsx(Qd,{className:"size-3 transition-transform group-data-[panel-open]:rotate-90"}),S.jsx(o8,{className:"size-3"}),S.jsx("span",{children:r("agent.reasoning.title")}),t&&S.jsx(Gs,{className:"size-3 animate-spin"})]}),S.jsx(Om,{children:S.jsx("div",{className:"text-muted-foreground border-border mt-1 border-l-2 pl-2 text-xs whitespace-pre-wrap break-words",children:e})})]})}const SX=em("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 Zs({className:e,variant:t="default",render:n,...r}){return Jp({defaultTagName:"span",props:Ti({className:Pe(SX({className:e,variant:t}))},r),render:n,state:{slot:"badge",variant:t}})}function $o(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function lx(e){if(typeof e=="string")return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function EX(e){return $o(e.output)&&typeof e.output.error=="string"?e.output.error:e.isError?lx(e.output):null}function CX(e){switch(e){case"send_input":return S.jsx(V8,{className:"size-3.5"});case"read_screen":return S.jsx(vm,{className:"size-3.5"});case"web_search":return S.jsx(m9,{className:"size-3.5"});case"fetch_url":return S.jsx(L0,{className:"size-3.5"});default:return S.jsx(A9,{className:"size-3.5"})}}function Rc({label:e,text:t}){return S.jsxs(km,{children:[S.jsxs(Mm,{className:"text-muted-foreground hover:text-foreground group flex items-center gap-1 text-xs",children:[S.jsx(Qd,{className:"size-3 transition-transform group-data-[panel-open]:rotate-90"}),S.jsx("span",{children:e})]}),S.jsx(Om,{children:S.jsx("pre",{className:"bg-muted mt-1 max-h-64 overflow-auto rounded-md p-2 font-mono text-xs whitespace-pre-wrap break-all",children:t})})]})}function TX(e){if(typeof e!="string")return null;try{const t=JSON.parse(e);return Array.isArray(t)?t.filter($o).map(n=>({title:typeof n.title=="string"?n.title:"",url:typeof n.url=="string"?n.url:"",snippet:typeof n.snippet=="string"?n.snippet:""})).filter(n=>n.url):null}catch{return null}}function RX({call:e}){const{t}=mn(),n=$o(e.input)?e.input:{},r=typeof n.text=="string"?n.text:"",a=Array.isArray(n.keys)?n.keys.filter(c=>typeof c=="string"):[],o=$o(e.output)?e.output:{},l=typeof o.screenTail=="string"?o.screenTail:"";return S.jsxs("div",{className:"flex flex-col gap-1.5",children:[r&&S.jsx("pre",{className:"bg-muted max-h-40 overflow-auto rounded-md p-2 font-mono text-xs whitespace-pre-wrap break-all",children:r}),a.length>0&&S.jsx("div",{className:"flex flex-wrap items-center gap-1",children:a.map((c,f)=>S.jsx(Zs,{variant:"outline",className:"font-mono",children:c},`${f}-${c}`))}),l&&S.jsx(Rc,{label:t("agent.tool.result"),text:l})]})}function kX({call:e}){const{t}=mn(),n=$o(e.output)?e.output:{},r=typeof n.screen=="string"?n.screen:"";return r?S.jsx(Rc,{label:t("agent.tool.screen"),text:r}):null}function MX({call:e}){const{t}=mn(),n=$o(e.input)?e.input:{},r=typeof n.query=="string"?n.query:"",a=e.resolved&&!e.isError&&!e.denied?TX(e.output):null;return S.jsxs("div",{className:"flex flex-col gap-1.5",children:[r&&S.jsxs("p",{className:"text-muted-foreground text-xs break-words",children:["“",r,"”"]}),a&&a.length>0&&S.jsx("ul",{className:"flex flex-col gap-1",children:a.map(o=>S.jsxs("li",{className:"min-w-0 text-xs",children:[S.jsx("a",{href:o.url,target:"_blank",rel:"noopener noreferrer",className:"text-primary block truncate underline underline-offset-2",title:o.title||o.url,children:o.title||o.url}),o.snippet&&S.jsx("p",{className:"text-muted-foreground line-clamp-2 break-words",children:o.snippet})]},o.url))}),e.resolved&&!e.isError&&!e.denied&&!a&&typeof e.output=="string"&&S.jsx(Rc,{label:t("agent.tool.result"),text:e.output})]})}function OX({call:e}){const{t}=mn(),n=$o(e.input)?e.input:{},r=typeof n.url=="string"?n.url:"",a=typeof e.output=="string"?e.output:"";return S.jsxs("div",{className:"flex flex-col gap-1.5",children:[r&&S.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"text-primary block truncate text-xs underline underline-offset-2",title:r,children:r}),e.resolved&&!e.isError&&!e.denied&&a&&S.jsx(Rc,{label:t("agent.tool.result"),text:a})]})}const AX=/^[A-Za-z0-9+/]{256,}={0,2}$/,NX=/^https?:\/\/\S+\.(png|jpe?g|webp|gif)(\?\S*)?$/i;function DX(e){return typeof e!="string"||e.length===0?null:e.startsWith("data:image/")||NX.test(e)?e:AX.test(e.replace(/\s/g,""))?`data:image/png;base64,${e.replace(/\s/g,"")}`:null}function IX(e){if(!e.resolved||e.isError||e.denied)return[];const t=[],n=(r,a)=>{if(t.length>=8||a>3)return;const o=DX(r);if(o){t.push(o);return}if(Array.isArray(r)){for(const l of r)n(l,a+1);return}if($o(r))for(const l of["result","image","images","url","b64_json","data"])l in r&&n(r[l],a+1)};return n(e.output,0),[...new Set(t)]}function PX({images:e}){return e.length===0?null:S.jsx("div",{className:"flex flex-wrap gap-2",children:e.map((t,n)=>S.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"block",children:S.jsx("img",{src:t,alt:"generated",className:"max-h-64 max-w-full rounded-md border border-border object-contain",loading:"lazy"})},n))})}function LX({call:e,hideOutput:t}){const{t:n}=mn();return S.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.input!==void 0&&S.jsx(Rc,{label:n("agent.tool.input"),text:lx(e.input)}),!t&&e.resolved&&!e.isError&&!e.denied&&e.output!==void 0&&S.jsx(Rc,{label:n("agent.tool.result"),text:lx(e.output)})]})}function _X({call:e,confirmationId:t,onDecide:n,className:r}){const{t:a}=mn(),o=!!t&&!e.resolved,l=e.resolved&&e.denied,c=e.resolved&&!l?EX(e):null,f=!e.resolved&&!o,d=l&&typeof e.output=="string"?e.output:"",m=`agent.tool.${e.toolName}`,h=["send_input","read_screen","web_search","fetch_url"].includes(e.toolName)?a(m):e.toolName,y=IX(e);return S.jsxs("div",{"data-testid":`agent-tool-card-${e.toolCallId}`,"data-tool-name":e.toolName,"data-tool-denied":l||void 0,className:Pe("border-border bg-card flex max-w-full min-w-0 flex-col gap-1.5 self-start rounded-lg border p-2",c!==null&&"border-destructive/50",l&&"opacity-80",r),children:[S.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium",children:[CX(e.toolName),S.jsx("span",{className:"min-w-0 truncate",children:h}),f&&S.jsx(Gs,{className:"text-muted-foreground size-3 animate-spin"}),e.resolved&&!l&&c===null&&S.jsx(Ip,{className:"size-3 text-emerald-500"}),c!==null&&S.jsx(od,{className:"text-destructive size-3"}),l&&S.jsxs("span",{className:"text-destructive flex items-center gap-0.5",children:[S.jsx(Va,{className:"size-3"}),a("agent.tool.denied")]})]}),e.toolName==="send_input"&&S.jsx(RX,{call:e}),e.toolName==="read_screen"&&S.jsx(kX,{call:e}),e.toolName==="web_search"&&S.jsx(MX,{call:e}),e.toolName==="fetch_url"&&S.jsx(OX,{call:e}),!["send_input","read_screen","web_search","fetch_url"].includes(e.toolName)&&S.jsx(LX,{call:e,hideOutput:y.length>0}),S.jsx(PX,{images:y}),c!==null&&S.jsx("p",{className:"text-destructive text-xs break-words whitespace-pre-wrap",children:c}),d&&S.jsx("p",{className:"text-muted-foreground text-xs break-words whitespace-pre-wrap",children:d}),o&&t&&S.jsxs("div",{"data-testid":`agent-tool-approval-${e.toolCallId}`,className:"flex items-center gap-2 pt-1",children:[S.jsx("span",{className:"text-muted-foreground min-w-0 flex-1 text-xs",children:a("agent.confirm.title")}),S.jsxs(Ht,{"data-testid":"agent-confirm-approve",size:"xs",variant:"secondary",onClick:()=>n==null?void 0:n(t,!0),children:[S.jsx(Ip,{}),a("agent.confirm.approve")]}),S.jsxs(Ht,{"data-testid":"agent-confirm-deny",size:"xs",variant:"destructive",onClick:()=>n==null?void 0:n(t,!1),children:[S.jsx(Va,{}),a("agent.confirm.deny")]})]})]})}function jX({text:e,className:t}){return S.jsx("div",{"data-testid":"agent-user-message",className:Pe("bg-primary text-primary-foreground max-w-[85%] self-end rounded-2xl px-3 py-2 text-sm whitespace-pre-wrap break-words",t),children:e})}const zX=48;function FX(){return S.jsxs("div",{"data-testid":"agent-running-indicator",className:"flex items-center gap-1 self-start px-1",children:[S.jsx("span",{className:"bg-muted-foreground size-1.5 animate-pulse rounded-full"}),S.jsx("span",{className:"bg-muted-foreground size-1.5 animate-pulse rounded-full [animation-delay:150ms]"}),S.jsx("span",{className:"bg-muted-foreground size-1.5 animate-pulse rounded-full [animation-delay:300ms]"})]})}function BX({blocks:e,running:t,emptyText:n,confirmationByToolCallId:r,onDecide:a,className:o}){const{t:l}=mn(),c=v.useRef(null),f=v.useRef(!0),[d,m]=v.useState(!1),h=()=>{const g=c.current;g&&(g.scrollTop=g.scrollHeight,f.current=!0,m(!1))};v.useEffect(()=>{if(f.current){const g=c.current;g&&(g.scrollTop=g.scrollHeight)}else m(!0)},[e,t]);const y=()=>{const g=c.current;if(!g)return;const C=g.scrollHeight-g.scrollTop-g.clientHeight<zX;f.current=C,m(!C)};return e.length===0&&!t?S.jsx("div",{"data-testid":"agent-chat-thread",className:Pe("flex min-h-0 flex-1 items-center justify-center p-4",o),children:S.jsx("p",{className:"text-muted-foreground text-sm",children:n})}):S.jsxs("div",{className:Pe("relative min-h-0 flex-1",o),children:[S.jsx("div",{ref:c,"data-testid":"agent-chat-thread",className:"h-full overflow-y-auto p-3",onScroll:y,children:S.jsxs("div",{className:"flex flex-col gap-3",children:[e.map(g=>{switch(g.kind){case"user":return S.jsx(jX,{text:g.text},g.key);case"assistant-text":return S.jsx(lX,{text:g.text,streaming:g.streaming},g.key);case"reasoning":return S.jsx(wX,{text:g.text,streaming:g.streaming},g.key);case"tool-call":return S.jsx(_X,{call:g.call,confirmationId:r.get(g.call.toolCallId),onDecide:a},g.key);default:return null}}),t&&S.jsx(FX,{})]})}),d&&S.jsx(Ht,{"data-testid":"agent-scroll-to-bottom",size:"icon-sm",variant:"secondary",className:"absolute right-3 bottom-3 z-10 rounded-full shadow-md",onClick:h,"aria-label":l("agent.panel.scrollToBottom"),children:S.jsx(J6,{})})]})}const IN=v.createContext(null),PN=v.createContext(null);function fa(){const e=v.useContext(IN);if(e===null)throw new Error(Cn(60));return e}function LN(){const e=v.useContext(PN);if(e===null)throw new Error(Cn(61));return e}const HX=(e,t)=>Object.is(e,t);function kc(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function UX(e,t,n){return!e||e.length===0?!1:e.some(r=>r===void 0?!1:kc(t,r,n))}function fd(e,t,n){return!e||e.length===0?-1:e.findIndex(r=>r===void 0?!1:kc(r,t,n))}function qX(e,t,n){return e.filter(r=>!kc(t,r,n))}function cx(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function _N(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function VX(e){if(!Array.isArray(e))return e!=null&&!("null"in e);if(_N(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 $X(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 cx(e)}function Wl(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?cx(e.value):cx(e)}function jN(e,t,n){function r(){return $X(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??r();if(Array.isArray(t)){const a=_N(t)?t.flatMap(o=>o.items):t;if(e==null||typeof e!="object"){const o=a.find(l=>l.value===e);return o&&o.label!=null?o.label:r()}if("value"in e){const o=a.find(l=>l&&l.value===e.value);if(o&&o.label!=null)return o.label}}return r()}function YX(e,t,n){return e.reduce((r,a,o)=>(o>0&&r.push(", "),r.push(S.jsx(v.Fragment,{children:jN(a,t,n)},o)),r),[])}const St={id:Ge(e=>e.id),modal:Ge(e=>e.modal),multiple:Ge(e=>e.multiple),items:Ge(e=>e.items),itemToStringLabel:Ge(e=>e.itemToStringLabel),itemToStringValue:Ge(e=>e.itemToStringValue),isItemEqualToValue:Ge(e=>e.isItemEqualToValue),value:Ge(e=>e.value),hasSelectedValue:Ge(e=>{const{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:Wl(t,r)!==""}),hasNullItemLabel:Ge((e,t)=>t?VX(e.items):!1),open:Ge(e=>e.open),mounted:Ge(e=>e.mounted),forceMount:Ge(e=>e.forceMount),transitionStatus:Ge(e=>e.transitionStatus),openMethod:Ge(e=>e.openMethod),activeIndex:Ge(e=>e.activeIndex),selectedIndex:Ge(e=>e.selectedIndex),isActive:Ge((e,t)=>e.activeIndex===t),isSelected:Ge((e,t,n)=>{const r=e.isItemEqualToValue,a=e.value;return e.multiple?Array.isArray(a)&&a.some(o=>kc(n,o,r)):e.selectedIndex===t&&e.selectedIndex!==null?!0:kc(n,a,r)}),isSelectedByFocus:Ge((e,t)=>e.selectedIndex===t),popupProps:Ge(e=>e.popupProps),triggerProps:Ge(e=>e.triggerProps),triggerElement:Ge(e=>e.triggerElement),positionerElement:Ge(e=>e.positionerElement),listElement:Ge(e=>e.listElement),scrollUpArrowVisible:Ge(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:Ge(e=>e.scrollDownArrowVisible),hasScrollArrows:Ge(e=>e.hasScrollArrows)};function WX(e){const{id:t,value:n,defaultValue:r=null,onValueChange:a,open:o,defaultOpen:l=!1,onOpenChange:c,name:f,autoComplete:d,disabled:m=!1,readOnly:h=!1,required:y=!1,modal:g=!0,actionsRef:w,inputRef:C,onOpenChangeComplete:T,items:E,multiple:R=!1,itemToStringLabel:k,itemToStringValue:M,isItemEqualToValue:D=HX,highlightItemOnHover:O=!0,children:A}=e,{clearErrors:L}=n0(),{setDirty:q,setTouched:F,setFocused:W,shouldValidateOnChange:_,validityData:V,setFilled:$,name:B,disabled:j,validation:z,validationMode:H}=Dc(),K=cm({id:t}),P=j||m,U=B??f,[G,I]=Sc({controlled:n,default:R?r??Vo:r,name:"Select",state:"value"}),[Q,le]=Sc({controlled:o,default:l,name:"Select",state:"open"}),ae=v.useRef([]),Z=v.useRef([]),ue=v.useRef(null),ve=v.useRef(null),Se=v.useRef(0),Le=v.useRef(null),te=v.useRef([]),he=v.useRef(!1),ye=v.useRef(!1),_e=v.useRef(null),Oe=v.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),Ce=v.useRef(!1),{mounted:Re,setMounted:J,transitionStatus:Ee}=Yd(Q),{openMethod:xe,triggerProps:Be,reset:Ve}=D0(Q),De=nr(()=>new BO({id:K,modal:g,multiple:R,itemToStringLabel:k,itemToStringValue:M,isItemEqualToValue:D,value:G,open:Q,mounted:Re,transitionStatus:Ee,items:E,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,ut=Ct(De,St.activeIndex),pe=Ct(De,St.selectedIndex),Te=Ct(De,St.triggerElement),ee=Ct(De,St.positionerElement),fe=v.useMemo(()=>R&&Array.isArray(G)&&G.length===0?"":Wl(G,M),[R,G,M]),Ae=v.useMemo(()=>R&&Array.isArray(G)?G.map(Je=>Wl(Je,M)):Wl(G,M),[R,G,M]),He=sr(De.state.triggerElement);l0({id:K,commit:z.commit,value:G,controlRef:He,name:U,getValue:()=>Ae});const $e=v.useRef(G);qe(()=>{G!==$e.current&&De.set("forceMount",!0)},[De,G]),qe(()=>{$(R?Array.isArray(G)&&G.length>0:G!=null)},[R,G,$]),qe(function(){if(Q)return;const Mt=te.current;if(R){const ie=Array.isArray(G)?G:[];if(ie.length===0){De.set("selectedIndex",null);return}const de=ie[ie.length-1],ke=fd(Mt,de,D);De.set("selectedIndex",ke===-1?null:ke);return}const X=fd(Mt,G,D);De.set("selectedIndex",X===-1?null:X)},[R,Q,G,te,D,De]),EA(G,()=>{L(U),q(G!==V.initialValue),_()?z.commit(G):z.commit(G,!0)});const et=Ye((Je,Mt)=>{if(c==null||c(Je,Mt),!Mt.isCanceled&&(le(Je),!Je&&(Mt.reason===Ws||Mt.reason===um)&&(F(!0),W(!1),H==="onBlur"&&z.commit(G)),!Je&&De.state.activeIndex!==null)){const X=ae.current[De.state.activeIndex];queueMicrotask(()=>{X==null||X.setAttribute("tabindex","-1")})}}),ze=Ye(()=>{J(!1),De.set("activeIndex",null),Ve(),T==null||T(!1)});Wa({enabled:!w,open:Q,ref:ue,onComplete(){Q||ze()}}),v.useImperativeHandle(w,()=>({unmount:ze}),[ze]);const Ze=Ye((Je,Mt)=>{a==null||a(Je,Mt),!Mt.isCanceled&&I(Je)}),tt=Ye(()=>{const Je=De.state.listElement||ue.current;if(!Je)return;const Mt=Je.scrollTop,X=Je.scrollTop+Je.clientHeight,ie=Mt>1,de=X<Je.scrollHeight-1;De.state.scrollUpArrowVisible!==ie&&De.set("scrollUpArrowVisible",ie),De.state.scrollDownArrowVisible!==de&&De.set("scrollDownArrowVisible",de)}),Tt=UO({open:Q,onOpenChange:et,elements:{reference:Te,floating:ee}}),zt=MO(Tt,{enabled:!h&&!P,event:"mousedown"}),yt=mm(Tt,{bubbles:!1}),At=WO(Tt,{enabled:!h&&!P,listRef:ae,activeIndex:ut,selectedIndex:pe,disabledIndices:Vo,onNavigate(Je){Je===null&&!Q||De.set("activeIndex",Je)},focusItemOnHover:!1}),it=GO(Tt,{enabled:!h&&!P&&(Q||!R),listRef:Z,activeIndex:ut,selectedIndex:pe,onMatch(Je){Q?De.set("activeIndex",Je):Ze(te.current[Je],xt("none"))},onTypingChange(Je){he.current=Je}}),{getReferenceProps:ft,getFloatingProps:bt,getItemProps:Ke}=Kd([zt,yt,At,it]),kt=v.useMemo(()=>Ti(ft(),Be,K?{id:K}:In),[ft,Be,K]);bm(()=>{De.update({popupProps:bt(),triggerProps:kt})}),qe(()=>{De.update({id:K,modal:g,multiple:R,value:G,open:Q,mounted:Re,transitionStatus:Ee,popupProps:bt(),triggerProps:kt,items:E,itemToStringLabel:k,itemToStringValue:M,isItemEqualToValue:D,openMethod:xe})},[De,K,g,R,G,Q,Re,Ee,bt,kt,E,k,M,D,xe]);const _t=v.useMemo(()=>({store:De,name:U,required:y,disabled:P,readOnly:h,multiple:R,itemToStringLabel:k,itemToStringValue:M,highlightItemOnHover:O,setValue:Ze,setOpen:et,listRef:ae,popupRef:ue,scrollHandlerRef:ve,handleScrollArrowVisibility:tt,scrollArrowsMountedCountRef:Se,getItemProps:Ke,events:Tt.context.events,valueRef:Le,valuesRef:te,labelsRef:Z,typingRef:he,selectionRef:Oe,selectedItemTextRef:_e,validation:z,onOpenChangeComplete:T,keyboardActiveRef:ye,alignItemWithTriggerActiveRef:Ce,initialValueRef:$e}),[De,U,y,P,h,R,k,M,O,Ze,et,Ke,Tt.context.events,z,T,tt]),Rt=zi(C,z.inputRef),dn=R&&Array.isArray(G)&&G.length>0,Ut=v.useMemo(()=>!R||!Array.isArray(G)||!U?null:G.map(Je=>{const Mt=Wl(Je,M);return S.jsx("input",{type:"hidden",name:U,value:Mt},Mt)}),[R,G,U,M]);return S.jsx(IN.Provider,{value:_t,children:S.jsxs(PN.Provider,{value:Tt,children:[A,S.jsx("input",{...z.getInputValidationProps({onFocus(){var Je;(Je=De.state.triggerElement)==null||Je.focus({focusVisible:!0})},onChange(Je){if(Je.nativeEvent.defaultPrevented)return;const Mt=Je.target.value,X=xt(Fi,Je.nativeEvent);function ie(){if(R)return;const de=te.current.find(ke=>Wl(ke,M).toLowerCase()===Mt.toLowerCase());de!=null&&(q(de!==V.initialValue),Ze(de,X),_()&&z.commit(de))}De.set("forceMount",!0),queueMicrotask(ie)}}),name:R?void 0:U,autoComplete:d,value:fe,disabled:P,required:y&&!dn,readOnly:h,ref:Rt,style:U?EO:hm,tabIndex:-1,"aria-hidden":!0}),Ut]})})}function zN(e){const t=e.getBoundingClientRect(),n=window.getComputedStyle(e,"::before"),r=window.getComputedStyle(e,"::after");if(!(n.content!=="none"||r.content!=="none"))return t;const o=parseFloat(n.width)||0,l=parseFloat(n.height)||0,c=parseFloat(r.width)||0,f=parseFloat(r.height)||0,d=Math.max(t.width,o,c),m=Math.max(t.height,l,f),h=d-t.width,y=m-t.height;return{left:t.left-h/2,right:t.right+h/2,top:t.top-y/2,bottom:t.bottom+y/2}}const Vh=2,KX=400,Nk=200,GX={...qv,...t0,value:()=>null},XX=v.forwardRef(function(t,n){const{render:r,className:a,id:o,disabled:l=!1,nativeButton:c=!0,...f}=t,{setTouched:d,setFocused:m,validationMode:h,state:y,disabled:g}=Dc(),{labelId:w}=am(),{store:C,setOpen:T,selectionRef:E,validation:R,readOnly:k,required:M,alignItemWithTriggerActiveRef:D,disabled:O,keyboardActiveRef:A}=fa(),L=g||O||l,q=Ct(C,St.open),F=Ct(C,St.value),W=Ct(C,St.triggerProps),_=Ct(C,St.positionerElement),V=Ct(C,St.listElement),$=Ct(C,St.id),B=Ct(C,St.hasSelectedValue),j=!B&&q,z=Ct(C,St.hasNullItemLabel,j),H=o??$;cm({id:H});const K=sr(_),P=v.useRef(null),{getButtonProps:U,buttonRef:G}=$a({disabled:L,native:c}),I=Ye(te=>{C.set("triggerElement",te)}),Q=zi(n,P,G,I),le=Bn(),ae=Bn(),Z=Bn(),ue=Bn();v.useEffect(()=>{if(q)return!(B||z)?Z.start(KX,()=>{E.current.allowUnselectedMouseUp=!0,E.current.allowSelectedMouseUp=!0}):ue.start(Nk,()=>{E.current.allowUnselectedMouseUp=!0,Z.start(Nk,()=>{E.current.allowSelectedMouseUp=!0})}),()=>{Z.clear(),ue.clear()};E.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},ae.clear()},[q,B,z,E,ae,Z,ue]);const ve=v.useMemo(()=>{var te;return(V==null?void 0:V.id)??((te=Ed(_))==null?void 0:te.id)},[V,_]),Se=Ti(W,{id:H,role:"combobox","aria-expanded":q?"true":"false","aria-haspopup":"listbox","aria-controls":q?ve:void 0,"aria-labelledby":w,"aria-readonly":k||void 0,"aria-required":M||void 0,tabIndex:L?-1:0,ref:Q,onFocus(te){m(!0),q&&D.current&&T(!1,xt(Fi,te.nativeEvent)),le.start(0,()=>{C.set("forceMount",!0)})},onBlur(te){Dt(_,te.relatedTarget)||(d(!0),m(!1),h==="onBlur"&&R.commit(F))},onPointerMove(){A.current=!1},onKeyDown(){A.current=!0},onMouseDown(te){if(q)return;const he=Qt(te.currentTarget);function ye(_e){if(!P.current)return;const Oe=_e.target;if(Dt(P.current,Oe)||Dt(K.current,Oe)||Oe===P.current)return;const Ce=zN(P.current);_e.clientX>=Ce.left-Vh&&_e.clientX<=Ce.right+Vh&&_e.clientY>=Ce.top-Vh&&_e.clientY<=Ce.bottom+Vh||T(!1,xt(mO,_e))}ae.start(0,()=>{he.addEventListener("mouseup",ye,{once:!0})})}},R.getValidationProps,f,U);Se.role="combobox";const Le={...y,open:q,disabled:L,value:F,readOnly:k,placeholder:!B};return It("button",t,{ref:[n,P],state:Le,stateAttributesMapping:GX,props:Se})}),QX={value:()=>null},ZX=v.forwardRef(function(t,n){const{className:r,render:a,children:o,placeholder:l,...c}=t,{store:f,valueRef:d}=fa(),m=Ct(f,St.value),h=Ct(f,St.items),y=Ct(f,St.itemToStringLabel),g=Ct(f,St.hasSelectedValue),w=!g&&l!=null&&o==null,C=Ct(f,St.hasNullItemLabel,w),T={value:m,placeholder:!g};let E=null;return typeof o=="function"?E=o(m):o!=null?E=o:!g&&l!=null&&!C?E=l:Array.isArray(m)?E=YX(m,h,y):E=jN(m,h,y),It("span",t,{state:T,ref:[n,d],props:[{children:E},c],stateAttributesMapping:QX})}),JX=v.forwardRef(function(t,n){const{className:r,render:a,...o}=t,{store:l}=fa(),f={open:Ct(l,St.open)};return It("span",t,{state:f,ref:n,props:[{"aria-hidden":!0,children:"▼"},o],stateAttributesMapping:yO})}),eQ=v.createContext(void 0),tQ=v.forwardRef(function(t,n){const{store:r}=fa(),a=Ct(r,St.mounted),o=Ct(r,St.forceMount);return a||o?S.jsx(eQ.Provider,{value:!0,children:S.jsx(p0,{ref:n,...t})}):null}),FN=v.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function nQ(){return v.useContext(FN)}function Am(e){const{children:t,elementsRef:n,labelsRef:r,onMapChange:a}=e,o=Ye(a),l=v.useRef(0),c=nr(iQ).current,f=nr(rQ).current,[d,m]=v.useState(0),h=v.useRef(d),y=Ye((E,R)=>{f.set(E,R??null),h.current+=1,m(h.current)}),g=Ye(E=>{f.delete(E),h.current+=1,m(h.current)}),w=v.useMemo(()=>{const E=new Map;return Array.from(f.keys()).filter(k=>k.isConnected).sort(aQ).forEach((k,M)=>{const D=f.get(k)??{};E.set(k,{...D,index:M})}),E},[f,d]);qe(()=>{if(typeof MutationObserver!="function"||w.size===0)return;const E=new MutationObserver(R=>{const k=new Set,M=D=>k.has(D)?k.delete(D):k.add(D);R.forEach(D=>{D.removedNodes.forEach(M),D.addedNodes.forEach(M)}),k.size===0&&(h.current+=1,m(h.current))});return w.forEach((R,k)=>{k.parentElement&&E.observe(k.parentElement,{childList:!0})}),()=>{E.disconnect()}},[w]),qe(()=>{h.current===d&&(n.current.length!==w.size&&(n.current.length=w.size),r&&r.current.length!==w.size&&(r.current.length=w.size),l.current=w.size),o(w)},[o,w,n,r,d]),qe(()=>()=>{n.current=[]},[n]),qe(()=>()=>{r&&(r.current=[])},[r]);const C=Ye(E=>(c.add(E),()=>{c.delete(E)}));qe(()=>{c.forEach(E=>E(w))},[c,w]);const T=v.useMemo(()=>({register:y,unregister:g,subscribeMapChange:C,elementsRef:n,labelsRef:r,nextIndexRef:l}),[y,g,C,n,r,l]);return S.jsx(FN.Provider,{value:T,children:t})}function rQ(){return new Map}function iQ(){return new Set}function aQ(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 BN=v.createContext(void 0);function sw(){const e=v.useContext(BN);if(!e)throw new Error(Cn(59));return e}function Bp(e,t){e&&Object.assign(e.style,t)}const HN={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},oQ={position:"fixed"},sQ=v.forwardRef(function(t,n){const{anchor:r,positionMethod:a="absolute",className:o,render:l,side:c="bottom",align:f="center",sideOffset:d=0,alignOffset:m=0,collisionBoundary:h="clipping-ancestors",collisionPadding:y,arrowPadding:g=5,sticky:w=!1,disableAnchorTracking:C,alignItemWithTrigger:T=!0,collisionAvoidance:E=C2,...R}=t,{store:k,listRef:M,labelsRef:D,alignItemWithTriggerActiveRef:O,selectedItemTextRef:A,valuesRef:L,initialValueRef:q,popupRef:F,setValue:W}=fa(),_=LN(),V=Ct(k,St.open),$=Ct(k,St.mounted),B=Ct(k,St.modal),j=Ct(k,St.value),z=Ct(k,St.openMethod),H=Ct(k,St.positionerElement),K=Ct(k,St.triggerElement),P=Ct(k,St.isItemEqualToValue),U=Ct(k,St.transitionStatus),G=v.useRef(null),I=v.useRef(null),[Q,le]=v.useState(T),ae=$&&Q&&z!=="touch";!$&&Q!==T&&le(T),qe(()=>{$||(St.scrollUpArrowVisible(k.state)&&k.set("scrollUpArrowVisible",!1),St.scrollDownArrowVisible(k.state)&&k.set("scrollDownArrowVisible",!1))},[k,$]),v.useImperativeHandle(O,()=>ae),N0((ae||B)&&V&&z!=="touch",K);const Z=z0({anchor:r,floatingRootContext:_,positionMethod:a,mounted:$,side:c,sideOffset:d,align:f,alignOffset:m,arrowPadding:g,collisionBoundary:h,collisionPadding:y,sticky:w,disableAnchorTracking:C??ae,collisionAvoidance:E,keepMounted:!0}),ue=ae?"none":Z.side,ve=ae?oQ:Z.positionerStyles,Se=v.useMemo(()=>{const Ce={};return V||(Ce.pointerEvents="none"),{role:"presentation",hidden:!$,style:{...ve,...Ce}}},[V,$,ve]),Le={open:V,side:ue,align:Z.align,anchorHidden:Z.anchorHidden},te=Ye(Ce=>{k.set("positionerElement",Ce)}),he=It("div",t,{ref:[n,te],state:Le,stateAttributesMapping:ua,props:[Se,_c(U),R]}),ye=v.useRef(0),_e=Ye(Ce=>{if(Ce.size===0&&ye.current===0||L.current.length===0)return;const Re=ye.current;if(ye.current=Ce.size,Ce.size===Re)return;const J=xt(Fi);if(Re!==0&&!k.state.multiple&&j!==null&&fd(L.current,j,P)===-1){const xe=q.current,Ve=xe!=null&&fd(L.current,xe,P)!==-1?xe:null;W(Ve,J),Ve===null&&(k.set("selectedIndex",null),A.current=null)}if(Re!==0&&k.state.multiple&&Array.isArray(j)){const Ee=Be=>fd(L.current,Be,P)!==-1,xe=j.filter(Be=>Ee(Be));(xe.length!==j.length||xe.some(Be=>!UX(j,Be,P)))&&(W(xe,J),xe.length===0&&(k.set("selectedIndex",null),A.current=null))}if(V&&ae){k.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const Ee={height:""};Bp(H,Ee),Bp(F.current,Ee)}}),Oe=v.useMemo(()=>({...Z,side:ue,alignItemWithTriggerActive:ae,setControlledAlignItemWithTrigger:le,scrollUpArrowRef:G,scrollDownArrowRef:I}),[Z,ue,ae,le]);return S.jsx(Am,{elementsRef:M,labelsRef:D,onMapChange:_e,children:S.jsxs(BN.Provider,{value:Oe,children:[$&&B&&S.jsx(O0,{inert:M0(!V),cutout:K}),he]})})});function UN(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 $h="base-ui-disable-scrollbar",Md={className:$h,getElement(e){return S.jsx("style",{nonce:e,href:$h,precedence:"base-ui:low",children:`.${$h}{scrollbar-width:none}.${$h}::-webkit-scrollbar{display:none}`})}},lQ=v.createContext(void 0);function qN(e){return v.useContext(lQ)}function Ha(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const cQ=v.createContext(void 0),uQ={disableStyleElements:!1};function VN(){return v.useContext(cQ)??uQ}const Es=1,dQ={...ua,...Ya},fQ=v.forwardRef(function(t,n){const{render:r,className:a,finalFocus:o,...l}=t,{store:c,popupRef:f,onOpenChangeComplete:d,setOpen:m,valueRef:h,selectedItemTextRef:y,keyboardActiveRef:g,multiple:w,handleScrollArrowVisibility:C,scrollHandlerRef:T,highlightItemOnHover:E}=fa(),{side:R,align:k,alignItemWithTriggerActive:M,setControlledAlignItemWithTrigger:D,scrollDownArrowRef:O,scrollUpArrowRef:A}=sw(),L=qN()!=null,q=LN(),{nonce:F,disableStyleElements:W}=VN(),_=Bn(),V=Ct(c,St.id),$=Ct(c,St.open),B=Ct(c,St.mounted),j=Ct(c,St.popupProps),z=Ct(c,St.transitionStatus),H=Ct(c,St.triggerElement),K=Ct(c,St.positionerElement),P=Ct(c,St.listElement),U=v.useRef(0),G=v.useRef(!1),I=v.useRef(0),Q=v.useRef(!1),le=v.useRef({}),ae=$d(),Z=Ye(Le=>{if(!K||!f.current||!Q.current)return;if(G.current||!M){C();return}const te=K.style.top==="0px",he=K.style.bottom==="0px",ye=K.getBoundingClientRect().height,_e=Qt(K),Oe=getComputedStyle(K),Ce=parseFloat(Oe.marginTop),Re=parseFloat(Oe.marginBottom),J=Dk(getComputedStyle(f.current)),Ee=Math.min(_e.documentElement.clientHeight-Ce-Re,J),xe=Le.scrollTop,Be=Ik(Le);let Ve=0,De=null,ut=!1,pe=!1;const Te=fe=>{K.style.height=`${fe}px`},ee=(fe,Ae)=>{const He=Ha(fe,0,Ee-ye);He>0&&Te(ye+He),Le.scrollTop=Ae,Ee-(ye+He)<=Es&&(G.current=!0),C()};if(te){const fe=Be-xe,Ae=ye+fe,He=Math.min(Ae,Ee);if(Ve=He,fe<=Es){ee(fe,Be);return}Ee-He>Es?pe=!0:ut=!0}else if(he){const fe=xe,Ae=ye+fe,He=Math.min(Ae,Ee),$e=Ae-Ee;if(Ve=He,fe<=Es){ee(fe,0);return}Ee-He>Es?De=0:(ut=!0,xe<Be&&(De=xe-(fe-$e)))}if(Ve=Math.ceil(Ve),Ve!==0&&Te(Ve),pe||De!=null){const fe=Ik(Le),Ae=pe?fe:Ha(De,0,fe);Math.abs(Le.scrollTop-Ae)>Es&&(Le.scrollTop=Ae)}(ut||Ve>=Ee-Es)&&(G.current=!0),C()});v.useImperativeHandle(T,()=>Z,[Z]),Wa({open:$,ref:f,onComplete(){$&&(d==null||d(!0))}});const ue={open:$,transitionStatus:z,side:R,align:k};qe(()=>{!K||!f.current||Object.keys(le.current).length||(le.current={top:K.style.top||"0",left:K.style.left||"0",right:K.style.right,height:K.style.height,bottom:K.style.bottom,minHeight:K.style.minHeight,maxHeight:K.style.maxHeight,marginTop:K.style.marginTop,marginBottom:K.style.marginBottom})},[f,K]),qe(()=>{$||M||(Q.current=!1,G.current=!1,U.current=0,I.current=0,Bp(K,le.current))},[$,M,K,f]),qe(()=>{const Le=f.current;if(!(!$||!H||!K||!Le||c.state.transitionStatus==="ending")){if(!M){Q.current=!0,ae.request(C),Le.style.removeProperty("--transform-origin");return}queueMicrotask(()=>{var he;const te=hQ(Le);Le.style.removeProperty("--transform-origin");try{const ye=getComputedStyle(K),_e=getComputedStyle(Le),Oe=Qt(H),Ce=Hn(K),Re=H.getBoundingClientRect(),J=K.getBoundingClientRect(),Ee=Re.left,xe=Re.height,Be=P||Le,Ve=Be.scrollHeight,De=parseFloat(_e.borderBottomWidth),ut=parseFloat(ye.marginTop)||10,pe=parseFloat(ye.marginBottom)||10,Te=parseFloat(ye.minHeight)||100,ee=Dk(_e),fe=5,Ae=5,He=20,$e=Oe.documentElement.clientHeight-ut-pe,et=Oe.documentElement.clientWidth,ze=$e-Re.bottom+xe,Ze=y.current,tt=h.current;let Tt,zt=0,yt=0;if(Ze&&tt){const Mt=tt.getBoundingClientRect();Tt=Ze.getBoundingClientRect();const X=Mt.left-Ee,ie=Tt.left-J.left,de=Mt.top-Re.top+Mt.height/2,ke=Tt.top-J.top+Tt.height/2;zt=X-ie,yt=ke-de}const At=ze+yt+pe+De;let it=Math.min($e,At);const ft=$e-ut-pe,bt=At-it,Ke=Math.max(fe,Ee+zt),kt=et-Ae,_t=Math.max(0,Ke+J.width-kt);K.style.left=`${Ke-_t}px`,K.style.height=`${it}px`,K.style.maxHeight="auto",K.style.marginTop=`${ut}px`,K.style.marginBottom=`${pe}px`,Le.style.height="100%";const Rt=Be.scrollHeight-Be.clientHeight,dn=bt>=Rt;dn&&(it=Math.min($e,J.height)-(bt-Rt));const Ut=Re.top<He||Re.bottom>$e-He||it<Math.min(Ve,Te),Je=(((he=Ce.visualViewport)==null?void 0:he.scale)??1)!==1&&sm;if(Ut||Je){Q.current=!0,Bp(K,le.current),pr.flushSync(()=>D(!1));return}if(dn){const Mt=Math.max(0,$e-At);K.style.top=J.height>=ft?"0":`${Mt}px`,K.style.height=`${it}px`,Be.scrollTop=Be.scrollHeight-Be.clientHeight,U.current=Math.max(Te,it)}else K.style.bottom="0",U.current=Math.max(Te,it),Be.scrollTop=bt;if(Tt){const Mt=J.top,X=J.height,ie=Tt.top+Tt.height/2,de=X>0?(ie-Mt)/X*100:50,ke=Ha(de,0,100);Le.style.setProperty("--transform-origin",`50% ${ke}%`)}(U.current===$e||it>=ee)&&(G.current=!0),C(),setTimeout(()=>{Q.current=!0})}finally{te()}})}},[c,$,K,H,h,y,f,C,M,D,ae,O,A,P]),v.useEffect(()=>{if(!M||!K||!$)return;const Le=Hn(K);function te(he){m(!1,xt(EH,he))}return Le.addEventListener("resize",te),()=>{Le.removeEventListener("resize",te)}},[m,M,K,$]);const ve={...P?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":w||void 0,id:`${V}-list`},onKeyDown(Le){g.current=!0,L&&R0.has(Le.key)&&Le.stopPropagation()},onMouseMove(){g.current=!1},onPointerLeave(Le){if(!E||UN(Le)||Le.pointerType==="touch")return;const te=Le.currentTarget;_.start(0,()=>{c.set("activeIndex",null),te.focus({preventScroll:!0})})},onScroll(Le){P||Z(Le.currentTarget)},...M&&{style:P?{height:"100%"}:HN}},Se=It("div",t,{ref:[n,f],state:ue,stateAttributesMapping:dQ,props:[j,ve,_c(z),{className:!P&&M?Md.className:void 0},l]});return S.jsxs(v.Fragment,{children:[!W&&Md.getElement(F),S.jsx(g0,{context:q,modal:!1,disabled:!B,returnFocus:o,restoreFocus:!0,children:Se})]})});function Dk(e){const t=e.maxHeight||"";return t.endsWith("px")&&parseFloat(t)||1/0}function Ik(e){return Math.max(0,e.scrollHeight-e.clientHeight)}const Pk=[["transform","none"],["scale","1"],["translate","0 0"]];function hQ(e){const{style:t}=e,n={};for(const[r,a]of Pk)n[r]=t.getPropertyValue(r),t.setProperty(r,a,"important");return()=>{for(const[r]of Pk){const a=n[r];a?t.setProperty(r,a):t.removeProperty(r)}}}const pQ=v.forwardRef(function(t,n){const{className:r,render:a,...o}=t,{store:l,scrollHandlerRef:c}=fa(),{alignItemWithTriggerActive:f}=sw(),d=Ct(l,St.hasScrollArrows),m=Ct(l,St.openMethod),h=Ct(l,St.multiple),g={id:`${Ct(l,St.id)}-list`,role:"listbox","aria-multiselectable":h||void 0,onScroll(C){var T;(T=c.current)==null||T.call(c,C.currentTarget)},...f&&{style:HN},className:d&&m!=="touch"?Md.className:void 0},w=Ye(C=>{l.set("listElement",C)});return It("div",t,{ref:[n,w],props:[g,o]})});let $N=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function lw(e={}){const{label:t,metadata:n,textRef:r,indexGuessBehavior:a,index:o}=e,{register:l,unregister:c,subscribeMapChange:f,elementsRef:d,labelsRef:m,nextIndexRef:h}=nQ(),y=v.useRef(-1),[g,w]=v.useState(o??(a===$N.GuessFromOrder?()=>{if(y.current===-1){const E=h.current;h.current+=1,y.current=E}return y.current}:-1)),C=v.useRef(null),T=v.useCallback(E=>{var R;if(C.current=E,g!==-1&&E!==null&&(d.current[g]=E,m)){const k=t!==void 0;m.current[g]=k?t:((R=r==null?void 0:r.current)==null?void 0:R.textContent)??E.textContent}},[g,d,m,t,r]);return qe(()=>{if(o!=null)return;const E=C.current;if(E)return l(E,n),()=>{c(E)}},[o,l,c,n]),qe(()=>{if(o==null)return f(E=>{var k;const R=C.current?(k=E.get(C.current))==null?void 0:k.index:null;R!=null&&w(R)})},[o,f,w]),v.useMemo(()=>({ref:T,index:g}),[g,T])}const YN=v.createContext(void 0);function cw(){const e=v.useContext(YN);if(!e)throw new Error(Cn(57));return e}const mQ=v.memo(v.forwardRef(function(t,n){const{render:r,className:a,value:o=null,label:l,disabled:c=!1,nativeButton:f=!1,...d}=t,m=v.useRef(null),h=lw({label:l,textRef:m,indexGuessBehavior:$N.GuessFromOrder}),{store:y,getItemProps:g,setOpen:w,setValue:C,selectionRef:T,typingRef:E,valuesRef:R,keyboardActiveRef:k,multiple:M,highlightItemOnHover:D}=fa(),O=Bn(),A=Ct(y,St.isActive,h.index),L=Ct(y,St.isSelected,h.index,o),q=Ct(y,St.isSelectedByFocus,h.index),F=Ct(y,St.isItemEqualToValue),W=h.index,_=W!==-1,V=v.useRef(null),$=sr(W);qe(()=>{if(!_)return;const ae=R.current;return ae[W]=o,()=>{delete ae[W]}},[_,W,o,R]),qe(()=>{if(!_)return;const ae=y.state.value;let Z=ae;M&&Array.isArray(ae)&&ae.length>0&&(Z=ae[ae.length-1]),Z!==void 0&&kc(o,Z,F)&&y.set("selectedIndex",W)},[_,W,M,F,y,o]);const B={disabled:c,selected:L,highlighted:A},j=g({active:A,selected:L});j.onFocus=void 0,j.id=void 0;const z=v.useRef(null),H=v.useRef("mouse"),K=v.useRef(!1),{getButtonProps:P,buttonRef:U}=$a({disabled:c,focusableWhenDisabled:!0,native:f});function G(ae){const Z=y.state.value;if(M){const ue=Array.isArray(Z)?Z:[],ve=L?qX(ue,o,F):[...ue,o];C(ve,xt(id,ae))}else C(o,xt(id,ae)),w(!1,xt(id,ae))}const I={role:"option","aria-selected":L,tabIndex:A?0:-1,onFocus(){y.set("activeIndex",W)},onMouseEnter(){!k.current&&y.state.selectedIndex===null&&D&&y.set("activeIndex",W)},onMouseMove(){D&&y.set("activeIndex",W)},onMouseLeave(ae){!D||k.current||UN(ae)||O.start(0,()=>{y.state.activeIndex===W&&y.set("activeIndex",null)})},onTouchStart(){T.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(ae){z.current=ae.key,y.set("activeIndex",W)},onClick(ae){K.current=!1,!(ae.type==="keydown"&&z.current===null)&&(c||z.current===" "&&E.current||H.current!=="touch"&&!A||(z.current=null,G(ae.nativeEvent)))},onPointerEnter(ae){H.current=ae.pointerType},onPointerDown(ae){H.current=ae.pointerType,K.current=!0},onMouseUp(ae){if(c)return;if(K.current){K.current=!1;return}const Z=!T.current.allowSelectedMouseUp&&L,ue=!T.current.allowUnselectedMouseUp&&!L;Z||ue||H.current!=="touch"&&!A||G(ae.nativeEvent)}},Q=It("div",t,{ref:[U,n,h.ref,V],state:B,props:[j,I,d,P]}),le=v.useMemo(()=>({selected:L,indexRef:$,textRef:m,selectedByFocus:q,hasRegistered:_}),[L,$,m,q,_]);return S.jsx(YN.Provider,{value:le,children:Q})})),gQ=v.forwardRef(function(t,n){const r=t.keepMounted??!1,{selected:a}=cw();return r||a?S.jsx(yQ,{...t,ref:n}):null}),yQ=v.memo(v.forwardRef((e,t)=>{const{render:n,className:r,keepMounted:a,...o}=e,{selected:l}=cw(),c=v.useRef(null),{transitionStatus:f,setMounted:d}=Yd(l),h=It("span",e,{ref:[t,c],state:{selected:l,transitionStatus:f},props:[{"aria-hidden":!0,children:"✔️"},o],stateAttributesMapping:Ya});return Wa({open:l,ref:c,onComplete(){l||d(!1)}}),h})),bQ=v.memo(v.forwardRef(function(t,n){const{indexRef:r,textRef:a,selectedByFocus:o,hasRegistered:l}=cw(),{selectedItemTextRef:c}=fa(),{className:f,render:d,...m}=t,h=v.useCallback(g=>{if(!g||!l)return;const w=c.current===null||!c.current.isConnected;(o||w&&r.current===0)&&(c.current=g)},[c,r,o,l]);return It("div",t,{ref:[h,n,a],props:m})})),WN=v.forwardRef(function(t,n){const{render:r,className:a,direction:o,keepMounted:l=!1,...c}=t,{store:f,popupRef:d,listRef:m,handleScrollArrowVisibility:h,scrollArrowsMountedCountRef:y}=fa(),{side:g,scrollDownArrowRef:w,scrollUpArrowRef:C}=sw(),T=o==="up"?St.scrollUpArrowVisible:St.scrollDownArrowVisible,E=Ct(f,T),R=Ct(f,St.openMethod),k=E&&R!=="touch",M=Bn(),D=o==="up"?C:w,{transitionStatus:O,setMounted:A}=Yd(k);qe(()=>(y.current+=1,f.state.hasScrollArrows||f.set("hasScrollArrows",!0),()=>{y.current=Math.max(0,y.current-1),y.current===0&&f.state.hasScrollArrows&&f.set("hasScrollArrows",!1)}),[f,y]),Wa({open:k,ref:D,onComplete(){k||A(!1)}});const F=It("div",t,{ref:[n,D],state:{direction:o,visible:k,side:g,transitionStatus:O},props:[{"aria-hidden":!0,children:o==="up"?"▲":"▼",style:{position:"absolute"},onMouseMove(_){if(_.movementX===0&&_.movementY===0||M.isStarted())return;f.set("activeIndex",null);function V(){var H;const $=f.state.listElement??d.current;if(!$)return;f.set("activeIndex",null),h();const B=$.scrollTop===0,j=Math.round($.scrollTop+$.clientHeight)>=$.scrollHeight;if(m.current.length===0&&(o==="up"?f.set("scrollUpArrowVisible",!B):f.set("scrollDownArrowVisible",!j)),o==="up"&&B||o==="down"&&j){M.clear();return}if((f.state.listElement||d.current)&&m.current&&m.current.length>0){const K=m.current,P=((H=D.current)==null?void 0:H.offsetHeight)||0;if(o==="up"){let U=0;const G=$.scrollTop+P;for(let Q=0;Q<K.length;Q+=1){const le=K[Q];if(le&&le.offsetTop>=G){U=Q;break}}const I=Math.max(0,U-1);if(I<U){const Q=K[I];Q&&($.scrollTop=Math.max(0,Q.offsetTop-P))}else $.scrollTop=0}else{let U=K.length-1;const G=$.scrollTop+$.clientHeight-P;for(let Q=0;Q<K.length;Q+=1){const le=K[Q];if(le&&le.offsetTop+le.offsetHeight>G){U=Math.max(0,Q-1);break}}const I=Math.min(K.length-1,U+1);if(I>U){const Q=K[I];Q&&($.scrollTop=Q.offsetTop+Q.offsetHeight-$.clientHeight+P)}else $.scrollTop=$.scrollHeight-$.clientHeight}}M.start(40,V)}M.start(40,V)},onMouseLeave(){M.clear()}},c]});return k||l?F:null}),vQ=v.forwardRef(function(t,n){return S.jsx(WN,{...t,ref:n,direction:"down"})}),xQ=v.forwardRef(function(t,n){return S.jsx(WN,{...t,ref:n,direction:"up"})}),KN=v.createContext(void 0);function wQ(){const e=v.useContext(KN);if(e===void 0)throw new Error(Cn(56));return e}const SQ=v.forwardRef(function(t,n){const{className:r,render:a,...o}=t,[l,c]=v.useState(),f=v.useMemo(()=>({labelId:l,setLabelId:c}),[l,c]),d=It("div",t,{ref:n,props:[{role:"group","aria-labelledby":l},o]});return S.jsx(KN.Provider,{value:f,children:d})}),EQ=v.forwardRef(function(t,n){const{className:r,render:a,id:o,...l}=t,{setLabelId:c}=wQ(),f=Vi(o);return qe(()=>{c(f)},[f,c]),It("div",t,{ref:n,props:[{id:f},l]})}),up=WX;function CQ({className:e,...t}){return S.jsx(SQ,{"data-slot":"select-group",className:Pe("scroll-my-1 p-1",e),...t})}function Gb({className:e,...t}){return S.jsx(ZX,{"data-slot":"select-value",className:Pe("flex flex-1 text-left",e),...t})}function dp({className:e,size:t="default",children:n,...r}){return S.jsxs(XX,{"data-slot":"select-trigger","data-size":t,className:Pe("border-input data-placeholder:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 gap-1.5 rounded-lg border bg-transparent py-2 pr-2 pl-2.5 text-sm transition-colors select-none focus-visible:ring-2 aria-invalid:ring-2 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:gap-1.5 [&_svg:not([class*='size-'])]:size-4 flex w-fit items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...r,children:[n,S.jsx(JX,{render:S.jsx(aA,{className:"text-muted-foreground size-4 pointer-events-none"})})]})}function fp({className:e,children:t,side:n="bottom",sideOffset:r=4,align:a="center",alignOffset:o=0,alignItemWithTrigger:l=!0,...c}){return S.jsx(tQ,{children:S.jsx(sQ,{side:n,sideOffset:r,align:a,alignOffset:o,alignItemWithTrigger:l,className:"isolate z-50",children:S.jsxs(fQ,{"data-slot":"select-content","data-align-trigger":l,className:Pe("bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 min-w-36 rounded-lg shadow-md ring-1 duration-100 data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 relative isolate z-50 max-h-(--available-height) w-(--anchor-width) origin-(--transform-origin) overflow-x-hidden overflow-y-auto data-[align-trigger=true]:animate-none",e),...c,children:[S.jsx(RQ,{}),S.jsx(pQ,{children:t}),S.jsx(kQ,{})]})})})}function TQ({className:e,...t}){return S.jsx(EQ,{"data-slot":"select-label",className:Pe("text-muted-foreground px-1.5 py-1 text-xs",e),...t})}function La({className:e,children:t,...n}){return S.jsxs(mQ,{"data-slot":"select-item",className:Pe("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:[S.jsx(bQ,{className:"flex flex-1 gap-2 shrink-0 whitespace-nowrap",children:t}),S.jsx(gQ,{render:S.jsx("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center"}),children:S.jsx(Ip,{className:"pointer-events-none"})})]})}function RQ({className:e,...t}){return S.jsx(xQ,{"data-slot":"select-scroll-up-button",className:Pe("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:S.jsx(d8,{})})}function kQ({className:e,...t}){return S.jsx(vQ,{"data-slot":"select-scroll-down-button",className:Pe("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:S.jsx(aA,{})})}const ux="::";function Lk(e,t){return`${e??""}${ux}${t}`}function MQ(e){const t=e.indexOf(ux);return t<0?{providerId:null,modelId:e}:{providerId:e.slice(0,t)||null,modelId:e.slice(t+ux.length)}}function OQ({providerId:e,modelId:t,onChange:n,disabled:r,className:a}){var C;const{t:o}=mn(),{data:l}=Ei({queryKey:["llm-providers"],queryFn:async()=>{const T=await fetch("/api/llm/providers");if(!T.ok)throw new Error("Failed to load providers");return await T.json()},throwOnError:!1}),{data:c}=Ei({queryKey:["llm-settings"],queryFn:async()=>{const T=await fetch("/api/llm/settings");if(!T.ok)throw new Error("Failed to load settings");return await T.json()},throwOnError:!1}),f=((l==null?void 0:l.providers)??[]).filter(T=>T.enabled&&T.models.length>0),d=e??(c==null?void 0:c.settings.defaultProviderId)??null,m=t??(c==null?void 0:c.settings.defaultModelId)??null,h=m?Lk(d,m):"",y=f.some(T=>T.id===d&&T.models.includes(m??"")),g=((C=f.find(T=>T.id===d))==null?void 0:C.name)??null,w=m?g?`${g}/${m}`:m:o("agent.model.placeholder");return S.jsxs(up,{value:h,onValueChange:T=>{if(typeof T!="string"||!T)return;const E=MQ(T);n(E.providerId,E.modelId)},disabled:r||f.length===0,children:[S.jsx(dp,{size:"sm",className:Pe("h-7 w-full min-w-0 border-transparent bg-transparent text-muted-foreground text-xs hover:border-border/40 dark:bg-transparent dark:hover:bg-transparent",a),"data-testid":"agent-model-picker","aria-label":o("agent.model.select"),children:S.jsx("span",{className:"min-w-0 truncate",children:w})}),S.jsxs(fp,{children:[!y&&m&&S.jsx(La,{value:h,className:"text-muted-foreground",children:m}),f.map(T=>S.jsxs(CQ,{children:[S.jsx(TQ,{children:T.name}),T.models.map(E=>S.jsx(La,{value:Lk(T.id,E),children:E},`${T.id}:${E}`))]},T.id))]})]})}function AQ({queued:e,onEdit:t,onWithdraw:n,onSteer:r}){const{t:a}=mn(),[o,l]=v.useState(null),[c,f]=v.useState("");if(e.length===0)return null;const d=h=>{l(h.id),f(h.text)},m=h=>{const y=c.trim();y&&t(h,y),l(null)};return S.jsxs("div",{"data-testid":"agent-queue",className:"bg-muted/50 mx-3 mb-2 flex shrink-0 flex-col gap-1.5 rounded-xl px-2.5 py-2",children:[S.jsxs("div",{className:"flex items-center justify-between",children:[S.jsx("span",{className:"text-muted-foreground text-xs font-medium",children:a("agent.queue.title",{count:e.length})}),S.jsxs(Ht,{"data-testid":"agent-queue-steer",size:"xs",variant:"outline",onClick:r,title:a("agent.queue.steerHint"),children:[S.jsx(uA,{}),a("agent.queue.steer")]})]}),S.jsx("ul",{className:"flex flex-col gap-1",children:e.map(h=>S.jsx("li",{"data-testid":`agent-queue-item-${h.id}`,className:"bg-background/60 flex items-start gap-1.5 rounded-lg px-2 py-1",children:o===h.id?S.jsxs(S.Fragment,{children:[S.jsx(H0,{value:c,onChange:y=>f(y.target.value),onKeyDown:y=>{y.key==="Enter"&&!y.shiftKey&&(y.preventDefault(),m(h.id)),y.key==="Escape"&&l(null)},rows:1,className:"max-h-32 min-h-7 flex-1 resize-none text-xs",autoFocus:!0}),S.jsx(Ht,{size:"icon-sm",variant:"ghost",onClick:()=>m(h.id),"aria-label":a("common.save"),children:S.jsx(Ip,{})})]}):S.jsxs(S.Fragment,{children:[S.jsx("span",{className:"min-w-0 flex-1 truncate text-xs",children:h.text}),S.jsx(Ht,{size:"icon-sm",variant:"ghost",onClick:()=>d(h),"aria-label":a("common.edit"),children:S.jsx(xm,{})}),S.jsx(Ht,{"data-testid":`agent-queue-withdraw-${h.id}`,size:"icon-sm",variant:"ghost",onClick:()=>n(h.id),"aria-label":a("agent.queue.withdraw"),children:S.jsx(Va,{})})]})},h.id))})]})}function NQ({onSend:e,onSteer:t,onStop:n,running:r,steerable:a,disabled:o,modelPicker:l,writeModeControl:c}){const{t:f}=mn(),[d,m]=v.useState(""),h=an(C=>{var T;return((T=C.draft)==null?void 0:T.prompt)??null}),y=v.useRef(null);v.useEffect(()=>{h&&h!==y.current&&(y.current=h,m(h))},[h]);const g=()=>{const C=d.trim();!C||o||(e==null||e(C),m(""))},w=()=>{const C=d.trim();!C||o||(t==null||t(C),m(""))};return S.jsxs("div",{"data-testid":"agent-chat-input",className:"bg-chat-surface flex shrink-0 flex-col gap-2 mx-3 mb-2.5 rounded-xl mt-1.5 focus-within:ring-1 focus-within:ring-ring/30",children:[S.jsx(H0,{"data-testid":"agent-chat-input-textarea",value:d,onChange:C=>m(C.target.value),onKeyDown:C=>{C.key==="Enter"&&!C.shiftKey&&!C.nativeEvent.isComposing&&(C.preventDefault(),g())},placeholder:f("agent.panel.inputPlaceholder"),disabled:o,className:"max-h-40 min-h-[4.5rem] w-full resize-none border-transparent bg-transparent p-3 text-[13px] shadow-none focus-visible:border-transparent focus-visible:ring-0 disabled:bg-transparent dark:bg-transparent dark:disabled:bg-transparent",rows:3}),S.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2 px-2.5 pb-2.5",children:[S.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[c,l&&S.jsx("div",{className:"min-w-0 flex-1",children:l})]}),r?S.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-1.5",children:[a&&S.jsx(Ht,{"data-testid":"agent-chat-steer",size:"icon",variant:"outline",disabled:o||d.trim().length===0,onClick:w,"aria-label":f("agent.queue.steer"),title:f("agent.queue.steerHint"),children:S.jsx(uA,{})}),S.jsx(Ht,{"data-testid":"agent-chat-send",size:"icon",variant:"secondary",disabled:o||d.trim().length===0,onClick:g,"aria-label":f("agent.panel.send"),children:S.jsx(CR,{})}),S.jsx(Ht,{"data-testid":"agent-chat-stop",size:"icon",variant:"destructive",onClick:()=>n==null?void 0:n(),"aria-label":f("agent.panel.stop"),children:S.jsx(w9,{})})]}):S.jsx(Ht,{"data-testid":"agent-chat-send",size:"icon",className:"ml-auto shrink-0",disabled:o||d.trim().length===0,onClick:g,"aria-label":f("agent.panel.send"),children:S.jsx(CR,{})})]})]})}function DQ(e,t,n){var o;if(!e.deviceId||!e.paneId)return null;const r=((o=n==null?void 0:n.find(l=>l.id===e.deviceId))==null?void 0:o.name)??null,a=t[e.deviceId];if(!(a!=null&&a.session))return{label:`${e.paneId}@${r??"?"}`,state:"unknown",windowId:null};for(const l of a.session.windows){const c=l.panes.find(f=>f.id===e.paneId);if(c)return{label:NV({paneIdx:c.index,windowIdx:l.index,paneTitle:c.title,windowName:l.name,windowCustomName:l.customName,deviceName:r}),state:"valid",windowId:l.id}}return{label:`${e.paneId}@${r??"?"}`,state:"invalid",windowId:null}}function IQ(){var ae;const{t:e}=mn(),t=Hd(),n=Bi(Z=>Z.setSidebarTab),r=pj("/devices/:deviceId/windows/:windowId/panes/:paneId"),a=(r==null?void 0:r.params.deviceId)??null,o=(r==null?void 0:r.params.paneId)??null,l=an(Z=>Z.sessions),c=an(Z=>Z.activeSessionId),f=an(Z=>Z.draft),d=an(Z=>Z.activeSessionId?Z.messages[Z.activeSessionId]:void 0),m=an(Z=>Z.activeSessionId?Z.inProgress[Z.activeSessionId]:void 0),h=an(Z=>Z.activeSessionId?Z.pendingConfirmations[Z.activeSessionId]:void 0),y=an(Z=>Z.activeSessionId?Z.sending[Z.activeSessionId]:void 0),g=an(Z=>Z.activeSessionId?Z.queued[Z.activeSessionId]:void 0),w=an(Z=>Z.defaultWriteMode),C=kn(Z=>Z.snapshots),{data:T}=Ei({queryKey:["devices"],queryFn:async()=>{const Z=await fetch("/api/devices");if(!Z.ok)throw new Error("Failed to load devices");return Z.json()},throwOnError:!1});v.useEffect(()=>{const Z=an.getState();Z.ensureInitialized(),Z.loadSessions()},[]);const E=c?l[c]:void 0,R=v.useMemo(()=>{var ue,ve;if(!a||!o)return null;const Z=(ve=(ue=C[a])==null?void 0:ue.session)==null?void 0:ve.windows;for(const Se of Z??[]){const Le=Se.panes.find(te=>te.id===o);if(Le)return Le.title??null}return null},[a,o,C]);v.useEffect(()=>{!E&&!f&&a&&o&&an.getState().startDraft(a,o,R)},[E,f,a,o,R]);const k=v.useMemo(()=>{const Z=new Map;for(const ue of h??[])Z.set(ue.toolCallId,ue.id);return Z},[h]),M=v.useMemo(()=>{const Z=EV(d,m),ue=new Set;for(const Se of Z)Se.kind==="tool-call"&&ue.add(Se.call.toolCallId);const ve=[];for(const Se of h??[])ue.has(Se.toolCallId)||ve.push({kind:"tool-call",key:`confirmation-${Se.id}`,call:{toolCallId:Se.toolCallId,toolName:Se.toolName,input:Se.input,isError:!1,denied:!1,resolved:!1}});return ve.length>0?[...Z,...ve]:Z},[d,m,h]),D=E??(f?{deviceId:f.deviceId,paneId:f.paneId}:null),O=D?DQ(D,C,T==null?void 0:T.devices):null,A=!!(E&&o&&a&&(E.paneId!==o||E.deviceId!==a)),L=(E==null?void 0:E.status)==="running",q=CV(d),F=!!(E&&(!E.deviceId||!((ae=T==null?void 0:T.devices)!=null&&ae.some(Z=>Z.id===E.deviceId))||(O==null?void 0:O.state)==="invalid")),W=g??[],_=(Z,ue)=>{c&&an.getState().decideConfirmation(c,Z,ue)},V=()=>{if(E!=null&&E.deviceId){if((O==null?void 0:O.state)==="valid"&&O.windowId&&E.paneId){t(`/devices/${E.deviceId}/windows/${O.windowId}/panes/${encodeURIComponent(E.paneId)}`);return}(O==null?void 0:O.state)==="unknown"&&t(`/devices/${E.deviceId}`)}},$=()=>{!a||!o||an.getState().startDraft(a,o,R)},B=(Z,ue)=>{E?an.getState().setSessionModel(E.id,Z,ue):f&&an.getState().updateDraft({providerId:Z,modelId:ue})},j=Z=>{const ue=an.getState();if(E){E.status==="running"?ue.enqueueMessage(E.id,Z):ue.sendMessage(E.id,Z);return}f&&(async()=>{const ve=await ue.materializeDraft();ve&&await ue.sendMessage(ve.id,Z)})()},z=Z=>{E&&an.getState().enqueueMessage(E.id,Z,!0)},H=()=>{if(!E)return;const Z=W[0];if(!Z)return;const ue=an.getState();(async()=>(await ue.withdrawQueuedMessage(E.id,Z.id),await ue.enqueueMessage(E.id,Z.text,!0)))()},K=E?E.providerId:(f==null?void 0:f.providerId)??null,P=E?E.modelId:(f==null?void 0:f.modelId)??null,U=!!(E||f),G=!!(f&&!E),I=E?E.writeMode:w,Q=!!(E&&((d==null?void 0:d.length)??0)>0),le=F||!U||(E==null?void 0:E.status)==="waiting_confirmation"||!!y;return S.jsxs("div",{"data-testid":"agent-tab",className:"flex h-full min-h-0 flex-col",children:[S.jsxs("div",{className:"flex shrink-0 items-center gap-2 px-3 py-2",children:[O?S.jsxs("button",{type:"button","data-testid":"agent-binding-chip","data-binding-state":O.state,className:Pe("border-border flex min-w-0 items-center gap-1 rounded-full border px-2 py-0.5 text-xs",E&&O.state==="valid"?"hover:bg-muted cursor-pointer":"text-muted-foreground",O.state==="invalid"&&"opacity-60"),onClick:V,disabled:!E||O.state==="invalid",children:[S.jsx(T9,{className:"size-3 shrink-0"}),S.jsx("span",{className:"min-w-0 truncate",children:O.label}),O.state==="invalid"&&S.jsxs("span",{className:"shrink-0",children:["· ",e("agent.binding.invalid")]})]}):S.jsx("div",{className:"min-w-0 flex-1"}),S.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-1",children:[S.jsx(Ht,{"data-testid":"agent-session-switch",size:"icon-sm",variant:"ghost",onClick:()=>n("panes"),"aria-label":e("agent.session.switch"),title:e("agent.session.switch"),children:S.jsx(Y8,{})}),Q&&S.jsx(Ht,{"data-testid":"agent-session-new",size:"icon-sm",variant:"ghost",disabled:!a||!o,onClick:$,"aria-label":e("agent.session.new"),title:e(!a||!o?"agent.session.selectPaneHint":"agent.session.new"),children:S.jsx(wm,{})})]})]}),F&&S.jsxs("div",{"data-testid":"agent-orphan-banner",className:"bg-muted/50 text-muted-foreground mx-3 mb-1.5 flex shrink-0 items-start gap-2 rounded-lg px-2 py-1.5 text-xs",children:[S.jsx(od,{className:"mt-0.5 size-3.5 shrink-0"}),S.jsx("span",{className:"min-w-0 flex-1",children:e("agent.orphan.readonly")})]}),E&&!F&&A&&S.jsxs("div",{"data-testid":"agent-pane-mismatch",className:"bg-muted/50 mx-3 mb-1.5 flex shrink-0 flex-wrap items-center gap-2 rounded-lg px-2 py-1.5 text-xs",children:[S.jsx(od,{className:"text-muted-foreground size-3.5 shrink-0"}),S.jsx("span",{className:"text-muted-foreground min-w-0 flex-1",children:e("agent.binding.mismatchTitle")}),(O==null?void 0:O.state)==="valid"&&S.jsx(Ht,{"data-testid":"agent-binding-goto",size:"xs",variant:"outline",onClick:V,children:e("agent.binding.goTo")}),o&&S.jsx(Ht,{"data-testid":"agent-binding-rebind",size:"xs",variant:"outline",onClick:()=>{an.getState().rebindPane(E.id,o)},children:e("agent.binding.rebind")})]}),(E==null?void 0:E.status)==="error"&&E.lastError&&S.jsxs("div",{"data-testid":"agent-error-banner",className:"bg-destructive/10 text-destructive mx-3 mb-1.5 flex shrink-0 items-start gap-2 rounded-lg px-2 py-1.5 text-xs",children:[S.jsx(od,{className:"mt-0.5 size-3.5 shrink-0"}),S.jsx("span",{className:"min-w-0 flex-1 break-words",children:E.lastError}),q&&!F&&S.jsx(Ht,{"data-testid":"agent-error-retry",size:"xs",variant:"outline",className:"shrink-0",disabled:!!y,onClick:()=>{an.getState().sendMessage(E.id,q)},children:e("agent.panel.retry")})]}),!G&&S.jsx(BX,{blocks:E?M:[],running:!!L,emptyText:e(U?"agent.panel.empty":"agent.session.selectPaneHint"),confirmationByToolCallId:k,onDecide:_,className:"bg-chat-surface mx-3 mb-2 overflow-hidden rounded-xl"},(E==null?void 0:E.id)??(f?"draft":"none")),E&&!F&&W.length>0&&S.jsx(AQ,{queued:W,onEdit:(Z,ue)=>void an.getState().editQueuedMessage(E.id,Z,ue),onWithdraw:Z=>void an.getState().withdrawQueuedMessage(E.id,Z),onSteer:H}),U&&S.jsxs("div",{className:G?"flex min-h-0 flex-1 flex-col justify-center":"contents",children:[G&&S.jsxs("div",{className:"flex flex-col items-center gap-2 px-6 pb-6 text-center",children:[S.jsx(lA,{className:"text-muted-foreground size-9"}),S.jsx("h3",{className:"text-sm font-medium",children:e("agent.welcome.title")}),S.jsx("p",{className:"text-muted-foreground text-xs",children:e("agent.welcome.subtitle")})]}),S.jsx(NQ,{disabled:le,running:!!L,steerable:!!E,onSend:j,onSteer:z,onStop:()=>{E&&an.getState().stopSession(E.id)},modelPicker:S.jsx(OQ,{providerId:K,modelId:P,onChange:B,disabled:L}),writeModeControl:S.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[S.jsx("span",{className:"text-muted-foreground text-xs",children:e(I==="auto"?"agent.writeMode.auto":"agent.writeMode.confirm")}),S.jsx(Lp,{"data-testid":"agent-write-mode-switch",checked:I==="auto",disabled:!!E&&F,onCheckedChange:Z=>{const ue=Z?"auto":"confirm";an.getState().setDefaultWriteMode(ue),E&&an.getState().setWriteMode(E.id,ue)}})]})})]})]})}const GN=v.createContext(void 0);function Nm(){const e=v.useContext(GN);if(e===void 0)throw new Error(Cn(53));return e}let Hp=(function(e){return e.scrollAreaCornerHeight="--scroll-area-corner-height",e.scrollAreaCornerWidth="--scroll-area-corner-width",e})({});const Yh=500,_k=16;function Si(e,t,n){if(!e)return 0;const r=getComputedStyle(e),a=n==="x"?"Inline":"Block";return n==="x"&&t==="margin"?parseFloat(r[`${t}InlineStart`])*2:parseFloat(r[`${t}${a}Start`])+parseFloat(r[`${t}${a}End`])}let PQ=(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})({}),ql=(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 uw={hasOverflowX:e=>e?{[ql.hasOverflowX]:""}:null,hasOverflowY:e=>e?{[ql.hasOverflowY]:""}:null,overflowXStart:e=>e?{[ql.overflowXStart]:""}:null,overflowXEnd:e=>e?{[ql.overflowXEnd]:""}:null,overflowYStart:e=>e?{[ql.overflowYStart]:""}:null,overflowYEnd:e=>e?{[ql.overflowYEnd]:""}:null,cornerHidden:()=>null},LQ={x:0,y:0},jk={width:0,height:0},_Q={xStart:!1,xEnd:!1,yStart:!1,yEnd:!1},jQ={x:!1,y:!1,corner:!1},zQ=v.forwardRef(function(t,n){const{render:r,className:a,overflowEdgeThreshold:o,...l}=t,c=FQ(o),f=Vi(),d=Bn(),m=Bn(),{nonce:h,disableStyleElements:y}=VN(),[g,w]=v.useState(!1),[C,T]=v.useState(!1),[E,R]=v.useState(!1),[k,M]=v.useState(!1),[D,O]=v.useState(jk),[A,L]=v.useState(jk),[q,F]=v.useState(_Q),[W,_]=v.useState(jQ),V=v.useRef(null),$=v.useRef(null),B=v.useRef(null),j=v.useRef(null),z=v.useRef(null),H=v.useRef(null),K=v.useRef(null),P=v.useRef(!1),U=v.useRef(0),G=v.useRef(0),I=v.useRef(0),Q=v.useRef(0),le=v.useRef("vertical"),ae=v.useRef(LQ),Z=Ye(Ce=>{const Re=Ce.x-ae.current.x,J=Ce.y-ae.current.y;ae.current=Ce,J!==0&&(R(!0),d.start(Yh,()=>{R(!1)})),Re!==0&&(T(!0),m.start(Yh,()=>{T(!1)}))}),ue=Ye(Ce=>{Ce.button===0&&(P.current=!0,U.current=Ce.clientY,G.current=Ce.clientX,le.current=Ce.currentTarget.getAttribute(PQ.orientation),$.current&&(I.current=$.current.scrollTop,Q.current=$.current.scrollLeft),z.current&&le.current==="vertical"&&z.current.setPointerCapture(Ce.pointerId),H.current&&le.current==="horizontal"&&H.current.setPointerCapture(Ce.pointerId))}),ve=Ye(Ce=>{if(!P.current)return;const Re=Ce.clientY-U.current,J=Ce.clientX-G.current;if($.current){const Ee=$.current.scrollHeight,xe=$.current.clientHeight,Be=$.current.scrollWidth,Ve=$.current.clientWidth;if(z.current&&B.current&&le.current==="vertical"){const De=Si(B.current,"padding","y"),ut=Si(z.current,"margin","y"),pe=z.current.offsetHeight,Te=B.current.offsetHeight-pe-De-ut,ee=Re/Te;$.current.scrollTop=I.current+ee*(Ee-xe),Ce.preventDefault(),R(!0),d.start(Yh,()=>{R(!1)})}if(H.current&&j.current&&le.current==="horizontal"){const De=Si(j.current,"padding","x"),ut=Si(H.current,"margin","x"),pe=H.current.offsetWidth,Te=j.current.offsetWidth-pe-De-ut,ee=J/Te;$.current.scrollLeft=Q.current+ee*(Be-Ve),Ce.preventDefault(),T(!0),m.start(Yh,()=>{T(!1)})}}}),Se=Ye(Ce=>{P.current=!1,z.current&&le.current==="vertical"&&z.current.releasePointerCapture(Ce.pointerId),H.current&&le.current==="horizontal"&&H.current.releasePointerCapture(Ce.pointerId)});function Le(Ce){M(Ce.pointerType==="touch")}function te(Ce){if(Le(Ce),Ce.pointerType!=="touch"){const Re=Dt(V.current,Ce.target);w(Re)}}const he=v.useMemo(()=>({scrolling:C||E,hasOverflowX:!W.x,hasOverflowY:!W.y,overflowXStart:q.xStart,overflowXEnd:q.xEnd,overflowYStart:q.yStart,overflowYEnd:q.yEnd,cornerHidden:W.corner}),[C,E,W.x,W.y,W.corner,q]),ye={role:"presentation",onPointerEnter:te,onPointerMove:te,onPointerDown:Le,onPointerLeave(){w(!1)},style:{position:"relative",[Hp.scrollAreaCornerHeight]:`${D.height}px`,[Hp.scrollAreaCornerWidth]:`${D.width}px`}},_e=It("div",t,{state:he,ref:[n,V],props:[ye,l],stateAttributesMapping:uw}),Oe=v.useMemo(()=>({handlePointerDown:ue,handlePointerMove:ve,handlePointerUp:Se,handleScroll:Z,cornerSize:D,setCornerSize:O,thumbSize:A,setThumbSize:L,touchModality:k,cornerRef:K,scrollingX:C,setScrollingX:T,scrollingY:E,setScrollingY:R,hovering:g,setHovering:w,viewportRef:$,rootRef:V,scrollbarYRef:B,scrollbarXRef:j,thumbYRef:z,thumbXRef:H,rootId:f,hiddenState:W,setHiddenState:_,overflowEdges:q,setOverflowEdges:F,viewportState:he,overflowEdgeThreshold:c}),[ue,ve,Se,Z,D,A,k,C,T,E,R,g,w,f,W,q,he,c]);return S.jsxs(GN.Provider,{value:Oe,children:[!y&&Md.getElement(h),_e]})});function FQ(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 BQ=v.createContext(void 0);function HQ(e,t){if(typeof IntersectionObserver>"u")return()=>{};const n=new IntersectionObserver(r=>{r.forEach(a=>{a.intersectionRatio>0&&(t(),n.disconnect())})});return n.observe(e),()=>{n.disconnect()}}let zo=(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 zk=1;function Fk(e,t){if(t<=0)return 0;const n=Ha(e,0,t),r=n,a=t-n,o=r<=zk,l=a<=zk;return o&&l?r<=a?0:t:o?0:l?t:n}let Bk=!1;function UQ(){Bk||sm||(typeof CSS<"u"&&"registerProperty"in CSS&&[zo.scrollAreaOverflowXStart,zo.scrollAreaOverflowXEnd,zo.scrollAreaOverflowYStart,zo.scrollAreaOverflowYEnd].forEach(e=>{try{CSS.registerProperty({name:e,syntax:"<length>",inherits:!1,initialValue:"0px"})}catch{}}),Bk=!0)}const qQ=v.forwardRef(function(t,n){const{render:r,className:a,...o}=t,{viewportRef:l,scrollbarYRef:c,scrollbarXRef:f,thumbYRef:d,thumbXRef:m,cornerRef:h,cornerSize:y,setCornerSize:g,setThumbSize:w,rootId:C,setHiddenState:T,hiddenState:E,handleScroll:R,setHovering:k,setOverflowEdges:M,overflowEdges:D,overflowEdgeThreshold:O,scrollingX:A,scrollingY:L}=Nm(),q=Lc(),F=v.useRef(!0),W=Bn(),_=Bn(),V=Ye(()=>{const K=l.current,P=c.current,U=f.current,G=d.current,I=m.current,Q=h.current;if(!K)return;const le=K.scrollHeight,ae=K.scrollWidth,Z=K.clientHeight,ue=K.clientWidth,ve=K.scrollTop,Se=K.scrollLeft;if(le===0||ae===0)return;const Le=Z>=le,te=ue>=ae,he=ue/ae,ye=Z/le,_e=Math.max(0,ae-ue),Oe=Math.max(0,le-Z);let Ce=0,Re=0;if(!te){let it=0;q==="rtl"?it=Ha(-Se,0,_e):it=Ha(Se,0,_e),Ce=Fk(it,_e),Re=_e-Ce}const J=Le?0:Ha(ve,0,Oe),Ee=Le?0:Fk(J,Oe),xe=Le?0:Oe-Ee,Be=te?0:ue,Ve=Le?0:Z;let De=0,ut=0;!te&&!Le&&(De=(P==null?void 0:P.offsetWidth)||0,ut=(U==null?void 0:U.offsetHeight)||0);const pe=y.width===0&&y.height===0,Te=pe?De:0,ee=pe?ut:0,fe=Si(U,"padding","x"),Ae=Si(P,"padding","y"),He=Si(I,"margin","x"),$e=Si(G,"margin","y"),et=Be-fe-He,ze=Ve-Ae-$e,Ze=U?Math.min(U.offsetWidth-Te,et):et,tt=P?Math.min(P.offsetHeight-ee,ze):ze,Tt=Math.max(_k,Ze*he),zt=Math.max(_k,tt*ye);if(w(it=>it.height===zt&&it.width===Tt?it:{width:Tt,height:zt}),P&&G){const it=P.offsetHeight-zt-Ae-$e,ft=le-Z,bt=ft===0?0:ve/ft,Ke=Math.min(it,Math.max(0,bt*it));G.style.transform=`translate3d(0,${Ke}px,0)`}if(U&&I){const it=U.offsetWidth-Tt-fe-He,ft=ae-ue,bt=ft===0?0:Se/ft,Ke=q==="rtl"?Ha(bt*it,-it,0):Ha(bt*it,0,it);I.style.transform=`translate3d(${Ke}px,0,0)`}const yt=[[zo.scrollAreaOverflowXStart,Ce],[zo.scrollAreaOverflowXEnd,Re],[zo.scrollAreaOverflowYStart,Ee],[zo.scrollAreaOverflowYEnd,xe]];for(const[it,ft]of yt)K.style.setProperty(it,`${ft}px`);Q&&(te||Le?g({width:0,height:0}):!te&&!Le&&g({width:De,height:ut})),T(it=>{const ft=Le||te;return it.y===Le&&it.x===te&&it.corner===ft?it:{y:Le,x:te,corner:ft}});const At={xStart:!te&&Ce>O.xStart,xEnd:!te&&Re>O.xEnd,yStart:!Le&&Ee>O.yStart,yEnd:!Le&&xe>O.yEnd};M(it=>it.xStart===At.xStart&&it.xEnd===At.xEnd&&it.yStart===At.yStart&&it.yEnd===At.yEnd?it:At)});qe(()=>{if(!l.current)return;UQ();let K=!1;return HQ(l.current,()=>{if(!K){K=!0;return}V()})},[V,l]),qe(()=>{queueMicrotask(V)},[V,E,q]),qe(()=>{var K;(K=l.current)!=null&&K.matches(":hover")&&k(!0)},[l,k]),v.useEffect(()=>{const K=l.current;if(typeof ResizeObserver>"u"||!K)return;let P=!1;const U=new ResizeObserver(()=>{if(!P){P=!0;return}V()});return U.observe(K),_.start(0,()=>{const G=K.getAnimations({subtree:!0});G.length!==0&&Promise.allSettled(G.map(I=>I.finished)).then(V).catch(()=>{})}),()=>{U.disconnect(),_.clear()}},[V,l,_]);function $(){F.current=!1}const B={role:"presentation",...C&&{"data-id":`${C}-viewport`},...(!E.x||!E.y)&&{tabIndex:0},className:Md.className,style:{overflow:"scroll"},onScroll(){l.current&&(V(),F.current||R({x:l.current.scrollLeft,y:l.current.scrollTop}),W.start(100,()=>{F.current=!0}))},onWheel:$,onTouchMove:$,onPointerMove:$,onPointerEnter:$,onKeyDown:$},j=v.useMemo(()=>({scrolling:A||L,hasOverflowX:!E.x,hasOverflowY:!E.y,overflowXStart:D.xStart,overflowXEnd:D.xEnd,overflowYStart:D.yStart,overflowYEnd:D.yEnd,cornerHidden:E.corner}),[A,L,E.x,E.y,E.corner,D]),z=It("div",t,{ref:[n,l],state:j,props:[B,o],stateAttributesMapping:uw}),H=v.useMemo(()=>({computeThumbPosition:V}),[V]);return S.jsx(BQ.Provider,{value:H,children:z})}),XN=v.createContext(void 0);function VQ(){const e=v.useContext(XN);if(e===void 0)throw new Error(Cn(54));return e}let Up=(function(e){return e.scrollAreaThumbHeight="--scroll-area-thumb-height",e.scrollAreaThumbWidth="--scroll-area-thumb-width",e})({});const $Q=v.forwardRef(function(t,n){const{render:r,className:a,orientation:o="vertical",keepMounted:l=!1,...c}=t,{hovering:f,scrollingX:d,scrollingY:m,hiddenState:h,overflowEdges:y,scrollbarYRef:g,scrollbarXRef:w,viewportRef:C,thumbYRef:T,thumbXRef:E,handlePointerDown:R,handlePointerUp:k,rootId:M,thumbSize:D}=Nm(),O={hovering:f,scrolling:{horizontal:d,vertical:m}[o],orientation:o,hasOverflowX:!h.x,hasOverflowY:!h.y,overflowXStart:y.xStart,overflowXEnd:y.xEnd,overflowYStart:y.yStart,overflowYEnd:y.yEnd,cornerHidden:h.corner},A=Lc();v.useEffect(()=>{const V=C.current,$=o==="vertical"?g.current:w.current;if(!$)return;function B(j){if(!(!V||!$||j.ctrlKey)){if(j.preventDefault(),o==="vertical"){if(V.scrollTop===0&&j.deltaY<0)return}else if(V.scrollLeft===0&&j.deltaX<0)return;if(o==="vertical"){if(V.scrollTop===V.scrollHeight-V.clientHeight&&j.deltaY>0)return}else if(V.scrollLeft===V.scrollWidth-V.clientWidth&&j.deltaX>0)return;o==="vertical"?V.scrollTop+=j.deltaY:V.scrollLeft+=j.deltaX}}return $.addEventListener("wheel",B,{passive:!1}),()=>{$.removeEventListener("wheel",B)}},[o,w,g,C]);const L={...M&&{"data-id":`${M}-scrollbar`},onPointerDown(V){if(V.button===0&&V.currentTarget===V.target&&C.current){if(T.current&&g.current&&o==="vertical"){const $=Si(T.current,"margin","y"),B=Si(g.current,"padding","y"),j=T.current.offsetHeight,z=g.current.getBoundingClientRect(),H=V.clientY-z.top-j/2-B+$/2,K=C.current.scrollHeight,P=C.current.clientHeight,U=g.current.offsetHeight-j-B-$,I=H/U*(K-P);C.current.scrollTop=I}if(E.current&&w.current&&o==="horizontal"){const $=Si(E.current,"margin","x"),B=Si(w.current,"padding","x"),j=E.current.offsetWidth,z=w.current.getBoundingClientRect(),H=V.clientX-z.left-j/2-B+$/2,K=C.current.scrollWidth,P=C.current.clientWidth,U=w.current.offsetWidth-j-B-$,G=H/U;let I;A==="rtl"?(I=(1-G)*(K-P),C.current.scrollLeft<=0&&(I=-I)):I=G*(K-P),C.current.scrollLeft=I}R(V)}},onPointerUp:k,style:{position:"absolute",touchAction:"none",WebkitUserSelect:"none",userSelect:"none",...o==="vertical"&&{top:0,bottom:`var(${Hp.scrollAreaCornerHeight})`,insetInlineEnd:0,[Up.scrollAreaThumbHeight]:`${D.height}px`},...o==="horizontal"&&{insetInlineStart:0,insetInlineEnd:`var(${Hp.scrollAreaCornerWidth})`,bottom:0,[Up.scrollAreaThumbWidth]:`${D.width}px`}}},q=It("div",t,{ref:[n,o==="vertical"?g:w],state:O,props:[L,c],stateAttributesMapping:uw}),F=v.useMemo(()=>({orientation:o}),[o]),W=o==="vertical"?h.y:h.x;return l||!W?S.jsx(XN.Provider,{value:F,children:q}):null}),YQ=v.forwardRef(function(t,n){const{render:r,className:a,...o}=t,{thumbYRef:l,thumbXRef:c,handlePointerDown:f,handlePointerMove:d,handlePointerUp:m,setScrollingX:h,setScrollingY:y}=Nm(),{orientation:g}=VQ();return It("div",t,{ref:[n,g==="vertical"?l:c],state:{orientation:g},props:[{onPointerDown:f,onPointerMove:d,onPointerUp(T){g==="vertical"&&y(!1),g==="horizontal"&&h(!1),m(T)},style:{...g==="vertical"&&{height:`var(${Up.scrollAreaThumbHeight})`},...g==="horizontal"&&{width:`var(${Up.scrollAreaThumbWidth})`}}},o]})}),WQ=v.forwardRef(function(t,n){const{render:r,className:a,...o}=t,{cornerRef:l,cornerSize:c,hiddenState:f}=Nm(),d=It("div",t,{ref:[n,l],props:[{style:{position:"absolute",bottom:0,insetInlineEnd:0,width:c.width,height:c.height}},o]});return f.corner?null:d});function QN({className:e,children:t,...n}){return S.jsxs(zQ,{"data-slot":"scroll-area",className:Pe("relative",e),...n,children:[S.jsx(qQ,{"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}),S.jsx(KQ,{}),S.jsx(WQ,{})]})}function KQ({className:e,orientation:t="vertical",...n}){return S.jsx($Q,{"data-slot":"scroll-area-scrollbar","data-orientation":t,orientation:t,className:Pe("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:S.jsx(YQ,{"data-slot":"scroll-area-thumb",className:"rounded-full bg-border relative flex-1"})})}function hp(e,t){return`${e}
455
+ ${t}`}const pp=Jd()(B0(e=>({expanded:{},toggle:(t,n)=>e(r=>{const a=hp(t,n),o={...r.expanded};return o[a]?delete o[a]:o[a]=!0,{expanded:o}}),expand:(t,n)=>e(r=>{const a=hp(t,n);return r.expanded[a]?r:{expanded:{...r.expanded,[a]:!0}}}),collapse:(t,n)=>e(r=>{const a=hp(t,n);if(!r.expanded[a])return r;const o={...r.expanded};return delete o[a],{expanded:o}}),pruneRoot:t=>e(n=>{const r=`${t}
456
+ `,a={};for(const o of Object.keys(n.expanded))o.startsWith(r)||(a[o]=n.expanded[o]);return{expanded:a}}),pruneStaleRoots:t=>e(n=>{const r=new Set(t),a={};let o=!1;for(const l of Object.keys(n.expanded)){const c=l.slice(0,l.indexOf(`
457
+ `));r.has(c)?a[l]=n.expanded[l]:o=!0}return o?{expanded:a}:n})}),{name:"tmex-file-tree",partialize:e=>({expanded:e.expanded})}));function GQ(e){const t=new TextEncoder().encode(e);let n="";for(const r of t)n+=String.fromCharCode(r);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function XQ(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.length%4===0?"":"=".repeat(4-t.length%4),r=atob(t+n),a=new Uint8Array(r.length);for(let o=0;o<r.length;o++)a[o]=r.charCodeAt(o);return new TextDecoder().decode(a)}function QQ(e,t){return GQ(`${e}
458
+ ${t}`)}function ZQ(e){try{const t=XQ(e),n=t.indexOf(`
459
+ `);return n<0?null:{rootId:t.slice(0,n),path:t.slice(n+1)}}catch{return null}}function JQ(e,t){return`/file/${QQ(e,t)}`}function dw(e,t,n){const r=new URLSearchParams({rootId:t});return n!=null&&r.set("path",n),`/api/files/${e}?${r.toString()}`}function eZ(e,t,n=!1){const r=new URLSearchParams({rootId:e,path:t});return n&&r.set("download","1"),`/api/files/raw?${r.toString()}`}class tZ extends Error{constructor(n,r,a){super(r);at(this,"status");at(this,"code");this.name="FileApiError",this.status=n,this.code=a}}async function il(e){let t=`HTTP ${e.status}`,n;try{const r=await e.json();r.error&&(t=r.error),n=r.code}catch{}return new tZ(e.status,t,n)}async function nZ(){const e=await fetch("/api/files/roots");if(!e.ok)throw await il(e);return await e.json()}async function Hte(e){const t=await fetch("/api/files/roots",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw await il(t);return await t.json()}async function Ute(e,t){const n=await fetch(`/api/files/roots/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok)throw await il(n);return await n.json()}async function qte(e){const t=await fetch(`/api/files/roots/${encodeURIComponent(e)}`,{method:"DELETE"});if(!t.ok)throw await il(t)}async function rZ(e,t){const n=await fetch(dw("list",e,t));if(!n.ok)throw await il(n);return await n.json()}async function Vte(e,t){const n=await fetch(dw("stat",e,t));if(!n.ok)throw await il(n);return await n.json()}async function $te(e,t){const n=await fetch(dw("content",e,t));if(!n.ok)throw await il(n);return await n.json()}const iZ=new Set(["json","jsonc","json5"]);function ZN(e,t){if(e.type==="dir"||e.category==="directory")return t!=null&&t.expanded?_8:z8;const n=e.name.toLowerCase().split(".").pop()??"";switch(e.category){case"code":return iZ.has(n)?w8:E8;case"markdown":return Eb;case"image":return k8;case"pdf":return Eb;case"archive":return v8;case"audio":return T8;case"video":return O8;case"text":return Eb;default:return D8}}function JN(e){switch(e){case"directory":return"text-muted-foreground";case"code":return"text-blue-500/80 dark:text-blue-400/80";case"markdown":return"text-foreground/70";case"image":return"text-emerald-500/80 dark:text-emerald-400/80";case"pdf":return"text-red-500/70 dark:text-red-400/70";case"archive":return"text-amber-500/80 dark:text-amber-400/80";case"audio":return"text-purple-500/70 dark:text-purple-400/70";case"video":return"text-pink-500/70 dark:text-pink-400/70";default:return"text-muted-foreground"}}function Yte(e){return e}function fw(e){return encodeURIComponent(e)}const aZ=12e3,oZ=12e3,sZ=120;let Xb=!1;function lZ(e){var n,r;const t=((r=(n=kn.getState().snapshots[e])==null?void 0:n.session)==null?void 0:r.windows)??[];return new Set(t.map(a=>a.id))}function cZ(e,t){var r,a;const n=((a=(r=kn.getState().snapshots[e])==null?void 0:r.session)==null?void 0:a.windows)??[];for(const o of n)if(!t.has(o.id)&&o.panes.length>0){const l=o.panes.find(c=>c.active)??o.panes[0];return{windowId:o.id,paneId:l.id,paneTitle:l.title??null}}return null}async function Hk(e,t){const n=Date.now();for(;Date.now()-n<t;){const r=e();if(r)return r;await new Promise(a=>setTimeout(a,sZ))}return null}function uZ(e,t){return hn.t("files.install.prompt",{device:e,scope:t?hn.t("files.install.scopeRemote"):hn.t("files.install.scopeLocal")})}async function dZ(e,t){if(!Xb){Xb=!0;try{const n=kn.getState();if(!n.connectedDevices.has(e)&&(n.connectDevice(e),!await Hk(()=>{var l;return(l=kn.getState().snapshots[e])!=null&&l.session?!0:null},aZ))){sn.error(hn.t("files.install.connectFailed"));return}const r=lZ(e);n.createWindow(e);const a=await Hk(()=>cZ(e,r),oZ);if(!a){sn.error(hn.t("files.install.windowFailed"));return}an.getState().startDraft(e,a.paneId,a.paneTitle,t),Iq(`/devices/${e}/windows/${a.windowId}/panes/${fw(a.paneId)}`,{replace:!0}),Bi.getState().setSidebarTab("agent"),Pq()}finally{Xb=!1}}}const eD=12,fZ=2e3,hZ=3e4;function pZ(e){const t=e.lastIndexOf("/");return t<=0?"/":e.slice(0,t)}function mZ(){const e=qi();return v.useMemo(()=>{const t=Us("/file/:ref",e.pathname);return t!=null&&t.params.ref?ZQ(t.params.ref):null},[e.pathname])}function gZ(e){return`files.error.${e??"unknown"}`}function yZ(){var m,h,y;const{t:e}=mn(),t=el(),n=VL({queryKey:["files"]}),r=pp(g=>g.pruneStaleRoots),a=Ei({queryKey:["files","roots"],queryFn:nZ,refetchOnWindowFocus:!0}),o=Ei({queryKey:["devices"],queryFn:async()=>{const g=await fetch("/api/devices");if(!g.ok)throw new Error("devices");return await g.json()}}),l=Ei({queryKey:["llm-providers"],queryFn:async()=>{const g=await fetch("/api/llm/providers");if(!g.ok)throw new Error("providers");return await g.json()},throwOnError:!1}),c=v.useMemo(()=>{var g;return(((g=a.data)==null?void 0:g.roots)??[]).filter(w=>w.enabled)},[a.data]);v.useEffect(()=>{a.data&&r(a.data.roots.map(g=>g.id))},[a.data,r]);const f={llmConfigured:(((m=l.data)==null?void 0:m.providers)??[]).length>0,localDeviceId:((y=(h=o.data)==null?void 0:h.devices.find(g=>g.type==="local"))==null?void 0:y.id)??null},d=()=>void t.invalidateQueries({queryKey:["files"]});return S.jsxs(F0,{className:"flex min-h-0 flex-1 flex-col pt-0","data-testid":"files-tab",children:[S.jsxs("div",{className:"flex items-center justify-between gap-2 px-2 pb-1.5",children:[S.jsx("span",{className:"truncate text-xs font-medium text-muted-foreground",children:e("files.title")}),S.jsx(Ht,{variant:"ghost",size:"icon-xs",onClick:d,title:e("files.refresh"),"data-testid":"files-refresh",children:S.jsx(sA,{className:Pe("h-3.5 w-3.5",n>0&&"animate-spin")})})]}),S.jsx(QN,{className:"min-h-0 flex-1",children:S.jsxs("div",{className:"space-y-0.5 pr-1 pb-2 select-none [-webkit-touch-callout:none] [-webkit-user-select:none]",children:[c.map(g=>S.jsx(tD,{root:g,rootId:g.id,path:g.path,depth:0,isRoot:!0,ctx:f},g.id)),a.isLoading&&S.jsx("div",{className:"px-2 py-3 text-center text-xs text-muted-foreground",children:e("common.loading")}),!a.isLoading&&c.length===0&&S.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:e("files.noRoots")})]})})]})}function bZ({root:e}){const t=e.deviceType==="ssh"?L0:vm;return S.jsxs("span",{className:"flex shrink-0 items-center gap-1 text-[10px] text-muted-foreground/70",children:[S.jsx(t,{className:"h-3 w-3"}),S.jsx("span",{className:"max-w-24 truncate",children:e.deviceName??"—"})]})}function tD({root:e,rootId:t,path:n,depth:r,isRoot:a,ctx:o}){var T,E,R;const{t:l}=mn(),c=hp(t,n),f=pp(k=>!!k.expanded[c]),d=pp(k=>k.toggle),m=Ei({queryKey:["files","list",t,n],queryFn:()=>rZ(t,n),enabled:f,staleTime:fZ,retry:!1,refetchOnWindowFocus:!0,refetchInterval:k=>k.state.status==="error"?!1:hZ,refetchIntervalInBackground:!1}),h=(T=m.error)==null?void 0:T.code,y=v.useRef(null);v.useEffect(()=>{if(!(h==="rsync_missing_local"||h==="rsync_missing_remote")){y.current=null;return}if(y.current===c)return;y.current=c;const M=h==="rsync_missing_remote",D=M||e.deviceType==="local"?e.deviceId:o.localDeviceId,O=`rsync-missing-${c}`;sn.error(l(gZ(h)),{id:O,description:e.deviceName?`${e.deviceName}`:void 0,action:o.llmConfigured&&D?{label:l("files.install.button"),onClick:()=>{sn.dismiss(O),dZ(D,uZ(e.deviceName??e.deviceId,M))}}:void 0})},[h,c,e,o.llmConfigured,o.localDeviceId,l]),v.useEffect(()=>{if(!m.data)return;const k=new Set(m.data.entries.filter(O=>O.type==="dir").map(O=>O.path)),M=pp.getState(),D=`${t}
460
+ `;for(const O of Object.keys(M.expanded)){if(!O.startsWith(D))continue;const A=O.slice(D.length);A!==n&&pZ(A)===n&&!k.has(A)&&M.collapse(t,A)}},[m.data,t,n]);const g=ZN({category:"directory",name:e.name,type:"dir"},{expanded:f}),w=r*eD+4,C=w+18;return S.jsxs("div",{children:[S.jsxs("button",{type:"button",onClick:()=>d(t,n),"data-testid":`file-dir-${t}-${n}`,style:{paddingLeft:w},className:Pe("flex w-full min-w-0 items-center gap-1.5 rounded-md py-1 pr-2 text-left transition-colors hover:bg-accent/40 [@media(any-pointer:coarse)]:py-1.5",a?"font-medium text-foreground":"text-foreground"),children:[S.jsx(Qd,{className:Pe("h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform",f&&"rotate-90")}),S.jsx(g,{className:Pe("h-4 w-4 shrink-0",a?"text-muted-foreground":JN("directory"))}),S.jsx("span",{className:"min-w-0 flex-1 truncate text-xs",children:a?e.name:xZ(n)}),a&&S.jsx(bZ,{root:e})]}),f&&S.jsxs("div",{children:[(m.isLoading||m.isFetching&&!m.data)&&S.jsxs("div",{style:{paddingLeft:C},className:"flex items-center gap-1.5 py-1 text-[11px] text-muted-foreground",children:[S.jsx(Gs,{className:"h-3 w-3 animate-spin"}),l("common.loading")]}),m.isError&&S.jsx(vZ,{code:h,indent:C,onRetry:()=>void m.refetch()}),(E=m.data)==null?void 0:E.entries.map(k=>k.type==="dir"?S.jsx(tD,{root:e,rootId:t,path:k.path,depth:r+1,isRoot:!1,ctx:o},k.path):S.jsx(wZ,{entry:k,rootId:t,depth:r+1},k.path)),m.data&&m.data.entries.length===0&&S.jsx("div",{style:{paddingLeft:C},className:"py-1 text-[11px] text-muted-foreground/70",children:l("files.emptyDir")}),((R=m.data)==null?void 0:R.truncated)&&S.jsx("div",{style:{paddingLeft:C},className:"py-1 text-[11px] text-muted-foreground/70",children:l("files.truncated")})]})]})}function vZ({code:e,indent:t,onRetry:n}){const{t:r}=mn();return S.jsxs("div",{style:{paddingLeft:t},className:"flex items-start gap-1.5 py-1 pr-2 text-[11px] text-destructive/80",children:[S.jsx(M9,{className:"mt-0.5 h-3 w-3 shrink-0"}),S.jsx("span",{className:"min-w-0 flex-1",children:r(`files.error.${e??"unknown"}`)}),S.jsx("button",{type:"button",onClick:n,className:"shrink-0 text-muted-foreground hover:text-foreground",title:r("files.retry"),children:S.jsx(sA,{className:"h-3 w-3"})})]})}function xZ(e){const t=e.lastIndexOf("/");return(t>=0?e.slice(t+1):e)||e}function wZ({entry:e,rootId:t,depth:n}){const{t:r}=mn(),a=Hd(),{isMobile:o,setOpenMobile:l}=Ur(),c=mZ(),f=(c==null?void 0:c.rootId)===t&&(c==null?void 0:c.path)===e.path,d=ZN(e),m=n*eD+4+18,h=()=>{a(JQ(t,e.path)),o&&l(!1)};return S.jsxs("div",{className:"group/file relative flex items-center",children:[S.jsxs("button",{type:"button",onClick:h,"data-testid":`file-item-${t}-${e.path}`,title:e.name,style:{paddingLeft:m},className:Pe("flex w-full min-w-0 items-center gap-1.5 rounded-md py-1 pr-9 text-left transition-colors [@media(any-pointer:coarse)]:py-1.5",f?"bg-primary/10 text-primary":"text-muted-foreground hover:bg-accent/30"),children:[S.jsx(d,{className:Pe("h-4 w-4 shrink-0",f?"text-primary":JN(e.category))}),S.jsx("span",{className:"min-w-0 flex-1 truncate text-xs",children:e.name}),e.isSymlink&&S.jsx("span",{className:"shrink-0 text-[9px] text-muted-foreground/60",title:"symlink",children:"↗"})]}),S.jsx("a",{href:eZ(t,e.path,!0),download:e.name,onClick:y=>y.stopPropagation(),"data-testid":`file-download-${t}-${e.path}`,title:r("files.download"),className:Pe("absolute top-1/2 right-1 flex h-6 w-6 -translate-y-1/2 items-center justify-center rounded text-muted-foreground transition-opacity hover:bg-background hover:text-foreground","opacity-0 group-hover/file:opacity-100 [@media(any-pointer:coarse)]:opacity-100"),children:S.jsx(p8,{className:"h-3 w-3"})})]})}const nD=v.createContext(void 0);function rD(){const e=v.useContext(nD);if(e===void 0)throw new Error(Cn(64));return e}let SZ=(function(e){return e.activationDirection="data-activation-direction",e.orientation="data-orientation",e})({});const iD={tabActivationDirection:e=>({[SZ.activationDirection]:e})},EZ=v.forwardRef(function(t,n){const{className:r,defaultValue:a=0,onValueChange:o,orientation:l="horizontal",render:c,value:f,...d}=t,m=Lc(),h=Object.hasOwn(t,"defaultValue"),y=v.useRef([]),[g,w]=v.useState(()=>new Map),[C,T]=Sc({controlled:f,default:a,name:"Tabs",state:"value"}),E=f!==void 0,[R,k]=v.useState(()=>new Map),[M,D]=v.useState("none"),O=Ye((z,H)=>{o==null||o(z,H),!H.isCanceled&&(T(z),D(H.activationDirection))}),A=Ye((z,H)=>{w(K=>{if(K.get(z)===H)return K;const P=new Map(K);return P.set(z,H),P})}),L=Ye((z,H)=>{w(K=>{if(!K.has(z)||K.get(z)!==H)return K;const P=new Map(K);return P.delete(z),P})}),q=v.useCallback(z=>g.get(z),[g]),F=v.useCallback(z=>{for(const H of R.values())if(z===(H==null?void 0:H.value))return H==null?void 0:H.id},[R]),W=v.useCallback(z=>{if(z===void 0)return null;for(const[H,K]of R.entries())if(K!=null&&z===(K.value??K.index))return H;return null},[R]),_=v.useMemo(()=>({direction:m,getTabElementBySelectedValue:W,getTabIdByPanelValue:F,getTabPanelIdByValue:q,onValueChange:O,orientation:l,registerMountedTabPanel:A,setTabMap:k,unregisterMountedTabPanel:L,tabActivationDirection:M,value:C}),[m,W,F,q,O,l,A,k,L,M,C]),V=v.useMemo(()=>{for(const z of R.values())if(z!=null&&z.value===C)return z},[R,C]),$=v.useMemo(()=>{for(const z of R.values())if(z!=null&&!z.disabled)return z.value},[R]);qe(()=>{if(E||R.size===0)return;const z=V==null?void 0:V.disabled,H=V==null&&C!==null;if(h&&z&&C===a||!z&&!H)return;const P=$??null;C!==P&&(T(P),D("none"))},[a,$,h,E,V,D,T,R,C]);const j=It("div",t,{state:{orientation:l,tabActivationDirection:M},ref:n,props:d,stateAttributesMapping:iD});return S.jsx(nD.Provider,{value:_,children:S.jsx(Am,{elementsRef:y,children:j})})}),aD="data-composite-item-active";function oD(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=e0(),{ref:a,index:o}=lw(e),l=n===o,c=v.useRef(null),f=zi(a,c);return{compositeProps:v.useMemo(()=>({tabIndex:l?0:-1,onFocus(){r(o)},onMouseMove(){const m=c.current;if(!t||!m)return;const h=m.hasAttribute("disabled")||m.ariaDisabled==="true";!l&&!h&&m.focus()}}),[l,r,o,t]),compositeRef:f,index:o}}const sD=v.createContext(void 0);function CZ(){const e=v.useContext(sD);if(e===void 0)throw new Error(Cn(65));return e}const TZ=v.forwardRef(function(t,n){const{className:r,disabled:a=!1,render:o,value:l,id:c,nativeButton:f=!0,...d}=t,{value:m,getTabPanelIdByValue:h,orientation:y}=rD(),{activateOnFocus:g,highlightedTabIndex:w,onTabActivation:C,setHighlightedTabIndex:T,tabsListElement:E}=CZ(),R=Vi(c),k=v.useMemo(()=>({disabled:a,id:R,value:l}),[a,R,l]),{compositeProps:M,compositeRef:D,index:O}=oD({metadata:k}),A=l===m,L=v.useRef(!1);qe(()=>{if(L.current){L.current=!1;return}if(!(A&&O>-1&&w!==O))return;const K=E;if(K!=null){const P=ni(Qt(K));if(P&&Dt(K,P))return}a||T(O)},[A,O,w,T,a,E]);const{getButtonProps:q,buttonRef:F}=$a({disabled:a,native:f,focusableWhenDisabled:!0}),W=h(l),_=v.useRef(!1),V=v.useRef(!1);function $(K){A||a||C(l,xt(Fi,K.nativeEvent,void 0,{activationDirection:"none"}))}function B(K){A||(O>-1&&!a&&T(O),!a&&g&&(!_.current||_.current&&V.current)&&C(l,xt(Fi,K.nativeEvent,void 0,{activationDirection:"none"})))}function j(K){if(A||a)return;_.current=!0;function P(){_.current=!1,V.current=!1}(!K.button||K.button===0)&&(V.current=!0,Qt(K.currentTarget).addEventListener("pointerup",P,{once:!0}))}return It("button",t,{state:{disabled:a,active:A,orientation:y},ref:[n,F,D],props:[M,{role:"tab","aria-controls":W,"aria-selected":A,id:R,onClick:$,onFocus:B,onPointerDown:j,[aD]:A?"":void 0,onKeyDownCapture(){L.current=!0}},d,q]})});function RZ(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}const kZ=[];function MZ(e){const{itemSizes:t,cols:n=1,loopFocus:r=!0,dense:a=!1,orientation:o="both",direction:l,highlightedIndex:c,onHighlightedIndexChange:f,rootRef:d,enableHomeAndEndKeys:m=!1,stopEventPropagation:h=!1,disabledIndices:y,modifierKeys:g=kZ}=e,[w,C]=v.useState(0),T=n>1,E=v.useRef(null),R=zi(E,d),k=v.useRef([]),M=v.useRef(!1),D=c??w,O=Ye((q,F=!1)=>{if((f??C)(q),F){const W=k.current[q];bR(E.current,W,l,o)}}),A=Ye(q=>{if(q.size===0||M.current)return;M.current=!0;const F=Array.from(q.keys()),W=F.find(V=>V==null?void 0:V.hasAttribute(aD))??null,_=W?F.indexOf(W):-1;_!==-1&&O(_),bR(E.current,W,l,o)}),L=v.useMemo(()=>({"aria-orientation":o==="both"?void 0:o,ref:R,onFocus(q){!E.current||!yR(q.target)||q.target.setSelectionRange(0,q.target.value.length??0)},onKeyDown(q){const F=m?M6:eA;if(!F.has(q.key)||OZ(q,g)||!E.current)return;const _=l==="rtl",V=_?Cd:rc,$={horizontal:V,vertical:ks,both:V}[o],B=_?rc:Cd,j={horizontal:B,vertical:nc,both:B}[o];if(yR(q.target)&&!RZ(q.target)){const I=q.target.selectionStart,Q=q.target.selectionEnd,le=q.target.value??"";if(I==null||q.shiftKey||I!==Q||q.key!==j&&I<le.length||q.key!==$&&I>0)return}let z=D;const H=np(k,y),K=Bv(k,y);if(T){const I=t||Array.from({length:k.current.length},()=>({width:1,height:1})),Q=tO(I,n,a),le=Q.findIndex(Z=>Z!=null&&!qo(k,Z,y)),ae=Q.reduce((Z,ue,ve)=>ue!=null&&!qo(k,ue,y)?ve:Z,-1);z=Q[eO({current:Q.map(Z=>Z?k.current[Z]:null)},{event:q,orientation:o,loopFocus:r,cols:n,disabledIndices:rO([...y||k.current.map((Z,ue)=>qo(k,ue)?ue:void 0),void 0],Q),minIndex:le,maxIndex:ae,prevIndex:nO(D>K?H:D,I,Q,n,q.key===ks?"bl":q.key===rc?"tr":"tl"),rtl:_})]}const P={horizontal:[V],vertical:[ks],both:[V,ks]}[o],U={horizontal:[B],vertical:[nc],both:[B,nc]}[o],G=T?F:{horizontal:m?R6:ZO,vertical:m?k6:JO,both:F}[o];m&&(q.key===Gd?z=H:q.key===Xd&&(z=K)),z===D&&(P.includes(q.key)||U.includes(q.key))&&(r&&z===K&&P.includes(q.key)?z=H:r&&z===H&&U.includes(q.key)?z=K:z=hr(k,{startingIndex:z,decrement:U.includes(q.key),disabledIndices:y})),z!==D&&!Ql(k,z)&&(h&&q.stopPropagation(),G.has(q.key)&&q.preventDefault(),O(z,!0),queueMicrotask(()=>{var I;(I=k.current[z])==null||I.focus()}))}}),[n,a,l,y,k,m,D,T,t,r,R,g,O,o,h]);return v.useMemo(()=>({props:L,highlightedIndex:D,onHighlightedIndexChange:O,elementsRef:k,disabledIndices:y,onMapChange:A,relayKeyboardEvent:L.onKeyDown}),[L,D,O,k,y,A])}function OZ(e,t){for(const n of I6.values())if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function AZ(e){const{render:t,className:n,refs:r=Vo,props:a=Vo,state:o=In,stateAttributesMapping:l,highlightedIndex:c,onHighlightedIndexChange:f,orientation:d,dense:m,itemSizes:h,loopFocus:y,cols:g,enableHomeAndEndKeys:w,onMapChange:C,stopEventPropagation:T=!0,rootRef:E,disabledIndices:R,modifierKeys:k,highlightItemOnHover:M=!1,tag:D="div",...O}=e,A=Lc(),{props:L,highlightedIndex:q,onHighlightedIndexChange:F,elementsRef:W,onMapChange:_,relayKeyboardEvent:V}=MZ({itemSizes:h,cols:g,loopFocus:y,dense:m,orientation:d,highlightedIndex:c,onHighlightedIndexChange:f,rootRef:E,stopEventPropagation:T,enableHomeAndEndKeys:w,direction:A,disabledIndices:R,modifierKeys:k}),$=It(D,e,{state:o,ref:r,props:[L,...a,O],stateAttributesMapping:l}),B=v.useMemo(()=>({highlightedIndex:q,onHighlightedIndexChange:F,highlightItemOnHover:M,relayKeyboardEvent:V}),[q,F,M,V]);return S.jsx(H2.Provider,{value:B,children:S.jsx(Am,{elementsRef:W,onMapChange:j=>{C==null||C(j),_(j)},children:$})})}const NZ=v.forwardRef(function(t,n){const{activateOnFocus:r=!1,className:a,loopFocus:o=!0,render:l,...c}=t,{getTabElementBySelectedValue:f,onValueChange:d,orientation:m,value:h,setTabMap:y,tabActivationDirection:g}=rD(),[w,C]=v.useState(0),[T,E]=v.useState(null),R=DZ(h,m,T,f),k=Ye((A,L)=>{if(A!==h){const q=R(A);L.activationDirection=q,d(A,L)}}),M={orientation:m,tabActivationDirection:g},D={"aria-orientation":m==="vertical"?"vertical":void 0,role:"tablist"},O=v.useMemo(()=>({activateOnFocus:r,highlightedTabIndex:w,onTabActivation:k,setHighlightedTabIndex:C,tabsListElement:T,value:h}),[r,w,k,C,T,h]);return S.jsx(sD.Provider,{value:O,children:S.jsx(AZ,{render:l,className:a,state:M,refs:[n,E],props:[D,c],stateAttributesMapping:iD,highlightedIndex:w,enableHomeAndEndKeys:!0,loopFocus:o,orientation:m,onHighlightedIndexChange:C,onMapChange:y,disabledIndices:Vo})})});function Uk(e,t){const{left:n,top:r}=e.getBoundingClientRect(),{left:a,top:o}=t.getBoundingClientRect(),l=n-a,c=r-o;return{left:l,top:c}}function DZ(e,t,n,r){const[a,o]=v.useState(null);return qe(()=>{if(e==null||n==null){o(null);return}const l=r(e);if(l==null){o(null);return}const{left:c,top:f}=Uk(l,n);o(t==="horizontal"?c:f)},[t,r,n,e]),v.useCallback(l=>{if(l===e)return"none";if(l==null)return o(null),"none";if(l!=null&&n!=null){const c=r(l);if(c!=null){const{left:f,top:d}=Uk(c,n);if(a==null)return o(t==="horizontal"?f:d),"none";if(t==="horizontal"){if(f<a)return o(f),"left";if(f>a)return o(f),"right"}else{if(d<a)return o(d),"up";if(d>a)return o(d),"down"}}}return"none"},[r,t,a,n,e])}function IZ({className:e,orientation:t="horizontal",...n}){return S.jsx(EZ,{"data-slot":"tabs","data-orientation":t,className:Pe("gap-2 group/tabs flex data-horizontal:flex-col",e),...n})}const PZ=em("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 LZ({className:e,variant:t="default",...n}){return S.jsx(NZ,{"data-slot":"tabs-list","data-variant":t,className:Pe(PZ({variant:t}),e),...n})}function Qb({className:e,...t}){return S.jsx(TZ,{"data-slot":"tabs-trigger",className:Pe("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 qp({children:e,onClick:t,...n}){const{isMobile:r,setOpenMobile:a}=Ur(),o=l=>{r&&a(!1),t==null||t(l)};return S.jsx(Wx,{...n,onClick:o,children:e})}function _Z({items:e}){const{t}=mn();return S.jsx(F0,{children:S.jsx(Tq,{children:e.map(n=>{var r,a;return S.jsxs(km,{defaultOpen:n.isActive,render:S.jsx(Rq,{}),children:[S.jsx(qp,{to:n.url,children:S.jsxs(Mq,{tooltip:t(n.title),children:[S.jsx(n.icon,{}),S.jsx("span",{children:t(n.title)})]})}),(r=n.items)!=null&&r.length?S.jsxs(S.Fragment,{children:[S.jsxs(Mm,{render:S.jsx(Oq,{className:"data-[state=open]:rotate-90"}),children:[S.jsx(Qd,{}),S.jsx("span",{className:"sr-only",children:"Toggle"})]}),S.jsx(Om,{children:S.jsx(Aq,{children:(a=n.items)==null?void 0:a.map(o=>S.jsx(Nq,{children:S.jsx(qp,{to:o.url,children:S.jsx(Dq,{children:S.jsx("span",{children:t(o.title)})})})},o.title))})})]}):null]},n.title)})})})}const jZ={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 zZ({deviceId:e,className:t}){const{t:n}=mn(),r=kn(o=>o.deviceReconnecting[e]),a=kn(o=>o.deviceErrors[e]);if(r)return S.jsxs(Zs,{variant:"outline",title:r.message,className:Pe("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:[S.jsx(f9,{className:"h-3 w-3 animate-spin"}),S.jsx("span",{className:"truncate max-w-[120px]",children:r.message})]});if(a){const o=jZ[a.type]??"unknown",l=n(`deviceStatus.errorBadge.${o}`),c=[l,a.message,a.rawMessage].filter(Boolean).join(`
461
+ `);return S.jsxs(Zs,{variant:"outline",title:c,className:Pe("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:[S.jsx(od,{className:"h-3 w-3"}),S.jsx("span",{className:"truncate max-w-[120px]",children:l})]})}return null}function FZ(e){const{children:t,open:n,defaultOpen:r=!1,onOpenChange:a,onOpenChangeComplete:o,actionsRef:l,handle:c,triggerId:f,defaultTriggerId:d=null}=e,m=Xo(),h=!!m,y=nr(()=>(c==null?void 0:c.store)??new nA({open:r,openProp:n,activeTriggerId:d,triggerIdProp:f,modal:!0,disablePointerDismissal:!0,nested:h,role:"alertdialog"})).current;y.useControlledProp("openProp",n),y.useControlledProp("triggerIdProp",f),y.useSyncedValue("nested",h),y.useContextCallback("onOpenChange",a),y.useContextCallback("onOpenChangeComplete",o);const g=y.useState("payload");tA({store:y,actionsRef:l,parentContext:m==null?void 0:m.store.context});const w=v.useMemo(()=>({store:y}),[y]);return S.jsx(u0.Provider,{value:w,children:typeof t=="function"?t({payload:g}):t})}function dx({...e}){return S.jsx(FZ,{"data-slot":"alert-dialog",...e})}function BZ({...e}){return S.jsx(A0,{"data-slot":"alert-dialog-portal",...e})}function HZ({className:e,...t}){return S.jsx(d0,{"data-slot":"alert-dialog-overlay",className:Pe("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 fx({className:e,size:t="default",...n}){return S.jsxs(BZ,{children:[S.jsx(HZ,{}),S.jsx(k0,{"data-slot":"alert-dialog-content","data-size":t,className:Pe("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 hx({className:e,...t}){return S.jsx("div",{"data-slot":"alert-dialog-header",className:Pe("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 px({className:e,...t}){return S.jsx("div",{"data-slot":"alert-dialog-footer",className:Pe("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 qk({className:e,...t}){return S.jsx("div",{"data-slot":"alert-dialog-media",className:Pe("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 mx({className:e,...t}){return S.jsx(I0,{"data-slot":"alert-dialog-title",className:Pe("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 gx({className:e,...t}){return S.jsx(f0,{"data-slot":"alert-dialog-description",className:Pe("text-muted-foreground *:[a]:hover:text-foreground text-sm text-balance md:text-pretty *:[a]:underline *:[a]:underline-offset-3",e),...t})}function yx({className:e,...t}){return S.jsx(Ht,{"data-slot":"alert-dialog-action",className:Pe(e),...t})}function bx({className:e,variant:t="outline",size:n="default",...r}){return S.jsx(fm,{"data-slot":"alert-dialog-cancel",className:Pe(e),render:S.jsx(Ht,{variant:t,size:n}),...r})}function vx({...e}){return S.jsx(rA,{"data-slot":"dialog",...e})}function UZ({...e}){return S.jsx(A0,{"data-slot":"dialog-portal",...e})}function qZ({className:e,...t}){return S.jsx(d0,{"data-slot":"dialog-overlay",className:Pe("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 xx({className:e,children:t,showCloseButton:n=!0,...r}){return S.jsxs(UZ,{children:[S.jsx(qZ,{}),S.jsxs(k0,{"data-slot":"dialog-content",className:Pe("bg-background data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 ring-foreground/10 grid max-w-[calc(100%-2rem)] gap-4 rounded-xl p-4 text-sm ring-1 duration-100 sm:max-w-sm fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none",e),...r,children:[t,n&&S.jsxs(fm,{"data-slot":"dialog-close",render:S.jsx(Ht,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm"}),children:[S.jsx(Va,{}),S.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function wx({className:e,...t}){return S.jsx("div",{"data-slot":"dialog-header",className:Pe("gap-2 flex flex-col",e),...t})}function Vk({className:e,showCloseButton:t=!1,children:n,...r}){return S.jsxs("div",{"data-slot":"dialog-footer",className:Pe("bg-muted/50 -mx-4 -mb-4 rounded-b-xl border-t p-4 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...r,children:[n,t&&S.jsx(fm,{render:S.jsx(Ht,{variant:"outline"}),children:"Close"})]})}function Sx({className:e,...t}){return S.jsx(I0,{"data-slot":"dialog-title",className:Pe("text-base leading-none font-medium",e),...t})}function lD({className:e,...t}){return S.jsx(f0,{"data-slot":"dialog-description",className:Pe("text-muted-foreground *:[a]:hover:text-foreground text-sm *:[a]:underline *:[a]:underline-offset-3",e),...t})}const cD=v.createContext(void 0);function uD(e){const t=v.useContext(cD);if(t===void 0&&!e)throw new Error(Cn(33));return t}const dD=v.createContext(void 0);function Jo(e){const t=v.useContext(dD);if(t===void 0&&!e)throw new Error(Cn(36));return t}const VZ=v.createContext(void 0);function rf(e=!0){const t=v.useContext(VZ);if(t===void 0&&!e)throw new Error(Cn(25));return t}const $Z={...ua,...Ya},YZ=v.forwardRef(function(t,n){const{className:r,render:a,...o}=t,{store:l}=Jo(),c=l.useState("open"),f=l.useState("mounted"),d=l.useState("transitionStatus"),m=l.useState("lastOpenChangeReason"),h=rf(),y={open:c,transitionStatus:d};return It("div",t,{ref:h!=null&&h.backdropRef?[n,h.backdropRef]:n,state:y,stateAttributesMapping:$Z,props:[{role:"presentation",hidden:!f,style:{pointerEvents:m===vr?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},o]})});function WZ(e){const{closeOnClick:t,highlighted:n,id:r,nodeId:a,store:o,itemRef:l,itemMetadata:c}=e,{events:f}=o.useState("floatingTreeRoot"),d=rf(!0),m=d!==void 0;return v.useMemo(()=>({id:r,role:"menuitem",tabIndex:n?0:-1,onMouseMove(h){a&&f.emit("itemhover",{nodeId:a,target:h.currentTarget})},onClick(h){t&&f.emit("close",{domEvent:h,reason:id})},onMouseUp(h){if(d){const y=d.initialCursorPointRef.current;if(d.initialCursorPointRef.current=null,m&&y&&Math.abs(h.clientX-y.x)<=1&&Math.abs(h.clientY-y.y)<=1)return}l.current&&o.context.allowMouseUpTriggerRef.current&&(!m||h.button===2)&&(!c||c.type==="regular-item")&&l.current.click()}}),[t,n,r,f,a,o,l,d,m,c])}const KZ={type:"regular-item"};function GZ(e){const{closeOnClick:t,disabled:n=!1,highlighted:r,id:a,store:o,nativeButton:l,itemMetadata:c,nodeId:f}=e,d=v.useRef(null),{getButtonProps:m,buttonRef:h}=$a({disabled:n,focusableWhenDisabled:!0,native:l}),y=WZ({closeOnClick:t,highlighted:r,id:a,nodeId:f,store:o,itemRef:d,itemMetadata:c}),g=v.useCallback(C=>Ti(y,{onMouseEnter(){c.type==="submenu-trigger"&&c.setActive()},onKeyUp(T){T.key===" "&&o.context.typingRef.current&&T.preventBaseUIHandler()}},C,m),[y,m,o,c]),w=zi(d,h);return v.useMemo(()=>({getItemProps:g,itemRef:w}),[g,w])}const XZ=v.forwardRef(function(t,n){const{render:r,className:a,id:o,label:l,nativeButton:c=!1,disabled:f=!1,closeOnClick:d=!0,...m}=t,h=lw({label:l}),y=uD(!0),g=Vi(o),{store:w}=Jo(),C=w.useState("isActive",h.index),T=w.useState("itemProps"),{getItemProps:E,itemRef:R}=GZ({closeOnClick:d,disabled:f,highlighted:C,id:g,store:w,nativeButton:c,nodeId:y==null?void 0:y.nodeId,itemMetadata:KZ});return It("div",t,{state:{disabled:f,highlighted:C},props:[T,m,E],ref:[R,n,h.ref]})}),QZ={...ua,...Ya},ZZ=v.forwardRef(function(t,n){const{render:r,className:a,finalFocus:o,...l}=t,{store:c}=Jo(),{side:f,align:d}=uD(),m=qN()!=null,h=c.useState("open"),y=c.useState("transitionStatus"),g=c.useState("popupProps"),w=c.useState("mounted"),C=c.useState("instantType"),T=c.useState("activeTriggerElement"),E=c.useState("parent"),R=c.useState("lastOpenChangeReason"),k=c.useState("rootId"),M=c.useState("floatingRootContext"),D=c.useState("floatingTreeRoot"),O=c.useState("closeDelay"),A=c.useState("activeTriggerElement"),L=E.type==="context-menu";Wa({open:h,ref:c.context.popupRef,onComplete(){var $,B;h&&((B=($=c.context).onOpenChangeComplete)==null||B.call($,!0))}}),v.useEffect(()=>{function $(B){c.setOpen(!1,xt(B.reason,B.domEvent))}return D.events.on("close",$),()=>{D.events.off("close",$)}},[D.events,c]);const q=c.useState("hoverEnabled"),F=c.useState("disabled");$O(M,{enabled:q&&!F&&!L&&E.type!=="menubar",closeDelay:O});const W={transitionStatus:y,side:f,align:d,open:h,nested:E.type==="menu",instant:C},_=It("div",t,{state:W,ref:[n,c.context.popupRef],stateAttributesMapping:QZ,props:[g,{onKeyDown($){m&&R0.has($.key)&&$.stopPropagation()}},_c(y),l,{"data-rootownerid":k}]});let V=E.type===void 0||L;return(T||E.type==="menubar"&&R!==um)&&(V=!0),S.jsx(g0,{context:M,modal:L,disabled:!w,returnFocus:o===void 0?V:o,initialFocus:E.type!=="menu",restoreFocus:!0,externalTree:E.type!=="menubar"?D:void 0,previousFocusableElement:A,nextFocusableElement:E.type===void 0?c.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:E.type===void 0?c.context.beforeContentFocusGuardRef:void 0,children:_})}),fD=v.createContext(void 0);function JZ(){const e=v.useContext(fD);if(e===void 0)throw new Error(Cn(32));return e}const eJ=v.forwardRef(function(t,n){const{keepMounted:r=!1,...a}=t,{store:o}=Jo();return o.useState("mounted")||r?S.jsx(fD.Provider,{value:r,children:S.jsx(p0,{ref:n,...a})}):null}),tJ=v.forwardRef(function(t,n){var Le;const{anchor:r,positionMethod:a="absolute",className:o,render:l,side:c,align:f,sideOffset:d=0,alignOffset:m=0,collisionBoundary:h="clipping-ancestors",collisionPadding:y=5,arrowPadding:g=5,sticky:w=!1,disableAnchorTracking:C=!1,collisionAvoidance:T=C2,...E}=t,{store:R}=Jo(),k=JZ(),M=rf(!0),D=R.useState("parent"),O=R.useState("floatingRootContext"),A=R.useState("floatingTreeRoot"),L=R.useState("mounted"),q=R.useState("open"),F=R.useState("modal"),W=R.useState("activeTriggerElement"),_=R.useState("transitionStatus"),V=R.useState("lastOpenChangeReason"),$=R.useState("floatingNodeId"),B=R.useState("floatingParentNodeId");let j=r,z=d,H=m,K=f,P=T;D.type==="context-menu"&&(j=r??((Le=D.context)==null?void 0:Le.anchor),K=K??"start",!c&&K!=="center"&&(H=t.alignOffset??2,z=t.sideOffset??-5));let U=c,G=K;D.type==="menu"?(U=U??"inline-end",G=G??"start",P=t.collisionAvoidance??T2):D.type==="menubar"&&(U=U??"bottom",G=G??"start");const I=D.type==="context-menu",Q=z0({anchor:j,floatingRootContext:O,positionMethod:M?"fixed":a,mounted:L,side:U,sideOffset:z,align:G,alignOffset:H,arrowPadding:I?0:g,collisionBoundary:h,collisionPadding:y,sticky:w,nodeId:$,keepMounted:k,disableAnchorTracking:C,collisionAvoidance:P,shiftCrossAxis:I&&!("side"in P&&P.side==="flip"),externalTree:A}),le=v.useMemo(()=>{const te={};return q||(te.pointerEvents="none"),{role:"presentation",hidden:!L,style:{...Q.positionerStyles,...te}}},[q,L,Q.positionerStyles]);v.useEffect(()=>{function te(he){he.open&&(he.parentNodeId===$&&R.set("hoverEnabled",!1),he.nodeId!==$&&he.parentNodeId===R.select("floatingParentNodeId")&&R.setOpen(!1,xt(ip)))}return A.events.on("menuopenchange",te),()=>{A.events.off("menuopenchange",te)}},[R,A.events,$]),v.useEffect(()=>{if(R.select("floatingParentNodeId")==null)return;function te(he){if(he.open||he.nodeId!==R.select("floatingParentNodeId"))return;const ye=he.reason??ip;R.setOpen(!1,xt(ye))}return A.events.on("menuopenchange",te),()=>{A.events.off("menuopenchange",te)}},[A.events,R]),v.useEffect(()=>{function te(he){!q||he.nodeId!==R.select("floatingParentNodeId")||he.target&&W&&W!==he.target&&R.setOpen(!1,xt(ip))}return A.events.on("itemhover",te),()=>{A.events.off("itemhover",te)}},[A.events,q,W,R]),v.useEffect(()=>{const te={open:q,nodeId:$,parentNodeId:B,reason:R.select("lastOpenChangeReason")};A.events.emit("menuopenchange",te)},[A.events,q,R,$,B]);const ae={open:q,side:Q.side,align:Q.align,anchorHidden:Q.anchorHidden,nested:D.type==="menu"},Z=v.useMemo(()=>({side:Q.side,align:Q.align,arrowRef:Q.arrowRef,arrowUncentered:Q.arrowUncentered,arrowStyles:Q.arrowStyles,nodeId:Q.context.nodeId}),[Q.side,Q.align,Q.arrowRef,Q.arrowUncentered,Q.arrowStyles,Q.context.nodeId]),ue=It("div",t,{state:ae,stateAttributesMapping:ua,ref:[n,R.useStateSetter("positionerElement")],props:[le,_c(_),E]}),ve=L&&D.type!=="menu"&&(D.type!=="menubar"&&F&&V!==vr||D.type==="menubar"&&D.context.modal);let Se=null;return D.type==="menubar"?Se=D.context.contentElement:D.type===void 0&&(Se=W),S.jsxs(cD.Provider,{value:Z,children:[ve&&S.jsx(O0,{ref:D.type==="context-menu"||D.type==="nested-context-menu"?D.context.internalBackdropRef:null,inert:M0(!q),cutout:Se}),S.jsx(PH,{id:$,children:S.jsx(Am,{elementsRef:R.context.itemDomElements,labelsRef:R.context.itemLabels,children:ue})})]})}),nJ=v.createContext(null);function hD(e){return v.useContext(nJ)}const rJ={...E0,disabled:Ge(e=>e.parent.type==="menubar"&&e.parent.context.disabled||e.disabled),modal:Ge(e=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0)),allowMouseEnter:Ge(e=>e.allowMouseEnter),stickIfOpen:Ge(e=>e.stickIfOpen),parent:Ge(e=>e.parent),rootId:Ge(e=>e.parent.type==="menu"?e.parent.store.select("rootId"):e.parent.type!==void 0?e.parent.context.rootId:e.rootId),activeIndex:Ge(e=>e.activeIndex),isActive:Ge((e,t)=>e.activeIndex===t),hoverEnabled:Ge(e=>e.hoverEnabled),instantType:Ge(e=>e.instantType),lastOpenChangeReason:Ge(e=>e.openChangeReason),floatingTreeRoot:Ge(e=>e.parent.type==="menu"?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot),floatingNodeId:Ge(e=>e.floatingNodeId),floatingParentNodeId:Ge(e=>e.floatingParentNodeId),itemProps:Ge(e=>e.itemProps),closeDelay:Ge(e=>e.closeDelay),keyboardEventRelay:Ge(e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay")})};class hw extends gm{constructor(n){super({...iJ(),...n},{positionerRef:v.createRef(),popupRef:v.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:v.createRef(),beforeContentFocusGuardRef:v.createRef(),onOpenChangeComplete:void 0,triggerElements:new Wd},rJ);at(this,"unsubscribeParentListener",null);this.unsubscribeParentListener=this.observe("parent",r=>{var a;if((a=this.unsubscribeParentListener)==null||a.call(this),r.type==="menu"){this.unsubscribeParentListener=r.store.subscribe(()=>{this.notifyAll()}),this.context.allowMouseUpTriggerRef=r.store.context.allowMouseUpTriggerRef;return}r.type!==void 0&&(this.context.allowMouseUpTriggerRef=r.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(n,r){this.state.floatingRootContext.context.events.emit("setOpen",{open:n,eventDetails:r})}static useStore(n,r){const a=nr(()=>new hw(r)).current;return n??a}}function iJ(){return{...S0(),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 h0,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:In,keyboardEventRelay:void 0,closeDelay:0}}const aJ=v.createContext(void 0);function oJ(){return v.useContext(aJ)}const sJ=b0(function(t){const{children:n,open:r,onOpenChange:a,onOpenChangeComplete:o,defaultOpen:l=!1,disabled:c=!1,modal:f,loopFocus:d=!0,orientation:m="vertical",actionsRef:h,closeParentOnEsc:y=!1,handle:g,triggerId:w,defaultTriggerId:C=null,highlightItemOnHover:T=!0}=t,E=rf(!0),R=Jo(!0),k=hD(!0),M=oJ(),D=v.useMemo(()=>M&&R?{type:"menu",store:R.store}:k?{type:"menubar",context:k}:E&&!R?{type:"context-menu",context:E}:{type:void 0},[E,R,k,M]),O=hw.useStore(g==null?void 0:g.store,{open:l,openProp:r,activeTriggerId:C,triggerIdProp:w,parent:D});bm(()=>{r===void 0&&O.state.open===!1&&l===!0&&O.update({open:!0,activeTriggerId:C})}),O.useControlledProp("openProp",r),O.useControlledProp("triggerIdProp",w),O.useContextCallback("onOpenChangeComplete",o);const A=O.useState("floatingTreeRoot"),L=wO(A),q=Ka();qe(()=>{E&&!R?O.update({parent:{type:"context-menu",context:E},floatingNodeId:L,floatingParentNodeId:q}):R&&O.update({floatingNodeId:L,floatingParentNodeId:q})},[E,R,L,q,O]);const F=O.useState("open"),W=O.useState("activeTriggerElement"),_=O.useState("positionerElement"),V=O.useState("hoverEnabled"),$=O.useState("modal"),B=O.useState("disabled"),j=O.useState("lastOpenChangeReason"),z=O.useState("parent"),H=O.useState("activeIndex"),K=O.useState("payload"),P=O.useState("floatingParentNodeId"),U=v.useRef(null),G=P!=null;let I;O.useSyncedValues({disabled:c,modal:z.type===void 0?f:void 0,rootId:nl()});const{openMethod:Q,triggerProps:le,reset:ae}=D0(F);x0(O);const{forceUnmount:Z}=w0(F,O,()=>{O.update({allowMouseEnter:!1,stickIfOpen:!0}),ae()}),ue=v.useRef(z.type!=="context-menu"),ve=Bn();v.useEffect(()=>{if(F||(U.current=null),z.type==="context-menu"){if(!F){ve.clear(),ue.current=!1;return}ve.start(500,()=>{ue.current=!0})}},[ve,F,z.type]),N0(F&&$&&j!==vr&&Q!=="touch",_),qe(()=>{!F&&!V&&O.set("hoverEnabled",!0)},[F,V,O]);const Se=v.useRef(!0),Le=Bn(),te=Ye((ze,Ze)=>{var bt;const tt=Ze.reason;if(F===ze&&Ze.trigger===W&&j===tt||(Ze.preventUnmountOnClose=()=>{O.set("preventUnmountingOnClose",!0)},!ze&&Ze.trigger==null&&(Ze.trigger=W??void 0),a==null||a(ze,Ze),Ze.isCanceled))return;const Tt={open:ze,nativeEvent:Ze.event,reason:Ze.reason,nested:G};I==null||I.emit("openchange",Tt);const zt=Ze.event;if(ze===!1&&(zt==null?void 0:zt.type)==="click"&&zt.pointerType==="touch"&&!Se.current)return;if(!ze&&H!==null){const Ke=O.context.itemDomElements.current[H];queueMicrotask(()=>{Ke==null||Ke.setAttribute("tabindex","-1")})}ze&&tt===Jl?(Se.current=!1,Le.start(300,()=>{Se.current=!0})):(Se.current=!0,Le.clear());const yt=(tt===Ys||tt===id)&&zt.detail===0&&(zt==null?void 0:zt.isTrusted),At=!ze&&(tt===dm||tt==null),it={open:ze,openChangeReason:tt};U.current=Ze.event??null;const ft=((bt=Ze.trigger)==null?void 0:bt.id)??null;(ft||ze)&&(it.activeTriggerId=ft,it.activeTriggerElement=Ze.trigger??null),O.update(it),z.type==="menubar"&&(tt===Jl||tt===Ws||tt===vr||tt===rp||tt===ip)?O.set("instantType","group"):yt||At?O.set("instantType",yt?"click":"dismiss"):O.set("instantType",void 0)}),he=v.useCallback(ze=>{const Ze=xt(ze);return Ze.preventUnmountOnClose=()=>{O.set("preventUnmountingOnClose",!0)},Ze},[O]),ye=v.useCallback(()=>{O.setOpen(!1,he(c0))},[O,he]);v.useImperativeHandle(h,()=>({unmount:Z,close:ye}),[Z,ye]);let _e;z.type==="context-menu"&&(_e=z.context),v.useImperativeHandle(_e==null?void 0:_e.positionerRef,()=>_,[_]),v.useImperativeHandle(_e==null?void 0:_e.actionsRef,()=>({setOpen:te}),[te]);const Oe=C0({popupStore:O,onOpenChange:te});I=Oe.context.events,v.useEffect(()=>{const ze=({open:Ze,eventDetails:tt})=>te(Ze,tt);return I.on("setOpen",ze),()=>{I==null||I.off("setOpen",ze)}},[I,te]);const Ce=mm(Oe,{enabled:!B,bubbles:{escapeKey:y&&z.type==="menu"},outsidePress(){var ze;return z.type!=="context-menu"||((ze=U.current)==null?void 0:ze.type)==="contextmenu"?!0:ue.current},externalTree:G?A:void 0}),Re=KO(Oe,{role:"menu"}),J=Lc(),Ee=v.useCallback(ze=>{O.select("activeIndex")!==ze&&O.set("activeIndex",ze)},[O]),xe=WO(Oe,{enabled:!B,listRef:O.context.itemDomElements,activeIndex:H,nested:z.type!==void 0,loopFocus:d,orientation:m,parentOrientation:z.type==="menubar"?z.context.orientation:void 0,rtl:J==="rtl",disabledIndices:Vo,onNavigate:Ee,openOnArrowKeyDown:z.type!=="context-menu",externalTree:G?A:void 0,focusItemOnHover:T}),Be=v.useCallback(ze=>{O.context.typingRef.current=ze},[O]),Ve=GO(Oe,{listRef:O.context.itemLabels,activeIndex:H,resetMs:hF,onMatch:ze=>{F&&ze!==H&&O.set("activeIndex",ze)},onTypingChange:Be}),{getReferenceProps:De,getFloatingProps:ut,getItemProps:pe,getTriggerProps:Te}=Kd([Ce,Re,xe,Ve]),ee=v.useMemo(()=>{const ze=Ti(De(),{onMouseMove(){O.set("allowMouseEnter",!0)}},le);return delete ze.role,ze},[De,O,le]),fe=v.useMemo(()=>{const ze=Te();if(!ze)return ze;const Ze=Ti(ze,le);return delete Ze.role,delete Ze["aria-controls"],Ze},[Te,le]),Ae=v.useMemo(()=>ut({onMouseMove(){O.set("allowMouseEnter",!0),z.type==="menu"&&O.set("hoverEnabled",!1)},onClick(){O.select("hoverEnabled")&&O.set("hoverEnabled",!1)},onKeyDown(ze){const Ze=O.select("keyboardEventRelay");Ze&&!ze.isPropagationStopped()&&Ze(ze)}}),[ut,z.type,O]),He=v.useMemo(()=>pe(),[pe]);O.useSyncedValues({floatingRootContext:Oe,activeTriggerProps:ee,inactiveTriggerProps:fe,popupProps:Ae,itemProps:He});const $e=v.useMemo(()=>({store:O,parent:D}),[O,D]),et=S.jsx(dD.Provider,{value:$e,children:typeof n=="function"?n({payload:K}):n});return z.type===void 0||z.type==="context-menu"?S.jsx(LH,{externalTree:A,children:et}):et});function lJ(e){const{render:t,className:n,state:r=In,props:a=Vo,refs:o=Vo,metadata:l,stateAttributesMapping:c,tag:f="div",...d}=e,{compositeProps:m,compositeRef:h}=oD({metadata:l});return It(f,e,{state:r,ref:[...o,h],props:[m,...a,d],stateAttributesMapping:c})}function pD(e){if(Mn(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid")??void 0;if(!ra(e))return pD(oa(e))}function cJ(e){const{enabled:t=!0,mouseDownAction:n,open:r}=e,a=v.useRef(!1);return v.useMemo(()=>t?{onMouseDown:o=>{(n==="open"&&!r||n==="close"&&r)&&(a.current=!0,Qt(o.currentTarget).addEventListener("click",()=>{a.current=!1},{once:!0}))},onClick:o=>{a.current&&(a.current=!1,o.preventBaseUIHandler())}}:In,[t,n,r])}const Wh=2,uJ=FO(function(t,n){const{render:r,className:a,disabled:o=!1,nativeButton:l=!0,id:c,openOnHover:f,delay:d=100,closeDelay:m=0,handle:h,payload:y,...g}=t,w=Jo(!0),C=(h==null?void 0:h.store)??(w==null?void 0:w.store);if(!C)throw new Error(Cn(85));const T=Vi(c),E=C.useState("isTriggerActive",T),R=C.useState("floatingRootContext"),k=C.useState("isOpenedByTrigger",T),M=v.useRef(null),D=fJ(),O=e0(!0),A=Qo(),L=v.useMemo(()=>A??new h0,[A]),q=wO(L),F=Ka(),{registerTrigger:W,isMountedByThisTrigger:_}=HO(T,M,C,{payload:y,closeDelay:m,parent:D,floatingTreeRoot:L,floatingNodeId:q,floatingParentNodeId:F,keyboardEventRelay:O==null?void 0:O.relayKeyboardEvent}),V=D.type==="menubar",$=C.useState("disabled"),B=o||$||V&&D.context.disabled,{getButtonProps:j,buttonRef:z}=$a({disabled:B,native:l});v.useEffect(()=>{!k&&D.type===void 0&&(C.context.allowMouseUpTriggerRef.current=!1)},[C,k,D.type]);const H=v.useRef(null),K=Bn(),P=Ye(Ce=>{if(!H.current)return;K.clear(),C.context.allowMouseUpTriggerRef.current=!1;const Re=Ce.target;if(Dt(H.current,Re)||Dt(C.select("positionerElement"),Re)||Re===H.current||Re!=null&&pD(Re)===C.select("rootId"))return;const J=zN(H.current);Ce.clientX>=J.left-Wh&&Ce.clientX<=J.right+Wh&&Ce.clientY>=J.top-Wh&&Ce.clientY<=J.bottom+Wh||L.events.emit("close",{domEvent:Ce,reason:mO})});v.useEffect(()=>{k&&C.select("lastOpenChangeReason")===vr&&Qt(H.current).addEventListener("mouseup",P,{once:!0})},[k,P,C]);const U=V&&D.context.hasSubmenuOpen,I=YO(R,{enabled:(f??U)&&!B&&D.type!=="context-menu"&&(!V||U&&!_),handleClose:XO({blockPointerEvents:!V}),mouseOnly:!0,move:!1,restMs:D.type===void 0?d:void 0,delay:{close:m},triggerElementRef:M,externalTree:L,isActiveTrigger:E}),Q=dJ(k,C.select("lastOpenChangeReason")),le=MO(R,{enabled:!B&&D.type!=="context-menu",event:k&&V?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:D.type===void 0?Q:!1}),ae=qO(R,{enabled:!B&&U}),Z=cJ({open:k,enabled:V,mouseDownAction:"open"}),ue=Kd([le,ae]),ve={disabled:B,open:k},Se=C.useState("triggerProps",_),Le=[H,n,z,W,M],te=[ue.getReferenceProps(),I??In,Se,{"aria-haspopup":"menu",id:T,onMouseDown:Ce=>{if(C.select("open"))return;K.start(200,()=>{C.context.allowMouseUpTriggerRef.current=!0}),Qt(Ce.currentTarget).addEventListener("mouseup",P,{once:!0})}},V?{role:"menuitem"}:{},Z,g,j],he=v.useRef(null),ye=Ye(Ce=>{pr.flushSync(()=>{C.setOpen(!1,xt(Ws,Ce.nativeEvent,Ce.currentTarget))});const Re=gH(he.current);Re==null||Re.focus()}),_e=Ye(Ce=>{var J;const Re=C.select("positionerElement");if(Re&&Zl(Ce,Re))(J=C.context.beforeContentFocusGuardRef.current)==null||J.focus();else{pr.flushSync(()=>{C.setOpen(!1,xt(Ws,Ce.nativeEvent,Ce.currentTarget))});let Ee=mH(C.context.triggerFocusTargetRef.current||M.current);for(;Ee!==null&&Dt(Re,Ee);){const xe=Ee;if(Ee=s0(Ee),Ee===xe)break}Ee==null||Ee.focus()}}),Oe=It("button",t,{enabled:!V,stateAttributesMapping:qv,state:ve,ref:Le,props:te});return V?S.jsx(lJ,{tag:"button",render:r,className:a,state:ve,refs:Le,props:te,stateAttributesMapping:qv}):k?S.jsxs(v.Fragment,{children:[S.jsx(Cc,{ref:he,onFocus:ye},`${T}-pre-focus-guard`),S.jsx(v.Fragment,{children:Oe},T),S.jsx(Cc,{ref:C.context.triggerFocusTargetRef,onFocus:_e},`${T}-post-focus-guard`)]}):S.jsx(v.Fragment,{children:Oe},T)});function dJ(e,t){const n=Bn(),[r,a]=v.useState(!1);return qe(()=>{e&&t==="trigger-hover"?(a(!0),n.start(pF,()=>{a(!1)})):e||(n.clear(),a(!1))},[e,t,n]),r}function fJ(){const e=rf(!0),t=Jo(!0),n=hD();return v.useMemo(()=>n?{type:"menubar",context:n}:e&&!t?{type:"context-menu",context:e}:{type:void 0},[e,t,n])}function pw({...e}){return S.jsx(sJ,{"data-slot":"dropdown-menu",...e})}function mw({...e}){return S.jsx(uJ,{"data-slot":"dropdown-menu-trigger",...e})}function gw({align:e="start",alignOffset:t=0,side:n="bottom",sideOffset:r=4,backdrop:a=!1,className:o,...l}){return S.jsxs(eJ,{children:[a&&S.jsx(YZ,{className:"fixed inset-0 z-50"}),S.jsx(tJ,{className:"isolate z-50 outline-none",align:e,alignOffset:t,side:n,sideOffset:r,children:S.jsx(ZZ,{"data-slot":"dropdown-menu-content",className:Pe("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",o),...l})})]})}function ac({className:e,inset:t,variant:n="default",...r}){return S.jsx(XZ,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:Pe("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive not-data-[variant=destructive]:focus:**:text-accent-foreground gap-1.5 rounded-md px-1.5 py-1 text-sm data-inset:pl-7 [&_svg:not([class*='size-'])]:size-4 group/dropdown-menu-item relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...r})}function Wte({className:e,...t}){return S.jsx(gO,{"data-slot":"dropdown-menu-separator",className:Pe("bg-border -mx-1 my-1 h-px",e),...t})}const hJ=(e,t)=>["watch-rules",e,t],mD=e=>["watch-rule-state",e];async function Fc(e,t){try{return(await e.json()).error??t}catch{return t}}async function pJ(e,t){const n=new URLSearchParams({deviceId:e,paneId:t}),r=await fetch(`/api/watch/rules?${n}`);if(!r.ok)throw new Error(await Fc(r,"Failed to load watch rules"));return(await r.json()).rules}async function mJ(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 Fc(t,"Failed to create watch rule"));return await t.json()}async function gD(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 Fc(n,"Failed to update watch rule"));return await n.json()}async function gJ(e){const t=await fetch(`/api/watch/rules/${e}`,{method:"DELETE"});if(!t.ok)throw new Error(await Fc(t,"Failed to delete watch rule"))}async function yD(e){const t=await fetch(`/api/watch/rules/${e}/state`);if(!t.ok)throw new Error(await Fc(t,"Failed to load watch rule state"));return await t.json()}async function yJ(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 Fc(t,"Failed to generate regex"));return await t.json()}const bJ=["match","unchanged","llm"],Zb="__default__";function $k(e){return e==="llm"?30:5}function vJ({deviceId:e,paneId:t,rule:n,onSaved:r,onCancel:a}){var Re;const{t:o}=mn(),l=v.useId(),[c,f]=v.useState((n==null?void 0:n.name)??""),[d,m]=v.useState((n==null?void 0:n.triggerType)??"match"),[h,y]=v.useState((n==null?void 0:n.pattern)??""),[g,w]=v.useState((n==null?void 0:n.patternFlags)??""),[C,T]=v.useState((n==null?void 0:n.extractGroup)??0),[E,R]=v.useState((n==null?void 0:n.unchangedMinutes)??10),[k,M]=v.useState((n==null?void 0:n.noMatchBehavior)??"reset"),[D,O]=v.useState((n==null?void 0:n.conditionPrompt)??""),[A,L]=v.useState((n==null?void 0:n.providerId)??null),[q,F]=v.useState((n==null?void 0:n.modelId)??""),[W,_]=v.useState((n==null?void 0:n.confirmWithLlm)??!1),[V,$]=v.useState((n==null?void 0:n.summarizeWithLlm)??!1),[B,j]=v.useState((n==null?void 0:n.intervalSeconds)??30),[z,H]=v.useState((n==null?void 0:n.fireMode)??"once"),[K,P]=v.useState((n==null?void 0:n.cooldownSeconds)??600),[U,G]=v.useState(""),[I,Q]=v.useState(null),ae=((Re=Ei({queryKey:["llm-providers"],queryFn:async()=>{const J=await fetch("/api/llm/providers");if(!J.ok)throw new Error("Failed to load providers");return await J.json()},throwOnError:!1}).data)==null?void 0:Re.providers)??[],Z=ae.filter(J=>J.enabled),ue=ae.find(J=>J.id===A),ve=(ue==null?void 0:ue.models)??[],Se=d==="match"||d==="unchanged",Le=d==="llm"||W||V,te=$k(d),he=J=>{m(J);const Ee=$k(J);j(xe=>xe<Ee?J==="llm"?60:30:xe)},ye=()=>{if(!c.trim())return o("watch.validation.nameRequired");if(Se){if(!h)return o("watch.validation.patternRequired");try{new RegExp(h,g.replace(/g/g,""))}catch(J){return o("watch.validation.patternInvalid",{detail:J instanceof Error?J.message:String(J)})}if(d==="unchanged"&&(!E||E<=0))return o("watch.validation.unchangedMinutesInvalid")}else if(!D.trim())return o("watch.validation.conditionPromptRequired");return!Number.isInteger(B)||B<te?o("watch.validation.intervalMin",{min:te}):null},_e=yd({mutationFn:async()=>{const J={name:c.trim(),triggerType:d,pattern:Se?h:null,patternFlags:Se?g:"",extractGroup:C,conditionPrompt:d==="llm"?D:null,providerId:A,modelId:A&&q.trim()||null,confirmWithLlm:Se?W:!1,summarizeWithLlm:Se?V:!1,intervalSeconds:B,unchangedMinutes:d==="unchanged"?E:null,noMatchBehavior:k,fireMode:z,cooldownSeconds:K};if(n){const xe=J;return await gD(n.id,xe),!1}const Ee={...J,deviceId:e,paneId:t,enabled:!0};return await mJ(Ee),!0},onSuccess:J=>{sn.success(o(J?"watch.toast.created":"watch.toast.updated")),r(J)},onError:J=>{sn.error(J instanceof Error?J.message:String(J))}}),Oe=yd({mutationFn:async()=>yJ({description:U.trim(),deviceId:e,paneId:t,providerId:A,modelId:A&&q.trim()||null}),onSuccess:J=>{y(J.pattern),w(J.flags),T(J.extractGroup),Q(J)},onError:J=>{sn.error(J instanceof Error?J.message:String(J))}}),Ce=()=>{const J=ye();if(J){sn.error(J);return}_e.mutate()};return S.jsxs("form",{"data-testid":"watch-rule-form",className:"space-y-4",onSubmit:J=>{J.preventDefault(),Ce()},children:[S.jsxs("div",{className:"space-y-2",children:[S.jsx("label",{className:"block text-sm font-medium",htmlFor:`${l}-name`,children:o("watch.form.name")}),S.jsx(Pi,{id:`${l}-name`,"data-testid":"watch-form-name",value:c,maxLength:120,onChange:J=>f(J.target.value),placeholder:o("watch.form.namePlaceholder")})]}),S.jsxs("div",{className:"space-y-2",children:[S.jsx("span",{className:"block text-sm font-medium",children:o("watch.form.triggerType")}),S.jsx("div",{className:"grid gap-2",children:bJ.map(J=>S.jsxs("button",{type:"button","data-testid":`watch-form-type-${J}`,onClick:()=>he(J),className:Pe("rounded-lg border px-3 py-2 text-left transition-colors",d===J?"border-primary/50 bg-primary/10":"border-border hover:bg-accent/40"),children:[S.jsx("span",{className:"block text-sm font-medium",children:o(`watch.type.${J}`)}),S.jsx("span",{className:"block text-xs text-muted-foreground",children:o(`watch.typeDesc.${J}`)})]},J))})]}),Se&&S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:"space-y-2 rounded-lg border border-dashed border-border p-3",children:[S.jsx("label",{className:"block text-sm font-medium",htmlFor:`${l}-assist`,children:o("watch.form.assistLabel")}),S.jsxs("div",{className:"flex gap-2",children:[S.jsx(Pi,{id:`${l}-assist`,"data-testid":"watch-form-assist-input",value:U,onChange:J=>G(J.target.value),placeholder:o("watch.form.assistPlaceholder")}),S.jsxs(Ht,{type:"button",variant:"secondary","data-testid":"watch-form-assist-generate",disabled:!U.trim()||Oe.isPending,onClick:()=>Oe.mutate(),children:[Oe.isPending?S.jsx(Gs,{className:"h-4 w-4 animate-spin"}):S.jsx(lA,{className:"h-4 w-4"}),o("watch.form.assistButton")]})]}),I&&S.jsxs("div",{className:"space-y-1 text-xs","data-testid":"watch-form-assist-result",children:[S.jsxs("p",{className:"text-muted-foreground",children:[S.jsxs("span",{className:"font-medium text-foreground",children:[o("watch.form.assistExplanation"),":"]})," ",I.explanation]}),S.jsxs("p",{className:"font-medium text-foreground",children:[o("watch.form.assistPreview"),":"]}),I.preview.length===0?S.jsx("p",{className:"text-muted-foreground",children:o("watch.form.assistPreviewEmpty")}):S.jsx("ul",{className:"max-h-24 space-y-0.5 overflow-y-auto",children:I.preview.map((J,Ee)=>S.jsx("li",{className:"truncate rounded bg-muted px-1.5 py-0.5 font-mono",children:J},Ee))})]})]}),S.jsxs("div",{className:"grid grid-cols-[1fr_5rem] gap-2",children:[S.jsxs("div",{className:"space-y-2",children:[S.jsx("label",{className:"block text-sm font-medium",htmlFor:`${l}-pattern`,children:o("watch.form.pattern")}),S.jsx(Pi,{id:`${l}-pattern`,"data-testid":"watch-form-pattern",value:h,onChange:J=>y(J.target.value),placeholder:o("watch.form.patternPlaceholder"),className:"font-mono"})]}),S.jsxs("div",{className:"space-y-2",children:[S.jsx("label",{className:"block text-sm font-medium",htmlFor:`${l}-flags`,children:o("watch.form.flags")}),S.jsx(Pi,{id:`${l}-flags`,"data-testid":"watch-form-flags",value:g,onChange:J=>w(J.target.value),placeholder:o("watch.form.flagsPlaceholder"),className:"font-mono"})]})]})]}),d==="unchanged"&&S.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[S.jsxs("div",{className:"space-y-2",children:[S.jsx("label",{className:"block text-sm font-medium",htmlFor:`${l}-extract-group`,children:o("watch.form.extractGroup")}),S.jsx(Pi,{id:`${l}-extract-group`,"data-testid":"watch-form-extract-group",type:"number",min:0,step:1,value:C,onChange:J=>T(Math.max(0,Number(J.target.value)||0))}),S.jsx("p",{className:"text-xs text-muted-foreground",children:o("watch.form.extractGroupHint")})]}),S.jsxs("div",{className:"space-y-2",children:[S.jsx("label",{className:"block text-sm font-medium",htmlFor:`${l}-unchanged-minutes`,children:o("watch.form.unchangedMinutes")}),S.jsx(Pi,{id:`${l}-unchanged-minutes`,"data-testid":"watch-form-unchanged-minutes",type:"number",min:1,step:1,value:E,onChange:J=>R(Math.max(1,Number(J.target.value)||1))})]}),S.jsxs("div",{className:"col-span-2 space-y-2",children:[S.jsx("span",{className:"block text-sm font-medium",children:o("watch.form.noMatchBehavior")}),S.jsxs(up,{value:k,onValueChange:J=>{(J==="reset"||J==="ignore")&&M(J)},children:[S.jsx(dp,{className:"w-full","data-testid":"watch-form-no-match-behavior",children:S.jsx(Gb,{children:o(k==="reset"?"watch.form.noMatchReset":"watch.form.noMatchIgnore")})}),S.jsxs(fp,{children:[S.jsx(La,{value:"reset",children:o("watch.form.noMatchReset")}),S.jsx(La,{value:"ignore",children:o("watch.form.noMatchIgnore")})]})]})]})]}),d==="llm"&&S.jsxs("div",{className:"space-y-2",children:[S.jsx("label",{className:"block text-sm font-medium",htmlFor:`${l}-condition`,children:o("watch.form.conditionPrompt")}),S.jsx(H0,{id:`${l}-condition`,"data-testid":"watch-form-condition-prompt",value:D,onChange:J=>O(J.target.value),placeholder:o("watch.form.conditionPromptPlaceholder"),rows:3})]}),S.jsxs("div",{className:"space-y-2",children:[S.jsx("span",{className:"block text-sm font-medium",children:o("watch.form.model")}),S.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[S.jsxs(up,{value:A??Zb,onValueChange:J=>{if(!J)return;const Ee=J===Zb?null:J;L(Ee),Ee===null&&F("")},children:[S.jsx(dp,{className:"w-full","data-testid":"watch-form-provider",children:S.jsx(Gb,{children:A?(ue==null?void 0:ue.name)??o("watch.form.providerUnavailable"):o("watch.form.followGlobalDefault")})}),S.jsxs(fp,{children:[S.jsx(La,{value:Zb,children:o("watch.form.followGlobalDefault")}),A&&!Z.some(J=>J.id===A)&&S.jsx(La,{value:A,children:ue?`${ue.name} (${o("watch.form.providerDisabled")})`:o("watch.form.providerUnavailable")}),Z.map(J=>S.jsx(La,{value:J.id,children:J.name},J.id))]})]}),S.jsx(Pi,{"data-testid":"watch-form-model",list:`${l}-model-options`,value:q,disabled:!A,onChange:J=>F(J.target.value),placeholder:o("watch.form.modelPlaceholder")}),S.jsx("datalist",{id:`${l}-model-options`,children:ve.map(J=>S.jsx("option",{value:J},J))})]}),Le&&S.jsx("p",{className:"rounded-md bg-primary/10 px-2 py-1.5 text-xs text-primary","data-testid":"watch-form-model-hint",children:o("watch.form.modelRequiredHint")})]}),Se&&S.jsxs("div",{className:"space-y-3",children:[S.jsxs("div",{className:"flex items-center justify-between gap-2",children:[S.jsxs("div",{children:[S.jsx("span",{className:"block text-sm font-medium",children:o("watch.form.confirmWithLlm")}),S.jsx("span",{className:"block text-xs text-muted-foreground",children:o("watch.form.confirmWithLlmDesc")})]}),S.jsx(Lp,{checked:W,onCheckedChange:J=>_(!!J),"data-testid":"watch-form-confirm-llm"})]}),S.jsxs("div",{className:"flex items-center justify-between gap-2",children:[S.jsxs("div",{children:[S.jsx("span",{className:"block text-sm font-medium",children:o("watch.form.summarizeWithLlm")}),S.jsx("span",{className:"block text-xs text-muted-foreground",children:o("watch.form.summarizeWithLlmDesc")})]}),S.jsx(Lp,{checked:V,onCheckedChange:J=>$(!!J),"data-testid":"watch-form-summarize-llm"})]})]}),S.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[S.jsxs("div",{className:"space-y-2",children:[S.jsx("label",{className:"block text-sm font-medium",htmlFor:`${l}-interval`,children:o("watch.form.intervalSeconds")}),S.jsx(Pi,{id:`${l}-interval`,"data-testid":"watch-form-interval",type:"number",min:te,step:1,value:B,onChange:J=>j(Number(J.target.value)||0)}),S.jsx("p",{className:"text-xs text-muted-foreground",children:o("watch.form.intervalHint",{min:te})})]}),S.jsxs("div",{className:"space-y-2",children:[S.jsx("span",{className:"block text-sm font-medium",children:o("watch.form.fireMode")}),S.jsxs(up,{value:z,onValueChange:J=>{(J==="once"||J==="repeat")&&H(J)},children:[S.jsx(dp,{className:"w-full","data-testid":"watch-form-fire-mode",children:S.jsx(Gb,{children:o(z==="once"?"watch.form.fireOnce":"watch.form.fireRepeat")})}),S.jsxs(fp,{children:[S.jsx(La,{value:"once",children:o("watch.form.fireOnce")}),S.jsx(La,{value:"repeat",children:o("watch.form.fireRepeat")})]})]}),z==="repeat"&&S.jsx(Pi,{"data-testid":"watch-form-cooldown",type:"number",min:0,step:1,value:K,onChange:J=>P(Math.max(0,Number(J.target.value)||0)),"aria-label":o("watch.form.cooldownSeconds"),placeholder:o("watch.form.cooldownSeconds")})]})]}),S.jsxs("div",{className:"flex justify-end gap-2",children:[S.jsx(Ht,{type:"button",variant:"outline",onClick:a,"data-testid":"watch-form-cancel",children:o("common.cancel")}),S.jsxs(Ht,{type:"submit",disabled:_e.isPending,"data-testid":"watch-form-save",children:[_e.isPending&&S.jsx(Gs,{className:"h-4 w-4 animate-spin"}),o(n?"watch.form.save":"watch.form.create")]})]})]})}function Ju(e){if(!e)return null;const t=new Date(e);return Number.isNaN(t.getTime())?null:t.toLocaleString()}function xJ({open:e,onOpenChange:t,deviceId:n,paneId:r}){const{t:a}=mn(),o=el(),[l,c]=v.useState({mode:"list"}),[f,d]=v.useState(null),[m,h]=v.useState(!1);v.useEffect(()=>{e||(c({mode:"list"}),d(null),h(!1))},[e]);const y=Ei({queryKey:hJ(n,r),queryFn:()=>pJ(n,r),enabled:e,throwOnError:!1}),g=()=>{o.invalidateQueries({queryKey:["watch-rules"]})},w=yd({mutationFn:async({rule:R,enabled:k})=>{await gD(R.id,{enabled:k})},onSuccess:g,onError:R=>{sn.error(R instanceof Error?R.message:String(R)),g()}}),C=yd({mutationFn:async R=>{await gJ(R.id)},onSuccess:()=>{sn.success(a("watch.toast.deleted")),g()},onError:R=>{sn.error(R instanceof Error?R.message:String(R))}}),T=R=>{g(),c({mode:"list"}),R&&typeof Notification<"u"&&Notification.permission==="default"&&h(!0)},E=y.data??[];return S.jsxs(S.Fragment,{children:[S.jsx(vx,{open:e,onOpenChange:t,children:S.jsxs(xx,{className:"sm:max-w-lg max-h-[85dvh] grid-rows-[auto_minmax(0,1fr)]","data-testid":"watch-dialog",children:[S.jsxs(wx,{children:[S.jsxs(Sx,{children:[l.mode==="list"&&a("watch.title"),l.mode==="form"&&(l.rule?a("watch.form.editTitle"):a("watch.form.createTitle")),l.mode==="state"&&a("watch.state.title")]}),S.jsx(lD,{children:l.mode==="list"?a("watch.dialogDesc"):null})]}),S.jsxs("div",{className:"min-h-0 overflow-y-auto pr-1",children:[l.mode==="list"&&S.jsxs("div",{className:"space-y-3",children:[m&&S.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:[S.jsx(r8,{className:"mt-0.5 h-4 w-4 shrink-0 text-primary"}),S.jsxs("div",{className:"min-w-0 flex-1",children:[S.jsx("p",{className:"text-sm font-medium",children:a("watch.notifPermission.title")}),S.jsx("p",{className:"text-xs text-muted-foreground",children:a("watch.notifPermission.desc")}),S.jsxs("div",{className:"mt-2 flex gap-2",children:[S.jsx(Ht,{size:"sm","data-testid":"watch-notif-enable",onClick:()=>{Notification.requestPermission().finally(()=>h(!1))},children:a("watch.notifPermission.enable")}),S.jsx(Ht,{size:"sm",variant:"ghost",onClick:()=>h(!1),children:a("watch.notifPermission.dismiss")})]})]})]}),y.isLoading&&S.jsx("div",{className:"flex justify-center py-6",children:S.jsx(Gs,{className:"h-5 w-5 animate-spin text-muted-foreground"})}),!y.isLoading&&E.length===0&&S.jsx("p",{className:"py-6 text-center text-sm text-muted-foreground","data-testid":"watch-rules-empty",children:a("watch.rules.empty")}),E.map(R=>S.jsx(wJ,{rule:R,onToggle:k=>w.mutate({rule:R,enabled:k}),onEdit:()=>c({mode:"form",rule:R}),onViewState:()=>c({mode:"state",rule:R}),onDelete:()=>d(R)},R.id)),S.jsxs(Ht,{variant:"outline",className:"w-full","data-testid":"watch-rule-add",onClick:()=>c({mode:"form",rule:null}),children:[S.jsx(wm,{className:"h-4 w-4"}),a("watch.rules.addRule")]})]}),l.mode==="form"&&S.jsx(vJ,{deviceId:n,paneId:r,rule:l.rule,onSaved:T,onCancel:()=>c({mode:"list"})}),l.mode==="state"&&S.jsx(SJ,{rule:l.rule,onBack:()=>c({mode:"list"})})]})]})}),S.jsx(dx,{open:f!==null,onOpenChange:R=>!R&&d(null),children:S.jsxs(fx,{"data-testid":"watch-rule-delete-dialog",children:[S.jsxs(hx,{children:[S.jsx(mx,{children:a("watch.rules.deleteTitle")}),S.jsx(gx,{children:a("watch.rules.deleteDesc",{name:(f==null?void 0:f.name)??""})})]}),S.jsxs(px,{children:[S.jsx(bx,{children:a("common.cancel")}),S.jsx(yx,{variant:"destructive","data-testid":"watch-rule-delete-confirm",onClick:()=>{f&&C.mutate(f),d(null)},children:a("watch.rules.deleteConfirm")})]})]})})]})}function wJ({rule:e,onToggle:t,onEdit:n,onViewState:r,onDelete:a}){var f,d;const{t:o}=mn(),l=Ei({queryKey:mD(e.id),queryFn:()=>yD(e.id),throwOnError:!1}),c=Ju((d=(f=l.data)==null?void 0:f.state)==null?void 0:d.lastTriggeredAt);return S.jsxs("div",{className:"rounded-lg border border-border p-3","data-testid":`watch-rule-item-${e.id}`,"data-rule-name":e.name,children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:e.name}),S.jsx(Zs,{variant:"secondary",children:o(`watch.type.${e.triggerType}`)}),S.jsx(Lp,{checked:e.enabled,onCheckedChange:m=>t(!!m),"data-testid":`watch-rule-toggle-${e.id}`})]}),S.jsxs("div",{className:"mt-2 flex items-center justify-between gap-2",children:[S.jsx("span",{className:"truncate text-xs text-muted-foreground",children:c?o("watch.rules.lastTriggered",{time:c}):o("watch.rules.neverTriggered")}),S.jsxs("div",{className:"flex shrink-0 gap-1",children:[S.jsx(Ht,{variant:"ghost",size:"icon-xs",onClick:r,title:o("watch.rules.viewState"),"aria-label":o("watch.rules.viewState"),"data-testid":`watch-rule-state-${e.id}`,children:S.jsx(Q6,{className:"h-3.5 w-3.5"})}),S.jsx(Ht,{variant:"ghost",size:"icon-xs",onClick:n,title:o("watch.rules.edit"),"aria-label":o("watch.rules.edit"),"data-testid":`watch-rule-edit-${e.id}`,children:S.jsx(xm,{className:"h-3.5 w-3.5"})}),S.jsx(Ht,{variant:"ghost",size:"icon-xs",onClick:a,title:o("watch.rules.delete"),"aria-label":o("watch.rules.delete"),"data-testid":`watch-rule-delete-${e.id}`,children:S.jsx(cA,{className:"h-3.5 w-3.5 text-destructive"})})]})]})]})}function SJ({rule:e,onBack:t}){var f,d;const{t:n}=mn(),r=Ei({queryKey:mD(e.id),queryFn:()=>yD(e.id),refetchInterval:5e3,throwOnError:!1}),a=((f=r.data)==null?void 0:f.state)??null,o=((d=r.data)==null?void 0:d.samples)??[],l=n("watch.state.none"),c=[{label:n("watch.state.lastSampledAt"),value:Ju(a==null?void 0:a.lastSampledAt)??l},{label:n("watch.state.lastValue"),value:(a==null?void 0:a.lastValue)??l},{label:n("watch.state.lastValueChangedAt"),value:Ju(a==null?void 0:a.lastValueChangedAt)??l},{label:n("watch.state.lastTriggeredAt"),value:Ju(a==null?void 0:a.lastTriggeredAt)??l},{label:n("watch.state.consecutiveErrors"),value:a?String(a.consecutiveErrors):l},{label:n("watch.state.lastError"),value:(a==null?void 0:a.lastError)??l}];return S.jsxs("div",{className:"space-y-3","data-testid":"watch-rule-state-view",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(Ht,{variant:"ghost",size:"icon-sm",onClick:t,"aria-label":n("watch.state.back"),children:S.jsx(t8,{className:"h-4 w-4"})}),S.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:e.name}),S.jsx(Zs,{variant:"secondary",children:n(`watch.type.${e.triggerType}`)})]}),r.isLoading?S.jsx("div",{className:"flex justify-center py-6",children:S.jsx(Gs,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):S.jsxs(S.Fragment,{children:[S.jsx("dl",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-1.5 text-sm",children:c.map(m=>S.jsxs("div",{className:"contents",children:[S.jsx("dt",{className:"text-muted-foreground",children:m.label}),S.jsx("dd",{className:"min-w-0 break-all",children:m.value})]},m.label))}),S.jsxs("div",{className:"space-y-1.5",children:[S.jsx("p",{className:"text-sm font-medium",children:n("watch.state.samples")}),o.length===0?S.jsx("p",{className:"text-xs text-muted-foreground",children:n("watch.state.samplesEmpty")}):S.jsx("ul",{className:"max-h-48 space-y-0.5 overflow-y-auto text-xs",children:[...o].reverse().map(m=>S.jsxs("li",{className:"flex items-center gap-2 rounded bg-muted/60 px-2 py-1",children:[S.jsx("span",{className:"shrink-0 font-mono text-muted-foreground",children:Ju(m.at)??m.at}),S.jsx("span",{className:"min-w-0 flex-1 truncate font-mono",children:m.value??l}),m.hit&&S.jsx(Zs,{variant:"default",className:"h-4 px-1 text-[10px]",children:n("watch.state.hit")})]},m.at))})]})]})]})}function EJ(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return v.useMemo(()=>r=>{t.forEach(a=>a(r))},t)}const Dm=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Bc(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function yw(e){return"nodeType"in e}function Vr(e){var t,n;return e?Bc(e)?e:yw(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function bw(e){const{Document:t}=Vr(e);return e instanceof t}function af(e){return Bc(e)?!1:e instanceof Vr(e).HTMLElement}function bD(e){return e instanceof Vr(e).SVGElement}function Hc(e){return e?Bc(e)?e.document:yw(e)?bw(e)?e:af(e)||bD(e)?e.ownerDocument:document:document:document}const la=Dm?v.useLayoutEffect:v.useEffect;function vw(e){const t=v.useRef(e);return la(()=>{t.current=e}),v.useCallback(function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return t.current==null?void 0:t.current(...r)},[])}function CJ(){const e=v.useRef(null),t=v.useCallback((r,a)=>{e.current=setInterval(r,a)},[]),n=v.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Od(e,t){t===void 0&&(t=[e]);const n=v.useRef(e);return la(()=>{n.current!==e&&(n.current=e)},t),n}function of(e,t){const n=v.useRef();return v.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Vp(e){const t=vw(e),n=v.useRef(null),r=v.useCallback(a=>{a!==n.current&&(t==null||t(a,n.current)),n.current=a},[]);return[n,r]}function Ex(e){const t=v.useRef();return v.useEffect(()=>{t.current=e},[e]),t.current}let Jb={};function sf(e,t){return v.useMemo(()=>{if(t)return t;const n=Jb[e]==null?0:Jb[e]+1;return Jb[e]=n,e+"-"+n},[e,t])}function vD(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return r.reduce((o,l)=>{const c=Object.entries(l);for(const[f,d]of c){const m=o[f];m!=null&&(o[f]=m+e*d)}return o},{...t})}}const oc=vD(1),Ad=vD(-1);function TJ(e){return"clientX"in e&&"clientY"in e}function xw(e){if(!e)return!1;const{KeyboardEvent:t}=Vr(e.target);return t&&e instanceof t}function RJ(e){if(!e)return!1;const{TouchEvent:t}=Vr(e.target);return t&&e instanceof t}function Cx(e){if(RJ(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 TJ(e)?{x:e.clientX,y:e.clientY}:null}const Js=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[Js.Translate.toString(e),Js.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Yk="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function kJ(e){return e.matches(Yk)?e:e.querySelector(Yk)}const MJ={display:"none"};function OJ(e){let{id:t,value:n}=e;return Fe.createElement("div",{id:t,style:MJ},n)}function AJ(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const a={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 Fe.createElement("div",{id:t,style:a,role:"status","aria-live":r,"aria-atomic":!0},n)}function NJ(){const[e,t]=v.useState("");return{announce:v.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const xD=v.createContext(null);function DJ(e){const t=v.useContext(xD);v.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function IJ(){const[e]=v.useState(()=>new Set),t=v.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[v.useCallback(r=>{let{type:a,event:o}=r;e.forEach(l=>{var c;return(c=l[a])==null?void 0:c.call(l,o)})},[e]),t]}const PJ={draggable:`
462
+ To pick up a draggable item, press the space bar.
463
+ While dragging, use the arrow keys to move the item.
464
+ Press space again to drop the item in its new position, or press escape to cancel.
465
+ `},LJ={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 _J(e){let{announcements:t=LJ,container:n,hiddenTextDescribedById:r,screenReaderInstructions:a=PJ}=e;const{announce:o,announcement:l}=NJ(),c=sf("DndLiveRegion"),[f,d]=v.useState(!1);if(v.useEffect(()=>{d(!0)},[]),DJ(v.useMemo(()=>({onDragStart(h){let{active:y}=h;o(t.onDragStart({active:y}))},onDragMove(h){let{active:y,over:g}=h;t.onDragMove&&o(t.onDragMove({active:y,over:g}))},onDragOver(h){let{active:y,over:g}=h;o(t.onDragOver({active:y,over:g}))},onDragEnd(h){let{active:y,over:g}=h;o(t.onDragEnd({active:y,over:g}))},onDragCancel(h){let{active:y,over:g}=h;o(t.onDragCancel({active:y,over:g}))}}),[o,t])),!f)return null;const m=Fe.createElement(Fe.Fragment,null,Fe.createElement(OJ,{id:r,value:a.draggable}),Fe.createElement(AJ,{id:c,announcement:l}));return n?pr.createPortal(m,n):m}var er;(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"})(er||(er={}));function $p(){}function ev(e,t){return v.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function jJ(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return v.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const Hi=Object.freeze({x:0,y:0});function wD(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function SD(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function zJ(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Wk(e){let{left:t,top:n,height:r,width:a}=e;return[{x:t,y:n},{x:t+a,y:n},{x:t,y:n+r},{x:t+a,y:n+r}]}function ED(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Kk(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 ww=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const a=Kk(t,t.left,t.top),o=[];for(const l of r){const{id:c}=l,f=n.get(c);if(f){const d=wD(Kk(f),a);o.push({id:c,data:{droppableContainer:l,value:d}})}}return o.sort(SD)},FJ=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const a=Wk(t),o=[];for(const l of r){const{id:c}=l,f=n.get(c);if(f){const d=Wk(f),m=a.reduce((y,g,w)=>y+wD(d[w],g),0),h=Number((m/4).toFixed(4));o.push({id:c,data:{droppableContainer:l,value:h}})}}return o.sort(SD)};function BJ(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),a=Math.min(t.left+t.width,e.left+e.width),o=Math.min(t.top+t.height,e.top+e.height),l=a-r,c=o-n;if(r<a&&n<o){const f=t.width*t.height,d=e.width*e.height,m=l*c,h=m/(f+d-m);return Number(h.toFixed(4))}return 0}const HJ=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const a=[];for(const o of r){const{id:l}=o,c=n.get(l);if(c){const f=BJ(c,t);f>0&&a.push({id:l,data:{droppableContainer:o,value:f}})}}return a.sort(zJ)};function UJ(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function CD(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Hi}function qJ(e){return function(n){for(var r=arguments.length,a=new Array(r>1?r-1:0),o=1;o<r;o++)a[o-1]=arguments[o];return a.reduce((l,c)=>({...l,top:l.top+e*c.y,bottom:l.bottom+e*c.y,left:l.left+e*c.x,right:l.right+e*c.x}),{...n})}}const VJ=qJ(1);function $J(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 YJ(e,t,n){const r=$J(t);if(!r)return e;const{scaleX:a,scaleY:o,x:l,y:c}=r,f=e.left-l-(1-a)*parseFloat(n),d=e.top-c-(1-o)*parseFloat(n.slice(n.indexOf(" ")+1)),m=a?e.width/a:e.width,h=o?e.height/o:e.height;return{width:m,height:h,top:d,right:f+m,bottom:d+h,left:f}}const WJ={ignoreTransform:!1};function Uc(e,t){t===void 0&&(t=WJ);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:m}=Vr(e).getComputedStyle(e);d&&(n=YJ(n,d,m))}const{top:r,left:a,width:o,height:l,bottom:c,right:f}=n;return{top:r,left:a,width:o,height:l,bottom:c,right:f}}function Gk(e){return Uc(e,{ignoreTransform:!0})}function KJ(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function GJ(e,t){return t===void 0&&(t=Vr(e).getComputedStyle(e)),t.position==="fixed"}function XJ(e,t){t===void 0&&(t=Vr(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(a=>{const o=t[a];return typeof o=="string"?n.test(o):!1})}function Im(e,t){const n=[];function r(a){if(t!=null&&n.length>=t||!a)return n;if(bw(a)&&a.scrollingElement!=null&&!n.includes(a.scrollingElement))return n.push(a.scrollingElement),n;if(!af(a)||bD(a)||n.includes(a))return n;const o=Vr(e).getComputedStyle(a);return a!==e&&XJ(a,o)&&n.push(a),GJ(a,o)?n:r(a.parentNode)}return e?r(e):n}function TD(e){const[t]=Im(e,1);return t??null}function tv(e){return!Dm||!e?null:Bc(e)?e:yw(e)?bw(e)||e===Hc(e).scrollingElement?window:af(e)?e:null:null}function RD(e){return Bc(e)?e.scrollX:e.scrollLeft}function kD(e){return Bc(e)?e.scrollY:e.scrollTop}function Tx(e){return{x:RD(e),y:kD(e)}}var or;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(or||(or={}));function MD(e){return!Dm||!e?!1:e===document.scrollingElement}function OD(e){const t={x:0,y:0},n=MD(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},a=e.scrollTop<=t.y,o=e.scrollLeft<=t.x,l=e.scrollTop>=r.y,c=e.scrollLeft>=r.x;return{isTop:a,isLeft:o,isBottom:l,isRight:c,maxScroll:r,minScroll:t}}const QJ={x:.2,y:.2};function ZJ(e,t,n,r,a){let{top:o,left:l,right:c,bottom:f}=n;r===void 0&&(r=10),a===void 0&&(a=QJ);const{isTop:d,isBottom:m,isLeft:h,isRight:y}=OD(e),g={x:0,y:0},w={x:0,y:0},C={height:t.height*a.y,width:t.width*a.x};return!d&&o<=t.top+C.height?(g.y=or.Backward,w.y=r*Math.abs((t.top+C.height-o)/C.height)):!m&&f>=t.bottom-C.height&&(g.y=or.Forward,w.y=r*Math.abs((t.bottom-C.height-f)/C.height)),!y&&c>=t.right-C.width?(g.x=or.Forward,w.x=r*Math.abs((t.right-C.width-c)/C.width)):!h&&l<=t.left+C.width&&(g.x=or.Backward,w.x=r*Math.abs((t.left+C.width-l)/C.width)),{direction:g,speed:w}}function JJ(e){if(e===document.scrollingElement){const{innerWidth:o,innerHeight:l}=window;return{top:0,left:0,right:o,bottom:l,width:o,height:l}}const{top:t,left:n,right:r,bottom:a}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:a,width:e.clientWidth,height:e.clientHeight}}function AD(e){return e.reduce((t,n)=>oc(t,Tx(n)),Hi)}function eee(e){return e.reduce((t,n)=>t+RD(n),0)}function tee(e){return e.reduce((t,n)=>t+kD(n),0)}function nee(e,t){if(t===void 0&&(t=Uc),!e)return;const{top:n,left:r,bottom:a,right:o}=t(e);TD(e)&&(a<=0||o<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const ree=[["x",["left","right"],eee],["y",["top","bottom"],tee]];class Sw{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 r=Im(n),a=AD(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[o,l,c]of ree)for(const f of l)Object.defineProperty(this,f,{get:()=>{const d=c(r),m=a[o]-d;return this.rect[f]+m},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class hd{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var a;(a=this.target)==null||a.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function iee(e){const{EventTarget:t}=Vr(e);return e instanceof t?e:Hc(e)}function nv(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var vi;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(vi||(vi={}));function Xk(e){e.preventDefault()}function aee(e){e.stopPropagation()}var rn;(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"})(rn||(rn={}));const ND={start:[rn.Space,rn.Enter],cancel:[rn.Esc],end:[rn.Space,rn.Enter,rn.Tab]},oee=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case rn.Right:return{...n,x:n.x+25};case rn.Left:return{...n,x:n.x-25};case rn.Down:return{...n,y:n.y+25};case rn.Up:return{...n,y:n.y-25}}};class Ew{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 hd(Hc(n)),this.windowListeners=new hd(Vr(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(vi.Resize,this.handleCancel),this.windowListeners.add(vi.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(vi.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&nee(r),n(Hi)}handleKeyDown(t){if(xw(t)){const{active:n,context:r,options:a}=this.props,{keyboardCodes:o=ND,coordinateGetter:l=oee,scrollBehavior:c="smooth"}=a,{code:f}=t;if(o.end.includes(f)){this.handleEnd(t);return}if(o.cancel.includes(f)){this.handleCancel(t);return}const{collisionRect:d}=r.current,m=d?{x:d.left,y:d.top}:Hi;this.referenceCoordinates||(this.referenceCoordinates=m);const h=l(t,{active:n,context:r.current,currentCoordinates:m});if(h){const y=Ad(h,m),g={x:0,y:0},{scrollableAncestors:w}=r.current;for(const C of w){const T=t.code,{isTop:E,isRight:R,isLeft:k,isBottom:M,maxScroll:D,minScroll:O}=OD(C),A=JJ(C),L={x:Math.min(T===rn.Right?A.right-A.width/2:A.right,Math.max(T===rn.Right?A.left:A.left+A.width/2,h.x)),y:Math.min(T===rn.Down?A.bottom-A.height/2:A.bottom,Math.max(T===rn.Down?A.top:A.top+A.height/2,h.y))},q=T===rn.Right&&!R||T===rn.Left&&!k,F=T===rn.Down&&!M||T===rn.Up&&!E;if(q&&L.x!==h.x){const W=C.scrollLeft+y.x,_=T===rn.Right&&W<=D.x||T===rn.Left&&W>=O.x;if(_&&!y.y){C.scrollTo({left:W,behavior:c});return}_?g.x=C.scrollLeft-W:g.x=T===rn.Right?C.scrollLeft-D.x:C.scrollLeft-O.x,g.x&&C.scrollBy({left:-g.x,behavior:c});break}else if(F&&L.y!==h.y){const W=C.scrollTop+y.y,_=T===rn.Down&&W<=D.y||T===rn.Up&&W>=O.y;if(_&&!y.x){C.scrollTo({top:W,behavior:c});return}_?g.y=C.scrollTop-W:g.y=T===rn.Down?C.scrollTop-D.y:C.scrollTop-O.y,g.y&&C.scrollBy({top:-g.y,behavior:c});break}}this.handleMove(t,oc(Ad(h,this.referenceCoordinates),g))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(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()}}Ew.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=ND,onActivation:a}=t,{active:o}=n;const{code:l}=e.nativeEvent;if(r.start.includes(l)){const c=o.activatorNode.current;return c&&e.target!==c?!1:(e.preventDefault(),a==null||a({event:e.nativeEvent}),!0)}return!1}}];function Qk(e){return!!(e&&"distance"in e)}function Zk(e){return!!(e&&"delay"in e)}class Cw{constructor(t,n,r){var a;r===void 0&&(r=iee(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:o}=t,{target:l}=o;this.props=t,this.events=n,this.document=Hc(l),this.documentListeners=new hd(this.document),this.listeners=new hd(r),this.windowListeners=new hd(Vr(l)),this.initialCoordinates=(a=Cx(o))!=null?a:Hi,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:r}}}=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(vi.Resize,this.handleCancel),this.windowListeners.add(vi.DragStart,Xk),this.windowListeners.add(vi.VisibilityChange,this.handleCancel),this.windowListeners.add(vi.ContextMenu,Xk),this.documentListeners.add(vi.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Zk(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Qk(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:r,onPending:a}=this.props;a(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(vi.Click,aee,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(vi.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:a,props:o}=this,{onMove:l,options:{activationConstraint:c}}=o;if(!a)return;const f=(n=Cx(t))!=null?n:Hi,d=Ad(a,f);if(!r&&c){if(Qk(c)){if(c.tolerance!=null&&nv(d,c.tolerance))return this.handleCancel();if(nv(d,c.distance))return this.handleStart()}if(Zk(c)&&nv(d,c.tolerance))return this.handleCancel();this.handlePending(c,d);return}t.cancelable&&t.preventDefault(),l(f)}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===rn.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const see={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class DD extends Cw{constructor(t){const{event:n}=t,r=Hc(n.target);super(t,see,r)}}DD.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const lee={move:{name:"mousemove"},end:{name:"mouseup"}};var Rx;(function(e){e[e.RightClick=2]="RightClick"})(Rx||(Rx={}));class ID extends Cw{constructor(t){super(t,lee,Hc(t.event.target))}}ID.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===Rx.RightClick?!1:(r==null||r({event:n}),!0)}}];const rv={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class PD extends Cw{constructor(t){super(t,rv)}static setup(){return window.addEventListener(rv.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(rv.move.name,t)};function t(){}}}PD.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:a}=n;return a.length>1?!1:(r==null||r({event:n}),!0)}}];var pd;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(pd||(pd={}));var Yp;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Yp||(Yp={}));function cee(e){let{acceleration:t,activator:n=pd.Pointer,canScroll:r,draggingRect:a,enabled:o,interval:l=5,order:c=Yp.TreeOrder,pointerCoordinates:f,scrollableAncestors:d,scrollableAncestorRects:m,delta:h,threshold:y}=e;const g=dee({delta:h,disabled:!o}),[w,C]=CJ(),T=v.useRef({x:0,y:0}),E=v.useRef({x:0,y:0}),R=v.useMemo(()=>{switch(n){case pd.Pointer:return f?{top:f.y,bottom:f.y,left:f.x,right:f.x}:null;case pd.DraggableRect:return a}},[n,a,f]),k=v.useRef(null),M=v.useCallback(()=>{const O=k.current;if(!O)return;const A=T.current.x*E.current.x,L=T.current.y*E.current.y;O.scrollBy(A,L)},[]),D=v.useMemo(()=>c===Yp.TreeOrder?[...d].reverse():d,[c,d]);v.useEffect(()=>{if(!o||!d.length||!R){C();return}for(const O of D){if((r==null?void 0:r(O))===!1)continue;const A=d.indexOf(O),L=m[A];if(!L)continue;const{direction:q,speed:F}=ZJ(O,L,R,t,y);for(const W of["x","y"])g[W][q[W]]||(F[W]=0,q[W]=0);if(F.x>0||F.y>0){C(),k.current=O,w(M,l),T.current=F,E.current=q;return}}T.current={x:0,y:0},E.current={x:0,y:0},C()},[t,M,r,C,o,l,JSON.stringify(R),JSON.stringify(g),w,d,D,m,JSON.stringify(y)])}const uee={x:{[or.Backward]:!1,[or.Forward]:!1},y:{[or.Backward]:!1,[or.Forward]:!1}};function dee(e){let{delta:t,disabled:n}=e;const r=Ex(t);return of(a=>{if(n||!r||!a)return uee;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[or.Backward]:a.x[or.Backward]||o.x===-1,[or.Forward]:a.x[or.Forward]||o.x===1},y:{[or.Backward]:a.y[or.Backward]||o.y===-1,[or.Forward]:a.y[or.Forward]||o.y===1}}},[n,t,r])}function fee(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return of(a=>{var o;return t==null?null:(o=r??a)!=null?o:null},[r,t])}function hee(e,t){return v.useMemo(()=>e.reduce((n,r)=>{const{sensor:a}=r,o=a.activators.map(l=>({eventName:l.eventName,handler:t(l.handler,r)}));return[...n,...o]},[]),[e,t])}var Nd;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Nd||(Nd={}));var kx;(function(e){e.Optimized="optimized"})(kx||(kx={}));const Jk=new Map;function pee(e,t){let{dragging:n,dependencies:r,config:a}=t;const[o,l]=v.useState(null),{frequency:c,measure:f,strategy:d}=a,m=v.useRef(e),h=T(),y=Od(h),g=v.useCallback(function(E){E===void 0&&(E=[]),!y.current&&l(R=>R===null?E:R.concat(E.filter(k=>!R.includes(k))))},[y]),w=v.useRef(null),C=of(E=>{if(h&&!n)return Jk;if(!E||E===Jk||m.current!==e||o!=null){const R=new Map;for(let k of e){if(!k)continue;if(o&&o.length>0&&!o.includes(k.id)&&k.rect.current){R.set(k.id,k.rect.current);continue}const M=k.node.current,D=M?new Sw(f(M),M):null;k.rect.current=D,D&&R.set(k.id,D)}return R}return E},[e,o,n,h,f]);return v.useEffect(()=>{m.current=e},[e]),v.useEffect(()=>{h||g()},[n,h]),v.useEffect(()=>{o&&o.length>0&&l(null)},[JSON.stringify(o)]),v.useEffect(()=>{h||typeof c!="number"||w.current!==null||(w.current=setTimeout(()=>{g(),w.current=null},c))},[c,h,g,...r]),{droppableRects:C,measureDroppableContainers:g,measuringScheduled:o!=null};function T(){switch(d){case Nd.Always:return!1;case Nd.BeforeDragging:return n;default:return!n}}}function LD(e,t){return of(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function mee(e,t){return LD(e,t)}function gee(e){let{callback:t,disabled:n}=e;const r=vw(t),a=v.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:o}=window;return new o(r)},[r,n]);return v.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function Pm(e){let{callback:t,disabled:n}=e;const r=vw(t),a=v.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:o}=window;return new o(r)},[n]);return v.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function yee(e){return new Sw(Uc(e),e)}function eM(e,t,n){t===void 0&&(t=yee);const[r,a]=v.useState(null);function o(){a(f=>{if(!e)return null;if(e.isConnected===!1){var d;return(d=f??n)!=null?d:null}const m=t(e);return JSON.stringify(f)===JSON.stringify(m)?f:m})}const l=gee({callback(f){if(e)for(const d of f){const{type:m,target:h}=d;if(m==="childList"&&h instanceof HTMLElement&&h.contains(e)){o();break}}}}),c=Pm({callback:o});return la(()=>{o(),e?(c==null||c.observe(e),l==null||l.observe(document.body,{childList:!0,subtree:!0})):(c==null||c.disconnect(),l==null||l.disconnect())},[e]),r}function bee(e){const t=LD(e);return CD(e,t)}const tM=[];function vee(e){const t=v.useRef(e),n=of(r=>e?r&&r!==tM&&e&&t.current&&e.parentNode===t.current.parentNode?r:Im(e):tM,[e]);return v.useEffect(()=>{t.current=e},[e]),n}function xee(e){const[t,n]=v.useState(null),r=v.useRef(e),a=v.useCallback(o=>{const l=tv(o.target);l&&n(c=>c?(c.set(l,Tx(l)),new Map(c)):null)},[]);return v.useEffect(()=>{const o=r.current;if(e!==o){l(o);const c=e.map(f=>{const d=tv(f);return d?(d.addEventListener("scroll",a,{passive:!0}),[d,Tx(d)]):null}).filter(f=>f!=null);n(c.length?new Map(c):null),r.current=e}return()=>{l(e),l(o)};function l(c){c.forEach(f=>{const d=tv(f);d==null||d.removeEventListener("scroll",a)})}},[a,e]),v.useMemo(()=>e.length?t?Array.from(t.values()).reduce((o,l)=>oc(o,l),Hi):AD(e):Hi,[e,t])}function nM(e,t){t===void 0&&(t=[]);const n=v.useRef(null);return v.useEffect(()=>{n.current=null},t),v.useEffect(()=>{const r=e!==Hi;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Ad(e,n.current):Hi}function wee(e){v.useEffect(()=>{if(!Dm)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function See(e,t){return v.useMemo(()=>e.reduce((n,r)=>{let{eventName:a,handler:o}=r;return n[a]=l=>{o(l,t)},n},{}),[e,t])}function _D(e){return v.useMemo(()=>e?KJ(e):null,[e])}const rM=[];function Eee(e,t){t===void 0&&(t=Uc);const[n]=e,r=_D(n?Vr(n):null),[a,o]=v.useState(rM);function l(){o(()=>e.length?e.map(f=>MD(f)?r:new Sw(t(f),f)):rM)}const c=Pm({callback:l});return la(()=>{c==null||c.disconnect(),l(),e.forEach(f=>c==null?void 0:c.observe(f))},[e]),a}function Cee(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return af(t)?t:e}function Tee(e){let{measure:t}=e;const[n,r]=v.useState(null),a=v.useCallback(d=>{for(const{target:m}of d)if(af(m)){r(h=>{const y=t(m);return h?{...h,width:y.width,height:y.height}:y});break}},[t]),o=Pm({callback:a}),l=v.useCallback(d=>{const m=Cee(d);o==null||o.disconnect(),m&&(o==null||o.observe(m)),r(m?t(m):null)},[t,o]),[c,f]=Vp(l);return v.useMemo(()=>({nodeRef:c,rect:n,setRef:f}),[n,c,f])}const Ree=[{sensor:DD,options:{}},{sensor:Ew,options:{}}],kee={current:{}},mp={draggable:{measure:Gk},droppable:{measure:Gk,strategy:Nd.WhileDragging,frequency:kx.Optimized},dragOverlay:{measure:Uc}};class md 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,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const Mee={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new md,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:$p},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:mp,measureDroppableContainers:$p,windowRect:null,measuringScheduled:!1},Oee={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:$p,draggableNodes:new Map,over:null,measureDroppableContainers:$p},Lm=v.createContext(Oee),jD=v.createContext(Mee);function Aee(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new md}}}function Nee(e,t){switch(t.type){case er.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case er.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 er.DragEnd:case er.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case er.RegisterDroppable:{const{element:n}=t,{id:r}=n,a=new md(e.droppable.containers);return a.set(r,n),{...e,droppable:{...e.droppable,containers:a}}}case er.SetDroppableDisabled:{const{id:n,key:r,disabled:a}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const l=new md(e.droppable.containers);return l.set(n,{...o,disabled:a}),{...e,droppable:{...e.droppable,containers:l}}}case er.UnregisterDroppable:{const{id:n,key:r}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;const o=new md(e.droppable.containers);return o.delete(n),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function Dee(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:a}=v.useContext(Lm),o=Ex(r),l=Ex(n==null?void 0:n.id);return v.useEffect(()=>{if(!t&&!r&&o&&l!=null){if(!xw(o)||document.activeElement===o.target)return;const c=a.get(l);if(!c)return;const{activatorNode:f,node:d}=c;if(!f.current&&!d.current)return;requestAnimationFrame(()=>{for(const m of[f.current,d.current]){if(!m)continue;const h=kJ(m);if(h){h.focus();break}}})}},[r,t,a,l,o]),null}function Iee(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((a,o)=>o({transform:a,...r}),n):n}function Pee(e){return v.useMemo(()=>({draggable:{...mp.draggable,...e==null?void 0:e.draggable},droppable:{...mp.droppable,...e==null?void 0:e.droppable},dragOverlay:{...mp.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 Lee(e){let{activeNode:t,measure:n,initialRect:r,config:a=!0}=e;const o=v.useRef(!1),{x:l,y:c}=typeof a=="boolean"?{x:a,y:a}:a;la(()=>{if(!l&&!c||!t){o.current=!1;return}if(o.current||!r)return;const d=t==null?void 0:t.node.current;if(!d||d.isConnected===!1)return;const m=n(d),h=CD(m,r);if(l||(h.x=0),c||(h.y=0),o.current=!0,Math.abs(h.x)>0||Math.abs(h.y)>0){const y=TD(d);y&&y.scrollBy({top:h.y,left:h.x})}},[t,l,c,r,n])}const zD=v.createContext({...Hi,scaleX:1,scaleY:1});var Co;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Co||(Co={}));const Tw=v.memo(function(t){var n,r,a,o;let{id:l,accessibility:c,autoScroll:f=!0,children:d,sensors:m=Ree,collisionDetection:h=HJ,measuring:y,modifiers:g,...w}=t;const C=v.useReducer(Nee,void 0,Aee),[T,E]=C,[R,k]=IJ(),[M,D]=v.useState(Co.Uninitialized),O=M===Co.Initialized,{draggable:{active:A,nodes:L,translate:q},droppable:{containers:F}}=T,W=A!=null?L.get(A):null,_=v.useRef({initial:null,translated:null}),V=v.useMemo(()=>{var ft;return A!=null?{id:A,data:(ft=W==null?void 0:W.data)!=null?ft:kee,rect:_}:null},[A,W]),$=v.useRef(null),[B,j]=v.useState(null),[z,H]=v.useState(null),K=Od(w,Object.values(w)),P=sf("DndDescribedBy",l),U=v.useMemo(()=>F.getEnabled(),[F]),G=Pee(y),{droppableRects:I,measureDroppableContainers:Q,measuringScheduled:le}=pee(U,{dragging:O,dependencies:[q.x,q.y],config:G.droppable}),ae=fee(L,A),Z=v.useMemo(()=>z?Cx(z):null,[z]),ue=it(),ve=mee(ae,G.draggable.measure);Lee({activeNode:A!=null?L.get(A):null,config:ue.layoutShiftCompensation,initialRect:ve,measure:G.draggable.measure});const Se=eM(ae,G.draggable.measure,ve),Le=eM(ae?ae.parentElement:null),te=v.useRef({activatorEvent:null,active:null,activeNode:ae,collisionRect:null,collisions:null,droppableRects:I,draggableNodes:L,draggingNode:null,draggingNodeRect:null,droppableContainers:F,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),he=F.getNodeFor((n=te.current.over)==null?void 0:n.id),ye=Tee({measure:G.dragOverlay.measure}),_e=(r=ye.nodeRef.current)!=null?r:ae,Oe=O?(a=ye.rect)!=null?a:Se:null,Ce=!!(ye.nodeRef.current&&ye.rect),Re=bee(Ce?null:Se),J=_D(_e?Vr(_e):null),Ee=vee(O?he??ae:null),xe=Eee(Ee),Be=Iee(g,{transform:{x:q.x-Re.x,y:q.y-Re.y,scaleX:1,scaleY:1},activatorEvent:z,active:V,activeNodeRect:Se,containerNodeRect:Le,draggingNodeRect:Oe,over:te.current.over,overlayNodeRect:ye.rect,scrollableAncestors:Ee,scrollableAncestorRects:xe,windowRect:J}),Ve=Z?oc(Z,q):null,De=xee(Ee),ut=nM(De),pe=nM(De,[Se]),Te=oc(Be,ut),ee=Oe?VJ(Oe,Be):null,fe=V&&ee?h({active:V,collisionRect:ee,droppableRects:I,droppableContainers:U,pointerCoordinates:Ve}):null,Ae=ED(fe,"id"),[He,$e]=v.useState(null),et=Ce?Be:oc(Be,pe),ze=UJ(et,(o=He==null?void 0:He.rect)!=null?o:null,Se),Ze=v.useRef(null),tt=v.useCallback((ft,bt)=>{let{sensor:Ke,options:kt}=bt;if($.current==null)return;const _t=L.get($.current);if(!_t)return;const Rt=ft.nativeEvent,dn=new Ke({active:$.current,activeNode:_t,event:Rt,options:kt,context:te,onAbort(Je){if(!L.get(Je))return;const{onDragAbort:X}=K.current,ie={id:Je};X==null||X(ie),R({type:"onDragAbort",event:ie})},onPending(Je,Mt,X,ie){if(!L.get(Je))return;const{onDragPending:ke}=K.current,je={id:Je,constraint:Mt,initialCoordinates:X,offset:ie};ke==null||ke(je),R({type:"onDragPending",event:je})},onStart(Je){const Mt=$.current;if(Mt==null)return;const X=L.get(Mt);if(!X)return;const{onDragStart:ie}=K.current,de={activatorEvent:Rt,active:{id:Mt,data:X.data,rect:_}};pr.unstable_batchedUpdates(()=>{ie==null||ie(de),D(Co.Initializing),E({type:er.DragStart,initialCoordinates:Je,active:Mt}),R({type:"onDragStart",event:de}),j(Ze.current),H(Rt)})},onMove(Je){E({type:er.DragMove,coordinates:Je})},onEnd:Ut(er.DragEnd),onCancel:Ut(er.DragCancel)});Ze.current=dn;function Ut(Je){return async function(){const{active:X,collisions:ie,over:de,scrollAdjustedTranslate:ke}=te.current;let je=null;if(X&&ke){const{cancelDrop:rt}=K.current;je={activatorEvent:Rt,active:X,collisions:ie,delta:ke,over:de},Je===er.DragEnd&&typeof rt=="function"&&await Promise.resolve(rt(je))&&(Je=er.DragCancel)}$.current=null,pr.unstable_batchedUpdates(()=>{E({type:Je}),D(Co.Uninitialized),$e(null),j(null),H(null),Ze.current=null;const rt=Je===er.DragEnd?"onDragEnd":"onDragCancel";if(je){const nt=K.current[rt];nt==null||nt(je),R({type:rt,event:je})}})}}},[L]),Tt=v.useCallback((ft,bt)=>(Ke,kt)=>{const _t=Ke.nativeEvent,Rt=L.get(kt);if($.current!==null||!Rt||_t.dndKit||_t.defaultPrevented)return;const dn={active:Rt};ft(Ke,bt.options,dn)===!0&&(_t.dndKit={capturedBy:bt.sensor},$.current=kt,tt(Ke,bt))},[L,tt]),zt=hee(m,Tt);wee(m),la(()=>{Se&&M===Co.Initializing&&D(Co.Initialized)},[Se,M]),v.useEffect(()=>{const{onDragMove:ft}=K.current,{active:bt,activatorEvent:Ke,collisions:kt,over:_t}=te.current;if(!bt||!Ke)return;const Rt={active:bt,activatorEvent:Ke,collisions:kt,delta:{x:Te.x,y:Te.y},over:_t};pr.unstable_batchedUpdates(()=>{ft==null||ft(Rt),R({type:"onDragMove",event:Rt})})},[Te.x,Te.y]),v.useEffect(()=>{const{active:ft,activatorEvent:bt,collisions:Ke,droppableContainers:kt,scrollAdjustedTranslate:_t}=te.current;if(!ft||$.current==null||!bt||!_t)return;const{onDragOver:Rt}=K.current,dn=kt.get(Ae),Ut=dn&&dn.rect.current?{id:dn.id,rect:dn.rect.current,data:dn.data,disabled:dn.disabled}:null,Je={active:ft,activatorEvent:bt,collisions:Ke,delta:{x:_t.x,y:_t.y},over:Ut};pr.unstable_batchedUpdates(()=>{$e(Ut),Rt==null||Rt(Je),R({type:"onDragOver",event:Je})})},[Ae]),la(()=>{te.current={activatorEvent:z,active:V,activeNode:ae,collisionRect:ee,collisions:fe,droppableRects:I,draggableNodes:L,draggingNode:_e,draggingNodeRect:Oe,droppableContainers:F,over:He,scrollableAncestors:Ee,scrollAdjustedTranslate:Te},_.current={initial:Oe,translated:ee}},[V,ae,fe,ee,L,_e,Oe,I,F,He,Ee,Te]),cee({...ue,delta:q,draggingRect:ee,pointerCoordinates:Ve,scrollableAncestors:Ee,scrollableAncestorRects:xe});const yt=v.useMemo(()=>({active:V,activeNode:ae,activeNodeRect:Se,activatorEvent:z,collisions:fe,containerNodeRect:Le,dragOverlay:ye,draggableNodes:L,droppableContainers:F,droppableRects:I,over:He,measureDroppableContainers:Q,scrollableAncestors:Ee,scrollableAncestorRects:xe,measuringConfiguration:G,measuringScheduled:le,windowRect:J}),[V,ae,Se,z,fe,Le,ye,L,F,I,He,Q,Ee,xe,G,le,J]),At=v.useMemo(()=>({activatorEvent:z,activators:zt,active:V,activeNodeRect:Se,ariaDescribedById:{draggable:P},dispatch:E,draggableNodes:L,over:He,measureDroppableContainers:Q}),[z,zt,V,Se,E,P,L,He,Q]);return Fe.createElement(xD.Provider,{value:k},Fe.createElement(Lm.Provider,{value:At},Fe.createElement(jD.Provider,{value:yt},Fe.createElement(zD.Provider,{value:ze},d)),Fe.createElement(Dee,{disabled:(c==null?void 0:c.restoreFocus)===!1})),Fe.createElement(_J,{...c,hiddenTextDescribedById:P}));function it(){const ft=(B==null?void 0:B.autoScrollEnabled)===!1,bt=typeof f=="object"?f.enabled===!1:f===!1,Ke=O&&!ft&&!bt;return typeof f=="object"?{...f,enabled:Ke}:{enabled:Ke}}}),_ee=v.createContext(null),iM="button",jee="Draggable";function zee(e){let{id:t,data:n,disabled:r=!1,attributes:a}=e;const o=sf(jee),{activators:l,activatorEvent:c,active:f,activeNodeRect:d,ariaDescribedById:m,draggableNodes:h,over:y}=v.useContext(Lm),{role:g=iM,roleDescription:w="draggable",tabIndex:C=0}=a??{},T=(f==null?void 0:f.id)===t,E=v.useContext(T?zD:_ee),[R,k]=Vp(),[M,D]=Vp(),O=See(l,t),A=Od(n);la(()=>(h.set(t,{id:t,key:o,node:R,activatorNode:M,data:A}),()=>{const q=h.get(t);q&&q.key===o&&h.delete(t)}),[h,t]);const L=v.useMemo(()=>({role:g,tabIndex:C,"aria-disabled":r,"aria-pressed":T&&g===iM?!0:void 0,"aria-roledescription":w,"aria-describedby":m.draggable}),[r,g,C,T,w,m.draggable]);return{active:f,activatorEvent:c,activeNodeRect:d,attributes:L,isDragging:T,listeners:r?void 0:O,node:R,over:y,setNodeRef:k,setActivatorNodeRef:D,transform:E}}function Fee(){return v.useContext(jD)}const Bee="Droppable",Hee={timeout:25};function Uee(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:a}=e;const o=sf(Bee),{active:l,dispatch:c,over:f,measureDroppableContainers:d}=v.useContext(Lm),m=v.useRef({disabled:n}),h=v.useRef(!1),y=v.useRef(null),g=v.useRef(null),{disabled:w,updateMeasurementsFor:C,timeout:T}={...Hee,...a},E=Od(C??r),R=v.useCallback(()=>{if(!h.current){h.current=!0;return}g.current!=null&&clearTimeout(g.current),g.current=setTimeout(()=>{d(Array.isArray(E.current)?E.current:[E.current]),g.current=null},T)},[T]),k=Pm({callback:R,disabled:w||!l}),M=v.useCallback((L,q)=>{k&&(q&&(k.unobserve(q),h.current=!1),L&&k.observe(L))},[k]),[D,O]=Vp(M),A=Od(t);return v.useEffect(()=>{!k||!D.current||(k.disconnect(),h.current=!1,k.observe(D.current))},[D,k]),v.useEffect(()=>(c({type:er.RegisterDroppable,element:{id:r,key:o,disabled:n,node:D,rect:y,data:A}}),()=>c({type:er.UnregisterDroppable,key:o,id:r})),[r]),v.useEffect(()=>{n!==m.current.disabled&&(c({type:er.SetDroppableDisabled,id:r,key:o,disabled:n}),m.current.disabled=n)},[r,o,n,c]),{active:l,rect:y,isOver:(f==null?void 0:f.id)===r,node:D,over:f,setNodeRef:O}}function lf(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function qee(e,t){return e.reduce((n,r,a)=>{const o=t.get(r);return o&&(n[a]=o),n},Array(e.length))}function Kh(e){return e!==null&&e>=0}function Vee(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 $ee(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const FD=e=>{let{rects:t,activeIndex:n,overIndex:r,index:a}=e;const o=lf(t,r,n),l=t[a],c=o[a];return!c||!l?null:{x:c.left-l.left,y:c.top-l.top,scaleX:c.width/l.width,scaleY:c.height/l.height}},Gh={scaleX:1,scaleY:1},Rw=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:a,rects:o,overIndex:l}=e;const c=(t=o[n])!=null?t:r;if(!c)return null;if(a===n){const d=o[l];return d?{x:0,y:n<l?d.top+d.height-(c.top+c.height):d.top-c.top,...Gh}:null}const f=Yee(o,a,n);return a>n&&a<=l?{x:0,y:-c.height-f,...Gh}:a<n&&a>=l?{x:0,y:c.height+f,...Gh}:{x:0,y:0,...Gh}};function Yee(e,t,n){const r=e[t],a=e[t-1],o=e[t+1];return r?n<t?a?r.top-(a.top+a.height):o?o.top-(r.top+r.height):0:o?o.top-(r.top+r.height):a?r.top-(a.top+a.height):0:0}const BD="Sortable",HD=Fe.createContext({activeIndex:-1,containerId:BD,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:FD,disabled:{draggable:!1,droppable:!1}});function kw(e){let{children:t,id:n,items:r,strategy:a=FD,disabled:o=!1}=e;const{active:l,dragOverlay:c,droppableRects:f,over:d,measureDroppableContainers:m}=Fee(),h=sf(BD,n),y=c.rect!==null,g=v.useMemo(()=>r.map(O=>typeof O=="object"&&"id"in O?O.id:O),[r]),w=l!=null,C=l?g.indexOf(l.id):-1,T=d?g.indexOf(d.id):-1,E=v.useRef(g),R=!Vee(g,E.current),k=T!==-1&&C===-1||R,M=$ee(o);la(()=>{R&&w&&m(g)},[R,g,w,m]),v.useEffect(()=>{E.current=g},[g]);const D=v.useMemo(()=>({activeIndex:C,containerId:h,disabled:M,disableTransforms:k,items:g,overIndex:T,useDragOverlay:y,sortedRects:qee(g,f),strategy:a}),[C,h,M.draggable,M.droppable,k,g,T,f,y,a]);return Fe.createElement(HD.Provider,{value:D},t)}const Wee=e=>{let{id:t,items:n,activeIndex:r,overIndex:a}=e;return lf(n,r,a).indexOf(t)},Kee=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:a,items:o,newIndex:l,previousItems:c,previousContainerId:f,transition:d}=e;return!d||!r||c!==o&&a===l?!1:n?!0:l!==a&&t===f},Gee={duration:200,easing:"ease"},UD="transform",Xee=Js.Transition.toString({property:UD,duration:0,easing:"linear"}),Qee={roleDescription:"sortable"};function Zee(e){let{disabled:t,index:n,node:r,rect:a}=e;const[o,l]=v.useState(null),c=v.useRef(n);return la(()=>{if(!t&&n!==c.current&&r.current){const f=a.current;if(f){const d=Uc(r.current,{ignoreTransform:!0}),m={x:f.left-d.left,y:f.top-d.top,scaleX:f.width/d.width,scaleY:f.height/d.height};(m.x||m.y)&&l(m)}}n!==c.current&&(c.current=n)},[t,n,r,a]),v.useEffect(()=>{o&&l(null)},[o]),o}function Mw(e){let{animateLayoutChanges:t=Kee,attributes:n,disabled:r,data:a,getNewIndex:o=Wee,id:l,strategy:c,resizeObserverConfig:f,transition:d=Gee}=e;const{items:m,containerId:h,activeIndex:y,disabled:g,disableTransforms:w,sortedRects:C,overIndex:T,useDragOverlay:E,strategy:R}=v.useContext(HD),k=Jee(r,g),M=m.indexOf(l),D=v.useMemo(()=>({sortable:{containerId:h,index:M,items:m},...a}),[h,a,M,m]),O=v.useMemo(()=>m.slice(m.indexOf(l)),[m,l]),{rect:A,node:L,isOver:q,setNodeRef:F}=Uee({id:l,data:D,disabled:k.droppable,resizeObserverConfig:{updateMeasurementsFor:O,...f}}),{active:W,activatorEvent:_,activeNodeRect:V,attributes:$,setNodeRef:B,listeners:j,isDragging:z,over:H,setActivatorNodeRef:K,transform:P}=zee({id:l,data:D,attributes:{...Qee,...n},disabled:k.draggable}),U=EJ(F,B),G=!!W,I=G&&!w&&Kh(y)&&Kh(T),Q=!E&&z,le=Q&&I?P:null,Z=I?le??(c??R)({rects:C,activeNodeRect:V,activeIndex:y,overIndex:T,index:M}):null,ue=Kh(y)&&Kh(T)?o({id:l,items:m,activeIndex:y,overIndex:T}):M,ve=W==null?void 0:W.id,Se=v.useRef({activeId:ve,items:m,newIndex:ue,containerId:h}),Le=m!==Se.current.items,te=t({active:W,containerId:h,isDragging:z,isSorting:G,id:l,index:M,items:m,newIndex:Se.current.newIndex,previousItems:Se.current.items,previousContainerId:Se.current.containerId,transition:d,wasDragging:Se.current.activeId!=null}),he=Zee({disabled:!te,index:M,node:L,rect:A});return v.useEffect(()=>{G&&Se.current.newIndex!==ue&&(Se.current.newIndex=ue),h!==Se.current.containerId&&(Se.current.containerId=h),m!==Se.current.items&&(Se.current.items=m)},[G,ue,h,m]),v.useEffect(()=>{if(ve===Se.current.activeId)return;if(ve!=null&&Se.current.activeId==null){Se.current.activeId=ve;return}const _e=setTimeout(()=>{Se.current.activeId=ve},50);return()=>clearTimeout(_e)},[ve]),{active:W,activeIndex:y,attributes:$,data:D,rect:A,index:M,newIndex:ue,items:m,isOver:q,isSorting:G,isDragging:z,listeners:j,node:L,overIndex:T,over:H,setNodeRef:U,setActivatorNodeRef:K,setDroppableNodeRef:F,setDraggableNodeRef:B,transform:he??Z,transition:ye()};function ye(){if(he||Le&&Se.current.newIndex===M)return Xee;if(!(Q&&!xw(_)||!d)&&(G||te))return Js.Transition.toString({...d,property:UD})}}function Jee(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}function Wp(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 ete=[rn.Down,rn.Right,rn.Up,rn.Left],tte=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:a,droppableContainers:o,over:l,scrollableAncestors:c}}=t;if(ete.includes(e.code)){if(e.preventDefault(),!n||!r)return;const f=[];o.getEnabled().forEach(h=>{if(!h||h!=null&&h.disabled)return;const y=a.get(h.id);if(y)switch(e.code){case rn.Down:r.top<y.top&&f.push(h);break;case rn.Up:r.top>y.top&&f.push(h);break;case rn.Left:r.left>y.left&&f.push(h);break;case rn.Right:r.left<y.left&&f.push(h);break}});const d=FJ({collisionRect:r,droppableRects:a,droppableContainers:f});let m=ED(d,"id");if(m===(l==null?void 0:l.id)&&d.length>1&&(m=d[1].id),m!=null){const h=o.get(n.id),y=o.get(m),g=y?a.get(y.id):null,w=y==null?void 0:y.node.current;if(w&&g&&h&&y){const T=Im(w).some((O,A)=>c[A]!==O),E=qD(h,y),R=nte(h,y),k=T||!E?{x:0,y:0}:{x:R?r.width-g.width:0,y:R?r.height-g.height:0},M={x:g.left,y:g.top};return k.x&&k.y?M:Ad(M,k)}}}};function qD(e,t){return!Wp(e)||!Wp(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function nte(e,t){return!Wp(e)||!Wp(t)||!qD(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function VD({status:e}){return S.jsx("span",{className:Pe("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 Ow(){return jJ(ev(ID,{activationConstraint:{distance:8}}),ev(PD,{activationConstraint:{delay:250,tolerance:5}}),ev(Ew,{coordinateGetter:tte}))}function rte(){const{t:e}=mn(),t=qi(),n=Hd(),{isMobile:r,setOpenMobile:a}=Ur(),{toggleDevice:o}=yV(),l=an(ee=>ee.sessions),c=an(ee=>ee.activeSessionId),f=Bi(ee=>ee.setSidebarTab);v.useEffect(()=>{const ee=an.getState();ee.ensureInitialized(),ee.loadSessions()},[]);const d=Us("/devices/:deviceId/windows/:windowId/panes/:paneId",t.pathname),m=d==null?void 0:d.params.deviceId,h=d==null?void 0:d.params.windowId,y=d==null?void 0:d.params.paneId,g=kn(ee=>ee.snapshots),w=kn(ee=>ee.connectedDevices),C=kn(ee=>ee.closeWindow),T=kn(ee=>ee.closePane),E=kn(ee=>ee.renameWindow),R=Xs(ee=>{var fe;return((fe=ee.settings)==null?void 0:fe.language)??"en_US"}),{data:k}=Ei({queryKey:["devices"],queryFn:async()=>{const ee=await fetch("/api/devices");if(!ee.ok)throw new Error("Failed to fetch devices");return ee.json()},throwOnError:!1}),M=kn(ee=>ee.hydrateDeviceErrors);v.useEffect(()=>{k!=null&&k.devices&&M(k.devices.map(ee=>({deviceId:ee.id,lastError:ee.lastError??null,lastErrorType:ee.lastErrorType??null})))},[k,M]);const D=v.useCallback((ee,fe)=>{n(ee,{replace:(fe==null?void 0:fe.replace)??!0}),r&&!(fe!=null&&fe.keepSidebarOpen)&&a(!1)},[n,r,a]),O=v.useCallback((ee,fe,Ae,He)=>{F.current=null,window.dispatchEvent(new CustomEvent("tmex:user-initiated-selection",{detail:{deviceId:ee,windowId:fe,paneId:Ae}})),D(`/devices/${ee}/windows/${fe}/panes/${fw(Ae)}`,{keepSidebarOpen:He==null?void 0:He.keepSidebarOpen})},[D]),A=v.useCallback(ee=>{var fe,Ae;if(an.getState().setActiveSession(ee.id),f("agent"),ee.deviceId&&ee.paneId){const He=(Ae=(fe=kn.getState().snapshots[ee.deviceId])==null?void 0:fe.session)==null?void 0:Ae.windows,$e=He==null?void 0:He.find(et=>et.panes.some(ze=>ze.id===ee.paneId));$e&&O(ee.deviceId,$e.id,ee.paneId,{keepSidebarOpen:!0})}},[f,O]),L=v.useCallback((ee,fe,Ae)=>{O(ee,fe,Ae.id,{keepSidebarOpen:!0}),an.getState().startDraft(ee,Ae.id,Ae.title??null),f("agent")},[O,f]),q=kn(ee=>ee.selectWindow),F=v.useRef(null);v.useEffect(()=>{var Ze,tt;const ee=F.current;if(!ee)return;if(Date.now()-ee.at>5e3){F.current=null;return}const{deviceId:fe,windowId:Ae}=ee,He=g[fe],$e=(Ze=He==null?void 0:He.session)==null?void 0:Ze.windows;if(!$e)return;const et=$e.find(Tt=>Tt.id===Ae);if(!((tt=et==null?void 0:et.panes)!=null&&tt.length))return;F.current=null;const ze=et.panes.find(Tt=>Tt.active)??et.panes[0];O(fe,Ae,ze.id)},[g,O]);const W=v.useCallback((ee,fe,Ae)=>{q(ee,fe);const He=Ae.find($e=>$e.active)??Ae[0];He?(O(ee,fe,He.id),F.current=null):F.current={deviceId:ee,windowId:fe,at:Date.now()}},[O,q]),_=v.useCallback((ee,fe)=>{fe?ee===m&&D("/devices"):D(`/devices/${ee}`),o(ee,fe)},[o,m,D]),V=v.useCallback((ee,fe)=>{ee===m&&fe===h&&D("/devices"),C(ee,fe)},[C,m,h,D]),[$,B]=v.useState(null),j=v.useCallback((ee,fe)=>{var $e,et;const Ae=(et=($e=kn.getState().snapshots[ee])==null?void 0:$e.session)==null?void 0:et.windows,He=Ae==null?void 0:Ae.find(ze=>ze.id===fe);B({kind:"window",deviceId:ee,windowId:fe,name:He?DV(He):""})},[]),z=v.useCallback((ee,fe,Ae)=>{var et,ze,Ze,tt;const He=(ze=(et=kn.getState().snapshots[ee])==null?void 0:et.session)==null?void 0:ze.windows,$e=(tt=(Ze=He==null?void 0:He.find(Tt=>Tt.id===fe))==null?void 0:Ze.panes)==null?void 0:tt.find(Tt=>Tt.id===Ae);B({kind:"pane",deviceId:ee,paneId:Ae,name:($e==null?void 0:$e.title)||`Pane ${($e==null?void 0:$e.index)??""}`})},[]),H=v.useCallback(()=>{$&&($.kind==="window"?V($.deviceId,$.windowId):T($.deviceId,$.paneId),B(null))},[$,V,T]),[K,P]=v.useState(null),[U,G]=v.useState(""),I=v.useCallback((ee,fe)=>{var $e,et;const Ae=(et=($e=kn.getState().snapshots[ee])==null?void 0:$e.session)==null?void 0:et.windows,He=Ae==null?void 0:Ae.find(ze=>ze.id===fe);He&&(G(He.customName??U0(He).title),P({deviceId:ee,windowId:fe,hasCustomName:!!He.customName}))},[]),Q=v.useCallback(()=>{if(!K)return;const ee=U.trim();ee&&(E(K.deviceId,K.windowId,ee),P(null))},[K,U,E]),le=v.useCallback(()=>{K&&(E(K.deviceId,K.windowId,""),P(null))},[K,E]),ae=v.useCallback(ee=>{kn.getState().createWindow(ee)},[]),[Z,ue]=v.useState(null),ve=v.useCallback((ee,fe)=>{ue({deviceId:ee,paneId:fe})},[]),[Se,Le]=v.useState(null),[te,he]=v.useState(""),[ye,_e]=v.useState(null),Oe=v.useCallback(ee=>{he(ee.title),Le(ee)},[]),Ce=v.useCallback(()=>{if(!Se)return;const ee=te.trim();ee&&(an.getState().renameSession(Se.id,ee),Le(null))},[Se,te]),Re=v.useCallback(ee=>{_e(ee)},[]),J=v.useCallback(()=>{ye&&(an.getState().deleteSession(ye.id),_e(null))},[ye]),Ee=el(),xe=Ow(),Be=yd({mutationFn:async ee=>{const fe=await fetch("/api/devices/order",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceIds:ee})});if(!fe.ok)throw new Error("Failed to reorder devices");return fe.json()},onMutate:async ee=>{await Ee.cancelQueries({queryKey:["devices"]});const fe=Ee.getQueryData(["devices"]);if(fe){const Ae=new Map(fe.devices.map(et=>[et.id,et])),He=ee.map((et,ze)=>{const Ze=Ae.get(et);return Ze?{...Ze,sortOrder:ze}:void 0}).filter(et=>et!==void 0),$e=fe.devices.filter(et=>!ee.includes(et.id));Ee.setQueryData(["devices"],{devices:[...He,...$e]})}return{previous:fe}},onError:(ee,fe,Ae)=>{Ae!=null&&Ae.previous&&Ee.setQueryData(["devices"],Ae.previous),sn.error(e("device.reorderFailed"))},onSettled:()=>{Ee.invalidateQueries({queryKey:["devices"]})}}),Ve=(k==null?void 0:k.devices)??[],De=v.useMemo(()=>[...Ve].sort((ee,fe)=>ee.sortOrder-fe.sortOrder||ee.name.localeCompare(fe.name,m2(R),{numeric:!0,sensitivity:"base"})),[Ve,R]),ut=v.useCallback(ee=>{const{active:fe,over:Ae}=ee;if(!Ae||fe.id===Ae.id)return;const He=De.map(ze=>ze.id),$e=He.indexOf(String(fe.id)),et=He.indexOf(String(Ae.id));$e<0||et<0||Be.mutate(lf(He,$e,et))},[De,Be]),{sessionsByPane:pe,orphanSessions:Te}=v.useMemo(()=>{const ee=new Set(Ve.map($e=>$e.id)),fe=new Map,Ae=[],He=Object.values(l).filter($e=>!!$e).sort(($e,et)=>$e.updatedAt<et.updatedAt?1:-1);for(const $e of He){if(!$e.deviceId||!$e.paneId||!ee.has($e.deviceId)){Ae.push($e);continue}const et=`${$e.deviceId}:${$e.paneId}`,ze=fe.get(et);ze?ze.push($e):fe.set(et,[$e])}return{sessionsByPane:fe,orphanSessions:Ae}},[l,Ve]);return S.jsxs(F0,{className:"flex flex-col flex-1 min-h-0 pt-0",children:[S.jsx(Tw,{sensors:xe,collisionDetection:ww,onDragEnd:ut,children:S.jsx(QN,{className:"flex-1 min-h-0",children:S.jsxs("div",{className:"space-y-1.5 pb-2 pt-1 select-none [-webkit-user-select:none] [-webkit-touch-callout:none]",children:[S.jsx(kw,{items:De.map(ee=>ee.id),strategy:Rw,children:De.map(ee=>{var fe,Ae;return S.jsx(ite,{device:ee,windows:((Ae=(fe=g[ee.id])==null?void 0:fe.session)==null?void 0:Ae.windows)??null,isConnected:w.has(ee.id),isSelected:ee.id===m,selectedWindowId:h,selectedPaneId:y,onConnectToggle:()=>_(ee.id,w.has(ee.id)),onCreateWindow:ae,onCloseWindow:j,onClosePane:z,onRenameWindow:I,onPaneClick:O,onWindowClick:W,onWatchPane:ve,sessionsByPane:pe,activeSessionId:c,onSelectSession:A,onCreateSessionForPane:L,onRenameSession:Oe,onDeleteSession:Re},ee.id)})}),De.length===0&&S.jsx("div",{className:"text-center text-sm text-muted-foreground py-4",children:e("sidebar.noDevices")}),Te.length>0&&S.jsx(ste,{sessions:Te,activeSessionId:c,onSelectSession:A,onRenameSession:Oe,onDeleteSession:Re})]})})}),S.jsx(dx,{open:$!==null,onOpenChange:ee=>!ee&&B(null),children:S.jsxs(fx,{children:[S.jsxs(hx,{children:[S.jsx(qk,{className:"bg-destructive/10",children:S.jsx(Va,{className:"h-5 w-5 text-destructive"})}),S.jsx(mx,{children:($==null?void 0:$.kind)==="pane"?e("window.closePaneConfirmTitle"):e("window.closeConfirmTitle")}),S.jsx(gx,{children:e("window.closeConfirmDesc",{name:($==null?void 0:$.name)??""})})]}),S.jsxs(px,{children:[S.jsx(bx,{children:e("common.cancel")}),S.jsx(yx,{variant:"destructive",disabled:!$,onClick:H,children:e("common.close")})]})]})}),S.jsx(vx,{open:K!==null,onOpenChange:ee=>!ee&&P(null),children:S.jsx(xx,{"data-testid":"window-rename-dialog",children:S.jsxs("form",{onSubmit:ee=>{ee.preventDefault(),Q()},children:[S.jsxs(wx,{children:[S.jsx(Sx,{children:e("window.rename")}),S.jsx(lD,{children:e("window.renameDesc")})]}),S.jsx("div",{className:"py-4",children:S.jsx(Pi,{autoFocus:!0,maxLength:64,value:U,onChange:ee=>G(ee.target.value),placeholder:e("window.renamePlaceholder"),"data-testid":"window-rename-input"})}),S.jsxs(Vk,{children:[(K==null?void 0:K.hasCustomName)&&S.jsx(Ht,{type:"button",variant:"ghost",onClick:le,"data-testid":"window-rename-reset",children:e("window.renameReset")}),S.jsx(Ht,{type:"button",variant:"outline",onClick:()=>P(null),children:e("common.cancel")}),S.jsx(Ht,{type:"submit",disabled:!U.trim(),"data-testid":"window-rename-save",children:e("common.save")})]})]})})}),S.jsx(vx,{open:Se!==null,onOpenChange:ee=>!ee&&Le(null),children:S.jsx(xx,{"data-testid":"agent-session-rename-dialog",children:S.jsxs("form",{onSubmit:ee=>{ee.preventDefault(),Ce()},children:[S.jsx(wx,{children:S.jsx(Sx,{children:e("agent.session.renameTitle")})}),S.jsx("div",{className:"py-4",children:S.jsx(Pi,{autoFocus:!0,maxLength:120,value:te,onChange:ee=>he(ee.target.value),placeholder:e("agent.session.renamePlaceholder"),"data-testid":"agent-session-rename-input"})}),S.jsxs(Vk,{children:[S.jsx(Ht,{type:"button",variant:"outline",onClick:()=>Le(null),children:e("agent.session.cancel")}),S.jsx(Ht,{type:"submit",disabled:!te.trim(),"data-testid":"agent-session-rename-save",children:e("agent.session.save")})]})]})})}),S.jsx(dx,{open:ye!==null,onOpenChange:ee=>!ee&&_e(null),children:S.jsxs(fx,{children:[S.jsxs(hx,{children:[S.jsx(qk,{className:"bg-destructive/10",children:S.jsx(Va,{className:"h-5 w-5 text-destructive"})}),S.jsx(mx,{children:e("agent.session.deleteTitle")}),S.jsx(gx,{children:e("agent.session.deleteDesc",{title:(ye==null?void 0:ye.title)??""})})]}),S.jsxs(px,{children:[S.jsx(bx,{children:e("common.cancel")}),S.jsx(yx,{variant:"destructive",disabled:!ye,onClick:J,"data-testid":"agent-session-delete-confirm",children:e("agent.session.deleteConfirm")})]})]})}),Z&&S.jsx(xJ,{open:!0,onOpenChange:ee=>!ee&&ue(null),deviceId:Z.deviceId,paneId:Z.paneId})]})}function ite({device:e,windows:t,isConnected:n,isSelected:r,selectedWindowId:a,selectedPaneId:o,onConnectToggle:l,onCreateWindow:c,onCloseWindow:f,onClosePane:d,onRenameWindow:m,onPaneClick:h,onWindowClick:y,onWatchPane:g,sessionsByPane:w,activeSessionId:C,onSelectSession:T,onCreateSessionForPane:E,onRenameSession:R,onDeleteSession:k}){const{t:M}=mn(),D=e.type==="local"?vm:L0,{attributes:O,listeners:A,setNodeRef:L,setActivatorNodeRef:q,transform:F,transition:W,isDragging:_}=Mw({id:e.id}),V=Ow(),$=B=>{const{active:j,over:z}=B;if(!z||j.id===z.id||!t)return;const H=t.map(U=>U.id),K=H.indexOf(String(j.id)),P=H.indexOf(String(z.id));K<0||P<0||kn.getState().reorderWindows(e.id,lf(H,K,P))};return S.jsxs("div",{ref:L,style:{transform:Js.Translate.toString(F),transition:W},"data-testid":`device-item-${e.id}`,className:Pe("group/device rounded-xl border border-border/60 overflow-hidden",r?"bg-card":n?"bg-muted/40":"bg-muted/20",_&&"opacity-60 shadow-lg"),onClick:n?void 0:l,children:[S.jsxs("div",{className:"relative px-3 py-1.5",children:[r&&S.jsx("span",{className:"absolute left-0 top-0 bottom-0 w-0.5 bg-muted-foreground/70"}),S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("button",{type:"button",ref:q,...O,...A,"aria-label":M("device.dragHandle"),onClick:B=>B.stopPropagation(),className:"touch-none cursor-grab shrink-0 -ml-1 text-muted-foreground/50 hover:text-muted-foreground opacity-100",children:S.jsx(_0,{className:"h-3.5 w-3.5 [@media(any-pointer:coarse)]:h-5 [@media(any-pointer:coarse)]:w-5"})}),S.jsx(D,{className:"h-4 w-4 text-muted-foreground shrink-0"}),S.jsx("span",{className:"flex-1 truncate text-xs font-medium",children:e.name}),S.jsx(zZ,{deviceId:e.id,className:"shrink-0"}),S.jsx("div",{className:Pe("h-2 w-2 rounded-full shrink-0",n?"bg-emerald-500":"bg-gray-400")}),S.jsx(Ht,{variant:"ghost",size:"icon-xs",onClick:B=>{B.stopPropagation(),l()},"data-testid":n?`device-disconnect-${e.id}`:`device-connect-${e.id}`,title:M(n?"device.disconnect":"device.connect"),children:n?S.jsx(o9,{className:"h-3.5 w-3.5 text-orange-500"}):S.jsx(l9,{className:"h-3.5 w-3.5 text-emerald-500"})})]})]}),n&&S.jsxs("div",{className:"p-1.5 space-y-1.5 [@media(any-pointer:coarse)]:space-y-2",children:[!t&&S.jsx("div",{className:"text-xs text-muted-foreground px-2 py-1.5 text-center",children:M("device.connecting")}),(t==null?void 0:t.length)===0&&S.jsx("div",{className:"text-xs text-muted-foreground px-2 py-1.5 text-center",children:M("window.noWindows")}),t&&t.length>0&&S.jsx(Tw,{sensors:V,collisionDetection:ww,onDragEnd:$,children:S.jsx(kw,{items:t.map(B=>B.id),strategy:Rw,children:t.map(B=>S.jsx(ate,{deviceId:e.id,window:B,isSelected:B.id===a,selectedPaneId:o,onPaneClick:h,onWindowClick:y,onCloseWindow:f,onClosePane:d,onRenameWindow:m,onWatchPane:g,sessionsByPane:w,activeSessionId:C,onSelectSession:T,onCreateSessionForPane:E,onRenameSession:R,onDeleteSession:k},B.id))})}),S.jsxs("button",{type:"button","data-testid":`window-create-${e.id}`,onPointerDown:B=>B.stopPropagation(),onMouseDown:B=>B.stopPropagation(),onClick:()=>c(e.id),className:"w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left transition-colors text-muted-foreground hover:text-foreground hover:bg-accent/30 border border-dashed border-border/50 hover:border-border",children:[S.jsx(wm,{className:"h-3.5 w-3.5 shrink-0"}),S.jsx("span",{className:"text-xs",children:M("window.new")})]})]})]})}function ate({deviceId:e,window:t,isSelected:n,selectedPaneId:r,onPaneClick:a,onWindowClick:o,onCloseWindow:l,onClosePane:c,onRenameWindow:f,onWatchPane:d,sessionsByPane:m,activeSessionId:h,onSelectSession:y,onCreateSessionForPane:g,onRenameSession:w,onDeleteSession:C}){const{t:T}=mn(),{isMobile:E}=Ur(),R=t.panes.length>1,k=U0(t),M=t.panes.find(B=>B.id===r),D=n&&!!M,{attributes:O,listeners:A,setNodeRef:L,setActivatorNodeRef:q,transform:F,transition:W,isDragging:_}=Mw({id:t.id}),V=Ow(),$=B=>{const{active:j,over:z}=B;if(!z||j.id===z.id)return;const H=t.panes.map(U=>U.id),K=H.indexOf(String(j.id)),P=H.indexOf(String(z.id));K<0||P<0||kn.getState().reorderPanes(e,t.id,lf(H,K,P))};return S.jsxs("div",{ref:L,style:{transform:Js.Translate.toString(F),transition:W},className:Pe("space-y-1",_&&"opacity-60"),children:[S.jsxs("div",{className:"group relative flex items-center gap-1",children:[S.jsx("button",{type:"button",ref:q,...O,...A,"aria-label":T("window.dragHandle"),onClick:B=>B.stopPropagation(),className:Pe("touch-none cursor-grab shrink-0 flex items-center justify-center text-muted-foreground/50 hover:text-muted-foreground opacity-100",E?"h-9 w-4":"h-6 w-3.5 [@media(any-pointer:coarse)]:h-9 [@media(any-pointer:coarse)]:w-4"),children:S.jsx(_0,{className:Pe(E?"h-4 w-4":"h-3.5 w-3.5")})}),S.jsxs("button",{type:"button",onClick:()=>o(e,t.id,t.panes),"data-testid":`window-item-${t.id}`,className:Pe("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",E&&"py-2.5 pr-13",D?"bg-primary/10 text-primary":t.active?"bg-accent text-accent-foreground":"hover:bg-accent/50 text-foreground"),children:[S.jsx(Zs,{variant:D?"default":"outline",className:"h-5 text-[10px] px-1.5 shrink-0",children:t.index}),S.jsxs("span",{className:"flex-1 min-w-0",children:[S.jsx("span",{className:"font-mono text-[11px] leading-tight font-medium line-clamp-2 [overflow-wrap:break-word]",children:k.title}),k.processName&&S.jsx("span",{className:"font-mono text-[10.5px] leading-tight text-muted-foreground line-clamp-1 break-all",children:k.processName})]})]}),S.jsxs(pw,{children:[S.jsx(mw,{"data-testid":`window-menu-${t.id}`,"aria-label":T("window.menu"),title:T("window.menu"),className:Pe("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",E?"h-11 w-11 right-0 rounded-lg bg-background/40 opacity-100":"h-5 w-5 right-1.5 [@media(any-pointer:coarse)]:h-10 [@media(any-pointer:coarse)]:w-10 [@media(any-pointer:coarse)]:right-0.5 [@media(any-pointer:coarse)]:rounded-lg",D?"opacity-100":"opacity-0 group-hover:opacity-100 [@media(any-pointer:coarse)]:opacity-100"),children:S.jsx(oA,{className:Pe(E?"h-5 w-5":"h-3.5 w-3.5 [@media(any-pointer:coarse)]:h-4.5 [@media(any-pointer:coarse)]:w-4.5")})}),S.jsxs(gw,{align:"end",backdrop:!0,className:"w-auto min-w-36 [@media(any-pointer:coarse)]:min-w-48",children:[S.jsxs(ac,{"data-testid":`window-menu-rename-${t.id}`,className:Pe("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",E&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>f(e,t.id),children:[S.jsx(xm,{className:Pe("h-4 w-4",E&&"h-5 w-5")}),T("window.rename")]}),S.jsxs(ac,{"data-testid":`window-menu-new-session-${t.id}`,className:Pe("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",E&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>g(e,t.id,M||t.panes[0]),children:[S.jsx(wm,{className:Pe("h-4 w-4",E&&"h-5 w-5")}),T("agent.session.new")]}),S.jsxs(ac,{variant:"destructive","data-testid":`window-menu-close-${t.id}`,className:Pe("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",E&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>l(e,t.id),children:[S.jsx(Va,{className:Pe("h-4 w-4",E&&"h-5 w-5")}),T("window.close")]})]})]})]}),R&&S.jsx("div",{className:"ml-4 pl-2 border-l border-border/50 space-y-1 [@media(any-pointer:coarse)]:space-y-1.5",children:S.jsx(Tw,{sensors:V,collisionDetection:ww,onDragEnd:$,children:S.jsx(kw,{items:t.panes.map(B=>B.id),strategy:Rw,children:t.panes.map(B=>S.jsx(ote,{deviceId:e,windowId:t.id,pane:B,isActive:B.id===r,isMobile:E,onPaneClick:a,onClosePane:c,onWatchPane:d,sessions:m.get(`${e}:${B.id}`),activeSessionId:h,onSelectSession:y,onRenameSession:w,onDeleteSession:C},B.id))})})}),!R&&t.panes[0]&&S.jsx("div",{className:"ml-[36px] pl-2 border-l border-border/50",children:S.jsx(YD,{sessions:m.get(`${e}:${t.panes[0].id}`),activeSessionId:h,onSelectSession:y,onRenameSession:w,onDeleteSession:C})})]})}function ote({deviceId:e,windowId:t,pane:n,isActive:r,isMobile:a,onPaneClick:o,onClosePane:l,onWatchPane:c,sessions:f,activeSessionId:d,onSelectSession:m,onRenameSession:h,onDeleteSession:y}){const{t:g}=mn(),{attributes:w,listeners:C,setNodeRef:T,setActivatorNodeRef:E,transform:R,transition:k,isDragging:M}=Mw({id:n.id});return S.jsxs("div",{ref:T,style:{transform:Js.Translate.toString(R),transition:k},className:Pe("group relative",M&&"opacity-60"),children:[S.jsxs("div",{className:"flex items-center gap-1",children:[S.jsx("button",{type:"button",ref:E,...w,...C,"aria-label":g("window.dragHandlePane"),onClick:D=>D.stopPropagation(),className:Pe("touch-none cursor-grab shrink-0 flex items-center justify-center text-muted-foreground/50 hover:text-muted-foreground opacity-100",a?"h-9 w-4":"h-6 w-3 [@media(any-pointer:coarse)]:h-9 [@media(any-pointer:coarse)]:w-4"),children:S.jsx(_0,{className:Pe(a?"h-4 w-4":"h-3 w-3")})}),S.jsxs("button",{type:"button",onClick:()=>o(e,t,n.id),"data-testid":`pane-item-${n.id}`,className:Pe("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",a&&"py-2.5 pr-24",r?"bg-primary/10 text-primary":n.active?"bg-accent text-accent-foreground":"hover:bg-accent/30 text-muted-foreground"),children:[S.jsx("span",{className:"text-[10px] font-mono opacity-60 w-4",children:n.index}),S.jsx("span",{className:"flex-1 text-xs line-clamp-2 break-all",children:n.title||`Pane ${n.index}`})]})]}),S.jsxs(pw,{children:[S.jsx(mw,{"data-testid":`pane-menu-${n.id}`,"aria-label":g("watch.openMonitor"),className:Pe("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",a?"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",r?"opacity-100":"opacity-0 group-hover:opacity-100 [@media(any-pointer:coarse)]:opacity-100"),children:S.jsx(oA,{className:Pe(a?"h-5 w-5":"h-3.5 w-3.5")})}),S.jsx(gw,{align:"end",backdrop:!0,className:"w-auto min-w-36 [@media(any-pointer:coarse)]:min-w-48",children:S.jsxs(ac,{"data-testid":`pane-watch-${n.id}`,className:Pe("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",a&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>c(e,n.id),children:[S.jsx(u9,{className:Pe("h-4 w-4",a&&"h-5 w-5")}),g("watch.openMonitor")]})})]}),S.jsx("button",{type:"button",onClick:D=>{D.stopPropagation(),l(e,t,n.id)},"data-testid":`pane-close-${n.id}`,className:Pe("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",a?"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",r?"opacity-100":"opacity-0 group-hover:opacity-100 [@media(any-pointer:coarse)]:opacity-100"),title:g("window.closePane"),children:S.jsx("span",{className:Pe("leading-none",a?"text-base":"text-xs"),children:"×"})}),S.jsx(YD,{sessions:f,activeSessionId:d,onSelectSession:m,onRenameSession:h,onDeleteSession:y})]})}function $D({session:e,onRenameSession:t,onDeleteSession:n,className:r,enlargeOnTouch:a=!1}){const{t:o}=mn(),{isMobile:l}=Ur(),c=a&&l;return S.jsxs(pw,{children:[S.jsx(mw,{render:S.jsx(Ht,{variant:"ghost",size:"icon-sm","data-testid":`agent-session-menu-${e.id}`,"aria-label":o("agent.session.rename"),onClick:f=>f.stopPropagation(),className:Pe("size-5 shrink-0 text-muted-foreground transition-opacity data-popup-open:opacity-100",l?"opacity-100":"opacity-0 group-hover:opacity-100 [@media(any-pointer:coarse)]:opacity-100",c&&"size-9",r)}),children:S.jsx(y8,{className:Pe("size-3.5",c&&"size-5")})}),S.jsxs(gw,{align:"end",backdrop:!0,className:"w-auto min-w-36 [@media(any-pointer:coarse)]:min-w-48",children:[S.jsxs(ac,{"data-testid":"agent-session-rename",className:Pe("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",l&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>t(e),children:[S.jsx(xm,{className:Pe("h-4 w-4",l&&"h-5 w-5")}),o("agent.session.rename")]}),S.jsxs(ac,{variant:"destructive","data-testid":"agent-session-delete",className:Pe("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",l&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>n(e),children:[S.jsx(cA,{className:Pe("h-4 w-4",l&&"h-5 w-5")}),o("agent.session.delete")]})]})]})}function YD({sessions:e,activeSessionId:t,onSelectSession:n,onRenameSession:r,onDeleteSession:a}){const{isMobile:o}=Ur();return S.jsx("div",{className:"mt-1 space-y-0.5 [@media(any-pointer:coarse)]:space-y-1",children:e==null?void 0:e.map(l=>{const c=l.id===t;return S.jsxs("div",{className:"group relative",children:[S.jsxs("button",{type:"button","data-testid":`agent-session-item-${l.id}`,onClick:()=>n(l),className:Pe("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",o&&"min-h-11 py-2 pr-12",c?"bg-primary/10 text-primary":"hover:bg-accent/30 text-muted-foreground"),children:[S.jsx(P0,{className:"size-3 shrink-0 opacity-70"}),S.jsx("span",{className:"min-w-0 flex-1 truncate text-[11px]",children:l.title}),S.jsx(VD,{status:l.status})]}),S.jsx("div",{className:"absolute right-0.5 top-1/2 -translate-y-1/2",children:S.jsx($D,{session:l,onRenameSession:r,onDeleteSession:a,enlargeOnTouch:!0})})]},l.id)})})}function ste({sessions:e,activeSessionId:t,onSelectSession:n,onRenameSession:r,onDeleteSession:a}){const{t:o}=mn(),[l,c]=v.useState(!1),f=Xs(d=>{var m;return((m=d.settings)==null?void 0:m.language)??"en_US"});return S.jsxs(km,{open:l,onOpenChange:c,className:"rounded-xl border border-border/60 bg-muted/20",children:[S.jsxs(Mm,{"data-testid":"agent-orphan-sessions-trigger",className:"flex w-full items-center gap-2 px-3 py-1.5 text-left",children:[S.jsx(U8,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),S.jsx("span",{className:"flex-1 truncate text-xs font-medium text-muted-foreground",children:o("agent.orphan.title",{count:e.length})}),S.jsx(Qd,{className:Pe("h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform",l&&"rotate-90")})]}),S.jsx(Om,{className:"space-y-0.5 px-1.5 pb-1.5",children:e.map(d=>{const m=d.id===t,h=[d.originPaneTitle,d.originProcessName,d.createdAt?new Date(d.createdAt).toLocaleString(m2(f)):null].filter(y=>!!y);return S.jsxs("div",{className:"group relative",children:[S.jsxs("button",{type:"button","data-testid":`agent-orphan-session-${d.id}`,onClick:()=>n(d),className:Pe("w-full flex flex-col gap-0.5 px-2 py-1.5 pr-7 rounded-lg text-left transition-colors",m?"bg-primary/10 text-primary":"hover:bg-accent/30"),children:[S.jsxs("span",{className:"flex items-center gap-1.5",children:[S.jsx(P0,{className:"size-3 shrink-0 opacity-70"}),S.jsx("span",{className:"min-w-0 flex-1 truncate text-[11px]",children:d.title}),S.jsx(VD,{status:d.status})]}),h.length>0&&S.jsx("span",{className:"truncate pl-[18px] text-[10px] text-muted-foreground",children:h.join(" · ")})]}),S.jsx("div",{className:"absolute right-0.5 top-1.5",children:S.jsx($D,{session:d,onRenameSession:r,onDeleteSession:a})})]},d.id)})})]})}function lte(){const{t:e}=mn(),{isMobile:t,setOpenMobile:n}=Ur(),r=Xs(m=>{var h;return(h=m.settings)==null?void 0:h.siteName}),a=Xs(m=>m.fetchSettings);v.useEffect(()=>{a()},[a]);const o=r??"tmex",l=Bi(m=>m.theme),c=Bi(m=>m.setTheme),f=l==="dark",d=()=>{const m=f?"light":"dark";c(m),document.documentElement.classList.toggle("dark",m==="dark")};return S.jsxs("div",{className:"flex items-center gap-2 px-2",children:[t&&S.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:S.jsx(Va,{className:"h-4 w-4"})}),S.jsxs(qp,{to:"/",className:"flex flex-1 items-center gap-3 overflow-hidden",children:[S.jsx("div",{className:"h-8 w-8 shrink-0 overflow-hidden rounded-lg border-2 border-black",children:S.jsx("img",{src:"/logo.png",alt:o,className:"h-full w-full object-cover"})}),S.jsx("span",{className:"truncate text-sm font-semibold tracking-tight",children:o})]}),S.jsx("button",{type:"button",onClick:d,className:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-sidebar-accent hover:text-foreground","aria-label":e(f?"settings.themeLight":"settings.themeDark"),title:e(f?"settings.themeLight":"settings.themeDark"),children:f?S.jsx(E9,{className:"h-4 w-4"}):S.jsx(Z8,{className:"h-4 w-4"})}),S.jsx(qp,{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:S.jsx(b9,{className:"h-4 w-4"})})]})}const iv="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]",cte=[{title:"nav.manageDevices",url:"/devices",icon:vm}];function ute({...e}){const{t}=mn(),n=Bi(a=>a.sidebarTab),r=Bi(a=>a.setSidebarTab);return S.jsxs(bq,{variant:"inset",...e,children:[S.jsx("div",{className:"h-[var(--tmex-safe-area-top)]"}),S.jsxs(Sq,{className:"gap-5 pt-3 pb-0",children:[S.jsx(lte,{}),S.jsx(IZ,{className:"mb-2.5",value:n,onValueChange:a=>r(a),children:S.jsxs(LZ,{className:"w-full p-1 rounded-xl border border-border/60 group-data-horizontal/tabs:h-11",children:[S.jsxs(Qb,{value:"panes","data-testid":"sidebar-tab-panes",className:iv,children:[S.jsx(n9,{}),t("sidebar.tab.panes")]}),S.jsxs(Qb,{value:"agent","data-testid":"sidebar-tab-agent",className:iv,children:[S.jsx(P0,{}),t("sidebar.tab.agent")]}),S.jsxs(Qb,{value:"files","data-testid":"sidebar-tab-files",className:iv,children:[S.jsx(P8,{}),t("sidebar.tab.files")]})]})})]}),S.jsxs(Cq,{className:"flex min-h-0 flex-col overflow-hidden",children:[n==="panes"&&S.jsx(rte,{}),n==="agent"&&S.jsx(IQ,{}),n==="files"&&S.jsx(yZ,{})]}),n==="panes"&&S.jsxs(Eq,{children:[S.jsx(_Z,{items:cte}),S.jsx("div",{className:"h-[var(--tmex-safe-area-bottom)]"})]})]})}let aM=!1;function dte(e,t,n){var a,o,l;let r=n;if(!r){const c=(o=(a=kn.getState().snapshots[e])==null?void 0:a.session)==null?void 0:o.windows;r=(l=c==null?void 0:c.find(f=>f.panes.some(d=>d.id===t)))==null?void 0:l.id}return r?`/devices/${e}/windows/${r}/panes/${fw(t)}`:`/devices/${e}`}function fte(e,t){const n=e.getQueriesData({queryKey:["watch-rules"]});for(const[,r]of n){const a=r==null?void 0:r.find(o=>o.id===t);if(a)return a.name}return null}async function hte(e,t){var r;const n=fte(e,t);if(n)return n;try{const a=await fetch(`/api/watch/rules/${t}`);return a.ok?((r=(await a.json()).rule)==null?void 0:r.name)??null:null}catch{return null}}function pte(e,t,n){if(!(typeof Notification>"u"||Notification.permission!=="granted"))try{const r=new Notification(e,{body:t});r.onclick=()=>{window.focus(),window.location.href=n}}catch{}}function mte(e,t){e.invalidateQueries({queryKey:["watch-rules"]}),e.invalidateQueries({queryKey:["watch-rule-state",t]})}async function gte(e,t,n,r,a){const l=await hte(e,t)??hn.t("watch.toast.triggeredTitle"),c=a.summary||a.matchedText||"",f=c.length>200?`${c.slice(0,200)}…`:c,d=dte(n,r,a.windowId);sn(l,{description:f,action:{label:hn.t("watch.toast.openTerminal"),onClick:()=>{window.location.href=d}}}),pte(l,f,d)}function yte(e){if(aM)return;aM=!0,Dn().onMessage(n=>{if(n.kind!==v3)return;let r;try{r=_a(R5,n.payload)}catch(o){console.error("[watch] failed to decode WATCH_EVENT:",o);return}let a;try{a=JSON.parse(new TextDecoder().decode(r.payload))}catch(o){console.error("[watch] failed to parse WATCH_EVENT payload:",o);return}switch(mte(e,r.ruleId),r.eventType){case I3:gte(e,r.ruleId,r.deviceId,r.paneId,a);return;case P3:{const o=a;sn.warning(hn.t("watch.toast.modelUnavailableTitle"),{description:`${o.message} ${hn.t("watch.toast.modelUnavailableHint")}`});return}case L3:{const o=a;sn.error(hn.t("watch.toast.ruleErrorTitle"),{description:o.message});return}default:return}})}function bte(){const e=el();return v.useEffect(()=>{yte(e),Dn().connect()},[e]),null}const vte=60,xte=.02;function wte(e){if(Math.abs(e.viewportScale-1)>xte)return 0;const t=Math.round(e.windowInnerHeight-e.viewportHeight-e.viewportOffsetTop);return t>=vte?t:0}function Kte(){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 Ste(){return typeof window>"u"||typeof navigator>"u"?!1:"ontouchstart"in window||navigator.maxTouchPoints>0}function Ete(e){const[t,n]=v.useState(0);return v.useEffect(()=>{if(!Ste())return;const r=window.visualViewport;if(!r)return;let a=null;const o=()=>{if(e){n(0);return}const c=document.activeElement;if(!(c instanceof Element&&c.closest("[data-virtual-keyboard-avoid]")!==null)){n(0);return}n(wte({windowInnerHeight:window.innerHeight,viewportHeight:r.height,viewportOffsetTop:r.offsetTop,viewportScale:r.scale}))},l=()=>{a===null&&(a=window.requestAnimationFrame(()=>{a=null,o()}))};return o(),r.addEventListener("resize",l),r.addEventListener("scroll",l),window.addEventListener("resize",l),document.addEventListener("focusin",l),document.addEventListener("focusout",l),()=>{r.removeEventListener("resize",l),r.removeEventListener("scroll",l),window.removeEventListener("resize",l),document.removeEventListener("focusin",l),document.removeEventListener("focusout",l),a!==null&&window.cancelAnimationFrame(a)}},[e]),t}function Cte(){var e;try{const t=localStorage.getItem("tmex-ui");if(!t){document.documentElement.classList.add("dark");return}const n=JSON.parse(t),r=(e=n==null?void 0:n.state)==null?void 0:e.theme,a=r==="dark"||r===void 0;document.documentElement.classList.toggle("dark",a)}catch{document.documentElement.classList.add("dark")}}Cte();const Tte=new AL({defaultOptions:{queries:{staleTime:5e3,retry:1}}});function Rte(){const{openMobile:e}=Ur(),t=Bi(n=>n.theme);return v.useEffect(()=>{const n=e?"--sidebar":"--background";document.body.style.backgroundColor=`var(${n})`,requestAnimationFrame(()=>{var o;const a=getComputedStyle(document.body).backgroundColor;(o=document.querySelector('meta[name="theme-color"]'))==null||o.setAttribute("content",a)})},[e,t]),null}function kte(){return S.jsxs(bV,{children:[S.jsx(bte,{}),S.jsxs(yq,{children:[S.jsx(Rte,{}),S.jsx(Lq,{}),S.jsx(ute,{}),S.jsx(Mte,{})]})]})}function Mte(){const{openMobile:e}=Ur(),t=Ete(e);return S.jsxs(wq,{className:"h-dvh overflow-hidden md:h-[calc(100dvh-1rem)]",style:t>0?{transform:`translateY(-${t}px)`,transition:"transform 0.12s ease-out"}:void 0,children:[S.jsx(Bj,{}),S.jsx("div",{style:{height:t>0?0:"var(--tmex-safe-area-bottom)",transition:"height 0.12s ease-out"}})]})}function Vl({moduleLoader:e}){const[t,n]=v.useState(null),r=bj();v.useEffect(()=>{e().then(n)},[e]);const a=t==null?void 0:t.default,o=t==null?void 0:t.PageTitle,l=t==null?void 0:t.PageActions;return S.jsxs(S.Fragment,{children:[S.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:[S.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2 px-4",children:[S.jsx(xq,{className:"-ml-1 shrink-0","data-testid":"mobile-sidebar-open"}),S.jsx(RH,{orientation:"vertical",className:"mr-2 shrink-0 data-[orientation=vertical]:h-4"}),S.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:o?S.jsx(o,{...r}):""})]}),S.jsx("div",{className:"flex shrink-0 items-center gap-1 px-4",children:l&&S.jsx(l,{...r})})]}),S.jsx("div",{className:"flex min-h-0 flex-1 flex-col gap-4 !pt-0 p-2 md:p-4",children:S.jsx("div",{className:"bg-muted/50 min-h-0 flex-1 overflow-auto overscroll-auto rounded-xl [-webkit-overflow-scrolling:touch]",children:a?S.jsx(a,{}):null})})]})}const Ote=()=>Kp(()=>import("./SettingsPage-Cfzr_Phh.js"),__vite__mapDeps([0,1,2])),oM=()=>Kp(()=>import("./DevicesPage-CKnRUGQm.js"),__vite__mapDeps([3,1])),sM=()=>Kp(()=>import("./DevicePage-5vkaNOjl.js"),__vite__mapDeps([4,2])),Ate=()=>Kp(()=>import("./FilePage-Uj-tzGW7.js").then(e=>e.F),__vite__mapDeps([5,6])),Nte=dz([{path:"/",Component:kte,children:[{index:!0,element:S.jsx(Vl,{moduleLoader:oM})},{path:"devices",element:S.jsx(Vl,{moduleLoader:oM})},{path:"devices/:deviceId",element:S.jsx(Vl,{moduleLoader:sM})},{path:"devices/:deviceId/windows/:windowId/panes/:paneId",element:S.jsx(Vl,{moduleLoader:sM})},{path:"settings",element:S.jsx(Vl,{moduleLoader:Ote})},{path:"file/:ref",element:S.jsx(Vl,{moduleLoader:Ate})}]}]),WD=document.getElementById("root");if(!WD)throw new Error("Root element not found");XL.createRoot(WD).render(S.jsx(v.StrictMode,{children:S.jsxs(DL,{client:Tte,children:[S.jsx(jj,{router:Nte}),S.jsx(Xz,{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}})]})}));export{qte as $,dx as A,Ht as B,wx as C,pw as D,y8 as E,Sx as F,L0 as G,lD as H,Pi as I,up as J,dp as K,Wx as L,vm as M,Gb as N,fp as O,wm as P,La as Q,H0 as R,RH as S,cA as T,Vk as U,Pe as V,gt as W,Gp as X,Ute as Y,uA as Z,tZ as _,el as a,Lp as a0,Hte as a1,Gs as a2,nZ as a3,Va as a4,Xs as a5,Bi as a6,Pte as a7,m2 as a8,hn as a9,aN as aA,dW as aB,zte as aC,_K as aD,on as aE,vt as aF,Kp as aG,VW as aH,rX as aI,ZQ as aJ,sA as aK,eZ as aL,p8 as aM,$te as aN,Vte as aO,CR as aa,jq as ab,_q as ac,_te as ad,Td as ae,Lte as af,bj as ag,Hd as ah,Yte as ai,Kte as aj,NV as ak,fw as al,jte as am,V8 as an,u9 as ao,xJ as ap,pJ as aq,hJ as ar,Tm as as,nw as at,$V as au,Bte as av,Fte as aw,Qv as ax,KV as ay,V0 as az,Ei as b,kn as c,yd as d,fx as e,hx as f,qk as g,mx as h,gx as i,S as j,px as k,bx as l,yx as m,mw as n,gw as o,ac as p,xm as q,v as r,Wte as s,sn as t,mn as u,Zs as v,zZ as w,MB as x,vx as y,xx as z};
466
+ //# sourceMappingURL=index-OpBFduyh.js.map