tmex-cli 0.9.2 → 0.11.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 (139) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/runtime/server.js +1988 -148
  3. package/package.json +4 -3
  4. package/resources/fe-dist/assets/DevicePage-fGI-do8S.js +26 -0
  5. package/resources/fe-dist/assets/DevicesPage-kGrzwhGj.js +2 -0
  6. package/resources/fe-dist/assets/FilePage-YWma96aj.js +16 -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-LhUD03Ln.js +32 -0
  67. package/resources/fe-dist/assets/arc-DLVa298O.js +2 -0
  68. package/resources/fe-dist/assets/architectureDiagram-3BPJPVTR-EOUpuRby.js +37 -0
  69. package/resources/fe-dist/assets/blockDiagram-GPEHLZMM-BTwwkzZh.js +133 -0
  70. package/resources/fe-dist/assets/c4Diagram-AAUBKEIU-xvTqXxl9.js +11 -0
  71. package/resources/fe-dist/assets/card-cbVDy0Xp.js +2 -0
  72. package/resources/fe-dist/assets/channel-DbG6qNF6.js +2 -0
  73. package/resources/fe-dist/assets/chunk-2J33WTMH-Blr6l1Nk.js +2 -0
  74. package/resources/fe-dist/assets/chunk-4BX2VUAB-D_Y2TeLg.js +2 -0
  75. package/resources/fe-dist/assets/chunk-55IACEB6-CimNoYDH.js +2 -0
  76. package/resources/fe-dist/assets/chunk-727SXJPM-JPYDN0Cb.js +207 -0
  77. package/resources/fe-dist/assets/chunk-AQP2D5EJ-Cb3NZBib.js +232 -0
  78. package/resources/fe-dist/assets/chunk-FMBD7UC4-DyZ7Ot2F.js +16 -0
  79. package/resources/fe-dist/assets/chunk-ND2GUHAM-SU6Ea3wF.js +2 -0
  80. package/resources/fe-dist/assets/chunk-QZHKN3VN-B6qXX6sU.js +2 -0
  81. package/resources/fe-dist/assets/classDiagram-4FO5ZUOK-rB1DgxOZ.js +2 -0
  82. package/resources/fe-dist/assets/classDiagram-v2-Q7XG4LA2-rB1DgxOZ.js +2 -0
  83. package/resources/fe-dist/assets/cose-bilkent-S5V4N54A-BAyMopHS.js +2 -0
  84. package/resources/fe-dist/assets/cytoscape.esm-DTSO7Bv0.js +332 -0
  85. package/resources/fe-dist/assets/dagre-BM42HDAG-Ckrx9BXZ.js +5 -0
  86. package/resources/fe-dist/assets/defaultLocale-DX6XiGOO.js +2 -0
  87. package/resources/fe-dist/assets/diagram-2AECGRRQ-DTnZtf2k.js +44 -0
  88. package/resources/fe-dist/assets/diagram-5GNKFQAL-DBpgZj4a.js +11 -0
  89. package/resources/fe-dist/assets/diagram-KO2AKTUF-CfijYCeY.js +4 -0
  90. package/resources/fe-dist/assets/diagram-LMA3HP47-D7nBmQ-E.js +25 -0
  91. package/resources/fe-dist/assets/diagram-OG6HWLK6-Bi8sHV0O.js +25 -0
  92. package/resources/fe-dist/assets/erDiagram-TEJ5UH35-DcoDesO2.js +86 -0
  93. package/resources/fe-dist/assets/flowDiagram-I6XJVG4X-Bbcl9kxS.js +163 -0
  94. package/resources/fe-dist/assets/ganttDiagram-6RSMTGT7-BM8Y7jwp.js +293 -0
  95. package/resources/fe-dist/assets/gitGraphDiagram-PVQCEYII-x3wpNQcW.js +107 -0
  96. package/resources/fe-dist/assets/graph-CAnANduQ.js +2 -0
  97. package/resources/fe-dist/assets/index-cfY8KuW7.js +466 -0
  98. package/resources/fe-dist/assets/index-vcS0VPIW.css +1 -0
  99. package/resources/fe-dist/assets/infoDiagram-5YYISTIA-Bl6cgwVb.js +3 -0
  100. package/resources/fe-dist/assets/init-Gi6I4Gst.js +2 -0
  101. package/resources/fe-dist/assets/ishikawaDiagram-YF4QCWOH-BfQ7aZxN.js +71 -0
  102. package/resources/fe-dist/assets/journeyDiagram-JHISSGLW-DSwQzmdL.js +140 -0
  103. package/resources/fe-dist/assets/kanban-definition-UN3LZRKU-B1aWDl4E.js +90 -0
  104. package/resources/fe-dist/assets/layout-DGIYPm2g.js +2 -0
  105. package/resources/fe-dist/assets/linear-CfhRC4iX.js +2 -0
  106. package/resources/fe-dist/assets/markdown-preview-Bf_6UH9R.css +1 -0
  107. package/resources/fe-dist/assets/markdown-preview-CfBRMViB.js +269 -0
  108. package/resources/fe-dist/assets/mermaid.core-M-o4g4TO.js +310 -0
  109. package/resources/fe-dist/assets/mindmap-definition-RKZ34NQL-D976sxOA.js +97 -0
  110. package/resources/fe-dist/assets/ordinal-BENe2yWM.js +2 -0
  111. package/resources/fe-dist/assets/pieDiagram-4H26LBE5-PVQ3-EB6.js +31 -0
  112. package/resources/fe-dist/assets/quadrantDiagram-W4KKPZXB-BNEFhYNq.js +8 -0
  113. package/resources/fe-dist/assets/{refresh-cw-D0LYIwxc.js → refresh-cw-cfX5JiIH.js} +3 -3
  114. package/resources/fe-dist/assets/requirementDiagram-4Y6WPE33-B7Zd2lpN.js +85 -0
  115. package/resources/fe-dist/assets/sankeyDiagram-5OEKKPKP-D_Td4j-B.js +41 -0
  116. package/resources/fe-dist/assets/sequenceDiagram-3UESZ5HK-DQSVX5mL.js +163 -0
  117. package/resources/fe-dist/assets/stateDiagram-AJRCARHV-C0PNCTfs.js +2 -0
  118. package/resources/fe-dist/assets/stateDiagram-v2-BHNVJYJU-CB5OePKf.js +2 -0
  119. package/resources/fe-dist/assets/timeline-definition-PNZ67QCA-BlMj8Fl1.js +121 -0
  120. package/resources/fe-dist/assets/vennDiagram-CIIHVFJN-DuGxwZiq.js +35 -0
  121. package/resources/fe-dist/assets/wardley-L42UT6IY-4VhWbg10.js +174 -0
  122. package/resources/fe-dist/assets/wardleyDiagram-YWT4CUSO-Bu4k6xIx.js +79 -0
  123. package/resources/fe-dist/assets/xychartDiagram-2RQKCTM6-Cv88IDWh.js +8 -0
  124. package/resources/fe-dist/fonts/GeistMonoNerdFontMono-Bold.woff2 +0 -0
  125. package/resources/fe-dist/fonts/GeistMonoNerdFontMono-Regular.woff2 +0 -0
  126. package/resources/fe-dist/index.html +2 -2
  127. package/resources/fe-dist/tmex-maskable.png +0 -0
  128. package/resources/fe-dist/tmex.png +0 -0
  129. package/resources/gateway-drizzle/0007_fearless_pestilence.sql +8 -0
  130. package/resources/gateway-drizzle/0008_perfect_ozymandias.sql +7 -0
  131. package/resources/gateway-drizzle/meta/_journal.json +14 -0
  132. package/resources/fe-dist/assets/DevicePage-RqH-pnZX.js +0 -26
  133. package/resources/fe-dist/assets/DevicesPage-BPLJu-5J.js +0 -2
  134. package/resources/fe-dist/assets/SettingsPage-CKP305BP.js +0 -22
  135. package/resources/fe-dist/assets/card-X35xwXzW.js +0 -2
  136. package/resources/fe-dist/assets/index-CKQEHZcV.css +0 -1
  137. package/resources/fe-dist/assets/index-O2a9149K.js +0 -400
  138. package/resources/fe-dist/fonts/GeistMono-Bold.woff2 +0 -0
  139. package/resources/fe-dist/fonts/GeistMono-Regular.woff2 +0 -0
@@ -1,400 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SettingsPage-CKP305BP.js","assets/card-X35xwXzW.js","assets/refresh-cw-D0LYIwxc.js","assets/DevicesPage-BPLJu-5J.js","assets/DevicePage-RqH-pnZX.js"])))=>i.map(i=>d[i]);
2
- var _P=Object.defineProperty;var nC=e=>{throw TypeError(e)};var zP=(e,t,n)=>t in e?_P(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var st=(e,t,n)=>zP(e,typeof t!="symbol"?t+"":t,n),Py=(e,t,n)=>t.has(e)||nC("Cannot "+n);var re=(e,t,n)=>(Py(e,t,"read from private field"),n?n.call(e):t.get(e)),pt=(e,t,n)=>t.has(e)?nC("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Qe=(e,t,n,r)=>(Py(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Bt=(e,t,n)=>(Py(e,t,"access private method"),n);var mh=(e,t,n,r)=>({set _(a){Qe(e,t,a,n)},get _(){return re(e,t,r)}});function FP(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 BP="modulepreload",HP=function(e){return"/"+e},rC={},vx=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=HP(d),d in rC)return;rC[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":BP,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 Bp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ly={exports:{}},Mu={};/**
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 iC;function UP(){if(iC)return Mu;iC=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 Mu.Fragment=t,Mu.jsx=n,Mu.jsxs=n,Mu}var aC;function VP(){return aC||(aC=1,Ly.exports=UP()),Ly.exports}var E=VP(),Tc=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(){}},qP={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Ro,bx,Wk,$P=(Wk=class{constructor(){pt(this,Ro,qP);pt(this,bx,!1)}setTimeoutProvider(e){Qe(this,Ro,e)}setTimeout(e,t){return re(this,Ro).setTimeout(e,t)}clearTimeout(e){re(this,Ro).clearTimeout(e)}setInterval(e,t){return re(this,Ro).setInterval(e,t)}clearInterval(e){re(this,Ro).clearInterval(e)}},Ro=new WeakMap,bx=new WeakMap,Wk),Cs=new $P;function YP(e){setTimeout(e,0)}var Bs=typeof window>"u"||"Deno"in globalThis;function Tr(){}function WP(e,t){return typeof e=="function"?e(t):e}function Gb(e){return typeof e=="number"&&e>=0&&e!==1/0}function iM(e,t){return Math.max(e+(t||0)-Date.now(),0)}function zo(e,t){return typeof e=="function"?e(t):e}function yi(e,t){return typeof e=="function"?e(t):e}function oC(e,t){const{type:n="all",exact:r,fetchStatus:a,predicate:o,queryKey:l,stale:c}=e;if(l){if(r){if(t.queryHash!==xx(l,t.options))return!1}else if(!hd(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 sC(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(!hd(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||a&&!a(t))}function xx(e,t){return((t==null?void 0:t.queryKeyHashFn)||Hs)(e)}function Hs(e){return JSON.stringify(e,(t,n)=>Xb(n)?Object.keys(n).sort().reduce((r,a)=>(r[a]=n[a],r),{}):n)}function hd(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>hd(e[n],t[n])):!1}var KP=Object.prototype.hasOwnProperty;function aM(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=lC(e)&&lC(t);if(!r&&!(Xb(e)&&Xb(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:KP.call(e,h))&&d++;continue}if(y===null||g===null||typeof y!="object"||typeof g!="object"){f[h]=g;continue}const w=aM(y,g,n+1);f[h]=w,w===y&&d++}return o===c&&d===o?e:f}function lp(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 lC(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Xb(e){if(!cC(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!cC(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function cC(e){return Object.prototype.toString.call(e)==="[object Object]"}function GP(e){return new Promise(t=>{Cs.setTimeout(t,e)})}function Qb(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?aM(e,t):t}function XP(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function QP(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var wx=Symbol();function oM(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===wx?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Sx(e,t){return typeof e=="function"?e(...t):!!e}function ZP(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,ko,nc,Kk,JP=(Kk=class extends Tc{constructor(){super();pt(this,Ms);pt(this,ko);pt(this,nc);Qe(this,nc,t=>{if(!Bs&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){re(this,ko)||this.setEventListener(re(this,nc))}onUnsubscribe(){var t;this.hasListeners()||((t=re(this,ko))==null||t.call(this),Qe(this,ko,void 0))}setEventListener(t){var n;Qe(this,nc,t),(n=re(this,ko))==null||n.call(this),Qe(this,ko,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,ko=new WeakMap,nc=new WeakMap,Kk),Ex=new JP;function Zb(){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 eL=YP;function tL(){let e=[],t=0,n=c=>{c()},r=c=>{c()},a=eL;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 er=tL(),rc,Mo,ic,Gk,nL=(Gk=class extends Tc{constructor(){super();pt(this,rc,!0);pt(this,Mo);pt(this,ic);Qe(this,ic,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,Mo)||this.setEventListener(re(this,ic))}onUnsubscribe(){var t;this.hasListeners()||((t=re(this,Mo))==null||t.call(this),Qe(this,Mo,void 0))}setEventListener(t){var n;Qe(this,ic,t),(n=re(this,Mo))==null||n.call(this),Qe(this,Mo,t(this.setOnline.bind(this)))}setOnline(t){re(this,rc)!==t&&(Qe(this,rc,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return re(this,rc)}},rc=new WeakMap,Mo=new WeakMap,ic=new WeakMap,Gk),cp=new nL;function rL(e){return Math.min(1e3*2**e,3e4)}function sM(e){return(e??"online")==="online"?cp.isOnline():!0}var Jb=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function lM(e){let t=!1,n=0,r;const a=Zb(),o=()=>a.status!=="pending",l=C=>{var T;if(!o()){const S=new Jb(C);y(S),(T=e.onCancel)==null||T.call(e,S)}},c=()=>{t=!0},f=()=>{t=!1},d=()=>Ex.isFocused()&&(e.networkMode==="always"||cp.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=S=>{(o()||d())&&C(S)},(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(S){C=Promise.reject(S)}Promise.resolve(C).then(h).catch(S=>{var A;if(o())return;const R=e.retry??(Bs?0:3),k=e.retryDelay??rL,M=typeof k=="function"?k(n,S):k,D=R===!0||typeof R=="number"&&n<R||typeof R=="function"&&R(n,S);if(t||!D){y(S);return}n++,(A=e.onFail)==null||A.call(e,n,S),GP(M).then(()=>d()?void 0:g()).then(()=>{t?y(S):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 As,Xk,cM=(Xk=class{constructor(){pt(this,As)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Gb(this.gcTime)&&Qe(this,As,Cs.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Bs?1/0:300*1e3))}clearGcTimeout(){re(this,As)&&(Cs.clearTimeout(re(this,As)),Qe(this,As,void 0))}},As=new WeakMap,Xk),Os,ac,mi,Ns,ar,Ad,Ds,Pi,Na,Qk,iL=(Qk=class extends cM{constructor(t){super();pt(this,Pi);pt(this,Os);pt(this,ac);pt(this,mi);pt(this,Ns);pt(this,ar);pt(this,Ad);pt(this,Ds);Qe(this,Ds,!1),Qe(this,Ad,t.defaultOptions),this.setOptions(t.options),this.observers=[],Qe(this,Ns,t.client),Qe(this,mi,re(this,Ns).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Qe(this,Os,dC(this.options)),this.state=t.state??re(this,Os),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,Ad),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=dC(this.options);n.data!==void 0&&(this.setState(uC(n.data,n.dataUpdatedAt)),Qe(this,Os,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&re(this,mi).remove(this)}setData(t,n){const r=Qb(this.state.data,t,this.options);return Bt(this,Pi,Na).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,Pi,Na).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,Os))}isActive(){return this.observers.some(t=>yi(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===wx||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>zo(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:!iM(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,mi).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,mi).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Bt(this,Pi,Na).call(this,{type:"invalidate"})}async fetch(t,n){var f,d,m,h,y,g,w,C,T,S,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=oM(this.options,n),A=(()=>{const O={client:re(this,Ns),queryKey:this.queryKey,meta:this.meta};return a(O),O})();return Qe(this,Ds,!1),this.options.persister?this.options.persister(M,A,this):M(A)},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,ac,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((m=c.fetchOptions)==null?void 0:m.meta))&&Bt(this,Pi,Na).call(this,{type:"fetch",meta:(h=c.fetchOptions)==null?void 0:h.meta}),Qe(this,ar,lM({initialPromise:n==null?void 0:n.initialPromise,fn:c.fetchFn,onCancel:M=>{M instanceof Jb&&M.revert&&this.setState({...re(this,ac),fetchStatus:"idle"}),r.abort()},onFail:(M,D)=>{Bt(this,Pi,Na).call(this,{type:"failed",failureCount:M,error:D})},onPause:()=>{Bt(this,Pi,Na).call(this,{type:"pause"})},onContinue:()=>{Bt(this,Pi,Na).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,mi).config).onSuccess)==null||g.call(y,M,this),(C=(w=re(this,mi).config).onSettled)==null||C.call(w,M,this.state.error,this),M}catch(M){if(M instanceof Jb){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,Pi,Na).call(this,{type:"error",error:M}),(S=(T=re(this,mi).config).onError)==null||S.call(T,M,this),(k=(R=re(this,mi).config).onSettled)==null||k.call(R,this.state.data,M,this),M}finally{this.scheduleGc()}}},Os=new WeakMap,ac=new WeakMap,mi=new WeakMap,Ns=new WeakMap,ar=new WeakMap,Ad=new WeakMap,Ds=new WeakMap,Pi=new WeakSet,Na=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,...uM(r.data,this.options),fetchMeta:t.meta??null};case"success":const a={...r,...uC(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Qe(this,ac,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),er.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),re(this,mi).notify({query:this,type:"updated",action:t})})},Qk);function uM(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:sM(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function uC(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function dC(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 _r,nn,Od,Cr,Is,oc,ja,Ao,Nd,sc,lc,Ps,Ls,Oo,cc,fn,$u,ev,tv,nv,rv,iv,av,ov,dM,Zk,aL=(Zk=class extends Tc{constructor(t,n){super();pt(this,fn);pt(this,_r);pt(this,nn);pt(this,Od);pt(this,Cr);pt(this,Is);pt(this,oc);pt(this,ja);pt(this,Ao);pt(this,Nd);pt(this,sc);pt(this,lc);pt(this,Ps);pt(this,Ls);pt(this,Oo);pt(this,cc,new Set);this.options=n,Qe(this,_r,t),Qe(this,Ao,null),Qe(this,ja,Zb()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(re(this,nn).addObserver(this),fC(re(this,nn),this.options)?Bt(this,fn,$u).call(this):this.updateResult(),Bt(this,fn,rv).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return sv(re(this,nn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return sv(re(this,nn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Bt(this,fn,iv).call(this),Bt(this,fn,av).call(this),re(this,nn).removeObserver(this)}setOptions(t){const n=this.options,r=re(this,nn);if(this.options=re(this,_r).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof yi(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,fn,ov).call(this),re(this,nn).setOptions(this.options),n._defaulted&&!lp(this.options,n)&&re(this,_r).getQueryCache().notify({type:"observerOptionsUpdated",query:re(this,nn),observer:this});const a=this.hasListeners();a&&hC(re(this,nn),r,this.options,n)&&Bt(this,fn,$u).call(this),this.updateResult(),a&&(re(this,nn)!==r||yi(this.options.enabled,re(this,nn))!==yi(n.enabled,re(this,nn))||zo(this.options.staleTime,re(this,nn))!==zo(n.staleTime,re(this,nn)))&&Bt(this,fn,ev).call(this);const o=Bt(this,fn,tv).call(this);a&&(re(this,nn)!==r||yi(this.options.enabled,re(this,nn))!==yi(n.enabled,re(this,nn))||o!==re(this,Oo))&&Bt(this,fn,nv).call(this,o)}getOptimisticResult(t){const n=re(this,_r).getQueryCache().build(re(this,_r),t),r=this.createResult(n,t);return sL(this,r)&&(Qe(this,Cr,r),Qe(this,oc,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,cc).add(t)}getCurrentQuery(){return re(this,nn)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=re(this,_r).defaultQueryOptions(t),r=re(this,_r).getQueryCache().build(re(this,_r),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Bt(this,fn,$u).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),re(this,Cr)))}createResult(t,n){var V;const r=re(this,nn),a=this.options,o=re(this,Cr),l=re(this,Is),c=re(this,oc),d=t!==r?t.state:re(this,Od),{state:m}=t;let h={...m},y=!1,g;if(n._optimisticResults){const F=this.hasListeners(),W=!F&&fC(t,n),j=F&&hC(t,r,n,a);(W||j)&&(h={...h,...uM(m.data,t.options)}),n._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:w,errorUpdatedAt:C,status:T}=h;g=h.data;let S=!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,S=!0):F=typeof n.placeholderData=="function"?n.placeholderData((V=re(this,lc))==null?void 0:V.state.data,re(this,lc)):n.placeholderData,F!==void 0&&(T="success",g=Qb(o==null?void 0:o.data,F,n),y=!0)}if(n.select&&g!==void 0&&!S)if(o&&g===(l==null?void 0:l.data)&&n.select===re(this,Nd))g=re(this,sc);else try{Qe(this,Nd,n.select),g=n.select(g),g=Qb(o==null?void 0:o.data,g,n),Qe(this,sc,g),Qe(this,Ao,null)}catch(F){Qe(this,Ao,F)}re(this,Ao)&&(w=re(this,Ao),g=re(this,sc),C=Date.now(),T="error");const R=h.fetchStatus==="fetching",k=T==="pending",M=T==="error",D=k&&R,A=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&&!A,isPaused:h.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:M&&A,isStale:Cx(t,n),refetch:this.refetch,promise:re(this,ja),isEnabled:yi(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const F=L.data!==void 0,W=L.status==="error"&&!F,j=B=>{W?B.reject(L.error):F&&B.resolve(L.data)},q=()=>{const B=Qe(this,ja,L.promise=Zb());j(B)},$=re(this,ja);switch($.status){case"pending":t.queryHash===r.queryHash&&j($);break;case"fulfilled":(W||L.data!==$.value)&&q();break;case"rejected":(!W||L.error!==$.reason)&&q();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,oc,this.options),re(this,Is).data!==void 0&&Qe(this,lc,re(this,nn)),lp(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,cc).size)return!0;const l=new Set(o??re(this,cc));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,fn,dM).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Bt(this,fn,rv).call(this)}},_r=new WeakMap,nn=new WeakMap,Od=new WeakMap,Cr=new WeakMap,Is=new WeakMap,oc=new WeakMap,ja=new WeakMap,Ao=new WeakMap,Nd=new WeakMap,sc=new WeakMap,lc=new WeakMap,Ps=new WeakMap,Ls=new WeakMap,Oo=new WeakMap,cc=new WeakMap,fn=new WeakSet,$u=function(t){Bt(this,fn,ov).call(this);let n=re(this,nn).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Tr)),n},ev=function(){Bt(this,fn,iv).call(this);const t=zo(this.options.staleTime,re(this,nn));if(Bs||re(this,Cr).isStale||!Gb(t))return;const r=iM(re(this,Cr).dataUpdatedAt,t)+1;Qe(this,Ps,Cs.setTimeout(()=>{re(this,Cr).isStale||this.updateResult()},r))},tv=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(re(this,nn)):this.options.refetchInterval)??!1},nv=function(t){Bt(this,fn,av).call(this),Qe(this,Oo,t),!(Bs||yi(this.options.enabled,re(this,nn))===!1||!Gb(re(this,Oo))||re(this,Oo)===0)&&Qe(this,Ls,Cs.setInterval(()=>{(this.options.refetchIntervalInBackground||Ex.isFocused())&&Bt(this,fn,$u).call(this)},re(this,Oo)))},rv=function(){Bt(this,fn,ev).call(this),Bt(this,fn,nv).call(this,Bt(this,fn,tv).call(this))},iv=function(){re(this,Ps)&&(Cs.clearTimeout(re(this,Ps)),Qe(this,Ps,void 0))},av=function(){re(this,Ls)&&(Cs.clearInterval(re(this,Ls)),Qe(this,Ls,void 0))},ov=function(){const t=re(this,_r).getQueryCache().build(re(this,_r),this.options);if(t===re(this,nn))return;const n=re(this,nn);Qe(this,nn,t),Qe(this,Od,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},dM=function(t){er.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(re(this,Cr))}),re(this,_r).getQueryCache().notify({query:re(this,nn),type:"observerResultsUpdated"})})},Zk);function oL(e,t){return yi(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function fC(e,t){return oL(e,t)||e.state.data!==void 0&&sv(e,t,t.refetchOnMount)}function sv(e,t,n){if(yi(t.enabled,e)!==!1&&zo(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Cx(e,t)}return!1}function hC(e,t,n,r){return(e!==t||yi(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Cx(e,n)}function Cx(e,t){return yi(t.enabled,e)!==!1&&e.isStaleByTime(zo(t.staleTime,e))}function sL(e,t){return!lp(e.getCurrentResult(),t)}function pC(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=>{ZP(k,()=>t.signal,()=>C=!0)},S=oM(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 O=(()=>{const W={client:t.client,queryKey:t.queryKey,pageParam:M,direction:D?"backward":"forward",meta:t.options.meta};return T(W),W})(),L=await S(O),{maxPages:V}=t.options,F=D?QP:XP;return{pages:F(k.pages,L,V),pageParams:F(k.pageParams,M,V)}};if(a&&o.length){const k=a==="backward",M=k?lL:mC,D={pages:o,pageParams:l},A=M(r,D);c=await R(D,A,k)}else{const k=e??o.length;do{const M=f===0?l[0]??r.initialPageParam:mC(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 mC(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 lL(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Dd,Ki,gr,js,Gi,wo,Jk,cL=(Jk=class extends cM{constructor(t){super();pt(this,Gi);pt(this,Dd);pt(this,Ki);pt(this,gr);pt(this,js);Qe(this,Dd,t.client),this.mutationId=t.mutationId,Qe(this,gr,t.mutationCache),Qe(this,Ki,[]),this.state=t.state||fM(),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,Ki).includes(t)||(re(this,Ki).push(t),this.clearGcTimeout(),re(this,gr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Qe(this,Ki,re(this,Ki).filter(n=>n!==t)),this.scheduleGc(),re(this,gr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){re(this,Ki).length||(this.state.status==="pending"?this.scheduleGc():re(this,gr).remove(this))}continue(){var t;return((t=re(this,js))==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,S,R,k,M,D,A,O;const n=()=>{Bt(this,Gi,wo).call(this,{type:"continue"})},r={client:re(this,Dd),meta:this.options.meta,mutationKey:this.options.mutationKey};Qe(this,js,lM({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(L,V)=>{Bt(this,Gi,wo).call(this,{type:"failed",failureCount:L,error:V})},onPause:()=>{Bt(this,Gi,wo).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,js).canStart();try{if(a)n();else{Bt(this,Gi,wo).call(this,{type:"pending",variables:t,isPaused:o}),re(this,gr).config.onMutate&&await re(this,gr).config.onMutate(t,this,r);const V=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t,r));V!==this.state.context&&Bt(this,Gi,wo).call(this,{type:"pending",context:V,variables:t,isPaused:o})}const L=await re(this,js).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,Gi,wo).call(this,{type:"success",data:L}),L}catch(L){try{await((S=(T=re(this,gr).config).onError)==null?void 0:S.call(T,L,t,this.state.context,this,r))}catch(V){Promise.reject(V)}try{await((k=(R=this.options).onError)==null?void 0:k.call(R,L,t,this.state.context,r))}catch(V){Promise.reject(V)}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(V){Promise.reject(V)}try{await((O=(A=this.options).onSettled)==null?void 0:O.call(A,void 0,L,t,this.state.context,r))}catch(V){Promise.reject(V)}throw Bt(this,Gi,wo).call(this,{type:"error",error:L}),L}finally{re(this,gr).runNext(this)}}},Dd=new WeakMap,Ki=new WeakMap,gr=new WeakMap,js=new WeakMap,Gi=new WeakSet,wo=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),er.batch(()=>{re(this,Ki).forEach(r=>{r.onMutationUpdate(t)}),re(this,gr).notify({mutation:this,type:"updated",action:t})})},Jk);function fM(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var _a,Li,Id,eM,uL=(eM=class extends Tc{constructor(t={}){super();pt(this,_a);pt(this,Li);pt(this,Id);this.config=t,Qe(this,_a,new Set),Qe(this,Li,new Map),Qe(this,Id,0)}build(t,n,r){const a=new cL({client:t,mutationCache:this,mutationId:++mh(this,Id)._,options:t.defaultMutationOptions(n),state:r});return this.add(a),a}add(t){re(this,_a).add(t);const n=gh(t);if(typeof n=="string"){const r=re(this,Li).get(n);r?r.push(t):re(this,Li).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(re(this,_a).delete(t)){const n=gh(t);if(typeof n=="string"){const r=re(this,Li).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,Li).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=gh(t);if(typeof n=="string"){const r=re(this,Li).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=gh(t);if(typeof n=="string"){const a=(r=re(this,Li).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(){er.batch(()=>{re(this,_a).forEach(t=>{this.notify({type:"removed",mutation:t})}),re(this,_a).clear(),re(this,Li).clear()})}getAll(){return Array.from(re(this,_a))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>sC(n,r))}findAll(t={}){return this.getAll().filter(n=>sC(t,n))}notify(t){er.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return er.batch(()=>Promise.all(t.map(n=>n.continue().catch(Tr))))}},_a=new WeakMap,Li=new WeakMap,Id=new WeakMap,eM);function gh(e){var t;return(t=e.options.scope)==null?void 0:t.id}var za,No,zr,Fa,Ha,$h,lv,tM,dL=(tM=class extends Tc{constructor(n,r){super();pt(this,Ha);pt(this,za);pt(this,No);pt(this,zr);pt(this,Fa);Qe(this,za,n),this.setOptions(r),this.bindMethods(),Bt(this,Ha,$h).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,za).defaultMutationOptions(n),lp(this.options,r)||re(this,za).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,Ha,$h).call(this),Bt(this,Ha,lv).call(this,n)}getCurrentResult(){return re(this,No)}reset(){var n;(n=re(this,zr))==null||n.removeObserver(this),Qe(this,zr,void 0),Bt(this,Ha,$h).call(this),Bt(this,Ha,lv).call(this)}mutate(n,r){var a;return Qe(this,Fa,r),(a=re(this,zr))==null||a.removeObserver(this),Qe(this,zr,re(this,za).getMutationCache().build(re(this,za),this.options)),re(this,zr).addObserver(this),re(this,zr).execute(n)}},za=new WeakMap,No=new WeakMap,zr=new WeakMap,Fa=new WeakMap,Ha=new WeakSet,$h=function(){var r;const n=((r=re(this,zr))==null?void 0:r.state)??fM();Qe(this,No,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},lv=function(n){er.batch(()=>{var r,a,o,l,c,f,d,m;if(re(this,Fa)&&this.hasListeners()){const h=re(this,No).variables,y=re(this,No).context,g={client:re(this,za),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(a=(r=re(this,Fa)).onSuccess)==null||a.call(r,n.data,h,y,g)}catch(w){Promise.reject(w)}try{(l=(o=re(this,Fa)).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,Fa)).onError)==null||f.call(c,n.error,h,y,g)}catch(w){Promise.reject(w)}try{(m=(d=re(this,Fa)).onSettled)==null||m.call(d,void 0,n.error,h,y,g)}catch(w){Promise.reject(w)}}}this.listeners.forEach(h=>{h(re(this,No))})})},tM),Xi,nM,fL=(nM=class extends Tc{constructor(t={}){super();pt(this,Xi);this.config=t,Qe(this,Xi,new Map)}build(t,n,r){const a=n.queryKey,o=n.queryHash??xx(a,n);let l=this.get(o);return l||(l=new iL({client:t,queryKey:a,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(a)}),this.add(l)),l}add(t){re(this,Xi).has(t.queryHash)||(re(this,Xi).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=re(this,Xi).get(t.queryHash);n&&(t.destroy(),n===t&&re(this,Xi).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){er.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return re(this,Xi).get(t)}getAll(){return[...re(this,Xi).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>oC(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>oC(t,r)):n}notify(t){er.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){er.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){er.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Xi=new WeakMap,nM),_n,Do,Io,uc,dc,Po,fc,hc,rM,hL=(rM=class{constructor(e={}){pt(this,_n);pt(this,Do);pt(this,Io);pt(this,uc);pt(this,dc);pt(this,Po);pt(this,fc);pt(this,hc);Qe(this,_n,e.queryCache||new fL),Qe(this,Do,e.mutationCache||new uL),Qe(this,Io,e.defaultOptions||{}),Qe(this,uc,new Map),Qe(this,dc,new Map),Qe(this,Po,0)}mount(){mh(this,Po)._++,re(this,Po)===1&&(Qe(this,fc,Ex.subscribe(async e=>{e&&(await this.resumePausedMutations(),re(this,_n).onFocus())})),Qe(this,hc,cp.subscribe(async e=>{e&&(await this.resumePausedMutations(),re(this,_n).onOnline())})))}unmount(){var e,t;mh(this,Po)._--,re(this,Po)===0&&((e=re(this,fc))==null||e.call(this),Qe(this,fc,void 0),(t=re(this,hc))==null||t.call(this),Qe(this,hc,void 0))}isFetching(e){return re(this,_n).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return re(this,Do).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=re(this,_n).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=re(this,_n).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(zo(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return re(this,_n).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,_n).get(r.queryHash),o=a==null?void 0:a.state.data,l=WP(t,o);if(l!==void 0)return re(this,_n).build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return er.batch(()=>re(this,_n).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,_n).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=re(this,_n);er.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=re(this,_n);return er.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=er.batch(()=>re(this,_n).findAll(e).map(a=>a.cancel(n)));return Promise.all(r).then(Tr).catch(Tr)}invalidateQueries(e,t={}){return er.batch(()=>(re(this,_n).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=er.batch(()=>re(this,_n).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,_n).build(this,t);return n.isStaleByTime(zo(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=pC(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Tr).catch(Tr)}ensureInfiniteQueryData(e){return e.behavior=pC(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return cp.isOnline()?re(this,Do).resumePausedMutations():Promise.resolve()}getQueryCache(){return re(this,_n)}getMutationCache(){return re(this,Do)}getDefaultOptions(){return re(this,Io)}setDefaultOptions(e){Qe(this,Io,e)}setQueryDefaults(e,t){re(this,uc).set(Hs(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...re(this,uc).values()],n={};return t.forEach(r=>{hd(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){re(this,dc).set(Hs(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...re(this,dc).values()],n={};return t.forEach(r=>{hd(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...re(this,Io).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=xx(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===wx&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...re(this,Io).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){re(this,_n).clear(),re(this,Do).clear()}},_n=new WeakMap,Do=new WeakMap,Io=new WeakMap,uc=new WeakMap,dc=new WeakMap,Po=new WeakMap,fc=new WeakMap,hc=new WeakMap,rM),jy={exports:{}},It={};/**
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 gC;function pL(){if(gC)return It;gC=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 S(U,G,I){this.props=U,this.context=G,this.refs=T,this.updater=I||w}S.prototype.isReactComponent={},S.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")},S.prototype.forceUpdate=function(U){this.updater.enqueueForceUpdate(this,U,"forceUpdate")};function R(){}R.prototype=S.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,S.prototype),M.isPureReactComponent=!0;var D=Array.isArray;function A(){}var O={H:null,A:null,T:null,S:null},L=Object.prototype.hasOwnProperty;function V(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 V(U.type,G,U.props)}function W(U){return typeof U=="object"&&U!==null&&U.$$typeof===e}function j(U){var G={"=":"=0",":":"=2"};return"$"+U.replace(/[=:]/g,function(I){return G[I]})}var q=/\/+/g;function $(U,G){return typeof U=="object"&&U!==null&&U.key!=null?j(""+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(A,A):(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 _(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,_(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(q,"$&/")+"/"),_(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(q,"$&/")+"/")+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+=_(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+=_(Q,G,I,ae,le);else if(ae==="object"){if(typeof U.then=="function")return _(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 _(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 It.Activity=h,It.Children=P,It.Component=S,It.Fragment=n,It.Profiler=a,It.PureComponent=k,It.StrictMode=r,It.Suspense=f,It.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=O,It.__COMPILER_RUNTIME={__proto__:null,c:function(U){return O.H.useMemoCache(U)}},It.cache=function(U){return function(){return U.apply(null,arguments)}},It.cacheSignal=function(){return null},It.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 V(U.type,le,Q)},It.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},It.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 V(U,ae,le)},It.createRef=function(){return{current:null}},It.forwardRef=function(U){return{$$typeof:c,render:U}},It.isValidElement=W,It.lazy=function(U){return{$$typeof:m,_payload:{_status:-1,_result:U},_init:H}},It.memo=function(U,G){return{$$typeof:d,type:U,compare:G===void 0?null:G}},It.startTransition=function(U){var G=O.T,I={};O.T=I;try{var Q=U(),le=O.S;le!==null&&le(I,Q),typeof Q=="object"&&Q!==null&&typeof Q.then=="function"&&Q.then(A,K)}catch(ae){K(ae)}finally{G!==null&&I.types!==null&&(G.types=I.types),O.T=G}},It.unstable_useCacheRefresh=function(){return O.H.useCacheRefresh()},It.use=function(U){return O.H.use(U)},It.useActionState=function(U,G,I){return O.H.useActionState(U,G,I)},It.useCallback=function(U,G){return O.H.useCallback(U,G)},It.useContext=function(U){return O.H.useContext(U)},It.useDebugValue=function(){},It.useDeferredValue=function(U,G){return O.H.useDeferredValue(U,G)},It.useEffect=function(U,G){return O.H.useEffect(U,G)},It.useEffectEvent=function(U){return O.H.useEffectEvent(U)},It.useId=function(){return O.H.useId()},It.useImperativeHandle=function(U,G,I){return O.H.useImperativeHandle(U,G,I)},It.useInsertionEffect=function(U,G){return O.H.useInsertionEffect(U,G)},It.useLayoutEffect=function(U,G){return O.H.useLayoutEffect(U,G)},It.useMemo=function(U,G){return O.H.useMemo(U,G)},It.useOptimistic=function(U,G){return O.H.useOptimistic(U,G)},It.useReducer=function(U,G,I){return O.H.useReducer(U,G,I)},It.useRef=function(U){return O.H.useRef(U)},It.useState=function(U){return O.H.useState(U)},It.useSyncExternalStore=function(U,G,I){return O.H.useSyncExternalStore(U,G,I)},It.useTransition=function(){return O.H.useTransition()},It.version="19.2.4",It}var yC;function Pd(){return yC||(yC=1,jy.exports=pL()),jy.exports}var v=Pd();const Fe=Bp(v),Tx=FP({__proto__:null,default:Fe},[v]);var hM=v.createContext(void 0),Ld=e=>{const t=v.useContext(hM);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},mL=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),E.jsx(hM.Provider,{value:e,children:t})),pM=v.createContext(!1),gL=()=>v.useContext(pM);pM.Provider;function yL(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var bL=v.createContext(yL()),vL=()=>v.useContext(bL),xL=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?Sx(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},wL=e=>{v.useEffect(()=>{e.clearReset()},[e])},SL=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(a&&e.data===void 0||Sx(n,[e.error,r])),EL=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))}},CL=(e,t)=>e.isLoading&&e.isFetching&&!t,TL=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,bC=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function RL(e,t,n){var y,g,w,C;const r=gL(),a=vL(),o=Ld(),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",EL(l),xL(l,a,c),wL(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 S=h?d.subscribe(er.batchCalls(T)):Tr;return d.updateResult(),S},[d,h]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),v.useEffect(()=>{d.setOptions(l)},[l,d]),TL(l,m))throw bC(l,d,a);if(SL({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&&CL(m,r)){const T=f?bC(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 Vo(e,t){return RL(e,aL)}function pd(e,t){const n=Ld(),[r]=v.useState(()=>new dL(n,e));v.useEffect(()=>{r.setOptions(e)},[r,e]);const a=v.useSyncExternalStore(v.useCallback(l=>r.subscribe(er.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=v.useCallback((l,c)=>{r.mutate(l,c).catch(Tr)},[r]);if(a.error&&Sx(r.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:o,mutateAsync:a.mutate}}var _y={exports:{}},Au={},zy={exports:{}},Fy={};/**
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 vC;function kL(){return vC||(vC=1,(function(e){function t(_,z){var H=_.length;_.push(z);e:for(;0<H;){var K=H-1>>>1,P=_[K];if(0<a(P,z))_[K]=z,_[H]=P,H=K;else break e}}function n(_){return _.length===0?null:_[0]}function r(_){if(_.length===0)return null;var z=_[0],H=_.pop();if(H!==z){_[0]=H;e:for(var K=0,P=_.length,U=P>>>1;K<U;){var G=2*(K+1)-1,I=_[G],Q=G+1,le=_[Q];if(0>a(I,H))Q<P&&0>a(le,I)?(_[K]=le,_[Q]=H,K=Q):(_[K]=I,_[G]=H,K=G);else if(Q<P&&0>a(le,H))_[K]=le,_[Q]=H,K=Q;else break e}}return z}function a(_,z){var H=_.sortIndex-z.sortIndex;return H!==0?H:_.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,S=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function M(_){for(var z=n(d);z!==null;){if(z.callback===null)r(d);else if(z.startTime<=_)r(d),z.sortIndex=z.expirationTime,t(f,z);else break;z=n(d)}}function D(_){if(C=!1,M(_),!w)if(n(f)!==null)w=!0,A||(A=!0,j());else{var z=n(d);z!==null&&B(D,z.startTime-_)}}var A=!1,O=-1,L=5,V=-1;function F(){return T?!0:!(e.unstable_now()-V<L)}function W(){if(T=!1,A){var _=e.unstable_now();V=_;var z=!0;try{e:{w=!1,C&&(C=!1,R(O),O=-1),g=!0;var H=y;try{t:{for(M(_),h=n(f);h!==null&&!(h.expirationTime>_&&F());){var K=h.callback;if(typeof K=="function"){h.callback=null,y=h.priorityLevel;var P=K(h.expirationTime<=_);if(_=e.unstable_now(),typeof P=="function"){h.callback=P,M(_),z=!0;break t}h===n(f)&&r(f),M(_)}else r(f);h=n(f)}if(h!==null)z=!0;else{var U=n(d);U!==null&&B(D,U.startTime-_),z=!1}}break e}finally{h=null,y=H,g=!1}z=void 0}}finally{z?j():A=!1}}}var j;if(typeof k=="function")j=function(){k(W)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,$=q.port2;q.port1.onmessage=W,j=function(){$.postMessage(null)}}else j=function(){S(W,0)};function B(_,z){O=S(function(){_(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(_){_.callback=null},e.unstable_forceFrameRate=function(_){0>_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<_?Math.floor(1e3/_):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(_){switch(y){case 1:case 2:case 3:var z=3;break;default:z=y}var H=y;y=z;try{return _()}finally{y=H}},e.unstable_requestPaint=function(){T=!0},e.unstable_runWithPriority=function(_,z){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var H=y;y=_;try{return z()}finally{y=H}},e.unstable_scheduleCallback=function(_,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,_){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,_={id:m++,callback:z,priorityLevel:_,startTime:H,expirationTime:P,sortIndex:-1},H>K?(_.sortIndex=H,t(d,_),n(f)===null&&_===n(d)&&(C?(R(O),O=-1):C=!0,B(D,H-K))):(_.sortIndex=P,t(f,_),w||g||(w=!0,A||(A=!0,j()))),_},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(_){var z=y;return function(){var H=y;y=z;try{return _.apply(this,arguments)}finally{y=H}}}})(Fy)),Fy}var xC;function ML(){return xC||(xC=1,zy.exports=kL()),zy.exports}var By={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 wC;function AL(){if(wC)return mr;wC=1;var e=Pd();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 SC;function mM(){if(SC)return By.exports;SC=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(),By.exports=AL(),By.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 EC;function OL(){if(EC)return Au;EC=1;var e=ML(),t=Pd(),n=mM();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"),S=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),k=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),V=Symbol.for("react.activity"),F=Symbol.for("react.memo_cache_sentinel"),W=Symbol.iterator;function j(i){return i===null||typeof i!="object"?null:(i=W&&i[W]||i["@@iterator"],typeof i=="function"?i:null)}var q=Symbol.for("react.client.reference");function $(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===q?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case C:return"Fragment";case S:return"Profiler";case T:return"StrictMode";case D:return"Suspense";case A:return"SuspenseList";case V: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 O: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,_=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)?TE(i):0;break;default:if(i=s.tagName,s=s.namespaceURI)s=TE(s),i=RE(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=RE(s,i.type);s!==u&&(I(le,i),I(Q,u))}function Pe(i){le.current===i&&(G(Q),G(le)),Z.current===i&&(G(Z),Cu._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 Le=!1;function Ae(i,s){if(!i||Le)return"";Le=!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{Le=!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 Ae(i.type,!1);case 11:return Ae(i.type.render,!1);case 1:return Ae(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,qe=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,Oe=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:gt,Ct=Math.log,zt=Math.LN2;function gt(i){return i>>>=0,i===0?32:31-(Ct(i)/zt|0)|0}var At=256,it=262144,ft=4194304;function yt(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=yt(p):(N&=Y,N!==0?b=yt(N):u||(u=Y&~i,u!==0&&(b=yt(u))))):(Y=p&~x,Y!==0?b=yt(Y):N!==0?b=yt(N):u||(u=p&~i,u!==0&&(b=yt(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 Rt(i,s){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&s)===0}function jt(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 Tt(){var i=ft;return ft<<=1,(ft&62914560)===0&&(ft=4194304),i}function un(i){for(var s=[],u=0;31>u;u++)s.push(i);return s}function Ht(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&&kt(i,p,0),x!==0&&b===0&&i.tag!==0&&(i.suspendedLanes|=x&~(N&~s))}function kt(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 _e(){var i=z.p;return i!==0?i:(i=window.event,i===void 0?32:GE(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,at="__reactContainer$"+nt,St="__reactEvents$"+nt,ht="__reactListeners$"+nt,Pt="__reactHandles$"+nt,$t="__reactResources$"+nt,On="__reactMarker$"+nt;function In(i){delete i[We],delete i[Xe],delete i[St],delete i[ht],delete i[Pt]}function Pn(i){var s=i[We];if(s)return s;for(var u=i.parentNode;u;){if(s=u[at]||u[We]){if(u=s.alternate,s.child!==null||u!==null&&u.child!==null)for(i=IE(i);i!==null;){if(u=i[We])return u;i=IE(i)}return s}i=u,u=i.parentNode}return null}function Zt(i){if(i=i[We]||i[at]){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 Ar(i){var s=i[$t];return s||(s=i[$t]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function Mn(i){i[On]=!0}var Ri=new Set,qr={};function ki(i,s){ai(i,s),ai(i+"Capture",s)}function ai(i,s){for(qr[i]=s,i=0;i<s.length;i++)Ri.add(s[i])}var fa=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:fa.test(i)?ts[i]=!0:(es[i]=!0,!1)}function Hn(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 Mi(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 rf(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 Bc(i){if(!i._valueTracker){var s=ns(i)?"checked":"value";i._valueTracker=rf(i,s,""+i[s])}}function b0(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 af(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 N2=/[\n"\\]/g;function oi(i){return i.replace(N2,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Mm(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?Am(i,N,en(s)):u!=null?Am(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 v0(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)){Bc(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),Bc(i)}function Am(i,s,u){s==="number"&&af(i.ownerDocument)===i||i.defaultValue===""+u||(i.defaultValue=""+u)}function tl(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 x0(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 w0(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),Bc(i)}function nl(i,s){if(s){var u=i.firstChild;if(u&&u===i.lastChild&&u.nodeType===3){u.nodeValue=s;return}}i.textContent=s}var D2=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 S0(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||D2.has(s)?s==="float"?i.cssFloat=u:i[s]=(""+u).trim():i[s]=u+"px"}function E0(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&&S0(i,b,p)}else for(var x in s)s.hasOwnProperty(x)&&S0(i,x,s[x])}function Om(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 I2=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"]]),P2=/^[\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 of(i){return P2.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function ha(){}var Nm=null;function Dm(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var rl=null,il=null;function C0(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(Mm(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="'+oi(""+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));Mm(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&&b0(p)}break e;case"textarea":x0(i,u.value,u.defaultValue);break e;case"select":s=u.value,s!=null&&tl(i,!!u.multiple,s,!1)}}}var Im=!1;function T0(i,s,u){if(Im)return i(s,u);Im=!0;try{var p=i(s);return p}finally{if(Im=!1,(rl!==null||il!==null)&&(Wf(),rl&&(s=rl,i=il,il=rl=null,C0(s),i)))for(s=0;s<i.length;s++)C0(i[s])}}function Hc(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 pa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Pm=!1;if(pa)try{var Uc={};Object.defineProperty(Uc,"passive",{get:function(){Pm=!0}}),window.addEventListener("test",Uc,Uc),window.removeEventListener("test",Uc,Uc)}catch{Pm=!1}var Ga=null,Lm=null,sf=null;function R0(){if(sf)return sf;var i,s=Lm,u=s.length,p,b="value"in Ga?Ga.value:Ga.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 sf=b.slice(i,1<p?1-p:void 0)}function lf(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 cf(){return!0}function k0(){return!1}function Or(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)?cf:k0,this.isPropagationStopped=k0,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=cf)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=cf)},persist:function(){},isPersistent:cf}),s}var rs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},uf=Or(rs),Vc=h({},rs,{view:0,detail:0}),L2=Or(Vc),jm,_m,qc,df=h({},Vc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Fm,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!==qc&&(qc&&i.type==="mousemove"?(jm=i.screenX-qc.screenX,_m=i.screenY-qc.screenY):_m=jm=0,qc=i),jm)},movementY:function(i){return"movementY"in i?i.movementY:_m}}),M0=Or(df),j2=h({},df,{dataTransfer:0}),_2=Or(j2),z2=h({},Vc,{relatedTarget:0}),zm=Or(z2),F2=h({},rs,{animationName:0,elapsedTime:0,pseudoElement:0}),B2=Or(F2),H2=h({},rs,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),U2=Or(H2),V2=h({},rs,{data:0}),A0=Or(V2),q2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},$2={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"},Y2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function W2(i){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(i):(i=Y2[i])?!!s[i]:!1}function Fm(){return W2}var K2=h({},Vc,{key:function(i){if(i.key){var s=q2[i.key]||i.key;if(s!=="Unidentified")return s}return i.type==="keypress"?(i=lf(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?$2[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Fm,charCode:function(i){return i.type==="keypress"?lf(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?lf(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),G2=Or(K2),X2=h({},df,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),O0=Or(X2),Q2=h({},Vc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Fm}),Z2=Or(Q2),J2=h({},rs,{propertyName:0,elapsedTime:0,pseudoElement:0}),eI=Or(J2),tI=h({},df,{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}),nI=Or(tI),rI=h({},rs,{newState:0,oldState:0}),iI=Or(rI),aI=[9,13,27,32],Bm=pa&&"CompositionEvent"in window,$c=null;pa&&"documentMode"in document&&($c=document.documentMode);var oI=pa&&"TextEvent"in window&&!$c,N0=pa&&(!Bm||$c&&8<$c&&11>=$c),D0=" ",I0=!1;function P0(i,s){switch(i){case"keyup":return aI.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function L0(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var al=!1;function sI(i,s){switch(i){case"compositionend":return L0(s);case"keypress":return s.which!==32?null:(I0=!0,D0);case"textInput":return i=s.data,i===D0&&I0?null:i;default:return null}}function lI(i,s){if(al)return i==="compositionend"||!Bm&&P0(i,s)?(i=R0(),sf=Lm=Ga=null,al=!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 N0&&s.locale!=="ko"?null:s.data;default:return null}}var cI={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 j0(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s==="input"?!!cI[i.type]:s==="textarea"}function _0(i,s,u,p){rl?il?il.push(p):il=[p]:rl=p,s=eh(s,"onChange"),0<s.length&&(u=new uf("onChange","change",null,u,p),i.push({event:u,listeners:s}))}var Yc=null,Wc=null;function uI(i){vE(i,0)}function ff(i){var s=rr(i);if(b0(s))return i}function z0(i,s){if(i==="change")return s}var F0=!1;if(pa){var Hm;if(pa){var Um="oninput"in document;if(!Um){var B0=document.createElement("div");B0.setAttribute("oninput","return;"),Um=typeof B0.oninput=="function"}Hm=Um}else Hm=!1;F0=Hm&&(!document.documentMode||9<document.documentMode)}function H0(){Yc&&(Yc.detachEvent("onpropertychange",U0),Wc=Yc=null)}function U0(i){if(i.propertyName==="value"&&ff(Wc)){var s=[];_0(s,Wc,i,Dm(i)),T0(uI,s)}}function dI(i,s,u){i==="focusin"?(H0(),Yc=s,Wc=u,Yc.attachEvent("onpropertychange",U0)):i==="focusout"&&H0()}function fI(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return ff(Wc)}function hI(i,s){if(i==="click")return ff(s)}function pI(i,s){if(i==="input"||i==="change")return ff(s)}function mI(i,s){return i===s&&(i!==0||1/i===1/s)||i!==i&&s!==s}var $r=typeof Object.is=="function"?Object.is:mI;function Kc(i,s){if($r(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)||!$r(i[b],s[b]))return!1}return!0}function V0(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function q0(i,s){var u=V0(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=V0(u)}}function $0(i,s){return i&&s?i===s?!0:i&&i.nodeType===3?!1:s&&s.nodeType===3?$0(i,s.parentNode):"contains"in i?i.contains(s):i.compareDocumentPosition?!!(i.compareDocumentPosition(s)&16):!1:!1}function Y0(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var s=af(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=af(i.document)}return s}function Vm(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 gI=pa&&"documentMode"in document&&11>=document.documentMode,ol=null,qm=null,Gc=null,$m=!1;function W0(i,s,u){var p=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;$m||ol==null||ol!==af(p)||(p=ol,"selectionStart"in p&&Vm(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}),Gc&&Kc(Gc,p)||(Gc=p,p=eh(qm,"onSelect"),0<p.length&&(s=new uf("onSelect","select",null,s,u),i.push({event:s,listeners:p}),s.target=ol)))}function is(i,s){var u={};return u[i.toLowerCase()]=s.toLowerCase(),u["Webkit"+i]="webkit"+s,u["Moz"+i]="moz"+s,u}var sl={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")},Ym={},K0={};pa&&(K0=document.createElement("div").style,"AnimationEvent"in window||(delete sl.animationend.animation,delete sl.animationiteration.animation,delete sl.animationstart.animation),"TransitionEvent"in window||delete sl.transitionend.transition);function as(i){if(Ym[i])return Ym[i];if(!sl[i])return i;var s=sl[i],u;for(u in s)if(s.hasOwnProperty(u)&&u in K0)return Ym[i]=s[u];return i}var G0=as("animationend"),X0=as("animationiteration"),Q0=as("animationstart"),yI=as("transitionrun"),bI=as("transitionstart"),vI=as("transitioncancel"),Z0=as("transitionend"),J0=new Map,Wm="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(" ");Wm.push("scrollEnd");function Ai(i,s){J0.set(i,s),ki(s,[i])}var hf=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)},si=[],ll=0,Km=0;function pf(){for(var i=ll,s=Km=ll=0;s<i;){var u=si[s];si[s++]=null;var p=si[s];si[s++]=null;var b=si[s];si[s++]=null;var x=si[s];if(si[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&&eS(u,b,x)}}function mf(i,s,u,p){si[ll++]=i,si[ll++]=s,si[ll++]=u,si[ll++]=p,Km|=p,i.lanes|=p,i=i.alternate,i!==null&&(i.lanes|=p)}function Gm(i,s,u,p){return mf(i,s,u,p),gf(i)}function os(i,s){return mf(i,null,null,s),gf(i)}function eS(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 gf(i){if(50<yu)throw yu=0,iy=null,Error(r(185));for(var s=i.return;s!==null;)i=s,s=i.return;return i.tag===3?i.stateNode:null}var cl={};function xI(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 Yr(i,s,u,p){return new xI(i,s,u,p)}function Xm(i){return i=i.prototype,!(!i||!i.isReactComponent)}function ma(i,s){var u=i.alternate;return u===null?(u=Yr(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 tS(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 yf(i,s,u,p,b,x){var N=0;if(p=i,typeof i=="function")Xm(i)&&(N=1);else if(typeof i=="string")N=TP(i,u,Q.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case V:return i=Yr(31,u,s,b),i.elementType=V,i.lanes=x,i;case C:return ss(u.children,b,x,s);case T:N=8,b|=24;break;case S:return i=Yr(12,u,s,b|2),i.elementType=S,i.lanes=x,i;case D:return i=Yr(13,u,s,b),i.elementType=D,i.lanes=x,i;case A:return i=Yr(19,u,s,b),i.elementType=A,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 O: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=Yr(N,u,s,b),s.elementType=i,s.type=p,s.lanes=x,s}function ss(i,s,u,p){return i=Yr(7,i,p,s),i.lanes=u,i}function Qm(i,s,u){return i=Yr(6,i,null,s),i.lanes=u,i}function nS(i){var s=Yr(18,null,null,0);return s.stateNode=i,s}function Zm(i,s,u){return s=Yr(4,i.children!==null?i.children:[],i.key,s),s.lanes=u,s.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},s}var rS=new WeakMap;function li(i,s){if(typeof i=="object"&&i!==null){var u=rS.get(i);return u!==void 0?u:(s={value:i,source:s,stack:Re(s)},rS.set(i,s),s)}return{value:i,source:s,stack:Re(s)}}var ul=[],dl=0,bf=null,Xc=0,ci=[],ui=0,Xa=null,Ui=1,Vi="";function ga(i,s){ul[dl++]=Xc,ul[dl++]=bf,bf=i,Xc=s}function iS(i,s,u){ci[ui++]=Ui,ci[ui++]=Vi,ci[ui++]=Xa,Xa=i;var p=Ui;i=Vi;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,Ui=1<<32-tt(s)+b|u<<b|p,Vi=x+i}else Ui=1<<x|u<<b|p,Vi=i}function Jm(i){i.return!==null&&(ga(i,1),iS(i,1,0))}function eg(i){for(;i===bf;)bf=ul[--dl],ul[dl]=null,Xc=ul[--dl],ul[dl]=null;for(;i===Xa;)Xa=ci[--ui],ci[ui]=null,Vi=ci[--ui],ci[ui]=null,Ui=ci[--ui],ci[ui]=null}function aS(i,s){ci[ui++]=Ui,ci[ui++]=Vi,ci[ui++]=Xa,Ui=s.id,Vi=s.overflow,Xa=i}var cr=null,Tn=null,tn=!1,Qa=null,di=!1,tg=Error(r(519));function Za(i){var s=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Qc(li(s,i)),tg}function oS(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<vu.length;u++)Wt(vu[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),v0(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),w0(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||EE(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=ha),s=!0):s=!1,s||Za(i,!0)}function sS(i){for(cr=i.return;cr;)switch(cr.tag){case 5:case 31:case 13:di=!1;return;case 27:case 3:di=!0;return;default:cr=cr.return}}function fl(i){if(i!==cr)return!1;if(!tn)return sS(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")||vy(i.type,i.memoizedProps)),u=!u),u&&Tn&&Za(i),sS(i),s===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));Tn=DE(i)}else if(s===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));Tn=DE(i)}else s===27?(s=Tn,ho(i.type)?(i=Cy,Cy=null,Tn=i):Tn=s):Tn=cr?hi(i.stateNode.nextSibling):null;return!0}function ls(){Tn=cr=null,tn=!1}function ng(){var i=Qa;return i!==null&&(Pr===null?Pr=i:Pr.push.apply(Pr,i),Qa=null),i}function Qc(i){Qa===null?Qa=[i]:Qa.push(i)}var rg=U(null),cs=null,ya=null;function Ja(i,s,u){I(rg,s._currentValue),s._currentValue=u}function ba(i){i._currentValue=rg.current,G(rg)}function ig(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 ag(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),ig(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),ig(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 hl(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;$r(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(Cu):i=[Cu])}b=b.return}i!==null&&ag(s,i,u,p),s.flags|=262144}function vf(i){for(i=i.firstContext;i!==null;){if(!$r(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function us(i){cs=i,ya=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function ur(i){return lS(cs,i)}function xf(i,s){return cs===null&&us(i),lS(i,s)}function lS(i,s){var u=s._currentValue;if(s={context:s,memoizedValue:u,next:null},ya===null){if(i===null)throw Error(r(308));ya=s,i.dependencies={lanes:0,firstContext:s},i.flags|=524288}else ya=ya.next=s;return u}var wI=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()})}},SI=e.unstable_scheduleCallback,EI=e.unstable_NormalPriority,$n={$$typeof:k,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function og(){return{controller:new wI,data:new Map,refCount:0}}function Zc(i){i.refCount--,i.refCount===0&&SI(EI,function(){i.controller.abort()})}var Jc=null,sg=0,pl=0,ml=null;function CI(i,s){if(Jc===null){var u=Jc=[];sg=0,pl=uy(),ml={status:"pending",value:void 0,then:function(p){u.push(p)}}}return sg++,s.then(cS,cS),s}function cS(){if(--sg===0&&Jc!==null){ml!==null&&(ml.status="fulfilled");var i=Jc;Jc=null,pl=0,ml=null;for(var s=0;s<i.length;s++)(0,i[s])()}}function TI(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 uS=_.S;_.S=function(i,s){W1=De(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&CI(i,s),uS!==null&&uS(i,s)};var ds=U(null);function lg(){var i=ds.current;return i!==null?i:vn.pooledCache}function wf(i,s){s===null?I(ds,ds.current):I(ds,s.pool)}function dS(){var i=lg();return i===null?null:{parent:$n._currentValue,pool:i}}var gl=Error(r(460)),cg=Error(r(474)),Sf=Error(r(542)),Ef={then:function(){}};function fS(i){return i=i.status,i==="fulfilled"||i==="rejected"}function hS(i,s,u){switch(u=i[u],u===void 0?i.push(s):u!==s&&(s.then(ha,ha),s=u),s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,mS(i),i;default:if(typeof s.status=="string")s.then(ha,ha);else{if(i=vn,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,mS(i),i}throw hs=s,gl}}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,gl):u}}var hs=null;function pS(){if(hs===null)throw Error(r(459));var i=hs;return hs=null,i}function mS(i){if(i===gl||i===Sf)throw Error(r(483))}var yl=null,eu=0;function Cf(i){var s=eu;return eu+=1,yl===null&&(yl=[]),hS(yl,i,s)}function tu(i,s){s=s.props.ref,i.ref=s!==void 0?s:null}function Tf(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 gS(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=ma(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=Qm(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),tu(oe,me),oe.return=ce,oe):(oe=yf(me.type,me.key,me.props,null,ce.mode,Ne),tu(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=Zm(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=Qm(""+oe,ce.mode,me),oe.return=ce,oe;if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case g:return me=yf(oe.type,oe.key,oe.props,null,ce.mode,me),tu(me,oe),me.return=ce,me;case w:return oe=Zm(oe,ce.mode,me),oe.return=ce,oe;case L:return oe=fs(oe),Ie(ce,oe,me)}if(B(oe)||j(oe))return oe=ss(oe,ce.mode,me,null),oe.return=ce,oe;if(typeof oe.then=="function")return Ie(ce,Cf(oe),me);if(oe.$$typeof===k)return Ie(ce,xf(ce,oe),me);Tf(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)||j(me))return mt!==null?null:Me(ce,oe,me,Ne,null);if(typeof me.then=="function")return be(ce,oe,Cf(me),Ne);if(me.$$typeof===k)return be(ce,oe,xf(ce,me),Ne);Tf(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)||j(Ne))return ce=ce.get(me)||null,Me(oe,ce,Ne,mt,null);if(typeof Ne.then=="function")return we(ce,oe,me,Cf(Ne),mt);if(Ne.$$typeof===k)return we(ce,oe,me,xf(oe,Ne),mt);Tf(oe,Ne)}return null}function ot(ce,oe,me,Ne){for(var mt=null,on=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 sn=be(ce,dt,me[Ft],Ne);if(sn===null){dt===null&&(dt=Xt);break}i&&dt&&sn.alternate===null&&s(ce,dt),oe=x(sn,oe,Ft),on===null?mt=sn:on.sibling=sn,on=sn,dt=Xt}if(Ft===me.length)return u(ce,dt),tn&&ga(ce,Ft),mt;if(dt===null){for(;Ft<me.length;Ft++)dt=Ie(ce,me[Ft],Ne),dt!==null&&(oe=x(dt,oe,Ft),on===null?mt=dt:on.sibling=dt,on=dt);return tn&&ga(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),on===null?mt=Xt:on.sibling=Xt,on=Xt);return i&&dt.forEach(function(bo){return s(ce,bo)}),tn&&ga(ce,Ft),mt}function xt(ce,oe,me,Ne){if(me==null)throw Error(r(151));for(var mt=null,on=null,dt=oe,Ft=oe=0,Xt=null,sn=me.next();dt!==null&&!sn.done;Ft++,sn=me.next()){dt.index>Ft?(Xt=dt,dt=null):Xt=dt.sibling;var bo=be(ce,dt,sn.value,Ne);if(bo===null){dt===null&&(dt=Xt);break}i&&dt&&bo.alternate===null&&s(ce,dt),oe=x(bo,oe,Ft),on===null?mt=bo:on.sibling=bo,on=bo,dt=Xt}if(sn.done)return u(ce,dt),tn&&ga(ce,Ft),mt;if(dt===null){for(;!sn.done;Ft++,sn=me.next())sn=Ie(ce,sn.value,Ne),sn!==null&&(oe=x(sn,oe,Ft),on===null?mt=sn:on.sibling=sn,on=sn);return tn&&ga(ce,Ft),mt}for(dt=p(dt);!sn.done;Ft++,sn=me.next())sn=we(dt,ce,Ft,sn.value,Ne),sn!==null&&(i&&sn.alternate!==null&&dt.delete(sn.key===null?Ft:sn.key),oe=x(sn,oe,Ft),on===null?mt=sn:on.sibling=sn,on=sn);return i&&dt.forEach(function(jP){return s(ce,jP)}),tn&&ga(ce,Ft),mt}function bn(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),tu(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=yf(me.type,me.key,me.props,null,ce.mode,Ne),tu(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=Zm(me,ce.mode,Ne),Ne.return=ce,ce=Ne}return N(ce);case L:return me=fs(me),bn(ce,oe,me,Ne)}if(B(me))return ot(ce,oe,me,Ne);if(j(me)){if(mt=j(me),typeof mt!="function")throw Error(r(150));return me=mt.call(me),xt(ce,oe,me,Ne)}if(typeof me.then=="function")return bn(ce,oe,Cf(me),Ne);if(me.$$typeof===k)return bn(ce,oe,xf(ce,me),Ne);Tf(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=Qm(me,ce.mode,Ne),Ne.return=ce,ce=Ne),N(ce)):u(ce,oe)}return function(ce,oe,me,Ne){try{eu=0;var mt=bn(ce,oe,me,Ne);return yl=null,mt}catch(dt){if(dt===gl||dt===Sf)throw dt;var on=Yr(29,dt,null,ce.mode);return on.lanes=Ne,on.return=ce,on}finally{}}}var ps=gS(!0),yS=gS(!1),eo=!1;function ug(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function dg(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 to(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function no(i,s,u){var p=i.updateQueue;if(p===null)return null;if(p=p.shared,(dn&2)!==0){var b=p.pending;return b===null?s.next=s:(s.next=b.next,b.next=s),p.pending=s,s=gf(i),eS(i,null,u),s}return mf(i,p,s,u),gf(i)}function nu(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 fg(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 hg=!1;function ru(){if(hg){var i=ml;if(i!==null)throw i}}function iu(i,s,u,p){hg=!1;var b=i.updateQueue;eo=!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===pl&&(hg=!0),Me!==null&&(Me=Me.next={lane:0,tag:Y.tag,payload:Y.payload,callback:null,next:null});e:{var ot=i,xt=Y;be=s;var bn=u;switch(xt.tag){case 1:if(ot=xt.payload,typeof ot=="function"){Ie=ot.call(bn,Ie,be);break e}Ie=ot;break e;case 3:ot.flags=ot.flags&-65537|128;case 0:if(ot=xt.payload,be=typeof ot=="function"?ot.call(bn,Ie,be):ot,be==null)break e;Ie=h({},Ie,be);break e;case 2:eo=!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),so|=N,i.lanes=N,i.memoizedState=Ie}}function bS(i,s){if(typeof i!="function")throw Error(r(191,i));i.call(s)}function vS(i,s){var u=i.callbacks;if(u!==null)for(i.callbacks=null,i=0;i<u.length;i++)bS(u[i],s)}var bl=U(null),Rf=U(0);function xS(i,s){i=ka,I(Rf,i),I(bl,s),ka=i|s.baseLanes}function pg(){I(Rf,ka),I(bl,bl.current)}function mg(){ka=Rf.current,G(bl),G(Rf)}var Wr=U(null),fi=null;function ro(i){var s=i.alternate;I(Un,Un.current&1),I(Wr,i),fi===null&&(s===null||bl.current!==null||s.memoizedState!==null)&&(fi=i)}function gg(i){I(Un,Un.current),I(Wr,i),fi===null&&(fi=i)}function wS(i){i.tag===22?(I(Un,Un.current),I(Wr,i),fi===null&&(fi=i)):io()}function io(){I(Un,Un.current),I(Wr,Wr.current)}function Kr(i){G(Wr),fi===i&&(fi=null),G(Un)}var Un=U(0);function kf(i){for(var s=i;s!==null;){if(s.tag===13){var u=s.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||Sy(u)||Ey(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 va=0,_t=null,gn=null,Yn=null,Mf=!1,vl=!1,ms=!1,Af=0,au=0,xl=null,RI=0;function Ln(){throw Error(r(321))}function yg(i,s){if(s===null)return!1;for(var u=0;u<s.length&&u<i.length;u++)if(!$r(i[u],s[u]))return!1;return!0}function bg(i,s,u,p,b,x){return va=x,_t=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,_.H=i===null||i.memoizedState===null?i1:Ig,ms=!1,x=u(p,b),ms=!1,vl&&(x=ES(s,u,p,b)),SS(i),x}function SS(i){_.H=lu;var s=gn!==null&&gn.next!==null;if(va=0,Yn=gn=_t=null,Mf=!1,au=0,xl=null,s)throw Error(r(300));i===null||Wn||(i=i.dependencies,i!==null&&vf(i)&&(Wn=!0))}function ES(i,s,u,p){_t=i;var b=0;do{if(vl&&(xl=null),au=0,vl=!1,25<=b)throw Error(r(301));if(b+=1,Yn=gn=null,i.updateQueue!=null){var x=i.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}_.H=a1,x=s(u,p)}while(vl);return x}function kI(){var i=_.H,s=i.useState()[0];return s=typeof s.then=="function"?ou(s):s,i=i.useState()[0],(gn!==null?gn.memoizedState:null)!==i&&(_t.flags|=1024),s}function vg(){var i=Af!==0;return Af=0,i}function xg(i,s,u){s.updateQueue=i.updateQueue,s.flags&=-2053,i.lanes&=~u}function wg(i){if(Mf){for(i=i.memoizedState;i!==null;){var s=i.queue;s!==null&&(s.pending=null),i=i.next}Mf=!1}va=0,Yn=gn=_t=null,vl=!1,au=Af=0,xl=null}function Sr(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Yn===null?_t.memoizedState=Yn=i:Yn=Yn.next=i,Yn}function Vn(){if(gn===null){var i=_t.alternate;i=i!==null?i.memoizedState:null}else i=gn.next;var s=Yn===null?_t.memoizedState:Yn.next;if(s!==null)Yn=s,gn=i;else{if(i===null)throw _t.alternate===null?Error(r(467)):Error(r(310));gn=i,i={memoizedState:gn.memoizedState,baseState:gn.baseState,baseQueue:gn.baseQueue,queue:gn.queue,next:null},Yn===null?_t.memoizedState=Yn=i:Yn=Yn.next=i}return Yn}function Of(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ou(i){var s=au;return au+=1,xl===null&&(xl=[]),i=hS(xl,i,s),s=_t,(Yn===null?s.memoizedState:Yn.next)===null&&(s=s.alternate,_.H=s===null||s.memoizedState===null?i1:Ig),i}function Nf(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return ou(i);if(i.$$typeof===k)return ur(i)}throw Error(r(438,String(i)))}function Sg(i){var s=null,u=_t.updateQueue;if(u!==null&&(s=u.memoCache),s==null){var p=_t.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=Of(),_t.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 xa(i,s){return typeof s=="function"?s(i):s}function Df(i){var s=Vn();return Eg(s,gn,i)}function Eg(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:(va&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===pl&&(Me=!0);else if((va&be)===be){ge=ge.next,be===pl&&(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,_t.lanes|=be,so|=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,_t.lanes|=Ie,so|=Ie;ge=ge.next}while(ge!==null&&ge!==s);if(ne===null?N=x:ne.next=Y,!$r(x,i.memoizedState)&&(Wn=!0,Me&&(u=ml,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 Cg(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);$r(x,s.memoizedState)||(Wn=!0),s.memoizedState=x,s.baseQueue===null&&(s.baseState=x),u.lastRenderedState=x}return[x,p]}function CS(i,s,u){var p=_t,b=Vn(),x=tn;if(x){if(u===void 0)throw Error(r(407));u=u()}else u=s();var N=!$r((gn||b).memoizedState,u);if(N&&(b.memoizedState=u,Wn=!0),b=b.queue,kg(kS.bind(null,p,b,i),[i]),b.getSnapshot!==s||N||Yn!==null&&Yn.memoizedState.tag&1){if(p.flags|=2048,wl(9,{destroy:void 0},RS.bind(null,p,b,u,s),null),vn===null)throw Error(r(349));x||(va&127)!==0||TS(p,s,u)}return u}function TS(i,s,u){i.flags|=16384,i={getSnapshot:s,value:u},s=_t.updateQueue,s===null?(s=Of(),_t.updateQueue=s,s.stores=[i]):(u=s.stores,u===null?s.stores=[i]:u.push(i))}function RS(i,s,u,p){s.value=u,s.getSnapshot=p,MS(s)&&AS(i)}function kS(i,s,u){return u(function(){MS(s)&&AS(i)})}function MS(i){var s=i.getSnapshot;i=i.value;try{var u=s();return!$r(i,u)}catch{return!0}}function AS(i){var s=os(i,2);s!==null&&Lr(s,i,2)}function Tg(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:xa,lastRenderedState:i},s}function OS(i,s,u,p){return i.baseState=u,Eg(i,gn,typeof p=="function"?p:xa)}function MI(i,s,u,p,b){if(Lf(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)}};_.T!==null?u(!0):x.isTransition=!1,p(x),u=s.pending,u===null?(x.next=s.pending=x,NS(s,x)):(x.next=u.next,s.pending=u.next=x)}}function NS(i,s){var u=s.action,p=s.payload,b=i.state;if(s.isTransition){var x=_.T,N={};_.T=N;try{var Y=u(b,p),ne=_.S;ne!==null&&ne(N,Y),DS(i,s,Y)}catch(ge){Rg(i,s,ge)}finally{x!==null&&N.types!==null&&(x.types=N.types),_.T=x}}else try{x=u(b,p),DS(i,s,x)}catch(ge){Rg(i,s,ge)}}function DS(i,s,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(p){IS(i,s,p)},function(p){return Rg(i,s,p)}):IS(i,s,u)}function IS(i,s,u){s.status="fulfilled",s.value=u,PS(s),i.state=u,s=i.pending,s!==null&&(u=s.next,u===s?i.pending=null:(u=u.next,s.next=u,NS(i,u)))}function Rg(i,s,u){var p=i.pending;if(i.pending=null,p!==null){p=p.next;do s.status="rejected",s.reason=u,PS(s),s=s.next;while(s!==p)}i.action=null}function PS(i){i=i.listeners;for(var s=0;s<i.length;s++)(0,i[s])()}function LS(i,s){return s}function jS(i,s){if(tn){var u=vn.formState;if(u!==null){e:{var p=_t;if(tn){if(Tn){t:{for(var b=Tn,x=di;b.nodeType!==8;){if(!x){b=null;break t}if(b=hi(b.nextSibling),b===null){b=null;break t}}x=b.data,b=x==="F!"||x==="F"?b:null}if(b){Tn=hi(b.nextSibling),p=b.data==="F!";break e}}Za(p)}p=!1}p&&(s=u[0])}}return u=Sr(),u.memoizedState=u.baseState=s,p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:LS,lastRenderedState:s},u.queue=p,u=t1.bind(null,_t,p),p.dispatch=u,p=Tg(!1),x=Dg.bind(null,_t,!1,p.queue),p=Sr(),b={state:s,dispatch:null,action:i,pending:null},p.queue=b,u=MI.bind(null,_t,b,x,u),b.dispatch=u,p.memoizedState=i,[s,u,!1]}function _S(i){var s=Vn();return zS(s,gn,i)}function zS(i,s,u){if(s=Eg(i,s,LS)[0],i=Df(xa)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var p=ou(s)}catch(N){throw N===gl?Sf:N}else p=s;s=Vn();var b=s.queue,x=b.dispatch;return u!==s.memoizedState&&(_t.flags|=2048,wl(9,{destroy:void 0},AI.bind(null,b,u),null)),[p,x,i]}function AI(i,s){i.action=s}function FS(i){var s=Vn(),u=gn;if(u!==null)return zS(s,u,i);Vn(),s=s.memoizedState,u=Vn();var p=u.queue.dispatch;return u.memoizedState=i,[s,p,!1]}function wl(i,s,u,p){return i={tag:i,create:u,deps:p,inst:s,next:null},s=_t.updateQueue,s===null&&(s=Of(),_t.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 BS(){return Vn().memoizedState}function If(i,s,u,p){var b=Sr();_t.flags|=i,b.memoizedState=wl(1|s,{destroy:void 0},u,p===void 0?null:p)}function Pf(i,s,u,p){var b=Vn();p=p===void 0?null:p;var x=b.memoizedState.inst;gn!==null&&p!==null&&yg(p,gn.memoizedState.deps)?b.memoizedState=wl(s,x,u,p):(_t.flags|=i,b.memoizedState=wl(1|s,x,u,p))}function HS(i,s){If(8390656,8,i,s)}function kg(i,s){Pf(2048,8,i,s)}function OI(i){_t.flags|=4;var s=_t.updateQueue;if(s===null)s=Of(),_t.updateQueue=s,s.events=[i];else{var u=s.events;u===null?s.events=[i]:u.push(i)}}function US(i){var s=Vn().memoizedState;return OI({ref:s,nextImpl:i}),function(){if((dn&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}function VS(i,s){return Pf(4,2,i,s)}function qS(i,s){return Pf(4,4,i,s)}function $S(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 YS(i,s,u){u=u!=null?u.concat([i]):null,Pf(4,4,$S.bind(null,s,i),u)}function Mg(){}function WS(i,s){var u=Vn();s=s===void 0?null:s;var p=u.memoizedState;return s!==null&&yg(s,p[1])?p[0]:(u.memoizedState=[i,s],i)}function KS(i,s){var u=Vn();s=s===void 0?null:s;var p=u.memoizedState;if(s!==null&&yg(s,p[1]))return p[0];if(p=i(),ms){Ze(!0);try{i()}finally{Ze(!1)}}return u.memoizedState=[p,s],p}function Ag(i,s,u){return u===void 0||(va&1073741824)!==0&&(Gt&261930)===0?i.memoizedState=s:(i.memoizedState=u,i=G1(),_t.lanes|=i,so|=i,u)}function GS(i,s,u,p){return $r(u,s)?u:bl.current!==null?(i=Ag(i,u,p),$r(i,s)||(Wn=!0),i):(va&42)===0||(va&1073741824)!==0&&(Gt&261930)===0?(Wn=!0,i.memoizedState=u):(i=G1(),_t.lanes|=i,so|=i,s)}function XS(i,s,u,p,b){var x=z.p;z.p=x!==0&&8>x?x:8;var N=_.T,Y={};_.T=Y,Dg(i,!1,s,u);try{var ne=b(),ge=_.S;if(ge!==null&&ge(Y,ne),ne!==null&&typeof ne=="object"&&typeof ne.then=="function"){var Me=TI(ne,p);su(i,s,Me,Qr(i))}else su(i,s,p,Qr(i))}catch(Ie){su(i,s,{then:function(){},status:"rejected",reason:Ie},Qr())}finally{z.p=x,N!==null&&Y.types!==null&&(N.types=Y.types),_.T=N}}function NI(){}function Og(i,s,u,p){if(i.tag!==5)throw Error(r(476));var b=QS(i).queue;XS(i,b,s,H,u===null?NI:function(){return ZS(i),u(p)})}function QS(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:xa,lastRenderedState:H},next:null};var u={};return s.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xa,lastRenderedState:u},next:null},i.memoizedState=s,i=i.alternate,i!==null&&(i.memoizedState=s),s}function ZS(i){var s=QS(i);s.next===null&&(s=i.alternate.memoizedState),su(i,s.next.queue,{},Qr())}function Ng(){return ur(Cu)}function JS(){return Vn().memoizedState}function e1(){return Vn().memoizedState}function DI(i){for(var s=i.return;s!==null;){switch(s.tag){case 24:case 3:var u=Qr();i=to(u);var p=no(s,i,u);p!==null&&(Lr(p,s,u),nu(p,s,u)),s={cache:og()},i.payload=s;return}s=s.return}}function II(i,s,u){var p=Qr();u={lane:p,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Lf(i)?n1(s,u):(u=Gm(i,s,u,p),u!==null&&(Lr(u,i,p),r1(u,s,p)))}function t1(i,s,u){var p=Qr();su(i,s,u,p)}function su(i,s,u,p){var b={lane:p,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(Lf(i))n1(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,$r(Y,N))return mf(i,s,b,0),vn===null&&pf(),!1}catch{}finally{}if(u=Gm(i,s,b,p),u!==null)return Lr(u,i,p),r1(u,s,p),!0}return!1}function Dg(i,s,u,p){if(p={lane:2,revertLane:uy(),gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},Lf(i)){if(s)throw Error(r(479))}else s=Gm(i,u,p,2),s!==null&&Lr(s,i,2)}function Lf(i){var s=i.alternate;return i===_t||s!==null&&s===_t}function n1(i,s){vl=Mf=!0;var u=i.pending;u===null?s.next=s:(s.next=u.next,u.next=s),i.pending=s}function r1(i,s,u){if((u&4194048)!==0){var p=s.lanes;p&=i.pendingLanes,u|=p,s.lanes=u,X(i,u)}}var lu={readContext:ur,use:Nf,useCallback:Ln,useContext:Ln,useEffect:Ln,useImperativeHandle:Ln,useLayoutEffect:Ln,useInsertionEffect:Ln,useMemo:Ln,useReducer:Ln,useRef:Ln,useState:Ln,useDebugValue:Ln,useDeferredValue:Ln,useTransition:Ln,useSyncExternalStore:Ln,useId:Ln,useHostTransitionStatus:Ln,useFormState:Ln,useActionState:Ln,useOptimistic:Ln,useMemoCache:Ln,useCacheRefresh:Ln};lu.useEffectEvent=Ln;var i1={readContext:ur,use:Nf,useCallback:function(i,s){return Sr().memoizedState=[i,s===void 0?null:s],i},useContext:ur,useEffect:HS,useImperativeHandle:function(i,s,u){u=u!=null?u.concat([i]):null,If(4194308,4,$S.bind(null,s,i),u)},useLayoutEffect:function(i,s){return If(4194308,4,i,s)},useInsertionEffect:function(i,s){If(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=II.bind(null,_t,i),[p.memoizedState,i]},useRef:function(i){var s=Sr();return i={current:i},s.memoizedState=i},useState:function(i){i=Tg(i);var s=i.queue,u=t1.bind(null,_t,s);return s.dispatch=u,[i.memoizedState,u]},useDebugValue:Mg,useDeferredValue:function(i,s){var u=Sr();return Ag(u,i,s)},useTransition:function(){var i=Tg(!1);return i=XS.bind(null,_t,i.queue,!0,!1),Sr().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,s,u){var p=_t,b=Sr();if(tn){if(u===void 0)throw Error(r(407));u=u()}else{if(u=s(),vn===null)throw Error(r(349));(Gt&127)!==0||TS(p,s,u)}b.memoizedState=u;var x={value:u,getSnapshot:s};return b.queue=x,HS(kS.bind(null,p,x,i),[i]),p.flags|=2048,wl(9,{destroy:void 0},RS.bind(null,p,x,u,s),null),u},useId:function(){var i=Sr(),s=vn.identifierPrefix;if(tn){var u=Vi,p=Ui;u=(p&~(1<<32-tt(p)-1)).toString(32)+u,s="_"+s+"R_"+u,u=Af++,0<u&&(s+="H"+u.toString(32)),s+="_"}else u=RI++,s="_"+s+"r_"+u.toString(32)+"_";return i.memoizedState=s},useHostTransitionStatus:Ng,useFormState:jS,useActionState:jS,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=Dg.bind(null,_t,!0,u),u.dispatch=s,[i,s]},useMemoCache:Sg,useCacheRefresh:function(){return Sr().memoizedState=DI.bind(null,_t)},useEffectEvent:function(i){var s=Sr(),u={impl:i};return s.memoizedState=u,function(){if((dn&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}},Ig={readContext:ur,use:Nf,useCallback:WS,useContext:ur,useEffect:kg,useImperativeHandle:YS,useInsertionEffect:VS,useLayoutEffect:qS,useMemo:KS,useReducer:Df,useRef:BS,useState:function(){return Df(xa)},useDebugValue:Mg,useDeferredValue:function(i,s){var u=Vn();return GS(u,gn.memoizedState,i,s)},useTransition:function(){var i=Df(xa)[0],s=Vn().memoizedState;return[typeof i=="boolean"?i:ou(i),s]},useSyncExternalStore:CS,useId:JS,useHostTransitionStatus:Ng,useFormState:_S,useActionState:_S,useOptimistic:function(i,s){var u=Vn();return OS(u,gn,i,s)},useMemoCache:Sg,useCacheRefresh:e1};Ig.useEffectEvent=US;var a1={readContext:ur,use:Nf,useCallback:WS,useContext:ur,useEffect:kg,useImperativeHandle:YS,useInsertionEffect:VS,useLayoutEffect:qS,useMemo:KS,useReducer:Cg,useRef:BS,useState:function(){return Cg(xa)},useDebugValue:Mg,useDeferredValue:function(i,s){var u=Vn();return gn===null?Ag(u,i,s):GS(u,gn.memoizedState,i,s)},useTransition:function(){var i=Cg(xa)[0],s=Vn().memoizedState;return[typeof i=="boolean"?i:ou(i),s]},useSyncExternalStore:CS,useId:JS,useHostTransitionStatus:Ng,useFormState:FS,useActionState:FS,useOptimistic:function(i,s){var u=Vn();return gn!==null?OS(u,gn,i,s):(u.baseState=i,[i,u.queue.dispatch])},useMemoCache:Sg,useCacheRefresh:e1};a1.useEffectEvent=US;function Pg(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 Lg={enqueueSetState:function(i,s,u){i=i._reactInternals;var p=Qr(),b=to(p);b.payload=s,u!=null&&(b.callback=u),s=no(i,b,p),s!==null&&(Lr(s,i,p),nu(s,i,p))},enqueueReplaceState:function(i,s,u){i=i._reactInternals;var p=Qr(),b=to(p);b.tag=1,b.payload=s,u!=null&&(b.callback=u),s=no(i,b,p),s!==null&&(Lr(s,i,p),nu(s,i,p))},enqueueForceUpdate:function(i,s){i=i._reactInternals;var u=Qr(),p=to(u);p.tag=2,s!=null&&(p.callback=s),s=no(i,p,u),s!==null&&(Lr(s,i,u),nu(s,i,u))}};function o1(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?!Kc(u,p)||!Kc(b,x):!0}function s1(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&&Lg.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 l1(i){hf(i)}function c1(i){console.error(i)}function u1(i){hf(i)}function jf(i,s){try{var u=i.onUncaughtError;u(s.value,{componentStack:s.stack})}catch(p){setTimeout(function(){throw p})}}function d1(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 jg(i,s,u){return u=to(u),u.tag=3,u.payload={element:null},u.callback=function(){jf(i,s)},u}function f1(i){return i=to(i),i.tag=3,i}function h1(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(){d1(s,u,p)}}var N=u.stateNode;N!==null&&typeof N.componentDidCatch=="function"&&(i.callback=function(){d1(s,u,p),typeof b!="function"&&(lo===null?lo=new Set([this]):lo.add(this));var Y=p.stack;this.componentDidCatch(p.value,{componentStack:Y!==null?Y:""})})}function PI(i,s,u,p,b){if(u.flags|=32768,p!==null&&typeof p=="object"&&typeof p.then=="function"){if(s=u.alternate,s!==null&&hl(s,u,b,!0),u=Wr.current,u!==null){switch(u.tag){case 31:case 13:return fi===null?Kf():u.alternate===null&&jn===0&&(jn=3),u.flags&=-257,u.flags|=65536,u.lanes=b,p===Ef?u.flags|=16384:(s=u.updateQueue,s===null?u.updateQueue=new Set([p]):s.add(p),sy(i,p,b)),!1;case 22:return u.flags|=65536,p===Ef?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)),sy(i,p,b)),!1}throw Error(r(435,u.tag))}return sy(i,p,b),Kf(),!1}if(tn)return s=Wr.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=b,p!==tg&&(i=Error(r(422),{cause:p}),Qc(li(i,u)))):(p!==tg&&(s=Error(r(423),{cause:p}),Qc(li(s,u))),i=i.current.alternate,i.flags|=65536,b&=-b,i.lanes|=b,p=li(p,u),b=jg(i.stateNode,p,b),fg(i,b),jn!==4&&(jn=2)),!1;var x=Error(r(520),{cause:p});if(x=li(x,u),gu===null?gu=[x]:gu.push(x),jn!==4&&(jn=2),s===null)return!0;p=li(p,u),u=s;do{switch(u.tag){case 3:return u.flags|=65536,i=b&-b,u.lanes|=i,i=jg(u.stateNode,p,i),fg(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"&&(lo===null||!lo.has(x))))return u.flags|=65536,b&=-b,u.lanes|=b,b=f1(b),h1(b,i,u,p),fg(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?yS(s,null,u,p):ps(s,i.child,u,p)}function p1(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=bg(i,s,u,N,x,b),Y=vg(),i!==null&&!Wn?(xg(i,s,b),wa(i,s,b)):(tn&&Y&&Jm(s),s.flags|=1,dr(i,s,p,b),s.child)}function m1(i,s,u,p,b){if(i===null){var x=u.type;return typeof x=="function"&&!Xm(x)&&x.defaultProps===void 0&&u.compare===null?(s.tag=15,s.type=x,g1(i,s,x,p,b)):(i=yf(u.type,null,p,s,s.mode,b),i.ref=s.ref,i.return=s,s.child=i)}if(x=i.child,!$g(i,b)){var N=x.memoizedProps;if(u=u.compare,u=u!==null?u:Kc,u(N,p)&&i.ref===s.ref)return wa(i,s,b)}return s.flags|=1,i=ma(x,p),i.ref=s.ref,i.return=s,s.child=i}function g1(i,s,u,p,b){if(i!==null){var x=i.memoizedProps;if(Kc(x,p)&&i.ref===s.ref)if(Wn=!1,s.pendingProps=p=x,$g(i,b))(i.flags&131072)!==0&&(Wn=!0);else return s.lanes=i.lanes,wa(i,s,b)}return zg(i,s,u,p,b)}function y1(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 b1(i,s,x,u,p)}if((u&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},i!==null&&wf(s,x!==null?x.cachePool:null),x!==null?xS(s,x):pg(),wS(s);else return p=s.lanes=536870912,b1(i,s,x!==null?x.baseLanes|u:u,u,p)}else x!==null?(wf(s,x.cachePool),xS(s,x),io(),s.memoizedState=null):(i!==null&&wf(s,null),pg(),io());return dr(i,s,b,u),s.child}function cu(i,s){return i!==null&&i.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function b1(i,s,u,p,b){var x=lg();return x=x===null?null:{parent:$n._currentValue,pool:x},s.memoizedState={baseLanes:u,cachePool:x},i!==null&&wf(s,null),pg(),wS(s),i!==null&&hl(i,s,p,!0),s.childLanes=b,null}function _f(i,s){return s=Ff({mode:s.mode,children:s.children},i.mode),s.ref=i.ref,i.child=s,s.return=i,s}function v1(i,s,u){return ps(s,i.child,null,u),i=_f(s,s.pendingProps),i.flags|=2,Kr(s),s.memoizedState=null,i}function LI(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=_f(s,p),s.lanes=536870912,cu(null,i);if(gg(s),(i=Tn)?(i=NE(i,di),i=i!==null&&i.data==="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:Xa!==null?{id:Ui,overflow:Vi}:null,retryLane:536870912,hydrationErrors:null},u=nS(i),u.return=s,s.child=u,cr=s,Tn=null)):i=null,i===null)throw Za(s);return s.lanes=536870912,null}return _f(s,p)}var x=i.memoizedState;if(x!==null){var N=x.dehydrated;if(gg(s),b)if(s.flags&256)s.flags&=-257,s=v1(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||hl(i,s,u,!1),b=(u&i.childLanes)!==0,Wn||b){if(p=vn,p!==null&&(N=ie(p,u),N!==0&&N!==x.retryLane))throw x.retryLane=N,os(i,N),Lr(p,i,N),_g;Kf(),s=v1(i,s,u)}else i=x.treeContext,Tn=hi(N.nextSibling),cr=s,tn=!0,Qa=null,di=!1,i!==null&&aS(s,i),s=_f(s,p),s.flags|=4096;return s}return i=ma(i.child,{mode:p.mode,children:p.children}),i.ref=s.ref,s.child=i,i.return=s,i}function zf(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 zg(i,s,u,p,b){return us(s),u=bg(i,s,u,p,void 0,b),p=vg(),i!==null&&!Wn?(xg(i,s,b),wa(i,s,b)):(tn&&p&&Jm(s),s.flags|=1,dr(i,s,u,b),s.child)}function x1(i,s,u,p,b,x){return us(s),s.updateQueue=null,u=ES(s,p,u,b),SS(i),p=vg(),i!==null&&!Wn?(xg(i,s,x),wa(i,s,x)):(tn&&p&&Jm(s),s.flags|=1,dr(i,s,u,x),s.child)}function w1(i,s,u,p,b){if(us(s),s.stateNode===null){var x=cl,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=Lg,s.stateNode=x,x._reactInternals=s,x=s.stateNode,x.props=p,x.state=s.memoizedState,x.refs={},ug(s),N=u.contextType,x.context=typeof N=="object"&&N!==null?ur(N):cl,x.state=s.memoizedState,N=u.getDerivedStateFromProps,typeof N=="function"&&(Pg(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&&Lg.enqueueReplaceState(x,x.state,null),iu(s,p,x,b),ru(),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=cl,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)&&s1(s,x,p,N),eo=!1;var be=s.memoizedState;x.state=be,iu(s,p,x,b),ru(),ge=s.memoizedState,Y||be!==ge||eo?(typeof Ie=="function"&&(Pg(s,u,Ie,p),ge=s.memoizedState),(ne=eo||o1(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,dg(i,s),N=s.memoizedProps,Me=gs(u,N),x.props=Me,Ie=s.pendingProps,be=x.context,ge=u.contextType,ne=cl,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)&&s1(s,x,p,ne),eo=!1,be=s.memoizedState,x.state=be,iu(s,p,x,b),ru();var we=s.memoizedState;N!==Ie||be!==we||eo||i!==null&&i.dependencies!==null&&vf(i.dependencies)?(typeof Y=="function"&&(Pg(s,u,Y,p),we=s.memoizedState),(Me=eo||o1(s,u,Me,p,be,we,ne)||i!==null&&i.dependencies!==null&&vf(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,zf(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=wa(i,s,b),i}function S1(i,s,u,p){return ls(),s.flags|=256,dr(i,s,u,p),s.child}var Fg={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Bg(i){return{baseLanes:i,cachePool:dS()}}function Hg(i,s,u){return i=i!==null?i.childLanes&~u:0,s&&(i|=Xr),i}function E1(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:(Un.current&2)!==0),N&&(b=!0,s.flags&=-129),N=(s.flags&32)!==0,s.flags&=-33,i===null){if(tn){if(b?ro(s):io(),(i=Tn)?(i=NE(i,di),i=i!==null&&i.data!=="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:Xa!==null?{id:Ui,overflow:Vi}:null,retryLane:536870912,hydrationErrors:null},u=nS(i),u.return=s,s.child=u,cr=s,Tn=null)):i=null,i===null)throw Za(s);return Ey(i)?s.lanes=32:s.lanes=536870912,null}var Y=p.children;return p=p.fallback,b?(io(),b=s.mode,Y=Ff({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=Bg(u),p.childLanes=Hg(i,N,u),s.memoizedState=Fg,cu(null,p)):(ro(s),Ug(s,Y))}var ne=i.memoizedState;if(ne!==null&&(Y=ne.dehydrated,Y!==null)){if(x)s.flags&256?(ro(s),s.flags&=-257,s=Vg(i,s,u)):s.memoizedState!==null?(io(),s.child=i.child,s.flags|=128,s=null):(io(),Y=p.fallback,b=s.mode,p=Ff({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=Bg(u),p.childLanes=Hg(i,N,u),s.memoizedState=Fg,s=cu(null,p));else if(ro(s),Ey(Y)){if(N=Y.nextSibling&&Y.nextSibling.dataset,N)var ge=N.dgst;N=ge,p=Error(r(419)),p.stack="",p.digest=N,Qc({value:p,source:null,stack:null}),s=Vg(i,s,u)}else if(Wn||hl(i,s,u,!1),N=(u&i.childLanes)!==0,Wn||N){if(N=vn,N!==null&&(p=ie(N,u),p!==0&&p!==ne.retryLane))throw ne.retryLane=p,os(i,p),Lr(N,i,p),_g;Sy(Y)||Kf(),s=Vg(i,s,u)}else Sy(Y)?(s.flags|=192,s.child=i.child,s=null):(i=ne.treeContext,Tn=hi(Y.nextSibling),cr=s,tn=!0,Qa=null,di=!1,i!==null&&aS(s,i),s=Ug(s,p.children),s.flags|=4096);return s}return b?(io(),Y=p.fallback,b=s.mode,ne=i.child,ge=ne.sibling,p=ma(ne,{mode:"hidden",children:p.children}),p.subtreeFlags=ne.subtreeFlags&65011712,ge!==null?Y=ma(ge,Y):(Y=ss(Y,b,u,null),Y.flags|=2),Y.return=s,p.return=s,p.sibling=Y,s.child=p,cu(null,p),p=s.child,Y=i.child.memoizedState,Y===null?Y=Bg(u):(b=Y.cachePool,b!==null?(ne=$n._currentValue,b=b.parent!==ne?{parent:ne,pool:ne}:b):b=dS(),Y={baseLanes:Y.baseLanes|u,cachePool:b}),p.memoizedState=Y,p.childLanes=Hg(i,N,u),s.memoizedState=Fg,cu(i.child,p)):(ro(s),u=i.child,i=u.sibling,u=ma(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 Ug(i,s){return s=Ff({mode:"visible",children:s},i.mode),s.return=i,i.child=s}function Ff(i,s){return i=Yr(22,i,null,s),i.lanes=0,i}function Vg(i,s,u){return ps(s,i.child,null,u),i=Ug(s,s.pendingProps.children),i.flags|=2,s.memoizedState=null,i}function C1(i,s,u){i.lanes|=s;var p=i.alternate;p!==null&&(p.lanes|=s),ig(i.return,s,u)}function qg(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 T1(i,s,u){var p=s.pendingProps,b=p.revealOrder,x=p.tail;p=p.children;var N=Un.current,Y=(N&2)!==0;if(Y?(N=N&1|2,s.flags|=128):N&=1,I(Un,N),dr(i,s,p,u),p=tn?Xc:0,!Y&&i!==null&&(i.flags&128)!==0)e:for(i=s.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&C1(i,u,s);else if(i.tag===19)C1(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&&kf(i)===null&&(b=u),u=u.sibling;u=b,u===null?(b=s.child,s.child=null):(b=u.sibling,u.sibling=null),qg(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&&kf(i)===null){s.child=b;break}i=b.sibling,b.sibling=u,u=b,b=i}qg(s,!0,u,null,x,p);break;case"together":qg(s,!1,null,null,void 0,p);break;default:s.memoizedState=null}return s.child}function wa(i,s,u){if(i!==null&&(s.dependencies=i.dependencies),so|=s.lanes,(u&s.childLanes)===0)if(i!==null){if(hl(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=ma(i,i.pendingProps),s.child=u,u.return=s;i.sibling!==null;)i=i.sibling,u=u.sibling=ma(i,i.pendingProps),u.return=s;u.sibling=null}return s.child}function $g(i,s){return(i.lanes&s)!==0?!0:(i=i.dependencies,!!(i!==null&&vf(i)))}function jI(i,s,u){switch(s.tag){case 3:ue(s,s.stateNode.containerInfo),Ja(s,$n,i.memoizedState.cache),ls();break;case 27:case 5:Se(s);break;case 4:ue(s,s.stateNode.containerInfo);break;case 10:Ja(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,gg(s),null;break;case 13:var p=s.memoizedState;if(p!==null)return p.dehydrated!==null?(ro(s),s.flags|=128,null):(u&s.child.childLanes)!==0?E1(i,s,u):(ro(s),i=wa(i,s,u),i!==null?i.sibling:null);ro(s);break;case 19:var b=(i.flags&128)!==0;if(p=(u&s.childLanes)!==0,p||(hl(i,s,u,!1),p=(u&s.childLanes)!==0),b){if(p)return T1(i,s,u);s.flags|=128}if(b=s.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),I(Un,Un.current),p)break;return null;case 22:return s.lanes=0,y1(i,s,u,s.pendingProps);case 24:Ja(s,$n,i.memoizedState.cache)}return wa(i,s,u)}function R1(i,s,u){if(i!==null)if(i.memoizedProps!==s.pendingProps)Wn=!0;else{if(!$g(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&&iS(s,Xc,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")Xm(i)?(p=gs(i,p),s.tag=1,s=w1(null,s,i,p,u)):(s.tag=0,s=zg(null,s,i,p,u));else{if(i!=null){var b=i.$$typeof;if(b===M){s.tag=11,s=p1(null,s,i,p,u);break e}else if(b===O){s.tag=14,s=m1(null,s,i,p,u);break e}}throw s=$(i)||i,Error(r(306,s,""))}}return s;case 0:return zg(i,s,s.type,s.pendingProps,u);case 1:return p=s.type,b=gs(p,s.pendingProps),w1(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,dg(i,s),iu(s,p,null,u);var N=s.memoizedState;if(p=N.cache,Ja(s,$n,p),p!==x.cache&&ag(s,[$n],u,!0),ru(),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=S1(i,s,p,u);break e}else if(p!==b){b=li(Error(r(424)),s),Qc(b),s=S1(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=hi(i.firstChild),cr=s,tn=!0,Qa=null,di=!0,u=yS(s,null,p,u),s.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(ls(),p===b){s=wa(i,s,u);break e}dr(i,s,p,u)}s=s.child}return s;case 26:return zf(i,s),i===null?(u=_E(s.type,null,s.pendingProps,null))?s.memoizedState=u:tn||(u=s.type,i=s.pendingProps,p=th(ae.current).createElement(u),p[We]=s,p[Xe]=i,fr(p,u,i),Mn(p),s.stateNode=p):s.memoizedState=_E(s.type,i.memoizedProps,s.pendingProps,i.memoizedState),null;case 27:return Se(s),i===null&&tn&&(p=s.stateNode=PE(s.type,s.pendingProps,ae.current),cr=s,di=!0,b=Tn,ho(s.type)?(Cy=b,Tn=hi(p.firstChild)):Tn=b),dr(i,s,s.pendingProps.children,u),zf(i,s),i===null&&(s.flags|=4194304),s.child;case 5:return i===null&&tn&&((b=p=Tn)&&(p=fP(p,s.type,s.pendingProps,di),p!==null?(s.stateNode=p,cr=s,Tn=hi(p.firstChild),di=!1,b=!0):b=!1),b||Za(s)),Se(s),b=s.type,x=s.pendingProps,N=i!==null?i.memoizedProps:null,p=x.children,vy(b,x)?p=null:N!==null&&vy(b,N)&&(s.flags|=32),s.memoizedState!==null&&(b=bg(i,s,kI,null,null,u),Cu._currentValue=b),zf(i,s),dr(i,s,p,u),s.child;case 6:return i===null&&tn&&((i=u=Tn)&&(u=hP(u,s.pendingProps,di),u!==null?(s.stateNode=u,cr=s,Tn=null,i=!0):i=!1),i||Za(s)),null;case 13:return E1(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 p1(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,Ja(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 m1(i,s,s.type,s.pendingProps,u);case 15:return g1(i,s,s.type,s.pendingProps,u);case 19:return T1(i,s,u);case 31:return LI(i,s,u);case 22:return y1(i,s,u,s.pendingProps);case 24:return us(s),p=ur($n),i===null?(b=lg(),b===null&&(b=vn,x=og(),b.pooledCache=x,x.refCount++,x!==null&&(b.pooledCacheLanes|=u),b=x),s.memoizedState={parent:p,cache:b},ug(s),Ja(s,$n,b)):((i.lanes&u)!==0&&(dg(i,s),iu(s,null,null,u),ru()),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),Ja(s,$n,p)):(p=x.cache,Ja(s,$n,p),p!==b.cache&&ag(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 Sa(i){i.flags|=4}function Yg(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(J1())i.flags|=8192;else throw hs=Ef,cg}else i.flags&=-16777217}function k1(i,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!UE(s))if(J1())i.flags|=8192;else throw hs=Ef,cg}function Bf(i,s){s!==null&&(i.flags|=4),i.flags&16384&&(s=i.tag!==22?Tt():536870912,i.lanes|=s,Tl|=s)}function uu(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 _I(i,s,u){var p=s.pendingProps;switch(eg(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),ba($n),ve(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(i===null||i.child===null)&&(fl(s)?Sa(s):i===null||i.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,ng())),Rn(s),null;case 26:var b=s.type,x=s.memoizedState;return i===null?(Sa(s),x!==null?(Rn(s),k1(s,x)):(Rn(s),Yg(s,b,null,p,u))):x?x!==i.memoizedState?(Sa(s),Rn(s),k1(s,x)):(Rn(s),s.flags&=-16777217):(i=i.memoizedProps,i!==p&&Sa(s),Rn(s),Yg(s,b,i,p,u)),null;case 27:if(Pe(s),u=ae.current,b=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==p&&Sa(s);else{if(!p){if(s.stateNode===null)throw Error(r(166));return Rn(s),null}i=Q.current,fl(s)?oS(s):(i=PE(b,p,u),s.stateNode=i,Sa(s))}return Rn(s),null;case 5:if(Pe(s),b=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==p&&Sa(s);else{if(!p){if(s.stateNode===null)throw Error(r(166));return Rn(s),null}if(x=Q.current,fl(s))oS(s);else{var N=th(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&&Sa(s)}}return Rn(s),Yg(s,s.type,i===null?null:i.memoizedProps,s.pendingProps,u),null;case 6:if(i&&s.stateNode!=null)i.memoizedProps!==p&&Sa(s);else{if(typeof p!="string"&&s.stateNode===null)throw Error(r(166));if(i=ae.current,fl(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||EE(i.nodeValue,u)),i||Za(s,!0)}else i=th(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=fl(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=ng(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=u),i=!0;if(!i)return s.flags&256?(Kr(s),s):(Kr(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=fl(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=ng(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=b),b=!0;if(!b)return s.flags&256?(Kr(s),s):(Kr(s),null)}return Kr(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),Bf(s,s.updateQueue),Rn(s),null);case 4:return ve(),i===null&&py(s.stateNode.containerInfo),Rn(s),null;case 10:return ba(s.type),Rn(s),null;case 19:if(G(Un),p=s.memoizedState,p===null)return Rn(s),null;if(b=(s.flags&128)!==0,x=p.rendering,x===null)if(b)uu(p,!1);else{if(jn!==0||i!==null&&(i.flags&128)!==0)for(i=s.child;i!==null;){if(x=kf(i),x!==null){for(s.flags|=128,uu(p,!1),i=x.updateQueue,s.updateQueue=i,Bf(s,i),s.subtreeFlags=0,i=u,u=s.child;u!==null;)tS(u,i),u=u.sibling;return I(Un,Un.current&1|2),tn&&ga(s,p.treeForkCount),s.child}i=i.sibling}p.tail!==null&&De()>$f&&(s.flags|=128,b=!0,uu(p,!1),s.lanes=4194304)}else{if(!b)if(i=kf(x),i!==null){if(s.flags|=128,b=!0,i=i.updateQueue,s.updateQueue=i,Bf(s,i),uu(p,!0),p.tail===null&&p.tailMode==="hidden"&&!x.alternate&&!tn)return Rn(s),null}else 2*De()-p.renderingStartTime>$f&&u!==536870912&&(s.flags|=128,b=!0,uu(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=Un.current,I(Un,b?u&1|2:u&1),tn&&ga(s,p.treeForkCount),i):(Rn(s),null);case 22:case 23:return Kr(s),mg(),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&&Bf(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),ba($n),Rn(s),null;case 25:return null;case 30:return null}throw Error(r(156,s.tag))}function zI(i,s){switch(eg(s),s.tag){case 1:return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 3:return ba($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 Pe(s),null;case 31:if(s.memoizedState!==null){if(Kr(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(Kr(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(Un),null;case 4:return ve(),null;case 10:return ba(s.type),null;case 22:case 23:return Kr(s),mg(),i!==null&&G(ds),i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 24:return ba($n),null;case 25:return null;default:return null}}function M1(i,s){switch(eg(s),s.tag){case 3:ba($n),ve();break;case 26:case 27:case 5:Pe(s);break;case 4:ve();break;case 31:s.memoizedState!==null&&Kr(s);break;case 13:Kr(s);break;case 19:G(Un);break;case 10:ba(s.type);break;case 22:case 23:Kr(s),mg(),i!==null&&G(ds);break;case 24:ba($n)}}function du(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){pn(s,s.return,Y)}}function ao(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){pn(b,ne,Me)}}}p=p.next}while(p!==x)}}catch(Me){pn(s,s.return,Me)}}function A1(i){var s=i.updateQueue;if(s!==null){var u=i.stateNode;try{vS(s,u)}catch(p){pn(i,i.return,p)}}}function O1(i,s,u){u.props=gs(i.type,i.memoizedProps),u.state=i.memoizedState;try{u.componentWillUnmount()}catch(p){pn(i,s,p)}}function fu(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){pn(i,s,b)}}function qi(i,s){var u=i.ref,p=i.refCleanup;if(u!==null)if(typeof p=="function")try{p()}catch(b){pn(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){pn(i,s,b)}else u.current=null}function N1(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){pn(i,i.return,b)}}function Wg(i,s,u){try{var p=i.stateNode;oP(p,i.type,u,s),p[Xe]=s}catch(b){pn(i,i.return,b)}}function D1(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&ho(i.type)||i.tag===4}function Kg(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||D1(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&&ho(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 Gg(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=ha));else if(p!==4&&(p===27&&ho(i.type)&&(u=i.stateNode,s=null),i=i.child,i!==null))for(Gg(i,s,u),i=i.sibling;i!==null;)Gg(i,s,u),i=i.sibling}function Hf(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&&ho(i.type)&&(u=i.stateNode),i=i.child,i!==null))for(Hf(i,s,u),i=i.sibling;i!==null;)Hf(i,s,u),i=i.sibling}function I1(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){pn(i,i.return,x)}}var Ea=!1,Kn=!1,Xg=!1,P1=typeof WeakSet=="function"?WeakSet:Set,ir=null;function FI(i,s){if(i=i.containerInfo,yy=lh,i=Y0(i),Vm(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(by={focusedElem:i,selectionRange:u},lh=!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 ot=gs(u.type,b);i=p.getSnapshotBeforeUpdate(ot,x),p.__reactInternalSnapshotBeforeUpdate=i}catch(xt){pn(u,u.return,xt)}}break;case 3:if((i&1024)!==0){if(i=s.stateNode.containerInfo,u=i.nodeType,u===9)wy(i);else if(u===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":wy(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 L1(i,s,u){var p=u.flags;switch(u.tag){case 0:case 11:case 15:Ta(i,u),p&4&&du(5,u);break;case 1:if(Ta(i,u),p&4)if(i=u.stateNode,s===null)try{i.componentDidMount()}catch(N){pn(u,u.return,N)}else{var b=gs(u.type,s.memoizedProps);s=s.memoizedState;try{i.componentDidUpdate(b,s,i.__reactInternalSnapshotBeforeUpdate)}catch(N){pn(u,u.return,N)}}p&64&&A1(u),p&512&&fu(u,u.return);break;case 3:if(Ta(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{vS(i,s)}catch(N){pn(u,u.return,N)}}break;case 27:s===null&&p&4&&I1(u);case 26:case 5:Ta(i,u),s===null&&p&4&&N1(u),p&512&&fu(u,u.return);break;case 12:Ta(i,u);break;case 31:Ta(i,u),p&4&&z1(i,u);break;case 13:Ta(i,u),p&4&&F1(i,u),p&64&&(i=u.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(u=KI.bind(null,u),pP(i,u))));break;case 22:if(p=u.memoizedState!==null||Ea,!p){s=s!==null&&s.memoizedState!==null||Kn,b=Ea;var x=Kn;Ea=p,(Kn=s)&&!x?Ra(i,u,(u.subtreeFlags&8772)!==0):Ta(i,u),Ea=b,Kn=x}break;case 30:break;default:Ta(i,u)}}function j1(i){var s=i.alternate;s!==null&&(i.alternate=null,j1(s)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(s=i.stateNode,s!==null&&In(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 Ca(i,s,u){for(u=u.child;u!==null;)_1(i,s,u),u=u.sibling}function _1(i,s,u){if(ze&&typeof ze.onCommitFiberUnmount=="function")try{ze.onCommitFiberUnmount(et,u)}catch{}switch(u.tag){case 26:Kn||qi(u,s),Ca(i,s,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:Kn||qi(u,s);var p=An,b=Nr;ho(u.type)&&(An=u.stateNode,Nr=!1),Ca(i,s,u),wu(u.stateNode),An=p,Nr=b;break;case 5:Kn||qi(u,s);case 6:if(p=An,b=Nr,An=null,Ca(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){pn(u,s,x)}else try{An.removeChild(u.stateNode)}catch(x){pn(u,s,x)}break;case 18:An!==null&&(Nr?(i=An,AE(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,u.stateNode),Il(i)):AE(An,u.stateNode));break;case 4:p=An,b=Nr,An=u.stateNode.containerInfo,Nr=!0,Ca(i,s,u),An=p,Nr=b;break;case 0:case 11:case 14:case 15:ao(2,u,s),Kn||ao(4,u,s),Ca(i,s,u);break;case 1:Kn||(qi(u,s),p=u.stateNode,typeof p.componentWillUnmount=="function"&&O1(u,s,p)),Ca(i,s,u);break;case 21:Ca(i,s,u);break;case 22:Kn=(p=Kn)||u.memoizedState!==null,Ca(i,s,u),Kn=p;break;default:Ca(i,s,u)}}function z1(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{Il(i)}catch(u){pn(s,s.return,u)}}}function F1(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{Il(i)}catch(u){pn(s,s.return,u)}}function BI(i){switch(i.tag){case 31:case 13:case 19:var s=i.stateNode;return s===null&&(s=i.stateNode=new P1),s;case 22:return i=i.stateNode,s=i._retryCache,s===null&&(s=i._retryCache=new P1),s;default:throw Error(r(435,i.tag))}}function Uf(i,s){var u=BI(i);s.forEach(function(p){if(!u.has(p)){u.add(p);var b=GI.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(ho(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));_1(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;)B1(s,i),s=s.sibling}var Oi=null;function B1(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&&(ao(3,i,i.return),du(3,i),ao(5,i,i.return));break;case 1:Dr(s,i),Ir(i),p&512&&(Kn||u===null||qi(u,u.return)),p&64&&Ea&&(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=Oi;if(Dr(s,i),Ir(i),p&512&&(Kn||u===null||qi(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[On]||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,Mn(x),p=x;break e;case"link":var N=BE("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=BE("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,Mn(x),p=x}i.stateNode=p}else HE(b,i.type,i.stateNode);else i.stateNode=FE(b,p,i.memoizedProps);else x!==p?(x===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):x.count--,p===null?HE(b,i.type,i.stateNode):FE(b,p,i.memoizedProps)):p===null&&i.stateNode!==null&&Wg(i,i.memoizedProps,u.memoizedProps)}break;case 27:Dr(s,i),Ir(i),p&512&&(Kn||u===null||qi(u,u.return)),u!==null&&p&4&&Wg(i,i.memoizedProps,u.memoizedProps);break;case 5:if(Dr(s,i),Ir(i),p&512&&(Kn||u===null||qi(u,u.return)),i.flags&32){b=i.stateNode;try{nl(b,"")}catch(ot){pn(i,i.return,ot)}}p&4&&i.stateNode!=null&&(b=i.memoizedProps,Wg(i,b,u!==null?u.memoizedProps:b)),p&1024&&(Xg=!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(ot){pn(i,i.return,ot)}}break;case 3:if(ih=null,b=Oi,Oi=nh(s.containerInfo),Dr(s,i),Oi=b,Ir(i),p&4&&u!==null&&u.memoizedState.isDehydrated)try{Il(s.containerInfo)}catch(ot){pn(i,i.return,ot)}Xg&&(Xg=!1,H1(i));break;case 4:p=Oi,Oi=nh(i.stateNode.containerInfo),Dr(s,i),Ir(i),Oi=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,Uf(i,p)));break;case 13:Dr(s,i),Ir(i),i.child.flags&8192&&i.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(qf=De()),p&4&&(p=i.updateQueue,p!==null&&(i.updateQueue=null,Uf(i,p)));break;case 22:b=i.memoizedState!==null;var ne=u!==null&&u.memoizedState!==null,ge=Ea,Me=Kn;if(Ea=ge||b,Kn=Me||ne,Dr(s,i),Kn=Me,Ea=ge,Ir(i),p&8192)e:for(s=i.stateNode,s._visibility=b?s._visibility&-2:s._visibility|1,b&&(u===null||ne||Ea||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(ot){pn(ne,ne.return,ot)}}}else if(s.tag===6){if(u===null){ne=s;try{ne.stateNode.nodeValue=b?"":ne.memoizedProps}catch(ot){pn(ne,ne.return,ot)}}}else if(s.tag===18){if(u===null){ne=s;try{var we=ne.stateNode;b?OE(we,!0):OE(ne.stateNode,!1)}catch(ot){pn(ne,ne.return,ot)}}}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,Uf(i,u))));break;case 19:Dr(s,i),Ir(i),p&4&&(p=i.updateQueue,p!==null&&(i.updateQueue=null,Uf(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(D1(p)){u=p;break}p=p.return}if(u==null)throw Error(r(160));switch(u.tag){case 27:var b=u.stateNode,x=Kg(i);Hf(i,x,b);break;case 5:var N=u.stateNode;u.flags&32&&(nl(N,""),u.flags&=-33);var Y=Kg(i);Hf(i,Y,N);break;case 3:case 4:var ne=u.stateNode.containerInfo,ge=Kg(i);Gg(i,ge,ne);break;default:throw Error(r(161))}}catch(Me){pn(i,i.return,Me)}i.flags&=-3}s&4096&&(i.flags&=-4097)}function H1(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var s=i;H1(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),i=i.sibling}}function Ta(i,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)L1(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:ao(4,s,s.return),ys(s);break;case 1:qi(s,s.return);var u=s.stateNode;typeof u.componentWillUnmount=="function"&&O1(s,s.return,u),ys(s);break;case 27:wu(s.stateNode);case 26:case 5:qi(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 Ra(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:Ra(b,x,u),du(4,x);break;case 1:if(Ra(b,x,u),p=x,b=p.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(ge){pn(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++)bS(ne[b],Y)}catch(ge){pn(p,p.return,ge)}}u&&N&64&&A1(x),fu(x,x.return);break;case 27:I1(x);case 26:case 5:Ra(b,x,u),u&&p===null&&N&4&&N1(x),fu(x,x.return);break;case 12:Ra(b,x,u);break;case 31:Ra(b,x,u),u&&N&4&&z1(b,x);break;case 13:Ra(b,x,u),u&&N&4&&F1(b,x);break;case 22:x.memoizedState===null&&Ra(b,x,u),fu(x,x.return);break;case 30:break;default:Ra(b,x,u)}s=s.sibling}}function Qg(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&&Zc(u))}function Zg(i,s){i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&Zc(i))}function Ni(i,s,u,p){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)U1(i,s,u,p),s=s.sibling}function U1(i,s,u,p){var b=s.flags;switch(s.tag){case 0:case 11:case 15:Ni(i,s,u,p),b&2048&&du(9,s);break;case 1:Ni(i,s,u,p);break;case 3:Ni(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&&Zc(i)));break;case 12:if(b&2048){Ni(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){pn(s,s.return,ne)}}else Ni(i,s,u,p);break;case 31:Ni(i,s,u,p);break;case 13:Ni(i,s,u,p);break;case 23:break;case 22:x=s.stateNode,N=s.alternate,s.memoizedState!==null?x._visibility&2?Ni(i,s,u,p):hu(i,s):x._visibility&2?Ni(i,s,u,p):(x._visibility|=2,Sl(i,s,u,p,(s.subtreeFlags&10256)!==0||!1)),b&2048&&Qg(N,s);break;case 24:Ni(i,s,u,p),b&2048&&Zg(s.alternate,s);break;default:Ni(i,s,u,p)}}function Sl(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:Sl(x,N,Y,ne,b),du(8,N);break;case 23:break;case 22:var Me=N.stateNode;N.memoizedState!==null?Me._visibility&2?Sl(x,N,Y,ne,b):hu(x,N):(Me._visibility|=2,Sl(x,N,Y,ne,b)),b&&ge&2048&&Qg(N.alternate,N);break;case 24:Sl(x,N,Y,ne,b),b&&ge&2048&&Zg(N.alternate,N);break;default:Sl(x,N,Y,ne,b)}s=s.sibling}}function hu(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:hu(u,p),b&2048&&Qg(p.alternate,p);break;case 24:hu(u,p),b&2048&&Zg(p.alternate,p);break;default:hu(u,p)}s=s.sibling}}var pu=8192;function El(i,s,u){if(i.subtreeFlags&pu)for(i=i.child;i!==null;)V1(i,s,u),i=i.sibling}function V1(i,s,u){switch(i.tag){case 26:El(i,s,u),i.flags&pu&&i.memoizedState!==null&&RP(u,Oi,i.memoizedState,i.memoizedProps);break;case 5:El(i,s,u);break;case 3:case 4:var p=Oi;Oi=nh(i.stateNode.containerInfo),El(i,s,u),Oi=p;break;case 22:i.memoizedState===null&&(p=i.alternate,p!==null&&p.memoizedState!==null?(p=pu,pu=16777216,El(i,s,u),pu=p):El(i,s,u));break;default:El(i,s,u)}}function q1(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 mu(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,Y1(p,i)}q1(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)$1(i),i=i.sibling}function $1(i){switch(i.tag){case 0:case 11:case 15:mu(i),i.flags&2048&&ao(9,i,i.return);break;case 3:mu(i);break;case 12:mu(i);break;case 22:var s=i.stateNode;i.memoizedState!==null&&s._visibility&2&&(i.return===null||i.return.tag!==13)?(s._visibility&=-3,Vf(i)):mu(i);break;default:mu(i)}}function Vf(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,Y1(p,i)}q1(i)}for(i=i.child;i!==null;){switch(s=i,s.tag){case 0:case 11:case 15:ao(8,s,s.return),Vf(s);break;case 22:u=s.stateNode,u._visibility&2&&(u._visibility&=-3,Vf(s));break;default:Vf(s)}i=i.sibling}}function Y1(i,s){for(;ir!==null;){var u=ir;switch(u.tag){case 0:case 11:case 15:ao(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:Zc(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(j1(p),p===u){ir=null;break e}if(b!==null){b.return=x,ir=b;break e}ir=x}}}var HI={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}},UI=typeof WeakMap=="function"?WeakMap:Map,dn=0,vn=null,Yt=null,Gt=0,hn=0,Gr=null,oo=!1,Cl=!1,Jg=!1,ka=0,jn=0,so=0,bs=0,ey=0,Xr=0,Tl=0,gu=null,Pr=null,ty=!1,qf=0,W1=0,$f=1/0,Yf=null,lo=null,Qn=0,co=null,Rl=null,Ma=0,ny=0,ry=null,K1=null,yu=0,iy=null;function Qr(){return(dn&2)!==0&&Gt!==0?Gt&-Gt:_.T!==null?uy():_e()}function G1(){if(Xr===0)if((Gt&536870912)===0||tn){var i=it;it<<=1,(it&3932160)===0&&(it=262144),Xr=i}else Xr=536870912;return i=Wr.current,i!==null&&(i.flags|=32),Xr}function Lr(i,s,u){(i===vn&&(hn===2||hn===9)||i.cancelPendingCommit!==null)&&(kl(i,0),uo(i,Gt,Xr,!1)),Ht(i,u),((dn&2)===0||i!==vn)&&(i===vn&&((dn&2)===0&&(bs|=u),jn===4&&uo(i,Gt,Xr,!1)),$i(i))}function X1(i,s,u){if((dn&6)!==0)throw Error(r(327));var p=!u&&(s&127)===0&&(s&i.expiredLanes)===0||Rt(i,s),b=p?$I(i,s):oy(i,s,!0),x=p;do{if(b===0){Cl&&!p&&uo(i,s,0,!1);break}else{if(u=i.current.alternate,x&&!VI(u)){b=oy(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=gu;var ne=Y.current.memoizedState.isDehydrated;if(ne&&(kl(Y,N).flags|=256),N=oy(Y,N,!1),N!==2){if(Jg&&!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){kl(i,0),uo(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:uo(p,s,Xr,!oo);break e;case 2:Pr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((s&62914560)===s&&(b=qf+300-De(),10<b)){if(uo(p,s,Xr,!oo),Ke(p,0,!0)!==0)break e;Ma=s,p.timeoutHandle=kE(Q1.bind(null,p,u,Pr,Yf,ty,s,Xr,bs,Tl,oo,x,"Throttled",-0,0),b);break e}Q1(p,u,Pr,Yf,ty,s,Xr,bs,Tl,oo,x,null,-0,0)}}break}while(!0);$i(i)}function Q1(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:ha},V1(s,x,Ie);var ot=(x&62914560)===x?qf-De():(x&4194048)===x?W1-De():0;if(ot=kP(Ie,ot),ot!==null){Ma=x,i.cancelPendingCommit=ot(aE.bind(null,i,s,x,u,p,b,N,Y,ne,Me,Ie,null,be,we)),uo(i,x,N,!ge);return}}aE(i,s,x,u,p,b,N,Y,ne)}function VI(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(!$r(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 uo(i,s,u,p){s&=~ey,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&&kt(i,u,s)}function Wf(){return(dn&6)===0?(bu(0),!1):!0}function ay(){if(Yt!==null){if(hn===0)var i=Yt.return;else i=Yt,ya=cs=null,wg(i),yl=null,eu=0,i=Yt;for(;i!==null;)M1(i.alternate,i),i=i.return;Yt=null}}function kl(i,s){var u=i.timeoutHandle;u!==-1&&(i.timeoutHandle=-1,cP(u)),u=i.cancelPendingCommit,u!==null&&(i.cancelPendingCommit=null,u()),Ma=0,ay(),vn=i,Yt=u=ma(i.current,null),Gt=s,hn=0,Gr=null,oo=!1,Cl=Rt(i,s),Jg=!1,Tl=Xr=ey=bs=so=jn=0,Pr=gu=null,ty=!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 ka=s,pf(),u}function Z1(i,s){_t=null,_.H=lu,s===gl||s===Sf?(s=pS(),hn=3):s===cg?(s=pS(),hn=4):hn=s===_g?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,Gr=s,Yt===null&&(jn=1,jf(i,li(s,i.current)))}function J1(){var i=Wr.current;return i===null?!0:(Gt&4194048)===Gt?fi===null:(Gt&62914560)===Gt||(Gt&536870912)!==0?i===fi:!1}function eE(){var i=_.H;return _.H=lu,i===null?lu:i}function tE(){var i=_.A;return _.A=HI,i}function Kf(){jn=4,oo||(Gt&4194048)!==Gt&&Wr.current!==null||(Cl=!0),(so&134217727)===0&&(bs&134217727)===0||vn===null||uo(vn,Gt,Xr,!1)}function oy(i,s,u){var p=dn;dn|=2;var b=eE(),x=tE();(vn!==i||Gt!==s)&&(Yf=null,kl(i,s)),s=!1;var N=jn;e:do try{if(hn!==0&&Yt!==null){var Y=Yt,ne=Gr;switch(hn){case 8:ay(),N=6;break e;case 3:case 2:case 9:case 6:Wr.current===null&&(s=!0);var ge=hn;if(hn=0,Gr=null,Ml(i,Y,ne,ge),u&&Cl){N=0;break e}break;default:ge=hn,hn=0,Gr=null,Ml(i,Y,ne,ge)}}qI(),N=jn;break}catch(Me){Z1(i,Me)}while(!0);return s&&i.shellSuspendCounter++,ya=cs=null,dn=p,_.H=b,_.A=x,Yt===null&&(vn=null,Gt=0,pf()),N}function qI(){for(;Yt!==null;)nE(Yt)}function $I(i,s){var u=dn;dn|=2;var p=eE(),b=tE();vn!==i||Gt!==s?(Yf=null,$f=De()+500,kl(i,s)):Cl=Rt(i,s);e:do try{if(hn!==0&&Yt!==null){s=Yt;var x=Gr;t:switch(hn){case 1:hn=0,Gr=null,Ml(i,s,x,1);break;case 2:case 9:if(fS(x)){hn=0,Gr=null,rE(s);break}s=function(){hn!==2&&hn!==9||vn!==i||(hn=7),$i(i)},x.then(s,s);break e;case 3:hn=7;break e;case 4:hn=5;break e;case 7:fS(x)?(hn=0,Gr=null,rE(s)):(hn=0,Gr=null,Ml(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?UE(N):Y.stateNode.complete){hn=0,Gr=null;var ne=Y.sibling;if(ne!==null)Yt=ne;else{var ge=Y.return;ge!==null?(Yt=ge,Gf(ge)):Yt=null}break t}}hn=0,Gr=null,Ml(i,s,x,5);break;case 6:hn=0,Gr=null,Ml(i,s,x,6);break;case 8:ay(),jn=6;break e;default:throw Error(r(462))}}YI();break}catch(Me){Z1(i,Me)}while(!0);return ya=cs=null,_.H=p,_.A=b,dn=u,Yt!==null?0:(vn=null,Gt=0,pf(),jn)}function YI(){for(;Yt!==null&&!Be();)nE(Yt)}function nE(i){var s=R1(i.alternate,i,ka);i.memoizedProps=i.pendingProps,s===null?Gf(i):Yt=s}function rE(i){var s=i,u=s.alternate;switch(s.tag){case 15:case 0:s=x1(u,s,s.pendingProps,s.type,void 0,Gt);break;case 11:s=x1(u,s,s.pendingProps,s.type.render,s.ref,Gt);break;case 5:wg(s);default:M1(u,s),s=Yt=tS(s,ka),s=R1(u,s,ka)}i.memoizedProps=i.pendingProps,s===null?Gf(i):Yt=s}function Ml(i,s,u,p){ya=cs=null,wg(s),yl=null,eu=0;var b=s.return;try{if(PI(i,b,s,u,Gt)){jn=1,jf(i,li(u,i.current)),Yt=null;return}}catch(x){if(b!==null)throw Yt=b,x;jn=1,jf(i,li(u,i.current)),Yt=null;return}s.flags&32768?(tn||p===1?i=!0:Cl||(Gt&536870912)!==0?i=!1:(oo=i=!0,(p===2||p===9||p===3||p===6)&&(p=Wr.current,p!==null&&p.tag===13&&(p.flags|=16384))),iE(s,i)):Gf(s)}function Gf(i){var s=i;do{if((s.flags&32768)!==0){iE(s,oo);return}i=s.return;var u=_I(s.alternate,s,ka);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 iE(i,s){do{var u=zI(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 aE(i,s,u,p,b,x,N,Y,ne){i.cancelPendingCommit=null;do Xf();while(Qn!==0);if((dn&6)!==0)throw Error(r(327));if(s!==null){if(s===i.current)throw Error(r(177));if(x=s.lanes|s.childLanes,x|=Km,Je(i,u,x,N,Y,ne),i===vn&&(Yt=vn=null,Gt=0),Rl=s,co=i,Ma=u,ny=x,ry=b,K1=p,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,XI(ee,function(){return uE(),null})):(i.callbackNode=null,i.callbackPriority=0),p=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||p){p=_.T,_.T=null,b=z.p,z.p=2,N=dn,dn|=4;try{FI(i,s,u)}finally{dn=N,z.p=b,_.T=p}}Qn=1,oE(),sE(),lE()}}function oE(){if(Qn===1){Qn=0;var i=co,s=Rl,u=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||u){u=_.T,_.T=null;var p=z.p;z.p=2;var b=dn;dn|=4;try{B1(s,i);var x=by,N=Y0(i.containerInfo),Y=x.focusedElem,ne=x.selectionRange;if(N!==Y&&Y&&Y.ownerDocument&&$0(Y.ownerDocument.documentElement,Y)){if(ne!==null&&Vm(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(),ot=Y.textContent.length,xt=Math.min(ne.start,ot),bn=ne.end===void 0?xt:Math.min(ne.end,ot);!we.extend&&xt>bn&&(N=bn,bn=xt,xt=N);var ce=q0(Y,xt),oe=q0(Y,bn);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(),xt>bn?(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}}lh=!!yy,by=yy=null}finally{dn=b,z.p=p,_.T=u}}i.current=s,Qn=2}}function sE(){if(Qn===2){Qn=0;var i=co,s=Rl,u=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||u){u=_.T,_.T=null;var p=z.p;z.p=2;var b=dn;dn|=4;try{L1(i,s.alternate,s)}finally{dn=b,z.p=p,_.T=u}}Qn=3}}function lE(){if(Qn===4||Qn===3){Qn=0,qe();var i=co,s=Rl,u=Ma,p=K1;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?Qn=5:(Qn=0,Rl=co=null,cE(i,i.pendingLanes));var b=i.pendingLanes;if(b===0&&(lo=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=_.T,b=z.p,z.p=2,_.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{_.T=s,z.p=b}}(Ma&3)!==0&&Xf(),$i(i),b=i.pendingLanes,(u&261930)!==0&&(b&42)!==0?i===iy?yu++:(yu=0,iy=i):yu=0,bu(0)}}function cE(i,s){(i.pooledCacheLanes&=s)===0&&(s=i.pooledCache,s!=null&&(i.pooledCache=null,Zc(s)))}function Xf(){return oE(),sE(),lE(),uE()}function uE(){if(Qn!==5)return!1;var i=co,s=ny;ny=0;var u=ke(Ma),p=_.T,b=z.p;try{z.p=32>u?32:u,_.T=null,u=ry,ry=null;var x=co,N=Ma;if(Qn=0,Rl=co=null,Ma=0,(dn&6)!==0)throw Error(r(331));var Y=dn;if(dn|=4,$1(x.current),U1(x,x.current,N,u),dn=Y,bu(0,!1),ze&&typeof ze.onPostCommitFiberRoot=="function")try{ze.onPostCommitFiberRoot(et,x)}catch{}return!0}finally{z.p=b,_.T=p,cE(i,s)}}function dE(i,s,u){s=li(u,s),s=jg(i.stateNode,s,2),i=no(i,s,2),i!==null&&(Ht(i,2),$i(i))}function pn(i,s,u){if(i.tag===3)dE(i,i,u);else for(;s!==null;){if(s.tag===3){dE(s,i,u);break}else if(s.tag===1){var p=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(lo===null||!lo.has(p))){i=li(u,i),u=f1(2),p=no(s,u,2),p!==null&&(h1(u,p,s,i),Ht(p,2),$i(p));break}}s=s.return}}function sy(i,s,u){var p=i.pingCache;if(p===null){p=i.pingCache=new UI;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)||(Jg=!0,b.add(u),i=WI.bind(null,i,s,u),s.then(i,i))}function WI(i,s,u){var p=i.pingCache;p!==null&&p.delete(s),i.pingedLanes|=i.suspendedLanes&u,i.warmLanes&=~u,vn===i&&(Gt&u)===u&&(jn===4||jn===3&&(Gt&62914560)===Gt&&300>De()-qf?(dn&2)===0&&kl(i,0):ey|=u,Tl===Gt&&(Tl=0)),$i(i)}function fE(i,s){s===0&&(s=Tt()),i=os(i,s),i!==null&&(Ht(i,s),$i(i))}function KI(i){var s=i.memoizedState,u=0;s!==null&&(u=s.retryLane),fE(i,u)}function GI(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),fE(i,u)}function XI(i,s){return Ee(i,s)}var Qf=null,Al=null,ly=!1,Zf=!1,cy=!1,fo=0;function $i(i){i!==Al&&i.next===null&&(Al===null?Qf=Al=i:Al=Al.next=i),Zf=!0,ly||(ly=!0,ZI())}function bu(i,s){if(!cy&&Zf){cy=!0;do for(var u=!1,p=Qf;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,gE(p,x))}else x=Gt,x=Ke(p,p===vn?x:0,p.cancelPendingCommit!==null||p.timeoutHandle!==-1),(x&3)===0||Rt(p,x)||(u=!0,gE(p,x));p=p.next}while(u);cy=!1}}function QI(){hE()}function hE(){Zf=ly=!1;var i=0;fo!==0&&lP()&&(i=fo);for(var s=De(),u=null,p=Qf;p!==null;){var b=p.next,x=pE(p,s);x===0?(p.next=null,u===null?Qf=b:u.next=b,b===null&&(Al=u)):(u=p,(i!==0||(x&3)!==0)&&(Zf=!0)),p=b}Qn!==0&&Qn!==5||bu(i),fo!==0&&(fo=0)}function pE(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]=jt(Y,s)):ne<=s&&(i.expiredLanes|=Y),x&=~Y}if(s=vn,u=Gt,u=Ke(i,i===s?u:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),p=i.callbackNode,u===0||i===s&&(hn===2||hn===9)||i.cancelPendingCommit!==null)return p!==null&&p!==null&&xe(p),i.callbackNode=null,i.callbackPriority=0;if((u&3)===0||Rt(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=Oe;break;default:u=ee}return p=mE.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 mE(i,s){if(Qn!==0&&Qn!==5)return i.callbackNode=null,i.callbackPriority=0,null;var u=i.callbackNode;if(Xf()&&i.callbackNode!==u)return null;var p=Gt;return p=Ke(i,i===vn?p:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),p===0?null:(X1(i,p,s),pE(i,De()),i.callbackNode!=null&&i.callbackNode===u?mE.bind(null,i):null)}function gE(i,s){if(Xf())return null;X1(i,s,!0)}function ZI(){uP(function(){(dn&6)!==0?Ee(pe,QI):hE()})}function uy(){if(fo===0){var i=pl;i===0&&(i=At,At<<=1,(At&261888)===0&&(At=256)),fo=i}return fo}function yE(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:of(""+i)}function bE(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 JI(i,s,u,p,b){if(s==="submit"&&u&&u.stateNode===b){var x=yE((b[Xe]||null).action),N=p.submitter;N&&(s=(s=N[Xe]||null)?yE(s.formAction):N.getAttribute("formAction"),s!==null&&(x=s,N=null));var Y=new uf("action","action",null,p,b);i.push({event:Y,listeners:[{instance:null,listener:function(){if(p.defaultPrevented){if(fo!==0){var ne=N?bE(b,N):new FormData(b);Og(u,{pending:!0,data:ne,method:b.method,action:x},null,ne)}}else typeof x=="function"&&(Y.preventDefault(),ne=N?bE(b,N):new FormData(b),Og(u,{pending:!0,data:ne,method:b.method,action:x},x,ne))},currentTarget:b}]})}}for(var dy=0;dy<Wm.length;dy++){var fy=Wm[dy],eP=fy.toLowerCase(),tP=fy[0].toUpperCase()+fy.slice(1);Ai(eP,"on"+tP)}Ai(G0,"onAnimationEnd"),Ai(X0,"onAnimationIteration"),Ai(Q0,"onAnimationStart"),Ai("dblclick","onDoubleClick"),Ai("focusin","onFocus"),Ai("focusout","onBlur"),Ai(yI,"onTransitionRun"),Ai(bI,"onTransitionStart"),Ai(vI,"onTransitionCancel"),Ai(Z0,"onTransitionEnd"),ai("onMouseEnter",["mouseout","mouseover"]),ai("onMouseLeave",["mouseout","mouseover"]),ai("onPointerEnter",["pointerout","pointerover"]),ai("onPointerLeave",["pointerout","pointerover"]),ki("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ki("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ki("onBeforeInput",["compositionend","keypress","textInput","paste"]),ki("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ki("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ki("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var vu="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(" "),nP=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(vu));function vE(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){hf(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){hf(Me)}b.currentTarget=null,x=ne}}}}function Wt(i,s){var u=s[St];u===void 0&&(u=s[St]=new Set);var p=i+"__bubble";u.has(p)||(xE(s,i,2,!1),u.add(p))}function hy(i,s,u){var p=0;s&&(p|=4),xE(u,i,p,s)}var Jf="_reactListening"+Math.random().toString(36).slice(2);function py(i){if(!i[Jf]){i[Jf]=!0,Ri.forEach(function(u){u!=="selectionchange"&&(nP.has(u)||hy(u,!1,i),hy(u,!0,i))});var s=i.nodeType===9?i:i.ownerDocument;s===null||s[Jf]||(s[Jf]=!0,hy("selectionchange",!1,s))}}function xE(i,s,u,p){switch(GE(s)){case 2:var b=OP;break;case 8:b=NP;break;default:b=Ay}u=b.bind(null,s,u,i),b=void 0,!Pm||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 my(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=Pn(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}T0(function(){var ge=x,Me=Dm(u),Ie=[];e:{var be=J0.get(i);if(be!==void 0){var we=uf,ot=i;switch(i){case"keypress":if(lf(u)===0)break e;case"keydown":case"keyup":we=G2;break;case"focusin":ot="focus",we=zm;break;case"focusout":ot="blur",we=zm;break;case"beforeblur":case"afterblur":we=zm;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=M0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":we=_2;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":we=Z2;break;case G0:case X0:case Q0:we=B2;break;case Z0:we=eI;break;case"scroll":case"scrollend":we=L2;break;case"wheel":we=nI;break;case"copy":case"cut":case"paste":we=U2;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":we=O0;break;case"toggle":case"beforetoggle":we=iI}var xt=(s&4)!==0,bn=!xt&&(i==="scroll"||i==="scrollend"),ce=xt?be!==null?be+"Capture":null:be;xt=[];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=Hc(oe,ce),Ne!=null&&xt.push(xu(oe,Ne,me))),bn)break;oe=oe.return}0<xt.length&&(be=new we(be,ot,null,u,Me),Ie.push({event:be,listeners:xt}))}}if((s&7)===0){e:{if(be=i==="mouseover"||i==="pointerover",we=i==="mouseout"||i==="pointerout",be&&u!==Nm&&(ot=u.relatedTarget||u.fromElement)&&(Pn(ot)||ot[at]))break e;if((we||be)&&(be=Me.window===Me?Me:(be=Me.ownerDocument)?be.defaultView||be.parentWindow:window,we?(ot=u.relatedTarget||u.toElement,we=ge,ot=ot?Pn(ot):null,ot!==null&&(bn=o(ot),xt=ot.tag,ot!==bn||xt!==5&&xt!==27&&xt!==6)&&(ot=null)):(we=null,ot=ge),we!==ot)){if(xt=M0,Ne="onMouseLeave",ce="onMouseEnter",oe="mouse",(i==="pointerout"||i==="pointerover")&&(xt=O0,Ne="onPointerLeave",ce="onPointerEnter",oe="pointer"),bn=we==null?be:rr(we),me=ot==null?be:rr(ot),be=new xt(Ne,oe+"leave",we,u,Me),be.target=bn,be.relatedTarget=me,Ne=null,Pn(Me)===ge&&(xt=new xt(ce,oe+"enter",ot,u,Me),xt.target=me,xt.relatedTarget=bn,Ne=xt),bn=Ne,we&&ot)t:{for(xt=rP,ce=we,oe=ot,me=0,Ne=ce;Ne;Ne=xt(Ne))me++;Ne=0;for(var mt=oe;mt;mt=xt(mt))Ne++;for(;0<me-Ne;)ce=xt(ce),me--;for(;0<Ne-me;)oe=xt(oe),Ne--;for(;me--;){if(ce===oe||oe!==null&&ce===oe.alternate){xt=ce;break t}ce=xt(ce),oe=xt(oe)}xt=null}else xt=null;we!==null&&wE(Ie,be,we,xt,!1),ot!==null&&bn!==null&&wE(Ie,bn,ot,xt,!0)}}e:{if(be=ge?rr(ge):window,we=be.nodeName&&be.nodeName.toLowerCase(),we==="select"||we==="input"&&be.type==="file")var on=z0;else if(j0(be))if(F0)on=pI;else{on=fI;var dt=dI}else we=be.nodeName,!we||we.toLowerCase()!=="input"||be.type!=="checkbox"&&be.type!=="radio"?ge&&Om(ge.elementType)&&(on=z0):on=hI;if(on&&(on=on(i,ge))){_0(Ie,on,u,Me);break e}dt&&dt(i,be,ge),i==="focusout"&&ge&&be.type==="number"&&ge.memoizedProps.value!=null&&Am(be,"number",be.value)}switch(dt=ge?rr(ge):window,i){case"focusin":(j0(dt)||dt.contentEditable==="true")&&(ol=dt,qm=ge,Gc=null);break;case"focusout":Gc=qm=ol=null;break;case"mousedown":$m=!0;break;case"contextmenu":case"mouseup":case"dragend":$m=!1,W0(Ie,u,Me);break;case"selectionchange":if(gI)break;case"keydown":case"keyup":W0(Ie,u,Me)}var Ft;if(Bm)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 al?P0(i,u)&&(Xt="onCompositionEnd"):i==="keydown"&&u.keyCode===229&&(Xt="onCompositionStart");Xt&&(N0&&u.locale!=="ko"&&(al||Xt!=="onCompositionStart"?Xt==="onCompositionEnd"&&al&&(Ft=R0()):(Ga=Me,Lm="value"in Ga?Ga.value:Ga.textContent,al=!0)),dt=eh(ge,Xt),0<dt.length&&(Xt=new A0(Xt,i,null,u,Me),Ie.push({event:Xt,listeners:dt}),Ft?Xt.data=Ft:(Ft=L0(u),Ft!==null&&(Xt.data=Ft)))),(Ft=oI?sI(i,u):lI(i,u))&&(Xt=eh(ge,"onBeforeInput"),0<Xt.length&&(dt=new A0("onBeforeInput","beforeinput",null,u,Me),Ie.push({event:dt,listeners:Xt}),dt.data=Ft)),JI(Ie,i,ge,u,Me)}vE(Ie,s)})}function xu(i,s,u){return{instance:i,listener:s,currentTarget:u}}function eh(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=Hc(i,u),b!=null&&p.unshift(xu(i,b,x)),b=Hc(i,s),b!=null&&p.push(xu(i,b,x))),i.tag===3)return p;i=i.return}return[]}function rP(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function wE(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=Hc(u,x),ge!=null&&N.unshift(xu(u,ge,ne))):b||(ge=Hc(u,x),ge!=null&&N.push(xu(u,ge,ne)))),u=u.return}N.length!==0&&i.push({event:s,listeners:N})}var iP=/\r\n?/g,aP=/\u0000|\uFFFD/g;function SE(i){return(typeof i=="string"?i:""+i).replace(iP,`
50
- `).replace(aP,"")}function EE(i,s){return s=SE(s),SE(i)===s}function yn(i,s,u,p,b,x){switch(u){case"children":typeof p=="string"?s==="body"||s==="textarea"&&p===""||nl(i,p):(typeof p=="number"||typeof p=="bigint")&&s!=="body"&&nl(i,""+p);break;case"className":Mi(i,"class",p);break;case"tabIndex":Mi(i,"tabindex",p);break;case"dir":case"role":case"viewBox":case"width":case"height":Mi(i,u,p);break;case"style":E0(i,p,x);break;case"data":if(s!=="object"){Mi(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=of(""+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"&&yn(i,s,"name",b.name,b,null),yn(i,s,"formEncType",b.formEncType,b,null),yn(i,s,"formMethod",b.formMethod,b,null),yn(i,s,"formTarget",b.formTarget,b,null)):(yn(i,s,"encType",b.encType,b,null),yn(i,s,"method",b.method,b,null),yn(i,s,"target",b.target,b,null)));if(p==null||typeof p=="symbol"||typeof p=="boolean"){i.removeAttribute(u);break}p=of(""+p),i.setAttribute(u,p);break;case"onClick":p!=null&&(i.onclick=ha);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=of(""+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),Hn(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":Hn(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=I2.get(u)||u,Hn(i,u,p))}}function gy(i,s,u,p,b,x){switch(u){case"style":E0(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"?nl(i,p):(typeof p=="number"||typeof p=="bigint")&&nl(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=ha);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!qr.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,""):Hn(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:yn(i,s,x,N,u,null)}}b&&yn(i,s,"srcSet",u.srcSet,u,null),p&&yn(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:yn(i,s,p,Me,u,null)}}v0(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:yn(i,s,b,Y,u,null)}s=x,u=N,i.multiple=!!p,s!=null?tl(i,!!p,s,!1):u!=null&&tl(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:yn(i,s,N,Y,u,null)}w0(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:yn(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<vu.length;p++)Wt(vu[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:yn(i,s,ge,p,u,null)}return;default:if(Om(s)){for(Me in u)u.hasOwnProperty(Me)&&(p=u[Me],p!==void 0&&gy(i,s,Me,p,u,void 0));return}}for(Y in u)u.hasOwnProperty(Y)&&(p=u[Y],p!=null&&yn(i,s,Y,p,u,null))}function oP(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)||yn(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&&yn(i,s,be,we,p,Ie)}}Mm(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)||yn(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&&yn(i,s,b,x,p,ne)}s=Y,u=N,p=we,be!=null?tl(i,!!u,be,!1):!!p!=!!u&&(s!=null?tl(i,!!u,s,!0):tl(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:yn(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&&yn(i,s,N,b,p,x)}x0(i,be,we);return;case"option":for(var ot in u)if(be=u[ot],u.hasOwnProperty(ot)&&be!=null&&!p.hasOwnProperty(ot))switch(ot){case"selected":i.selected=!1;break;default:yn(i,s,ot,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:yn(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 xt in u)be=u[xt],u.hasOwnProperty(xt)&&be!=null&&!p.hasOwnProperty(xt)&&yn(i,s,xt,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:yn(i,s,ge,be,p,we)}return;default:if(Om(s)){for(var bn in u)be=u[bn],u.hasOwnProperty(bn)&&be!==void 0&&!p.hasOwnProperty(bn)&&gy(i,s,bn,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||gy(i,s,Me,be,p,we);return}}for(var ce in u)be=u[ce],u.hasOwnProperty(ce)&&be!=null&&!p.hasOwnProperty(ce)&&yn(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||yn(i,s,Ie,be,p,we)}function CE(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function sP(){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&&CE(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&&CE(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 yy=null,by=null;function th(i){return i.nodeType===9?i:i.ownerDocument}function TE(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 RE(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 vy(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 xy=null;function lP(){var i=window.event;return i&&i.type==="popstate"?i===xy?!1:(xy=i,!0):(xy=null,!1)}var kE=typeof setTimeout=="function"?setTimeout:void 0,cP=typeof clearTimeout=="function"?clearTimeout:void 0,ME=typeof Promise=="function"?Promise:void 0,uP=typeof queueMicrotask=="function"?queueMicrotask:typeof ME<"u"?function(i){return ME.resolve(null).then(i).catch(dP)}:kE;function dP(i){setTimeout(function(){throw i})}function ho(i){return i==="head"}function AE(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),Il(s);return}p--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")p++;else if(u==="html")wu(i.ownerDocument.documentElement);else if(u==="head"){u=i.ownerDocument.head,wu(u);for(var x=u.firstChild;x;){var N=x.nextSibling,Y=x.nodeName;x[On]||Y==="SCRIPT"||Y==="STYLE"||Y==="LINK"&&x.rel.toLowerCase()==="stylesheet"||u.removeChild(x),x=N}}else u==="body"&&wu(i.ownerDocument.body);u=b}while(u);Il(s)}function OE(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 wy(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":wy(u),In(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}i.removeChild(u)}}function fP(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[On])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=hi(i.nextSibling),i===null)break}return null}function hP(i,s,u){if(s==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!u||(i=hi(i.nextSibling),i===null))return null;return i}function NE(i,s){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!s||(i=hi(i.nextSibling),i===null))return null;return i}function Sy(i){return i.data==="$?"||i.data==="$~"}function Ey(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function pP(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 hi(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 Cy=null;function DE(i){i=i.nextSibling;for(var s=0;i;){if(i.nodeType===8){var u=i.data;if(u==="/$"||u==="/&"){if(s===0)return hi(i.nextSibling);s--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||s++}i=i.nextSibling}return null}function IE(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 PE(i,s,u){switch(s=th(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 wu(i){for(var s=i.attributes;s.length;)i.removeAttributeNode(s[0]);In(i)}var pi=new Map,LE=new Set;function nh(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var Aa=z.d;z.d={f:mP,r:gP,D:yP,C:bP,L:vP,m:xP,X:SP,S:wP,M:EP};function mP(){var i=Aa.f(),s=Wf();return i||s}function gP(i){var s=Zt(i);s!==null&&s.tag===5&&s.type==="form"?ZS(s):Aa.r(i)}var Ol=typeof document>"u"?null:document;function jE(i,s,u){var p=Ol;if(p&&typeof s=="string"&&s){var b=oi(s);b='link[rel="'+i+'"][href="'+b+'"]',typeof u=="string"&&(b+='[crossorigin="'+u+'"]'),LE.has(b)||(LE.add(b),i={rel:i,crossOrigin:u,href:s},p.querySelector(b)===null&&(s=p.createElement("link"),fr(s,"link",i),Mn(s),p.head.appendChild(s)))}}function yP(i){Aa.D(i),jE("dns-prefetch",i,null)}function bP(i,s){Aa.C(i,s),jE("preconnect",i,s)}function vP(i,s,u){Aa.L(i,s,u);var p=Ol;if(p&&i&&s){var b='link[rel="preload"][as="'+oi(s)+'"]';s==="image"&&u&&u.imageSrcSet?(b+='[imagesrcset="'+oi(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(b+='[imagesizes="'+oi(u.imageSizes)+'"]')):b+='[href="'+oi(i)+'"]';var x=b;switch(s){case"style":x=Nl(i);break;case"script":x=Dl(i)}pi.has(x)||(i=h({rel:"preload",href:s==="image"&&u&&u.imageSrcSet?void 0:i,as:s},u),pi.set(x,i),p.querySelector(b)!==null||s==="style"&&p.querySelector(Su(x))||s==="script"&&p.querySelector(Eu(x))||(s=p.createElement("link"),fr(s,"link",i),Mn(s),p.head.appendChild(s)))}}function xP(i,s){Aa.m(i,s);var u=Ol;if(u&&i){var p=s&&typeof s.as=="string"?s.as:"script",b='link[rel="modulepreload"][as="'+oi(p)+'"][href="'+oi(i)+'"]',x=b;switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=Dl(i)}if(!pi.has(x)&&(i=h({rel:"modulepreload",href:i},s),pi.set(x,i),u.querySelector(b)===null)){switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Eu(x)))return}p=u.createElement("link"),fr(p,"link",i),Mn(p),u.head.appendChild(p)}}}function wP(i,s,u){Aa.S(i,s,u);var p=Ol;if(p&&i){var b=Ar(p).hoistableStyles,x=Nl(i);s=s||"default";var N=b.get(x);if(!N){var Y={loading:0,preload:null};if(N=p.querySelector(Su(x)))Y.loading=5;else{i=h({rel:"stylesheet",href:i,"data-precedence":s},u),(u=pi.get(x))&&Ty(i,u);var ne=N=p.createElement("link");Mn(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,rh(N,s,p)}N={type:"stylesheet",instance:N,count:1,state:Y},b.set(x,N)}}}function SP(i,s){Aa.X(i,s);var u=Ol;if(u&&i){var p=Ar(u).hoistableScripts,b=Dl(i),x=p.get(b);x||(x=u.querySelector(Eu(b)),x||(i=h({src:i,async:!0},s),(s=pi.get(b))&&Ry(i,s),x=u.createElement("script"),Mn(x),fr(x,"link",i),u.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},p.set(b,x))}}function EP(i,s){Aa.M(i,s);var u=Ol;if(u&&i){var p=Ar(u).hoistableScripts,b=Dl(i),x=p.get(b);x||(x=u.querySelector(Eu(b)),x||(i=h({src:i,async:!0,type:"module"},s),(s=pi.get(b))&&Ry(i,s),x=u.createElement("script"),Mn(x),fr(x,"link",i),u.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},p.set(b,x))}}function _E(i,s,u,p){var b=(b=ae.current)?nh(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=Nl(u.href),u=Ar(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=Nl(u.href);var x=Ar(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(Su(i)))&&!x._p&&(N.instance=x,N.state.loading=5),pi.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},pi.set(i,u),x||CP(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=Dl(u),u=Ar(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 Nl(i){return'href="'+oi(i)+'"'}function Su(i){return'link[rel="stylesheet"]['+i+"]"}function zE(i){return h({},i,{"data-precedence":i.precedence,precedence:null})}function CP(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),Mn(s),i.head.appendChild(s))}function Dl(i){return'[src="'+oi(i)+'"]'}function Eu(i){return"script[async]"+i}function FE(i,s,u){if(s.count++,s.instance===null)switch(s.type){case"style":var p=i.querySelector('style[data-href~="'+oi(u.href)+'"]');if(p)return s.instance=p,Mn(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"),Mn(p),fr(p,"style",b),rh(p,u.precedence,i),s.instance=p;case"stylesheet":b=Nl(u.href);var x=i.querySelector(Su(b));if(x)return s.state.loading|=4,s.instance=x,Mn(x),x;p=zE(u),(b=pi.get(b))&&Ty(p,b),x=(i.ownerDocument||i).createElement("link"),Mn(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,rh(x,u.precedence,i),s.instance=x;case"script":return x=Dl(u.src),(b=i.querySelector(Eu(x)))?(s.instance=b,Mn(b),b):(p=u,(b=pi.get(x))&&(p=h({},u),Ry(p,b)),i=i.ownerDocument||i,b=i.createElement("script"),Mn(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,rh(p,u.precedence,i));return s.instance}function rh(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 Ty(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.title==null&&(i.title=s.title)}function Ry(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.integrity==null&&(i.integrity=s.integrity)}var ih=null;function BE(i,s,u){if(ih===null){var p=new Map,b=ih=new Map;b.set(u,p)}else b=ih,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[On]||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 HE(i,s,u){i=i.ownerDocument||i,i.head.insertBefore(u,s==="title"?i.querySelector("head > title"):null)}function TP(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 UE(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function RP(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=Nl(p.href),x=s.querySelector(Su(b));if(x){s=x._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(i.count++,i=ah.bind(i),s.then(i,i)),u.state.loading|=4,u.instance=x,Mn(x);return}x=s.ownerDocument||s,p=zE(p),(b=pi.get(b))&&Ty(p,b),x=x.createElement("link"),Mn(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=ah.bind(i),s.addEventListener("load",u),s.addEventListener("error",u))}}var ky=0;function kP(i,s){return i.stylesheets&&i.count===0&&sh(i,i.stylesheets),0<i.count||0<i.imgCount?function(u){var p=setTimeout(function(){if(i.stylesheets&&sh(i,i.stylesheets),i.unsuspend){var x=i.unsuspend;i.unsuspend=null,x()}},6e4+s);0<i.imgBytes&&ky===0&&(ky=62500*sP());var b=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&sh(i,i.stylesheets),i.unsuspend)){var x=i.unsuspend;i.unsuspend=null,x()}},(i.imgBytes>ky?50:800)+s);return i.unsuspend=u,function(){i.unsuspend=null,clearTimeout(p),clearTimeout(b)}}:null}function ah(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)sh(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var oh=null;function sh(i,s){i.stylesheets=null,i.unsuspend!==null&&(i.count++,oh=new Map,s.forEach(MP,i),oh=null,ah.call(i))}function MP(i,s){if(!(s.state.loading&4)){var u=oh.get(i);if(u)var p=u.get(null);else{u=new Map,oh.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=ah.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 Cu={$$typeof:k,Provider:null,Consumer:null,_currentValue:H,_currentValue2:H,_threadCount:0};function AP(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=un(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=un(0),this.hiddenUpdates=un(null),this.identifierPrefix=p,this.onUncaughtError=b,this.onCaughtError=x,this.onRecoverableError=N,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ne,this.incompleteTransitions=new Map}function VE(i,s,u,p,b,x,N,Y,ne,ge,Me,Ie){return i=new AP(i,s,u,N,ne,ge,Me,Ie,Y),s=1,x===!0&&(s|=24),x=Yr(3,null,null,s),i.current=x,x.stateNode=i,s=og(),s.refCount++,i.pooledCache=s,s.refCount++,x.memoizedState={element:p,isDehydrated:u,cache:s},ug(x),i}function qE(i){return i?(i=cl,i):cl}function $E(i,s,u,p,b,x){b=qE(b),p.context===null?p.context=b:p.pendingContext=b,p=to(s),p.payload={element:u},x=x===void 0?null:x,x!==null&&(p.callback=x),u=no(i,p,s),u!==null&&(Lr(u,i,s),nu(u,i,s))}function YE(i,s){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var u=i.retryLane;i.retryLane=u!==0&&u<s?u:s}}function My(i,s){YE(i,s),(i=i.alternate)&&YE(i,s)}function WE(i){if(i.tag===13||i.tag===31){var s=os(i,67108864);s!==null&&Lr(s,i,67108864),My(i,67108864)}}function KE(i){if(i.tag===13||i.tag===31){var s=Qr();s=de(s);var u=os(i,s);u!==null&&Lr(u,i,s),My(i,s)}}var lh=!0;function OP(i,s,u,p){var b=_.T;_.T=null;var x=z.p;try{z.p=2,Ay(i,s,u,p)}finally{z.p=x,_.T=b}}function NP(i,s,u,p){var b=_.T;_.T=null;var x=z.p;try{z.p=8,Ay(i,s,u,p)}finally{z.p=x,_.T=b}}function Ay(i,s,u,p){if(lh){var b=Oy(p);if(b===null)my(i,s,p,ch,u),XE(i,p);else if(IP(b,i,s,u,p))p.stopPropagation();else if(XE(i,p),s&4&&-1<DP.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=yt(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}$i(x),(dn&6)===0&&($f=De()+500,bu(0))}}break;case 31:case 13:Y=os(x,2),Y!==null&&Lr(Y,x,2),Wf(),My(x,2)}if(x=Oy(p),x===null&&my(i,s,p,ch,u),x===b)break;b=x}b!==null&&p.stopPropagation()}else my(i,s,p,null,u)}}function Oy(i){return i=Dm(i),Ny(i)}var ch=null;function Ny(i){if(ch=null,i=Pn(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 ch=i,null}function GE(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 Oe:return 268435456;default:return 32}default:return 32}}var Dy=!1,po=null,mo=null,go=null,Tu=new Map,Ru=new Map,yo=[],DP="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 XE(i,s){switch(i){case"focusin":case"focusout":po=null;break;case"dragenter":case"dragleave":mo=null;break;case"mouseover":case"mouseout":go=null;break;case"pointerover":case"pointerout":Tu.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ru.delete(s.pointerId)}}function ku(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&&WE(s)),i):(i.eventSystemFlags|=p,s=i.targetContainers,b!==null&&s.indexOf(b)===-1&&s.push(b),i)}function IP(i,s,u,p,b){switch(s){case"focusin":return po=ku(po,i,s,u,p,b),!0;case"dragenter":return mo=ku(mo,i,s,u,p,b),!0;case"mouseover":return go=ku(go,i,s,u,p,b),!0;case"pointerover":var x=b.pointerId;return Tu.set(x,ku(Tu.get(x)||null,i,s,u,p,b)),!0;case"gotpointercapture":return x=b.pointerId,Ru.set(x,ku(Ru.get(x)||null,i,s,u,p,b)),!0}return!1}function QE(i){var s=Pn(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(){KE(u)});return}}else if(s===31){if(s=c(u),s!==null){i.blockedOn=s,rt(i.priority,function(){KE(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 uh(i){if(i.blockedOn!==null)return!1;for(var s=i.targetContainers;0<s.length;){var u=Oy(i.nativeEvent);if(u===null){u=i.nativeEvent;var p=new u.constructor(u.type,u);Nm=p,u.target.dispatchEvent(p),Nm=null}else return s=Zt(u),s!==null&&WE(s),i.blockedOn=u,!1;s.shift()}return!0}function ZE(i,s,u){uh(i)&&u.delete(s)}function PP(){Dy=!1,po!==null&&uh(po)&&(po=null),mo!==null&&uh(mo)&&(mo=null),go!==null&&uh(go)&&(go=null),Tu.forEach(ZE),Ru.forEach(ZE)}function dh(i,s){i.blockedOn===s&&(i.blockedOn=null,Dy||(Dy=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,PP)))}var fh=null;function JE(i){fh!==i&&(fh=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){fh===i&&(fh=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(Ny(p||u)===null)continue;break}var x=Zt(u);x!==null&&(i.splice(s,3),s-=3,Og(x,{pending:!0,data:b,method:u.method,action:p},p,b))}}))}function Il(i){function s(ne){return dh(ne,i)}po!==null&&dh(po,i),mo!==null&&dh(mo,i),go!==null&&dh(go,i),Tu.forEach(s),Ru.forEach(s);for(var u=0;u<yo.length;u++){var p=yo[u];p.blockedOn===i&&(p.blockedOn=null)}for(;0<yo.length&&(u=yo[0],u.blockedOn===null);)QE(u),u.blockedOn===null&&yo.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||JE(u);else if(N){var Y=null;if(x&&x.hasAttribute("formAction")){if(b=x,N=x[Xe]||null)Y=N.formAction;else if(Ny(b)!==null)continue}else Y=N.action;typeof Y=="function"?u[p+1]=Y:(u.splice(p,3),p-=3),JE(u)}}}function eC(){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 Iy(i){this._internalRoot=i}hh.prototype.render=Iy.prototype.render=function(i){var s=this._internalRoot;if(s===null)throw Error(r(409));var u=s.current,p=Qr();$E(u,p,i,s,null,null)},hh.prototype.unmount=Iy.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var s=i.containerInfo;$E(i.current,2,null,i,null,null),Wf(),s[at]=null}};function hh(i){this._internalRoot=i}hh.prototype.unstable_scheduleHydration=function(i){if(i){var s=_e();i={blockedOn:null,target:i,priority:s};for(var u=0;u<yo.length&&s!==0&&s<yo[u].priority;u++);yo.splice(u,0,i),u===0&&QE(i)}};var tC=t.version;if(tC!=="19.2.4")throw Error(r(527,tC,"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 LP={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:_,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ph=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ph.isDisabled&&ph.supportsFiber)try{et=ph.inject(LP),ze=ph}catch{}}return Au.createRoot=function(i,s){if(!a(i))throw Error(r(299));var u=!1,p="",b=l1,x=c1,N=u1;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=VE(i,1,!1,null,null,u,p,null,b,x,N,eC),i[at]=s.current,py(i),new Iy(s)},Au.hydrateRoot=function(i,s,u){if(!a(i))throw Error(r(299));var p=!1,b="",x=l1,N=c1,Y=u1,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=VE(i,1,!0,s,u??null,p,b,ne,x,N,Y,eC),s.context=qE(null),u=s.current,p=Qr(),p=de(p),b=to(p),b.callback=null,no(u,b,p),u=p,s.current.lanes=u,Ht(s,u),$i(s),i[at]=s.current,py(i),new hh(s)},Au.version="19.2.4",Au}var CC;function NL(){if(CC)return _y.exports;CC=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=OL(),_y.exports}var DL=NL();/**
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 gM=e=>{throw TypeError(e)},IL=(e,t,n)=>t.has(e)||gM("Cannot "+n),Hy=(e,t,n)=>(IL(e,t,"read from private field"),n?n.call(e):t.get(e)),PL=(e,t,n)=>t.has(e)?gM("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),TC="popstate";function LL(e={}){function t(r,a){let{pathname:o,search:l,hash:c}=r.location;return md("",{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:na(a)}return _L(t,n,null,e)}function Vt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Xn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function jL(){return Math.random().toString(36).substring(2,10)}function RC(e,t){return{usr:e.state,key:e.key,idx:t}}function md(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||jL()}}function na({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 _L(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(),S=T==null?null:T-d;d=T,f&&f({action:c,location:C.location,delta:S})}function y(T,S){c="PUSH";let R=md(C.location,T,S);d=m()+1;let k=RC(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,S){c="REPLACE";let R=md(C.location,T,S);d=m();let k=RC(R,d),M=C.createHref(R);l.replaceState(k,"",M),o&&f&&f({action:c,location:C.location,delta:0})}function w(T){return yM(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(TC,h),f=T,()=>{a.removeEventListener(TC,h),f=null}},createHref(T){return t(a,T)},createURL:w,encodeLocation(T){let S=w(T);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:y,replace:g,go(T){return l.go(T)}};return C}function yM(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:na(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}var Yu,kC=class{constructor(e){if(PL(this,Yu,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(Hy(this,Yu).has(e))return Hy(this,Yu).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){Hy(this,Yu).set(e,t)}};Yu=new WeakMap;var zL=new Set(["lazy","caseSensitive","path","id","index","children"]);function FL(e){return zL.has(e)}var BL=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function HL(e){return BL.has(e)}function UL(e){return e.index===!0}function gd(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`),UL(o)){let d={...o,id:f};return r[f]=MC(d,t(d)),d}else{let d={...o,id:f,children:void 0};return r[f]=MC(d,t(d)),o.children&&(d.children=gd(o.children,t,c,r,a)),d}})}function MC(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function Co(e,t,n="/"){return Wu(e,t,n,!1)}function Wu(e,t,n,r){let a=typeof t=="string"?Yo(t):t,o=Si(a.pathname||"/",n);if(o==null)return null;let l=bM(e);qL(l);let c=null;for(let f=0;c==null&&f<l.length;++f){let d=xM(o);c=JL(l[f],d,r)}return c}function VL(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 bM(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=Ji([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}".`),bM(l.children,t,y,h,f)),!(l.path==null&&!l.index)&&t.push({path:h,score:QL(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 vM(l.path))o(l,c,!0,d)}),t}function vM(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=vM(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 qL(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:ZL(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var $L=/^:[\w-]+$/,YL=3,WL=2,KL=1,GL=10,XL=-2,AC=e=>e==="*";function QL(e,t){let n=e.split("/"),r=n.length;return n.some(AC)&&(r+=XL),t&&(r+=WL),n.filter(a=>!AC(a)).reduce((a,o)=>a+($L.test(o)?YL:o===""?KL:GL),r)}function ZL(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 JL(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=pc({path:f.relativePath,caseSensitive:f.caseSensitive,end:d},m),y=f.route;if(!h&&d&&n&&!r[r.length-1].route.index&&(h=pc({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},m)),!h)return null;Object.assign(a,h.params),l.push({params:a,pathname:Ji([o,h.pathname]),pathnameBase:rj(Ji([o,h.pathnameBase])),route:y}),h.pathnameBase!=="/"&&(o=Ji([o,h.pathnameBase]))}return l}function pc(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=ej(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 ej(e,t=!1,n=!0){Xn(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 xM(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Xn(!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 Si(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 tj({basename:e,pathname:t}){return t==="/"?e:Ji([e,t])}var wM=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Rx=e=>wM.test(e);function nj(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=OC(n.substring(1),"/"):o=OC(n,t)):o=t,{pathname:o,search:ij(r),hash:aj(a)}}function OC(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 Uy(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 SM(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function kx(e){let t=SM(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Mx(e,t,n,r=!1){let a;typeof e=="string"?a=Yo(e):(a={...e},Vt(!a.pathname||!a.pathname.includes("?"),Uy("?","pathname","search",a)),Vt(!a.pathname||!a.pathname.includes("#"),Uy("#","pathname","hash",a)),Vt(!a.search||!a.search.includes("#"),Uy("#","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=nj(a,c),d=l&&l!=="/"&&l.endsWith("/"),m=(o||l===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(d||m)&&(f.pathname+="/"),f}var Ji=e=>e.join("/").replace(/\/\/+/g,"/"),rj=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),ij=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,aj=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,jd=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 yd(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function _d(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var EM=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function CM(e,t){let n=e;if(typeof n!="string"||!wM.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,a=!1;if(EM)try{let o=new URL(window.location.href),l=n.startsWith("//")?new URL(o.protocol+n):new URL(n),c=Si(l.pathname,t);l.origin===o.origin&&c!=null?n=c+l.search+l.hash:a=!0}catch{Xn(!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 Lo=Symbol("Uninstrumented");function oj(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=Vl(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=Vl(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[Lo]??o,c=Vl(n[a],l,(...f)=>NC(f[0]));c&&(a==="loader"&&l.hydrate===!0&&(c.hydrate=!0),c[Lo]=l,r[a]=c)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(a=>{let o=a[Lo]??a,l=Vl(n.middleware,o,(...c)=>NC(c[0]));return l?(l[Lo]=o,l):a})),r}function sj(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[Lo]??e.navigate,a=Vl(n.navigate,r,(...o)=>{let[l,c]=o;return{to:typeof l=="number"||typeof l=="string"?l:l?na(l):".",...DC(e,c??{})}});a&&(a[Lo]=r,e.navigate=a)}if(n.fetch.length>0){let r=e.fetch[Lo]??e.fetch,a=Vl(n.fetch,r,(...o)=>{let[l,,c,f]=o;return{href:c??".",fetcherKey:l,...DC(e,f??{})}});a&&(a[Lo]=r,e.fetch=a)}return e}function Vl(e,t,n){return e.length===0?null:async(...r)=>{let a=await TM(e,n(...r),()=>t(...r),e.length-1);if(a.type==="error")throw a.value;return a.value}}async function TM(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=TM(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 NC(e){let{request:t,context:n,params:r,unstable_pattern:a}=e;return{request:lj(t),params:{...r},unstable_pattern:a,context:cj(n)}}function DC(e,t){return{currentUrl:na(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 lj(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function cj(e){if(dj(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var uj=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function dj(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")===uj}var RM=["POST","PUT","PATCH","DELETE"],fj=new Set(RM),hj=["GET",...RM],pj=new Set(hj),kM=new Set([301,302,303,307,308]),mj=new Set([307,308]),Vy={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},gj={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ou={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},yj=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),MM="remix-router-transitions",AM=Symbol("ResetLoaderData");function bj(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||yj,o=a;if(e.unstable_instrumentations){let X=e.unstable_instrumentations;o=ie=>({...a(ie),...oj(X.map(de=>de.route).filter(Boolean),ie)})}let l={},c=gd(e.routes,o,void 0,l),f,d=e.basename||"/";d.startsWith("/")||(d=`/${d}`);let m=e.dataStrategy||Ej,h={...e.future},y=null,g=new Set,w=null,C=null,T=null,S=e.hydrationData!=null,R=Co(c,e.history.location,d),k=!1,M=null,D;if(R==null&&!e.patchRoutesOnNavigation){let X=gi(404,{pathname:e.history.location.pathname}),{matches:ie,route:de}=yh(c);D=!0,R=ie,M={[de.id]:X}}else if(R&&!e.hydrationData&&Tt(R,c,e.history.location.pathname).active&&(R=null),R)if(R.some(X=>X.route.lazy))D=!1;else if(!R.some(X=>Ax(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=>!uv(ke.route,X,ie))}else D=R.every(de=>!uv(de.route,X,ie))}else{D=!1,R=[];let X=Tt(null,c,e.history.location.pathname);X.active&&X.matches&&(k=!0,R=X.matches)}let A,O={historyAction:e.history.action,location:e.history.location,matches:R,initialized:D,navigation:Vy,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",V=null,F=!1,W,j=!1,q=new Map,$=null,B=!1,_=!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}Xn(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:O.location,nextLocation:ie,historyAction:X});if(ke&&de!=null){let _e=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}),_e.then(()=>e.history.go(de))},reset(){let rt=new Map(O.blockers);rt.set(ke,Ou),te({blockers:rt})}}),V==null||V.resolve(),V=null;return}return Ae(X,ie)}),n){Hj(t,q);let X=()=>Uj(t,q);t.addEventListener("pagehide",X),$=()=>t.removeEventListener("pagehide",X)}return O.initialized||Ae("POP",O.location,{initialHydration:!0}),A}function Se(){y&&y(),$&&$(),g.clear(),W&&W.abort(),O.fetchers.forEach((X,ie)=>$e(ie)),O.blockers.forEach((X,ie)=>gt(ie))}function Pe(X){return g.add(X),()=>g.delete(X)}function te(X,ie={}){X.matches&&(X.matches=X.matches.map(_e=>{let rt=l[_e.route.id],nt=_e.route;return nt.element!==rt.element||nt.errorElement!==rt.errorElement||nt.hydrateFallbackElement!==rt.hydrateFallbackElement?{..._e,route:rt}:_e})),O={...O,...X};let de=[],ke=[];O.fetchers.forEach((_e,rt)=>{_e.state==="idle"&&(le.has(rt)?de.push(rt):ke.push(rt))}),le.forEach(_e=>{!O.fetchers.has(_e)&&!H.has(_e)&&de.push(_e)}),[...g].forEach(_e=>_e(O,{deletedFetchers:de,newErrors:X.errors??null,viewTransitionOpts:ie.viewTransitionOpts,flushSync:ie.flushSync===!0})),de.forEach(_e=>$e(_e)),ke.forEach(_e=>O.fetchers.delete(_e))}function he(X,ie,{flushSync:de}={}){var St,ht;let ke=O.actionData!=null&&O.navigation.formMethod!=null&&yr(O.navigation.formMethod)&&O.navigation.state==="loading"&&((St=X.state)==null?void 0:St._isRedirect)!==!0,_e;ie.actionData?Object.keys(ie.actionData).length>0?_e=ie.actionData:_e=null:ke?_e=O.actionData:_e=null;let rt=ie.loaderData?UC(O.loaderData,ie.loaderData,ie.matches||[],ie.errors):O.loaderData,nt=O.blockers;nt.size>0&&(nt=new Map(nt),nt.forEach((Pt,$t)=>nt.set($t,Ou)));let We=B?!1:jt(X,ie.matches||O.matches),Xe=F===!0||O.navigation.formMethod!=null&&yr(O.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 at;if(L==="POP"){let Pt=q.get(O.location.pathname);Pt&&Pt.has(X.pathname)?at={currentLocation:O.location,nextLocation:X}:q.has(X.pathname)&&(at={currentLocation:X,nextLocation:O.location})}else if(j){let Pt=q.get(O.location.pathname);Pt?Pt.add(X.pathname):(Pt=new Set([X.pathname]),q.set(O.location.pathname,Pt)),at={currentLocation:O.location,nextLocation:X}}te({...ie,actionData:_e,loaderData:rt,historyAction:L,location:X,initialized:!0,navigation:Vy,revalidation:"idle",restoreScrollPosition:We,preventScrollReset:Xe,blockers:nt},{viewTransitionOpts:at,flushSync:de===!0}),L="POP",F=!1,j=!1,B=!1,_=!1,V==null||V.resolve(),V=null,ue==null||ue.resolve(),ue=null}async function ye(X,ie){if(V==null||V.resolve(),V=null,typeof X=="number"){V||(V=YC());let $t=V.promise;return e.history.go(X),$t}let de=cv(O.location,O.matches,d,X,ie==null?void 0:ie.fromRouteId,ie==null?void 0:ie.relative),{path:ke,submission:_e,error:rt}=IC(!1,de,ie),nt=O.location,We=md(O.location,ke,ie&&ie.state);We={...We,...e.history.encodeLocation(We)};let Xe=ie&&ie.replace!=null?ie.replace:void 0,at="PUSH";Xe===!0?at="REPLACE":Xe===!1||_e!=null&&yr(_e.formMethod)&&_e.formAction===O.location.pathname+O.location.search&&(at="REPLACE");let St=ie&&"preventScrollReset"in ie?ie.preventScrollReset===!0:void 0,ht=(ie&&ie.flushSync)===!0,Pt=it({currentLocation:nt,nextLocation:We,historyAction:at});if(Pt){At(Pt,{state:"blocked",location:We,proceed(){At(Pt,{state:"proceeding",proceed:void 0,reset:void 0,location:We}),ye(X,ie)},reset(){let $t=new Map(O.blockers);$t.set(Pt,Ou),te({blockers:$t})}});return}await Ae(at,We,{submission:_e,pendingError:rt,preventScrollReset:St,replace:ie&&ie.replace,enableViewTransition:ie&&ie.viewTransition,flushSync:ht,callSiteDefaultShouldRevalidate:ie&&ie.unstable_defaultShouldRevalidate})}function Le(){ue||(ue=YC()),Te(),te({revalidation:"loading"});let X=ue.promise;return O.navigation.state==="submitting"?X:O.navigation.state==="idle"?(Ae(O.historyAction,O.location,{startUninterruptedRevalidation:!0}),X):(Ae(L||O.historyAction,O.navigation.location,{overrideNavigation:O.navigation,enableViewTransition:j===!0}),X)}async function Ae(X,ie,de){W&&W.abort(),W=null,L=X,B=(de&&de.startUninterruptedRevalidation)===!0,Rt(O.location,O.matches),F=(de&&de.preventScrollReset)===!0,j=(de&&de.enableViewTransition)===!0;let ke=f||c,_e=de&&de.overrideNavigation,rt=de!=null&&de.initialHydration&&O.matches&&O.matches.length>0&&!k?O.matches:Co(ke,ie,d),nt=(de&&de.flushSync)===!0;if(rt&&O.initialized&&!_&&Nj(O.location,ie)&&!(de&&de.submission&&yr(de.submission.formMethod))){he(ie,{matches:rt},{flushSync:nt});return}let We=Tt(rt,ke,ie.pathname);if(We.active&&We.matches&&(rt=We.matches),!rt){let{error:In,notFoundMatches:Pn,route:Zt}=ft(ie.pathname);he(ie,{matches:Pn,loaderData:{},errors:{[Zt.id]:In}},{flushSync:nt});return}W=new AbortController;let Xe=Bl(e.history,ie,W.signal,de&&de.submission),at=e.getContext?await e.getContext():new kC,St;if(de&&de.pendingError)St=[To(rt).route.id,{type:"error",error:de.pendingError}];else if(de&&de.submission&&yr(de.submission.formMethod)){let In=await Ce(Xe,ie,de.submission,rt,at,We.active,de&&de.initialHydration===!0,{replace:de.replace,flushSync:nt});if(In.shortCircuited)return;if(In.pendingActionResult){let[Pn,Zt]=In.pendingActionResult;if(Jr(Zt)&&yd(Zt.error)&&Zt.error.status===404){W=null,he(ie,{matches:In.matches,loaderData:{},errors:{[Pn]:Zt.error}});return}}rt=In.matches||rt,St=In.pendingActionResult,_e=qy(ie,de.submission),nt=!1,We.active=!1,Xe=Bl(e.history,Xe.url,Xe.signal)}let{shortCircuited:ht,matches:Pt,loaderData:$t,errors:On}=await Re(Xe,ie,rt,at,We.active,_e,de&&de.submission,de&&de.fetcherSubmission,de&&de.replace,de&&de.initialHydration===!0,nt,St,de&&de.callSiteDefaultShouldRevalidate);ht||(W=null,he(ie,{matches:Pt||rt,...VC(St),loaderData:$t,errors:On}))}async function Ce(X,ie,de,ke,_e,rt,nt,We={}){Te();let Xe=Fj(ie,de);if(te({navigation:Xe},{flushSync:We.flushSync===!0}),rt){let ht=await un(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:On}=yh(c);return{matches:$t,pendingActionResult:[On.id,{type:"error",error:ht.error}]}}let Pt=To(ht.partialMatches).route.id;return{matches:ht.partialMatches,pendingActionResult:[Pt,{type:"error",error:ht.error}]}}else if(ht.matches)ke=ht.matches;else{let{notFoundMatches:Pt,error:$t,route:On}=ft(ie.pathname);return{matches:Pt,pendingActionResult:[On.id,{type:"error",error:$t}]}}}let at,St=Yh(ke,ie);if(!St.route.action&&!St.route.lazy)at={type:"error",error:gi(405,{method:X.method,pathname:ie.pathname,routeId:St.route.id})};else{let ht=$l(o,l,X,ke,St,nt?[]:r,_e),Pt=await ut(X,ht,_e,null);if(at=Pt[St.route.id],!at){for(let $t of ke)if(Pt[$t.route.id]){at=Pt[$t.route.id];break}}if(X.signal.aborted)return{shortCircuited:!0}}if(Ts(at)){let ht;return We&&We.replace!=null?ht=We.replace:ht=FC(at.response.headers.get("Location"),new URL(X.url),d,e.history)===O.location.pathname+O.location.search,await De(X,at,!0,{submission:de,replace:ht}),{shortCircuited:!0}}if(Jr(at)){let ht=To(ke,St.route.id);return(We&&We.replace)!==!0&&(L="PUSH"),{matches:ke,pendingActionResult:[ht.route.id,at,St.route.id]}}return{matches:ke,pendingActionResult:[St.route.id,at]}}async function Re(X,ie,de,ke,_e,rt,nt,We,Xe,at,St,ht,Pt){let $t=rt||qy(ie,nt),On=nt||We||$C($t),In=!B&&!at;if(_e){if(In){let Hn=J(ht);te({navigation:$t,...Hn!==void 0?{actionData:Hn}:{}},{flushSync:St})}let Jt=await un(de,ie.pathname,X.signal);if(Jt.type==="aborted")return{shortCircuited:!0};if(Jt.type==="error"){if(Jt.partialMatches.length===0){let{matches:Mi,route:lr}=yh(c);return{matches:Mi,loaderData:{},errors:{[lr.id]:Jt.error}}}let Hn=To(Jt.partialMatches).route.id;return{matches:Jt.partialMatches,loaderData:{},errors:{[Hn]:Jt.error}}}else if(Jt.matches)de=Jt.matches;else{let{error:Hn,notFoundMatches:Mi,route:lr}=ft(ie.pathname);return{matches:Mi,loaderData:{},errors:{[lr.id]:Hn}}}}let Pn=f||c,{dsMatches:Zt,revalidatingFetchers:rr}=PC(X,ke,o,l,e.history,O,de,On,ie,at?[]:r,at===!0,_,z,le,I,G,Pn,d,e.patchRoutesOnNavigation!=null,ht,Pt);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&&Jr(ht[1])?{[ht[0]]:ht[1].error}:null,...VC(ht),...Jt?{fetchers:new Map(O.fetchers)}:{}},{flushSync:St}),{shortCircuited:!0}}if(In){let Jt={};if(!_e){Jt.navigation=$t;let Hn=J(ht);Hn!==void 0&&(Jt.actionData=Hn)}rr.length>0&&(Jt.fetchers=Ee(rr)),te(Jt,{flushSync:St})}rr.forEach(Jt=>{ze(Jt.key),Jt.controller&&H.set(Jt.key,Jt.controller)});let Ar=()=>rr.forEach(Jt=>ze(Jt.key));W&&W.signal.addEventListener("abort",Ar);let{loaderResults:Mn,fetcherResults:Ri}=await pe(Zt,rr,X,ke);if(X.signal.aborted)return{shortCircuited:!0};W&&W.signal.removeEventListener("abort",Ar),rr.forEach(Jt=>H.delete(Jt.key));let qr=bh(Mn);if(qr)return await De(X,qr.result,!0,{replace:Xe}),{shortCircuited:!0};if(qr=bh(Ri),qr)return G.add(qr.key),await De(X,qr.result,!0,{replace:Xe}),{shortCircuited:!0};let{loaderData:ki,errors:ai}=HC(O,de,Mn,ht,rr,Ri);at&&O.errors&&(ai={...O.errors,...ai});let fa=tt(),es=Ct(P),ts=fa||es||rr.length>0;return{matches:de,loaderData:ki,errors:ai,...ts?{fetchers:new Map(O.fetchers)}:{}}}function J(X){if(X&&!Jr(X[1]))return{[X[0]]:X[1].data};if(O.actionData)return Object.keys(O.actionData).length===0?null:O.actionData}function Ee(X){return X.forEach(ie=>{let de=O.fetchers.get(ie.key),ke=Nu(void 0,de?de.data:void 0);O.fetchers.set(ie.key,ke)}),new Map(O.fetchers)}async function xe(X,ie,de,ke){ze(X);let _e=(ke&&ke.flushSync)===!0,rt=f||c,nt=cv(O.location,O.matches,d,de,ie,ke==null?void 0:ke.relative),We=Co(rt,nt,d),Xe=Tt(We,rt,nt);if(Xe.active&&Xe.matches&&(We=Xe.matches),!We){fe(X,ie,gi(404,{pathname:nt}),{flushSync:_e});return}let{path:at,submission:St,error:ht}=IC(!0,nt,ke);if(ht){fe(X,ie,ht,{flushSync:_e});return}let Pt=e.getContext?await e.getContext():new kC,$t=(ke&&ke.preventScrollReset)===!0;if(St&&yr(St.formMethod)){await Be(X,ie,at,We,Pt,Xe.active,_e,$t,St,ke&&ke.unstable_defaultShouldRevalidate);return}I.set(X,{routeId:ie,path:at}),await qe(X,ie,at,We,Pt,Xe.active,_e,$t,St)}async function Be(X,ie,de,ke,_e,rt,nt,We,Xe,at){Te(),I.delete(X);let St=O.fetchers.get(X);ee(X,Bj(Xe,St),{flushSync:nt});let ht=new AbortController,Pt=Bl(e.history,de,ht.signal,Xe);if(rt){let en=await un(ke,new URL(Pt.url).pathname,Pt.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,gi(404,{pathname:de}),{flushSync:nt});return}}let $t=Yh(ke,de);if(!$t.route.action&&!$t.route.lazy){let en=gi(405,{method:Xe.formMethod,pathname:de,routeId:ie});fe(X,ie,en,{flushSync:nt});return}H.set(X,ht);let On=K,In=$l(o,l,Pt,ke,$t,r,_e),Pn=await ut(Pt,In,_e,X),Zt=Pn[$t.route.id];if(!Zt){for(let en of In)if(Pn[en.route.id]){Zt=Pn[en.route.id];break}}if(Pt.signal.aborted){H.get(X)===ht&&H.delete(X);return}if(le.has(X)){if(Ts(Zt)||Jr(Zt)){ee(X,Da(void 0));return}}else{if(Ts(Zt))if(H.delete(X),P>On){ee(X,Da(void 0));return}else return G.add(X),ee(X,Nu(Xe)),De(Pt,Zt,!1,{fetcherSubmission:Xe,preventScrollReset:We});if(Jr(Zt)){fe(X,ie,Zt.error);return}}let rr=O.navigation.location||O.location,Ar=Bl(e.history,rr,ht.signal),Mn=f||c,Ri=O.navigation.state!=="idle"?Co(Mn,O.navigation.location,d):O.matches;Vt(Ri,"Didn't find any matches after fetcher action");let qr=++K;U.set(X,qr);let ki=Nu(Xe,Zt.data);O.fetchers.set(X,ki);let{dsMatches:ai,revalidatingFetchers:fa}=PC(Ar,_e,o,l,e.history,O,Ri,Xe,rr,r,!1,_,z,le,I,G,Mn,d,e.patchRoutesOnNavigation!=null,[$t.route.id,Zt],at);fa.filter(en=>en.key!==X).forEach(en=>{let ns=en.key,rf=O.fetchers.get(ns),Bc=Nu(void 0,rf?rf.data:void 0);O.fetchers.set(ns,Bc),ze(ns),en.controller&&H.set(ns,en.controller)}),te({fetchers:new Map(O.fetchers)});let es=()=>fa.forEach(en=>ze(en.key));ht.signal.addEventListener("abort",es);let{loaderResults:ts,fetcherResults:Jt}=await pe(ai,fa,Ar,_e);if(ht.signal.aborted)return;if(ht.signal.removeEventListener("abort",es),U.delete(X),H.delete(X),fa.forEach(en=>H.delete(en.key)),O.fetchers.has(X)){let en=Da(Zt.data);O.fetchers.set(X,en)}let Hn=bh(ts);if(Hn)return De(Ar,Hn.result,!1,{preventScrollReset:We});if(Hn=bh(Jt),Hn)return G.add(Hn.key),De(Ar,Hn.result,!1,{preventScrollReset:We});let{loaderData:Mi,errors:lr}=HC(O,Ri,ts,void 0,fa,Jt);Ct(qr),O.navigation.state==="loading"&&qr>P?(Vt(L,"Expected pending action"),W&&W.abort(),he(O.navigation.location,{matches:Ri,loaderData:Mi,errors:lr,fetchers:new Map(O.fetchers)})):(te({errors:lr,loaderData:UC(O.loaderData,Mi,Ri,lr),fetchers:new Map(O.fetchers)}),_=!1)}async function qe(X,ie,de,ke,_e,rt,nt,We,Xe){let at=O.fetchers.get(X);ee(X,Nu(Xe,at?at.data:void 0),{flushSync:nt});let St=new AbortController,ht=Bl(e.history,de,St.signal);if(rt){let Zt=await un(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,gi(404,{pathname:de}),{flushSync:nt});return}}let Pt=Yh(ke,de);H.set(X,St);let $t=K,On=$l(o,l,ht,ke,Pt,r,_e),Pn=(await ut(ht,On,_e,X))[Pt.route.id];if(H.get(X)===St&&H.delete(X),!ht.signal.aborted){if(le.has(X)){ee(X,Da(void 0));return}if(Ts(Pn))if(P>$t){ee(X,Da(void 0));return}else{G.add(X),await De(ht,Pn,!1,{preventScrollReset:We});return}if(Jr(Pn)){fe(X,ie,Pn.error);return}ee(X,Da(Pn.data))}}async function De(X,ie,de,{submission:ke,fetcherSubmission:_e,preventScrollReset:rt,replace:nt}={}){de||(V==null||V.resolve(),V=null),ie.response.headers.has("X-Remix-Revalidate")&&(_=!0);let We=ie.response.headers.get("Location");Vt(We,"Expected a Location header on the redirect Response"),We=FC(We,new URL(X.url),d,e.history);let Xe=md(O.location,We,{_isRedirect:!0});if(n){let On=!1;if(ie.response.headers.has("X-Remix-Reload-Document"))On=!0;else if(Rx(We)){const In=yM(We,!0);On=In.origin!==t.location.origin||Si(In.pathname,d)==null}if(On){nt?t.location.replace(We):t.location.assign(We);return}}W=null;let at=nt===!0||ie.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:St,formAction:ht,formEncType:Pt}=O.navigation;!ke&&!_e&&St&&ht&&Pt&&(ke=$C(O.navigation));let $t=ke||_e;if(mj.has(ie.response.status)&&$t&&yr($t.formMethod))await Ae(at,Xe,{submission:{...$t,formAction:We},preventScrollReset:rt||F,enableViewTransition:de?j:void 0});else{let On=qy(Xe,ke);await Ae(at,Xe,{overrideNavigation:On,fetcherSubmission:_e,preventScrollReset:rt||F,enableViewTransition:de?j:void 0})}}async function ut(X,ie,de,ke){var nt;let _e,rt={};try{_e=await Tj(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=_e[We.route.id])==null?void 0:nt.type)==="error")break;!_e.hasOwnProperty(We.route.id)&&!O.loaderData.hasOwnProperty(We.route.id)&&(!O.errors||!O.errors.hasOwnProperty(We.route.id))&&We.shouldCallHandler()&&(_e[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(_e))if(Lj(Xe)){let at=Xe.result;rt[We]={type:"redirect",response:Aj(at,X,We,ie,d)}}else rt[We]=await Mj(Xe);return rt}async function pe(X,ie,de,ke){let _e=ut(de,X,ke,null),rt=Promise.all(ie.map(async Xe=>{if(Xe.matches&&Xe.match&&Xe.request&&Xe.controller){let St=(await ut(Xe.request,Xe.matches,ke,Xe.key))[Xe.match.route.id];return{[Xe.key]:St}}else return Promise.resolve({[Xe.key]:{type:"error",error:gi(404,{pathname:Xe.path})}})})),nt=await _e,We=(await rt).reduce((Xe,at)=>Object.assign(Xe,at),{});return{loaderResults:nt,fetcherResults:We}}function Te(){_=!0,I.forEach((X,ie)=>{H.has(ie)&&z.add(ie),ze(ie)})}function ee(X,ie,de={}){O.fetchers.set(X,ie),te({fetchers:new Map(O.fetchers)},{flushSync:(de&&de.flushSync)===!0})}function fe(X,ie,de,ke={}){let _e=To(O.matches,ie);$e(X),te({errors:{[_e.route.id]:de},fetchers:new Map(O.fetchers)},{flushSync:(ke&&ke.flushSync)===!0})}function Oe(X){return Q.set(X,(Q.get(X)||0)+1),le.has(X)&&le.delete(X),O.fetchers.get(X)||gj}function He(X,ie){ze(X,ie==null?void 0:ie.reason),ee(X,Da(null))}function $e(X){let ie=O.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),O.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(O.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=Oe(ie),ke=Da(de.data);O.fetchers.set(ie,ke)}}function tt(){let X=[],ie=!1;for(let de of G){let ke=O.fetchers.get(de);Vt(ke,`Expected fetcher: ${de}`),ke.state==="loading"&&(G.delete(de),X.push(de),ie=!0)}return Ze(X),ie}function Ct(X){let ie=[];for(let[de,ke]of U)if(ke<X){let _e=O.fetchers.get(de);Vt(_e,`Expected fetcher: ${de}`),_e.state==="loading"&&(ze(de),U.delete(de),ie.push(de))}return Ze(ie),ie.length>0}function zt(X,ie){let de=O.blockers.get(X)||Ou;return ae.get(X)!==ie&&ae.set(X,ie),de}function gt(X){O.blockers.delete(X),ae.delete(X)}function At(X,ie){let de=O.blockers.get(X)||Ou;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(O.blockers);ke.set(X,ie),te({blockers:ke})}function it({currentLocation:X,nextLocation:ie,historyAction:de}){if(ae.size===0)return;ae.size>1&&Xn(!1,"A router only supports one blocker at a time");let ke=Array.from(ae.entries()),[_e,rt]=ke[ke.length-1],nt=O.blockers.get(_e);if(!(nt&&nt.state==="proceeding")&&rt({currentLocation:X,nextLocation:ie,historyAction:de}))return _e}function ft(X){let ie=gi(404,{pathname:X}),de=f||c,{matches:ke,route:_e}=yh(de);return{notFoundMatches:ke,route:_e,error:ie}}function yt(X,ie,de){if(w=X,T=ie,C=de||null,!S&&O.navigation===Vy){S=!0;let ke=jt(O.location,O.matches);ke!=null&&te({restoreScrollPosition:ke})}return()=>{w=null,T=null,C=null}}function Ke(X,ie){return C&&C(X,ie.map(ke=>VL(ke,O.loaderData)))||X.key}function Rt(X,ie){if(w&&T){let de=Ke(X,ie);w[de]=T()}}function jt(X,ie){if(w){let de=Ke(X,ie),ke=w[de];if(typeof ke=="number")return ke}return null}function Tt(X,ie,de){if(e.patchRoutesOnNavigation)if(X){if(Object.keys(X[0].params).length>0)return{active:!0,matches:Wu(ie,de,d,!0)}}else return{active:!0,matches:Wu(ie,de,d,!0)||[]};return{active:!1,matches:null}}async function un(X,ie,de,ke){if(!e.patchRoutesOnNavigation)return{type:"success",matches:X};let _e=X;for(;;){let rt=f==null,nt=f||c,We=l;try{await e.patchRoutesOnNavigation({signal:de,path:ie,matches:_e,fetcherKey:ke,patch:(St,ht)=>{de.aborted||LC(St,ht,nt,We,o,!1)}})}catch(St){return{type:"error",error:St,partialMatches:_e}}finally{rt&&!de.aborted&&(c=[...c])}if(de.aborted)return{type:"aborted"};let Xe=Co(nt,ie,d),at=null;if(Xe){if(Object.keys(Xe[0].params).length===0)return{type:"success",matches:Xe};if(at=Wu(nt,ie,d,!0),!(at&&_e.length<at.length&&Ht(_e,at.slice(0,_e.length))))return{type:"success",matches:Xe}}if(at||(at=Wu(nt,ie,d,!0)),!at||Ht(_e,at))return{type:"success",matches:null};_e=at}}function Ht(X,ie){return X.length===ie.length&&X.every((de,ke)=>de.route.id===ie[ke].route.id)}function Je(X){l={},f=gd(X,o,void 0,l)}function kt(X,ie,de=!1){let ke=f==null;LC(X,ie,f||c,l,o,de),ke&&(c=[...c],te({}))}return A={get basename(){return d},get future(){return h},get state(){return O},get routes(){return c},get window(){return t},initialize:ve,subscribe:Pe,enableScrollRestoration:yt,navigate:ye,fetch:xe,revalidate:Le,createHref:X=>e.history.createHref(X),encodeLocation:X=>e.history.encodeLocation(X),getFetcher:Oe,resetFetcher:He,deleteFetcher:et,dispose:Se,getBlocker:zt,deleteBlocker:gt,patchRoutes:kt,_internalFetchControllers:H,_internalSetRoutes:Je,_internalSetStateDoNotUseOrYouWillBreakYourApp(X){te(X)}},e.unstable_instrumentations&&(A=sj(A,e.unstable_instrumentations.map(X=>X.router).filter(Boolean))),A}function vj(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function cv(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=Mx(r||".",kx(l),Si(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=Nx(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=tj({basename:n,pathname:f.pathname})),na(f)}function IC(e,t,n){if(!n||!vj(n))return{path:t};if(n.formMethod&&!zj(n.formMethod))return{path:t,error:gi(405,{method:n.formMethod})};let r=()=>({path:t,error:gi(400,{type:"invalid-body"})}),o=(n.formMethod||"get").toUpperCase(),l=LM(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=fv(n.formData),f=n.formData;else if(n.body instanceof FormData)c=fv(n.body),f=n.body;else if(n.body instanceof URLSearchParams)c=n.body,f=BC(c);else if(n.body==null)c=new URLSearchParams,f=new FormData;else try{c=new URLSearchParams(n.body),f=BC(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&&Nx(m.search)&&c.append("index",""),m.search=`?${c}`,{path:na(m),submission:d}}function PC(e,t,n,r,a,o,l,c,f,d,m,h,y,g,w,C,T,S,R,k,M){var B;let D=k?Jr(k[1])?k[1].error:k[1].data:void 0,A=a.createURL(o.location),O=a.createURL(f),L;if(m&&o.errors){let _=Object.keys(o.errors)[0];L=l.findIndex(z=>z.route.id===_)}else if(k&&Jr(k[1])){let _=k[0];L=l.findIndex(z=>z.route.id===_)-1}let V=k?k[1].statusCode:void 0,F=V&&V>=400,W={currentUrl:A,currentParams:((B=o.matches[0])==null?void 0:B.params)||{},nextUrl:O,nextParams:l[0].params,...c,actionResult:D,actionStatus:V},j=_d(l),q=l.map((_,z)=>{let{route:H}=_,K=null;if(L!=null&&z>L?K=!1:H.lazy?K=!0:Ax(H)?m?K=uv(H,o.loaderData,o.errors):xj(o.loaderData,o.matches[z],_)&&(K=!0):K=!1,K!==null)return dv(n,r,e,j,_,d,t,K);let P=!1;typeof M=="boolean"?P=M:F?P=!1:(h||A.pathname+A.search===O.pathname+O.search||A.search!==O.search||wj(o.matches[z],_))&&(P=!0);let U={...W,defaultShouldRevalidate:P},G=Qu(_,U);return dv(n,r,e,j,_,d,t,G,U,M)}),$=[];return w.forEach((_,z)=>{if(m||!l.some(le=>le.route.id===_.routeId)||g.has(z))return;let H=o.fetchers.get(z),K=H&&H.state!=="idle"&&H.data===void 0,P=Co(T,_.path,S);if(!P){if(R&&K)return;$.push({key:z,routeId:_.routeId,path:_.path,matches:null,match:null,request:null,controller:null});return}if(C.has(z))return;let U=Yh(P,_.path),G=new AbortController,I=Bl(a,_.path,G.signal),Q=null;if(y.has(z))y.delete(z),Q=$l(n,r,I,P,U,d,t);else if(K)h&&(Q=$l(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};Qu(U,ae)&&(Q=$l(n,r,I,P,U,d,t,ae))}Q&&$.push({key:z,routeId:_.routeId,path:_.path,matches:Q,match:U,request:I,controller:G})}),{dsMatches:q,revalidatingFetchers:$}}function Ax(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function uv(e,t,n){if(e.lazy)return!0;if(!Ax(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 xj(e,t,n){let r=!t||n.route.id!==t.route.id,a=!e.hasOwnProperty(n.route.id);return r||a}function wj(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Qu(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function LC(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=>OM(d,h));m?f.push({existingRoute:m,newRoute:d}):c.push(d)}),c.length>0){let d=gd(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]=gd([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 OM(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=>OM(n,o))}):!1}var jC=new WeakMap,NM=({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=jC.get(a);l||(l={},jC.set(a,l));let c=l[e];if(c)return c;let f=(async()=>{let d=FL(e),h=a[e]!==void 0&&e!=="hasErrorBoundary";if(d)Xn(!d,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),l[e]=Promise.resolve();else if(h)Xn(!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},_C=new WeakMap;function Sj(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=_C.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=HL(w),R=o[w]!==void 0&&w!=="hasErrorBoundary";T?Xn(!T,"Route property "+w+" is not a supported property to be returned from a lazy route function. This property will be ignored."):R?Xn(!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 _C.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=NM({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 zC(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 Ej(e){return e.matches.some(t=>t.route.middleware)?DM(e,()=>zC(e)):zC(e)}function DM(e,t){return Cj(e,t,r=>{if(_j(r))throw r;return r},Ij,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=To(l,l[c].route.id).route.id;return Promise.resolve({[f]:{type:"error",result:r}})}}}async function Cj(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 IM({request:l,params:c,context:f,unstable_pattern:d},m,t,n,r,a)}async function IM(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 IM(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 PM(e,t,n,r,a){let o=NM({key:"middleware",route:r.route,manifest:t,mapRouteProperties:e}),l=Sj(r.route,yr(n.method)?"action":"loader",t,e,a);return{middleware:o,route:l.lazyRoutePromise,handler:l.lazyHandlerPromise}}function dv(e,t,n,r,a,o,l,c,f=null,d){let m=!1,h=PM(e,t,n,a,o);return{...a,_lazyPromises:h,shouldLoad:c,shouldRevalidateArgs:f,shouldCallHandler(y){return m=!0,f?typeof d=="boolean"?Qu(a,{...f,defaultShouldRevalidate:d}):typeof y=="boolean"?Qu(a,{...f,defaultShouldRevalidate:y}):Qu(a,f):c},resolve(y){let{lazy:g,loader:w,middleware:C}=a.route,T=m||c||y&&!yr(n.method)&&(g||w),S=C&&C.length>0&&!w&&!g;return T&&(yr(n.method)||!S)?Rj({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 $l(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:PM(e,t,n,f,o),resolve:()=>Promise.resolve({type:"data",result:void 0})}:dv(e,t,n,_d(r),f,o,l,!0,c))}async function Tj(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:_d(n),params:n[0].params,context:a,matches:n},f=await e({...l,fetcherKey:r,runClientMiddleware:d=>{let m=l;return DM(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 Rj({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((S,R)=>g=R);f=()=>g(),e.signal.addEventListener("abort",f);let C=S=>typeof y!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${m}" [routeId: ${n.route.id}]`)):y({request:e,unstable_pattern:t,params:n.params,context:l},...S!==void 0?[S]:[]),T=(async()=>{try{return{type:"data",result:await(o?o(R=>C(R)):C())}}catch(S){return{type:"error",result:S}}})();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 gi(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 gi(404,{pathname:w})}}catch(y){return{type:"error",result:y}}finally{f&&e.signal.removeEventListener("abort",f)}return c}async function kj(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 Mj(e){var r,a,o,l,c;let{result:t,type:n}=e;if(Ox(t)){let f;try{f=await kj(t)}catch(d){return{type:"error",error:d}}return n==="error"?{type:"error",error:new jd(t.status,t.statusText,f),statusCode:t.status,headers:t.headers}:{type:"data",data:f,statusCode:t.status,headers:t.headers}}return n==="error"?qC(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:Dj(t),statusCode:yd(t)?t.status:void 0,headers:(o=t.init)!=null&&o.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:yd(t)?t.status:void 0}:qC(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 Aj(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"),!Rx(o)){let l=r.slice(0,r.findIndex(c=>c.route.id===n)+1);o=cv(new URL(t.url),l,a,o),e.headers.set("Location",o)}return e}function FC(e,t,n,r){let a=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(Rx(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=Si(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 Bl(e,t,n,r){let a=e.createURL(LM(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=fv(r.formData):o.body=r.formData}return new Request(a,o)}function fv(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function BC(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function Oj(e,t,n,r=!1,a=!1){let o={},l=null,c,f=!1,d={},m=n&&Jr(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"),Jr(g)){let w=g.error;if(m!==void 0&&(w=m,m=void 0),l=l||{},a)l[y]=w;else{let C=To(e,y);l[C.route.id]==null&&(l[C.route.id]=w)}r||(o[y]=AM),f||(f=!0,c=yd(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 HC(e,t,n,r,a,o){let{loaderData:l,errors:c}=Oj(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"),Jr(y)){let g=To(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=Da(y.data);e.fetchers.set(d,g)}}),{loaderData:l,errors:c}}function UC(e,t,n,r){let a=Object.entries(t).filter(([,o])=>o!==AM).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 VC(e){return e?Jr(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function To(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 yh(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 gi(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 jd(e||500,l,new Error(c),!0)}function bh(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 LM(e){let t=typeof e=="string"?Yo(e):e;return na({...t,hash:""})}function Nj(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function Dj(e){var t,n;return new jd(((t=e.init)==null?void 0:t.status)??500,((n=e.init)==null?void 0:n.statusText)??"Internal Server Error",e.data)}function Ij(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&Pj(n))}function Pj(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function Lj(e){return Ox(e.result)&&kM.has(e.result.status)}function Jr(e){return e.type==="error"}function Ts(e){return(e&&e.type)==="redirect"}function qC(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function Ox(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function jj(e){return kM.has(e)}function _j(e){return Ox(e)&&jj(e.status)&&e.headers.has("Location")}function zj(e){return pj.has(e.toUpperCase())}function yr(e){return fj.has(e.toUpperCase())}function Nx(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Yh(e,t){let n=typeof t=="string"?Yo(t).search:t.search;if(e[e.length-1].route.index&&Nx(n||""))return e[e.length-1];let r=SM(e);return r[r.length-1]}function $C(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 qy(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 Fj(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 Nu(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 Bj(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 Da(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 Hj(e,t){try{let n=e.sessionStorage.getItem(MM);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 Uj(e,t){if(t.size>0){let n={};for(let[r,a]of t)n[r]=[...a];try{e.sessionStorage.setItem(MM,JSON.stringify(n))}catch(r){Xn(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function YC(){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 Zs=v.createContext(null);Zs.displayName="DataRouter";var zd=v.createContext(null);zd.displayName="DataRouterState";var jM=v.createContext(!1);function Vj(){return v.useContext(jM)}var Dx=v.createContext({isTransitioning:!1});Dx.displayName="ViewTransition";var _M=v.createContext(new Map);_M.displayName="Fetchers";var qj=v.createContext(null);qj.displayName="Await";var Ci=v.createContext(null);Ci.displayName="Navigation";var Hp=v.createContext(null);Hp.displayName="Location";var Bi=v.createContext({outlet:null,matches:[],isDataRoute:!1});Bi.displayName="Route";var Ix=v.createContext(null);Ix.displayName="RouteError";var zM="REACT_ROUTER_ERROR",$j="REDIRECT",Yj="ROUTE_ERROR_RESPONSE";function Wj(e){if(e.startsWith(`${zM}:${$j}:{`))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 Kj(e){if(e.startsWith(`${zM}:${Yj}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new jd(t.status,t.statusText,t.data)}catch{}}function Gj(e,{relative:t}={}){Vt(Rc(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=v.useContext(Ci),{hash:a,pathname:o,search:l}=Fd(e,{relative:t}),c=o;return n!=="/"&&(c=o==="/"?n:Ji([n,o])),r.createHref({pathname:c,search:l,hash:a})}function Rc(){return v.useContext(Hp)!=null}function sa(){return Vt(Rc(),"useLocation() may be used only in the context of a <Router> component."),v.useContext(Hp).location}function Xj(e){Vt(Rc(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:t}=sa();return v.useMemo(()=>pc(e,xM(t)),[t,e])}var FM="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function BM(e){v.useContext(Ci).static||v.useLayoutEffect(e)}function Px(){let{isDataRoute:e}=v.useContext(Bi);return e?f_():Qj()}function Qj(){Vt(Rc(),"useNavigate() may be used only in the context of a <Router> component.");let e=v.useContext(Zs),{basename:t,navigator:n}=v.useContext(Ci),{matches:r}=v.useContext(Bi),{pathname:a}=sa(),o=JSON.stringify(kx(r)),l=v.useRef(!1);return BM(()=>{l.current=!0}),v.useCallback((f,d={})=>{if(Xn(l.current,FM),!l.current)return;if(typeof f=="number"){n.go(f);return}let m=Mx(f,JSON.parse(o),a,d.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:Ji([t,m.pathname])),(d.replace?n.replace:n.push)(m,d.state,d)},[t,n,o,a,e])}var Zj=v.createContext(null);function Jj(e){let t=v.useContext(Bi).outlet;return v.useMemo(()=>t&&v.createElement(Zj.Provider,{value:e},t),[t,e])}function e_(){let{matches:e}=v.useContext(Bi),t=e[e.length-1];return t?t.params:{}}function Fd(e,{relative:t}={}){let{matches:n}=v.useContext(Bi),{pathname:r}=sa(),a=JSON.stringify(kx(n));return v.useMemo(()=>Mx(e,JSON.parse(a),r,t==="path"),[e,a,r,t])}function t_(e,t,n,r,a){Vt(Rc(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=v.useContext(Ci),{matches:l}=v.useContext(Bi),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||"";UM(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=sa(),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=Co(e,{pathname:C});return Xn(h||T!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),Xn(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.`),o_(T&&T.map(R=>Object.assign({},R,{params:Object.assign({},f,R.params),pathname:Ji([m,o.encodeLocation?o.encodeLocation(R.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathname]),pathnameBase:R.pathnameBase==="/"?m:Ji([m,o.encodeLocation?o.encodeLocation(R.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathnameBase])})),l,n,r,a)}function n_(){let e=d_(),t=yd(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 r_=v.createElement(n_,null),HM=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=Kj(e.digest);n&&(e=n)}let t=e!==void 0?v.createElement(Bi.Provider,{value:this.props.routeContext},v.createElement(Ix.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?v.createElement(i_,{error:e},t):t}};HM.contextType=jM;var $y=new WeakMap;function i_({children:e,error:t}){let{basename:n}=v.useContext(Ci);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=Wj(t.digest);if(r){let a=$y.get(t);if(a)throw a;let o=CM(r.location,n);if(EM&&!$y.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 $y.set(t,l),l}return v.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function a_({routeContext:e,match:t,children:n}){let r=v.useContext(Zs);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),v.createElement(Bi.Provider,{value:e},n)}function o_(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:_d(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||r_,c&&(f<0&&y===0?(UM("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 S=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(a_,{match:h,routeContext:{outlet:m,matches:S,isDataRoute:n!=null},children:k})};return n&&(h.route.ErrorBoundary||h.route.errorElement||y===0)?v.createElement(HM,{location:n.location,revalidation:n.revalidation,component:C,error:g,children:R(),routeContext:{outlet:null,matches:S,isDataRoute:!0},onError:d}):R()},null)}function Lx(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function s_(e){let t=v.useContext(Zs);return Vt(t,Lx(e)),t}function l_(e){let t=v.useContext(zd);return Vt(t,Lx(e)),t}function c_(e){let t=v.useContext(Bi);return Vt(t,Lx(e)),t}function jx(e){let t=c_(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 u_(){return jx("useRouteId")}function d_(){var r;let e=v.useContext(Ix),t=l_("useRouteError"),n=jx("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function f_(){let{router:e}=s_("useNavigate"),t=jx("useNavigate"),n=v.useRef(!1);return BM(()=>{n.current=!0}),v.useCallback(async(a,o={})=>{Xn(n.current,FM),n.current&&(typeof a=="number"?await e.navigate(a):await e.navigate(a,{fromRouteId:t,...o}))},[e,t])}var WC={};function UM(e,t,n){!t&&!WC[e]&&(WC[e]=!0,Xn(!1,n))}var KC={};function GC(e,t){!e&&!KC[t]&&(KC[t]=!0,console.warn(t))}var h_="useOptimistic",XC=Tx[h_],p_=()=>{};function m_(e){return XC?XC(e):[e,p_]}function g_(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&Xn(!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&&Xn(!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&&Xn(!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 y_=["HydrateFallback","hydrateFallbackElement"],b_=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 v_({router:e,flushSync:t,onError:n,unstable_useTransitions:r}){r=Vj()||r;let[o,l]=v.useState(e.state),[c,f]=m_(o),[d,m]=v.useState(),[h,y]=v.useState({isTransitioning:!1}),[g,w]=v.useState(),[C,T]=v.useState(),[S,R]=v.useState(),k=v.useRef(new Map),M=v.useCallback((L,{deletedFetchers:V,newErrors:F,flushSync:W,viewTransitionOpts:j})=>{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:_d(L.matches)})}),L.fetchers.forEach(($,B)=>{$.data!==void 0&&k.current.set(B,$.data)}),V.forEach($=>k.current.delete($)),GC(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 q=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(GC(j==null||q,"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."),!j||!q){t&&W?t(()=>l(L)):r===!1?l(L):v.startTransition(()=>{r===!0&&f($=>QC($,L)),l(L)});return}if(t&&W){t(()=>{C&&(g==null||g.resolve(),C.skipTransition()),y({isTransitioning:!0,flushSync:!0,currentLocation:j.currentLocation,nextLocation:j.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:j.currentLocation,nextLocation:j.nextLocation})):(m(L),y({isTransitioning:!0,flushSync:!1,currentLocation:j.currentLocation,nextLocation:j.nextLocation}))},[e.window,t,C,g,r,f,n]);v.useLayoutEffect(()=>e.subscribe(M),[e,M]),v.useEffect(()=>{h.isTransitioning&&!h.flushSync&&w(new b_)},[h]),v.useEffect(()=>{if(g&&d&&e.window){let L=d,V=g.promise,F=e.window.document.startViewTransition(async()=>{r===!1?l(L):v.startTransition(()=>{r===!0&&f(W=>QC(W,L)),l(L)}),await V});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&&S&&(m(S.state),y({isTransitioning:!0,flushSync:!1,currentLocation:S.currentLocation,nextLocation:S.nextLocation}),R(void 0))},[h.isTransitioning,S]);let D=v.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:L=>e.navigate(L),push:(L,V,F)=>e.navigate(L,{state:V,preventScrollReset:F==null?void 0:F.preventScrollReset}),replace:(L,V,F)=>e.navigate(L,{replace:!0,state:V,preventScrollReset:F==null?void 0:F.preventScrollReset})}),[e]),A=e.basename||"/",O=v.useMemo(()=>({router:e,navigator:D,static:!1,basename:A,onError:n}),[e,D,A,n]);return v.createElement(v.Fragment,null,v.createElement(Zs.Provider,{value:O},v.createElement(zd.Provider,{value:c},v.createElement(_M.Provider,{value:k.current},v.createElement(Dx.Provider,{value:h},v.createElement(E_,{basename:A,location:c.location,navigationType:c.historyAction,navigator:D,unstable_useTransitions:r},v.createElement(x_,{routes:e.routes,future:e.future,state:c,onError:n})))))),null)}function QC(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 x_=v.memo(w_);function w_({routes:e,future:t,state:n,onError:r}){return t_(e,void 0,n,r,t)}function S_(e){return Jj(e.context)}function E_({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:a,static:o=!1,unstable_useTransitions:l}){Vt(!Rc(),"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=Si(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 Xn(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(Ci.Provider,{value:f},v.createElement(Hp.Provider,{children:t,value:w}))}var Wh="get",Kh="application/x-www-form-urlencoded";function Up(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function C_(e){return Up(e)&&e.tagName.toLowerCase()==="button"}function T_(e){return Up(e)&&e.tagName.toLowerCase()==="form"}function R_(e){return Up(e)&&e.tagName.toLowerCase()==="input"}function k_(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function M_(e,t){return e.button===0&&(!t||t==="_self")&&!k_(e)}var vh=null;function A_(){if(vh===null)try{new FormData(document.createElement("form"),0),vh=!1}catch{vh=!0}return vh}var O_=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Yy(e){return e!=null&&!O_.has(e)?(Xn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Kh}"`),null):e}function N_(e,t){let n,r,a,o,l;if(T_(e)){let c=e.getAttribute("action");r=c?Si(c,t):null,n=e.getAttribute("method")||Wh,a=Yy(e.getAttribute("enctype"))||Kh,o=new FormData(e)}else if(C_(e)||R_(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?Si(f,t):null,n=e.getAttribute("formmethod")||c.getAttribute("method")||Wh,a=Yy(e.getAttribute("formenctype"))||Yy(c.getAttribute("enctype"))||Kh,o=new FormData(c,e),!A_()){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(Up(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Wh,r=null,a=Kh,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 D_(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&&Si(a.pathname,t)==="/"?a.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:a.pathname=`${a.pathname.replace(/\/$/,"")}.${r}`,a}async function I_(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 P_(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 L_(e,t,n){let r=await Promise.all(e.map(async a=>{let o=t.routes[a.route.id];if(o){let l=await I_(o,n);return l.links?l.links():[]}return[]}));return F_(r.flat(1).filter(P_).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function ZC(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 j_(e,t,{includeHydrateFallback:n}={}){return __(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 __(e){return[...new Set(e)]}function z_(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function F_(e,t){let n=new Set;return new Set(t),e.reduce((r,a)=>{let o=JSON.stringify(z_(a));return n.has(o)||(n.add(o),r.push({key:o,link:a})),r},[])}function VM(){let e=v.useContext(Zs);return _x(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function B_(){let e=v.useContext(zd);return _x(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var zx=v.createContext(void 0);zx.displayName="FrameworkContext";function qM(){let e=v.useContext(zx);return _x(e,"You must render this element inside a <HydratedRouter> element"),e}function H_(e,t){let n=v.useContext(zx),[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=S=>{S.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:Du(c,g),onBlur:Du(f,w),onMouseEnter:Du(d,g),onMouseLeave:Du(m,w),onTouchStart:Du(h,g)}]:[!1,y,{}]}function Du(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function U_({page:e,...t}){let{router:n}=VM(),r=v.useMemo(()=>Co(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?v.createElement(q_,{page:e,matches:r,...t}):null}function V_(e){let{manifest:t,routeModules:n}=qM(),[r,a]=v.useState([]);return v.useEffect(()=>{let o=!1;return L_(e,t,n).then(l=>{o||a(l)}),()=>{o=!0}},[e,t,n]),r}function q_({page:e,matches:t,...n}){let r=sa(),{future:a,manifest:o,routeModules:l}=qM(),{basename:c}=VM(),{loaderData:f,matches:d}=B_(),m=v.useMemo(()=>ZC(e,t,d,o,r,"data"),[e,t,d,o,r]),h=v.useMemo(()=>ZC(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 S=D_(e,c,a.unstable_trailingSlashAwareDataRequests,"data");return T&&C.size>0&&S.searchParams.set("_routes",t.filter(R=>C.has(R.route.id)).map(R=>R.route.id).join(",")),[S.pathname+S.search]},[c,a.unstable_trailingSlashAwareDataRequests,f,r,o,m,t,e,l]),g=v.useMemo(()=>j_(h,o),[h,o]),w=V_(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 $_(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var Y_=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Y_&&(window.__reactRouterVersion="7.13.0")}catch{}function W_(e,t){return bj({basename:t==null?void 0:t.basename,getContext:t==null?void 0:t.getContext,future:t==null?void 0:t.future,history:LL({window:t==null?void 0:t.window}),hydrationData:K_(),routes:e,mapRouteProperties:g_,hydrationRouteProperties:y_,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 K_(){let e=window==null?void 0:window.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:G_(e.errors)}),e}function G_(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 jd(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 $M=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Fx=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(Ci),S=typeof d=="string"&&$M.test(d),R=CM(d,C);d=R.to;let k=Gj(d,{relative:a}),[M,D,A]=H_(r,g),O=J_(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||O(F)}let V=v.createElement("a",{...g,...A,href:R.absoluteURL||k,onClick:R.isExternal||o?t:L,ref:$_(w,D),target:f,"data-discover":!S&&n==="render"?"true":void 0});return M&&!S?v.createElement(v.Fragment,null,V,v.createElement(U_,{page:k})):V});Fx.displayName="Link";var X_=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=Fd(l,{relative:d.relative}),y=sa(),g=v.useContext(zd),{navigator:w,basename:C}=v.useContext(Ci),T=g!=null&&iz(h)&&c===!0,S=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,S=S.toLowerCase()),k&&C&&(k=Si(k,C)||k);const M=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let D=R===S||!a&&R.startsWith(S)&&R.charAt(M)==="/",A=k!=null&&(k===S||!a&&k.startsWith(S)&&k.charAt(S.length)==="/"),O={isActive:D,isPending:A,isTransitioning:T},L=D?t:void 0,V;typeof r=="function"?V=r(O):V=[r,D?"active":null,A?"pending":null,T?"transitioning":null].filter(Boolean).join(" ");let F=typeof o=="function"?o(O):o;return v.createElement(Fx,{...d,"aria-current":L,className:V,ref:m,style:F,to:l,viewTransition:c},typeof f=="function"?f(O):f)});X_.displayName="NavLink";var Q_=v.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:a,state:o,method:l=Wh,action:c,onSubmit:f,relative:d,preventScrollReset:m,viewTransition:h,unstable_defaultShouldRevalidate:y,...g},w)=>{let{unstable_useTransitions:C}=v.useContext(Ci),T=nz(),S=rz(c,{relative:d}),R=l.toLowerCase()==="get"?"get":"post",k=typeof c=="string"&&$M.test(c),M=D=>{if(f&&f(D),D.defaultPrevented)return;D.preventDefault();let A=D.nativeEvent.submitter,O=(A==null?void 0:A.getAttribute("formmethod"))||l,L=()=>T(A||D.currentTarget,{fetcherKey:t,method:O,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:S,onSubmit:r?f:M,...g,"data-discover":!k&&e==="render"?"true":void 0})});Q_.displayName="Form";function Z_(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function YM(e){let t=v.useContext(Zs);return Vt(t,Z_(e)),t}function J_(e,{target:t,replace:n,state:r,preventScrollReset:a,relative:o,viewTransition:l,unstable_defaultShouldRevalidate:c,unstable_useTransitions:f}={}){let d=Px(),m=sa(),h=Fd(e,{relative:o});return v.useCallback(y=>{if(M_(y,t)){y.preventDefault();let g=n!==void 0?n:na(m)===na(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 ez=0,tz=()=>`__${String(++ez)}__`;function nz(){let{router:e}=YM("useSubmit"),{basename:t}=v.useContext(Ci),n=u_(),r=e.fetch,a=e.navigate;return v.useCallback(async(o,l={})=>{let{action:c,method:f,encType:d,formData:m,body:h}=N_(o,t);if(l.navigate===!1){let y=l.fetcherKey||tz();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 rz(e,{relative:t}={}){let{basename:n}=v.useContext(Ci),r=v.useContext(Bi);Vt(r,"useFormAction must be used inside a RouteContext");let[a]=r.matches.slice(-1),o={...Fd(e||".",{relative:t})},l=sa();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:Ji([n,o.pathname])),na(o)}function iz(e,{relative:t}={}){let n=v.useContext(Dx);Vt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=YM("useViewTransitionState"),a=Fd(e,{relative:t});if(!n.isTransitioning)return!1;let o=Si(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=Si(n.nextLocation.pathname,r)||n.nextLocation.pathname;return pc(a.pathname,l)!=null||pc(a.pathname,o)!=null}var pr=mM();const az=Bp(pr);function oz(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 sz=e=>{switch(e){case"success":return uz;case"info":return fz;case"warning":return dz;case"error":return hz;default:return null}},lz=Array(12).fill(0),cz=({visible:e,className:t})=>Fe.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Fe.createElement("div",{className:"sonner-spinner"},lz.map((n,r)=>Fe.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),uz=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"})),dz=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"})),fz=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"})),hz=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"})),pz=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"})),mz=()=>{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 hv=1;class gz{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:hv++,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(bz(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)||hv++;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 gz,yz=(e,t)=>{const n=(t==null?void 0:t.id)||hv++;return Fr.addToast({title:e,...t,id:n}),n},bz=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",vz=yz,xz=()=>Fr.toasts,wz=()=>Fr.getActiveToasts(),mn=Object.assign(vz,{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:xz,getToasts:wz});oz("[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 xh(e){return e.label!==void 0}const Sz=3,Ez="24px",Cz="16px",JC=4e3,Tz=356,Rz=14,kz=45,Mz=200;function Yi(...e){return e.filter(Boolean).join(" ")}function Az(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const Oz=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:S,toasts:R,expanded:k,removeToast:M,defaultRichColors:D,closeButton:A,style:O,cancelButtonStyle:L,actionButtonStyle:V,className:F="",descriptionClassName:W="",duration:j,position:q,gap:$,expandByDefault:B,classNames:_,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),[Pe,te]=Fe.useState(!1),[he,ye]=Fe.useState(0),[Le,Ae]=Fe.useState(0),Ce=Fe.useRef(h.duration||j||JC),Re=Fe.useRef(null),J=Fe.useRef(null),Ee=S===0,xe=S+1<=C,Be=h.type,qe=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:A},[h.closeButton,A]),ee=Fe.useMemo(()=>h.duration||j||JC,[h.duration,j]),fe=Fe.useRef(0),Oe=Fe.useRef(0),He=Fe.useRef(0),$e=Fe.useRef(null),[et,ze]=q.split("-"),Ze=Fe.useMemo(()=>T.reduce((Ke,Rt,jt)=>jt>=pe?Ke:Ke+Rt.height,0),[T,pe]),tt=mz(),Ct=h.invert||m,zt=Be==="loading";Oe.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 Rt=Ke.getBoundingClientRect().height;return Ae(Rt),w(jt=>[{toastId:h.id,height:Rt,position:h.position},...jt]),()=>w(jt=>jt.filter(Tt=>Tt.toastId!==h.id))}},[w,h.id]),Fe.useLayoutEffect(()=>{if(!I)return;const Ke=J.current,Rt=Ke.style.height;Ke.style.height="auto";const jt=Ke.getBoundingClientRect().height;Ke.style.height=Rt,Ae(jt),w(Tt=>Tt.find(Ht=>Ht.toastId===h.id)?Tt.map(Ht=>Ht.toastId===h.id?{...Ht,height:jt}:Ht):[{toastId:h.id,height:jt,position:h.position},...Tt])},[I,h.title,h.description,w,h.id,h.jsx,h.action,h.cancel]);const gt=Fe.useCallback(()=>{ae(!0),ye(Oe.current),w(Ke=>Ke.filter(Rt=>Rt.toastId!==h.id)),setTimeout(()=>{M(h)},Mz)},[h,M,w,Oe]);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 Tt=new Date().getTime()-fe.current;Ce.current=Ce.current-Tt}He.current=new Date().getTime()})():(()=>{Ce.current!==1/0&&(fe.current=new Date().getTime(),Ke=setTimeout(()=>{h.onAutoClose==null||h.onAutoClose.call(h,h),gt()},Ce.current))})(),()=>clearTimeout(Ke)},[k,g,h,Be,tt,gt]),Fe.useEffect(()=>{h.delete&&(gt(),h.onDismiss==null||h.onDismiss.call(h,h))},[gt,h.delete]);function At(){var Ke;if(z!=null&&z.loading){var Rt;return Fe.createElement("div",{className:Yi(_==null?void 0:_.loader,h==null||(Rt=h.classNames)==null?void 0:Rt.loader,"sonner-loader"),"data-visible":Be==="loading"},z.loading)}return Fe.createElement(cz,{className:Yi(_==null?void 0:_.loader,h==null||(Ke=h.classNames)==null?void 0:Ke.loader),visible:Be==="loading"})}const it=h.icon||(z==null?void 0:z[Be])||sz(Be);var ft,yt;return Fe.createElement("li",{tabIndex:0,ref:J,className:Yi(F,De,_==null?void 0:_.toast,h==null||(t=h.classNames)==null?void 0:t.toast,_==null?void 0:_.default,_==null?void 0:_[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":Pe,"data-removed":le,"data-visible":xe,"data-y-position":et,"data-x-position":ze,"data-index":S,"data-front":Ee,"data-swiping":Z,"data-dismissible":qe,"data-type":Be,"data-invert":Ct,"data-swipe-out":ve,"data-swipe-direction":U,"data-expanded":!!(k||B&&I),"data-testid":h.testId,style:{"--index":S,"--toasts-before":S,"--z-index":R.length-S,"--offset":`${le?he:Oe.current}px`,"--initial-height":B?"auto":`${Le}px`,...O,...h.style},onDragEnd:()=>{ue(!1),P(null),$e.current=null},onPointerDown:Ke=>{Ke.button!==2&&(zt||!qe||(Re.current=new Date,ye(Oe.current),Ke.target.setPointerCapture(Ke.pointerId),Ke.target.tagName!=="BUTTON"&&(ue(!0),$e.current={x:Ke.clientX,y:Ke.clientY})))},onPointerUp:()=>{var Ke,Rt,jt;if(ve||!qe)return;$e.current=null;const Tt=Number(((Ke=J.current)==null?void 0:Ke.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),un=Number(((Rt=J.current)==null?void 0:Rt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ht=new Date().getTime()-((jt=Re.current)==null?void 0:jt.getTime()),Je=K==="x"?Tt:un,kt=Math.abs(Je)/Ht;if(Math.abs(Je)>=kz||kt>.11){ye(Oe.current),h.onDismiss==null||h.onDismiss.call(h,h),G(K==="x"?Tt>0?"right":"left":un>0?"down":"up"),gt(),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 Rt,jt,Tt;if(!$e.current||!qe||((Rt=window.getSelection())==null?void 0:Rt.toString().length)>0)return;const Ht=Ke.clientY-$e.current.y,Je=Ke.clientX-$e.current.x;var kt;const X=(kt=e.swipeDirections)!=null?kt:Az(q);!K&&(Math.abs(Je)>1||Math.abs(Ht)>1)&&P(Math.abs(Je)>Math.abs(Ht)?"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")&&Ht<0||X.includes("bottom")&&Ht>0)ie.y=Ht;else{const ke=Ht*de(Ht);ie.y=Math.abs(ke)<Math.abs(Ht)?ke:Ht}}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),(jt=J.current)==null||jt.style.setProperty("--swipe-amount-x",`${ie.x}px`),(Tt=J.current)==null||Tt.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||!qe?()=>{}:()=>{gt(),h.onDismiss==null||h.onDismiss.call(h,h)},className:Yi(_==null?void 0:_.closeButton,h==null||(r=h.classNames)==null?void 0:r.closeButton)},(yt=z==null?void 0:z.close)!=null?yt:pz):null,(Be||h.icon||h.promise)&&h.icon!==null&&((z==null?void 0:z[Be])!==null||h.icon)?Fe.createElement("div",{"data-icon":"",className:Yi(_==null?void 0:_.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:Yi(_==null?void 0:_.content,h==null||(o=h.classNames)==null?void 0:o.content)},Fe.createElement("div",{"data-title":"",className:Yi(_==null?void 0:_.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:Yi(W,ut,_==null?void 0:_.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&&xh(h.cancel)?Fe.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||L,onClick:Ke=>{xh(h.cancel)&&qe&&(h.cancel.onClick==null||h.cancel.onClick.call(h.cancel,Ke),gt())},className:Yi(_==null?void 0:_.cancelButton,h==null||(f=h.classNames)==null?void 0:f.cancelButton)},h.cancel.label):null,Fe.isValidElement(h.action)?h.action:h.action&&xh(h.action)?Fe.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||V,onClick:Ke=>{xh(h.action)&&(h.action.onClick==null||h.action.onClick.call(h.action,Ke),!Ke.defaultPrevented&&gt())},className:Yi(_==null?void 0:_.actionButton,h==null||(d=h.classNames)==null?void 0:d.actionButton)},h.action.label):null)};function eT(){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 Nz(e,t){const n={};return[e,t].forEach((r,a)=>{const o=a===1,l=o?"--mobile-offset":"--offset",c=o?Cz:Ez;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 Dz=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=Sz,toastOptions:S,dir:R=eT(),gap:k=Rz,icons:M,containerAriaLabel:D="Notifications"}=t,[A,O]=Fe.useState([]),L=Fe.useMemo(()=>r?A.filter(I=>I.toasterId===r):A.filter(I=>!I.toasterId),[A,r]),V=Fe.useMemo(()=>Array.from(new Set([o].concat(L.filter(I=>I.position).map(I=>I.position)))),[L,o]),[F,W]=Fe.useState([]),[j,q]=Fe.useState(!1),[$,B]=Fe.useState(!1),[_,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=>{O(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(()=>{O(Q=>Q.map(le=>le.id===I.id?{...le,delete:!0}:le))});return}setTimeout(()=>{az.flushSync(()=>{O(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]})})})}),[A]),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(()=>{A.length<=1&&q(!1)},[A]),Fe.useEffect(()=>{const I=Q=>{var le;if(l.every(ue=>Q[ue]||Q.code===ue)){var Z;q(!0),(Z=H.current)==null||Z.focus()}Q.code==="Escape"&&(document.activeElement===H.current||(le=H.current)!=null&&le.contains(document.activeElement))&&q(!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},V.map((I,Q)=>{var le;const[ae,Z]=I.split("-");return L.length?Fe.createElement("ol",{key:I,dir:R==="auto"?eT():R,tabIndex:-1,ref:H,className:d,"data-sonner-toaster":!0,"data-sonner-theme":_,"data-y-position":ae,"data-x-position":Z,style:{"--front-toast-height":`${((le=F[0])==null?void 0:le.height)||0}px`,"--width":`${Tz}px`,"--gap":`${k}px`,...C,...Nz(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:()=>q(!0),onMouseMove:()=>q(!0),onMouseLeave:()=>{$||q(!1)},onDragEnd:()=>q(!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,Pe;return Fe.createElement(Oz,{key:ue.id,icons:M,index:ve,toast:ue,defaultRichColors:g,duration:(Se=S==null?void 0:S.duration)!=null?Se:w,className:S==null?void 0:S.className,descriptionClassName:S==null?void 0:S.descriptionClassName,invert:a,visibleToasts:T,closeButton:(Pe=S==null?void 0:S.closeButton)!=null?Pe:f,interacting:$,position:I,style:S==null?void 0:S.style,unstyled:S==null?void 0:S.unstyled,classNames:S==null?void 0:S.classNames,cancelButtonStyle:S==null?void 0:S.cancelButtonStyle,actionButtonStyle:S==null?void 0:S.actionButtonStyle,closeButtonAriaLabel:S==null?void 0:S.closeButtonAriaLabel,removeToast:G,toasts:L.filter(te=>te.position==ue.position),heights:F.filter(te=>te.position==ue.position),setHeights:W,expandByDefault:c,gap:k,expanded:j,swipeDirections:t.swipeDirections})})):null}))}),Mt=e=>typeof e=="string",Iu=()=>{let e,t;const n=new Promise((r,a)=>{e=r,t=a});return n.resolve=e,n.reject=t,n},tT=e=>e==null?"":""+e,Iz=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},Pz=/###/g,nT=e=>e&&e.indexOf("###")>-1?e.replace(Pz,"."):e,rT=e=>!e||Mt(e),Zu=(e,t,n)=>{const r=Mt(t)?t.split("."):t;let a=0;for(;a<r.length-1;){if(rT(e))return{};const o=nT(r[a]);!e[o]&&n&&(e[o]=new n),Object.prototype.hasOwnProperty.call(e,o)?e=e[o]:e={},++a}return rT(e)?{}:{obj:e,k:nT(r[a])}},iT=(e,t,n)=>{const{obj:r,k:a}=Zu(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=Zu(e,l,Object);for(;c.obj===void 0&&l.length;)o=`${l[l.length-1]}.${o}`,l=l.slice(0,l.length-1),c=Zu(e,l,Object),c!=null&&c.obj&&typeof c.obj[`${c.k}.${o}`]<"u"&&(c.obj=void 0);c.obj[`${c.k}.${o}`]=n},Lz=(e,t,n,r)=>{const{obj:a,k:o}=Zu(e,t,Object);a[o]=a[o]||[],a[o].push(n)},up=(e,t)=>{const{obj:n,k:r}=Zu(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},jz=(e,t,n)=>{const r=up(e,n);return r!==void 0?r:up(t,n)},WM=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?Mt(e[r])||e[r]instanceof String||Mt(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):WM(e[r],t[r],n):e[r]=t[r]);return e},Pl=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var _z={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const zz=e=>Mt(e)?e.replace(/[&<>"'\/]/g,t=>_z[t]):e;class Fz{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 Bz=[" ",",","?","!",";"],Hz=new Fz(20),Uz=(e,t,n)=>{t=t||"",n=n||"";const r=Bz.filter(l=>t.indexOf(l)<0&&n.indexOf(l)<0);if(r.length===0)return!0;const a=Hz.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},pv=(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},bd=e=>e==null?void 0:e.replace("_","-"),Vz={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 dp{constructor(t,n={}){this.init(t,n)}init(t,n={}){this.prefix=n.prefix||"i18next:",this.logger=t||Vz,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:(Mt(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new dp(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new dp(this.logger,t)}}var Zi=new dp;class Vp{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 aT extends Vp{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):Mt(r)&&o?c.push(...r.split(o)):c.push(r)));const f=up(this.data,c);return!f&&!n&&!r&&t.indexOf(".")>-1&&(t=c[0],n=c[1],r=c.slice(2).join(".")),f||!l||!Mt(r)?f:pv((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),iT(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)(Mt(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=up(this.data,c)||{};l.skipCopy||(r=JSON.parse(JSON.stringify(r))),a?WM(f,r,o):f={...f,...r},iT(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 KM={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 GM=Symbol("i18next/PATH_KEY");function qz(){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===GM?e:(e.push(a),n=Proxy.revocable(r,t),n.proxy)},Proxy.revocable(Object.create(null),t).proxy}function mv(e,t){const{[GM]:n}=e(qz());return n.join((t==null?void 0:t.keySeparator)??".")}const oT={},Wy=e=>!Mt(e)&&typeof e!="boolean"&&typeof e!="number";class fp extends Vp{constructor(t,n={}){super(),Iz(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Zi.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=Wy(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&&!Uz(t,r,a);if(l&&!c){const f=t.match(this.interpolator.nestingRegexp);if(f&&f.length>0)return{key:t,namespaces:Mt(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:Mt(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=mv(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,S=["[object Number]","[object Function]","[object RegExp]"],R=a.joinArrays!==void 0?a.joinArrays:this.options.joinArrays,k=!this.i18nFormat||this.i18nFormat.handleAsObject,M=a.count!==void 0&&!Mt(a.count),D=fp.hasDefaultValue(a),A=M?this.pluralResolver.getSuffix(h,a.count,a):"",O=a.ordinal&&M?this.pluralResolver.getSuffix(h,a.count,{ordinal:!1}):"",L=M&&!a.ordinal&&a.count===0,V=L&&a[`defaultValue${this.options.pluralSeparator}zero`]||a[`defaultValue${A}`]||a[`defaultValue${O}`]||a.defaultValue;let F=w;k&&!w&&D&&(F=V);const W=Wy(F),j=Object.prototype.toString.apply(F);if(k&&F&&W&&S.indexOf(j)<0&&!(Mt(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 q=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=q,g.usedParams=this.getUsedParamsDetails(a),g):q}if(l){const q=Array.isArray(F),$=q?[]:{},B=q?T:C;for(const _ in F)if(Object.prototype.hasOwnProperty.call(F,_)){const z=`${B}${l}${_}`;D&&!w?$[_]=this.translate(z,{...a,defaultValue:Wy(V)?V[_]:void 0,joinArrays:!1,ns:f}):$[_]=this.translate(z,{...a,joinArrays:!1,ns:f}),$[_]===z&&($[_]=F[_])}w=$}}else if(k&&Mt(R)&&Array.isArray(w))w=w.join(R),w&&(w=this.extendTranslation(w,t,a,r));else{let q=!1,$=!1;!this.isValidLookup(w)&&D&&(q=!0,w=V),this.isValidLookup(w)||($=!0,w=c);const _=(a.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&$?void 0:w,z=D&&V!==w&&this.options.updateMissing;if($||q||z){if(this.logger.log(z?"updateKey":"missingKey",h,d,c,z?V: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:_;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}`]||V)})}):P(H,c,V))}w=this.extendTranslation(w,t,a,g,r),$&&w===c&&this.options.appendNamespaceToMissingKey&&(w=`${d}${m}${c}`),($||q)&&this.options.parseMissingKeyHandler&&(w=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${d}${m}${c}`:c,q?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=Mt(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&&!Mt(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=Mt(l)?[l]:l;return t!=null&&(c!=null&&c.length)&&r.applyPostProcessor!==!1&&(t=KM.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 Mt(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&&!Mt(n.count),g=y&&!n.ordinal&&n.count===0,w=n.context!==void 0&&(Mt(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 S,R;this.isValidLookup(r)||(c=T,!oT[`${C[0]}-${T}`]&&((S=this.utils)!=null&&S.hasLoadedNamespace)&&!((R=this.utils)!=null&&R.hasLoadedNamespace(c))&&(oT[`${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 A;if(this.isValidLookup(r))return;l=k;const M=[m];if((A=this.i18nFormat)!=null&&A.addLookupKeys)this.i18nFormat.addLookupKeys(M,m,k,T,n);else{let O;y&&(O=this.pluralResolver.getSuffix(k,n.count,n));const L=`${this.options.pluralSeparator}zero`,V=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(y&&(n.ordinal&&O.indexOf(V)===0&&M.push(m+O.replace(V,this.options.pluralSeparator)),M.push(m+O),g&&M.push(m+L)),w){const F=`${m}${this.options.contextSeparator||"_"}${n.context}`;M.push(F),y&&(n.ordinal&&O.indexOf(V)===0&&M.push(F+O.replace(V,this.options.pluralSeparator)),M.push(F+O),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&&!Mt(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 sT{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Zi.create("languageUtils")}getScriptPartFromCode(t){if(t=bd(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=bd(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(Mt(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)),Mt(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 Mt(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))):Mt(t)&&o(this.formatLanguageCode(t)),r.forEach(l=>{a.indexOf(l)<0&&o(this.formatLanguageCode(l))}),a}}const lT={zero:0,one:1,two:2,few:3,many:4,other:5},cT={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class $z{constructor(t,n={}){this.languageUtils=t,this.options=n,this.logger=Zi.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,n={}){const r=bd(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!"),cT;if(!t.match(/-|_/))return cT;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)=>lT[a]-lT[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 uT=(e,t,n,r=".",a=!0)=>{let o=jz(e,t,n);return!o&&a&&Mt(n)&&(o=pv(e,n,r),o===void 0&&(o=pv(t,n,r))),o},Ky=e=>e.replace(/\$/g,"$$$$");class dT{constructor(t={}){var n;this.logger=Zi.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:S,alwaysFormat:R}=t.interpolation;this.escape=n!==void 0?n:zz,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=a!==void 0?a:!1,this.prefix=o?Pl(o):l||"{{",this.suffix=c?Pl(c):f||"}}",this.formatSeparator=d||",",this.unescapePrefix=m?"":h||"-",this.unescapeSuffix=this.unescapePrefix?"":m||"",this.nestingPrefix=y?Pl(y):g||Pl("$t("),this.nestingSuffix=w?Pl(w):C||Pl(")"),this.nestingOptionsSeparator=T||",",this.maxReplaces=S||1e3,this.alwaysFormat=R!==void 0?R:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>(n==null?void 0:n.source)===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,n,r,a){var g;let o,l,c;const f=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},d=w=>{if(w.indexOf(this.formatSeparator)<0){const R=uT(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(),S=C.join(this.formatSeparator).trim();return this.format(uT(n,f,T,this.options.keySeparator,this.options.ignoreJSONStructure),S,r,{...a,...n,interpolationkey:T})};this.resetRegExp();const m=(a==null?void 0:a.missingInterpolationHandler)||this.options.missingInterpolationHandler,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=>Ky(w)},{regex:this.regexp,safeValue:w=>this.escapeValue?Ky(this.escape(w)):Ky(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 S=m(t,o,a);l=Mt(S)?S:""}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!Mt(l)&&!this.useRawValueToEscape&&(l=tT(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&&!Mt(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&&!Mt(o))return o;Mt(o)||(o=tT(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 Yz=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}},fT=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(bd(r),a),t[l]=c),c(n)}},Wz=e=>(t,n,r)=>e(bd(n),r)(t);class Kz{constructor(t={}){this.logger=Zi.create("formatter"),this.options=t,this.init(t)}init(t,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const r=n.cacheInBuiltFormats?fT:Wz;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()]=fT(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}=Yz(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 Gz=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class Xz extends Vp{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=Zi.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=>{Lz(f.loaded,[o],l),Gz(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();Mt(t)&&(t=this.languageUtils.toResolveHierarchy(t)),Mt(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 Gy=()=>({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]),Mt(e[1])&&(t.defaultValue=e[1]),Mt(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}),hT=e=>{var t,n;return Mt(e.ns)&&(e.ns=[e.ns]),Mt(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Mt(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},wh=()=>{},Qz=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})},Zz=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 Ju extends Vp{constructor(t={},n){if(super(),this.options=hT(t),this.services={},this.logger=Zi,this.modules={external:[]},Qz(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&&(Mt(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const r=Gy();this.options={...r,...this.options,...hT(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&&!Zz(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?Zi.init(a(this.modules.logger),this.options):Zi.init(null,this.options);let d;this.modules.formatter?d=this.modules.formatter:d=Kz;const m=new sT(this.options);this.store=new aT(this.options.resources,this.options);const h=this.services;h.logger=Zi,h.resourceStore=this.store,h.languageUtils=m,h.pluralResolver=new $z(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 dT(this.options),h.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},h.backendConnector=new Xz(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 fp(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=wh),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=Iu(),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=wh){var o,l;let r=n;const a=Mt(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=Iu();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=wh),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"&&KM.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=Iu();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=Mt(c)?c:c&&c[0],d=this.store.hasLanguageSomeTranslations(f)?f:this.services.languageUtils.getBestMatchFromCodes(Mt(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=mv(h,{...this.options,...l})),`${f.keyPrefix}${d}${h}`)):(typeof o=="function"&&(o=mv(o,{...this.options,...l})),m=f.keyPrefix?`${f.keyPrefix}${d}${o}`:o),this.t(m,f)};return Mt(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=Iu();return this.options.ns?(Mt(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=Iu();Mt(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 sT(Gy());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 Ju(t,n);return r.createInstance=Ju.createInstance,r}cloneInstance(t={},n=wh){const r=t.forkResourceStore;r&&delete t.forkResourceStore;const a={...this.options,...t,isClone:!0},o=new Ju(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 aT(c,a),o.services.resourceStore=o.store}if(t.interpolation){const f={...Gy().interpolation,...this.options.interpolation,...t.interpolation},d={...a,interpolation:f};o.services.interpolator=new dT(d)}return o.translator=new fp(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 En=Ju.createInstance();En.createInstance;En.dir;En.init;En.loadResources;En.reloadResources;En.use;En.changeLanguage;En.getFixedT;En.t;En.exists;En.setDefaultNamespace;En.hasLoadedNamespace;En.loadNamespaces;En.loadLanguages;const Jz=(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);Us(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)},pT={},XM=(e,t,n,r)=>{Us(n)&&pT[n]||(Us(n)&&(pT[n]=new Date),Jz(e,t,n,r))},QM=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},gv=(e,t,n)=>{e.loadNamespaces(t,QM(e,n))},mT=(e,t,n,r)=>{if(Us(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return gv(e,n,r);n.forEach(a=>{e.options.ns.indexOf(a)<0&&e.options.ns.push(a)}),e.loadLanguages(t,QM(e,r))},e3=(e,t,n={})=>!t.languages||!t.languages.length?(XM(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}}),Us=e=>typeof e=="string",t3=e=>typeof e=="object"&&e!==null,n3=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,r3={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},i3=e=>r3[e],a3=e=>e.replace(n3,i3);let yv={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:a3,transDefaultProps:void 0};const o3=(e={})=>{yv={...yv,...e}},s3=()=>yv;let ZM;const l3=e=>{ZM=e},c3=()=>ZM,u3={type:"3rdParty",init(e){o3(e.options.react),l3(e)}},d3=v.createContext();class f3{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var Xy={exports:{}},Qy={};/**
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 gT;function h3(){if(gT)return Qy;gT=1;var e=Pd();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 Qy.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,Qy}var yT;function JM(){return yT||(yT=1,Xy.exports=h3()),Xy.exports}var Bx=JM();const p3=(e,t)=>Us(t)?t:t3(t)&&Us(t.defaultValue)?t.defaultValue:Array.isArray(e)?e[e.length-1]:e,m3={t:p3,ready:!1},g3=()=>()=>{},Sn=(e,t={})=>{var V,F,W;const{i18n:n}=t,{i18n:r,defaultNS:a}=v.useContext(d3)||{},o=n||r||c3();o&&!o.reportNamespaces&&(o.reportNamespaces=new f3),o||XM(o,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const l=v.useMemo(()=>{var j;return{...s3(),...(j=o==null?void 0:o.options)==null?void 0:j.react,...t}},[o,t]),{useSuspense:c,keyPrefix:f}=l,d=a||((V=o==null?void 0:o.options)==null?void 0:V.defaultNS),m=Us(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(j=>{if(!o)return g3;const{bindI18n:q,bindI18nStore:$}=l,B=()=>{y.current+=1,j()};return q&&o.on(q,B),$&&o.store.on($,B),()=>{q&&q.split(" ").forEach(_=>o.off(_,B)),$&&$.split(" ").forEach(_=>o.store.off(_,B))}},[o,l]),w=v.useRef(),C=v.useCallback(()=>{if(!o)return m3;const j=!!(o.isInitialized||o.initializedStoreOnce)&&h.every(H=>e3(H,o,l)),q=t.lng||o.language,$=y.current,B=w.current;if(B&&B.ready===j&&B.lng===q&&B.keyPrefix===f&&B.revision===$)return B;const z={t:o.getFixedT(q,l.nsMode==="fallback"?h:h[0],f),ready:j,lng:q,keyPrefix:f,revision:$};return w.current=z,z},[o,h,f,l,t.lng]),[T,S]=v.useState(0),{t:R,ready:k}=Bx.useSyncExternalStore(g,C,C);v.useEffect(()=>{if(o&&!k&&!c){const j=()=>S(q=>q+1);t.lng?mT(o,t.lng,h,j):gv(o,h,j)}},[o,t.lng,h,k,c,T]);const M=o||{},D=v.useRef(null),A=v.useRef(),O=j=>{const q=Object.getOwnPropertyDescriptors(j);q.__original&&delete q.__original;const $=Object.create(Object.getPrototypeOf(j),q);if(!Object.prototype.hasOwnProperty.call($,"__original"))try{Object.defineProperty($,"__original",{value:j,writable:!1,enumerable:!1,configurable:!1})}catch{}return $},L=v.useMemo(()=>{const j=M,q=j==null?void 0:j.language;let $=j;j&&(D.current&&D.current.__original===j?A.current!==q?($=O(j),D.current=$,A.current=q):$=D.current:($=O(j),D.current=$,A.current=q));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(j=>{const q=()=>j();t.lng?mT(o,t.lng,h,q):gv(o,h,q)});return L},y3={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"}},telegram:{title:"Telegram Bot Management",botName:"Bot Name",botNamePlaceholder:"e.g., ops-bot",botToken:"Bot Token",botTokenPlaceholder:"123456:AA...",addBot:"Add Bot",enableBot:"Enable Bot",allowAuthRequests:"Allow Authorization Requests",pendingChats:"Pending Authorization",chats:"Authorized Chats",authorizedChats:"Authorized",noPendingChats:"No pending chats",noAuthorizedChats:"No authorized chats",approve:"Approve",authorize:"Authorize",reject:"Reject",revokeAuth:"Revoke Authorization",testMessage:"Test Message",sendTestMessage:"Send Test Message",deleteBot:"Delete Bot",tokenOptional:"Token (leave empty to keep unchanged)",tokenPlaceholder:"Enter new token",botCreated:"Bot created",botUpdated:"Bot updated",botDeleted:"Bot deleted",authApproved:"Authorization approved",chatRemoved:"Chat removed",testMessageSent:"Test message sent",createFailed:"Failed to create bot",updateFailed:"Failed to update bot",deleteFailed:"Failed to delete bot",approveFailed:"Failed to approve authorization",removeFailed:"Failed to remove chat",testMessageFailed:"Failed to send test message",loadBotsFailed:"Failed to load bot list",loadChatsFailed:"Failed to load chat list",noBots:"No bots yet, add one first.",expand:"Expand",collapse:"Collapse",authCount:"{{authorized}} authorized / {{pending}} pending (max 8)",chatId:"Chat ID",applyTime:"Application Time",gatewayOnline:"🟢 Gateway online @ {{siteName}}",deviceConnectionError:`🔴 {{siteName}}: Connection error on device "{{deviceName}}" ({{host}}) [{{category}}]
71
- {{error}}`,agentCredentialWarning:'⚠️ {{siteName}}: A message in agent session "{{sessionTitle}}" appears to contain credentials ({{types}}). It will be sent to the LLM and stored — risk of leakage.',authSuccess:"✅ Authorized. You will now receive notifications.",authPending:"⏳ Authorization request received. Please approve in tmex settings.",authFailed:"❌ Authorization request failed. Please contact administrator.",testMessageTemplate:`🧪 Test Message
72
- Site: {{siteName}}
73
- Time: {{time}}`,approveMessageTemplate:`✅ Authorized via tmex.
74
- Bot: {{botName}}
75
- Time: {{time}}`,botNotFound:"Bot not found or unavailable",botNotRunning:"Bot is not running or unavailable"},webhook:{title:"Webhooks",url:"Webhook URL",secret:"Secret",secretPlaceholder:"Used to sign payloads (HMAC-SHA256)",enabled:"Enabled",eventMask:"Events",add:"Add Webhook",empty:"No webhooks yet.",createFailed:"Failed to create webhook",deleteFailed:"Failed to delete webhook",loadFailed:"Failed to load webhooks"},sshError:{sshConfigRefNotSupported:"SSH Config reference is not supported in this version. Please use host + username with Agent/Key/Password authentication.",configRefNotSupported:"SSH Config reference is not supported in this version. Please use host + username with Agent/Key/Password authentication.",agentUnavailable:"SSH Agent unavailable: SSH_AUTH_SOCK not detected. Please check agent environment.",agentNoIdentity:"SSH Agent has no available keys. Please run ssh-add first.",agentNoIdentities:"SSH Agent has no available keys. Please run ssh-add first.",authFailed:"Authentication failed: incorrect username, password, or key. Please check device configuration.",authFailedGeneric:"Authentication failed: incorrect username, password, or key. Please check device configuration.",networkUnreachable:"Network unreachable: Please check routing, firewall, or VPN configuration.",connectionRefused:"Connection refused: Unable to connect to target host. Please check host address and port.",timeout:"Connection timeout: Unable to connect to device. Please check network or firewall settings.",connectionTimeout:"Connection timeout: Unable to connect to device. Please check network or firewall settings.",hostNotFound:"Host not found: Unable to resolve hostname. Please check DNS or hostname configuration.",handshakeFailed:"Handshake failed: Unable to establish secure connection. Possibly incompatible key exchange algorithm.",tmuxUnavailable:"Remote tmux unavailable or failed to start. Please ensure tmux is installed and available in the remote shell PATH.",connectionClosed:"Connection closed, attempting to reconnect",unknown:"Connection failed: {{message}}",reconnecting:"Connection interrupted, reconnecting in {{delay}} seconds ({{attempt}}/{{maxRetries}})",reconnectFailed:"Auto-reconnect failed, please retry manually",reconnected:"Device reconnected automatically"},deviceStatus:{reconnecting:"Reconnecting {{delay}}s",offline:"Offline",errorBadge:{authFailed:"Auth failed",agentUnavailable:"Agent unavailable",agentNoIdentity:"Agent has no keys",configRefNotSupported:"SSH Config unsupported",networkUnreachable:"Network unreachable",connectionRefused:"Refused",timeout:"Timeout",hostNotFound:"Host not found",handshakeFailed:"Handshake failed",tmuxUnavailable:"Tmux unavailable",connectionClosed:"Disconnected",unknown:"Connection error"}},websocket:{error:"WebSocket connection error",checkGateway:"Please check Gateway status",upgradeFailed:"Upgrade failed",invalidMessage:"Invalid message format"},wsError:{checkGateway:"Please check Gateway status"},apiError:{siteNameRequired:"Site name cannot be empty",siteUrlInvalid:"Site URL must start with http:// or https://",bellThrottleInvalid:"Bell throttle seconds must be between 0-300",sshRetriesInvalid:"SSH reconnect retries must be between 0-20",sshDelayInvalid:"SSH reconnect delay must be between 1-300 seconds",languageInvalid:"Language must be one of the supported locales",botNameRequired:"Bot name cannot be empty",botTokenRequired:"Bot token cannot be empty",missingFields:"Missing required fields",sshRequiresHost:"SSH device requires host or sshConfigRef",invalidRequest:"Invalid request",deviceNotFound:"Device not found",botNotFound:"Bot not found",chatNotFound:"Chat not found",urlAndSecretRequired:"URL and secret are required",notFound:"Not found",llmProviderNameRequired:"Provider name cannot be empty",llmProviderProtocolInvalid:"Protocol must be openai-chat or openai-responses",llmProviderBaseUrlInvalid:"Base URL must start with http:// or https://",llmProviderApiKeyRequired:"API key cannot be empty",llmProviderNotFound:"LLM provider not found",llmProviderDisabled:"LLM provider {{name}} is disabled",llmNoDefaultProvider:"No LLM provider specified and no default provider configured",llmNoDefaultModel:"No model specified and no default model configured",llmDefaultProviderNotFound:"Default provider does not exist",llmSearchProviderInvalid:"Search provider must be none, tavily or brave",llmFetchModelsFailed:"Failed to fetch model list: {{detail}}",agentSessionNotFound:"Agent session not found",agentSessionBusy:"Agent session is currently running, stop it or wait for completion",agentSessionAwaitingConfirmation:"Agent session has pending confirmations, resolve them first",agentDeviceRequired:"Device is required",agentPaneRequired:"Terminal pane is required",agentWriteModeInvalid:"Write mode must be confirm or auto",agentMaxStepsInvalid:"Max steps per turn must be between 1 and 100",agentProviderWebSearchRequiresResponses:"Provider built-in web search requires the openai-responses protocol",agentHostedToolUnknown:"Unknown hosted tool: {{name}}",agentHostedToolRequiresResponses:"Provider hosted tools require the openai-responses protocol",agentSessionOrphaned:"This agent session is orphaned (its terminal is gone) and is read-only",agentQueuedMessageNotFound:"Queued message not found",agentConfirmationNotFound:"Confirmation not found",agentConfirmationAlreadyDecided:"Confirmation has already been decided",agentMessageTextRequired:"Message text is required",watchRuleNotFound:"Watch rule not found",watchNameRequired:"Rule name is required",watchTriggerTypeInvalid:"Trigger type must be match, unchanged or llm",watchPatternRequired:"match/unchanged rules require a regular expression",watchPatternInvalid:"Invalid regular expression: {{detail}}",watchUnchangedMinutesInvalid:"unchanged rules require unchangedMinutes greater than 0",watchExtractGroupInvalid:"Capture group index must be an integer >= 0",watchConditionPromptRequired:"llm rules require a condition prompt",watchIntervalInvalid:"Sampling interval must be at least {{min}} seconds",watchNoMatchBehaviorInvalid:"No-match behavior must be reset or ignore",watchFireModeInvalid:"Fire mode must be once or repeat",watchCooldownInvalid:"Cooldown seconds must be an integer >= 0",watchAssistDescriptionRequired:"Please describe what to match",watchAssistModelUnavailable:"Model call failed: {{detail}}"},notification:{clickToJump:"Click to jump to corresponding pane",eventType:{terminal_bell:"🔔 Terminal Bell",terminal_notification:"🔔 Terminal Notification",tmux_window_close:"🪟 Window Closed",tmux_pane_close:"📱 Pane Closed",device_tmux_missing:"⚠️ Tmux Missing",device_disconnect:"🔌 Device Disconnected",session_created:"🆕 Session Created",session_closed:"🚪 Session Closed",agent_confirmation_pending:"🤖 Agent Confirmation Pending",agent_turn_finished:"🤖 Agent Turn Finished",agent_error:"🤖 Agent Error",watch_triggered:"👁️ Watch Rule Triggered",watch_model_unavailable:"👁️ Watch Model Unavailable",watch_rule_error:"👁️ Watch Rule Error"},site:"Site",device:"Device",window:"Window",pane:"Pane",time:"Time",directLink:"Direct Link",message:"Message",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"}}},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:"保存搜索设置失败"}},telegram:{title:"Telegram Bot 管理",botName:"Bot 名称",botNamePlaceholder:"如:ops-bot",botToken:"Bot Token",botTokenPlaceholder:"123456:AA...",addBot:"新增 Bot",enableBot:"启用 Bot",allowAuthRequests:"允许申请授权",pendingChats:"待授权",chats:"已授权",authorizedChats:"已授权",noPendingChats:"暂无待授权 chat",noAuthorizedChats:"暂无已授权 chat",approve:"批准",authorize:"授权",reject:"拒绝",revokeAuth:"撤销授权",testMessage:"测试消息",sendTestMessage:"发送测试消息",deleteBot:"删除 Bot",tokenOptional:"Token(留空不改)",tokenPlaceholder:"输入新 token",botCreated:"Bot 已创建",botUpdated:"Bot 已更新",botDeleted:"Bot 已删除",authApproved:"授权已批准",chatRemoved:"chat 已移除",testMessageSent:"测试消息已发送",createFailed:"新增 Bot 失败",updateFailed:"更新 Bot 失败",deleteFailed:"删除 Bot 失败",approveFailed:"批准授权失败",removeFailed:"删除 chat 失败",testMessageFailed:"发送测试消息失败",loadBotsFailed:"加载 Bot 列表失败",loadChatsFailed:"加载 chat 列表失败",noBots:"暂无 Bot,先添加一个。",expand:"展开",collapse:"收起",authCount:"已授权 {{authorized}} / 待授权 {{pending}}(总上限 8)",chatId:"chatId",applyTime:"申请时间",gatewayOnline:"🟢 Gateway online @ {{siteName}}",deviceConnectionError:`🔴 {{siteName}}:设备「{{deviceName}}」({{host}}) 连接异常 [{{category}}]
76
- {{error}}`,agentCredentialWarning:"⚠️ {{siteName}}:Agent 会话「{{sessionTitle}}」的一条消息疑似包含凭证({{types}})。该内容将发送至 LLM 并存储,存在泄露风险。",authSuccess:"✅ 已授权,可接收通知。",authPending:"⏳ 已收到授权申请,请在 tmex 设置页审批。",authFailed:"❌ 授权申请失败,请联系管理员。",testMessageTemplate:`🧪 测试消息
77
- 站点:{{siteName}}
78
- 时间:{{time}}`,approveMessageTemplate:`✅ 已通过 tmex 授权。
79
- Bot:{{botName}}
80
- 时间:{{time}}`,botNotFound:"Bot 未启动或不可用",botNotRunning:"Bot 未启动或不可用"},webhook:{title:"Webhooks",url:"Webhook 地址",secret:"密钥",secretPlaceholder:"用于签名(HMAC-SHA256)",enabled:"启用",eventMask:"事件",add:"添加 Webhook",empty:"暂无 Webhook。",createFailed:"创建 Webhook 失败",deleteFailed:"删除 Webhook 失败",loadFailed:"加载 Webhook 失败"},sshError:{sshConfigRefNotSupported:"当前版本暂不支持 SSH Config 引用,请改为填写 host + username,并选择 Agent/私钥/密码认证",configRefNotSupported:"当前版本暂不支持 SSH Config 引用,请改为填写 host + username,并选择 Agent/私钥/密码认证",agentUnavailable:"SSH Agent 不可用:未检测到 SSH_AUTH_SOCK,请检查 agent 环境",agentNoIdentity:"SSH Agent 未加载可用密钥,请先执行 ssh-add",agentNoIdentities:"SSH Agent 未加载可用密钥,请先执行 ssh-add",authFailed:"认证失败:用户名、密码或密钥不正确,请检查设备配置",authFailedGeneric:"认证失败:用户名、密码或密钥不正确,请检查设备配置",networkUnreachable:"网络不可达:请检查路由、防火墙或 VPN 配置",connectionRefused:"连接被拒绝:无法连接到目标主机,请检查主机地址和端口是否正确",timeout:"连接超时:无法连接到设备,请检查网络或防火墙设置",connectionTimeout:"连接超时:无法连接到设备,请检查网络或防火墙设置",hostNotFound:"主机未找到:无法解析主机地址,请检查 DNS 或主机名是否正确",handshakeFailed:"握手失败:无法建立安全连接,可能是密钥交换算法不兼容",tmuxUnavailable:"远端 tmux 不可用或启动失败,请检查远端是否已安装 tmux,且远端 shell PATH 可找到 tmux",connectionClosed:"连接已断开,尝试重连中",unknown:"连接失败:{{message}}",reconnecting:"连接中断,{{delay}} 秒后自动重连({{attempt}}/{{maxRetries}})",reconnectFailed:"自动重连失败,请手动重试",reconnected:"设备已自动重连"},deviceStatus:{reconnecting:"重连中 {{delay}}s",offline:"离线",errorBadge:{authFailed:"认证失败",agentUnavailable:"Agent 不可用",agentNoIdentity:"Agent 无密钥",configRefNotSupported:"不支持 SSH Config",networkUnreachable:"网络不可达",connectionRefused:"连接被拒",timeout:"连接超时",hostNotFound:"主机未找到",handshakeFailed:"握手失败",tmuxUnavailable:"tmux 不可用",connectionClosed:"连接已断开",unknown:"连接异常"}},websocket:{error:"WebSocket 连接错误",checkGateway:"请检查 Gateway 状态",upgradeFailed:"Upgrade failed",invalidMessage:"Invalid message format"},wsError:{checkGateway:"请检查 Gateway 状态"},apiError:{siteNameRequired:"站点名称不能为空",siteUrlInvalid:"站点 URL 必须以 http:// 或 https:// 开头",bellThrottleInvalid:"Bell 频控秒数需在 0-300 之间",sshRetriesInvalid:"SSH 重连次数需在 0-20 之间",sshDelayInvalid:"SSH 重连等待时间需在 1-300 秒之间",languageInvalid:"语言必须是受支持的区域设置之一",botNameRequired:"Bot 名称不能为空",botTokenRequired:"Bot token 不能为空",missingFields:"缺少必填字段",sshRequiresHost:"SSH 设备需要 host 或 sshConfigRef",invalidRequest:"请求无效",deviceNotFound:"Device not found",botNotFound:"Bot 不存在",chatNotFound:"Chat 不存在",urlAndSecretRequired:"URL and secret required",notFound:"Not found",llmProviderNameRequired:"Provider 名称不能为空",llmProviderProtocolInvalid:"协议必须是 openai-chat 或 openai-responses",llmProviderBaseUrlInvalid:"Base URL 必须以 http:// 或 https:// 开头",llmProviderApiKeyRequired:"API key 不能为空",llmProviderNotFound:"LLM provider 不存在",llmProviderDisabled:"LLM provider {{name}} 已被禁用",llmNoDefaultProvider:"未指定 LLM provider 且未配置默认 provider",llmNoDefaultModel:"未指定模型且未配置默认模型",llmDefaultProviderNotFound:"默认 provider 不存在",llmSearchProviderInvalid:"搜索服务必须是 none、tavily 或 brave",llmFetchModelsFailed:"拉取模型列表失败:{{detail}}",agentSessionNotFound:"Agent 会话不存在",agentSessionBusy:"Agent 会话正在运行中,请先停止或等待完成",agentSessionAwaitingConfirmation:"Agent 会话有待处理的确认请求,请先处理",agentDeviceRequired:"必须指定设备",agentPaneRequired:"必须指定终端 pane",agentWriteModeInvalid:"写入模式必须是 confirm 或 auto",agentMaxStepsInvalid:"每回合最大步数必须在 1-100 之间",agentProviderWebSearchRequiresResponses:"Provider 内置搜索仅支持 openai-responses 协议",agentHostedToolUnknown:"未知的 hosted 工具:{{name}}",agentHostedToolRequiresResponses:"Provider hosted 工具仅支持 openai-responses 协议",agentSessionOrphaned:"该 Agent 会话已孤立(绑定终端已不存在),仅可只读查看",agentQueuedMessageNotFound:"排队消息不存在",agentConfirmationNotFound:"确认请求不存在",agentConfirmationAlreadyDecided:"确认请求已被处理",agentMessageTextRequired:"消息内容不能为空",watchRuleNotFound:"Watch 规则不存在",watchNameRequired:"规则名称不能为空",watchTriggerTypeInvalid:"触发类型必须是 match、unchanged 或 llm",watchPatternRequired:"match/unchanged 规则必须提供正则表达式",watchPatternInvalid:"正则表达式无效:{{detail}}",watchUnchangedMinutesInvalid:"unchanged 规则的未变化分钟数必须大于 0",watchExtractGroupInvalid:"捕获组序号必须是不小于 0 的整数",watchConditionPromptRequired:"llm 规则必须提供条件描述",watchIntervalInvalid:"采样间隔不能小于 {{min}} 秒",watchNoMatchBehaviorInvalid:"无命中行为必须是 reset 或 ignore",watchFireModeInvalid:"触发模式必须是 once 或 repeat",watchCooldownInvalid:"冷却秒数必须是不小于 0 的整数",watchAssistDescriptionRequired:"请描述要匹配的内容",watchAssistModelUnavailable:"模型调用失败:{{detail}}"},notification:{clickToJump:"点击跳转到对应 Pane",eventType:{terminal_bell:"🔔 终端 Bell",terminal_notification:"🔔 终端通知",tmux_window_close:"🪟 窗口关闭",tmux_pane_close:"📱 Pane 关闭",device_tmux_missing:"⚠️ Tmux 不可用",device_disconnect:"🔌 设备断开",session_created:"🆕 会话创建",session_closed:"🚪 会话关闭",agent_confirmation_pending:"🤖 Agent 等待确认",agent_turn_finished:"🤖 Agent 回合完成",agent_error:"🤖 Agent 错误",watch_triggered:"👁️ Watch 规则触发",watch_model_unavailable:"👁️ Watch 模型不可用",watch_rule_error:"👁️ Watch 规则错误"},site:"站点",device:"设备",window:"窗口",pane:"Pane",time:"时间",directLink:"直达",message:"信息",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 设备需要填写主机地址"}}},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:"検索設定の保存に失敗しました"}},telegram:{title:"Telegram Bot 管理",botName:"Bot 名",botNamePlaceholder:"例:ops-bot",botToken:"Bot Token",botTokenPlaceholder:"123456:AA...",addBot:"Bot を追加",enableBot:"Bot を有効にする",allowAuthRequests:"認証リクエストを許可",pendingChats:"承認待ち",chats:"承認済み",authorizedChats:"承認済み",noPendingChats:"承認待ちのチャットはありません",noAuthorizedChats:"承認済みのチャットはありません",approve:"承認",authorize:"認証",reject:"拒否",revokeAuth:"認証を取り消す",testMessage:"テストメッセージ",sendTestMessage:"テストメッセージを送信",deleteBot:"Bot を削除",tokenOptional:"Token(変更しない場合は空)",tokenPlaceholder:"新しい token を入力",botCreated:"Bot を作成しました",botUpdated:"Bot を更新しました",botDeleted:"Bot を削除しました",authApproved:"認証が承認されました",chatRemoved:"チャットを削除しました",testMessageSent:"テストメッセージを送信しました",createFailed:"Bot の作成に失敗しました",updateFailed:"Bot の更新に失敗しました",deleteFailed:"Bot の削除に失敗しました",approveFailed:"認証の承認に失敗しました",removeFailed:"チャットの削除に失敗しました",testMessageFailed:"テストメッセージの送信に失敗しました",loadBotsFailed:"Bot 一覧の読み込みに失敗しました",loadChatsFailed:"チャット一覧の読み込みに失敗しました",noBots:"Bot がありません。まず追加してください。",expand:"展開",collapse:"折りたたむ",authCount:"承認済み {{authorized}} / 承認待ち {{pending}}(最大 8)",chatId:"Chat ID",applyTime:"申請時間",gatewayOnline:"🟢 Gateway online @ {{siteName}}",deviceConnectionError:`🔴 {{siteName}}:デバイス「{{deviceName}}」({{host}}) で接続エラー [{{category}}]
81
- {{error}}`,agentCredentialWarning:"⚠️ {{siteName}}:Agent セッション「{{sessionTitle}}」のメッセージに認証情報が含まれている可能性があります({{types}})。LLM に送信され保存されるため、漏洩のリスクがあります。",authSuccess:"✅ 承認されました。通知を受信できます。",authPending:"⏳ 認証リクエストを受信しました。tmex 設定ページで承認してください。",authFailed:"❌ 認証リクエストに失敗しました。管理者に連絡してください。",testMessageTemplate:`🧪 テストメッセージ
82
- サイト:{{siteName}}
83
- 時間:{{time}}`,approveMessageTemplate:`✅ tmex で承認されました。
84
- Bot:{{botName}}
85
- 時間:{{time}}`,botNotFound:"Bot が見つからないか利用できません",botNotRunning:"Bot が起動していないか利用できません"},webhook:{title:"Webhooks",url:"Webhook URL",secret:"シークレット",secretPlaceholder:"署名に使用(HMAC-SHA256)",enabled:"有効",eventMask:"イベント",add:"Webhook を追加",empty:"Webhook がありません。",createFailed:"Webhook の作成に失敗しました",deleteFailed:"Webhook の削除に失敗しました",loadFailed:"Webhook の読み込みに失敗しました"},sshError:{sshConfigRefNotSupported:"このバージョンでは SSH Config 参照はサポートされていません。host + username を使用し、Agent/秘密鍵/パスワード認証を選択してください。",configRefNotSupported:"このバージョンでは SSH Config 参照はサポートされていません。host + username を使用し、Agent/秘密鍵/パスワード認証を選択してください。",agentUnavailable:"SSH Agent が利用できません:SSH_AUTH_SOCK が検出されません。agent 環境を確認してください。",agentNoIdentity:"SSH Agent に利用可能な鍵がありません。ssh-add を実行してください。",agentNoIdentities:"SSH Agent に利用可能な鍵がありません。ssh-add を実行してください。",authFailed:"認証に失敗しました:ユーザー名、パスワード、または鍵が正しくありません。デバイス設定を確認してください。",authFailedGeneric:"認証に失敗しました:ユーザー名、パスワード、または鍵が正しくありません。デバイス設定を確認してください。",networkUnreachable:"ネットワークに到達できません:ルーティング、ファイアウォール、または VPN 設定を確認してください。",connectionRefused:"接続が拒否されました:ターゲットホストに接続できません。ホストアドレスとポートを確認してください。",timeout:"接続タイムアウト:デバイスに接続できません。ネットワークまたはファイアウォール設定を確認してください。",connectionTimeout:"接続タイムアウト:デバイスに接続できません。ネットワークまたはファイアウォール設定を確認してください。",hostNotFound:"ホストが見つかりません:ホスト名を解決できません。DNS またはホスト名設定を確認してください。",handshakeFailed:"ハンドシェイクに失敗しました:安全な接続を確立できません。キー交換アルゴリズムが互換性がない可能性があります。",tmuxUnavailable:"リモート tmux が利用できないか起動に失敗しました。tmux がインストールされ、リモート shell の PATH から参照できることを確認してください。",connectionClosed:"接続が切断されました。再接続を試みています",unknown:"接続に失敗しました:{{message}}",reconnecting:"接続が中断されました。{{delay}} 秒後に再接続します({{attempt}}/{{maxRetries}})",reconnectFailed:"自動再接続に失敗しました。手動で再試行してください",reconnected:"デバイスが自動的に再接続されました"},deviceStatus:{reconnecting:"再接続中 {{delay}}s",offline:"オフライン",errorBadge:{authFailed:"認証失敗",agentUnavailable:"Agent 利用不可",agentNoIdentity:"Agent に鍵なし",configRefNotSupported:"SSH Config 非対応",networkUnreachable:"ネットワーク不可達",connectionRefused:"接続拒否",timeout:"タイムアウト",hostNotFound:"ホスト未検出",handshakeFailed:"ハンドシェイク失敗",tmuxUnavailable:"tmux 利用不可",connectionClosed:"切断",unknown:"接続エラー"}},websocket:{error:"WebSocket 接続エラー",checkGateway:"Gateway 状態を確認してください",upgradeFailed:"アップグレードに失敗しました",invalidMessage:"無効なメッセージ形式"},wsError:{checkGateway:"Gateway 状態を確認してください"},apiError:{siteNameRequired:"サイト名は空にできません",siteUrlInvalid:"サイト URL は http:// または https:// で始まる必要があります",bellThrottleInvalid:"ベル制限秒数は 0-300 の間である必要があります",sshRetriesInvalid:"SSH 再接続試行回数は 0-20 の間である必要があります",sshDelayInvalid:"SSH 再接続待機時間は 1-300 秒の間である必要があります",languageInvalid:"言語はサポートされているロケールのいずれかである必要があります",botNameRequired:"Bot 名は空にできません",botTokenRequired:"Bot token は空にできません",missingFields:"必須フィールドがありません",sshRequiresHost:"SSH デバイスには host または sshConfigRef が必要です",invalidRequest:"無効なリクエスト",deviceNotFound:"デバイスが見つかりません",botNotFound:"Bot が見つかりません",chatNotFound:"チャットが見つかりません",urlAndSecretRequired:"URL とシークレットが必要です",notFound:"見つかりません",llmProviderNameRequired:"プロバイダー名は空にできません",llmProviderProtocolInvalid:"プロトコルは openai-chat または openai-responses である必要があります",llmProviderBaseUrlInvalid:"Base URL は http:// または https:// で始まる必要があります",llmProviderApiKeyRequired:"API key は空にできません",llmProviderNotFound:"LLM プロバイダーが見つかりません",llmProviderDisabled:"LLM プロバイダー {{name}} は無効化されています",llmNoDefaultProvider:"LLM プロバイダーが指定されておらず、デフォルトプロバイダーも設定されていません",llmNoDefaultModel:"モデルが指定されておらず、デフォルトモデルも設定されていません",llmDefaultProviderNotFound:"デフォルトプロバイダーが存在しません",llmSearchProviderInvalid:"検索プロバイダーは none、tavily、brave のいずれかである必要があります",llmFetchModelsFailed:"モデル一覧の取得に失敗しました:{{detail}}",agentSessionNotFound:"Agent セッションが存在しません",agentSessionBusy:"Agent セッションは実行中です。停止するか完了をお待ちください",agentSessionAwaitingConfirmation:"Agent セッションに未処理の確認リクエストがあります。先に処理してください",agentDeviceRequired:"デバイスを指定してください",agentPaneRequired:"ターミナル pane を指定してください",agentWriteModeInvalid:"書き込みモードは confirm または auto である必要があります",agentMaxStepsInvalid:"1 ターンあたりの最大ステップ数は 1〜100 の範囲で指定してください",agentProviderWebSearchRequiresResponses:"プロバイダ内蔵の Web 検索は openai-responses プロトコルのみ対応しています",agentHostedToolUnknown:"不明な hosted ツール: {{name}}",agentHostedToolRequiresResponses:"プロバイダの hosted ツールは openai-responses プロトコルのみ対応しています",agentSessionOrphaned:"この Agent セッションは孤立しており(端末が存在しません)、読み取り専用です",agentQueuedMessageNotFound:"キューのメッセージが存在しません",agentConfirmationNotFound:"確認リクエストが存在しません",agentConfirmationAlreadyDecided:"確認リクエストは既に処理済みです",agentMessageTextRequired:"メッセージ内容を入力してください",watchRuleNotFound:"Watch ルールが存在しません",watchNameRequired:"ルール名を入力してください",watchTriggerTypeInvalid:"トリガー種別は match、unchanged、llm のいずれかです",watchPatternRequired:"match/unchanged ルールには正規表現が必要です",watchPatternInvalid:"正規表現が無効です:{{detail}}",watchUnchangedMinutesInvalid:"unchanged ルールには 0 より大きい未変化分数が必要です",watchExtractGroupInvalid:"キャプチャグループ番号は 0 以上の整数で指定してください",watchConditionPromptRequired:"llm ルールには条件の説明が必要です",watchIntervalInvalid:"サンプリング間隔は {{min}} 秒以上で指定してください",watchNoMatchBehaviorInvalid:"非マッチ時の挙動は reset または ignore です",watchFireModeInvalid:"発火モードは once または repeat です",watchCooldownInvalid:"クールダウン秒数は 0 以上の整数で指定してください",watchAssistDescriptionRequired:"マッチさせたい内容を記述してください",watchAssistModelUnavailable:"モデル呼び出しに失敗しました:{{detail}}"},notification:{clickToJump:"対応するペインにジャンプ",eventType:{terminal_bell:"🔔 ターミナルベル",terminal_notification:"🔔 ターミナル通知",tmux_window_close:"🪟 ウィンドウ閉じる",tmux_pane_close:"📱 ペイン閉じる",device_tmux_missing:"⚠️ Tmux がありません",device_disconnect:"🔌 デバイス切断",session_created:"🆕 セッション作成",session_closed:"🚪 セッション閉じる",agent_confirmation_pending:"🤖 エージェント確認待ち",agent_turn_finished:"🤖 エージェントターン完了",agent_error:"🤖 エージェントエラー",watch_triggered:"👁️ Watch ルール発動",watch_model_unavailable:"👁️ Watch モデル利用不可",watch_rule_error:"👁️ Watch ルールエラー"},site:"サイト",device:"デバイス",window:"ウィンドウ",pane:"ペイン",time:"時間",directLink:"直接リンク",message:"メッセージ",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 デバイスにはホストアドレスが必要です"}}}},Hx="en_US",vee={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 eA(e){return e.replace("_","-")}var Zy={},vs={},xs={},bT;function b3(){if(bT)return xs;bT=1,Object.defineProperty(xs,"__esModule",{value:!0}),xs.BinaryReader=xs.BinaryWriter=void 0;class e{constructor(r=1024){st(this,"buffer");st(this,"view");st(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){st(this,"buffer");st(this,"view");st(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 Jy={},vT;function v3(){return vT||(vT=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.registry=e.TypeRegistry=void 0;class t{constructor(){st(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}})})(Jy)),Jy}var xT;function x3(){if(xT)return vs;xT=1,Object.defineProperty(vs,"__esModule",{value:!0}),vs.b=vs.Schema=void 0;const e=b3(),t=v3();class n{constructor(a,o,l){st(this,"type");st(this,"options");st(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 wT;function w3(){return wT||(wT=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Schema=e.b=void 0;var t=x3();Object.defineProperty(e,"b",{enumerable:!0,get:function(){return t.b}}),Object.defineProperty(e,"Schema",{enumerable:!0,get:function(){return t.Schema}})})(Zy)),Zy}var se=w3();const S3=1,E3=2,C3=3,T3=4,R3=5,k3=257,M3=258,A3=259,O3=260,N3=261,D3=513,I3=514,P3=515,L3=516,j3=517,_3=518,z3=519,F3=520,B3=522,H3=523,U3=524,V3=769,q3=770,$3=771,Y3=772,W3=773,K3=774,G3=1025,X3=1026,Q3=1281,Z3=1537,J3=1538,e4=1539,t4=1793,n4=1,r4=2,i4=3,a4=4,o4=5,s4=6,l4=7,c4=8,u4=9,d4=10,f4=11,h4=12,p4=13,m4=1,g4=2,y4=3,b4=1001,Qi=1002,v4=1003,tA=1004,Gh=1005,x4=1101,w4=1102,S4=1201,E4=1202,C4=1301,T4=1302,R4=1401,k4={[b4]:"Unsupported protocol version",[Qi]:"Invalid frame format",[v4]:"Unknown message kind",[tA]:"Failed to decode payload",[Gh]:"Frame exceeds maximum size",[x4]:"Device not found",[w4]:"Failed to connect device",[S4]:"Tmux target not found",[E4]:"Tmux not ready",[C4]:"Select conflict",[T4]:"Select token mismatch",[R4]:"Internal server error"};function M4(e){return k4[e]??`Unknown error code: ${e}`}class ei extends Error{constructor(t,n=!1,r){super(r??M4(t)),this.code=t,this.retryable=n,this.name="WsBorshError"}}const nA=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()}),A4=se.b.option(se.b.u32()),mc=se.b.option(se.b.u16()),Mr=se.b.option(se.b.string()),O4=se.b.struct({clientImpl:se.b.string(),clientVersion:se.b.string(),maxFrameBytes:se.b.u32(),supportsCompression:se.b.bool(),supportsDiffSnapshot:se.b.bool()}),N4=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())}),D4=se.b.struct({nonce:se.b.u32(),timeMs:se.b.u64()});se.b.struct({refSeq:A4,code:se.b.u16(),message:se.b.string(),retryable:se.b.bool()});const I4=se.b.struct({deviceId:se.b.string()}),P4=se.b.struct({deviceId:se.b.string()}),L4=se.b.struct({deviceId:se.b.string()}),j4=se.b.struct({deviceId:se.b.string()}),_4=se.b.struct({deviceId:se.b.string(),eventType:se.b.u8(),errorType:Mr,message:Mr,rawMessage:Mr}),z4=se.b.struct({deviceId:se.b.string(),windowId:Mr,paneId:Mr,selectToken:se.b.bytes(16),wantHistory:se.b.bool(),cols:mc,rows:mc}),F4=se.b.struct({deviceId:se.b.string(),windowId:se.b.string()}),B4=se.b.struct({deviceId:se.b.string(),name:Mr}),H4=se.b.struct({deviceId:se.b.string(),windowId:se.b.string()}),U4=se.b.struct({deviceId:se.b.string(),paneId:se.b.string()}),V4=se.b.struct({deviceId:se.b.string(),windowId:se.b.string(),name:se.b.string()}),q4=se.b.struct({deviceId:se.b.string(),style:se.b.string()}),$4=se.b.struct({deviceId:se.b.string(),windowIds:se.b.vec(se.b.string())}),Y4=se.b.struct({deviceId:se.b.string(),windowId:se.b.string(),paneIds:se.b.vec(se.b.string())}),W4=se.b.struct({deviceId:se.b.string(),eventType:se.b.u8(),eventData:se.b.bytes()}),K4=se.b.struct({deviceId:se.b.string(),paneId:se.b.string(),encoding:se.b.u8(),data:se.b.bytes(),isComposing:se.b.bool()}),G4=se.b.struct({deviceId:se.b.string(),paneId:se.b.string(),encoding:se.b.u8(),data:se.b.bytes(),isComposing:se.b.bool()}),rA=se.b.struct({deviceId:se.b.string(),paneId:se.b.string(),cols:se.b.u16(),rows:se.b.u16()}),X4=rA,Q4=se.b.struct({deviceId:se.b.string(),paneId:se.b.string(),encoding:se.b.u8(),data:se.b.bytes()}),Z4=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()}),J4=se.b.struct({deviceId:se.b.string(),windowId:se.b.string(),paneId:se.b.string(),selectToken:se.b.bytes(16)}),e5=se.b.struct({deviceId:se.b.string(),paneId:se.b.string(),selectToken:se.b.bytes(16)}),iA=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()}),t5=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()}),n5=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(t5)}),r5=se.b.struct({id:se.b.string(),name:se.b.string(),windows:se.b.vec(n5)}),i5=se.b.struct({deviceId:se.b.string(),session:se.b.option(r5)});se.b.struct({deviceId:se.b.string(),baseRevision:se.b.u32(),revision:se.b.u32(),diffFormat:se.b.u8(),diffBytes:se.b.bytes()});const a5=se.b.struct({sessionId:se.b.string()}),o5=se.b.struct({sessionId:se.b.string()}),s5=se.b.struct({sessionId:se.b.string(),seq:se.b.u32(),eventType:se.b.u8(),payload:se.b.bytes()}),l5=se.b.struct({ruleId:se.b.string(),deviceId:se.b.string(),paneId:se.b.string(),eventType:se.b.u8(),payload:se.b.bytes()}),c5=se.b.struct({windowId:se.b.string()}),u5=se.b.struct({windowId:se.b.string()}),d5=se.b.struct({windowId:se.b.string(),name:se.b.string()}),f5=se.b.struct({windowId:se.b.string()}),h5=se.b.struct({paneId:se.b.string(),windowId:se.b.string()}),p5=se.b.struct({paneId:se.b.string()}),m5=se.b.struct({windowId:se.b.string(),paneId:se.b.string()}),g5=se.b.struct({windowId:se.b.string(),layout:se.b.string()}),y5=se.b.struct({windowId:Mr,paneId:Mr,windowIndex:mc,paneIndex:mc,paneUrl:Mr}),b5=se.b.struct({source:se.b.u8(),title:Mr,body:se.b.string(),windowId:Mr,paneId:Mr,windowIndex:mc,paneIndex:mc,paneUrl:Mr}),vd=new Uint8Array([84,88]),v5=1;function Xh(e,t,n,r=0,a=v5){const o={magic:vd,version:a,kind:e,flags:r,seq:n,payload:t};return nA.serialize(o)}function tr(e,t){return e.serialize(t)}function x5(e){if(e.length<12)throw new ei(Qi,!1,"Envelope too small");if(e[0]!==vd[0]||e[1]!==vd[1])throw new ei(Qi,!1,"Invalid magic bytes");try{return nA.deserialize(e)}catch(t){throw new ei(Qi,!1,t instanceof Error?t.message:"Failed to decode envelope")}}function La(e,t){try{return e.deserialize(t)}catch(n){throw new ei(tA,!1,n instanceof Error?n.message:"Failed to decode payload")}}function w5(e,t){const n=iA.serialize(e);return Xh(1281,n,t)}function S5(e){return iA.deserialize(e)}function E5(e){return e.length>=2&&e[0]===vd[0]&&e[1]===vd[1]}const C5=5e3,ST=100,bv=1e3;class T5{constructor(){st(this,"streams",new Map);st(this,"lastCleanup",Date.now())}addChunk(t){if(this.cleanup(),t.totalChunks>bv)throw new ei(Qi,!1,`Too many chunks: ${t.totalChunks} > ${bv}`);if(t.chunkIndex>=t.totalChunks)throw new ei(Qi,!1,`Chunk index out of bounds: ${t.chunkIndex} >= ${t.totalChunks}`);let n=this.streams.get(t.chunkStreamId);if(!n){if(this.streams.size>=ST&&(this.cleanup(!0),this.streams.size>=ST))throw new ei(Qi,!1,"Too many concurrent chunk streams");n={chunks:new Map,totalChunks:t.totalChunks,createdAt:Date.now(),originalKind:t.originalKind,originalSeq:t.originalSeq},this.streams.set(t.chunkStreamId,n)}if(n.totalChunks!==t.totalChunks)throw this.streams.delete(t.chunkStreamId),new ei(Qi,!1,"Chunk total count mismatch");if(n.chunks.has(t.chunkIndex))throw new ei(Qi,!1,`Duplicate chunk index: ${t.chunkIndex}`);return n.chunks.set(t.chunkIndex,t),n.chunks.size===n.totalChunks?this.reassemble(t.chunkStreamId,n):null}reassemble(t,n){const r=[];let a=0;for(let c=0;c<n.totalChunks;c++){const f=n.chunks.get(c);if(!f)throw this.streams.delete(t),new ei(Qi,!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-C5;for(const[a,o]of this.streams)o.createdAt<r&&this.streams.delete(a)}getActiveStreamCount(){return this.streams.size}clear(){this.streams.clear()}}function R5(e,t,n,r){const{maxFrameBytes:a,chunkStreamId:o}=r,l=16,c=18,f=a-l;if(f<=0)throw new ei(Gh,!1,`maxFrameBytes too small: ${a}`);if(e.length<=f)return{chunks:[],totalChunks:0};const d=a-l-c;if(d<=0)throw new ei(Gh,!1,`maxFrameBytes too small for chunking: ${a}`);const m=Math.ceil(e.length/d);if(m>bv)throw new ei(Gh,!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 eb=1;function k5(){const e=eb;return eb=eb%4294967295+1,e}const M5={1:"osc9",2:"osc777",3:"osc1337",4:"osc99"};function A5(e){const t=_4.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 O5(e){const t=W4.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:N5(r,t.eventData)}}function N5(e,t){if(t.length===0)return{};try{switch(e){case"window-add":return c5.deserialize(t);case"window-close":return u5.deserialize(t);case"window-renamed":return d5.deserialize(t);case"window-active":return f5.deserialize(t);case"pane-add":return h5.deserialize(t);case"pane-close":return p5.deserialize(t);case"pane-active":return m5.deserialize(t);case"layout-change":return g5.deserialize(t);case"bell":{const n=y5.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=b5.deserialize(t);return{source:M5[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 D5(e){const t=i5.deserialize(e);return{deviceId:t.deviceId,session:t.session?I5(t.session):null}}function I5(e){return{id:e.id,name:e.name,windows:e.windows.map(P5)}}function P5(e){return{id:e.id,name:e.name,customName:e.customName??void 0,index:e.index,active:e.active,panes:e.panes.map(L5)}}function L5(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 j5(){const e=navigator.language;return e.startsWith("zh")?"zh_CN":e.startsWith("ja")?"ja_JP":Hx}En.use(u3).init({resources:y3,lng:j5(),fallbackLng:Hx,interpolation:{escapeValue:!1},returnNull:!1});const _5={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"},z5={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 F5(e){const t=e==="light"?_5:z5;return`fg=${t.foreground},bg=${t.background}`}const aA=["GeistMonoTmex","NotoSansSymbols2Tmex"],xee=`${aA.join(", ")}, monospace`;let Ll=null;function wee(){var t;if(Ll)return Ll;const e=(t=globalThis.document)==null?void 0:t.fonts;return e!=null&&e.load?(Ll=Promise.all(aA.flatMap(n=>[e.load(`13px ${n}`),e.load(`bold 13px ${n}`)])).then(()=>{}).catch(()=>{}),Ll):(Ll=Promise.resolve(),Ll)}const B5=`${typeof window<"u"&&window.location.protocol==="https:"?"wss:":"ws:"}//${typeof window<"u"?window.location.host:""}/ws`,H5={clientImpl:"tmex-fe",clientVersion:"0.1.0",maxFrameBytes:1048576,reconnectDelayMs:1e3,maxReconnectAttempts:5,heartbeatIntervalMs:15e3};class U5{constructor(t={}){st(this,"ws",null);st(this,"options");st(this,"state","IDLE");st(this,"seq",0);st(this,"chunkReassembler",new T5);st(this,"reconnectAttempts",0);st(this,"reconnectTimer",null);st(this,"heartbeatTimer",null);st(this,"messageHandlers",new Set);st(this,"stateChangeHandlers",new Set);st(this,"errorHandlers",new Set);st(this,"pendingMessages",[]);st(this,"maxPendingMessages",100);this.options={...H5,...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(B5),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(!E5(n)){console.warn("[borsh-client] Received message without magic, ignoring");return}try{const r=x5(n);if(r.kind===Q3){const a=S5(r.payload),o=this.chunkReassembler.addChunk(a);o&&this.dispatchMessage({kind:o.kind,seq:o.seq,payload:o.payload});return}if(r.kind===E3){this.handleHelloS2C(r.payload);return}if(r.kind===T3)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=La(N4,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(O4,t),r=this.nextSeq(),a=Xh(S3,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=R5(n,t,r,{maxFrameBytes:this.options.maxFrameBytes,chunkStreamId:k5()});if(a.totalChunks===0){const o=Xh(t,n,r);this.sendRaw(o)}else for(const o of a.chunks){const l=w5(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(D4,t),r=this.nextSeq(),a=Xh(C3,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 tb=null;function Nn(){return tb||(tb=new U5),tb}class V5{constructor(t={}){st(this,"transactions",new Map);st(this,"outputGates",new Map);st(this,"deferredResets",new Set);st(this,"deferredHistories",new Map);st(this,"deferredFlushes",new Map);st(this,"deferredOutputs",new Map);st(this,"callbacks");st(this,"ackTimeoutMs",1500);st(this,"liveResumeTimeoutMs",2e3);st(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 Pu=null;function xd(e){return Pu?(e&&Pu.setCallbacks(e),Pu):(Pu=new V5(e),Pu)}function q5(){return crypto.getRandomValues(new Uint8Array(16))}function oA(e){const t=tr(I4,{deviceId:e});return{kind:k3,payload:t}}function $5(e){const t=tr(L4,{deviceId:e});return{kind:A3,payload:t}}function Y5(e){const t=tr(z4,{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:D3,payload:t}}function W5(e,t){const n=tr(F4,{deviceId:e,windowId:t});return{kind:I3,payload:n}}function K5(e,t){const n=tr(B4,{deviceId:e,name:t??null});return{kind:P3,payload:n}}function G5(e,t){const n=tr(H4,{deviceId:e,windowId:t});return{kind:L3,payload:n}}function X5(e,t){const n=tr(U4,{deviceId:e,paneId:t});return{kind:j3,payload:n}}function Q5(e,t,n){const r=tr(V4,{deviceId:e,windowId:t,name:n});return{kind:_3,payload:r}}function Z5(e,t){const n=tr(q4,{deviceId:e,style:t});return{kind:B3,payload:n}}function J5(e,t){const n=tr($4,{deviceId:e,windowIds:t});return{kind:H3,payload:n}}function eF(e,t,n){const r=tr(Y4,{deviceId:e,windowId:t,paneIds:n});return{kind:U3,payload:r}}function tF(e,t,n,r=!1){const a=new TextEncoder,o=tr(K4,{deviceId:e,paneId:t,encoding:2,data:a.encode(n),isComposing:r});return{kind:V3,payload:o}}function nF(e,t,n){const r=new TextEncoder,a=tr(G4,{deviceId:e,paneId:t,encoding:2,data:r.encode(n),isComposing:!1});return{kind:q3,payload:a}}function rF(e,t,n,r){const a=tr(rA,{deviceId:e,paneId:t,cols:n,rows:r});return{kind:$3,payload:a}}function iF(e,t,n,r){const a=tr(X4,{deviceId:e,paneId:t,cols:n,rows:r});return{kind:Y3,payload:a}}function aF(e){const t=tr(a5,{sessionId:e});return{kind:Z3,payload:t}}function oF(e){const t=tr(o5,{sessionId:e});return{kind:J3,payload:t}}const ET=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},sF=(e=>e?ET(e):ET),lF=e=>e;function cF(e,t=lF){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 CT=e=>{const t=sF(e),n=r=>cF(t,r);return Object.assign(n,t),n},qp=(e=>e?CT(e):CT),nb={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:Hx,updatedAt:new Date(0).toISOString()};async function TT(){const e=await fetch("/api/settings/site");if(!e.ok)throw new Error("Failed to load site settings");return(await e.json()).settings}const Vs=qp((e,t)=>({settings:null,loading:!1,fetchSettings:async()=>{const n=t().settings;if(n)return n;e({loading:!0});try{const r=await TT();return e({settings:r,loading:!1}),En.changeLanguage(r.language),r}catch(r){return console.error("[site] failed to fetch settings:",r),e({settings:nb,loading:!1}),En.changeLanguage(nb.language),nb}},refreshSettings:async()=>{e({loading:!0});try{const n=await TT();return e({settings:n,loading:!1}),En.changeLanguage(n.language),n}catch(n){throw console.error("[site] failed to refresh settings:",n),e({loading:!1}),n}}}));function uF(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 dF(e){const t=typeof e.title=="string"&&e.title?e.title:"Terminal Notification",n=uF(e),r=typeof e.body=="string"&&e.body?e.body:typeof e.source=="string"&&e.source?`From ${e.source}`:"Terminal notification";return{title:t,description:n?`${n}
86
- ${r}`:r}}function fF(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 vv=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return vv(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return vv(r)(n)}}}},hF=(e,t)=>(n,r,a)=>{let o={storage:fF(()=>window.localStorage),partialize:T=>T,version:0,merge:(T,S)=>({...S,...T}),...t},l=!1,c=0;const f=new Set,d=new Set;let m=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,S)=>(y(T,S),h());const g=e((...T)=>(n(...T),h()),r,a);a.getInitialState=()=>g;let w;const C=()=>{var T,S;if(!m)return;const R=++c;l=!1,f.forEach(M=>{var D;return M((D=r())!=null?D:g)});const k=((S=o.onRehydrateStorage)==null?void 0:S.call(o,(T=r())!=null?T:g))||void 0;return vv(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(A=>[!0,A]):[!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[A,O]=M;if(w=o.merge(O,(D=r())!=null?D:g),n(w,!0),A)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},sA=hF,ra=qp()(sA(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}}})),pF=500,RT=new Map,rb=new Map;function lA(e){const t=Date.now(),n=RT.get(e);return n!==void 0&&t-n<pF?!0:(RT.set(e,t),!1)}let kT=!1;function ib(e){const t=F5(ra.getState().theme),n=Z5(e,t);Nn().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 mF(e,t){if(kT)return;kT=!0;const n=Nn(),r=o=>{const l=t().selectedPanes[o];!l||xd().getTransaction(o)||t().selectPane(o,l.windowId,l.paneId)};n.onStateChange(o=>{e({socketReady:o==="READY"})}),n.onMessage(o=>{const l=xd();switch(o.kind){case M3:{const c=La(P4,o.payload);e(f=>({deviceConnected:{...f.deviceConnected,[c.deviceId]:!0},deviceErrors:{...f.deviceErrors,[c.deviceId]:void 0},deviceReconnecting:{...f.deviceReconnecting,[c.deviceId]:void 0}})),ib(c.deviceId),r(c.deviceId);return}case O3:{const c=La(j4,o.payload);l.cleanup(c.deviceId),e(f=>({deviceConnected:{...f.deviceConnected,[c.deviceId]:!1}}));return}case N3:{const c=A5(o.payload);gF(e,c),c.type==="reconnected"&&(ib(c.deviceId),r(c.deviceId));return}case F3:{const c=D5(o.payload);e(f=>({snapshots:{...f.snapshots,[c.deviceId]:c}}));return}case z3:{const c=O5(o.payload);yF(e,c);return}case G3:{const c=La(J4,o.payload);l.dispatch({type:"SWITCH_ACK",deviceId:c.deviceId,selectToken:c.selectToken});return}case K3:{const c=La(Z4,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 X3:{const c=La(e5,o.payload);l.dispatch({type:"LIVE_RESUME",deviceId:c.deviceId,selectToken:c.selectToken});return}case W3:{const c=La(Q4,o.payload);l.dispatch({type:"OUTPUT",deviceId:c.deviceId,paneId:c.paneId,data:c.data});return}case R3:return}}),n.onError(o=>{console.error("[tmux] borsh ws error:",o),e({socketReady:!1}),mn.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(lA(c))continue;const f=oA(c);n.send(f.kind,f.payload)}});let a=ra.getState().theme;ra.subscribe(o=>{if(o.theme===a)return;a=o.theme;const l=t();for(const c of l.connectedDevices)l.deviceConnected[c]&&ib(c)})}function gF(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)&&mn.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"){xd().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 yF(e,t){if(t.type==="bell"){console.log("[tmex] bell",t.data);const n=Vs.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;mn(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=Vs.getState().settings;if((n==null?void 0:n.enableBrowserNotificationToast)===!1)return;const r=t.data??{},{title:a,description:o}=dF(r),l=typeof r.paneUrl=="string"?r.paneUrl:void 0;mn(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 qn=qp((e,t)=>({socketReady:!1,snapshots:{},connectedDevices:new Set,deviceConnected:{},deviceErrors:{},deviceReconnecting:{},selectedPanes:{},activePaneFromEvent:{},pendingCreateWindowAt:{},ensureSocketConnected(){mF(e,t),Nn().connect()},connectDevice(n){if(!n||(e(a=>{const o=new Set(a.connectedDevices);return o.add(n),{connectedDevices:o}}),t().ensureSocketConnected(),lA(n)))return;const r=oA(n);Nn().send(r.kind,r.payload)},disconnectDevice(n){if(!n)return;e(a=>{const o=new Set(a.connectedDevices);return o.delete(n),{connectedDevices:o}}),xd().cleanup(n);const r=$5(n);Nn().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=q5(),c=!0;xd().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)??rb.get(n)??null,d=Y5({deviceId:n,windowId:r,paneId:a,selectToken:l,wantHistory:c,cols:f==null?void 0:f.cols,rows:f==null?void 0:f.rows});Nn().send(d.kind,d.payload)},selectWindow(n,r){if(!n||!r)return;const a=W5(n,r);Nn().send(a.kind,a.payload)},sendInput(n,r,a,o=!1){if(!n||!r)return;const l=tF(n,r,a,o);Nn().send(l.kind,l.payload)},resizePane(n,r,a,o){if(!n||!r)return;const l=ab(a,o);l&&rb.set(n,{...l,at:Date.now()});const c=rF(n,r,a,o);Nn().send(c.kind,c.payload)},syncPaneSize(n,r,a,o){if(!n||!r)return;const l=ab(a,o);l&&rb.set(n,{...l,at:Date.now()});const c=iF(n,r,a,o);Nn().send(c.kind,c.payload)},paste(n,r,a){if(!n||!r)return;const o=nF(n,r,a);Nn().send(o.kind,o.payload)},createWindow(n,r){if(!n)return;const a=K5(n,r);Nn().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=G5(n,r);Nn().send(a.kind,a.payload)},closePane(n,r){if(!n||!r)return;const a=X5(n,r);Nn().send(a.kind,a.payload)},renameWindow(n,r,a){if(!n||!r)return;const o=Q5(n,r,a);Nn().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=J5(n,r);Nn().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=eF(n,r,a);Nn().send(o.kind,o.payload)}})),MT="tmex:connectedDevices",cA=v.createContext(null);function bF(){const e=v.useContext(cA);if(!e)throw new Error("useGlobalDevice must be used within GlobalDeviceProvider");return e}function vF({children:e}){const t=sa(),[n,r]=v.useState(()=>{try{const h=localStorage.getItem(MT);if(h){const y=JSON.parse(h);return new Set(y)}}catch{}return new Set}),a=qn(h=>h.connectDevice),o=qn(h=>h.disconnectDevice),l=qn(h=>h.connectedDevices);v.useEffect(()=>{try{localStorage.setItem(MT,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 E.jsx(cA.Provider,{value:m,children:e})}/**
87
- * @license lucide-react v0.564.0 - ISC
88
- *
89
- * This source code is licensed under the ISC license.
90
- * See the LICENSE file in the root directory of this source tree.
91
- */const uA=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
92
- * @license lucide-react v0.564.0 - ISC
93
- *
94
- * This source code is licensed under the ISC license.
95
- * See the LICENSE file in the root directory of this source tree.
96
- */const xF=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
97
- * @license lucide-react v0.564.0 - ISC
98
- *
99
- * This source code is licensed under the ISC license.
100
- * See the LICENSE file in the root directory of this source tree.
101
- */const wF=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
102
- * @license lucide-react v0.564.0 - ISC
103
- *
104
- * This source code is licensed under the ISC license.
105
- * See the LICENSE file in the root directory of this source tree.
106
- */const AT=e=>{const t=wF(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
107
- * @license lucide-react v0.564.0 - ISC
108
- *
109
- * This source code is licensed under the ISC license.
110
- * See the LICENSE file in the root directory of this source tree.
111
- */var SF={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
112
- * @license lucide-react v0.564.0 - ISC
113
- *
114
- * This source code is licensed under the ISC license.
115
- * See the LICENSE file in the root directory of this source tree.
116
- */const EF=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
117
- * @license lucide-react v0.564.0 - ISC
118
- *
119
- * This source code is licensed under the ISC license.
120
- * See the LICENSE file in the root directory of this source tree.
121
- */const CF=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,...SF,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:uA("lucide",a),...!o&&!EF(c)&&{"aria-hidden":"true"},...c},[...l.map(([d,m])=>v.createElement(d,m)),...Array.isArray(o)?o:[o]]));/**
122
- * @license lucide-react v0.564.0 - ISC
123
- *
124
- * This source code is licensed under the ISC license.
125
- * See the LICENSE file in the root directory of this source tree.
126
- */const Lt=(e,t)=>{const n=v.forwardRef(({className:r,...a},o)=>v.createElement(CF,{ref:o,iconNode:t,className:uA(`lucide-${xF(AT(e))}`,`lucide-${e}`,r),...a}));return n.displayName=AT(e),n};/**
127
- * @license lucide-react v0.564.0 - ISC
128
- *
129
- * This source code is licensed under the ISC license.
130
- * See the LICENSE file in the root directory of this source tree.
131
- */const TF=[["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"}]],RF=Lt("activity",TF);/**
132
- * @license lucide-react v0.564.0 - ISC
133
- *
134
- * This source code is licensed under the ISC license.
135
- * See the LICENSE file in the root directory of this source tree.
136
- */const kF=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],MF=Lt("arrow-down",kF);/**
137
- * @license lucide-react v0.564.0 - ISC
138
- *
139
- * This source code is licensed under the ISC license.
140
- * See the LICENSE file in the root directory of this source tree.
141
- */const AF=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],OF=Lt("arrow-left",AF);/**
142
- * @license lucide-react v0.564.0 - ISC
143
- *
144
- * This source code is licensed under the ISC license.
145
- * See the LICENSE file in the root directory of this source tree.
146
- */const NF=[["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"}]],DF=Lt("bell",NF);/**
147
- * @license lucide-react v0.564.0 - ISC
148
- *
149
- * This source code is licensed under the ISC license.
150
- * See the LICENSE file in the root directory of this source tree.
151
- */const IF=[["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"}]],Ux=Lt("bot",IF);/**
152
- * @license lucide-react v0.564.0 - ISC
153
- *
154
- * This source code is licensed under the ISC license.
155
- * See the LICENSE file in the root directory of this source tree.
156
- */const PF=[["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"}]],LF=Lt("brain",PF);/**
157
- * @license lucide-react v0.564.0 - ISC
158
- *
159
- * This source code is licensed under the ISC license.
160
- * See the LICENSE file in the root directory of this source tree.
161
- */const jF=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],hp=Lt("check",jF);/**
162
- * @license lucide-react v0.564.0 - ISC
163
- *
164
- * This source code is licensed under the ISC license.
165
- * See the LICENSE file in the root directory of this source tree.
166
- */const _F=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],dA=Lt("chevron-down",_F);/**
167
- * @license lucide-react v0.564.0 - ISC
168
- *
169
- * This source code is licensed under the ISC license.
170
- * See the LICENSE file in the root directory of this source tree.
171
- */const zF=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],$p=Lt("chevron-right",zF);/**
172
- * @license lucide-react v0.564.0 - ISC
173
- *
174
- * This source code is licensed under the ISC license.
175
- * See the LICENSE file in the root directory of this source tree.
176
- */const FF=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],BF=Lt("chevron-up",FF);/**
177
- * @license lucide-react v0.564.0 - ISC
178
- *
179
- * This source code is licensed under the ISC license.
180
- * See the LICENSE file in the root directory of this source tree.
181
- */const HF=[["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"}]],ed=Lt("circle-alert",HF);/**
182
- * @license lucide-react v0.564.0 - ISC
183
- *
184
- * This source code is licensed under the ISC license.
185
- * See the LICENSE file in the root directory of this source tree.
186
- */const UF=[["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"}]],fA=Lt("ellipsis-vertical",UF);/**
187
- * @license lucide-react v0.564.0 - ISC
188
- *
189
- * This source code is licensed under the ISC license.
190
- * See the LICENSE file in the root directory of this source tree.
191
- */const VF=[["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"}]],qF=Lt("ellipsis",VF);/**
192
- * @license lucide-react v0.564.0 - ISC
193
- *
194
- * This source code is licensed under the ISC license.
195
- * See the LICENSE file in the root directory of this source tree.
196
- */const $F=[["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"}]],YF=Lt("folder-closed",$F);/**
197
- * @license lucide-react v0.564.0 - ISC
198
- *
199
- * This source code is licensed under the ISC license.
200
- * See the LICENSE file in the root directory of this source tree.
201
- */const WF=[["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"}]],KF=Lt("folder",WF);/**
202
- * @license lucide-react v0.564.0 - ISC
203
- *
204
- * This source code is licensed under the ISC license.
205
- * See the LICENSE file in the root directory of this source tree.
206
- */const GF=[["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"}]],hA=Lt("globe",GF);/**
207
- * @license lucide-react v0.564.0 - ISC
208
- *
209
- * This source code is licensed under the ISC license.
210
- * See the LICENSE file in the root directory of this source tree.
211
- */const XF=[["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"}]],Vx=Lt("grip-vertical",XF);/**
212
- * @license lucide-react v0.564.0 - ISC
213
- *
214
- * This source code is licensed under the ISC license.
215
- * See the LICENSE file in the root directory of this source tree.
216
- */const QF=[["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"}]],ZF=Lt("history",QF);/**
217
- * @license lucide-react v0.564.0 - ISC
218
- *
219
- * This source code is licensed under the ISC license.
220
- * See the LICENSE file in the root directory of this source tree.
221
- */const JF=[["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"}]],eB=Lt("keyboard",JF);/**
222
- * @license lucide-react v0.564.0 - ISC
223
- *
224
- * This source code is licensed under the ISC license.
225
- * See the LICENSE file in the root directory of this source tree.
226
- */const tB=[["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"}]],nB=Lt("list-tree",tB);/**
227
- * @license lucide-react v0.564.0 - ISC
228
- *
229
- * This source code is licensed under the ISC license.
230
- * See the LICENSE file in the root directory of this source tree.
231
- */const rB=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],gc=Lt("loader-circle",rB);/**
232
- * @license lucide-react v0.564.0 - ISC
233
- *
234
- * This source code is licensed under the ISC license.
235
- * See the LICENSE file in the root directory of this source tree.
236
- */const iB=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],aB=Lt("menu",iB);/**
237
- * @license lucide-react v0.564.0 - ISC
238
- *
239
- * This source code is licensed under the ISC license.
240
- * See the LICENSE file in the root directory of this source tree.
241
- */const oB=[["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"}]],qx=Lt("monitor",oB);/**
242
- * @license lucide-react v0.564.0 - ISC
243
- *
244
- * This source code is licensed under the ISC license.
245
- * See the LICENSE file in the root directory of this source tree.
246
- */const sB=[["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"}]],lB=Lt("moon",sB);/**
247
- * @license lucide-react v0.564.0 - ISC
248
- *
249
- * This source code is licensed under the ISC license.
250
- * See the LICENSE file in the root directory of this source tree.
251
- */const cB=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],uB=Lt("panel-left",cB);/**
252
- * @license lucide-react v0.564.0 - ISC
253
- *
254
- * This source code is licensed under the ISC license.
255
- * See the LICENSE file in the root directory of this source tree.
256
- */const dB=[["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"}]],fB=Lt("panels-top-left",dB);/**
257
- * @license lucide-react v0.564.0 - ISC
258
- *
259
- * This source code is licensed under the ISC license.
260
- * See the LICENSE file in the root directory of this source tree.
261
- */const hB=[["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"}]],Yp=Lt("pencil",hB);/**
262
- * @license lucide-react v0.564.0 - ISC
263
- *
264
- * This source code is licensed under the ISC license.
265
- * See the LICENSE file in the root directory of this source tree.
266
- */const pB=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Wp=Lt("plus",pB);/**
267
- * @license lucide-react v0.564.0 - ISC
268
- *
269
- * This source code is licensed under the ISC license.
270
- * See the LICENSE file in the root directory of this source tree.
271
- */const mB=[["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"}]],gB=Lt("power-off",mB);/**
272
- * @license lucide-react v0.564.0 - ISC
273
- *
274
- * This source code is licensed under the ISC license.
275
- * See the LICENSE file in the root directory of this source tree.
276
- */const yB=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],bB=Lt("power",yB);/**
277
- * @license lucide-react v0.564.0 - ISC
278
- *
279
- * This source code is licensed under the ISC license.
280
- * See the LICENSE file in the root directory of this source tree.
281
- */const vB=[["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"}]],xB=Lt("radar",vB);/**
282
- * @license lucide-react v0.564.0 - ISC
283
- *
284
- * This source code is licensed under the ISC license.
285
- * See the LICENSE file in the root directory of this source tree.
286
- */const wB=[["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"}]],SB=Lt("refresh-ccw",wB);/**
287
- * @license lucide-react v0.564.0 - ISC
288
- *
289
- * This source code is licensed under the ISC license.
290
- * See the LICENSE file in the root directory of this source tree.
291
- */const EB=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],CB=Lt("search",EB);/**
292
- * @license lucide-react v0.564.0 - ISC
293
- *
294
- * This source code is licensed under the ISC license.
295
- * See the LICENSE file in the root directory of this source tree.
296
- */const TB=[["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"}]],OT=Lt("send",TB);/**
297
- * @license lucide-react v0.564.0 - ISC
298
- *
299
- * This source code is licensed under the ISC license.
300
- * See the LICENSE file in the root directory of this source tree.
301
- */const RB=[["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"}]],kB=Lt("settings",RB);/**
302
- * @license lucide-react v0.564.0 - ISC
303
- *
304
- * This source code is licensed under the ISC license.
305
- * See the LICENSE file in the root directory of this source tree.
306
- */const MB=[["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"}]],pA=Lt("sparkles",MB);/**
307
- * @license lucide-react v0.564.0 - ISC
308
- *
309
- * This source code is licensed under the ISC license.
310
- * See the LICENSE file in the root directory of this source tree.
311
- */const AB=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],OB=Lt("square",AB);/**
312
- * @license lucide-react v0.564.0 - ISC
313
- *
314
- * This source code is licensed under the ISC license.
315
- * See the LICENSE file in the root directory of this source tree.
316
- */const NB=[["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"}]],DB=Lt("sun",NB);/**
317
- * @license lucide-react v0.564.0 - ISC
318
- *
319
- * This source code is licensed under the ISC license.
320
- * See the LICENSE file in the root directory of this source tree.
321
- */const IB=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],PB=Lt("terminal",IB);/**
322
- * @license lucide-react v0.564.0 - ISC
323
- *
324
- * This source code is licensed under the ISC license.
325
- * See the LICENSE file in the root directory of this source tree.
326
- */const LB=[["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"}]],mA=Lt("trash-2",LB);/**
327
- * @license lucide-react v0.564.0 - ISC
328
- *
329
- * This source code is licensed under the ISC license.
330
- * See the LICENSE file in the root directory of this source tree.
331
- */const jB=[["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"}]],_B=Lt("wrench",jB);/**
332
- * @license lucide-react v0.564.0 - ISC
333
- *
334
- * This source code is licensed under the ISC license.
335
- * See the LICENSE file in the root directory of this source tree.
336
- */const zB=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ua=Lt("x",zB);/**
337
- * @license lucide-react v0.564.0 - ISC
338
- *
339
- * This source code is licensed under the ISC license.
340
- * See the LICENSE file in the root directory of this source tree.
341
- */const FB=[["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"}]],gA=Lt("zap",FB);function Kp(){return typeof window<"u"}function Wo(e){return $x(e)?(e.nodeName||"").toLowerCase():"#document"}function Bn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function la(e){var t;return(t=($x(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function $x(e){return Kp()?e instanceof Node||e instanceof Bn(e).Node:!1}function cn(e){return Kp()?e instanceof Element||e instanceof Bn(e).Element:!1}function kn(e){return Kp()?e instanceof HTMLElement||e instanceof Bn(e).HTMLElement:!1}function xv(e){return!Kp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Bn(e).ShadowRoot}const BB=new Set(["inline","contents"]);function Ko(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=ii(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!BB.has(a)}const HB=new Set(["table","td","th"]);function UB(e){return HB.has(Wo(e))}const VB=[":popover-open",":modal"];function Gp(e){return VB.some(t=>{try{return e.matches(t)}catch{return!1}})}const qB=["transform","translate","scale","rotate","perspective"],$B=["transform","translate","scale","rotate","perspective","filter"],YB=["paint","layout","strict","content"];function Yx(e){const t=Xp(),n=cn(e)?ii(e):e;return qB.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)||$B.some(r=>(n.willChange||"").includes(r))||YB.some(r=>(n.contain||"").includes(r))}function WB(e){let t=ia(e);for(;kn(t)&&!ea(t);){if(Yx(t))return t;if(Gp(t))return null;t=ia(t)}return null}function Xp(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const KB=new Set(["html","body","#document"]);function ea(e){return KB.has(Wo(e))}function ii(e){return Bn(e).getComputedStyle(e)}function Qp(e){return cn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ia(e){if(Wo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||xv(e)&&e.host||la(e);return xv(t)?t.host:t}function yA(e){const t=ia(e);return ea(t)?e.ownerDocument?e.ownerDocument.body:e.body:kn(t)&&Ko(t)?t:yA(t)}function Fo(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=yA(e),o=a===((r=e.ownerDocument)==null?void 0:r.body),l=Bn(a);if(o){const c=wv(l);return t.concat(l,l.visualViewport||[],Ko(a)?a:[],c&&n?Fo(c):[])}return t.concat(a,Fo(a,[],n))}function wv(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const NT={};function nr(e,t){const n=v.useRef(NT);return n.current===NT&&(n.current=e(t)),n}const ob=Tx[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],GB=ob&&ob!==v.useLayoutEffect?ob:e=>e();function Ye(e){const t=nr(XB).current;return t.next=e,GB(t.effect),t.trampoline}function XB(){const e={next:void 0,callback:QB,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function QB(){}const ZB={...Tx},JB=()=>{},Ve=typeof document<"u"?v.useLayoutEffect:JB;function Sv(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}const td={};function Ei(e,t,n,r,a){let o={...Ev(e,td)};return t&&(o=Ku(o,t)),n&&(o=Ku(o,n)),r&&(o=Ku(o,r)),a&&(o=Ku(o,a)),o}function eH(e){if(e.length===0)return td;if(e.length===1)return Ev(e[0],td);let t={...Ev(e[0],td)};for(let n=1;n<e.length;n+=1)t=Ku(t,e[n]);return t}function Ku(e,t){return bA(t)?t(e):tH(e,t)}function tH(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":{e[n]=Sv(e.style,r);break}case"className":{e[n]=vA(e.className,r);break}default:nH(n,r)?e[n]=rH(e[n],r):e[n]=r}}return e}function nH(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 bA(e){return typeof e=="function"}function Ev(e,t){return bA(e)?e(t):e??td}function rH(e,t){return t?e?n=>{if(iH(n)){const a=n;Cv(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 Cv(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function vA(e,t){return t?e?t+" "+e:t:e}function iH(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 xA=v.createContext(void 0);function Wx(e=!1){const t=v.useContext(xA);if(t===void 0&&!e)throw new Error(Cn(16));return t}function aH(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 qa(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:a=!0}=e,o=v.useRef(null),l=Wx(!0)!==void 0,c=Ye(()=>{const y=o.current;return!!((y==null?void 0:y.tagName)==="A"&&(y!=null&&y.href))}),{props:f}=aH({focusableWhenDisabled:n,disabled:t,composite:l,tabIndex:r,isNativeButton:a}),d=v.useCallback(()=>{const y=o.current;oH(y)&&l&&t&&f.disabled===void 0&&y.disabled&&(y.disabled=!1)},[t,f.disabled,l]);Ve(d,[d]);const m=v.useCallback((y={})=>{const{onClick:g,onMouseDown:w,onKeyUp:C,onKeyDown:T,onPointerDown:S,...R}=y;return Ei({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||(Cv(M),T==null||T(M)),M.baseUIHandlerPrevented)return;const D=M.target===M.currentTarget&&!a&&!c()&&!t,A=M.key==="Enter",O=M.key===" ";D&&((O||A)&&M.preventDefault(),A&&(g==null||g(M)))},onKeyUp(M){t||(Cv(M),C==null||C(M)),!M.baseUIHandlerPrevented&&M.target===M.currentTarget&&!a&&!t&&M.key===" "&&(g==null||g(M))},onPointerDown(M){if(t){M.preventDefault();return}S==null||S(M)}},a?void 0:{role:"button"},f,R)},[t,f,a,c]),h=Ye(y=>{o.current=y,d()});return{getButtonProps:m,buttonRef:h}}function oH(e){return kn(e)&&e.tagName==="BUTTON"}function _i(e,t,n,r){const a=nr(wA).current;return lH(a,e,t,n,r)&&SA(a,[e,t,n,r]),a.callback}function sH(e){const t=nr(wA).current;return cH(t,e)&&SA(t,e),t.callback}function wA(){return{callback:null,cleanup:null,refs:[]}}function lH(e,t,n,r,a){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==a}function cH(e,t){return e.refs.length!==t.length||e.refs.some((n,r)=>n!==t[r])}function SA(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 uH=parseInt(v.version,10);function Kx(e){return uH>=e}function DT(e){if(!v.isValidElement(e))return null;const t=e,n=t.props;return(Kx(19)?n==null?void 0:n.ref:t.ref)??null}function dH(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 fH(e,t){return typeof e=="function"?e(t):e}function hH(e,t){return typeof e=="function"?e(t):e}function Br(){}const qo=Object.freeze([]),Dn=Object.freeze({}),pH=500,mH=500,gH={style:{transition:"none"}},yH="data-base-ui-click-trigger",EA={fallbackAxisSide:"none"},CA={fallbackAxisSide:"end"},bH={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function Dt(e,t,n={}){const r=t.render,a=vH(t,n);if(n.enabled===!1)return null;const o=n.state??Dn;return wH(e,r,a,o)}function vH(e,t={}){const{className:n,style:r,render:a}=e,{state:o=Dn,ref:l,props:c,stateAttributesMapping:f,enabled:d=!0}=t,m=d?fH(n,o):void 0,h=d?hH(r,o):void 0,y=d?dH(o,f):Dn,g=d?Sv(y,Array.isArray(c)?eH(c):c)??Dn:Dn;return typeof document<"u"&&(d?Array.isArray(l)?g.ref=sH([g.ref,DT(a),...l]):g.ref=_i(g.ref,DT(a),l):_i(null,null)),d?(m!==void 0&&(g.className=vA(g.className,m)),h!==void 0&&(g.style=Sv(g.style,h)),g):Dn}const xH=Symbol.for("react.lazy");function wH(e,t,n,r){if(t){if(typeof t=="function")return t(n,r);const a=Ei(n,t.props);a.ref=n.ref;let o=t;return(o==null?void 0:o.$$typeof)===xH&&(o=v.Children.toArray(t)[0]),v.cloneElement(o,a)}if(e&&typeof e=="string")return SH(e,n);throw new Error(Cn(8))}function SH(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)}const EH=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}=qa({disabled:o,focusableWhenDisabled:l,native:c});return Dt("button",t,{state:{disabled:o},ref:[n,m],props:[f,d]})});function TA(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=TA(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function RA(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=TA(e))&&(r&&(r+=" "),r+=t);return r}const IT=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,PT=RA,Zp=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return PT(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=IT(m)||IT(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 PT(e,l,f,n==null?void 0:n.class,n==null?void 0:n.className)},CH=(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},TH=(e,t)=>({classGroupId:e,validator:t}),kA=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),pp="-",LT=[],RH="arbitrary..",kH=e=>{const t=AH(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return MH(l);const c=l.split(pp),f=c[0]===""&&c.length>1?1:0;return MA(c,f,t)},getConflictingClassGroupIds:(l,c)=>{if(c){const f=r[l],d=n[l];return f?d?CH(d,f):f:d||LT}return n[l]||LT}}},MA=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const a=e[t],o=n.nextPart.get(a);if(o){const d=MA(e,t+1,o);if(d)return d}const l=n.validators;if(l===null)return;const c=t===0?e.join(pp):e.slice(t).join(pp),f=l.length;for(let d=0;d<f;d++){const m=l[d];if(m.validator(c))return m.classGroupId}},MH=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?RH+r:void 0})(),AH=e=>{const{theme:t,classGroups:n}=e;return OH(n,t)},OH=(e,t)=>{const n=kA();for(const r in e){const a=e[r];Gx(a,n,r,t)}return n},Gx=(e,t,n,r)=>{const a=e.length;for(let o=0;o<a;o++){const l=e[o];NH(l,t,n,r)}},NH=(e,t,n,r)=>{if(typeof e=="string"){DH(e,t,n);return}if(typeof e=="function"){IH(e,t,n,r);return}PH(e,t,n,r)},DH=(e,t,n)=>{const r=e===""?t:AA(t,e);r.classGroupId=n},IH=(e,t,n,r)=>{if(LH(e)){Gx(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(TH(n,e))},PH=(e,t,n,r)=>{const a=Object.entries(e),o=a.length;for(let l=0;l<o;l++){const[c,f]=a[l];Gx(f,AA(t,c),n,r)}},AA=(e,t)=>{let n=e;const r=t.split(pp),a=r.length;for(let o=0;o<a;o++){const l=r[o];let c=n.nextPart.get(l);c||(c=kA(),n.nextPart.set(l,c)),n=c}return n},LH=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,jH=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)}}},Tv="!",jT=":",_H=[],_T=(e,t,n,r,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:a}),zH=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===jT){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(Tv)?(y=h.slice(0,-1),g=!0):h.startsWith(Tv)&&(y=h.slice(1),g=!0);const w=d&&d>f?d-f:void 0;return _T(o,g,y,w)};if(t){const a=t+jT,o=r;r=l=>l.startsWith(a)?o(l.slice(a.length)):_T(_H,!1,l,void 0,!0)}if(n){const a=r;r=o=>n({className:o,parseClassName:a})}return r},FH=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}},BH=e=>({cache:jH(e.cacheSize),parseClassName:zH(e),sortModifiers:FH(e),...kH(e)}),HH=/\s+/,UH=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:o}=t,l=[],c=e.trim().split(HH);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,S=r(T?w.substring(0,C):w);if(!S){if(!T){f=m+(f.length>0?" "+f:f);continue}if(S=r(w),!S){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+Tv:R,M=k+S;if(l.indexOf(M)>-1)continue;l.push(M);const D=a(S,T);for(let A=0;A<D.length;++A){const O=D[A];l.push(k+O)}f=m+(f.length>0?" "+f:f)}return f},VH=(...e)=>{let t=0,n,r,a="";for(;t<e.length;)(n=e[t++])&&(r=OA(n))&&(a&&(a+=" "),a+=r);return a},OA=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=OA(e[r]))&&(n&&(n+=" "),n+=t);return n},qH=(e,...t)=>{let n,r,a,o;const l=f=>{const d=t.reduce((m,h)=>h(m),e());return n=BH(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=UH(f,n);return a(f,m),m};return o=l,(...f)=>o(VH(...f))},$H=[],Zn=e=>{const t=n=>n[e]||$H;return t.isThemeGetter=!0,t},NA=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,DA=/^\((?:(\w[\w-]*):)?(.+)\)$/i,YH=/^\d+\/\d+$/,WH=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,KH=/\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$/,GH=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,XH=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,QH=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,jl=e=>YH.test(e),Ut=e=>!!e&&!Number.isNaN(Number(e)),vo=e=>!!e&&Number.isInteger(Number(e)),sb=e=>e.endsWith("%")&&Ut(e.slice(0,-1)),Oa=e=>WH.test(e),ZH=()=>!0,JH=e=>KH.test(e)&&!GH.test(e),IA=()=>!1,eU=e=>XH.test(e),tU=e=>QH.test(e),nU=e=>!lt(e)&&!ct(e),rU=e=>kc(e,jA,IA),lt=e=>NA.test(e),ws=e=>kc(e,_A,JH),lb=e=>kc(e,lU,Ut),zT=e=>kc(e,PA,IA),iU=e=>kc(e,LA,tU),Sh=e=>kc(e,zA,eU),ct=e=>DA.test(e),Lu=e=>Mc(e,_A),aU=e=>Mc(e,cU),FT=e=>Mc(e,PA),oU=e=>Mc(e,jA),sU=e=>Mc(e,LA),Eh=e=>Mc(e,zA,!0),kc=(e,t,n)=>{const r=NA.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Mc=(e,t,n=!1)=>{const r=DA.exec(e);return r?r[1]?t(r[1]):n:!1},PA=e=>e==="position"||e==="percentage",LA=e=>e==="image"||e==="url",jA=e=>e==="length"||e==="size"||e==="bg-size",_A=e=>e==="length",lU=e=>e==="number",cU=e=>e==="family-name",zA=e=>e==="shadow",uU=()=>{const e=Zn("color"),t=Zn("font"),n=Zn("text"),r=Zn("font-weight"),a=Zn("tracking"),o=Zn("leading"),l=Zn("breakpoint"),c=Zn("container"),f=Zn("spacing"),d=Zn("radius"),m=Zn("shadow"),h=Zn("inset-shadow"),y=Zn("text-shadow"),g=Zn("drop-shadow"),w=Zn("blur"),C=Zn("perspective"),T=Zn("aspect"),S=Zn("ease"),R=Zn("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],A=()=>["auto","hidden","clip","visible","scroll"],O=()=>["auto","contain","none"],L=()=>[ct,lt,f],V=()=>[jl,"full","auto",...L()],F=()=>[vo,"none","subgrid",ct,lt],W=()=>["auto",{span:["full",vo,ct,lt]},vo,ct,lt],j=()=>[vo,"auto",ct,lt],q=()=>["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"],_=()=>["auto",...L()],z=()=>[jl,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...L()],H=()=>[e,ct,lt],K=()=>[...M(),FT,zT,{position:[ct,lt]}],P=()=>["no-repeat",{repeat:["","x","y","space","round"]}],U=()=>["auto","cover","contain",oU,rU,{size:[ct,lt]}],G=()=>[sb,Lu,ws],I=()=>["","none","full",d,ct,lt],Q=()=>["",Ut,Lu,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=()=>[Ut,sb,FT,zT],ue=()=>["","none",w,ct,lt],ve=()=>["none",Ut,ct,lt],Se=()=>["none",Ut,ct,lt],Pe=()=>[Ut,ct,lt],te=()=>[jl,"full",...L()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Oa],breakpoint:[Oa],color:[ZH],container:[Oa],"drop-shadow":[Oa],ease:["in","out","in-out"],font:[nU],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Oa],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Oa],shadow:[Oa],spacing:["px",Ut],text:[Oa],"text-shadow":[Oa],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",jl,lt,ct,T]}],container:["container"],columns:[{columns:[Ut,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:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:V()}],"inset-x":[{"inset-x":V()}],"inset-y":[{"inset-y":V()}],start:[{start:V()}],end:[{end:V()}],top:[{top:V()}],right:[{right:V()}],bottom:[{bottom:V()}],left:[{left:V()}],visibility:["visible","invisible","collapse"],z:[{z:[vo,"auto",ct,lt]}],basis:[{basis:[jl,"full","auto",c,...L()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ut,jl,"auto","initial","none",lt]}],grow:[{grow:["",Ut,ct,lt]}],shrink:[{shrink:["",Ut,ct,lt]}],order:[{order:[vo,"first","last","none",ct,lt]}],"grid-cols":[{"grid-cols":F()}],"col-start-end":[{col:W()}],"col-start":[{"col-start":j()}],"col-end":[{"col-end":j()}],"grid-rows":[{"grid-rows":F()}],"row-start-end":[{row:W()}],"row-start":[{"row-start":j()}],"row-end":[{"row-end":j()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":q()}],"auto-rows":[{"auto-rows":q()}],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:_()}],mx:[{mx:_()}],my:[{my:_()}],ms:[{ms:_()}],me:[{me:_()}],mt:[{mt:_()}],mr:[{mr:_()}],mb:[{mb:_()}],ml:[{ml:_()}],"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,Lu,ws]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ct,lb]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",sb,lt]}],"font-family":[{font:[aU,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":[Ut,"none",ct,lb]}],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:[Ut,"from-font","auto",ct,ws]}],"text-decoration-color":[{decoration:H()}],"underline-offset":[{"underline-offset":[Ut,"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"]},vo,ct,lt],radial:["",ct,lt],conic:[vo,ct,lt]},sU,iU]}],"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":[Ut,ct,lt]}],"outline-w":[{outline:["",Ut,Lu,ws]}],"outline-color":[{outline:H()}],shadow:[{shadow:["","none",m,Eh,Sh]}],"shadow-color":[{shadow:H()}],"inset-shadow":[{"inset-shadow":["none",h,Eh,Sh]}],"inset-shadow-color":[{"inset-shadow":H()}],"ring-w":[{ring:Q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:H()}],"ring-offset-w":[{"ring-offset":[Ut,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,Eh,Sh]}],"text-shadow-color":[{"text-shadow":H()}],opacity:[{opacity:[Ut,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":[Ut]}],"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":[Ut]}],"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:[Ut,ct,lt]}],contrast:[{contrast:[Ut,ct,lt]}],"drop-shadow":[{"drop-shadow":["","none",g,Eh,Sh]}],"drop-shadow-color":[{"drop-shadow":H()}],grayscale:[{grayscale:["",Ut,ct,lt]}],"hue-rotate":[{"hue-rotate":[Ut,ct,lt]}],invert:[{invert:["",Ut,ct,lt]}],saturate:[{saturate:[Ut,ct,lt]}],sepia:[{sepia:["",Ut,ct,lt]}],"backdrop-filter":[{"backdrop-filter":["","none",ct,lt]}],"backdrop-blur":[{"backdrop-blur":ue()}],"backdrop-brightness":[{"backdrop-brightness":[Ut,ct,lt]}],"backdrop-contrast":[{"backdrop-contrast":[Ut,ct,lt]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ut,ct,lt]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ut,ct,lt]}],"backdrop-invert":[{"backdrop-invert":["",Ut,ct,lt]}],"backdrop-opacity":[{"backdrop-opacity":[Ut,ct,lt]}],"backdrop-saturate":[{"backdrop-saturate":[Ut,ct,lt]}],"backdrop-sepia":[{"backdrop-sepia":["",Ut,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:[Ut,"initial",ct,lt]}],ease:[{ease:["linear","initial",S,ct,lt]}],delay:[{delay:[Ut,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:Pe()}],"skew-x":[{"skew-x":Pe()}],"skew-y":[{"skew-y":Pe()}],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:[Ut,Lu,ws,lb]}],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"]}},dU=qH(uU);function je(...e){return dU(RA(e))}const fU=Zp("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 qt({className:e,variant:t="default",size:n="default",...r}){return E.jsx(EH,{"data-slot":"button",className:je(fU({variant:t,size:n,className:e})),...r})}function yc({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]}const FA={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},Jp={...FA,position:"fixed",top:0,left:0},BA={...FA,position:"absolute"};let BT=0;function hU(e,t="mui"){const[n,r]=v.useState(e),a=e||n;return v.useEffect(()=>{n==null&&(BT+=1,r(`${t}-${BT}`))},[n,t]),a}const HT=ZB.useId;function Js(e,t){if(HT!==void 0){const n=HT();return e??(t?`${t}-${n}`:n)}return hU(e,t)}function Hi(e){return Js(e,"base-ui")}const HA=v.createContext(void 0);function pU(){const e=v.useContext(HA);if(e===void 0)throw new Error(Cn(63));return e}let UT=(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 mU={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Xx={valid(e){return e===null?null:e?{[UT.valid]:""}:{[UT.invalid]:""}}};let VT=(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 UA={...Xx,checked(e){return e?{[VT.checked]:""}:{[VT.unchecked]:""}}};function gU(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}const yU=v.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Br,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function Qx(){return v.useContext(yU)}const bU=v.createContext({invalid:void 0,name:void 0,validityData:{state:mU,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=Dn)=>e,getInputValidationProps:(e=Dn)=>e,inputRef:{current:null},commit:async()=>{}}});function Ac(e=!0){const t=v.useContext(bU);if(t.setValidityData===Br&&!e)throw new Error(Cn(28));return t}function Zx(e){const{enabled:t=!0,value:n,id:r,name:a,controlRef:o,commit:l}=e,{formRef:c}=Qx(),{invalid:f,markedDirtyRef:d,validityData:m,setValidityData:h}=Ac(),y=Ye(e.getValue);Ve(()=>{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]),Ve(()=>{!t||!r||c.current.fields.set(r,{getValue:y,name:a,controlRef:o,validityData:gU(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]),Ve(()=>{const g=c.current.fields;return()=>{r&&g.delete(r)}},[c,r])}const vU=v.createContext({controlId:void 0,registerControlId:Br,labelId:void 0,setLabelId:Br,messageIds:[],setMessageIds:Br,getDescriptionProps:e=>e});function em(){return v.useContext(vU)}function tm(e={}){const{id:t,implicit:n=!1,controlRef:r}=e,{controlId:a,registerControlId:o}=em(),l=Hi(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 Ve(()=>{if(o===Br)return;let y;if(n){const g=r==null?void 0:r.current;cn(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}const zi="none",qs="trigger-press",vr="trigger-hover",Yl="trigger-focus",nm="outside-press",nd="item-press",xU="close-press",$s="focus-out",rm="escape-key",Qh="list-navigation",VA="cancel-open",Zh="sibling-open",wU="disabled",Jx="imperative-action",SU="window-resize";function vt(e,t,n,r){let a=!1,o=!1;const l=r??Dn;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}}function qA(e,t){const n=v.useRef(e),r=Ye(t);Ve(()=>{n.current!==e&&r(n.current)},[e,r]),Ve(()=>{n.current=e},[e])}const EU=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,...S}=t,{clearErrors:R}=Qx(),{state:k,setTouched:M,setDirty:D,validityData:A,setFilled:O,setFocused:L,shouldValidateOnChange:V,validationMode:F,disabled:W,name:j,validation:q}=Ac(),{labelId:$}=em(),B=W||g,_=j??f,z=Ye(m),H=v.useRef(null),K=_i(H,c,q.inputRef),P=v.useRef(null),U=Hi(),G=tm({id:l,implicit:!1,controlRef:P}),I=d?void 0:G,[Q,le]=yc({controlled:r,default:!!o,name:"Switch",state:"checked"});Zx({id:U,commit:q.commit,value:Q,controlRef:P,name:_,getValue:()=>Q}),Ve(()=>{H.current&&O(H.current.checked)},[H,O]),qA(Q,()=>{R(_),D(Q!==A.initialValue),O(Q),V()?q.commit(Q):q.commit(Q,!0)});const{getButtonProps:ae,buttonRef:Z}=qa({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"&&q.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(()=>Ei({checked:Q,disabled:B,id:I,name:_,required:y,style:_?BA:Jp,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:K,onChange(te){if(te.nativeEvent.defaultPrevented)return;const he=te.target.checked,ye=vt(zi,te.nativeEvent);z==null||z(he,ye),!ye.isCanceled&&le(he)},onFocus(){var te;(te=P.current)==null||te.focus()}},q.getInputValidationProps,T!==void 0?{value:T}:Dn),[Q,B,K,I,_,z,y,le,q,T]),Se=v.useMemo(()=>({...k,checked:Q,disabled:B,readOnly:h,required:y}),[k,Q,B,h,y]),Pe=Dt("span",t,{state:Se,ref:[n,P,Z],props:[ue,q.getValidationProps,S,ae],stateAttributesMapping:UA});return E.jsxs(HA.Provider,{value:Se,children:[Pe,!Q&&_&&C!==void 0&&E.jsx("input",{type:"hidden",name:_,value:C}),E.jsx("input",{...ve})]})}),CU=v.forwardRef(function(t,n){const{render:r,className:a,...o}=t,{state:l}=Ac(),c=pU(),f={...l,...c};return Dt("span",t,{state:f,ref:n,stateAttributesMapping:UA,props:o})});function mp({className:e,size:t="default",...n}){return E.jsx(EU,{"data-slot":"switch","data-size":t,className:je("data-checked:bg-primary data-unchecked:bg-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 dark:data-unchecked:bg-input/80 shrink-0 rounded-full border border-transparent focus-visible:ring-3 aria-invalid:ring-3 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] peer group/switch relative inline-flex items-center transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-disabled:cursor-not-allowed data-disabled:opacity-50",e),...n,children:E.jsx(CU,{"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 ew({className:e,...t}){return E.jsx("textarea",{"data-slot":"textarea",className:je("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 Gu(){return{texts:[],reasonings:[],toolCalls:[],staleBarrier:!1}}function Wl(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function $A(e){if(Wl(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 YA(e){return typeof e=="string"?e:Array.isArray(e)?e.map(t=>Wl(t)&&typeof t.text=="string"?t.text:"").filter(Boolean).join(`
342
- `):""}function TU(e){const t=[],n=new Map;for(const r of e){const a=Wl(r.content)?r.content:null;if(!a)continue;const o=a.content;switch(r.role){case"user":{const l=YA(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(!Wl(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(!Wl(l)||l.type!=="tool-result")continue;const c=typeof l.toolCallId=="string"?l.toolCallId:"",f=n.get(c),{value:d,isError:m,denied:h}=$A(l.output);f&&(f.output=d,f.isError=m,f.denied=h,f.resolved=!0)}break}}}return{blocks:t,toolBlocksById:n}}function RU(e,t){const{blocks:n,toolBlocksById:r}=TU(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 Rv(e){return!e||e.length===0?-1:e[e.length-1].seq}function kU(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=Wl(n.content)?n.content:null,a=r?YA(r.content):"";if(a)return a}return null}async function Er(e,t){try{return(await e.json()).error??t}catch{return t}}function ju(e){return Object.values(e).filter(t=>!!t).sort((t,n)=>t.updatedAt<n.updatedAt?1:-1).map(t=>t.id)}function qT(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 $T=!1;const So=new Set,MU=40,_s=new Map;let _u=null;const AU=120,rd=new Map,cb=new Set,kv=new Set;function OU(e){const t=rd.get(e);t&&(clearTimeout(t),rd.delete(e)),_s.delete(e),kv.delete(e)}function Mv(e){const t=aF(e);Nn().send(t.kind,t.payload)}function YT(e){const t=oF(e);Nn().send(t.kind,t.payload)}function WT(e,t,n,r){let a=_s.get(e);a||(a={texts:new Map,reasonings:new Map},_s.set(e,a));const o=a[t];o.set(n,(o.get(n)??"")+r)}function NU(e){const t=()=>{if(_u&&(clearTimeout(_u),_u=null),_s.size===0)return;const r=new Map(_s);_s.clear(),e(a=>{const o={...a.inProgress};for(const[l,c]of r){const f=o[l]??Gu(),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:()=>{_u||(_u=setTimeout(t,MU))}}}function DU(e,t){if($T)return;$T=!0;const n=Nn(),r=NU(e),a=T=>{rd.get(T)||rd.set(T,setTimeout(()=>{rd.delete(T),t().loadHistory(T)},AU))},o=(T,S)=>{_s.delete(T),e(k=>{const M=k.sessions[T],D=Gu();return S.inProgressText&&D.texts.push({messageId:"__sync__",text:S.inProgressText,stale:!1}),S.inProgressReasoning&&D.reasonings.push({messageId:"__sync_reasoning__",text:S.inProgressReasoning,stale:!1}),{sessions:M?{...k.sessions,[T]:{...M,status:S.status,lastError:S.lastError}}:k.sessions,inProgress:{...k.inProgress,[T]:D},pendingConfirmations:{...k.pendingConfirmations,[T]:S.pendingConfirmations.map(A=>({id:A.confirmationId,toolCallId:A.toolCallId,toolName:A.toolName,input:A.input,createdAt:A.createdAt}))},queued:{...k.queued,[T]:S.queuedMessages.map(A=>({id:A.id,sessionId:T,seq:A.seq,text:A.text,createdAt:A.createdAt}))}}});const R=t();(S.lastMessageSeq>Rv(R.messages[T])||!R.historyLoaded[T])&&R.loadHistory(T)},l=(T,S)=>{const R=!!t().sessions[T];if(e(k=>{const M=k.sessions[T];return M?{sessions:{...k.sessions,[T]:{...M,status:S.status,lastError:S.lastError!==void 0?S.lastError:M.lastError}}}:k}),!R){t().loadSessions();return}t().refreshSession(T)},c=(T,S)=>{r.flush(),e(R=>{const k=R.inProgress[T]??Gu(),M=[...k.toolCalls],D=M.findIndex(O=>O.toolCallId===S.toolCallId),A={toolCallId:S.toolCallId,toolName:S.toolName,input:S.input,isError:!1,denied:!1,resolved:!1,stale:!1};return D>=0?M[D]={...M[D],...A}:M.push(A),{inProgress:{...R.inProgress,[T]:{...k,toolCalls:M}}}})},f=(T,S)=>{r.flush();const{value:R,isError:k,denied:M}=$A(S.output);e(D=>{const A=D.inProgress[T]??Gu(),O=[...A.toolCalls],L=O.findIndex(V=>V.toolCallId===S.toolCallId);return L>=0?O[L]={...O[L],output:R,isError:!!S.isError||k,denied:M,resolved:!0}:O.push({toolCallId:S.toolCallId,toolName:S.toolName,input:void 0,output:R,isError:!!S.isError||k,denied:M,resolved:!0,stale:A.staleBarrier}),{inProgress:{...D.inProgress,[T]:{...A,toolCalls:O}}}})},d=(T,S)=>{e(R=>{const k=R.pendingConfirmations[T]??[];return k.some(M=>M.id===S.confirmationId)?R:{pendingConfirmations:{...R.pendingConfirmations,[T]:[...k,{id:S.confirmationId,toolCallId:S.toolCallId,toolName:S.toolName,input:S.input,createdAt:new Date().toISOString()}]}}})},m=(T,S)=>{e(R=>{const k=R.pendingConfirmations[T];return!k||!k.some(M=>M.id===S.confirmationId)?R:{pendingConfirmations:{...R.pendingConfirmations,[T]:k.filter(M=>M.id!==S.confirmationId)}}})},h=(T,S)=>{r.flush(),(S.role==="assistant"||S.role==="tool")&&e(R=>{const k=R.inProgress[T];return k?{inProgress:{...R.inProgress,[T]:{texts:k.texts.map(M=>({...M,stale:!0})),reasonings:k.reasonings.map(M=>({...M,stale:!0})),toolCalls:k.toolCalls.map(M=>M.resolved?{...M,stale:!0}:M),staleBarrier:!0}}}:R}),a(T)},y=(T,S)=>{r.flush(),e(R=>{const k=R.sessions[T];return{sessions:k?{...R.sessions,[T]:{...k,status:S.sessionStatus}}:R.sessions,inProgress:{...R.inProgress,[T]:Gu()}}}),S.lastMessageSeq>Rv(t().messages[T])&&a(T)},g=(T,S)=>{const R=t().sessions[T];mn.error(En.t("agent.toast.errorTitle",{title:(R==null?void 0:R.title)??"Agent"}),{description:S.message})},w=(T,S)=>{mn.warning(En.t("agent.toast.credentialWarningTitle"),{description:En.t("agent.toast.credentialWarningDescription",{types:S.types.join(", ")}),duration:1e4})},C=(T,S)=>{e(R=>({queued:{...R.queued,[T]:S.queued.map(k=>({id:k.id,sessionId:T,seq:k.seq,text:k.text,createdAt:k.createdAt}))}}))};n.onMessage(T=>{if(T.kind!==e4)return;let S;try{S=La(s5,T.payload)}catch(M){console.error("[agent] failed to decode AGENT_EVENT:",M);return}let R;try{R=JSON.parse(new TextDecoder().decode(S.payload))}catch(M){console.error("[agent] failed to parse AGENT_EVENT payload:",M);return}const k=S.sessionId;switch(S.eventType){case n4:o(k,R);return;case r4:l(k,R);return;case i4:{const M=R;WT(k,"texts",M.messageId,M.delta),r.schedule();return}case a4:{const M=R;WT(k,"reasonings",M.messageId,M.delta),r.schedule();return}case o4:c(k,R);return;case s4:f(k,R);return;case l4:d(k,R);return;case c4:m(k,R);return;case u4:h(k,R);return;case d4:g(k,R);return;case f4:y(k,R);return;case h4:w(k,R);return;case p4:C(k,R);return;default:return}}),n.onStateChange(T=>{if(T!=="READY")return;for(const R of So)Mv(R);const S=t().activeSessionId;S&&t().loadHistory(S)})}const ln=qp()(sA((e,t)=>({sessions:{},sessionOrder:[],sessionsLoaded:!1,activeSessionId:null,messages:{},historyLoaded:{},inProgress:{},pendingConfirmations:{},queued:{},sending:{},draft:null,defaultWriteMode:"confirm",ensureInitialized(){DU(e,t),Nn().connect();const n=t().activeSessionId;n&&!So.has(n)&&(So.add(n),Mv(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:ju(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:ju(l)}})}catch(r){console.error("[agent] refreshSession failed:",r)}},setActiveSession(n){const r=t().activeSessionId;r!==n&&(r&&So.has(r)&&(So.delete(r),YT(r)),e({activeSessionId:n,draft:null}),n&&(So.add(n),Mv(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:ju(d),messages:{...f.messages,[c.id]:[]},historyLoaded:{...f.historyLoaded,[c.id]:!0}}}),t().setActiveSession(c.id),c}catch(o){return mn.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:ju(c)}}),!0}catch(a){return mn.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),OU(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:ju(o),messages:l,historyLoaded:c,inProgress:f,pendingConfirmations:d,queued:m}}),!0}catch(r){return mn.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){mn.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){mn.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){mn.error(a instanceof Error?a.message:String(a))}},async loadHistory(n){if(cb.has(n)){kv.add(n);return}cb.add(n);try{const r=t(),a=r.historyLoaded[n]?Rv(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=qT(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{cb.delete(n),kv.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]:qT(c.messages[n],[l])},sessions:f?{...c.sessions,[n]:{...f,status:"running",lastError:null}}:c.sessions}})}return!0}catch(a){return mn.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){mn.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){mn.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){mn.error(a instanceof Error?a.message:String(a))}},startDraft(n,r,a){const o=t().activeSessionId;o&&So.has(o)&&(So.delete(o),YT(o)),e({activeSessionId:null,draft:{deviceId:n,paneId:r,providerId:null,modelId:null,paneTitle:a}})},updateDraft(n){e(r=>r.draft?{draft:{...r.draft,...n}}:r)},clearDraft(){e({draft:null})},async materializeDraft(){const n=t().draft;return n?await t().createSession(n.deviceId,n.paneId,{providerId:n.providerId,modelId:n.modelId,originPaneTitle:n.paneTitle}):null},async stopSession(n){try{const r=await fetch(`/api/agent/sessions/${n}/stop`,{method:"POST"});if(!r.ok)throw new Error(await 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){mn.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){mn.error(c instanceof Error?c.message:String(c))}}}),{name:"tmex-agent",partialize:e=>({activeSessionId:e.activeSessionId,defaultWriteMode:e.defaultWriteMode})}));function IU(){const e=Vs.getState().settings;return(e==null?void 0:e.siteName)||"tmex"}function KT(e){const t=e==null?void 0:e.trim();return t&&t.length>0?t:"?"}function PU({paneIdx:e,windowIdx:t,paneTitle:n,windowName:r,windowCustomName:a,deviceName:o}){const l=t??"?",c=e??"?",f=KT(a??n??r),d=KT(o);return`${l}/${c}: ${f}@${d}`}function tw(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 LU(e){const{title:t,processName:n}=tw(e);return n?`${n}: ${t}`:t}function See(e){const t=IU();return e!=null&&e.trim()?`[${t}]${e}`:t}function jU(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const _U=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,zU=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,FU={};function GT(e,t){return(FU.jsx?zU:_U).test(e)}const BU=/[ \t\n\f\r]/g;function HU(e){return typeof e=="object"?e.type==="text"?XT(e.value):!1:XT(e)}function XT(e){return e.replace(BU,"")===""}class Bd{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Bd.prototype.normal={};Bd.prototype.property={};Bd.prototype.space=void 0;function WA(e,t){const n={},r={};for(const a of e)Object.assign(n,a.property),Object.assign(r,a.normal);return new Bd(n,r,t)}function Av(e){return e.toLowerCase()}class Ur{constructor(t,n){this.attribute=n,this.property=t}}Ur.prototype.attribute="";Ur.prototype.booleanish=!1;Ur.prototype.boolean=!1;Ur.prototype.commaOrSpaceSeparated=!1;Ur.prototype.commaSeparated=!1;Ur.prototype.defined=!1;Ur.prototype.mustUseProperty=!1;Ur.prototype.number=!1;Ur.prototype.overloadedBoolean=!1;Ur.prototype.property="";Ur.prototype.spaceSeparated=!1;Ur.prototype.space=void 0;let UU=0;const Ot=el(),Gn=el(),Ov=el(),Ue=el(),xn=el(),zs=el(),Zr=el();function el(){return 2**++UU}const Nv=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ot,booleanish:Gn,commaOrSpaceSeparated:Zr,commaSeparated:zs,number:Ue,overloadedBoolean:Ov,spaceSeparated:xn},Symbol.toStringTag,{value:"Module"})),ub=Object.keys(Nv);class nw extends Ur{constructor(t,n,r,a){let o=-1;if(super(t,n),QT(this,"space",a),typeof r=="number")for(;++o<ub.length;){const l=ub[o];QT(this,ub[o],(r&Nv[l])===Nv[l])}}}nw.prototype.defined=!0;function QT(e,t,n){n&&(e[t]=n)}function Oc(e){const t={},n={};for(const[r,a]of Object.entries(e.properties)){const o=new nw(r,e.transform(e.attributes||{},r),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[Av(r)]=r,n[Av(o.attribute)]=r}return new Bd(t,n,e.space)}const KA=Oc({properties:{ariaActiveDescendant:null,ariaAtomic:Gn,ariaAutoComplete:null,ariaBusy:Gn,ariaChecked:Gn,ariaColCount:Ue,ariaColIndex:Ue,ariaColSpan:Ue,ariaControls:xn,ariaCurrent:null,ariaDescribedBy:xn,ariaDetails:null,ariaDisabled:Gn,ariaDropEffect:xn,ariaErrorMessage:null,ariaExpanded:Gn,ariaFlowTo:xn,ariaGrabbed:Gn,ariaHasPopup:null,ariaHidden:Gn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:xn,ariaLevel:Ue,ariaLive:null,ariaModal:Gn,ariaMultiLine:Gn,ariaMultiSelectable:Gn,ariaOrientation:null,ariaOwns:xn,ariaPlaceholder:null,ariaPosInSet:Ue,ariaPressed:Gn,ariaReadOnly:Gn,ariaRelevant:null,ariaRequired:Gn,ariaRoleDescription:xn,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 GA(e,t){return t in e?e[t]:t}function XA(e,t){return GA(e,t.toLowerCase())}const VU=Oc({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:zs,acceptCharset:xn,accessKey:xn,action:null,allow:null,allowFullScreen:Ot,allowPaymentRequest:Ot,allowUserMedia:Ot,alpha:Ot,alt:null,as:null,async:Ot,autoCapitalize:null,autoComplete:xn,autoFocus:Ot,autoPlay:Ot,blocking:xn,capture:null,charSet:null,checked:Ot,cite:null,className:xn,closedBy:null,colorSpace:null,cols:Ue,colSpan:Ue,command:null,commandFor:null,content:null,contentEditable:Gn,controls:Ot,controlsList:xn,coords:Ue|zs,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ot,defer:Ot,dir:null,dirName:null,disabled:Ot,download:Ov,draggable:Gn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ot,formTarget:null,headers:xn,height:Ue,hidden:Ov,high:Ue,href:null,hrefLang:null,htmlFor:xn,httpEquiv:xn,id:null,imageSizes:null,imageSrcSet:null,inert:Ot,inputMode:null,integrity:null,is:null,isMap:Ot,itemId:null,itemProp:xn,itemRef:xn,itemScope:Ot,itemType:xn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ot,low:Ue,manifest:null,max:null,maxLength:Ue,media:null,method:null,min:null,minLength:Ue,multiple:Ot,muted:Ot,name:null,nonce:null,noModule:Ot,noValidate:Ot,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:Ot,optimum:Ue,pattern:null,ping:xn,placeholder:null,playsInline:Ot,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ot,referrerPolicy:null,rel:xn,required:Ot,reversed:Ot,rows:Ue,rowSpan:Ue,sandbox:xn,scope:null,scoped:Ot,seamless:Ot,selected:Ot,shadowRootClonable:Ot,shadowRootCustomElementRegistry:Ot,shadowRootDelegatesFocus:Ot,shadowRootMode:null,shadowRootSerializable:Ot,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:Ot,useMap:null,value:Gn,width:Ue,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:xn,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:Ot,declare:Ot,event:null,face:null,frame:null,frameBorder:null,hSpace:Ue,leftMargin:Ue,link:null,longDesc:null,lowSrc:null,marginHeight:Ue,marginWidth:Ue,noResize:Ot,noHref:Ot,noShade:Ot,noWrap:Ot,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:Ot,disablePictureInPicture:Ot,disableRemotePlayback:Ot,exportParts:zs,part:xn,prefix:null,property:null,results:Ue,security:null,unselectable:null},space:"html",transform:XA}),qU=Oc({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:Zr,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:xn,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:Ot,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:zs,g2:zs,glyphName:zs,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:Zr,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:xn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ue,pointsAtY:Ue,pointsAtZ:Ue,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Zr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Zr,rev:Zr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Zr,requiredFeatures:Zr,requiredFonts:Zr,requiredFormats:Zr,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:Zr,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:Zr,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:Zr,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:GA}),QA=Oc({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()}}),ZA=Oc({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:XA}),JA=Oc({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),$U={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"},YU=/[A-Z]/g,ZT=/-[a-z]/g,WU=/^data[-\w.:]+$/i;function KU(e,t){const n=Av(t);let r=t,a=Ur;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&WU.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(ZT,XU);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!ZT.test(o)){let l=o.replace(YU,GU);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}a=nw}return new a(r,t)}function GU(e){return"-"+e.toLowerCase()}function XU(e){return e.charAt(1).toUpperCase()}const QU=WA([KA,VU,QA,ZA,JA],"html"),rw=WA([KA,qU,QA,ZA,JA],"svg");function ZU(e){return e.join(" ").trim()}var _l={},db,JT;function JU(){if(JT)return db;JT=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=`
343
- `,d="/",m="*",h="",y="comment",g="declaration";function w(T,S){if(typeof T!="string")throw new TypeError("First argument must be a string");if(!T)return[];S=S||{};var R=1,k=1;function M($){var B=$.match(t);B&&(R+=B.length);var _=$.lastIndexOf(f);k=~_?$.length-_:k+$.length}function D(){var $={line:R,column:k};return function(B){return B.position=new A($),V(),B}}function A($){this.start=$,this.end={line:R,column:k},this.source=S.source}A.prototype.content=T;function O($){var B=new Error(S.source+":"+R+":"+k+": "+$);if(B.reason=$,B.filename=S.source,B.line=R,B.column=k,B.source=T,!S.silent)throw B}function L($){var B=$.exec(T);if(B){var _=B[0];return M(_),T=T.slice(_.length),B}}function V(){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 O("End of comment missing");var _=T.slice(2,B-2);return k+=2,M(_),T=T.slice(B),k+=2,$({type:y,comment:_})}}function j(){var $=D(),B=L(r);if(B){if(W(),!L(a))return O("property missing ':'");var _=L(o),z=$({type:g,property:C(B[0].replace(e,h)),value:_?C(_[0].replace(e,h)):h});return L(l),z}}function q(){var $=[];F($);for(var B;B=j();)B!==!1&&($.push(B),F($));return $}return V(),q()}function C(T){return T?T.replace(c,h):h}return db=w,db}var eR;function e6(){if(eR)return _l;eR=1;var e=_l&&_l.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(_l,"__esModule",{value:!0}),_l.default=n;const t=e(JU());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 _l}var zu={},tR;function t6(){if(tR)return zu;tR=1,Object.defineProperty(zu,"__esModule",{value:!0}),zu.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 zu.camelCase=f,zu}var Fu,nR;function n6(){if(nR)return Fu;nR=1;var e=Fu&&Fu.__importDefault||function(a){return a&&a.__esModule?a:{default:a}},t=e(e6()),n=t6();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,Fu=r,Fu}var r6=n6();const i6=Bp(r6),eO=tO("end"),iw=tO("start");function tO(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 a6(e){const t=iw(e),n=eO(e);if(t&&n)return{start:t,end:n}}function id(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?rR(e.position):"start"in e||"end"in e?rR(e):"line"in e||"column"in e?Dv(e):""}function Dv(e){return iR(e&&e.line)+":"+iR(e&&e.column)}function rR(e){return Dv(e&&e.start)+"-"+Dv(e&&e.end)}function iR(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=id(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 aw={}.hasOwnProperty,o6=new Map,s6=/[A-Z]/g,l6=new Set(["table","tbody","thead","tfoot","tr"]),c6=new Set(["td","th"]),nO="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function u6(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=b6(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=y6(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"?rw:QU,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=rO(a,e,void 0);return o&&typeof o!="string"?o:a.create(e,a.Fragment,{children:o||void 0},void 0)}function rO(e,t,n){if(t.type==="element")return d6(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return f6(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return p6(e,t,n);if(t.type==="mdxjsEsm")return h6(e,t);if(t.type==="root")return m6(e,t,n);if(t.type==="text")return g6(e,t)}function d6(e,t,n){const r=e.schema;let a=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(a=rw,e.schema=a),e.ancestors.push(t);const o=aO(e,t.tagName,!1),l=v6(e,t);let c=sw(e,t);return l6.has(t.tagName)&&(c=c.filter(function(f){return typeof f=="string"?!HU(f):!0})),iO(e,l,o,t),ow(l,c),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function f6(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)}wd(e,t.position)}function h6(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);wd(e,t.position)}function p6(e,t,n){const r=e.schema;let a=r;t.name==="svg"&&r.space==="html"&&(a=rw,e.schema=a),e.ancestors.push(t);const o=t.name===null?e.Fragment:aO(e,t.name,!0),l=x6(e,t),c=sw(e,t);return iO(e,l,o,t),ow(l,c),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function m6(e,t,n){const r={};return ow(r,sw(e,t)),e.create(t,e.Fragment,r,n)}function g6(e,t){return t.value}function iO(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function ow(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function y6(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 b6(e,t){return n;function n(r,a,o,l){const c=Array.isArray(o.children),f=iw(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 v6(e,t){const n={};let r,a;for(a in t.properties)if(a!=="children"&&aw.call(t.properties,a)){const o=w6(e,a,t.properties[a]);if(o){const[l,c]=o;e.tableCellAlignToStyle&&l==="align"&&typeof c=="string"&&c6.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 x6(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 wd(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 wd(e,t.position);else o=r.value===null?!0:r.value;n[a]=o}return n}function sw(e,t){const n=[];let r=-1;const a=e.passKeys?new Map:o6;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=rO(e,o,l);c!==void 0&&n.push(c)}return n}function w6(e,t,n){const r=KU(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?jU(n):ZU(n)),r.property==="style"){let a=typeof n=="object"?n:S6(e,String(n));return e.stylePropertyNameCase==="css"&&(a=E6(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&r.space?$U[r.property]||r.property:r.attribute,n]}}function S6(e,t){try{return i6(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=nO+"#cannot-parse-style-attribute",a}}function aO(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=GT(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=GT(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const a=r.value;return aw.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(r);wd(e)}function wd(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=nO+"#cannot-handle-mdx-estrees-without-createevaluater",n}function E6(e){const t={};let n;for(n in e)aw.call(e,n)&&(t[C6(n)]=e[n]);return t}function C6(e){let t=e.replace(s6,T6);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function T6(e){return"-"+e.toLowerCase()}const fb={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"]},R6={};function lw(e,t){const n=R6,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return oO(e,r,a)}function oO(e,t,n){if(k6(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 aR(e.children,t,n)}return Array.isArray(e)?aR(e,t,n):""}function aR(e,t,n){const r=[];let a=-1;for(;++a<e.length;)r[a]=oO(e[a],t,n);return r.join("")}function k6(e){return!!(e&&typeof e=="object")}const oR=document.createElement("i");function cw(e){const t="&"+e+";";oR.innerHTML=t;const n=oR.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ri(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 vi(e,t){return e.length>0?(ri(e,e.length,0,t),e):t}const sR={}.hasOwnProperty;function sO(e){const t={};let n=-1;for(;++n<e.length;)M6(t,e[n]);return t}function M6(e,t){let n;for(n in t){const a=(sR.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let l;if(o)for(l in o){sR.call(a,l)||(a[l]=[]);const c=o[l];A6(a[l],Array.isArray(c)?c:c?[c]:[])}}}function A6(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);ri(e,0,0,r)}function lO(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=Go(/[A-Za-z]/),xr=Go(/[\dA-Za-z]/),O6=Go(/[#-'*+\--9=?A-Z^-~]/);function gp(e){return e!==null&&(e<32||e===127)}const Iv=Go(/\d/),N6=Go(/[\dA-Fa-f]/),D6=Go(/[!-/:-@[-`{-~]/);function bt(e){return e!==null&&e<-2}function wn(e){return e!==null&&(e<0||e===32)}function Kt(e){return e===-2||e===-1||e===32}const im=Go(new RegExp("\\p{P}|\\p{S}","u")),Ys=Go(/\s/);function Go(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Nc(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 an(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 I6={tokenize:P6};function P6(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"),an(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 bt(c)?(e.consume(c),e.exit("chunkText"),o):(e.consume(c),l)}}const L6={tokenize:j6},lR={tokenize:_6};function j6(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,A;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){A=t.events[D][1].end;break}S(r);let O=M;for(;O<t.events.length;)t.events[O][1].end={...A},O++;return ri(t.events,D+1,0,t.events.slice(M)),t.events.length=O,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(lR,m,h)(k)}function m(k){return a&&R(),S(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(lR,g,w)(k)}function g(k){return r++,n.push([t.currentConstruct,t.containerState]),y(k)}function w(k){if(k===null){a&&R(),S(0),e.consume(k);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:o}),C(k)}function C(k){if(k===null){T(e.exit("chunkFlow"),!0),S(0),e.consume(k);return}return bt(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 A=a.events.length;for(;A--;)if(a.events[A][1].start.offset<l&&(!a.events[A][1].end||a.events[A][1].end.offset>l))return;const O=t.events.length;let L=O,V,F;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){if(V){F=t.events[L][1].end;break}V=!0}for(S(r),A=O;A<t.events.length;)t.events[A][1].end={...F},A++;ri(t.events,L+1,0,t.events.slice(O)),t.events.length=A}}function S(k){let M=n.length;for(;M-- >k;){const D=n[M];t.containerState=D[1],D[0].exit.call(t,e)}n.length=k}function R(){a.write([null]),o=void 0,a=void 0,t.containerState._closeFlow=void 0}}function _6(e,t,n){return an(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function bc(e){if(e===null||wn(e)||Ys(e))return 1;if(im(e))return 2}function am(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 Pv={name:"attention",resolveAll:z6,tokenize:F6};function z6(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};cR(h,-f),cR(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=vi(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=vi(d,[["enter",a,t],["enter",l,t],["exit",l,t],["enter",o,t]]),d=vi(d,am(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=vi(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=vi(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):m=0,ri(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 F6(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,a=bc(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=bc(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 cR(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const B6={name:"autolink",tokenize:H6};function H6(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||gp(g)?n(g):(e.consume(g),f)}function d(g){return g===64?(e.consume(g),m):O6(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 Hd={partial:!0,tokenize:U6};function U6(e,t,n){return r;function r(o){return Kt(o)?an(e,a,"linePrefix")(o):a(o)}function a(o){return o===null||bt(o)?t(o):n(o)}}const cO={continuation:{tokenize:q6},exit:$6,name:"blockQuote",tokenize:V6};function V6(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 q6(e,t,n){const r=this;return a;function a(l){return Kt(l)?an(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):o(l)}function o(l){return e.attempt(cO,t,n)(l)}}function $6(e){e.exit("blockQuote")}const uO={name:"characterEscape",tokenize:Y6};function Y6(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 D6(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const dO={name:"characterReference",tokenize:W6};function W6(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=N6,m):(e.enter("characterReferenceValue"),o=7,l=Iv,m(h))}function m(h){if(h===59&&a){const y=e.exit("characterReferenceValue");return l===xr&&!cw(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 uR={partial:!0,tokenize:G6},dR={concrete:!0,name:"codeFenced",tokenize:K6};function K6(e,t,n){const r=this,a={partial:!0,tokenize:D};let o=0,l=0,c;return f;function f(A){return d(A)}function d(A){const O=r.events[r.events.length-1];return o=O&&O[1].type==="linePrefix"?O[2].sliceSerialize(O[1],!0).length:0,c=A,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m(A)}function m(A){return A===c?(l++,e.consume(A),m):l<3?n(A):(e.exit("codeFencedFenceSequence"),Kt(A)?an(e,h,"whitespace")(A):h(A))}function h(A){return A===null||bt(A)?(e.exit("codeFencedFence"),r.interrupt?t(A):e.check(uR,C,M)(A)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(A))}function y(A){return A===null||bt(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(A)):Kt(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),an(e,g,"whitespace")(A)):A===96&&A===c?n(A):(e.consume(A),y)}function g(A){return A===null||bt(A)?h(A):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),w(A))}function w(A){return A===null||bt(A)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(A)):A===96&&A===c?n(A):(e.consume(A),w)}function C(A){return e.attempt(a,M,T)(A)}function T(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),S}function S(A){return o>0&&Kt(A)?an(e,R,"linePrefix",o+1)(A):R(A)}function R(A){return A===null||bt(A)?e.check(uR,C,M)(A):(e.enter("codeFlowValue"),k(A))}function k(A){return A===null||bt(A)?(e.exit("codeFlowValue"),R(A)):(e.consume(A),k)}function M(A){return e.exit("codeFenced"),t(A)}function D(A,O,L){let V=0;return F;function F(B){return A.enter("lineEnding"),A.consume(B),A.exit("lineEnding"),W}function W(B){return A.enter("codeFencedFence"),Kt(B)?an(A,j,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):j(B)}function j(B){return B===c?(A.enter("codeFencedFenceSequence"),q(B)):L(B)}function q(B){return B===c?(V++,A.consume(B),q):V>=l?(A.exit("codeFencedFenceSequence"),Kt(B)?an(A,$,"whitespace")(B):$(B)):L(B)}function $(B){return B===null||bt(B)?(A.exit("codeFencedFence"),O(B)):L(B)}}}function G6(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 hb={name:"codeIndented",tokenize:Q6},X6={partial:!0,tokenize:Z6};function Q6(e,t,n){const r=this;return a;function a(d){return e.enter("codeIndented"),an(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):bt(d)?e.attempt(X6,l,f)(d):(e.enter("codeFlowValue"),c(d))}function c(d){return d===null||bt(d)?(e.exit("codeFlowValue"),l(d)):(e.consume(d),c)}function f(d){return e.exit("codeIndented"),t(d)}}function Z6(e,t,n){const r=this;return a;function a(l){return r.parser.lazy[r.now().line]?n(l):bt(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a):an(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):bt(l)?a(l):n(l)}}const J6={name:"codeText",previous:t8,resolve:e8,tokenize:n8};function e8(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 t8(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function n8(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)):bt(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||bt(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 r8{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&&Bu(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),Bu(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Bu(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);Bu(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Bu(this.left,n.reverse())}}}function Bu(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 fO(e){const t={};let n=-1,r,a,o,l,c,f,d;const m=new r8(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,i8(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 ri(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!d}function i8(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 S=c.slice(T[y],T[y+1]),R=o.pop();f.push([R,R+S.length-1]),e.splice(R,2,S)}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 a8={resolve:s8,tokenize:l8},o8={partial:!0,tokenize:c8};function s8(e){return fO(e),e}function l8(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):bt(c)?e.check(o8,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 c8(e,t,n){const r=this;return a;function a(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),an(e,o,"linePrefix")}function o(l){if(l===null||bt(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 hO(e,t,n,r,a,o,l,c,f){const d=f||Number.POSITIVE_INFINITY;let m=0;return h;function h(S){return S===60?(e.enter(r),e.enter(a),e.enter(o),e.consume(S),e.exit(o),y):S===null||S===32||S===41||gp(S)?n(S):(e.enter(r),e.enter(l),e.enter(c),e.enter("chunkString",{contentType:"string"}),C(S))}function y(S){return S===62?(e.enter(o),e.consume(S),e.exit(o),e.exit(a),e.exit(r),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),g(S))}function g(S){return S===62?(e.exit("chunkString"),e.exit(c),y(S)):S===null||S===60||bt(S)?n(S):(e.consume(S),S===92?w:g)}function w(S){return S===60||S===62||S===92?(e.consume(S),g):g(S)}function C(S){return!m&&(S===null||S===41||wn(S))?(e.exit("chunkString"),e.exit(c),e.exit(l),e.exit(r),t(S)):m<d&&S===40?(e.consume(S),m++,C):S===41?(e.consume(S),m--,C):S===null||S===32||S===40||gp(S)?n(S):(e.consume(S),S===92?T:C)}function T(S){return S===40||S===41||S===92?(e.consume(S),C):C(S)}}function pO(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):bt(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||bt(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 mO(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):bt(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),an(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===l||y===null||bt(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 ad(e,t){let n;return r;function r(a){return bt(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,r):Kt(a)?an(e,r,n?"linePrefix":"lineSuffix")(a):t(a)}}const u8={name:"definition",tokenize:f8},d8={partial:!0,tokenize:h8};function f8(e,t,n){const r=this;let a;return o;function o(g){return e.enter("definition"),l(g)}function l(g){return pO.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 wn(g)?ad(e,d)(g):d(g)}function d(g){return hO(e,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function m(g){return e.attempt(d8,h,h)(g)}function h(g){return Kt(g)?an(e,y,"whitespace")(g):y(g)}function y(g){return g===null||bt(g)?(e.exit("definition"),r.parser.defined.push(a),t(g)):n(g)}}function h8(e,t,n){return r;function r(c){return wn(c)?ad(e,a)(c):n(c)}function a(c){return mO(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function o(c){return Kt(c)?an(e,l,"whitespace")(c):l(c)}function l(c){return c===null||bt(c)?t(c):n(c)}}const p8={name:"hardBreakEscape",tokenize:m8};function m8(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),a}function a(o){return bt(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const g8={name:"headingAtx",resolve:y8,tokenize:b8};function y8(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"},ri(e,r,n-r+1,[["enter",a,t],["enter",o,t],["exit",o,t],["exit",a,t]])),e}function b8(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||wn(m)?(e.exit("atxHeadingSequence"),c(m)):n(m)}function c(m){return m===35?(e.enter("atxHeadingSequence"),f(m)):m===null||bt(m)?(e.exit("atxHeading"),t(m)):Kt(m)?an(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||wn(m)?(e.exit("atxHeadingText"),c(m)):(e.consume(m),d)}}const v8=["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"],fR=["pre","script","style","textarea"],x8={concrete:!0,name:"htmlFlow",resolveTo:E8,tokenize:C8},w8={partial:!0,tokenize:R8},S8={partial:!0,tokenize:T8};function E8(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 C8(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:j: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||wn(I)){const Q=I===47,le=l.toLowerCase();return!Q&&!o&&fR.includes(le)?(a=1,r.interrupt?t(I):j(I)):v8.includes(l.toLowerCase())?(a=6,Q?(e.consume(I),S):r.interrupt?t(I):j(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 S(I){return I===62?(e.consume(I),r.interrupt?t:j):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),A):Kt(I)?(e.consume(I),D):k(I)}function A(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),f=I,O):Kt(I)?(e.consume(I),A):L(I)}function O(I){return I===f?(e.consume(I),f=null,V):I===null||bt(I)?n(I):(e.consume(I),O)}function L(I){return I===null||I===34||I===39||I===47||I===60||I===61||I===62||I===96||wn(I)?D(I):(e.consume(I),L)}function V(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||bt(I)?j(I):Kt(I)?(e.consume(I),W):n(I)}function j(I){return I===45&&a===2?(e.consume(I),_):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):bt(I)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(w8,G,q)(I)):I===null||bt(I)?(e.exit("htmlFlowData"),q(I)):(e.consume(I),j)}function q(I){return e.check(S8,$,G)(I)}function $(I){return e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),B}function B(I){return I===null||bt(I)?q(I):(e.enter("htmlFlowData"),j(I))}function _(I){return I===45?(e.consume(I),P):j(I)}function z(I){return I===47?(e.consume(I),l="",H):j(I)}function H(I){if(I===62){const Q=l.toLowerCase();return fR.includes(Q)?(e.consume(I),U):j(I)}return kr(I)&&l.length<8?(e.consume(I),l+=String.fromCharCode(I),H):j(I)}function K(I){return I===93?(e.consume(I),P):j(I)}function P(I){return I===62?(e.consume(I),U):I===45&&a===2?(e.consume(I),P):j(I)}function U(I){return I===null||bt(I)?(e.exit("htmlFlowData"),G(I)):(e.consume(I),U)}function G(I){return e.exit("htmlFlow"),t(I)}}function T8(e,t,n){const r=this;return a;function a(l){return bt(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 R8(e,t,n){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(Hd,t,n)}}const k8={name:"htmlText",tokenize:M8};function M8(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):bt(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?_(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):bt(P)?(l=C,z(P)):(e.consume(P),C)}function T(P){return P===93?(e.consume(P),S):C(P)}function S(P){return P===62?_(P):P===93?(e.consume(P),S):C(P)}function R(P){return P===null||P===62?_(P):bt(P)?(l=R,z(P)):(e.consume(P),R)}function k(P){return P===null?n(P):P===63?(e.consume(P),M):bt(P)?(l=k,z(P)):(e.consume(P),k)}function M(P){return P===62?_(P):k(P)}function D(P){return kr(P)?(e.consume(P),A):n(P)}function A(P){return P===45||xr(P)?(e.consume(P),A):O(P)}function O(P){return bt(P)?(l=O,z(P)):Kt(P)?(e.consume(P),O):_(P)}function L(P){return P===45||xr(P)?(e.consume(P),L):P===47||P===62||wn(P)?V(P):n(P)}function V(P){return P===47?(e.consume(P),_):P===58||P===95||kr(P)?(e.consume(P),F):bt(P)?(l=V,z(P)):Kt(P)?(e.consume(P),V):_(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),j):bt(P)?(l=W,z(P)):Kt(P)?(e.consume(P),W):V(P)}function j(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(e.consume(P),a=P,q):bt(P)?(l=j,z(P)):Kt(P)?(e.consume(P),j):(e.consume(P),$)}function q(P){return P===a?(e.consume(P),a=void 0,B):P===null?n(P):bt(P)?(l=q,z(P)):(e.consume(P),q)}function $(P){return P===null||P===34||P===39||P===60||P===61||P===96?n(P):P===47||P===62||wn(P)?V(P):(e.consume(P),$)}function B(P){return P===47||P===62||wn(P)?V(P):n(P)}function _(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)?an(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 uw={name:"labelEnd",resolveAll:D8,resolveTo:I8,tokenize:P8},A8={tokenize:L8},O8={tokenize:j8},N8={tokenize:_8};function D8(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&&ri(e,0,e.length,n),e}function I8(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=vi(c,e.slice(o+1,o+r+3)),c=vi(c,[["enter",m,t]]),c=vi(c,am(t.parser.constructs.insideSpan.null,e.slice(o+r+4,l-3),t)),c=vi(c,[["exit",m,t],e[l-2],e[l-1],["exit",d,t]]),c=vi(c,e.slice(l+1)),c=vi(c,[["exit",f,t]]),ri(e,o,e.length,c),e}function P8(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(A8,m,l?m:h)(y):y===91?e.attempt(O8,m,l?d:h)(y):l?m(y):h(y)}function d(y){return e.attempt(N8,m,h)(y)}function m(y){return t(y)}function h(y){return o._balanced=!0,n(y)}}function L8(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 wn(h)?ad(e,o)(h):o(h)}function o(h){return h===41?m(h):hO(e,l,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function l(h){return wn(h)?ad(e,f)(h):m(h)}function c(h){return n(h)}function f(h){return h===34||h===39||h===40?mO(e,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):m(h)}function d(h){return wn(h)?ad(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 j8(e,t,n){const r=this;return a;function a(c){return pO.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 _8(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 z8={name:"labelStartImage",resolveAll:uw.resolveAll,tokenize:F8};function F8(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 B8={name:"labelStartLink",resolveAll:uw.resolveAll,tokenize:H8};function H8(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 pb={name:"lineEnding",tokenize:U8};function U8(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),an(e,t,"linePrefix")}}const Jh={name:"thematicBreak",tokenize:V8};function V8(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||bt(d))?(e.exit("thematicBreak"),t(d)):n(d)}function f(d){return d===a?(e.consume(d),r++,f):(e.exit("thematicBreakSequence"),Kt(d)?an(e,c,"whitespace")(d):c(d))}}const jr={continuation:{tokenize:W8},exit:G8,name:"list",tokenize:Y8},q8={partial:!0,tokenize:X8},$8={partial:!0,tokenize:K8};function Y8(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:Iv(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(Jh,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 Iv(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(Hd,r.interrupt?n:m,e.attempt(q8,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 W8(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Hd,a,o);function a(c){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,an(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($8,t,l)(c))}function l(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,an(e,e.attempt(jr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function K8(e,t,n){const r=this;return an(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 G8(e){e.exit(this.containerState.type)}function X8(e,t,n){const r=this;return an(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 hR={name:"setextUnderline",resolveTo:Q8,tokenize:Z8};function Q8(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 Z8(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)?an(e,f,"lineSuffix")(d):f(d))}function f(d){return d===null||bt(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const J8={tokenize:e9};function e9(e){const t=this,n=e.attempt(Hd,r,e.attempt(this.parser.constructs.flowInitial,a,an(e,e.attempt(this.parser.constructs.flow,a,e.attempt(a8,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 t9={resolveAll:yO()},n9=gO("string"),r9=gO("text");function gO(e){return{resolveAll:yO(e==="text"?i9: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 yO(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 i9(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 a9={42:jr,43:jr,45:jr,48:jr,49:jr,50:jr,51:jr,52:jr,53:jr,54:jr,55:jr,56:jr,57:jr,62:cO},o9={91:u8},s9={[-2]:hb,[-1]:hb,32:hb},l9={35:g8,42:Jh,45:[hR,Jh],60:x8,61:hR,95:Jh,96:dR,126:dR},c9={38:dO,92:uO},u9={[-5]:pb,[-4]:pb,[-3]:pb,33:z8,38:dO,42:Pv,60:[B6,k8],91:B8,92:[p8,uO],93:uw,95:Pv,96:J6},d9={null:[Pv,t9]},f9={null:[42,95]},h9={null:[]},p9=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:f9,contentInitial:o9,disable:h9,document:a9,flow:l9,flowInitial:s9,insideSpan:d9,string:c9,text:u9},Symbol.toStringTag,{value:"Module"}));function m9(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:O(D),check:O(A),consume:R,enter:k,exit:M,interrupt:O(A,{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=vi(l,W),T(),l[l.length-1]!==null?[]:(L(t,0),d.events=am(o,d.events,d),d.events)}function y(W,j){return y9(g(W),j)}function g(W){return g9(l,W)}function w(){const{_bufferIndex:W,_index:j,line:q,column:$,offset:B}=r;return{_bufferIndex:W,_index:j,line:q,column:$,offset:B}}function C(W){a[W.line]=W.column,F()}function T(){let W;for(;r._index<l.length;){const j=l[r._index];if(typeof j=="string")for(W=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===W&&r._bufferIndex<j.length;)S(j.charCodeAt(r._bufferIndex));else S(j)}}function S(W){m=m(W)}function R(W){bt(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,j){const q=j||{};return q.type=W,q.start=w(),d.events.push(["enter",q,d]),c.push(q),q}function M(W){const j=c.pop();return j.end=w(),d.events.push(["exit",j,d]),j}function D(W,j){L(W,j.from)}function A(W,j){j.restore()}function O(W,j){return q;function q($,B,_){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,Pe=[...Array.isArray(ve)?ve:ve?[ve]:[],...Array.isArray(Se)?Se:Se?[Se]:[]];return G(Pe)(ue)}}function G(ae){return z=ae,H=0,ae.length===0?_:I(ae[H])}function I(ae){return Z;function Z(ue){return P=V(),K=ae,ae.partial||(d.currentConstruct=ae),ae.name&&d.parser.constructs.disable.null.includes(ae.name)?le():ae.tokenize.call(j?Object.assign(Object.create(d),j):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]):_}}}function L(W,j){W.resolveAll&&!o.includes(W)&&o.push(W),W.resolve&&ri(d.events,j,d.events.length-j,W.resolve(d.events.slice(j),d)),W.resolveTo&&(d.events=W.resolveTo(d.events,d))}function V(){const W=w(),j=d.previous,q=d.currentConstruct,$=d.events.length,B=Array.from(c);return{from:$,restore:_};function _(){r=W,d.previous=j,d.currentConstruct=q,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 g9(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 y9(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=`
344
- `;break}case-3:{l=`\r
345
- `;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 b9(e){const r={constructs:sO([p9,...(e||{}).extensions||[]]),content:a(I6),defined:[],document:a(L6),flow:a(J8),lazy:{},string:a(n9),text:a(r9)};return r;function a(o){return l;function l(c){return m9(r,o,c)}}}function v9(e){for(;!fO(e););return e}const pR=/[\0\t\n\r]/g;function x9(){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(pR.lastIndex=h,d=pR.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 w9=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function S9(e){return e.replace(w9,E9)}function E9(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),o=a===120||a===88;return lO(n.slice(o?2:1),o?16:10)}return cw(n)||e}const bO={}.hasOwnProperty;function C9(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),T9(n)(v9(b9(n).document().write(x9()(e,t,!0))))}function T9(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(J),autolinkProtocol:V,autolinkEmail:V,atxHeading:o(Le),blockQuote:o(Se),characterEscape:V,characterReference:V,codeFenced:o(Pe),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:o(Pe,l),codeText:o(te,l),codeTextData:V,data:V,codeFlowValue:V,definition:o(he),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:o(ye),hardBreakEscape:o(Ae),hardBreakTrailing:o(Ae),htmlFlow:o(Ce,l),htmlFlowData:V,htmlText:o(Ce,l),htmlTextData:V,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(Le),strong:o(qe),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(S),codeText:f(B),codeTextData:F,data:F,definition:f(),definitionDestinationString:M,definitionLabelString:R,definitionTitleString:k,emphasis:f(),hardBreakEscape:f(j),hardBreakTrailing:f(j),htmlFlow:f(q),htmlFlowData:F,htmlText:f($),htmlTextData:F,image:f(z),label:K,labelText:H,lineEnding:W,link:f(_),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:Q,resourceDestinationString:P,resourceTitleString:U,resource:G,setextHeading:f(L),setextHeadingLineSequence:O,setextHeadingText:A,strong:f(),thematicBreak:f()}};vO(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 Oe=-1;for(;++Oe<pe.length;)if(pe[Oe][1].type==="listOrdered"||pe[Oe][1].type==="listUnordered")if(pe[Oe][0]==="enter")fe.push(Oe);else{const He=fe.pop();Oe=a(pe,He,Oe)}for(Oe=-1;++Oe<pe.length;){const He=t[pe[Oe][0]];bO.call(He,pe[Oe][1].type)&&He[pe[Oe][1].type].call(Object.assign({sliceSerialize:pe[Oe][2].sliceSerialize},ee),pe[Oe][1])}if(ee.tokenStack.length>0){const He=ee.tokenStack[ee.tokenStack.length-1];(He[1]||mR).call(ee,void 0,He[0])}for(Te.position={start:xo(pe.length>0?pe[0][1].start:{line:1,column:1,offset:0}),end:xo(pe.length>0?pe[pe.length-2][1].end:{line:1,column:1,offset:0})},Oe=-1;++Oe<t.transforms.length;)Te=t.transforms[Oe](Te)||Te;return Te}function a(pe,Te,ee){let fe=Te-1,Oe=-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"?Oe++:Oe--,Ze=void 0;break}case"lineEndingBlank":{tt[0]==="enter"&&($e&&!Ze&&!Oe&&!ze&&(ze=fe),Ze=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ze=void 0}if(!Oe&&tt[0]==="enter"&&tt[1].type==="listItemPrefix"||Oe===-1&&tt[0]==="exit"&&(tt[1].type==="listUnordered"||tt[1].type==="listOrdered")){if($e){let Ct=fe;for(et=void 0;Ct--;){const zt=pe[Ct];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=Ct}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 Ct={type:"listItem",_spread:!1,start:Object.assign({},tt[1].start),end:void 0};$e=Ct,pe.splice(fe,0,["enter",Ct,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:xo(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]||mR).call(this,pe,fe[0]));else throw new Error("Cannot close `"+pe.type+"` ("+id({start:pe.start,end:pe.end})+"): it’s not open");ee.position.end=xo(pe.end)}function m(){return lw(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 S(){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 A(){this.data.setextHeadingSlurpLineEnding=!0}function O(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 V(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:xo(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=xo(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=xo(pe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Te.type)&&(V.call(this,pe),F.call(this,pe))}function j(){this.data.atHardBreak=!0}function q(){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 _(){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=S9(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=lO(Te,ee==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):fe=cw(Te);const Oe=this.stack[this.stack.length-1];Oe.value+=fe}function Z(pe){const Te=this.stack.pop();Te.position.end=xo(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 Pe(){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 Le(){return{type:"heading",depth:0,children:[]}}function Ae(){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 qe(){return{type:"strong",children:[]}}function De(){return{type:"text",value:""}}function ut(){return{type:"thematicBreak"}}}function xo(e){return{line:e.line,column:e.column,offset:e.offset}}function vO(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?vO(e,r):R9(e,r)}}function R9(e,t){let n;for(n in t)if(bO.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 mR(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+id({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+id({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+id({start:t.start,end:t.end})+") is still open")}function k9(e){const t=this;t.parser=n;function n(r){return C9(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function M9(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 A9(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
346
- `}]}function O9(e,t){const n=t.value?t.value+`
347
- `:"",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 N9(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function D9(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function I9(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),a=Nc(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 P9(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 L9(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function xO(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 j9(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return xO(e,t);const a={src:Nc(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 _9(e,t){const n={src:Nc(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 z9(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 F9(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return xO(e,t);const a={href:Nc(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 B9(e,t){const n={href:Nc(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 H9(e,t,n){const r=e.all(t),a=n?U9(n):wO(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:`
348
- `}),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:`
349
- `});const d={type:"element",tagName:"li",properties:o,children:l};return e.patch(t,d),e.applyData(t,d)}function U9(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=wO(n[r])}return t}function wO(e){const t=e.spread;return t??e.children.length>1}function V9(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 q9(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function $9(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Y9(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function W9(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=iw(t.children[1]),f=eO(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 K9(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 G9(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const gR=9,yR=32;function X9(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),a=0;const o=[];for(;r;)o.push(bR(t.slice(a,r.index),a>0,!0),r[0]),a=r.index+r[0].length,r=n.exec(t);return o.push(bR(t.slice(a),a>0,!1)),o.join("")}function bR(e,t,n){let r=0,a=e.length;if(t){let o=e.codePointAt(r);for(;o===gR||o===yR;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(a-1);for(;o===gR||o===yR;)a--,o=e.codePointAt(a-1)}return a>r?e.slice(r,a):""}function Q9(e,t){const n={type:"text",value:X9(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Z9(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const J9={blockquote:M9,break:A9,code:O9,delete:N9,emphasis:D9,footnoteReference:I9,heading:P9,html:L9,imageReference:j9,image:_9,inlineCode:z9,linkReference:F9,link:B9,listItem:H9,list:V9,paragraph:q9,root:$9,strong:Y9,table:W9,tableCell:G9,tableRow:K9,text:Q9,thematicBreak:Z9,toml:Ch,yaml:Ch,definition:Ch,footnoteDefinition:Ch};function Ch(){}const SO=-1,om=0,od=1,yp=2,dw=3,fw=4,hw=5,pw=6,EO=7,CO=8,eV=typeof self=="object"?self:globalThis,vR=(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 eV[e](t)},tV=(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 om:case SO:return n(l,a);case od:{const c=n([],a);for(const f of l)c.push(r(f));return c}case yp:{const c=n({},a);for(const[f,d]of l)c[r(f)]=r(d);return c}case dw:return n(new Date(l),a);case fw:{const{source:c,flags:f}=l;return n(new RegExp(c,f),a)}case hw:{const c=n(new Map,a);for(const[f,d]of l)c.set(r(f),r(d));return c}case pw:{const c=n(new Set,a);for(const f of l)c.add(r(f));return c}case EO:{const{name:c,message:f}=l;return n(vR(c,f),a)}case CO: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(vR(o,l),a)};return r},xR=e=>tV(new Map,e)(0),zl="",{toString:nV}={},{keys:rV}=Object,Hu=e=>{const t=typeof e;if(t!=="object"||!e)return[om,t];const n=nV.call(e).slice(8,-1);switch(n){case"Array":return[od,zl];case"Object":return[yp,zl];case"Date":return[dw,zl];case"RegExp":return[fw,zl];case"Map":return[hw,zl];case"Set":return[pw,zl];case"DataView":return[od,n]}return n.includes("Array")?[od,n]:n.includes("Error")?[EO,n]:[yp,n]},Th=([e,t])=>e===om&&(t==="function"||t==="symbol"),iV=(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]=Hu(l);switch(c){case om:{let m=l;switch(f){case"bigint":c=CO,m=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+f);m=null;break;case"undefined":return a([SO],l)}return a([c,m],l)}case od:{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 yp:{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 rV(l))(e||!Th(Hu(l[y])))&&m.push([o(y),o(l[y])]);return h}case dw:return a([c,l.toISOString()],l);case fw:{const{source:m,flags:h}=l;return a([c,{source:m,flags:h}],l)}case hw:{const m=[],h=a([c,m],l);for(const[y,g]of l)(e||!(Th(Hu(y))||Th(Hu(g))))&&m.push([o(y),o(g)]);return h}case pw:{const m=[],h=a([c,m],l);for(const y of l)(e||!Th(Hu(y)))&&m.push(o(y));return h}}const{message:d}=l;return a([c,{name:f,message:d}],l)};return o},wR=(e,{json:t,lossy:n}={})=>{const r=[];return iV(!(t||n),!!t,new Map,r)(e),r},bp=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?xR(wR(e,t)):structuredClone(e):(e,t)=>xR(wR(e,t));function aV(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 oV(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function sV(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||aV,r=e.options.footnoteBackLabel||oV,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=Nc(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 S={type:"element",tagName:"li",properties:{id:t+"fn-"+y},children:e.wrap(m,!0)};e.patch(d,S),c.push(S)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...bp(l),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:`
350
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
351
- `}]}}const sm=(function(e){if(e==null)return dV;if(typeof e=="function")return lm(e);if(typeof e=="object")return Array.isArray(e)?lV(e):cV(e);if(typeof e=="string")return uV(e);throw new Error("Expected function, string, or object as test")});function lV(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=sm(e[n]);return lm(r);function r(...a){let o=-1;for(;++o<t.length;)if(t[o].apply(this,a))return!0;return!1}}function cV(e){const t=e;return lm(n);function n(r){const a=r;let o;for(o in e)if(a[o]!==t[o])return!1;return!0}}function uV(e){return lm(t);function t(n){return n&&n.type===e}}function lm(e){return t;function t(n,r,a){return!!(fV(n)&&e.call(this,n,typeof r=="number"?r:void 0,a||void 0))}}function dV(){return!0}function fV(e){return e!==null&&typeof e=="object"&&"type"in e}const TO=[],hV=!0,Lv=!1,pV="skip";function RO(e,t,n,r){let a;typeof t=="function"&&typeof n!="function"?(r=n,n=t):a=t;const o=sm(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=TO,w,C,T;if((!t||o(f,d,m[m.length-1]||void 0))&&(g=mV(n(f,m)),g[0]===Lv))return g;if("children"in f&&f.children){const S=f;if(S.children&&g[0]!==pV)for(C=(r?S.children.length:-1)+l,T=m.concat(S);C>-1&&C<S.children.length;){const R=S.children[C];if(w=c(R,C,T)(),w[0]===Lv)return w;C=typeof w[1]=="number"?w[1]:C+l}}return g}}}function mV(e){return Array.isArray(e)?e:typeof e=="number"?[hV,e]:e==null?TO:[e]}function mw(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),RO(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 jv={}.hasOwnProperty,gV={};function yV(e,t){const n=t||gV,r=new Map,a=new Map,o=new Map,l={...J9,...n.handlers},c={all:d,applyData:vV,definitionById:r,footnoteById:a,footnoteCounts:o,footnoteOrder:[],handlers:l,one:f,options:n,patch:bV,wrap:wV};return mw(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(jv.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,S=bp(T);return S.children=c.all(m),S}return bp(m)}return(c.options.unknownHandler||xV)(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=SR(w.value)),!Array.isArray(w)&&w.type==="element")){const C=w.children[0];C&&C.type==="text"&&(C.value=SR(C.value))}Array.isArray(w)?h.push(...w):h.push(w)}}}return h}}function bV(e,t){e.position&&(t.position=a6(e))}function vV(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,bp(o)),"children"in n&&n.children&&a!==null&&a!==void 0&&(n.children=a)}return n}function xV(e,t){const n=t.data||{},r="value"in t&&!(jv.call(n,"hProperties")||jv.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 wV(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
352
- `});++r<e.length;)r&&n.push({type:"text",value:`
353
- `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
354
- `}),n}function SR(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function ER(e,t){const n=yV(e,t),r=n.one(e,void 0),a=sV(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return a&&o.children.push({type:"text",value:`
355
- `},a),o}function SV(e,t){return e&&"run"in e?async function(n,r){const a=ER(n,{file:r,...t});await e.run(a,r)}:function(n,r){return ER(n,{file:r,...e||t})}}function CR(e){if(e)throw e}var mb,TR;function EV(){if(TR)return mb;TR=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 mb=function f(){var d,m,h,y,g,w,C=arguments[0],T=1,S=arguments.length,R=!1;for(typeof C=="boolean"&&(R=C,C=arguments[1]||{},T=2),(C==null||typeof C!="object"&&typeof C!="function")&&(C={});T<S;++T)if(d=arguments[T],d!=null)for(m in d)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},mb}var CV=EV();const gb=Bp(CV);function _v(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 TV(){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?RV(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 RV(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 Wi={basename:kV,dirname:MV,extname:AV,join:OV,sep:"/"};function kV(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Ud(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 MV(e){if(Ud(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 AV(e){Ud(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 OV(...e){let t=-1,n;for(;++t<e.length;)Ud(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":NV(n)}function NV(e){Ud(e);const t=e.codePointAt(0)===47;let n=DV(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function DV(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 Ud(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const IV={cwd:PV};function PV(){return"/"}function zv(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function LV(e){if(typeof e=="string")e=new URL(e);else if(!zv(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 jV(e)}function jV(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 yb=["history","path","basename","stem","extname","dirname"];class kO{constructor(t){let n;t?zv(t)?n={path:t}:typeof t=="string"||_V(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":IV.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<yb.length;){const o=yb[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)yb.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?Wi.basename(this.path):void 0}set basename(t){vb(t,"basename"),bb(t,"basename"),this.path=Wi.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Wi.dirname(this.path):void 0}set dirname(t){RR(this.basename,"dirname"),this.path=Wi.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Wi.extname(this.path):void 0}set extname(t){if(bb(t,"extname"),RR(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=Wi.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){zv(t)&&(t=LV(t)),vb(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Wi.basename(this.path,this.extname):void 0}set stem(t){vb(t,"stem"),bb(t,"stem"),this.path=Wi.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(Wi.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Wi.sep+"`")}function vb(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function RR(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function _V(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const zV=(function(e){const r=this.constructor.prototype,a=r[e],o=function(){return a.apply(o,arguments)};return Object.setPrototypeOf(o,r),o}),FV={}.hasOwnProperty;class gw extends zV{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=TV()}copy(){const t=new gw;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(gb(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Sb("data",this.frozen),this.namespace[t]=n,this):FV.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Sb("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=Rh(t),r=this.parser||this.Parser;return xb("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),xb("process",this.parser||this.Parser),wb("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(o,l){const c=Rh(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);UV(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(),xb("processSync",this.parser||this.Parser),wb("processSync",this.compiler||this.Compiler),this.process(t,a),MR("processSync","process",n),r;function a(o,l){n=!0,CR(o),r=l}}run(t,n,r){kR(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=Rh(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),MR("runSync","run",r),a;function o(l,c){CR(l),a=c,r=!0}}stringify(t,n){this.freeze();const r=Rh(n),a=this.compiler||this.Compiler;return wb("stringify",a),kR(t),a(t,r)}use(t,...n){const r=this.attachers,a=this.namespace;if(Sb("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=gb(!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];_v(C)&&_v(g)&&(g=gb(!0,C,g)),r[y]=[d,g,...w]}}}}const BV=new gw().freeze();function xb(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function wb(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Sb(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 kR(e){if(!_v(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function MR(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Rh(e){return HV(e)?e:new kO(e)}function HV(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function UV(e){return typeof e=="string"||VV(e)}function VV(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const qV="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",AR=[],OR={allowDangerousHtml:!0},$V=/^(https?|ircs?|mailto|xmpp)$/i,YV=[{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 WV(e){const t=KV(e),n=GV(e);return XV(t.runSync(t.parse(n),n),e)}function KV(e){const t=e.rehypePlugins||AR,n=e.remarkPlugins||AR,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...OR}:OR;return BV().use(k9).use(n).use(SV,r).use(t)}function GV(e){const t=e.children||"",n=new kO;return typeof t=="string"&&(n.value=t),n}function XV(e,t){const n=t.allowedElements,r=t.allowElement,a=t.components,o=t.disallowedElements,l=t.skipHtml,c=t.unwrapDisallowed,f=t.urlTransform||QV;for(const m of YV)Object.hasOwn(t,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+qV+m.id,void 0);return mw(e,d),u6(e,{Fragment:E.Fragment,components:a,ignoreInvalidStyle:!0,jsx:E.jsx,jsxs:E.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 fb)if(Object.hasOwn(fb,g)&&Object.hasOwn(m.properties,g)){const w=m.properties[g],C=fb[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 QV(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||$V.test(e.slice(0,t))?e:""}function NR(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 ZV(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function JV(e,t,n){const a=sm((n||{}).ignore||[]),o=eq(t);let l=-1;for(;++l<o.length;)RO(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 S=!1,R=[];y.lastIndex=0;let k=y.exec(d.value);for(;k;){const M=k.index,D={index:k.index,input:k.input,stack:[...m,d]};let A=g(...k,D);if(typeof A=="string"&&(A=A.length>0?{type:"text",value:A}:void 0),A===!1?y.lastIndex=M+1:(w!==M&&R.push({type:"text",value:d.value.slice(w,M)}),Array.isArray(A)?R.push(...A):A&&R.push(A),w=M+k[0].length,S=!0),!y.global)break;k=y.exec(d.value)}return S?(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 eq(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([tq(a[0]),nq(a[1])])}return t}function tq(e){return typeof e=="string"?new RegExp(ZV(e),"g"):e}function nq(e){return typeof e=="function"?e:function(){return e}}const Eb="phrasing",Cb=["autolink","link","image","label"];function rq(){return{transforms:[uq],enter:{literalAutolink:aq,literalAutolinkEmail:Tb,literalAutolinkHttp:Tb,literalAutolinkWww:Tb},exit:{literalAutolink:cq,literalAutolinkEmail:lq,literalAutolinkHttp:oq,literalAutolinkWww:sq}}}function iq(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Eb,notInConstruct:Cb},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Eb,notInConstruct:Cb},{character:":",before:"[ps]",after:"\\/",inConstruct:Eb,notInConstruct:Cb}]}}function aq(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Tb(e){this.config.enter.autolinkProtocol.call(this,e)}function oq(e){this.config.exit.autolinkProtocol.call(this,e)}function sq(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 lq(e){this.config.exit.autolinkEmail.call(this,e)}function cq(e){this.exit(e)}function uq(e){JV(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,dq],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),fq]],{ignore:["link","linkReference"]})}function dq(e,t,n,r,a){let o="";if(!MO(a)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!hq(n)))return!1;const l=pq(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 fq(e,t,n,r){return!MO(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function hq(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 pq(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=NR(e,"(");let o=NR(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 MO(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Ys(n)||im(n))&&(!t||n!==47)}AO.peek=Eq;function mq(){this.buffer()}function gq(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function yq(){this.buffer()}function bq(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function vq(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 xq(e){this.exit(e)}function wq(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 Sq(e){this.exit(e)}function Eq(){return"["}function AO(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 Cq(){return{enter:{gfmFootnoteCallString:mq,gfmFootnoteCall:gq,gfmFootnoteDefinitionLabelString:yq,gfmFootnoteDefinition:bq},exit:{gfmFootnoteCallString:vq,gfmFootnoteCall:xq,gfmFootnoteDefinitionLabelString:wq,gfmFootnoteDefinition:Sq}}}function Tq(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:AO},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?`
356
- `:" ")+o.indentLines(o.containerFlow(r,c.current()),t?OO:Rq))),d(),f}}function Rq(e,t,n){return t===0?e:OO(e,t,n)}function OO(e,t,n){return(n?"":" ")+e}const kq=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];NO.peek=Dq;function Mq(){return{canContainEols:["delete"],enter:{strikethrough:Oq},exit:{strikethrough:Nq}}}function Aq(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:kq}],handlers:{delete:NO}}}function Oq(e){this.enter({type:"delete",children:[]},e)}function Nq(e){this.exit(e)}function NO(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 Dq(){return"~"}function Iq(e){return e.length}function Pq(e,t){const n=t||{},r=(n.align||[]).concat(),a=n.stringLength||Iq,o=[],l=[],c=[],f=[];let d=0,m=-1;for(;++m<e.length;){const C=[],T=[];let S=-1;for(e[m].length>d&&(d=e[m].length);++S<e[m].length;){const R=Lq(e[m][S]);if(n.alignDelimiters!==!1){const k=a(R);T[S]=k,(f[S]===void 0||k>f[S])&&(f[S]=k)}C.push(R)}l[m]=C,c[m]=T}let h=-1;if(typeof r=="object"&&"length"in r)for(;++h<d;)o[h]=DR(r[h]);else{const C=DR(r);for(;++h<d;)o[h]=C}h=-1;const y=[],g=[];for(;++h<d;){const C=o[h];let T="",S="";C===99?(T=":",S=":"):C===108?T=":":C===114&&(S=":");let R=n.alignDelimiters===!1?1:Math.max(1,f[h]-T.length-S.length);const k=T+"-".repeat(R)+S;n.alignDelimiters!==!1&&(R=T.length+R+S.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 S=[];for(;++h<d;){const R=C[h]||"";let k="",M="";if(n.alignDelimiters!==!1){const D=f[h]-(T[h]||0),A=o[h];A===114?k=" ".repeat(D):A===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&&S.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&R==="")&&(n.delimiterStart!==!1||h)&&S.push(" "),n.alignDelimiters!==!1&&S.push(k),S.push(R),n.alignDelimiters!==!1&&S.push(M),n.padding!==!1&&S.push(" "),(n.delimiterEnd!==!1||h!==d-1)&&S.push("|")}w.push(n.delimiterEnd===!1?S.join("").replace(/ +$/,""):S.join(""))}return w.join(`
357
- `)}function Lq(e){return e==null?"":String(e)}function DR(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 jq(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()),_q);return a(),l}function _q(e,t,n){return">"+(n?"":" ")+e}function zq(e,t){return IR(e,t.inConstruct,!0)&&!IR(e,t.notInConstruct,!1)}function IR(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 PR(e,t,n,r){let a=-1;for(;++a<n.unsafe.length;)if(n.unsafe[a].character===`
358
- `&&zq(n.stack,n.unsafe[a]))return/[ \t]/.test(r.before)?"":" ";return`\\
359
- `}function Fq(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 Bq(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 Hq(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 Uq(e,t,n,r){const a=Hq(n),o=e.value||"",l=a==="`"?"GraveAccent":"Tilde";if(Bq(e,n)){const h=n.enter("codeIndented"),y=n.indentLines(o,Vq);return h(),y}const c=n.createTracker(r),f=a.repeat(Math.max(Fq(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:`
360
- `,encode:["`"],...c.current()})),h()}return m+=c.move(`
361
- `),o&&(m+=c.move(o+`
362
- `)),m+=c.move(f),d(),m}function Vq(e,t,n){return(n?"":" ")+e}function yw(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 qq(e,t,n,r){const a=yw(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?" ":`
363
- `,...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 $q(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 Sd(e){return"&#x"+e.toString(16).toUpperCase()+";"}function vp(e,t,n){const r=bc(e),a=bc(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}}DO.peek=Yq;function DO(e,t,n,r){const a=$q(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=vp(r.before.charCodeAt(r.before.length-1),d,a);m.inside&&(f=Sd(d)+f.slice(1));const h=f.charCodeAt(f.length-1),y=vp(r.after.charCodeAt(0),h,a);y.inside&&(f=f.slice(0,-1)+Sd(h));const g=l.move(a);return o(),n.attentionEncodeSurroundingInfo={after:y.outside,before:m.outside},c+f+g}function Yq(e,t,n){return n.options.emphasis||"*"}function Wq(e,t){let n=!1;return mw(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Lv}),!!((!e.depth||e.depth<3)&&lw(e)&&(t.options.setext||n))}function Kq(e,t,n,r){const a=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(Wq(e,n)){const m=n.enter("headingSetext"),h=n.enter("phrasing"),y=n.containerPhrasing(e,{...o.current(),before:`
364
- `,after:`
365
- `});return h(),m(),y+`
366
- `+(a===1?"=":"-").repeat(y.length-(Math.max(y.lastIndexOf("\r"),y.lastIndexOf(`
367
- `))+1))}const l="#".repeat(a),c=n.enter("headingAtx"),f=n.enter("phrasing");o.move(l+" ");let d=n.containerPhrasing(e,{before:"# ",after:`
368
- `,...o.current()});return/^[\t ]/.test(d)&&(d=Sd(d.charCodeAt(0))+d.slice(1)),d=d?l+" "+d:l,n.options.closeAtx&&(d+=" "+l),f(),c(),d}IO.peek=Gq;function IO(e){return e.value||""}function Gq(){return"<"}PO.peek=Xq;function PO(e,t,n,r){const a=yw(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 Xq(){return"!"}LO.peek=Qq;function LO(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 Qq(){return"!"}jO.peek=Zq;function jO(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 Zq(){return"`"}function _O(e,t){const n=lw(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))}zO.peek=Jq;function zO(e,t,n,r){const a=yw(n),o=a==='"'?"Quote":"Apostrophe",l=n.createTracker(r);let c,f;if(_O(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 Jq(e,t,n){return _O(e,n)?"<":"["}FO.peek=e7;function FO(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 e7(){return"["}function bw(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 t7(e){const t=bw(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 n7(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 BO(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 r7(e,t,n,r){const a=n.enter("list"),o=n.bulletCurrent;let l=e.ordered?n7(n):bw(n);const c=e.ordered?l==="."?")":".":t7(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),BO(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 i7(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 a7(e,t,n,r){const a=i7(n);let o=n.bulletCurrent||bw(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 o7(e,t,n,r){const a=n.enter("paragraph"),o=n.enter("phrasing"),l=n.containerPhrasing(e,r);return o(),a(),l}const s7=sm(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function l7(e,t,n,r){return(e.children.some(function(l){return s7(l)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function c7(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}HO.peek=u7;function HO(e,t,n,r){const a=c7(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=vp(r.before.charCodeAt(r.before.length-1),d,a);m.inside&&(f=Sd(d)+f.slice(1));const h=f.charCodeAt(f.length-1),y=vp(r.after.charCodeAt(0),h,a);y.inside&&(f=f.slice(0,-1)+Sd(h));const g=l.move(a+a);return o(),n.attentionEncodeSurroundingInfo={after:y.outside,before:m.outside},c+f+g}function u7(e,t,n){return n.options.strong||"*"}function d7(e,t,n,r){return n.safe(e.value,r)}function f7(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 h7(e,t,n){const r=(BO(n)+(n.options.ruleSpaces?" ":"")).repeat(f7(n));return n.options.ruleSpaces?r.slice(0,-1):r}const UO={blockquote:jq,break:PR,code:Uq,definition:qq,emphasis:DO,hardBreak:PR,heading:Kq,html:IO,image:PO,imageReference:LO,inlineCode:jO,link:zO,linkReference:FO,list:r7,listItem:a7,paragraph:o7,root:l7,strong:HO,text:d7,thematicBreak:h7};function p7(){return{enter:{table:m7,tableData:LR,tableHeader:LR,tableRow:y7},exit:{codeText:b7,table:g7,tableData:Rb,tableHeader:Rb,tableRow:Rb}}}function m7(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 g7(e){this.exit(e),this.data.inTable=void 0}function y7(e){this.enter({type:"tableRow",children:[]},e)}function Rb(e){this.exit(e)}function LR(e){this.enter({type:"tableCell",children:[]},e)}function b7(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,v7));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function v7(e,t){return t==="|"?t:e}function x7(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,a=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
369
- `,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 S=h(g,C,T),R=d([S]);return R.slice(0,R.indexOf(`
370
- `))}function f(g,w,C,T){const S=C.enter("tableCell"),R=C.enter("phrasing"),k=C.containerPhrasing(g,{...T,before:o,after:o});return R(),S(),k}function d(g,w){return Pq(g,{align:w,alignDelimiters:r,padding:n,stringLength:a})}function m(g,w,C){const T=g.children;let S=-1;const R=[],k=w.enter("table");for(;++S<T.length;)R[S]=h(T[S],w,C);return k(),R}function h(g,w,C){const T=g.children;let S=-1;const R=[],k=w.enter("tableRow");for(;++S<T.length;)R[S]=f(T[S],g,w,C);return k(),R}function y(g,w,C){let T=UO.inlineCode(g,w,C);return C.stack.includes("tableCell")&&(T=T.replace(/\|/g,"\\$&")),T}}function w7(){return{exit:{taskListCheckValueChecked:jR,taskListCheckValueUnchecked:jR,paragraph:E7}}}function S7(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:C7}}}function jR(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function E7(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 C7(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=UO.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 T7(){return[rq(),Cq(),Mq(),p7(),w7()]}function R7(e){return{extensions:[iq(),Tq(e),Aq(),x7(e),S7()]}}const k7={tokenize:I7,partial:!0},VO={tokenize:P7,partial:!0},qO={tokenize:L7,partial:!0},$O={tokenize:j7,partial:!0},M7={tokenize:_7,partial:!0},YO={name:"wwwAutolink",tokenize:N7,previous:KO},WO={name:"protocolAutolink",tokenize:D7,previous:GO},$a={name:"emailAutolink",tokenize:O7,previous:XO},ca={};function A7(){return{text:ca}}let Ss=48;for(;Ss<123;)ca[Ss]=$a,Ss++,Ss===58?Ss=65:Ss===91&&(Ss=97);ca[43]=$a;ca[45]=$a;ca[46]=$a;ca[95]=$a;ca[72]=[$a,WO];ca[104]=[$a,WO];ca[87]=[$a,YO];ca[119]=[$a,YO];function O7(e,t,n){const r=this;let a,o;return l;function l(h){return!Fv(h)||!XO.call(r,r.previous)||vw(r.events)?n(h):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(h))}function c(h){return Fv(h)?(e.consume(h),c):h===64?(e.consume(h),f):n(h)}function f(h){return h===46?e.check(M7,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 N7(e,t,n){const r=this;return a;function a(l){return l!==87&&l!==119||!KO.call(r,r.previous)||vw(r.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(k7,e.attempt(VO,e.attempt(qO,o),n),n)(l))}function o(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function D7(e,t,n){const r=this;let a="",o=!1;return l;function l(h){return(h===72||h===104)&&GO.call(r,r.previous)&&!vw(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||gp(h)||wn(h)||Ys(h)||im(h)?n(h):e.attempt(VO,e.attempt(qO,m),n)(h)}function m(h){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(h)}}function I7(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 P7(e,t,n){let r,a,o;return l;function l(d){return d===46||d===95?e.check($O,f,c)(d):d===null||wn(d)||Ys(d)||d!==45&&im(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 L7(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($O,t,o)(l):l===null||wn(l)||Ys(l)?t(l):(e.consume(l),a)}function o(l){return l===41&&r++,e.consume(l),a}}function j7(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||wn(c)||Ys(c)?t(c):n(c)}function a(c){return c===null||c===40||c===91||wn(c)||Ys(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 _7(e,t,n){return r;function r(o){return e.consume(o),a}function a(o){return xr(o)?n(o):t(o)}}function KO(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||wn(e)}function GO(e){return!kr(e)}function XO(e){return!(e===47||Fv(e))}function Fv(e){return e===43||e===45||e===46||e===95||xr(e)}function vw(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 z7={tokenize:Y7,partial:!0};function F7(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:V7,continuation:{tokenize:q7},exit:$7}},text:{91:{name:"gfmFootnoteCall",tokenize:U7},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:B7,resolveTo:H7}}}}function B7(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 H7(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 U7(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||wn(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 wn(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 V7(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||wn(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 wn(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),an(e,g,"gfmFootnoteDefinitionWhitespace")):n(w)}function g(w){return t(w)}}function q7(e,t,n){return e.check(Hd,t,e.attempt(z7,t,n))}function $7(e){e.exit("gfmFootnoteDefinition")}function Y7(e,t,n){const r=this;return an(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 W7(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&&ri(y,y.length,0,am(g,l.slice(d+1,f),c)),ri(y,y.length,0,[["exit",h,c],["enter",l[f][1],c],["exit",l[f][1],c],["exit",m,c]]),ri(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=bc(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"),S=bc(w);return T._open=!S||S===2&&!!C,T._close=!C||C===2&&!!S,c(w)}}}class K7{constructor(){this.map=[]}add(t,n,r){G7(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 G7(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 X7(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 Q7(){return{flow:{null:{name:"table",tokenize:Z7,resolveAll:J7}}}}function Z7(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 j=W>-1?r.events[W][1].type:null,q=j==="tableHead"||j==="tableRow"?A:f;return q===A&&r.parser.lazy[r.now().line]?n(F):q(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):bt(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)?an(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||wn(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)?an(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)?an(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"),S):F===45?(o+=1,S(F)):F===null||bt(F)?M(F):D(F)}function S(F){return F===45?(e.enter("tableDelimiterFiller"),R(F)):D(F)}function R(F){return F===45?(e.consume(F),R):F===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(F),e.exit("tableDelimiterMarker"),k):(e.exit("tableDelimiterFiller"),k(F))}function k(F){return Kt(F)?an(e,M,"whitespace")(F):M(F)}function M(F){return F===124?w(F):F===null||bt(F)?!l||a!==o?D(F):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(F)):D(F)}function D(F){return n(F)}function A(F){return e.enter("tableRow"),O(F)}function O(F){return F===124?(e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),O):F===null||bt(F)?(e.exit("tableRow"),t(F)):Kt(F)?an(e,O,"whitespace")(F):(e.enter("data"),L(F))}function L(F){return F===null||F===124||wn(F)?(e.exit("data"),O(F)):(e.consume(F),F===92?V:L)}function V(F){return F===92||F===124?(e.consume(F),L):L(F)}}function J7(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 K7;for(;++n<e.length;){const g=e[n],w=g[1];g[0]==="enter"?w.type==="tableHead"?(c=!1,f!==0&&(_R(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=kh(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=kh(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=kh(y,t,o,a,n,h)):l[1]!==0&&(h=kh(y,t,l,a,n,h)),a=0):a&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")&&(l[3]=n)}for(f!==0&&_R(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=X7(t.events,n))}return e}function kh(e,t,n,r,a,o){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(o.end=Object.assign({},Hl(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const f=Hl(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=Hl(t.events,n[2]),m=Hl(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({},Hl(t.events,a)),e.add(a,0,[["exit",o,t]]),o=void 0),o}function _R(e,t,n,r,a){const o=[],l=Hl(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 Hl(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const e$={name:"tasklistCheck",tokenize:n$};function t$(){return{text:{91:e$}}}function n$(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 wn(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 bt(f)?t(f):Kt(f)?e.check({tokenize:r$},t,n)(f):n(f)}}function r$(e,t,n){return an(e,r,"whitespace");function r(a){return a===null?n(a):t(a)}}function i$(e){return sO([A7(),F7(),W7(e),Q7(),t$()])}const a$={};function o$(e){const t=this,n=e||a$,r=t.data(),a=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);a.push(i$(n)),o.push(T7()),l.push(R7(n))}function s$(e){const t=e.split(`
371
- `),n=[];let r=[],a=!1;const o=()=>{const l=r.join(`
372
- `);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 l$={a:({node:e,...t})=>E.jsx("a",{...t,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline underline-offset-2 break-all"}),pre:({node:e,...t})=>E.jsx("pre",{...t,className:"bg-muted overflow-x-auto rounded-md p-2 font-mono text-xs leading-relaxed"}),code:({node:e,className:t,...n})=>E.jsx("code",{...n,className:je("bg-muted rounded px-1 font-mono text-xs",t)}),ul:({node:e,...t})=>E.jsx("ul",{...t,className:"list-disc pl-5"}),ol:({node:e,...t})=>E.jsx("ol",{...t,className:"list-decimal pl-5"}),blockquote:({node:e,...t})=>E.jsx("blockquote",{...t,className:"border-border text-muted-foreground border-l-2 pl-2"}),h1:({node:e,...t})=>E.jsx("h1",{...t,className:"text-base font-semibold"}),h2:({node:e,...t})=>E.jsx("h2",{...t,className:"text-sm font-semibold"}),h3:({node:e,...t})=>E.jsx("h3",{...t,className:"text-sm font-semibold"}),table:({node:e,...t})=>E.jsx("div",{className:"overflow-x-auto",children:E.jsx("table",{...t,className:"border-border w-full border-collapse border text-xs"})}),th:({node:e,...t})=>E.jsx("th",{...t,className:"border-border bg-muted border px-2 py-1 text-left"}),td:({node:e,...t})=>E.jsx("td",{...t,className:"border-border border px-2 py-1"})},c$=v.memo(function({content:t}){return E.jsx(WV,{remarkPlugins:[o$],components:l$,children:t})});function u$({text:e,streaming:t=!1,className:n}){const r=v.useMemo(()=>s$(e),[e]);return E.jsxs("div",{className:je("flex min-w-0 flex-col gap-2 text-sm leading-relaxed",n),children:[r.map((a,o)=>E.jsx(c$,{content:a},o)),t&&E.jsx("span",{"data-testid":"agent-streaming-cursor",className:"bg-foreground inline-block h-4 w-2 animate-pulse self-start"})]})}function d$({text:e,streaming:t=!1,className:n}){return E.jsx("div",{"data-testid":"agent-assistant-message",className:je("min-w-0 max-w-full self-start",n),children:E.jsx(u$,{text:e,streaming:t})})}const f$=[];function cm(e){v.useEffect(e,f$)}const Mh=null;class h${constructor(){st(this,"callbacks",[]);st(this,"callbacksCount",0);st(this,"nextId",1);st(this,"startId",1);st(this,"isScheduled",!1);st(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 Ah=new h$;class zn{constructor(){st(this,"currentId",Mh);st(this,"cancel",()=>{this.currentId!==Mh&&(Ah.cancel(this.currentId),this.currentId=Mh)});st(this,"disposeEffect",()=>this.cancel)}static create(){return new zn}static request(t){return Ah.request(t)}static cancel(t){return Ah.cancel(t)}request(t){this.cancel(),this.currentId=Ah.request(()=>{this.currentId=Mh,t()})}}function Vd(){const e=nr(zn.create).current;return cm(e.disposeEffect),e}function Ia(e){return e==null?e:"current"in e?e.current:e}let Ws=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const p$={[Ws.startingStyle]:""},m$={[Ws.endingStyle]:""},Ya={transitionStatus(e){return e==="starting"?p$:e==="ending"?m$:null}};function QO(e,t=!1,n=!0){const r=Vd();return Ye((a,o=null)=>{r.cancel();function l(){pr.flushSync(a)}const c=Ia(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=Ws.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 qd(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),Ve(()=>{if(!e&&o&&r!=="ending"&&n){const c=zn.request(()=>{a("ending")});return()=>{zn.cancel(c)}}},[e,o,r,n]),Ve(()=>{if(!e||t)return;const c=zn.request(()=>{a(void 0)});return()=>{zn.cancel(c)}},[t,e]),Ve(()=>{if(!e||!t)return;e&&o&&r!=="idle"&&a("starting");const c=zn.request(()=>{a("idle")});return()=>{zn.cancel(c)}},[t,e,o,a,r]),v.useMemo(()=>({mounted:o,setMounted:l,transitionStatus:r}),[o,r])}function g$(e){const{open:t,defaultOpen:n,onOpenChange:r,disabled:a}=e,o=t!==void 0,[l,c]=yc({controlled:t,default:n,name:"Collapsible",state:"open"}),{mounted:f,setMounted:d,transitionStatus:m}=qd(l,!0,!0),[h,y]=v.useState(l),[{height:g,width:w},C]=v.useState({height:void 0,width:void 0}),T=Hi(),[S,R]=v.useState(),k=S??T,[M,D]=v.useState(!1),[A,O]=v.useState(!1),L=v.useRef(null),V=v.useRef(null),F=v.useRef(null),W=v.useRef(null),j=QO(W,!1),q=Ye($=>{const B=!l,_=vt(qs,$.nativeEvent);if(r(B,_),_.isCanceled)return;const z=W.current;V.current==="css-animation"&&z!=null&&z.style.removeProperty("animation-name"),!M&&!A&&(V.current!=null&&V.current!=="css-animation"&&!f&&B&&d(!0),V.current==="css-animation"&&(!h&&B&&y(!0),!f&&B&&d(!0))),c(B),V.current==="none"&&f&&!B&&d(!1)});return Ve(()=>{o&&V.current==="none"&&!A&&!l&&d(!1)},[o,A,l,t,d]),v.useMemo(()=>({abortControllerRef:L,animationTypeRef:V,disabled:a,handleTrigger:q,height:g,mounted:f,open:l,panelId:k,panelRef:W,runOnceAnimationsFinish:j,setDimensions:C,setHiddenUntilFound:D,setKeepMounted:O,setMounted:d,setOpen:c,setPanelIdState:R,setVisible:y,transitionDimensionRef:F,transitionStatus:m,visible:h,width:w}),[L,V,a,q,g,f,l,k,W,j,C,D,O,d,c,y,F,m,h,w])}const ZO=v.createContext(void 0);function JO(){const e=v.useContext(ZO);if(e===void 0)throw new Error(Cn(15));return e}let sd=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Ws.startingStyle]="startingStyle",e[e.endingStyle=Ws.endingStyle]="endingStyle",e})({}),y$=(function(e){return e.panelOpen="data-panel-open",e})({});const b$={[sd.open]:""},v$={[sd.closed]:""},x$={open(e){return e?{[y$.panelOpen]:""}:null}},w$={open(e){return e?b$:v$}},eN={...w$,...Ya},S$=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=g$({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=Dt("div",t,{state:y,ref:n,props:d,stateAttributesMapping:eN});return E.jsx(ZO.Provider,{value:g,children:w})}),E$={...x$,...Ya},C$=v.forwardRef(function(t,n){const{panelId:r,open:a,handleTrigger:o,state:l,disabled:c}=JO(),{className:f,disabled:d=c,id:m,render:h,nativeButton:y=!0,...g}=t,{getButtonProps:w,buttonRef:C}=qa({disabled:d,focusableWhenDisabled:!0,native:y}),T=v.useMemo(()=>({"aria-controls":a?r:void 0,"aria-expanded":a,onClick:o}),[r,a,o]);return Dt("button",t,{state:l,ref:[n,C],props:[T,g,w],stateAttributesMapping:E$})});let T$=(function(e){return e.disabled="data-disabled",e.orientation="data-orientation",e})({});function R$(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:S,visible:R,width:k}=e,M=v.useRef(!1),D=v.useRef(null),A=v.useRef(m),O=v.useRef(m),L=Vd(),V=v.useMemo(()=>n.current==="css-animation"?!R:!m&&!f,[m,f,R,n]),F=Ye(j=>{if(!j)return;if(n.current==null||S.current==null){const B=getComputedStyle(j),_=B.animationName!=="none"&&B.animationName!=="",z=B.transitionDuration!=="0s"&&B.transitionDuration!=="";_&&z||(B.animationName==="none"&&B.transitionDuration!=="0s"?n.current="css-transition":B.animationName!=="none"&&B.transitionDuration==="0s"?n.current="css-animation":n.current="none"),j.getAttribute(T$.orientation)==="horizontal"||B.transitionProperty.indexOf("width")>-1?S.current="width":S.current="height"}if(n.current!=="css-transition")return;(a===void 0||k===void 0)&&(g({height:j.scrollHeight,width:j.scrollWidth}),O.current&&j.style.setProperty("transition-duration","0s"));let q=-1,$=-1;return q=zn.request(()=>{O.current=!1,$=zn.request(()=>{setTimeout(()=>{j.style.removeProperty("transition-duration")})})}),()=>{zn.cancel(q),zn.cancel($)}}),W=_i(r,h,F);return Ve(()=>{if(n.current!=="css-transition")return;const j=h.current;if(!j)return;let q=-1;if(t.current!=null&&(t.current.abort(),t.current=null),m){const $={"justify-content":j.style.justifyContent,"align-items":j.style.alignItems,"align-content":j.style.alignContent,"justify-items":j.style.justifyItems};Object.keys($).forEach(B=>{j.style.setProperty(B,"initial","important")}),!O.current&&!l&&j.setAttribute(sd.startingStyle,""),g({height:j.scrollHeight,width:j.scrollWidth}),q=zn.request(()=>{Object.entries($).forEach(([B,_])=>{_===""?j.style.removeProperty(B):j.style.setProperty(B,_)})})}else{if(j.scrollHeight===0&&j.scrollWidth===0)return;g({height:j.scrollHeight,width:j.scrollWidth});const $=new AbortController;t.current=$;const B=$.signal;let _=null;const z=sd.endingStyle;return _=new MutationObserver(H=>{H.some(P=>P.type==="attributes"&&P.attributeName===z)&&(_==null||_.disconnect(),_=null,y(()=>{g({height:0,width:0}),j.style.removeProperty("content-visibility"),w(!1),t.current===$&&(t.current=null)},B))}),_.observe(j,{attributes:!0,attributeFilter:[z]}),()=>{_==null||_.disconnect(),L.cancel(),t.current===$&&($.abort(),t.current=null)}}return()=>{zn.cancel(q)}},[t,n,L,o,l,f,m,h,y,g,w]),Ve(()=>{if(n.current!=="css-animation")return;const j=h.current;j&&(D.current=j.style.animationName||D.current,j.style.setProperty("animation-name","none"),g({height:j.scrollHeight,width:j.scrollWidth}),!A.current&&!M.current&&j.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]),cm(()=>{const j=zn.request(()=>{A.current=!1});return()=>zn.cancel(j)}),Ve(()=>{if(!o)return;const j=h.current;if(!j)return;let q=-1,$=-1;return m&&M.current&&(j.style.transitionDuration="0s",g({height:j.scrollHeight,width:j.scrollWidth}),q=zn.request(()=>{M.current=!1,$=zn.request(()=>{setTimeout(()=>{j.style.removeProperty("transition-duration")})})})),()=>{zn.cancel(q),zn.cancel($)}},[o,m,h,g]),Ve(()=>{const j=h.current;j&&o&&V&&(j.setAttribute("hidden","until-found"),n.current==="css-transition"&&j.setAttribute(sd.startingStyle,""))},[o,V,n,h]),v.useEffect(function(){const q=h.current;if(!q)return;function $(B){M.current=!0,C(!0),d(!0,vt(zi,B))}return q.addEventListener("beforematch",$),()=>{q.removeEventListener("beforematch",$)}},[d,h,C]),v.useMemo(()=>({props:{hidden:V,id:c,ref:W}}),[V,c,W])}let zR=(function(e){return e.collapsiblePanelHeight="--collapsible-panel-height",e.collapsiblePanelWidth="--collapsible-panel-width",e})({});function Wa(e){const{enabled:t=!0,open:n,ref:r,onComplete:a}=e,o=Ye(a),l=QO(r,n,!1);v.useEffect(()=>{if(!t)return;const c=new AbortController;return l(o,c.signal),()=>{c.abort()}},[t,n,o,l])}const k$=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:S,setDimensions:R,setHiddenUntilFound:k,setKeepMounted:M,setMounted:D,setPanelIdState:A,setOpen:O,setVisible:L,state:V,transitionDimensionRef:F,visible:W,width:j,transitionStatus:q}=JO(),$=a??!1,B=o??!1;Ve(()=>{if(c)return A(c),()=>{A(void 0)}},[c,A]),Ve(()=>{k($)},[k,$]),Ve(()=>{M(B)},[M,B]);const{props:_}=R$({abortControllerRef:d,animationTypeRef:m,externalRef:n,height:h,hiddenUntilFound:$,id:C,keepMounted:B,mounted:y,onOpenChange:g,open:w,panelRef:T,runOnceAnimationsFinish:S,setDimensions:R,setMounted:D,setOpen:O,setVisible:L,transitionDimensionRef:F,visible:W,width:j});Wa({open:w&&q==="idle",ref:T,onComplete(){w&&R({height:void 0,width:void 0})}});const z=v.useMemo(()=>({...V,transitionStatus:q}),[V,q]),H=Dt("div",t,{state:z,ref:[n,T],props:[_,{style:{[zR.collapsiblePanelHeight]:h===void 0?"auto":`${h}px`,[zR.collapsiblePanelWidth]:j===void 0?"auto":`${j}px`}},f],stateAttributesMapping:eN});return B||$||!B&&y?H:null});function um({...e}){return E.jsx(S$,{"data-slot":"collapsible",...e})}function dm({...e}){return E.jsx(C$,{"data-slot":"collapsible-trigger",...e})}function fm({...e}){return E.jsx(k$,{"data-slot":"collapsible-content",...e})}function M$({text:e,streaming:t=!1,className:n}){const{t:r}=Sn();return E.jsxs(um,{"data-testid":"agent-reasoning-block",className:je("min-w-0 max-w-full self-start",n),children:[E.jsxs(dm,{className:"text-muted-foreground hover:text-foreground group flex items-center gap-1 text-xs",children:[E.jsx($p,{className:"size-3 transition-transform group-data-[panel-open]:rotate-90"}),E.jsx(LF,{className:"size-3"}),E.jsx("span",{children:r("agent.reasoning.title")}),t&&E.jsx(gc,{className:"size-3 animate-spin"})]}),E.jsx(fm,{children:E.jsx("div",{className:"text-muted-foreground border-border mt-1 border-l-2 pl-2 text-xs whitespace-pre-wrap break-words",children:e})})]})}function hm(e){return Dt(e.defaultTagName??"div",e,e)}const A$=Zp("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 Ks({className:e,variant:t="default",render:n,...r}){return hm({defaultTagName:"span",props:Ei({className:je(A$({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 Bv(e){if(typeof e=="string")return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function O$(e){return $o(e.output)&&typeof e.output.error=="string"?e.output.error:e.isError?Bv(e.output):null}function N$(e){switch(e){case"send_input":return E.jsx(eB,{className:"size-3.5"});case"read_screen":return E.jsx(qx,{className:"size-3.5"});case"web_search":return E.jsx(CB,{className:"size-3.5"});case"fetch_url":return E.jsx(hA,{className:"size-3.5"});default:return E.jsx(_B,{className:"size-3.5"})}}function vc({label:e,text:t}){return E.jsxs(um,{children:[E.jsxs(dm,{className:"text-muted-foreground hover:text-foreground group flex items-center gap-1 text-xs",children:[E.jsx($p,{className:"size-3 transition-transform group-data-[panel-open]:rotate-90"}),E.jsx("span",{children:e})]}),E.jsx(fm,{children:E.jsx("pre",{className:"bg-muted mt-1 max-h-64 overflow-auto rounded-md p-2 font-mono text-xs whitespace-pre-wrap break-all",children:t})})]})}function D$(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 I$({call:e}){const{t}=Sn(),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 E.jsxs("div",{className:"flex flex-col gap-1.5",children:[r&&E.jsx("pre",{className:"bg-muted max-h-40 overflow-auto rounded-md p-2 font-mono text-xs whitespace-pre-wrap break-all",children:r}),a.length>0&&E.jsx("div",{className:"flex flex-wrap items-center gap-1",children:a.map((c,f)=>E.jsx(Ks,{variant:"outline",className:"font-mono",children:c},`${f}-${c}`))}),l&&E.jsx(vc,{label:t("agent.tool.result"),text:l})]})}function P$({call:e}){const{t}=Sn(),n=$o(e.output)?e.output:{},r=typeof n.screen=="string"?n.screen:"";return r?E.jsx(vc,{label:t("agent.tool.screen"),text:r}):null}function L$({call:e}){const{t}=Sn(),n=$o(e.input)?e.input:{},r=typeof n.query=="string"?n.query:"",a=e.resolved&&!e.isError&&!e.denied?D$(e.output):null;return E.jsxs("div",{className:"flex flex-col gap-1.5",children:[r&&E.jsxs("p",{className:"text-muted-foreground text-xs break-words",children:["“",r,"”"]}),a&&a.length>0&&E.jsx("ul",{className:"flex flex-col gap-1",children:a.map(o=>E.jsxs("li",{className:"min-w-0 text-xs",children:[E.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&&E.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"&&E.jsx(vc,{label:t("agent.tool.result"),text:e.output})]})}function j$({call:e}){const{t}=Sn(),n=$o(e.input)?e.input:{},r=typeof n.url=="string"?n.url:"",a=typeof e.output=="string"?e.output:"";return E.jsxs("div",{className:"flex flex-col gap-1.5",children:[r&&E.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"text-primary block truncate text-xs underline underline-offset-2",title:r,children:r}),e.resolved&&!e.isError&&!e.denied&&a&&E.jsx(vc,{label:t("agent.tool.result"),text:a})]})}const _$=/^[A-Za-z0-9+/]{256,}={0,2}$/,z$=/^https?:\/\/\S+\.(png|jpe?g|webp|gif)(\?\S*)?$/i;function F$(e){return typeof e!="string"||e.length===0?null:e.startsWith("data:image/")||z$.test(e)?e:_$.test(e.replace(/\s/g,""))?`data:image/png;base64,${e.replace(/\s/g,"")}`:null}function B$(e){if(!e.resolved||e.isError||e.denied)return[];const t=[],n=(r,a)=>{if(t.length>=8||a>3)return;const o=F$(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 H$({images:e}){return e.length===0?null:E.jsx("div",{className:"flex flex-wrap gap-2",children:e.map((t,n)=>E.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"block",children:E.jsx("img",{src:t,alt:"generated",className:"max-h-64 max-w-full rounded-md border border-border object-contain",loading:"lazy"})},n))})}function U$({call:e,hideOutput:t}){const{t:n}=Sn();return E.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.input!==void 0&&E.jsx(vc,{label:n("agent.tool.input"),text:Bv(e.input)}),!t&&e.resolved&&!e.isError&&!e.denied&&e.output!==void 0&&E.jsx(vc,{label:n("agent.tool.result"),text:Bv(e.output)})]})}function V$({call:e,confirmationId:t,onDecide:n,className:r}){const{t:a}=Sn(),o=!!t&&!e.resolved,l=e.resolved&&e.denied,c=e.resolved&&!l?O$(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=B$(e);return E.jsxs("div",{"data-testid":`agent-tool-card-${e.toolCallId}`,"data-tool-name":e.toolName,"data-tool-denied":l||void 0,className:je("border-border bg-card flex max-w-full min-w-0 flex-col gap-1.5 self-start rounded-lg border p-2",c!==null&&"border-destructive/50",l&&"opacity-80",r),children:[E.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium",children:[N$(e.toolName),E.jsx("span",{className:"min-w-0 truncate",children:h}),f&&E.jsx(gc,{className:"text-muted-foreground size-3 animate-spin"}),e.resolved&&!l&&c===null&&E.jsx(hp,{className:"size-3 text-emerald-500"}),c!==null&&E.jsx(ed,{className:"text-destructive size-3"}),l&&E.jsxs("span",{className:"text-destructive flex items-center gap-0.5",children:[E.jsx(Ua,{className:"size-3"}),a("agent.tool.denied")]})]}),e.toolName==="send_input"&&E.jsx(I$,{call:e}),e.toolName==="read_screen"&&E.jsx(P$,{call:e}),e.toolName==="web_search"&&E.jsx(L$,{call:e}),e.toolName==="fetch_url"&&E.jsx(j$,{call:e}),!["send_input","read_screen","web_search","fetch_url"].includes(e.toolName)&&E.jsx(U$,{call:e,hideOutput:y.length>0}),E.jsx(H$,{images:y}),c!==null&&E.jsx("p",{className:"text-destructive text-xs break-words whitespace-pre-wrap",children:c}),d&&E.jsx("p",{className:"text-muted-foreground text-xs break-words whitespace-pre-wrap",children:d}),o&&t&&E.jsxs("div",{"data-testid":`agent-tool-approval-${e.toolCallId}`,className:"flex items-center gap-2 pt-1",children:[E.jsx("span",{className:"text-muted-foreground min-w-0 flex-1 text-xs",children:a("agent.confirm.title")}),E.jsxs(qt,{"data-testid":"agent-confirm-approve",size:"xs",variant:"secondary",onClick:()=>n==null?void 0:n(t,!0),children:[E.jsx(hp,{}),a("agent.confirm.approve")]}),E.jsxs(qt,{"data-testid":"agent-confirm-deny",size:"xs",variant:"destructive",onClick:()=>n==null?void 0:n(t,!1),children:[E.jsx(Ua,{}),a("agent.confirm.deny")]})]})]})}function q$({text:e,className:t}){return E.jsx("div",{"data-testid":"agent-user-message",className:je("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 $$=48;function Y$(){return E.jsxs("div",{"data-testid":"agent-running-indicator",className:"flex items-center gap-1 self-start px-1",children:[E.jsx("span",{className:"bg-muted-foreground size-1.5 animate-pulse rounded-full"}),E.jsx("span",{className:"bg-muted-foreground size-1.5 animate-pulse rounded-full [animation-delay:150ms]"}),E.jsx("span",{className:"bg-muted-foreground size-1.5 animate-pulse rounded-full [animation-delay:300ms]"})]})}function W$({blocks:e,running:t,emptyText:n,confirmationByToolCallId:r,onDecide:a,className:o}){const{t:l}=Sn(),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<$$;f.current=C,m(!C)};return e.length===0&&!t?E.jsx("div",{"data-testid":"agent-chat-thread",className:je("flex min-h-0 flex-1 items-center justify-center p-4",o),children:E.jsx("p",{className:"text-muted-foreground text-sm",children:n})}):E.jsxs("div",{className:je("relative min-h-0 flex-1",o),children:[E.jsx("div",{ref:c,"data-testid":"agent-chat-thread",className:"h-full overflow-y-auto p-3",onScroll:y,children:E.jsxs("div",{className:"flex flex-col gap-3",children:[e.map(g=>{switch(g.kind){case"user":return E.jsx(q$,{text:g.text},g.key);case"assistant-text":return E.jsx(d$,{text:g.text,streaming:g.streaming},g.key);case"reasoning":return E.jsx(M$,{text:g.text,streaming:g.streaming},g.key);case"tool-call":return E.jsx(V$,{call:g.call,confirmationId:r.get(g.call.toolCallId),onDecide:a},g.key);default:return null}}),t&&E.jsx(Y$,{})]})}),d&&E.jsx(qt,{"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:E.jsx(MF,{})})]})}function pm(e){const t=v.useRef(!0);t.current&&(t.current=!1,e())}function sr(e){const t=nr(K$,e).current;return t.next=e,Ve(t.effect),t}function K$(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var xp=Symbol("NOT_FOUND");function G$(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function X$(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function Q$(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 FR=e=>Array.isArray(e)?e:[e];function Z$(e){const t=Array.isArray(e[0])?e[0]:e;return Q$(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function J$(e,t){const n=[],{length:r}=e;for(let a=0;a<r;a++)n.push(e[a].apply(null,t));return n}function eY(e){let t;return{get(n){return t&&e(t.key,n)?t.value:xp},put(n,r){t={key:n,value:r}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function tY(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 xp}function a(c,f){r(c)===xp&&(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 nY=(e,t)=>e===t;function rY(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 iY(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:r=nY,maxSize:a=1,resultEqualityCheck:o}=n,l=rY(r);let c=0;const f=a<=1?eY(l):tY(a,l);function d(){let m=f.get(arguments);if(m===xp){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 aY=class{constructor(e){this.value=e}deref(){return this.value}},oY=typeof WeakRef<"u"?WeakRef:aY,sY=0,BR=1;function Oh(){return{s:sY,v:void 0,o:null,p:null}}function tN(e,t={}){let n=Oh();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=Oh(),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=Oh(),C.set(w,c)):c=T}}const d=c;let m;if(c.s===BR)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 oY(m):m}return d.s=BR,d.v=m,m}return l.clearCache=()=>{n=Oh(),l.resetResultsCount()},l.resultsCount=()=>o,l.resetResultsCount=()=>{o=0},l}function nN(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()),G$(d,`createSelector expects an output function after the inputs, but received: [${typeof d}]`);const m={...n,...f},{memoize:h,memoizeOptions:y=[],argsMemoize:g=tN,argsMemoizeOptions:w=[]}=m,C=FR(y),T=FR(w),S=Z$(a),R=h(function(){return o++,d.apply(null,arguments)},...C),k=g(function(){l++;const D=J$(S,arguments);return c=R.apply(null,D),c},...T);return Object.assign(k,{resultFunc:d,memoizedResultFunc:R,dependencies:S,dependencyRecomputations:()=>l,resetDependencyRecomputations:()=>{l=0},lastResult:()=>c,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:h,argsMemoize:g})};return Object.assign(r,{withTypes:()=>r}),r}var lY=nN(tN),cY=Object.assign((e,t=lY)=>{X$(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:()=>cY});nN({memoize:iY,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 kb={exports:{}},Mb={};/**
373
- * @license React
374
- * use-sync-external-store-shim/with-selector.production.js
375
- *
376
- * Copyright (c) Meta Platforms, Inc. and affiliates.
377
- *
378
- * This source code is licensed under the MIT license found in the
379
- * LICENSE file in the root directory of this source tree.
380
- */var HR;function uY(){if(HR)return Mb;HR=1;var e=Pd(),t=JM();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 Mb.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 S(A){if(!R){if(R=!0,k=A,A=y(A),g!==void 0&&C.hasValue){var O=C.value;if(g(O,A))return M=O}return M=A}if(O=M,r(k,A))return O;var L=y(A);return g!==void 0&&g(O,L)?(k=A,O):(k=A,M=L)}var R=!1,k,M,D=h===void 0?null:h;return[function(){return S(m())},D===null?void 0:function(){return S(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},Mb}var UR;function dY(){return UR||(UR=1,kb.exports=uY()),kb.exports}var fY=dY();const Hv=[];let Uv;function hY(){return Uv}function pY(e){Hv.push(e)}function xw(e){const t=(n,r)=>{const a=nr(mY).current;let o;try{Uv=a;for(const l of Hv)l.before(a);o=e(n,r);for(const l of Hv)l.after(a);a.didInitialize=!0}finally{Uv=void 0}return o};return t.displayName=e.displayName||e.name,t}function rN(e){return v.forwardRef(xw(e))}function mY(){return{didInitialize:!1}}const gY=Kx(19),yY=gY?vY:xY;function Et(e,t,n,r,a){return yY(e,t,n,r,a)}function bY(e,t,n,r,a){const o=v.useCallback(()=>t(e.getSnapshot(),n,r,a),[e,t,n,r,a]);return Bx.useSyncExternalStore(e.subscribe,o,o)}pY({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()}}),Bx.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function vY(e,t,n,r,a){const o=hY();if(!o)return bY(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 xY(e,t,n,r,a){return fY.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,o=>t(o,n,r,a))}class iN{constructor(t){st(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));st(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 Et(this,t,n,r,a)}}class mm extends iN{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}useSyncedValue(t,n){v.useDebugValue(t),Ve(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){const r=this;Ve(()=>(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);Ve(()=>{n.update(t)},[n,...r])}useControlledProp(t,n){v.useDebugValue(t);const r=n!==void 0;Ve(()=>{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),Et(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 Uu=0;class aa{constructor(){st(this,"currentId",Uu);st(this,"clear",()=>{this.currentId!==Uu&&(clearTimeout(this.currentId),this.currentId=Uu)});st(this,"disposeEffect",()=>this.clear)}static create(){return new aa}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Uu,n()},t)}isStarted(){return this.currentId!==Uu}}function Fn(){const e=nr(aa.create).current;return cm(e.disposeEffect),e}function Qt(e){return(e==null?void 0:e.ownerDocument)||document}const Dc=typeof navigator<"u",Ab=SY(),aN=CY(),oN=EY(),gm=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),sN=Ab.platform==="MacIntel"&&Ab.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(Ab.platform),lN=Dc&&/apple/i.test(navigator.vendor),Vv=Dc&&/android/i.test(aN)||/android/i.test(oN),wY=Dc&&aN.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,cN=oN.includes("jsdom/");function SY(){if(!Dc)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 EY(){if(!Dc)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function CY(){if(!Dc)return"";const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform??""}const qv="data-base-ui-focusable",uN="active",dN="selected",fN="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Bo="ArrowLeft",Ho="ArrowRight",ww="ArrowUp",$d="ArrowDown";function ti(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 Nt(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&&xv(n)){let a=t;for(;a;){if(e===a)return!0;a=a.parentNode||a.host}}return!1}function wp(e,t){if(!cn(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,r]of t.entries())if(Nt(r,n))return!r.hasAttribute("data-trigger-disabled");return!1}function Rr(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Di(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 TY(e){return e.matches("html,body")}function ym(e){return kn(e)&&e.matches(fN)}function $v(e){return e?e.getAttribute("role")==="combobox"&&ym(e):!1}function RY(e){if(!e||cN)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function Ed(e){return e?e.hasAttribute(qv)?e:e.querySelector(`[${qv}]`)||e:null}function Fs(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,...Fs(e,a.id,n)])}function VR(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 kY(e){return"nativeEvent"in e}function hN(e){return e.pointerType===""&&e.isTrusted?!0:Vv&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function pN(e){return cN?!1:!Vv&&e.width===0&&e.height===0||Vv&&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 Gs(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function mN(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const MY=["top","right","bottom","left"],xc=Math.min,ni=Math.max,Sp=Math.round,ql=Math.floor,ta=e=>({x:e,y:e}),AY={left:"right",right:"left",bottom:"top",top:"bottom"},OY={start:"end",end:"start"};function Yv(e,t,n){return ni(e,xc(t,n))}function Va(e,t){return typeof e=="function"?e(t):e}function Hr(e){return e.split("-")[0]}function Xo(e){return e.split("-")[1]}function Sw(e){return e==="x"?"y":"x"}function Ew(e){return e==="y"?"height":"width"}const NY=new Set(["top","bottom"]);function xi(e){return NY.has(Hr(e))?"y":"x"}function Cw(e){return Sw(xi(e))}function DY(e,t,n){n===void 0&&(n=!1);const r=Xo(e),a=Cw(e),o=Ew(a);let l=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(l=Ep(l)),[l,Ep(l)]}function IY(e){const t=Ep(e);return[Wv(e),t,Wv(t)]}function Wv(e){return e.replace(/start|end/g,t=>OY[t])}const qR=["left","right"],$R=["right","left"],PY=["top","bottom"],LY=["bottom","top"];function jY(e,t,n){switch(e){case"top":case"bottom":return n?t?$R:qR:t?qR:$R;case"left":case"right":return t?PY:LY;default:return[]}}function _Y(e,t,n,r){const a=Xo(e);let o=jY(Hr(e),n==="start",r);return a&&(o=o.map(l=>l+"-"+a),t&&(o=o.concat(o.map(Wv)))),o}function Ep(e){return e.replace(/left|right|bottom|top/g,t=>AY[t])}function zY(e){return{top:0,right:0,bottom:0,left:0,...e}}function gN(e){return typeof e!="number"?zY(e):{top:e,right:e,bottom:e,left:e}}function Cp(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 Nh(e,t,n){return Math.floor(e/t)!==n}function Kl(e,t){return t<0||t>=e.current.length}function ep(e,t){return hr(e,{disabledIndices:t})}function Kv(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&&Uo(e,o,r));return o}function yN(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 S=null,R=-1;e.current.forEach((k,M)=>{if(k==null)return;const D=k.closest('[role="row"]');D&&(w=!0),(D!==S||R===-1)&&(S=D,R+=1,y[R]=[]),y[R].push(M),g[M]=R})}const C=w&&y.length>0&&y.some(S=>S.length!==o);function T(S){if(!C||d===-1)return;const R=g[d];if(R==null)return;const k=y[R].indexOf(d);let M=S==="up"?R-1:R+1;r&&(M<0?M=y.length-1:M>=y.length&&(M=0));const D=new Set;for(;M>=0&&M<y.length&&!D.has(M);){D.add(M);const A=y[M];if(A.length===0){M=S==="up"?M-1:M+1;continue}const O=Math.min(k,A.length-1);for(let L=O;L>=0;L-=1){const V=A[L];if(!Uo(e,V,l))return V}M=S==="up"?M-1:M+1,r&&(M<0?M=y.length-1:M>=y.length&&(M=0))}}if(t.key===ww){const S=T("up");if(S!==void 0)m&&br(t),h=S;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}Kl(e,h)&&(h=d)}}if(t.key===$d){const S=T("down");S!==void 0?(m&&br(t),h=S):(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}))),Kl(e,h)&&(h=d))}if(n==="both"){const S=ql(d/o);t.key===(a?Bo:Ho)&&(m&&br(t),d%o!==o-1?(h=hr(e,{startingIndex:d,disabledIndices:l}),r&&Nh(h,o,S)&&(h=hr(e,{startingIndex:d-d%o-1,disabledIndices:l}))):r&&(h=hr(e,{startingIndex:d-d%o-1,disabledIndices:l})),Nh(h,o,S)&&(h=d)),t.key===(a?Ho:Bo)&&(m&&br(t),d%o!==0?(h=hr(e,{startingIndex:d,decrement:!0,disabledIndices:l}),r&&Nh(h,o,S)&&(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})),Nh(h,o,S)&&(h=d));const R=ql(f/o)===S;Kl(e,h)&&(r&&R?h=t.key===(a?Ho:Bo)?f:hr(e,{startingIndex:d-d%o-1,disabledIndices:l}):h=d)}return h}function bN(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 vN(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 xN(e,t){return t.flatMap((n,r)=>e.includes(n)?[r]:[])}function Uo(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}/*!
381
- * tabbable 6.4.0
382
- * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
383
- */var FY=["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] *)"],Tp=FY.join(","),wN=typeof Element>"u",wc=wN?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Rp=!wN&&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},kp=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]"):kp(t.parentNode));return l},BY=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},SN=function(t,n,r){if(kp(t))return[];var a=Array.prototype.slice.apply(t.querySelectorAll(Tp));return n&&wc.call(t,Tp)&&a.unshift(t),a=a.filter(r),a},Mp=function(t,n,r){for(var a=[],o=Array.from(t);o.length;){var l=o.shift();if(!kp(l,!1))if(l.tagName==="SLOT"){var c=l.assignedElements(),f=c.length?c:l.children,d=Mp(f,!0,r);r.flatten?a.push.apply(a,d):a.push({scopeParent:l,candidates:d})}else{var m=wc.call(l,Tp);m&&r.filter(l)&&(n||!t.includes(l))&&a.push(l);var h=l.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(l),y=!kp(h,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(l));if(h&&y){var g=Mp(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},EN=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},CN=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||BY(t))&&!EN(t)?0:t.tabIndex},HY=function(t,n){var r=CN(t);return r<0&&n&&!EN(t)?0:r},UY=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},TN=function(t){return t.tagName==="INPUT"},VY=function(t){return TN(t)&&t.type==="hidden"},qY=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},$Y=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},YY=function(t){if(!t.name)return!0;var n=t.form||Rp(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=$Y(a,t.form);return!o||o===t},WY=function(t){return TN(t)&&t.type==="radio"},KY=function(t){return WY(t)&&!YY(t)},GY=function(t){var n,r=t&&Rp(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=Rp(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},YR=function(t){var n=t.getBoundingClientRect(),r=n.width,a=n.height;return r===0&&a===0},XY=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=Rp(t);if(d&&!d.shadowRoot&&a(d)===!0)return YR(t);t.assignedSlot?t=t.assignedSlot:!d&&m!==t.ownerDocument?t=m.host:t=d}t=f}if(GY(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return YR(t);return!1},QY=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},Gv=function(t,n){return!(n.disabled||VY(n)||XY(n,t)||qY(n)||QY(n))},Xv=function(t,n){return!(KY(n)||CN(n)<0||!Gv(t,n))},ZY=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},RN=function(t){var n=[],r=[];return t.forEach(function(a,o){var l=!!a.scopeParent,c=l?a.scopeParent:a,f=HY(c,l),d=l?RN(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(UY).reduce(function(a,o){return o.isScope?a.push.apply(a,o.content):a.push(o.content),a},[]).concat(n)},Yd=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Mp([t],n.includeContainer,{filter:Xv.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:ZY}):r=SN(t,n.includeContainer,Xv.bind(null,n)),RN(r)},JY=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Mp([t],n.includeContainer,{filter:Gv.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=SN(t,n.includeContainer,Gv.bind(null,n)),r},kN=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return wc.call(t,Tp)===!1?!1:Xv(n,t)};const Ic=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function MN(e,t){const n=Yd(e,Ic()),r=n.length;if(r===0)return;const a=ti(Qt(e)),o=n.indexOf(a),l=o===-1?t===1?0:r-1:o+t;return n[l]}function Tw(e){return MN(Qt(e).body,1)||e}function AN(e){return MN(Qt(e).body,-1)||e}function ON(e,t){if(!e)return null;const n=Yd(Qt(e).body,Ic()),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 eW(e){return ON(e,1)}function tW(e){return ON(e,-1)}function Gl(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Nt(n,r)}function nW(e){Yd(e,Ic()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function WR(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function NN(){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 Rw{constructor(){st(this,"nodesRef",{current:[]});st(this,"events",NN())}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 DN=v.createContext(null),IN=v.createContext(null),Ka=()=>{var e;return((e=v.useContext(DN))==null?void 0:e.id)||null},Qo=e=>{const t=v.useContext(IN);return e??t};function PN(e){const t=Js(),n=Qo(e),r=Ka();return Ve(()=>{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 rW(e){const{children:t,id:n}=e,r=Ka();return E.jsx(DN.Provider,{value:v.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function iW(e){const{children:t,externalTree:n}=e,r=nr(()=>n??new Rw).current;return E.jsx(IN.Provider,{value:r,children:t})}function Sc(e){return`data-base-ui-${e}`}function tp(e,t,n){if(n&&!Gs(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 aW=v.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new aa,currentIdRef:{current:null},currentContextRef:{current:null}});function oW(e,t={open:!1}){const n="rootStore"in e?e.rootStore:e,r=n.useState("floatingId"),{open:a}=t,o=v.useContext(aW),{currentIdRef:l,delayRef:c,timeoutMs:f,initialDelayRef:d,currentContextRef:m,hasProvider:h,timeout:y}=o,[g,w]=v.useState(!1);return Ve(()=>{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]),Ve(()=>{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:tp(d.current,"close")},T!==null&&T!==r?(w(!0),C==null||C.setIsInstantPhase(!0),C==null||C.onOpenChange(!1,vt(zi))):(w(!1),C==null||C.setIsInstantPhase(!1))},[a,r,n,l,c,f,d,m,y]),Ve(()=>()=>{m.current=null},[m]),v.useMemo(()=>({hasProvider:h,delayRef:c,isInstantPhase:g}),[h,c,g])}const Ec=v.forwardRef(function(t,n){const[r,a]=v.useState();Ve(()=>{lN&&a("button")},[]);const o={tabIndex:0,role:r};return E.jsx("span",{...t,ref:n,style:Jp,"aria-hidden":r?void 0:!0,...o,"data-base-ui-focus-guard":""})});let KR=0;function ld(e,t={}){const{preventScroll:n=!1,cancelPrevious:r=!0,sync:a=!1}=t;r&&cancelAnimationFrame(KR);const o=()=>e==null?void 0:e.focus({preventScroll:n});a?o():KR=requestAnimationFrame(o)}const Xl={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function GR(e){return e==="inert"?Xl.inert:e==="aria-hidden"?Xl["aria-hidden"]:Xl.none}let Dh=new WeakSet,Ih={},Ob=0;const LN=e=>e&&(e.host||LN(e.parentNode)),sW=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=LN(n);return e.contains(r)?r:null}).filter(n=>n!=null);function lW(e,t,n,r){const a="data-base-ui-inert",o=r?"inert":n?"aria-hidden":null,l=sW(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",S=GR(o),R=(S.get(w)||0)+1,k=(m.get(w)||0)+1;S.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 Ob+=1,()=>{d.forEach(g=>{const w=GR(o),T=(w.get(g)||0)-1,S=(m.get(g)||0)-1;w.set(g,T),m.set(g,S),T||(!Dh.has(g)&&o&&g.removeAttribute(o),Dh.delete(g)),S||g.removeAttribute(a)}),Ob-=1,Ob||(Xl.inert=new WeakMap,Xl["aria-hidden"]=new WeakMap,Xl.none=new WeakMap,Dh=new WeakSet,Ih={})}}function cW(e,t=!1,n=!1){const r=Qt(e[0]).body;return lW(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const jN=v.createContext(null),_N=()=>v.useContext(jN),uW=Sc("portal");function zN(e={}){const{ref:t,container:n,componentProps:r=Dn,elementProps:a}=e,o=Js(),l=_N(),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);Ve(()=>{if(n===null){g.current&&(g.current=null,h(null),d(null));return}if(o==null)return;const T=(n&&($x(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=Dt("div",r,{ref:[t,y],props:[{id:o,[uW]:""},a]});return{portalNode:m,portalSubtree:f&&w?pr.createPortal(w,f):null}}const kw=v.forwardRef(function(t,n){const{children:r,container:a,className:o,render:l,renderGuards:c,...f}=t,{portalNode:d,portalSubtree:m}=zN({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),S=C==null?void 0:C.modal,R=C==null?void 0:C.open,k=typeof c=="boolean"?c:!!C&&!C.modal&&C.open&&!!d;v.useEffect(()=>{if(!d||S)return;function D(A){d&&A.relatedTarget&&Gl(A)&&(A.type==="focusin"?WR:nW)(d)}return d.addEventListener("focusin",D,!0),d.addEventListener("focusout",D,!0),()=>{d.removeEventListener("focusin",D,!0),d.removeEventListener("focusout",D,!0)}},[d,S]),v.useEffect(()=>{!d||R||WR(d)},[R,d]);const M=v.useMemo(()=>({beforeOutsideRef:h,afterOutsideRef:y,beforeInsideRef:g,afterInsideRef:w,portalNode:d,setFocusManagerState:T}),[d]);return E.jsxs(v.Fragment,{children:[m,E.jsxs(jN.Provider,{value:M,children:[k&&d&&E.jsx(Ec,{"data-type":"outside",ref:h,onFocus:D=>{var A;if(Gl(D,d))(A=g.current)==null||A.focus();else{const O=C?C.domReference:null,L=AN(O);L==null||L.focus()}}}),k&&d&&E.jsx("span",{"aria-owns":d.id,style:bH}),d&&pr.createPortal(r,d),k&&d&&E.jsx(Ec,{"data-type":"outside",ref:y,onFocus:D=>{var A;if(Gl(D,d))(A=w.current)==null||A.focus();else{const O=C?C.domReference:null,L=Tw(O);L==null||L.focus(),C!=null&&C.closeOnFocusOut&&(C==null||C.onOpenChange(!1,vt($s,D.nativeEvent)))}}})]})]})});function dW(e,t){const n=Bn(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 XR=20;let jo=[];function Mw(){jo=jo.filter(e=>{var t;return(t=e.deref())==null?void 0:t.isConnected})}function fW(e){Mw(),e&&Wo(e)!=="body"&&(jo.push(new WeakRef(e)),jo.length>XR&&(jo=jo.slice(-XR)))}function Nb(){var e;return Mw(),(e=jo[jo.length-1])==null?void 0:e.deref()}function hW(e){if(!e)return null;const t=Ic();return kN(e,t)?e:Yd(e,t)[0]||e}function pW(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():ii(e).display!=="none"}function QR(e,t){var l;if(!t.current.includes("floating")&&!((l=e.getAttribute("role"))!=null&&l.includes("dialog")))return;const n=Ic(),a=JY(e,n).filter(c=>{const f=c.getAttribute("data-tabindex")||"";return kN(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 Aw(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"),S=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,A=$v(T)&&D,O=v.useRef(["content"]),L=sr(a),V=sr(o),F=sr(d),W=Qo(g),j=_N(),q=v.useRef(null),$=v.useRef(null),B=v.useRef(!1),_=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=_i(U,y,j==null?void 0:j.beforeInsideRef),Q=_i(G,j==null?void 0:j.afterInsideRef),le=Fn(),ae=Fn(),Z=Vd(),ue=j!=null,ve=Ed(S),Se=Ye((he=ve)=>he?Yd(he,Ic()):[]),Pe=Ye(he=>{const ye=Se(he);return O.current.map(()=>ye).filter(Boolean).flat()});v.useEffect(()=>{if(r||!c)return;function he(Le){Le.key==="Tab"&&Nt(ve,ti(Qt(ve)))&&Se().length===0&&!A&&br(Le)}const ye=Qt(ve);return ye.addEventListener("keydown",he),()=>{ye.removeEventListener("keydown",he)}},[r,T,ve,c,O,A,Se,Pe]),v.useEffect(()=>{if(r||!C)return;const he=Qt(ve);function ye(){z.current=!1}function Le(Ce){const Re=Rr(Ce),J=Nt(S,Re)||Nt(T,Re)||Nt(j==null?void 0:j.portalNode,Re);z.current=!J,P.current=Ce.pointerType||"keyboard",Re!=null&&Re.closest(`[${yH}]`)&&(_.current=!0)}function Ae(){P.current="keyboard"}return he.addEventListener("pointerdown",Le,!0),he.addEventListener("pointerup",ye,!0),he.addEventListener("pointercancel",ye,!0),he.addEventListener("keydown",Ae,!0),()=>{he.removeEventListener("pointerdown",Le,!0),he.removeEventListener("pointerup",ye,!0),he.removeEventListener("pointercancel",ye,!0),he.removeEventListener("keydown",Ae,!0)}},[r,S,T,ve,C,j]),v.useEffect(()=>{if(r||!f)return;const he=Qt(ve);function ye(){_.current=!0,ae.start(0,()=>{_.current=!1})}function Le(Ee){const xe=Rr(Ee),qe=Se().indexOf(xe);qe!==-1&&(H.current=qe)}function Ae(Ee){const xe=Ee.relatedTarget,Be=Ee.currentTarget,qe=Rr(Ee);queueMicrotask(()=>{const De=M(),ut=w.context.triggerElements,pe=(xe==null?void 0:xe.hasAttribute(Sc("focus-guard")))&&[U.current,G.current,j==null?void 0:j.beforeInsideRef.current,j==null?void 0:j.afterInsideRef.current,j==null?void 0:j.beforeOutsideRef.current,j==null?void 0:j.afterOutsideRef.current,Ia(h),Ia(m)].includes(xe),Te=!(Nt(T,xe)||Nt(S,xe)||Nt(xe,S)||Nt(j==null?void 0:j.portalNode,xe)||xe!=null&&ut.hasElement(xe)||ut.hasMatchingElement(ee=>Nt(ee,xe))||pe||W&&(Fs(W.nodesRef.current,De).find(ee=>{var fe,Oe;return Nt((fe=ee.context)==null?void 0:fe.elements.floating,xe)||Nt((Oe=ee.context)==null?void 0:Oe.elements.domReference,xe)})||VR(W.nodesRef.current,De).find(ee=>{var fe,Oe,He;return[(fe=ee.context)==null?void 0:fe.elements.floating,Ed((Oe=ee.context)==null?void 0:Oe.elements.floating)].includes(xe)||((He=ee.context)==null?void 0:He.elements.domReference)===xe})));if(Be===T&&ve&&QR(ve,O),l&&Be!==T&&!pW(qe)&&ti(he)===he.body){if(kn(ve)&&(ve.focus(),l==="popup")){Z.request(()=>{ve.focus()});return}const ee=H.current,fe=Se(),Oe=fe[ee]||fe[fe.length-1]||ve;kn(Oe)&&Oe.focus()}if(k.current.insideReactTree){k.current.insideReactTree=!1;return}(A||!c)&&xe&&Te&&!_.current&&(A||xe!==Nb())&&(B.current=!0,w.setOpen(!1,vt($s,Ee)))})}function Ce(){z.current||(k.current.insideReactTree=!0,le.start(0,()=>{k.current.insideReactTree=!1}))}const Re=kn(T)?T:null,J=[];if(!(!S&&!Re))return Re&&(Re.addEventListener("focusout",Ae),Re.addEventListener("pointerdown",ye),J.push(()=>{Re.removeEventListener("focusout",Ae),Re.removeEventListener("pointerdown",ye)})),S&&(S.addEventListener("focusin",Le),S.addEventListener("focusout",Ae),j&&(S.addEventListener("focusout",Ce,!0),J.push(()=>{S.removeEventListener("focusout",Ce,!0)})),J.push(()=>{S.removeEventListener("focusin",Le),S.removeEventListener("focusout",Ae)})),()=>{J.forEach(Ee=>{Ee()})}},[r,T,S,ve,c,W,j,w,f,l,Se,A,M,O,k,le,ae,Z,m,h]),v.useEffect(()=>{var Ce,Re,J;if(r||!S||!C)return;const he=Array.from(((Ce=j==null?void 0:j.portalNode)==null?void 0:Ce.querySelectorAll(`[${Sc("portal")}]`))||[]),Le=(J=(Re=(W?VR(W.nodesRef.current,M()):[]).find(Ee=>{var xe;return $v(((xe=Ee.context)==null?void 0:xe.elements.domReference)||null)}))==null?void 0:Re.context)==null?void 0:J.elements.domReference,Ae=[S,Le,...he,q.current,$.current,U.current,G.current,j==null?void 0:j.beforeOutsideRef.current,j==null?void 0:j.afterOutsideRef.current,Ia(h),Ia(m),A?T:null].filter(Ee=>Ee!=null);return cW(Ae,c||A)},[C,r,T,S,c,O,j,A,W,M,m,h]),Ve(()=>{if(!C||r||!kn(ve))return;const he=Qt(ve),ye=ti(he);queueMicrotask(()=>{const Le=Pe(ve),Ae=L.current,Ce=typeof Ae=="function"?Ae(F.current||""):Ae;if(Ce===void 0||Ce===!1)return;let Re;Ce===!0||Ce===null?Re=Le[0]||ve:Re=Ia(Ce),Re=Re||Le[0]||ve,!Nt(ve,ye)&&ld(Re,{preventScroll:Re===ve})})},[r,C,ve,D,Pe,L,F]),Ve(()=>{if(r||!ve)return;const he=Qt(ve),ye=ti(he);fW(ye);function Le(Re){if(Re.open||(K.current=dW(Re.nativeEvent,P.current)),Re.reason===vr&&Re.nativeEvent.type==="mouseleave"&&(B.current=!0),Re.reason===nm)if(Re.nested)B.current=!1;else if(hN(Re.nativeEvent)||pN(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",Le);const Ae=he.createElement("span");Ae.setAttribute("tabindex","-1"),Ae.setAttribute("aria-hidden","true"),Object.assign(Ae.style,Jp),ue&&T&&T.insertAdjacentElement("afterend",Ae);function Ce(){const Re=V.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||Nb();return xe&&xe.isConnected?xe:Ae}const Ee=T||Nb()||Ae;return Ia(J)||Ee}return()=>{R.off("openchange",Le);const Re=ti(he),J=Nt(S,Re)||W&&Fs(W.nodesRef.current,M(),!1).some(xe=>{var Be;return Nt((Be=xe.context)==null?void 0:Be.elements.floating,Re)}),Ee=Ce();queueMicrotask(()=>{const xe=hW(Ee),Be=typeof V.current!="boolean";V.current&&!B.current&&kn(xe)&&(!(!Be&&xe!==Re&&Re!==he.body)||J)&&xe.focus({preventScroll:!0}),Ae.remove(),B.current=!1})}},[r,S,ve,V,k,R,W,ue,T,M]),Ve(()=>{if(!gm||C||!S)return;const he=ti(Qt(S));!kn(he)||!ym(he)||Nt(S,he)&&he.blur()},[C,S]),Ve(()=>{if(!(r||!j))return j.setFocusManagerState({modal:c,closeOnFocusOut:f,open:C,onOpenChange:w.setOpen,domReference:T}),()=>{j.setFocusManagerState(null)}},[r,j,c,C,w,f,T]),Ve(()=>{if(!(r||!ve))return QR(ve,O),()=>{queueMicrotask(Mw)}},[r,ve,O]);const te=!r&&(c?!A:!0)&&(ue||c);return E.jsxs(v.Fragment,{children:[te&&E.jsx(Ec,{"data-type":"inside",ref:I,onFocus:he=>{var ye;if(c){const Le=Pe();ld(Le[Le.length-1])}else if(j!=null&&j.portalNode)if(B.current=!1,Gl(he,j.portalNode)){const Le=Tw(T);Le==null||Le.focus()}else(ye=Ia(h??j.beforeOutsideRef))==null||ye.focus()}}),n,te&&E.jsx(Ec,{"data-type":"inside",ref:Q,onFocus:he=>{var ye;if(c)ld(Pe()[0]);else if(j!=null&&j.portalNode)if(f&&(B.current=!0),Gl(he,j.portalNode)){const Le=AN(T);Le==null||Le.focus()}else(ye=Ia(m??j.afterOutsideRef))==null||ye.focus()}})]})}function FN(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=qs}=t,h=v.useRef(void 0),y=Vd(),g=Fn(),w=v.useMemo(()=>({onPointerDown(C){h.current=C.pointerType},onMouseDown(C){const T=h.current,S=C.nativeEvent,R=n.select("open");if(C.button!==0||o==="click"||Gs(T,!0)&&c)return;const k=r.current.openEvent,M=k==null?void 0:k.type,D=n.select("domReferenceElement")!==C.currentTarget,A=R&&D||!(R&&l&&(!(k&&f)||M==="click"||M==="mousedown"));if(ym(S.target)){const L=vt(m,S,S.target);A&&T==="touch"&&d>0?g.start(d,()=>{n.setOpen(!0,L)}):n.setOpen(A,L);return}const O=C.currentTarget;y.request(()=>{const L=vt(m,S,O);A&&T==="touch"&&d>0?g.start(d,()=>{n.setOpen(!0,L)}):n.setOpen(A,L)})},onClick(C){if(o==="mousedown-only")return;const T=h.current;if(o==="mousedown"&&T){h.current=void 0;return}if(Gs(T,!0)&&c)return;const S=n.select("open"),R=r.current.openEvent,k=n.select("domReferenceElement")!==C.currentTarget,M=S&&k||!(S&&l&&(!(R&&f)||mN(R))),D=vt(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}:Dn,[a,w])}function mW(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 ZR(e){return e!=null&&e.clientX!=null}function gW(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,A)=>{d.current||l.current.openEvent&&!ZR(l.current.openEvent)||n.set("positionReference",mW(A??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)}),S=Gs(h)?a:r,R=v.useCallback(()=>{if(!S||!c)return;const M=Bn(a);function D(A){const O=Rr(A);Nt(a,O)?(M.removeEventListener("mousemove",D),m.current=null):C(A.clientX,A.clientY)}if(!l.current.openEvent||ZR(l.current.openEvent)){M.addEventListener("mousemove",D);const A=()=>{M.removeEventListener("mousemove",D),m.current=null};return m.current=A,A}n.set("positionReference",o)},[S,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 JR(e,t,n){let{reference:r,floating:a}=e;const o=xi(t),l=Cw(t),c=Ew(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(Xo(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 yW(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}=Va(t,e),w=gN(g),T=c[y?h==="floating"?"reference":"floating":h],S=Cp(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=Cp(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:R,offsetParent:k,strategy:f}):R);return{top:(S.top-D.top+w.top)/M.y,bottom:(D.bottom-S.bottom+w.bottom)/M.y,left:(S.left-D.left+w.left)/M.x,right:(D.right-S.right+w.right)/M.x}}const bW=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}=JR(d,r,f),y=r,g={},w=0;for(let T=0;T<c.length;T++){var C;const{name:S,fn:R}=c[T],{x:k,y:M,data:D,reset:A}=await R({x:m,y:h,initialPlacement:r,placement:y,strategy:a,middlewareData:g,rects:d,platform:{...l,detectOverflow:(C=l.detectOverflow)!=null?C:yW},elements:{reference:e,floating:t}});m=k??m,h=M??h,g={...g,[S]:{...g[S],...D}},A&&w<=50&&(w++,typeof A=="object"&&(A.placement&&(y=A.placement),A.rects&&(d=A.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:a}):A.rects),{x:m,y:h}=JR(d,y,f)),T=-1)}return{x:m,y:h,placement:y,strategy:a,middlewareData:g}},vW=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}=Va(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const S=Hr(a),R=xi(c),k=Hr(c)===c,M=await(f.isRTL==null?void 0:f.isRTL(d.floating)),D=y||(k||!C?[Ep(c)]:IY(c)),A=w!=="none";!y&&A&&D.push(..._Y(c,C,w,M));const O=[c,...D],L=await f.detectOverflow(t,T),V=[];let F=((r=o.flip)==null?void 0:r.overflows)||[];if(m&&V.push(L[S]),h){const $=DY(a,l,M);V.push(L[$[0]],L[$[1]])}if(F=[...F,{placement:a,overflows:V}],!V.every($=>$<=0)){var W,j;const $=(((W=o.flip)==null?void 0:W.index)||0)+1,B=O[$];if(B&&(!(h==="alignment"?R!==xi(B):!1)||F.every(H=>xi(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:j.placement;if(!_)switch(g){case"bestFit":{var q;const z=(q=F.filter(H=>{if(A){const K=xi(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:q[0];z&&(_=z);break}case"initialPlacement":_=c;break}if(a!==_)return{reset:{placement:_}}}return{}}}};function ek(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function tk(e){return MY.some(t=>e[t]>=0)}const xW=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:a="referenceHidden",...o}=Va(e,t);switch(a){case"referenceHidden":{const l=await r.detectOverflow(t,{...o,elementContext:"reference"}),c=ek(l,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:tk(c)}}}case"escaped":{const l=await r.detectOverflow(t,{...o,altBoundary:!0}),c=ek(l,n.floating);return{data:{escapedOffsets:c,escaped:tk(c)}}}default:return{}}}}},BN=new Set(["left","top"]);async function wW(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=Xo(n),f=xi(n)==="y",d=BN.has(l)?-1:1,m=o&&f?-1:1,h=Va(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 SW=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 wW(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}}}}},EW=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:S=>{let{x:R,y:k}=S;return{x:R,y:k}}},...d}=Va(e,t),m={x:n,y:r},h=await o.detectOverflow(t,d),y=xi(Hr(a)),g=Sw(y);let w=m[g],C=m[y];if(l){const S=g==="y"?"top":"left",R=g==="y"?"bottom":"right",k=w+h[S],M=w-h[R];w=Yv(k,w,M)}if(c){const S=y==="y"?"top":"left",R=y==="y"?"bottom":"right",k=C+h[S],M=C-h[R];C=Yv(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}}}}}},CW=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}=Va(e,t),m={x:n,y:r},h=xi(a),y=Sw(h);let g=m[y],w=m[h];const C=Va(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 S,R;const k=y==="y"?"width":"height",M=BN.has(Hr(a)),D=o.reference[h]-o.floating[k]+(M&&((S=l.offset)==null?void 0:S[h])||0)+(M?0:T.crossAxis),A=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>A&&(w=A)}return{[y]:g,[h]:w}}}},TW=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}=Va(e,t),m=await l.detectOverflow(t,d),h=Hr(a),y=Xo(a),g=xi(a)==="y",{width:w,height:C}=o.floating;let T,S;h==="top"||h==="bottom"?(T=h,S=y===(await(l.isRTL==null?void 0:l.isRTL(c.floating))?"start":"end")?"left":"right"):(S=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[S],k),A=!t.middlewareData.shift;let O=M,L=D;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(L=k),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(O=R),A&&!y){const F=ni(m.left,0),W=ni(m.right,0),j=ni(m.top,0),q=ni(m.bottom,0);g?L=w-2*(F!==0||W!==0?F+W:ni(m.left,m.right)):O=C-2*(j!==0||q!==0?j+q:ni(m.top,m.bottom))}await f({...t,availableWidth:L,availableHeight:O});const V=await l.getDimensions(c.floating);return w!==V.width||C!==V.height?{reset:{rects:!0}}:{}}}};function HN(e){const t=ii(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=kn(e),o=a?e.offsetWidth:n,l=a?e.offsetHeight:r,c=Sp(n)!==o||Sp(r)!==l;return c&&(n=o,r=l),{width:n,height:r,$:c}}function Ow(e){return cn(e)?e:e.contextElement}function Ql(e){const t=Ow(e);if(!kn(t))return ta(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:o}=HN(t);let l=(o?Sp(n.width):n.width)/r,c=(o?Sp(n.height):n.height)/a;return(!l||!Number.isFinite(l))&&(l=1),(!c||!Number.isFinite(c))&&(c=1),{x:l,y:c}}const RW=ta(0);function UN(e){const t=Bn(e);return!Xp()||!t.visualViewport?RW:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function kW(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Bn(e)?!1:t}function Xs(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),o=Ow(e);let l=ta(1);t&&(r?cn(r)&&(l=Ql(r)):l=Ql(e));const c=kW(o,n,r)?UN(o):ta(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=Bn(o),g=r&&cn(r)?Bn(r):r;let w=y,C=wv(w);for(;C&&r&&g!==w;){const T=Ql(C),S=C.getBoundingClientRect(),R=ii(C),k=S.left+(C.clientLeft+parseFloat(R.paddingLeft))*T.x,M=S.top+(C.clientTop+parseFloat(R.paddingTop))*T.y;f*=T.x,d*=T.y,m*=T.x,h*=T.y,f+=k,d+=M,w=Bn(C),C=wv(w)}}return Cp({width:m,height:h,x:f,y:d})}function bm(e,t){const n=Qp(e).scrollLeft;return t?t.left+n:Xs(la(e)).left+n}function VN(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-bm(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function MW(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const o=a==="fixed",l=la(r),c=t?Gp(t.floating):!1;if(r===l||c&&o)return n;let f={scrollLeft:0,scrollTop:0},d=ta(1);const m=ta(0),h=kn(r);if((h||!h&&!o)&&((Wo(r)!=="body"||Ko(l))&&(f=Qp(r)),kn(r))){const g=Xs(r);d=Ql(r),m.x=g.x+r.clientLeft,m.y=g.y+r.clientTop}const y=l&&!h&&!o?VN(l,f):ta(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 AW(e){return Array.from(e.getClientRects())}function OW(e){const t=la(e),n=Qp(e),r=e.ownerDocument.body,a=ni(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=ni(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+bm(e);const c=-n.scrollTop;return ii(r).direction==="rtl"&&(l+=ni(t.clientWidth,r.clientWidth)-a),{width:a,height:o,x:l,y:c}}const nk=25;function NW(e,t){const n=Bn(e),r=la(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=Xp();(!m||m&&t==="fixed")&&(c=a.offsetLeft,f=a.offsetTop)}const d=bm(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<=nk&&(o-=w)}else d<=nk&&(o+=d);return{width:o,height:l,x:c,y:f}}const DW=new Set(["absolute","fixed"]);function IW(e,t){const n=Xs(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,o=kn(e)?Ql(e):ta(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 rk(e,t,n){let r;if(t==="viewport")r=NW(e,n);else if(t==="document")r=OW(la(e));else if(cn(t))r=IW(t,n);else{const a=UN(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Cp(r)}function qN(e,t){const n=ia(e);return n===t||!cn(n)||ea(n)?!1:ii(n).position==="fixed"||qN(n,t)}function PW(e,t){const n=t.get(e);if(n)return n;let r=Fo(e,[],!1).filter(c=>cn(c)&&Wo(c)!=="body"),a=null;const o=ii(e).position==="fixed";let l=o?ia(e):e;for(;cn(l)&&!ea(l);){const c=ii(l),f=Yx(l);!f&&c.position==="fixed"&&(a=null),(o?!f&&!a:!f&&c.position==="static"&&!!a&&DW.has(a.position)||Ko(l)&&!f&&qN(e,l))?r=r.filter(m=>m!==l):a=c,l=ia(l)}return t.set(e,r),r}function LW(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const l=[...n==="clippingAncestors"?Gp(t)?[]:PW(t,this._c):[].concat(n),r],c=l[0],f=l.reduce((d,m)=>{const h=rk(t,m,a);return d.top=ni(h.top,d.top),d.right=xc(h.right,d.right),d.bottom=xc(h.bottom,d.bottom),d.left=ni(h.left,d.left),d},rk(t,c,a));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function jW(e){const{width:t,height:n}=HN(e);return{width:t,height:n}}function _W(e,t,n){const r=kn(t),a=la(t),o=n==="fixed",l=Xs(e,!0,o,t);let c={scrollLeft:0,scrollTop:0};const f=ta(0);function d(){f.x=bm(a)}if(r||!r&&!o)if((Wo(t)!=="body"||Ko(a))&&(c=Qp(t)),r){const g=Xs(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?VN(a,c):ta(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 Db(e){return ii(e).position==="static"}function ik(e,t){if(!kn(e)||ii(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return la(e)===n&&(n=n.ownerDocument.body),n}function $N(e,t){const n=Bn(e);if(Gp(e))return n;if(!kn(e)){let a=ia(e);for(;a&&!ea(a);){if(cn(a)&&!Db(a))return a;a=ia(a)}return n}let r=ik(e,t);for(;r&&UB(r)&&Db(r);)r=ik(r,t);return r&&ea(r)&&Db(r)&&!Yx(r)?n:r||WB(e)||n}const zW=async function(e){const t=this.getOffsetParent||$N,n=this.getDimensions,r=await n(e.floating);return{reference:_W(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function FW(e){return ii(e).direction==="rtl"}const BW={convertOffsetParentRelativeRectToViewportRelativeRect:MW,getDocumentElement:la,getClippingRect:LW,getOffsetParent:$N,getElementRects:zW,getClientRects:AW,getDimensions:jW,getScale:Ql,isElement:cn,isRTL:FW};function YN(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function HW(e,t){let n=null,r;const a=la(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=ql(h),C=ql(a.clientWidth-(m+y)),T=ql(a.clientHeight-(h+g)),S=ql(m),k={rootMargin:-w+"px "+-C+"px "+-T+"px "+-S+"px",threshold:ni(0,xc(1,f))||1};let M=!0;function D(A){const O=A[0].intersectionRatio;if(O!==f){if(!M)return l();O?l(!1,O):r=setTimeout(()=>{l(!1,1e-7)},1e3)}O===1&&!YN(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 ak(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=Ow(e),m=a||o?[...d?Fo(d):[],...Fo(t)]:[];m.forEach(S=>{a&&S.addEventListener("scroll",n,{passive:!0}),o&&S.addEventListener("resize",n)});const h=d&&c?HW(d,n):null;let y=-1,g=null;l&&(g=new ResizeObserver(S=>{let[R]=S;R&&R.target===d&&g&&(g.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var k;(k=g)==null||k.observe(t)})),n()}),d&&!f&&g.observe(d),g.observe(t));let w,C=f?Xs(e):null;f&&T();function T(){const S=Xs(e);C&&!YN(C,S)&&n(),C=S,w=requestAnimationFrame(T)}return n(),()=>{var S;m.forEach(R=>{a&&R.removeEventListener("scroll",n),o&&R.removeEventListener("resize",n)}),h==null||h(),(S=g)==null||S.disconnect(),g=null,f&&cancelAnimationFrame(w)}}const UW=SW,VW=EW,qW=vW,$W=TW,YW=xW,WW=CW,KW=(e,t,n)=>{const r=new Map,a={platform:BW,...n},o={...a.platform,_c:r};return bW(e,t,{...a,platform:o})};var GW=typeof document<"u",XW=function(){},np=GW?v.useLayoutEffect:XW;function Ap(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(!Ap(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)&&!Ap(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function WN(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ok(e,t){const n=WN(e);return Math.round(t*n)/n}function Ib(e){const t=v.useRef(e);return np(()=>{t.current=e}),t}function QW(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);Ap(y,r)||g(r);const[w,C]=v.useState(null),[T,S]=v.useState(null),R=v.useCallback(H=>{H!==A.current&&(A.current=H,C(H))},[]),k=v.useCallback(H=>{H!==O.current&&(O.current=H,S(H))},[]),M=o||w,D=l||T,A=v.useRef(null),O=v.useRef(null),L=v.useRef(m),V=f!=null,F=Ib(f),W=Ib(a),j=Ib(d),q=v.useCallback(()=>{if(!A.current||!O.current)return;const H={placement:t,strategy:n,middleware:y};W.current&&(H.platform=W.current),KW(A.current,O.current,H).then(K=>{const P={...K,isPositioned:j.current!==!1};$.current&&!Ap(L.current,P)&&(L.current=P,pr.flushSync(()=>{h(P)}))})},[y,t,n,W,j]);np(()=>{d===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,h(H=>({...H,isPositioned:!1})))},[d]);const $=v.useRef(!1);np(()=>($.current=!0,()=>{$.current=!1}),[]),np(()=>{if(M&&(A.current=M),D&&(O.current=D),M&&D){if(F.current)return F.current(M,D,q);q()}},[M,D,q,F,V]);const B=v.useMemo(()=>({reference:A,floating:O,setReference:R,setFloating:k}),[R,k]),_=v.useMemo(()=>({reference:M,floating:D}),[M,D]),z=v.useMemo(()=>{const H={position:n,left:0,top:0};if(!_.floating)return H;const K=ok(_.floating,m.x),P=ok(_.floating,m.y);return c?{...H,transform:"translate("+K+"px, "+P+"px)",...WN(_.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:K,top:P}},[n,c,_.floating,m.x,m.y]);return v.useMemo(()=>({...m,update:q,refs:B,elements:_,floatingStyles:z}),[m,q,B,_,z])}const ZW=(e,t)=>({...UW(e),options:[e,t]}),JW=(e,t)=>({...VW(e),options:[e,t]}),eK=(e,t)=>({...WW(e),options:[e,t]}),tK=(e,t)=>({...qW(e),options:[e,t]}),nK=(e,t)=>({...$W(e),options:[e,t]}),rK=(e,t)=>({...YW(e),options:[e,t]}),iK={intentional:"onClick",sloppy:"onPointerDown"};function aK(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 vm(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:S}=t,R=Qo(S),k=Ye(typeof h=="function"?h:()=>!1),M=typeof h=="function"?k:h,D=v.useRef(!1),{escapeKey:A,outsidePress:O}=aK(T),L=v.useRef(null),V=Fn(),F=Fn(),W=Ye(()=>{F.clear(),f.current.insideReactTree=!1}),j=v.useRef(!1),q=v.useRef(""),$=Ye(te=>{q.current=te.pointerType}),B=Ye(()=>{const te=q.current,he=te==="pen"||!te?"mouse":te,ye=typeof y=="function"?y():y;return typeof ye=="string"?ye:ye[he]}),_=Ye(te=>{var Ce;if(!r||!d||!m||te.key!=="Escape"||j.current)return;const he=(Ce=f.current.floatingContext)==null?void 0:Ce.nodeId,ye=R?Fs(R.nodesRef.current,he):[];if(!A&&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 Le=kY(te)?te.nativeEvent:te,Ae=vt(rm,Le);n.setOpen(!1,Ae),!A&&!Ae.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),Le=`[${Sc("inert")}]`,Ae=Qt(n.select("floatingElement")).querySelectorAll(Le),Ce=n.context.triggerElements;if(ye&&(Ce.hasElement(ye)||Ce.hasMatchingElement(qe=>Nt(qe,ye))))return;let Re=cn(ye)?ye:null;for(;Re&&!ea(Re);){const qe=ia(Re);if(ea(qe)||!cn(qe))break;Re=qe}if(Ae.length&&cn(ye)&&!TY(ye)&&!Nt(ye,n.select("floatingElement"))&&Array.from(Ae).every(qe=>!Nt(Re,qe)))return;if(kn(ye)&&!("touches"in te)){const qe=ea(ye),De=ii(ye),ut=/auto|scroll/,pe=qe||ut.test(De.overflowX),Te=qe||ut.test(De.overflowY),ee=pe&&ye.clientWidth>0&&ye.scrollWidth>ye.clientWidth,fe=Te&&ye.clientHeight>0&&ye.scrollHeight>ye.clientHeight,Oe=De.direction==="rtl",He=fe&&(Oe?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&&Fs(R.nodesRef.current,J).some(qe=>{var De;return Di(te,(De=qe.context)==null?void 0:De.elements.floating)});if(Di(te,n.select("floatingElement"))||Di(te,n.select("domReferenceElement"))||Ee)return;const xe=R?Fs(R.nodesRef.current,J):[];if(xe.length>0){let qe=!0;if(xe.forEach(De=>{var ut;(ut=De.context)!=null&&ut.open&&!De.context.dataRef.current.__outsidePressBubbles&&(qe=!1)}),!qe)return}n.setOpen(!1,vt(nm,te)),W()}),P=Ye(te=>{B()!=="sloppy"||te.pointerType==="touch"||!n.select("open")||!d||Di(te,n.select("floatingElement"))||Di(te,n.select("domReferenceElement"))||K(te)}),U=Ye(te=>{if(B()!=="sloppy"||!n.select("open")||!d||Di(te,n.select("floatingElement"))||Di(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},V.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,V.clear(),te.type==="mousedown"&&L.current&&!L.current.dismissOnMouseDown)return;const ye=Rr(te);function Le(){te.type==="pointerdown"?P(te):K(te,he),ye==null||ye.removeEventListener(te.type,Le)}ye==null||ye.addEventListener(te.type,Le)}),Q=Ye(te=>{if(B()!=="sloppy"||!L.current||Di(te,n.select("floatingElement"))||Di(te,n.select("domReferenceElement")))return;const he=te.touches[0];if(!he)return;const ye=Math.abs(he.clientX-L.current.startX),Le=Math.abs(he.clientY-L.current.startY),Ae=Math.sqrt(ye*ye+Le*Le);Ae>5&&(L.current.dismissOnTouchEnd=!0),Ae>10&&(K(te),V.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||Di(te,n.select("floatingElement"))||Di(te,n.select("domReferenceElement"))||(L.current.dismissOnTouchEnd&&K(te),V.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=A,f.current.__outsidePressBubbles=O;const te=new aa;function he(Re){n.setOpen(!1,vt(zi,Re))}function ye(){te.clear(),j.current=!0}function Le(){te.start(Xp()?5:0,()=>{j.current=!1})}const Ae=Qt(a);Ae.addEventListener("pointerdown",$,!0),m&&(Ae.addEventListener("keydown",_),Ae.addEventListener("compositionstart",ye),Ae.addEventListener("compositionend",Le)),M&&(Ae.addEventListener("click",I,!0),Ae.addEventListener("pointerdown",I,!0),Ae.addEventListener("touchstart",G,!0),Ae.addEventListener("touchmove",le,!0),Ae.addEventListener("touchend",Z,!0),Ae.addEventListener("mousedown",I,!0));let Ce=[];return C&&(cn(l)&&(Ce=Fo(l)),cn(a)&&(Ce=Ce.concat(Fo(a))),!cn(o)&&o&&o.contextElement&&(Ce=Ce.concat(Fo(o.contextElement)))),Ce=Ce.filter(Re=>{var J;return Re!==((J=Ae.defaultView)==null?void 0:J.visualViewport)}),Ce.forEach(Re=>{Re.addEventListener("scroll",he,{passive:!0})}),()=>{Ae.removeEventListener("pointerdown",$,!0),m&&(Ae.removeEventListener("keydown",_),Ae.removeEventListener("compositionstart",ye),Ae.removeEventListener("compositionend",Le)),M&&(Ae.removeEventListener("click",I,!0),Ae.removeEventListener("pointerdown",I,!0),Ae.removeEventListener("touchstart",G,!0),Ae.removeEventListener("touchmove",le,!0),Ae.removeEventListener("touchend",Z,!0),Ae.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,A,O,_,K,I,P,G,le,Z,$,n]),v.useEffect(W,[M,W]);const ue=v.useMemo(()=>({onKeyDown:_,...g&&{[iK[w]]:te=>{n.setOpen(!1,vt(qs,te.nativeEvent))},...w!=="intentional"&&{onClick(te){n.setOpen(!1,vt(qs,te.nativeEvent))}}}}),[_,n,g,w]),ve=Ye(te=>{const he=Rr(te.nativeEvent);!Nt(n.select("floatingElement"),he)||te.button!==0||(D.current=!0)}),Se=Ye(te=>{!r||!d||te.button!==0||(D.current=!0)}),Pe=v.useMemo(()=>({onKeyDown:_,onPointerDown:ve,onMouseDown:ve,onMouseUp:ve,onClickCapture:H,onMouseDownCapture(te){H(),Se(te)},onPointerDownCapture(te){H(),Se(te)},onMouseUpCapture:H,onTouchEndCapture:H,onTouchMoveCapture:H}),[_,ve,H,Se]);return v.useMemo(()=>d?{reference:ue,floating:Pe,trigger:ue}:{},[d,ue,Pe])}const oK={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 Nw extends mm{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:NN(),nested:r,noEmit:a,triggerElements:l},oK);st(this,"setOpen",(n,r)=>{var a,o;if((!n||!this.state.open||mN(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 sK(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 KN(e,t,n,r){const a=n.useState("isMountedByTrigger",e),o=sK(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 Ve(()=>{a&&n.update({activeTriggerElement:t.current,...r})},[a,n,t,...Object.values(r)]),{registerTrigger:l,isMountedByThisTrigger:a}}function Dw(e){const t=e.useState("open");Ve(()=>{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 Iw(e,t,n){const{mounted:r,setMounted:a,transitionStatus:o}=qd(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 lK(){return new Nw({open:!1,floatingElement:null,referenceElement:null,triggerElements:new Wd,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function Pw(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:"idle",floatingRootContext:lK(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Dn,inactiveTriggerProps:Dn,popupProps:Dn}}const Ph=Ge(e=>e.triggerIdProp??e.activeTriggerId),Lw={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:Ph,activeTriggerElement:Ge(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:Ge((e,t)=>t!==void 0&&Ph(e)===t),isOpenedByTrigger:Ge((e,t)=>t!==void 0&&Ph(e)===t&&e.open),isMountedByTrigger:Ge((e,t)=>t!==void 0&&Ph(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 GN(e){const{open:t=!1,onOpenChange:n,elements:r={}}=e,a=Js(),o=Ka()!=null,l=nr(()=>new Nw({open:t,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new Wd,floatingId:a,nested:o,noEmit:!1})).current;return Ve(()=>{const c={open:t,floatingId:a};r.reference!==void 0&&(c.referenceElement=r.reference,c.domReferenceElement=cn(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 cK(e={}){const{nodeId:t,externalTree:n}=e,r=GN(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);Ve(()=>{o.domReference&&(f.current=o.domReference)},[o.domReference]);const m=QW({...e,elements:{...o,...l&&{reference:l}}}),h=v.useCallback(O=>{const L=cn(O)?{getBoundingClientRect:()=>O.getBoundingClientRect(),getClientRects:()=>O.getClientRects(),contextElement:O}:O;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",cn(y)?y:null),a.useSyncedValue("floatingElement",w);const T=v.useCallback(O=>{(cn(O)||O===null)&&(f.current=O,g(O)),(cn(m.refs.reference.current)||m.refs.reference.current===null||O!==null&&!cn(O))&&m.refs.setReference(O)},[m.refs,g]),S=v.useCallback(O=>{C(O),m.refs.setFloating(O)},[m.refs]),R=v.useMemo(()=>({...m.refs,setReference:T,setFloating:S,setPositionReference:h,domReference:f}),[m.refs,T,S,h]),k=v.useMemo(()=>({...m.elements,domReference:o.domReference}),[m.elements,o.domReference]),M=a.useState("open"),D=a.useState("floatingId"),A=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 Ve(()=>{a.context.dataRef.current.floatingContext=A;const O=d==null?void 0:d.nodesRef.current.find(L=>L.id===t);O&&(O.context=A)}),v.useMemo(()=>({...m,context:A,refs:R,elements:k,rootStore:a}),[m,R,k,A,a])}function jw(e){const{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:r=!1,onOpenChange:a}=e,o=Js(),l=Ka()!=null,c=t.useState("open"),f=t.useState("activeTriggerElement"),d=t.useState(r?"popupElement":"positionerElement"),m=t.context.triggerElements,h=nr(()=>new Nw({open:c,referenceElement:f,floatingElement:d,triggerElements:m,onOpenChange:a,floatingId:o,nested:l,noEmit:n})).current;return Ve(()=>{const y={open:c,floatingId:o,referenceElement:f,floatingElement:d};cn(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 Pb=wY&&lN;function XN(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=Fn(),m=v.useRef(!0);v.useEffect(()=>{const y=n.select("domReferenceElement");if(!o)return;const g=Bn(y);function w(){const S=n.select("domReferenceElement");!n.select("open")&&kn(S)&&S===ti(Qt(S))&&(c.current=!0)}function C(){m.current=!0}function T(){m.current=!1}return g.addEventListener("blur",w),Pb&&(g.addEventListener("keydown",C,!0),g.addEventListener("pointerdown",T,!0)),()=>{g.removeEventListener("blur",w),Pb&&(g.removeEventListener("keydown",C,!0),g.removeEventListener("pointerdown",T,!0))}},[n,o]),v.useEffect(()=>{if(!o)return;function y(g){if(g.reason===qs||g.reason===rm){const w=n.select("domReferenceElement");cn(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(cn(w)){if(Pb&&!y.relatedTarget){if(!m.current&&!ym(w))return}else if(!RY(w))return}const C=wp(y.relatedTarget,n.context.triggerElements),{nativeEvent:T,currentTarget:S}=y,R=typeof l=="function"?l():l;if(n.select("open")&&C||R===0||R===void 0){n.setOpen(!0,vt(Yl,T,S));return}d.start(R,()=>{c.current||n.setOpen(!0,vt(Yl,T,S))})},onBlur(y){c.current=!1,f.current=null;const g=y.relatedTarget,w=y.nativeEvent,C=cn(g)&&g.hasAttribute(Sc("focus-guard"))&&g.getAttribute("data-type")==="outside";d.start(0,()=>{var k;const T=n.select("domReferenceElement"),S=ti(T?T.ownerDocument:document);!g&&S===T||Nt((k=a.current.floatingContext)==null?void 0:k.refs.floating.current,S)||Nt(T,S)||C||wp(g??S,n.context.triggerElements)||n.setOpen(!1,vt(Yl,w))})}}),[a,n,d,l]);return v.useMemo(()=>o?{reference:h,trigger:h}:{},[o,h])}const Qv=Sc("safe-polygon"),uK=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${fN}`;function dK(e){return e?!!e.closest(uK):!1}class _w{constructor(){st(this,"dispose",()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()});st(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 aa,this.restTimeout=new aa,this.handleCloseOptions=void 0}static create(){return new _w}}function QN(e){const t=nr(_w.create).current,n=e.context.dataRef.current;return n.hoverInteractionState||(n.hoverInteractionState=t),cm(n.hoverInteractionState.disposeEffect),n.hoverInteractionState}const fK=new Set(["click","mousedown"]);function ZN(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=QN(n),m=Qo(),h=Ka(),y=Ye(()=>d.interactedInside?!0:l.current.openEvent?fK.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=>wp(k,n.context.triggerElements)),C=v.useCallback((k,M=!0)=>{const D=hK(f,d.pointerType);D&&!d.handler?d.openChangeTimeout.start(D,()=>n.setOpen(!1,vt(vr,k))):M&&(d.openChangeTimeout.clear(),n.setOpen(!1,vt(vr,k)))},[f,n,d]),T=Ye(()=>{d.unbindMouseMove(),d.handler=void 0}),S=Ye(()=>{if(d.performedPointerEventsMutation){const k=Qt(a).body;k.style.pointerEvents="",k.removeAttribute(Qv),d.performedPointerEventsMutation=!1}}),R=Ye(k=>{const M=Rr(k);if(!dK(M)){d.interactedInside=!1;return}d.interactedInside=!0});Ve(()=>{r||(d.pointerType=void 0,d.restTimeoutPending=!1,d.interactedInside=!1,T(),S())},[r,d,T,S]),v.useEffect(()=>()=>{T()},[T]),v.useEffect(()=>S,[S]),Ve(()=>{var k,M,D;if(c&&r&&(k=d.handleCloseOptions)!=null&&k.blockPointerEvents&&g()&&cn(o)&&a){d.performedPointerEventsMutation=!0;const A=Qt(a).body;A.setAttribute(Qv,"");const O=o,L=a,V=(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 V&&(V.style.pointerEvents=""),A.style.pointerEvents="none",O.style.pointerEvents="auto",L.style.pointerEvents="auto",()=>{A.style.pointerEvents="",O.style.pointerEvents="",L.style.pointerEvents=""}}},[c,r,o,a,d,g,m,h]),v.useEffect(()=>{if(!c)return;function k(O){y()||!l.current.floatingContext||!n.select("open")||w(O.relatedTarget)||(S(),T(),y()||C(O))}function M(O){var L;d.openChangeTimeout.clear(),S(),(L=d.handler)==null||L.call(d,O),T()}function D(O){y()||C(O,!1)}const A=a;return A&&(A.addEventListener("mouseleave",k),A.addEventListener("mouseenter",M),A.addEventListener("mouseleave",D),A.addEventListener("pointerdown",R,!0)),()=>{A&&(A.removeEventListener("mouseleave",k),A.removeEventListener("mouseenter",M),A.removeEventListener("mouseleave",D),A.removeEventListener("pointerdown",R,!0))}},[c,a,n,l,y,w,C,S,T,R,d])}function hK(e,t){return t&&!Gs(t)?0:typeof e=="function"?e():e}function Lb(e){return typeof e=="function"?e():e}const pK={current:null};function JN(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=pK,externalTree:y,isActiveTrigger:g=!0}=t,w=Qo(y),C=QN(n),T=sr(c),S=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=>wp(W,n.context.triggerElements)),A=v.useCallback((W,j=!0)=>{const q=tp(S.current,"close",C.pointerType);q&&!C.handler?C.openChangeTimeout.start(q,()=>n.setOpen(!1,vt(vr,W))):j&&(C.openChangeTimeout.clear(),n.setOpen(!1,vt(vr,W)))},[S,n,C]),O=Ye(()=>{C.unbindMouseMove(),C.handler=void 0}),L=Ye(()=>{if(C.performedPointerEventsMutation){const W=Qt(n.select("domReferenceElement")).body;W.style.pointerEvents="",W.removeAttribute(Qv),C.performedPointerEventsMutation=!1}});v.useEffect(()=>{if(!o)return;function W(j){j.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 V=Ye(W=>{var q;if(M()||!r.current.floatingContext||D(W.relatedTarget))return;const j=h.current;(q=T.current)==null||q.call(T,{...r.current.floatingContext,tree:w,x:W.clientX,y:W.clientY,onClose(){L(),O(),!M()&&j===n.select("domReferenceElement")&&A(W)}})(W)});return v.useEffect(()=>{if(!o)return;const W=h.current??(g?n.select("domReferenceElement"):null);if(!cn(W))return;function j(B){if(C.openChangeTimeout.clear(),C.blockMouseMove=!1,f&&!Gs(C.pointerType)||Lb(R.current)>0&&!tp(S.current,"open"))return;const _=tp(S.current,"open",C.pointerType),z=n.select("domReferenceElement"),H=n.context.triggerElements,K=(H.hasElement(B.target)||H.hasMatchingElement(I=>Nt(I,B.target)))&&(!z||!Nt(z,B.target)),P=B.currentTarget??null,U=n.select("open"),G=!U||K;K&&U?n.setOpen(!0,vt(vr,B,P)):_?C.openChangeTimeout.start(_,()=>{G&&n.setOpen(!0,vt(vr,B,P))}):G&&n.setOpen(!0,vt(vr,B,P))}function q(B){if(M()){L();return}C.unbindMouseMove();const _=n.select("domReferenceElement"),z=Qt(_);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(),O(),k.current&&!M()&&K===n.select("domReferenceElement")&&A(B,!0)}});const P=C.handler;P(B),z.addEventListener("mousemove",P),C.unbindMouseMove=()=>{z.removeEventListener("mousemove",P)};return}(C.pointerType==="touch"?!Nt(n.select("floatingElement"),B.relatedTarget):!0)&&A(B)}function $(B){V(B)}return n.select("open")&&W.addEventListener("mouseleave",$),m&&W.addEventListener("mousemove",j,{once:!0}),W.addEventListener("mouseenter",j),W.addEventListener("mouseleave",q),()=>{W.removeEventListener("mouseleave",$),m&&W.removeEventListener("mousemove",j),W.removeEventListener("mouseenter",j),W.removeEventListener("mouseleave",q)}},[O,L,r,S,A,n,o,T,V,C,g,M,D,f,m,R,h,w,k]),v.useMemo(()=>{if(!o)return;function W(j){C.pointerType=j.pointerType}return{onPointerDown:W,onPointerEnter:W,onMouseMove(j){const{nativeEvent:q}=j,$=j.currentTarget,B=n.select("domReferenceElement"),_=n.context.triggerElements,z=n.select("open"),H=(_.hasElement(j.target)||_.hasMatchingElement(P=>Nt(P,j.target)))&&(!B||!Nt(B,j.target));if(f&&!Gs(C.pointerType)||z&&!H||Lb(R.current)===0||!H&&C.restTimeoutPending&&j.movementX**2+j.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,vt(vr,q,$))}C.pointerType==="touch"?pr.flushSync(()=>{K()}):H&&z?K():(C.restTimeoutPending=!0,C.restTimeout.start(Lb(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=>Lh(d,e,"reference"),t),l=v.useCallback(d=>Lh(d,e,"floating"),n),c=v.useCallback(d=>Lh(d,e,"item"),r),f=v.useCallback(d=>Lh(d,e,"trigger"),a);return v.useMemo(()=>({getReferenceProps:o,getFloatingProps:l,getItemProps:c,getTriggerProps:f}),[o,l,c,f])}function Lh(e,t,n){var l;const r=new Map,a=n==="item",o={};n==="floating"&&(o.tabIndex=-1,o[qv]="");for(const c in e)a&&e&&(c===uN||c===dN)||(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&&sk(o,f,a,r)}return sk(o,e,a,r),o}function sk(e,t,n,r){var a;for(const o in t){const l=t[o];n&&(o===uN||o===dN)||(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 mK="Escape";function xm(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function jh(e,t){return xm(t,e===ww||e===$d,e===Bo||e===Ho)}function jb(e,t,n){return xm(t,e===$d,n?e===Bo:e===Ho)||e==="Enter"||e===" "||e===""}function gK(e,t,n){return xm(t,n?e===Bo:e===Ho,e===$d)}function yK(e,t,n,r){const a=n?e===Ho:e===Bo,o=e===ww;return t==="both"||t==="horizontal"&&r&&r>1?e===mK:xm(t,a,o)}function eD(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:S="auto",focusItemOnHover:R=!0,openOnArrowKeyDown:k=!0,disabledIndices:M=void 0,orientation:D="vertical",parentOrientation:A,cols:O=1,id:L,resetOnPointerLeave:V=!0,externalTree:F}=t,W=Ed(a),j=sr(W),q=Ka(),$=Qo(F);Ve(()=>{l.current.orientation=D},[l,D]);const B=$v(o),_=v.useRef(S),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(V),Se=Ye(()=>{function J(qe){T?$==null||$.events.emit("virtualfocus",qe):ld(qe,{sync:Q.current,preventScroll:!0})}const Ee=c.current[z.current],xe=le.current;Ee&&J(Ee),(Q.current?qe=>qe():requestAnimationFrame)(()=>{var ut;const qe=c.current[z.current]||Ee;if(!qe)return;Ee||J(qe),te&&(xe||!K.current)&&((ut=qe.scrollIntoView)==null||ut.call(qe,{block:"nearest",inline:"nearest"}))})});Ve(()=>{m&&(r&&a?(z.current=h??-1,_.current&&h!=null&&(le.current=!0,P())):G.current&&(z.current=-1,U.current()))},[m,r,a,h,P]),Ve(()=>{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)&&_.current&&(H.current!=null||_.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||jb(H.current,D,C)||w?ep(c):Kv(c),H.current=null,P())};Ee()}}else Kl(c,f)||(z.current=f,Se(),le.current=!1)}},[m,r,a,f,ue,w,c,D,C,P,Se,ae]),Ve(()=>{var qe,De;if(!m||a||!$||T||!G.current)return;const J=$.nodesRef.current,Ee=(De=(qe=J.find(ut=>ut.id===q))==null?void 0:qe.context)==null?void 0:De.elements.floating,xe=ti(Qt(a)),Be=J.some(ut=>ut.context&&Nt(ut.context.elements.floating,xe));Ee&&!Be&&K.current&&Ee.focus({preventScroll:!0})},[m,a,$,q,T]),Ve(()=>{U.current=P,I.current=r,G.current=!!a}),Ve(()=>{r||(H.current=null,_.current=S)},[r,S]);const Pe=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 qe;if(!Z.current||!K.current||xe.pointerType==="touch")return;Q.current=!0;const Be=xe.relatedTarget;!R||c.current.includes(Be)||ve.current&&(ld(null,{sync:!0}),z.current=-1,P(xe),T||(qe=j.current)==null||qe.focus({preventScroll:!0}))}}},[Z,j,R,c,P,ve,T]),he=v.useCallback(()=>{var J,Ee,xe;return A??((xe=(Ee=(J=$==null?void 0:$.nodesRef.current.find(Be=>Be.id===q))==null?void 0:J.context)==null?void 0:Ee.dataRef)==null?void 0:xe.current.orientation)},[q,$,A]),ye=Ye(J=>{if(K.current=!1,Q.current=!0,J.which===229||!Z.current&&J.currentTarget===j.current)return;if(w&&yK(J.key,D,C,O)){jh(J.key,he())||br(J),n.setOpen(!1,vt(Qh,J.nativeEvent)),kn(o)&&(T?$==null||$.events.emit("virtualfocus",o):o.focus());return}const Ee=z.current,xe=ep(c,M),Be=Kv(c,M);if(B||(J.key==="Home"&&(br(J),z.current=xe,P(J)),J.key==="End"&&(br(J),z.current=Be,P(J))),O>1){const qe=Array.from({length:c.current.length},()=>({width:1,height:1})),De=bN(qe,O,!1),ut=De.findIndex(ee=>ee!=null&&!Uo(c,ee,M)),pe=De.reduce((ee,fe,Oe)=>fe!=null&&!Uo(c,fe,M)?Oe:ee,-1),Te=De[yN({current:De.map(ee=>ee!=null?c.current[ee]:null)},{event:J,orientation:D,loopFocus:g,rtl:C,cols:O,disabledIndices:xN([...(typeof M!="function"?M:null)||c.current.map((ee,fe)=>Uo(c,fe,M)?fe:void 0),void 0],De),minIndex:ut,maxIndex:pe,prevIndex:vN(z.current>Be?xe:z.current,qe,De,O,J.key===$d?"bl":J.key===(C?Bo:Ho)?"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&&ti(J.currentTarget.ownerDocument)===J.currentTarget){z.current=jb(J.key,D,C)?xe:Be,P(J);return}jb(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})),Kl(c,z.current)&&(z.current=-1),P(J)}}),Le=v.useMemo(()=>T&&r&&Pe&&{"aria-activedescendant":`${L}-${f}`},[T,r,Pe,L,f]),Ae=v.useMemo(()=>({"aria-orientation":D==="both"?void 0:D,...B?{}:Le,onKeyDown(J){if(J.key==="Tab"&&J.shiftKey&&r&&!T){const Ee=Rr(J.nativeEvent);if(Ee&&!Nt(j.current,Ee))return;br(J),n.setOpen(!1,vt($s,J.nativeEvent)),kn(o)&&o.focus();return}ye(J)},onPointerMove(){K.current=!0}}),[Le,ye,j,D,B,n,r,T,o]),Ce=v.useMemo(()=>{function J(xe){S==="auto"&&hN(xe.nativeEvent)&&(_.current=!T)}function Ee(xe){_.current=S,S==="auto"&&pN(xe.nativeEvent)&&(_.current=!0)}return{onKeyDown(xe){const Be=n.select("open");K.current=!1;const qe=xe.key.startsWith("Arrow"),De=gK(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&&qe)){if(pe){const Te=jh(xe.key,he());H.current=w&&Te?null:xe.key}if(w){De&&(br(xe),Be?(z.current=ep(c,ae.current),P(xe)):n.setOpen(!0,vt(Qh,xe.nativeEvent,xe.currentTarget)));return}ut&&(ue.current!=null&&(z.current=ue.current),br(xe),!Be&&k?n.setOpen(!0,vt(Qh,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,S,c,w,P,n,k,D,he,C,ue,T]),Re=v.useMemo(()=>({...Le,...Ce}),[Le,Ce]);return v.useMemo(()=>m?{reference:Re,floating:Ae,item:te,trigger:Ce}:{},[m,Re,Ae,Ce,te])}const bK=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function tD(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=Js(),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=bK.get(c)??c,g=Ka()!=null,w=v.useMemo(()=>h==="tooltip"||c==="label"?Dn:{"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]),S=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:S,trigger:w}),[C,T,w,S])}function nD(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=Fn(),g=v.useRef(""),w=v.useRef(h??l??-1),C=v.useRef(null);Ve(()=>{!a&&h!==null||(y.clear(),C.current=null,g.current!==""&&(g.current=""))},[a,h,y]),Ve(()=>{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))}),S=Ye(D=>{function A(j,q,$){const B=q.find(_=>(_==null?void 0:_.toLocaleLowerCase().indexOf($.toLocaleLowerCase()))===0);return B?j.indexOf(B):-1}const O=o.current;if(g.current.length>0&&g.current[0]!==" "&&(A(O,O,g.current)===-1?T(!1):D.key===" "&&br(D)),O==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),O.every(j=>{var q,$;return j?((q=j[0])==null?void 0:q.toLocaleLowerCase())!==(($=j[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=A(O,[...O.slice((F||0)+1),...O.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 A=D.relatedTarget,O=n.select("domReferenceElement"),L=n.select("floatingElement"),V=Nt(O,A),F=Nt(L,A);V||F||(y.clear(),g.current="",w.current=C.current,T(!1))}),k=v.useMemo(()=>({onKeyDown:S,onBlur:R}),[S,R]),M=v.useMemo(()=>({onKeyDown:S,onKeyUp(D){D.key===" "&&T(!1)},onBlur:R}),[S,R,T]);return v.useMemo(()=>d?{reference:k,floating:M}:{},[d,k,M])}function lk(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 vK(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function rD(e={}){const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,a=new aa;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:S})=>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:A}=k,O=[D,A],L=Rr(k),V=k.type==="mouseleave",F=Nt(w.floating,L),W=Nt(w.domReference,L),j=w.domReference.getBoundingClientRect(),q=w.floating.getBoundingClientRect(),$=g.split("-")[0],B=h>q.right-q.width/2,_=y>q.bottom-q.height/2,z=vK(O,j),H=q.width>j.width,K=q.height>j.height,P=(H?j:q).left,U=(H?j:q).right,G=(K?j:q).top,I=(K?j:q).bottom;if(F&&(o=!0,!V))return;if(W&&(o=!1),W&&!V){o=!0;return}if(V&&cn(k.relatedTarget)&&Nt(w.floating,k.relatedTarget)||S&&Fs(S.nodesRef.current,T).some(({context:ae})=>ae==null?void 0:ae.open))return;if($==="top"&&y>=j.bottom-1||$==="bottom"&&y<=j.top+1||$==="left"&&h>=j.right-1||$==="right"&&h<=j.left+1)return M();let Q=[];switch($){case"top":Q=[[P,j.top+1],[P,q.bottom-1],[U,q.bottom-1],[U,j.top+1]];break;case"bottom":Q=[[P,q.top+1],[P,j.bottom-1],[U,j.bottom-1],[U,q.top+1]];break;case"left":Q=[[q.right-1,I],[q.right-1,G],[j.left+1,G],[j.left+1,I]];break;case"right":Q=[[j.right-1,I],[j.right-1,G],[q.left+1,G],[q.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=[[q.left,B||H?q.bottom-t:q.top],[q.right,B?H?q.bottom-t:q.top:q.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=[[q.left,B||H?q.top+t:q.bottom],[q.right,B?H?q.top+t:q.bottom:q.top+t]];return[ue,ve,...Se]}case"left":{const ue=[ae+t+1,K?Z+t/2:_?Z+t*4:Z-t*4],ve=[ae+t+1,K?Z-t/2:_?Z+t*4:Z-t*4];return[...[[_||K?q.right-t:q.left,q.top],[_?K?q.right-t:q.left:q.right-t,q.bottom]],ue,ve]}case"right":{const ue=[ae-t,K?Z+t/2:_?Z+t*4:Z-t*4],ve=[ae-t,K?Z-t/2:_?Z+t*4:Z-t*4],Se=[[_||K?q.left+t:q.right,q.top],[_?K?q.left+t:q.right:q.left+t,q.bottom]];return[ue,ve,...Se]}default:return[]}}if(!lk([D,A],Q)){if(o&&!z)return M();if(!V&&r){const ae=d(k.clientX,k.clientY);if(ae!==null&&ae<.1)return M()}lk([D,A],le([h,y]))?!o&&r&&a.start(40,M):M()}};return m.__options={blockPointerEvents:n},m}const iD=v.createContext(null),aD=v.createContext(null);function ua(){const e=v.useContext(iD);if(e===null)throw new Error(Cn(60));return e}function oD(){const e=v.useContext(aD);if(e===null)throw new Error(Cn(61));return e}const xK=(e,t)=>Object.is(e,t);function Cc(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function wK(e,t,n){return!e||e.length===0?!1:e.some(r=>r===void 0?!1:Cc(t,r,n))}function cd(e,t,n){return!e||e.length===0?-1:e.findIndex(r=>r===void 0?!1:Cc(r,t,n))}function SK(e,t,n){return e.filter(r=>!Cc(t,r,n))}function Zv(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function sD(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function EK(e){if(!Array.isArray(e))return e!=null&&!("null"in e);if(sD(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 CK(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 Zv(e)}function Ul(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?Zv(e.value):Zv(e)}function lD(e,t,n){function r(){return CK(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=sD(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 TK(e,t,n){return e.reduce((r,a,o)=>(o>0&&r.push(", "),r.push(E.jsx(v.Fragment,{children:lD(a,t,n)},o)),r),[])}const wt={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:Ul(t,r)!==""}),hasNullItemLabel:Ge((e,t)=>t?EK(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=>Cc(n,o,r)):e.selectedIndex===t&&e.selectedIndex!==null?!0:Cc(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 RK(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 zw(e){const[t,n]=v.useState(null),r=Ye((c,f)=>{e||n(f||(sN?"touch":""))}),a=v.useCallback(()=>{n(null)},[]),{onClick:o,onPointerDown:l}=RK(r);return v.useMemo(()=>({openMethod:t,reset:a,triggerProps:{onClick:o,onPointerDown:l}}),[t,a,o,l])}function kK(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:S,multiple:R=!1,itemToStringLabel:k,itemToStringValue:M,isItemEqualToValue:D=xK,highlightItemOnHover:A=!0,children:O}=e,{clearErrors:L}=Qx(),{setDirty:V,setTouched:F,setFocused:W,shouldValidateOnChange:j,validityData:q,setFilled:$,name:B,disabled:_,validation:z,validationMode:H}=Ac(),K=tm({id:t}),P=_||m,U=B??f,[G,I]=yc({controlled:n,default:R?r??qo:r,name:"Select",state:"value"}),[Q,le]=yc({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),Pe=v.useRef(null),te=v.useRef([]),he=v.useRef(!1),ye=v.useRef(!1),Le=v.useRef(null),Ae=v.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),Ce=v.useRef(!1),{mounted:Re,setMounted:J,transitionStatus:Ee}=qd(Q),{openMethod:xe,triggerProps:Be,reset:qe}=zw(Q),De=nr(()=>new iN({id:K,modal:g,multiple:R,itemToStringLabel:k,itemToStringValue:M,isItemEqualToValue:D,value:G,open:Q,mounted:Re,transitionStatus:Ee,items:S,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,ut=Et(De,wt.activeIndex),pe=Et(De,wt.selectedIndex),Te=Et(De,wt.triggerElement),ee=Et(De,wt.positionerElement),fe=v.useMemo(()=>R&&Array.isArray(G)&&G.length===0?"":Ul(G,M),[R,G,M]),Oe=v.useMemo(()=>R&&Array.isArray(G)?G.map(Je=>Ul(Je,M)):Ul(G,M),[R,G,M]),He=sr(De.state.triggerElement);Zx({id:K,commit:z.commit,value:G,controlRef:He,name:U,getValue:()=>Oe});const $e=v.useRef(G);Ve(()=>{G!==$e.current&&De.set("forceMount",!0)},[De,G]),Ve(()=>{$(R?Array.isArray(G)&&G.length>0:G!=null)},[R,G,$]),Ve(function(){if(Q)return;const kt=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=cd(kt,de,D);De.set("selectedIndex",ke===-1?null:ke);return}const X=cd(kt,G,D);De.set("selectedIndex",X===-1?null:X)},[R,Q,G,te,D,De]),qA(G,()=>{L(U),V(G!==q.initialValue),j()?z.commit(G):z.commit(G,!0)});const et=Ye((Je,kt)=>{if(c==null||c(Je,kt),!kt.isCanceled&&(le(Je),!Je&&(kt.reason===$s||kt.reason===nm)&&(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),qe(),T==null||T(!1)});Wa({enabled:!w,open:Q,ref:ue,onComplete(){Q||ze()}}),v.useImperativeHandle(w,()=>({unmount:ze}),[ze]);const Ze=Ye((Je,kt)=>{a==null||a(Je,kt),!kt.isCanceled&&I(Je)}),tt=Ye(()=>{const Je=De.state.listElement||ue.current;if(!Je)return;const kt=Je.scrollTop,X=Je.scrollTop+Je.clientHeight,ie=kt>1,de=X<Je.scrollHeight-1;De.state.scrollUpArrowVisible!==ie&&De.set("scrollUpArrowVisible",ie),De.state.scrollDownArrowVisible!==de&&De.set("scrollDownArrowVisible",de)}),Ct=GN({open:Q,onOpenChange:et,elements:{reference:Te,floating:ee}}),zt=FN(Ct,{enabled:!h&&!P,event:"mousedown"}),gt=vm(Ct,{bubbles:!1}),At=eD(Ct,{enabled:!h&&!P,listRef:ae,activeIndex:ut,selectedIndex:pe,disabledIndices:qo,onNavigate(Je){Je===null&&!Q||De.set("activeIndex",Je)},focusItemOnHover:!1}),it=nD(Ct,{enabled:!h&&!P&&(Q||!R),listRef:Z,activeIndex:ut,selectedIndex:pe,onMatch(Je){Q?De.set("activeIndex",Je):Ze(te.current[Je],vt("none"))},onTypingChange(Je){he.current=Je}}),{getReferenceProps:ft,getFloatingProps:yt,getItemProps:Ke}=Kd([zt,gt,At,it]),Rt=v.useMemo(()=>Ei(ft(),Be,K?{id:K}:Dn),[ft,Be,K]);pm(()=>{De.update({popupProps:yt(),triggerProps:Rt})}),Ve(()=>{De.update({id:K,modal:g,multiple:R,value:G,open:Q,mounted:Re,transitionStatus:Ee,popupProps:yt(),triggerProps:Rt,items:S,itemToStringLabel:k,itemToStringValue:M,isItemEqualToValue:D,openMethod:xe})},[De,K,g,R,G,Q,Re,Ee,yt,Rt,S,k,M,D,xe]);const jt=v.useMemo(()=>({store:De,name:U,required:y,disabled:P,readOnly:h,multiple:R,itemToStringLabel:k,itemToStringValue:M,highlightItemOnHover:A,setValue:Ze,setOpen:et,listRef:ae,popupRef:ue,scrollHandlerRef:ve,handleScrollArrowVisibility:tt,scrollArrowsMountedCountRef:Se,getItemProps:Ke,events:Ct.context.events,valueRef:Pe,valuesRef:te,labelsRef:Z,typingRef:he,selectionRef:Ae,selectedItemTextRef:Le,validation:z,onOpenChangeComplete:T,keyboardActiveRef:ye,alignItemWithTriggerActiveRef:Ce,initialValueRef:$e}),[De,U,y,P,h,R,k,M,A,Ze,et,Ke,Ct.context.events,z,T,tt]),Tt=_i(C,z.inputRef),un=R&&Array.isArray(G)&&G.length>0,Ht=v.useMemo(()=>!R||!Array.isArray(G)||!U?null:G.map(Je=>{const kt=Ul(Je,M);return E.jsx("input",{type:"hidden",name:U,value:kt},kt)}),[R,G,U,M]);return E.jsx(iD.Provider,{value:jt,children:E.jsxs(aD.Provider,{value:Ct,children:[O,E.jsx("input",{...z.getInputValidationProps({onFocus(){var Je;(Je=De.state.triggerElement)==null||Je.focus({focusVisible:!0})},onChange(Je){if(Je.nativeEvent.defaultPrevented)return;const kt=Je.target.value,X=vt(zi,Je.nativeEvent);function ie(){if(R)return;const de=te.current.find(ke=>Ul(ke,M).toLowerCase()===kt.toLowerCase());de!=null&&(V(de!==q.initialValue),Ze(de,X),j()&&z.commit(de))}De.set("forceMount",!0),queueMicrotask(ie)}}),name:R?void 0:U,autoComplete:d,value:fe,disabled:P,required:y&&!un,readOnly:h,ref:Tt,style:U?BA:Jp,tabIndex:-1,"aria-hidden":!0}),Ht]})})}let Rs=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Ws.startingStyle]="startingStyle",e[e.endingStyle=Ws.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),Op=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const MK={[Op.popupOpen]:""},AK={[Op.popupOpen]:"",[Op.pressed]:""},OK={[Rs.open]:""},NK={[Rs.closed]:""},DK={[Rs.anchorHidden]:""},cD={open(e){return e?MK:null}},Jv={open(e){return e?AK:null}},da={open(e){return e?OK:NK},anchorHidden(e){return e?DK:null}};function uD(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 _h=2,IK=400,ck=200,PK={...Jv,...Xx,value:()=>null},LK=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}=Ac(),{labelId:w}=em(),{store:C,setOpen:T,selectionRef:S,validation:R,readOnly:k,required:M,alignItemWithTriggerActiveRef:D,disabled:A,keyboardActiveRef:O}=ua(),L=g||A||l,V=Et(C,wt.open),F=Et(C,wt.value),W=Et(C,wt.triggerProps),j=Et(C,wt.positionerElement),q=Et(C,wt.listElement),$=Et(C,wt.id),B=Et(C,wt.hasSelectedValue),_=!B&&V,z=Et(C,wt.hasNullItemLabel,_),H=o??$;tm({id:H});const K=sr(j),P=v.useRef(null),{getButtonProps:U,buttonRef:G}=qa({disabled:L,native:c}),I=Ye(te=>{C.set("triggerElement",te)}),Q=_i(n,P,G,I),le=Fn(),ae=Fn(),Z=Fn(),ue=Fn();v.useEffect(()=>{if(V)return!(B||z)?Z.start(IK,()=>{S.current.allowUnselectedMouseUp=!0,S.current.allowSelectedMouseUp=!0}):ue.start(ck,()=>{S.current.allowUnselectedMouseUp=!0,Z.start(ck,()=>{S.current.allowSelectedMouseUp=!0})}),()=>{Z.clear(),ue.clear()};S.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},ae.clear()},[V,B,z,S,ae,Z,ue]);const ve=v.useMemo(()=>{var te;return(q==null?void 0:q.id)??((te=Ed(j))==null?void 0:te.id)},[q,j]),Se=Ei(W,{id:H,role:"combobox","aria-expanded":V?"true":"false","aria-haspopup":"listbox","aria-controls":V?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),V&&D.current&&T(!1,vt(zi,te.nativeEvent)),le.start(0,()=>{C.set("forceMount",!0)})},onBlur(te){Nt(j,te.relatedTarget)||(d(!0),m(!1),h==="onBlur"&&R.commit(F))},onPointerMove(){O.current=!1},onKeyDown(){O.current=!0},onMouseDown(te){if(V)return;const he=Qt(te.currentTarget);function ye(Le){if(!P.current)return;const Ae=Le.target;if(Nt(P.current,Ae)||Nt(K.current,Ae)||Ae===P.current)return;const Ce=uD(P.current);Le.clientX>=Ce.left-_h&&Le.clientX<=Ce.right+_h&&Le.clientY>=Ce.top-_h&&Le.clientY<=Ce.bottom+_h||T(!1,vt(VA,Le))}ae.start(0,()=>{he.addEventListener("mouseup",ye,{once:!0})})}},R.getValidationProps,f,U);Se.role="combobox";const Pe={...y,open:V,disabled:L,value:F,readOnly:k,placeholder:!B};return Dt("button",t,{ref:[n,P],state:Pe,stateAttributesMapping:PK,props:Se})}),jK={value:()=>null},_K=v.forwardRef(function(t,n){const{className:r,render:a,children:o,placeholder:l,...c}=t,{store:f,valueRef:d}=ua(),m=Et(f,wt.value),h=Et(f,wt.items),y=Et(f,wt.itemToStringLabel),g=Et(f,wt.hasSelectedValue),w=!g&&l!=null&&o==null,C=Et(f,wt.hasNullItemLabel,w),T={value:m,placeholder:!g};let S=null;return typeof o=="function"?S=o(m):o!=null?S=o:!g&&l!=null&&!C?S=l:Array.isArray(m)?S=TK(m,h,y):S=lD(m,h,y),Dt("span",t,{state:T,ref:[n,d],props:[{children:S},c],stateAttributesMapping:jK})}),zK=v.forwardRef(function(t,n){const{className:r,render:a,...o}=t,{store:l}=ua(),f={open:Et(l,wt.open)};return Dt("span",t,{state:f,ref:n,props:[{"aria-hidden":!0,children:"▼"},o],stateAttributesMapping:cD})}),FK=v.createContext(void 0),BK=v.forwardRef(function(t,n){const{store:r}=ua(),a=Et(r,wt.mounted),o=Et(r,wt.forceMount);return a||o?E.jsx(FK.Provider,{value:!0,children:E.jsx(kw,{ref:n,...t})}):null});function Fw(e){return Kx(19)?e:e?"true":void 0}let uk={},dk={},fk="";function HK(e){if(typeof document>"u")return!1;const t=Qt(e);return Bn(t).innerWidth-t.documentElement.clientWidth>0}function UK(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 VK(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 qK(e){var y;const t=Qt(e),n=t.documentElement,r=t.body,a=Bn(n);let o=0,l=0,c=!1;const f=zn.create();if(gm&&(((y=a.visualViewport)==null?void 0:y.scale)??1)!==1)return()=>{};function d(){const g=a.getComputedStyle(n),w=a.getComputedStyle(r),S=(g.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";o=n.scrollTop,l=n.scrollLeft,uk={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},fk=n.style.scrollBehavior,dk={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",A=Math.max(0,a.innerWidth-r.clientWidth),O=Math.max(0,a.innerHeight-r.clientHeight),L=parseFloat(w.marginTop)+parseFloat(w.marginBottom),V=parseFloat(w.marginLeft)+parseFloat(w.marginRight),F=Ko(n)?n:r;if(c=UK(e),c){n.style.scrollbarGutter=S,F.style.overflowY="hidden",F.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:S,overflowY:"hidden",overflowX:"hidden"}),(R||M)&&(n.style.overflowY="scroll"),(k||D)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:L||O?`calc(100dvh - ${L+O}px)`:"100dvh",width:V||A?`calc(100vw - ${V+A}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,uk),Object.assign(r.style,dk),c||(n.scrollTop=o,n.scrollLeft=l,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=fk)}function h(){m(),f.request(d)}return d(),a.addEventListener("resize",h),()=>{f.cancel(),m(),typeof a.removeEventListener=="function"&&a.removeEventListener("resize",h)}}class $K{constructor(){st(this,"lockCount",0);st(this,"restore",null);st(this,"timeoutLock",aa.create());st(this,"timeoutUnlock",aa.create());st(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});st(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=Bn(r).getComputedStyle(r).overflowY;if(a==="hidden"||a==="clip"){this.restore=Br;return}const o=sN||!HK(t);this.restore=o?VK(t):qK(t)}}const YK=new $K;function Bw(e=!0,t=null){Ve(()=>{if(e)return YK.acquire(t)},[e,t])}const dD=v.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function WK(){return v.useContext(dD)}function wm(e){const{children:t,elementsRef:n,labelsRef:r,onMapChange:a}=e,o=Ye(a),l=v.useRef(0),c=nr(GK).current,f=nr(KK).current,[d,m]=v.useState(0),h=v.useRef(d),y=Ye((S,R)=>{f.set(S,R??null),h.current+=1,m(h.current)}),g=Ye(S=>{f.delete(S),h.current+=1,m(h.current)}),w=v.useMemo(()=>{const S=new Map;return Array.from(f.keys()).filter(k=>k.isConnected).sort(XK).forEach((k,M)=>{const D=f.get(k)??{};S.set(k,{...D,index:M})}),S},[f,d]);Ve(()=>{if(typeof MutationObserver!="function"||w.size===0)return;const S=new MutationObserver(R=>{const k=new Set,M=D=>k.has(D)?k.delete(D):k.add(D);R.forEach(D=>{D.removedNodes.forEach(M),D.addedNodes.forEach(M)}),k.size===0&&(h.current+=1,m(h.current))});return w.forEach((R,k)=>{k.parentElement&&S.observe(k.parentElement,{childList:!0})}),()=>{S.disconnect()}},[w]),Ve(()=>{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]),Ve(()=>()=>{n.current=[]},[n]),Ve(()=>()=>{r&&(r.current=[])},[r]);const C=Ye(S=>(c.add(S),()=>{c.delete(S)}));Ve(()=>{c.forEach(S=>S(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 E.jsx(dD.Provider,{value:T,children:t})}function KK(){return new Map}function GK(){return new Set}function XK(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 QK=v.createContext(void 0);function Pc(){const e=v.useContext(QK);return(e==null?void 0:e.direction)??"ltr"}const ZK=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"}=Va(e,t)||{};if(d==null)return{};const y=gN(m),g={x:n,y:r},w=Cw(a),C=Ew(w),T=await l.getDimensions(d),S=w==="y",R=S?"top":"left",k=S?"bottom":"right",M=S?"clientHeight":"clientWidth",D=o.reference[C]+o.reference[w]-g[w]-o.floating[C],A=g[w]-o.reference[w],O=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,O)))&&(L=c.floating[M]||o.floating[C]);const V=D/2-A/2,F=L/2-T[C]/2-1,W=Math.min(y[R],F),j=Math.min(y[k],F),q=W,$=L-T[C]-j,B=L/2-T[C]/2+V,_=Yv(q,B,$),z=!f.arrow&&Xo(a)!=null&&B!==_&&o.reference[C]/2-(B<q?W:j)-T[C]/2<0,H=z?B<q?B-q:B-$:0;return{[w]:g[w]+H,data:{[w]:_,centerOffset:B-_-H,...z&&{alignmentOffset:H}},reset:z}}}),JK=(e,t)=>({...ZK(e),options:[e,t]}),eG={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 rK().fn(e)).data)==null?void 0:c.referenceHidden)||o}}}},rp={sideX:"left",sideY:"top"},tG={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=Bn(a),d=f.getComputedStyle(a);if(!(d.transitionDuration!=="0s"&&d.transitionDuration!==""))return{x:t,y:n,data:rp};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":rp.sideX,S=g==="top"?"bottom":rp.sideY;return{x:w,y:C,data:{sideX:T,sideY:S}}}};function fD(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 hk(e,t,n){const{rects:r,placement:a}=e;return{side:fD(t,Hr(a),n),align:Xo(a)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Hw(e){var Ct,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:S,adaptiveOrigin:R,lazyFlip:k=!1,externalTree:M}=e,[D,A]=v.useState(null);!w&&D!==null&&A(null);const O=C.side||"flip",L=C.align||"flip",V=C.fallbackAxisSide||"end",F=typeof t=="function"?t:void 0,W=Ye(F),j=F?W:t,q=sr(t),B=Pc()==="rtl",_=D||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":B?"left":"right","inline-start":B?"right":"left"}[r],z=o==="center"?_:`${_}-${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=[ZW(gt=>{const At=hk(gt,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])],Pe=L==="none"&&O!=="shift",te=!Pe&&(d||T||O==="shift"),he=O==="none"?null:tK({...Q,padding:{top:H.top+K,right:H.right+K,bottom:H.bottom+K,left:H.left+K},mainAxis:!T&&O==="flip",crossAxis:L==="flip"?"alignment":!1,fallbackAxisSideDirection:V}),ye=Pe?null:JW(gt=>{const At=Qt(gt.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:eK(it=>{if(!le.current)return{};const{width:ft,height:yt}=le.current.getBoundingClientRect(),Ke=xi(Hr(it.placement)),Rt=Ke==="y"?ft:yt,jt=Ke==="y"?H.left+H.right:H.top+H.bottom;return{offset:Rt/2+jt/2}})}},[Q,d,T,H,L]);O==="shift"||L==="shift"||o==="center"?Se.push(ye,he):Se.push(he,ye),Se.push(nK({...Q,apply({elements:{floating:gt},rects:{reference:At},availableWidth:it,availableHeight:ft}){const yt=gt.style;yt.setProperty("--available-width",`${it}px`),yt.setProperty("--available-height",`${ft}px`),yt.setProperty("--anchor-width",`${At.width}px`),yt.setProperty("--anchor-height",`${At.height}px`)}}),JK(()=>({element:le.current||document.createElement("div"),padding:m,offsetParent:"floating"}),[m]),{name:"transformOrigin",fn(gt){var Xe,at,St;const{elements:At,middlewareData:it,placement:ft,rects:yt,y:Ke}=gt,Rt=Hr(ft),jt=xi(Rt),Tt=le.current,un=((Xe=it.arrow)==null?void 0:Xe.x)||0,Ht=((at=it.arrow)==null?void 0:at.y)||0,Je=(Tt==null?void 0:Tt.clientWidth)||0,kt=(Tt==null?void 0:Tt.clientHeight)||0,X=un+Je/2,ie=Ht+kt/2,de=Math.abs(((St=it.shift)==null?void 0:St.y)||0),ke=yt.reference.height/2,_e=typeof a=="function"?a(hk(gt,r,B)):a,rt=de>_e,nt={top:`${X}px calc(100% + ${_e}px)`,bottom:`${X}px ${-_e}px`,left:`calc(100% + ${_e}px) ${ie}px`,right:`${-_e}px ${ie}px`}[Rt],We=`${X}px ${yt.reference.y+ke-Ke}px`;return At.floating.style.setProperty("--transform-origin",te&&jt==="y"&&rt?We:nt),{}}},eG,R),Ve(()=>{!w&&g&&g.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[w,g]);const Le=v.useMemo(()=>({elementResize:!h&&typeof ResizeObserver<"u",layoutShift:!h&&typeof IntersectionObserver<"u"}),[h]),{refs:Ae,elements:Ce,x:Re,y:J,middlewareData:Ee,update:xe,placement:Be,context:qe,isPositioned:De,floatingStyles:ut}=cK({rootContext:g,placement:z,middleware:Se,strategy:n,whileElementsMounted:y?void 0:(...gt)=>ak(...gt,Le),nodeId:S,externalTree:M}),{sideX:pe,sideY:Te}=Ee.adaptiveOrigin||rp,ee=De?n:"fixed",fe=v.useMemo(()=>{const gt=R?{position:ee,[pe]:Re,[Te]:J}:{position:ee,...ut};return De||(gt.opacity=0),gt},[R,ee,pe,Re,Te,J,ut,De]),Oe=v.useRef(null);Ve(()=>{if(!w)return;const gt=q.current,At=typeof gt=="function"?gt():gt,ft=(pk(At)?At.current:At)||null||null;ft!==Oe.current&&(Ae.setPositionReference(ft),Oe.current=ft)},[w,Ae,j,q]),v.useEffect(()=>{if(!w)return;const gt=q.current;typeof gt!="function"&&pk(gt)&&gt.current!==Oe.current&&(Ae.setPositionReference(gt.current),Oe.current=gt.current)},[w,Ae,j,q]),v.useEffect(()=>{if(y&&w&&Ce.domReference&&Ce.floating)return ak(Ce.domReference,Ce.floating,xe,Le)},[y,w,Ce,xe,Le]);const He=Hr(Be),$e=fD(r,He,B),et=Xo(Be)||"center",ze=!!((Ct=Ee.hide)!=null&&Ct.referenceHidden);Ve(()=>{k&&w&&De&&A(He)},[k,w,De,He]);const Ze=v.useMemo(()=>{var gt,At;return{position:"absolute",top:(gt=Ee.arrow)==null?void 0:gt.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:Ae,context:qe,isPositioned:De,update:xe}),[fe,Ze,le,tt,$e,et,He,ze,Ae,qe,De,xe])}function pk(e){return e!=null&&"current"in e}const hD=v.createContext(void 0);function Uw(){const e=v.useContext(hD);if(!e)throw new Error(Cn(59));return e}const Vw=v.forwardRef(function(t,n){const{cutout:r,...a}=t;let o;if(r){const l=r==null?void 0:r.getBoundingClientRect();o=`polygon(
384
- 0% 0%,
385
- 100% 0%,
386
- 100% 100%,
387
- 0% 100%,
388
- 0% 0%,
389
- ${l.left}px ${l.top}px,
390
- ${l.left}px ${l.bottom}px,
391
- ${l.right}px ${l.bottom}px,
392
- ${l.right}px ${l.top}px,
393
- ${l.left}px ${l.top}px
394
- )`}return E.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...a,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:o}})});function Lc(e){return e==="starting"?gH:Dn}function Np(e,t){e&&Object.assign(e.style,t)}const pD={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},nG={position:"fixed"},rG=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:S=EA,...R}=t,{store:k,listRef:M,labelsRef:D,alignItemWithTriggerActiveRef:A,selectedItemTextRef:O,valuesRef:L,initialValueRef:V,popupRef:F,setValue:W}=ua(),j=oD(),q=Et(k,wt.open),$=Et(k,wt.mounted),B=Et(k,wt.modal),_=Et(k,wt.value),z=Et(k,wt.openMethod),H=Et(k,wt.positionerElement),K=Et(k,wt.triggerElement),P=Et(k,wt.isItemEqualToValue),U=Et(k,wt.transitionStatus),G=v.useRef(null),I=v.useRef(null),[Q,le]=v.useState(T),ae=$&&Q&&z!=="touch";!$&&Q!==T&&le(T),Ve(()=>{$||(wt.scrollUpArrowVisible(k.state)&&k.set("scrollUpArrowVisible",!1),wt.scrollDownArrowVisible(k.state)&&k.set("scrollDownArrowVisible",!1))},[k,$]),v.useImperativeHandle(A,()=>ae),Bw((ae||B)&&q&&z!=="touch",K);const Z=Hw({anchor:r,floatingRootContext:j,positionMethod:a,mounted:$,side:c,sideOffset:d,align:f,alignOffset:m,arrowPadding:g,collisionBoundary:h,collisionPadding:y,sticky:w,disableAnchorTracking:C??ae,collisionAvoidance:S,keepMounted:!0}),ue=ae?"none":Z.side,ve=ae?nG:Z.positionerStyles,Se=v.useMemo(()=>{const Ce={};return q||(Ce.pointerEvents="none"),{role:"presentation",hidden:!$,style:{...ve,...Ce}}},[q,$,ve]),Pe={open:q,side:ue,align:Z.align,anchorHidden:Z.anchorHidden},te=Ye(Ce=>{k.set("positionerElement",Ce)}),he=Dt("div",t,{ref:[n,te],state:Pe,stateAttributesMapping:da,props:[Se,Lc(U),R]}),ye=v.useRef(0),Le=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=vt(zi);if(Re!==0&&!k.state.multiple&&_!==null&&cd(L.current,_,P)===-1){const xe=V.current,qe=xe!=null&&cd(L.current,xe,P)!==-1?xe:null;W(qe,J),qe===null&&(k.set("selectedIndex",null),O.current=null)}if(Re!==0&&k.state.multiple&&Array.isArray(_)){const Ee=Be=>cd(L.current,Be,P)!==-1,xe=_.filter(Be=>Ee(Be));(xe.length!==_.length||xe.some(Be=>!wK(_,Be,P)))&&(W(xe,J),xe.length===0&&(k.set("selectedIndex",null),O.current=null))}if(q&&ae){k.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const Ee={height:""};Np(H,Ee),Np(F.current,Ee)}}),Ae=v.useMemo(()=>({...Z,side:ue,alignItemWithTriggerActive:ae,setControlledAlignItemWithTrigger:le,scrollUpArrowRef:G,scrollDownArrowRef:I}),[Z,ue,ae,le]);return E.jsx(wm,{elementsRef:M,labelsRef:D,onMapChange:Le,children:E.jsxs(hD.Provider,{value:Ae,children:[$&&B&&E.jsx(Vw,{inert:Fw(!q),cutout:K}),he]})})});function mD(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 zh="base-ui-disable-scrollbar",Cd={className:zh,getElement(e){return E.jsx("style",{nonce:e,href:zh,precedence:"base-ui:low",children:`.${zh}{scrollbar-width:none}.${zh}::-webkit-scrollbar{display:none}`})}},iG=v.createContext(void 0);function gD(e){return v.useContext(iG)}const Zl="ArrowUp",ks="ArrowDown",Td="ArrowLeft",Jl="ArrowRight",Gd="Home",Xd="End",yD=new Set([Td,Jl]),aG=new Set([Td,Jl,Gd,Xd]),bD=new Set([Zl,ks]),oG=new Set([Zl,ks,Gd,Xd]),vD=new Set([...yD,...bD]),sG=new Set([...vD,Gd,Xd]),qw=new Set([Zl,ks,Td,Jl,Gd,Xd]),lG="Shift",cG="Control",uG="Alt",dG="Meta",fG=new Set([lG,cG,uG,dG]);function hG(e){return kn(e)&&e.tagName==="INPUT"}function mk(e){return!!(hG(e)&&e.selectionStart!=null||kn(e)&&e.tagName==="TEXTAREA")}function gk(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=yk(e,t,"left"),d=Fh(e),m=Fh(t);n==="ltr"&&(f+t.offsetWidth+m.scrollMarginRight>e.scrollLeft+e.clientWidth-d.scrollPaddingRight?a=f+t.offsetWidth+m.scrollMarginRight-e.clientWidth+d.scrollPaddingRight:f-m.scrollMarginLeft<e.scrollLeft+d.scrollPaddingLeft&&(a=f-m.scrollMarginLeft-d.scrollPaddingLeft)),n==="rtl"&&(f-m.scrollMarginRight<e.scrollLeft+d.scrollPaddingLeft?a=f-m.scrollMarginLeft-d.scrollPaddingLeft:f+t.offsetWidth+m.scrollMarginRight>e.scrollLeft+e.clientWidth-d.scrollPaddingRight&&(a=f+t.offsetWidth+m.scrollMarginRight-e.clientWidth+d.scrollPaddingRight))}if(c&&r!=="horizontal"){const f=yk(e,t,"top"),d=Fh(e),m=Fh(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 yk(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let a=0;for(;t.offsetParent&&(a+=t[r],t.offsetParent!==e);)t=t.offsetParent;return a}function Fh(e){const t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}function Ba(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const pG=v.createContext(void 0),mG={disableStyleElements:!1};function xD(){return v.useContext(pG)??mG}const Es=1,gG={...da,...Ya},yG=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:S}=ua(),{side:R,align:k,alignItemWithTriggerActive:M,setControlledAlignItemWithTrigger:D,scrollDownArrowRef:A,scrollUpArrowRef:O}=Uw(),L=gD()!=null,V=oD(),{nonce:F,disableStyleElements:W}=xD(),j=Fn(),q=Et(c,wt.id),$=Et(c,wt.open),B=Et(c,wt.mounted),_=Et(c,wt.popupProps),z=Et(c,wt.transitionStatus),H=Et(c,wt.triggerElement),K=Et(c,wt.positionerElement),P=Et(c,wt.listElement),U=v.useRef(0),G=v.useRef(!1),I=v.useRef(0),Q=v.useRef(!1),le=v.useRef({}),ae=Vd(),Z=Ye(Pe=>{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,Le=Qt(K),Ae=getComputedStyle(K),Ce=parseFloat(Ae.marginTop),Re=parseFloat(Ae.marginBottom),J=bk(getComputedStyle(f.current)),Ee=Math.min(Le.documentElement.clientHeight-Ce-Re,J),xe=Pe.scrollTop,Be=vk(Pe);let qe=0,De=null,ut=!1,pe=!1;const Te=fe=>{K.style.height=`${fe}px`},ee=(fe,Oe)=>{const He=Ba(fe,0,Ee-ye);He>0&&Te(ye+He),Pe.scrollTop=Oe,Ee-(ye+He)<=Es&&(G.current=!0),C()};if(te){const fe=Be-xe,Oe=ye+fe,He=Math.min(Oe,Ee);if(qe=He,fe<=Es){ee(fe,Be);return}Ee-He>Es?pe=!0:ut=!0}else if(he){const fe=xe,Oe=ye+fe,He=Math.min(Oe,Ee),$e=Oe-Ee;if(qe=He,fe<=Es){ee(fe,0);return}Ee-He>Es?De=0:(ut=!0,xe<Be&&(De=xe-(fe-$e)))}if(qe=Math.ceil(qe),qe!==0&&Te(qe),pe||De!=null){const fe=vk(Pe),Oe=pe?fe:Ba(De,0,fe);Math.abs(Pe.scrollTop-Oe)>Es&&(Pe.scrollTop=Oe)}(ut||qe>=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};Ve(()=>{!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]),Ve(()=>{$||M||(Q.current=!1,G.current=!1,U.current=0,I.current=0,Np(K,le.current))},[$,M,K,f]),Ve(()=>{const Pe=f.current;if(!(!$||!H||!K||!Pe||c.state.transitionStatus==="ending")){if(!M){Q.current=!0,ae.request(C),Pe.style.removeProperty("--transform-origin");return}queueMicrotask(()=>{var he;const te=bG(Pe);Pe.style.removeProperty("--transform-origin");try{const ye=getComputedStyle(K),Le=getComputedStyle(Pe),Ae=Qt(H),Ce=Bn(K),Re=H.getBoundingClientRect(),J=K.getBoundingClientRect(),Ee=Re.left,xe=Re.height,Be=P||Pe,qe=Be.scrollHeight,De=parseFloat(Le.borderBottomWidth),ut=parseFloat(ye.marginTop)||10,pe=parseFloat(ye.marginBottom)||10,Te=parseFloat(ye.minHeight)||100,ee=bk(Le),fe=5,Oe=5,He=20,$e=Ae.documentElement.clientHeight-ut-pe,et=Ae.documentElement.clientWidth,ze=$e-Re.bottom+xe,Ze=y.current,tt=h.current;let Ct,zt=0,gt=0;if(Ze&&tt){const kt=tt.getBoundingClientRect();Ct=Ze.getBoundingClientRect();const X=kt.left-Ee,ie=Ct.left-J.left,de=kt.top-Re.top+kt.height/2,ke=Ct.top-J.top+Ct.height/2;zt=X-ie,gt=ke-de}const At=ze+gt+pe+De;let it=Math.min($e,At);const ft=$e-ut-pe,yt=At-it,Ke=Math.max(fe,Ee+zt),Rt=et-Oe,jt=Math.max(0,Ke+J.width-Rt);K.style.left=`${Ke-jt}px`,K.style.height=`${it}px`,K.style.maxHeight="auto",K.style.marginTop=`${ut}px`,K.style.marginBottom=`${pe}px`,Pe.style.height="100%";const Tt=Be.scrollHeight-Be.clientHeight,un=yt>=Tt;un&&(it=Math.min($e,J.height)-(yt-Tt));const Ht=Re.top<He||Re.bottom>$e-He||it<Math.min(qe,Te),Je=(((he=Ce.visualViewport)==null?void 0:he.scale)??1)!==1&&gm;if(Ht||Je){Q.current=!0,Np(K,le.current),pr.flushSync(()=>D(!1));return}if(un){const kt=Math.max(0,$e-At);K.style.top=J.height>=ft?"0":`${kt}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=yt;if(Ct){const kt=J.top,X=J.height,ie=Ct.top+Ct.height/2,de=X>0?(ie-kt)/X*100:50,ke=Ba(de,0,100);Pe.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,A,O,P]),v.useEffect(()=>{if(!M||!K||!$)return;const Pe=Bn(K);function te(he){m(!1,vt(SU,he))}return Pe.addEventListener("resize",te),()=>{Pe.removeEventListener("resize",te)}},[m,M,K,$]);const ve={...P?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":w||void 0,id:`${q}-list`},onKeyDown(Pe){g.current=!0,L&&qw.has(Pe.key)&&Pe.stopPropagation()},onMouseMove(){g.current=!1},onPointerLeave(Pe){if(!S||mD(Pe)||Pe.pointerType==="touch")return;const te=Pe.currentTarget;j.start(0,()=>{c.set("activeIndex",null),te.focus({preventScroll:!0})})},onScroll(Pe){P||Z(Pe.currentTarget)},...M&&{style:P?{height:"100%"}:pD}},Se=Dt("div",t,{ref:[n,f],state:ue,stateAttributesMapping:gG,props:[_,ve,Lc(z),{className:!P&&M?Cd.className:void 0},l]});return E.jsxs(v.Fragment,{children:[!W&&Cd.getElement(F),E.jsx(Aw,{context:V,modal:!1,disabled:!B,returnFocus:o,restoreFocus:!0,children:Se})]})});function bk(e){const t=e.maxHeight||"";return t.endsWith("px")&&parseFloat(t)||1/0}function vk(e){return Math.max(0,e.scrollHeight-e.clientHeight)}const xk=[["transform","none"],["scale","1"],["translate","0 0"]];function bG(e){const{style:t}=e,n={};for(const[r,a]of xk)n[r]=t.getPropertyValue(r),t.setProperty(r,a,"important");return()=>{for(const[r]of xk){const a=n[r];a?t.setProperty(r,a):t.removeProperty(r)}}}const vG=v.forwardRef(function(t,n){const{className:r,render:a,...o}=t,{store:l,scrollHandlerRef:c}=ua(),{alignItemWithTriggerActive:f}=Uw(),d=Et(l,wt.hasScrollArrows),m=Et(l,wt.openMethod),h=Et(l,wt.multiple),g={id:`${Et(l,wt.id)}-list`,role:"listbox","aria-multiselectable":h||void 0,onScroll(C){var T;(T=c.current)==null||T.call(c,C.currentTarget)},...f&&{style:pD},className:d&&m!=="touch"?Cd.className:void 0},w=Ye(C=>{l.set("listElement",C)});return Dt("div",t,{ref:[n,w],props:[g,o]})});let wD=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function $w(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}=WK(),y=v.useRef(-1),[g,w]=v.useState(o??(a===wD.GuessFromOrder?()=>{if(y.current===-1){const S=h.current;h.current+=1,y.current=S}return y.current}:-1)),C=v.useRef(null),T=v.useCallback(S=>{var R;if(C.current=S,g!==-1&&S!==null&&(d.current[g]=S,m)){const k=t!==void 0;m.current[g]=k?t:((R=r==null?void 0:r.current)==null?void 0:R.textContent)??S.textContent}},[g,d,m,t,r]);return Ve(()=>{if(o!=null)return;const S=C.current;if(S)return l(S,n),()=>{c(S)}},[o,l,c,n]),Ve(()=>{if(o==null)return f(S=>{var k;const R=C.current?(k=S.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 SD=v.createContext(void 0);function Yw(){const e=v.useContext(SD);if(!e)throw new Error(Cn(57));return e}const xG=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=$w({label:l,textRef:m,indexGuessBehavior:wD.GuessFromOrder}),{store:y,getItemProps:g,setOpen:w,setValue:C,selectionRef:T,typingRef:S,valuesRef:R,keyboardActiveRef:k,multiple:M,highlightItemOnHover:D}=ua(),A=Fn(),O=Et(y,wt.isActive,h.index),L=Et(y,wt.isSelected,h.index,o),V=Et(y,wt.isSelectedByFocus,h.index),F=Et(y,wt.isItemEqualToValue),W=h.index,j=W!==-1,q=v.useRef(null),$=sr(W);Ve(()=>{if(!j)return;const ae=R.current;return ae[W]=o,()=>{delete ae[W]}},[j,W,o,R]),Ve(()=>{if(!j)return;const ae=y.state.value;let Z=ae;M&&Array.isArray(ae)&&ae.length>0&&(Z=ae[ae.length-1]),Z!==void 0&&Cc(o,Z,F)&&y.set("selectedIndex",W)},[j,W,M,F,y,o]);const B={disabled:c,selected:L,highlighted:O},_=g({active:O,selected:L});_.onFocus=void 0,_.id=void 0;const z=v.useRef(null),H=v.useRef("mouse"),K=v.useRef(!1),{getButtonProps:P,buttonRef:U}=qa({disabled:c,focusableWhenDisabled:!0,native:f});function G(ae){const Z=y.state.value;if(M){const ue=Array.isArray(Z)?Z:[],ve=L?SK(ue,o,F):[...ue,o];C(ve,vt(nd,ae))}else C(o,vt(nd,ae)),w(!1,vt(nd,ae))}const I={role:"option","aria-selected":L,tabIndex:O?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||mD(ae)||A.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===" "&&S.current||H.current!=="touch"&&!O||(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"&&!O||G(ae.nativeEvent)}},Q=Dt("div",t,{ref:[U,n,h.ref,q],state:B,props:[_,I,d,P]}),le=v.useMemo(()=>({selected:L,indexRef:$,textRef:m,selectedByFocus:V,hasRegistered:j}),[L,$,m,V,j]);return E.jsx(SD.Provider,{value:le,children:Q})})),wG=v.forwardRef(function(t,n){const r=t.keepMounted??!1,{selected:a}=Yw();return r||a?E.jsx(SG,{...t,ref:n}):null}),SG=v.memo(v.forwardRef((e,t)=>{const{render:n,className:r,keepMounted:a,...o}=e,{selected:l}=Yw(),c=v.useRef(null),{transitionStatus:f,setMounted:d}=qd(l),h=Dt("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})),EG=v.memo(v.forwardRef(function(t,n){const{indexRef:r,textRef:a,selectedByFocus:o,hasRegistered:l}=Yw(),{selectedItemTextRef:c}=ua(),{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 Dt("div",t,{ref:[h,n,a],props:m})})),ED=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}=ua(),{side:g,scrollDownArrowRef:w,scrollUpArrowRef:C}=Uw(),T=o==="up"?wt.scrollUpArrowVisible:wt.scrollDownArrowVisible,S=Et(f,T),R=Et(f,wt.openMethod),k=S&&R!=="touch",M=Fn(),D=o==="up"?C:w,{transitionStatus:A,setMounted:O}=qd(k);Ve(()=>(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||O(!1)}});const F=Dt("div",t,{ref:[n,D],state:{direction:o,visible:k,side:g,transitionStatus:A},props:[{"aria-hidden":!0,children:o==="up"?"▲":"▼",style:{position:"absolute"},onMouseMove(j){if(j.movementX===0&&j.movementY===0||M.isStarted())return;f.set("activeIndex",null);function q(){var H;const $=f.state.listElement??d.current;if(!$)return;f.set("activeIndex",null),h();const B=$.scrollTop===0,_=Math.round($.scrollTop+$.clientHeight)>=$.scrollHeight;if(m.current.length===0&&(o==="up"?f.set("scrollUpArrowVisible",!B):f.set("scrollDownArrowVisible",!_)),o==="up"&&B||o==="down"&&_){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,q)}M.start(40,q)},onMouseLeave(){M.clear()}},c]});return k||l?F:null}),CG=v.forwardRef(function(t,n){return E.jsx(ED,{...t,ref:n,direction:"down"})}),TG=v.forwardRef(function(t,n){return E.jsx(ED,{...t,ref:n,direction:"up"})}),CD=v.createContext(void 0);function RG(){const e=v.useContext(CD);if(e===void 0)throw new Error(Cn(56));return e}const kG=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=Dt("div",t,{ref:n,props:[{role:"group","aria-labelledby":l},o]});return E.jsx(CD.Provider,{value:f,children:d})}),MG=v.forwardRef(function(t,n){const{className:r,render:a,id:o,...l}=t,{setLabelId:c}=RG(),f=Hi(o);return Ve(()=>{c(f)},[f,c]),Dt("div",t,{ref:n,props:[{id:f},l]})}),TD=v.forwardRef(function(t,n){const{className:r,render:a,orientation:o="horizontal",...l}=t;return Dt("div",t,{state:{orientation:o},ref:n,props:[{role:"separator","aria-orientation":o},l]})}),ip=kK;function AG({className:e,...t}){return E.jsx(kG,{"data-slot":"select-group",className:je("scroll-my-1 p-1",e),...t})}function _b({className:e,...t}){return E.jsx(_K,{"data-slot":"select-value",className:je("flex flex-1 text-left",e),...t})}function ap({className:e,size:t="default",children:n,...r}){return E.jsxs(LK,{"data-slot":"select-trigger","data-size":t,className:je("border-input data-placeholder:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 gap-1.5 rounded-lg border bg-transparent py-2 pr-2 pl-2.5 text-sm transition-colors select-none focus-visible:ring-2 aria-invalid:ring-2 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:gap-1.5 [&_svg:not([class*='size-'])]:size-4 flex w-fit items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...r,children:[n,E.jsx(zK,{render:E.jsx(dA,{className:"text-muted-foreground size-4 pointer-events-none"})})]})}function op({className:e,children:t,side:n="bottom",sideOffset:r=4,align:a="center",alignOffset:o=0,alignItemWithTrigger:l=!0,...c}){return E.jsx(BK,{children:E.jsx(rG,{side:n,sideOffset:r,align:a,alignOffset:o,alignItemWithTrigger:l,className:"isolate z-50",children:E.jsxs(yG,{"data-slot":"select-content","data-align-trigger":l,className:je("bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 min-w-36 rounded-lg shadow-md ring-1 duration-100 data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 relative isolate z-50 max-h-(--available-height) w-(--anchor-width) origin-(--transform-origin) overflow-x-hidden overflow-y-auto data-[align-trigger=true]:animate-none",e),...c,children:[E.jsx(NG,{}),E.jsx(vG,{children:t}),E.jsx(DG,{})]})})})}function OG({className:e,...t}){return E.jsx(MG,{"data-slot":"select-label",className:je("text-muted-foreground px-1.5 py-1 text-xs",e),...t})}function Pa({className:e,children:t,...n}){return E.jsxs(xG,{"data-slot":"select-item",className:je("focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 relative flex w-full cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...n,children:[E.jsx(EG,{className:"flex flex-1 gap-2 shrink-0 whitespace-nowrap",children:t}),E.jsx(wG,{render:E.jsx("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center"}),children:E.jsx(hp,{className:"pointer-events-none"})})]})}function NG({className:e,...t}){return E.jsx(TG,{"data-slot":"select-scroll-up-button",className:je("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4 top-0 w-full",e),...t,children:E.jsx(BF,{})})}function DG({className:e,...t}){return E.jsx(CG,{"data-slot":"select-scroll-down-button",className:je("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4 bottom-0 w-full",e),...t,children:E.jsx(dA,{})})}const ex="::";function wk(e,t){return`${e??""}${ex}${t}`}function IG(e){const t=e.indexOf(ex);return t<0?{providerId:null,modelId:e}:{providerId:e.slice(0,t)||null,modelId:e.slice(t+ex.length)}}function PG({providerId:e,modelId:t,onChange:n,disabled:r,className:a}){var C;const{t:o}=Sn(),{data:l}=Vo({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}=Vo({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?wk(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 E.jsxs(ip,{value:h,onValueChange:T=>{if(typeof T!="string"||!T)return;const S=IG(T);n(S.providerId,S.modelId)},disabled:r||f.length===0,children:[E.jsx(ap,{size:"sm",className:je("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:E.jsx("span",{className:"min-w-0 truncate",children:w})}),E.jsxs(op,{children:[!y&&m&&E.jsx(Pa,{value:h,className:"text-muted-foreground",children:m}),f.map(T=>E.jsxs(AG,{children:[E.jsx(OG,{children:T.name}),T.models.map(S=>E.jsx(Pa,{value:wk(T.id,S),children:S},`${T.id}:${S}`))]},T.id))]})]})}function LG({queued:e,onEdit:t,onWithdraw:n,onSteer:r}){const{t:a}=Sn(),[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 E.jsxs("div",{"data-testid":"agent-queue",className:"bg-muted/50 mx-3 mb-2 flex shrink-0 flex-col gap-1.5 rounded-xl px-2.5 py-2",children:[E.jsxs("div",{className:"flex items-center justify-between",children:[E.jsx("span",{className:"text-muted-foreground text-xs font-medium",children:a("agent.queue.title",{count:e.length})}),E.jsxs(qt,{"data-testid":"agent-queue-steer",size:"xs",variant:"outline",onClick:r,title:a("agent.queue.steerHint"),children:[E.jsx(gA,{}),a("agent.queue.steer")]})]}),E.jsx("ul",{className:"flex flex-col gap-1",children:e.map(h=>E.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?E.jsxs(E.Fragment,{children:[E.jsx(ew,{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}),E.jsx(qt,{size:"icon-sm",variant:"ghost",onClick:()=>m(h.id),"aria-label":a("common.save"),children:E.jsx(hp,{})})]}):E.jsxs(E.Fragment,{children:[E.jsx("span",{className:"min-w-0 flex-1 truncate text-xs",children:h.text}),E.jsx(qt,{size:"icon-sm",variant:"ghost",onClick:()=>d(h),"aria-label":a("common.edit"),children:E.jsx(Yp,{})}),E.jsx(qt,{"data-testid":`agent-queue-withdraw-${h.id}`,size:"icon-sm",variant:"ghost",onClick:()=>n(h.id),"aria-label":a("agent.queue.withdraw"),children:E.jsx(Ua,{})})]})},h.id))})]})}function jG({onSend:e,onSteer:t,onStop:n,running:r,steerable:a,disabled:o,modelPicker:l,writeModeControl:c}){const{t:f}=Sn(),[d,m]=v.useState(""),h=()=>{const g=d.trim();!g||o||(e==null||e(g),m(""))},y=()=>{const g=d.trim();!g||o||(t==null||t(g),m(""))};return E.jsxs("div",{"data-testid":"agent-chat-input",className:"bg-chat-surface flex shrink-0 flex-col gap-2 mx-3 mb-2.5 rounded-xl mt-1.5 focus-within:ring-1 focus-within:ring-ring/30",children:[E.jsx(ew,{"data-testid":"agent-chat-input-textarea",value:d,onChange:g=>m(g.target.value),onKeyDown:g=>{g.key==="Enter"&&!g.shiftKey&&!g.nativeEvent.isComposing&&(g.preventDefault(),h())},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}),E.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2 px-2.5 pb-2.5",children:[E.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[c,l&&E.jsx("div",{className:"min-w-0 flex-1",children:l})]}),r?E.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-1.5",children:[a&&E.jsx(qt,{"data-testid":"agent-chat-steer",size:"icon",variant:"outline",disabled:o||d.trim().length===0,onClick:y,"aria-label":f("agent.queue.steer"),title:f("agent.queue.steerHint"),children:E.jsx(gA,{})}),E.jsx(qt,{"data-testid":"agent-chat-send",size:"icon",variant:"secondary",disabled:o||d.trim().length===0,onClick:h,"aria-label":f("agent.panel.send"),children:E.jsx(OT,{})}),E.jsx(qt,{"data-testid":"agent-chat-stop",size:"icon",variant:"destructive",onClick:()=>n==null?void 0:n(),"aria-label":f("agent.panel.stop"),children:E.jsx(OB,{})})]}):E.jsx(qt,{"data-testid":"agent-chat-send",size:"icon",className:"ml-auto shrink-0",disabled:o||d.trim().length===0,onClick:h,"aria-label":f("agent.panel.send"),children:E.jsx(OT,{})})]})]})}function _G(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:PU({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 zG(){var ae;const{t:e}=Sn(),t=Px(),n=ra(Z=>Z.setSidebarTab),r=Xj("/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=ln(Z=>Z.sessions),c=ln(Z=>Z.activeSessionId),f=ln(Z=>Z.draft),d=ln(Z=>Z.activeSessionId?Z.messages[Z.activeSessionId]:void 0),m=ln(Z=>Z.activeSessionId?Z.inProgress[Z.activeSessionId]:void 0),h=ln(Z=>Z.activeSessionId?Z.pendingConfirmations[Z.activeSessionId]:void 0),y=ln(Z=>Z.activeSessionId?Z.sending[Z.activeSessionId]:void 0),g=ln(Z=>Z.activeSessionId?Z.queued[Z.activeSessionId]:void 0),w=ln(Z=>Z.defaultWriteMode),C=qn(Z=>Z.snapshots),{data:T}=Vo({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=ln.getState();Z.ensureInitialized(),Z.loadSessions()},[]);const S=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 Pe=Se.panes.find(te=>te.id===o);if(Pe)return Pe.title??null}return null},[a,o,C]);v.useEffect(()=>{!S&&!f&&a&&o&&ln.getState().startDraft(a,o,R)},[S,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=RU(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=S??(f?{deviceId:f.deviceId,paneId:f.paneId}:null),A=D?_G(D,C,T==null?void 0:T.devices):null,O=!!(S&&o&&a&&(S.paneId!==o||S.deviceId!==a)),L=(S==null?void 0:S.status)==="running",V=kU(d),F=!!(S&&(!S.deviceId||!((ae=T==null?void 0:T.devices)!=null&&ae.some(Z=>Z.id===S.deviceId))||(A==null?void 0:A.state)==="invalid")),W=g??[],j=(Z,ue)=>{c&&ln.getState().decideConfirmation(c,Z,ue)},q=()=>{if(S!=null&&S.deviceId){if((A==null?void 0:A.state)==="valid"&&A.windowId&&S.paneId){t(`/devices/${S.deviceId}/windows/${A.windowId}/panes/${encodeURIComponent(S.paneId)}`);return}(A==null?void 0:A.state)==="unknown"&&t(`/devices/${S.deviceId}`)}},$=()=>{!a||!o||ln.getState().startDraft(a,o,R)},B=(Z,ue)=>{S?ln.getState().setSessionModel(S.id,Z,ue):f&&ln.getState().updateDraft({providerId:Z,modelId:ue})},_=Z=>{const ue=ln.getState();if(S){S.status==="running"?ue.enqueueMessage(S.id,Z):ue.sendMessage(S.id,Z);return}f&&(async()=>{const ve=await ue.materializeDraft();ve&&await ue.sendMessage(ve.id,Z)})()},z=Z=>{S&&ln.getState().enqueueMessage(S.id,Z,!0)},H=()=>{if(!S)return;const Z=W[0];if(!Z)return;const ue=ln.getState();(async()=>(await ue.withdrawQueuedMessage(S.id,Z.id),await ue.enqueueMessage(S.id,Z.text,!0)))()},K=S?S.providerId:(f==null?void 0:f.providerId)??null,P=S?S.modelId:(f==null?void 0:f.modelId)??null,U=!!(S||f),G=!!(f&&!S),I=S?S.writeMode:w,Q=!!(S&&((d==null?void 0:d.length)??0)>0),le=F||!U||(S==null?void 0:S.status)==="waiting_confirmation"||!!y;return E.jsxs("div",{"data-testid":"agent-tab",className:"flex h-full min-h-0 flex-col",children:[E.jsxs("div",{className:"flex shrink-0 items-center gap-2 px-3 py-2",children:[A?E.jsxs("button",{type:"button","data-testid":"agent-binding-chip","data-binding-state":A.state,className:je("border-border flex min-w-0 items-center gap-1 rounded-full border px-2 py-0.5 text-xs",S&&A.state==="valid"?"hover:bg-muted cursor-pointer":"text-muted-foreground",A.state==="invalid"&&"opacity-60"),onClick:q,disabled:!S||A.state==="invalid",children:[E.jsx(PB,{className:"size-3 shrink-0"}),E.jsx("span",{className:"min-w-0 truncate",children:A.label}),A.state==="invalid"&&E.jsxs("span",{className:"shrink-0",children:["· ",e("agent.binding.invalid")]})]}):E.jsx("div",{className:"min-w-0 flex-1"}),E.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-1",children:[E.jsx(qt,{"data-testid":"agent-session-switch",size:"icon-sm",variant:"ghost",onClick:()=>n("panes"),"aria-label":e("agent.session.switch"),title:e("agent.session.switch"),children:E.jsx(nB,{})}),Q&&E.jsx(qt,{"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:E.jsx(Wp,{})})]})]}),F&&E.jsxs("div",{"data-testid":"agent-orphan-banner",className:"bg-muted/50 text-muted-foreground mx-3 mb-1.5 flex shrink-0 items-start gap-2 rounded-lg px-2 py-1.5 text-xs",children:[E.jsx(ed,{className:"mt-0.5 size-3.5 shrink-0"}),E.jsx("span",{className:"min-w-0 flex-1",children:e("agent.orphan.readonly")})]}),S&&!F&&O&&E.jsxs("div",{"data-testid":"agent-pane-mismatch",className:"bg-muted/50 mx-3 mb-1.5 flex shrink-0 flex-wrap items-center gap-2 rounded-lg px-2 py-1.5 text-xs",children:[E.jsx(ed,{className:"text-muted-foreground size-3.5 shrink-0"}),E.jsx("span",{className:"text-muted-foreground min-w-0 flex-1",children:e("agent.binding.mismatchTitle")}),(A==null?void 0:A.state)==="valid"&&E.jsx(qt,{"data-testid":"agent-binding-goto",size:"xs",variant:"outline",onClick:q,children:e("agent.binding.goTo")}),o&&E.jsx(qt,{"data-testid":"agent-binding-rebind",size:"xs",variant:"outline",onClick:()=>{ln.getState().rebindPane(S.id,o)},children:e("agent.binding.rebind")})]}),(S==null?void 0:S.status)==="error"&&S.lastError&&E.jsxs("div",{"data-testid":"agent-error-banner",className:"bg-destructive/10 text-destructive mx-3 mb-1.5 flex shrink-0 items-start gap-2 rounded-lg px-2 py-1.5 text-xs",children:[E.jsx(ed,{className:"mt-0.5 size-3.5 shrink-0"}),E.jsx("span",{className:"min-w-0 flex-1 break-words",children:S.lastError}),V&&!F&&E.jsx(qt,{"data-testid":"agent-error-retry",size:"xs",variant:"outline",className:"shrink-0",disabled:!!y,onClick:()=>{ln.getState().sendMessage(S.id,V)},children:e("agent.panel.retry")})]}),!G&&E.jsx(W$,{blocks:S?M:[],running:!!L,emptyText:e(U?"agent.panel.empty":"agent.session.selectPaneHint"),confirmationByToolCallId:k,onDecide:j,className:"bg-chat-surface mx-3 mb-2 overflow-hidden rounded-xl"},(S==null?void 0:S.id)??(f?"draft":"none")),S&&!F&&W.length>0&&E.jsx(LG,{queued:W,onEdit:(Z,ue)=>void ln.getState().editQueuedMessage(S.id,Z,ue),onWithdraw:Z=>void ln.getState().withdrawQueuedMessage(S.id,Z),onSteer:H}),U&&E.jsxs("div",{className:G?"flex min-h-0 flex-1 flex-col justify-center":"contents",children:[G&&E.jsxs("div",{className:"flex flex-col items-center gap-2 px-6 pb-6 text-center",children:[E.jsx(pA,{className:"text-muted-foreground size-9"}),E.jsx("h3",{className:"text-sm font-medium",children:e("agent.welcome.title")}),E.jsx("p",{className:"text-muted-foreground text-xs",children:e("agent.welcome.subtitle")})]}),E.jsx(jG,{disabled:le,running:!!L,steerable:!!S,onSend:_,onSteer:z,onStop:()=>{S&&ln.getState().stopSession(S.id)},modelPicker:E.jsx(PG,{providerId:K,modelId:P,onChange:B,disabled:L}),writeModeControl:E.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[E.jsx("span",{className:"text-muted-foreground text-xs",children:e(I==="auto"?"agent.writeMode.auto":"agent.writeMode.confirm")}),E.jsx(mp,{"data-testid":"agent-write-mode-switch",checked:I==="auto",disabled:!!S&&F,onCheckedChange:Z=>{const ue=Z?"auto":"confirm";ln.getState().setDefaultWriteMode(ue),S&&ln.getState().setWriteMode(S.id,ue)}})]})})]})]})}function FG(){const{t:e}=Sn();return E.jsxs("div",{"data-testid":"files-tab",className:"text-muted-foreground flex h-full flex-col items-center justify-center gap-2 px-4 text-center",children:[E.jsx(KF,{className:"size-8 opacity-50"}),E.jsx("span",{className:"text-sm",children:e("agent.files.comingSoon")})]})}const zb=768;function BG(){const[e,t]=v.useState(void 0);return v.useEffect(()=>{const n=window.matchMedia(`(max-width: ${zb-1}px)`),r=()=>{t(window.innerWidth<zb)};return n.addEventListener("change",r),t(window.innerWidth<zb),()=>n.removeEventListener("change",r)},[]),!!e}const HG=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:S,validityData:R,setFocused:k,setFilled:M,validationMode:D,validation:A}=Ac(),O=C||f,L=w??l,V={...g,disabled:O},{labelId:F}=em(),W=tm({id:o});Ve(()=>{var H;const z=c!=null;(H=A.inputRef.current)!=null&&H.value||z&&c!==""?M(!0):z&&c===""&&M(!1)},[A.inputRef,M,c]);const j=v.useRef(null);Ve(()=>{h&&j.current===ti(Qt(j.current))&&k(!0)},[h,k]);const[q]=yc({controlled:c,default:m,name:"FieldControl",state:"value"}),$=c!==void 0,B=$?q:void 0;return Zx({id:W,name:L,commit:A.commit,value:B,getValue:()=>{var z;return(z=A.inputRef.current)==null?void 0:z.value},controlRef:A.inputRef}),Dt("input",t,{ref:[n,j],state:V,props:[{id:W,disabled:O,name:L,ref:A.inputRef,"aria-labelledby":F,autoFocus:h,...$?{value:B}:{defaultValue:m},onChange(z){const H=z.currentTarget.value;d==null||d(H,vt(zi,z.nativeEvent)),S(H!==R.initialValue),M(H!=="")},onFocus(){k(!0)},onBlur(z){T(!0),k(!1),D==="onBlur"&&A.commit(z.currentTarget.value)},onKeyDown(z){z.currentTarget.tagName==="INPUT"&&z.key==="Enter"&&(T(!0),A.commit(z.currentTarget.value))}},A.getInputValidationProps(),y],stateAttributesMapping:Xx})}),UG=v.forwardRef(function(t,n){return E.jsx(HG,{ref:n,...t})});function Ii({className:e,type:t,...n}){return E.jsx(UG,{type:t,"data-slot":"input",className:je("dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 disabled:bg-input/50 dark:disabled:bg-input/80 h-8 rounded-lg border bg-transparent px-2.5 py-1 text-base transition-colors file:h-6 file:text-sm file:font-medium focus-visible:ring-2 aria-invalid:ring-2 md:text-sm file:text-foreground placeholder:text-muted-foreground w-full min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",e),...n})}function VG({className:e,orientation:t="horizontal",...n}){return E.jsx(TD,{"data-slot":"separator",orientation:t,className:je("bg-border shrink-0 data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",e),...n})}const Ww=v.createContext(void 0);function Zo(e){const t=v.useContext(Ww);if(e===!1&&t===void 0)throw new Error(Cn(27));return t}const qG={...da,...Ya},Kw=v.forwardRef(function(t,n){const{render:r,className:a,forceRender:o=!1,...l}=t,{store:c}=Zo(),f=c.useState("open"),d=c.useState("nested"),m=c.useState("mounted"),h=c.useState("transitionStatus");return Dt("div",t,{state:{open:f,transitionStatus:h},ref:[c.context.backdropRef,n],stateAttributesMapping:qG,props:[{role:"presentation",hidden:!m,style:{userSelect:"none",WebkitUserSelect:"none"}},l],enabled:o||!d})}),Sm=v.forwardRef(function(t,n){const{render:r,className:a,disabled:o=!1,nativeButton:l=!0,...c}=t,{store:f}=Zo(),d=f.useState("open");function m(w){d&&f.setOpen(!1,vt(xU,w.nativeEvent))}const{getButtonProps:h,buttonRef:y}=qa({disabled:o,native:l});return Dt("button",t,{state:{disabled:o},ref:[n,y],props:[{onClick:m},c,h]})}),Gw=v.forwardRef(function(t,n){const{render:r,className:a,id:o,...l}=t,{store:c}=Zo(),f=Hi(o);return c.useSyncedValueWithCleanup("descriptionElementId",f),Dt("p",t,{ref:n,props:[{id:f},l]})});let $G=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),YG=(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 RD=v.createContext(void 0);function WG(){const e=v.useContext(RD);if(e===void 0)throw new Error(Cn(26));return e}const KG={...da,...Ya,nestedDialogOpen(e){return e?{[YG.nestedDialogOpen]:""}:null}},Xw=v.forwardRef(function(t,n){const{className:r,finalFocus:a,initialFocus:o,render:l,...c}=t,{store:f}=Zo(),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"),S=f.useState("open"),R=f.useState("openMethod"),k=f.useState("titleElementId"),M=f.useState("transitionStatus"),D=f.useState("role");WG(),Wa({open:S,ref:f.context.popupRef,onComplete(){var W,j;S&&((j=(W=f.context).onOpenChangeComplete)==null||j.call(W,!0))}});function A(W){return W==="touch"?f.context.popupRef.current:!0}const O=o===void 0?A:o,L=T>0,F=Dt("div",t,{state:{open:S,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){qw.has(W.key)&&W.stopPropagation()},style:{[$G.nestedDialogs]:T}},c],ref:[n,f.context.popupRef,f.useStateSetter("popupElement")],stateAttributesMapping:KG});return E.jsx(Aw,{context:h,openInteractionType:R,disabled:!w,closeOnFocusOut:!m,initialFocus:O,returnFocus:a,modal:g!==!1,restoreFocus:"popup",children:F})}),Qw=v.forwardRef(function(t,n){const{keepMounted:r=!1,...a}=t,{store:o}=Zo(),l=o.useState("mounted"),c=o.useState("modal"),f=o.useState("open");return l||r?E.jsx(RD.Provider,{value:r,children:E.jsxs(kw,{ref:n,...a,children:[l&&c===!0&&E.jsx(Vw,{ref:o.context.internalBackdropRef,inert:Fw(!f)}),t.children]})}):null});function kD(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}=zw(a);Dw(t);const{forceUnmount:h}=Iw(a,t,()=>{m()}),y=Ye(F=>{const W=vt(F);return W.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},W}),g=v.useCallback(()=>{t.setOpen(!1,y(Jx))},[t,y]);v.useImperativeHandle(r,()=>({unmount:h,close:g}),[h,g]);const w=jw({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[C,T]=v.useState(0),S=C===0,R=tD(w),k=vm(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(S&&!o){const j=W;return l&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===j||t.context.backdropRef.current===j||Nt(j,c)&&!(j!=null&&j.hasAttribute("data-base-ui-portal")):!0}return!1},escapeKey:S});Bw(a&&l===!0,c);const{getReferenceProps:M,getFloatingProps:D,getTriggerProps:A}=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 O=v.useMemo(()=>M(d),[M,d]),L=v.useMemo(()=>A(d),[A,d]),V=v.useMemo(()=>D(),[D]);t.useSyncedValues({openMethod:f,activeTriggerProps:O,inactiveTriggerProps:L,popupProps:V,floatingRootContext:w,nestedOpenDialogCount:C})}const GG={...Lw,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 MD extends mm{constructor(n){super(XG(n),{popupRef:v.createRef(),backdropRef:v.createRef(),internalBackdropRef:v.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new Wd,onOpenChange:void 0,onOpenChangeComplete:void 0},GG);st(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 XG(e={}){return{...Pw(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...e}}function AD(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=Zo(!0),g=!!y,w=nr(()=>(d==null?void 0:d.store)??new MD({open:r,openProp:n,activeTriggerId:h,triggerIdProp:m,modal:c,disablePointerDismissal:l,nested:g})).current;pm(()=>{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");kD({store:w,actionsRef:f,parentContext:y==null?void 0:y.store.context});const T=v.useMemo(()=>({store:w}),[w]);return E.jsx(Ww.Provider,{value:T,children:typeof t=="function"?t({payload:C}):t})}const Zw=v.forwardRef(function(t,n){const{render:r,className:a,id:o,...l}=t,{store:c}=Zo(),f=Hi(o);return c.useSyncedValueWithCleanup("titleElementId",f),Dt("h2",t,{ref:n,props:[{id:f},l]})});function QG({...e}){return E.jsx(AD,{"data-slot":"sheet",...e})}function ZG({...e}){return E.jsx(Qw,{"data-slot":"sheet-portal",...e})}function JG({className:e,...t}){return E.jsx(Kw,{"data-slot":"sheet-overlay",className:je("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 eX="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 tX({className:e,children:t,side:n="right",showCloseButton:r=!0,animation:a="slide",...o}){return E.jsxs(ZG,{children:[E.jsx(JG,{}),E.jsxs(Xw,{"data-slot":"sheet-content","data-side":n,className:je("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"&&eX,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&&E.jsxs(Sm,{"data-slot":"sheet-close",render:E.jsx(qt,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm"}),children:[E.jsx(Ua,{}),E.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function nX({className:e,...t}){return E.jsx("div",{"data-slot":"sheet-header",className:je("gap-0.5 p-4 flex flex-col",e),...t})}function rX({className:e,...t}){return E.jsx(Zw,{"data-slot":"sheet-title",className:je("text-foreground text-base font-medium",e),...t})}function iX({className:e,...t}){return E.jsx(Gw,{"data-slot":"sheet-description",className:je("text-muted-foreground text-sm",e),...t})}const OD=v.createContext(void 0);function Qd(e){const t=v.useContext(OD);if(t===void 0&&!e)throw new Error(Cn(72));return t}const aX={...Lw,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 Jw extends mm{constructor(n){super({...oX(),...n},{popupRef:v.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new Wd},aX);st(this,"setOpen",(n,r)=>{var d,m;const a=r.reason,o=a===vr,l=n&&a===Yl,c=!n&&(a===qs||a===rm);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 Jw(r)).current,o=n??a,l=jw({popupStore:o,onOpenChange:o.setOpen});return o.state.floatingRootContext=l,o}}function oX(){return{...Pw(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeDelay:0,hasViewport:!1}}const sX=xw(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=Jw.useStore(m==null?void 0:m.store,{open:r,openProp:a,activeTriggerId:y,triggerIdProp:h});pm(()=>{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,S=w.useState("activeTriggerId"),R=w.useState("payload");w.useSyncedValues({trackCursorAxis:l,disableHoverablePopup:o}),Ve(()=>{C&&n&&w.setOpen(!1,vt(wU))},[C,n,w]),w.useSyncedValue("disabled",n),Dw(w);const{forceUnmount:k,transitionStatus:M}=Iw(T,w),D=w.useState("isInstantPhase"),A=w.useState("instantType"),O=w.useState("lastOpenChangeReason"),L=v.useRef(null);Ve(()=>{M==="ending"&&O===zi||M!=="ending"&&D?(A!=="delay"&&(L.current=A),w.set("instantType","delay")):L.current!==null&&(w.set("instantType",L.current),L.current=null)},[M,D,O,A,w]),Ve(()=>{T&&S==null&&w.set("payload",void 0)},[w,S,T]);const V=v.useCallback(()=>{w.setOpen(!1,lX(w,Jx))},[w]);v.useImperativeHandle(c,()=>({unmount:k,close:V}),[k,V]);const F=w.useState("floatingRootContext"),W=vm(F,{enabled:!n,referencePress:!0}),j=gW(F,{enabled:!n&&l!=="none",axis:l==="none"?void 0:l}),{getReferenceProps:q,getFloatingProps:$,getTriggerProps:B}=Kd([W,j]),_=v.useMemo(()=>q(),[q]),z=v.useMemo(()=>B(),[B]),H=v.useMemo(()=>$(),[$]);return w.useSyncedValues({activeTriggerProps:_,inactiveTriggerProps:z,popupProps:H}),E.jsx(OD.Provider,{value:w,children:typeof g=="function"?g({payload:R}):g})});function lX(e,t){const n=vt(t);return n.preventUnmountOnClose=()=>{e.set("preventUnmountingOnClose",!0)},n}const cX=v.createContext(void 0);function uX(){return v.useContext(cX)}let dX=(function(e){return e[e.popupOpen=Op.popupOpen]="popupOpen",e.triggerDisabled="data-trigger-disabled",e})({});const fX=600,hX=rN(function(t,n){const{className:r,render:a,handle:o,payload:l,disabled:c,delay:f,closeDelay:d,id:m,...h}=t,y=Qd(!0),g=(o==null?void 0:o.store)??y;if(!g)throw new Error(Cn(82));const w=Hi(m),C=g.useState("isTriggerActive",w),T=g.useState("isOpenedByTrigger",w),S=g.useState("floatingRootContext"),R=v.useRef(null),k=f??fX,M=d??0,{registerTrigger:D,isMountedByThisTrigger:A}=KN(w,R,g,{payload:l,closeDelay:M}),O=uX(),{delayRef:L,isInstantPhase:V,hasProvider:F}=oW(S,{open:T});g.useSyncedValue("isInstantPhase",V);const W=g.useState("disabled"),j=c??W,q=g.useState("trackCursorAxis"),$=g.useState("disableHoverablePopup"),B=JN(S,{enabled:!j,mouseOnly:!0,move:!1,handleClose:!$&&q!=="both"?rD():null,restMs(){const P=O==null?void 0:O.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}),_=XN(S,{enabled:!j}).reference,z={open:T},H=g.useState("triggerProps",A);return Dt("button",t,{state:z,ref:[n,D,R],props:[B,_,H,{id:w,[dX.triggerDisabled]:j?"":void 0},h],stateAttributesMapping:cD})}),ND=v.createContext(void 0);function pX(){const e=v.useContext(ND);if(e===void 0)throw new Error(Cn(70));return e}const mX=v.forwardRef(function(t,n){const{children:r,container:a,className:o,render:l,...c}=t,{portalNode:f,portalSubtree:d}=zN({container:a,ref:n,componentProps:t,elementProps:c});return!d&&!f?null:E.jsxs(v.Fragment,{children:[d,f&&pr.createPortal(r,f)]})}),gX=v.forwardRef(function(t,n){const{keepMounted:r=!1,...a}=t;return Qd().useState("mounted")||r?E.jsx(ND.Provider,{value:r,children:E.jsx(mX,{ref:n,...a})}):null}),DD=v.createContext(void 0);function ID(){const e=v.useContext(DD);if(e===void 0)throw new Error(Cn(71));return e}const yX=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=CA,...S}=t,R=Qd(),k=pX(),M=R.useState("open"),D=R.useState("mounted"),A=R.useState("trackCursorAxis"),O=R.useState("disableHoverablePopup"),L=R.useState("floatingRootContext"),V=R.useState("instantType"),F=R.useState("transitionStatus"),W=R.useState("hasViewport"),j=Hw({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?tG:void 0}),q=v.useMemo(()=>{const z={};return(!M||A==="both"||O)&&(z.pointerEvents="none"),{role:"presentation",hidden:!D,style:{...j.positionerStyles,...z}}},[M,A,O,D,j.positionerStyles]),$=v.useMemo(()=>({open:M,side:j.side,align:j.align,anchorHidden:j.anchorHidden,instant:A!=="none"?"tracking-cursor":V}),[M,j.side,j.align,j.anchorHidden,A,V]),B=v.useMemo(()=>({...$,arrowRef:j.arrowRef,arrowStyles:j.arrowStyles,arrowUncentered:j.arrowUncentered}),[$,j.arrowRef,j.arrowStyles,j.arrowUncentered]),_=Dt("div",t,{state:$,props:[q,Lc(F),S],ref:[n,R.useStateSetter("positionerElement")],stateAttributesMapping:da});return E.jsx(DD.Provider,{value:B,children:_})}),bX={...da,...Ya},vX=v.forwardRef(function(t,n){const{className:r,render:a,...o}=t,l=Qd(),{side:c,align:f}=ID(),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 ZN(g,{enabled:!w,closeDelay:C}),Dt("div",t,{state:{open:d,side:c,align:f,instant:m,transitionStatus:h},ref:[n,l.context.popupRef,l.useStateSetter("popupElement")],props:[y,Lc(h),o],stateAttributesMapping:bX})}),xX=v.forwardRef(function(t,n){const{className:r,render:a,...o}=t,c=Qd().useState("instantType"),{open:f,arrowRef:d,side:m,align:h,arrowUncentered:y,arrowStyles:g}=ID();return Dt("div",t,{state:{open:f,side:m,align:h,uncentered:y,instant:c},ref:[n,d],props:[{style:g,"aria-hidden":!0},o],stateAttributesMapping:da})});function wX({...e}){return E.jsx(sX,{"data-slot":"tooltip",...e})}function SX({...e}){return E.jsx(hX,{"data-slot":"tooltip-trigger",...e})}function EX({className:e,side:t="top",sideOffset:n=4,align:r="center",alignOffset:a=0,children:o,...l}){return E.jsx(gX,{children:E.jsx(yX,{align:r,alignOffset:a,side:t,sideOffset:n,className:"isolate z-50",children:E.jsxs(vX,{"data-slot":"tooltip-content",className:je("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,E.jsx(xX,{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 CX="sidebar_state",TX=3600*24*7,Fb="100vw",RX="3rem",kX="b",Vu=320,Dp=320,MX=450,Bb="tmex_sidebar_width";function AX(){const e=typeof window>"u"?Number.POSITIVE_INFINITY:window.innerWidth;return Math.max(Dp,e-MX)}function Bh(e){return Math.min(AX(),Math.max(Dp,Math.round(e)))}const PD=v.createContext(null);function Ti(){const e=v.useContext(PD);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function OX({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:a,children:o,...l}){const c=BG(),[f,d]=v.useState(!1),m=v.useRef(Vu),[h,y]=v.useState(()=>{if(typeof window>"u")return Vu;const L=Number(window.localStorage.getItem(Bb)),V=Number.isFinite(L)&&L>0?Math.max(Dp,Math.round(L)):Vu;return m.current=V,Bh(V)}),[g,w]=v.useState(!1),C=v.useCallback(L=>{const V=Math.max(Dp,Math.round(L));m.current=V,y(Bh(L)),window.localStorage.setItem(Bb,String(V))},[]),T=v.useCallback(()=>{m.current=Vu,y(Bh(Vu)),window.localStorage.removeItem(Bb)},[]);v.useEffect(()=>{const L=()=>{y(Bh(m.current))};return window.addEventListener("resize",L),()=>window.removeEventListener("resize",L)},[]);const[S,R]=v.useState(e),k=t??S,M=v.useCallback(L=>{const V=typeof L=="function"?L(k):L;n?n(V):R(V),document.cookie=`${CX}=${V}; path=/; max-age=${TX}`},[n,k]),D=v.useCallback(()=>c?d(L=>!L):M(L=>!L),[c,M,d]);v.useEffect(()=>{const L=V=>{V.defaultPrevented||V.target instanceof HTMLElement&&V.target.closest(".xterm")||V.key===kX&&(V.metaKey||V.ctrlKey)&&(V.preventDefault(),D())};return window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)},[D]);const A=k?"expanded":"collapsed",O=v.useMemo(()=>({state:A,open:k,setOpen:M,isMobile:c,openMobile:f,setOpenMobile:d,toggleSidebar:D,width:h,setWidth:C,resetWidth:T,isResizing:g,setIsResizing:w}),[A,k,M,c,f,d,D,h,C,T,g]);return E.jsx(PD.Provider,{value:O,children:E.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":`${h}px`,"--sidebar-width-icon":RX,...a},className:je("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",r),...l,children:o})})}function NX({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}=Ti();return n==="none"?E.jsx("div",{"data-slot":"sidebar",className:je("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",r),...l,children:a}):c?E.jsx(QG,{open:d,onOpenChange:m,...l,children:E.jsxs(tX,{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":Fb,width:Fb,maxWidth:Fb},side:e,animation:"top-down",children:[E.jsxs(nX,{className:"sr-only",children:[E.jsx(rX,{children:"Sidebar"}),E.jsx(iX,{children:"Displays the mobile sidebar."})]}),E.jsx("div",{className:"flex h-full w-full flex-col","data-testid":"sidebar",style:{paddingBottom:"var(--tmex-safe-area-bottom)"},children:a})]})}):E.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":f,"data-collapsible":f==="collapsed"?n:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[E.jsx("div",{"data-slot":"sidebar-gap",className:je(!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)")}),E.jsxs("div",{"data-slot":"sidebar-container","data-side":e,className:je(!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:[E.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner","data-testid":"sidebar",className:"bg-sidebar group-data-[variant=floating]:ring-sidebar-border group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 flex size-full flex-col",style:{paddingBottom:"var(--tmex-safe-area-bottom)"},children:a}),f==="expanded"&&E.jsx(DX,{side:e})]})]})}function DX({side:e}){const{width:t,setWidth:n,resetWidth:r,setIsResizing:a}=Ti(),o=v.useRef(null);return E.jsx("div",{"data-slot":"sidebar-resizer","data-testid":"sidebar-resizer","aria-hidden":"true",className:je("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 IX({className:e,onClick:t,...n}){const{toggleSidebar:r,isMobile:a}=Ti();return E.jsxs(qt,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon-sm",className:je(e),onClick:o=>{t==null||t(o),r()},...n,children:[a?E.jsx(aB,{}):E.jsx(uB,{}),E.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function PX({className:e,...t}){return E.jsx("main",{"data-slot":"sidebar-inset",className:je("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 LX({className:e,...t}){return E.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:je("gap-2 p-2 flex flex-col",e),...t})}function jX({className:e,...t}){return E.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:je("gap-2 p-2 flex flex-col",e),...t})}function _X({className:e,...t}){return E.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:je("no-scrollbar gap-0 flex min-h-0 flex-1 flex-col overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function LD({className:e,...t}){return E.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:je("p-2 relative flex w-full min-w-0 flex-col",e),...t})}function zX({className:e,...t}){return E.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:je("gap-0 flex w-full min-w-0 flex-col",e),...t})}function FX({className:e,...t}){return E.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:je("group/menu-item relative",e),...t})}const BX=Zp("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 HX({render:e,isActive:t=!1,variant:n="default",size:r="default",tooltip:a,className:o,...l}){const{isMobile:c,state:f}=Ti(),d=hm({defaultTagName:"button",props:Ei({className:je(BX({variant:n,size:r}),o)},l),render:a?SX:e,state:{slot:"sidebar-menu-button",sidebar:"menu-button",size:r,active:t}});return a?(typeof a=="string"&&(a={children:a}),E.jsxs(wX,{children:[d,E.jsx(EX,{side:"right",align:"center",hidden:f!=="collapsed"||c,...a})]})):d}function UX({className:e,render:t,showOnHover:n=!1,...r}){return hm({defaultTagName:"button",props:Ei({className:je("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 VX({className:e,...t}){return E.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:je("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 qX({className:e,...t}){return E.jsx("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:je("group/menu-sub-item relative",e),...t})}function $X({render:e,size:t="md",isActive:n=!1,className:r,...a}){return hm({defaultTagName:"a",props:Ei({className:je("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground h-7 gap-2 rounded-md px-2 focus-visible:ring-2 data-[size=md]:text-sm data-[size=sm]:text-xs [&>svg]:size-4 flex min-w-0 -translate-x-px items-center overflow-hidden outline-hidden group-data-[collapsible=icon]:hidden disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:shrink-0",r)},a),render:e,state:{slot:"sidebar-menu-sub-button",sidebar:"menu-sub-button",size:t,active:n}})}const jD=v.createContext(void 0);function _D(){const e=v.useContext(jD);if(e===void 0)throw new Error(Cn(64));return e}let YX=(function(e){return e.activationDirection="data-activation-direction",e.orientation="data-orientation",e})({});const zD={tabActivationDirection:e=>({[YX.activationDirection]:e})},WX=v.forwardRef(function(t,n){const{className:r,defaultValue:a=0,onValueChange:o,orientation:l="horizontal",render:c,value:f,...d}=t,m=Pc(),h=Object.hasOwn(t,"defaultValue"),y=v.useRef([]),[g,w]=v.useState(()=>new Map),[C,T]=yc({controlled:f,default:a,name:"Tabs",state:"value"}),S=f!==void 0,[R,k]=v.useState(()=>new Map),[M,D]=v.useState("none"),A=Ye((z,H)=>{o==null||o(z,H),!H.isCanceled&&(T(z),D(H.activationDirection))}),O=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})}),V=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]),j=v.useMemo(()=>({direction:m,getTabElementBySelectedValue:W,getTabIdByPanelValue:F,getTabPanelIdByValue:V,onValueChange:A,orientation:l,registerMountedTabPanel:O,setTabMap:k,unregisterMountedTabPanel:L,tabActivationDirection:M,value:C}),[m,W,F,V,A,l,O,k,L,M,C]),q=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]);Ve(()=>{if(S||R.size===0)return;const z=q==null?void 0:q.disabled,H=q==null&&C!==null;if(h&&z&&C===a||!z&&!H)return;const P=$??null;C!==P&&(T(P),D("none"))},[a,$,h,S,q,D,T,R,C]);const _=Dt("div",t,{state:{orientation:l,tabActivationDirection:M},ref:n,props:d,stateAttributesMapping:zD});return E.jsx(jD.Provider,{value:j,children:E.jsx(wm,{elementsRef:y,children:_})})}),FD="data-composite-item-active";function BD(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=Wx(),{ref:a,index:o}=$w(e),l=n===o,c=v.useRef(null),f=_i(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 HD=v.createContext(void 0);function KX(){const e=v.useContext(HD);if(e===void 0)throw new Error(Cn(65));return e}const GX=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}=_D(),{activateOnFocus:g,highlightedTabIndex:w,onTabActivation:C,setHighlightedTabIndex:T,tabsListElement:S}=KX(),R=Hi(c),k=v.useMemo(()=>({disabled:a,id:R,value:l}),[a,R,l]),{compositeProps:M,compositeRef:D,index:A}=BD({metadata:k}),O=l===m,L=v.useRef(!1);Ve(()=>{if(L.current){L.current=!1;return}if(!(O&&A>-1&&w!==A))return;const K=S;if(K!=null){const P=ti(Qt(K));if(P&&Nt(K,P))return}a||T(A)},[O,A,w,T,a,S]);const{getButtonProps:V,buttonRef:F}=qa({disabled:a,native:f,focusableWhenDisabled:!0}),W=h(l),j=v.useRef(!1),q=v.useRef(!1);function $(K){O||a||C(l,vt(zi,K.nativeEvent,void 0,{activationDirection:"none"}))}function B(K){O||(A>-1&&!a&&T(A),!a&&g&&(!j.current||j.current&&q.current)&&C(l,vt(zi,K.nativeEvent,void 0,{activationDirection:"none"})))}function _(K){if(O||a)return;j.current=!0;function P(){j.current=!1,q.current=!1}(!K.button||K.button===0)&&(q.current=!0,Qt(K.currentTarget).addEventListener("pointerup",P,{once:!0}))}return Dt("button",t,{state:{disabled:a,active:O,orientation:y},ref:[n,F,D],props:[M,{role:"tab","aria-controls":W,"aria-selected":O,id:R,onClick:$,onFocus:B,onPointerDown:_,[FD]:O?"":void 0,onKeyDownCapture(){L.current=!0}},d,V]})});function XX(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}const QX=[];function ZX(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=QX}=e,[w,C]=v.useState(0),T=n>1,S=v.useRef(null),R=_i(S,d),k=v.useRef([]),M=v.useRef(!1),D=c??w,A=Ye((V,F=!1)=>{if((f??C)(V),F){const W=k.current[V];gk(S.current,W,l,o)}}),O=Ye(V=>{if(V.size===0||M.current)return;M.current=!0;const F=Array.from(V.keys()),W=F.find(q=>q==null?void 0:q.hasAttribute(FD))??null,j=W?F.indexOf(W):-1;j!==-1&&A(j),gk(S.current,W,l,o)}),L=v.useMemo(()=>({"aria-orientation":o==="both"?void 0:o,ref:R,onFocus(V){!S.current||!mk(V.target)||V.target.setSelectionRange(0,V.target.value.length??0)},onKeyDown(V){const F=m?sG:vD;if(!F.has(V.key)||JX(V,g)||!S.current)return;const j=l==="rtl",q=j?Td:Jl,$={horizontal:q,vertical:ks,both:q}[o],B=j?Jl:Td,_={horizontal:B,vertical:Zl,both:B}[o];if(mk(V.target)&&!XX(V.target)){const I=V.target.selectionStart,Q=V.target.selectionEnd,le=V.target.value??"";if(I==null||V.shiftKey||I!==Q||V.key!==_&&I<le.length||V.key!==$&&I>0)return}let z=D;const H=ep(k,y),K=Kv(k,y);if(T){const I=t||Array.from({length:k.current.length},()=>({width:1,height:1})),Q=bN(I,n,a),le=Q.findIndex(Z=>Z!=null&&!Uo(k,Z,y)),ae=Q.reduce((Z,ue,ve)=>ue!=null&&!Uo(k,ue,y)?ve:Z,-1);z=Q[yN({current:Q.map(Z=>Z?k.current[Z]:null)},{event:V,orientation:o,loopFocus:r,cols:n,disabledIndices:xN([...y||k.current.map((Z,ue)=>Uo(k,ue)?ue:void 0),void 0],Q),minIndex:le,maxIndex:ae,prevIndex:vN(D>K?H:D,I,Q,n,V.key===ks?"bl":V.key===Jl?"tr":"tl"),rtl:j})]}const P={horizontal:[q],vertical:[ks],both:[q,ks]}[o],U={horizontal:[B],vertical:[Zl],both:[B,Zl]}[o],G=T?F:{horizontal:m?aG:yD,vertical:m?oG:bD,both:F}[o];m&&(V.key===Gd?z=H:V.key===Xd&&(z=K)),z===D&&(P.includes(V.key)||U.includes(V.key))&&(r&&z===K&&P.includes(V.key)?z=H:r&&z===H&&U.includes(V.key)?z=K:z=hr(k,{startingIndex:z,decrement:U.includes(V.key),disabledIndices:y})),z!==D&&!Kl(k,z)&&(h&&V.stopPropagation(),G.has(V.key)&&V.preventDefault(),A(z,!0),queueMicrotask(()=>{var I;(I=k.current[z])==null||I.focus()}))}}),[n,a,l,y,k,m,D,T,t,r,R,g,A,o,h]);return v.useMemo(()=>({props:L,highlightedIndex:D,onHighlightedIndexChange:A,elementsRef:k,disabledIndices:y,onMapChange:O,relayKeyboardEvent:L.onKeyDown}),[L,D,A,k,y,O])}function JX(e,t){for(const n of fG.values())if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function eQ(e){const{render:t,className:n,refs:r=qo,props:a=qo,state:o=Dn,stateAttributesMapping:l,highlightedIndex:c,onHighlightedIndexChange:f,orientation:d,dense:m,itemSizes:h,loopFocus:y,cols:g,enableHomeAndEndKeys:w,onMapChange:C,stopEventPropagation:T=!0,rootRef:S,disabledIndices:R,modifierKeys:k,highlightItemOnHover:M=!1,tag:D="div",...A}=e,O=Pc(),{props:L,highlightedIndex:V,onHighlightedIndexChange:F,elementsRef:W,onMapChange:j,relayKeyboardEvent:q}=ZX({itemSizes:h,cols:g,loopFocus:y,dense:m,orientation:d,highlightedIndex:c,onHighlightedIndexChange:f,rootRef:S,stopEventPropagation:T,enableHomeAndEndKeys:w,direction:O,disabledIndices:R,modifierKeys:k}),$=Dt(D,e,{state:o,ref:r,props:[L,...a,A],stateAttributesMapping:l}),B=v.useMemo(()=>({highlightedIndex:V,onHighlightedIndexChange:F,highlightItemOnHover:M,relayKeyboardEvent:q}),[V,F,M,q]);return E.jsx(xA.Provider,{value:B,children:E.jsx(wm,{elementsRef:W,onMapChange:_=>{C==null||C(_),j(_)},children:$})})}const tQ=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}=_D(),[w,C]=v.useState(0),[T,S]=v.useState(null),R=nQ(h,m,T,f),k=Ye((O,L)=>{if(O!==h){const V=R(O);L.activationDirection=V,d(O,L)}}),M={orientation:m,tabActivationDirection:g},D={"aria-orientation":m==="vertical"?"vertical":void 0,role:"tablist"},A=v.useMemo(()=>({activateOnFocus:r,highlightedTabIndex:w,onTabActivation:k,setHighlightedTabIndex:C,tabsListElement:T,value:h}),[r,w,k,C,T,h]);return E.jsx(HD.Provider,{value:A,children:E.jsx(eQ,{render:l,className:a,state:M,refs:[n,S],props:[D,c],stateAttributesMapping:zD,highlightedIndex:w,enableHomeAndEndKeys:!0,loopFocus:o,orientation:m,onHighlightedIndexChange:C,onMapChange:y,disabledIndices:qo})})});function Sk(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 nQ(e,t,n,r){const[a,o]=v.useState(null);return Ve(()=>{if(e==null||n==null){o(null);return}const l=r(e);if(l==null){o(null);return}const{left:c,top:f}=Sk(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}=Sk(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 rQ({className:e,orientation:t="horizontal",...n}){return E.jsx(WX,{"data-slot":"tabs","data-orientation":t,className:je("gap-2 group/tabs flex data-horizontal:flex-col",e),...n})}const iQ=Zp("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 aQ({className:e,variant:t="default",...n}){return E.jsx(tQ,{"data-slot":"tabs-list","data-variant":t,className:je(iQ({variant:t}),e),...n})}function Hb({className:e,...t}){return E.jsx(GX,{"data-slot":"tabs-trigger",className:je("gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg:not([class*='size-'])]:size-4 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center whitespace-nowrap transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent","data-active:bg-background dark:data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 data-active:text-foreground","after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",e),...t})}function Ip({children:e,onClick:t,...n}){const{isMobile:r,setOpenMobile:a}=Ti(),o=l=>{r&&a(!1),t==null||t(l)};return E.jsx(Fx,{...n,onClick:o,children:e})}function oQ({items:e}){const{t}=Sn();return E.jsx(LD,{children:E.jsx(zX,{children:e.map(n=>{var r,a;return E.jsxs(um,{defaultOpen:n.isActive,render:E.jsx(FX,{}),children:[E.jsx(Ip,{to:n.url,children:E.jsxs(HX,{tooltip:t(n.title),children:[E.jsx(n.icon,{}),E.jsx("span",{children:t(n.title)})]})}),(r=n.items)!=null&&r.length?E.jsxs(E.Fragment,{children:[E.jsxs(dm,{render:E.jsx(UX,{className:"data-[state=open]:rotate-90"}),children:[E.jsx($p,{}),E.jsx("span",{className:"sr-only",children:"Toggle"})]}),E.jsx(fm,{children:E.jsx(VX,{children:(a=n.items)==null?void 0:a.map(o=>E.jsx(qX,{children:E.jsx(Ip,{to:o.url,children:E.jsx($X,{children:E.jsx("span",{children:t(o.title)})})})},o.title))})})]}):null]},n.title)})})})}const sQ={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 lQ({deviceId:e,className:t}){const{t:n}=Sn(),r=qn(o=>o.deviceReconnecting[e]),a=qn(o=>o.deviceErrors[e]);if(r)return E.jsxs(Ks,{variant:"outline",title:r.message,className:je("h-5 gap-1 border-amber-400/40 bg-amber-500/10 px-1.5 text-[10px] font-normal text-amber-700 dark:text-amber-300",t),children:[E.jsx(SB,{className:"h-3 w-3 animate-spin"}),E.jsx("span",{className:"truncate max-w-[120px]",children:r.message})]});if(a){const o=sQ[a.type]??"unknown",l=n(`deviceStatus.errorBadge.${o}`),c=[l,a.message,a.rawMessage].filter(Boolean).join(`
395
- `);return E.jsxs(Ks,{variant:"outline",title:c,className:je("h-5 gap-1 border-red-400/40 bg-red-500/10 px-1.5 text-[10px] font-normal text-red-700 dark:text-red-300",t),children:[E.jsx(ed,{className:"h-3 w-3"}),E.jsx("span",{className:"truncate max-w-[120px]",children:l})]})}return null}function cQ(e){const{children:t,open:n,defaultOpen:r=!1,onOpenChange:a,onOpenChangeComplete:o,actionsRef:l,handle:c,triggerId:f,defaultTriggerId:d=null}=e,m=Zo(),h=!!m,y=nr(()=>(c==null?void 0:c.store)??new MD({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");kD({store:y,actionsRef:l,parentContext:m==null?void 0:m.store.context});const w=v.useMemo(()=>({store:y}),[y]);return E.jsx(Ww.Provider,{value:w,children:typeof t=="function"?t({payload:g}):t})}function tx({...e}){return E.jsx(cQ,{"data-slot":"alert-dialog",...e})}function uQ({...e}){return E.jsx(Qw,{"data-slot":"alert-dialog-portal",...e})}function dQ({className:e,...t}){return E.jsx(Kw,{"data-slot":"alert-dialog-overlay",className:je("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 nx({className:e,size:t="default",...n}){return E.jsxs(uQ,{children:[E.jsx(dQ,{}),E.jsx(Xw,{"data-slot":"alert-dialog-content","data-size":t,className:je("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 rx({className:e,...t}){return E.jsx("div",{"data-slot":"alert-dialog-header",className:je("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 ix({className:e,...t}){return E.jsx("div",{"data-slot":"alert-dialog-footer",className:je("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 Ek({className:e,...t}){return E.jsx("div",{"data-slot":"alert-dialog-media",className:je("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 ax({className:e,...t}){return E.jsx(Zw,{"data-slot":"alert-dialog-title",className:je("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 ox({className:e,...t}){return E.jsx(Gw,{"data-slot":"alert-dialog-description",className:je("text-muted-foreground *:[a]:hover:text-foreground text-sm text-balance md:text-pretty *:[a]:underline *:[a]:underline-offset-3",e),...t})}function sx({className:e,...t}){return E.jsx(qt,{"data-slot":"alert-dialog-action",className:je(e),...t})}function lx({className:e,variant:t="outline",size:n="default",...r}){return E.jsx(Sm,{"data-slot":"alert-dialog-cancel",className:je(e),render:E.jsx(qt,{variant:t,size:n}),...r})}function cx({...e}){return E.jsx(AD,{"data-slot":"dialog",...e})}function fQ({...e}){return E.jsx(Qw,{"data-slot":"dialog-portal",...e})}function hQ({className:e,...t}){return E.jsx(Kw,{"data-slot":"dialog-overlay",className:je("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 ux({className:e,children:t,showCloseButton:n=!0,...r}){return E.jsxs(fQ,{children:[E.jsx(hQ,{}),E.jsxs(Xw,{"data-slot":"dialog-content",className:je("bg-background data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 ring-foreground/10 grid max-w-[calc(100%-2rem)] gap-4 rounded-xl p-4 text-sm ring-1 duration-100 sm:max-w-sm fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none",e),...r,children:[t,n&&E.jsxs(Sm,{"data-slot":"dialog-close",render:E.jsx(qt,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm"}),children:[E.jsx(Ua,{}),E.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function dx({className:e,...t}){return E.jsx("div",{"data-slot":"dialog-header",className:je("gap-2 flex flex-col",e),...t})}function Ck({className:e,showCloseButton:t=!1,children:n,...r}){return E.jsxs("div",{"data-slot":"dialog-footer",className:je("bg-muted/50 -mx-4 -mb-4 rounded-b-xl border-t p-4 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...r,children:[n,t&&E.jsx(Sm,{render:E.jsx(qt,{variant:"outline"}),children:"Close"})]})}function fx({className:e,...t}){return E.jsx(Zw,{"data-slot":"dialog-title",className:je("text-base leading-none font-medium",e),...t})}function UD({className:e,...t}){return E.jsx(Gw,{"data-slot":"dialog-description",className:je("text-muted-foreground *:[a]:hover:text-foreground text-sm *:[a]:underline *:[a]:underline-offset-3",e),...t})}const VD=v.createContext(void 0);function qD(e){const t=v.useContext(VD);if(t===void 0&&!e)throw new Error(Cn(33));return t}const $D=v.createContext(void 0);function Jo(e){const t=v.useContext($D);if(t===void 0&&!e)throw new Error(Cn(36));return t}const pQ=v.createContext(void 0);function Zd(e=!0){const t=v.useContext(pQ);if(t===void 0&&!e)throw new Error(Cn(25));return t}const mQ={...da,...Ya},gQ=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=Zd(),y={open:c,transitionStatus:d};return Dt("div",t,{ref:h!=null&&h.backdropRef?[n,h.backdropRef]:n,state:y,stateAttributesMapping:mQ,props:[{role:"presentation",hidden:!f,style:{pointerEvents:m===vr?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},o]})});function yQ(e){const{closeOnClick:t,highlighted:n,id:r,nodeId:a,store:o,itemRef:l,itemMetadata:c}=e,{events:f}=o.useState("floatingTreeRoot"),d=Zd(!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:nd})},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 bQ={type:"regular-item"};function vQ(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}=qa({disabled:n,focusableWhenDisabled:!0,native:l}),y=yQ({closeOnClick:t,highlighted:r,id:a,nodeId:f,store:o,itemRef:d,itemMetadata:c}),g=v.useCallback(C=>Ei(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=_i(d,h);return v.useMemo(()=>({getItemProps:g,itemRef:w}),[g,w])}const xQ=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=$w({label:l}),y=qD(!0),g=Hi(o),{store:w}=Jo(),C=w.useState("isActive",h.index),T=w.useState("itemProps"),{getItemProps:S,itemRef:R}=vQ({closeOnClick:d,disabled:f,highlighted:C,id:g,store:w,nativeButton:c,nodeId:y==null?void 0:y.nodeId,itemMetadata:bQ});return Dt("div",t,{state:{disabled:f,highlighted:C},props:[T,m,S],ref:[R,n,h.ref]})}),wQ={...da,...Ya},SQ=v.forwardRef(function(t,n){const{render:r,className:a,finalFocus:o,...l}=t,{store:c}=Jo(),{side:f,align:d}=qD(),m=gD()!=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"),S=c.useState("parent"),R=c.useState("lastOpenChangeReason"),k=c.useState("rootId"),M=c.useState("floatingRootContext"),D=c.useState("floatingTreeRoot"),A=c.useState("closeDelay"),O=c.useState("activeTriggerElement"),L=S.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,vt(B.reason,B.domEvent))}return D.events.on("close",$),()=>{D.events.off("close",$)}},[D.events,c]);const V=c.useState("hoverEnabled"),F=c.useState("disabled");ZN(M,{enabled:V&&!F&&!L&&S.type!=="menubar",closeDelay:A});const W={transitionStatus:y,side:f,align:d,open:h,nested:S.type==="menu",instant:C},j=Dt("div",t,{state:W,ref:[n,c.context.popupRef],stateAttributesMapping:wQ,props:[g,{onKeyDown($){m&&qw.has($.key)&&$.stopPropagation()}},Lc(y),l,{"data-rootownerid":k}]});let q=S.type===void 0||L;return(T||S.type==="menubar"&&R!==nm)&&(q=!0),E.jsx(Aw,{context:M,modal:L,disabled:!w,returnFocus:o===void 0?q:o,initialFocus:S.type!=="menu",restoreFocus:!0,externalTree:S.type!=="menubar"?D:void 0,previousFocusableElement:O,nextFocusableElement:S.type===void 0?c.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:S.type===void 0?c.context.beforeContentFocusGuardRef:void 0,children:j})}),YD=v.createContext(void 0);function EQ(){const e=v.useContext(YD);if(e===void 0)throw new Error(Cn(32));return e}const CQ=v.forwardRef(function(t,n){const{keepMounted:r=!1,...a}=t,{store:o}=Jo();return o.useState("mounted")||r?E.jsx(YD.Provider,{value:r,children:E.jsx(kw,{ref:n,...a})}):null}),TQ=v.forwardRef(function(t,n){var Pe;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=EA,...S}=t,{store:R}=Jo(),k=EQ(),M=Zd(!0),D=R.useState("parent"),A=R.useState("floatingRootContext"),O=R.useState("floatingTreeRoot"),L=R.useState("mounted"),V=R.useState("open"),F=R.useState("modal"),W=R.useState("activeTriggerElement"),j=R.useState("transitionStatus"),q=R.useState("lastOpenChangeReason"),$=R.useState("floatingNodeId"),B=R.useState("floatingParentNodeId");let _=r,z=d,H=m,K=f,P=T;D.type==="context-menu"&&(_=r??((Pe=D.context)==null?void 0:Pe.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??CA):D.type==="menubar"&&(U=U??"bottom",G=G??"start");const I=D.type==="context-menu",Q=Hw({anchor:_,floatingRootContext:A,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:O}),le=v.useMemo(()=>{const te={};return V||(te.pointerEvents="none"),{role:"presentation",hidden:!L,style:{...Q.positionerStyles,...te}}},[V,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,vt(Zh)))}return O.events.on("menuopenchange",te),()=>{O.events.off("menuopenchange",te)}},[R,O.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??Zh;R.setOpen(!1,vt(ye))}return O.events.on("menuopenchange",te),()=>{O.events.off("menuopenchange",te)}},[O.events,R]),v.useEffect(()=>{function te(he){!V||he.nodeId!==R.select("floatingParentNodeId")||he.target&&W&&W!==he.target&&R.setOpen(!1,vt(Zh))}return O.events.on("itemhover",te),()=>{O.events.off("itemhover",te)}},[O.events,V,W,R]),v.useEffect(()=>{const te={open:V,nodeId:$,parentNodeId:B,reason:R.select("lastOpenChangeReason")};O.events.emit("menuopenchange",te)},[O.events,V,R,$,B]);const ae={open:V,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=Dt("div",t,{state:ae,stateAttributesMapping:da,ref:[n,R.useStateSetter("positionerElement")],props:[le,Lc(j),S]}),ve=L&&D.type!=="menu"&&(D.type!=="menubar"&&F&&q!==vr||D.type==="menubar"&&D.context.modal);let Se=null;return D.type==="menubar"?Se=D.context.contentElement:D.type===void 0&&(Se=W),E.jsxs(VD.Provider,{value:Z,children:[ve&&E.jsx(Vw,{ref:D.type==="context-menu"||D.type==="nested-context-menu"?D.context.internalBackdropRef:null,inert:Fw(!V),cutout:Se}),E.jsx(rW,{id:$,children:E.jsx(wm,{elementsRef:R.context.itemDomElements,labelsRef:R.context.itemLabels,children:ue})})]})}),RQ=v.createContext(null);function WD(e){return v.useContext(RQ)}const kQ={...Lw,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 e0 extends mm{constructor(n){super({...MQ(),...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},kQ);st(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 e0(r)).current;return n??a}}function MQ(){return{...Pw(),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 Rw,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Dn,keyboardEventRelay:void 0,closeDelay:0}}const AQ=v.createContext(void 0);function OQ(){return v.useContext(AQ)}const NQ=xw(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,S=Zd(!0),R=Jo(!0),k=WD(!0),M=OQ(),D=v.useMemo(()=>M&&R?{type:"menu",store:R.store}:k?{type:"menubar",context:k}:S&&!R?{type:"context-menu",context:S}:{type:void 0},[S,R,k,M]),A=e0.useStore(g==null?void 0:g.store,{open:l,openProp:r,activeTriggerId:C,triggerIdProp:w,parent:D});pm(()=>{r===void 0&&A.state.open===!1&&l===!0&&A.update({open:!0,activeTriggerId:C})}),A.useControlledProp("openProp",r),A.useControlledProp("triggerIdProp",w),A.useContextCallback("onOpenChangeComplete",o);const O=A.useState("floatingTreeRoot"),L=PN(O),V=Ka();Ve(()=>{S&&!R?A.update({parent:{type:"context-menu",context:S},floatingNodeId:L,floatingParentNodeId:V}):R&&A.update({floatingNodeId:L,floatingParentNodeId:V})},[S,R,L,V,A]);const F=A.useState("open"),W=A.useState("activeTriggerElement"),j=A.useState("positionerElement"),q=A.useState("hoverEnabled"),$=A.useState("modal"),B=A.useState("disabled"),_=A.useState("lastOpenChangeReason"),z=A.useState("parent"),H=A.useState("activeIndex"),K=A.useState("payload"),P=A.useState("floatingParentNodeId"),U=v.useRef(null),G=P!=null;let I;A.useSyncedValues({disabled:c,modal:z.type===void 0?f:void 0,rootId:Js()});const{openMethod:Q,triggerProps:le,reset:ae}=zw(F);Dw(A);const{forceUnmount:Z}=Iw(F,A,()=>{A.update({allowMouseEnter:!1,stickIfOpen:!0}),ae()}),ue=v.useRef(z.type!=="context-menu"),ve=Fn();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]),Bw(F&&$&&_!==vr&&Q!=="touch",j),Ve(()=>{!F&&!q&&A.set("hoverEnabled",!0)},[F,q,A]);const Se=v.useRef(!0),Pe=Fn(),te=Ye((ze,Ze)=>{var yt;const tt=Ze.reason;if(F===ze&&Ze.trigger===W&&_===tt||(Ze.preventUnmountOnClose=()=>{A.set("preventUnmountingOnClose",!0)},!ze&&Ze.trigger==null&&(Ze.trigger=W??void 0),a==null||a(ze,Ze),Ze.isCanceled))return;const Ct={open:ze,nativeEvent:Ze.event,reason:Ze.reason,nested:G};I==null||I.emit("openchange",Ct);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=A.context.itemDomElements.current[H];queueMicrotask(()=>{Ke==null||Ke.setAttribute("tabindex","-1")})}ze&&tt===Yl?(Se.current=!1,Pe.start(300,()=>{Se.current=!0})):(Se.current=!0,Pe.clear());const gt=(tt===qs||tt===nd)&&zt.detail===0&&(zt==null?void 0:zt.isTrusted),At=!ze&&(tt===rm||tt==null),it={open:ze,openChangeReason:tt};U.current=Ze.event??null;const ft=((yt=Ze.trigger)==null?void 0:yt.id)??null;(ft||ze)&&(it.activeTriggerId=ft,it.activeTriggerElement=Ze.trigger??null),A.update(it),z.type==="menubar"&&(tt===Yl||tt===$s||tt===vr||tt===Qh||tt===Zh)?A.set("instantType","group"):gt||At?A.set("instantType",gt?"click":"dismiss"):A.set("instantType",void 0)}),he=v.useCallback(ze=>{const Ze=vt(ze);return Ze.preventUnmountOnClose=()=>{A.set("preventUnmountingOnClose",!0)},Ze},[A]),ye=v.useCallback(()=>{A.setOpen(!1,he(Jx))},[A,he]);v.useImperativeHandle(h,()=>({unmount:Z,close:ye}),[Z,ye]);let Le;z.type==="context-menu"&&(Le=z.context),v.useImperativeHandle(Le==null?void 0:Le.positionerRef,()=>j,[j]),v.useImperativeHandle(Le==null?void 0:Le.actionsRef,()=>({setOpen:te}),[te]);const Ae=jw({popupStore:A,onOpenChange:te});I=Ae.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=vm(Ae,{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?O:void 0}),Re=tD(Ae,{role:"menu"}),J=Pc(),Ee=v.useCallback(ze=>{A.select("activeIndex")!==ze&&A.set("activeIndex",ze)},[A]),xe=eD(Ae,{enabled:!B,listRef:A.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:qo,onNavigate:Ee,openOnArrowKeyDown:z.type!=="context-menu",externalTree:G?O:void 0,focusItemOnHover:T}),Be=v.useCallback(ze=>{A.context.typingRef.current=ze},[A]),qe=nD(Ae,{listRef:A.context.itemLabels,activeIndex:H,resetMs:pH,onMatch:ze=>{F&&ze!==H&&A.set("activeIndex",ze)},onTypingChange:Be}),{getReferenceProps:De,getFloatingProps:ut,getItemProps:pe,getTriggerProps:Te}=Kd([Ce,Re,xe,qe]),ee=v.useMemo(()=>{const ze=Ei(De(),{onMouseMove(){A.set("allowMouseEnter",!0)}},le);return delete ze.role,ze},[De,A,le]),fe=v.useMemo(()=>{const ze=Te();if(!ze)return ze;const Ze=Ei(ze,le);return delete Ze.role,delete Ze["aria-controls"],Ze},[Te,le]),Oe=v.useMemo(()=>ut({onMouseMove(){A.set("allowMouseEnter",!0),z.type==="menu"&&A.set("hoverEnabled",!1)},onClick(){A.select("hoverEnabled")&&A.set("hoverEnabled",!1)},onKeyDown(ze){const Ze=A.select("keyboardEventRelay");Ze&&!ze.isPropagationStopped()&&Ze(ze)}}),[ut,z.type,A]),He=v.useMemo(()=>pe(),[pe]);A.useSyncedValues({floatingRootContext:Ae,activeTriggerProps:ee,inactiveTriggerProps:fe,popupProps:Oe,itemProps:He});const $e=v.useMemo(()=>({store:A,parent:D}),[A,D]),et=E.jsx($D.Provider,{value:$e,children:typeof n=="function"?n({payload:K}):n});return z.type===void 0||z.type==="context-menu"?E.jsx(iW,{externalTree:O,children:et}):et});function DQ(e){const{render:t,className:n,state:r=Dn,props:a=qo,refs:o=qo,metadata:l,stateAttributesMapping:c,tag:f="div",...d}=e,{compositeProps:m,compositeRef:h}=BD({metadata:l});return Dt(f,e,{state:r,ref:[...o,h],props:[m,...a,d],stateAttributesMapping:c})}function KD(e){if(kn(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid")??void 0;if(!ea(e))return KD(ia(e))}function IQ(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())}}:Dn,[t,n,r])}const Hh=2,PQ=rN(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=Hi(c),S=C.useState("isTriggerActive",T),R=C.useState("floatingRootContext"),k=C.useState("isOpenedByTrigger",T),M=v.useRef(null),D=jQ(),A=Wx(!0),O=Qo(),L=v.useMemo(()=>O??new Rw,[O]),V=PN(L),F=Ka(),{registerTrigger:W,isMountedByThisTrigger:j}=KN(T,M,C,{payload:y,closeDelay:m,parent:D,floatingTreeRoot:L,floatingNodeId:V,floatingParentNodeId:F,keyboardEventRelay:A==null?void 0:A.relayKeyboardEvent}),q=D.type==="menubar",$=C.useState("disabled"),B=o||$||q&&D.context.disabled,{getButtonProps:_,buttonRef:z}=qa({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=Fn(),P=Ye(Ce=>{if(!H.current)return;K.clear(),C.context.allowMouseUpTriggerRef.current=!1;const Re=Ce.target;if(Nt(H.current,Re)||Nt(C.select("positionerElement"),Re)||Re===H.current||Re!=null&&KD(Re)===C.select("rootId"))return;const J=uD(H.current);Ce.clientX>=J.left-Hh&&Ce.clientX<=J.right+Hh&&Ce.clientY>=J.top-Hh&&Ce.clientY<=J.bottom+Hh||L.events.emit("close",{domEvent:Ce,reason:VA})});v.useEffect(()=>{k&&C.select("lastOpenChangeReason")===vr&&Qt(H.current).addEventListener("mouseup",P,{once:!0})},[k,P,C]);const U=q&&D.context.hasSubmenuOpen,I=JN(R,{enabled:(f??U)&&!B&&D.type!=="context-menu"&&(!q||U&&!j),handleClose:rD({blockPointerEvents:!q}),mouseOnly:!0,move:!1,restMs:D.type===void 0?d:void 0,delay:{close:m},triggerElementRef:M,externalTree:L,isActiveTrigger:S}),Q=LQ(k,C.select("lastOpenChangeReason")),le=FN(R,{enabled:!B&&D.type!=="context-menu",event:k&&q?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:D.type===void 0?Q:!1}),ae=XN(R,{enabled:!B&&U}),Z=IQ({open:k,enabled:q,mouseDownAction:"open"}),ue=Kd([le,ae]),ve={disabled:B,open:k},Se=C.useState("triggerProps",j),Pe=[H,n,z,W,M],te=[ue.getReferenceProps(),I??Dn,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})}},q?{role:"menuitem"}:{},Z,g,_],he=v.useRef(null),ye=Ye(Ce=>{pr.flushSync(()=>{C.setOpen(!1,vt($s,Ce.nativeEvent,Ce.currentTarget))});const Re=tW(he.current);Re==null||Re.focus()}),Le=Ye(Ce=>{var J;const Re=C.select("positionerElement");if(Re&&Gl(Ce,Re))(J=C.context.beforeContentFocusGuardRef.current)==null||J.focus();else{pr.flushSync(()=>{C.setOpen(!1,vt($s,Ce.nativeEvent,Ce.currentTarget))});let Ee=eW(C.context.triggerFocusTargetRef.current||M.current);for(;Ee!==null&&Nt(Re,Ee);){const xe=Ee;if(Ee=Tw(Ee),Ee===xe)break}Ee==null||Ee.focus()}}),Ae=Dt("button",t,{enabled:!q,stateAttributesMapping:Jv,state:ve,ref:Pe,props:te});return q?E.jsx(DQ,{tag:"button",render:r,className:a,state:ve,refs:Pe,props:te,stateAttributesMapping:Jv}):k?E.jsxs(v.Fragment,{children:[E.jsx(Ec,{ref:he,onFocus:ye},`${T}-pre-focus-guard`),E.jsx(v.Fragment,{children:Ae},T),E.jsx(Ec,{ref:C.context.triggerFocusTargetRef,onFocus:Le},`${T}-post-focus-guard`)]}):E.jsx(v.Fragment,{children:Ae},T)});function LQ(e,t){const n=Fn(),[r,a]=v.useState(!1);return Ve(()=>{e&&t==="trigger-hover"?(a(!0),n.start(mH,()=>{a(!1)})):e||(n.clear(),a(!1))},[e,t,n]),r}function jQ(){const e=Zd(!0),t=Jo(!0),n=WD();return v.useMemo(()=>n?{type:"menubar",context:n}:e&&!t?{type:"context-menu",context:e}:{type:void 0},[e,t,n])}function t0({...e}){return E.jsx(NQ,{"data-slot":"dropdown-menu",...e})}function n0({...e}){return E.jsx(PQ,{"data-slot":"dropdown-menu-trigger",...e})}function r0({align:e="start",alignOffset:t=0,side:n="bottom",sideOffset:r=4,backdrop:a=!1,className:o,...l}){return E.jsxs(CQ,{children:[a&&E.jsx(gQ,{className:"fixed inset-0 z-50"}),E.jsx(TQ,{className:"isolate z-50 outline-none",align:e,alignOffset:t,side:n,sideOffset:r,children:E.jsx(SQ,{"data-slot":"dropdown-menu-content",className:je("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 ec({className:e,inset:t,variant:n="default",...r}){return E.jsx(xQ,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:je("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 Eee({className:e,...t}){return E.jsx(TD,{"data-slot":"dropdown-menu-separator",className:je("bg-border -mx-1 my-1 h-px",e),...t})}const GD=v.createContext(void 0);function Em(){const e=v.useContext(GD);if(e===void 0)throw new Error(Cn(53));return e}let Pp=(function(e){return e.scrollAreaCornerHeight="--scroll-area-corner-height",e.scrollAreaCornerWidth="--scroll-area-corner-width",e})({});const Uh=500,Tk=16;function wi(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 _Q=(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})({}),Fl=(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 i0={hasOverflowX:e=>e?{[Fl.hasOverflowX]:""}:null,hasOverflowY:e=>e?{[Fl.hasOverflowY]:""}:null,overflowXStart:e=>e?{[Fl.overflowXStart]:""}:null,overflowXEnd:e=>e?{[Fl.overflowXEnd]:""}:null,overflowYStart:e=>e?{[Fl.overflowYStart]:""}:null,overflowYEnd:e=>e?{[Fl.overflowYEnd]:""}:null,cornerHidden:()=>null},zQ={x:0,y:0},Rk={width:0,height:0},FQ={xStart:!1,xEnd:!1,yStart:!1,yEnd:!1},BQ={x:!1,y:!1,corner:!1},HQ=v.forwardRef(function(t,n){const{render:r,className:a,overflowEdgeThreshold:o,...l}=t,c=UQ(o),f=Hi(),d=Fn(),m=Fn(),{nonce:h,disableStyleElements:y}=xD(),[g,w]=v.useState(!1),[C,T]=v.useState(!1),[S,R]=v.useState(!1),[k,M]=v.useState(!1),[D,A]=v.useState(Rk),[O,L]=v.useState(Rk),[V,F]=v.useState(FQ),[W,j]=v.useState(BQ),q=v.useRef(null),$=v.useRef(null),B=v.useRef(null),_=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(zQ),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(Uh,()=>{R(!1)})),Re!==0&&(T(!0),m.start(Uh,()=>{T(!1)}))}),ue=Ye(Ce=>{Ce.button===0&&(P.current=!0,U.current=Ce.clientY,G.current=Ce.clientX,le.current=Ce.currentTarget.getAttribute(_Q.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,qe=$.current.clientWidth;if(z.current&&B.current&&le.current==="vertical"){const De=wi(B.current,"padding","y"),ut=wi(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(Uh,()=>{R(!1)})}if(H.current&&_.current&&le.current==="horizontal"){const De=wi(_.current,"padding","x"),ut=wi(H.current,"margin","x"),pe=H.current.offsetWidth,Te=_.current.offsetWidth-pe-De-ut,ee=J/Te;$.current.scrollLeft=Q.current+ee*(Be-qe),Ce.preventDefault(),T(!0),m.start(Uh,()=>{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 Pe(Ce){M(Ce.pointerType==="touch")}function te(Ce){if(Pe(Ce),Ce.pointerType!=="touch"){const Re=Nt(q.current,Ce.target);w(Re)}}const he=v.useMemo(()=>({scrolling:C||S,hasOverflowX:!W.x,hasOverflowY:!W.y,overflowXStart:V.xStart,overflowXEnd:V.xEnd,overflowYStart:V.yStart,overflowYEnd:V.yEnd,cornerHidden:W.corner}),[C,S,W.x,W.y,W.corner,V]),ye={role:"presentation",onPointerEnter:te,onPointerMove:te,onPointerDown:Pe,onPointerLeave(){w(!1)},style:{position:"relative",[Pp.scrollAreaCornerHeight]:`${D.height}px`,[Pp.scrollAreaCornerWidth]:`${D.width}px`}},Le=Dt("div",t,{state:he,ref:[n,q],props:[ye,l],stateAttributesMapping:i0}),Ae=v.useMemo(()=>({handlePointerDown:ue,handlePointerMove:ve,handlePointerUp:Se,handleScroll:Z,cornerSize:D,setCornerSize:A,thumbSize:O,setThumbSize:L,touchModality:k,cornerRef:K,scrollingX:C,setScrollingX:T,scrollingY:S,setScrollingY:R,hovering:g,setHovering:w,viewportRef:$,rootRef:q,scrollbarYRef:B,scrollbarXRef:_,thumbYRef:z,thumbXRef:H,rootId:f,hiddenState:W,setHiddenState:j,overflowEdges:V,setOverflowEdges:F,viewportState:he,overflowEdgeThreshold:c}),[ue,ve,Se,Z,D,O,k,C,T,S,R,g,w,f,W,V,he,c]);return E.jsxs(GD.Provider,{value:Ae,children:[!y&&Cd.getElement(h),Le]})});function UQ(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 VQ=v.createContext(void 0);function qQ(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 _o=(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 kk=1;function Mk(e,t){if(t<=0)return 0;const n=Ba(e,0,t),r=n,a=t-n,o=r<=kk,l=a<=kk;return o&&l?r<=a?0:t:o?0:l?t:n}let Ak=!1;function $Q(){Ak||gm||(typeof CSS<"u"&&"registerProperty"in CSS&&[_o.scrollAreaOverflowXStart,_o.scrollAreaOverflowXEnd,_o.scrollAreaOverflowYStart,_o.scrollAreaOverflowYEnd].forEach(e=>{try{CSS.registerProperty({name:e,syntax:"<length>",inherits:!1,initialValue:"0px"})}catch{}}),Ak=!0)}const YQ=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:S,handleScroll:R,setHovering:k,setOverflowEdges:M,overflowEdges:D,overflowEdgeThreshold:A,scrollingX:O,scrollingY:L}=Em(),V=Pc(),F=v.useRef(!0),W=Fn(),j=Fn(),q=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 Pe=Z>=le,te=ue>=ae,he=ue/ae,ye=Z/le,Le=Math.max(0,ae-ue),Ae=Math.max(0,le-Z);let Ce=0,Re=0;if(!te){let it=0;V==="rtl"?it=Ba(-Se,0,Le):it=Ba(Se,0,Le),Ce=Mk(it,Le),Re=Le-Ce}const J=Pe?0:Ba(ve,0,Ae),Ee=Pe?0:Mk(J,Ae),xe=Pe?0:Ae-Ee,Be=te?0:ue,qe=Pe?0:Z;let De=0,ut=0;!te&&!Pe&&(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=wi(U,"padding","x"),Oe=wi(P,"padding","y"),He=wi(I,"margin","x"),$e=wi(G,"margin","y"),et=Be-fe-He,ze=qe-Oe-$e,Ze=U?Math.min(U.offsetWidth-Te,et):et,tt=P?Math.min(P.offsetHeight-ee,ze):ze,Ct=Math.max(Tk,Ze*he),zt=Math.max(Tk,tt*ye);if(w(it=>it.height===zt&&it.width===Ct?it:{width:Ct,height:zt}),P&&G){const it=P.offsetHeight-zt-Oe-$e,ft=le-Z,yt=ft===0?0:ve/ft,Ke=Math.min(it,Math.max(0,yt*it));G.style.transform=`translate3d(0,${Ke}px,0)`}if(U&&I){const it=U.offsetWidth-Ct-fe-He,ft=ae-ue,yt=ft===0?0:Se/ft,Ke=V==="rtl"?Ba(yt*it,-it,0):Ba(yt*it,0,it);I.style.transform=`translate3d(${Ke}px,0,0)`}const gt=[[_o.scrollAreaOverflowXStart,Ce],[_o.scrollAreaOverflowXEnd,Re],[_o.scrollAreaOverflowYStart,Ee],[_o.scrollAreaOverflowYEnd,xe]];for(const[it,ft]of gt)K.style.setProperty(it,`${ft}px`);Q&&(te||Pe?g({width:0,height:0}):!te&&!Pe&&g({width:De,height:ut})),T(it=>{const ft=Pe||te;return it.y===Pe&&it.x===te&&it.corner===ft?it:{y:Pe,x:te,corner:ft}});const At={xStart:!te&&Ce>A.xStart,xEnd:!te&&Re>A.xEnd,yStart:!Pe&&Ee>A.yStart,yEnd:!Pe&&xe>A.yEnd};M(it=>it.xStart===At.xStart&&it.xEnd===At.xEnd&&it.yStart===At.yStart&&it.yEnd===At.yEnd?it:At)});Ve(()=>{if(!l.current)return;$Q();let K=!1;return qQ(l.current,()=>{if(!K){K=!0;return}q()})},[q,l]),Ve(()=>{queueMicrotask(q)},[q,S,V]),Ve(()=>{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}q()});return U.observe(K),j.start(0,()=>{const G=K.getAnimations({subtree:!0});G.length!==0&&Promise.allSettled(G.map(I=>I.finished)).then(q).catch(()=>{})}),()=>{U.disconnect(),j.clear()}},[q,l,j]);function $(){F.current=!1}const B={role:"presentation",...C&&{"data-id":`${C}-viewport`},...(!S.x||!S.y)&&{tabIndex:0},className:Cd.className,style:{overflow:"scroll"},onScroll(){l.current&&(q(),F.current||R({x:l.current.scrollLeft,y:l.current.scrollTop}),W.start(100,()=>{F.current=!0}))},onWheel:$,onTouchMove:$,onPointerMove:$,onPointerEnter:$,onKeyDown:$},_=v.useMemo(()=>({scrolling:O||L,hasOverflowX:!S.x,hasOverflowY:!S.y,overflowXStart:D.xStart,overflowXEnd:D.xEnd,overflowYStart:D.yStart,overflowYEnd:D.yEnd,cornerHidden:S.corner}),[O,L,S.x,S.y,S.corner,D]),z=Dt("div",t,{ref:[n,l],state:_,props:[B,o],stateAttributesMapping:i0}),H=v.useMemo(()=>({computeThumbPosition:q}),[q]);return E.jsx(VQ.Provider,{value:H,children:z})}),XD=v.createContext(void 0);function WQ(){const e=v.useContext(XD);if(e===void 0)throw new Error(Cn(54));return e}let Lp=(function(e){return e.scrollAreaThumbHeight="--scroll-area-thumb-height",e.scrollAreaThumbWidth="--scroll-area-thumb-width",e})({});const KQ=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:S,handlePointerDown:R,handlePointerUp:k,rootId:M,thumbSize:D}=Em(),A={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},O=Pc();v.useEffect(()=>{const q=C.current,$=o==="vertical"?g.current:w.current;if(!$)return;function B(_){if(!(!q||!$||_.ctrlKey)){if(_.preventDefault(),o==="vertical"){if(q.scrollTop===0&&_.deltaY<0)return}else if(q.scrollLeft===0&&_.deltaX<0)return;if(o==="vertical"){if(q.scrollTop===q.scrollHeight-q.clientHeight&&_.deltaY>0)return}else if(q.scrollLeft===q.scrollWidth-q.clientWidth&&_.deltaX>0)return;o==="vertical"?q.scrollTop+=_.deltaY:q.scrollLeft+=_.deltaX}}return $.addEventListener("wheel",B,{passive:!1}),()=>{$.removeEventListener("wheel",B)}},[o,w,g,C]);const L={...M&&{"data-id":`${M}-scrollbar`},onPointerDown(q){if(q.button===0&&q.currentTarget===q.target&&C.current){if(T.current&&g.current&&o==="vertical"){const $=wi(T.current,"margin","y"),B=wi(g.current,"padding","y"),_=T.current.offsetHeight,z=g.current.getBoundingClientRect(),H=q.clientY-z.top-_/2-B+$/2,K=C.current.scrollHeight,P=C.current.clientHeight,U=g.current.offsetHeight-_-B-$,I=H/U*(K-P);C.current.scrollTop=I}if(S.current&&w.current&&o==="horizontal"){const $=wi(S.current,"margin","x"),B=wi(w.current,"padding","x"),_=S.current.offsetWidth,z=w.current.getBoundingClientRect(),H=q.clientX-z.left-_/2-B+$/2,K=C.current.scrollWidth,P=C.current.clientWidth,U=w.current.offsetWidth-_-B-$,G=H/U;let I;O==="rtl"?(I=(1-G)*(K-P),C.current.scrollLeft<=0&&(I=-I)):I=G*(K-P),C.current.scrollLeft=I}R(q)}},onPointerUp:k,style:{position:"absolute",touchAction:"none",WebkitUserSelect:"none",userSelect:"none",...o==="vertical"&&{top:0,bottom:`var(${Pp.scrollAreaCornerHeight})`,insetInlineEnd:0,[Lp.scrollAreaThumbHeight]:`${D.height}px`},...o==="horizontal"&&{insetInlineStart:0,insetInlineEnd:`var(${Pp.scrollAreaCornerWidth})`,bottom:0,[Lp.scrollAreaThumbWidth]:`${D.width}px`}}},V=Dt("div",t,{ref:[n,o==="vertical"?g:w],state:A,props:[L,c],stateAttributesMapping:i0}),F=v.useMemo(()=>({orientation:o}),[o]),W=o==="vertical"?h.y:h.x;return l||!W?E.jsx(XD.Provider,{value:F,children:V}):null}),GQ=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}=Em(),{orientation:g}=WQ();return Dt("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(${Lp.scrollAreaThumbHeight})`},...g==="horizontal"&&{width:`var(${Lp.scrollAreaThumbWidth})`}}},o]})}),XQ=v.forwardRef(function(t,n){const{render:r,className:a,...o}=t,{cornerRef:l,cornerSize:c,hiddenState:f}=Em(),d=Dt("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 QQ({className:e,children:t,...n}){return E.jsxs(HQ,{"data-slot":"scroll-area",className:je("relative",e),...n,children:[E.jsx(YQ,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:t}),E.jsx(ZQ,{}),E.jsx(XQ,{})]})}function ZQ({className:e,orientation:t="vertical",...n}){return E.jsx(KQ,{"data-slot":"scroll-area-scrollbar","data-orientation":t,orientation:t,className:je("data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent flex touch-none p-px transition-colors select-none","[@media(any-pointer:coarse)]:hidden",e),...n,children:E.jsx(GQ,{"data-slot":"scroll-area-thumb",className:"rounded-full bg-border relative flex-1"})})}const JQ=(e,t)=>["watch-rules",e,t],QD=e=>["watch-rule-state",e];async function jc(e,t){try{return(await e.json()).error??t}catch{return t}}async function eZ(e,t){const n=new URLSearchParams({deviceId:e,paneId:t}),r=await fetch(`/api/watch/rules?${n}`);if(!r.ok)throw new Error(await jc(r,"Failed to load watch rules"));return(await r.json()).rules}async function tZ(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 jc(t,"Failed to create watch rule"));return await t.json()}async function ZD(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 jc(n,"Failed to update watch rule"));return await n.json()}async function nZ(e){const t=await fetch(`/api/watch/rules/${e}`,{method:"DELETE"});if(!t.ok)throw new Error(await jc(t,"Failed to delete watch rule"))}async function JD(e){const t=await fetch(`/api/watch/rules/${e}/state`);if(!t.ok)throw new Error(await jc(t,"Failed to load watch rule state"));return await t.json()}async function rZ(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 jc(t,"Failed to generate regex"));return await t.json()}const iZ=["match","unchanged","llm"],Ub="__default__";function Ok(e){return e==="llm"?30:5}function aZ({deviceId:e,paneId:t,rule:n,onSaved:r,onCancel:a}){var Re;const{t:o}=Sn(),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),[S,R]=v.useState((n==null?void 0:n.unchangedMinutes)??10),[k,M]=v.useState((n==null?void 0:n.noMatchBehavior)??"reset"),[D,A]=v.useState((n==null?void 0:n.conditionPrompt)??""),[O,L]=v.useState((n==null?void 0:n.providerId)??null),[V,F]=v.useState((n==null?void 0:n.modelId)??""),[W,j]=v.useState((n==null?void 0:n.confirmWithLlm)??!1),[q,$]=v.useState((n==null?void 0:n.summarizeWithLlm)??!1),[B,_]=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=Vo({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===O),ve=(ue==null?void 0:ue.models)??[],Se=d==="match"||d==="unchanged",Pe=d==="llm"||W||q,te=Ok(d),he=J=>{m(J);const Ee=Ok(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"&&(!S||S<=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},Le=pd({mutationFn:async()=>{const J={name:c.trim(),triggerType:d,pattern:Se?h:null,patternFlags:Se?g:"",extractGroup:C,conditionPrompt:d==="llm"?D:null,providerId:O,modelId:O&&V.trim()||null,confirmWithLlm:Se?W:!1,summarizeWithLlm:Se?q:!1,intervalSeconds:B,unchangedMinutes:d==="unchanged"?S:null,noMatchBehavior:k,fireMode:z,cooldownSeconds:K};if(n){const xe=J;return await ZD(n.id,xe),!1}const Ee={...J,deviceId:e,paneId:t,enabled:!0};return await tZ(Ee),!0},onSuccess:J=>{mn.success(o(J?"watch.toast.created":"watch.toast.updated")),r(J)},onError:J=>{mn.error(J instanceof Error?J.message:String(J))}}),Ae=pd({mutationFn:async()=>rZ({description:U.trim(),deviceId:e,paneId:t,providerId:O,modelId:O&&V.trim()||null}),onSuccess:J=>{y(J.pattern),w(J.flags),T(J.extractGroup),Q(J)},onError:J=>{mn.error(J instanceof Error?J.message:String(J))}}),Ce=()=>{const J=ye();if(J){mn.error(J);return}Le.mutate()};return E.jsxs("form",{"data-testid":"watch-rule-form",className:"space-y-4",onSubmit:J=>{J.preventDefault(),Ce()},children:[E.jsxs("div",{className:"space-y-2",children:[E.jsx("label",{className:"block text-sm font-medium",htmlFor:`${l}-name`,children:o("watch.form.name")}),E.jsx(Ii,{id:`${l}-name`,"data-testid":"watch-form-name",value:c,maxLength:120,onChange:J=>f(J.target.value),placeholder:o("watch.form.namePlaceholder")})]}),E.jsxs("div",{className:"space-y-2",children:[E.jsx("span",{className:"block text-sm font-medium",children:o("watch.form.triggerType")}),E.jsx("div",{className:"grid gap-2",children:iZ.map(J=>E.jsxs("button",{type:"button","data-testid":`watch-form-type-${J}`,onClick:()=>he(J),className:je("rounded-lg border px-3 py-2 text-left transition-colors",d===J?"border-primary/50 bg-primary/10":"border-border hover:bg-accent/40"),children:[E.jsx("span",{className:"block text-sm font-medium",children:o(`watch.type.${J}`)}),E.jsx("span",{className:"block text-xs text-muted-foreground",children:o(`watch.typeDesc.${J}`)})]},J))})]}),Se&&E.jsxs(E.Fragment,{children:[E.jsxs("div",{className:"space-y-2 rounded-lg border border-dashed border-border p-3",children:[E.jsx("label",{className:"block text-sm font-medium",htmlFor:`${l}-assist`,children:o("watch.form.assistLabel")}),E.jsxs("div",{className:"flex gap-2",children:[E.jsx(Ii,{id:`${l}-assist`,"data-testid":"watch-form-assist-input",value:U,onChange:J=>G(J.target.value),placeholder:o("watch.form.assistPlaceholder")}),E.jsxs(qt,{type:"button",variant:"secondary","data-testid":"watch-form-assist-generate",disabled:!U.trim()||Ae.isPending,onClick:()=>Ae.mutate(),children:[Ae.isPending?E.jsx(gc,{className:"h-4 w-4 animate-spin"}):E.jsx(pA,{className:"h-4 w-4"}),o("watch.form.assistButton")]})]}),I&&E.jsxs("div",{className:"space-y-1 text-xs","data-testid":"watch-form-assist-result",children:[E.jsxs("p",{className:"text-muted-foreground",children:[E.jsxs("span",{className:"font-medium text-foreground",children:[o("watch.form.assistExplanation"),":"]})," ",I.explanation]}),E.jsxs("p",{className:"font-medium text-foreground",children:[o("watch.form.assistPreview"),":"]}),I.preview.length===0?E.jsx("p",{className:"text-muted-foreground",children:o("watch.form.assistPreviewEmpty")}):E.jsx("ul",{className:"max-h-24 space-y-0.5 overflow-y-auto",children:I.preview.map((J,Ee)=>E.jsx("li",{className:"truncate rounded bg-muted px-1.5 py-0.5 font-mono",children:J},Ee))})]})]}),E.jsxs("div",{className:"grid grid-cols-[1fr_5rem] gap-2",children:[E.jsxs("div",{className:"space-y-2",children:[E.jsx("label",{className:"block text-sm font-medium",htmlFor:`${l}-pattern`,children:o("watch.form.pattern")}),E.jsx(Ii,{id:`${l}-pattern`,"data-testid":"watch-form-pattern",value:h,onChange:J=>y(J.target.value),placeholder:o("watch.form.patternPlaceholder"),className:"font-mono"})]}),E.jsxs("div",{className:"space-y-2",children:[E.jsx("label",{className:"block text-sm font-medium",htmlFor:`${l}-flags`,children:o("watch.form.flags")}),E.jsx(Ii,{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"&&E.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[E.jsxs("div",{className:"space-y-2",children:[E.jsx("label",{className:"block text-sm font-medium",htmlFor:`${l}-extract-group`,children:o("watch.form.extractGroup")}),E.jsx(Ii,{id:`${l}-extract-group`,"data-testid":"watch-form-extract-group",type:"number",min:0,step:1,value:C,onChange:J=>T(Math.max(0,Number(J.target.value)||0))}),E.jsx("p",{className:"text-xs text-muted-foreground",children:o("watch.form.extractGroupHint")})]}),E.jsxs("div",{className:"space-y-2",children:[E.jsx("label",{className:"block text-sm font-medium",htmlFor:`${l}-unchanged-minutes`,children:o("watch.form.unchangedMinutes")}),E.jsx(Ii,{id:`${l}-unchanged-minutes`,"data-testid":"watch-form-unchanged-minutes",type:"number",min:1,step:1,value:S,onChange:J=>R(Math.max(1,Number(J.target.value)||1))})]}),E.jsxs("div",{className:"col-span-2 space-y-2",children:[E.jsx("span",{className:"block text-sm font-medium",children:o("watch.form.noMatchBehavior")}),E.jsxs(ip,{value:k,onValueChange:J=>{(J==="reset"||J==="ignore")&&M(J)},children:[E.jsx(ap,{className:"w-full","data-testid":"watch-form-no-match-behavior",children:E.jsx(_b,{children:o(k==="reset"?"watch.form.noMatchReset":"watch.form.noMatchIgnore")})}),E.jsxs(op,{children:[E.jsx(Pa,{value:"reset",children:o("watch.form.noMatchReset")}),E.jsx(Pa,{value:"ignore",children:o("watch.form.noMatchIgnore")})]})]})]})]}),d==="llm"&&E.jsxs("div",{className:"space-y-2",children:[E.jsx("label",{className:"block text-sm font-medium",htmlFor:`${l}-condition`,children:o("watch.form.conditionPrompt")}),E.jsx(ew,{id:`${l}-condition`,"data-testid":"watch-form-condition-prompt",value:D,onChange:J=>A(J.target.value),placeholder:o("watch.form.conditionPromptPlaceholder"),rows:3})]}),E.jsxs("div",{className:"space-y-2",children:[E.jsx("span",{className:"block text-sm font-medium",children:o("watch.form.model")}),E.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[E.jsxs(ip,{value:O??Ub,onValueChange:J=>{if(!J)return;const Ee=J===Ub?null:J;L(Ee),Ee===null&&F("")},children:[E.jsx(ap,{className:"w-full","data-testid":"watch-form-provider",children:E.jsx(_b,{children:O?(ue==null?void 0:ue.name)??o("watch.form.providerUnavailable"):o("watch.form.followGlobalDefault")})}),E.jsxs(op,{children:[E.jsx(Pa,{value:Ub,children:o("watch.form.followGlobalDefault")}),O&&!Z.some(J=>J.id===O)&&E.jsx(Pa,{value:O,children:ue?`${ue.name} (${o("watch.form.providerDisabled")})`:o("watch.form.providerUnavailable")}),Z.map(J=>E.jsx(Pa,{value:J.id,children:J.name},J.id))]})]}),E.jsx(Ii,{"data-testid":"watch-form-model",list:`${l}-model-options`,value:V,disabled:!O,onChange:J=>F(J.target.value),placeholder:o("watch.form.modelPlaceholder")}),E.jsx("datalist",{id:`${l}-model-options`,children:ve.map(J=>E.jsx("option",{value:J},J))})]}),Pe&&E.jsx("p",{className:"rounded-md bg-primary/10 px-2 py-1.5 text-xs text-primary","data-testid":"watch-form-model-hint",children:o("watch.form.modelRequiredHint")})]}),Se&&E.jsxs("div",{className:"space-y-3",children:[E.jsxs("div",{className:"flex items-center justify-between gap-2",children:[E.jsxs("div",{children:[E.jsx("span",{className:"block text-sm font-medium",children:o("watch.form.confirmWithLlm")}),E.jsx("span",{className:"block text-xs text-muted-foreground",children:o("watch.form.confirmWithLlmDesc")})]}),E.jsx(mp,{checked:W,onCheckedChange:J=>j(!!J),"data-testid":"watch-form-confirm-llm"})]}),E.jsxs("div",{className:"flex items-center justify-between gap-2",children:[E.jsxs("div",{children:[E.jsx("span",{className:"block text-sm font-medium",children:o("watch.form.summarizeWithLlm")}),E.jsx("span",{className:"block text-xs text-muted-foreground",children:o("watch.form.summarizeWithLlmDesc")})]}),E.jsx(mp,{checked:q,onCheckedChange:J=>$(!!J),"data-testid":"watch-form-summarize-llm"})]})]}),E.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[E.jsxs("div",{className:"space-y-2",children:[E.jsx("label",{className:"block text-sm font-medium",htmlFor:`${l}-interval`,children:o("watch.form.intervalSeconds")}),E.jsx(Ii,{id:`${l}-interval`,"data-testid":"watch-form-interval",type:"number",min:te,step:1,value:B,onChange:J=>_(Number(J.target.value)||0)}),E.jsx("p",{className:"text-xs text-muted-foreground",children:o("watch.form.intervalHint",{min:te})})]}),E.jsxs("div",{className:"space-y-2",children:[E.jsx("span",{className:"block text-sm font-medium",children:o("watch.form.fireMode")}),E.jsxs(ip,{value:z,onValueChange:J=>{(J==="once"||J==="repeat")&&H(J)},children:[E.jsx(ap,{className:"w-full","data-testid":"watch-form-fire-mode",children:E.jsx(_b,{children:o(z==="once"?"watch.form.fireOnce":"watch.form.fireRepeat")})}),E.jsxs(op,{children:[E.jsx(Pa,{value:"once",children:o("watch.form.fireOnce")}),E.jsx(Pa,{value:"repeat",children:o("watch.form.fireRepeat")})]})]}),z==="repeat"&&E.jsx(Ii,{"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")})]})]}),E.jsxs("div",{className:"flex justify-end gap-2",children:[E.jsx(qt,{type:"button",variant:"outline",onClick:a,"data-testid":"watch-form-cancel",children:o("common.cancel")}),E.jsxs(qt,{type:"submit",disabled:Le.isPending,"data-testid":"watch-form-save",children:[Le.isPending&&E.jsx(gc,{className:"h-4 w-4 animate-spin"}),o(n?"watch.form.save":"watch.form.create")]})]})]})}function Xu(e){if(!e)return null;const t=new Date(e);return Number.isNaN(t.getTime())?null:t.toLocaleString()}function oZ({open:e,onOpenChange:t,deviceId:n,paneId:r}){const{t:a}=Sn(),o=Ld(),[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=Vo({queryKey:JQ(n,r),queryFn:()=>eZ(n,r),enabled:e,throwOnError:!1}),g=()=>{o.invalidateQueries({queryKey:["watch-rules"]})},w=pd({mutationFn:async({rule:R,enabled:k})=>{await ZD(R.id,{enabled:k})},onSuccess:g,onError:R=>{mn.error(R instanceof Error?R.message:String(R)),g()}}),C=pd({mutationFn:async R=>{await nZ(R.id)},onSuccess:()=>{mn.success(a("watch.toast.deleted")),g()},onError:R=>{mn.error(R instanceof Error?R.message:String(R))}}),T=R=>{g(),c({mode:"list"}),R&&typeof Notification<"u"&&Notification.permission==="default"&&h(!0)},S=y.data??[];return E.jsxs(E.Fragment,{children:[E.jsx(cx,{open:e,onOpenChange:t,children:E.jsxs(ux,{className:"sm:max-w-lg max-h-[85dvh] grid-rows-[auto_minmax(0,1fr)]","data-testid":"watch-dialog",children:[E.jsxs(dx,{children:[E.jsxs(fx,{children:[l.mode==="list"&&a("watch.title"),l.mode==="form"&&(l.rule?a("watch.form.editTitle"):a("watch.form.createTitle")),l.mode==="state"&&a("watch.state.title")]}),E.jsx(UD,{children:l.mode==="list"?a("watch.dialogDesc"):null})]}),E.jsxs("div",{className:"min-h-0 overflow-y-auto pr-1",children:[l.mode==="list"&&E.jsxs("div",{className:"space-y-3",children:[m&&E.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-primary/30 bg-primary/10 p-3","data-testid":"watch-notif-banner",children:[E.jsx(DF,{className:"mt-0.5 h-4 w-4 shrink-0 text-primary"}),E.jsxs("div",{className:"min-w-0 flex-1",children:[E.jsx("p",{className:"text-sm font-medium",children:a("watch.notifPermission.title")}),E.jsx("p",{className:"text-xs text-muted-foreground",children:a("watch.notifPermission.desc")}),E.jsxs("div",{className:"mt-2 flex gap-2",children:[E.jsx(qt,{size:"sm","data-testid":"watch-notif-enable",onClick:()=>{Notification.requestPermission().finally(()=>h(!1))},children:a("watch.notifPermission.enable")}),E.jsx(qt,{size:"sm",variant:"ghost",onClick:()=>h(!1),children:a("watch.notifPermission.dismiss")})]})]})]}),y.isLoading&&E.jsx("div",{className:"flex justify-center py-6",children:E.jsx(gc,{className:"h-5 w-5 animate-spin text-muted-foreground"})}),!y.isLoading&&S.length===0&&E.jsx("p",{className:"py-6 text-center text-sm text-muted-foreground","data-testid":"watch-rules-empty",children:a("watch.rules.empty")}),S.map(R=>E.jsx(sZ,{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)),E.jsxs(qt,{variant:"outline",className:"w-full","data-testid":"watch-rule-add",onClick:()=>c({mode:"form",rule:null}),children:[E.jsx(Wp,{className:"h-4 w-4"}),a("watch.rules.addRule")]})]}),l.mode==="form"&&E.jsx(aZ,{deviceId:n,paneId:r,rule:l.rule,onSaved:T,onCancel:()=>c({mode:"list"})}),l.mode==="state"&&E.jsx(lZ,{rule:l.rule,onBack:()=>c({mode:"list"})})]})]})}),E.jsx(tx,{open:f!==null,onOpenChange:R=>!R&&d(null),children:E.jsxs(nx,{"data-testid":"watch-rule-delete-dialog",children:[E.jsxs(rx,{children:[E.jsx(ax,{children:a("watch.rules.deleteTitle")}),E.jsx(ox,{children:a("watch.rules.deleteDesc",{name:(f==null?void 0:f.name)??""})})]}),E.jsxs(ix,{children:[E.jsx(lx,{children:a("common.cancel")}),E.jsx(sx,{variant:"destructive","data-testid":"watch-rule-delete-confirm",onClick:()=>{f&&C.mutate(f),d(null)},children:a("watch.rules.deleteConfirm")})]})]})})]})}function sZ({rule:e,onToggle:t,onEdit:n,onViewState:r,onDelete:a}){var f,d;const{t:o}=Sn(),l=Vo({queryKey:QD(e.id),queryFn:()=>JD(e.id),throwOnError:!1}),c=Xu((d=(f=l.data)==null?void 0:f.state)==null?void 0:d.lastTriggeredAt);return E.jsxs("div",{className:"rounded-lg border border-border p-3","data-testid":`watch-rule-item-${e.id}`,"data-rule-name":e.name,children:[E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:e.name}),E.jsx(Ks,{variant:"secondary",children:o(`watch.type.${e.triggerType}`)}),E.jsx(mp,{checked:e.enabled,onCheckedChange:m=>t(!!m),"data-testid":`watch-rule-toggle-${e.id}`})]}),E.jsxs("div",{className:"mt-2 flex items-center justify-between gap-2",children:[E.jsx("span",{className:"truncate text-xs text-muted-foreground",children:c?o("watch.rules.lastTriggered",{time:c}):o("watch.rules.neverTriggered")}),E.jsxs("div",{className:"flex shrink-0 gap-1",children:[E.jsx(qt,{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:E.jsx(RF,{className:"h-3.5 w-3.5"})}),E.jsx(qt,{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:E.jsx(Yp,{className:"h-3.5 w-3.5"})}),E.jsx(qt,{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:E.jsx(mA,{className:"h-3.5 w-3.5 text-destructive"})})]})]})]})}function lZ({rule:e,onBack:t}){var f,d;const{t:n}=Sn(),r=Vo({queryKey:QD(e.id),queryFn:()=>JD(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:Xu(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:Xu(a==null?void 0:a.lastValueChangedAt)??l},{label:n("watch.state.lastTriggeredAt"),value:Xu(a==null?void 0:a.lastTriggeredAt)??l},{label:n("watch.state.consecutiveErrors"),value:a?String(a.consecutiveErrors):l},{label:n("watch.state.lastError"),value:(a==null?void 0:a.lastError)??l}];return E.jsxs("div",{className:"space-y-3","data-testid":"watch-rule-state-view",children:[E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx(qt,{variant:"ghost",size:"icon-sm",onClick:t,"aria-label":n("watch.state.back"),children:E.jsx(OF,{className:"h-4 w-4"})}),E.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:e.name}),E.jsx(Ks,{variant:"secondary",children:n(`watch.type.${e.triggerType}`)})]}),r.isLoading?E.jsx("div",{className:"flex justify-center py-6",children:E.jsx(gc,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):E.jsxs(E.Fragment,{children:[E.jsx("dl",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-1.5 text-sm",children:c.map(m=>E.jsxs("div",{className:"contents",children:[E.jsx("dt",{className:"text-muted-foreground",children:m.label}),E.jsx("dd",{className:"min-w-0 break-all",children:m.value})]},m.label))}),E.jsxs("div",{className:"space-y-1.5",children:[E.jsx("p",{className:"text-sm font-medium",children:n("watch.state.samples")}),o.length===0?E.jsx("p",{className:"text-xs text-muted-foreground",children:n("watch.state.samplesEmpty")}):E.jsx("ul",{className:"max-h-48 space-y-0.5 overflow-y-auto text-xs",children:[...o].reverse().map(m=>E.jsxs("li",{className:"flex items-center gap-2 rounded bg-muted/60 px-2 py-1",children:[E.jsx("span",{className:"shrink-0 font-mono text-muted-foreground",children:Xu(m.at)??m.at}),E.jsx("span",{className:"min-w-0 flex-1 truncate font-mono",children:m.value??l}),m.hit&&E.jsx(Ks,{variant:"default",className:"h-4 px-1 text-[10px]",children:n("watch.state.hit")})]},m.at))})]})]})]})}function cZ(){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 Cm=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function _c(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function a0(e){return"nodeType"in e}function Vr(e){var t,n;return e?_c(e)?e:a0(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function o0(e){const{Document:t}=Vr(e);return e instanceof t}function Jd(e){return _c(e)?!1:e instanceof Vr(e).HTMLElement}function e2(e){return e instanceof Vr(e).SVGElement}function zc(e){return e?_c(e)?e.document:a0(e)?o0(e)?e:Jd(e)||e2(e)?e.ownerDocument:document:document:document}const oa=Cm?v.useLayoutEffect:v.useEffect;function s0(e){const t=v.useRef(e);return oa(()=>{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 uZ(){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 Rd(e,t){t===void 0&&(t=[e]);const n=v.useRef(e);return oa(()=>{n.current!==e&&(n.current=e)},t),n}function ef(e,t){const n=v.useRef();return v.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function jp(e){const t=s0(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 hx(e){const t=v.useRef();return v.useEffect(()=>{t.current=e},[e]),t.current}let Vb={};function tf(e,t){return v.useMemo(()=>{if(t)return t;const n=Vb[e]==null?0:Vb[e]+1;return Vb[e]=n,e+"-"+n},[e,t])}function t2(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 tc=t2(1),kd=t2(-1);function dZ(e){return"clientX"in e&&"clientY"in e}function l0(e){if(!e)return!1;const{KeyboardEvent:t}=Vr(e.target);return t&&e instanceof t}function fZ(e){if(!e)return!1;const{TouchEvent:t}=Vr(e.target);return t&&e instanceof t}function px(e){if(fZ(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 dZ(e)?{x:e.clientX,y:e.clientY}:null}const Qs=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[Qs.Translate.toString(e),Qs.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Nk="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function hZ(e){return e.matches(Nk)?e:e.querySelector(Nk)}const pZ={display:"none"};function mZ(e){let{id:t,value:n}=e;return Fe.createElement("div",{id:t,style:pZ},n)}function gZ(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 yZ(){const[e,t]=v.useState("");return{announce:v.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const n2=v.createContext(null);function bZ(e){const t=v.useContext(n2);v.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function vZ(){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 xZ={draggable:`
396
- To pick up a draggable item, press the space bar.
397
- While dragging, use the arrow keys to move the item.
398
- Press space again to drop the item in its new position, or press escape to cancel.
399
- `},wZ={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 SZ(e){let{announcements:t=wZ,container:n,hiddenTextDescribedById:r,screenReaderInstructions:a=xZ}=e;const{announce:o,announcement:l}=yZ(),c=tf("DndLiveRegion"),[f,d]=v.useState(!1);if(v.useEffect(()=>{d(!0)},[]),bZ(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(mZ,{id:r,value:a.draggable}),Fe.createElement(gZ,{id:c,announcement:l}));return n?pr.createPortal(m,n):m}var Jn;(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"})(Jn||(Jn={}));function _p(){}function qb(e,t){return v.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function EZ(){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 Fi=Object.freeze({x:0,y:0});function r2(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function i2(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function CZ(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Dk(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 a2(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Ik(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 c0=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const a=Ik(t,t.left,t.top),o=[];for(const l of r){const{id:c}=l,f=n.get(c);if(f){const d=r2(Ik(f),a);o.push({id:c,data:{droppableContainer:l,value:d}})}}return o.sort(i2)},TZ=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const a=Dk(t),o=[];for(const l of r){const{id:c}=l,f=n.get(c);if(f){const d=Dk(f),m=a.reduce((y,g,w)=>y+r2(d[w],g),0),h=Number((m/4).toFixed(4));o.push({id:c,data:{droppableContainer:l,value:h}})}}return o.sort(i2)};function RZ(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 kZ=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=RZ(c,t);f>0&&a.push({id:l,data:{droppableContainer:o,value:f}})}}return a.sort(CZ)};function MZ(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function o2(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Fi}function AZ(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 OZ=AZ(1);function NZ(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 DZ(e,t,n){const r=NZ(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 IZ={ignoreTransform:!1};function Fc(e,t){t===void 0&&(t=IZ);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:m}=Vr(e).getComputedStyle(e);d&&(n=DZ(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 Pk(e){return Fc(e,{ignoreTransform:!0})}function PZ(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function LZ(e,t){return t===void 0&&(t=Vr(e).getComputedStyle(e)),t.position==="fixed"}function jZ(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 Tm(e,t){const n=[];function r(a){if(t!=null&&n.length>=t||!a)return n;if(o0(a)&&a.scrollingElement!=null&&!n.includes(a.scrollingElement))return n.push(a.scrollingElement),n;if(!Jd(a)||e2(a)||n.includes(a))return n;const o=Vr(e).getComputedStyle(a);return a!==e&&jZ(a,o)&&n.push(a),LZ(a,o)?n:r(a.parentNode)}return e?r(e):n}function s2(e){const[t]=Tm(e,1);return t??null}function $b(e){return!Cm||!e?null:_c(e)?e:a0(e)?o0(e)||e===zc(e).scrollingElement?window:Jd(e)?e:null:null}function l2(e){return _c(e)?e.scrollX:e.scrollLeft}function c2(e){return _c(e)?e.scrollY:e.scrollTop}function mx(e){return{x:l2(e),y:c2(e)}}var or;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(or||(or={}));function u2(e){return!Cm||!e?!1:e===document.scrollingElement}function d2(e){const t={x:0,y:0},n=u2(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 _Z={x:.2,y:.2};function zZ(e,t,n,r,a){let{top:o,left:l,right:c,bottom:f}=n;r===void 0&&(r=10),a===void 0&&(a=_Z);const{isTop:d,isBottom:m,isLeft:h,isRight:y}=d2(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 FZ(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 f2(e){return e.reduce((t,n)=>tc(t,mx(n)),Fi)}function BZ(e){return e.reduce((t,n)=>t+l2(n),0)}function HZ(e){return e.reduce((t,n)=>t+c2(n),0)}function UZ(e,t){if(t===void 0&&(t=Fc),!e)return;const{top:n,left:r,bottom:a,right:o}=t(e);s2(e)&&(a<=0||o<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const VZ=[["x",["left","right"],BZ],["y",["top","bottom"],HZ]];class u0{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=Tm(n),a=f2(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[o,l,c]of VZ)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 ud{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 qZ(e){const{EventTarget:t}=Vr(e);return e instanceof t?e:zc(e)}function Yb(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 bi;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(bi||(bi={}));function Lk(e){e.preventDefault()}function $Z(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 h2={start:[rn.Space,rn.Enter],cancel:[rn.Esc],end:[rn.Space,rn.Enter,rn.Tab]},YZ=(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 d0{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 ud(zc(n)),this.windowListeners=new ud(Vr(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(bi.Resize,this.handleCancel),this.windowListeners.add(bi.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(bi.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&UZ(r),n(Fi)}handleKeyDown(t){if(l0(t)){const{active:n,context:r,options:a}=this.props,{keyboardCodes:o=h2,coordinateGetter:l=YZ,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}:Fi;this.referenceCoordinates||(this.referenceCoordinates=m);const h=l(t,{active:n,context:r.current,currentCoordinates:m});if(h){const y=kd(h,m),g={x:0,y:0},{scrollableAncestors:w}=r.current;for(const C of w){const T=t.code,{isTop:S,isRight:R,isLeft:k,isBottom:M,maxScroll:D,minScroll:A}=d2(C),O=FZ(C),L={x:Math.min(T===rn.Right?O.right-O.width/2:O.right,Math.max(T===rn.Right?O.left:O.left+O.width/2,h.x)),y:Math.min(T===rn.Down?O.bottom-O.height/2:O.bottom,Math.max(T===rn.Down?O.top:O.top+O.height/2,h.y))},V=T===rn.Right&&!R||T===rn.Left&&!k,F=T===rn.Down&&!M||T===rn.Up&&!S;if(V&&L.x!==h.x){const W=C.scrollLeft+y.x,j=T===rn.Right&&W<=D.x||T===rn.Left&&W>=A.x;if(j&&!y.y){C.scrollTo({left:W,behavior:c});return}j?g.x=C.scrollLeft-W:g.x=T===rn.Right?C.scrollLeft-D.x:C.scrollLeft-A.x,g.x&&C.scrollBy({left:-g.x,behavior:c});break}else if(F&&L.y!==h.y){const W=C.scrollTop+y.y,j=T===rn.Down&&W<=D.y||T===rn.Up&&W>=A.y;if(j&&!y.x){C.scrollTo({top:W,behavior:c});return}j?g.y=C.scrollTop-W:g.y=T===rn.Down?C.scrollTop-D.y:C.scrollTop-A.y,g.y&&C.scrollBy({top:-g.y,behavior:c});break}}this.handleMove(t,tc(kd(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()}}d0.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=h2,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 jk(e){return!!(e&&"distance"in e)}function _k(e){return!!(e&&"delay"in e)}class f0{constructor(t,n,r){var a;r===void 0&&(r=qZ(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=zc(l),this.documentListeners=new ud(this.document),this.listeners=new ud(r),this.windowListeners=new ud(Vr(l)),this.initialCoordinates=(a=px(o))!=null?a:Fi,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(bi.Resize,this.handleCancel),this.windowListeners.add(bi.DragStart,Lk),this.windowListeners.add(bi.VisibilityChange,this.handleCancel),this.windowListeners.add(bi.ContextMenu,Lk),this.documentListeners.add(bi.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(_k(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(jk(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(bi.Click,$Z,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(bi.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=px(t))!=null?n:Fi,d=kd(a,f);if(!r&&c){if(jk(c)){if(c.tolerance!=null&&Yb(d,c.tolerance))return this.handleCancel();if(Yb(d,c.distance))return this.handleStart()}if(_k(c)&&Yb(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 WZ={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class p2 extends f0{constructor(t){const{event:n}=t,r=zc(n.target);super(t,WZ,r)}}p2.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 KZ={move:{name:"mousemove"},end:{name:"mouseup"}};var gx;(function(e){e[e.RightClick=2]="RightClick"})(gx||(gx={}));class m2 extends f0{constructor(t){super(t,KZ,zc(t.event.target))}}m2.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===gx.RightClick?!1:(r==null||r({event:n}),!0)}}];const Wb={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class g2 extends f0{constructor(t){super(t,Wb)}static setup(){return window.addEventListener(Wb.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Wb.move.name,t)};function t(){}}}g2.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 dd;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(dd||(dd={}));var zp;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(zp||(zp={}));function GZ(e){let{acceleration:t,activator:n=dd.Pointer,canScroll:r,draggingRect:a,enabled:o,interval:l=5,order:c=zp.TreeOrder,pointerCoordinates:f,scrollableAncestors:d,scrollableAncestorRects:m,delta:h,threshold:y}=e;const g=QZ({delta:h,disabled:!o}),[w,C]=uZ(),T=v.useRef({x:0,y:0}),S=v.useRef({x:0,y:0}),R=v.useMemo(()=>{switch(n){case dd.Pointer:return f?{top:f.y,bottom:f.y,left:f.x,right:f.x}:null;case dd.DraggableRect:return a}},[n,a,f]),k=v.useRef(null),M=v.useCallback(()=>{const A=k.current;if(!A)return;const O=T.current.x*S.current.x,L=T.current.y*S.current.y;A.scrollBy(O,L)},[]),D=v.useMemo(()=>c===zp.TreeOrder?[...d].reverse():d,[c,d]);v.useEffect(()=>{if(!o||!d.length||!R){C();return}for(const A of D){if((r==null?void 0:r(A))===!1)continue;const O=d.indexOf(A),L=m[O];if(!L)continue;const{direction:V,speed:F}=zZ(A,L,R,t,y);for(const W of["x","y"])g[W][V[W]]||(F[W]=0,V[W]=0);if(F.x>0||F.y>0){C(),k.current=A,w(M,l),T.current=F,S.current=V;return}}T.current={x:0,y:0},S.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 XZ={x:{[or.Backward]:!1,[or.Forward]:!1},y:{[or.Backward]:!1,[or.Forward]:!1}};function QZ(e){let{delta:t,disabled:n}=e;const r=hx(t);return ef(a=>{if(n||!r||!a)return XZ;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 ZZ(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return ef(a=>{var o;return t==null?null:(o=r??a)!=null?o:null},[r,t])}function JZ(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 Md;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Md||(Md={}));var yx;(function(e){e.Optimized="optimized"})(yx||(yx={}));const zk=new Map;function eJ(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=Rd(h),g=v.useCallback(function(S){S===void 0&&(S=[]),!y.current&&l(R=>R===null?S:R.concat(S.filter(k=>!R.includes(k))))},[y]),w=v.useRef(null),C=ef(S=>{if(h&&!n)return zk;if(!S||S===zk||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 u0(f(M),M):null;k.rect.current=D,D&&R.set(k.id,D)}return R}return S},[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 Md.Always:return!1;case Md.BeforeDragging:return n;default:return!n}}}function y2(e,t){return ef(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function tJ(e,t){return y2(e,t)}function nJ(e){let{callback:t,disabled:n}=e;const r=s0(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 Rm(e){let{callback:t,disabled:n}=e;const r=s0(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 rJ(e){return new u0(Fc(e),e)}function Fk(e,t,n){t===void 0&&(t=rJ);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=nJ({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=Rm({callback:o});return oa(()=>{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 iJ(e){const t=y2(e);return o2(e,t)}const Bk=[];function aJ(e){const t=v.useRef(e),n=ef(r=>e?r&&r!==Bk&&e&&t.current&&e.parentNode===t.current.parentNode?r:Tm(e):Bk,[e]);return v.useEffect(()=>{t.current=e},[e]),n}function oJ(e){const[t,n]=v.useState(null),r=v.useRef(e),a=v.useCallback(o=>{const l=$b(o.target);l&&n(c=>c?(c.set(l,mx(l)),new Map(c)):null)},[]);return v.useEffect(()=>{const o=r.current;if(e!==o){l(o);const c=e.map(f=>{const d=$b(f);return d?(d.addEventListener("scroll",a,{passive:!0}),[d,mx(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=$b(f);d==null||d.removeEventListener("scroll",a)})}},[a,e]),v.useMemo(()=>e.length?t?Array.from(t.values()).reduce((o,l)=>tc(o,l),Fi):f2(e):Fi,[e,t])}function Hk(e,t){t===void 0&&(t=[]);const n=v.useRef(null);return v.useEffect(()=>{n.current=null},t),v.useEffect(()=>{const r=e!==Fi;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?kd(e,n.current):Fi}function sJ(e){v.useEffect(()=>{if(!Cm)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 lJ(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 b2(e){return v.useMemo(()=>e?PZ(e):null,[e])}const Uk=[];function cJ(e,t){t===void 0&&(t=Fc);const[n]=e,r=b2(n?Vr(n):null),[a,o]=v.useState(Uk);function l(){o(()=>e.length?e.map(f=>u2(f)?r:new u0(t(f),f)):Uk)}const c=Rm({callback:l});return oa(()=>{c==null||c.disconnect(),l(),e.forEach(f=>c==null?void 0:c.observe(f))},[e]),a}function uJ(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Jd(t)?t:e}function dJ(e){let{measure:t}=e;const[n,r]=v.useState(null),a=v.useCallback(d=>{for(const{target:m}of d)if(Jd(m)){r(h=>{const y=t(m);return h?{...h,width:y.width,height:y.height}:y});break}},[t]),o=Rm({callback:a}),l=v.useCallback(d=>{const m=uJ(d);o==null||o.disconnect(),m&&(o==null||o.observe(m)),r(m?t(m):null)},[t,o]),[c,f]=jp(l);return v.useMemo(()=>({nodeRef:c,rect:n,setRef:f}),[n,c,f])}const fJ=[{sensor:p2,options:{}},{sensor:d0,options:{}}],hJ={current:{}},sp={draggable:{measure:Pk},droppable:{measure:Pk,strategy:Md.WhileDragging,frequency:yx.Optimized},dragOverlay:{measure:Fc}};class fd 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 pJ={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new fd,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:_p},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:sp,measureDroppableContainers:_p,windowRect:null,measuringScheduled:!1},mJ={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:_p,draggableNodes:new Map,over:null,measureDroppableContainers:_p},km=v.createContext(mJ),v2=v.createContext(pJ);function gJ(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new fd}}}function yJ(e,t){switch(t.type){case Jn.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Jn.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 Jn.DragEnd:case Jn.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Jn.RegisterDroppable:{const{element:n}=t,{id:r}=n,a=new fd(e.droppable.containers);return a.set(r,n),{...e,droppable:{...e.droppable,containers:a}}}case Jn.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 fd(e.droppable.containers);return l.set(n,{...o,disabled:a}),{...e,droppable:{...e.droppable,containers:l}}}case Jn.UnregisterDroppable:{const{id:n,key:r}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;const o=new fd(e.droppable.containers);return o.delete(n),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function bJ(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:a}=v.useContext(km),o=hx(r),l=hx(n==null?void 0:n.id);return v.useEffect(()=>{if(!t&&!r&&o&&l!=null){if(!l0(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=hZ(m);if(h){h.focus();break}}})}},[r,t,a,l,o]),null}function vJ(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((a,o)=>o({transform:a,...r}),n):n}function xJ(e){return v.useMemo(()=>({draggable:{...sp.draggable,...e==null?void 0:e.draggable},droppable:{...sp.droppable,...e==null?void 0:e.droppable},dragOverlay:{...sp.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 wJ(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;oa(()=>{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=o2(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=s2(d);y&&y.scrollBy({top:h.y,left:h.x})}},[t,l,c,r,n])}const x2=v.createContext({...Fi,scaleX:1,scaleY:1});var Eo;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Eo||(Eo={}));const h0=v.memo(function(t){var n,r,a,o;let{id:l,accessibility:c,autoScroll:f=!0,children:d,sensors:m=fJ,collisionDetection:h=kZ,measuring:y,modifiers:g,...w}=t;const C=v.useReducer(yJ,void 0,gJ),[T,S]=C,[R,k]=vZ(),[M,D]=v.useState(Eo.Uninitialized),A=M===Eo.Initialized,{draggable:{active:O,nodes:L,translate:V},droppable:{containers:F}}=T,W=O!=null?L.get(O):null,j=v.useRef({initial:null,translated:null}),q=v.useMemo(()=>{var ft;return O!=null?{id:O,data:(ft=W==null?void 0:W.data)!=null?ft:hJ,rect:j}:null},[O,W]),$=v.useRef(null),[B,_]=v.useState(null),[z,H]=v.useState(null),K=Rd(w,Object.values(w)),P=tf("DndDescribedBy",l),U=v.useMemo(()=>F.getEnabled(),[F]),G=xJ(y),{droppableRects:I,measureDroppableContainers:Q,measuringScheduled:le}=eJ(U,{dragging:A,dependencies:[V.x,V.y],config:G.droppable}),ae=ZZ(L,O),Z=v.useMemo(()=>z?px(z):null,[z]),ue=it(),ve=tJ(ae,G.draggable.measure);wJ({activeNode:O!=null?L.get(O):null,config:ue.layoutShiftCompensation,initialRect:ve,measure:G.draggable.measure});const Se=Fk(ae,G.draggable.measure,ve),Pe=Fk(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=dJ({measure:G.dragOverlay.measure}),Le=(r=ye.nodeRef.current)!=null?r:ae,Ae=A?(a=ye.rect)!=null?a:Se:null,Ce=!!(ye.nodeRef.current&&ye.rect),Re=iJ(Ce?null:Se),J=b2(Le?Vr(Le):null),Ee=aJ(A?he??ae:null),xe=cJ(Ee),Be=vJ(g,{transform:{x:V.x-Re.x,y:V.y-Re.y,scaleX:1,scaleY:1},activatorEvent:z,active:q,activeNodeRect:Se,containerNodeRect:Pe,draggingNodeRect:Ae,over:te.current.over,overlayNodeRect:ye.rect,scrollableAncestors:Ee,scrollableAncestorRects:xe,windowRect:J}),qe=Z?tc(Z,V):null,De=oJ(Ee),ut=Hk(De),pe=Hk(De,[Se]),Te=tc(Be,ut),ee=Ae?OZ(Ae,Be):null,fe=q&&ee?h({active:q,collisionRect:ee,droppableRects:I,droppableContainers:U,pointerCoordinates:qe}):null,Oe=a2(fe,"id"),[He,$e]=v.useState(null),et=Ce?Be:tc(Be,pe),ze=MZ(et,(o=He==null?void 0:He.rect)!=null?o:null,Se),Ze=v.useRef(null),tt=v.useCallback((ft,yt)=>{let{sensor:Ke,options:Rt}=yt;if($.current==null)return;const jt=L.get($.current);if(!jt)return;const Tt=ft.nativeEvent,un=new Ke({active:$.current,activeNode:jt,event:Tt,options:Rt,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,kt,X,ie){if(!L.get(Je))return;const{onDragPending:ke}=K.current,_e={id:Je,constraint:kt,initialCoordinates:X,offset:ie};ke==null||ke(_e),R({type:"onDragPending",event:_e})},onStart(Je){const kt=$.current;if(kt==null)return;const X=L.get(kt);if(!X)return;const{onDragStart:ie}=K.current,de={activatorEvent:Tt,active:{id:kt,data:X.data,rect:j}};pr.unstable_batchedUpdates(()=>{ie==null||ie(de),D(Eo.Initializing),S({type:Jn.DragStart,initialCoordinates:Je,active:kt}),R({type:"onDragStart",event:de}),_(Ze.current),H(Tt)})},onMove(Je){S({type:Jn.DragMove,coordinates:Je})},onEnd:Ht(Jn.DragEnd),onCancel:Ht(Jn.DragCancel)});Ze.current=un;function Ht(Je){return async function(){const{active:X,collisions:ie,over:de,scrollAdjustedTranslate:ke}=te.current;let _e=null;if(X&&ke){const{cancelDrop:rt}=K.current;_e={activatorEvent:Tt,active:X,collisions:ie,delta:ke,over:de},Je===Jn.DragEnd&&typeof rt=="function"&&await Promise.resolve(rt(_e))&&(Je=Jn.DragCancel)}$.current=null,pr.unstable_batchedUpdates(()=>{S({type:Je}),D(Eo.Uninitialized),$e(null),_(null),H(null),Ze.current=null;const rt=Je===Jn.DragEnd?"onDragEnd":"onDragCancel";if(_e){const nt=K.current[rt];nt==null||nt(_e),R({type:rt,event:_e})}})}}},[L]),Ct=v.useCallback((ft,yt)=>(Ke,Rt)=>{const jt=Ke.nativeEvent,Tt=L.get(Rt);if($.current!==null||!Tt||jt.dndKit||jt.defaultPrevented)return;const un={active:Tt};ft(Ke,yt.options,un)===!0&&(jt.dndKit={capturedBy:yt.sensor},$.current=Rt,tt(Ke,yt))},[L,tt]),zt=JZ(m,Ct);sJ(m),oa(()=>{Se&&M===Eo.Initializing&&D(Eo.Initialized)},[Se,M]),v.useEffect(()=>{const{onDragMove:ft}=K.current,{active:yt,activatorEvent:Ke,collisions:Rt,over:jt}=te.current;if(!yt||!Ke)return;const Tt={active:yt,activatorEvent:Ke,collisions:Rt,delta:{x:Te.x,y:Te.y},over:jt};pr.unstable_batchedUpdates(()=>{ft==null||ft(Tt),R({type:"onDragMove",event:Tt})})},[Te.x,Te.y]),v.useEffect(()=>{const{active:ft,activatorEvent:yt,collisions:Ke,droppableContainers:Rt,scrollAdjustedTranslate:jt}=te.current;if(!ft||$.current==null||!yt||!jt)return;const{onDragOver:Tt}=K.current,un=Rt.get(Oe),Ht=un&&un.rect.current?{id:un.id,rect:un.rect.current,data:un.data,disabled:un.disabled}:null,Je={active:ft,activatorEvent:yt,collisions:Ke,delta:{x:jt.x,y:jt.y},over:Ht};pr.unstable_batchedUpdates(()=>{$e(Ht),Tt==null||Tt(Je),R({type:"onDragOver",event:Je})})},[Oe]),oa(()=>{te.current={activatorEvent:z,active:q,activeNode:ae,collisionRect:ee,collisions:fe,droppableRects:I,draggableNodes:L,draggingNode:Le,draggingNodeRect:Ae,droppableContainers:F,over:He,scrollableAncestors:Ee,scrollAdjustedTranslate:Te},j.current={initial:Ae,translated:ee}},[q,ae,fe,ee,L,Le,Ae,I,F,He,Ee,Te]),GZ({...ue,delta:V,draggingRect:ee,pointerCoordinates:qe,scrollableAncestors:Ee,scrollableAncestorRects:xe});const gt=v.useMemo(()=>({active:q,activeNode:ae,activeNodeRect:Se,activatorEvent:z,collisions:fe,containerNodeRect:Pe,dragOverlay:ye,draggableNodes:L,droppableContainers:F,droppableRects:I,over:He,measureDroppableContainers:Q,scrollableAncestors:Ee,scrollableAncestorRects:xe,measuringConfiguration:G,measuringScheduled:le,windowRect:J}),[q,ae,Se,z,fe,Pe,ye,L,F,I,He,Q,Ee,xe,G,le,J]),At=v.useMemo(()=>({activatorEvent:z,activators:zt,active:q,activeNodeRect:Se,ariaDescribedById:{draggable:P},dispatch:S,draggableNodes:L,over:He,measureDroppableContainers:Q}),[z,zt,q,Se,S,P,L,He,Q]);return Fe.createElement(n2.Provider,{value:k},Fe.createElement(km.Provider,{value:At},Fe.createElement(v2.Provider,{value:gt},Fe.createElement(x2.Provider,{value:ze},d)),Fe.createElement(bJ,{disabled:(c==null?void 0:c.restoreFocus)===!1})),Fe.createElement(SZ,{...c,hiddenTextDescribedById:P}));function it(){const ft=(B==null?void 0:B.autoScrollEnabled)===!1,yt=typeof f=="object"?f.enabled===!1:f===!1,Ke=A&&!ft&&!yt;return typeof f=="object"?{...f,enabled:Ke}:{enabled:Ke}}}),SJ=v.createContext(null),Vk="button",EJ="Draggable";function CJ(e){let{id:t,data:n,disabled:r=!1,attributes:a}=e;const o=tf(EJ),{activators:l,activatorEvent:c,active:f,activeNodeRect:d,ariaDescribedById:m,draggableNodes:h,over:y}=v.useContext(km),{role:g=Vk,roleDescription:w="draggable",tabIndex:C=0}=a??{},T=(f==null?void 0:f.id)===t,S=v.useContext(T?x2:SJ),[R,k]=jp(),[M,D]=jp(),A=lJ(l,t),O=Rd(n);oa(()=>(h.set(t,{id:t,key:o,node:R,activatorNode:M,data:O}),()=>{const V=h.get(t);V&&V.key===o&&h.delete(t)}),[h,t]);const L=v.useMemo(()=>({role:g,tabIndex:C,"aria-disabled":r,"aria-pressed":T&&g===Vk?!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:A,node:R,over:y,setNodeRef:k,setActivatorNodeRef:D,transform:S}}function TJ(){return v.useContext(v2)}const RJ="Droppable",kJ={timeout:25};function MJ(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:a}=e;const o=tf(RJ),{active:l,dispatch:c,over:f,measureDroppableContainers:d}=v.useContext(km),m=v.useRef({disabled:n}),h=v.useRef(!1),y=v.useRef(null),g=v.useRef(null),{disabled:w,updateMeasurementsFor:C,timeout:T}={...kJ,...a},S=Rd(C??r),R=v.useCallback(()=>{if(!h.current){h.current=!0;return}g.current!=null&&clearTimeout(g.current),g.current=setTimeout(()=>{d(Array.isArray(S.current)?S.current:[S.current]),g.current=null},T)},[T]),k=Rm({callback:R,disabled:w||!l}),M=v.useCallback((L,V)=>{k&&(V&&(k.unobserve(V),h.current=!1),L&&k.observe(L))},[k]),[D,A]=jp(M),O=Rd(t);return v.useEffect(()=>{!k||!D.current||(k.disconnect(),h.current=!1,k.observe(D.current))},[D,k]),v.useEffect(()=>(c({type:Jn.RegisterDroppable,element:{id:r,key:o,disabled:n,node:D,rect:y,data:O}}),()=>c({type:Jn.UnregisterDroppable,key:o,id:r})),[r]),v.useEffect(()=>{n!==m.current.disabled&&(c({type:Jn.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:A}}function nf(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function AJ(e,t){return e.reduce((n,r,a)=>{const o=t.get(r);return o&&(n[a]=o),n},Array(e.length))}function Vh(e){return e!==null&&e>=0}function OJ(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 NJ(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const w2=e=>{let{rects:t,activeIndex:n,overIndex:r,index:a}=e;const o=nf(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}},qh={scaleX:1,scaleY:1},p0=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,...qh}:null}const f=DJ(o,a,n);return a>n&&a<=l?{x:0,y:-c.height-f,...qh}:a<n&&a>=l?{x:0,y:c.height+f,...qh}:{x:0,y:0,...qh}};function DJ(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 S2="Sortable",E2=Fe.createContext({activeIndex:-1,containerId:S2,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:w2,disabled:{draggable:!1,droppable:!1}});function m0(e){let{children:t,id:n,items:r,strategy:a=w2,disabled:o=!1}=e;const{active:l,dragOverlay:c,droppableRects:f,over:d,measureDroppableContainers:m}=TJ(),h=tf(S2,n),y=c.rect!==null,g=v.useMemo(()=>r.map(A=>typeof A=="object"&&"id"in A?A.id:A),[r]),w=l!=null,C=l?g.indexOf(l.id):-1,T=d?g.indexOf(d.id):-1,S=v.useRef(g),R=!OJ(g,S.current),k=T!==-1&&C===-1||R,M=NJ(o);oa(()=>{R&&w&&m(g)},[R,g,w,m]),v.useEffect(()=>{S.current=g},[g]);const D=v.useMemo(()=>({activeIndex:C,containerId:h,disabled:M,disableTransforms:k,items:g,overIndex:T,useDragOverlay:y,sortedRects:AJ(g,f),strategy:a}),[C,h,M.draggable,M.droppable,k,g,T,f,y,a]);return Fe.createElement(E2.Provider,{value:D},t)}const IJ=e=>{let{id:t,items:n,activeIndex:r,overIndex:a}=e;return nf(n,r,a).indexOf(t)},PJ=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},LJ={duration:200,easing:"ease"},C2="transform",jJ=Qs.Transition.toString({property:C2,duration:0,easing:"linear"}),_J={roleDescription:"sortable"};function zJ(e){let{disabled:t,index:n,node:r,rect:a}=e;const[o,l]=v.useState(null),c=v.useRef(n);return oa(()=>{if(!t&&n!==c.current&&r.current){const f=a.current;if(f){const d=Fc(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 g0(e){let{animateLayoutChanges:t=PJ,attributes:n,disabled:r,data:a,getNewIndex:o=IJ,id:l,strategy:c,resizeObserverConfig:f,transition:d=LJ}=e;const{items:m,containerId:h,activeIndex:y,disabled:g,disableTransforms:w,sortedRects:C,overIndex:T,useDragOverlay:S,strategy:R}=v.useContext(E2),k=FJ(r,g),M=m.indexOf(l),D=v.useMemo(()=>({sortable:{containerId:h,index:M,items:m},...a}),[h,a,M,m]),A=v.useMemo(()=>m.slice(m.indexOf(l)),[m,l]),{rect:O,node:L,isOver:V,setNodeRef:F}=MJ({id:l,data:D,disabled:k.droppable,resizeObserverConfig:{updateMeasurementsFor:A,...f}}),{active:W,activatorEvent:j,activeNodeRect:q,attributes:$,setNodeRef:B,listeners:_,isDragging:z,over:H,setActivatorNodeRef:K,transform:P}=CJ({id:l,data:D,attributes:{..._J,...n},disabled:k.draggable}),U=cZ(F,B),G=!!W,I=G&&!w&&Vh(y)&&Vh(T),Q=!S&&z,le=Q&&I?P:null,Z=I?le??(c??R)({rects:C,activeNodeRect:q,activeIndex:y,overIndex:T,index:M}):null,ue=Vh(y)&&Vh(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}),Pe=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=zJ({disabled:!te,index:M,node:L,rect:O});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 Le=setTimeout(()=>{Se.current.activeId=ve},50);return()=>clearTimeout(Le)},[ve]),{active:W,activeIndex:y,attributes:$,data:D,rect:O,index:M,newIndex:ue,items:m,isOver:V,isSorting:G,isDragging:z,listeners:_,node:L,overIndex:T,over:H,setNodeRef:U,setActivatorNodeRef:K,setDroppableNodeRef:F,setDraggableNodeRef:B,transform:he??Z,transition:ye()};function ye(){if(he||Pe&&Se.current.newIndex===M)return jJ;if(!(Q&&!l0(j)||!d)&&(G||te))return Qs.Transition.toString({...d,property:C2})}}function FJ(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 Fp(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 BJ=[rn.Down,rn.Right,rn.Up,rn.Left],HJ=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:a,droppableContainers:o,over:l,scrollableAncestors:c}}=t;if(BJ.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=TZ({collisionRect:r,droppableRects:a,droppableContainers:f});let m=a2(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=Tm(w).some((A,O)=>c[O]!==A),S=T2(h,y),R=UJ(h,y),k=T||!S?{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:kd(M,k)}}}};function T2(e,t){return!Fp(e)||!Fp(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function UJ(e,t){return!Fp(e)||!Fp(t)||!T2(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function Cee(e){return e}function R2(e){return encodeURIComponent(e)}function k2({status:e}){return E.jsx("span",{className:je("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 y0(){return EZ(qb(m2,{activationConstraint:{distance:8}}),qb(g2,{activationConstraint:{delay:250,tolerance:5}}),qb(d0,{coordinateGetter:HJ}))}function VJ(){const{t:e}=Sn(),t=sa(),n=Px(),{isMobile:r,setOpenMobile:a}=Ti(),{toggleDevice:o}=bF(),l=ln(ee=>ee.sessions),c=ln(ee=>ee.activeSessionId),f=ra(ee=>ee.setSidebarTab);v.useEffect(()=>{const ee=ln.getState();ee.ensureInitialized(),ee.loadSessions()},[]);const d=pc("/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=qn(ee=>ee.snapshots),w=qn(ee=>ee.connectedDevices),C=qn(ee=>ee.closeWindow),T=qn(ee=>ee.closePane),S=qn(ee=>ee.renameWindow),R=Vs(ee=>{var fe;return((fe=ee.settings)==null?void 0:fe.language)??"en_US"}),{data:k}=Vo({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=qn(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]),A=v.useCallback((ee,fe,Oe,He)=>{F.current=null,window.dispatchEvent(new CustomEvent("tmex:user-initiated-selection",{detail:{deviceId:ee,windowId:fe,paneId:Oe}})),D(`/devices/${ee}/windows/${fe}/panes/${R2(Oe)}`,{keepSidebarOpen:He==null?void 0:He.keepSidebarOpen})},[D]),O=v.useCallback(ee=>{var fe,Oe;if(ln.getState().setActiveSession(ee.id),f("agent"),ee.deviceId&&ee.paneId){const He=(Oe=(fe=qn.getState().snapshots[ee.deviceId])==null?void 0:fe.session)==null?void 0:Oe.windows,$e=He==null?void 0:He.find(et=>et.panes.some(ze=>ze.id===ee.paneId));$e&&A(ee.deviceId,$e.id,ee.paneId,{keepSidebarOpen:!0})}},[f,A]),L=v.useCallback((ee,fe,Oe)=>{A(ee,fe,Oe.id,{keepSidebarOpen:!0}),ln.getState().startDraft(ee,Oe.id,Oe.title??null),f("agent")},[A,f]),V=qn(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:Oe}=ee,He=g[fe],$e=(Ze=He==null?void 0:He.session)==null?void 0:Ze.windows;if(!$e)return;const et=$e.find(Ct=>Ct.id===Oe);if(!((tt=et==null?void 0:et.panes)!=null&&tt.length))return;F.current=null;const ze=et.panes.find(Ct=>Ct.active)??et.panes[0];A(fe,Oe,ze.id)},[g,A]);const W=v.useCallback((ee,fe,Oe)=>{V(ee,fe);const He=Oe.find($e=>$e.active)??Oe[0];He?(A(ee,fe,He.id),F.current=null):F.current={deviceId:ee,windowId:fe,at:Date.now()}},[A,V]),j=v.useCallback((ee,fe)=>{fe?ee===m&&D("/devices"):D(`/devices/${ee}`),o(ee,fe)},[o,m,D]),q=v.useCallback((ee,fe)=>{ee===m&&fe===h&&D("/devices"),C(ee,fe)},[C,m,h,D]),[$,B]=v.useState(null),_=v.useCallback((ee,fe)=>{var $e,et;const Oe=(et=($e=qn.getState().snapshots[ee])==null?void 0:$e.session)==null?void 0:et.windows,He=Oe==null?void 0:Oe.find(ze=>ze.id===fe);B({kind:"window",deviceId:ee,windowId:fe,name:He?LU(He):""})},[]),z=v.useCallback((ee,fe,Oe)=>{var et,ze,Ze,tt;const He=(ze=(et=qn.getState().snapshots[ee])==null?void 0:et.session)==null?void 0:ze.windows,$e=(tt=(Ze=He==null?void 0:He.find(Ct=>Ct.id===fe))==null?void 0:Ze.panes)==null?void 0:tt.find(Ct=>Ct.id===Oe);B({kind:"pane",deviceId:ee,paneId:Oe,name:($e==null?void 0:$e.title)||`Pane ${($e==null?void 0:$e.index)??""}`})},[]),H=v.useCallback(()=>{$&&($.kind==="window"?q($.deviceId,$.windowId):T($.deviceId,$.paneId),B(null))},[$,q,T]),[K,P]=v.useState(null),[U,G]=v.useState(""),I=v.useCallback((ee,fe)=>{var $e,et;const Oe=(et=($e=qn.getState().snapshots[ee])==null?void 0:$e.session)==null?void 0:et.windows,He=Oe==null?void 0:Oe.find(ze=>ze.id===fe);He&&(G(He.customName??tw(He).title),P({deviceId:ee,windowId:fe,hasCustomName:!!He.customName}))},[]),Q=v.useCallback(()=>{if(!K)return;const ee=U.trim();ee&&(S(K.deviceId,K.windowId,ee),P(null))},[K,U,S]),le=v.useCallback(()=>{K&&(S(K.deviceId,K.windowId,""),P(null))},[K,S]),ae=v.useCallback(ee=>{qn.getState().createWindow(ee)},[]),[Z,ue]=v.useState(null),ve=v.useCallback((ee,fe)=>{ue({deviceId:ee,paneId:fe})},[]),[Se,Pe]=v.useState(null),[te,he]=v.useState(""),[ye,Le]=v.useState(null),Ae=v.useCallback(ee=>{he(ee.title),Pe(ee)},[]),Ce=v.useCallback(()=>{if(!Se)return;const ee=te.trim();ee&&(ln.getState().renameSession(Se.id,ee),Pe(null))},[Se,te]),Re=v.useCallback(ee=>{Le(ee)},[]),J=v.useCallback(()=>{ye&&(ln.getState().deleteSession(ye.id),Le(null))},[ye]),Ee=Ld(),xe=y0(),Be=pd({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 Oe=new Map(fe.devices.map(et=>[et.id,et])),He=ee.map((et,ze)=>{const Ze=Oe.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,Oe)=>{Oe!=null&&Oe.previous&&Ee.setQueryData(["devices"],Oe.previous),mn.error(e("device.reorderFailed"))},onSettled:()=>{Ee.invalidateQueries({queryKey:["devices"]})}}),qe=(k==null?void 0:k.devices)??[],De=v.useMemo(()=>[...qe].sort((ee,fe)=>ee.sortOrder-fe.sortOrder||ee.name.localeCompare(fe.name,eA(R),{numeric:!0,sensitivity:"base"})),[qe,R]),ut=v.useCallback(ee=>{const{active:fe,over:Oe}=ee;if(!Oe||fe.id===Oe.id)return;const He=De.map(ze=>ze.id),$e=He.indexOf(String(fe.id)),et=He.indexOf(String(Oe.id));$e<0||et<0||Be.mutate(nf(He,$e,et))},[De,Be]),{sessionsByPane:pe,orphanSessions:Te}=v.useMemo(()=>{const ee=new Set(qe.map($e=>$e.id)),fe=new Map,Oe=[],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)){Oe.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:Oe}},[l,qe]);return E.jsxs(LD,{className:"flex flex-col flex-1 min-h-0 pt-0",children:[E.jsx(h0,{sensors:xe,collisionDetection:c0,onDragEnd:ut,children:E.jsx(QQ,{className:"flex-1 min-h-0",children:E.jsxs("div",{className:"space-y-1.5 pb-2 pt-1 select-none [-webkit-user-select:none] [-webkit-touch-callout:none]",children:[E.jsx(m0,{items:De.map(ee=>ee.id),strategy:p0,children:De.map(ee=>{var fe,Oe;return E.jsx(qJ,{device:ee,windows:((Oe=(fe=g[ee.id])==null?void 0:fe.session)==null?void 0:Oe.windows)??null,isConnected:w.has(ee.id),isSelected:ee.id===m,selectedWindowId:h,selectedPaneId:y,onConnectToggle:()=>j(ee.id,w.has(ee.id)),onCreateWindow:ae,onCloseWindow:_,onClosePane:z,onRenameWindow:I,onPaneClick:A,onWindowClick:W,onWatchPane:ve,sessionsByPane:pe,activeSessionId:c,onSelectSession:O,onCreateSessionForPane:L,onRenameSession:Ae,onDeleteSession:Re},ee.id)})}),De.length===0&&E.jsx("div",{className:"text-center text-sm text-muted-foreground py-4",children:e("sidebar.noDevices")}),Te.length>0&&E.jsx(WJ,{sessions:Te,activeSessionId:c,onSelectSession:O,onRenameSession:Ae,onDeleteSession:Re})]})})}),E.jsx(tx,{open:$!==null,onOpenChange:ee=>!ee&&B(null),children:E.jsxs(nx,{children:[E.jsxs(rx,{children:[E.jsx(Ek,{className:"bg-destructive/10",children:E.jsx(Ua,{className:"h-5 w-5 text-destructive"})}),E.jsx(ax,{children:($==null?void 0:$.kind)==="pane"?e("window.closePaneConfirmTitle"):e("window.closeConfirmTitle")}),E.jsx(ox,{children:e("window.closeConfirmDesc",{name:($==null?void 0:$.name)??""})})]}),E.jsxs(ix,{children:[E.jsx(lx,{children:e("common.cancel")}),E.jsx(sx,{variant:"destructive",disabled:!$,onClick:H,children:e("common.close")})]})]})}),E.jsx(cx,{open:K!==null,onOpenChange:ee=>!ee&&P(null),children:E.jsx(ux,{"data-testid":"window-rename-dialog",children:E.jsxs("form",{onSubmit:ee=>{ee.preventDefault(),Q()},children:[E.jsxs(dx,{children:[E.jsx(fx,{children:e("window.rename")}),E.jsx(UD,{children:e("window.renameDesc")})]}),E.jsx("div",{className:"py-4",children:E.jsx(Ii,{autoFocus:!0,maxLength:64,value:U,onChange:ee=>G(ee.target.value),placeholder:e("window.renamePlaceholder"),"data-testid":"window-rename-input"})}),E.jsxs(Ck,{children:[(K==null?void 0:K.hasCustomName)&&E.jsx(qt,{type:"button",variant:"ghost",onClick:le,"data-testid":"window-rename-reset",children:e("window.renameReset")}),E.jsx(qt,{type:"button",variant:"outline",onClick:()=>P(null),children:e("common.cancel")}),E.jsx(qt,{type:"submit",disabled:!U.trim(),"data-testid":"window-rename-save",children:e("common.save")})]})]})})}),E.jsx(cx,{open:Se!==null,onOpenChange:ee=>!ee&&Pe(null),children:E.jsx(ux,{"data-testid":"agent-session-rename-dialog",children:E.jsxs("form",{onSubmit:ee=>{ee.preventDefault(),Ce()},children:[E.jsx(dx,{children:E.jsx(fx,{children:e("agent.session.renameTitle")})}),E.jsx("div",{className:"py-4",children:E.jsx(Ii,{autoFocus:!0,maxLength:120,value:te,onChange:ee=>he(ee.target.value),placeholder:e("agent.session.renamePlaceholder"),"data-testid":"agent-session-rename-input"})}),E.jsxs(Ck,{children:[E.jsx(qt,{type:"button",variant:"outline",onClick:()=>Pe(null),children:e("agent.session.cancel")}),E.jsx(qt,{type:"submit",disabled:!te.trim(),"data-testid":"agent-session-rename-save",children:e("agent.session.save")})]})]})})}),E.jsx(tx,{open:ye!==null,onOpenChange:ee=>!ee&&Le(null),children:E.jsxs(nx,{children:[E.jsxs(rx,{children:[E.jsx(Ek,{className:"bg-destructive/10",children:E.jsx(Ua,{className:"h-5 w-5 text-destructive"})}),E.jsx(ax,{children:e("agent.session.deleteTitle")}),E.jsx(ox,{children:e("agent.session.deleteDesc",{title:(ye==null?void 0:ye.title)??""})})]}),E.jsxs(ix,{children:[E.jsx(lx,{children:e("common.cancel")}),E.jsx(sx,{variant:"destructive",disabled:!ye,onClick:J,"data-testid":"agent-session-delete-confirm",children:e("agent.session.deleteConfirm")})]})]})}),Z&&E.jsx(oZ,{open:!0,onOpenChange:ee=>!ee&&ue(null),deviceId:Z.deviceId,paneId:Z.paneId})]})}function qJ({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:S,onRenameSession:R,onDeleteSession:k}){const{t:M}=Sn(),D=e.type==="local"?qx:hA,{attributes:A,listeners:O,setNodeRef:L,setActivatorNodeRef:V,transform:F,transition:W,isDragging:j}=g0({id:e.id}),q=y0(),$=B=>{const{active:_,over:z}=B;if(!z||_.id===z.id||!t)return;const H=t.map(U=>U.id),K=H.indexOf(String(_.id)),P=H.indexOf(String(z.id));K<0||P<0||qn.getState().reorderWindows(e.id,nf(H,K,P))};return E.jsxs("div",{ref:L,style:{transform:Qs.Translate.toString(F),transition:W},"data-testid":`device-item-${e.id}`,className:je("group/device rounded-xl border border-border/60 overflow-hidden",r?"bg-card":n?"bg-muted/40":"bg-muted/20",j&&"opacity-60 shadow-lg"),onClick:n?void 0:l,children:[E.jsxs("div",{className:"relative px-3 py-1.5",children:[r&&E.jsx("span",{className:"absolute left-0 top-0 bottom-0 w-0.5 bg-muted-foreground/70"}),E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx("button",{type:"button",ref:V,...A,...O,"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:E.jsx(Vx,{className:"h-3.5 w-3.5 [@media(any-pointer:coarse)]:h-5 [@media(any-pointer:coarse)]:w-5"})}),E.jsx(D,{className:"h-4 w-4 text-muted-foreground shrink-0"}),E.jsx("span",{className:"flex-1 truncate text-xs font-medium",children:e.name}),E.jsx(lQ,{deviceId:e.id,className:"shrink-0"}),E.jsx("div",{className:je("h-2 w-2 rounded-full shrink-0",n?"bg-emerald-500":"bg-gray-400")}),E.jsx(qt,{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?E.jsx(gB,{className:"h-3.5 w-3.5 text-orange-500"}):E.jsx(bB,{className:"h-3.5 w-3.5 text-emerald-500"})})]})]}),n&&E.jsxs("div",{className:"p-1.5 space-y-1.5 [@media(any-pointer:coarse)]:space-y-2",children:[!t&&E.jsx("div",{className:"text-xs text-muted-foreground px-2 py-1.5 text-center",children:M("device.connecting")}),(t==null?void 0:t.length)===0&&E.jsx("div",{className:"text-xs text-muted-foreground px-2 py-1.5 text-center",children:M("window.noWindows")}),t&&t.length>0&&E.jsx(h0,{sensors:q,collisionDetection:c0,onDragEnd:$,children:E.jsx(m0,{items:t.map(B=>B.id),strategy:p0,children:t.map(B=>E.jsx($J,{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:S,onRenameSession:R,onDeleteSession:k},B.id))})}),E.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:[E.jsx(Wp,{className:"h-3.5 w-3.5 shrink-0"}),E.jsx("span",{className:"text-xs",children:M("window.new")})]})]})]})}function $J({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}=Sn(),{isMobile:S}=Ti(),R=t.panes.length>1,k=tw(t),M=t.panes.find(B=>B.id===r),D=n&&!!M,{attributes:A,listeners:O,setNodeRef:L,setActivatorNodeRef:V,transform:F,transition:W,isDragging:j}=g0({id:t.id}),q=y0(),$=B=>{const{active:_,over:z}=B;if(!z||_.id===z.id)return;const H=t.panes.map(U=>U.id),K=H.indexOf(String(_.id)),P=H.indexOf(String(z.id));K<0||P<0||qn.getState().reorderPanes(e,t.id,nf(H,K,P))};return E.jsxs("div",{ref:L,style:{transform:Qs.Translate.toString(F),transition:W},className:je("space-y-1",j&&"opacity-60"),children:[E.jsxs("div",{className:"group relative flex items-center gap-1",children:[E.jsx("button",{type:"button",ref:V,...A,...O,"aria-label":T("window.dragHandle"),onClick:B=>B.stopPropagation(),className:je("touch-none cursor-grab shrink-0 flex items-center justify-center text-muted-foreground/50 hover:text-muted-foreground opacity-100",S?"h-9 w-4":"h-6 w-3.5 [@media(any-pointer:coarse)]:h-9 [@media(any-pointer:coarse)]:w-4"),children:E.jsx(Vx,{className:je(S?"h-4 w-4":"h-3.5 w-3.5")})}),E.jsxs("button",{type:"button",onClick:()=>o(e,t.id,t.panes),"data-testid":`window-item-${t.id}`,className:je("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",S&&"py-2.5 pr-13",D?"bg-primary/10 text-primary":t.active?"bg-accent text-accent-foreground":"hover:bg-accent/50 text-foreground"),children:[E.jsx(Ks,{variant:D?"default":"outline",className:"h-5 text-[10px] px-1.5 shrink-0",children:t.index}),E.jsxs("span",{className:"flex-1 min-w-0",children:[E.jsx("span",{className:"font-mono text-[11px] leading-tight font-medium line-clamp-2 [overflow-wrap:break-word]",children:k.title}),k.processName&&E.jsx("span",{className:"font-mono text-[10.5px] leading-tight text-muted-foreground line-clamp-1 break-all",children:k.processName})]})]}),E.jsxs(t0,{children:[E.jsx(n0,{"data-testid":`window-menu-${t.id}`,"aria-label":T("window.menu"),title:T("window.menu"),className:je("absolute top-1/2 -translate-y-1/2 flex items-center justify-center rounded text-muted-foreground hover:bg-background hover:text-foreground transition-opacity data-popup-open:opacity-100",S?"h-11 w-11 right-0 rounded-lg bg-background/40 opacity-100":"h-5 w-5 right-1.5 [@media(any-pointer:coarse)]:h-10 [@media(any-pointer:coarse)]:w-10 [@media(any-pointer:coarse)]:right-0.5 [@media(any-pointer:coarse)]:rounded-lg",D?"opacity-100":"opacity-0 group-hover:opacity-100 [@media(any-pointer:coarse)]:opacity-100"),children:E.jsx(fA,{className:je(S?"h-5 w-5":"h-3.5 w-3.5 [@media(any-pointer:coarse)]:h-4.5 [@media(any-pointer:coarse)]:w-4.5")})}),E.jsxs(r0,{align:"end",backdrop:!0,className:"w-auto min-w-36 [@media(any-pointer:coarse)]:min-w-48",children:[E.jsxs(ec,{"data-testid":`window-menu-rename-${t.id}`,className:je("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",S&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>f(e,t.id),children:[E.jsx(Yp,{className:je("h-4 w-4",S&&"h-5 w-5")}),T("window.rename")]}),E.jsxs(ec,{"data-testid":`window-menu-new-session-${t.id}`,className:je("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",S&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>g(e,t.id,M||t.panes[0]),children:[E.jsx(Wp,{className:je("h-4 w-4",S&&"h-5 w-5")}),T("agent.session.new")]}),E.jsxs(ec,{variant:"destructive","data-testid":`window-menu-close-${t.id}`,className:je("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",S&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>l(e,t.id),children:[E.jsx(Ua,{className:je("h-4 w-4",S&&"h-5 w-5")}),T("window.close")]})]})]})]}),R&&E.jsx("div",{className:"ml-4 pl-2 border-l border-border/50 space-y-1 [@media(any-pointer:coarse)]:space-y-1.5",children:E.jsx(h0,{sensors:q,collisionDetection:c0,onDragEnd:$,children:E.jsx(m0,{items:t.panes.map(B=>B.id),strategy:p0,children:t.panes.map(B=>E.jsx(YJ,{deviceId:e,windowId:t.id,pane:B,isActive:B.id===r,isMobile:S,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]&&E.jsx("div",{className:"ml-[36px] pl-2 border-l border-border/50",children:E.jsx(A2,{sessions:m.get(`${e}:${t.panes[0].id}`),activeSessionId:h,onSelectSession:y,onRenameSession:w,onDeleteSession:C})})]})}function YJ({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}=Sn(),{attributes:w,listeners:C,setNodeRef:T,setActivatorNodeRef:S,transform:R,transition:k,isDragging:M}=g0({id:n.id});return E.jsxs("div",{ref:T,style:{transform:Qs.Translate.toString(R),transition:k},className:je("group relative",M&&"opacity-60"),children:[E.jsxs("div",{className:"flex items-center gap-1",children:[E.jsx("button",{type:"button",ref:S,...w,...C,"aria-label":g("window.dragHandlePane"),onClick:D=>D.stopPropagation(),className:je("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:E.jsx(Vx,{className:je(a?"h-4 w-4":"h-3 w-3")})}),E.jsxs("button",{type:"button",onClick:()=>o(e,t,n.id),"data-testid":`pane-item-${n.id}`,className:je("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:[E.jsx("span",{className:"text-[10px] font-mono opacity-60 w-4",children:n.index}),E.jsx("span",{className:"flex-1 text-xs line-clamp-2 break-all",children:n.title||`Pane ${n.index}`})]})]}),E.jsxs(t0,{children:[E.jsx(n0,{"data-testid":`pane-menu-${n.id}`,"aria-label":g("watch.openMonitor"),className:je("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:E.jsx(fA,{className:je(a?"h-5 w-5":"h-3.5 w-3.5")})}),E.jsx(r0,{align:"end",backdrop:!0,className:"w-auto min-w-36 [@media(any-pointer:coarse)]:min-w-48",children:E.jsxs(ec,{"data-testid":`pane-watch-${n.id}`,className:je("[@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:[E.jsx(xB,{className:je("h-4 w-4",a&&"h-5 w-5")}),g("watch.openMonitor")]})})]}),E.jsx("button",{type:"button",onClick:D=>{D.stopPropagation(),l(e,t,n.id)},"data-testid":`pane-close-${n.id}`,className:je("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:E.jsx("span",{className:je("leading-none",a?"text-base":"text-xs"),children:"×"})}),E.jsx(A2,{sessions:f,activeSessionId:d,onSelectSession:m,onRenameSession:h,onDeleteSession:y})]})}function M2({session:e,onRenameSession:t,onDeleteSession:n,className:r,enlargeOnTouch:a=!1}){const{t:o}=Sn(),{isMobile:l}=Ti(),c=a&&l;return E.jsxs(t0,{children:[E.jsx(n0,{render:E.jsx(qt,{variant:"ghost",size:"icon-sm","data-testid":`agent-session-menu-${e.id}`,"aria-label":o("agent.session.rename"),onClick:f=>f.stopPropagation(),className:je("size-5 shrink-0 text-muted-foreground transition-opacity data-popup-open:opacity-100",l?"opacity-100":"opacity-0 group-hover:opacity-100 [@media(any-pointer:coarse)]:opacity-100",c&&"size-9",r)}),children:E.jsx(qF,{className:je("size-3.5",c&&"size-5")})}),E.jsxs(r0,{align:"end",backdrop:!0,className:"w-auto min-w-36 [@media(any-pointer:coarse)]:min-w-48",children:[E.jsxs(ec,{"data-testid":"agent-session-rename",className:je("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",l&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>t(e),children:[E.jsx(Yp,{className:je("h-4 w-4",l&&"h-5 w-5")}),o("agent.session.rename")]}),E.jsxs(ec,{variant:"destructive","data-testid":"agent-session-delete",className:je("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",l&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>n(e),children:[E.jsx(mA,{className:je("h-4 w-4",l&&"h-5 w-5")}),o("agent.session.delete")]})]})]})}function A2({sessions:e,activeSessionId:t,onSelectSession:n,onRenameSession:r,onDeleteSession:a}){const{isMobile:o}=Ti();return E.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 E.jsxs("div",{className:"group relative",children:[E.jsxs("button",{type:"button","data-testid":`agent-session-item-${l.id}`,onClick:()=>n(l),className:je("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:[E.jsx(Ux,{className:"size-3 shrink-0 opacity-70"}),E.jsx("span",{className:"min-w-0 flex-1 truncate text-[11px]",children:l.title}),E.jsx(k2,{status:l.status})]}),E.jsx("div",{className:"absolute right-0.5 top-1/2 -translate-y-1/2",children:E.jsx(M2,{session:l,onRenameSession:r,onDeleteSession:a,enlargeOnTouch:!0})})]},l.id)})})}function WJ({sessions:e,activeSessionId:t,onSelectSession:n,onRenameSession:r,onDeleteSession:a}){const{t:o}=Sn(),[l,c]=v.useState(!1),f=Vs(d=>{var m;return((m=d.settings)==null?void 0:m.language)??"en_US"});return E.jsxs(um,{open:l,onOpenChange:c,className:"rounded-xl border border-border/60 bg-muted/20",children:[E.jsxs(dm,{"data-testid":"agent-orphan-sessions-trigger",className:"flex w-full items-center gap-2 px-3 py-1.5 text-left",children:[E.jsx(ZF,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),E.jsx("span",{className:"flex-1 truncate text-xs font-medium text-muted-foreground",children:o("agent.orphan.title",{count:e.length})}),E.jsx($p,{className:je("h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform",l&&"rotate-90")})]}),E.jsx(fm,{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(eA(f)):null].filter(y=>!!y);return E.jsxs("div",{className:"group relative",children:[E.jsxs("button",{type:"button","data-testid":`agent-orphan-session-${d.id}`,onClick:()=>n(d),className:je("w-full flex flex-col gap-0.5 px-2 py-1.5 pr-7 rounded-lg text-left transition-colors",m?"bg-primary/10 text-primary":"hover:bg-accent/30"),children:[E.jsxs("span",{className:"flex items-center gap-1.5",children:[E.jsx(Ux,{className:"size-3 shrink-0 opacity-70"}),E.jsx("span",{className:"min-w-0 flex-1 truncate text-[11px]",children:d.title}),E.jsx(k2,{status:d.status})]}),h.length>0&&E.jsx("span",{className:"truncate pl-[18px] text-[10px] text-muted-foreground",children:h.join(" · ")})]}),E.jsx("div",{className:"absolute right-0.5 top-1.5",children:E.jsx(M2,{session:d,onRenameSession:r,onDeleteSession:a})})]},d.id)})})]})}function KJ(){const{t:e}=Sn(),{isMobile:t,setOpenMobile:n}=Ti(),r=Vs(m=>{var h;return(h=m.settings)==null?void 0:h.siteName}),a=Vs(m=>m.fetchSettings);v.useEffect(()=>{a()},[a]);const o=r??"tmex",l=ra(m=>m.theme),c=ra(m=>m.setTheme),f=l==="dark",d=()=>{const m=f?"light":"dark";c(m),document.documentElement.classList.toggle("dark",m==="dark")};return E.jsxs("div",{className:"flex items-center gap-2 px-2",children:[t&&E.jsx("button",{type:"button","data-testid":"mobile-sidebar-close",onClick:()=>n(!1),className:"inline-flex h-8 w-8 ml-[-8px] shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-sidebar-accent hover:text-foreground","aria-label":e("nav.closeSidebar"),title:e("nav.closeSidebar"),children:E.jsx(Ua,{className:"h-4 w-4"})}),E.jsxs(Ip,{to:"/",className:"flex flex-1 items-center gap-3 overflow-hidden",children:[E.jsx("div",{className:"h-8 w-8 shrink-0 overflow-hidden rounded-lg border-2 border-black",children:E.jsx("img",{src:"/logo.png",alt:o,className:"h-full w-full object-cover"})}),E.jsx("span",{className:"truncate text-sm font-semibold tracking-tight",children:o})]}),E.jsx("button",{type:"button",onClick:d,className:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-sidebar-accent hover:text-foreground","aria-label":e(f?"settings.themeLight":"settings.themeDark"),title:e(f?"settings.themeLight":"settings.themeDark"),children:f?E.jsx(DB,{className:"h-4 w-4"}):E.jsx(lB,{className:"h-4 w-4"})}),E.jsx(Ip,{to:"/settings",className:"inline-flex h-8 w-8 mr-[-8px] shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-sidebar-accent hover:text-foreground","aria-label":e("sidebar.settings"),title:e("sidebar.settings"),children:E.jsx(kB,{className:"h-4 w-4"})})]})}const Kb="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]",GJ=[{title:"nav.manageDevices",url:"/devices",icon:qx}];function XJ({...e}){const{t}=Sn(),n=ra(a=>a.sidebarTab),r=ra(a=>a.setSidebarTab);return E.jsxs(NX,{variant:"inset",...e,children:[E.jsx("div",{className:"h-[var(--tmex-safe-area-top)]"}),E.jsxs(LX,{className:"gap-5 pt-3 pb-0",children:[E.jsx(KJ,{}),E.jsx(rQ,{className:"mb-2.5",value:n,onValueChange:a=>r(a),children:E.jsxs(aQ,{className:"w-full p-1 rounded-xl border border-border/60 group-data-horizontal/tabs:h-11",children:[E.jsxs(Hb,{value:"panes","data-testid":"sidebar-tab-panes",className:Kb,children:[E.jsx(fB,{}),t("sidebar.tab.panes")]}),E.jsxs(Hb,{value:"agent","data-testid":"sidebar-tab-agent",className:Kb,children:[E.jsx(Ux,{}),t("sidebar.tab.agent")]}),E.jsxs(Hb,{value:"files","data-testid":"sidebar-tab-files",className:Kb,children:[E.jsx(YF,{}),t("sidebar.tab.files")]})]})})]}),E.jsxs(_X,{className:"flex min-h-0 flex-col overflow-hidden",children:[n==="panes"&&E.jsx(VJ,{}),n==="agent"&&E.jsx(zG,{}),n==="files"&&E.jsx(FG,{})]}),n==="panes"&&E.jsxs(jX,{children:[E.jsx(oQ,{items:GJ}),E.jsx("div",{className:"h-[var(--tmex-safe-area-bottom)]"})]})]})}let qk=!1;function QJ(e,t,n){var a,o,l;let r=n;if(!r){const c=(o=(a=qn.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/${R2(t)}`:`/devices/${e}`}function ZJ(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 JJ(e,t){var r;const n=ZJ(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 eee(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 tee(e,t){e.invalidateQueries({queryKey:["watch-rules"]}),e.invalidateQueries({queryKey:["watch-rule-state",t]})}async function nee(e,t,n,r,a){const l=await JJ(e,t)??En.t("watch.toast.triggeredTitle"),c=a.summary||a.matchedText||"",f=c.length>200?`${c.slice(0,200)}…`:c,d=QJ(n,r,a.windowId);mn(l,{description:f,action:{label:En.t("watch.toast.openTerminal"),onClick:()=>{window.location.href=d}}}),eee(l,f,d)}function ree(e){if(qk)return;qk=!0,Nn().onMessage(n=>{if(n.kind!==t4)return;let r;try{r=La(l5,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(tee(e,r.ruleId),r.eventType){case m4:nee(e,r.ruleId,r.deviceId,r.paneId,a);return;case g4:{const o=a;mn.warning(En.t("watch.toast.modelUnavailableTitle"),{description:`${o.message} ${En.t("watch.toast.modelUnavailableHint")}`});return}case y4:{const o=a;mn.error(En.t("watch.toast.ruleErrorTitle"),{description:o.message});return}default:return}})}function iee(){const e=Ld();return v.useEffect(()=>{ree(e),Nn().connect()},[e]),null}const aee=60,oee=.02;function see(e){if(Math.abs(e.viewportScale-1)>oee)return 0;const t=Math.round(e.windowInnerHeight-e.viewportHeight-e.viewportOffsetTop);return t>=aee?t:0}function Tee(){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 lee(){return typeof window>"u"||typeof navigator>"u"?!1:"ontouchstart"in window||navigator.maxTouchPoints>0}function cee(e){const[t,n]=v.useState(0);return v.useEffect(()=>{if(!lee())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(see({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 uee(){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")}}uee();const dee=new hL({defaultOptions:{queries:{staleTime:5e3,retry:1}}});function fee(){const{openMobile:e}=Ti(),t=ra(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 hee(){return E.jsxs(vF,{children:[E.jsx(iee,{}),E.jsxs(OX,{children:[E.jsx(fee,{}),E.jsx(XJ,{}),E.jsx(pee,{})]})]})}function pee(){const{openMobile:e}=Ti(),t=cee(e);return E.jsxs(PX,{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:[E.jsx(S_,{}),E.jsx("div",{style:{height:t>0?0:"var(--tmex-safe-area-bottom)",transition:"height 0.12s ease-out"}})]})}function qu({moduleLoader:e}){const[t,n]=v.useState(null),r=e_();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 E.jsxs(E.Fragment,{children:[E.jsxs("header",{className:"sticky top-0 z-10 flex h-12 md:h-16 shrink-0 items-center justify-between gap-2 bg-background/95 backdrop-blur-sm","data-testid":"mobile-topbar",children:[E.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2 px-4",children:[E.jsx(IX,{className:"-ml-1 shrink-0","data-testid":"mobile-sidebar-open"}),E.jsx(VG,{orientation:"vertical",className:"mr-2 shrink-0 data-[orientation=vertical]:h-4"}),E.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:o?E.jsx(o,{...r}):""})]}),E.jsx("div",{className:"flex shrink-0 items-center gap-1 px-4",children:l&&E.jsx(l,{...r})})]}),E.jsx("div",{className:"flex min-h-0 flex-1 flex-col gap-4 !pt-0 p-2 md:p-4",children:E.jsx("div",{className:"bg-muted/50 min-h-0 flex-1 overflow-auto overscroll-auto rounded-xl [-webkit-overflow-scrolling:touch]",children:a?E.jsx(a,{}):null})})]})}const mee=()=>vx(()=>import("./SettingsPage-CKP305BP.js"),__vite__mapDeps([0,1,2])),$k=()=>vx(()=>import("./DevicesPage-BPLJu-5J.js"),__vite__mapDeps([3,1])),Yk=()=>vx(()=>import("./DevicePage-RqH-pnZX.js"),__vite__mapDeps([4,2])),gee=W_([{path:"/",Component:hee,children:[{index:!0,element:E.jsx(qu,{moduleLoader:$k})},{path:"devices",element:E.jsx(qu,{moduleLoader:$k})},{path:"devices/:deviceId",element:E.jsx(qu,{moduleLoader:Yk})},{path:"devices/:deviceId/windows/:windowId/panes/:paneId",element:E.jsx(qu,{moduleLoader:Yk})},{path:"settings",element:E.jsx(qu,{moduleLoader:mee})}]}]),O2=document.getElementById("root");if(!O2)throw new Error("Root element not found");DL.createRoot(O2).render(E.jsx(v.StrictMode,{children:E.jsxs(mL,{client:dee,children:[E.jsx(v_,{router:gee}),E.jsx(Dz,{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{lQ as $,tx as A,qt as B,Vo as C,cx as D,Vs as E,ra as F,vee as G,eA as H,Ii as I,En as J,OT as K,gc as L,qn as M,qx as N,Ek as O,Wp as P,hA as Q,t0 as R,ip as S,mA as T,n0 as U,qF as V,r0 as W,Ua as X,ec as Y,gA as Z,Eee as _,Ld as a,VG as a0,Fx as a1,fU as a2,ew as a3,je as a4,z5 as a5,_5 as a6,wee as a7,xd as a8,xee as a9,e_ as aa,Px as ab,Cee as ac,Tee as ad,PU as ae,R2 as af,See as ag,eB as ah,xB as ai,oZ as aj,eZ as ak,JQ as al,pd as b,Lt as c,ux as d,dx as e,fx as f,UD as g,ap as h,_b as i,E as j,op as k,Pa as l,Ck as m,mp as n,Ks as o,Yp as p,nx as q,v as r,rx as s,mn as t,Sn as u,ax as v,ox as w,ix as x,lx as y,sx as z};
400
- //# sourceMappingURL=index-O2a9149K.js.map