@workerdeck/web 1.0.0 → 1.1.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 (186) hide show
  1. package/dist/assets/abap-08VXUWAP.js +1 -0
  2. package/dist/assets/apex-BWPQTe0t.js +1 -0
  3. package/dist/assets/azcli-Bc_sGQ0U.js +1 -0
  4. package/dist/assets/bat-i0X4ZdIN.js +1 -0
  5. package/dist/assets/bicep-B5-_aFwp.js +2 -0
  6. package/dist/assets/cameligo-DMUM7wLl.js +1 -0
  7. package/dist/assets/clojure-Cm7r79vr.js +1 -0
  8. package/dist/assets/coffee-Ba7i2nA0.js +1 -0
  9. package/dist/assets/cpp-C7h46wYY.js +1 -0
  10. package/dist/assets/csharp-BKxtCVv1.js +1 -0
  11. package/dist/assets/csp-bTuwJoIa.js +1 -0
  12. package/dist/assets/css-DIMkf-bt.js +3 -0
  13. package/dist/assets/cypher-CVaqCwHa.js +1 -0
  14. package/dist/assets/dart-onAF5SnQ.js +1 -0
  15. package/dist/assets/dist-BtXT6Sf4.js +1 -0
  16. package/dist/assets/dist-QWwtnke2.js +2 -0
  17. package/dist/assets/dockerfile-DZFCIeNp.js +1 -0
  18. package/dist/assets/ecl-D05T4iGw.js +1 -0
  19. package/dist/assets/elixir-6RTg0lbw.js +1 -0
  20. package/dist/assets/emscripten-module.browser-5SUE27GY-C0NM25Z_.js +1 -0
  21. package/dist/assets/ffi-DuopEUiF.js +1 -0
  22. package/dist/assets/flow9-C5_-GSwl.js +1 -0
  23. package/dist/assets/freemarker2-BdPif1ny.js +3 -0
  24. package/dist/assets/fsharp-C8Ef5oNN.js +1 -0
  25. package/dist/assets/go-C-y9NEjX.js +1 -0
  26. package/dist/assets/graphql-fmXr3nnJ.js +1 -0
  27. package/dist/assets/handlebars-DwVdBVf0.js +1 -0
  28. package/dist/assets/hcl-CpzslTdj.js +1 -0
  29. package/dist/assets/highlighted-body-KPVGNVTW-CVEvHk7T.js +1 -0
  30. package/dist/assets/html-VuPCN_oy.js +1 -0
  31. package/dist/assets/index-B7-PiO0B.js +203 -0
  32. package/dist/assets/index-iUYfk6qq.css +2 -0
  33. package/dist/assets/ini-sBoK_t0W.js +1 -0
  34. package/dist/assets/java-BEtHBSE6.js +1 -0
  35. package/dist/assets/javascript-KcV6i_uV.js +1 -0
  36. package/dist/assets/julia-Bri6UV-V.js +1 -0
  37. package/dist/assets/kotlin-BOotOW0E.js +1 -0
  38. package/dist/assets/less-B9JPFI3C.js +2 -0
  39. package/dist/assets/lexon-CfSJPG6W.js +1 -0
  40. package/dist/assets/liquid-CCa4GCZ8.js +1 -0
  41. package/dist/assets/lua-CsQS60Ue.js +1 -0
  42. package/dist/assets/m3-D-oSqn_W.js +1 -0
  43. package/dist/assets/markdown-Cimd5fb3.js +1 -0
  44. package/dist/assets/mdx-BlPcythz.js +1 -0
  45. package/dist/assets/mermaid-HWGCJPDP-DOqoEVZq.js +1 -0
  46. package/dist/assets/mips-CIPQ_RoX.js +1 -0
  47. package/dist/assets/module-asyncify-R6PWJ6ZV-C_qleNZi.js +6 -0
  48. package/dist/assets/msdax-DauUninz.js +1 -0
  49. package/dist/assets/mysql-SOo6toE5.js +1 -0
  50. package/dist/assets/objective-c-FvmIjYaQ.js +1 -0
  51. package/dist/assets/pascal-DrH0SRf2.js +1 -0
  52. package/dist/assets/pascaligo-D-ptJ9y-.js +1 -0
  53. package/dist/assets/perl-oz_6vUea.js +1 -0
  54. package/dist/assets/pgsql-DTj74zXo.js +1 -0
  55. package/dist/assets/php-nr791fC2.js +1 -0
  56. package/dist/assets/pla-CopQ2nXW.js +1 -0
  57. package/dist/assets/postiats-43DmfD33.js +1 -0
  58. package/dist/assets/powerquery-D3hlyOfw.js +1 -0
  59. package/dist/assets/powershell-DmHpPYUd.js +1 -0
  60. package/dist/assets/protobuf-C531GsRP.js +2 -0
  61. package/dist/assets/pug-Z5eAx3Zn.js +1 -0
  62. package/dist/assets/python-BpDgS7wU.js +1 -0
  63. package/dist/assets/qsharp-DkqhCAOL.js +1 -0
  64. package/dist/assets/r-BwWrilGY.js +1 -0
  65. package/dist/assets/razor-Dzb2XurD.js +1 -0
  66. package/dist/assets/redis-ClamHrr6.js +1 -0
  67. package/dist/assets/redshift-DT7zqm-g.js +1 -0
  68. package/dist/assets/restructuredtext-BYgofb2h.js +1 -0
  69. package/dist/assets/ruby-DezsRK8O.js +1 -0
  70. package/dist/assets/rust-DdL9SqIa.js +1 -0
  71. package/dist/assets/sb-CcwsVR0C.js +1 -0
  72. package/dist/assets/scala-DHpiXF5c.js +1 -0
  73. package/dist/assets/scheme-BeGwcela.js +1 -0
  74. package/dist/assets/scss-gp-XZpBa.js +3 -0
  75. package/dist/assets/shell-CC2rA5mh.js +1 -0
  76. package/dist/assets/solidity-BEEn4gHE.js +1 -0
  77. package/dist/assets/sophia-CRfGWb83.js +1 -0
  78. package/dist/assets/sparql-D_Lu-MrJ.js +1 -0
  79. package/dist/assets/sql-NEE52Syq.js +1 -0
  80. package/dist/assets/src-C4bOKcbq.js +22 -0
  81. package/dist/assets/st-DbInun42.js +1 -0
  82. package/dist/assets/swift-Bxkupp3x.js +1 -0
  83. package/dist/assets/systemverilog-Bz4Y3fRF.js +1 -0
  84. package/dist/assets/tcl-DISqw1ZD.js +1 -0
  85. package/dist/assets/twig-De2hgUGE.js +1 -0
  86. package/dist/assets/typescript-CerielFy.js +1 -0
  87. package/dist/assets/typespec-B8J7ngcE.js +1 -0
  88. package/dist/assets/vb-DV3o63ZY.js +1 -0
  89. package/dist/assets/vs-CgLI4CIR.js +902 -0
  90. package/dist/assets/vs-DWxI6Y27.css +1 -0
  91. package/dist/assets/{wgsl-DumH7NcR.js → wgsl-DpFanUEy.js} +9 -9
  92. package/dist/assets/xml-CzSgAH1Q.js +1 -0
  93. package/dist/assets/yaml-D-SnOjNt.js +1 -0
  94. package/dist/index.html +2 -2
  95. package/package.json +18 -18
  96. package/dist/assets/abap-DLDM7-KI.js +0 -1
  97. package/dist/assets/apex-DNDY2TF8.js +0 -1
  98. package/dist/assets/azcli-Y6nb8tq_.js +0 -1
  99. package/dist/assets/bat-BwHxbl9M.js +0 -1
  100. package/dist/assets/bicep-CFznDFnq.js +0 -2
  101. package/dist/assets/cameligo-Bf6VGUru.js +0 -1
  102. package/dist/assets/clojure-Dnu-v4kV.js +0 -1
  103. package/dist/assets/coffee-Bd8akH9Z.js +0 -1
  104. package/dist/assets/cpp-BbWJElDN.js +0 -1
  105. package/dist/assets/csharp-Co3qMtFm.js +0 -1
  106. package/dist/assets/csp-D-4FJmMZ.js +0 -1
  107. package/dist/assets/css-DdJfP1eB.js +0 -3
  108. package/dist/assets/cypher-cTPe9QuQ.js +0 -1
  109. package/dist/assets/dart-BOtBlQCF.js +0 -1
  110. package/dist/assets/dockerfile-BG73LgW2.js +0 -1
  111. package/dist/assets/ecl-BEgZUVRK.js +0 -1
  112. package/dist/assets/elixir-BkW5O-1t.js +0 -1
  113. package/dist/assets/emscripten-module.browser-5SUE27GY-ntU7dq9B.js +0 -1
  114. package/dist/assets/ffi-CdNMd84O.js +0 -1
  115. package/dist/assets/flow9-BeJ5waoc.js +0 -1
  116. package/dist/assets/freemarker2-BjQKJR75.js +0 -3
  117. package/dist/assets/fsharp-PahG7c26.js +0 -1
  118. package/dist/assets/go-acbASCJo.js +0 -1
  119. package/dist/assets/graphql-BxJiqAUM.js +0 -1
  120. package/dist/assets/handlebars-DdzZ41QQ.js +0 -1
  121. package/dist/assets/hcl-DtV1sZF8.js +0 -1
  122. package/dist/assets/highlighted-body-OFNGDK62-H04khugu.js +0 -1
  123. package/dist/assets/html-DTlHA5zn.js +0 -1
  124. package/dist/assets/index-44R7RBlD.js +0 -22
  125. package/dist/assets/index-BSQur81o.js +0 -930
  126. package/dist/assets/index-CXkKwxiP.css +0 -1
  127. package/dist/assets/index-Cw8epeIo.js +0 -1
  128. package/dist/assets/index-DpUzmpr_.css +0 -1
  129. package/dist/assets/index-fLoM_ihM.js +0 -1209
  130. package/dist/assets/index-i5QQarYN.js +0 -2
  131. package/dist/assets/ini-Kd9XrMLS.js +0 -1
  132. package/dist/assets/java-CXBNlu9o.js +0 -1
  133. package/dist/assets/javascript-Cj1RpkWm.js +0 -1
  134. package/dist/assets/julia-cl7-CwDS.js +0 -1
  135. package/dist/assets/kotlin-s7OhZKlX.js +0 -1
  136. package/dist/assets/less-9HpZscsL.js +0 -2
  137. package/dist/assets/lexon-OrD6JF1K.js +0 -1
  138. package/dist/assets/liquid-DkYEpmq0.js +0 -1
  139. package/dist/assets/lua-Cyyb5UIc.js +0 -1
  140. package/dist/assets/m3-B8OfTtLu.js +0 -1
  141. package/dist/assets/markdown-BFxVWTOG.js +0 -1
  142. package/dist/assets/mdx-DfzU5VQY.js +0 -1
  143. package/dist/assets/mips-CiqrrVzr.js +0 -1
  144. package/dist/assets/module-asyncify-R6PWJ6ZV-V2kApR_G.js +0 -6
  145. package/dist/assets/msdax-DmeGPVcC.js +0 -1
  146. package/dist/assets/mysql-C_tMU-Nz.js +0 -1
  147. package/dist/assets/objective-c-BDtDVThU.js +0 -1
  148. package/dist/assets/pascal-vHIfCaH5.js +0 -1
  149. package/dist/assets/pascaligo-DtZ0uQbO.js +0 -1
  150. package/dist/assets/perl-Ub6l9XKa.js +0 -1
  151. package/dist/assets/pgsql-BlNEE0v7.js +0 -1
  152. package/dist/assets/php-BBUBE1dy.js +0 -1
  153. package/dist/assets/pla-DSh2-awV.js +0 -1
  154. package/dist/assets/postiats-CocnycG-.js +0 -1
  155. package/dist/assets/powerquery-tScXyioY.js +0 -1
  156. package/dist/assets/powershell-COWaemsV.js +0 -1
  157. package/dist/assets/protobuf-Brw8urJB.js +0 -2
  158. package/dist/assets/pug-8SOpv6rk.js +0 -1
  159. package/dist/assets/python-CDJH5-wi.js +0 -1
  160. package/dist/assets/qsharp-Bw9ernYp.js +0 -1
  161. package/dist/assets/r-j7ic8hl3.js +0 -1
  162. package/dist/assets/razor-BEws0ddb.js +0 -1
  163. package/dist/assets/redis-Bu5POkcn.js +0 -1
  164. package/dist/assets/redshift-Bs9aos_-.js +0 -1
  165. package/dist/assets/restructuredtext-CqXO7rUv.js +0 -1
  166. package/dist/assets/ruby-zBfavPgS.js +0 -1
  167. package/dist/assets/rust-BzKRNQWT.js +0 -1
  168. package/dist/assets/sb-BBc9UKZt.js +0 -1
  169. package/dist/assets/scala-D9hQfWCl.js +0 -1
  170. package/dist/assets/scheme-BPhDTwHR.js +0 -1
  171. package/dist/assets/scss-CBJaRo0y.js +0 -3
  172. package/dist/assets/shell-DiJ1NA_G.js +0 -1
  173. package/dist/assets/solidity-Db0IVjzk.js +0 -1
  174. package/dist/assets/sophia-CnS9iZB_.js +0 -1
  175. package/dist/assets/sparql-CJmd_6j2.js +0 -1
  176. package/dist/assets/sql-ClhHkBeG.js +0 -1
  177. package/dist/assets/st-CHwy0fLd.js +0 -1
  178. package/dist/assets/swift-Bqt4WxQ4.js +0 -3
  179. package/dist/assets/systemverilog-Bs9z6M-B.js +0 -1
  180. package/dist/assets/tcl-Dm6ycUr_.js +0 -1
  181. package/dist/assets/twig-Csy3S7wG.js +0 -1
  182. package/dist/assets/typescript-BmDBQa99.js +0 -1
  183. package/dist/assets/typespec-Btyra-wh.js +0 -1
  184. package/dist/assets/vb-Db0cS2oM.js +0 -1
  185. package/dist/assets/xml-BxrXC_-r.js +0 -1
  186. package/dist/assets/yaml-B-ctRatN.js +0 -1
@@ -0,0 +1,203 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vs-CgLI4CIR.js","assets/vs-DWxI6Y27.css"])))=>i.map(i=>d[i]);
2
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=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,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function P(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function F(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var I=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},L={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=L,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:F}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,I)}catch(e){I(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.8`})),d=o(((e,t)=>{t.exports=u()})),f=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}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(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=d();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.8`})),h=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=m()})),g=o((e=>{var t=p(),n=d(),r=h();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}var m=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),k=Symbol.for(`react.activity`),A=Symbol.for(`react.memo_cache_sentinel`),j=Symbol.iterator;function M(e){return typeof e!=`object`||!e?null:(e=j&&e[j]||e[`@@iterator`],typeof e==`function`?e:null)}var N=Symbol.for(`react.client.reference`);function P(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===N?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case k:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?P(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return P(e(t))}catch{}}return null}var F=Array.isArray,I=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee={pending:!1,data:null,method:null,action:null},R=[],te=-1;function z(e){return{current:e}}function B(e){0>te||(e.current=R[te],R[te]=null,te--)}function V(e,t){te++,R[te]=e.current,e.current=t}var ne=z(null),H=z(null),re=z(null),ie=z(null);function ae(e,t){switch(V(re,t),V(H,e),V(ne,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Xd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Xd(t),e=Zd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}B(ne),V(ne,e)}function oe(){B(ne),B(H),B(re)}function se(e){e.memoizedState!==null&&V(ie,e);var t=ne.current,n=Zd(t,e.type);t!==n&&(V(H,e),V(ne,n))}function ce(e){H.current===e&&(B(ne),B(H)),ie.current===e&&(B(ie),sp._currentValue=ee)}var le,ue;function de(e){if(le===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);le=t&&t[1]||``,ue=-1<e.stack.indexOf(`
3
+ at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
4
+ `+le+e+ue}var fe=!1;function pe(e,t){if(!e||fe)return``;fe=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
5
+ `),l=s.split(`
6
+ `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
7
+ `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{fe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?de(n):``}function me(e,t){switch(e.tag){case 26:case 27:case 5:return de(e.type);case 16:return de(`Lazy`);case 13:return e.child!==t&&t!==null?de(`Suspense Fallback`):de(`Suspense`);case 19:return de(`SuspenseList`);case 0:case 15:return pe(e.type,!1);case 11:return pe(e.type.render,!1);case 1:return pe(e.type,!0);case 31:return de(`Activity`);default:return``}}function he(e){try{var t=``,n=null;do t+=me(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
8
+ Error generating stack: `+e.message+`
9
+ `+e.stack}}var ge=Object.prototype.hasOwnProperty,_e=t.unstable_scheduleCallback,ve=t.unstable_cancelCallback,ye=t.unstable_shouldYield,be=t.unstable_requestPaint,xe=t.unstable_now,Se=t.unstable_getCurrentPriorityLevel,Ce=t.unstable_ImmediatePriority,we=t.unstable_UserBlockingPriority,Te=t.unstable_NormalPriority,Ee=t.unstable_LowPriority,De=t.unstable_IdlePriority,Oe=t.log,ke=t.unstable_setDisableYieldValue,Ae=null,je=null;function Me(e){if(typeof Oe==`function`&&ke(e),je&&typeof je.setStrictMode==`function`)try{je.setStrictMode(Ae,e)}catch{}}var Ne=Math.clz32?Math.clz32:Ie,Pe=Math.log,Fe=Math.LN2;function Ie(e){return e>>>=0,e===0?32:31-(Pe(e)/Fe|0)|0}var Le=256,Re=262144,ze=4194304;function Be(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ve(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Be(n))):i=Be(o):i=Be(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Be(n))):i=Be(o)):i=Be(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function He(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ue(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 We(){var e=ze;return ze<<=1,!(ze&62914560)&&(ze=4194304),e}function Ge(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ke(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function qe(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Ne(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&Je(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Je(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ne(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Ye(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ne(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Xe(e,t){var n=t&-t;return n=n&42?1:Ze(n),(n&(e.suspendedLanes|t))===0?n:0}function Ze(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Qe(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function $e(){var e=L.p;return e===0?(e=window.event,e===void 0?32:Cp(e.type)):e}function et(e,t){var n=L.p;try{return L.p=e,t()}finally{L.p=n}}var tt=Math.random().toString(36).slice(2),nt=`__reactFiber$`+tt,rt=`__reactProps$`+tt,it=`__reactContainer$`+tt,at=`__reactEvents$`+tt,ot=`__reactListeners$`+tt,st=`__reactHandles$`+tt,ct=`__reactResources$`+tt,lt=`__reactMarker$`+tt;function ut(e){delete e[nt],delete e[rt],delete e[at],delete e[ot],delete e[st]}function dt(e){var t=e[nt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[it]||n[nt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=bf(e);e!==null;){if(n=e[nt])return n;e=bf(e)}return t}e=n,n=e.parentNode}return null}function ft(e){if(e=e[nt]||e[it]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function pt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function mt(e){var t=e[ct];return t||=e[ct]={hoistableStyles:new Map,hoistableScripts:new Map},t}function ht(e){e[lt]=!0}var gt=new Set,_t={};function vt(e,t){yt(e,t),yt(e+`Capture`,t)}function yt(e,t){for(_t[e]=t,e=0;e<t.length;e++)gt.add(t[e])}var bt=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]*$`),xt={},St={};function Ct(e){return ge.call(St,e)?!0:ge.call(xt,e)?!1:bt.test(e)?St[e]=!0:(xt[e]=!0,!1)}function wt(e,t,n){if(Ct(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}}function Tt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function Et(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Dt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Ot(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function kt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function At(e){if(!e._valueTracker){var t=Ot(e)?`checked`:`value`;e._valueTracker=kt(e,t,``+e[t])}}function jt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Ot(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}function Mt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Nt=/[\n"\\]/g;function Pt(e){return e.replace(Nt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Ft(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Dt(t)):e.value!==``+Dt(t)&&(e.value=``+Dt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Lt(e,o,Dt(n)):Lt(e,o,Dt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Dt(s):e.removeAttribute(`name`)}function It(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){At(e);return}n=n==null?``:``+Dt(n),t=t==null?n:``+Dt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),At(e)}function Lt(e,t,n){t===`number`&&Mt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Rt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Dt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function zt(e,t,n){if(t!=null&&(t=``+Dt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Dt(n)}function Bt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(F(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Dt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),At(e)}function Vt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ht=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 Ut(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Ht.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Wt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Ut(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Ut(e,o,t[o])}function Gt(e){if(e.indexOf(`-`)===-1)return!1;switch(e){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 Kt=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`]]),qt=/^[\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 Jt(e){return qt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Yt(){}var Xt=null;function Zt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Qt=null,$t=null;function en(e){var t=ft(e);if(t&&(e=t.stateNode)){var n=e[rt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Ft(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Pt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[rt]||null;if(!a)throw Error(i(90));Ft(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&jt(r)}break a;case`textarea`:zt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Rt(e,!!n.multiple,t,!1)}}}var tn=!1;function nn(e,t,n){if(tn)return e(t,n);tn=!0;try{return e(t)}finally{if(tn=!1,(Qt!==null||$t!==null)&&(Eu(),Qt&&(t=Qt,e=$t,$t=Qt=null,en(t),e)))for(t=0;t<e.length;t++)en(e[t])}}function rn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[rt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var an=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),on=!1;if(an)try{var sn={};Object.defineProperty(sn,"passive",{get:function(){on=!0}}),window.addEventListener(`test`,sn,sn),window.removeEventListener(`test`,sn,sn)}catch{on=!1}var cn=null,ln=null,un=null;function dn(){if(un)return un;var e,t=ln,n=t.length,r,i=`value`in cn?cn.value:cn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return un=i.slice(e,1<r?1-r:void 0)}function fn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function pn(){return!0}function mn(){return!1}function hn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?pn:mn,this.isPropagationStopped=mn,this}return m(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=pn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=pn)},persist:function(){},isPersistent:pn}),t}var gn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},_n=hn(gn),vn=m({},gn,{view:0,detail:0}),yn=hn(vn),bn,xn,Sn,Cn=m({},vn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Pn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Sn&&(Sn&&e.type===`mousemove`?(bn=e.screenX-Sn.screenX,xn=e.screenY-Sn.screenY):xn=bn=0,Sn=e),bn)},movementY:function(e){return`movementY`in e?e.movementY:xn}}),wn=hn(Cn),Tn=hn(m({},Cn,{dataTransfer:0})),En=hn(m({},vn,{relatedTarget:0})),Dn=hn(m({},gn,{animationName:0,elapsedTime:0,pseudoElement:0})),On=hn(m({},gn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),kn=hn(m({},gn,{data:0})),An={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},jn={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},Mn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Nn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Mn[e])?!!t[e]:!1}function Pn(){return Nn}var Fn=hn(m({},vn,{key:function(e){if(e.key){var t=An[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=fn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?jn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Pn,charCode:function(e){return e.type===`keypress`?fn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?fn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),In=hn(m({},Cn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Ln=hn(m({},vn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Pn})),Rn=hn(m({},gn,{propertyName:0,elapsedTime:0,pseudoElement:0})),zn=hn(m({},Cn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Bn=hn(m({},gn,{newState:0,oldState:0})),Vn=[9,13,27,32],U=an&&`CompositionEvent`in window,Hn=null;an&&`documentMode`in document&&(Hn=document.documentMode);var Un=an&&`TextEvent`in window&&!Hn,Wn=an&&(!U||Hn&&8<Hn&&11>=Hn),Gn=` `,Kn=!1;function qn(e,t){switch(e){case`keyup`:return Vn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Jn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Yn=!1;function Xn(e,t){switch(e){case`compositionend`:return Jn(t);case`keypress`:return t.which===32?(Kn=!0,Gn):null;case`textInput`:return e=t.data,e===Gn&&Kn?null:e;default:return null}}function Zn(e,t){if(Yn)return e===`compositionend`||!U&&qn(e,t)?(e=dn(),un=ln=cn=null,Yn=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Wn&&t.locale!==`ko`?null:t.data;default:return null}}var Qn={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 $n(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Qn[e.type]:t===`textarea`}function er(e,t,n,r){Qt?$t?$t.push(r):$t=[r]:Qt=r,t=Pd(t,`onChange`),0<t.length&&(n=new _n(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var tr=null,nr=null;function rr(e){Ed(e,0)}function ir(e){if(jt(pt(e)))return e}function ar(e,t){if(e===`change`)return t}var or=!1;if(an){var sr;if(an){var cr=`oninput`in document;if(!cr){var lr=document.createElement(`div`);lr.setAttribute(`oninput`,`return;`),cr=typeof lr.oninput==`function`}sr=cr}else sr=!1;or=sr&&(!document.documentMode||9<document.documentMode)}function ur(){tr&&(tr.detachEvent(`onpropertychange`,dr),nr=tr=null)}function dr(e){if(e.propertyName===`value`&&ir(nr)){var t=[];er(t,nr,e,Zt(e)),nn(rr,t)}}function fr(e,t,n){e===`focusin`?(ur(),tr=t,nr=n,tr.attachEvent(`onpropertychange`,dr)):e===`focusout`&&ur()}function pr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return ir(nr)}function mr(e,t){if(e===`click`)return ir(t)}function hr(e,t){if(e===`input`||e===`change`)return ir(t)}function gr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var _r=typeof Object.is==`function`?Object.is:gr;function vr(e,t){if(_r(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!ge.call(t,i)||!_r(e[i],t[i]))return!1}return!0}function yr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function br(e,t){var n=yr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=yr(n)}}function xr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?xr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Sr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Mt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Mt(e.document)}return t}function Cr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var wr=an&&`documentMode`in document&&11>=document.documentMode,Tr=null,Er=null,Dr=null,Or=!1;function kr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Or||Tr==null||Tr!==Mt(r)||(r=Tr,`selectionStart`in r&&Cr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Dr&&vr(Dr,r)||(Dr=r,r=Pd(Er,`onSelect`),0<r.length&&(t=new _n(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Tr)))}function Ar(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var jr={animationend:Ar(`Animation`,`AnimationEnd`),animationiteration:Ar(`Animation`,`AnimationIteration`),animationstart:Ar(`Animation`,`AnimationStart`),transitionrun:Ar(`Transition`,`TransitionRun`),transitionstart:Ar(`Transition`,`TransitionStart`),transitioncancel:Ar(`Transition`,`TransitionCancel`),transitionend:Ar(`Transition`,`TransitionEnd`)},Mr={},Nr={};an&&(Nr=document.createElement(`div`).style,`AnimationEvent`in window||(delete jr.animationend.animation,delete jr.animationiteration.animation,delete jr.animationstart.animation),`TransitionEvent`in window||delete jr.transitionend.transition);function Pr(e){if(Mr[e])return Mr[e];if(!jr[e])return e;var t=jr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Nr)return Mr[e]=t[n];return e}var Fr=Pr(`animationend`),Ir=Pr(`animationiteration`),Lr=Pr(`animationstart`),Rr=Pr(`transitionrun`),zr=Pr(`transitionstart`),Br=Pr(`transitioncancel`),Vr=Pr(`transitionend`),Hr=new Map,Ur=`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(` `);Ur.push(`scrollEnd`);function Wr(e,t){Hr.set(e,t),vt(t,[e])}var Gr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Kr=[],qr=0,Jr=0;function Yr(){for(var e=qr,t=Jr=qr=0;t<e;){var n=Kr[t];Kr[t++]=null;var r=Kr[t];Kr[t++]=null;var i=Kr[t];Kr[t++]=null;var a=Kr[t];if(Kr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&$r(n,i,a)}}function Xr(e,t,n,r){Kr[qr++]=e,Kr[qr++]=t,Kr[qr++]=n,Kr[qr++]=r,Jr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Zr(e,t,n,r){return Xr(e,t,n,r),ei(e)}function Qr(e,t){return Xr(e,null,null,t),ei(e)}function $r(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Ne(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ei(e){if(50<_u)throw _u=0,vu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ti={};function ni(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ri(e,t,n,r){return new ni(e,t,n,r)}function ii(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ai(e,t){var n=e.alternate;return n===null?(n=ri(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function oi(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function si(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ii(e)&&(s=1);else if(typeof e==`string`)s=Qf(e,n,ne.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case k:return e=ri(31,n,t,a),e.elementType=k,e.lanes=o,e;case y:return ci(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=ri(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=ri(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=ri(19,n,t,a),e.elementType=E,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case D:s=14;break a;case O:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ri(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function ci(e,t,n,r){return e=ri(7,e,r,t),e.lanes=n,e}function li(e,t,n){return e=ri(6,e,null,t),e.lanes=n,e}function ui(e){var t=ri(18,null,null,0);return t.stateNode=e,t}function di(e,t,n){return t=ri(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var fi=new WeakMap;function pi(e,t){if(typeof e==`object`&&e){var n=fi.get(e);return n===void 0?(t={value:e,source:t,stack:he(t)},fi.set(e,t),t):n}return{value:e,source:t,stack:he(t)}}var mi=[],hi=0,gi=null,_i=0,vi=[],yi=0,bi=null,xi=1,Si=``;function Ci(e,t){mi[hi++]=_i,mi[hi++]=gi,gi=e,_i=t}function wi(e,t,n){vi[yi++]=xi,vi[yi++]=Si,vi[yi++]=bi,bi=e;var r=xi;e=Si;var i=32-Ne(r)-1;r&=~(1<<i),n+=1;var a=32-Ne(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,xi=1<<32-Ne(t)+i|n<<i|r,Si=a+e}else xi=1<<a|n<<i|r,Si=e}function Ti(e){e.return!==null&&(Ci(e,1),wi(e,1,0))}function Ei(e){for(;e===gi;)gi=mi[--hi],mi[hi]=null,_i=mi[--hi],mi[hi]=null;for(;e===bi;)bi=vi[--yi],vi[yi]=null,Si=vi[--yi],vi[yi]=null,xi=vi[--yi],vi[yi]=null}function Di(e,t){vi[yi++]=xi,vi[yi++]=Si,vi[yi++]=bi,xi=t.id,Si=t.overflow,bi=e}var Oi=null,ki=null,Ai=!1,ji=null,Mi=!1,Ni=Error(i(519));function Pi(e){throw Bi(pi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Ni}function Fi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[nt]=e,t[rt]=r,n){case`dialog`:Dd(`cancel`,t),Dd(`close`,t);break;case`iframe`:case`object`:case`embed`:Dd(`load`,t);break;case`video`:case`audio`:for(n=0;n<wd.length;n++)Dd(wd[n],t);break;case`source`:Dd(`error`,t);break;case`img`:case`image`:case`link`:Dd(`error`,t),Dd(`load`,t);break;case`details`:Dd(`toggle`,t);break;case`input`:Dd(`invalid`,t),It(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Dd(`invalid`,t);break;case`textarea`:Dd(`invalid`,t),Bt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Bd(t.textContent,n)?(r.popover!=null&&(Dd(`beforetoggle`,t),Dd(`toggle`,t)),r.onScroll!=null&&Dd(`scroll`,t),r.onScrollEnd!=null&&Dd(`scrollend`,t),r.onClick!=null&&(t.onclick=Yt),t=!0):t=!1,t||Pi(e,!0)}function Ii(e){for(Oi=e.return;Oi;)switch(Oi.tag){case 5:case 31:case 13:Mi=!1;return;case 27:case 3:Mi=!0;return;default:Oi=Oi.return}}function Li(e){if(e!==Oi)return!1;if(!Ai)return Ii(e),Ai=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||Qd(e.type,e.memoizedProps)),n=!n),n&&ki&&Pi(e),Ii(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ki=yf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ki=yf(e)}else t===27?(t=ki,sf(e.type)?(e=vf,vf=null,ki=e):ki=t):ki=Oi?_f(e.stateNode.nextSibling):null;return!0}function Ri(){ki=Oi=null,Ai=!1}function zi(){var e=ji;return e!==null&&(ru===null?ru=e:ru.push.apply(ru,e),ji=null),e}function Bi(e){ji===null?ji=[e]:ji.push(e)}var Vi=z(null),Hi=null,Ui=null;function Wi(e,t,n){V(Vi,t._currentValue),t._currentValue=n}function Gi(e){e._currentValue=Vi.current,B(Vi)}function Ki(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function qi(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Ki(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Ki(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Ji(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;_r(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===ie.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[sp]:e.push(sp))}a=a.return}e!==null&&qi(t,e,n,r),t.flags|=262144}function Yi(e){for(e=e.firstContext;e!==null;){if(!_r(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Xi(e){Hi=e,Ui=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Zi(e){return $i(Hi,e)}function Qi(e,t){return Hi===null&&Xi(e),$i(e,t)}function $i(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Ui===null){if(e===null)throw Error(i(308));Ui=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ui=Ui.next=t;return n}var ea=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ta=t.unstable_scheduleCallback,na=t.unstable_NormalPriority,ra={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ia(){return{controller:new ea,data:new Map,refCount:0}}function aa(e){e.refCount--,e.refCount===0&&ta(na,function(){e.controller.abort()})}var oa=null,sa=0,ca=0,la=null;function ua(e,t){if(oa===null){var n=oa=[];sa=0,ca=vd(),la={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return sa++,t.then(da,da),t}function da(){if(--sa===0&&oa!==null){la!==null&&(la.status=`fulfilled`);var e=oa;oa=null,ca=0,la=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function fa(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var pa=I.S;I.S=function(e,t){ou=xe(),typeof t==`object`&&t&&typeof t.then==`function`&&ua(e,t),pa!==null&&pa(e,t)};var ma=z(null);function ha(){var e=ma.current;return e===null?Vl.pooledCache:e}function ga(e,t){t===null?V(ma,ma.current):V(ma,t.pool)}function _a(){var e=ha();return e===null?null:{parent:ra._currentValue,pool:e}}var va=Error(i(460)),ya=Error(i(474)),ba=Error(i(542)),xa={then:function(){}};function Sa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Ca(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Yt,Yt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Da(e),e;default:if(typeof t.status==`string`)t.then(Yt,Yt);else{if(e=Vl,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Da(e),e}throw Ta=t,va}}function wa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Ta=e,va):e}}var Ta=null;function Ea(){if(Ta===null)throw Error(i(459));var e=Ta;return Ta=null,e}function Da(e){if(e===va||e===ba)throw Error(i(483))}var Oa=null,ka=0;function Aa(e){var t=ka;return ka+=1,Oa===null&&(Oa=[]),Ca(Oa,e,t)}function ja(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Ma(e,t){throw t.$$typeof===g?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Na(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=ai(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=li(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===O&&wa(i)===t.type)?(t=a(t,n.props),ja(t,n),t.return=e,t):(t=si(n.type,n.key,n.props,null,e.mode,r),ja(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=di(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=ci(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=li(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=si(t.type,t.key,t.props,null,e.mode,n),ja(n,t),n.return=e,n;case v:return t=di(t,e.mode,n),t.return=e,t;case O:return t=wa(t),f(e,t,n)}if(F(t)||M(t))return t=ci(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Aa(t),n);if(t.$$typeof===C)return f(e,Qi(e,t),n);Ma(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case O:return n=wa(n),p(e,t,n,r)}if(F(n)||M(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Aa(n),r);if(n.$$typeof===C)return p(e,t,Qi(e,n),r);Ma(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case O:return r=wa(r),m(e,t,n,r,i)}if(F(r)||M(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Aa(r),i);if(r.$$typeof===C)return m(e,t,n,Qi(t,r),i);Ma(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),Ai&&Ci(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return Ai&&Ci(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),Ai&&Ci(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),Ai&&Ci(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Ai&&Ci(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),Ai&&Ci(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===O&&wa(l)===r.type){n(e,r.sibling),c=a(r,o.props),ja(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===y?(c=ci(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=si(o.type,o.key,o.props,null,e.mode,c),ja(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=di(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=wa(o),b(e,r,o,c)}if(F(o))return h(e,r,o,c);if(M(o)){if(l=M(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Aa(o),c);if(o.$$typeof===C)return b(e,r,Qi(e,o),c);Ma(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=li(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{ka=0;var i=b(e,t,n,r);return Oa=null,i}catch(t){if(t===va||t===ba)throw t;var a=ri(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Pa=Na(!0),Fa=Na(!1),Ia=!1;function La(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ra(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function za(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ba(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Bl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ei(e),$r(e,null,n),t}return Xr(e,r,t,n),ei(e)}function Va(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ye(e,n)}}function Ha(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ua=!1;function Wa(){if(Ua){var e=la;if(e!==null)throw e}}function Ga(e,t,n,r){Ua=!1;var i=e.updateQueue;Ia=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Ul&f)===f:(r&f)===f){f!==0&&f===ca&&(Ua=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=m({},d,f);break a;case 2:Ia=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Zl|=o,e.lanes=o,e.memoizedState=d}}function Ka(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function qa(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ka(n[e],t)}var Ja=z(null),Ya=z(0);function Xa(e,t){e=Yl,V(Ya,e),V(Ja,t),Yl=e|t.baseLanes}function Za(){V(Ya,Yl),V(Ja,Ja.current)}function Qa(){Yl=Ya.current,B(Ja),B(Ya)}var $a=z(null),eo=null;function to(e){var t=e.alternate;V(ao,ao.current&1),V($a,e),eo===null&&(t===null||Ja.current!==null||t.memoizedState!==null)&&(eo=e)}function no(e){V(ao,ao.current),V($a,e),eo===null&&(eo=e)}function ro(e){e.tag===22?(V(ao,ao.current),V($a,e),eo===null&&(eo=e)):W(e)}function W(){V(ao,ao.current),V($a,$a.current)}function io(e){B($a),eo===e&&(eo=null),B(ao)}var ao=z(0);function oo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||mf(n)||hf(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var so=0,co=null,lo=null,uo=null,fo=!1,po=!1,mo=!1,ho=0,go=0,_o=null,vo=0;function yo(){throw Error(i(321))}function bo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!_r(e[n],t[n]))return!1;return!0}function xo(e,t,n,r,i,a){return so=a,co=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,I.H=e===null||e.memoizedState===null?Rs:zs,mo=!1,a=n(r,i),mo=!1,po&&(a=Co(t,n,r,i)),So(e),a}function So(e){I.H=Ls;var t=lo!==null&&lo.next!==null;if(so=0,uo=lo=co=null,fo=!1,go=0,_o=null,t)throw Error(i(300));e===null||nc||(e=e.dependencies,e!==null&&Yi(e)&&(nc=!0))}function Co(e,t,n,r){co=e;var a=0;do{if(po&&(_o=null),go=0,po=!1,25<=a)throw Error(i(301));if(a+=1,uo=lo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}I.H=Bs,o=t(n,r)}while(po);return o}function wo(){var e=I.H,t=e.useState()[0];return t=typeof t.then==`function`?jo(t):t,e=e.useState()[0],(lo===null?null:lo.memoizedState)!==e&&(co.flags|=1024),t}function To(){var e=ho!==0;return ho=0,e}function Eo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Do(e){if(fo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}fo=!1}so=0,uo=lo=co=null,po=!1,go=ho=0,_o=null}function Oo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return uo===null?co.memoizedState=uo=e:uo=uo.next=e,uo}function ko(){if(lo===null){var e=co.alternate;e=e===null?null:e.memoizedState}else e=lo.next;var t=uo===null?co.memoizedState:uo.next;if(t!==null)uo=t,lo=e;else{if(e===null)throw co.alternate===null?Error(i(467)):Error(i(310));lo=e,e={memoizedState:lo.memoizedState,baseState:lo.baseState,baseQueue:lo.baseQueue,queue:lo.queue,next:null},uo===null?co.memoizedState=uo=e:uo=uo.next=e}return uo}function Ao(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function jo(e){var t=go;return go+=1,_o===null&&(_o=[]),e=Ca(_o,e,t),t=co,(uo===null?t.memoizedState:uo.next)===null&&(t=t.alternate,I.H=t===null||t.memoizedState===null?Rs:zs),e}function Mo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return jo(e);if(e.$$typeof===C)return Zi(e)}throw Error(i(438,String(e)))}function No(e){var t=null,n=co.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=co.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Ao(),co.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=A;return t.index++,n}function Po(e,t){return typeof t==`function`?t(e):t}function Fo(e){return Io(ko(),lo,e)}function Io(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(so&f)===f:(Ul&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ca&&(d=!0);else if((so&p)===p){u=u.next,p===ca&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,co.lanes|=p,Zl|=p;f=u.action,mo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,co.lanes|=f,Zl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!_r(o,e.memoizedState)&&(nc=!0,d&&(n=la,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Lo(e){var t=ko(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);_r(o,t.memoizedState)||(nc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Ro(e,t,n){var r=co,a=ko(),o=Ai;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!_r((lo||a).memoizedState,n);if(s&&(a.memoizedState=n,nc=!0),a=a.queue,ls(Vo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||uo!==null&&uo.memoizedState.tag&1){if(r.flags|=2048,is(9,{destroy:void 0},Bo.bind(null,r,a,n,t),null),Vl===null)throw Error(i(349));o||so&127||zo(r,t,n)}return n}function zo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=co.updateQueue,t===null?(t=Ao(),co.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Bo(e,t,n,r){t.value=n,t.getSnapshot=r,Ho(t)&&Uo(e)}function Vo(e,t,n){return n(function(){Ho(t)&&Uo(e)})}function Ho(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!_r(e,n)}catch{return!0}}function Uo(e){var t=Qr(e,2);t!==null&&xu(t,e,2)}function Wo(e){var t=Oo();if(typeof e==`function`){var n=e;if(e=n(),mo){Me(!0);try{n()}finally{Me(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Po,lastRenderedState:e},t}function Go(e,t,n,r){return e.baseState=n,Io(e,lo,typeof r==`function`?r:Po)}function Ko(e,t,n,r,a){if(Ps(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};I.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,qo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function qo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=I.T,o={};I.T=o;try{var s=n(i,r),c=I.S;c!==null&&c(o,s),Jo(e,t,s)}catch(n){Xo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),I.T=a}}else try{a=n(i,r),Jo(e,t,a)}catch(n){Xo(e,t,n)}}function Jo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Yo(e,t,n)},function(n){return Xo(e,t,n)}):Yo(e,t,n)}function Yo(e,t,n){t.status=`fulfilled`,t.value=n,Zo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,qo(e,n)))}function Xo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Zo(t),t=t.next;while(t!==r)}e.action=null}function Zo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Qo(e,t){return t}function $o(e,t){if(Ai){var n=Vl.formState;if(n!==null){a:{var r=co;if(Ai){if(ki){b:{for(var i=ki,a=Mi;i.nodeType!==8;){if(!a){i=null;break b}if(i=_f(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ki=_f(i.nextSibling),r=i.data===`F!`;break a}}Pi(r)}r=!1}r&&(t=n[0])}}return n=Oo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qo,lastRenderedState:t},n.queue=r,n=js.bind(null,co,r),r.dispatch=n,r=Wo(!1),a=Ns.bind(null,co,!1,r.queue),r=Oo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Ko.bind(null,co,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function es(e){return ts(ko(),lo,e)}function ts(e,t,n){if(t=Io(e,t,Qo)[0],e=Fo(Po)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=jo(t)}catch(e){throw e===va?ba:e}else r=t;t=ko();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(co.flags|=2048,is(9,{destroy:void 0},ns.bind(null,i,n),null)),[r,a,e]}function ns(e,t){e.action=t}function rs(e){var t=ko(),n=lo;if(n!==null)return ts(t,n,e);ko(),t=t.memoizedState,n=ko();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function is(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=co.updateQueue,t===null&&(t=Ao(),co.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function as(){return ko().memoizedState}function os(e,t,n,r){var i=Oo();co.flags|=e,i.memoizedState=is(1|t,{destroy:void 0},n,r===void 0?null:r)}function ss(e,t,n,r){var i=ko();r=r===void 0?null:r;var a=i.memoizedState.inst;lo!==null&&r!==null&&bo(r,lo.memoizedState.deps)?i.memoizedState=is(t,a,n,r):(co.flags|=e,i.memoizedState=is(1|t,a,n,r))}function cs(e,t){os(8390656,8,e,t)}function ls(e,t){ss(2048,8,e,t)}function us(e){co.flags|=4;var t=co.updateQueue;if(t===null)t=Ao(),co.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ds(e){var t=ko().memoizedState;return us({ref:t,nextImpl:e}),function(){if(Bl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function fs(e,t){return ss(4,2,e,t)}function ps(e,t){return ss(4,4,e,t)}function ms(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function hs(e,t,n){n=n==null?null:n.concat([e]),ss(4,4,ms.bind(null,t,e),n)}function gs(){}function _s(e,t){var n=ko();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&bo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function vs(e,t){var n=ko();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&bo(t,r[1]))return r[0];if(r=e(),mo){Me(!0);try{e()}finally{Me(!1)}}return n.memoizedState=[r,t],r}function ys(e,t,n){return n===void 0||so&1073741824&&!(Ul&261930)?e.memoizedState=t:(e.memoizedState=n,e=bu(),co.lanes|=e,Zl|=e,n)}function bs(e,t,n,r){return _r(n,t)?n:Ja.current===null?!(so&42)||so&1073741824&&!(Ul&261930)?(nc=!0,e.memoizedState=n):(e=bu(),co.lanes|=e,Zl|=e,t):(e=ys(e,n,r),_r(e,t)||(nc=!0),e)}function xs(e,t,n,r,i){var a=L.p;L.p=a!==0&&8>a?a:8;var o=I.T,s={};I.T=s,Ns(e,!1,t,n);try{var c=i(),l=I.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Ms(e,t,fa(c,r),yu(e)):Ms(e,t,r,yu(e))}catch(n){Ms(e,t,{then:function(){},status:`rejected`,reason:n},yu())}finally{L.p=a,o!==null&&s.types!==null&&(o.types=s.types),I.T=o}}function Ss(){}function Cs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=ws(e).queue;xs(e,a,t,ee,n===null?Ss:function(){return Ts(e),n(r)})}function ws(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ee,baseState:ee,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Po,lastRenderedState:ee},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Po,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ts(e){var t=ws(e);t.next===null&&(t=e.alternate.memoizedState),Ms(e,t.next.queue,{},yu())}function Es(){return Zi(sp)}function Ds(){return ko().memoizedState}function Os(){return ko().memoizedState}function ks(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=yu();e=za(n);var r=Ba(t,e,n);r!==null&&(xu(r,t,n),Va(r,t,n)),t={cache:ia()},e.payload=t;return}t=t.return}}function As(e,t,n){var r=yu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ps(e)?Fs(t,n):(n=Zr(e,t,n,r),n!==null&&(xu(n,e,r),Is(n,t,r)))}function js(e,t,n){Ms(e,t,n,yu())}function Ms(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ps(e))Fs(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,_r(s,o))return Xr(e,t,i,0),Vl===null&&Yr(),!1}catch{}if(n=Zr(e,t,i,r),n!==null)return xu(n,e,r),Is(n,t,r),!0}return!1}function Ns(e,t,n,r){if(r={lane:2,revertLane:vd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ps(e)){if(t)throw Error(i(479))}else t=Zr(e,n,r,2),t!==null&&xu(t,e,2)}function Ps(e){var t=e.alternate;return e===co||t!==null&&t===co}function Fs(e,t){po=fo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Is(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ye(e,n)}}var Ls={readContext:Zi,use:Mo,useCallback:yo,useContext:yo,useEffect:yo,useImperativeHandle:yo,useLayoutEffect:yo,useInsertionEffect:yo,useMemo:yo,useReducer:yo,useRef:yo,useState:yo,useDebugValue:yo,useDeferredValue:yo,useTransition:yo,useSyncExternalStore:yo,useId:yo,useHostTransitionStatus:yo,useFormState:yo,useActionState:yo,useOptimistic:yo,useMemoCache:yo,useCacheRefresh:yo};Ls.useEffectEvent=yo;var Rs={readContext:Zi,use:Mo,useCallback:function(e,t){return Oo().memoizedState=[e,t===void 0?null:t],e},useContext:Zi,useEffect:cs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),os(4194308,4,ms.bind(null,t,e),n)},useLayoutEffect:function(e,t){return os(4194308,4,e,t)},useInsertionEffect:function(e,t){os(4,2,e,t)},useMemo:function(e,t){var n=Oo();t=t===void 0?null:t;var r=e();if(mo){Me(!0);try{e()}finally{Me(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Oo();if(n!==void 0){var i=n(t);if(mo){Me(!0);try{n(t)}finally{Me(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=As.bind(null,co,e),[r.memoizedState,e]},useRef:function(e){var t=Oo();return e={current:e},t.memoizedState=e},useState:function(e){e=Wo(e);var t=e.queue,n=js.bind(null,co,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:gs,useDeferredValue:function(e,t){return ys(Oo(),e,t)},useTransition:function(){var e=Wo(!1);return e=xs.bind(null,co,e.queue,!0,!1),Oo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=co,a=Oo();if(Ai){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Vl===null)throw Error(i(349));Ul&127||zo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,cs(Vo.bind(null,r,o,e),[e]),r.flags|=2048,is(9,{destroy:void 0},Bo.bind(null,r,o,n,t),null),n},useId:function(){var e=Oo(),t=Vl.identifierPrefix;if(Ai){var n=Si,r=xi;n=(r&~(1<<32-Ne(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=ho++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=vo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Es,useFormState:$o,useActionState:$o,useOptimistic:function(e){var t=Oo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ns.bind(null,co,!0,n),n.dispatch=t,[e,t]},useMemoCache:No,useCacheRefresh:function(){return Oo().memoizedState=ks.bind(null,co)},useEffectEvent:function(e){var t=Oo(),n={impl:e};return t.memoizedState=n,function(){if(Bl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},zs={readContext:Zi,use:Mo,useCallback:_s,useContext:Zi,useEffect:ls,useImperativeHandle:hs,useInsertionEffect:fs,useLayoutEffect:ps,useMemo:vs,useReducer:Fo,useRef:as,useState:function(){return Fo(Po)},useDebugValue:gs,useDeferredValue:function(e,t){return bs(ko(),lo.memoizedState,e,t)},useTransition:function(){var e=Fo(Po)[0],t=ko().memoizedState;return[typeof e==`boolean`?e:jo(e),t]},useSyncExternalStore:Ro,useId:Ds,useHostTransitionStatus:Es,useFormState:es,useActionState:es,useOptimistic:function(e,t){return Go(ko(),lo,e,t)},useMemoCache:No,useCacheRefresh:Os};zs.useEffectEvent=ds;var Bs={readContext:Zi,use:Mo,useCallback:_s,useContext:Zi,useEffect:ls,useImperativeHandle:hs,useInsertionEffect:fs,useLayoutEffect:ps,useMemo:vs,useReducer:Lo,useRef:as,useState:function(){return Lo(Po)},useDebugValue:gs,useDeferredValue:function(e,t){var n=ko();return lo===null?ys(n,e,t):bs(n,lo.memoizedState,e,t)},useTransition:function(){var e=Lo(Po)[0],t=ko().memoizedState;return[typeof e==`boolean`?e:jo(e),t]},useSyncExternalStore:Ro,useId:Ds,useHostTransitionStatus:Es,useFormState:rs,useActionState:rs,useOptimistic:function(e,t){var n=ko();return lo===null?(n.baseState=e,[e,n.queue.dispatch]):Go(n,lo,e,t)},useMemoCache:No,useCacheRefresh:Os};Bs.useEffectEvent=ds;function Vs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:m({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Hs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=yu(),i=za(r);i.payload=t,n!=null&&(i.callback=n),t=Ba(e,i,r),t!==null&&(xu(t,e,r),Va(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=yu(),i=za(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ba(e,i,r),t!==null&&(xu(t,e,r),Va(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=yu(),r=za(n);r.tag=2,t!=null&&(r.callback=t),t=Ba(e,r,n),t!==null&&(xu(t,e,n),Va(t,e,n))}};function Us(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!vr(n,r)||!vr(i,a):!0}function Ws(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Hs.enqueueReplaceState(t,t.state,null)}function Gs(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=m({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Ks(e){Gr(e)}function qs(e){console.error(e)}function Js(e){Gr(e)}function Ys(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Xs(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Zs(e,t,n){return n=za(n),n.tag=3,n.payload={element:null},n.callback=function(){Ys(e,t)},n}function Qs(e){return e=za(e),e.tag=3,e}function $s(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Xs(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Xs(t,n,r),typeof i!=`function`&&(lu===null?lu=new Set([this]):lu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function ec(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Ji(t,n,a,!0),n=$a.current,n!==null){switch(n.tag){case 31:case 13:return eo===null?Nu():n.alternate===null&&Xl===0&&(Xl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===xa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Qu(e,r,a)),!1;case 22:return n.flags|=65536,r===xa?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Qu(e,r,a)),!1}throw Error(i(435,n.tag))}return Qu(e,r,a),Nu(),!1}if(Ai)return t=$a.current,t===null?(r!==Ni&&(t=Error(i(423),{cause:r}),Bi(pi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=pi(r,n),a=Zs(e.stateNode,r,a),Ha(e,a),Xl!==4&&(Xl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Ni&&(e=Error(i(422),{cause:r}),Bi(pi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=pi(o,n),nu===null?nu=[o]:nu.push(o),Xl!==4&&(Xl=2),t===null)return!0;r=pi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Zs(n.stateNode,r,e),Ha(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(lu===null||!lu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Qs(a),$s(a,e,n,r),Ha(n,a),!1}n=n.return}while(n!==null);return!1}var tc=Error(i(461)),nc=!1;function rc(e,t,n,r){t.child=e===null?Fa(t,null,n,r):Pa(t,e.child,n,r)}function ic(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Xi(t),r=xo(e,t,n,o,a,i),s=To(),e!==null&&!nc?(Eo(e,t,i),Oc(e,t,i)):(Ai&&s&&Ti(t),t.flags|=1,rc(e,t,r,i),t.child)}function ac(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ii(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,oc(e,t,a,r,i)):(e=si(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!kc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?vr:n,n(o,r)&&e.ref===t.ref)return Oc(e,t,i)}return t.flags|=1,e=ai(a,r),e.ref=t.ref,e.return=t,t.child=e}function oc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(vr(a,r)&&e.ref===t.ref){if(nc=!1,t.pendingProps=r=a,kc(e,i))e.flags&131072&&(nc=!0);else return t.lanes=e.lanes,Oc(e,t,i)}}return mc(e,t,n,r,i)}function sc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return lc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ga(t,a===null?null:a.cachePool),a===null?Za():Xa(t,a),ro(t);else return r=t.lanes=536870912,lc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ga(t,null),Za(),W(t)):(ga(t,a.cachePool),Xa(t,a),W(t),t.memoizedState=null);return rc(e,t,i,n),t.child}function cc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function lc(e,t,n,r,i){var a=ha();return a=a===null?null:{parent:ra._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ga(t,null),Za(),ro(t),e!==null&&Ji(e,t,r,!0),t.childLanes=i,null}function uc(e,t){return t=Cc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function dc(e,t,n){return Pa(t,e.child,null,n),e=uc(t,t.pendingProps),e.flags|=2,io(t),t.memoizedState=null,e}function fc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(Ai){if(r.mode===`hidden`)return e=uc(t,r),t.lanes=536870912,cc(null,e);if(no(t),(e=ki)?(e=pf(e,Mi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:bi===null?null:{id:xi,overflow:Si},retryLane:536870912,hydrationErrors:null},n=ui(e),n.return=t,t.child=n,Oi=t,ki=null)):e=null,e===null)throw Pi(t);return t.lanes=536870912,null}return uc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(no(t),a){if(t.flags&256)t.flags&=-257,t=dc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(nc||Ji(e,t,n,!1),a=(n&e.childLanes)!==0,nc||a){if(r=Vl,r!==null&&(s=Xe(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Qr(e,s),xu(r,e,s),tc;Nu(),t=dc(e,t,n)}else e=o.treeContext,ki=_f(s.nextSibling),Oi=t,Ai=!0,ji=null,Mi=!1,e!==null&&Di(t,e),t=uc(t,r),t.flags|=4096;return t}return e=ai(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function pc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function mc(e,t,n,r,i){return Xi(t),n=xo(e,t,n,r,void 0,i),r=To(),e!==null&&!nc?(Eo(e,t,i),Oc(e,t,i)):(Ai&&r&&Ti(t),t.flags|=1,rc(e,t,n,i),t.child)}function hc(e,t,n,r,i,a){return Xi(t),t.updateQueue=null,n=Co(t,r,n,i),So(e),r=To(),e!==null&&!nc?(Eo(e,t,a),Oc(e,t,a)):(Ai&&r&&Ti(t),t.flags|=1,rc(e,t,n,a),t.child)}function gc(e,t,n,r,i){if(Xi(t),t.stateNode===null){var a=ti,o=n.contextType;typeof o==`object`&&o&&(a=Zi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Hs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},La(t),o=n.contextType,a.context=typeof o==`object`&&o?Zi(o):ti,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Vs(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Hs.enqueueReplaceState(a,a.state,null),Ga(t,r,a,i),Wa(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Gs(n,s);a.props=c;var l=a.context,u=n.contextType;o=ti,typeof u==`object`&&u&&(o=Zi(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Ws(t,a,r,o),Ia=!1;var f=t.memoizedState;a.state=f,Ga(t,r,a,i),Wa(),l=t.memoizedState,s||f!==l||Ia?(typeof d==`function`&&(Vs(t,n,d,r),l=t.memoizedState),(c=Ia||Us(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ra(e,t),o=t.memoizedProps,u=Gs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ti,typeof l==`object`&&l&&(c=Zi(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Ws(t,a,r,c),Ia=!1,f=t.memoizedState,a.state=f,Ga(t,r,a,i),Wa();var p=t.memoizedState;o!==d||f!==p||Ia||e!==null&&e.dependencies!==null&&Yi(e.dependencies)?(typeof s==`function`&&(Vs(t,n,s,r),p=t.memoizedState),(u=Ia||Us(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Yi(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,pc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Pa(t,e.child,null,i),t.child=Pa(t,null,n,i)):rc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Oc(e,t,i),e}function _c(e,t,n,r){return Ri(),t.flags|=256,rc(e,t,n,r),t.child}var vc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function yc(e){return{baseLanes:e,cachePool:_a()}}function bc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=eu),e}function xc(e,t,n){var r=t.pendingProps,a=!1,o=!!(t.flags&128),s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:!!(ao.current&2)),s&&(a=!0,t.flags&=-129),s=!!(t.flags&32),t.flags&=-33,e===null){if(Ai){if(a?to(t):W(t),(e=ki)?(e=pf(e,Mi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:bi===null?null:{id:xi,overflow:Si},retryLane:536870912,hydrationErrors:null},n=ui(e),n.return=t,t.child=n,Oi=t,ki=null)):e=null,e===null)throw Pi(t);return hf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(W(t),a=t.mode,c=Cc({mode:`hidden`,children:c},a),r=ci(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=yc(n),r.childLanes=bc(e,s,n),t.memoizedState=vc,cc(null,r)):(to(t),Sc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(to(t),t.flags&=-257,t=wc(e,t,n)):t.memoizedState===null?(W(t),c=r.fallback,a=t.mode,r=Cc({mode:`visible`,children:r.children},a),c=ci(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Pa(t,e.child,null,n),r=t.child,r.memoizedState=yc(n),r.childLanes=bc(e,s,n),t.memoizedState=vc,t=cc(null,r)):(W(t),t.child=e.child,t.flags|=128,t=null);else if(to(t),hf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Bi({value:r,source:null,stack:null}),t=wc(e,t,n)}else if(nc||Ji(e,t,n,!1),s=(n&e.childLanes)!==0,nc||s){if(s=Vl,s!==null&&(r=Xe(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Qr(e,r),xu(s,e,r),tc;mf(c)||Nu(),t=wc(e,t,n)}else mf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,ki=_f(c.nextSibling),Oi=t,Ai=!0,ji=null,Mi=!1,e!==null&&Di(t,e),t=Sc(t,r.children),t.flags|=4096);return t}return a?(W(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=ai(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=ci(c,a,n,null),c.flags|=2):c=ai(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,cc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=yc(n):(a=c.cachePool,a===null?a=_a():(l=ra._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=bc(e,s,n),t.memoizedState=vc,cc(e.child,r)):(to(t),n=e.child,e=n.sibling,n=ai(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function Sc(e,t){return t=Cc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Cc(e,t){return e=ri(22,e,null,t),e.lanes=0,e}function wc(e,t,n){return Pa(t,e.child,null,n),e=Sc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Tc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ki(e.return,t,n)}function Ec(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Dc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=ao.current,s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,V(ao,o),rc(e,t,r,n),r=Ai?_i:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Tc(e,n,t);else if(e.tag===19)Tc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&oo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Ec(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&oo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Ec(t,!0,n,null,a,r);break;case`together`:Ec(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Oc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Zl|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Ji(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=ai(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ai(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function kc(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Yi(e)))}function Ac(e,t,n){switch(t.tag){case 3:ae(t,t.stateNode.containerInfo),Wi(t,ra,e.memoizedState.cache),Ri();break;case 27:case 5:se(t);break;case 4:ae(t,t.stateNode.containerInfo);break;case 10:Wi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,no(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(to(t),e=Oc(e,t,n),e===null?null:e.sibling):xc(e,t,n):(to(t),t.flags|=128,null);to(t);break;case 19:var i=!!(e.flags&128);if(r=(n&t.childLanes)!==0,r||=(Ji(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Dc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),V(ao,ao.current),r)break;return null;case 22:return t.lanes=0,sc(e,t,n,t.pendingProps);case 24:Wi(t,ra,e.memoizedState.cache)}return Oc(e,t,n)}function jc(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)nc=!0;else{if(!kc(e,n)&&!(t.flags&128))return nc=!1,Ac(e,t,n);nc=!!(e.flags&131072)}}else nc=!1,Ai&&t.flags&1048576&&wi(t,_i,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=wa(t.elementType),t.type=e,typeof e==`function`)ii(e)?(r=Gs(e,r),t.tag=1,t=gc(null,t,e,r,n)):(t.tag=0,t=mc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=ic(null,t,e,r,n);break a}if(a===D){t.tag=14,t=ac(null,t,e,r,n);break a}}throw t=P(e)||e,Error(i(306,t,``))}}return t;case 0:return mc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Gs(r,t.pendingProps),gc(e,t,r,a,n);case 3:a:{if(ae(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ra(e,t),Ga(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Wi(t,ra,r),r!==o.cache&&qi(t,[ra],n,!0),Wa(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=_c(e,t,r,n);break a}if(r!==a){a=pi(Error(i(424)),t),Bi(a),t=_c(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(ki=_f(e.firstChild),Oi=t,Ai=!0,ji=null,Mi=!0,n=Fa(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ri(),r===a){t=Oc(e,t,n);break a}rc(e,t,r,n)}t=t.child}return t;case 26:return pc(e,t),e===null?(n=Rf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ai||(n=t.type,e=t.pendingProps,r=Yd(re.current).createElement(n),r[nt]=t,r[rt]=e,Ud(r,n,e),ht(r),t.stateNode=r):t.memoizedState=Rf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return se(t),e===null&&Ai&&(r=t.stateNode=xf(t.type,t.pendingProps,re.current),Oi=t,Mi=!0,a=ki,sf(t.type)?(vf=a,ki=_f(r.firstChild)):ki=a),rc(e,t,t.pendingProps.children,n),pc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ai&&((a=r=ki)&&(r=df(r,t.type,t.pendingProps,Mi),r===null?a=!1:(t.stateNode=r,Oi=t,ki=_f(r.firstChild),Mi=!1,a=!0)),a||Pi(t)),se(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Qd(a,o)?r=null:s!==null&&Qd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=xo(e,t,wo,null,null,n),sp._currentValue=a),pc(e,t),rc(e,t,r,n),t.child;case 6:return e===null&&Ai&&((e=n=ki)&&(n=ff(n,t.pendingProps,Mi),n===null?e=!1:(t.stateNode=n,Oi=t,ki=null,e=!0)),e||Pi(t)),null;case 13:return xc(e,t,n);case 4:return ae(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Pa(t,null,r,n):rc(e,t,r,n),t.child;case 11:return ic(e,t,t.type,t.pendingProps,n);case 7:return rc(e,t,t.pendingProps,n),t.child;case 8:return rc(e,t,t.pendingProps.children,n),t.child;case 12:return rc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Wi(t,t.type,r.value),rc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Xi(t),a=Zi(a),r=r(a),t.flags|=1,rc(e,t,r,n),t.child;case 14:return ac(e,t,t.type,t.pendingProps,n);case 15:return oc(e,t,t.type,t.pendingProps,n);case 19:return Dc(e,t,n);case 31:return fc(e,t,n);case 22:return sc(e,t,n,t.pendingProps);case 24:return Xi(t),r=Zi(ra),e===null?(a=ha(),a===null&&(a=Vl,o=ia(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},La(t),Wi(t,ra,a)):((e.lanes&n)!==0&&(Ra(e,t),Ga(t,null,null,n),Wa()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Wi(t,ra,r),r!==a.cache&&qi(t,[ra],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Wi(t,ra,r))),rc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Mc(e){e.flags|=4}function Nc(e,t,n,r,i){if((t=!!(e.mode&32))&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Au())e.flags|=8192;else throw Ta=xa,ya}}else e.flags&=-16777217}function Pc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!$f(t)){if(Au())e.flags|=8192;else throw Ta=xa,ya}}function Fc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:We(),e.lanes|=t,tu|=t)}function Ic(e,t){if(!Ai)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Lc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Rc(e,t,n){var r=t.pendingProps;switch(Ei(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Lc(t),null;case 1:return Lc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Gi(ra),oe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Li(t)?Mc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,zi())),Lc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Mc(t),o===null?(Lc(t),Nc(t,a,null,r,n)):(Lc(t),Pc(t,o))):o?o===e.memoizedState?(Lc(t),t.flags&=-16777217):(Mc(t),Lc(t),Pc(t,o)):(e=e.memoizedProps,e!==r&&Mc(t),Lc(t),Nc(t,a,e,r,n)),null;case 27:if(ce(t),n=re.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Mc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Lc(t),null}e=ne.current,Li(t)?Fi(t,e):(e=xf(a,r,n),t.stateNode=e,Mc(t))}return Lc(t),null;case 5:if(ce(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Mc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Lc(t),null}if(o=ne.current,Li(t))Fi(t,o);else{var s=Yd(re.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[nt]=t,o[rt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Ud(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Mc(t)}}return Lc(t),Nc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Mc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=re.current,Li(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Oi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[nt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Bd(e.nodeValue,n)),e||Pi(t,!0)}else e=Yd(e).createTextNode(r),e[nt]=t,t.stateNode=e}return Lc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Li(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[nt]=t}else Ri(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Lc(t),e=!1}else n=zi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(io(t),t):(io(t),null);if(t.flags&128)throw Error(i(558))}return Lc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Li(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[nt]=t}else Ri(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Lc(t),a=!1}else a=zi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(io(t),t):(io(t),null)}return io(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Fc(t,t.updateQueue),Lc(t),null);case 4:return oe(),e===null&&Ad(t.stateNode.containerInfo),Lc(t),null;case 10:return Gi(t.type),Lc(t),null;case 19:if(B(ao),r=t.memoizedState,r===null)return Lc(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)Ic(r,!1);else{if(Xl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=oo(e),o!==null){for(t.flags|=128,Ic(r,!1),e=o.updateQueue,t.updateQueue=e,Fc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)oi(n,e),n=n.sibling;return V(ao,ao.current&1|2),Ai&&Ci(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&xe()>su&&(t.flags|=128,a=!0,Ic(r,!1),t.lanes=4194304)}}else{if(!a){if(e=oo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Fc(t,e),Ic(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Ai)return Lc(t),null}else 2*xe()-r.renderingStartTime>su&&n!==536870912&&(t.flags|=128,a=!0,Ic(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Lc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=xe(),e.sibling=null,n=ao.current,V(ao,a?n&1|2:n&1),Ai&&Ci(t,r.treeForkCount),e);case 22:case 23:return io(t),Qa(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Lc(t),t.subtreeFlags&6&&(t.flags|=8192)):Lc(t),n=t.updateQueue,n!==null&&Fc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&B(ma),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Gi(ra),Lc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function zc(e,t){switch(Ei(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Gi(ra),oe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ce(t),null;case 31:if(t.memoizedState!==null){if(io(t),t.alternate===null)throw Error(i(340));Ri()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(io(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Ri()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return B(ao),null;case 4:return oe(),null;case 10:return Gi(t.type),null;case 22:case 23:return io(t),Qa(),e!==null&&B(ma),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Gi(ra),null;case 25:return null;default:return null}}function Bc(e,t){switch(Ei(t),t.tag){case 3:Gi(ra),oe();break;case 26:case 27:case 5:ce(t);break;case 4:oe();break;case 31:t.memoizedState!==null&&io(t);break;case 13:io(t);break;case 19:B(ao);break;case 10:Gi(t.type);break;case 22:case 23:io(t),Qa(),e!==null&&B(ma);break;case 24:Gi(ra)}}function Vc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Zu(t,t.return,e)}}function Hc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Zu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Zu(t,t.return,e)}}function Uc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{qa(t,n)}catch(t){Zu(e,e.return,t)}}}function Wc(e,t,n){n.props=Gs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Zu(e,t,n)}}function Gc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Zu(e,t,n)}}function Kc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Zu(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Zu(e,t,n)}else n.current=null}}function qc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Zu(e,e.return,t)}}function Jc(e,t,n){try{var r=e.stateNode;Wd(r,e.type,n,t),r[rt]=t}catch(t){Zu(e,e.return,t)}}function Yc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&sf(e.type)||e.tag===4}function Xc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Yc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&sf(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Zc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Yt));else if(r!==4&&(r===27&&sf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Zc(e,t,n),e=e.sibling;e!==null;)Zc(e,t,n),e=e.sibling}function Qc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&sf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Qc(e,t,n),e=e.sibling;e!==null;)Qc(e,t,n),e=e.sibling}function $c(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Ud(t,r,n),t[nt]=e,t[rt]=n}catch(t){Zu(e,e.return,t)}}var el=!1,tl=!1,nl=!1,rl=typeof WeakSet==`function`?WeakSet:Set,il=null;function al(e,t){if(e=e.containerInfo,qd=gp,e=Sr(e),Cr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Jd={focusedElem:e,selectionRange:n},gp=!1,il=t;il!==null;)if(t=il,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,il=e;else for(;il!==null;){switch(t=il,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Gs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Zu(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)uf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:uf(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,il=e;break}il=t.return}}function ol(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:xl(e,n),r&4&&Vc(5,n);break;case 1:if(xl(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Zu(n,n.return,e)}else{var i=Gs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Zu(n,n.return,e)}}}r&64&&Uc(n),r&512&&Gc(n,n.return);break;case 3:if(xl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{qa(e,t)}catch(e){Zu(n,n.return,e)}}break;case 27:t===null&&r&4&&$c(n);case 26:case 5:xl(e,n),t===null&&r&4&&qc(n),r&512&&Gc(n,n.return);break;case 12:xl(e,n);break;case 31:xl(e,n),r&4&&fl(e,n);break;case 13:xl(e,n),r&4&&pl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=td.bind(null,n),gf(e,n))));break;case 22:if(r=n.memoizedState!==null||el,!r){t=t!==null&&t.memoizedState!==null||tl,i=el;var a=tl;el=r,(tl=t)&&!a?Cl(e,n,!!(n.subtreeFlags&8772)):xl(e,n),el=i,tl=a}break;case 30:break;default:xl(e,n)}}function sl(e){var t=e.alternate;t!==null&&(e.alternate=null,sl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ut(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var cl=null,ll=!1;function ul(e,t,n){for(n=n.child;n!==null;)dl(e,t,n),n=n.sibling}function dl(e,t,n){if(je&&typeof je.onCommitFiberUnmount==`function`)try{je.onCommitFiberUnmount(Ae,n)}catch{}switch(n.tag){case 26:tl||Kc(n,t),ul(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:tl||Kc(n,t);var r=cl,i=ll;sf(n.type)&&(cl=n.stateNode,ll=!1),ul(e,t,n),Sf(n.stateNode),cl=r,ll=i;break;case 5:tl||Kc(n,t);case 6:if(r=cl,i=ll,cl=null,ul(e,t,n),cl=r,ll=i,cl!==null){if(ll)try{(cl.nodeType===9?cl.body:cl.nodeName===`HTML`?cl.ownerDocument.body:cl).removeChild(n.stateNode)}catch(e){Zu(n,t,e)}else try{cl.removeChild(n.stateNode)}catch(e){Zu(n,t,e)}}break;case 18:cl!==null&&(ll?(e=cl,cf(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Hp(e)):cf(cl,n.stateNode));break;case 4:r=cl,i=ll,cl=n.stateNode.containerInfo,ll=!0,ul(e,t,n),cl=r,ll=i;break;case 0:case 11:case 14:case 15:Hc(2,n,t),tl||Hc(4,n,t),ul(e,t,n);break;case 1:tl||(Kc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Wc(n,t,r)),ul(e,t,n);break;case 21:ul(e,t,n);break;case 22:tl=(r=tl)||n.memoizedState!==null,ul(e,t,n),tl=r;break;default:ul(e,t,n)}}function fl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Hp(e)}catch(e){Zu(t,t.return,e)}}}function pl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Hp(e)}catch(e){Zu(t,t.return,e)}}function ml(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new rl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new rl),t;default:throw Error(i(435,e.tag))}}function hl(e,t){var n=ml(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=nd.bind(null,e,t);t.then(r,r)}})}function gl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(sf(c.type)){cl=c.stateNode,ll=!1;break a}break;case 5:cl=c.stateNode,ll=!1;break a;case 3:case 4:cl=c.stateNode.containerInfo,ll=!0;break a}c=c.return}if(cl===null)throw Error(i(160));dl(o,s,a),cl=null,ll=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)vl(t,e),t=t.sibling}var _l=null;function vl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:gl(t,e),yl(e),r&4&&(Hc(3,e,e.return),Vc(3,e),Hc(5,e,e.return));break;case 1:gl(t,e),yl(e),r&512&&(tl||n===null||Kc(n,n.return)),r&64&&el&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=_l;if(gl(t,e),yl(e),r&512&&(tl||n===null||Kc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null){if(r===null){if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[lt]||o[nt]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Ud(o,r,n),o[nt]=e,ht(o),r=o;break a;case`link`:var s=Xf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Ud(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Xf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Ud(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[nt]=e,ht(o),r=o}e.stateNode=r}else Zf(a,e.type,e.stateNode)}else e.stateNode=Gf(a,r,e.memoizedProps)}else o===r?r===null&&e.stateNode!==null&&Jc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Zf(a,e.type,e.stateNode):Gf(a,r,e.memoizedProps))}break;case 27:gl(t,e),yl(e),r&512&&(tl||n===null||Kc(n,n.return)),n!==null&&r&4&&Jc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(gl(t,e),yl(e),r&512&&(tl||n===null||Kc(n,n.return)),e.flags&32){a=e.stateNode;try{Vt(a,``)}catch(t){Zu(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Jc(e,a,n===null?a:n.memoizedProps)),r&1024&&(nl=!0);break;case 6:if(gl(t,e),yl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Zu(e,e.return,t)}}break;case 3:if(Yf=null,a=_l,_l=Tf(t.containerInfo),gl(t,e),_l=a,yl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Hp(t.containerInfo)}catch(t){Zu(e,e.return,t)}nl&&(nl=!1,bl(e));break;case 4:r=_l,_l=Tf(e.stateNode.containerInfo),gl(t,e),yl(e),_l=r;break;case 12:gl(t,e),yl(e);break;case 31:gl(t,e),yl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,hl(e,r)));break;case 13:gl(t,e),yl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(au=xe()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,hl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=el,d=tl;if(el=u||a,tl=d||l,gl(t,e),tl=d,el=u,yl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||el||tl||Sl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Zu(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Zu(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?lf(m,!0):lf(l.stateNode,!1)}catch(e){Zu(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,hl(e,n))));break;case 19:gl(t,e),yl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,hl(e,r)));break;case 30:break;case 21:break;default:gl(t,e),yl(e)}}function yl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Yc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Qc(e,Xc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Vt(o,``),n.flags&=-33),Qc(e,Xc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Zc(e,Xc(e),s);break;default:throw Error(i(161))}}catch(t){Zu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function bl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;bl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function xl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)ol(e,t.alternate,t),t=t.sibling}function Sl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Hc(4,t,t.return),Sl(t);break;case 1:Kc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Wc(t,t.return,n),Sl(t);break;case 27:Sf(t.stateNode);case 26:case 5:Kc(t,t.return),Sl(t);break;case 22:t.memoizedState===null&&Sl(t);break;case 30:Sl(t);break;default:Sl(t)}e=e.sibling}}function Cl(e,t,n){for(n&&=!!(t.subtreeFlags&8772),t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:Cl(i,a,n),Vc(4,a);break;case 1:if(Cl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Zu(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Ka(c[i],s)}catch(e){Zu(r,r.return,e)}}n&&o&64&&Uc(a),Gc(a,a.return);break;case 27:$c(a);case 26:case 5:Cl(i,a,n),n&&r===null&&o&4&&qc(a),Gc(a,a.return);break;case 12:Cl(i,a,n);break;case 31:Cl(i,a,n),n&&o&4&&fl(i,a);break;case 13:Cl(i,a,n),n&&o&4&&pl(i,a);break;case 22:a.memoizedState===null&&Cl(i,a,n),Gc(a,a.return);break;case 30:break;default:Cl(i,a,n)}t=t.sibling}}function wl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&aa(n))}function Tl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&aa(e))}function El(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Dl(e,t,n,r),t=t.sibling}function Dl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:El(e,t,n,r),i&2048&&Vc(9,t);break;case 1:El(e,t,n,r);break;case 3:El(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&aa(e)));break;case 12:if(i&2048){El(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Zu(t,t.return,e)}}else El(e,t,n,r);break;case 31:El(e,t,n,r);break;case 13:El(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?El(e,t,n,r):(a._visibility|=2,Ol(e,t,n,r,!!(t.subtreeFlags&10256)||!1)):a._visibility&2?El(e,t,n,r):kl(e,t),i&2048&&wl(o,t);break;case 24:El(e,t,n,r),i&2048&&Tl(t.alternate,t);break;default:El(e,t,n,r)}}function Ol(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Ol(a,o,s,c,i),Vc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Ol(a,o,s,c,i)):u._visibility&2?Ol(a,o,s,c,i):kl(a,o),i&&l&2048&&wl(o.alternate,o);break;case 24:Ol(a,o,s,c,i),i&&l&2048&&Tl(o.alternate,o);break;default:Ol(a,o,s,c,i)}t=t.sibling}}function kl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:kl(n,r),i&2048&&wl(r.alternate,r);break;case 24:kl(n,r),i&2048&&Tl(r.alternate,r);break;default:kl(n,r)}t=t.sibling}}var Al=8192;function jl(e,t,n){if(e.subtreeFlags&Al)for(e=e.child;e!==null;)Ml(e,t,n),e=e.sibling}function Ml(e,t,n){switch(e.tag){case 26:jl(e,t,n),e.flags&Al&&e.memoizedState!==null&&ep(n,_l,e.memoizedState,e.memoizedProps);break;case 5:jl(e,t,n);break;case 3:case 4:var r=_l;_l=Tf(e.stateNode.containerInfo),jl(e,t,n),_l=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Al,Al=16777216,jl(e,t,n),Al=r):jl(e,t,n));break;default:jl(e,t,n)}}function Nl(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Pl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];il=r,Ll(r,e)}Nl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Fl(e),e=e.sibling}function Fl(e){switch(e.tag){case 0:case 11:case 15:Pl(e),e.flags&2048&&Hc(9,e,e.return);break;case 3:Pl(e);break;case 12:Pl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Il(e)):Pl(e);break;default:Pl(e)}}function Il(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];il=r,Ll(r,e)}Nl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Hc(8,t,t.return),Il(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Il(t));break;default:Il(t)}e=e.sibling}}function Ll(e,t){for(;il!==null;){var n=il;switch(n.tag){case 0:case 11:case 15:Hc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:aa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,il=r;else a:for(n=e;il!==null;){r=il;var i=r.sibling,a=r.return;if(sl(r),r===n){il=null;break a}if(i!==null){i.return=a,il=i;break a}il=a}}}var Rl={getCacheForType:function(e){var t=Zi(ra),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Zi(ra).controller.signal}},zl=typeof WeakMap==`function`?WeakMap:Map,Bl=0,Vl=null,Hl=null,Ul=0,Wl=0,Gl=null,Kl=!1,ql=!1,Jl=!1,Yl=0,Xl=0,Zl=0,Ql=0,$l=0,eu=0,tu=0,nu=null,ru=null,iu=!1,au=0,ou=0,su=1/0,cu=null,lu=null,uu=0,du=null,fu=null,pu=0,mu=0,hu=null,gu=null,_u=0,vu=null;function yu(){return Bl&2&&Ul!==0?Ul&-Ul:I.T===null?$e():vd()}function bu(){if(eu===0){if(!(Ul&536870912)||Ai){var e=Re;Re<<=1,!(Re&3932160)&&(Re=262144),eu=e}else eu=536870912}return e=$a.current,e!==null&&(e.flags|=32),eu}function xu(e,t,n){(e===Vl&&(Wl===2||Wl===9)||e.cancelPendingCommit!==null)&&(Ou(e,0),Tu(e,Ul,eu,!1)),Ke(e,n),(!(Bl&2)||e!==Vl)&&(e===Vl&&(!(Bl&2)&&(Ql|=n),Xl===4&&Tu(e,Ul,eu,!1)),ud(e))}function Su(e,t,n){if(Bl&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||He(e,t),a=r?Iu(e,t):Pu(e,t,!0),o=r;do{if(a===0){ql&&!r&&Tu(e,t,0,!1);break}if(n=e.current.alternate,o&&!wu(n)){a=Pu(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=nu;var l=c.current.memoizedState.isDehydrated;if(l&&(Ou(c,s).flags|=256),s=Pu(c,s,!1),s!==2){if(Jl&&!l){c.errorRecoveryDisabledLanes|=o,Ql|=o,a=4;break a}o=ru,ru=a,o!==null&&(ru===null?ru=o:ru.push.apply(ru,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Ou(e,0),Tu(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:Tu(r,t,eu,!Kl);break a;case 2:ru=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=au+300-xe(),10<a)){if(Tu(r,t,eu,!Kl),Ve(r,0,!0)!==0)break a;pu=t,r.timeoutHandle=tf(Cu.bind(null,r,n,ru,cu,iu,t,eu,Ql,tu,Kl,o,`Throttled`,-0,0),a);break a}Cu(r,n,ru,cu,iu,t,eu,Ql,tu,Kl,o,null,-0,0)}break}while(1);ud(e)}function Cu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Yt},Ml(t,a,d);var m=(a&62914560)===a?au-xe():(a&4194048)===a?ou-xe():0;if(m=np(d,m),m!==null){pu=a,e.cancelPendingCommit=m(Uu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),Tu(e,a,o,!l);return}}Uu(e,t,a,n,r,i,o,s,c)}function wu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!_r(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Tu(e,t,n,r){t&=~$l,t&=~Ql,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ne(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Je(e,n,t)}function Eu(){return Bl&6?!0:(dd(0,!1),!1)}function Du(){if(Hl!==null){if(Wl===0)var e=Hl.return;else e=Hl,Ui=Hi=null,Do(e),Oa=null,ka=0,e=Hl;for(;e!==null;)Bc(e.alternate,e),e=e.return;Hl=null}}function Ou(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,nf(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),pu=0,Du(),Vl=e,Hl=n=ai(e.current,null),Ul=t,Wl=0,Gl=null,Kl=!1,ql=He(e,t),Jl=!1,tu=eu=$l=Ql=Zl=Xl=0,ru=nu=null,iu=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Ne(r),a=1<<i;t|=e[i],r&=~a}return Yl=t,Yr(),n}function ku(e,t){co=null,I.H=Ls,t===va||t===ba?(t=Ea(),Wl=3):t===ya?(t=Ea(),Wl=4):Wl=t===tc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Gl=t,Hl===null&&(Xl=1,Ys(e,pi(t,e.current)))}function Au(){var e=$a.current;return e===null?!0:(Ul&4194048)===Ul?eo===null:(Ul&62914560)===Ul||Ul&536870912?e===eo:!1}function ju(){var e=I.H;return I.H=Ls,e===null?Ls:e}function Mu(){var e=I.A;return I.A=Rl,e}function Nu(){Xl=4,Kl||(Ul&4194048)!==Ul&&$a.current!==null||(ql=!0),!(Zl&134217727)&&!(Ql&134217727)||Vl===null||Tu(Vl,Ul,eu,!1)}function Pu(e,t,n){var r=Bl;Bl|=2;var i=ju(),a=Mu();(Vl!==e||Ul!==t)&&(cu=null,Ou(e,t)),t=!1;var o=Xl;a:do try{if(Wl!==0&&Hl!==null){var s=Hl,c=Gl;switch(Wl){case 8:Du(),o=6;break a;case 3:case 2:case 9:case 6:$a.current===null&&(t=!0);var l=Wl;if(Wl=0,Gl=null,Bu(e,s,c,l),n&&ql){o=0;break a}break;default:l=Wl,Wl=0,Gl=null,Bu(e,s,c,l)}}Fu(),o=Xl;break}catch(t){ku(e,t)}while(1);return t&&e.shellSuspendCounter++,Ui=Hi=null,Bl=r,I.H=i,I.A=a,Hl===null&&(Vl=null,Ul=0,Yr()),o}function Fu(){for(;Hl!==null;)Ru(Hl)}function Iu(e,t){var n=Bl;Bl|=2;var r=ju(),a=Mu();Vl!==e||Ul!==t?(cu=null,su=xe()+500,Ou(e,t)):ql=He(e,t);a:do try{if(Wl!==0&&Hl!==null){t=Hl;var o=Gl;b:switch(Wl){case 1:Wl=0,Gl=null,Bu(e,t,o,1);break;case 2:case 9:if(Sa(o)){Wl=0,Gl=null,zu(t);break}t=function(){Wl!==2&&Wl!==9||Vl!==e||(Wl=7),ud(e)},o.then(t,t);break a;case 3:Wl=7;break a;case 4:Wl=5;break a;case 7:Sa(o)?(Wl=0,Gl=null,zu(t)):(Wl=0,Gl=null,Bu(e,t,o,7));break;case 5:var s=null;switch(Hl.tag){case 26:s=Hl.memoizedState;case 5:case 27:var c=Hl;if(s?$f(s):c.stateNode.complete){Wl=0,Gl=null;var l=c.sibling;if(l!==null)Hl=l;else{var u=c.return;u===null?Hl=null:(Hl=u,Vu(u))}break b}}Wl=0,Gl=null,Bu(e,t,o,5);break;case 6:Wl=0,Gl=null,Bu(e,t,o,6);break;case 8:Du(),Xl=6;break a;default:throw Error(i(462))}}Lu();break}catch(t){ku(e,t)}while(1);return Ui=Hi=null,I.H=r,I.A=a,Bl=n,Hl===null?(Vl=null,Ul=0,Yr(),Xl):0}function Lu(){for(;Hl!==null&&!ye();)Ru(Hl)}function Ru(e){var t=jc(e.alternate,e,Yl);e.memoizedProps=e.pendingProps,t===null?Vu(e):Hl=t}function zu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=hc(n,t,t.pendingProps,t.type,void 0,Ul);break;case 11:t=hc(n,t,t.pendingProps,t.type.render,t.ref,Ul);break;case 5:Do(t);default:Bc(n,t),t=Hl=oi(t,Yl),t=jc(n,t,Yl)}e.memoizedProps=e.pendingProps,t===null?Vu(e):Hl=t}function Bu(e,t,n,r){Ui=Hi=null,Do(t),Oa=null,ka=0;var i=t.return;try{if(ec(e,i,t,n,Ul)){Xl=1,Ys(e,pi(n,e.current)),Hl=null;return}}catch(t){if(i!==null)throw Hl=i,t;Xl=1,Ys(e,pi(n,e.current)),Hl=null;return}t.flags&32768?(Ai||r===1?e=!0:ql||Ul&536870912?e=!1:(Kl=e=!0,(r===2||r===9||r===3||r===6)&&(r=$a.current,r!==null&&r.tag===13&&(r.flags|=16384))),Hu(t,e)):Vu(t)}function Vu(e){var t=e;do{if(t.flags&32768){Hu(t,Kl);return}e=t.return;var n=Rc(t.alternate,t,Yl);if(n!==null){Hl=n;return}if(t=t.sibling,t!==null){Hl=t;return}Hl=t=e}while(t!==null);Xl===0&&(Xl=5)}function Hu(e,t){do{var n=zc(e.alternate,e);if(n!==null){n.flags&=32767,Hl=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Hl=e;return}Hl=e=n}while(e!==null);Xl=6,Hl=null}function Uu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Ju();while(uu!==0);if(Bl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Jr,qe(e,n,o,s,c,l),e===Vl&&(Hl=Vl=null,Ul=0),fu=t,du=e,pu=n,mu=o,hu=a,gu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,rd(Te,function(){return Yu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=I.T,I.T=null,a=L.p,L.p=2,s=Bl,Bl|=4;try{al(e,t,n)}finally{Bl=s,L.p=a,I.T=r}}uu=1,Wu(),Gu(),Ku()}}function Wu(){if(uu===1){uu=0;var e=du,t=fu,n=!!(t.flags&13878);if(t.subtreeFlags&13878||n){n=I.T,I.T=null;var r=L.p;L.p=2;var i=Bl;Bl|=4;try{vl(t,e);var a=Jd,o=Sr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&xr(s.ownerDocument.documentElement,s)){if(c!==null&&Cr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=br(s,h),v=br(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}gp=!!qd,Jd=qd=null}finally{Bl=i,L.p=r,I.T=n}}e.current=t,uu=2}}function Gu(){if(uu===2){uu=0;var e=du,t=fu,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=I.T,I.T=null;var r=L.p;L.p=2;var i=Bl;Bl|=4;try{ol(e,t.alternate,t)}finally{Bl=i,L.p=r,I.T=n}}uu=3}}function Ku(){if(uu===4||uu===3){uu=0,be();var e=du,t=fu,n=pu,r=gu;t.subtreeFlags&10256||t.flags&10256?uu=5:(uu=0,fu=du=null,qu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(lu=null),Qe(n),t=t.stateNode,je&&typeof je.onCommitFiberRoot==`function`)try{je.onCommitFiberRoot(Ae,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=I.T,i=L.p,L.p=2,I.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{I.T=t,L.p=i}}pu&3&&Ju(),ud(e),i=e.pendingLanes,n&261930&&i&42?e===vu?_u++:(_u=0,vu=e):_u=0,dd(0,!1)}}function qu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,aa(t)))}function Ju(){return Wu(),Gu(),Ku(),Yu()}function Yu(){if(uu!==5)return!1;var e=du,t=mu;mu=0;var n=Qe(pu),r=I.T,a=L.p;try{L.p=32>n?32:n,I.T=null,n=hu,hu=null;var o=du,s=pu;if(uu=0,fu=du=null,pu=0,Bl&6)throw Error(i(331));var c=Bl;if(Bl|=4,Fl(o.current),Dl(o,o.current,s,n),Bl=c,dd(0,!1),je&&typeof je.onPostCommitFiberRoot==`function`)try{je.onPostCommitFiberRoot(Ae,o)}catch{}return!0}finally{L.p=a,I.T=r,qu(e,t)}}function Xu(e,t,n){t=pi(n,t),t=Zs(e.stateNode,t,2),e=Ba(e,t,2),e!==null&&(Ke(e,2),ud(e))}function Zu(e,t,n){if(e.tag===3)Xu(e,e,n);else for(;t!==null;){if(t.tag===3){Xu(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(lu===null||!lu.has(r))){e=pi(n,e),n=Qs(2),r=Ba(t,n,2),r!==null&&($s(n,r,t,e),Ke(r,2),ud(r));break}}t=t.return}}function Qu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new zl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Jl=!0,i.add(n),e=$u.bind(null,e,t,n),t.then(e,e))}function $u(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Vl===e&&(Ul&n)===n&&(Xl===4||Xl===3&&(Ul&62914560)===Ul&&300>xe()-au?!(Bl&2)&&Ou(e,0):$l|=n,tu===Ul&&(tu=0)),ud(e)}function ed(e,t){t===0&&(t=We()),e=Qr(e,t),e!==null&&(Ke(e,t),ud(e))}function td(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ed(e,n)}function nd(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),ed(e,n)}function rd(e,t){return _e(e,t)}var id=null,ad=null,od=!1,sd=!1,cd=!1,ld=0;function ud(e){e!==ad&&e.next===null&&(ad===null?id=ad=e:ad=ad.next=e),sd=!0,od||(od=!0,_d())}function dd(e,t){if(!cd&&sd){cd=!0;do for(var n=!1,r=id;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Ne(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,gd(r,a))}else a=Ul,a=Ve(r,r===Vl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||He(r,a)||(n=!0,gd(r,a))}r=r.next}while(n);cd=!1}}function fd(){pd()}function pd(){sd=od=!1;var e=0;ld!==0&&ef()&&(e=ld);for(var t=xe(),n=null,r=id;r!==null;){var i=r.next,a=md(r,t);a===0?(r.next=null,n===null?id=i:n.next=i,i===null&&(ad=n)):(n=r,(e!==0||a&3)&&(sd=!0)),r=i}uu!==0&&uu!==5||dd(e,!1),ld!==0&&(ld=0)}function md(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Ne(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Ue(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Vl,n=Ul,n=Ve(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Wl===2||Wl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&ve(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||He(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&ve(r),Qe(n)){case 2:case 8:n=we;break;case 32:n=Te;break;case 268435456:n=De;break;default:n=Te}return r=hd.bind(null,e),n=_e(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&ve(r),e.callbackPriority=2,e.callbackNode=null,2}function hd(e,t){if(uu!==0&&uu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Ju()&&e.callbackNode!==n)return null;var r=Ul;return r=Ve(e,e===Vl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Su(e,r,t),md(e,xe()),e.callbackNode!=null&&e.callbackNode===n?hd.bind(null,e):null)}function gd(e,t){if(Ju())return null;Su(e,t,!0)}function _d(){af(function(){Bl&6?_e(Ce,fd):pd()})}function vd(){if(ld===0){var e=ca;e===0&&(e=Le,Le<<=1,!(Le&261888)&&(Le=256)),ld=e}return ld}function yd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Jt(``+e)}function bd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function xd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=yd((i[rt]||null).action),o=r.submitter;o&&(t=(t=o[rt]||null)?yd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new _n(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(ld!==0){var e=o?bd(i,o):new FormData(i);Cs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?bd(i,o):new FormData(i),Cs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Sd=0;Sd<Ur.length;Sd++){var Cd=Ur[Sd];Wr(Cd.toLowerCase(),`on`+(Cd[0].toUpperCase()+Cd.slice(1)))}Wr(Fr,`onAnimationEnd`),Wr(Ir,`onAnimationIteration`),Wr(Lr,`onAnimationStart`),Wr(`dblclick`,`onDoubleClick`),Wr(`focusin`,`onFocus`),Wr(`focusout`,`onBlur`),Wr(Rr,`onTransitionRun`),Wr(zr,`onTransitionStart`),Wr(Br,`onTransitionCancel`),Wr(Vr,`onTransitionEnd`),yt(`onMouseEnter`,[`mouseout`,`mouseover`]),yt(`onMouseLeave`,[`mouseout`,`mouseover`]),yt(`onPointerEnter`,[`pointerout`,`pointerover`]),yt(`onPointerLeave`,[`pointerout`,`pointerover`]),vt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),vt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),vt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),vt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),vt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),vt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var wd=`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(` `),Td=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(wd));function Ed(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Gr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Gr(e)}i.currentTarget=null,a=c}}}}function Dd(e,t){var n=t[at];n===void 0&&(n=t[at]=new Set);var r=e+`__bubble`;n.has(r)||(jd(t,e,2,!1),n.add(r))}function Od(e,t,n){var r=0;t&&(r|=4),jd(n,e,r,t)}var kd=`_reactListening`+Math.random().toString(36).slice(2);function Ad(e){if(!e[kd]){e[kd]=!0,gt.forEach(function(t){t!==`selectionchange`&&(Td.has(t)||Od(t,!1,e),Od(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[kd]||(t[kd]=!0,Od(`selectionchange`,!1,t))}}function jd(e,t,n,r){switch(Cp(t)){case 2:var i=_p;break;case 8:i=vp;break;default:i=yp}n=i.bind(null,t,n,e),i=void 0,!on||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Md(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=dt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}nn(function(){var r=a,i=Zt(n),s=[];a:{var c=Hr.get(e);if(c!==void 0){var l=_n,u=e;switch(e){case`keypress`:if(fn(n)===0)break a;case`keydown`:case`keyup`:l=Fn;break;case`focusin`:u=`focus`,l=En;break;case`focusout`:u=`blur`,l=En;break;case`beforeblur`:case`afterblur`:l=En;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=wn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Tn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Ln;break;case Fr:case Ir:case Lr:l=Dn;break;case Vr:l=Rn;break;case`scroll`:case`scrollend`:l=yn;break;case`wheel`:l=zn;break;case`copy`:case`cut`:case`paste`:l=On;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=In;break;case`toggle`:case`beforetoggle`:l=Bn}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=rn(m,p),g!=null&&d.push(Nd(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==Xt&&(u=n.relatedTarget||n.fromElement)&&(dt(u)||u[it]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?dt(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=wn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=In,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:pt(l),h=u==null?c:pt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,dt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Fd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Id(s,c,l,d,!1),u!==null&&f!==null&&Id(s,f,u,d,!0)}}a:{if(c=r?pt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=ar;else if($n(c)){if(or)v=hr;else{v=pr;var y=fr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Gt(r.elementType)&&(v=ar):v=mr;if(v&&=v(e,r)){er(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Lt(c,`number`,c.value)}switch(y=r?pt(r):window,e){case`focusin`:($n(y)||y.contentEditable===`true`)&&(Tr=y,Er=r,Dr=null);break;case`focusout`:Dr=Er=Tr=null;break;case`mousedown`:Or=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Or=!1,kr(s,n,i);break;case`selectionchange`:if(wr)break;case`keydown`:case`keyup`:kr(s,n,i)}var b;if(U)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else Yn?qn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Wn&&n.locale!==`ko`&&(Yn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Yn&&(b=dn()):(cn=i,ln=`value`in cn?cn.value:cn.textContent,Yn=!0)),y=Pd(r,x),0<y.length&&(x=new kn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=Jn(n),b!==null&&(x.data=b)))),(b=Un?Xn(e,n):Zn(e,n))&&(x=Pd(r,`onBeforeInput`),0<x.length&&(y=new kn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),xd(s,e,r,n,i)}Ed(s,t)})}function Nd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Pd(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=rn(e,n),i!=null&&r.unshift(Nd(e,i,a)),i=rn(e,t),i!=null&&r.push(Nd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Fd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Id(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=rn(n,a),l!=null&&o.unshift(Nd(n,l,c))):i||(l=rn(n,a),l!=null&&o.push(Nd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Ld=/\r\n?/g,Rd=/\u0000|\uFFFD/g;function zd(e){return(typeof e==`string`?e:``+e).replace(Ld,`
10
+ `).replace(Rd,``)}function Bd(e,t){return t=zd(t),zd(e)===t}function Vd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Vt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Vt(e,``+r);break;case`className`:Tt(e,`class`,r);break;case`tabIndex`:Tt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Tt(e,n,r);break;case`style`:Wt(e,r,o);break;case`data`:if(t!==`object`){Tt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Jt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`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}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&Vd(e,t,`name`,a.name,a,null),Vd(e,t,`formEncType`,a.formEncType,a,null),Vd(e,t,`formMethod`,a.formMethod,a,null),Vd(e,t,`formTarget`,a.formTarget,a,null)):(Vd(e,t,`encType`,a.encType,a,null),Vd(e,t,`method`,a.method,a,null),Vd(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Jt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Yt);break;case`onScroll`:r!=null&&Dd(`scroll`,e);break;case`onScrollEnd`:r!=null&&Dd(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Jt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);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`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Dd(`beforetoggle`,e),Dd(`toggle`,e),wt(e,`popover`,r);break;case`xlinkActuate`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Et(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Et(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Et(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:wt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Kt.get(n)||n,wt(e,n,r))}}function Hd(e,t,n,r,a,o){switch(n){case`style`:Wt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Vt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Vt(e,``+r);break;case`onScroll`:r!=null&&Dd(`scroll`,e);break;case`onScrollEnd`:r!=null&&Dd(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Yt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!_t.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[rt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):wt(e,n,r)}}}function Ud(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Dd(`error`,e),Dd(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Vd(e,t,o,s,n,null)}}a&&Vd(e,t,`srcSet`,n.srcSet,n,null),r&&Vd(e,t,`src`,n.src,n,null);return;case`input`:Dd(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Vd(e,t,r,d,n,null)}}It(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Dd(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Vd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Rt(e,!!r,n,!0):Rt(e,!!r,t,!1);return;case`textarea`:for(s in Dd(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Vd(e,t,s,c,n,null)}Bt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Vd(e,t,l,r,n,null)}return;case`dialog`:Dd(`beforetoggle`,e),Dd(`toggle`,e),Dd(`cancel`,e),Dd(`close`,e);break;case`iframe`:case`object`:Dd(`load`,e);break;case`video`:case`audio`:for(r=0;r<wd.length;r++)Dd(wd[r],e);break;case`image`:Dd(`error`,e),Dd(`load`,e);break;case`details`:Dd(`toggle`,e);break;case`embed`:case`source`:case`link`:Dd(`error`,e),Dd(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Vd(e,t,u,r,n,null)}return;default:if(Gt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Hd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Vd(e,t,c,r,n,null))}function Wd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Vd(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Vd(e,t,p,m,r,f)}}Ft(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Vd(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Vd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Rt(e,!!n,n?[]:``,!1):Rt(e,!!n,t,!0)):Rt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Vd(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Vd(e,t,s,a,r,o)}zt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Vd(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Vd(e,t,l,p,r,m)}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 g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Vd(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Vd(e,t,u,p,r,m)}return;default:if(Gt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Hd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Hd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Vd(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Vd(e,t,f,p,r,m)}function Gd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Kd(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Gd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Gd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var qd=null,Jd=null;function Yd(e){return e.nodeType===9?e:e.ownerDocument}function Xd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Zd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Qd(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var $d=null;function ef(){var e=window.event;return e&&e.type===`popstate`?e!==$d&&($d=e,!0):($d=null,!1)}var tf=typeof setTimeout==`function`?setTimeout:void 0,nf=typeof clearTimeout==`function`?clearTimeout:void 0,rf=typeof Promise==`function`?Promise:void 0,af=typeof queueMicrotask==`function`?queueMicrotask:rf===void 0?tf:function(e){return rf.resolve(null).then(e).catch(of)};function of(e){setTimeout(function(){throw e})}function sf(e){return e===`head`}function cf(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Hp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Sf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Sf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[lt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Sf(e.ownerDocument.body)}n=i}while(n);Hp(t)}function lf(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function uf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:uf(n),ut(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function df(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[lt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=_f(e.nextSibling),e===null)break}return null}function ff(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=_f(e.nextSibling),e===null))return null;return e}function pf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=_f(e.nextSibling),e===null))return null;return e}function mf(e){return e.data===`$?`||e.data===`$~`}function hf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function gf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function _f(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var vf=null;function yf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return _f(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function bf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function xf(e,t,n){switch(t=Yd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function Sf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ut(e)}var Cf=new Map,wf=new Set;function Tf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ef=L.d;L.d={f:Df,r:Of,D:jf,C:Mf,L:Nf,m:Pf,X:If,S:Ff,M:Lf};function Df(){var e=Ef.f(),t=Eu();return e||t}function Of(e){var t=ft(e);t!==null&&t.tag===5&&t.type===`form`?Ts(t):Ef.r(e)}var kf=typeof document>`u`?null:document;function Af(e,t,n){var r=kf;if(r&&typeof t==`string`&&t){var i=Pt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),wf.has(i)||(wf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Ud(t,`link`,e),ht(t),r.head.appendChild(t)))}}function jf(e){Ef.D(e),Af(`dns-prefetch`,e,null)}function Mf(e,t){Ef.C(e,t),Af(`preconnect`,e,t)}function Nf(e,t,n){Ef.L(e,t,n);var r=kf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Pt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Pt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Pt(n.imageSizes)+`"]`)):i+=`[href="`+Pt(e)+`"]`;var a=i;switch(t){case`style`:a=zf(e);break;case`script`:a=Uf(e)}Cf.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Cf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Bf(a))||t===`script`&&r.querySelector(Wf(a))||(t=r.createElement(`link`),Ud(t,`link`,e),ht(t),r.head.appendChild(t)))}}function Pf(e,t){Ef.m(e,t);var n=kf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Pt(r)+`"][href="`+Pt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Uf(e)}if(!Cf.has(a)&&(e=m({rel:`modulepreload`,href:e},t),Cf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Wf(a)))return}r=n.createElement(`link`),Ud(r,`link`,e),ht(r),n.head.appendChild(r)}}}function Ff(e,t,n){Ef.S(e,t,n);var r=kf;if(r&&e){var i=mt(r).hoistableStyles,a=zf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Bf(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Cf.get(a))&&qf(e,n);var c=o=r.createElement(`link`);ht(c),Ud(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Kf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function If(e,t){Ef.X(e,t);var n=kf;if(n&&e){var r=mt(n).hoistableScripts,i=Uf(e),a=r.get(i);a||(a=n.querySelector(Wf(i)),a||(e=m({src:e,async:!0},t),(t=Cf.get(i))&&Jf(e,t),a=n.createElement(`script`),ht(a),Ud(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Lf(e,t){Ef.M(e,t);var n=kf;if(n&&e){var r=mt(n).hoistableScripts,i=Uf(e),a=r.get(i);a||(a=n.querySelector(Wf(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=Cf.get(i))&&Jf(e,t),a=n.createElement(`script`),ht(a),Ud(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Rf(e,t,n,r){var a=(a=re.current)?Tf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=zf(n.href),n=mt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=zf(n.href);var o=mt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Bf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),Cf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Cf.set(e,n),o||Hf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Uf(n),n=mt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function zf(e){return`href="`+Pt(e)+`"`}function Bf(e){return`link[rel="stylesheet"][`+e+`]`}function Vf(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function Hf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Ud(t,`link`,n),ht(t),e.head.appendChild(t))}function Uf(e){return`[src="`+Pt(e)+`"]`}function Wf(e){return`script[async]`+e}function Gf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Pt(n.href)+`"]`);if(r)return t.instance=r,ht(r),r;var a=m({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),ht(r),Ud(r,`style`,a),Kf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=zf(n.href);var o=e.querySelector(Bf(a));if(o)return t.state.loading|=4,t.instance=o,ht(o),o;r=Vf(n),(a=Cf.get(a))&&qf(r,a),o=(e.ownerDocument||e).createElement(`link`),ht(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Ud(o,`link`,r),t.state.loading|=4,Kf(o,n.precedence,e),t.instance=o;case`script`:return o=Uf(n.src),(a=e.querySelector(Wf(o)))?(t.instance=a,ht(a),a):(r=n,(a=Cf.get(o))&&(r=m({},n),Jf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),ht(a),Ud(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Kf(r,n.precedence,e));return t.instance}function Kf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function qf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Jf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Yf=null;function Xf(e,t,n){if(Yf===null){var r=new Map,i=Yf=new Map;i.set(n,r)}else i=Yf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[lt]||a[nt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Zf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Qf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function $f(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function ep(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=zf(r.href),a=t.querySelector(Bf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=rp.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,ht(a);return}a=t.ownerDocument||t,r=Vf(r),(i=Cf.get(i))&&qf(r,i),a=a.createElement(`link`),ht(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Ud(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=rp.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var tp=0;function np(e,t){return e.stylesheets&&e.count===0&&ap(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ap(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&tp===0&&(tp=62500*Kd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ap(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>tp?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function rp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ap(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ip=null;function ap(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ip=new Map,t.forEach(op,e),ip=null,rp.call(e))}function op(e,t){if(!(t.state.loading&4)){var n=ip.get(e);if(n)var r=n.get(null);else{n=new Map,ip.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=rp.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var sp={$$typeof:C,Provider:null,Consumer:null,_currentValue:ee,_currentValue2:ee,_threadCount:0};function cp(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,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=Ge(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ge(0),this.hiddenUpdates=Ge(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function lp(e,t,n,r,i,a,o,s,c,l,u,d){return e=new cp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ri(3,null,null,t),e.current=a,a.stateNode=e,t=ia(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},La(a),e}function up(e){return e?(e=ti,e):ti}function dp(e,t,n,r,i,a){i=up(i),r.context===null?r.context=i:r.pendingContext=i,r=za(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ba(e,r,t),n!==null&&(xu(n,e,t),Va(n,e,t))}function fp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function pp(e,t){fp(e,t),(e=e.alternate)&&fp(e,t)}function mp(e){if(e.tag===13||e.tag===31){var t=Qr(e,67108864);t!==null&&xu(t,e,67108864),pp(e,67108864)}}function hp(e){if(e.tag===13||e.tag===31){var t=yu();t=Ze(t);var n=Qr(e,t);n!==null&&xu(n,e,t),pp(e,t)}}var gp=!0;function _p(e,t,n,r){var i=I.T;I.T=null;var a=L.p;try{L.p=2,yp(e,t,n,r)}finally{L.p=a,I.T=i}}function vp(e,t,n,r){var i=I.T;I.T=null;var a=L.p;try{L.p=8,yp(e,t,n,r)}finally{L.p=a,I.T=i}}function yp(e,t,n,r){if(gp){var i=bp(r);if(i===null)Md(e,t,r,xp,n),Mp(e,r);else if(Pp(i,e,t,n,r))r.stopPropagation();else if(Mp(e,r),t&4&&-1<jp.indexOf(e)){for(;i!==null;){var a=ft(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Be(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ne(o);s.entanglements[1]|=c,o&=~c}ud(a),!(Bl&6)&&(su=xe()+500,dd(0,!1))}}break;case 31:case 13:s=Qr(a,2),s!==null&&xu(s,a,2),Eu(),pp(a,2)}if(a=bp(r),a===null&&Md(e,t,r,xp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Md(e,t,r,null,n)}}function bp(e){return e=Zt(e),Sp(e)}var xp=null;function Sp(e){if(xp=null,e=dt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return xp=e,null}function Cp(e){switch(e){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(Se()){case Ce:return 2;case we:return 8;case Te:case Ee:return 32;case De:return 268435456;default:return 32}default:return 32}}var wp=!1,Tp=null,Ep=null,Dp=null,Op=new Map,kp=new Map,Ap=[],jp=`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 Mp(e,t){switch(e){case`focusin`:case`focusout`:Tp=null;break;case`dragenter`:case`dragleave`:Ep=null;break;case`mouseover`:case`mouseout`:Dp=null;break;case`pointerover`:case`pointerout`:Op.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:kp.delete(t.pointerId)}}function Np(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=ft(t),t!==null&&mp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Pp(e,t,n,r,i){switch(t){case`focusin`:return Tp=Np(Tp,e,t,n,r,i),!0;case`dragenter`:return Ep=Np(Ep,e,t,n,r,i),!0;case`mouseover`:return Dp=Np(Dp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Op.set(a,Np(Op.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,kp.set(a,Np(kp.get(a)||null,e,t,n,r,i)),!0}return!1}function Fp(e){var t=dt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,et(e.priority,function(){hp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,et(e.priority,function(){hp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ip(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=bp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Xt=r,n.target.dispatchEvent(r),Xt=null}else return t=ft(n),t!==null&&mp(t),e.blockedOn=n,!1;t.shift()}return!0}function Lp(e,t,n){Ip(e)&&n.delete(t)}function Rp(){wp=!1,Tp!==null&&Ip(Tp)&&(Tp=null),Ep!==null&&Ip(Ep)&&(Ep=null),Dp!==null&&Ip(Dp)&&(Dp=null),Op.forEach(Lp),kp.forEach(Lp)}function zp(e,n){e.blockedOn===n&&(e.blockedOn=null,wp||(wp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Rp)))}var Bp=null;function Vp(e){Bp!==e&&(Bp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Bp===e&&(Bp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Sp(r||n)===null)continue;break}var a=ft(n);a!==null&&(e.splice(t,3),t-=3,Cs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Hp(e){function t(t){return zp(t,e)}Tp!==null&&zp(Tp,e),Ep!==null&&zp(Ep,e),Dp!==null&&zp(Dp,e),Op.forEach(t),kp.forEach(t);for(var n=0;n<Ap.length;n++){var r=Ap[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ap.length&&(n=Ap[0],n.blockedOn===null);)Fp(n),n.blockedOn===null&&Ap.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[rt]||null;if(typeof a==`function`)o||Vp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[rt]||null)s=o.formAction;else if(Sp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Vp(n)}}}function Up(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Wp(e){this._internalRoot=e}Gp.prototype.render=Wp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;dp(n,yu(),e,t,null,null)},Gp.prototype.unmount=Wp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;dp(e.current,2,null,e,null,null),Eu(),t[it]=null}};function Gp(e){this._internalRoot=e}Gp.prototype.unstable_scheduleHydration=function(e){if(e){var t=$e();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ap.length&&t!==0&&t<Ap[n].priority;n++);Ap.splice(n,0,e),n===0&&Fp(e)}};var Kp=n.version;if(Kp!==`19.2.8`)throw Error(i(527,Kp,`19.2.8`));L.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var qp={bundleType:0,version:`19.2.8`,rendererPackageName:`react-dom`,currentDispatcherRef:I,reconcilerVersion:`19.2.8`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Jp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jp.isDisabled&&Jp.supportsFiber)try{Ae=Jp.inject(qp),je=Jp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Ks,s=qs,c=Js;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=lp(e,1,!1,null,null,n,r,null,o,s,c,Up),e[it]=t.current,Ad(e),new Wp(t)}})),_=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=l(d(),1),y=_();function b(e){try{return localStorage.getItem(e)??void 0}catch{return}}function x(e,t){try{t===void 0?localStorage.removeItem(e):localStorage.setItem(e,t)}catch{}}function S(e,t){let n=b(e);if(n===void 0)return t;try{return JSON.parse(n)}catch{return t}}function C(e,t){x(e,JSON.stringify(t))}var w=`workerdeck.theme`;function T(){let e=b(w);return e===`light`||e===`dark`?e:matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}function E(e=T()){return document.documentElement.setAttribute(`data-theme`,e)}function D(e){x(w,e),E(e)}function O(){let e=T()===`dark`?`light`:`dark`;return D(e),e}var k=v.useLayoutEffect;function A(e,t,n){v.useEffect(()=>{if(!e.current||n||typeof IntersectionObserver!=`function`)return()=>t();let r=new IntersectionObserver(e=>{t(e.pop())},{rootMargin:`100px`});return r.observe(e.current),()=>{r.disconnect(),t()}},[t,n,e])}function j(e){let t=v.useRef(null);return v.useImperativeHandle(e,()=>t.current,[]),t}function M(e){return e[e.length-1]}function N(e,t){return typeof e==`function`?e(t):e}var P=Object.prototype.hasOwnProperty,F=Object.prototype.propertyIsEnumerable;function I(e){for(let t in e)if(P.call(e,t))return!0;return!1}var L=()=>Object.create(null),ee=(e,t)=>R(e,t,L);function R(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=V(e)&&V(i);if(!a&&!(z(e)&&z(i)))return i;let o=a?e:te(e);if(!o)return i;let s=a?i:te(i);if(!s)return i;let c=o.length,l=s.length,u=a?Array(l):n(),d=0;for(let t=0;t<l;t++){let o=a?t:s[t],l=e[o],f=i[o];if(l===f){u[o]=l,(a?t<c:P.call(e,o))&&d++;continue}if(l===null||f===null||typeof l!=`object`||typeof f!=`object`){u[o]=f;continue}let p=R(l,f,n,r+1);u[o]=p,p===l&&d++}return c===l&&d===c?e:u}function te(e){let t=Object.keys(e);if(t.length!==Object.getOwnPropertyNames(e).length)return!1;let n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;for(let r of n){if(!F.call(e,r))return!1;t.push(r)}return t}function z(e){if(!B(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!B(n)||!n.hasOwnProperty(`isPrototypeOf`))}function B(e){return Object.prototype.toString.call(e)===`[object Object]`}function V(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ne(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!ne(e[r],t[r],n))return!1;return!0}if(z(e)&&z(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!ne(e[i],t[i],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;let a=0;for(let o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!ne(e[o],t[o],n)))return!1;return i===a}return!1}var H=/[\x00-\x1f\x7f"<>`{}]/g;function re(e){return e.replace(H,e=>`%`+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,`0`))}function ie(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return re(t)}var ae=[`http:`,`https:`,`mailto:`,`tel:`];function oe(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function se(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=ie(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=ie(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function ce(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function le(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 ue(){throw Error(`Invariant failed`)}function de(e){let t=new Map,n,r,i=e=>{e.next&&(e.prev?(e.prev.next=e.next,e.next.prev=e.prev,e.next=void 0,r&&(r.next=e,e.prev=r)):(e.next.prev=void 0,n=e.next,e.next=void 0,r&&(e.prev=r,r.next=e)),r=e)};return{get(e){let n=t.get(e);if(n)return i(n),n.value},set(a,o){if(t.size>=e&&n){let e=n;t.delete(e.key),e.next&&(n=e.next,e.next.prev=void 0),e===r&&(r=void 0)}let s=t.get(a);if(s)s.value=o,i(s);else{let e={key:a,value:o,prev:r};r&&(r.next=e),r=e,n||=e,t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var fe=4,pe=5;function me(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=a.indexOf(`{`),s;if(o!==-1&&o+1<a.length&&(s=a.indexOf(`}`,o))!==-1){let r=a.charCodeAt(o+1);if(r===45){if(o+2<a.length&&a.charCodeAt(o+2)===36){let e=o+3,r=s;if(e<r)return n[0]=3,n[1]=t+o,n[2]=t+e,n[3]=t+r,n[4]=t+s+1,n[5]=i,n}}else if(r===36){let r=o+1,a=o+2;return a===s?(n[0]=2,n[1]=t+o,n[2]=t+r,n[3]=t+a,n[4]=t+s+1,n[5]=e.length,n):(n[0]=1,n[1]=t+o,n[2]=t+a,n[3]=t+s,n[4]=t+s+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function he(e,t,n,r,i,a,o,s){s?.(n);let c=r;{let r=n.fullPath??n.from,s=n.options,l=r.length,u=s?.caseSensitive??e,d=s?.params?.parse??s?.parseParams;for(;c<l;){let e=me(r,c,t),n,s=c,l=e[5];c=l+1,a++;let f=e[0];switch(f){case 0:{let t=r.substring(e[2],e[3]),o=t,s;u?s=i.static??=new Map:(o=t.toLowerCase(),s=i.staticInsensitive??=new Map);let c=s.get(o);if(c)n=c;else{let e=_e(r);e.parent=i,e.depth=a,n=e,s.set(o,e)}break}case 1:case 3:case 2:{let t=r.substring(s,e[1]),c=r.substring(e[4],l),p=u&&!!(t||c);u||(t=t.toLowerCase(),c=c.toLowerCase());let m=f===1?i.dynamic:f===3?i.optional:i.wildcard,h=f!==2&&!d&&m?.find(e=>!e.parse&&e.caseSensitive===p&&e.prefix===t&&e.suffix===c);if(h)n=h;else{let e=ve(f,r,p,t,c);n=e,e.parent=i,e.depth=a;let s;s=f===1?i.dynamic??=[]:f===3?i.optional??=[]:i.wildcard??=[],s.push(e),s.length===2&&o?.push(s)}break}}i=n}if(d&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){let e=_e(r);e.kind=pe,e.parent=i,a++,e.depth=a,i.pathless??=[],i.pathless.push(e),i=e}let f=(n.path||!n.children)&&!n.isRoot;if(f&&r.endsWith(`/`)){let e=_e(r);e.kind=fe,e.parent=i,a++,e.depth=a,i.index=e,i=e}i.parse=d??null,i.priority=s?.params?.priority??0,f&&!i.route&&(i.route=n,i.fullPath=r)}if(n.children)for(let r of n.children)he(e,t,r,c,i,a,o,s)}function ge(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function _e(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function ve(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:i}}function ye(e,t){let n=_e(`/`),r=new Uint16Array(6),i=[];for(let t of e)he(!1,r,t,1,n,0,i);for(let e of i)e.sort(ge);t.masksTree=n,t.flatCache=de(1e3)}function be(e,t){e||=`/`;let n=t.flatCache.get(e);if(n!==void 0)return n;let r=Te(e,t.masksTree);return t.flatCache.set(e,r),r}function xe(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=_e(`/`),he(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),Te(r,o,n)}function Se(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=Te(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=De(a.route)),t.matchCache.set(r,a),a}function Ce(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function we(e,t=!1,n){let r=_e(e.fullPath),i=new Uint16Array(6),a=[],o={},s={},c=0;he(t,i,e,1,r,0,a,e=>{if(n?.(e,c),e.id in o&&ue(),o[e.id]=e,c!==0&&e.path){let t=Ce(e.fullPath);(!s[t]||e.fullPath.endsWith(`/`))&&(s[t]=e)}c++});for(let e of a)e.sort(ge);return{processedTree:{segmentTree:r,singleCache:de(1e3),matchCache:de(1e3),flatCache:null,masksTree:null},routesById:o,routesByPath:s}}function Te(e,t,n=!1){let r=e.split(`/`),i=ke(e,r,t,n);if(!i)return null;let[a]=Ee(e,r,i);return{route:i.node.route,rawParams:a}}function Ee(e,t,n){let r=Oe(n.node),i=null,a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;s<r.length;o++,s++,c++,l++){let u=r[s];if(u.kind===fe)break;if(u.kind===pe){l--,o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1){i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix.length;if(e.charCodeAt(t)===123){let n=u.suffix.length,r=e.substring(t+2,e.length-n-1),i=d.substring(t,d.length-n);a[r]=decodeURIComponent(i)}else{let t=e.substring(1);a[t]=decodeURIComponent(d)}}else if(u.kind===3){if(n.skipped&1<<s){o--,c=f-1;continue}i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix.length,r=u.suffix.length,p=e.substring(t+3,e.length-r-1),m=u.suffix||u.prefix?d.substring(t,d.length-r):d;m&&(a[p]=decodeURIComponent(m))}else if(u.kind===2){let t=u,n=e.substring(f+t.prefix.length,e.length-t.suffix.length),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,segment:l}]}function De(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function Oe(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function ke(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!M(t),a=i&&e!==`/`,o=t.length-+!!i,s=[{node:n,index:1,skipped:0,statics:0,dynamics:0,optionals:0}],c=null,l=null;for(;s.length;){let n=s.pop(),{node:i,index:u,skipped:d,statics:f,dynamics:p,optionals:m}=n,{extract:h,rawParams:g}=n;if(i.kind===2&&i.route&&!Ne(l,n))continue;if(i.parse){if(!Me(e,t,n))continue;g=n.rawParams,h=n.extract}r&&i.route&&i.kind!==fe&&Ne(c,n)&&(c=n);let _=u===o;if(_&&(i.route&&(!a||i.kind===fe||i.kind===2)&&Ne(l,n)&&(l=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let v=_?void 0:t[u],y;if(_&&i.index){let n={node:i.index,index:u,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g},r=!0;if(i.index.parse&&(Me(e,t,n)||(r=!1)),r){if(!p&&!m&&!d&&je(f,o))return n;Ne(l,n)&&(l=n)}}if(i.wildcard)for(let e=i.wildcard.length-1;e>=0;e--){let n=i.wildcard[e],{prefix:r,suffix:a}=n;if(!(r&&(_||!(n.caseSensitive?v:y??=v.toLowerCase()).startsWith(r)))){if(a){if(_)continue;let e=t.slice(u).join(`/`),i=e.slice(-a.length);if((n.caseSensitive?i:i.toLowerCase())!==a||e.length-a.length<r.length)continue}s.push({node:n,index:o,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(i.optional){let e=d|1<<i.depth+1;for(let t=i.optional.length-1;t>=0;t--){let n=i.optional[t];s.push({node:n,index:u,skipped:e,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_)for(let e=i.optional.length-1;e>=0;e--){let t=i.optional[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&e.indexOf(r,e.length-r.length)<n.length)continue}s.push({node:t,index:u+1,skipped:d,statics:f,dynamics:p,optionals:m+Ae(o,u),extract:h,rawParams:g})}}if(!_&&i.dynamic&&v)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&e.indexOf(r,e.length-r.length)<n.length)continue}s.push({node:t,index:u+1,skipped:d,statics:f,dynamics:p+Ae(o,u),optionals:m,extract:h,rawParams:g})}if(!_&&i.staticInsensitive){let e=i.staticInsensitive.get(y??=v.toLowerCase());e&&s.push({node:e,index:u+1,skipped:d,statics:f+Ae(o,u),dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_&&i.static){let e=i.static.get(v);e&&s.push({node:e,index:u+1,skipped:d,statics:f+Ae(o,u),dynamics:p,optionals:m,extract:h,rawParams:g})}if(i.pathless)for(let e=i.pathless.length-1;e>=0;e--){let t=i.pathless[e];s.push({node:t,index:u,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(l)return l;if(r&&c){let n=c.index;for(let e=0;e<c.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return c.rawParams??=Object.create(null),c.rawParams[`**`]=decodeURIComponent(r),c}return null}function Ae(e,t){return 2**(e-t-1)}function je(e,t){return e===2**(t-1)-1}function Me(e,t,n){let r,i;try{[r,i]=Ee(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function Ne(e,t){return!e||t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===fe)>(e.node.kind===fe)||t.node.kind===fe==(e.node.kind===fe)&&t.node.depth>e.node.depth)))}function Pe(e){return Fe(e.filter(e=>e!==void 0).join(`/`))}function Fe(e){return e.replace(/\/{2,}/g,`/`)}function Ie(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function Le(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function Re(e){return Le(Ie(e))}function ze(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function Be(e,t,n){return ze(e,n)===ze(t,n)}function Ve({base:e,to:t,trailingSlash:n=`never`,cache:r}){if(t.includes(`//`)&&(t=Fe(t)),t.startsWith(`/`))return t.length===1||n===`preserve`?t:n===`always`?t.endsWith(`/`)?t:`${t}/`:t.endsWith(`/`)?t.slice(0,-1):t;let i=t===`.`,a;if(r){a=i?e:e+`\0`+t;let n=r.get(a);if(n)return n}let o;if(i)o=e.split(`/`);else{for(e.includes(`//`)&&(e=Fe(e)),o=e.split(`/`);o.length>1&&M(o)===``;)o.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&o.push(r):o=[r]:r===`..`?o.length>1?o.pop():o=[``]:r===`.`||o.push(r)}}o.length>1&&(M(o)===``?n===`never`&&o.pop():n===`always`&&o.push(``));let s=o.join(`/`),c=(i?Fe(s):s)||`/`;return a&&r&&r.set(a,c),c}function He(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=Array.from(t.keys()).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),r=new RegExp(n,`g`);return e=>e.replace(r,e=>t.get(e)??e)}function Ue(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>Ge(e,n)).join(`/`):Ge(r,n):r}function We({path:e,params:t,decoder:n,...r}){let i=!1,a=Object.create(null);if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:a,isMissingParams:i};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:a,isMissingParams:i};let o=e.length,s=0,c,l=``;for(;s<o;){let r=s;c=me(e,r,c);let o=c[5];if(s=o+1,r===o)continue;let u=c[0];if(u===0){l+=`/`+e.substring(r,o);continue}if(u===2){let s=t._splat;a._splat=s,a[`*`]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o);if(!s){i=!0,(u||d)&&(l+=`/`+u+d);continue}let f=Ue(`_splat`,t,n);l+=`/`+u+f+d;continue}if(u===1){let s=e.substring(c[2],c[3]);!i&&!(s in t)&&(i=!0),a[s]=t[s];let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=Ue(s,t,n)??`undefined`;l+=`/`+u+f+d;continue}if(u===3){let i=e.substring(c[2],c[3]),s=t[i];if(s==null)continue;a[i]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=Ue(i,t,n)??``;l+=`/`+u+f+d;continue}}return e.endsWith(`/`)&&(l+=`/`),{usedParams:a,interpolatedPath:l||`/`,isMissingParams:i}}function Ge(e,t){let n=encodeURIComponent(e);return t?.(n)??n}function Ke(e){return e?.isNotFound===!0}function qe(){try{return sessionStorage}catch{return}}var Je=`tsr-scroll-restoration-v1_3`,Ye=qe();function Xe(){try{return JSON.parse(Ye?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}function Ze(){try{Ye?.setItem(Je,JSON.stringify(Qe))}catch{}}var Qe=Xe(),$e=`data-scroll-restoration-id`,et=e=>e.state.__TSR_key||e.href;function tt(e){let t=e.getAttribute($e);if(t)return`[${$e}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}var nt=!1,rt=`window`;function it(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function at(e){let t=new Set;for(let n of e){if(n===rt)continue;let e=it(n);e&&t.add(e)}return t}function ot(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);let i=e.options.getScrollRestorationKey||et,a=new Set,o=e=>{let t=Qe[e]||={};for(let e of a)e===document?t[rt]={scrollX,scrollY}:e.isConnected&&(t[tt(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.restoration&&(r.restoration=!0,nt=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{nt||a.add(e.target)},!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&o(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{o(i(e.stores.resolvedLocation.get()??e.stores.location.get())),Ze()})),!r.reset&&(r.reset=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.next,c=r.hash,l;if(a.clear(),r.next=!0,r.hash=!1,typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let u=i(t.toLocation),d=t.fromLocation&&i(t.fromLocation);if(r.restoring&&d&&d!==u){let e=Qe[d];if(e){let t=Qe[u];for(let n in e){if(n===rt){if(s)continue}else{let e=it(n);if(!e||s&&o&&(l??=at(o),l.has(e)))continue}t||=Qe[u]={},t[n]??=e[n]}}}nt=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){!e&&o&&(l??=at(o));let t=e&&i&&c,s=r.restoring?Qe[u]:void 0;if(s)for(let e in s){let{scrollX:r,scrollY:i}=s[e];if(e===rt){if(t)continue;scrollTo({top:i,left:r,behavior:n}),a=!0}else{let t=it(e);t&&(t.scrollLeft=r,t.scrollTop=i,l?.delete(t))}}if(!e){let e={top:0,left:0,behavior:n};if(a||scrollTo(e),l)for(let t of l)t.scrollTo(e)}}!a&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{nt=!1}}))}function st(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function ct(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function lt(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=ct(r):Array.isArray(t)?t.push(ct(r)):n[e]=[t,ct(r)]}return n}var ut=/^(?:\s|["[{\d-]|fa|nu|tr)/,dt=pt(JSON.parse),ft=mt(JSON.stringify,JSON.parse);function pt(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=lt(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function mt(e,t){let n=t===JSON.parse;function r(r){if(r&&typeof r==`object`)try{return e(r)}catch{}else if(t&&typeof r==`string`){if(n&&!ut.test(r))return r;try{return t(r),e(r)}catch{}}return r}return e=>{let t=st(e,r);return t?`?${t}`:``}}var ht=`__root__`;function gt(e){if(e.statusCode=e.statusCode||e.code||307,!e.reloadDocument&&typeof e.href==`string`)try{new URL(e.href),e.reloadDocument=!0}catch{}let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function _t(e){return e instanceof Response&&!!e.options}function vt(e){return{input:({url:t})=>{for(let n of e)t=bt(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=xt(e[n],t);return t}}}function yt(e){let t=Re(e.basepath),n=`/${t}`,r=e.caseSensitive?n:n.toLowerCase(),i=`${r}/`;return{input:({url:t})=>{let a=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return a===r?t.pathname=`/`:a.startsWith(i)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=Pe([`/`,t,e.pathname]),e)}}function bt(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function xt(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function St(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i}=t,a=new Map,o=n(`idle`),s=n(e),c=n(void 0),l=n([]),u=r(()=>l.get().map(e=>a.get(e).get())),d=r(()=>({status:o.get(),isLoading:o.get()===`pending`,matches:u.get(),location:s.get(),resolvedLocation:c.get()}));function f(e){let t=a.get(e);return t||(t=n(void 0),a.set(e,t)),t}let p={status:o,location:s,resolvedLocation:c,ids:l,matches:u,byRoute:a,__store:d,getMatchStore:f,setMatches:m};function m(e){let t=l.get(),n=e.map(e=>e.routeId);i(()=>{le(t,n)||l.set(n);for(let e of t)n.includes(e)||a.get(e).set(()=>void 0);for(let t of e){let e=f(t.routeId);e.get()!==t&&e.set(t)}})}return p}var Ct=`__TSR_index`,wt=`popstate`,Tt=`beforeunload`;function Et(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=jt(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[Ct];i=Dt(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[Ct];i=Dt(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[Ct]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function Dt(e,t){t||={};let n=Mt();return{...t,key:n,__TSR_key:n,[Ct]:e}}function Ot(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=e?.createHref??(e=>e),c=e?.parseLocation??(()=>jt(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=Mt();t.history.replaceState({[Ct]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_=()=>{g&&(S._ignoreSubscribers=!0,(g[2]?t.history.pushState:t.history.replaceState)(g[1],``,g[0]),S._ignoreSubscribers=!1,g=void 0,u=void 0)},v=(e,t,n)=>{let r=s(t),i=!!g;i||(u=l),l=jt(t,n),g=[r,n,g?.[2]||e],i||queueMicrotask(()=>_())},y=e=>{l=c(),S.notify({type:e})},b=async()=>{if(f){f=!1;return}let e=c(),n=e.state[Ct]-l.state[Ct],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let n=a();if(typeof document<`u`&&n.length){for(let r of n)if(await r.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(1),S.notify(u);return}}}l=c(),S.notify(u)},x=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},S=Et({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>v(!0,e,t),replaceState:(e,t)=>v(!1,e,t),back:e=>(e&&(p=!0),m=!0,t.history.back()),forward:e=>{e&&(p=!0),m=!0,t.history.forward()},go:e=>{d=!0,t.history.go(e)},createHref:e=>s(e),flush:_,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(Tt,x,{capture:!0}),t.removeEventListener(wt,b)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(Tt,x,{capture:!0}),t.addEventListener(wt,b),t.history.pushState=function(...e){let r=n.apply(t.history,e);return S._ignoreSubscribers||y(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return S._ignoreSubscribers||y(`REPLACE`),n},S}function kt(e){let t=e?.window??(typeof document<`u`?window:void 0);return Ot({window:t,parseLocation:()=>{let e=t.location.hash.split(`#`).slice(1),n=e[0]??`/`,r=t.location.search,i=e.slice(1);return jt(`${n}${r}${i.length===0?``:`#${i.join(`#`)}`}`,t.history.state)},createHref:e=>`${t.location.pathname}${t.location.search}#${e}`})}function At(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function jt(e,t){let n=At(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=Mt();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[Ct]:0,key:a,__TSR_key:a}}}function Mt(){return(Math.random()+1).toString(36).substring(7)}function Nt(e){return e.options.loader||e.options.beforeLoad||e.lazyFn||e.options.component?.preload||e.options.pendingComponent?.preload}function Pt(e,t){return{fromLocation:t,toLocation:e,pathChanged:t?.pathname!==e.pathname,hrefChanged:t?.href!==e.href,hashChanged:t?.hash!==e.hash}}function Ft({key:e,__TSR_key:t,__TSR_index:n,__hashScrollIntoViewOptions:r,...i}){return i}function It(e,t,n,r){for(let i of t){if(r&&e._tx!==r)return;n.some(e=>e.routeId===i.routeId)||e.routesById[i.routeId].options.onLeave?.(i)}for(let i of n){if(r&&e._tx!==r)return;e.routesById[i.routeId].options[t.some(e=>e.routeId===i.routeId)?`onStay`:`onEnter`]?.(i)}}var Lt=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=async e=>(e(),!1),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??!1??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=He(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history?this.options.history:Ot()),this.origin=this.options.origin,this.origin||=window?.origin&&window.origin!==`null`?window.origin:`http://localhost`,this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;this.resolvePathCache=de(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=St(this.latestLocation,e),ot(this)}let a=this.options.basepath??`/`,o=this.options.rewrite;if(r||n!==a||i!==o){this.basepath=a;let e=[],t=Re(a);t&&t!==`/`&&e.push(yt({basepath:a})),o&&e.push(o),this.rewrite=e.length===0?void 0:e.length===1?e[0]:vt(e),this.history&&this.updateLatestLocation(),this.stores&&this.stores.location.set(this.latestLocation)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=we(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&ye(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{for(let t of this.subscribers)if(t.eventType===e.type)try{t.fn(e)}catch(e){console.error(e)}},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i,state:a})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:se(e).path,external:!1,searchStr:o,search:ee(t?.search,i),hash:se(r.slice(1)).path,state:R(t?.state,a)}}let o=new URL(i,this.origin),s=bt(this.rewrite,o),c=this.options.parseSearch(s.search),l=this.options.stringifySearch(c);return s.search=l,{href:s.href.replace(s.origin,``),publicHref:i,pathname:se(s.pathname).path,external:!!this.rewrite&&s.origin!==this.origin,searchStr:l,search:ee(t?.search,c),hash:se(s.hash.slice(1)).path,state:R(t?.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathWithBase=(e,t)=>Ve({base:e,to:t,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>{let t=Object.create(null),n=Se(Le(e),this.processedTree,!0);return n&&Object.assign(t,n.rawParams),[n?.branch||[this.routesById.__root__],t,n?.route]},this.buildLocation=e=>{let t=(t={})=>{if(t.href){let e=jt(t.href,{});t={...t,to:bt(this.rewrite,new URL(e.pathname,this.origin)).pathname,search:this.options.parseSearch(e.search),hash:e.hash.slice(1)}}let n=t._fromLocation||this._pendingLocation||this.latestLocation,r=this.matchRoutesLightweight(n);t.from;let i=t.unsafeRelative===`path`?n.pathname:t.from??r[1],a=r[2],o=r[3],s=this.resolvePathWithBase(i,t.to?`${t.to}`:`.`),c=Ut(t.params,o),l=this.routesByPath[Le(s)],u;if(l)u=this.getRouteBranch(l);else if(s.includes(`$`))u=[];else{let[e,t,n]=this.getMatchedRoutes(s);u=e,this.options.notFoundRoute&&(!n||n.path!==`/`&&t[`**`])&&(u=[...u,this.options.notFoundRoute])}if(u.length&&I(c))for(let e of u){let t=e.options.params?.stringify??e.options.stringifyParams;if(t){c===o&&(c=Object.assign(Object.create(null),c));try{Object.assign(c,t(c))}catch{}}}let d=e.leaveParams?s:se(We({path:s,params:c,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,f=a;if(e._includeValidateSearch&&this.options.search?.strict){let e={};u.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,Bt(t.options.validateSearch,{...e,...f}))}catch{}}),f=e}f=Vt(f,t,u,e._includeValidateSearch),f=ee(a,f);let p=this.options.stringifySearch(f),m=t.hash===!0?n.hash:t.hash?N(t.hash,n.hash):void 0,h=m?`#${m}`:``,g=t.state===!0?n.state:t.state?N(t.state,n.state):{};t.state&&(g=R(n.state,g));let _=`${d}${p}${h}`,v,y,b=!1;if(this.rewrite){let e=new URL(_,this.origin),t=xt(this.rewrite,e);v=e.href.replace(e.origin,``),t.origin===this.origin?y=t.pathname+t.search+t.hash:(y=t.href,b=!0)}else v=ce(_),y=v;return{publicHref:y,href:v,pathname:d,search:f,searchStr:p,state:g,hash:m??``,external:b,unmaskOnReload:t.unmaskOnReload}},n=t(e);if(e.mask)n.maskedLocation=t({from:e.from,...e.mask});else if(this.options.routeMasks){let r=be(n.pathname,this.processedTree);if(r){let i=Object.assign(Object.create(null),r.rawParams),{from:a,params:o,...s}=r.route,c=Ut(o,i);n.maskedLocation=t({from:e.from,...s,params:c})}}return n},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r,i=Le(this.latestLocation.href)===Le(n.href)&&ne(Ft(n.state),Ft(this.latestLocation.state)),a=this._commitPromise,o,s=new Promise(e=>{o=e});if(s.resolve=()=>{o(),a?.resolve()},this._commitPromise=s,i)this.load();else{let{maskedLocation:i,hashScrollIntoView:a,...o}=n;i&&(o={...i,state:{...i.state,__tempKey:void 0,__tempLocation:{...o,search:o.searchStr,state:{...o.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(o.unmaskOnReload??this.options.unmaskOnReload??!1)&&(o.state.__tempKey=this.tempLocationKey)),o.state.__hashScrollIntoViewOptions=a??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,r=n.replace?`REPLACE`:`PUSH`,this.history[r===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t}),this.history.subscribers.size||this.load({action:{type:r}})}return this._scroll.next=n.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,...a}={})=>{let o=this.buildLocation({...a,_includeValidateSearch:!0});this._pendingLocation=o;let s=this.commitLocation({...o,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return queueMicrotask(()=>{this._pendingLocation===o&&(this._pendingLocation=void 0)}),s},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=!1;if(n)try{new URL(`${n}`),a=!0}catch{}if(a&&!t&&(t=!0),t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i});n??=t.publicHref,r??=t.publicHref}let t=!a&&r?r:n;if(oe(t,this.protocolAllowlist))return;if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return}i.replace?window.location.replace(t):window.location.href=t;return}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.load=async e=>{this.updateLatestLocation(),e?.action&&(this._scroll.hash=e.action.type===`PUSH`||e.action.type===`REPLACE`),await Fn(this,e)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&window.CSS?.supports?.(`selector(:active-view-transition-type(a))`)){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(Pt(r,i)):t.types;if(a===!1)return e();n={update:e,types:a}}else n=e;return document.startViewTransition(n).updateCallbackDone}return e()},this.invalidate=e=>{let t=this._committed,n=e?.filter,r=this._preloads,i=new Set([...t,...this._cache.values(),...[...r?.values()??[]].flat(),...this._tx?.[3]??[]].filter(e=>!n||n(e)).map(e=>e.id)),a=[];for(let[e,t]of r??[])t.some(e=>i.has(e.id))&&(r.delete(e),a.push(e));let o=t=>{if(i.has(t.id)){let n=this.routesById[t.routeId],r={...t,invalid:!0,...(e?.forcePending||t.status===`error`||t.status===`notFound`)&&Nt(n)?{status:`pending`,error:void 0}:void 0};return t._flight=void 0,r}return t};this._committed=t.map(o);for(let[t,n]of this._cache)i.has(t)&&(n.invalid=!0,e?.forcePending&&(n.status=`pending`));for(let e of i)this._flights?.delete(e);for(let e of a)e.abort();return this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href){let t=this.buildLocation(e.options).publicHref||`/`;e.options.href=t,e.headers.set(`Location`,t)}else if(t)try{let n=new URL(t);if(this.origin&&n.origin===this.origin){let t=n.pathname+n.search+n.hash;e.options.href=t,e.headers.set(`Location`,t)}}catch{}if(e.options.href&&oe(e.options.href,this.protocolAllowlist))throw Error(`Redirect blocked: unsafe protocol`);return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=this._cache,n=this._preloads,r=e?.filter,i=[],a=[];for(let[e,n]of t)(!r||r(n))&&(a.push(e),i.push(n));let o=[];for(let[e,t]of n??[])(!r||t.some(r))&&(o.push(e),i.push(...t));for(let e of a)t.delete(e);for(let e of o)n.delete(e);for(let e of i){let t=e._flight;e._flight=void 0,t&&!--t[2]&&(this._flights?.get(e.id)===t&&this._flights.delete(e.id),o.push(t[1]))}for(let e of o)e.abort()},this.loadRouteChunk=qt,this.preloadRoute=e=>In(this,e),this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n),i=this.stores.status.get()===`pending`;if(t?.pending&&!i)return!1;let a=t?.pending??!i?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),o=xe(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,a.pathname,this.processedTree);return!o||e.params&&!ne(o.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?ne(a.search,r.search,{partial:!0})?o.rawParams:!1:o.rawParams},this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??ft,parseSearch:e.parseSearch??dt,protocolAllowlist:e.protocolAllowlist??ae}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=De(e),this.routeBranchCache.set(e,t)),t}matchRoutesInternal(e,t){let[n,r,i]=this.getMatchedRoutes(e.pathname),a=n,o=!1;(i?i.path!==`/`&&r[`**`]:Le(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=o?Ht(this.options.notFoundMode,a):void 0,c=Array(a.length),l=this._committed,u=(e,t)=>{let n=l[t];return n?.routeId===e.id?n:e===this.options.notFoundRoute?l.find(t=>t.routeId===e.id):void 0},d;for(let n=0;n<a.length;n++){let i=a[n],o=c[n-1],l,f,p;{let n=o?.search??e.search,r=o?._strictSearch??void 0;try{let e=Bt(i.options.validateSearch,{...n})??void 0;l={...n,...e},f={...r,...e}}catch(e){let r=e;if(e instanceof Rt||(r=new Rt(e.message,{cause:e})),t?.throwOnError)throw r;l=n,f={},p=r}}let m=``,h=``;try{m=i.options.loaderDeps?.({search:l})??``,h=m&&JSON.stringify(m)||``}catch(e){if(t?.throwOnError)throw e;p??=e}let{interpolatedPath:g,usedParams:_}=We({path:i.fullPath,params:r,decoder:this.pathParamsDecoder,server:this.isServer}),v=i.id+g+h,y=u(i,n),b=this._cache.get(v)??(y?.id===v?y:void 0);d=b?._strictParams??Object.assign(_,d);let x;if(!b)try{Wt(i,d)}catch(e){if(x=Ke(e)||_t(e)?e:new zt(e.message,{cause:e}),t?.throwOnError)throw x}let S=y?`stay`:`enter`,C;if(b)C={...b,cause:S,search:ee(y?y.search:b.search,l),_strictSearch:f,searchError:p};else{let e=Nt(i)?`pending`:`success`;C={id:v,ssr:i.options.ssr,index:n,routeId:i.id,params:y?.params??d,_strictParams:d,pathname:g,updatedAt:Date.now(),search:y?ee(y.search,l):l,_strictSearch:f,searchError:p,status:e,isFetching:!1,error:void 0,paramsError:x,context:{},abortController:t?._controller??new AbortController,cause:S,loaderDeps:y?R(y.loaderDeps,m):m,invalid:!1,preload:!1,staticData:i.options.staticData||{},fullPath:i.fullPath}}let w=s===i.id;C._notFound&&!w&&(C.error=void 0),C._notFound=w,c[n]=C}for(let e=0;e<c.length;e++){let n=c[e];n.params=n.cause===`stay`?ee(n.params,d):d,t?._controller&&(n.context={})}return c}matchRoutesLightweight(e){let t=M(this.stores.ids.get()),n=t?this.stores.byRoute.get(t).get():void 0,r=n?.id,i=this.lightweightCache.get(e);if(i&&i[0]===r)return i[1];let[a,o]=this.getMatchedRoutes(e.pathname),s=M(a),c={...e.search};for(let e of a)try{Object.assign(c,Bt(e.options.validateSearch,c))}catch{}let l=n&&n.routeId===s.id&&n.pathname===e.pathname,u;if(l)u=n.params;else{let e=Object.assign(Object.create(null),o);for(let t of a)try{Wt(t,e)}catch{}u=e}let d=[a,s.fullPath,c,u];return this.lightweightCache.set(e,[r,d]),d}},Rt=class extends Error{},zt=class extends Error{};function Bt(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new Rt(`Async validation not supported`);if(n.issues)throw new Rt(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function Vt(e,t,n,r){let i=[];for(let e of n){let t=e.options;`search`in t?t.search?.middlewares&&i.push(...t.search.middlewares):(t.preSearchFilters||t.postSearchFilters)&&i.push(({search:e,next:n})=>{let r=n(t.preSearchFilters?t.preSearchFilters.reduce((e,t)=>t(e),e):e);return t.postSearchFilters?t.postSearchFilters.reduce((e,t)=>t(e),r):r});let n=t.validateSearch;r&&n&&i.push(({search:e,next:t,meta:r})=>{let i=t(e);try{let e=Bt(n,i);if(r&&e)for(let t in e)t in i||(r.defaulted||=new Map).set(t,e[t]);return{...i,...e}}catch{}return i})}let a=(e,n,r)=>{if(e>=i.length){if(!t.search)return{};if(t.search===!0)return n;let e=N(t.search,n);return r&&(r.explicit=e),e}return i[e]({search:n,next:(t,n)=>{if(n){let n=r||{};return{search:a(e+1,t,n),meta:n}}return a(e+1,t,r)},meta:r})};return a(0,e)}function Ht(e,t){if(e!==`root`){let e;for(let n=t.length-1;n>=0;n--){let r=t[n];if(r.options.notFoundComponent)return r.id;e||=r.children&&r.id}if(e)return e}return ht}function Ut(e,t){if(e===!1||e===null)return Object.create(null);if((e??!0)===!0)return t;let n=Object.assign(Object.create(null),t);return Object.assign(n,N(e,n))}function Wt(e,t){let n=e.options.params?.parse??e.options.parseParams;n&&Object.assign(t,n(t))}function Gt(e,t){return e.options[t]?.preload?.()}function Kt(e,t){let n=Gt(e,`component`),r=Gt(e,`pendingComponent`);return t&&(r?r=r.then(t):t()),n&&r?Promise.all([n,r]).then(()=>{}):n??r}function qt(e,t,n){let r=()=>t===!1?void 0:t?Gt(e,t):Kt(e,n),i=e._lazy;if(i)return i===!0?r():i.then(r);if(!e.lazyFn)return r();let a=e.lazyFn().then(t=>{{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazy=!0}},t=>{throw e._lazy=void 0,t});return e._lazy=a,a.then(r)}function Jt(e){let t=e.findIndex(e=>e.status!==`success`||e._notFound)+1;return t&&t<e.length?e.slice(0,t):e}var Yt=0,Xt=1,Zt=2,Qt=3,$t=[4];function en(e){return typeof e[0]==`number`}function tn(e,t){return t.aborted?Promise.race([Promise.reject(t),e]):new Promise((n,r)=>{let i=()=>r(t);t.addEventListener(`abort`,i,{once:!0}),Promise.resolve(e).then(n,r).finally(()=>t.removeEventListener(`abort`,i))})}function nn(e,t){return e.routesById[t.routeId]}function rn(e,t,n){return _t(e)?[Qt,e]:Ke(e)?(e.routeId||=n,[Zt,e]):t?(typeof e?.then==`function`&&(e=Error(`A Promise was thrown`,{cause:e})),[Xt,e]):[Yt,e]}function an(e,t){let n=rn(t,!0,e.id);if(n[0]!==Xt)return n;try{e.options.onError?.(n[1])}catch(t){n=rn(t,!0,e.id)}return n}function on(e,t,n,r,i){return i[0].signal.aborted?$t:Sn(e,t,n,an(n,r),i)}async function sn(e,t,n,r,i,a){let[o,s]=t,c=n[0].signal,l=!!n[3];for(let i=n[6]??0;i<r;i++){let r=s[i],u=nn(e,r);r.abortController=n[0];let d=s[i-1]?.context??e.options.context??{},f={params:r.params,location:o,navigate:t=>e.navigate({...t,_fromLocation:o}),buildLocation:e.buildLocation,cause:l?`preload`:r.cause,abortController:n[0],preload:l,matches:s,routeId:u.id};try{let e=r._ctx||=u.options.context?u.options.context({...f,deps:r.loaderDeps,context:d})||{}:void 0;r.context={...d,...e}}catch(a){return ln(e,r),[i,on(e,t,u,a,n)]}if(c.aborted)return[i,$t];let p=r.paramsError??r.searchError;if(p!==void 0)return ln(e,r),[i,on(e,t,u,p,n)];let m=u.options.beforeLoad;if(!m)continue;let h=r.status;i>=a&&(r.status=`pending`,n[7]?.());try{fn(e,r,`beforeLoad`,n[0]);let a=await tn(m({...f,search:r.search,context:r.context,...e.options.additionalContext}),c);if(c.aborted)return[i,$t];let o=Sn(e,t,u,rn(a,!1,u.id),n);if(o[0]!==Yt)return ln(e,r),[i,o];r.context={...r.context,...a}}catch(a){return ln(e,r),[i,on(e,t,u,a,n)]}finally{r.status=h,fn(e,r,!1,n[0])}}i()}function cn(e,t,n){if(!(!n||--n[2])){if(e._flights?.get(t.id)===n){let n=e._tx;if(n&&!n[0].signal.aborted&&!n[3].includes(t)&&n[3].some(e=>e.id===t.id)&&n[3].some(e=>e.isFetching===`beforeLoad`))return;e._flights.delete(t.id)}return n[1]}}function ln(e,t){let n=t._flight;t._flight=void 0,cn(e,t,n)?.abort()}function un(e,t,n,r){let i=[];for(let a of t)if(!n?.includes(a)){let t=a._flight;if(a._flight=void 0,r&&t?.[2]===1&&e._flights?.get(a.id)===t&&n?.some(e=>e.id===a.id))t[2]=0;else{let n=cn(e,a,t);n&&i.push(n)}}for(let e of i)e.abort()}function dn(e){for(let t of e){let e=t._flight;e&&e[2]++}}function fn(e,t,n,r){if(t.isFetching=n,r&&e._tx?.[0]!==r)return;let i=e.stores.byRoute.get(t.routeId),a=i?.get();a?.id===t.id&&i.set({...a,isFetching:n})}function pn(e,t,n,r,i,a,o){let s=t[0];return{params:n.params,location:s,navigate:t=>e.navigate({...t,_fromLocation:s}),cause:o?`preload`:n.cause,abortController:i,preload:o,deps:n.loaderDeps,parentMatchPromise:a,context:n.context,route:r,...e.options.additionalContext}}async function mn(e,t,n,r,i,a,o){let s=o[0],c=s.signal;if(c.aborted)return $t;if(!i)return[Yt,void 0];let l=n._flight;fn(e,n,`loader`,s);try{if(!l){let s=new AbortController;l=[Promise.resolve().then(()=>i(pn(e,t,n,r,s,a,!!o[3]))).then(e=>rn(e,!1,r.id),e=>rn(e,!0,r.id)).then(t=>(t[0]!==Yt&&e._flights?.get(n.id)===l&&(e._flights.delete(n.id),l[2]||s.abort()),t[0]===Xt&&l[2]?an(r,t[1]):t)),s,1],(e._flights??=new Map).set(n.id,l)}return n._flight=l,n.abortController=l[1],Sn(e,t,r,await tn(l[0],c),o)}catch(t){if(t!==c||!c.aborted)throw t;return ln(e,n),$t}finally{fn(e,n,!1,s)}}function hn(e,t,n){t[0]!==Qt&&(e.status=`success`,e.error=void 0,t[0]===Yt?(e.loaderData=t[1],e.invalid=!1,e.updatedAt=Date.now(),e.preload=n):e.invalid=!0)}function gn(e,t,n){let r=e._cache.get(t.id);if(r!==n||e._committed.some(e=>e.id===t.id&&e._flight===t._flight))return;let i={...t,_notFound:void 0,context:{}};i._flight&&i._flight[2]++,e._cache.set(t.id,i),r&&ln(e,r)}function _n(e,t){return t[0]===Xt||t[0]===Zt?{...e,status:t[0]===Xt?`error`:`notFound`,error:t[1],_flight:void 0}:e}function vn(e,t,n,r,i,a,o){let s=t[1][n],c=nn(e,s),l=!!a[3],u=e._cache.get(s.id),d,f=!1,p;try{if(s.status===`success`&&(d=c.options.shouldReload,typeof d==`function`&&(d=d(pn(e,t,s,c,a[0],i,l))),a[0].signal.aborted&&(p=$t)),!p){if(s.status!==`success`)f=!0;else{let t=l||s.preload?c.options.preloadStaleTime??e.options.defaultPreloadStaleTime??3e4:c.options.staleTime??e.options.defaultStaleTime??0;f=!!(s.invalid||d||d===void 0&&Date.now()-s.updatedAt>=t&&(a[5]||s.cause===`enter`||a[2].some(e=>e.routeId===s.routeId&&e.id!==s.id)))}}}catch(n){s.invalid=!0,ln(e,s),p=on(e,t,c,n,a)}let m=c.options.loader,h=typeof m==`function`,g=h?m:m?.handler,_=!l||c.options.preload!==!1,v=_&&m?e._flights?.get(s.id):void 0;v===s._flight||p?v=void 0:v&&!f&&!l&&d===void 0?f=!0:f||(v=void 0);let y=!!(m&&f&&s.status===`success`&&!l&&!a[4]&&((h?void 0:m.staleReloadMode)??e.options.defaultStaleReloadMode)!==`blocking`),b=f&&_,x=b&&!y&&(s.status!==`success`||!!m),S=n>=o?a[7]:void 0,C=c.lazyFn&&c._lazy!==!0?S:void 0;if(b&&!m&&(s.invalid=!1,s.updatedAt=Date.now()),v&&v[2]++,x){let t=s._flight;s._flight=v,cn(e,s,t)?.abort(),n>=o&&(s.status=`pending`),S?.()}b||(s.isFetching=!1);let w=(p?Promise.resolve(p):x?mn(e,t,s,c,g,i,a):Promise.resolve([Yt,s.loaderData])).then(t=>(x&&(hn(s,t,l),t[0]===Yt&&(m&&!a[0].signal.aborted&&gn(e,s,u),n>=o&&(s.status=`pending`))),t)),T=tn(Promise.resolve().then(()=>qt(c,void 0,C)),a[0].signal).then(()=>void 0,r=>t[1].some((e,t)=>t<=n&&(e.status===`error`||e.status===`notFound`||e._notFound))?void 0:[n,on(e,t,c,r,a)]).then(e=>w.then(t=>(x&&!e&&t[0]===Yt&&s.status===`pending`&&!a[0].signal.aborted&&(s.status=`success`,S?.()),e)));if(r.push([n,w,T]),!y)return w.then(e=>_n(s,e));let E={...s,status:`pending`,preload:!1,_flight:v};s.invalid=!1,s.isFetching=`loader`;let D=mn(e,t,E,c,g,i,a).then(e=>(s.isFetching=!1,hn(E,e,!1),e));return(t[2]??=[]).push([n,D,T,E]),D.then(e=>_n(E,e))}async function yn(e,t,n,r,i=0){let a=n?.[1][1],o=a?.routeId?t.findIndex(e=>e.routeId===a.routeId):n?.[0]??t.length-1;o<0&&(o=0);for(let n=o;n>=0;n--){let i=nn(e,t[n]);try{let e=qt(i,!1);e&&await tn(e,r)}catch(e){if(e===r&&r.aborted)throw e}if(i.options.notFoundComponent)return n}return a?.routeId?o:i}function bn(e,t){t[2]&&=(un(e,t[2].map(e=>e[3])),void 0)}async function xn(e,t,n,r){let i;try{await Promise.all(e.map(e=>e[1].then(async t=>{let a=e[0];if(!(r&&a>=await r)){if(t[0]>=Qt)throw[a,t];!i&&t[0]!==Yt&&(i=[a,t],await Promise.all((n??[]).map(e=>{if(!(e[0]<=a))return e[1].then(t=>{if(t[0]===Qt)throw[e[0],t]})})))}})))}catch(e){return e}return t??i}function Sn(e,t,n,r,i,a){for(;r[0]===Qt;){let o=r[1],s=o.options;if(s.reloadDocument?i[3]:i[1]>=20)return r;try{return s.href&&s.reloadDocument?(e.resolveRedirect(o),r):[Qt,o,e.buildLocation({...s,_fromLocation:t[0],_includeValidateSearch:!0})]}catch(e){r=a?[Xt,e]:an(n,e),a=!0}}return r}async function Cn(e,t,n,r,i,a){let o=t[1],s=await i,c=!1,l=o.findIndex(e=>e._notFound),u=t=>t[1][0]===Zt?yn(e,o,t,r.signal):t[0],d=l<0?o.length:l;if((s?.[1][0]??0)>=Qt)d=0;else if(s){d=s[2]??=await u(s);for(let e of n){if(e[0]>=d)break;let t=await e[1];if(t[0]!==Yt&&t[0]<Qt&&!(`loaderData`in o[e[0]])){s=[e[0],t],d=s[2]=await u(s);break}}}for(let e of n){if(e[0]>=d)break;let t=await e[2];if(t){s=t;break}}if((s?.[1][0]??0)>=Qt){let n=s[1];if(n[0]!==Qt||n[1].options.reloadDocument||n[2])return bn(e,t),n;c=!0,s=[0,[Xt,Error(`Too many redirects`)]]}let f=s?s[2]??await u(s):l;if(f>=0){let i=s?.[1],l=i?.[0],u=o[f],d=i?.[1],p=()=>{i&&(u._notFound=void 0,l===Xt?u.status=`error`:(d.routeId=u.routeId,u.routeId===e.routeTree.id?(u.status=`success`,u._notFound=!0):u.status=`notFound`),u.error=d,u.isFetching=!1)};p(),i||a?.();let m=nn(e,u);try{await tn(i?Promise.resolve().then(()=>qt(m,l===Xt?`errorComponent`:`notFoundComponent`)):Promise.all([qt(m),qt(m,`notFoundComponent`)]),r.signal)}catch(n){if(n===r.signal&&r.signal.aborted)return bn(e,t),$t}i?c&&(r.abort(),await Promise.all([...n.map(e=>e[1]),...n.map(e=>e[2]),...(t[2]??[]).map(e=>e[1])]),bn(e,t),un(e,o),p()):u.status=`success`}return t}async function wn(e,t,n,r=0,i=t[1].length){let a=t[1];for(let t=r;t<i;t++){let r=a[t],i=nn(e,r).options;if(i.head||i.scripts)try{let t={ssr:e.options.ssr,matches:a,match:r,params:r.params,loaderData:r.loaderData},[o,s]=await tn(Promise.all([i.head?.(t),i.scripts?.(t)]),n);r.meta=o?.meta,r.links=o?.links,r.headScripts=o?.scripts,r.styles=o?.styles,r.scripts=s}catch(e){if(e===n&&n.aborted)break;console.error(e)}if(r.status!==`success`||r._notFound)break}return t}async function Tn(e,t,n,r){let i=[t,n],a=r[0].signal,o;try{let t=e.stores.matches.get(),s=n.findIndex(e=>e._notFound);if(e.options.notFoundMode!==`root`&&s>=0){let t=await yn(e,n,void 0,a,s);n[s]._notFound=void 0,n[t]._notFound=!0,s=t}let c=s<0?n.length:s+1,l=0;for(;l<c&&l!==s;){let e=n[l],i=r[2][l],a=t[l];if(i?.id!==e.id||i.status!==`success`||i._notFound||e.preload||a?.id!==e.id||a.status!==`success`||a._notFound)break;l++}let u=[],d=r[6]??0,f=d?Promise.resolve(n[d-1]):void 0,p=()=>{for(let t=d;t<c&&!a.aborted;t++)f=vn(e,i,t,u,f,r,l)},m=await sn(e,i,r,c,p,l);if(m){if(r[4]=!0,c=m[0],m[1][0]===Zt){let t=await yn(e,n,m,a);m[2]=t,c=Math.min(c,t+1)}else m[1][0]>=Qt&&(c=0);p()}if(!a.aborted&&!r[3]){let t=[];for(let[n,r]of e._flights??[])r[2]||(e._flights.delete(n),t.push(r[1]));for(let e of t)e.abort()}let h=Cn(e,i,u,r[0],xn(u,m,i[2]),r[7]);i[2]?.length&&(i[3]=xn(i[2],void 0,void 0,h.then(e=>en(e)?0:Jt(n).length,()=>0))),o=await h}catch(t){if(bn(e,i),t===a&&a.aborted)return $t;throw t}return en(o)?o:wn(e,o,a,r[6]===n.length?r[6]:0)}function En(e,t){if(e._tx!==t)return;let n=t[3],r=e.stores.matches.get(),i=e._pending;for(let a=0;a<n.length;a++){let o=n[a],s=o.status===`success`&&!o._notFound,c=r[a]?.id===o.id&&r[a]?.status===`pending`;if(s&&!c)continue;let l=nn(e,o),u=s||o.invalid?0:l.options.pendingMs??e.options.defaultPendingMs,d=l.options.pendingComponent??e.options.defaultPendingComponent;if(!d||typeof u!=`number`||u===1/0){i&&(i[0]=t,i[2]=0,i[4]=!0);return}let f=l.options.pendingMinMs??e.options.defaultPendingMinMs??0,p=!1;if(i?.[1]===o.id?(p=i[0]!==t,i[0]=t):(clearTimeout(i?.[3]),e._pending=i=void 0),i||(e._pending=i=[t,o.id,c?Date.now()+f:t[4]+u,void 0,c||void 0,d]),i[4]&&!p&&i[5]===d)return;if(i[5]=d,!i[4]){clearTimeout(i[3]);let n=i[2]-Date.now();if(n>0){i[3]=setTimeout(()=>En(e,t),n);return}i[2]=0}let m=n.map(e=>({...e,_flight:void 0}));m[a].status=`pending`;let h=i[4]=e.startTransition(()=>e.stores.setMatches(m),m).then(t=>(t&&e._pending===i&&i[4]===h&&!i[2]&&(i[2]=Date.now()+f),t));return}}function Dn(e,t){let n=e._pending;(e._tx===t||!e._tx?.[3].some(e=>e.id===n?.[1]))&&(clearTimeout(n?.[3]),e._pending=void 0)}async function On(e,t){let n=e._pending;if(!n)return;clearTimeout(n[3]);let r=n[2]-Date.now();if(!n[4]||r<=0||!Jt(t[3]).some(e=>e.id===n[1]))return;let i;try{await tn(new Promise(e=>{i=setTimeout(e,r)}),t[0].signal)}catch{}clearTimeout(i)}function kn(e,t){e._committed=t,e.stores.setMatches(t)}function An(e,t,n,r){let i=e._committed,a=e._cache;for(let e of n)e.preload=!1,r&&(e._assetEnd=void 0);let o=Jt(n).length,s=new Map;{let t=Date.now();for(let r of[...i,...a.values()]){if(r.status!==`success`||n.some((e,t)=>e.id===r.id&&(t<o||e.status===`success`)))continue;let i=nn(e,r);!i.options.loader||t-r.updatedAt>=(r.preload?i.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:i.options.gcTime??e.options.defaultGcTime??3e5)||s.set(r.id,a.get(r.id)===r?r:{...r,_flight:void 0,isFetching:!1,context:{}})}}t[3]=[],e._cache=s,kn(e,n),un(e,[...a.values(),...i],[...n,...s.values()]),It(e,i,n,t)}async function jn(e,t){let n=e._tx;for(;n&&n!==t;){if(await n[5],e._tx===n)return;n=e._tx}}function Mn(e,t,n){let r=n[1].options,i=n[2];if(!i)return e.navigate({...r,replace:!0,ignoreBlocker:!0});if(r.reloadDocument)return e.navigate({href:i.publicHref,reloadDocument:!0,replace:!0,ignoreBlocker:!0});i._redirects=t[1]+1,e._pendingLocation=i;let a=e.commitLocation({...i,viewTransition:r.viewTransition,replace:!0,resetScroll:r.resetScroll,hashScrollIntoView:r.hashScrollIntoView,ignoreBlocker:!0});return queueMicrotask(()=>{e._pendingLocation===i&&(e._pendingLocation=void 0)}),a}async function Nn(e,t,n,r,i){let a=n.map(e=>({...e}));dn(a);for(let t of r)ln(e,a[t[0]]),a[t[0]]=t[3];let o=[t[2],a],s;try{s=await Cn(e,o,r,t[0],i)}catch(t){throw un(e,a),t}if(en(s)){un(e,a),s[0]===Qt&&e._tx===t&&e._committed===n&&await Mn(e,t,s);return}if(await wn(e,s,t[0].signal),e._tx!==t||e._committed!==n){un(e,a);return}for(let t of a){let n=e._cache.get(t.id);n?._flight&&n._flight===t._flight&&(e._cache.delete(t.id),ln(e,n))}kn(e,a),un(e,n,a)}async function Pn(e,t,n,r,i,a){let o=await Tn(e,t[2],t[3],[t[0],t[1],e._committed,void 0,i,n,a,r]);if(en(o)){let n=o[0]===Qt&&e._tx===t;if((!n||o[1].options.reloadDocument)&&Dn(e,t),un(e,t[3]),t[3]=[],!n)return;if(e._tx!==t){Dn(e,t);return}await Mn(e,t,o);return}let s=o[1];if(e._tx===t&&await On(e,t),e._tx!==t){Dn(e,t),un(e,s),bn(e,o);return}let c=t[2],l=Pt(c,e.stores.resolvedLocation.get()),u=o[2];await e.startViewTransition(async()=>{if(e._tx===t&&await On(e,t),e._tx!==t){Dn(e,t),un(e,s),bn(e,o);return}let n=await e.startTransition(()=>{Dn(e,t),An(e,t,s,a),e._tx===t&&(e.emit({type:`onLoad`,...l}),e._tx===t&&e.emit({type:`onBeforeRouteMount`,...l}))},s);if(e._tx!==t){bn(e,o);return}u?.length&&Nn(e,t,s,u,o[3]).catch(console.error),e.batch(()=>{e.stores.resolvedLocation.set(c),e.stores.status.set(`idle`),e._tx===t&&e.emit({type:`onResolved`,...l}),n&&e._tx===t&&e.emit({type:`onRendered`,...l})}),e._tx===t&&(e._commitPromise?.resolve(),e._commitPromise=void 0)})}async function Fn(e,t){let n=e._tx,r=e.stores.resolvedLocation.get(),i=r??e.stores.location.get(),a=e.latestLocation,o=e._pendingLocation,s=o?.href===a.href?o._redirects??0:0,c=e._handoff,l=c?.[0](),u=new AbortController,d=e._preflight;if(e._preflight=u,l||c?.[1](),d?.abort(),!u.signal.aborted){let t=Pt(a,r);e.emit({type:`onBeforeNavigate`,...t}),u.signal.aborted||e.emit({type:`onBeforeLoad`,...t})}if(u.signal.aborted){await jn(e,n);return}let f=i.href===a.href,p=u,m=e.matchRoutes(a,{_controller:u});dn(m);let h=l?c[1](m):void 0;if(h?p=l:l?.abort(),u.signal.aborted){un(e,m),await jn(e,n);return}e._preflight=void 0;let g,_=()=>Pn(e,y,f,()=>En(e,y),t?.sync,h),v=t?.sync?new Promise(e=>g=e):Promise.resolve().then(_).then(),y=[p,s,a,m,Date.now(),v];if(e._tx=y,n){for(let t of e.stores.matches.get()){if(e._tx!==y)break;t.isFetching&&fn(e,t,!1)}n[0].abort(),un(e,n[3],y[3],!0)}if(e._tx!==y){un(e,y[3]),y[3]=[],g?.(),await jn(e,y);return}e.batch(()=>{e.stores.status.set(`pending`),e.stores.location.set(a)}),(h||!e._committed.length&&m[0]?.status!==`success`&&!m.some(e=>e._notFound))&&En(e,y),g?.(_()),await v,await jn(e,y)}async function In(e,t){let n=e.buildLocation(t);for(let t=0;;t++){let r=e._committed,i=new AbortController,a,o,s;try{try{a=e.matchRoutes(n,{_controller:i}),dn(a),o=(e._preloads??=new Map).set(i,a),s=await Tn(e,n,a,[i,t,r,!0])}finally{o&&(o=o.delete(i),un(e,a)),i.abort()}if(!en(s))return s[1];if(!o||s.length<3)return;n=s[2]}catch(e){Ke(e)||console.error(e);return}}}var Ln=`Error preloading route! ☝️`,Rn=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e.originalIndex;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=ht:this.parentRoute||ue();let r=n?ht:t?.path;r&&r!==`/`&&(r=Ie(r));let i=t?.id||r,a=n?ht:Pe([this.parentRoute.id===`__root__`?``:this.parentRoute.id,i]);r===`__root__`&&(r=`/`),a!==`__root__`&&(a=Pe([`/`,a]));let o=a===`__root__`?`/`:Pe([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=o,this._to=Le(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>gt({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},zn=class extends Rn{constructor(e){super(e)}},Bn=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),Vn=o(((e,t)=>{t.exports=Bn()})),U=Vn(),Hn=class extends v.Component{constructor(...e){super(...e),this.state={error:null},this.reset=()=>{this.setState({error:null})}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){this.props.onCatch?.(e,t)}render(){let e=this.state.error;return e?v.createElement(this.props.errorComponent??Un,{error:e,reset:this.reset}):this.props.children}};function Un({error:e}){let[t,n]=v.useState(!1);return(0,U.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,U.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,U.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,U.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,U.jsx)(`div`,{children:(0,U.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,U.jsx)(`code`,{children:e.message}):null})}):null]})}function Wn({children:e,fallback:t=null}){return(0,U.jsx)(v.Fragment,{children:Gn()?e:t})}function Gn(){return v.useSyncExternalStore(Kn,()=>!0,()=>!1)}function Kn(){return()=>{}}var qn=v.createContext(null);function Jn(e){return v.useContext(qn)}var Yn=v.createContext(void 0),Xn=v.createContext(void 0),Zn=(e=>(e[e.None=0]=`None`,e[e.Mutable=1]=`Mutable`,e[e.Watching=2]=`Watching`,e[e.RecursedCheck=4]=`RecursedCheck`,e[e.Recursed=8]=`Recursed`,e[e.Dirty=16]=`Dirty`,e[e.Pending=32]=`Pending`,e))(Zn||{});function Qn({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(!0)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(!0)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function $n(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var er=[],tr=0,{link:nr,unlink:rr,propagate:ir,checkDirty:ar,shallowPropagate:or}=Qn({update(e){return e._update()},notify(e){er[cr++]=e,e.flags&=~Zn.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=Zn.Mutable|Zn.Dirty,fr(e))}}),sr=0,cr=0,lr,ur=0;function dr(e){try{++ur,e()}finally{--ur||pr()}}function fr(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=rr(n,e)}function pr(){if(!(ur>0)){for(;sr<cr;){let e=er[sr];er[sr++]=void 0,e.notify()}sr=0,cr=0}}function mr(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?Zn.None:Zn.Mutable,get(){return lr!==void 0&&nr(i,lr,tr),i._snapshot},subscribe(e){let t=$n(e),n={current:!1},r=hr(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=lr,o=t?.compare??Object.is;if(n)lr=i,++tr,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=Zn.Mutable|Zn.RecursedCheck);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{lr=a,n&&(i.flags&=~Zn.RecursedCheck),fr(i)}}};return n?(i.flags=Zn.Mutable|Zn.Dirty,i.get=function(){let e=i.flags;if(e&Zn.Dirty||e&Zn.Pending&&ar(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&or(e)}}else e&Zn.Pending&&(i.flags=e&~Zn.Pending);return lr!==void 0&&nr(i,lr,tr),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(ir(e),or(e),pr())}},i}function hr(e){let t=()=>{let t=lr;lr=n,++tr,n.depsTail=void 0,n.flags=Zn.Watching|Zn.RecursedCheck;try{return e()}finally{lr=t,n.flags&=~Zn.RecursedCheck,fr(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Zn.Watching|Zn.RecursedCheck,notify(){let e=this.flags;e&Zn.Dirty||e&Zn.Pending&&ar(this.deps,this)?t():this.flags=Zn.Watching},stop(){this.flags=Zn.None,this.depsTail=void 0,fr(this)}};return t(),n}var gr=o((e=>{var t=d();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),_r=o(((e,t)=>{t.exports=gr()})),vr=o((e=>{var t=d(),n=_r();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),yr=o(((e,t)=>{t.exports=vr()}))();function br(e,t){return e===t}function xr(e,t,n=br){let r=(0,v.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=(0,v.useCallback)(()=>e?.get(),[e]);return(0,yr.useSyncExternalStoreWithSelector)(r,i,i,t,n)}var Sr={};function Cr(e,t){let n=v.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=R(n.current,i):i}}function wr(e){let t=Jn(),n=v.useContext(e.from?Xn:Yn),r=e.from??n,i=t.stores.getMatchStore(r),a=Cr(e,t),o=xr(i,e=>e?a(e):Sr);if(o!==Sr)return o;(e.shouldThrow??!0)&&ue()}function Tr(e){return wr({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Er(e){let{select:t,...n}=e;return wr({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function Dr(e){return wr({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Or(e){return wr({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function kr(e){let t=Jn();return v.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function Ar(e){return wr({...e,select:t=>e.select?e.select(t.context):t.context})}function jr(e){let t=v.useRef(e);return ne(t.current,e,{ignoreUndefined:!1})||(t.current=e),t.current}function Mr(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function Nr(e,t,n){if(e?.external)return oe(e.href,n)?void 0:e.href;if(!Wr(t)&&typeof t==`string`&&t.indexOf(`:`)!==-1)try{return new URL(t),oe(t,n)?void 0:t}catch{}}function Pr(e,t,n,r,i,a){if(a)return!1;if(n?.exact){if(!Be(e.pathname,t.pathname,r))return!1}else{let n=ze(e.pathname,r),i=ze(t.pathname,r);if(!(n.startsWith(i)&&(n.length===i.length||n[i.length]===`/`)))return!1}return(n?.includeSearch??!0)&&!ne(e.search,t.search,{partial:!n?.exact,ignoreUndefined:!n?.explicitUndefined})?!1:!n?.includeHash||i&&e.hash===t.hash}function Fr(e,t){let n=Jn(),r=j(t),{activeProps:i,inactiveProps:a,activeOptions:o,to:s,preload:c,preloadDelay:l,preloadIntentProximity:u,hashScrollIntoView:d,replace:f,startTransition:p,resetScroll:m,viewTransition:h,children:g,target:_,disabled:y,style:b,className:x,onClick:S,onBlur:C,onFocus:w,onMouseEnter:T,onMouseLeave:E,onTouchStart:D,ignoreBlocker:O,params:k,search:M,hash:P,state:F,mask:I,reloadDocument:L,unsafeRelative:ee,from:R,_fromLocation:te,...z}=e,B=Gn(),V=jr(e.search),ne=jr(e.params),H=jr(o),re=v.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,V,ne,e.state,e.mask,e.unsafeRelative]),ie=v.useCallback(e=>{let t=n.buildLocation({_fromLocation:e,...re}),r=Ur(t.maskedLocation?t.maskedLocation.publicHref:t.publicHref,t.maskedLocation?t.maskedLocation.external:t.external,n.history,y),i=Nr(r,s,n.protocolAllowlist);return[r?.href,i,Pr(e,t,H,n.basepath,B,i!==void 0)]},[H,y,B,re,n,s]),[ae,oe,se]=xr(n.stores.location,ie,Mr),ce=se?N(i,{})??Lr:Ir,le=se?Ir:N(a,{})??Ir,ue=[x,ce.className,le.className].filter(Boolean).join(` `),de=(b||ce.style||le.style)&&{...b,...ce.style,...le.style},fe=v.useRef(!1),pe=e.reloadDocument||oe||y?!1:c??n.options.defaultPreload,me=l??n.options.defaultPreloadDelay??0,he=v.useCallback(()=>{n.preloadRoute(re).catch(e=>{console.warn(e),console.warn(Ln)})},[n,re]),ge=v.useCallback(e=>{if(!e){Vr(r);return}if(!(e.isIntersecting??pe===`intent`)){e.isIntersecting===!1&&Vr(r);return}if(!me){he();return}Br.has(r)||Br.set(r,setTimeout(()=>{Br.delete(r),he()},me))},[he,r,pe,me]);A(r,ge,pe!==`viewport`),v.useEffect(()=>{fe.current||pe===`render`&&(he(),fe.current=!0)},[he,pe]);let _e=e=>{let t=e.currentTarget.getAttribute(`target`),r=_===void 0?t:_;!y&&!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0&&(e.preventDefault(),n.navigate({...re,replace:f,resetScroll:m,hashScrollIntoView:d,startTransition:p,viewTransition:h,ignoreBlocker:O}))};if(oe)return{...z,ref:r,href:oe,...g&&{children:g},..._&&{target:_},...y&&{disabled:y},...b&&{style:b},...x&&{className:x},...S&&{onClick:S},...C&&{onBlur:C},...w&&{onFocus:w},...T&&{onMouseEnter:T},...E&&{onMouseLeave:E},...D&&{onTouchStart:D}};let ve=()=>{pe===`intent`&&he()},ye=()=>{pe===`intent`&&Vr(r)};return{...z,...ce,...le,href:ae,ref:r,onClick:Hr([S,_e]),onBlur:Hr([C,ye]),onFocus:Hr([w,ge]),onMouseEnter:Hr([T,ge]),onMouseLeave:Hr([E,ye]),onTouchStart:Hr([D,ve]),disabled:!!y,target:_,...de&&{style:de},...ue&&{className:ue},...y&&Rr,...se&&zr}}var Ir={},Lr={className:`active`},Rr={role:`link`,"aria-disabled":!0},zr={"data-status":`active`,"aria-current":`page`},Br=new WeakMap,Vr=e=>{clearTimeout(Br.get(e)),Br.delete(e)},Hr=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}};function Ur(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||`/`,external:!1}}function Wr(e){if(typeof e!=`string`)return!1;let t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Gr=v.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,...a}=Fr(r,t),o=typeof r.children==`function`?r.children({isActive:a[`data-status`]===`active`}):r.children;if(!n){let{disabled:e,...t}=a;return v.createElement(`a`,t,o)}return v.createElement(n,a,o)}),Kr=class extends Rn{constructor(e){super(e),this.useMatch=e=>wr({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>Ar({...e,from:this.id}),this.useSearch=e=>Or({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>Dr({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Er({...e,from:this.id}),this.useLoaderData=e=>Tr({...e,from:this.id}),this.useNavigate=()=>kr({from:this.fullPath}),this.Link=v.forwardRef((e,t)=>(0,U.jsx)(Gr,{ref:t,from:this.fullPath,...e}))}};function qr(e){return new Kr(e)}var Jr=class extends zn{constructor(e){super(e),this.useMatch=e=>wr({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>Ar({...e,from:this.id}),this.useSearch=e=>Or({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>Dr({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Er({...e,from:this.id}),this.useLoaderData=e=>Tr({...e,from:this.id}),this.useNavigate=()=>kr({from:this.fullPath}),this.Link=v.forwardRef((e,t)=>(0,U.jsx)(Gr,{ref:t,from:this.fullPath,...e}))}};function Yr(e){return new Jr(e)}function Xr(e){let t=Jn(),n=`not-found-${xr(t.stores.location,e=>e.pathname)}-${xr(t.stores.status,e=>e)}`;return(0,U.jsx)(Hn,{getResetKey:()=>n,onCatch:(t,n)=>{if(Ke(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(Ke(t))return e.fallback?.(t);throw t},children:e.children})}function Zr(){return(0,U.jsx)(`p`,{children:`Not Found`})}function Qr(e){return(0,U.jsx)(U.Fragment,{children:e.children})}function $r(e,t,n){return t.options.notFoundComponent?(0,U.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,U.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,U.jsx)(Zr,{})}function ei(e,t){let n=t?.options.pendingComponent??e.options.defaultPendingComponent;return n?(0,U.jsx)(n,{}):null}var ti=(e,t)=>e[0]===t[0]&&e[1]===t[1],ni=(e,t,n)=>!t.isRoot||t.options.shellComponent||t.options.wrapInSuspense||n===!1||n===`data-only`||!e.ssr,ri=v.memo(function({routeId:e}){let t=Jn();return(0,U.jsx)(ii,{router:t,match:xr(t.stores.getMatchStore(e),e=>e)})});function ii({router:e,match:t}){let n=e.routesById[t.routeId],r=ei(e,n),i=n.options.errorComponent??e.options.defaultErrorComponent,a=n.options.onCatch??e.options.defaultOnCatch,o=n.isRoot?n.options.notFoundComponent??e.options.notFoundRoute?.options.component:n.options.notFoundComponent,s=t.ssr===!1||t.ssr===`data-only`,c=ni(e,n,t.ssr)&&(n.options.wrapInSuspense??r??(n.options.errorComponent?.preload||s))?v.Suspense:Qr,l=i?Hn:Qr,u=o?Xr:Qr;return(0,U.jsxs)(n.isRoot?n.options.shellComponent??Qr:Qr,{children:[(0,U.jsx)(Yn.Provider,{value:t.routeId,children:(0,U.jsx)(c,{fallback:r,children:(0,U.jsx)(l,{getResetKey:()=>t,errorComponent:i,onCatch:(e,n)=>{if(Ke(e))throw e.routeId??=t.routeId,e;a?.(e,n)},children:(0,U.jsx)(u,{fallback:e=>{if(e.routeId??=t.routeId,e.routeId!==t.routeId)throw e;return v.createElement(o,e)},children:s?(0,U.jsx)(Wn,{fallback:r,children:(0,U.jsx)(ai,{match:t})}):(0,U.jsx)(ai,{match:t})})})})}),null]})}var ai=v.memo(function({match:e}){let t=Jn(),n=e.routeId,r=t.routesById[n],i=v.useMemo(()=>{let i=(r.options.remountDeps??t.options.defaultRemountDeps)?.({routeId:n,loaderDeps:e.loaderDeps,params:e._strictParams,search:e._strictSearch});return i?JSON.stringify(i):void 0},[n,e.loaderDeps,e._strictParams,e._strictSearch,r.options.remountDeps,t.options.defaultRemountDeps]),a=v.useMemo(()=>{let e=r.options.component??t.options.defaultComponent;return e?(0,U.jsx)(e,{},i):(0,U.jsx)(oi,{})},[i,r.options.component,t.options.defaultComponent]);if(e.status===`pending`){if(t.ssr&&!ni(t,r,e.ssr))return a;if(t._tx)throw t._tx[5];return ei(t,r)}if(e.status===`notFound`)return $r(t,r,e.error);if(e.status===`error`)throw e.error;return a}),oi=v.memo(function(){let e=Jn(),t=v.useContext(Yn),n,r,i;{let a=e.stores.getMatchStore(t);[n,r]=xr(a,e=>[!!e._notFound,e.error],ti),i=xr(e.stores.ids,e=>e[e.indexOf(t)+1])}if(n)return $r(e,e.routesById[t],r);if(!i)return null;let a=(0,U.jsx)(ri,{routeId:i});return t===`__root__`?(0,U.jsx)(v.Suspense,{fallback:ei(e),children:a}):a});function si(e,t){let n=e[1];e.length=0,n?.(t)}function ci({t:e}){let t=Jn(),n=t._rendered??=[];return t.startTransition=(r,i)=>new Promise(a=>{si(n,!1),n.push(i,a),e(t),v.startTransition(r)}),k(()=>{let e=t.history.subscribe(t.load);t.updateLatestLocation();let r=t.latestLocation,i=t.buildLocation({to:r.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(Le(r.publicHref)!==Le(i.publicHref))return t.commitLocation({...i,replace:!0,ignoreBlocker:!0}),e;let a=t.stores.resolvedLocation.get();return a?.href===r.href&&a.state.__TSR_key===r.state.__TSR_key?n.push(t.stores.matches.get(),e=>{e&&t.emit({type:`onRendered`,...Pt(a,a)})}):t._tx||t.load({sync:!0}).catch(console.error),e},[t,t.history]),null}function li(){let e=Jn(),t=e.routesById[ht],n=ei(e,t),r=e.ssr?Qr:v.Suspense,i=(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(ci,{t:v.useState()[1]}),(0,U.jsx)(r,{fallback:n,children:(0,U.jsx)(ui,{})})]});return e.options.InnerWrap?(0,U.jsx)(e.options.InnerWrap,{children:i}):i}function ui(){let e=Jn(),t=e._rendered,n=xr(e.stores.matches,e=>t[0]??e),r=n[0],i=r?.routeId;k(()=>{t[0]===n&&si(t,!0)},[t,n]);let a=i?(0,U.jsx)(ri,{routeId:i}):null;return(0,U.jsx)(Yn.Provider,{value:i,children:e.options.disableGlobalCatchBoundary?a:(0,U.jsx)(Hn,{getResetKey:()=>r,onCatch:void 0,children:a})})}var di=e=>({createMutableStore:mr,createReadonlyStore:mr,batch:dr}),fi=e=>new pi(e),pi=class extends Lt{constructor(e){super(e,di)}};function mi({router:e,children:t,...n}){I(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,U.jsx)(qn.Provider,{value:e,children:t});return e.options.Wrap?(0,U.jsx)(e.options.Wrap,{children:r}):r}function hi({router:e,...t}){return(0,U.jsx)(mi,{router:e,...t,children:(0,U.jsx)(li,{})})}function gi(e){let t=Jn({warn:e?.router===void 0}),n=e?.router||t;return xr(n.stores.__store,Cr(e,n))}function _i(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=_i(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function vi(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=_i(e))&&(r&&(r+=` `),r+=t);return r}var yi=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,bi=vi,xi=(e,t)=>n=>{if(t?.variants==null)return bi(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=yi(t)||yi(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return bi(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},Si=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Ci=(e,t)=>({classGroupId:e,validator:t}),wi=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Ti=`-`,Ei=[],Di=`arbitrary..`,Oi=e=>{let t=ji(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Ai(e);let n=e.split(Ti);return ki(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Si(i,t):t:i||Ei}return n[e]||Ei}}},ki=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=ki(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Ti):e.slice(t).join(Ti),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Ai=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Di+r:void 0})(),ji=e=>{let{theme:t,classGroups:n}=e;return Mi(n,t)},Mi=(e,t)=>{let n=wi();for(let r in e){let i=e[r];Ni(i,n,r,t)}return n},Ni=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];Pi(i,t,n,r)}},Pi=(e,t,n,r)=>{if(typeof e==`string`){Fi(e,t,n);return}if(typeof e==`function`){Ii(e,t,n,r);return}Li(e,t,n,r)},Fi=(e,t,n)=>{let r=e===``?t:Ri(t,e);r.classGroupId=n},Ii=(e,t,n,r)=>{if(zi(e)){Ni(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Ci(n,e))},Li=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Ni(o,Ri(t,a),n,r)}},Ri=(e,t)=>{let n=e,r=t.split(Ti),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=wi(),n.nextPart.set(t,i)),n=i}return n},zi=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,Bi=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},Vi=`!`,Hi=`:`,Ui=[],Wi=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Gi=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===Hi){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(Vi)?(c=s.slice(0,-1),l=!0):s.startsWith(Vi)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return Wi(t,l,c,u)};if(t){let e=t+Hi,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Wi(Ui,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},Ki=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},qi=e=>({cache:Bi(e.cacheSize),parseClassName:Gi(e),sortModifiers:Ki(e),postfixLookupClassGroupIds:Ji(e),...Oi(e)}),Ji=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},Yi=/\s+/,Xi=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(Yi),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+Vi:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},Zi=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=Qi(n))&&(i&&(i+=` `),i+=r);return i},Qi=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=Qi(e[r]))&&(n&&(n+=` `),n+=t);return n},$i=(e,...t)=>{let n,r,i,a,o=o=>(n=qi(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=Xi(e,n);return i(e,a),a};return a=o,(...e)=>a(Zi(...e))},ea=[],ta=e=>{let t=t=>t[e]||ea;return t.isThemeGetter=!0,t},na=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ra=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ia=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,aa=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,oa=/\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$/,sa=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ca=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,la=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ua=e=>ia.test(e),da=e=>!!e&&!Number.isNaN(Number(e)),fa=e=>!!e&&Number.isInteger(Number(e)),pa=e=>e.endsWith(`%`)&&da(e.slice(0,-1)),ma=e=>aa.test(e),ha=()=>!0,ga=e=>oa.test(e)&&!sa.test(e),_a=()=>!1,va=e=>ca.test(e),ya=e=>la.test(e),ba=e=>!Ca(e)&&!ja(e),xa=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),Sa=e=>za(e,Ua,_a),Ca=e=>na.test(e),wa=e=>za(e,Wa,ga),Ta=e=>za(e,Ga,da),Ea=e=>za(e,qa,ha),Da=e=>za(e,Ka,_a),Oa=e=>za(e,Va,_a),ka=e=>za(e,Ha,ya),Aa=e=>za(e,Ja,va),ja=e=>ra.test(e),Ma=e=>Ba(e,Wa),Na=e=>Ba(e,Ka),Pa=e=>Ba(e,Va),Fa=e=>Ba(e,Ua),Ia=e=>Ba(e,Ha),La=e=>Ba(e,Ja,!0),Ra=e=>Ba(e,qa,!0),za=(e,t,n)=>{let r=na.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Ba=(e,t,n=!1)=>{let r=ra.exec(e);return r?r[1]?t(r[1]):n:!1},Va=e=>e===`position`||e===`percentage`,Ha=e=>e===`image`||e===`url`,Ua=e=>e===`length`||e===`size`||e===`bg-size`,Wa=e=>e===`length`,Ga=e=>e===`number`,Ka=e=>e===`family-name`,qa=e=>e===`number`||e===`weight`,Ja=e=>e===`shadow`,Ya=()=>{let e=ta(`color`),t=ta(`font`),n=ta(`text`),r=ta(`font-weight`),i=ta(`tracking`),a=ta(`leading`),o=ta(`breakpoint`),s=ta(`container`),c=ta(`spacing`),l=ta(`radius`),u=ta(`shadow`),d=ta(`inset-shadow`),f=ta(`text-shadow`),p=ta(`drop-shadow`),m=ta(`blur`),h=ta(`perspective`),g=ta(`aspect`),_=ta(`ease`),v=ta(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),ja,Ca],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[ja,Ca,c],T=()=>[ua,`full`,`auto`,...w()],E=()=>[fa,`none`,`subgrid`,ja,Ca],D=()=>[`auto`,{span:[`full`,fa,ja,Ca]},fa,ja,Ca],O=()=>[fa,`auto`,ja,Ca],k=()=>[`auto`,`min`,`max`,`fr`,ja,Ca],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[ua,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[ua,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],F=()=>[ua,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],I=()=>[e,ja,Ca],L=()=>[...b(),Pa,Oa,{position:[ja,Ca]}],ee=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],R=()=>[`auto`,`cover`,`contain`,Fa,Sa,{size:[ja,Ca]}],te=()=>[pa,Ma,wa],z=()=>[``,`none`,`full`,l,ja,Ca],B=()=>[``,da,Ma,wa],V=()=>[`solid`,`dashed`,`dotted`,`double`],ne=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],H=()=>[da,pa,Pa,Oa],re=()=>[``,`none`,m,ja,Ca],ie=()=>[`none`,da,ja,Ca],ae=()=>[`none`,da,ja,Ca],oe=()=>[da,ja,Ca],se=()=>[ua,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[ma],breakpoint:[ma],color:[ha],container:[ma],"drop-shadow":[ma],ease:[`in`,`out`,`in-out`],font:[ba],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[ma],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[ma],shadow:[ma],spacing:[`px`,da],text:[ma],"text-shadow":[ma],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,ua,Ca,ja,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,ja,Ca]}],"container-named":[xa],columns:[{columns:[da,Ca,ja,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"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:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[fa,`auto`,ja,Ca]}],basis:[{basis:[ua,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[da,ua,`auto`,`initial`,`none`,Ca]}],grow:[{grow:[``,da,ja,Ca]}],shrink:[{shrink:[``,da,ja,Ca]}],order:[{order:[fa,`first`,`last`,`none`,ja,Ca]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...P()]}],"min-inline-size":[{"min-inline":[`auto`,...P()]}],"max-inline-size":[{"max-inline":[`none`,...P()]}],"block-size":[{block:[`auto`,...F()]}],"min-block-size":[{"min-block":[`auto`,...F()]}],"max-block-size":[{"max-block":[`none`,...F()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,...N()]}],"font-size":[{text:[`base`,n,Ma,wa]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Ra,Ea]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,pa,Ca]}],"font-family":[{font:[Na,Da,t]}],"font-features":[{"font-features":[Ca]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,ja,Ca]}],"line-clamp":[{"line-clamp":[da,`none`,ja,Ta]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,ja,Ca]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,ja,Ca]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...V(),`wavy`]}],"text-decoration-thickness":[{decoration:[da,`from-font`,`auto`,ja,wa]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[da,`auto`,ja,Ca]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[fa,ja,Ca]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,ja,Ca]}],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`,ja,Ca]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:ee()}],"bg-size":[{bg:R()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},fa,ja,Ca],radial:[``,ja,Ca],conic:[fa,ja,Ca]},Ia,ka]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:te()}],"gradient-via-pos":[{via:te()}],"gradient-to-pos":[{to:te()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:z()}],"rounded-s":[{"rounded-s":z()}],"rounded-e":[{"rounded-e":z()}],"rounded-t":[{"rounded-t":z()}],"rounded-r":[{"rounded-r":z()}],"rounded-b":[{"rounded-b":z()}],"rounded-l":[{"rounded-l":z()}],"rounded-ss":[{"rounded-ss":z()}],"rounded-se":[{"rounded-se":z()}],"rounded-ee":[{"rounded-ee":z()}],"rounded-es":[{"rounded-es":z()}],"rounded-tl":[{"rounded-tl":z()}],"rounded-tr":[{"rounded-tr":z()}],"rounded-br":[{"rounded-br":z()}],"rounded-bl":[{"rounded-bl":z()}],"border-w":[{border:B()}],"border-w-x":[{"border-x":B()}],"border-w-y":[{"border-y":B()}],"border-w-s":[{"border-s":B()}],"border-w-e":[{"border-e":B()}],"border-w-bs":[{"border-bs":B()}],"border-w-be":[{"border-be":B()}],"border-w-t":[{"border-t":B()}],"border-w-r":[{"border-r":B()}],"border-w-b":[{"border-b":B()}],"border-w-l":[{"border-l":B()}],"divide-x":[{"divide-x":B()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":B()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...V(),`hidden`,`none`]}],"divide-style":[{divide:[...V(),`hidden`,`none`]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...V(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[da,ja,Ca]}],"outline-w":[{outline:[``,da,Ma,wa]}],"outline-color":[{outline:I()}],shadow:[{shadow:[``,`none`,u,La,Aa]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":[`none`,d,La,Aa]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:B()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[da,wa]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":B()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":[`none`,f,La,Aa]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[da,ja,Ca]}],"mix-blend":[{"mix-blend":[...ne(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ne()}],"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":[da]}],"mask-image-linear-from-pos":[{"mask-linear-from":H()}],"mask-image-linear-to-pos":[{"mask-linear-to":H()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":H()}],"mask-image-t-to-pos":[{"mask-t-to":H()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":H()}],"mask-image-r-to-pos":[{"mask-r-to":H()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":H()}],"mask-image-b-to-pos":[{"mask-b-to":H()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":H()}],"mask-image-l-to-pos":[{"mask-l-to":H()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":H()}],"mask-image-x-to-pos":[{"mask-x-to":H()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":H()}],"mask-image-y-to-pos":[{"mask-y-to":H()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[ja,Ca]}],"mask-image-radial-from-pos":[{"mask-radial-from":H()}],"mask-image-radial-to-pos":[{"mask-radial-to":H()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"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":b()}],"mask-image-conic-pos":[{"mask-conic":[da]}],"mask-image-conic-from-pos":[{"mask-conic-from":H()}],"mask-image-conic-to-pos":[{"mask-conic-to":H()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:ee()}],"mask-size":[{mask:R()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,ja,Ca]}],filter:[{filter:[``,`none`,ja,Ca]}],blur:[{blur:re()}],brightness:[{brightness:[da,ja,Ca]}],contrast:[{contrast:[da,ja,Ca]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,La,Aa]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:[``,da,ja,Ca]}],"hue-rotate":[{"hue-rotate":[da,ja,Ca]}],invert:[{invert:[``,da,ja,Ca]}],saturate:[{saturate:[da,ja,Ca]}],sepia:[{sepia:[``,da,ja,Ca]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,ja,Ca]}],"backdrop-blur":[{"backdrop-blur":re()}],"backdrop-brightness":[{"backdrop-brightness":[da,ja,Ca]}],"backdrop-contrast":[{"backdrop-contrast":[da,ja,Ca]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,da,ja,Ca]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[da,ja,Ca]}],"backdrop-invert":[{"backdrop-invert":[``,da,ja,Ca]}],"backdrop-opacity":[{"backdrop-opacity":[da,ja,Ca]}],"backdrop-saturate":[{"backdrop-saturate":[da,ja,Ca]}],"backdrop-sepia":[{"backdrop-sepia":[``,da,ja,Ca]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,ja,Ca]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[da,`initial`,ja,Ca]}],ease:[{ease:[`linear`,`initial`,_,ja,Ca]}],delay:[{delay:[da,ja,Ca]}],animate:[{animate:[`none`,v,ja,Ca]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,ja,Ca]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:ie()}],"rotate-x":[{"rotate-x":ie()}],"rotate-y":[{"rotate-y":ie()}],"rotate-z":[{"rotate-z":ie()}],scale:[{scale:ae()}],"scale-x":[{"scale-x":ae()}],"scale-y":[{"scale-y":ae()}],"scale-z":[{"scale-z":ae()}],"scale-3d":[`scale-3d`],skew:[{skew:oe()}],"skew-x":[{"skew-x":oe()}],"skew-y":[{"skew-y":oe()}],transform:[{transform:[ja,Ca,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:se()}],"translate-x":[{"translate-x":se()}],"translate-y":[{"translate-y":se()}],"translate-z":[{"translate-z":se()}],"translate-none":[`translate-none`],zoom:[{zoom:[fa,ja,Ca]}],accent:[{accent:I()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:I()}],"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`,ja,Ca]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":I()}],"scrollbar-track-color":[{"scrollbar-track":I()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"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`,ja,Ca]}],fill:[{fill:[`none`,...I()]}],"stroke-w":[{stroke:[da,Ma,wa,Ta]}],stroke:[{stroke:[`none`,...I()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}},Xa=(e,{cacheSize:t,prefix:n,experimentalParseClassName:r,extend:i={},override:a={}})=>(Za(e,`cacheSize`,t),Za(e,`prefix`,n),Za(e,`experimentalParseClassName`,r),Qa(e.theme,a.theme),Qa(e.classGroups,a.classGroups),Qa(e.conflictingClassGroups,a.conflictingClassGroups),Qa(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),Za(e,`postfixLookupClassGroups`,a.postfixLookupClassGroups),Za(e,`orderSensitiveModifiers`,a.orderSensitiveModifiers),$a(e.theme,i.theme),$a(e.classGroups,i.classGroups),$a(e.conflictingClassGroups,i.conflictingClassGroups),$a(e.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers),eo(e,i,`postfixLookupClassGroups`),eo(e,i,`orderSensitiveModifiers`),e),Za=(e,t,n)=>{n!==void 0&&(e[t]=n)},Qa=(e,t)=>{if(t)for(let n in t)Za(e,n,t[n])},$a=(e,t)=>{if(t)for(let n in t)eo(e,t,n)},eo=(e,t,n)=>{let r=t[n];r!==void 0&&(e[n]=e[n]?e[n].concat(r):r)},to=(e,...t)=>typeof e==`function`?$i(Ya,e,...t):$i(()=>Xa(Ya(),e),...t),no=$i(Ya),ro=to({extend:{classGroups:{"font-size":[{text:[`display-xl`,`display-lg`,`display-md`,`display-sm`,`heading-1`,`heading-2`,`heading-3`,`body`,`body-sm`,`label`,`code`]}]}}});function W(...e){return ro(vi(e))}var io=xi(`group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-colors outline-none select-none focus-visible:ring-2 focus-visible:ring-ring/60 focus-visible:ring-offset-1 focus-visible:ring-offset-bg disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-accent-hover`,outline:`border-border bg-surface hover:border-border-strong hover:bg-surface-hover`,secondary:`bg-secondary text-secondary-foreground hover:bg-surface-hover`,ghost:`text-fg-2 hover:bg-surface-hover hover:text-foreground`,destructive:`text-danger hover:bg-danger-bg`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-3`,xs:`h-6 gap-1 px-2 text-xs [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 px-2.5 text-xs`,lg:`h-9 gap-1.5 px-3.5`,icon:`size-8`,"icon-sm":`size-7`}},defaultVariants:{variant:`default`,size:`default`}}),ao=(0,v.forwardRef)(({className:e,variant:t=`default`,size:n=`default`,type:r=`button`,...i},a)=>(0,U.jsx)(`button`,{ref:a,type:r,"data-slot":`button`,className:W(io({variant:t,size:n,className:e})),...i}));ao.displayName=`Button`;var oo=xi(`inline-flex items-center gap-1.5 rounded-full border px-2 py-0.5 text-label font-medium whitespace-nowrap`,{variants:{variant:{neutral:`border-border bg-surface text-fg-2`,accent:`border-transparent bg-accent-bg text-fg-1`,success:`border-transparent bg-success-bg text-success`,warning:`border-transparent bg-warning-bg text-warning`,danger:`border-transparent bg-danger-bg text-danger`,info:`border-transparent bg-info-bg text-info`},mono:{true:`font-mono text-code`,false:``}},defaultVariants:{variant:`neutral`,mono:!1}});function so({className:e,variant:t=`neutral`,mono:n,dot:r,children:i,...a}){return(0,U.jsxs)(`span`,{"data-slot":`badge`,className:W(oo({variant:t,mono:n,className:e})),...a,children:[r?(0,U.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 shrink-0 self-center rounded-full bg-current`}):null,i]})}function co({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`card`,className:W(`rounded-lg border border-border bg-surface`,e),...t})}function lo({className:e,...t}){return(0,U.jsx)(`div`,{className:W(`flex items-start justify-between gap-3 px-4 pt-3.5 pb-3`,e),...t})}function uo({className:e,...t}){return(0,U.jsx)(`h3`,{className:W(`text-heading-3 font-semibold text-text`,e),...t})}function fo({className:e,...t}){return(0,U.jsx)(`div`,{className:W(`px-4 pb-4`,e),...t})}var po=(0,v.forwardRef)(({className:e,...t},n)=>(0,U.jsx)(`input`,{ref:n,"data-slot":`input`,className:W(`h-8 w-full rounded-md border border-border bg-bg px-2.5 text-body-sm text-text`,`placeholder:text-fg-4 transition-colors outline-none`,`hover:border-border-strong focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/40`,`disabled:pointer-events-none disabled:opacity-50`,e),...t}));po.displayName=`Input`;var mo=(0,v.forwardRef)(({className:e,...t},n)=>(0,U.jsx)(`textarea`,{ref:n,"data-slot":`textarea`,className:W(`w-full resize-none rounded-md border border-border bg-bg px-2.5 py-2 text-body-sm text-text`,`placeholder:text-fg-4 transition-colors outline-none`,`hover:border-border-strong focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/40`,`disabled:pointer-events-none disabled:opacity-50`,e),...t}));mo.displayName=`Textarea`;var ho={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},go={...ho,position:`fixed`,top:0,left:0},_o={...ho,position:`absolute`},vo={};function yo(e,t){let n=v.useRef(vo);return n.current===vo&&(n.current=e(t)),n}function bo(e,t,n,r){let i=yo(So).current;return Co(i,e,t,n,r)&&To(i,[e,t,n,r]),i.callback}function xo(e){let t=yo(So).current;return wo(t,e)&&To(t,e),t.callback}function So(){return{callback:null,cleanup:null,refs:[]}}function Co(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function wo(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function To(e,t){if(e.refs=t,t.every(e=>e==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}function Eo(e){let t=v.useRef(!0);t.current&&(t.current=!1,e())}function Do(e){let[t,n]=v.useState({current:e,previous:null});return Object.is(e,t.current)||n({current:e,previous:t.current}),t.previous}function Oo(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}function ko({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=v.useRef(e!==void 0),[a,o]=v.useState(t);return[i?e:a,v.useCallback(e=>{i||o(e)},[])]}var Ao=typeof document<`u`?v.useLayoutEffect:()=>{},jo={...v},Mo=jo.useInsertionEffect,No=Mo&&Mo!==jo.useLayoutEffect?Mo:e=>e();function Po(e){let t=yo(Fo).current;return t.next=e,No(t.effect),t.trampoline}function Fo(){let e={next:void 0,callback:Io,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Io(){}function Lo(e){let t=yo(Ro,e).current;return t.next=e,Ao(t.effect),t}function Ro(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function zo(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var Bo=zo(`https://base-ui.com/production-error`,`Base UI`),Vo=19;function Ho(e){return Vo>=e}var Uo=[],Wo=void 0;function Go(){return Wo}function Ko(e){Uo.push(e)}function qo(e){let t=(t,n)=>{let r=yo(Yo).current,i;try{Wo=r;for(let e of Uo)e.before(r);i=e(t,n);for(let e of Uo)e.after(r);r.didInitialize=!0}finally{Wo=void 0}return i};return t.displayName=e.displayName||e.name,t}function Jo(e){return v.forwardRef(qo(e))}function Yo(){return{didInitialize:!1}}var Xo=_r(),Zo=Ho(19)?es:ts;function Qo(e,t,n,r,i){return Zo(e,t,n,r,i)}function $o(e,t,n,r,i){let a=v.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,Xo.useSyncExternalStore)(e.subscribe,a,a)}Ko({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){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,Xo.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function es(e,t,n,r,i){let a=Go();if(!a)return $o(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function ts(e,t,n,r,i){return(0,yr.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var ns=class{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return Qo(this,e,t,n,r)}};function rs(){}var is=Object.freeze([]),as=Object.freeze({}),os=class extends ns{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){v.useDebugValue(e);let n=this;Ao(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;Ao(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;Ao(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){v.useDebugValue(e);let n=this,r=t!==void 0;Ao(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return v.useDebugValue(e),Qo(this,this.selectors[e],t,n,r)}useContextCallback(e,t){v.useDebugValue(e);let n=Po(t??rs);this.context[e]=n}useStateSetter(e){let t=v.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}};function ss(){return typeof window<`u`}function cs(e){return ds(e)?(e.nodeName||``).toLowerCase():`#document`}function ls(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function us(e){return((ds(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function ds(e){return ss()?e instanceof Node||e instanceof ls(e).Node:!1}function fs(e){return ss()?e instanceof Element||e instanceof ls(e).Element:!1}function ps(e){return ss()?e instanceof HTMLElement||e instanceof ls(e).HTMLElement:!1}function ms(e){return!ss()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof ls(e).ShadowRoot}function hs(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Es(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function gs(e){return/^(table|td|th)$/.test(cs(e))}function _s(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var vs=/transform|translate|scale|rotate|perspective|filter/,ys=/paint|layout|strict|content/,bs=e=>!!e&&e!==`none`,xs;function Ss(e){let t=fs(e)?Es(e):e;return bs(t.transform)||bs(t.translate)||bs(t.scale)||bs(t.rotate)||bs(t.perspective)||!ws()&&(bs(t.backdropFilter)||bs(t.filter))||vs.test(t.willChange||``)||ys.test(t.contain||``)}function Cs(e){let t=Os(e);for(;ps(t)&&!Ts(t);){if(Ss(t))return t;if(_s(t))return null;t=Os(t)}return null}function ws(){return xs??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),xs}function Ts(e){return/^(html|body|#document)$/.test(cs(e))}function Es(e){return ls(e).getComputedStyle(e)}function Ds(e){return fs(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Os(e){if(cs(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ms(e)&&e.host||us(e);return ms(t)?t.host:t}function ks(e){let t=Os(e);return Ts(t)?(e.ownerDocument||e).body:ps(t)&&hs(t)?t:ks(t)}function As(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=ks(e),i=r===e.ownerDocument?.body,a=ls(r);if(i){let e=js(a);return t.concat(a,a.visualViewport||[],hs(r)?r:[],e&&n?As(e):[])}return t.concat(r,As(r,[],n))}function js(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ms(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function Ns(e){return e?.ownerDocument||document}function Ps(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Fs(e){v.useEffect(e,is)}var Is=null;globalThis.requestAnimationFrame;var Ls=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,--this.callbacksCount)}},Rs=class e{static create(){return new e}static request(e){return Ls.request(e)}static cancel(e){return Ls.cancel(e)}currentId=Is;request(e){this.cancel(),this.currentId=Ls.request(()=>{this.currentId=Is,e()})}cancel=()=>{this.currentId!==Is&&(Ls.cancel(this.currentId),this.currentId=Is)};disposeEffect=()=>this.cancel};function zs(){let e=yo(Rs.create).current;return Fs(e.disposeEffect),e}var Bs=0,Vs=class e{static create(){return new e}currentId=Bs;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Bs,t()},e)}isStarted(){return this.currentId!==Bs}clear=()=>{this.currentId!==Bs&&(clearTimeout(this.currentId),this.currentId=Bs)};disposeEffect=()=>this.clear};function Hs(){let e=yo(Vs.create).current;return Fs(e.disposeEffect),e}function Us(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:Ws,platform:Gs,maxTouchPoints:Ks}=Us(),qs=Ws.toLowerCase(),Js=Gs.toLowerCase(),Ys=/^i(os$|p)/.test(Js)||Js===`macintel`&&Ks>1,Xs=`android`,Zs=Js===Xs||qs.includes(Xs),Qs=!Ys&&Js.startsWith(`mac`);Js.startsWith(`win`),!Zs&&/^(linux|chrome os)/.test(Js);var $s=Qs||Ys,ec=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!ec&&qs.includes(`firefox`),!ec&&qs.includes(`chrom`);var tc=$s,nc=/jsdom|happydom/.test(qs);function rc(e){e.preventDefault(),e.stopPropagation()}function ic(e){return`nativeEvent`in e}function ac(e){return e.pointerType===``&&e.isTrusted?!0:Zs&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function oc(e){return nc?!1:!Zs&&e.width===0&&e.height===0||Zs&&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 sc(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function cc(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var lc=`data-base-ui-focusable`,uc=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,dc=`ArrowLeft`,fc=`ArrowRight`,pc=`ArrowUp`,mc=`ArrowDown`;function hc(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function gc(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&ms(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function _c(e){return`composedPath`in e?e.composedPath()[0]:e.target}function vc(e,t){if(!fs(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(`data-trigger-disabled`);for(let[,e]of t.entries())if(gc(e,n))return!e.hasAttribute(`data-trigger-disabled`);return!1}function yc(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function bc(e){return e.matches(`html,body`)}function xc(e){return ps(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function Sc(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${uc}`)!=null}function Cc(e){return e?e.getAttribute(`role`)===`combobox`&&xc(e):!1}function wc(e){if(!e||nc)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function Tc(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function Ec(e,t){return t!=null&&!sc(t)?0:typeof e==`function`?e():e}function Dc(e,t,n){let r=Ec(e,n);return typeof r==`number`?r:r?.[t]}function Oc(e){return typeof e==`function`?e():e}function kc(e,t){return t||e===`click`||e===`mousedown`}function Ac(e){return e?.includes(`mouse`)&&e!==`mousedown`}var jc=`none`,Mc=`trigger-press`,Nc=`trigger-hover`,Pc=`trigger-focus`,Fc=`outside-press`,Ic=`item-press`,Lc=`close-press`,Rc=`focus-out`,zc=`escape-key`,Bc=`list-navigation`,Vc=`cancel-open`,Hc=`sibling-open`,Uc=`disabled`,Wc=`imperative-action`,Gc=`window-resize`;function Kc(e,t,n,r){let i=!1,a=!1,o=r??as;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}var qc=v.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Vs,currentIdRef:{current:null},currentContextRef:{current:null}});function Jc(e,t){e.current=t.current}function Yc(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=v.useRef(n),a=v.useRef(n),o=v.useRef(null),s=v.useRef(null),c=Hs();return Ao(()=>{if(a.current=n,!o.current){i.current=n;return}i.current={open:Dc(i.current,`open`),close:Dc(n,`close`)}},[n,o,i,a]),(0,U.jsx)(qc.Provider,{value:v.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function Xc(e,t={open:!1}){let{open:n}=t,r=`rootStore`in e?e.rootStore:e,i=r.useState(`floatingId`),{currentIdRef:a,delayRef:o,timeoutMs:s,initialDelayRef:c,currentContextRef:l,hasProvider:u,timeout:d}=v.useContext(qc),[f,p]=v.useState(!1),m=v.useRef(n);return Ao(()=>{m.current=n},[n]),Ao(()=>{function e(){l.current?.setIsInstantPhase(!1),a.current=null,l.current=null,o.current=c.current,d.clear()}if(a.current&&!n&&a.current===i){if(p(!1),s){let t=i;return d.start(s,()=>{r.select(`open`)||a.current&&a.current!==t||e()}),()=>{(m.current||a.current!==t)&&d.clear()}}e()}},[n,i,a,o,s,c,l,d,r]),Ao(()=>{if(!n)return;let e=l.current,t=a.current;d.clear(),l.current={onOpenChange:r.setOpen,setIsInstantPhase:p},a.current=i,o.current={open:0,close:Dc(c.current,`close`)},t!==null&&t!==i?(p(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,Kc(jc))):(p(!1),e?.setIsInstantPhase(!1))},[n,i,r,a,o,c,l,d]),Ao(()=>()=>{if(a.current===i){if(l.current=null,!m.current)return;a.current=null,Jc(o,c),d.clear()}},[l,a,o,i,c,d]),v.useMemo(()=>({hasProvider:u,delayRef:o,isInstantPhase:f}),[u,o,f])}var Zc=v.forwardRef(function(e,t){let[n,r]=v.useState();Ao(()=>{tc&&ec&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,U.jsx)(`span`,{...e,ref:t,style:go,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})}),Qc=Math.min,$c=Math.max,el=Math.round,tl=Math.floor,nl=e=>({x:e,y:e}),rl={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function il(e,t,n){return $c(e,Qc(t,n))}function al(e,t){return typeof e==`function`?e(t):e}function ol(e){return e.split(`-`)[0]}function sl(e){return e.split(`-`)[1]}function cl(e){return e===`x`?`y`:`x`}function ll(e){return e===`y`?`height`:`width`}function ul(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function dl(e){return cl(ul(e))}function fl(e,t,n){n===void 0&&(n=!1);let r=sl(e),i=dl(e),a=ll(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=xl(o)),[o,xl(o)]}function pl(e){let t=xl(e);return[ml(e),t,ml(t)]}function ml(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var hl=[`left`,`right`],gl=[`right`,`left`],_l=[`top`,`bottom`],vl=[`bottom`,`top`];function yl(e,t,n){switch(e){case`top`:case`bottom`:return n?t?gl:hl:t?hl:gl;case`left`:case`right`:return t?_l:vl;default:return[]}}function bl(e,t,n,r){let i=sl(e),a=yl(ol(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(ml)))),a}function xl(e){let t=ol(e);return rl[t]+e.slice(t.length)}function Sl(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Cl(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Sl(e)}function wl(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Tl(e,t){return t<0||t>=e.length}function El(e,t){return Ol(e.current,{disabledIndices:t})}function Dl(e,t){return Ol(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Ol(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&kl(e,a,r));return a}function kl(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!jl(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function Al(e){return e.visibility===`hidden`||e.visibility===`collapse`}function jl(e,t=e?Es(e):null){return!e||!e.isConnected||!t||Al(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var Ml=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function Nl(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return ms(n)?n.host:null}function Pl(e){for(let t of Array.from(e.children))if(cs(t)===`summary`)return t;return null}function Fl(e,t){let n=Pl(t);return!!n&&(e===n||gc(n,e))}function Il(e){let t=e?cs(e):``;return e!=null&&e.matches(Ml)&&(t!==`summary`||e.parentElement!=null&&cs(e.parentElement)===`details`&&Pl(e.parentElement)===e)&&(t!==`details`||Pl(e)==null)&&(t!==`input`||e.type!==`hidden`)}function Ll(e){if(!Il(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=Nl(t)){let n=t!==e,r=cs(t)===`slot`;if(t.hasAttribute(`inert`)||n&&cs(t)===`details`&&!t.open&&!Fl(e,t)||t.hasAttribute(`hidden`)||!r&&!Rl(t,n))return!1}return!0}function Rl(e,t){let n=Es(e);return t?n.display!==`none`:jl(e,n)}function zl(e){let t=e.tabIndex;if(t<0){let t=cs(e);if(t===`details`||t===`audio`||t===`video`||ps(e)&&e.isContentEditable)return 0}return t}function Bl(e){if(cs(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function Vl(e,t){let n=Bl(e);if(!n)return!0;let r=t.find(e=>{let t=Bl(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=Bl(e);return t?.name===n.name&&t.form===n.form})===n}function Hl(e){if(ps(e)&&cs(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return ps(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function Ul(e,t){Hl(e).forEach(e=>{Il(e)&&t.push(e),Ul(e,t)})}function Wl(e,t,n){Hl(e).forEach(e=>{ps(e)&&e.matches(t)&&n.push(e),Wl(e,t,n)})}function Gl(e){return Ll(e)&&zl(e)>=0}function Kl(e){let t=[];return Ul(e,t),t.filter(Ll)}function ql(e){let t=Kl(e);return t.filter(e=>zl(e)>=0&&Vl(e,t))}function Jl(e,t){let n=ql(e),r=n.length;if(r===0)return;let i=hc(Ns(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function Yl(e){return Jl(Ns(e).body,1)||e}function Xl(e){return Jl(Ns(e).body,-1)||e}function Zl(e,t){if(!e)return null;let n=ql(Ns(e).body),r=n.length;if(r===0)return null;let i=n.indexOf(e);return i===-1?null:n[(i+t+r)%r]}function Ql(e){return Zl(e,1)}function $l(e){return Zl(e,-1)}function eu(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!gc(n,r)}function tu(e){ql(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function nu(e){let t=[];Wl(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function ru(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...ru(e,t.id,n)])}function iu(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function au(e){return`data-base-ui-${e}`}var ou=0;function su(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(ou);function a(){i&&!i()||e?.focus({preventScroll:n})}if(r)return a(),rs;let o=requestAnimationFrame(a);return ou=o,()=>{ou===o&&(cancelAnimationFrame(o),ou=0)}}var cu={inert:new WeakMap,"aria-hidden":new WeakMap},lu=`data-base-ui-inert`,uu={inert:new WeakSet,"aria-hidden":new WeakSet},du=new WeakMap,fu=0;function pu(e){return uu[e]}function mu(e){return e?ms(e)?e.host:mu(e.parentNode):null}var hu=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=mu(t);return e.contains(n)?n:null}).filter(e=>e!=null),gu=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},_u=(e,t,n)=>{let r=[],i=e=>{!e||n.has(e)||Array.from(e.children).forEach(e=>{cs(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function vu(e,t,n,r,{mark:i=!0}){let a=null;r?a=`inert`:n&&(a=`aria-hidden`);let o=null,s=null,c=hu(t,e),l=i?_u(t,gu(c),new Set(c)):[],u=[],d=[];if(a){let e=cu[a],n=pu(a);s=n,o=e;let r=hu(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=c.concat(r);_u(t,gu(i),new Set(i)).forEach(t=>{let r=t.getAttribute(a),i=r!==null&&r!==`false`,o=(e.get(t)||0)+1;e.set(t,o),u.push(t),o===1&&i&&n.add(t),i||t.setAttribute(a,a===`inert`?``:`true`)})}return i&&l.forEach(e=>{let t=(du.get(e)||0)+1;du.set(e,t),d.push(e),t===1&&e.setAttribute(lu,``)}),fu+=1,()=>{o&&u.forEach(e=>{let t=(o.get(e)||0)-1;o.set(e,t),t||(!s?.has(e)&&a&&e.removeAttribute(a),s?.delete(e))}),i&&d.forEach(e=>{let t=(du.get(e)||0)-1;du.set(e,t),t||e.removeAttribute(lu)}),--fu,fu||(cu.inert=new WeakMap,cu[`aria-hidden`]=new WeakMap,uu.inert=new WeakSet,uu[`aria-hidden`]=new WeakSet,du=new WeakMap)}}function yu(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0}=t,a=Ns(e[0]).body;return vu(e,a,n,r,{mark:i})}var bu=0;function xu(e,t=`mui`){let[n,r]=v.useState(e),i=e||n;return v.useEffect(()=>{n??(bu+=1,r(`${t}-${bu}`))},[n,t]),i}var Su=jo.useId;function Cu(e,t){if(Su!==void 0){let n=Su();return e??(t?`${t}-${n}`:n)}return xu(e,t)}function wu(e){if(!v.isValidElement(e))return null;let t=e,n=t.props;return(Ho(19)?n?.ref:t.ref)??null}function Tu(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function Eu(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e);continue}i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function Du(e,t){return typeof e==`function`?e(t):e}function Ou(e,t){return typeof e==`function`?e(t):e}var ku={};function Au(e,t,n,r,i){if(!n&&!r&&!i&&!e)return Mu(t);let a=Mu(e);return t&&(a=Nu(a,t)),n&&(a=Nu(a,n)),r&&(a=Nu(a,r)),i&&(a=Nu(a,i)),a}function ju(e){if(e.length===0)return ku;if(e.length===1)return Mu(e[0]);let t=Mu(e[0]);for(let n=1;n<e.length;n+=1)t=Nu(t,e[n]);return t}function Mu(e){return Lu(e)?{...Ru(e,ku)}:Pu(e)}function Nu(e,t){return Lu(t)?Ru(t,e):Fu(e,t)}function Pu(e){let t={...e};for(let e in t){let n=t[e];Iu(e,n)&&(t[e]=Bu(n))}return t}function Fu(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=Tu(e.style,r);break;case`className`:e[n]=Hu(e.className,r);break;default:e[n]=Iu(n,r)?zu(e[n],r):r}}return e}function Iu(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function Lu(e){return typeof e==`function`}function Ru(e,t){return Lu(e)?e(t):e??ku}function zu(e,t){return t?e?(...n)=>{let r=n[0];if(Uu(r)){let i=r;Vu(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:Bu(t):e}function Bu(e){return e&&((...t)=>{let n=t[0];return Uu(n)&&Vu(n),e(...t)})}function Vu(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Hu(e,t){return t?e?t+` `+e:t:e}function Uu(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function Wu(e,t,n={}){let r=t.render,i=Gu(t,n);return n.enabled===!1?null:Ju(e,r,i,n.state??as)}function Gu(e,t={}){let{className:n,style:r,render:i}=e,{state:a=as,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?Du(n,a):void 0,d=l?Ou(r,a):void 0,f=l?Eu(a,c):as,p=l&&s?Ku(s):void 0,m=l?Tu(f,p)??{}:as;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?xo([m.ref,wu(i),...o]):bo(m.ref,wu(i),o):bo(null,null)),l?(u!==void 0&&(m.className=Hu(m.className,u)),d!==void 0&&(m.style=Tu(m.style,d)),m):as}function Ku(e){return Array.isArray(e)?ju(e):Au(void 0,e)}var qu=Symbol.for(`react.lazy`);function Ju(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=Au(n,t.props);e.ref=n.ref;let i=t;return i?.$$typeof===qu&&(i=v.Children.toArray(t)[0]),v.cloneElement(i,e)}if(e&&typeof e==`string`)return Yu(e,n);throw Error(Bo(8))}function Yu(e,t){return e===`button`?(0,v.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,v.createElement)(`img`,{alt:``,...t,key:t.key}):v.createElement(e,t)}var Xu={style:{transition:`none`}},Zu=`data-base-ui-click-trigger`,Qu={fallbackAxisSide:`none`},$u={fallbackAxisSide:`end`},ed={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},td=l(h(),1),nd=v.createContext(null),rd=()=>v.useContext(nd),id=au(`portal`);function ad(e={}){let{ref:t,container:n,componentProps:r=as,elementProps:i}=e,a=Cu(),o=rd()?.portalNode,[s,c]=v.useState(null),[l,u]=v.useState(null),d=Po(e=>{e!==null&&u(e)}),f=v.useRef(null);Ao(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(ds(n)?n:n.current))??o??document.body;if(e==null){f.current&&(f.current=null,u(null),c(null));return}f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let p=Wu(`div`,r,{ref:[t,d],props:[{id:a,[id]:``},i]}),m=s&&p?td.createPortal(p,s):null;return{node:l,nodeId:v.isValidElement(p)?p.props.id:void 0,subtree:m}}var od=v.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,...s}=e,{node:c,nodeId:l,subtree:u}=ad({container:o,ref:t,componentProps:e,elementProps:s}),d=v.useRef(null),f=v.useRef(null),p=v.useRef(null),m=v.useRef(null),[h,g]=v.useState(null),_=v.useRef(!1),y=h?.modal,b=h?.open,x=!!h&&!h.modal&&h.open&&!!c;v.useEffect(()=>{if(!c||y)return;function e(e){c&&e.relatedTarget&&eu(e)&&(e.type===`focusin`?_.current&&=(nu(c),!1):(tu(c),_.current=!0))}return Ms(Ps(c,`focusin`,e,!0),Ps(c,`focusout`,e,!0))},[c,y]),Ao(()=>{!c||b!==!0||!_.current||(nu(c),_.current=!1)},[b,c]);let S=v.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:f,beforeInsideRef:p,afterInsideRef:m,portalNode:c,setFocusManagerState:g}),[c]);return(0,U.jsxs)(v.Fragment,{children:[u,(0,U.jsxs)(nd.Provider,{value:S,children:[x&&c&&(0,U.jsx)(Zc,{"data-type":`outside`,ref:d,onFocus:e=>{eu(e,c)?p.current?.focus():Xl(h?h.domReference:null)?.focus()}}),x&&c&&(0,U.jsx)(`span`,{"aria-owns":l,style:ed}),c&&td.createPortal(a,c),x&&c&&(0,U.jsx)(Zc,{"data-type":`outside`,ref:f,onFocus:e=>{eu(e,c)?m.current?.focus():(Yl(h?h.domReference:null)?.focus(),h?.closeOnFocusOut&&h?.onOpenChange(!1,Kc(`focus-out`,e.nativeEvent)))}})]})]})});function sd(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var cd=class{nodesRef={current:[]};events=sd();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},ld=v.createContext(null),ud=v.createContext(null),dd=()=>v.useContext(ld)?.id||null,fd=e=>{let t=v.useContext(ud);return e??t};function pd(e){let t=Cu(),n=fd(e),r=dd();return Ao(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function md(e){let{children:t,id:n}=e,r=dd();return(0,U.jsx)(ld.Provider,{value:v.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function hd(e){let{children:t,externalTree:n}=e,r=yo(()=>n??new cd).current;return(0,U.jsx)(ud.Provider,{value:r,children:t})}function gd(e){return e==null?e:`current`in e?e.current:e}function _d(e,t){let n=ls(_c(e));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`):``}var vd=20,yd=[];function bd(){yd=yd.filter(e=>e.deref()?.isConnected)}function xd(e){bd(),e&&cs(e)!==`body`&&(yd.push(new WeakRef(e)),yd.length>vd&&(yd=yd.slice(-20)))}function Sd(){return bd(),yd[yd.length-1]?.deref()}function Cd(e){return e?Gl(e)?e:ql(e)[0]||e:null}function wd(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=Kl(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return Gl(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function Td(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,restoreFocus:o=!1,modal:s=!0,closeOnFocusOut:c=!0,openInteractionType:l=``,nextFocusableElement:u,previousFocusableElement:d,beforeContentFocusGuardRef:f,externalTree:p,getInsideElements:m}=e,h=`rootStore`in t?t.rootStore:t,g=h.useState(`open`),_=h.useState(`domReferenceElement`),y=h.useState(`floatingElement`),{events:b,dataRef:x}=h.context,S=Po(()=>x.current.floatingContext?.nodeId),C=i===!1,w=Cc(_)&&C,T=Lo(i),E=Lo(a),D=Lo(l),O=Lo(g),k=fd(p),A=rd(),j=v.useRef(!1),M=v.useRef(!1),N=v.useRef(!1),P=v.useRef(null),F=v.useRef(``),I=v.useRef(``),L=v.useRef(null),ee=v.useRef(null),R=bo(L,f,A?.beforeInsideRef),te=bo(ee,A?.afterInsideRef),z=Hs(),B=Hs(),V=zs(),ne=A!=null,H=Tc(y),re=Po((e=H)=>e?ql(e):[]),ie=Po(()=>m?.().filter(e=>e!=null)??[]);v.useEffect(()=>{if(r||!s)return;function e(e){e.key===`Tab`&&gc(H,hc(Ns(H)))&&re().length===0&&!w&&rc(e)}return Ps(Ns(H),`keydown`,e)},[r,H,s,w,re]),v.useEffect(()=>{if(r||!g)return;let e=Ns(H);function t(){N.current=!1}function n(e){let t=_c(e),n=ie(),r=gc(y,t)||gc(_,t)||gc(A?.portalNode,t)||n.some(e=>e===t||gc(e,t));N.current=!r,I.current=e.pointerType||`keyboard`,t?.closest(`[data-base-ui-click-trigger]`)&&(M.current=!0,B.start(0,()=>{M.current=!1}))}function i(){I.current=`keyboard`}return Ms(Ps(e,`pointerdown`,n,!0),Ps(e,`pointerup`,t,!0),Ps(e,`pointercancel`,t,!0),Ps(e,`keydown`,i,!0),t)},[r,y,_,H,g,A,B,ie]),v.useEffect(()=>{if(r||!c)return;let e=Ns(H);function t(){M.current=!0,B.start(0,()=>{M.current=!1})}function n(e){let t=_c(e);Gl(t)&&(P.current=t)}function i(t){let n=t.relatedTarget,r=t.currentTarget,i=_c(t);s&&n==null&&i!=null&&gc(y,i)&&xd(i),queueMicrotask(()=>{let a=S(),c=h.context.triggerElements,l=ie(),f=n?.hasAttribute(au(`focus-guard`))&&[L.current,ee.current,A?.beforeInsideRef.current,A?.afterInsideRef.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,gd(d),gd(u)].includes(n),p=!(gc(_,n)||gc(y,n)||gc(n,y)||gc(A?.portalNode,n)||l.some(e=>e===n||gc(e,n))||c.hasMatchingElement(e=>gc(e,n))||f||k&&(ru(k.nodesRef.current,a).find(e=>gc(e.context?.elements.floating,n)||gc(e.context?.elements.domReference,n))||iu(k.nodesRef.current,a).find(e=>[e.context?.elements.floating,Tc(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===_&&H&&wd(H),o&&r!==_&&!jl(i)&&hc(e)===e.body){if(ps(H)&&(H.focus(),o===`popup`)){V.request(()=>{H.focus()});return}let e=re(),t=P.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||H;ps(n)&&n.focus()}if(x.current.insideReactTree){x.current.insideReactTree=!1;return}(w||!s)&&n&&p&&!M.current&&(w||n!==Sd())&&(j.current=!0,h.setOpen(!1,Kc(Rc,t)))})}function a(){N.current||(x.current.insideReactTree=!0,z.start(0,()=>{x.current.insideReactTree=!1}))}let l=ps(_)?_:null;if(!(!y&&!l))return Ms(l&&Ps(l,`focusout`,i),l&&Ps(l,`pointerdown`,t),y&&Ps(y,`focusin`,n),y&&Ps(y,`focusout`,i),y&&A&&Ps(y,`focusout`,a,!0))},[r,_,y,H,s,k,A,h,c,o,re,w,S,x,z,B,V,u,d,ie]),v.useEffect(()=>{if(r||!y||!g)return;let e=Array.from(A?.portalNode?.querySelectorAll(`[${au(`portal`)}]`)||[]),t=(k?iu(k.nodesRef.current,S()):[]).find(e=>Cc(e.context?.elements.domReference||null))?.context?.elements.domReference,n=yu([y,...e,L.current,ee.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,...ie(),t,gd(d),gd(u),w?_:null].filter(e=>e!=null),{ariaHidden:s||w,mark:!1}),i=yu([y,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,_,y,s,A,w,k,S,u,d,ie]),Ao(()=>{if(!g||r||!ps(H))return;F.current=``,I.current=``;let e=Ns(H),t=hc(e);queueMicrotask(()=>{let n=T.current,r=typeof n==`function`?n(D.current||``):n;if(r===void 0||r===!1||gc(H,t))return;let i=null,a=()=>(i??=re(H),i[0]||H),o;o=r===!0||r===null?a():gd(r),o||=a();let s=gc(H,hc(e));su(o,{preventScroll:o===H,shouldFocus(){if(!O.current)return!1;if(s)return!0;let t=hc(e);return!(t!==o&&gc(H,t))}})})},[r,g,H,re,T,D,O]),Ao(()=>{if(r||!H)return;let e=Ns(H),t=hc(e),n=D.current==null;xd(t);function i(e){if(e.open||(F.current=_d(e.nativeEvent,I.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(j.current=!0),e.reason===`outside-press`){if(e.nested)j.current=!1;else if(ac(e.nativeEvent)||oc(e.nativeEvent))j.current=!1;else{let e=!1;Ns(H).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?j.current=!1:j.current=!0}}}b.on(`openchange`,i);function a(e){let r=E.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=_?.isConnected?_:null,o=t?.isConnected&&cs(t)!==`body`?t:null,s=n?o||a:a||o;return s||=Sd()||null,typeof i==`boolean`?s:gd(i)||s||null}return()=>{b.off(`openchange`,i);let t=hc(e),n=ie(),r=gc(y,t)||n.some(e=>e===t||gc(e,t))||k&&ru(k.nodesRef.current,S(),!1).some(e=>gc(e.context?.elements.floating,t)),o=E.current,s=F.current,c=a(s);queueMicrotask(()=>{let n=Cd(c),i=typeof o!=`boolean`;if(o&&!j.current&&ps(n)&&(!(!i&&n!==t&&t!==e.body)||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}j.current=!1})}},[r,y,H,E,D,b,k,_,S,ie]),Ao(()=>{if(!ec||g||!y)return;let e=hc(Ns(y));!ps(e)||!xc(e)||gc(y,e)&&e.blur()},[g,y]),Ao(()=>{if(!(r||!A))return A.setFocusManagerState({modal:s,closeOnFocusOut:c,open:g,onOpenChange:h.setOpen,domReference:_}),()=>{A.setFocusManagerState(null)}},[r,A,s,g,h,c,_]),Ao(()=>{if(!(r||!H))return wd(H),()=>{queueMicrotask(bd)}},[r,H]);let ae=!r&&(!s||!w)&&(ne||s);return(0,U.jsxs)(v.Fragment,{children:[ae&&(0,U.jsx)(Zc,{"data-type":`inside`,ref:R,onFocus:e=>{if(s){let e=re();su(e[e.length-1])}else A?.portalNode&&(j.current=!1,eu(e,A.portalNode)?Yl(_)?.focus():gd(d??A.beforeOutsideRef)?.focus())}}),n,ae&&(0,U.jsx)(Zc,{"data-type":`inside`,ref:te,onFocus:e=>{s?su(re()[0]):A?.portalNode&&(c&&(j.current=!0),eu(e,A.portalNode)?Xl(_)?.focus():gd(u??A.afterOutsideRef)?.focus())}})]})}function Ed(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=Mc}=t,l=`rootStore`in e?e.rootStore:e,u=l.context.dataRef,d=v.useRef(void 0),f=zs(),p=Hs(),m=v.useMemo(()=>{function e(e,t,n,r){let i=Kc(c,t,n);e&&r===`touch`&&s>0?p.start(s,()=>{l.setOpen(!0,i)}):l.setOpen(e,i)}function t(e,t,n){let r=u.current.openEvent,a=l.select(`domReferenceElement`)!==t;return e&&a||!e||!i?!0:r&&o?!n(r.type):!1}return{onPointerDown(e){d.current=sc(e.pointerType,!0)&&oc(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(n){let i=d.current,o=n.nativeEvent,s=l.select(`open`);if(n.button!==0||r===`click`||sc(i,!0)&&a)return;let c=t(s,n.currentTarget,e=>e===`click`||e===`mousedown`),u=_c(o);if(xc(u)){e(c,o,u,i);return}let p=n.currentTarget;f.request(()=>{e(c,o,p,i)})},onClick(n){if(r===`mousedown-only`)return;let i=d.current;if(r===`mousedown`&&i){d.current=void 0;return}sc(i,!0)&&a||e(t(l.select(`open`),n.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),n.nativeEvent,n.currentTarget,i)},onKeyDown(){d.current=void 0}}},[u,r,a,c,l,o,i,f,p,s]);return v.useMemo(()=>n?{reference:m}:as,[n,m])}function Dd(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=a.width,u=a.height,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,l=0,u=0,!i||c?(l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f):i&&!c&&(u=t.axis===`x`?a.height:u,l=t.axis===`y`?a.width:l),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function Od(e){return e!=null&&e.clientX!=null}function kd(e,t={}){let{enabled:n=!0,axis:r=`both`}=t,i=`rootStore`in e?e.rootStore:e,a=i.useState(`open`),o=i.useState(`floatingElement`),s=i.useState(`domReferenceElement`),c=i.context.dataRef,l=v.useRef(!1),u=v.useRef(null),[d,f]=v.useState(),[p,m]=v.useState([]),h=Po(e=>{i.set(`positionReference`,e)}),g=Po((e,t,n)=>{l.current||c.current.openEvent&&!Od(c.current.openEvent)||i.set(`positionReference`,Dd(n??s,{x:e,y:t,axis:r,dataRef:c,pointerType:d}))}),_=Po(e=>{a?u.current||(g(e.clientX,e.clientY,e.currentTarget),m([])):g(e.clientX,e.clientY,e.currentTarget)}),y=sc(d)?o:a;v.useEffect(()=>{if(!n){h(s);return}if(!y)return;function e(){u.current?.(),u.current=null}let t=ls(o);function r(t){let n=_c(t);gc(o,n)?e():g(t.clientX,t.clientY)}return!c.current.openEvent||Od(c.current.openEvent)?u.current=Ps(t,`mousemove`,r):h(s),e},[y,n,o,c,s,i,g,h,p]),v.useEffect(()=>()=>{i.set(`positionReference`,null)},[i]),v.useEffect(()=>{n&&!o&&(l.current=!1)},[n,o]),v.useEffect(()=>{!n&&a&&(l.current=!0)},[n,a]);let b=v.useMemo(()=>{function e(e){f(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:_,onMouseEnter:_}},[_]);return v.useMemo(()=>n?{reference:b,trigger:b}:{},[n,b])}function Ad(){return!1}function jd(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function Md(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=Ad,bubbles:s,externalTree:c}=t,l=`rootStore`in e?e.rootStore:e,u=l.useState(`open`),d=l.useState(`floatingElement`),{dataRef:f}=l.context,p=fd(c),m=Po(typeof i==`function`?i:()=>!1),h=typeof i==`function`?m:i,g=h!==!1,_=Po(()=>a),{escapeKey:y,outsidePress:b}=jd(s),x=v.useRef(!1),S=v.useRef(!1),C=v.useRef(!1),w=v.useRef(!1),T=v.useRef(``),E=v.useRef(null),D=Hs(),O=Hs(),k=Po(()=>{O.clear(),f.current.insideReactTree=!1}),A=Po(e=>{let t=f.current.floatingContext?.nodeId;return(p?ru(p.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),j=Po(e=>yc(e,l.select(`floatingElement`))||yc(e,l.select(`domReferenceElement`))),M=Po(e=>{o()&&l.setOpen(!1,Kc(Mc,e.nativeEvent))}),N=Po(e=>{if(!u||!n||!r||e.key!==`Escape`||w.current||!y&&A(`__escapeKeyBubbles`))return;let t=Kc(zc,ic(e)?e.nativeEvent:e);l.setOpen(!1,t),t.isCanceled||e.preventDefault(),!y&&!t.isPropagationAllowed&&e.stopPropagation()}),P=Po(()=>{f.current.insideReactTree=!0,O.start(0,k)}),F=Po(e=>{if(!u||!n||e.button!==0)return;let t=_c(e.nativeEvent);gc(l.select(`floatingElement`),t)&&(x.current||(x.current=!0,S.current=!1))}),I=Po(e=>{!u||!n||(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&x.current&&(S.current=!0)});v.useEffect(()=>{if(!u||!n)return k;f.current.__escapeKeyBubbles=y,f.current.__outsidePressBubbles=b;let e=new Vs,t=new Vs;function i(){e.clear(),w.current=!0}function a(){e.start(ec?5:0,()=>{w.current=!1})}function o(){C.current=!0,t.start(0,()=>{C.current=!1})}function s(){x.current=!1,S.current=!1}function c(){let e=T.current,t=e===`pen`||!e?`mouse`:e,n=_(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function m(e){let t=c();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function v(e){let t=f.current.floatingContext?.nodeId,n=p&&ru(p.nodesRef.current,t).some(t=>yc(e,t.context?.elements.floating));return j(e)||n}function O(e){if(m(e)){e.type!==`click`&&!j(e)&&(t.clear(),C.current=!1),k();return}if(f.current.insideReactTree){k();return}let n=_c(e),r=`[${au(`inert`)}]`,i=fs(n)?n.getRootNode():null,a=Array.from((ms(i)?i:Ns(l.select(`floatingElement`))).querySelectorAll(r)),o=l.context.triggerElements;if(n&&(o.hasElement(n)||o.hasMatchingElement(e=>gc(e,n))))return;let s=fs(n)?n:null;for(;s&&!Ts(s);){let e=Os(s);if(Ts(e)||!fs(e))break;s=e}if(!(a.length&&fs(n)&&!bc(n)&&!gc(n,l.select(`floatingElement`))&&a.every(e=>!gc(s,e)))){if(ps(n)&&!(`touches`in e)){let t=Ts(n),r=Es(n),i=/auto|scroll/,a=t||i.test(r.overflowX),o=t||i.test(r.overflowY),s=a&&n.clientWidth>0&&n.scrollWidth>n.clientWidth,c=o&&n.clientHeight>0&&n.scrollHeight>n.clientHeight,l=r.direction===`rtl`,u=c&&(l?e.offsetX<=n.offsetWidth-n.clientWidth:e.offsetX>n.clientWidth),d=s&&e.offsetY>n.clientHeight;if(u||d)return}if(!v(e)){if(c()===`intentional`&&C.current){t.clear(),C.current=!1;return}typeof h==`function`&&!h(e)||A(`__outsidePressBubbles`)||(l.setOpen(!1,Kc(Fc,e)),k())}}}function M(e){c()!==`sloppy`||e.pointerType===`touch`||!l.select(`open`)||!n||j(e)||O(e)}function P(e){if(c()!==`sloppy`||!l.select(`open`)||!n||j(e))return;let t=e.touches[0];t&&(E.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},D.start(1e3,()=>{E.current&&(E.current.dismissOnTouchEnd=!1,E.current.dismissOnMouseDown=!1)}))}function F(e,t){let n=_c(e);if(!n)return;let r=Ps(n,e.type,()=>{t(e),r()})}function I(e){T.current=`touch`,F(e,P)}function L(e){D.clear(),e.type===`pointerdown`&&(T.current=e.pointerType),!(e.type===`mousedown`&&E.current&&!E.current.dismissOnMouseDown)&&F(e,e=>{e.type===`pointerdown`?M(e):O(e)})}function ee(e){if(!x.current)return;let n=S.current;if(s(),c()===`intentional`){if(e.type===`pointercancel`){n&&o();return}if(!v(e)){if(n){o();return}typeof h==`function`&&!h(e)||(t.clear(),C.current=!0,k())}}}function R(e){if(c()!==`sloppy`||!E.current||j(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-E.current.startX),r=Math.abs(t.clientY-E.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(E.current.dismissOnTouchEnd=!0),i>10&&(O(e),D.clear(),E.current=null)}function te(e){F(e,R)}function z(e){c()!==`sloppy`||!E.current||j(e)||(E.current.dismissOnTouchEnd&&O(e),D.clear(),E.current=null)}function B(e){F(e,z)}let V=Ns(d),ne=Ms(r&&Ms(Ps(V,`keydown`,N),Ps(V,`compositionstart`,i),Ps(V,`compositionend`,a)),g&&Ms(Ps(V,`click`,L,!0),Ps(V,`pointerdown`,L,!0),Ps(V,`pointerup`,ee,!0),Ps(V,`pointercancel`,ee,!0),Ps(V,`mousedown`,L,!0),Ps(V,`mouseup`,ee,!0),Ps(V,`touchstart`,I,!0),Ps(V,`touchmove`,te,!0),Ps(V,`touchend`,B,!0)));return()=>{ne(),e.clear(),t.clear(),s(),C.current=!1,k()}},[f,d,r,g,h,u,n,y,b,N,k,_,A,j,p,l,D]);let L=v.useMemo(()=>({onKeyDown:N,onPointerDown:M,onClick:M}),[N,M]),ee=v.useMemo(()=>({onKeyDown:N,onPointerDown:I,onMouseDown:I,onClickCapture:P,onMouseDownCapture(e){P(),F(e)},onPointerDownCapture(e){P(),F(e)},onMouseUpCapture:P,onTouchEndCapture:P,onTouchMoveCapture:P}),[N,P,F,I]);return v.useMemo(()=>n?{reference:L,floating:ee,trigger:L}:{},[n,L,ee])}function Nd(e,t,n){let{reference:r,floating:i}=e,a=ul(t),o=dl(t),s=ll(o),c=ol(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=sl(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Pd(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=al(t,e),p=Cl(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=wl(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=wl(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Fd=50,Id=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Pd},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Nd(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Fd&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Nd(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Ld=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=al(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=ol(r),_=ul(o),v=ol(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[xl(o)]:pl(o)),x=p!==`none`;!d&&x&&b.push(...bl(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=fl(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===ul(t)||T.every(e=>ul(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=ul(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},Rd=new Set([`left`,`top`]);async function zd(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=ol(n),s=sl(n),c=ul(n)===`y`,l=Rd.has(o)?-1:1,u=a&&c?-1:1,d=al(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Bd=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await zd(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Vd=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=al(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=ul(i),p=cl(f),m=u[p],h=u[f],g=(e,t)=>il(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Hd=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=al(e,t),u={x:n,y:r},d=ul(i),f=cl(d),p=u[f],m=u[d],h=al(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Rd.has(ol(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Ud=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=al(e,t),c=await i.detectOverflow(t,s),l=ol(n),u=sl(n),d=ul(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Qc(p-c[m],g),y=Qc(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*$c(c.left,c.right):S=p-2*$c(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Wd(e){let t=Es(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=ps(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=el(n)!==a||el(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Gd(e){return fs(e)?e:e.contextElement}function Kd(e){let t=Gd(e);if(!ps(t))return nl(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Wd(t),o=(a?el(n.width):n.width)/r,s=(a?el(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var qd=nl(0);function Jd(e){let t=ls(e);return!ws()||!t.visualViewport?qd:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Yd(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===ls(e)}function Xd(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Gd(e),o=nl(1);t&&(r?fs(r)&&(o=Kd(r)):o=Kd(e));let s=Yd(a,n,r)?Jd(a):nl(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=ls(a),t=fs(r)?ls(r):r,n=e,i=js(n);for(;i&&t!==n;){let e=Kd(i),t=i.getBoundingClientRect(),r=Es(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=ls(i),i=js(n)}}return wl({width:u,height:d,x:c,y:l})}function Zd(e,t){let n=Ds(e).scrollLeft;return t?t.left+n:Xd(us(e)).left+n}function Qd(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Zd(e,n),y:n.top+t.scrollTop}}function $d(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=us(r),s=t?_s(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=nl(1),u=nl(0),d=ps(r);if((d||!a)&&((cs(r)!==`body`||hs(o))&&(c=Ds(r)),d)){let e=Xd(r);l=Kd(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Qd(o,c):nl(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function ef(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function tf(e){let t=Ds(e),n=e.ownerDocument.body,r=$c(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=$c(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Zd(e),o=-t.scrollTop;return Es(n).direction===`rtl`&&(a+=$c(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var nf=25;function rf(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=ls(e),a=us(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!ws()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Zd(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=nf&&(s-=o)}return{width:s,height:c,x:l,y:u}}function af(e,t){let n=Xd(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Kd(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function of(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=rf(e,n,t);else if(t===`document`)r=tf(us(e));else if(fs(t))r=af(t,n);else{let n=Jd(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return wl(r)}function sf(e,t){let n=t.get(e);if(n)return n;let r=As(e,[],!1).filter(e=>fs(e)&&cs(e)!==`body`),i=null,a=Es(e).position===`fixed`,o=a?Os(e):e;for(;fs(o)&&!Ts(o);){let e=Es(o),t=Ss(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Os(o)}return t.set(e,r),r}function cf(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?_s(t)?[]:sf(t,this._c):[].concat(n),r],o=of(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=of(t,a[e],i);s=$c(n.top,s),c=Qc(n.right,c),l=Qc(n.bottom,l),u=$c(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function lf(e){let{width:t,height:n}=Wd(e);return{width:t,height:n}}function uf(e,t,n){let r=ps(t),i=us(t),a=n===`fixed`,o=Xd(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=nl(0);if((r||!a)&&((cs(t)!==`body`||hs(i))&&(s=Ds(t)),r)){let e=Xd(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Zd(i));let l=i&&!r&&!a?Qd(i,s):nl(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function df(e){return Es(e).position===`static`}function ff(e,t){if(!ps(e)||Es(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return us(e)===n&&(n=n.ownerDocument.body),n}function pf(e,t){let n=ls(e);if(_s(e))return n;if(!ps(e)){let t=Os(e);for(;t&&!Ts(t);){if(fs(t)&&!df(t))return t;t=Os(t)}return n}let r=ff(e,t);for(;r&&gs(r)&&df(r);)r=ff(r,t);return r&&Ts(r)&&df(r)&&!Ss(r)?n:r||Cs(e)||n}var mf=async function(e){let t=this.getOffsetParent||pf,n=this.getDimensions,r=await n(e.floating);return{reference:uf(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function hf(e){return Es(e).direction===`rtl`}var gf={convertOffsetParentRelativeRectToViewportRelativeRect:$d,getDocumentElement:us,getClippingRect:cf,getOffsetParent:pf,getElementRects:mf,getClientRects:ef,getDimensions:lf,getScale:Kd,isElement:fs,isRTL:hf};function _f(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function vf(e,t,n){let r=null,i,a=us(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=tl(d),h=tl(a.clientWidth-(u+f)),g=tl(a.clientHeight-(d+p)),_=tl(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:$c(0,Qc(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!_f(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=ls(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function yf(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Gd(e),u=i||a?[...l?As(l):[],...t?As(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?vf(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Xd(e):null;c&&g();function g(){let t=Xd(e);h&&!_f(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var bf=Bd,xf=Vd,Sf=Ld,Cf=Ud,wf=Hd,Tf=(e,t,n)=>{let r=new Map,i=n??{},a={...gf,...i.platform,_c:r};return Id(e,t,{...i,platform:a})},Ef=typeof document<`u`?v.useLayoutEffect:function(){};function Df(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,i;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(!Df(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Df(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Of(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function kf(e,t){let n=Of(e);return Math.round(t*n)/n}function Af(e){let t=v.useRef(e);return Ef(()=>{t.current=e}),t}function jf(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=v.useState(r);Df(f,r)||p(r);let[m,h]=v.useState(null),[g,_]=v.useState(null),y=v.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=v.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=a||m,S=o||g,C=v.useRef(null),w=v.useRef(null),T=v.useRef(u),E=c!=null,D=Af(c),O=Af(i),k=Af(l),A=v.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),Tf(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!Df(T.current,t)&&(T.current=t,td.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);Ef(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=v.useRef(!1);Ef(()=>(j.current=!0,()=>{j.current=!1}),[]),Ef(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=v.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=v.useMemo(()=>({reference:x,floating:S}),[x,S]),P=v.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=kf(N.floating,u.x),r=kf(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Of(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return v.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var Mf=(e,t)=>{let n=bf(e);return{name:n.name,fn:n.fn,options:[e,t]}},Nf=(e,t)=>{let n=xf(e);return{name:n.name,fn:n.fn,options:[e,t]}},Pf=(e,t)=>({fn:wf(e).fn,options:[e,t]}),Ff=(e,t)=>{let n=Sf(e);return{name:n.name,fn:n.fn,options:[e,t]}},If=(e,t)=>{let n=Cf(e);return{name:n.name,fn:n.fn,options:[e,t]}},Lf={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},Rf=class extends os{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:sd(),nested:n,triggerElements:i},Lf),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&cc(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{if(this.syncOnly){this.context.onOpenChange?.(e,t);return}this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function zf(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=o,f=v.useRef(null);r===void 0&&f.current===null&&(f.current=new Rf({open:s,transitionStatus:void 0,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:d,floatingId:i,syncOnly:!0,nested:a}));let p=r??f.current;return t.useSyncedValue(`floatingId`,i),Ao(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};fs(c)&&(e.domReferenceElement=c),p.state.positionReference===p.state.referenceElement&&(e.positionReference=c),p.update(e)},[s,i,c,l,p]),p.context.onOpenChange=d,p.context.nested=a,p}function Bf(e,t=!1,n=!1){let[r,i]=v.useState(e&&t?`idle`:void 0),[a,o]=v.useState(e);return e&&!a&&(o(!0),i(`starting`)),!e&&a&&r!==`ending`&&!n&&i(`ending`),!e&&!a&&r===`ending`&&i(void 0),Ao(()=>{if(!e&&a&&r!==`ending`&&n){let e=Rs.request(()=>{i(`ending`)});return()=>{Rs.cancel(e)}}},[e,a,r,n]),Ao(()=>{if(!e||t)return;let n=Rs.request(()=>{i(void 0)});return()=>{Rs.cancel(n)}},[t,e]),Ao(()=>{if(!e||!t)return;e&&a&&r!==`idle`&&i(`starting`);let n=Rs.request(()=>{i(`idle`)});return()=>{Rs.cancel(n)}},[t,e,a,r]),{mounted:a,setMounted:o,transitionStatus:r}}function Vf(e,t=!1){let n=zs();return Po((r,i=null)=>{n.cancel();let a=gd(e);if(a==null)return;let o=a,s=()=>{td.flushSync(r)};if(typeof o.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){r();return}function c(){Promise.all(o.getAnimations().map(e=>e.finished)).then(()=>{i?.aborted||s()},()=>{if(!i?.aborted){if(o.getAnimations().some(e=>e.pending||e.playState!==`finished`)){c();return}s()}})}if(t){let e=`data-starting-style`;if(!o.hasAttribute(e)){n.request(c);return}let t=new MutationObserver(()=>{o.hasAttribute(e)||(t.disconnect(),c())});t.observe(o,{attributes:!0,attributeFilter:[e]}),i?.addEventListener(`abort`,()=>t.disconnect(),{once:!0});return}n.request(c)})}function Hf(e){let{enabled:t=!0,open:n,ref:r,onComplete:i}=e,a=Po(i),o=Vf(r,n);v.useEffect(()=>{if(!t)return;let e=new AbortController;return o(a,e.signal),()=>{e.abort()}},[t,n,a,o])}var Uf={tabIndex:-1,[lc]:``};function Wf(e){return t=>t!==`touch`||e.current}function Gf(e,t=!1){let n=Cu(),r=dd()!=null,i=yo(()=>e(n,r)).current;return zf({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function Kf({handle:e,store:t}){return Ao(()=>e.attachStore(t),[e,t]),null}function qf(e,t){let n=v.useRef(null),r=v.useRef(null);return v.useCallback(i=>{if(e===void 0)return;let a=!1;if(n.current!==null){let e=n.current,i=r.current,o=t.context.triggerElements.getById(e);i&&o===i&&(t.context.triggerElements.delete(e),a=!0),n.current=null,r.current=null}if(i!==null&&(n.current=e,r.current=i,t.context.triggerElements.add(e,i),a=!0),a){let e=t.context.triggerElements.size;t.select(`open`)&&t.state.triggerCount!==e&&t.set(`triggerCount`,e)}},[t,e])}function Jf(e,t,n,r=!1){t?e.preventUnmountingOnClose=!1:r&&(e.preventUnmountingOnClose=!0);let i=n?.id??null;(i||t)&&(e.activeTriggerId=i,e.activeTriggerElement=n??null)}function Yf(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Xf(e,t,n,r={}){let i=n.reason,a=i===Nc,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=Yf(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i={...r.extraState,open:t};o?i.instantType=`focus`:s?i.instantType=`dismiss`:a&&(i.instantType=void 0),Jf(i,t,n.trigger,c()),e.update(i)};a?td.flushSync(l):l()}function Zf(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=qf(e,n),o=Po(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){n.update({activeTriggerElement:t,...i?r:null});return}a==null&&i&&n.update({activeTriggerId:e,activeTriggerElement:t,...r})}),s=v.useCallback(e=>{a(e),e&&o(e)},[a,o]);return Ao(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function Qf(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=v.useRef(null),i=e.useState(`open`);Ao(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=Kc(jc);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,e.useState(`triggerCount`),e.useState(`activeTriggerId`),e.useState(`activeTriggerElement`),n])}function $f(e,t,n){let{mounted:r,setMounted:i,transitionStatus:a}=Bf(e),o=t.useState(`preventUnmountingOnClose`),s=!e&&o;t.useSyncedValues({mounted:r,transitionStatus:a,preventUnmountingOnClose:s});let c=Po(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return Hf({enabled:r&&!e&&!s,open:e,ref:t.context.popupRef,onComplete(){e||c()}}),{forceUnmount:c,transitionStatus:a}}function ep(e,t){e.useSyncedValues(t),Ao(()=>()=>{e.update({activeTriggerProps:as,inactiveTriggerProps:as,popupProps:as})},[e])}function tp(e,t){Ao(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),Ao(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var np=class{constructor(){this.idMap=new Map}add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}};function rp(){return new Rf({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new np,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function ip(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:rp(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:as,inactiveTriggerProps:as,popupProps:as}}function ap(e,t,n=!1){return new Rf({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}var op=e=>e.triggerIdProp??e.activeTriggerId,sp=e=>e.openProp??e.open,cp=e=>(e.popupElement?.id??e.floatingId)||void 0;function lp(e,t){return t!==void 0&&sp(e)&&op(e)===t}function up(e,t){return lp(e,t)?!0:t!==void 0&&sp(e)&&op(e)==null&&e.triggerCount===1}var dp={open:sp,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:op,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:cp,isTriggerActive:(e,t)=>t!==void 0&&op(e)===t,isOpenedByTrigger:(e,t)=>lp(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&op(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>up(e,t)?cp(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function fp(e){let t=v.useCallback(t=>e===void 0?rs:e.subscribeStore(t),[e]),n=v.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,Xo.useSyncExternalStore)(t,n,()=>e?.serverStore)}function pp(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=Cu(),a=dd()!=null,o=yo(()=>new Rf({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new np,floatingId:i,syncOnly:!1,nested:a})).current;return Ao(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=fs(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o}function mp(e){return hp(e,e.rootContext)}function hp(e,t){let{nodeId:n,externalTree:r}=e,i=t.useState(`referenceElement`),a=t.useState(`floatingElement`),o=t.useState(`domReferenceElement`),s=t.useState(`open`),c=t.useState(`floatingId`),[l,u]=v.useState(null),[d,f]=v.useState(void 0),[p,m]=v.useState(void 0),h=v.useRef(null),g=fd(r),_=v.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),y=jf({...e,elements:{..._,...l&&{reference:l}}}),b=fs(d)?d:null,x=p===void 0?t.state.floatingElement:p;t.useSyncedValue(`referenceElement`,d??null),t.useSyncedValue(`domReferenceElement`,d===void 0?o:b),t.useSyncedValue(`floatingElement`,x);let S=v.useCallback(e=>{let t=fs(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),y.refs.setReference(t)},[y.refs]),C=v.useCallback(e=>{(fs(e)||e===null)&&(h.current=e,f(e)),(fs(y.refs.reference.current)||y.refs.reference.current===null||e!==null&&!fs(e))&&y.refs.setReference(e)},[y.refs,f]),w=v.useCallback(e=>{m(e),y.refs.setFloating(e)},[y.refs]),T=v.useMemo(()=>({...y.refs,setReference:C,setFloating:w,setPositionReference:S,domReference:h}),[y.refs,C,w,S]),E=v.useMemo(()=>({...y.elements,domReference:o}),[y.elements,o]),D=v.useMemo(()=>({...y,dataRef:t.context.dataRef,open:s,onOpenChange:t.setOpen,events:t.context.events,floatingId:c,refs:T,elements:E,nodeId:n,rootStore:t}),[y,T,E,n,t,s,c]);return Ao(()=>{o&&(h.current=o)},[o]),Ao(()=>{t.context.dataRef.current.floatingContext=D;let e=g?.nodesRef.current.find(e=>e.id===n);e&&(e.context=D)}),v.useMemo(()=>({...y,context:D,refs:T,elements:E,rootStore:t}),[y,T,E,D,t])}var gp=Qs&&ec;function _p(e,t={}){let{enabled:n=!0,delay:r}=t,i=`rootStore`in e?e.rootStore:e,{events:a,dataRef:o}=i.context,s=v.useRef(!1),c=v.useRef(null),l=v.useRef(!0),u=Hs();v.useEffect(()=>{let e=i.select(`domReferenceElement`);if(!n)return;let t=ls(e);function r(){let e=i.select(`domReferenceElement`);!i.select(`open`)&&ps(e)&&e===hc(Ns(e))&&(s.current=!0)}function a(){l.current=!0}function o(){l.current=!1}return Ms(Ps(t,`blur`,r),gp&&Ps(t,`keydown`,a,!0),gp&&Ps(t,`pointerdown`,o,!0))},[i,n]),v.useEffect(()=>{if(!n)return;function e(e){if(e.reason===`trigger-press`||e.reason===`escape-key`){let e=i.select(`domReferenceElement`);fs(e)&&(c.current=e,s.current=!0)}}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[a,n,i]);let d=v.useMemo(()=>{function e(){s.current=!1,c.current=null}return{onMouseLeave(){e()},onFocus(t){let n=t.currentTarget;if(s.current){if(c.current===n)return;e()}let a=_c(t.nativeEvent);if(fs(a)){if(gp&&!t.relatedTarget){if(!l.current&&!xc(a))return}else if(!wc(a))return}let o=vc(t.relatedTarget,i.context.triggerElements),{nativeEvent:d,currentTarget:f}=t,p=typeof r==`function`?r():r;if(i.select(`open`)&&o||p===0||p===void 0){i.setOpen(!0,Kc(Pc,d,f));return}u.start(p,()=>{s.current||i.setOpen(!0,Kc(Pc,d,f))})},onBlur(t){e();let n=t.relatedTarget,r=t.nativeEvent,a=fs(n)&&n.hasAttribute(au(`focus-guard`))&&n.getAttribute(`data-type`)===`outside`;u.start(0,()=>{let e=i.select(`domReferenceElement`),t=hc(Ns(e));!n&&t===e||gc(o.current.floatingContext?.refs.floating.current,t)||gc(e,t)||a||vc(n??t,i.context.triggerElements)||i.setOpen(!1,Kc(Pc,r))})}}},[o,r,i,u]);return v.useMemo(()=>n?{reference:d,trigger:d}:{},[n,d])}var vp=class e{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new Vs,this.restTimeout=new Vs,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},yp=new WeakMap;function bp(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&yp.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),yp.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function xp(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=yp.get(n);a&&a!==e&&bp(a),bp(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,yp.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function Sp(e){let t=e.context.dataRef.current,n=yo(()=>t.hoverInteractionState??vp.create()).current;return t.hoverInteractionState||=n,Fs(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function Cp(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=`rootStore`in e?e.rootStore:e,o=a.useState(`open`),s=a.useState(`floatingElement`),c=a.useState(`domReferenceElement`),{dataRef:l}=a.context,u=fd(),d=dd(),f=Sp(a),p=Hs(),m=Po(()=>kc(l.current.openEvent?.type,f.interactedInside)),h=Po(()=>Ac(l.current.openEvent?.type)),g=Po(()=>{bp(f)});Ao(()=>{o||(f.pointerType=void 0,f.restTimeoutPending=!1,f.interactedInside=!1,g())},[o,f,g]),v.useEffect(()=>g,[g]),Ao(()=>{if(n&&o&&f.handleCloseOptions?.blockPointerEvents&&h()&&fs(c)&&s){let e=c,t=s,n=Ns(s),r=u?.nodesRef.current.find(e=>e.id===d)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=f.pointerEventsScopeElement===t?null:f.pointerEventsScopeElement,a=r===t?null:r,o=f.handleCloseOptions?.getScope?.()??i??a??e.closest(`[data-rootownerid]`)??n.body;return xp(f,{scopeElement:o,referenceElement:e,floatingElement:t}),()=>{g()}}},[n,o,c,s,f,h,u,d,g]),v.useEffect(()=>{if(!n)return;function e(){return!!(u&&d&&ru(u.nodesRef.current,d).length>0)}function t(e){let t=Dc(r,`close`,f.pointerType),n=()=>{a.setOpen(!1,Kc(Nc,e)),u?.events.emit(`floating.closed`,e)};t?f.openChangeTimeout.start(t,n):(f.openChangeTimeout.clear(),n())}function o(e){let t=_c(e);if(!Sc(t)){f.interactedInside=!1;return}f.interactedInside=t?.closest(`[aria-haspopup]`)!=null}function c(){f.openChangeTimeout.clear(),p.clear(),u?.events.off(`floating.closed`,v),g()}function _(n){if(e()&&u){u.events.on(`floating.closed`,v);return}if(vc(n.relatedTarget,a.context.triggerElements))return;let r=l.current.floatingContext?.nodeId??i,o=n.relatedTarget;if(!(u&&r&&fs(o)&&ru(u.nodesRef.current,r,!1).some(e=>gc(e.context?.elements.floating,o)))){if(f.handler){f.handler(n);return}g(),h()&&!m()&&t(n)}}function v(t){!u||!d||e()||p.start(0,()=>{u.events.off(`floating.closed`,v),a.setOpen(!1,Kc(Nc,t)),u.events.emit(`floating.closed`,t)})}let y=s;return Ms(y&&Ps(y,`mouseenter`,c),y&&Ps(y,`mouseleave`,_),y&&Ps(y,`pointerdown`,o,!0),()=>{u?.events.off(`floating.closed`,v)})},[n,s,a,l,r,i,h,m,g,f,u,d,p])}var wp={current:null};function Tp(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=wp,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,h=`rootStore`in e?e.rootStore:e,{dataRef:g,events:_}=h.context,y=fd(l),b=Sp(h),x=v.useRef(!1),S=Lo(i),C=Lo(r),w=Lo(o),T=Lo(n),E=Lo(p),D=Lo(f),O=Po(()=>kc(g.current.openEvent?.type,b.interactedInside)),k=Po(()=>E.current?.()!==!1),A=Po((e,t,n)=>{let r=h.context.triggerElements;if(r.hasElement(t))return!e||!gc(e,t);if(!fs(n))return!1;let i=n;return r.hasMatchingElement(e=>gc(e,i))&&(!e||!gc(e,i))}),j=Po(()=>{b.handler&&=(Ns(h.select(`domReferenceElement`)).removeEventListener(`mousemove`,b.handler),void 0)}),M=Po(()=>{bp(b)});return u&&(b.handleCloseOptions=S.current?.__options),v.useEffect(()=>j,[j]),v.useEffect(()=>{if(!n)return;function e(e){e.open?x.current=!1:(x.current=e.reason===Nc,j(),b.openChangeTimeout.clear(),b.restTimeout.clear(),b.blockMouseMove=!0,b.restTimeoutPending=!1)}return _.on(`openchange`,e),()=>{_.off(`openchange`,e)}},[n,_,b,j]),v.useEffect(()=>{if(!n)return;function e(e,t=!0){let n=Dc(C.current,`close`,b.pointerType);n?b.openChangeTimeout.start(n,()=>{h.setOpen(!1,Kc(Nc,e)),y?.events.emit(`floating.closed`,e)}):t&&(b.openChangeTimeout.clear(),h.setOpen(!1,Kc(Nc,e)),y?.events.emit(`floating.closed`,e))}let t=c.current??(u?h.select(`domReferenceElement`):null);if(!fs(t))return;function r(e){if(b.openChangeTimeout.clear(),b.blockMouseMove=!1,a&&!sc(b.pointerType))return;let t=Oc(w.current),n=Dc(C.current,`open`,b.pointerType),r=_c(e),i=e.currentTarget??null,o=h.select(`domReferenceElement`),s=i;if(fs(r)&&!h.context.triggerElements.hasElement(r)){for(let e of h.context.triggerElements.elements())if(gc(e,r)){s=e;break}}fs(i)&&fs(o)&&!h.context.triggerElements.hasElement(i)&&gc(i,o)&&(s=o);let c=s!=null&&A(o,s,r),l=h.select(`open`),u=D.current?.()??h.select(`transitionStatus`)===`ending`,d=!l&&u&&x.current,f=!c&&fs(s)&&fs(o)&&gc(o,s)&&d,p=t>0&&!n,m=c&&(l||d)||f,g=!l||c;if(m){k()&&h.setOpen(!0,Kc(Nc,e,s));return}p||(n?b.openChangeTimeout.start(n,()=>{g&&k()&&h.setOpen(!0,Kc(Nc,e,s))}):g&&k()&&h.setOpen(!0,Kc(Nc,e,s)))}function i(t){if(O()){M();return}j();let n=Ns(h.select(`domReferenceElement`));b.restTimeout.clear(),b.restTimeoutPending=!1;let r=g.current.floatingContext??d?.();if(!vc(t.relatedTarget,h.context.triggerElements)){if(S.current&&r){h.select(`open`)||b.openChangeTimeout.clear();let i=c.current;b.handler=S.current({...r,tree:y,x:t.clientX,y:t.clientY,onClose(){M(),j(),T.current&&!O()&&i===h.select(`domReferenceElement`)&&e(t,!0)}}),n.addEventListener(`mousemove`,b.handler),b.handler(t);return}(b.pointerType!==`touch`||!gc(h.select(`floatingElement`),t.relatedTarget))&&e(t)}}function o(e){gc(t,e.relatedTarget)||(b.openChangeTimeout.clear(),b.restTimeout.clear(),b.restTimeoutPending=!1)}let l=m?Ps(t,`mouseout`,o):void 0;return s?Ms(Ps(t,`mousemove`,r,{once:!0}),Ps(t,`mouseenter`,r),Ps(t,`mouseleave`,i),l):Ms(Ps(t,`mouseenter`,r),Ps(t,`mouseleave`,i),l)},[j,M,g,C,h,n,S,b,u,A,O,a,s,w,c,y,T,d,D,k,m]),v.useMemo(()=>{if(!n)return;function e(e){b.pointerType=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,n=e.currentTarget,r=h.select(`domReferenceElement`),i=h.select(`open`),o=A(r,n,e.target);if(a&&!sc(b.pointerType))return;if(i&&o&&b.handleCloseOptions?.blockPointerEvents){let e=h.select(`floatingElement`);if(e){let t=b.handleCloseOptions?.getScope?.()??n.ownerDocument.body;xp(b,{scopeElement:t,referenceElement:n,floatingElement:e})}}let s=Oc(w.current);if(i&&!o||s===0||!o&&b.restTimeoutPending&&e.movementX**2+e.movementY**2<2)return;b.restTimeout.clear();function c(){if(b.restTimeoutPending=!1,O())return;let e=h.select(`open`);!b.blockMouseMove&&(!e||o)&&k()&&h.setOpen(!0,Kc(Nc,t,n))}b.pointerType===`touch`?td.flushSync(()=>{c()}):o&&i?c():(b.restTimeoutPending=!0,b.restTimeout.start(s,c))}}},[n,b,O,A,a,h,w,k])}var Ep=`Escape`;function Dp(e){return ec&&e.movementX===0&&e.movementY===0}function Op(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function kp(e,t){return Op(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function Ap(e,t,n){return Op(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function jp(e,t,n){return Op(t,n?e===dc:e===fc,e===mc)}function Mp(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===Ep:Op(t,n?e===fc:e===dc,e===pc)}function Np(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:l=!1,rtl:u=!1,virtual:d=!1,focusItemOnOpen:f=`auto`,focusItemOnHover:p=!0,openOnArrowKeyDown:m=!0,disabledIndices:h=void 0,orientation:g=`vertical`,parentOrientation:_,id:y,resetOnPointerLeave:b=!0,externalTree:x,grid:S}=t,C=S!=null,w=`rootStore`in e?e.rootStore:e,T=w.useState(`open`),E=w.useState(`floatingElement`),D=w.useState(`domReferenceElement`),O=w.context.dataRef,k=Tc(E),A=Cc(D),j=Lo(k),M=dd(),N=fd(x),P=v.useRef(f),F=v.useRef(o??-1),I=v.useRef(null),L=v.useRef(!0),ee=Po(e=>{i(F.current===-1?null:F.current,e)}),R=v.useRef(!!E),te=v.useRef(T),z=v.useRef(!1),B=v.useRef(!1),V=v.useRef(null),ne=Lo(h),H=Lo(T),re=Lo(o),ie=Lo(b),ae=zs(),oe=zs(),se=Po(()=>{function e(e){d?N?.events.emit(`virtualfocus`,e):V.current=su(e,{sync:z.current,preventScroll:!0})}let t=n.current[F.current],r=B.current;t&&e(t),(z.current?e=>e():e=>ae.request(e))(()=>{let i=n.current[F.current]||t;i&&(t||e(i),pe&&(r||!L.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});Ao(()=>{O.current.orientation=g},[O,g]),Ao(()=>{a&&(T&&E?(F.current=o??-1,P.current&&o!=null&&(B.current=!0,ee())):R.current&&(F.current=-1,ee()))},[a,T,E,o,ee]),Ao(()=>{if(a){if(!T){z.current=!1;return}if(E){if(r==null){if(z.current=!1,re.current!=null)return;if(R.current&&(F.current=-1,se()),(!te.current||!R.current)&&P.current&&(I.current!=null||P.current===!0&&I.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>oe.request(e):queueMicrotask)(t),e+=1):(F.current=I.current==null||Ap(I.current,g,u)||l?El(n):Dl(n),I.current=null,ee())};t()}}else Tl(n.current,r)||(F.current=r,se(),B.current=!1)}}},[a,T,E,r,re,l,n,g,u,ee,se,oe]),Ao(()=>{if(!a||E||!N||d||!R.current)return;let e=N.nodesRef.current,t=e.find(e=>e.id===M)?.context?.elements.floating,n=hc(Ns(D??t??null)),r=e.some(e=>e.context&&gc(e.context.elements.floating,n));t&&!r&&L.current&&t.focus({preventScroll:!0})},[a,E,D,N,M,d]),Ao(()=>{te.current=T,R.current=!!E}),Ao(()=>{T||(I.current=null,P.current=f)},[T,f]);let ce=r!=null,le=Po(e=>{if(!H.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(F.current!==t||r!==t)&&(F.current=t,ee(e))}),ue=Po(()=>_??N?.nodesRef.current.find(e=>e.id===M)?.context?.dataRef?.current.orientation),de=Po(()=>El(n,ne.current)),fe=Po(e=>{if(L.current=!1,z.current=!0,e.which===229||!H.current&&e.currentTarget===j.current)return;if(l&&Mp(e.key,g,u,C)){kp(e.key,ue())||rc(e),w.setOpen(!1,Kc(Bc,e.nativeEvent)),ps(D)&&(d?N?.events.emit(`virtualfocus`,D):D.focus());return}let t=F.current,r=El(n,h),i=Dl(n,h);if(A||(e.key===`Home`&&(rc(e),F.current=r,ee(e)),e.key===`End`&&(rc(e),F.current=i,ee(e))),S!=null){let t=S(e,F.current,n,g,c,u,h,r,i);if(t!=null&&(F.current=t,ee(e)),g===`both`)return}if(kp(e.key,g)){if(rc(e),T&&!d&&hc(e.currentTarget.ownerDocument)===e.currentTarget){F.current=Ap(e.key,g,u)?r:i,ee(e);return}Ap(e.key,g,u)?c?t>=i?s&&t!==n.current.length?F.current=-1:(z.current=!1,F.current=r):F.current=Ol(n.current,{startingIndex:t,disabledIndices:h}):F.current=Math.min(i,Ol(n.current,{startingIndex:t,disabledIndices:h})):c?t<=r?s&&t!==-1?F.current=n.current.length:(z.current=!1,F.current=i):F.current=Ol(n.current,{startingIndex:t,decrement:!0,disabledIndices:h}):F.current=Math.max(r,Ol(n.current,{startingIndex:t,decrement:!0,disabledIndices:h})),Tl(n.current,F.current)&&(F.current=-1),ee(e)}}),pe=v.useMemo(()=>({onFocus(e){z.current=!0,le(e)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(e){Dp(e)||(z.current=!0,B.current=!1,p&&le(e))},onPointerLeave(e){if(!H.current||!L.current||e.pointerType===`touch`)return;z.current=!0;let t=e.relatedTarget;if(!(!p||n.current.includes(t))&&ie.current&&(V.current?.(),V.current=null,F.current=-1,ee(e),!d)){let e=j.current,t=hc(Ns(e));e&&gc(e,t)&&e.focus({preventScroll:!0})}}}),[le,H,j,p,n,ee,ie,d]),me=v.useMemo(()=>d&&T&&ce&&{"aria-activedescendant":`${y}-${r}`},[d,T,ce,y,r]),he=v.useMemo(()=>({"aria-orientation":g===`both`?void 0:g,...A?{}:me,onKeyDown(e){if(e.key===`Tab`&&e.shiftKey&&T&&!d){let t=_c(e.nativeEvent);if(t&&!gc(j.current,t))return;rc(e),w.setOpen(!1,Kc(Rc,e.nativeEvent)),ps(D)&&D.focus();return}fe(e)},onPointerMove(e){Dp(e)||(L.current=!0)}}),[me,fe,j,g,A,w,T,d,D]),ge=v.useMemo(()=>{function e(e){w.setOpen(!0,Kc(Bc,e.nativeEvent,e.currentTarget))}function t(e){f===`auto`&&ac(e.nativeEvent)&&(P.current=!d)}function n(e){P.current=f,f===`auto`&&oc(e.nativeEvent)&&(P.current=!0)}return{onKeyDown(t){let n=w.select(`open`);L.current=!1;let r=t.key.startsWith(`Arrow`),i=jp(t.key,ue(),u),a=kp(t.key,g),o=(l?i:a)||t.key===`Enter`||t.key.trim()===``;if(d&&n)return fe(t);if(!(!n&&!m&&r)){if(o){let e=kp(t.key,ue());I.current=l&&e?null:t.key}if(l){i&&(rc(t),n?(F.current=de(),ee(t)):e(t));return}a&&(re.current!=null&&(F.current=re.current),rc(t),!n&&m?e(t):fe(t),n&&ee(t))}},onFocus(e){w.select(`open`)&&!d&&(F.current=-1,ee(e))},onPointerDown:n,onPointerEnter:n,onMouseDown:t,onClick:t}},[fe,f,de,l,ee,w,m,g,ue,u,re,d]),_e=v.useMemo(()=>({...me,...ge}),[me,ge]);return v.useMemo(()=>a?{reference:_e,floating:he,item:pe,trigger:ge}:{},[a,_e,he,ge,pe])}function Pp(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:s,enabled:c=!0,resetMs:l=750,selectedIndex:u=null}=t,d=`rootStore`in e?e.rootStore:e,f=d.useState(`open`),p=Hs(),m=v.useRef(``),h=v.useRef(u??i??-1),g=v.useRef(null),_=Po(e=>{function t(e){return r?.current[e]}function c(e){let n=t(e);return n&&!jl(n)||n?.matches(`:disabled`)?!1:o==null||!kl(is,e,o)}function d(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(!(!e[n]?.toLowerCase().startsWith(i)||!c(n)))return n}return-1}let _=n.current;if(m.current.length>0&&e.key===` `&&(rc(e),s?.(!0)),m.current.length>0&&m.current[0]!==` `&&d(_,m.current)===-1&&e.key!==` `&&s?.(!1),_==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;f&&e.key!==` `&&(rc(e),s?.(!0));let v=m.current===``;v&&(h.current=u??i??-1),_.every((e,t)=>e&&c(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&m.current===e.key&&(m.current=``,h.current=g.current),m.current+=e.key,p.start(l,()=>{m.current=``,h.current=g.current,s?.(!1)});let y=((v?u??i??-1:h.current)??0)+1,b=d(_,m.current,y);b===-1?e.key!==` `&&(m.current=``,s?.(!1)):(a?.(b),g.current=b)}),y=Po(e=>{let t=e.relatedTarget,n=d.select(`domReferenceElement`),r=d.select(`floatingElement`);gc(n,t)||gc(r,t)||(p.clear(),m.current=``,h.current=g.current,s?.(!1))});Ao(()=>{!f&&u!==null||(p.clear(),g.current=null,m.current!==``&&(m.current=``))},[f,u,p]);let b=v.useMemo(()=>({onKeyDown:_,onBlur:y}),[_,y]);return v.useMemo(()=>c?{reference:b,floating:b}:{},[c,b])}var Fp=.1,Ip=Fp*Fp,Lp=.5;function Rp(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function zp(e,t,n,r,i,a,o,s,c,l){let u=!1;return Rp(e,t,n,r,i,a)&&(u=!u),Rp(e,t,i,a,o,s)&&(u=!u),Rp(e,t,o,s,c,l)&&(u=!u),Rp(e,t,c,l,n,r)&&(u=!u),u}function Bp(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function Vp(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function Hp(e={}){let{blockPointerEvents:t=!1}=e,n=new Vs,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*Ip;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=_c(r),g=r.type===`mouseleave`,_=gc(u,h),v=gc(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&fs(r.relatedTarget)&&gc(u,r.relatedTarget))return;function y(){return!!(s&&ru(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=Vp(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=Vp(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=Vp(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=Vp(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!Bp(d,f,x)){b();return}if(!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?Lp/2:Lp*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+Lp+1,o=C||T?S.bottom-Lp:S.top,s=C?T?S.bottom-Lp:S.top:S.bottom-Lp;M=zp(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?Lp/2:Lp*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-Lp,o=C||T?S.top+Lp:S.bottom,s=C?T?S.top+Lp:S.bottom:S.top+Lp;M=zp(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?Lp/2:Lp*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+Lp+1,o=w||E?S.right-Lp:S.left,s=w?E?S.right-Lp:S.left:S.right-Lp;M=zp(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?Lp/2:Lp*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-Lp,o=w||E?S.left+Lp:S.right,s=w?E?S.left+Lp:S.right:S.left+Lp;M=zp(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}var Up=v.createContext(null);function Wp(){let e=v.useContext(Up);if(e===null)throw Error(Bo(60));return e}var Gp={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Kp={disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},qp={valid(e){return e===null?null:e?{"data-valid":``}:{"data-invalid":``}}},Jp={invalid:void 0,name:void 0,validityData:{state:Gp,errors:[],error:``,value:``,initialValue:null},setValidityData:rs,disabled:void 0,setTouched:rs,setDirty:rs,setFilled:rs,setFocused:rs,validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:Kp,registerFieldControl:rs,validation:{getValidationProps:(e,t=as)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:rs,getInputControl:()=>null,commit:async()=>{},change:rs}},Yp=v.createContext(Jp);function Xp(e=!0){let t=v.useContext(Yp);if(t.setValidityData===rs&&!e)throw Error(Bo(28));return t}function Zp(e,t,n,r,i=!0,a){let{registerFieldControl:o}=Xp(),s=yo(()=>Symbol());Ao(()=>{let c=s.current;if(!i){o(c,void 0);return}o(c,{controlRef:e,getValue:r,id:t,name:a,value:n})},[e,i,r,t,a,o,s,n]),Ao(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}function Qp(e){return Cu(e,`base-ui`)}var $p=v.createContext({controlId:void 0,registerControlId:rs,labelId:void 0,setLabelId:rs,messageIds:[],setMessageIds:rs,getDescriptionProps:e=>e});function em(){return v.useContext($p)}function tm(e={}){let{id:t,implicit:n=!1,controlRef:r}=e,{controlId:i,registerControlId:a}=em(),o=Qp(t),s=n?i:void 0,c=yo(()=>Symbol()),l=v.useRef(!1),u=v.useRef(t!=null),d=Po(()=>{!l.current||a===rs||(l.current=!1,a(c.current,void 0))});return Ao(()=>{if(a===rs)return;let e;if(n){let n=r?.current;e=fs(n)&&n.closest(`label`)!=null?t??null:s??o}else if(t!=null)u.current=!0,e=t;else if(u.current)e=o;else{d();return}if(e===void 0){d();return}l.current=!0,a(c.current,e)},[t,r,s,a,n,o,c,d]),v.useEffect(()=>d,[d]),i??o}var nm=(e,t)=>Object.is(e,t);function rm(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function im(e,t,n){return!e||e.length===0?-1:e.findIndex(e=>e!==void 0&&rm(e,t,n))}function am(e,t,n){return e.filter(e=>!rm(t,e,n))}function om(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function sm(e){return e!=null&&e.length>0&&typeof e[0]==`object`&&e[0]!=null&&`items`in e[0]}function cm(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(sm(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function lm(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 om(e)}function um(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?om(e.value):om(e)}function dm(e,t,n){function r(){return lm(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)){let n=t,i=sm(n)?n.flatMap(e=>e.items):n;if(typeof e!=`object`||!e){let t=i.find(t=>t.value===e);return t&&t.label!=null?t.label:r()}if(`value`in e){let t=i.find(t=>t&&t.value===e.value);if(t&&t.label!=null)return t.label}}return r()}function fm(e,t,n){return e.reduce((e,r,i)=>(i>0&&e.push(`, `),e.push((0,U.jsx)(v.Fragment,{children:dm(r,t,n)},i)),e),[])}var pm={id:e=>e.id,labelId:e=>e.labelId,modal:e=>e.modal,items:e=>e.items,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,value:e=>e.value,hasSelectedValue:e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:um(t,r)!==``},hasNullItemLabel:(e,t)=>t?cm(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMount:e=>e.forceMount,transitionStatus:e=>e.transitionStatus,openMethod:e=>e.openMethod,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(e=>rm(t,e,n)):rm(t,r,n)},isSelectedByFocus:(e,t)=>e.selectedIndex===t,popupProps:e=>e.popupProps,triggerProps:e=>e.triggerProps,triggerElement:e=>e.triggerElement,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupSide:e=>e.popupSide,scrollUpArrowVisible:e=>e.scrollUpArrowVisible,scrollDownArrowVisible:e=>e.scrollDownArrowVisible,hasScrollArrows:e=>e.hasScrollArrows},mm=v.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:rs,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});function hm(){return v.useContext(mm)}function gm(e,t,n=(e,t)=>e===t){return e.length===t.length&&e.every((e,r)=>n(e,t[r]))}function _m(e,t){let n=v.useRef(e),r=Po(t);Ao(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function vm(e){let t=v.useRef(``),n=v.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:v.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``},[e]),onPointerDown:n}}function ym(e,t){let{onClick:n,onPointerDown:r}=vm(Po((n,r)=>{(typeof e==`function`?e():e)||t(r||(Ys?`touch`:``))}));return v.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function bm(e){let[t,n]=v.useState(null),r=ym(e,n);return _m(e,t=>{t&&!e&&n(null)}),v.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function xm(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function Sm(e,t){return Math.max(0,e-t)}function Cm(e,t){if(t<=0)return 0;let n=xm(e,0,t),r=n,i=t-n,a=r<=1,o=i<=1;return a&&o?r<=i?0:t:a?0:o?t:n}function wm(e){let{id:t,value:n,defaultValue:r=null,onValueChange:i,open:a,defaultOpen:o=!1,onOpenChange:s,name:c,form:l,autoComplete:u,disabled:d=!1,readOnly:f=!1,required:p=!1,modal:m=!0,actionsRef:h,inputRef:g,onOpenChangeComplete:_,items:y,multiple:b=!1,itemToStringLabel:x,itemToStringValue:S,isItemEqualToValue:C=nm,highlightItemOnHover:w=!0,children:T}=e,{clearErrors:E}=hm(),{setDirty:D,setTouched:O,setFocused:k,validityData:A,setFilled:j,name:M,disabled:N,validation:P,validationMode:F}=Xp(),I=tm({id:t}),L=N||d,ee=M??c,[R,te]=ko({controlled:n,default:b?r??is:r,name:`Select`,state:`value`}),[z,B]=ko({controlled:a,default:o,name:`Select`,state:`open`}),V=v.useRef([]),ne=v.useRef([]),H=v.useRef(null),re=v.useRef(null),ie=v.useRef(0),ae=v.useRef(null),oe=v.useRef([]),se=v.useRef(!1),ce=v.useRef(null),le=v.useRef(null),ue=v.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),de=v.useRef(!1),{mounted:fe,setMounted:pe,transitionStatus:me}=Bf(z),{openMethod:he,triggerProps:ge}=bm(z),_e=yo(()=>new os({id:I,labelId:void 0,modal:m,multiple:b,itemToStringLabel:x,itemToStringValue:S,isItemEqualToValue:C,value:R,open:z,mounted:fe,transitionStatus:me,items:y,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,ve=Qo(_e,pm.activeIndex),ye=Qo(_e,pm.selectedIndex),be=Qo(_e,pm.triggerElement),xe=Qo(_e,pm.positionerElement),Se=Do(he),Ce=he??Se,we=v.useMemo(()=>b?``:um(R,S),[b,R,S]),Te=v.useMemo(()=>b&&Array.isArray(R)?R.map(e=>um(e,S)):um(R,S),[b,R,S]);Zp(Lo(be),I,R,Po(()=>Te),!L,c);let Ee=v.useRef(R),De=b?Array.isArray(R)&&R.length>0:R!=null&&we!==``;Ao(()=>{j(De)},[De,j]),Ao(function(){let e=R,t=!1;if(b){let n=Array.isArray(R)?R:[];t=n.length===0,e=n[n.length-1]}let n=t?-1:im(oe.current,e,C),r=n===-1?null:n;r===null&&(le.current=null),!z&&_e.set(`selectedIndex`,r)},[b,z,R,C,_e]);function Oe(e){let t=A.initialValue;return Array.isArray(e)&&Array.isArray(t)?!gm(e,t,(e,t)=>rm(e,t,C)):e!==t}_m(R,()=>{E(ee),D(Oe(R)),P.change(R)});let ke=Po((e,t)=>{s?.(e,t),!t.isCanceled&&(B(e),!e&&(t.reason===`focus-out`||t.reason===`outside-press`)&&(O(!0),k(!1),F===`onBlur`&&P.commit(R)))}),Ae=Po(()=>{pe(!1),_e.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),_?.(!1)});Hf({enabled:!h,open:z,ref:H,onComplete(){z||Ae()}}),v.useImperativeHandle(h,()=>({unmount:Ae}),[Ae]);let je=Po((e,t)=>{i?.(e,t),!t.isCanceled&&te(e)}),Me=Po(e=>{let t=Sm(e.scrollHeight,e.clientHeight),n=Cm(e.scrollTop,t),r=n>0,i=n<t;_e.set(`scrollUpArrowVisible`,r),_e.set(`scrollDownArrowVisible`,i)}),Ne=pp({open:z,onOpenChange:ke,elements:{reference:be,floating:xe}}),Pe=Ed(Ne,{enabled:!f&&!L,event:`mousedown`}),Fe=Md(Ne),Ie=Np(Ne,{enabled:!f&&!L,listRef:V,activeIndex:ve,selectedIndex:ye,disabledIndices:is,onNavigate(e){e===null&&!z||_e.set(`activeIndex`,e)},focusItemOnHover:w}),Le=Pp(Ne,{enabled:!f&&!L&&(z||!b),listRef:ne,activeIndex:ve,selectedIndex:ye,disabledIndices:e=>Oo(V.current[e]),onMatch(e){z?_e.set(`activeIndex`,e):je(oe.current[e],Kc(jc))},onTyping(e){se.current=e}}),Re=v.useMemo(()=>Au(Le.reference,Ie.reference,Fe.reference,Pe.reference,ge),[Pe.reference,Le.reference,Ie.reference,Fe.reference,ge]),ze=v.useMemo(()=>Au(Uf,Le.floating,Ie.floating,Fe.floating),[Le.floating,Ie.floating,Fe.floating]),Be=Ie.item??as;Eo(()=>{_e.update({popupProps:ze,triggerProps:Re})}),_e.useSyncedValues({id:I,modal:m,multiple:b,value:R,open:z,mounted:fe,transitionStatus:me,popupProps:ze,triggerProps:Re,items:y,itemToStringLabel:x,itemToStringValue:S,isItemEqualToValue:C,openMethod:Ce});let Ve=v.useMemo(()=>({store:_e,floatingContext:Ne,required:p,disabled:L,readOnly:f,multiple:b,highlightItemOnHover:w,setValue:je,setOpen:ke,listRef:V,popupRef:H,scrollHandlerRef:re,handleScrollArrowVisibility:Me,scrollArrowsMountedCountRef:ie,itemProps:Be,valueRef:ae,valuesRef:oe,labelsRef:ne,typingRef:se,selectionRef:ue,firstItemTextRef:ce,selectedItemTextRef:le,validation:P,onOpenChangeComplete:_,alignItemWithTriggerActiveRef:de,initialValueRef:Ee}),[_e,Ne,p,L,f,b,w,je,ke,Be,P,_,Me]),He=bo(g,P.inputRef),Ue=b?void 0:ee,We=v.useMemo(()=>!b||!Array.isArray(R)||!ee?null:R.map(e=>{let t=um(e,S);return(0,U.jsx)(`input`,{type:`hidden`,form:l,name:ee,value:t,disabled:L},t)}),[b,R,l,ee,S,L]);return(0,U.jsxs)(Up.Provider,{value:Ve,children:[T,(0,U.jsx)(`input`,{...P.getValidationProps(L,{onFocus(){_e.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented||L||f)return;let t=e.currentTarget.value,n=Kc(jc,e.nativeEvent);function r(){if(b)return;let e=t.toLowerCase(),r=oe.current.findIndex(t=>um(t,S).toLowerCase()===e||lm(t,x).toLowerCase()===e);r===-1&&(r=oe.current.findIndex((t,n)=>{let r=ne.current[n];return r!=null&&r.toLowerCase()===e}));let i=oe.current[r];i!=null&&je(i,n)}_e.set(`forceMount`,!0),queueMicrotask(r)}}),id:I&&Ue==null?`${I}-hidden-input`:void 0,form:l,name:Ue,autoComplete:u,value:we,disabled:L,required:p&&!(b&&De),readOnly:f,ref:He,style:ee?_o:go,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),We]})}function Tm(e,t){return e??t}var Em=function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e}({}),Dm={"data-starting-style":``},Om={"data-ending-style":``},km={transitionStatus(e){return e===`starting`?Dm:e===`ending`?Om:null}};(function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=Em.startingStyle]=`startingStyle`,e[e.endingStyle=Em.endingStyle]=`endingStyle`,e.anchorHidden=`data-anchor-hidden`,e.side=`data-side`,e.align=`data-align`,e})({});var Am={"data-popup-open":``},jm={"data-popup-open":``,"data-pressed":``},Mm={"data-open":``},Nm={"data-closed":``},Pm={"data-anchor-hidden":``},Fm={open(e){return e?Am:null}},Im={open(e){return e?jm:null}},Lm={open(e){return e?Mm:Nm},anchorHidden(e){return e?Pm:null}},Rm={...Lm,...km},zm=5;function Bm(e,t){let n=Vm(t);return e.clientX>=n.left-zm&&e.clientX<=n.right+zm&&e.clientY>=n.top-zm&&e.clientY<=n.bottom+zm}function Vm(e){let t=e.getBoundingClientRect(),n=ls(e);if(nc)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}var Hm=v.createContext(void 0);function Um(e=!1){let t=v.useContext(Hm);if(t===void 0&&!e)throw Error(Bo(16));return t}function Wm(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:v.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function Gm(e,t,{detail:n=0}={}){e.dispatchEvent(new(ls(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function Km(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=v.useRef(null),s=Um(!0),c=a??s!==void 0,{props:l}=Wm({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=v.useCallback(()=>{let e=o.current;qm(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return Ao(u,[u]),{getButtonProps:v.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return Au({onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(Vu(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=qm(r),s=!i&&Jm(r),l=n&&(i?a:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&c&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!i||a)&&(e.preventBaseUIHandler(),Gm(r,e));return}if(!l||i||!d&&!u){n&&s&&d&&e.preventDefault();return}e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),Gm(r,e)))},onKeyUp(e){if(!t){if(Vu(e),a?.(e),e.target===e.currentTarget&&i&&c&&qm(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!c&&!e.defaultPrevented&&e.key===` `&&(e.preventBaseUIHandler(),Gm(e.currentTarget,e))}},onPointerDown(e){if(t){e.preventDefault();return}s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:Po(e=>{o.current=e,u()})}}function qm(e){return ps(e)&&e.tagName===`BUTTON`}function Jm(e){return ps(e)&&e.tagName===`A`&&!!e.href}var Ym=400,Xm={...Im,...qp,popupSide:e=>e?{"data-popup-side":e}:null,value:()=>null},Zm=v.forwardRef(function(e,t){let{render:n,className:r,id:i,disabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{setTouched:l,setFocused:u,validationMode:d,state:f,disabled:p}=Xp(),{labelId:m}=em(),{store:h,setOpen:g,selectionRef:_,validation:y,readOnly:b,required:x,alignItemWithTriggerActiveRef:S,disabled:C}=Wp(),w=p||C||a,T=Qo(h,pm.open),E=Qo(h,pm.mounted),D=Qo(h,pm.value),O=Qo(h,pm.triggerProps),k=Qo(h,pm.positionerElement),A=Qo(h,pm.listElement),j=Qo(h,pm.popupSide),M=Qo(h,pm.id),N=Qo(h,pm.labelId),P=Qo(h,pm.hasSelectedValue),F=E&&k?j:null,I=i??M,L=Tm(m,N);tm({id:I});let ee=Lo(k),R=v.useRef(null),{getButtonProps:te,buttonRef:z}=Km({disabled:w,native:o}),B=h.useStateSetter(`triggerElement`),V=Hs(),ne=Hs(),H=Hs();v.useEffect(()=>{if(T)return H.start(Ym,()=>{_.current.allowUnselectedMouseUp=!0,_.current.allowSelectedMouseUp=!0}),()=>{H.clear()};_.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},ne.clear()},[T,_,ne,H]);let re=Au(O,{id:I,role:`combobox`,"aria-expanded":T,"aria-haspopup":`listbox`,"aria-controls":T?A?.id??Tc(k)?.id:void 0,"aria-labelledby":L,"aria-readonly":b||void 0,"aria-required":x||void 0,tabIndex:w?-1:0,onFocus(e){u(!0),T&&S.current&&g(!1,Kc(jc,e.nativeEvent)),V.start(0,()=>{h.set(`forceMount`,!0)})},onBlur(e){gc(k,e.relatedTarget)||(l(!0),u(!1),d===`onBlur`&&y.commit(D))},onMouseDown(e){if(T)return;let t=Ns(e.currentTarget);function n(e){if(!R.current)return;let t=e.target;gc(R.current,t)||gc(ee.current,t)||Bm(e,R.current)||g(!1,Kc(Vc,e))}ne.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},c,te),ie=y.getValidationProps(w,re);ie.role=`combobox`;let ae={...f,open:T,disabled:w,value:D,readOnly:b,popupSide:F,placeholder:!P};return Wu(`button`,e,{ref:[t,R,z,B],state:ae,stateAttributesMapping:Xm,props:ie})}),Qm={value:()=>null},$m=v.forwardRef(function(e,t){let{className:n,render:r,children:i,placeholder:a,style:o,...s}=e,{store:c,valueRef:l}=Wp(),u=Qo(c,pm.value),d=Qo(c,pm.items),f=Qo(c,pm.itemToStringLabel),p=Qo(c,pm.hasSelectedValue),m=!p&&a!=null&&i==null,h=Qo(c,pm.hasNullItemLabel,m),g={value:u,placeholder:!p},_=null;return _=typeof i==`function`?i(u):i??(m&&!h?a:Array.isArray(u)?fm(u,d,f):dm(u,d,f)),Wu(`span`,e,{state:g,ref:[t,l],props:[{children:_},s],stateAttributesMapping:Qm})}),eh=v.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{store:o}=Wp();return Wu(`span`,e,{state:{open:Qo(o,pm.open)},ref:t,props:[{"aria-hidden":!0,children:`▼`},a],stateAttributesMapping:Fm})}),th=v.forwardRef(function(e,t){let{store:n}=Wp(),r=Qo(n,pm.mounted),i=Qo(n,pm.forceMount);return r||i?(0,U.jsx)(od,{ref:t,...e}):null});function nh(e){return Ho(19)?e:e?`true`:void 0}var rh=v.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function ih(){return v.useContext(rh)}function ah(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=Po(i),[,o]=v.useState(!1),s=yo(sh).current,c=yo(oh).current,l=v.useRef(0),u=v.useRef(!0),d=v.useRef([]),f=v.useRef(null),p=Po(()=>{u.current||(u.current=!0,o(e=>!e))}),m=Po((e,t)=>{c.set(e,t),p()}),h=Po(e=>{c.delete(e),p()}),g=Po(e=>{let t=new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),l.current=n.current.length,t});function _(e){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!uh(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&dh(r,n)>0){t.disconnect(),p();return}r=n}});f.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=lh(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let y=Po(()=>{let[e,t]=ch(c),n=g(e);_(t),d.current=e,u.current=!1,s.forEach(e=>e(n)),a(n)});Ao(()=>(u.current||g(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,g]),Ao(()=>{u.current&&y()}),Ao(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let b=Po(e=>(s.add(e),()=>{s.delete(e)})),x=v.useMemo(()=>({register:m,unregister:h,subscribeMapChange:b,nextIndexRef:l}),[m,h,b,l]);return(0,U.jsx)(rh.Provider,{value:x,children:t})}function oh(){return new Map}function sh(){return new Set}function ch(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>dh(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function lh(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function uh(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function dh(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var fh=v.createContext(void 0);function ph(){return v.useContext(fh)?.direction??`ltr`}var mh=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:d=`real`}=al(e,t)||{};if(l==null)return{};let f=Cl(u),p={x:n,y:r},m=dl(i),h=ll(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];(!w||!await o.isElement?.(C))&&(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,D=Math.min(f[v],E),O=Math.min(f[y],E),k=D,A=w-g[h]-O,j=w/2-g[h]/2+T,M=il(k,j,A),N=!c.arrow&&sl(i)!=null&&j!==M&&a.reference[h]/2-(j<k?D:O)-g[h]/2<0,P=N?j<k?j-k:j-A:0;return{[m]:p[m]+P,data:{[m]:M,centerOffset:j-M-P,...N&&{alignmentOffset:P}},reset:N}}}),hh=(e,t)=>({...mh(e),options:[e,t]}),gh={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},_h={sideX:`left`,sideY:`top`},vh=`--available-width`,yh=`--available-height`;function bh(e,t,n){let 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 xh(e,t,n){let{rects:r,placement:i}=e;return{side:bh(t,ol(i),n),align:sl(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Sh(e){return Ch(e,mp)}function Ch(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:h,mounted:g,collisionAvoidance:_,shift:y,nodeId:b,adaptiveOrigin:x,lazyFlip:S=!1,externalTree:C}=e,[w,T]=v.useState(null);!g&&w!==null&&T(null);let E=_.side||`flip`,D=_.align||`flip`,O=_.fallbackAxisSide||`end`,k=y?.crossAxis??!1,A=y?.rootBoundary,j=typeof n==`function`?n:void 0,M=Po(j),N=j?M:n,P=Lo(n),F=Lo(g),I=ph()===`rtl`,L=w||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":I?`left`:`right`,"inline-start":I?`right`:`left`}[i],ee=o===`center`?L:`${L}-${o}`,R=l;typeof R==`number`?R={top:R,right:R,bottom:R,left:R}:R&&={top:R.top||0,right:R.right||0,bottom:R.bottom||0,left:R.left||0};let te=+(i===`bottom`),z=+(i===`top`),B=+(i===`right`),V=+(i===`left`),ne={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:R},H=v.useRef(null),re=Lo(a),ie=Lo(s),ae=typeof a==`function`?0:a,oe=typeof s==`function`?0:s,se=[];p&&se.push(p),se.push(Mf(e=>{let t=xh(e,i,I),n=typeof re.current==`function`?re.current(t):re.current,r=typeof ie.current==`function`?ie.current(t):ie.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[ae,oe,I,i]));let ce=D===`none`&&E!==`shift`,le=!ce&&(u||k||E===`shift`),ue=E===`none`?null:Ff({...ne,padding:{top:R.top+1+te,right:R.right+1+V,bottom:R.bottom+1+z,left:R.left+1+B},mainAxis:!k&&E===`flip`,crossAxis:D===`flip`&&`alignment`,fallbackAxisSideDirection:O}),de=ce?null:Nf({...ne,rootBoundary:A,mainAxis:D!==`none`,crossAxis:le,limiter:u||k?void 0:Pf(e=>{if(!H.current)return{};let{width:t,height:n}=H.current.getBoundingClientRect(),r=ul(ol(e.placement)),i=r===`y`?t:n,a=r===`y`?R.left+R.right:R.top+R.bottom;return{offset:i/2+a/2}})},[ne,u,k,A,R,D]);E===`shift`||D===`shift`||o===`center`?se.push(de,ue):se.push(ue,de),se.push(If({...ne,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!F.current)return;let i=e.style;i.setProperty(vh,`${t}px`),i.setProperty(yh,`${n}px`);let a=ls(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(`--anchor-width`,`${u}px`),i.setProperty(`--anchor-height`,`${d}px`)}}),hh(e=>({element:H.current||Ns(e.elements.floating).createElement(`div`),padding:d,offsetParent:`floating`}),[d]),{name:`transformOrigin`,fn(e){let{elements:t,middlewareData:n,placement:r,rects:o,y:s}=e,c=ol(r),l=ul(c),u=H.current,d=n.arrow?.x||0,f=n.arrow?.y||0,p=u?.clientWidth||0,m=u?.clientHeight||0,h=d+p/2,g=f+m/2,_=Math.abs(n.shift?.y||0),v=o.reference.height/2,y=typeof a==`function`?a(xh(e,i,I)):a,b=_>y,x={top:`${h}px calc(100% + ${y}px)`,bottom:`${h}px ${-y}px`,left:`calc(100% + ${y}px) ${g}px`,right:`${-y}px ${g}px`}[c],S=`${h}px ${o.reference.y+v-s}px`;return t.floating.style.setProperty(`--transform-origin`,le&&l===`y`&&b?S:x),{}}},gh,x),Ao(()=>{!g&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,h]);let fe=v.useMemo(()=>({elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:pe,elements:me,x:he,y:ge,middlewareData:_e,update:ve,placement:ye,context:be,isPositioned:xe,floatingStyles:Se}=t({rootContext:h,open:m?g:void 0,placement:ee,middleware:se,strategy:r,whileElementsMounted:m?void 0:(...e)=>yf(...e,fe),nodeId:b,externalTree:C}),{sideX:Ce,sideY:we}=_e.adaptiveOrigin||_h,Te=xe?r:`fixed`,Ee=v.useMemo(()=>{let e;return e=xe?x?{position:Te,[Ce]:he,[we]:ge}:{...Se,position:Te}:{position:Te,top:0,left:0},e[vh]=`100vw`,e[yh]=`100vh`,xe||(e.opacity=0),e},[x,Te,Ce,he,we,ge,Se,xe]),De=v.useRef(null);Ao(()=>{if(!g)return;let e=P.current,t=typeof e==`function`?e():e,n=(wh(t)?t.current:t)||null;n!==De.current&&(pe.setPositionReference(n),De.current=n)},[g,pe,N,P]),v.useEffect(()=>{if(!g)return;let e=P.current;typeof e!=`function`&&wh(e)&&e.current!==De.current&&(pe.setPositionReference(e.current),De.current=e.current)},[g,pe,N,P]),v.useEffect(()=>{if(m&&g&&me.reference&&me.floating)return yf(me.reference,me.floating,ve,fe)},[m,g,me,ve,fe]);let Oe=ol(ye),ke=bh(i,Oe,I),Ae=sl(ye)||`center`,je=!!_e.hide?.referenceHidden;Ao(()=>{S&&g&&xe&&Oe!==L&&T(Oe)},[S,g,xe,Oe,L]);let Me=v.useMemo(()=>({position:`absolute`,top:_e.arrow?.y,left:_e.arrow?.x}),[_e.arrow]),Ne=_e.arrow?.centerOffset!==0;return v.useMemo(()=>({positionerStyles:Ee,arrowStyles:Me,arrowRef:H,arrowUncentered:Ne,side:ke,align:Ae,physicalSide:Oe,anchorHidden:je,refs:pe,context:be,isPositioned:xe,update:ve}),[Ee,Me,H,Ne,ke,Ae,Oe,je,pe,be,xe,ve])}function wh(e){return e!=null&&`current`in e}var Th=v.createContext(void 0);function Eh(){let e=v.useContext(Th);if(!e)throw Error(Bo(59));return e}var Dh=v.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,U.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})});function Oh(e,t){e&&Object.assign(e.style,t)}var kh={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`};function Ah(e){return e===`starting`?Xu:as}function jh(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),Wu(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},Ah(r),i],stateAttributesMapping:Lm})}var Mh={},Nh={},Ph=``;function Fh(e,t){return hs(e)?e:t}function Ih(e,t,n){return/hidden|clip/.test(e.getComputedStyle(Fh(t,n)).overflowY)}function Lh(e){if(typeof document>`u`)return!1;let t=Ns(e);return ls(t).innerWidth-t.documentElement.clientWidth>0}function Rh(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=Ns(e),n=t.documentElement,r=t.body,i=Fh(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function zh(e){let t=Ns(e),n=t.documentElement,r=t.body,i=Fh(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function Bh(e){let t=Ns(e),n=t.documentElement,r=t.body,i=ls(n),a=0,o=0,s=!1,c=Rs.create();if(ec&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,Mh={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Ph=n.style.scrollBehavior,Nh={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};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=Fh(n,r);if(s=Rh(e),s){n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,Mh),Object.assign(r.style,Nh),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=Ph)}function d(){u(),c.request(l)}l();let f=Ps(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var Vh=new class{lockCount=0;restore=null;timeoutLock=Vs.create();timeoutUnlock=Vs.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=Ns(e),n=t.documentElement,r=t.body,i=ls(n);if(Ih(i,n,r)){let t=new i.MutationObserver(()=>{Ih(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=Ys||!Lh(e);this.restore=a?zh(e):Bh(e)}};function Hh(e=!0,t=null){Ao(()=>{if(e)return Vh.acquire(t)},[e,t])}var Uh=20;function Wh(e,t,n,r){let[i,a]=v.useState(!1);Ao(()=>{if(!e||!t||n==null){a(!1);return}let r=Ns(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-Uh)},[e,t,n]),Hh(e&&(!t||i),r)}var Gh={position:`fixed`},Kh=v.forwardRef(function(e,t){let{anchor:n,className:r,render:i,positionMethod:a,side:o,align:s,sideOffset:c,alignOffset:l,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f,sticky:p,disableAnchorTracking:m,alignItemWithTrigger:h=!0,collisionAvoidance:g=Qu,style:_,...y}=e,{store:b,listRef:x,labelsRef:S,alignItemWithTriggerActiveRef:C,selectedItemTextRef:w,valuesRef:T,initialValueRef:E,popupRef:D,setValue:O,floatingContext:k}=Wp(),A=Qo(b,pm.open),j=Qo(b,pm.mounted),M=Qo(b,pm.modal),N=Qo(b,pm.value),P=Qo(b,pm.openMethod),F=Qo(b,pm.positionerElement),I=Qo(b,pm.triggerElement),L=Qo(b,pm.isItemEqualToValue),ee=Qo(b,pm.transitionStatus),R=v.useRef(null),te=v.useRef(null),[z,B]=v.useState(h),V=j&&z&&P!==`touch`;!j&&z!==h&&B(h),v.useImperativeHandle(C,()=>V),Wh((V||M)&&A,P===`touch`,F,I);let ne=Sh({anchor:n,floatingRootContext:k,positionMethod:a,mounted:j,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m??V,collisionAvoidance:g,keepMounted:!0}),H=V?`none`:ne.side,re=V?Gh:ne.positionerStyles,ie={open:A,side:H,align:ne.align,anchorHidden:ne.anchorHidden};Ao(()=>{b.set(`popupSide`,ne.side)},[b,ne.side]);let ae=jh(e,ie,{styles:re,transitionStatus:ee,props:y,refs:[t,b.useStateSetter(`positionerElement`)],hidden:!j,inert:!A}),oe=v.useRef(0),se=Po(e=>{if(T.current.length===0)return;let t=oe.current;if(oe.current=e.size,e.size===t)return;let n=Kc(jc);if(t!==0&&!b.state.multiple&&N!==null&&im(T.current,N,L)===-1){let e=E.current,t=e!=null&&im(T.current,e,L)!==-1?e:null;O(t,n),t===null&&(b.set(`selectedIndex`,null),w.current=null)}if(t!==0&&b.state.multiple&&Array.isArray(N)){let e=N.filter(e=>im(T.current,e,L)!==-1);e.length!==N.length&&(O(e,n),e.length===0&&(b.set(`selectedIndex`,null),w.current=null))}if(A&&V){b.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};Oh(F,e),Oh(D.current,e)}}),ce=v.useMemo(()=>({...ne,side:H,alignItemWithTriggerActive:V,setControlledAlignItemWithTrigger:B,scrollUpArrowRef:R,scrollDownArrowRef:te}),[ne,H,V,B]);return(0,U.jsx)(ah,{elementsRef:x,labelsRef:S,onMapChange:se,children:(0,U.jsxs)(Th.Provider,{value:ce,children:[j&&M&&(0,U.jsx)(Dh,{inert:nh(!A),cutout:I}),ae]})})}),qh=`base-ui-disable-scrollbar`,Jh={className:qh,getElement(e){return(0,U.jsx)(`style`,{nonce:e,href:qh,precedence:`base-ui:low`,children:`.${qh}{scrollbar-width:none}.${qh}::-webkit-scrollbar{display:none}`})}},Yh=v.createContext(void 0);function Xh(e){let t=v.useContext(Yh);if(t===void 0&&!e)throw Error(Bo(69));return t}var Zh=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Home`,`End`]),Qh=v.createContext(void 0),$h={disableStyleElements:!1};function eg(){return v.useContext(Qh)??$h}var tg={...Lm,...km},ng=v.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,{store:s,popupRef:c,onOpenChangeComplete:l,setOpen:u,valueRef:d,firstItemTextRef:f,selectedItemTextRef:p,multiple:m,handleScrollArrowVisibility:h,scrollHandlerRef:g,listRef:_,highlightItemOnHover:y,floatingContext:b}=Wp(),{side:x,align:S,alignItemWithTriggerActive:C,isPositioned:w,setControlledAlignItemWithTrigger:T}=Eh(),E=Xh(!0)!=null,D=ph(),{nonce:O,disableStyleElements:k}=eg(),A=Qo(s,pm.id),j=Qo(s,pm.open),M=Qo(s,pm.openMethod),N=Qo(s,pm.mounted),P=Qo(s,pm.popupProps),F=Qo(s,pm.transitionStatus),I=Qo(s,pm.triggerElement),L=Qo(s,pm.positionerElement),ee=Qo(s,pm.listElement),R=v.useRef(!1),te=v.useRef(!1),z=v.useRef({}),B=zs(),V=Po(e=>{if(!L||!c.current||!te.current)return;let t=L.style.top===`0px`,n=L.style.bottom===`0px`;if(R.current||!C||!t&&!n){h(e);return}let r=ag(L),i=og(L.getBoundingClientRect().height,`y`,r),a=Ns(L),o=ls(L),s=o.getComputedStyle(L),l=parseFloat(s.marginTop),u=parseFloat(s.marginBottom),d=rg(o.getComputedStyle(c.current)),f=Math.min(a.documentElement.clientHeight-l-u,d),p=e.scrollTop,m=ig(e),g=null,_=e=>{L.style.height=`${e}px`},v=t?m-p:p,y=Math.min(i+v,f);if(v<=1){let n=xm(v,0,f-i);n>0&&_(i+n),e.scrollTop=t?m:0,f-(i+n)<=1&&(R.current=!0),h(e);return}f-y>1?g=t?1/0:0:n&&p<m&&(g=p-(v-(i+v-f)));let b=Math.ceil(y);if(b!==0&&_(b),g!=null){let t=xm(g,0,ig(e));Math.abs(e.scrollTop-t)>1&&(e.scrollTop=t)}b>=f-1&&(R.current=!0),h(e)});v.useImperativeHandle(g,()=>V,[V]),Hf({open:j,ref:c,onComplete(){j&&l?.(!0)}});let ne={open:j,transitionStatus:F,side:x,align:S};Ao(()=>{!L||!c.current||Object.keys(z.current).length||(z.current={top:L.style.top||`0`,left:L.style.left||`0`,right:L.style.right,height:L.style.height,bottom:L.style.bottom,minHeight:L.style.minHeight,maxHeight:L.style.maxHeight,marginTop:L.style.marginTop,marginBottom:L.style.marginBottom})},[c,L]),Ao(()=>{j||C||(te.current=!1,R.current=!1,Oh(L,z.current))},[j,C,L,c]),Ao(()=>{let e=c.current;if(!j||!I||!L||!e||C&&!w||s.state.transitionStatus===`ending`)return;if(te.current=!0,e.style.removeProperty(`--transform-origin`),!C){B.request(()=>h(ee||e));return}let t=lg(e);try{let t=p.current;t?.isConnected||(t=!pm.hasSelectedValue(s.state)&&f.current?.isConnected?f.current:null);let n=d.current,r=ls(L),i=r.getComputedStyle(L),a=r.getComputedStyle(e),o=Ns(I),c=ag(I),l=sg(I.getBoundingClientRect(),c),u=sg(L.getBoundingClientRect(),c),m=l.height,g=ee||e,v=g.scrollHeight,b=parseFloat(a.borderBottomWidth),x=parseFloat(i.marginTop)||10,S=parseFloat(i.marginBottom)||10,C=parseFloat(i.minHeight)||100,w=rg(a),E=o.documentElement.clientHeight-x-S,O=o.documentElement.clientWidth,k=E-l.bottom+m,A,j=D===`rtl`?l.right-u.width:l.left,M=0;if(t&&n){let e=sg(n.getBoundingClientRect(),c);A=sg(t.getBoundingClientRect(),c),j=u.left+(D===`rtl`?e.right-A.right:e.left-A.left);let r=e.top-l.top+e.height/2;M=A.top-u.top+A.height/2-r}let N=k+M+S+b,P=Math.min(E,N),F=E-x-S,te=N-P,B=O-5;L.style.left=`${xm(j,5,B-u.width)}px`,L.style.height=`${P}px`,L.style.maxHeight=`none`,L.style.marginTop=`${x}px`,L.style.marginBottom=`${S}px`,e.style.height=`100%`;let V=ig(g),ne=te>=V-1;ne&&(P=Math.min(E,u.height)-(te-V));let H=l.top<20||l.bottom>E-20||Math.ceil(P)+1<Math.min(v,C),re=(r.visualViewport?.scale??1)!==1&&ec;if(H||re){Oh(L,z.current),T(!1);return}let ie=Math.max(C,P);if(ne){let e=Math.max(0,E-N);L.style.top=u.height>=F?`0`:`${e}px`,L.style.height=`${P}px`,g.scrollTop=ig(g)}else L.style.bottom=`0`,g.scrollTop=te;if(A){let t=u.top,n=u.height,r=A.top+A.height/2,i=xm(n>0?(r-t)/n*100:50,0,100);e.style.setProperty(`--transform-origin`,`50% ${i}%`)}(ie===E||P>=w)&&(R.current=!0),h(g),y&&s.state.selectedIndex===null&&s.state.activeIndex===null&&_.current[0]!=null&&s.set(`activeIndex`,0)}finally{t()}},[s,j,L,I,d,f,p,c,h,C,T,B,ee,_,y,D,w]),v.useEffect(()=>{if(!C||!L||!j)return;let e=ls(L);function t(e){u(!1,Kc(Gc,e))}return Ps(e,`resize`,t)},[u,C,L,j]);let H={...ee?{role:`presentation`,"aria-orientation":void 0}:{role:`listbox`,"aria-multiselectable":m||void 0,id:`${A}-list`},onKeyDown(e){E&&Zh.has(e.key)&&e.stopPropagation()},onScroll(e){ee||V(e.currentTarget)},...C&&{style:ee?{height:`100%`}:kh},className:!ee&&C?Jh.className:void 0},re=Wu(`div`,e,{ref:[t,c],state:ne,stateAttributesMapping:tg,props:[P,H,Ah(F),o]});return(0,U.jsxs)(v.Fragment,{children:[!k&&Jh.getElement(O),(0,U.jsx)(Td,{context:b,modal:!1,disabled:!N,openInteractionType:M,returnFocus:a,restoreFocus:!0,children:re})]})});function rg(e){let t=e.maxHeight;return t.endsWith(`px`)&&parseFloat(t)||1/0}function ig(e){return Sm(e.scrollHeight,e.clientHeight)}function ag(e){return gf.getScale(e)}function og(e,t,n){return e/n[t]}function sg(e,t){return wl({x:og(e.x,`x`,t),y:og(e.y,`y`,t),width:og(e.width,`x`,t),height:og(e.height,`y`,t)})}var cg=[[`transform`,`none`],[`scale`,`1`],[`translate`,`0 0`]];function lg(e){let{style:t}=e,n={};for(let[e,r]of cg)n[e]=t.getPropertyValue(e),t.setProperty(e,r,`important`);return()=>{for(let[e]of cg){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}function ug(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=ih(),u=v.useRef(-1),[d,f]=v.useState(a==null&&t?()=>{if(u.current===-1){let e=l.current;l.current+=1,u.current=e}return u.current}:-1),p=a??d,m=v.useRef(null),h=v.useCallback(e=>{let t=m.current;t&&s(t),m.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return Ao(()=>{if(a==null)return c(e=>{let t=m.current?e.get(m.current)?.index:null;t!=null&&f(t)})},[a,c]),{ref:h,index:p}}var dg=v.createContext(void 0);function fg(){let e=v.useContext(dg);if(!e)throw Error(Bo(57));return e}var pg=v.memo(v.forwardRef(function(e,t){let{render:n,className:r,style:i,value:a=null,label:o,disabled:s=!1,nativeButton:c=!1,...l}=e,u=v.useRef(null),d=ug({guess:!0,label:o,textRef:u}),{store:f,itemProps:p,setOpen:m,setValue:h,selectionRef:g,typingRef:_,valuesRef:y,multiple:b,selectedItemTextRef:x,disabled:S,readOnly:C}=Wp(),w=S||s,T=Qo(f,pm.isActive,d.index),E=Qo(f,pm.open),D=Qo(f,pm.isSelected,a),O=Qo(f,pm.isSelectedByFocus,d.index),k=Qo(f,pm.isItemEqualToValue),A=d.index,j=v.useRef(null);Ao(()=>{let e=y.current;return e[A]=a,()=>{delete e[A]}},[A,a,y]),Ao(()=>{let e=f.state.value,t=e;b&&Array.isArray(e)&&(t=e.length>0?e[e.length-1]:void 0),t!==void 0&&rm(a,t,k)&&(f.set(`selectedIndex`,A),u.current&&(x.current=u.current))},[A,b,k,f,a,x]);let M=v.useRef(`mouse`),N=v.useRef(!1),{getButtonProps:P,buttonRef:F}=Km({disabled:w,focusableWhenDisabled:!0,native:c,composite:!0}),I={disabled:w,selected:D,highlighted:T};function L(e){if(S||C)return;let t=f.state.value;if(b){let n=Array.isArray(t)?t:[],r=D?am(n,a,k):[...n,a];h(r,Kc(Ic,e))}else h(a,Kc(Ic,e)),m(!1,Kc(Ic,e))}function ee(){g.current.dragY=0}let R={role:`option`,"aria-selected":D,tabIndex:E&&T?0:-1,onKeyDown(e){f.set(`activeIndex`,A),e.key===` `&&_.current&&e.preventDefault()},onClick(e){let t=M.current!==`touch`,n=e.nativeEvent.pointerType,r=t&&ac(e.nativeEvent)&&(n!==void 0||T),i=t&&!r&&!N.current;N.current=!1,!(w||i)&&L(e.nativeEvent)},onPointerEnter(e){M.current=e.pointerType},onPointerMove(e){if(e.pointerType===`mouse`&&e.buttons===1){let t=g.current;t.dragY+=e.movementY,t.dragY**2>=64&&(t.allowUnselectedMouseUp=!0)}},onPointerDown(e){M.current=e.pointerType,N.current=!0,ee()},onMouseUp(){if(ee(),w||M.current===`touch`||N.current)return;let e=!g.current.allowSelectedMouseUp&&D,t=!g.current.allowUnselectedMouseUp&&!D;e||t||(N.current=!0,j.current?.click(),N.current=!1)}},te=Wu(`div`,e,{ref:[F,t,d.ref,j],state:I,props:[p,R,l,P]}),z=v.useMemo(()=>({selected:D,index:A,textRef:u,selectedByFocus:O}),[D,A,u,O]);return(0,U.jsx)(dg.Provider,{value:z,children:te})})),mg=v.forwardRef(function(e,t){let{selected:n}=fg();return e.keepMounted||n?(0,U.jsx)(hg,{...e,ref:t}):null}),hg=v.memo(v.forwardRef((e,t)=>{let{render:n,className:r,style:i,keepMounted:a,...o}=e,{selected:s}=fg(),c=v.useRef(null),{transitionStatus:l,setMounted:u}=Bf(s),d=Wu(`span`,e,{ref:[t,c],state:{selected:s,transitionStatus:l},props:[{"aria-hidden":!0,children:`✔️`},o],stateAttributesMapping:km});return Hf({open:s,ref:c,onComplete(){s||u(!1)}}),d})),gg=v.memo(v.forwardRef(function(e,t){let{index:n,textRef:r,selectedByFocus:i}=fg(),{firstItemTextRef:a,selectedItemTextRef:o}=Wp(),{render:s,className:c,style:l,...u}=e;return Wu(`div`,e,{ref:[v.useCallback(e=>{e&&(n===0&&(a.current=e),i&&(o.current=e))},[a,o,n,i]),t,r],props:u})})),_g=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),vg=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),yg=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),bg=e=>{let t=yg(e);return t.charAt(0).toUpperCase()+t.slice(1)},xg={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`},Sg=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Cg=(0,v.createContext)({}),wg=()=>(0,v.useContext)(Cg),Tg=(0,v.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=wg()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,v.createElement)(`svg`,{ref:c,...xg,width:t??l??xg.width,height:t??l??xg.height,stroke:e??f,strokeWidth:m,className:_g(`lucide`,p,i),...!a&&!Sg(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,v.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),G=(e,t)=>{let n=(0,v.forwardRef)(({className:n,...r},i)=>(0,v.createElement)(Tg,{ref:i,iconNode:t,className:_g(`lucide-${vg(bg(e))}`,`lucide-${e}`,n),...r}));return n.displayName=bg(e),n},Eg=G(`anchor`,[[`path`,{d:`M12 6v16`,key:`nqf5sj`}],[`path`,{d:`m19 13 2-1a9 9 0 0 1-18 0l2 1`,key:`y7qv08`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}],[`circle`,{cx:`12`,cy:`4`,r:`2`,key:`muu5ef`}]]),Dg=G(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),Og=G(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),kg=G(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),Ag=G(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),jg=G(`at-sign`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8`,key:`7n84p3`}]]),Mg=G(`atom`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`path`,{d:`M20.2 20.2c2.04-2.03.02-7.36-4.5-11.9-4.54-4.52-9.87-6.54-11.9-4.5-2.04 2.03-.02 7.36 4.5 11.9 4.54 4.52 9.87 6.54 11.9 4.5Z`,key:`1l2ple`}],[`path`,{d:`M15.7 15.7c4.52-4.54 6.54-9.87 4.5-11.9-2.03-2.04-7.36-.02-11.9 4.5-4.52 4.54-6.54 9.87-4.5 11.9 2.03 2.04 7.36.02 11.9-4.5Z`,key:`1wam0m`}]]),Ng=G(`beaker`,[[`path`,{d:`M4.5 3h15`,key:`c7n0jr`}],[`path`,{d:`M6 3v16a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V3`,key:`m1uhx7`}],[`path`,{d:`M6 14h12`,key:`4cwo0f`}]]),Pg=G(`bell-ring`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M22 8c0-2.3-.8-4.3-2-6`,key:`5bb3ad`}],[`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`}],[`path`,{d:`M4 2C2.8 3.7 2 5.7 2 8`,key:`tap9e0`}]]),Fg=G(`bike`,[[`circle`,{cx:`18.5`,cy:`17.5`,r:`3.5`,key:`15x4ox`}],[`circle`,{cx:`5.5`,cy:`17.5`,r:`3.5`,key:`1noe27`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`path`,{d:`M12 17.5V14l-3-3 4-3 2 3h2`,key:`1npguv`}]]),Ig=G(`binary`,[[`rect`,{x:`14`,y:`14`,width:`4`,height:`6`,rx:`2`,key:`p02svl`}],[`rect`,{x:`6`,y:`4`,width:`4`,height:`6`,rx:`2`,key:`xm4xkj`}],[`path`,{d:`M6 20h4`,key:`1i6q5t`}],[`path`,{d:`M14 10h4`,key:`ru81e7`}],[`path`,{d:`M6 14h2v6`,key:`16z9wg`}],[`path`,{d:`M14 4h2v6`,key:`1idq9u`}]]),Lg=G(`blocks`,[[`path`,{d:`M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2`,key:`1ah6g2`}],[`rect`,{x:`14`,y:`2`,width:`8`,height:`8`,rx:`1`,key:`88lufb`}]]),Rg=G(`bot`,[[`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`}]]),zg=G(`box`,[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]),Bg=G(`brain`,[[`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`}]]),Vg=G(`briefcase`,[[`path`,{d:`M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16`,key:`jecpp`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`6`,rx:`2`,key:`i6l2r4`}]]),Hg=G(`brush`,[[`path`,{d:`m11 10 3 3`,key:`fzmg1i`}],[`path`,{d:`M6.5 21A3.5 3.5 0 1 0 3 17.5a2.62 2.62 0 0 1-.708 1.792A1 1 0 0 0 3 21z`,key:`p4q2r7`}],[`path`,{d:`M9.969 17.031 21.378 5.624a1 1 0 0 0-3.002-3.002L6.967 14.031`,key:`wy6l02`}]]),Ug=G(`bug`,[[`path`,{d:`M12 20v-9`,key:`1qisl0`}],[`path`,{d:`M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z`,key:`uouzyp`}],[`path`,{d:`M14.12 3.88 16 2`,key:`qol33r`}],[`path`,{d:`M21 21a4 4 0 0 0-3.81-4`,key:`1b0z45`}],[`path`,{d:`M21 5a4 4 0 0 1-3.55 3.97`,key:`5cxbf6`}],[`path`,{d:`M22 13h-4`,key:`1jl80f`}],[`path`,{d:`M3 21a4 4 0 0 1 3.81-4`,key:`1fjd4g`}],[`path`,{d:`M3 5a4 4 0 0 0 3.55 3.97`,key:`1d7oge`}],[`path`,{d:`M6 13H2`,key:`82j7cp`}],[`path`,{d:`m8 2 1.88 1.88`,key:`fmnt4t`}],[`path`,{d:`M9 7.13V6a3 3 0 1 1 6 0v1.13`,key:`1vgav8`}]]),Wg=G(`building-2`,[[`path`,{d:`M10 12h4`,key:`a56b0p`}],[`path`,{d:`M10 8h4`,key:`1sr2af`}],[`path`,{d:`M14 21v-3a2 2 0 0 0-4 0v3`,key:`1rgiei`}],[`path`,{d:`M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2`,key:`secmi2`}],[`path`,{d:`M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16`,key:`16ra0t`}]]),Gg=G(`cable`,[[`path`,{d:`M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z`,key:`trhst0`}],[`path`,{d:`M17 21v-2`,key:`ds4u3f`}],[`path`,{d:`M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10`,key:`1mo9zo`}],[`path`,{d:`M21 21v-2`,key:`eo0ou`}],[`path`,{d:`M3 5V3`,key:`1k5hjh`}],[`path`,{d:`M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z`,key:`1dd30t`}],[`path`,{d:`M7 5V3`,key:`1t1388`}]]),Kg=G(`calendar-clock`,[[`path`,{d:`M16 14v2.2l1.6 1`,key:`fo4ql5`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`path`,{d:`M21 7.338V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h2.338`,key:`7hb8p4`}],[`path`,{d:`M3 9h5.859`,key:`numkqi`}],[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`circle`,{cx:`16`,cy:`16`,r:`6`,key:`qoo3c4`}]]),qg=G(`camera`,[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]),Jg=G(`car`,[[`path`,{d:`M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2`,key:`5owen`}],[`circle`,{cx:`7`,cy:`17`,r:`2`,key:`u2ysq9`}],[`path`,{d:`M9 17h6`,key:`r8uit2`}],[`circle`,{cx:`17`,cy:`17`,r:`2`,key:`axvx0g`}]]),Yg=G(`cat`,[[`path`,{d:`M12 5c.67 0 1.35.09 2 .26 1.78-2 5.03-2.84 6.42-2.26 1.4.58-.42 7-.42 7 .57 1.07 1 2.24 1 3.44C21 17.9 16.97 21 12 21s-9-3-9-7.56c0-1.25.5-2.4 1-3.44 0 0-1.89-6.42-.5-7 1.39-.58 4.72.23 6.5 2.23A9.04 9.04 0 0 1 12 5Z`,key:`x6xyqk`}],[`path`,{d:`M8 14v.5`,key:`1nzgdb`}],[`path`,{d:`M16 14v.5`,key:`1lajdz`}],[`path`,{d:`M11.25 16.25h1.5L12 17l-.75-.75Z`,key:`12kq1m`}]]),Xg=G(`chart-pie`,[[`path`,{d:`M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z`,key:`pzmjnu`}],[`path`,{d:`M21.21 15.89A10 10 0 1 1 8 2.83`,key:`k2fpak`}]]),Zg=G(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Qg=G(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),$g=G(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),e_=G(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),t_=G(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),n_=G(`circle-alert`,[[`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`}]]),r_=G(`circle-arrow-down`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 8v8`,key:`napkw2`}],[`path`,{d:`m8 12 4 4 4-4`,key:`k98ssh`}]]),i_=G(`circle-pause`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`10`,x2:`10`,y1:`15`,y2:`9`,key:`c1nkhi`}],[`line`,{x1:`14`,x2:`14`,y1:`15`,y2:`9`,key:`h65svq`}]]),a_=G(`circle-slash`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`9`,x2:`15`,y1:`15`,y2:`9`,key:`1dfufj`}]]),o_=G(`circuit-board`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M11 9h4a2 2 0 0 0 2-2V3`,key:`1ve2rv`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`M7 21v-4a2 2 0 0 1 2-2h4`,key:`1fwkro`}],[`circle`,{cx:`15`,cy:`15`,r:`2`,key:`3i40o0`}]]),s_=G(`clipboard-list`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`M12 11h4`,key:`1jrz19`}],[`path`,{d:`M12 16h4`,key:`n85exb`}],[`path`,{d:`M8 11h.01`,key:`1dfujw`}],[`path`,{d:`M8 16h.01`,key:`18s6g9`}]]),c_=G(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),l_=G(`cloud`,[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]),u_=G(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),d_=G(`coffee`,[[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M14 2v2`,key:`6buw04`}],[`path`,{d:`M16 8a1 1 0 0 1 1 1v8a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1h14a4 4 0 1 1 0 8h-1`,key:`pwadti`}],[`path`,{d:`M6 2v2`,key:`colzsn`}]]),f_=G(`cog`,[[`path`,{d:`M11 10.27 7 3.34`,key:`16pf9h`}],[`path`,{d:`m11 13.73-4 6.93`,key:`794ttg`}],[`path`,{d:`M12 22v-2`,key:`1osdcq`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M14 12h8`,key:`4f43i9`}],[`path`,{d:`m17 20.66-1-1.73`,key:`eq3orb`}],[`path`,{d:`m17 3.34-1 1.73`,key:`2wel8s`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`m20.66 17-1.73-1`,key:`sg0v6f`}],[`path`,{d:`m20.66 7-1.73 1`,key:`1ow05n`}],[`path`,{d:`m3.34 17 1.73-1`,key:`nuk764`}],[`path`,{d:`m3.34 7 1.73 1`,key:`1ulond`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`circle`,{cx:`12`,cy:`12`,r:`8`,key:`46899m`}]]),p_=G(`compass`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z`,key:`9ktpf1`}]]),m_=G(`container`,[[`path`,{d:`M22 7.7c0-.6-.4-1.2-.8-1.5l-6.3-3.9a1.72 1.72 0 0 0-1.7 0l-10.3 6c-.5.2-.9.8-.9 1.4v6.6c0 .5.4 1.2.8 1.5l6.3 3.9a1.72 1.72 0 0 0 1.7 0l10.3-6c.5-.3.9-1 .9-1.5Z`,key:`1t2lqe`}],[`path`,{d:`M10 21.9V14L2.1 9.1`,key:`o7czzq`}],[`path`,{d:`m10 14 11.9-6.9`,key:`zm5e20`}],[`path`,{d:`M14 19.8v-8.1`,key:`159ecu`}],[`path`,{d:`M18 17.5V9.4`,key:`11uown`}]]),h_=G(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),g_=G(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),__=G(`credit-card`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`5`,rx:`2`,key:`ynyp8z`}],[`line`,{x1:`2`,x2:`22`,y1:`10`,y2:`10`,key:`1b3vmo`}]]),v_=G(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),y_=G(`diamond`,[[`path`,{d:`M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z`,key:`1f1r0c`}]]),b_=G(`dog`,[[`path`,{d:`M11.25 16.25h1.5L12 17z`,key:`w7jh35`}],[`path`,{d:`M16 14v.5`,key:`1lajdz`}],[`path`,{d:`M4.42 11.247A13.152 13.152 0 0 0 4 14.556C4 18.728 7.582 21 12 21s8-2.272 8-6.444a11.702 11.702 0 0 0-.493-3.309`,key:`u7s9ue`}],[`path`,{d:`M8 14v.5`,key:`1nzgdb`}],[`path`,{d:`M8.5 8.5c-.384 1.05-1.083 2.028-2.344 2.5-1.931.722-3.576-.297-3.656-1-.113-.994 1.177-6.53 4-7 1.923-.321 3.651.845 3.651 2.235A7.497 7.497 0 0 1 14 5.277c0-1.39 1.844-2.598 3.767-2.277 2.823.47 4.113 6.006 4 7-.08.703-1.725 1.722-3.656 1-1.261-.472-1.855-1.45-2.239-2.5`,key:`v8hric`}]]),x_=G(`dot`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}]]),S_=G(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),C_=G(`ellipsis`,[[`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`}]]),w_=G(`eraser`,[[`path`,{d:`M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21`,key:`g5wo59`}],[`path`,{d:`m5.082 11.09 8.828 8.828`,key:`1wx5vj`}]]),T_=G(`feather`,[[`path`,{d:`M14.086 18.412A2 2 0 0112.67 19H5v-7.672a2 2 0 01.586-1.414L11.75 3.75a6 6 0 118.49 8.49z`,key:`1nq9jb`}],[`path`,{d:`M16 8 2 22`,key:`vp34q`}],[`path`,{d:`M17.488 15H9`,key:`16yirz`}]]),E_=G(`file-diff`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M9 10h6`,key:`9gxzsh`}],[`path`,{d:`M12 13V7`,key:`h0r20n`}],[`path`,{d:`M9 17h6`,key:`r8uit2`}]]),D_=G(`file-exclamation-point`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),O_=G(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),k_=G(`file`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]),A_=G(`film`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M7 3v18`,key:`bbkbws`}],[`path`,{d:`M3 7.5h4`,key:`zfgn84`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`path`,{d:`M3 16.5h4`,key:`1230mu`}],[`path`,{d:`M17 3v18`,key:`in4fa5`}],[`path`,{d:`M17 7.5h4`,key:`myr1c1`}],[`path`,{d:`M17 16.5h4`,key:`go4c1d`}]]),j_=G(`flame`,[[`path`,{d:`M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4`,key:`1slcih`}]]),M_=G(`flask-conical`,[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]),N_=G(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),P_=G(`folder-search`,[[`path`,{d:`M10.7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v4.1`,key:`1bw5m7`}],[`path`,{d:`m21 21-1.9-1.9`,key:`1g2n9r`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}]]),F_=G(`folder-tree`,[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`hod4my`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`w4yl2u`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`,key:`f2jnh7`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`,key:`k8epm1`}]]),I_=G(`folder`,[[`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`}]]),L_=G(`funnel`,[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]]),R_=G(`gamepad-2`,[[`line`,{x1:`6`,x2:`10`,y1:`11`,y2:`11`,key:`1gktln`}],[`line`,{x1:`8`,x2:`8`,y1:`9`,y2:`13`,key:`qnk9ow`}],[`line`,{x1:`15`,x2:`15.01`,y1:`12`,y2:`12`,key:`krot7o`}],[`line`,{x1:`18`,x2:`18.01`,y1:`10`,y2:`10`,key:`1lcuu1`}],[`path`,{d:`M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z`,key:`mfqc10`}]]),z_=G(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),B_=G(`gem`,[[`path`,{d:`M10.5 3 8 9l4 13 4-13-2.5-6`,key:`b3dvk1`}],[`path`,{d:`M17 3a2 2 0 0 1 1.6.8l3 4a2 2 0 0 1 .013 2.382l-7.99 10.986a2 2 0 0 1-3.247 0l-7.99-10.986A2 2 0 0 1 2.4 7.8l2.998-3.997A2 2 0 0 1 7 3z`,key:`7w4byz`}],[`path`,{d:`M2 9h20`,key:`16fsjt`}]]),V_=G(`gift`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M20 11v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-8`,key:`1sqzm4`}],[`path`,{d:`M7.5 7a1 1 0 0 1 0-5A4.8 8 0 0 1 12 7a4.8 8 0 0 1 4.5-5 1 1 0 0 1 0 5`,key:`kc0143`}],[`rect`,{x:`3`,y:`7`,width:`18`,height:`4`,rx:`1`,key:`1hberx`}]]),H_=G(`ghost`,[[`path`,{d:`M15 10v1`,key:`oj8wfp`}],[`path`,{d:`M7.528 20.472a1.6 1.6 0 012.277 0l1.057 1.056a1.6 1.6 0 002.276 0l1.057-1.056a1.6 1.6 0 012.277 0l1.114 1.114a1.4 1.4 0 002.414-1V10a8 8 0 00-16 0v10.586a1.4 1.4 0 002.414 1z`,key:`13lou3`}],[`path`,{d:`M9 10v1`,key:`1e14fa`}]]),U_=G(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),W_=G(`globe`,[[`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`}]]),G_=G(`graduation-cap`,[[`path`,{d:`M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z`,key:`j76jl0`}],[`path`,{d:`M22 10v6`,key:`1lu8f3`}],[`path`,{d:`M6 12.5V16a6 3 0 0 0 12 0v-3.5`,key:`1r8lef`}]]),K_=G(`hammer`,[[`path`,{d:`m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9`,key:`1hayfq`}],[`path`,{d:`m18 15 4-4`,key:`16gjal`}],[`path`,{d:`m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5`,key:`15ts47`}]]),q_=G(`hand`,[[`path`,{d:`M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2`,key:`1fvzgz`}],[`path`,{d:`M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2`,key:`1kc0my`}],[`path`,{d:`M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8`,key:`10h0bg`}],[`path`,{d:`M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15`,key:`1s1gnw`}]]),J_=G(`hexagon`,[[`path`,{d:`M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z`,key:`yt0hxn`}]]),Y_=G(`house`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]]),X_=G(`id-card`,[[`path`,{d:`M16 10h2`,key:`8sgtl7`}],[`path`,{d:`M16 14h2`,key:`epxaof`}],[`path`,{d:`M6.17 15a3 3 0 0 1 5.66 0`,key:`n6f512`}],[`circle`,{cx:`9`,cy:`11`,r:`2`,key:`yxgjnd`}],[`rect`,{x:`2`,y:`5`,width:`20`,height:`14`,rx:`2`,key:`qneu4z`}]]),Z_=G(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),Q_=G(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),$_=G(`key`,[[`path`,{d:`m2 21 9.6-9.6`,key:`9l79m3`}],[`path`,{d:`m7.5 15.5 2.3 2.3a1 1 0 0 1 0 1.4l-2.1 2.1a1 1 0 0 1-1.4 0L4 19`,key:`fw8biw`}],[`circle`,{cx:`15.5`,cy:`7.5`,r:`5.5`,key:`4wxmhb`}]]),ev=G(`landmark`,[[`path`,{d:`M10 18v-7`,key:`wt116b`}],[`path`,{d:`M11.119 2.205a2 2 0 0 1 1.762 0l7.84 3.846A.5.5 0 0 1 20.5 7h-17a.5.5 0 0 1-.22-.949z`,key:`yxxwt6`}],[`path`,{d:`M14 18v-7`,key:`vav6t3`}],[`path`,{d:`M18 18v-7`,key:`aexdmj`}],[`path`,{d:`M3 22h18`,key:`8prr45`}],[`path`,{d:`M6 18v-7`,key:`1ivflk`}]]),tv=G(`laptop`,[[`path`,{d:`M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z`,key:`1pdavp`}],[`path`,{d:`M20.054 15.987H3.946`,key:`14rxg9`}]]),nv=G(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),rv=G(`leaf`,[[`path`,{d:`M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19 2c1 2 2 4.18 2 8 0 5.5-4.78 10-10 10Z`,key:`nnexq3`}],[`path`,{d:`M2 21c0-3 1.85-5.36 5.08-6C9.5 14.52 12 13 13 12`,key:`mt58a7`}]]),iv=G(`library`,[[`path`,{d:`m16 6 4 14`,key:`ji33uf`}],[`path`,{d:`M12 6v14`,key:`1n7gus`}],[`path`,{d:`M8 8v12`,key:`1gg7y9`}],[`path`,{d:`M4 4v16`,key:`6qkkli`}]]),av=G(`lightbulb`,[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]),ov=G(`link-2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]),sv=G(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),cv=G(`list-todo`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`rect`,{x:`3`,y:`4`,width:`6`,height:`6`,rx:`1`,key:`cif1o7`}]]),lv=G(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),uv=G(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),dv=G(`mail`,[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]),fv=G(`map`,[[`path`,{d:`M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z`,key:`169xi5`}],[`path`,{d:`M15 5.764v15`,key:`1pn4in`}],[`path`,{d:`M9 3.236v15`,key:`1uimfh`}]]),pv=G(`message-circle-question-mark`,[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),mv=G(`message-circle`,[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]]),hv=G(`message-square-text`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M7 11h10`,key:`1twpyw`}],[`path`,{d:`M7 15h6`,key:`d9of3u`}],[`path`,{d:`M7 7h8`,key:`af5zfr`}]]),gv=G(`mic`,[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`,key:`1vc78b`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`13`,rx:`3`,key:`s6n7sd`}]]),_v=G(`monitor`,[[`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`}]]),vv=G(`moon`,[[`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`}]]),yv=G(`mountain`,[[`path`,{d:`m8 3 4 8 5-5 5 15H2L8 3z`,key:`otkl63`}]]),bv=G(`music`,[[`path`,{d:`M9 18V5l12-2v13`,key:`1jmyc2`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`circle`,{cx:`18`,cy:`16`,r:`3`,key:`1hluhg`}]]),xv=G(`network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]),Sv=G(`newspaper`,[[`path`,{d:`M15 18h-5`,key:`95g1m2`}],[`path`,{d:`M18 14h-8`,key:`sponae`}],[`path`,{d:`M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-4 0v-9a2 2 0 0 1 2-2h2`,key:`39pd36`}],[`rect`,{width:`8`,height:`4`,x:`10`,y:`6`,rx:`1`,key:`aywv1n`}]]),Cv=G(`notebook`,[[`path`,{d:`M2 6h4`,key:`aawbzj`}],[`path`,{d:`M2 10h4`,key:`l0bgd4`}],[`path`,{d:`M2 14h4`,key:`1gsvsf`}],[`path`,{d:`M2 18h4`,key:`1bu2t1`}],[`rect`,{width:`16`,height:`20`,x:`4`,y:`2`,rx:`2`,key:`1nb95v`}],[`path`,{d:`M16 2v20`,key:`rotuqe`}]]),wv=G(`orbit`,[[`path`,{d:`M20.341 6.484A10 10 0 0 1 10.266 21.85`,key:`1enhxb`}],[`path`,{d:`M3.659 17.516A10 10 0 0 1 13.74 2.152`,key:`1crzgf`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`circle`,{cx:`19`,cy:`5`,r:`2`,key:`mhkx31`}],[`circle`,{cx:`5`,cy:`19`,r:`2`,key:`v8kfzx`}]]),Tv=G(`package`,[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]]),Ev=G(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),Dv=G(`panel-left-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m14 9 3 3-3 3`,key:`8010ee`}]]),Ov=G(`panel-left-close`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m16 15-3-3 3-3`,key:`14y99z`}]]),kv=G(`paperclip`,[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]),Av=G(`pen-tool`,[[`path`,{d:`M15.707 21.293a1 1 0 0 1-1.414 0l-1.586-1.586a1 1 0 0 1 0-1.414l5.586-5.586a1 1 0 0 1 1.414 0l1.586 1.586a1 1 0 0 1 0 1.414z`,key:`nt11vn`}],[`path`,{d:`m18 13-1.375-6.874a1 1 0 0 0-.746-.776L3.235 2.028a1 1 0 0 0-1.207 1.207L5.35 15.879a1 1 0 0 0 .776.746L13 18`,key:`15qc1e`}],[`path`,{d:`m2.3 2.3 7.286 7.286`,key:`1wuzzi`}],[`circle`,{cx:`11`,cy:`11`,r:`2`,key:`xmgehs`}]]),jv=G(`pencil-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}],[`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`}]]),Mv=G(`pencil`,[[`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`}]]),Nv=G(`phone`,[[`path`,{d:`M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384`,key:`9njp5v`}]]),Pv=G(`piggy-bank`,[[`path`,{d:`M11 17h3v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-3a3.16 3.16 0 0 0 2-2h1a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1h-1a5 5 0 0 0-2-4V3a4 4 0 0 0-3.2 1.6l-.3.4H11a6 6 0 0 0-6 6v1a5 5 0 0 0 2 4v3a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1z`,key:`1piglc`}],[`path`,{d:`M16 10h.01`,key:`1m94wz`}],[`path`,{d:`M2 8v1a2 2 0 0 0 2 2h1`,key:`1env43`}]]),Fv=G(`plane`,[[`path`,{d:`M17.8 19.2 16 11l3.5-3.5C21 6 21.5 4 21 3c-1-.5-3 0-4.5 1.5L13 8 4.8 6.2c-.5-.1-.9.1-1.1.5l-.3.5c-.2.5-.1 1 .3 1.3L9 12l-2 3H4l-1 1 3 2 2 3 1-1v-3l3-2 3.5 5.3c.3.4.8.5 1.3.3l.5-.2c.4-.3.6-.7.5-1.2z`,key:`1v9wt8`}]]),Iv=G(`plug`,[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]),Lv=G(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Rv=G(`power-off`,[[`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`}]]),zv=G(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),Bv=G(`puzzle`,[[`path`,{d:`M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z`,key:`w46dr5`}]]),Vv=G(`radar`,[[`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`}]]),Hv=G(`radio`,[[`path`,{d:`M16.247 7.761a6 6 0 0 1 0 8.478`,key:`1fwjs5`}],[`path`,{d:`M19.075 4.933a10 10 0 0 1 0 14.134`,key:`ehdyv1`}],[`path`,{d:`M4.925 19.067a10 10 0 0 1 0-14.134`,key:`1q22gi`}],[`path`,{d:`M7.753 16.239a6 6 0 0 1 0-8.478`,key:`r2q7qm`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),Uv=G(`receipt`,[[`path`,{d:`M12 17V7`,key:`pyj7ub`}],[`path`,{d:`M16 8h-6a2 2 0 0 0 0 4h4a2 2 0 0 1 0 4H8`,key:`1elt7d`}],[`path`,{d:`M4 3a1 1 0 0 1 1-1 1.3 1.3 0 0 1 .7.2l.933.6a1.3 1.3 0 0 0 1.4 0l.934-.6a1.3 1.3 0 0 1 1.4 0l.933.6a1.3 1.3 0 0 0 1.4 0l.933-.6a1.3 1.3 0 0 1 1.4 0l.934.6a1.3 1.3 0 0 0 1.4 0l.933-.6A1.3 1.3 0 0 1 19 2a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1 1.3 1.3 0 0 1-.7-.2l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.934.6a1.3 1.3 0 0 1-1.4 0l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-1.4 0l-.934-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-.7.2 1 1 0 0 1-1-1z`,key:`ycz6yz`}]]),Wv=G(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),Gv=G(`rocket`,[[`path`,{d:`M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5`,key:`qeys4`}],[`path`,{d:`M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09`,key:`u4xsad`}],[`path`,{d:`M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z`,key:`676m9`}],[`path`,{d:`M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05`,key:`92ym6u`}]]),Kv=G(`rotate-ccw-clock`,[[`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`}]]),qv=G(`rotate-ccw`,[[`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`}]]),Jv=G(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]),Yv=G(`ruler`,[[`path`,{d:`M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z`,key:`icamh8`}],[`path`,{d:`m14.5 12.5 2-2`,key:`inckbg`}],[`path`,{d:`m11.5 9.5 2-2`,key:`fmmyf7`}],[`path`,{d:`m8.5 6.5 2-2`,key:`vc6u1g`}],[`path`,{d:`m17.5 15.5 2-2`,key:`wo5hmg`}]]),Xv=G(`satellite`,[[`path`,{d:`m13.5 6.5-3.148-3.148a1.205 1.205 0 0 0-1.704 0L6.352 5.648a1.205 1.205 0 0 0 0 1.704L9.5 10.5`,key:`dzhfyz`}],[`path`,{d:`M16.5 7.5 19 5`,key:`1ltcjm`}],[`path`,{d:`m17.5 10.5 3.148 3.148a1.205 1.205 0 0 1 0 1.704l-2.296 2.296a1.205 1.205 0 0 1-1.704 0L13.5 14.5`,key:`nfoymv`}],[`path`,{d:`M9 21a6 6 0 0 0-6-6`,key:`1iajcf`}],[`path`,{d:`M9.352 10.648a1.205 1.205 0 0 0 0 1.704l2.296 2.296a1.205 1.205 0 0 0 1.704 0l4.296-4.296a1.205 1.205 0 0 0 0-1.704l-2.296-2.296a1.205 1.205 0 0 0-1.704 0z`,key:`nv9zqy`}]]),Zv=G(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),Qv=G(`scale`,[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`path`,{d:`m19 8 3 8a5 5 0 0 1-6 0zV7`,key:`zcdpyk`}],[`path`,{d:`M3 7h1a17 17 0 0 0 8-2 17 17 0 0 0 8 2h1`,key:`1yorad`}],[`path`,{d:`m5 8 3 8a5 5 0 0 1-6 0zV7`,key:`eua70x`}],[`path`,{d:`M7 21h10`,key:`1b0cd5`}]]),$v=G(`scissors`,[[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M8.12 8.12 12 12`,key:`1alkpv`}],[`path`,{d:`M20 4 8.12 15.88`,key:`xgtan2`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M14.8 14.8 20 20`,key:`ptml3r`}]]),ey=G(`search-x`,[[`path`,{d:`m13.5 8.5-5 5`,key:`1cs55j`}],[`path`,{d:`m8.5 8.5 5 5`,key:`a8mexj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]),ty=G(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),ny=G(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),ry=G(`settings`,[[`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`}]]),iy=G(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),ay=G(`shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),oy=G(`ship`,[[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 9.189V13`,key:`yp40p3`}],[`path`,{d:`M19 12V6a2 2 0 00-2-2H7a2 2 0 00-2 2v6`,key:`1wcigf`}],[`path`,{d:`M19.38 19A11.6 11.6 0 0021 13l-8.188-3.639a2 2 0 00-1.624 0L3 13.001a11.6 11.6 0 002.81 7.76`,key:`1kdp0u`}],[`path`,{d:`M2 20c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1s1.2 1 2.5 1c2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1`,key:`1l8w7g`}]]),sy=G(`shopping-cart`,[[`path`,{d:`m2.05 2.05 1.099-.028a1 1 0 0 1 1.008.815l2.69 14.347A1 1 0 0 0 7.83 18H18`,key:`uebgi3`}],[`path`,{d:`M4.563 5h16.435a1 1 0 0 1 .981 1.204l-1.026 6.226A2 2 0 0 1 18.962 14H6.25`,key:`1j7c9p`}],[`circle`,{cx:`18`,cy:`20`,r:`2`,key:`t9985n`}],[`circle`,{cx:`8`,cy:`20`,r:`2`,key:`ckkr5m`}]]),cy=G(`signal`,[[`path`,{d:`M2 20h.01`,key:`4haj6o`}],[`path`,{d:`M7 20v-4`,key:`j294jx`}],[`path`,{d:`M12 20v-8`,key:`i3yub9`}],[`path`,{d:`M17 20V8`,key:`1tkaf5`}],[`path`,{d:`M22 4v16`,key:`sih9yq`}]]),ly=G(`smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),uy=G(`sparkles`,[[`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`}]]),dy=G(`sprout`,[[`path`,{d:`M14 9.536V7a4 4 0 0 1 4-4h1.5a.5.5 0 0 1 .5.5V5a4 4 0 0 1-4 4 4 4 0 0 0-4 4c0 2 1 3 1 5a5 5 0 0 1-1 3`,key:`139s4v`}],[`path`,{d:`M4 9a5 5 0 0 1 8 4 5 5 0 0 1-8-4`,key:`1dlkgp`}],[`path`,{d:`M5 21h14`,key:`11awu3`}]]),fy=G(`square-check-big`,[[`path`,{d:`M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344`,key:`2acyp4`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),py=G(`square-pen`,[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]]),my=G(`square-slash`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`line`,{x1:`9`,x2:`15`,y1:`15`,y2:`9`,key:`1dfufj`}]]),hy=G(`square-terminal`,[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]]),gy=G(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),_y=G(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),vy=G(`sun`,[[`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`}]]),yy=G(`table`,[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M3 15h18`,key:`5xshup`}]]),by=G(`tag`,[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]),xy=G(`target`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`6`,key:`1vlfrh`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),Sy=G(`telescope`,[[`path`,{d:`m10.065 12.493-6.18 1.318a.934.934 0 0 1-1.108-.702l-.537-2.15a1.07 1.07 0 0 1 .691-1.265l13.504-4.44`,key:`k4qptu`}],[`path`,{d:`m13.56 11.747 4.332-.924`,key:`19l80z`}],[`path`,{d:`m16 21-3.105-6.21`,key:`7oh9d`}],[`path`,{d:`M16.485 5.94a2 2 0 0 1 1.455-2.425l1.09-.272a1 1 0 0 1 1.212.727l1.515 6.06a1 1 0 0 1-.727 1.213l-1.09.272a2 2 0 0 1-2.425-1.455z`,key:`m7xp4m`}],[`path`,{d:`m6.158 8.633 1.114 4.456`,key:`74o979`}],[`path`,{d:`m8 21 3.105-6.21`,key:`1fvxut`}],[`circle`,{cx:`12`,cy:`13`,r:`2`,key:`1c1ljs`}]]),Cy=G(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),wy=G(`test-tube`,[[`path`,{d:`M14.5 2v17.5c0 1.4-1.1 2.5-2.5 2.5c-1.4 0-2.5-1.1-2.5-2.5V2`,key:`125lnx`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}],[`path`,{d:`M14.5 16h-5`,key:`1ox875`}]]),Ty=G(`trash-2`,[[`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`}]]),Ey=G(`tree-pine`,[[`path`,{d:`m17 14 3 3.3a1 1 0 0 1-.7 1.7H4.7a1 1 0 0 1-.7-1.7L7 14h-.3a1 1 0 0 1-.7-1.7L9 9h-.2A1 1 0 0 1 8 7.3L12 3l4 4.3a1 1 0 0 1-.8 1.7H15l3 3.3a1 1 0 0 1-.7 1.7H17Z`,key:`cpyugq`}],[`path`,{d:`M12 22v-3`,key:`kmzjlo`}]]),Dy=G(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Oy=G(`trophy`,[[`path`,{d:`M10 14.66V17a1 1 0 0 1-1 1 2 2 0 0 0-2 2v2`,key:`pwuv1l`}],[`path`,{d:`M14 14.66V17a1 1 0 0 0 1 1 2 2 0 0 1 2 2v2`,key:`1y54w1`}],[`path`,{d:`M17.916 10H19.5A2.5 2.5 0 0 0 22 7.5V5a1 1 0 0 0-1-1h-3`,key:`e30mpu`}],[`path`,{d:`M4 22h16`,key:`57wxv0`}],[`path`,{d:`M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z`,key:`1mhfuq`}],[`path`,{d:`M6.084 10H4.5A2.5 2.5 0 0 1 2 7.5V5a1 1 0 0 1 1-1h3`,key:`i0yafy`}]]),ky=G(`truck`,[[`path`,{d:`M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2`,key:`wrbu53`}],[`path`,{d:`M15 18H9`,key:`1lyqi6`}],[`path`,{d:`M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14`,key:`lysw3i`}],[`circle`,{cx:`17`,cy:`18`,r:`2`,key:`332jqn`}],[`circle`,{cx:`7`,cy:`18`,r:`2`,key:`19iecd`}]]),Ay=G(`umbrella`,[[`path`,{d:`M12 13v7a2 2 0 0 0 4 0`,key:`rpgb42`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M20.992 13a1 1 0 0 0 .97-1.274 10.284 10.284 0 0 0-19.923 0A1 1 0 0 0 3 13z`,key:`124nyo`}]]),jy=G(`users-round`,[[`path`,{d:`M18 21a8 8 0 0 0-16 0`,key:`3ypg7q`}],[`circle`,{cx:`10`,cy:`8`,r:`5`,key:`o932ke`}],[`path`,{d:`M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3`,key:`10s06x`}]]),My=G(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),Ny=G(`wallet`,[[`path`,{d:`M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1`,key:`18etb6`}],[`path`,{d:`M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4`,key:`xoc0q4`}]]),Py=G(`wand`,[[`path`,{d:`M15 4V2`,key:`z1p9b7`}],[`path`,{d:`M15 16v-2`,key:`px0unx`}],[`path`,{d:`M8 9h2`,key:`1g203m`}],[`path`,{d:`M20 9h2`,key:`19tzq7`}],[`path`,{d:`M17.8 11.8 19 13`,key:`yihg8r`}],[`path`,{d:`M15 9h.01`,key:`x1ddxp`}],[`path`,{d:`M17.8 6.2 19 5`,key:`fd4us0`}],[`path`,{d:`m3 21 9-9`,key:`1jfql5`}],[`path`,{d:`M12.2 6.2 11 5`,key:`i3da3b`}]]),Fy=G(`waves-horizontal`,[[`path`,{d:`M2 12q2.5 2 5 0t5 0 5 0 5 0`,key:`8ddzzs`}],[`path`,{d:`M2 19q2.5 2 5 0t5 0 5 0 5 0`,key:`1wj4st`}],[`path`,{d:`M2 5q2.5 2 5 0t5 0 5 0 5 0`,key:`69x50u`}]]),Iy=G(`webhook`,[[`path`,{d:`M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2`,key:`q3hayz`}],[`path`,{d:`m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06`,key:`1go1hn`}],[`path`,{d:`m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8`,key:`qlwsc0`}]]),Ly=G(`wifi-off`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Ry=G(`wifi`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M2 8.82a15 15 0 0 1 20 0`,key:`dnpr2z`}],[`path`,{d:`M5 12.859a10 10 0 0 1 14 0`,key:`1x1e6c`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}]]),zy=G(`wrench`,[[`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`}]]),By=G(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Vy=G(`zap`,[[`path`,{d:`M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z`,key:`1v7up4`}]]),Hy=({children:e})=>(0,U.jsx)(`div`,{className:`wd-root`,style:{display:`contents`},children:e}),Uy=wm,Wy=$m,Gy=gg,Ky=({className:e,children:t,...n})=>(0,U.jsxs)(Zm,{"data-slot":`select-trigger`,className:W(`inline-flex h-7 items-center justify-between gap-1.5 rounded-md border border-border bg-bg px-2 text-body-sm text-text`,`transition-colors outline-none hover:border-border-strong focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/40`,`data-popup-open:border-border-strong disabled:pointer-events-none disabled:opacity-50`,e),...n,children:[t,(0,U.jsx)(eh,{className:`text-fg-4`,children:(0,U.jsx)(t_,{className:`size-3.5`})})]}),qy=({className:e,align:t=`start`,alignItemWithTrigger:n=!1,side:r=`bottom`,sideOffset:i=6,...a})=>(0,U.jsx)(th,{children:(0,U.jsx)(Hy,{children:(0,U.jsx)(Kh,{align:t,alignItemWithTrigger:n,side:r,sideOffset:i,className:`isolate z-80 outline-none`,children:(0,U.jsx)(ng,{"data-slot":`select-content`,className:W(`max-h-[min(24rem,var(--available-height))] min-w-[var(--anchor-width)] overflow-y-auto`,`rounded-md border border-border bg-surface p-1 text-fg-1 shadow-(--shadow-lg) outline-none`,e),...a})})})}),Jy=({className:e,children:t,...n})=>(0,U.jsxs)(pg,{"data-slot":`select-item`,className:W(`flex cursor-pointer items-start gap-2 rounded-sm px-2 py-1.5 text-body-sm text-text outline-none select-none`,`data-highlighted:bg-surface-hover`,e),...n,children:[(0,U.jsx)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:t}),(0,U.jsx)(mg,{className:`mt-0.5 text-fg-1`,children:(0,U.jsx)(Zg,{className:`size-3.5`})})]});function Yy({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),i=e.useState(`disablePointerDismissal`),a=e.useState(`modal`),o=e.useState(`popupElement`),s=e.useState(`floatingRootContext`),[c,l]=v.useState(0),[u,d]=v.useState(0),f=c===0,p=Md(s,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:a===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=_c(t);if(f&&!i){if(a){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||gc(n,o)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:f});return Hh(r&&a===!0,o),e.useContextCallback(`onNestedDialogOpen`,(e,t)=>{l(e),d(t)}),Ao(()=>(t?.onNestedDialogOpen&&(r?t.onNestedDialogOpen(c+1,u+ +!!n):t.onNestedDialogOpen(0,0)),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,c,u,t]),ep(e,{activeTriggerProps:p.reference,inactiveTriggerProps:p.trigger,popupProps:p.floating,nestedOpenDialogCount:c,nestedOpenDrawerCount:u}),null}var Xy=v.createContext(void 0);function Zy(e){let t=v.useContext(Xy);if(!e&&t===void 0)throw Error(Bo(27));return t}var Qy={...dp,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role},$y=class extends os{constructor(e,t,n){let r=new np,i=eb(e,r,t,n);super(i,tb(r),Qy)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let n={open:e};Jf(n,e,t.trigger),this.update(n)}};function eb(e,t,n,r=!1){let i={...ip(),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e};return i.floatingRootContext=ap(t,n,r),i}function tb(e){return{popupRef:v.createRef(),backdropRef:v.createRef(),internalBackdropRef:v.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function nb(e,t){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:f=null}=t,p=e===`drawer`,m=e===`alert-dialog`,h=m?!0:c,g=m||s,_=m?`alertdialog`:`dialog`,y=Zy(!0),b={modal:h,disablePointerDismissal:g,nested:y!=null,role:_},x=Gf((e,t)=>new $y({open:i,openProp:r,activeTriggerId:f,triggerIdProp:d,...b},e,t),!0);x.useControlledProp(`openProp`,r),x.useControlledProp(`triggerIdProp`,d),x.useSyncedValues(b),x.useContextCallback(`onOpenChange`,a),x.useContextCallback(`onOpenChangeComplete`,o);let S=x.useState(`open`),C=x.useState(`mounted`),w=x.useState(`payload`);tp(x,S),Qf(x);let{forceUnmount:T}=$f(S,x);v.useImperativeHandle(l,()=>({unmount:T,close:()=>x.setOpen(!1,Kc(Wc))}),[T,x]);let E=S||C;return(0,U.jsxs)(Xy.Provider,{value:x,children:[u&&(0,U.jsx)(Kf,{handle:u,store:x}),E&&(0,U.jsx)(Yy,{store:x,parentContext:y?.context,isDrawer:p}),typeof n==`function`?n({payload:w}):n]})}function rb(e){return nb(`alert-dialog`,e)}var ib=v.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=Zy(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return Wu(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:Rm,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),ab=v.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,c=Zy(),l=c.useState(`open`),{getButtonProps:u,buttonRef:d}=Km({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,Kc(Lc,e.nativeEvent))}return Wu(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})}),ob=v.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=Zy(),c=Qp(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),Wu(`p`,e,{ref:t,props:[{id:c},o]})}),sb=v.createContext(void 0);function cb(){let e=v.useContext(sb);if(e===void 0)throw Error(Bo(26));return e}var lb={...Lm,...km,nestedDialogOpen(e){return e?{"data-nested-dialog-open":``}:null}},ub=v.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=Zy(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),m=c.useState(`mounted`),h=c.useState(`nested`),g=c.useState(`nestedOpenDialogCount`),_=c.useState(`open`),v=c.useState(`openMethod`),y=c.useState(`titleElementId`),b=c.useState(`transitionStatus`),x=c.useState(`role`),S=d.useState(`floatingId`);cb(),Hf({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});let C=o===void 0?Wf(c.context.popupRef):o,w=g>0,T=c.useStateSetter(`popupElement`),E=Wu(`div`,e,{state:{open:_,nested:h,transitionStatus:b,nestedDialogOpen:w},props:[f,{id:S,"aria-labelledby":y,"aria-describedby":l,role:x,...Uf,hidden:!m,onKeyDown(e){Zh.has(e.key)&&e.stopPropagation()},style:{"--nested-dialogs":g}},s],ref:[t,c.context.popupRef,T],stateAttributesMapping:lb});return(0,U.jsx)(Td,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:C,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:E})}),db=v.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=Zy(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,U.jsx)(sb.Provider,{value:n,children:(0,U.jsxs)(od,{ref:t,...r,children:[a&&o===!0&&(0,U.jsx)(Dh,{ref:i.context.internalBackdropRef,inert:nh(!s)}),e.children]})}):null}),fb=v.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=Zy(),c=Qp(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),Wu(`h2`,e,{ref:t,props:[{id:c},o]})}),pb=v.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,payload:c,handle:l,...u}=e,d=Zy(!0),f=fp(l)??d;if(!f)throw Error(Bo(79));let p=Qp(s),m=f.useState(`floatingRootContext`),h=f.useState(`isOpenedByTrigger`,p),g=f.useState(`triggerPopupId`,p),_=v.useRef(null),{registerTrigger:y,isMountedByThisTrigger:b}=Zf(p,_,f,{payload:c}),{getButtonProps:x,buttonRef:S}=Km({disabled:a,native:o}),C=Ed(m),w=ym(()=>f.select(`open`),e=>{f.set(`openMethod`,e)}),T={disabled:a,open:h},E=f.useState(`triggerProps`,b);return Wu(`button`,e,{state:T,ref:[S,t,y,_],props:[C.reference,E,w,{[Zu]:``,id:p,"aria-haspopup":`dialog`,"aria-expanded":h,"aria-controls":g},u,x],stateAttributesMapping:Fm})}),mb=rb,hb=pb,gb=ab,_b=({className:e,children:t,...n})=>(0,U.jsx)(db,{children:(0,U.jsxs)(Hy,{children:[(0,U.jsx)(ib,{className:W(`fixed inset-0 z-70 bg-black/40 backdrop-blur-[1px]`,`transition-opacity duration-(--motion-base)`,`data-starting-style:opacity-0 data-ending-style:opacity-0`)}),(0,U.jsx)(ub,{"data-slot":`alert-dialog-content`,className:W(`fixed top-1/2 left-1/2 z-70 w-[min(28rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2`,`rounded-lg border border-border bg-surface p-5 shadow-(--shadow-lg) outline-none`,`transition-[opacity,transform] duration-(--motion-base)`,`data-starting-style:scale-95 data-starting-style:opacity-0`,`data-ending-style:scale-95 data-ending-style:opacity-0`,e),...n,children:t})]})}),vb=({className:e,...t})=>(0,U.jsx)(fb,{className:W(`text-heading-3 font-semibold text-text`,e),...t}),yb=({className:e,...t})=>(0,U.jsx)(ob,{className:W(`mt-1.5 text-body-sm text-muted-foreground`,e),...t}),bb=v.createContext(void 0);function xb(e){let t=v.useContext(bb);if(t===void 0&&!e)throw Error(Bo(33));return t}var Sb=v.createContext(void 0);function Cb(e){let t=v.useContext(Sb);if(t===void 0&&!e)throw Error(Bo(36));return t}var wb=v.createContext(void 0);function Tb(e=!0){let t=v.useContext(wb);if(t===void 0&&!e)throw Error(Bo(25));return t}function Eb(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,{events:l}=a.useState(`floatingTreeRoot`),u=a.useState(`open`),d=Tb(!0),f=d!==void 0;return v.useMemo(()=>({id:r,role:`menuitem`,tabIndex:u&&n?0:-1,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&l.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&l.emit(`close`,{domEvent:e,reason:Ic})},onMouseUp(e){if(d){let t=d.initialCursorPointRef.current;if(d.initialCursorPointRef.current=null,f&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||f&&!Qs&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!f||e.button===2)&&c.type===`regular-item`&&Gm(s.current,e,{detail:1})}}),[t,n,r,l,i,u,a,o,s,d,f,c])}var Db={type:`regular-item`};function Ob(e){let{closeOnClick:t,disabled:n,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:l}=e,u=v.useRef(null),{getButtonProps:d,buttonRef:f}=Km({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),p=Eb({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),m=v.useCallback(e=>Au(p,{onMouseEnter(){c.type===`submenu-trigger`&&c.setActive()}},e,d),[p,d,c]),h=bo(u,f);return v.useMemo(()=>({getItemProps:m,itemRef:h}),[m,h])}var kb=v.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,d=ug({guess:!0,label:a}),f=xb(!0),p=Qp(i),{store:m}=Cb(),h=m.useState(`disabled`),g=s||h,_=m.useState(`isActive`,d.index),v=m.useState(`itemProps`),{getItemProps:y,itemRef:b}=Ob({closeOnClick:c,disabled:g,highlighted:_,id:p,store:m,nativeButton:o,nodeId:f?.context.nodeId,itemMetadata:Db});return Wu(`div`,e,{state:{disabled:g,highlighted:_},props:[v,u,y],ref:[b,t,d.ref]})}),Ab=v.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,{store:s}=Cb(),{side:c,align:l}=xb(),u=Xh(!0)!=null,d=s.useState(`open`),f=s.useState(`transitionStatus`),p=s.useState(`popupProps`),m=s.useState(`mounted`),h=s.useState(`instantType`),g=s.useState(`activeTriggerElement`),_=s.useState(`parent`),y=s.useState(`lastOpenChangeReason`),b=s.useState(`rootId`),x=s.useState(`floatingRootContext`),S=s.useState(`floatingTreeRoot`),C=s.useState(`closeDelay`),w=s.useState(`hoverEnabled`),T=s.useState(`disabled`),E=s.useState(`openMethod`),D=_.type===`context-menu`;Hf({open:d,ref:s.context.popupRef,onComplete(){d&&s.context.onOpenChangeComplete?.(!0)}}),v.useEffect(()=>{function e(e){s.setOpen(!1,Kc(e.reason,e.domEvent))}return S.events.on(`close`,e),()=>{S.events.off(`close`,e)}},[S.events,s]),Cp(x,{enabled:w&&!T&&!D&&_.type!==`menubar`,closeDelay:C});let O=s.useStateSetter(`popupElement`),k=Wu(`div`,e,{state:{transitionStatus:f,side:c,align:l,open:d,nested:_.type===`menu`,instant:h},ref:[t,s.context.popupRef,O],stateAttributesMapping:Rm,props:[p,{onKeyDown(e){u&&Zh.has(e.key)&&e.stopPropagation()}},Ah(f),o,{"data-rootownerid":b}]}),A=_.type===void 0||D;return(g||_.type===`menubar`&&y!==`outside-press`)&&(A=!0),(0,U.jsx)(Td,{context:x,openInteractionType:E,modal:D,disabled:!m,returnFocus:a===void 0?A:a,initialFocus:_.type!==`menu`,restoreFocus:!0,externalTree:_.type===`menubar`?void 0:S,previousFocusableElement:g,nextFocusableElement:_.type===void 0?s.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:_.type===void 0?s.context.beforeContentFocusGuardRef:void 0,children:k})}),jb=v.createContext(void 0);function Mb(){let e=v.useContext(jb);if(e===void 0)throw Error(Bo(32));return e}var Nb=v.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=Cb();return i.useState(`mounted`)||n?(0,U.jsx)(jb.Provider,{value:n,children:(0,U.jsx)(od,{ref:t,...r})}):null}),Pb=v.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=Qu,style:g,..._}=e,{store:y}=Cb(),b=Mb(),x=Tb(!0),S=y.useState(`parent`),C=y.useState(`floatingRootContext`),w=y.useState(`floatingTreeRoot`),T=y.useState(`mounted`),E=y.useState(`open`),D=y.useState(`modal`),O=y.useState(`openMethod`),k=y.useState(`activeTriggerElement`),A=y.useState(`transitionStatus`),j=y.useState(`positionerElement`),M=y.useState(`instantType`),N=y.useState(`adaptiveOrigin`),P=y.useState(`lastOpenChangeReason`),F=y.useState(`floatingNodeId`),I=y.useState(`floatingParentNodeId`),L=C.useState(`domReferenceElement`),ee=v.useRef(null),R=Vf(j),te=n,z=c,B=l,V=s,ne=h;S.type===`context-menu`&&(te=n??S.context?.anchor,V??=`start`,!o&&V!==`center`&&(B=e.alignOffset??2,z=e.sideOffset??-5));let H=o,re=V;S.type===`menu`?(H??=`inline-end`,re??=`start`,ne=e.collisionAvoidance??$u):S.type===`menubar`&&(H??=S.context.orientation===`vertical`?`inline-end`:`bottom`,re??=`start`);let ie=S.type===`context-menu`,ae=Sh({anchor:te,floatingRootContext:C,positionMethod:x?`fixed`:r,mounted:T,side:H,sideOffset:z,align:re,alignOffset:B,arrowPadding:ie?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:F,keepMounted:b,disableAnchorTracking:m,collisionAvoidance:ne,shift:ie?{crossAxis:!(`side`in ne&&ne.side===`flip`),rootBoundary:`layoutViewport`}:void 0,externalTree:w,adaptiveOrigin:N});v.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===F&&y.set(`hoverEnabled`,!1),e.nodeId!==F&&e.parentNodeId===y.select(`floatingParentNodeId`)&&y.setOpen(!1,Kc(Hc)))}return w.events.on(`menuopenchange`,e),()=>{w.events.off(`menuopenchange`,e)}},[y,w.events,F]),v.useEffect(()=>{if(y.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==y.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;y.setOpen(!1,Kc(t))}return w.events.on(`menuopenchange`,e),()=>{w.events.off(`menuopenchange`,e)}},[w.events,y]);let oe=Hs();v.useEffect(()=>{E||oe.clear()},[E,oe]),v.useEffect(()=>{function e(e){if(!(!E||e.nodeId!==y.select(`floatingParentNodeId`))){if(e.target&&k&&k!==e.target){let e=y.select(`closeDelay`);e>0?oe.isStarted()||oe.start(e,()=>{y.setOpen(!1,Kc(Hc))}):y.setOpen(!1,Kc(Hc))}else oe.clear()}}return w.events.on(`itemhover`,e),()=>{w.events.off(`itemhover`,e)}},[w.events,E,k,y,oe]),v.useEffect(()=>{let e={open:E,nodeId:F,parentNodeId:I,reason:y.select(`lastOpenChangeReason`)};w.events.emit(`menuopenchange`,e)},[w.events,E,y,F,I]),Ao(()=>{let e=L,t=ee.current;if(e&&(ee.current=e),t&&e&&e!==t){y.set(`instantType`,void 0);let e=new AbortController;return R(()=>{y.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[L,R,y]);let se={open:E,side:ae.side,align:ae.align,anchorHidden:ae.anchorHidden,nested:S.type===`menu`,instant:M},ce=S.type===`menubar`&&S.context.modal;Wh(E&&(ce||D&&P!==`trigger-hover`),O===`touch`,j,k);let le=jh(e,se,{styles:ae.positionerStyles,transitionStatus:A,props:_,refs:[t,y.useStateSetter(`positionerElement`)],hidden:!T,inert:!E}),ue=T&&S.type!==`menu`&&(S.type!==`menubar`&&D&&P!==`trigger-hover`||S.type===`menubar`&&S.context.modal),de=null;return S.type===`menubar`?de=S.context.contentElement:S.type===void 0&&(de=k),(0,U.jsxs)(bb.Provider,{value:ae,children:[ue&&(0,U.jsx)(Dh,{ref:S.type===`context-menu`||S.type===`nested-context-menu`?S.context.internalBackdropRef:null,inert:nh(!E),cutout:de}),(0,U.jsx)(md,{id:F,children:(0,U.jsx)(ah,{elementsRef:y.context.itemDomElements,labelsRef:y.context.itemLabels,children:le})})]})}),Fb=v.createContext(null);function Ib(e){let t=v.useContext(Fb);if(t===null&&!e)throw Error(Bo(5));return t}var Lb={...dp,disabled:e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0),openMethod:e=>e.openMethod,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId,activeIndex:e=>e.activeIndex,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)}},Rb=class extends os{constructor(e){super({...Bb(),...e},zb(),Lb),this.unsubscribeParentListener=this.observe(`parent`,e=>{if(this.unsubscribeParentListener?.(),e.type===`menu`){let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);this.unsubscribeParentListener=e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);(t!==i||n!==a||r!==o)&&(t=i,n=a,r=o,this.notifyAll())}),this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef;return}e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}unsubscribeParentListener=null};function zb(){return{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 np}}function Bb(){return{...ip(),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new cd,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:as,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0}}var Vb=v.createContext(void 0);function Hb(){return v.useContext(Vb)}var Ub=qo(function(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,defaultOpen:a=!1,disabled:o=!1,modal:s,loopFocus:c=!0,orientation:l=`vertical`,actionsRef:u,closeParentOnEsc:d=!1,handle:f,triggerId:p,defaultTriggerId:m=null,highlightItemOnHover:h=!0}=e,g=Tb(!0),_=Cb(!0),y=Ib(!0),b=Hb(),x=v.useMemo(()=>b&&_?{type:`menu`,store:_.store}:y?{type:`menubar`,context:y}:g&&!_?{type:`context-menu`,context:g}:{type:void 0},[g,_,y,b]),S=Wb({open:a,openProp:n,activeTriggerId:m,triggerIdProp:p,parent:x});S.useControlledProp(`openProp`,n),S.useControlledProp(`triggerIdProp`,p),S.useContextCallback(`onOpenChangeComplete`,i);let C=Cu(),w=Cu(),T=S.useState(`floatingTreeRoot`),E=pd(T),D=dd(),O=S.useState(`open`),k=S.useState(`activeTriggerElement`),A=S.useState(`positionerElement`),j=S.useState(`hoverEnabled`),M=S.useState(`disabled`),N=S.useState(`lastOpenChangeReason`),P=S.useState(`parent`),F=S.useState(`activeIndex`),I=S.useState(`payload`),L=S.useState(`floatingParentNodeId`),ee=v.useRef(null),R=v.useRef(P.type!==`context-menu`),te=Hs(),z=v.useRef(!0),B=Hs(),V=L!=null,{openMethod:ne,triggerProps:H}=bm(O);S.useSyncedValues({disabled:o,highlightItemOnHover:h,modal:P.type===void 0?s:void 0,openMethod:ne,rootId:C}),Qf(S);let{forceUnmount:re}=$f(O,S,()=>{S.set(`allowMouseEnter`,!1)});Ao(()=>{g&&!_?S.update({parent:{type:`context-menu`,context:g},floatingNodeId:E,floatingParentNodeId:D}):_&&S.update({floatingNodeId:E,floatingParentNodeId:D})},[g,_,E,D,S]),v.useEffect(()=>{if(O||(ee.current=null),P.type===`context-menu`){if(!O){te.clear(),R.current=!1;return}te.start(500,()=>{R.current=!0})}},[te,O,P.type]),Ao(()=>{!O&&!j&&S.set(`hoverEnabled`,!0)},[O,j,S]);let ie=Po((e,t)=>{let n=t.reason;if(!e&&!S.select(`open`)||O===e&&t.trigger===k&&N===n)return;let i=Yf(t);if(!e&&t.trigger==null&&(t.trigger=k??void 0),r?.(e,t),t.isCanceled)return;S.state.floatingRootContext.dispatchOpenChange(e,t);let a=t.event;if(e===!1&&a?.type===`click`&&a.pointerType===`touch`&&!z.current)return;e&&n===`trigger-focus`?(z.current=!1,B.start(300,()=>{z.current=!0})):(z.current=!0,B.clear());let o=(n===`trigger-press`||n===`item-press`)&&a.detail===0,s=!e&&(n===`escape-key`||n==null),c={open:e,openChangeReason:n};ee.current=t.event,Jf(c,e,t.trigger,i()),S.update(c),P.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?S.set(`instantType`,`group`):o||s?S.set(`instantType`,o?`click`:`dismiss`):S.set(`instantType`,void 0)}),ae=zf({popupStore:S,floatingId:w,nested:D!=null,onOpenChange:ie}),oe=ae.context.events;Ao(()=>{let e=({open:e,eventDetails:t})=>ie(e,t);return oe.on(`setOpen`,e),()=>{oe?.off(`setOpen`,e)}},[oe,ie]);let se=v.useCallback(()=>{S.setOpen(!1,Kc(Wc))},[S]);v.useImperativeHandle(u,()=>({unmount:re,close:se}),[re,se]);let ce;P.type===`context-menu`&&(ce=P.context),v.useImperativeHandle(ce?.positionerRef,()=>A,[A]),v.useImperativeHandle(ce?.actionsRef,()=>({setOpen:ie}),[ie]);let le=Md(ae,{enabled:!M,bubbles:{escapeKey:d&&P.type===`menu`},outsidePress(){return P.type!==`context-menu`||ee.current?.type===`contextmenu`||R.current},externalTree:V?T:void 0}),ue=ph(),de=v.useCallback(e=>{S.select(`activeIndex`)!==e&&S.set(`activeIndex`,e)},[S]),fe=Np(ae,{enabled:!M,listRef:S.context.itemDomElements,activeIndex:F,nested:P.type!==void 0,loopFocus:c,orientation:l,parentOrientation:P.type===`menubar`?P.context.orientation:void 0,rtl:ue===`rtl`,disabledIndices:is,onNavigate:de,openOnArrowKeyDown:P.type!==`context-menu`,externalTree:V?T:void 0,focusItemOnHover:h}),pe=v.useCallback(e=>{S.context.typingRef.current=e},[S]),me=Pp(ae,{enabled:!M,listRef:S.context.itemLabels,elementsRef:S.context.itemDomElements,activeIndex:F,resetMs:500,onMatch:e=>{O&&e!==F&&S.set(`activeIndex`,e)},onTyping:pe});ep(S,{floatingRootContext:ae,activeTriggerProps:v.useMemo(()=>{let e=Au(me.reference,fe.reference,le.reference,{onMouseMove(){S.set(`allowMouseEnter`,!0)}},H);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=O,e},[S,me.reference,fe.reference,le.reference,H,O]),inactiveTriggerProps:v.useMemo(()=>{let e=Au(fe.trigger,le.trigger,H);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[fe.trigger,le.trigger,H]),popupProps:v.useMemo(()=>Au(Uf,{id:w,role:`menu`,"aria-labelledby":k?.id,onMouseMove(){S.set(`allowMouseEnter`,!0),P.type===`menu`&&S.set(`hoverEnabled`,!1)},onClick(){S.select(`hoverEnabled`)&&S.set(`hoverEnabled`,!1)},onKeyDown(e){let t=S.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},me.floating,fe.floating,le.floating),[k,w,P.type,S,me.floating,fe.floating,le.floating]),itemProps:fe.item??as});let he=v.useMemo(()=>({store:S,parent:x}),[S,x]),ge=(0,U.jsxs)(Sb.Provider,{value:he,children:[f&&(0,U.jsx)(Kf,{handle:f,store:S}),typeof t==`function`?t({payload:I}):t]});return P.type===void 0||P.type===`context-menu`?(0,U.jsx)(hd,{externalTree:T,children:ge}):ge});function Wb(e){return yo(()=>new Rb(e)).current}function Gb(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=Um(),{ref:i,index:a}=ug(e),o=n===a,s=v.useRef(null),c=bo(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:c,index:a}}function Kb(e){let{render:t,className:n,style:r,state:i=as,props:a=is,refs:o=is,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=Gb({metadata:s});return Wu(l,e,{state:i,ref:[f,...o],props:[d,...a,u],stateAttributesMapping:c})}function qb(e){if(ps(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`);if(!Ts(e))return qb(Os(e))}function Jb(e,t){let n=v.useRef(null);function r(t){td.flushSync(()=>{e.setOpen(!1,Kc(Rc,t.nativeEvent,t.currentTarget))}),$l(n.current)?.focus()}function i(n){let r=e.select(`positionerElement`);if(r&&eu(n,r))e.context.beforeContentFocusGuardRef.current?.focus();else{td.flushSync(()=>{e.setOpen(!1,Kc(Rc,n.nativeEvent,n.currentTarget))});let i=Ql(e.context.triggerFocusTargetRef.current||t.current);for(;i!==null&&gc(r,i);){let e=i;if(i=Yl(i),i===e)break}i?.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function Yb(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=v.useRef(!1);return v.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,Ns(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:as,[t,n,r])}var Xb=Jo(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,openOnHover:c,delay:l=100,closeDelay:u=0,handle:d,payload:f,...p}=e,m=Cb(!0),h=fp(d)??m?.store;if(!h)throw Error(Bo(85));let g=Qp(s),_=h.useState(`isTriggerActive`,g),y=h.useState(`floatingRootContext`),b=h.useState(`isOpenedByTrigger`,g),x=h.useState(`triggerPopupId`,g),S=v.useRef(null),C=Qb(),w=Um(!0),T=fd(),E=v.useMemo(()=>T??new cd,[T]),{registerTrigger:D,isMountedByThisTrigger:O}=Zf(g,S,h,{payload:f,closeDelay:u,parent:C,floatingTreeRoot:E,floatingNodeId:pd(E),floatingParentNodeId:dd(),keyboardEventRelay:w?.relayKeyboardEvent}),k=C.type===`menubar`,A=h.useState(`disabled`),j=a||A||k&&C.context.disabled,{getButtonProps:M,buttonRef:N}=Km({disabled:j,native:o});v.useEffect(()=>{!b&&C.type===void 0&&(h.context.allowMouseUpTriggerRef.current=!1)},[h,b,C.type]);let P=v.useRef(null),F=Hs(),I=Po(e=>{if(!P.current)return;F.clear(),h.context.allowMouseUpTriggerRef.current=!1;let t=e.target;gc(P.current,t)||gc(h.select(`positionerElement`),t)||t===P.current||(t==null||qb(t)!==h.select(`rootId`))&&(Bm(e,P.current)||E.events.emit(`close`,{domEvent:e,reason:Vc}))});v.useEffect(()=>{b&&h.select(`lastOpenChangeReason`)===`trigger-hover`&&Ns(P.current).addEventListener(`mouseup`,I,{once:!0})},[b,I,h]);let L=k&&C.context.hasSubmenuOpen,ee=Tp(y,{enabled:(c??L)&&!j&&(!k||L&&!O),handleClose:Hp({blockPointerEvents:!k}),mouseOnly:!0,move:!1,restMs:C.type===void 0?l:void 0,delay:{close:u},triggerElementRef:S,externalTree:E,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),R=Zb(b,h.select(`lastOpenChangeReason`)),te=Ed(y,{enabled:!j,event:b&&k?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:C.type===void 0&&R}),z=_p(y,{enabled:!j&&L}),B=Yb({open:b,enabled:k,mouseDownAction:`open`}),V=v.useMemo(()=>Au(z.reference,te.reference),[z.reference,te.reference]),ne=h.useState(`triggerProps`,O),{preFocusGuardRef:H,handlePreFocusGuardFocus:re,handleFocusTargetFocus:ie}=Jb(h,S),ae={disabled:j,open:b},oe=[P,t,N,D,S],se=[V,ee??as,ne,{"aria-haspopup":`menu`,"aria-controls":x,id:g,onMouseDown:e=>{h.select(`open`)||(F.start(200,()=>{h.context.allowMouseUpTriggerRef.current=!0}),Ns(e.currentTarget).addEventListener(`mouseup`,I,{once:!0}))}},k?{role:`menuitem`}:{},B,p,M],ce=Wu(`button`,e,{enabled:!k,stateAttributesMapping:Im,state:ae,ref:oe,props:se});return k?(0,U.jsx)(Kb,{tag:`button`,render:n,className:r,style:i,state:ae,refs:oe,props:se,stateAttributesMapping:Im}):b?(0,U.jsxs)(v.Fragment,{children:[(0,U.jsx)(Zc,{ref:H,onFocus:re},`${g}-pre-focus-guard`),(0,U.jsx)(v.Fragment,{children:ce},g),(0,U.jsx)(Zc,{ref:h.context.triggerFocusTargetRef,onFocus:ie},`${g}-post-focus-guard`)]}):(0,U.jsx)(v.Fragment,{children:ce},g)});function Zb(e,t){let n=Hs(),[r,i]=v.useState(!1);return Ao(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function Qb(){let e=Ib(!0);return v.useMemo(()=>e?{type:`menubar`,context:e}:{type:void 0},[e])}var $b=Ub,ex=Xb,tx=({className:e,align:t=`end`,side:n=`bottom`,sideOffset:r=6,...i})=>(0,U.jsx)(Nb,{children:(0,U.jsx)(Hy,{children:(0,U.jsx)(Pb,{align:t,side:n,sideOffset:r,className:`isolate z-80 outline-none`,children:(0,U.jsx)(Ab,{"data-slot":`menu-content`,className:W(`min-w-48 rounded-md border border-border bg-surface p-1 text-fg-1 shadow-(--shadow-lg) outline-none`,`transition-[opacity,transform] duration-(--motion-base)`,`data-starting-style:scale-95 data-starting-style:opacity-0`,`data-ending-style:scale-95 data-ending-style:opacity-0`,e),...i})})})}),nx=({className:e,destructive:t,...n})=>(0,U.jsx)(kb,{"data-slot":`menu-item`,className:W(`flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-body-sm outline-none select-none`,`data-highlighted:bg-surface-hover`,t?`text-danger`:`text-text`,e),...n});function rx(e){return nb(`dialog`,e)}var ix=rx,ax=({className:e,children:t,size:n=`md`,...r})=>(0,U.jsx)(db,{children:(0,U.jsxs)(Hy,{children:[(0,U.jsx)(ib,{className:W(`fixed inset-0 z-70 bg-black/40 backdrop-blur-[1px]`,`transition-opacity duration-(--motion-base)`,`data-starting-style:opacity-0 data-ending-style:opacity-0`)}),(0,U.jsx)(ub,{"data-slot":`dialog-content`,className:W(`fixed top-1/2 left-1/2 z-70 flex max-h-[min(42rem,calc(100dvh-3rem))] -translate-x-1/2 -translate-y-1/2 flex-col`,n===`sm`&&`w-[min(24rem,calc(100vw-2rem))]`,n===`md`&&`w-[min(32rem,calc(100vw-2rem))]`,n===`lg`&&`w-[min(46rem,calc(100vw-2rem))]`,`rounded-lg border border-border bg-surface shadow-(--shadow-lg) outline-none`,`transition-[opacity,transform] duration-(--motion-base)`,`data-starting-style:scale-95 data-starting-style:opacity-0`,`data-ending-style:scale-95 data-ending-style:opacity-0`,e),...r,children:t})]})}),ox=({title:e,description:t,actions:n})=>(0,U.jsxs)(`div`,{className:`flex items-start gap-2 border-b border-border px-4 py-3`,children:[(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(fb,{className:`truncate text-body-sm font-semibold text-text`,children:e}),t?(0,U.jsx)(ob,{className:`mt-0.5 text-label text-fg-4`,children:t}):null]}),n,(0,U.jsx)(ab,{"aria-label":`Close`,className:`-mr-1 flex size-6 shrink-0 items-center justify-center rounded-md text-fg-3 transition-colors outline-none hover:bg-surface-hover hover:text-fg-1`,children:(0,U.jsx)(By,{className:`size-3.5`})})]}),sx=({className:e,...t})=>(0,U.jsx)(`div`,{className:W(`min-h-0 flex-1 overflow-y-auto p-4`,e),...t}),cx=({label:e,children:t,mono:n})=>(0,U.jsxs)(`div`,{className:`flex items-baseline justify-between gap-4 py-1.5`,children:[(0,U.jsx)(`span`,{className:`shrink-0 text-label text-fg-3`,children:e}),(0,U.jsx)(`span`,{className:W(`min-w-0 truncate text-right text-body-sm text-fg-1`,n&&`font-mono text-label`),children:t})]}),lx=v.createContext(void 0);function ux(e){let t=v.useContext(lx);if(t===void 0&&!e)throw Error(Bo(72));return t}var dx={...dp,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},fx=class extends os{constructor(e,t,n){let r=new np;super(px(e,r,t,n),mx(r),dx)}setOpen=(e,t)=>{Xf(this,e,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,Kc(Mc,e))}};function px(e,t,n,r=!1){let i={...ip(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e};return i.floatingRootContext=ap(t,n,r),i}function mx(e){return{popupRef:v.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}var hx=qo(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,p=Gf((e,t)=>new fx({open:n,openProp:r,activeTriggerId:d,triggerIdProp:u},e,t));p.useControlledProp(`openProp`,r),p.useControlledProp(`triggerIdProp`,u),p.useContextCallback(`onOpenChange`,s),p.useContextCallback(`onOpenChangeComplete`,c);let m=p.useState(`open`),h=!t&&m,g=p.useState(`activeTriggerId`),_=p.useState(`mounted`),y=p.useState(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i,disabled:t}),Qf(p,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:b,transitionStatus:x}=$f(h,p),S=p.useState(`isInstantPhase`),C=p.useState(`instantType`),w=p.useState(`lastOpenChangeReason`),T=v.useRef(null);Ao(()=>{m&&t&&p.setOpen(!1,Kc(Uc))},[m,t,p]),Ao(()=>{x===`ending`&&w===`none`||x!==`ending`&&S?(C!==`delay`&&(T.current=C),p.set(`instantType`,`delay`)):T.current!==null&&(p.set(`instantType`,T.current),T.current=null)},[x,S,w,C,p]),Ao(()=>{h&&(g??p.set(`payload`,void 0))},[p,g,h]),v.useImperativeHandle(o,()=>({unmount:b,close:()=>p.setOpen(!1,Kc(Wc))}),[b,p]);let E=h||_||!t&&a!==`none`;return(0,U.jsxs)(lx.Provider,{value:p,children:[l&&(0,U.jsx)(Kf,{handle:l,store:p}),E&&(0,U.jsx)(gx,{store:p,disabled:t,trackCursorAxis:a}),typeof f==`function`?f({payload:y}):f]})});function gx({store:e,disabled:t,trackCursorAxis:n}){let r=e.useState(`floatingRootContext`),i=Md(r,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),a=kd(r,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n}),o=v.useMemo(()=>Au(a.reference,i.reference),[a.reference,i.reference]);return ep(e,{activeTriggerProps:o,inactiveTriggerProps:o,popupProps:i.floating??as}),null}var _x=v.createContext(void 0);function vx(){return v.useContext(_x)}var yx=`data-base-ui-tooltip-trigger`;function bx(e){if(`composedPath`in e){let t=e.composedPath();for(let e=0;e<t.length;e+=1){let n=t[e];if(fs(n))return n}}let t=e.target;return fs(t)?t:null}function xx(e){let t=e;for(;t;){let e=t.closest(`[${yx}]`);if(e)return e;let n=t.getRootNode();t=`host`in n&&fs(n.host)?n.host:null}return null}var Sx=Jo(function(e,t){let{render:n,className:r,style:i,handle:a,payload:o,disabled:s,delay:c,closeOnClick:l=!0,closeDelay:u,id:d,...f}=e,p=ux(!0),m=fp(a)??p;if(!m)throw Error(Bo(82));let h=Qp(d),g=m.useState(`isTriggerActive`,h),_=m.useState(`isOpenedByTrigger`,h),y=m.useState(`floatingRootContext`),b=v.useRef(null),x=c??600,S=u??0,{registerTrigger:C,isMountedByThisTrigger:w}=Zf(h,b,m,{payload:o,closeOnClick:l,closeDelay:S}),T=vx(),{delayRef:E,isInstantPhase:D,hasProvider:O}=Xc(y,{open:_}),k=Sp(y);m.useSyncedValue(`isInstantPhase`,D);let A=m.useState(`disabled`),j=s??A,M=Lo(j),N=m.useState(`trackCursorAxis`),P=m.useState(`disableHoverablePopup`),F=v.useRef(!1),I=Hs(),L=v.useRef(void 0);function ee(){return O?Dc(E.current,`open`)===0?0:c??T??600:x}function R(e){let t=b.current;if(!t||!e)return!1;let n=xx(e);return n!==null&&n!==t&&gc(t,n)}function te(e){let t=R(e);return F.current=t,t&&(k.openChangeTimeout.clear(),k.restTimeout.clear(),k.restTimeoutPending=!1,I.clear()),t}let z=Tp(y,{enabled:!j,mouseOnly:!0,move:!1,handleClose:!P&&N!==`both`?Hp():null,restMs:ee,delay(){return u==null&&O?{close:Dc(E.current,`close`)}:{close:S}},triggerElementRef:b,isActiveTrigger:g,isClosing:()=>m.select(`transitionStatus`)===`ending`,shouldOpen(){return!F.current}}),B=_p(y,{enabled:!j}).reference,V=e=>{let t=F.current,n=bx(e),r=te(n),i=b.current,a=i&&n&&gc(i,n);if(r&&m.select(`open`)&&m.select(`lastOpenChangeReason`)===`trigger-hover`){m.setOpen(!1,Kc(Nc,e));return}if(t&&!r&&a&&!M.current&&!m.select(`open`)&&i&&sc(L.current)){let t=()=>{!F.current&&!M.current&&!m.select(`open`)&&m.setOpen(!0,Kc(Nc,e,i))},n=ee();n===0?(I.clear(),t()):I.start(n,t)}},ne=m.useState(`triggerProps`,w);return Wu(`button`,e,{state:{open:_},ref:[t,C,b],props:[z,B,w||N!==`none`?ne:void 0,{onMouseOver(e){V(e.nativeEvent)},onFocus(e){R(bx(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){F.current=!1,I.clear(),L.current=void 0},onPointerEnter(e){L.current=e.pointerType},onPointerDown(e){L.current=e.pointerType,m.set(`closeOnClick`,l),l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},onClick(e){l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},id:h,"data-trigger-disabled":j?``:void 0,[yx]:j?void 0:``},f],stateAttributesMapping:Fm})}),Cx=v.createContext(void 0);function wx(){let e=v.useContext(Cx);if(e===void 0)throw Error(Bo(70));return e}var Tx=v.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{node:c,subtree:l}=ad({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,U.jsxs)(v.Fragment,{children:[l,c&&td.createPortal(n,c)]})}),Ex=v.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return ux().useState(`mounted`)||n?(0,U.jsx)(Cx.Provider,{value:n,children:(0,U.jsx)(Tx,{ref:t,...r})}):null}),Dx=v.createContext(void 0);function Ox(){let e=v.useContext(Dx);if(e===void 0)throw Error(Bo(71));return e}var kx=v.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=$u,style:g,..._}=e,y=ux(),b=wx(),x=y.useState(`open`),S=y.useState(`mounted`),C=y.useState(`trackCursorAxis`),w=y.useState(`disableHoverablePopup`),T=y.useState(`floatingRootContext`),E=y.useState(`instantType`),D=y.useState(`transitionStatus`),O=Sh({anchor:i,positionMethod:a,floatingRootContext:T,mounted:S,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:b,collisionAvoidance:h,adaptiveOrigin:y.useState(`adaptiveOrigin`)}),k=jh(e,v.useMemo(()=>({open:x,side:O.side,align:O.align,anchorHidden:O.anchorHidden,instant:C===`none`?E:`tracking-cursor`}),[x,O.side,O.align,O.anchorHidden,C,E]),{styles:O.positionerStyles,transitionStatus:D,props:_,refs:[t,y.useStateSetter(`positionerElement`)],hidden:!S,inert:!x||C===`both`||w});return(0,U.jsx)(Dx.Provider,{value:O,children:k})}),Ax=v.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=ux(),{side:s,align:c}=Ox(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`),m=o.useState(`disabled`),h=o.useState(`closeDelay`);Hf({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}}),Cp(p,{enabled:!m,closeDelay:h});let g=o.useStateSetter(`popupElement`);return Wu(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,g],props:[Uf,f,Ah(d),a],stateAttributesMapping:Rm})}),jx=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=v.useMemo(()=>({open:t,close:n}),[t,n]);return(0,U.jsx)(_x.Provider,{value:t,children:(0,U.jsx)(Yc,{delay:i,timeoutMs:r,children:e.children})})},Mx=({className:e,side:t=`top`,sideOffset:n=6,...r})=>(0,U.jsx)(Ex,{children:(0,U.jsx)(Hy,{children:(0,U.jsx)(kx,{side:t,sideOffset:n,className:`isolate z-90`,children:(0,U.jsx)(Ax,{"data-slot":`tooltip-content`,className:W(`rounded-md border border-border bg-surface px-2 py-1 text-label text-fg-2 shadow-(--shadow-md) outline-none`,e),...r})})})});function Nx({content:e,render:t,side:n,children:r}){return(0,U.jsxs)(hx,{children:[(0,U.jsx)(Sx,{render:t??(0,U.jsx)(`span`,{className:`inline-flex`}),children:r}),(0,U.jsx)(Mx,{side:n,children:e})]})}function Px(e){if(!e||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))}var Fx=e=>{switch(e){case`success`:return Rx;case`info`:return Bx;case`warning`:return zx;case`error`:return Vx;default:return null}},Ix=Array(12).fill(0),Lx=({visible:e,className:t})=>v.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},v.createElement(`div`,{className:`sonner-spinner`},Ix.map((e,t)=>v.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),Rx=v.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},v.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`})),zx=v.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},v.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`})),Bx=v.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},v.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`})),Vx=v.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},v.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`})),Hx=v.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`,"aria-hidden":`true`},v.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),v.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),Ux=()=>{let[e,t]=v.useState(document.hidden);return v.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]),e},Wx=1,Gx=100,Kx=e=>typeof e?.id==`number`||e?.id?.length>0?e.id:Wx++,qx=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),this.getActiveToasts().forEach(t=>e(t)),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e],this.trimHistory()},this.trimHistory=()=>{let e=this.toasts.length-Gx;e<=0||(this.toasts=this.toasts.filter(t=>e>0&&this.dismissedToasts.has(t.id)?(this.dismissedToasts.delete(t.id),e--,!1):!0))},this.create=e=>{let{message:t,...n}=e,r=Kx(e),i=this.pendingDismissals.get(r);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(r),this.dismissedToasts.delete(r));let a=this.dismissedToasts.has(r),o=e.dismissible===void 0||e.dismissible;return a&&(this.dismissedToasts.delete(r),this.toasts=this.toasts.filter(e=>e.id!==r)),!a&&this.toasts.find(e=>e.id===r)?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:o,title:t}):n):this.addToast({title:t,...n,dismissible:o,id:r}),r},this.dismiss=e=>{if(e==null)return this.getActiveToasts().forEach(e=>{this.dismissedToasts.add(e.id),this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e;this.dismissedToasts.add(e);let t=this.pendingDismissals.get(e);return t!==void 0&&cancelAnimationFrame(t),this.pendingDismissals.set(e,requestAnimationFrame(()=>{this.pendingDismissals.delete(e),this.subscribers.forEach(t=>t({id:e,dismiss:!0}))})),e},this.message=(e,t)=>this.create({...t,message:e,type:void 0}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],v.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(Yx(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!v.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!v.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!v.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!v.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=Kx(t);return this.create({...t,jsx:e(n),id:n,type:void 0}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}},Jx=(e,t)=>qx.message(e,t),Yx=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,Xx=Object.assign(Jx,{success:qx.success,info:qx.info,warning:qx.warning,error:qx.error,custom:qx.custom,message:qx.message,promise:qx.promise,dismiss:qx.dismiss,loading:qx.loading},{getHistory:()=>qx.toasts,getToasts:()=>qx.getActiveToasts()});Px(`[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;flex:1;min-width:0}[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(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);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]{-webkit-user-select:none;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 Zx(e){return e.label!==void 0}var Qx=3,$x=`24px`,eS=`16px`,tS=4e3,nS=356,rS=14,iS=45,aS=200;function oS(...e){return e.filter(Boolean).join(` `)}function sS(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var cS=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:h,actionButtonStyle:g,className:_=``,descriptionClassName:y=``,duration:b,position:x,gap:S,expandByDefault:C,classNames:w,icons:T,closeButtonAriaLabel:E=`Close toast`}=e,[D,O]=v.useState(null),[k,A]=v.useState(null),[j,M]=v.useState(!1),[N,P]=v.useState(!1),[F,I]=v.useState(!1),[L,ee]=v.useState(!1),[R,te]=v.useState(!1),[z,B]=v.useState(0),[V,ne]=v.useState(0),H=v.useRef(n.duration||b||tS),re=v.useRef(null),ie=v.useRef(null),ae=c===0,oe=c+1<=o,se=n.type,ce=se??`default`,le=n.dismissible!==!1,ue=n.className||``,de=n.descriptionClassName||``,fe=v.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),pe=v.useMemo(()=>n.closeButton??p,[n.closeButton,p]),me=v.useMemo(()=>n.duration||b||tS,[n.duration,b]),he=v.useRef(0),ge=v.useRef(0),_e=v.useRef(0),ve=v.useRef(null),[ye,be]=x.split(`-`),xe=v.useMemo(()=>s.reduce((e,t,n)=>n>=fe?e:e+t.height,0),[s,fe]),Se=Ux(),Ce=v.useMemo(()=>e.swipeDirections??sS(x),[e.swipeDirections,x]),we=n.invert||t,Te=se===`loading`;ge.current=v.useMemo(()=>fe*S+xe,[fe,xe]),v.useEffect(()=>{H.current=me},[me]),v.useEffect(()=>{M(!0)},[]),v.useEffect(()=>{let e=ie.current;if(e){let t=e.getBoundingClientRect().height;return ne(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),v.useLayoutEffect(()=>{if(!j)return;let e=ie.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,ne(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[j,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let Ee=v.useCallback(()=>{P(!0),B(ge.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},aS)},[n,d,a,ge]);v.useEffect(()=>{if(n.promise&&se===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||Se?(()=>{if(_e.current<he.current){let e=new Date().getTime()-he.current;H.current-=e}_e.current=new Date().getTime()})():H.current!==1/0&&(he.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),Ee()},H.current)),()=>clearTimeout(e)},[u,i,n,se,Se,Ee]),v.useEffect(()=>{n.delete&&(Ee(),n.onDismiss==null||n.onDismiss.call(n,n))},[Ee,n.delete]);function De(){return T?.loading?v.createElement(`div`,{className:oS(w?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":se===`loading`},T.loading):v.createElement(Lx,{className:oS(w?.loader,n?.classNames?.loader),visible:se===`loading`})}let Oe=n.icon||T?.[se]||Fx(se);return v.createElement(`li`,{tabIndex:0,ref:ie,className:oS(_,ue,w?.toast,n?.classNames?.toast,w?.[ce],n?.classNames?.[ce]),"data-sonner-toast":``,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":j,"data-promise":!!n.promise,"data-swiped":R,"data-removed":N,"data-visible":oe,"data-y-position":ye,"data-x-position":be,"data-index":c,"data-front":ae,"data-swiping":F,"data-dismissible":le,"data-type":se,"data-invert":we,"data-swipe-out":L,"data-swipe-direction":k,"data-expanded":!!(u||C&&j),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${N?z:ge.current}px`,"--initial-height":C?`auto`:`${V}px`,...m,...n.style},onDragEnd:()=>{I(!1),O(null),ve.current=null},onPointerDown:e=>{e.button!==2&&(Te||!le||(re.current=new Date,B(ge.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(I(!0),ve.current={x:e.clientX,y:e.clientY})))},onPointerUp:()=>{if(L||!le)return;ve.current=null;let e=Number(ie.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(ie.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-re.current?.getTime(),i=D===`x`?e:t,a=Math.abs(i)/r;if((D===`x`?Ce.includes(e>0?`right`:`left`):Ce.includes(t>0?`bottom`:`top`))&&(Math.abs(i)>=iS||a>.11)){B(ge.current),n.onDismiss==null||n.onDismiss.call(n,n),A(D===`x`?e>0?`right`:`left`:t>0?`down`:`up`),Ee(),ee(!0);return}var o,s;(o=ie.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=ie.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`),te(!1),I(!1),O(null)},onPointerMove:e=>{var t,n;if(!ve.current||!le||window.getSelection()?.toString().length>0)return;let r=e.clientY-ve.current.y,i=e.clientX-ve.current.x;!D&&(Math.abs(i)>1||Math.abs(r)>1)&&O(Math.abs(i)>Math.abs(r)?`x`:`y`);let a={x:0,y:0},o=e=>1/(1.5+Math.abs(e)/20);if(D===`y`){if(Ce.includes(`top`)||Ce.includes(`bottom`)){if(Ce.includes(`top`)&&r<0||Ce.includes(`bottom`)&&r>0)a.y=r;else{let e=r*o(r);a.y=Math.abs(e)<Math.abs(r)?e:r}}}else if(D===`x`&&(Ce.includes(`left`)||Ce.includes(`right`))){if(Ce.includes(`left`)&&i<0||Ce.includes(`right`)&&i>0)a.x=i;else{let e=i*o(i);a.x=Math.abs(e)<Math.abs(i)?e:i}}(Math.abs(a.x)>0||Math.abs(a.y)>0)&&te(!0),(t=ie.current)==null||t.style.setProperty(`--swipe-amount-x`,`${a.x}px`),(n=ie.current)==null||n.style.setProperty(`--swipe-amount-y`,`${a.y}px`)}},pe&&!n.jsx&&se!==`loading`?v.createElement(`button`,{"aria-label":E,"data-disabled":Te,"data-close-button":!0,onClick:Te||!le?()=>{}:()=>{Ee(),n.onDismiss==null||n.onDismiss.call(n,n)},className:oS(w?.closeButton,n?.classNames?.closeButton)},T?.close??Hx):null,(se||n.icon||n.promise)&&n.icon!==null&&(T?.[se]!==null||n.icon)?v.createElement(`div`,{"data-icon":``,className:oS(w?.icon,n?.classNames?.icon)},se===`loading`?n.icon||De():n.promise?De():null,se===`loading`?null:Oe):null,v.createElement(`div`,{"data-content":``,className:oS(w?.content,n?.classNames?.content)},v.createElement(`div`,{"data-title":``,className:oS(w?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?v.createElement(`div`,{"data-description":``,className:oS(y,de,w?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),v.isValidElement(n.cancel)?n.cancel:n.cancel&&Zx(n.cancel)?v.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{Zx(n.cancel)&&le&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),Ee())},className:oS(w?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,v.isValidElement(n.action)?n.action:n.action&&Zx(n.action)?v.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{Zx(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&Ee())},className:oS(w?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function lS(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function uS(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?eS:$x;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var dS=v.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:d=`light`,richColors:f,duration:p,style:m,visibleToasts:h=Qx,toastOptions:g,dir:_=lS(),gap:y=rS,icons:b,customAriaLabel:x,containerAriaLabel:S=`Notifications`}=e,[C,w]=v.useState([]),T=v.useMemo(()=>n?C.filter(e=>e.toasterId===n):C.filter(e=>!e.toasterId),[C,n]),E=v.useMemo(()=>Array.from(new Set([i].concat(T.filter(e=>e.position).map(e=>e.position)))),[T,i]),[D,O]=v.useState([]),[k,A]=v.useState(!1),[j,M]=v.useState(!1),[N,P]=v.useState(d===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:d),F=v.useRef(null),I=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),L=v.useRef(null),ee=v.useRef(!1),R=v.useCallback(e=>{w(t=>(t.find(t=>t.id===e.id)?.delete||qx.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return v.useEffect(()=>qx.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{w(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});return}setTimeout(()=>{td.flushSync(()=>{w(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[]),v.useEffect(()=>{if(d!==`system`){P(d);return}if(d===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?P(`dark`):P(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{P(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{P(e?`dark`:`light`)}catch(e){console.error(e)}})}},[d]),v.useEffect(()=>{C.length<=1&&A(!1)},[C]),v.useEffect(()=>{let e=e=>{if(a.length>0&&a.every(t=>e[t]||e.code===t)){var t;A(!0),(t=F.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===F.current||F.current?.contains(document.activeElement))&&A(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),v.useEffect(()=>{if(F.current)return()=>{L.current&&(L.current.focus({preventScroll:!0}),L.current=null,ee.current=!1)}},[F.current]),v.createElement(`section`,{ref:t,"aria-label":x??`${S} ${I}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},E.map((t,n)=>{let[i,a]=t.split(`-`);return T.length?v.createElement(`ol`,{key:t,dir:_===`auto`?lS():_,tabIndex:-1,ref:F,className:c,"data-sonner-toaster":!0,"data-sonner-theme":N,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${D[0]?.height||0}px`,"--width":`${nS}px`,"--gap":`${y}px`,...m,...uS(l,u)},onBlur:e=>{ee.current&&!e.currentTarget.contains(e.relatedTarget)&&(ee.current=!1,L.current&&=(L.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||ee.current||(ee.current=!0,L.current=e.relatedTarget)},onMouseEnter:()=>A(!0),onMouseMove:()=>A(!0),onMouseLeave:()=>{j||A(!1)},onDragEnd:()=>A(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||M(!0)},onPointerUp:()=>M(!1)},T.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>v.createElement(cS,{key:n.id,icons:b,index:i,toast:n,defaultRichColors:f,duration:g?.duration??p,className:g?.className,descriptionClassName:g?.descriptionClassName,invert:r,visibleToasts:h,closeButton:g?.closeButton??s,interacting:j,position:t,style:g?.style,unstyled:g?.unstyled,classNames:g?.classNames,cancelButtonStyle:g?.cancelButtonStyle,actionButtonStyle:g?.actionButtonStyle,closeButtonAriaLabel:g?.closeButtonAriaLabel,removeToast:R,toasts:T.filter(e=>e.position==n.position),heights:D.filter(e=>e.position==n.position),setHeights:O,expandByDefault:o,gap:y,expanded:k,swipeDirections:e.swipeDirections}))):null}))});function fS(){return(0,U.jsx)(dS,{position:`bottom-right`,toastOptions:{style:{background:`var(--surface)`,color:`var(--text)`,border:`1px solid var(--border)`,boxShadow:`var(--shadow-md)`,fontFamily:`var(--cw-font-sans)`,fontSize:`var(--text-body-sm)`}}})}async function pS(e){try{if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(e),!0}catch{}return mS(e)}function mS(e){if(typeof document>`u`)return!1;let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.position=`fixed`,t.style.top=`-9999px`,t.style.opacity=`0`,document.body.appendChild(t);let n=document.activeElement;try{return t.select(),t.setSelectionRange(0,e.length),document.execCommand(`copy`)}catch{return!1}finally{document.body.removeChild(t),n instanceof HTMLElement&&n.focus()}}function hS({value:e,glyph:t,className:n,variant:r=`ghost`,size:i=`icon-sm`,...a}){let[o,s]=(0,v.useState)(!1);return(0,U.jsx)(ao,{variant:r,size:i,"aria-label":`Copy`,className:W(`text-fg-3`,n),onClick:()=>{pS(e).then(e=>{e&&(s(!0),setTimeout(()=>s(!1),1500))})},...a,children:t?(0,U.jsx)(`span`,{className:W(`font-mono text-body-sm leading-5`,o&&`text-success`),children:o?`✓`:`⧉`}):o?(0,U.jsx)(Zg,{className:`size-3.5 text-success`}):(0,U.jsx)(h_,{className:`size-3.5`})})}function gS({className:e}){return(0,U.jsx)(lv,{"aria-label":`Loading`,className:W(`size-4 animate-spin text-fg-3`,e)})}function _S({code:e,label:t,copyable:n=!0,variant:r=`panel`,className:i}){let a=r===`plain`,o=t!==void 0||n;return a?(0,U.jsxs)(`div`,{"data-slot":`code-block`,"data-variant":`plain`,className:W(`min-w-0`,i),children:[o?(0,U.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2`,children:[(0,U.jsx)(`span`,{className:`truncate text-label leading-5 text-fg-4`,children:t}),n?(0,U.jsx)(hS,{glyph:!0,value:e,className:`size-5 shrink-0 rounded-sm`}):null]}):null,(0,U.jsx)(`pre`,{className:`max-h-64 overflow-auto bg-code-bg px-2 font-mono text-label leading-5 whitespace-pre-wrap text-fg-2`,children:e})]}):(0,U.jsxs)(`div`,{"data-slot":`code-block`,className:W(`overflow-hidden rounded-md border border-border bg-code-bg`,i),children:[o?(0,U.jsxs)(`div`,{className:`flex h-8 items-center justify-between border-b border-border px-2.5`,children:[(0,U.jsx)(`span`,{className:`font-mono text-label text-fg-3`,children:t}),n?(0,U.jsx)(hS,{value:e}):null]}):null,(0,U.jsx)(`pre`,{className:`max-h-64 overflow-auto px-3 py-2 font-mono text-label whitespace-pre-wrap text-fg-2`,children:e})]})}function vS({orientation:e,value:t,onValueChange:n,min:r,max:i,step:a=16,defaultValue:o,inverted:s,"aria-label":c,className:l}){let u=(0,v.useRef)(null),d=e===`vertical`,f=(0,v.useCallback)(e=>Math.min(i,Math.max(r,e)),[r,i]),p=e=>{e.button===0&&(e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),u.current={origin:d?e.clientX:e.clientY,start:t})},m=e=>{let t=u.current;if(!t)return;let r=(d?e.clientX:e.clientY)-t.origin;n(f(t.start+(s?-r:r)))},h=e=>{u.current&&(u.current=null,e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId))};return(0,U.jsx)(`div`,{"data-slot":`splitter`,role:`separator`,tabIndex:0,"aria-label":c,"aria-orientation":e,"aria-valuenow":Math.round(t),"aria-valuemin":r,"aria-valuemax":i,onPointerDown:p,onPointerMove:m,onPointerUp:h,onPointerCancel:h,onDoubleClick:()=>{o!==void 0&&n(f(o))},onKeyDown:e=>{let o=d?`ArrowRight`:`ArrowDown`,c=d?`ArrowLeft`:`ArrowUp`,l=s?-1:1;if(e.key===o)n(f(t+a*l));else if(e.key===c)n(f(t-a*l));else if(e.key===`Home`)n(r);else if(e.key===`End`)n(i);else return;e.preventDefault()},className:W(`group relative shrink-0 touch-none bg-border transition-colors`,`hover:bg-border-strong focus-visible:bg-accent focus-visible:outline-none`,d?`w-px cursor-col-resize`:`h-px cursor-row-resize`,l),children:(0,U.jsx)(`span`,{"aria-hidden":!0,className:W(`absolute`,d?`-inset-x-[3px] inset-y-0`:`-inset-y-[3px] inset-x-0`)})})}function yS({icon:e,title:t,description:n,action:r,onAction:i}){return(0,U.jsxs)(`div`,{className:`flex flex-col items-center gap-2 px-5 py-8 text-center`,children:[(0,U.jsx)(`div`,{className:`text-fg-4 opacity-60 [&_svg]:size-7`,children:e}),(0,U.jsx)(`p`,{className:`text-body-sm font-medium text-fg-2`,children:t}),n?(0,U.jsx)(`p`,{className:`max-w-[26ch] text-balance text-label leading-relaxed text-fg-4`,children:n}):null,r&&i?(0,U.jsx)(ao,{variant:`outline`,size:`sm`,className:`mt-1`,onClick:i,children:r}):null]})}function bS({children:e}){return(0,U.jsx)(`span`,{className:`rounded border border-border px-1 font-mono text-fg-3`,children:e})}function xS({value:e,size:t=13,strokeWidth:n=2,className:r}){let i=Math.min(100,Math.max(0,e)),a=(t-n)/2,o=2*Math.PI*a;return(0,U.jsxs)(`svg`,{"data-slot":`progress-ring`,width:t,height:t,viewBox:`0 0 ${t} ${t}`,role:`img`,"aria-label":`${Math.round(i)}%`,className:W(`shrink-0 -rotate-90`,r),children:[(0,U.jsx)(`circle`,{cx:t/2,cy:t/2,r:a,fill:`none`,stroke:`currentColor`,strokeOpacity:.2,strokeWidth:n}),(0,U.jsx)(`circle`,{cx:t/2,cy:t/2,r:a,fill:`none`,stroke:`currentColor`,strokeWidth:n,strokeLinecap:`round`,strokeDasharray:o,strokeDashoffset:o*(1-i/100)})]})}function SS(e){return e.map(e=>e.type===`text`?e.text:`${e.trigger}${e.displayText}`).join(``)}function CS(e){return e?[{type:`text`,text:e}]:[]}function wS(e,t){if(t<=0)return[];let n=[],r=0;for(let i of e){let e=i.type===`text`?i.text.length:i.trigger.length+i.displayText.length;if(r+e<=t){n.push(i),r+=e;continue}if(i.type===`text`){let e=t-r;if(e>0){let t=i.text.charCodeAt(e-1);t>=55296&&t<=56319&&--e,e>0&&n.push({type:`text`,text:i.text.slice(0,e)})}}break}return n}function TS(e){return e===` `||e===`
11
+ `||e===` `}function ES(e){let t=new Map;for(let n of e)t.has(n.char)||t.set(n.char,n);return t}function DS(e,t,n){if(t===0)return!0;let r=e[t-1];return n===`start`?r===`
12
+ `:TS(r)}function OS(e,t,n){if(!e||t===0||n.length===0)return null;let r=ES(n);for(let n=t-1;n>=0;n--){let i=e[n];if(TS(i)){if(n+1<t){let i=e[n+1],a=r.get(i);if(a&&DS(e,n+1,a.position))return{config:a,startOffset:n+1,query:e.slice(n+2,t)}}return null}let a=r.get(i);if(a&&DS(e,n,a.position))return{config:a,startOffset:n,query:e.slice(n+1,t)}}return null}function kS(e,t,n){let r=t.startOffset,i=r+1+t.query.length,a=[],o=0;for(let s of e)if(s.type===`chip`){let e=`${s.trigger}${s.displayText}`,t=o,n=o+e.length;(n<=r||t>=i)&&a.push(s),o=n}else{let e=o,c=o+s.text.length;if(c<=r)a.push(s);else if(e>=i)a.push(s);else{let o=s.text.slice(0,Math.max(0,r-e)),c=s.text.slice(Math.min(s.text.length,i-e));o&&a.push({type:`text`,text:o});let l={type:`chip`,trigger:t.config.char,value:n.value,displayText:n.displayText,...n.data===void 0?{}:{data:n.data},...n.autoResolved?{autoResolved:!0}:{}};a.push(l),c?a.push({type:`text`,text:` `+c.replace(/^\s/,``)}):a.push({type:`text`,text:` `})}o=c}let s=zS(a),c=-1,l=0;for(let e of s)e.type===`text`?l+=e.text.length:(l+=e.trigger.length+e.displayText.length,e.value===n.value&&e.displayText===n.displayText&&e.trigger===t.config.char&&(c=l));return{segments:s,cursorOffset:c===-1?l:c+1}}function AS(e,t,n){let r=t.startOffset,i=r+1+t.query.length,a=[],o=0,s=r+n.length;for(let t of e){if(t.type===`chip`){let e=o+`${t.trigger}${t.displayText}`.length;(e<=r||o>=i)&&a.push(t),o=e;continue}let e=o,s=o+t.text.length;if(s<=r||e>=i)a.push(t);else{let o=t.text.slice(0,Math.max(0,r-e)),s=t.text.slice(Math.min(t.text.length,i-e));o&&a.push({type:`text`,text:o}),a.push({type:`text`,text:n}),s&&a.push({type:`text`,text:s})}o=s}let c=zS(a),l=SS(c).length;return s>l&&(s=l),{segments:c,cursorOffset:s}}function jS(e,t){return t<0||t>=e.length||e[t].type!==`chip`?e:zS([...e.slice(0,t),...e.slice(t+1)])}function MS(e,t){if(t<0||t>=e.length)return null;let n=e[t];if(n.type!==`chip`||!n.autoResolved)return null;let r=`${n.trigger}${n.displayText}`;return{segments:zS([...e.slice(0,t),{type:`text`,text:r},...e.slice(t+1)]),revertedText:r}}function NS(e,t){let n=t.filter(e=>e.resolveOnSpace);if(n.length===0)return e;let r=ES(n),i=[];for(let t of e){if(t.type===`chip`){i.push(t);continue}let e=PS(t.text,r);i.push(...e)}return zS(i)}function PS(e,t){if(!e)return[];let n=[],r=0;for(;r<e.length;){let i=e[r];if(t.has(i)&&(r===0||TS(e[r-1]))){let a=t.get(i);if(a&&DS(e,r,a.position)){let t=r+1;for(;t<e.length&&!TS(e[t]);)t++;let o=e.slice(r+1,t);if(o.length>0){let e=a.onSelect?.({value:o,label:o})||o;n.push({type:`chip`,trigger:i,value:o,displayText:e,autoResolved:!0}),r=t;continue}}}let a=r;for(r++;r<e.length&&!(t.has(e[r])&&TS(e[r-1]));)r++;n.push({type:`text`,text:e.slice(a,r)})}return n}function FS(e,t,n,r){let i=[],a=0,o=!1;for(let s of e)if(s.type===`chip`){let e=`${s.trigger}${s.displayText}`,c=a,l=a+e.length;!o&&t===n&&c===t&&(i.push({type:`text`,text:r}),o=!0),(l<=t||c>=n)&&i.push(s),a=l}else{let e=a,c=a+s.text.length,l=t===n?c<t:c<=t,u=t===n?e>n:e>=n;if(l)i.push(s);else if(u)i.push(s);else{let a=s.text.slice(0,Math.max(0,t-e)),c=s.text.slice(Math.min(s.text.length,n-e));a&&i.push({type:`text`,text:a}),!o&&e<=t&&(i.push({type:`text`,text:r}),o=!0),c&&i.push({type:`text`,text:c})}a=c}return!o&&r&&i.push({type:`text`,text:r}),zS(i)}function IS(e,t,n,r){if(t===n)return null;let i=SS(e),a=r.length,o=t>=a&&i.slice(t-a,t)===r,s=n+a<=i.length&&i.slice(n,n+a)===r,c=o&&s;if(c&&a===1){let e=t>a?i[t-a-1]:``,o=n+a<i.length?i[n+a]:``;(e===r||o===r)&&(c=!1)}return c?{segments:FS(FS(e,n,n+a,``),t-a,t,``),selectionStart:t-a,selectionEnd:n-a}:{segments:FS(FS(e,n,n,r),t,t,r),selectionStart:t+a,selectionEnd:n+a}}function LS(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.type!==i.type)return!1;if(r.type===`text`){if(i.type!==`text`||r.text!==i.text)return!1}else if(i.type!==`chip`||r.trigger!==i.trigger||r.value!==i.value||r.displayText!==i.displayText||r.autoResolved!==i.autoResolved)return!1}return!0}function RS(e,t){return LS(zS(e),zS(t))}function zS(e){let t=[];for(let n of e){if(n.type===`text`&&n.text===``)continue;let e=t[t.length-1];n.type===`text`&&e?.type===`text`?t[t.length-1]={type:`text`,text:e.text+n.text}:t.push(n)}return t}function BS(e){let t=e.match(/^(\s*)([•\-*]) /);if(t)return{kind:`bullet`,indent:Math.floor(t[1].length/2),marker:t[2],prefixLen:t[0].length};let n=e.match(/^(\s*)(\d+)\. /);if(n){let e=n[1].length;return{kind:`numbered`,indent:Math.floor(n[1].length/2),number:parseInt(n[2],10),numberStart:e,numberEnd:e+n[2].length,prefixLen:n[0].length}}return null}function VS(e,t){let n=e.lastIndexOf(`
13
+ `,t-1)+1,r=e.indexOf(`
14
+ `,t),i=e.slice(n,r===-1?e.length:r),a=BS(i);return a?{lineStart:n,prefix:i.slice(0,a.prefixLen),indent:a.indent,listType:a.kind,...a.kind===`bullet`?{marker:a.marker}:{number:a.number},contentStart:n+a.prefixLen}:null}function HS(e,t){let n=SS(e),r=n.lastIndexOf(`
15
+ `,t-1)+1,i=n.slice(r,t),a=i.match(/^(\s*)[-*] $/);if(!a)return null;let o=`${a[1]}• `;return{segments:FS(e,r,r+i.length,o),cursorOffset:r+o.length}}function US(e,t){let n=SS(e),r=VS(n,t);if(!r)return null;let i=n.indexOf(`
16
+ `,t);if(n.slice(r.contentStart,i===-1?n.length:i).trim()===``)return r.indent>0?{segments:FS(e,r.lineStart,r.lineStart+2,``),cursorOffset:Math.max(r.lineStart,t-2)}:{segments:FS(e,r.lineStart,r.lineStart+r.prefix.length,``),cursorOffset:r.lineStart};let a=` `.repeat(r.indent),o;o=r.listType===`bullet`?`${a}${r.marker??`•`} `:`${a}${(r.number??1)+1}. `;let s=`\n${o}`;return{segments:FS(e,t,t,s),cursorOffset:t+s.length}}function WS(e,t){if(t===0)return null;let n=e.lastIndexOf(`
17
+ `,t-2)+1,r=BS(e.slice(n,t-1));return r?r.indent:null}function GS(e,t){let n=SS(e),r=VS(n,t);if(!r)return null;let i=WS(n,r.lineStart),a=i===null?0:i+1;return r.indent>=a?null:{segments:FS(e,r.lineStart,r.lineStart,` `),cursorOffset:t+2}}function KS(e,t){let n=VS(SS(e),t);return!n||n.indent===0?null:{segments:FS(e,n.lineStart,n.lineStart+2,``),cursorOffset:Math.max(n.lineStart,t-2)}}function qS(e,t){let n=VS(SS(e),t);return!n||t>n.contentStart?null:{segments:FS(e,n.lineStart,n.contentStart,` `.repeat(n.indent)),cursorOffset:n.lineStart+n.indent*2}}var JS=/^\s*```/;function YS(e,t){return t?e.replace(/^(\s*)- /,`$1• `):e.replace(/^(\s*)• /,`$1- `)}function XS(e){let t=new Set,n=-1;return e.forEach((e,r)=>{if(JS.test(e)){if(n===-1)n=r;else{for(let e=n;e<=r;e++)t.add(e);n=-1}}}),t}function ZS(e,t){let n=e.split(`
18
+ `),r=XS(n);return n.map((e,n)=>r.has(n)?e:YS(e,t)).join(`
19
+ `)}function QS(e,t){let n=[];e.forEach(e=>{e.type===`text`&&n.push(...e.text.split(`
20
+ `))});let r=XS(n),i=0,a=!1,o=e.map(e=>{if(e.type!==`text`)return e;let n=e.text.split(`
21
+ `).map(e=>{let n=r.has(i)?e:YS(e,t);return i++,n}).join(`
22
+ `);return n===e.text?e:(a=!0,{...e,text:n})});return a?o:e}function $S(e){let t=null,n=0,r=0,i=0,a=!0;for(let o of e.split(`
23
+ `)){let e=BS(o);if(e?.kind===`numbered`&&e.indent===t){if(a&&=e.number===r+1,r=e.number,i++,i>=2&&(n===1||a))return!0}else e?.kind===`numbered`?(t=e.indent,n=e.number,r=e.number,i=1,a=!0):(t=null,i=0)}return!1}function eC(e){if(!/^[ \t]*\d+\. /m.test(e))return{text:e,edits:[]};let t=new Map,n=[],r=e.split(`
24
+ `),i=``,a=0,o=(e,n)=>{for(let r of t.keys())(n?r>=e:r>e)&&t.delete(r)};for(let e=0;e<r.length;e++){let s=r[e],c=BS(s);if(!c)t.clear(),i+=s;else if(c.kind===`bullet`)o(c.indent,!0),i+=s;else{let e=c.indent;o(e,!1);let r=t.get(e),l=r===void 0?1:r+1;t.set(e,l);let u=String(l);u===String(c.number)?i+=s:(n.push({oldStart:a+c.numberStart,oldEnd:a+c.numberEnd,newText:u}),i+=s.slice(0,c.numberStart)+u+s.slice(c.numberEnd))}e<r.length-1&&(i+=`
25
+ `),a+=s.length+1}return n.length===0?{text:e,edits:n}:{text:i,edits:n}}function tC(e,t){let n=0;for(let r of t)if(r.oldEnd<=e)n+=r.newText.length-(r.oldEnd-r.oldStart);else if(r.oldStart>=e)break;else return r.oldStart+n+Math.min(e-r.oldStart,r.newText.length);return e+n}function nC(e){let{edits:t}=eC(SS(e));if(t.length===0)return{segments:e,edits:t};let n=e;for(let e=t.length-1;e>=0;e--){let r=t[e];n=FS(n,r.oldStart,r.oldEnd,r.newText)}return{segments:n,edits:t}}var rC=/https?:\/\/[^\s),]+/g,iC=/(\*{3})(.+?)\*{3}|(\*{2})(.+?)\*{2}|(\*)(.+?)\*/g,aC=/(^|\n)([ \t]*)•/g,oC=/(^|\n)([ \t]+)(?=(?:[•\-*] |\d+\. ))/g;function sC(e){return e instanceof HTMLElement}function cC(e){return e instanceof HTMLElement&&e.dataset.chipTrigger!==void 0}function lC(e){return e instanceof HTMLBRElement}function uC(e){return e instanceof Text}function dC(e){return cC(e)&&e.dataset.chipAutoResolved===`true`}function fC(e){return e instanceof HTMLAnchorElement&&e.dataset.url===`true`}function pC(e){try{return JSON.parse(e)}catch{return}}function mC(e){try{return JSON.stringify(e)}catch{return}}function hC(e){if(cC(e))return e.dataset.chipTrigger}function gC(e){if(cC(e))return e.dataset.chipValue}function _C(e){if(cC(e))return e.dataset.chipDisplay??e.textContent??void 0}function vC(e){if(!cC(e))return;let t=e.dataset.chipData;if(t)return pC(t)}function yC(e){let t=e.dataset.chipTrigger??``,n=e.dataset.chipDisplay??e.textContent??``;return t.length+n.length}function bC(e){if(!cC(e))return null;let t=hC(e),n=gC(e),r=_C(e);if(!t||n===void 0||!r)return null;let i=vC(e),a=dC(e);return{type:`chip`,trigger:t,value:n,displayText:r,...i===void 0?{}:{data:i},...a?{autoResolved:!0}:{}}}function xC(e,t){let n=e.childNodes;for(let e=0;e<n.length;e++)if(n[e]===t)return e;return-1}function SC(e){return e.nodeType===Node.TEXT_NODE?(e.textContent??``)!==``:lC(e)?!e.dataset.sentinel:cC(e)?bC(e)!==null:sC(e)?(e.textContent??``)!==``:!1}function CC(e,t){let n=0;for(let r=0;r<t;r++)SC(e.childNodes[r])&&n++;return n}function wC(e,t){let n=t;for(;n!==null;){if(n.parentNode===e)return n;n=n.parentNode}return null}function TC(e,t){let n=document.createDocumentFragment();for(;t.firstChild;)n.appendChild(t.firstChild);n.appendChild(document.createElement(`br`)),e.replaceChild(n,t)}function EC(e){let t=!1,n=new Set([`DIV`,`P`,`SECTION`,`ARTICLE`,`BLOCKQUOTE`]);for(let r=e.childNodes.length-1;r>=0;r--){let i=e.childNodes[r];if(!(i instanceof HTMLElement)||i.dataset.chipTrigger!==void 0||i instanceof HTMLBRElement)continue;let a=i.tagName;if(n.has(a))TC(e,i),t=!0;else if(a===`FONT`||a===`B`||a===`I`||a===`U`||a===`STRONG`||a===`EM`||a===`A`||a===`SPAN`){let n=i.textContent??``;n?e.replaceChild(document.createTextNode(n),i):e.removeChild(i),t=!0}}return e.normalize(),t}function DC(e){let t=!1,n=[];for(let t=0;t<e.childNodes.length;t++){let r=e.childNodes[t];uC(r)&&r.textContent&&n.push(r)}for(let e of n){let n=e.textContent??``;rC.lastIndex=0;let r=[],i;for(;(i=rC.exec(n))!==null;){let e=i[0];for(;e.length>0&&/[.;:!?]$/.test(e);)e=e.slice(0,-1);e.length>0&&r.push({url:e,index:i.index})}if(r.length===0)continue;let a=e.parentNode;if(!a)continue;let o=[];for(let{url:e,index:t}of r)try{let n=new URL(e);(n.protocol===`http:`||n.protocol===`https:`)&&o.push({url:e,href:n.href,index:t})}catch{}if(o.length===0)continue;t=!0;let s=document.createDocumentFragment(),c=0;for(let{url:e,href:t,index:r}of o){r>c&&s.appendChild(document.createTextNode(n.slice(c,r)));let i=document.createElement(`a`);i.href=t,i.target=`_blank`,i.rel=`noopener noreferrer`,i.dataset.url=`true`,i.className=`text-accent hover:text-accent-hover underline cursor-pointer`,i.textContent=e,s.appendChild(i),c=r+e.length}c<n.length&&s.appendChild(document.createTextNode(n.slice(c))),a.replaceChild(s,e)}return t}function OC(e){let t=!1,n=[];for(let t=0;t<e.childNodes.length;t++){let r=e.childNodes[t];uC(r)&&r.textContent&&n.push(r)}for(let e of n){let n=e.textContent??``;iC.lastIndex=0;let r=[],i;for(;(i=iC.exec(n))!==null;)i[1]&&i[2]?r.push({fullMatch:i[0],marker:i[1],content:i[2],index:i.index,className:`font-bold italic`}):i[3]&&i[4]?r.push({fullMatch:i[0],marker:i[3],content:i[4],index:i.index,className:`font-bold`}):i[5]&&i[6]&&r.push({fullMatch:i[0],marker:i[5],content:i[6],index:i.index,className:`italic`});if(r.length===0)continue;t=!0;let a=e.parentNode;if(!a)continue;let o=document.createDocumentFragment(),s=0;for(let{fullMatch:e,marker:t,content:i,index:a,className:c}of r){a>s&&o.appendChild(document.createTextNode(n.slice(s,a)));let r=document.createElement(`span`);r.dataset.md=`true`;let l=document.createElement(`span`);l.className=`prompt-area-md-marker`,l.textContent=t;let u=document.createElement(`span`);u.className=c,u.textContent=i;let d=document.createElement(`span`);d.className=`prompt-area-md-marker`,d.textContent=t,r.appendChild(l),r.appendChild(u),r.appendChild(d),o.appendChild(r),s=a+e.length}s<n.length&&o.appendChild(document.createTextNode(n.slice(s))),a.replaceChild(o,e)}return t}function kC(e){let t=!1,n=[];for(let t=0;t<e.childNodes.length;t++){let r=e.childNodes[t];uC(r)&&r.textContent?.includes(`•`)&&n.push(r)}for(let e of n){let n=e.textContent??``;aC.lastIndex=0;let r=[],i;for(;(i=aC.exec(n))!==null;)r.push(i.index+i[1].length+i[2].length);if(r.length===0)continue;t=!0;let a=e.parentNode;if(!a)continue;let o=document.createDocumentFragment(),s=0;for(let e of r){e>s&&o.appendChild(document.createTextNode(n.slice(s,e)));let t=document.createElement(`span`);t.dataset.md=`true`,t.className=`prompt-area-list-bullet`,t.textContent=`•`,o.appendChild(t),s=e+1}s<n.length&&o.appendChild(document.createTextNode(n.slice(s))),a.replaceChild(o,e)}return t}function AC(e){let t=!1,n=[];for(let t=0;t<e.childNodes.length;t++){let r=e.childNodes[t];uC(r)&&n.push(r)}for(let e of n){let n=e.textContent??``;oC.lastIndex=0;let r=[],i;for(;(i=oC.exec(n))!==null;){let e=i.index+i[1].length;r.push({start:e,end:e+i[2].length})}if(r.length===0)continue;t=!0;let a=e.parentNode;if(!a)continue;let o=document.createDocumentFragment(),s=0;for(let{start:e,end:t}of r){e>s&&o.appendChild(document.createTextNode(n.slice(s,e)));let r=n.slice(e,t),i=Math.floor(r.length/2),a=document.createElement(`span`);a.dataset.md=`true`,a.className=`prompt-area-list-indent`,a.style.width=`calc(var(--prompt-area-indent-size, 1.5em) * ${i})`,a.textContent=r,o.appendChild(a),s=t}s<n.length&&o.appendChild(document.createTextNode(n.slice(s))),a.replaceChild(o,e)}return t}function jC(e,t){t&&(AC(e),kC(e)),DC(e),t&&OC(e)}function MC(){let e=window.getSelection();return!e||e.rangeCount===0?null:e.getRangeAt(0)}function NC(e){let t=MC();if(!t||!e.contains(t.startContainer))return null;let n=document.createRange();return n.selectNodeContents(e),n.setEnd(t.startContainer,t.startOffset),RC(n)}function PC(e,t){let n=VC(e,t);if(!n)return null;let r=document.createRange();return r.setStart(n.node,n.offset),r.collapse(!0),r}function FC(e){let t=e.getBoundingClientRect();if(t.height>0)return t;let n=e.startContainer;if(n.nodeType!==Node.ELEMENT_NODE)return null;let r=n.childNodes,i=[r[e.startOffset],r[e.startOffset-1]];for(let e of i){if(!e)continue;let t=document.createRange();t.selectNode(e);let n=t.getBoundingClientRect();if(n.height>0)return n}return null}function IC(e){let t=window.getSelection();if(!t||t.rangeCount===0)return;let n=t.getRangeAt(0);if(!e.contains(n.startContainer))return;let r=FC(n);if(!r)return;let i=e.getBoundingClientRect();r.bottom>i.bottom?e.scrollTop+=r.bottom-i.bottom:r.top<i.top&&(e.scrollTop-=i.top-r.top)}function LC(e,t){let n=window.getSelection();if(!n)return;let r=VC(e,t);if(r){let t=document.createRange();t.setStart(r.node,r.offset),t.collapse(!0),n.removeAllRanges(),n.addRange(t),IC(e);return}let i=document.createRange();i.selectNodeContents(e),i.collapse(!1),n.removeAllRanges(),n.addRange(i),IC(e)}function RC(e){let t=e.cloneContents(),n=0,r=e=>{if(e.nodeType===Node.TEXT_NODE)n+=(e.textContent??``).length;else if(cC(e))n+=yC(e);else if(sC(e)&&e.tagName===`BR`){if(e.dataset.sentinel)return;n+=1}else sC(e)&&e.childNodes.forEach(r)};return t.childNodes.forEach(r),n}function zC(e){let t=MC();if(!t||!e.contains(t.startContainer))return null;let n=document.createRange();n.selectNodeContents(e),n.setEnd(t.startContainer,t.startOffset);let r=RC(n);if(t.collapsed)return{start:r,end:r};let i=document.createRange();return i.selectNodeContents(e),i.setEnd(t.endContainer,t.endOffset),{start:r,end:RC(i)}}function BC(e,t,n){let r=window.getSelection();if(!r)return;if(t===n){LC(e,t);return}let i=VC(e,t),a=VC(e,n);if(!i||!a)return;let o=document.createRange();o.setStart(i.node,i.offset),o.setEnd(a.node,a.offset),r.removeAllRanges(),r.addRange(o)}function VC(e,t){let n=t;for(let t=0;t<e.childNodes.length;t++){let r=e.childNodes[t];if(r.nodeType===Node.TEXT_NODE){let e=(r.textContent??``).length;if(n<=e)return{node:r,offset:n};n-=e}else if(cC(r)){let i=yC(r);if(n<=i)return{node:e,offset:t+1};n-=i}else if(lC(r)){if(r.dataset.sentinel)continue;if(n<=1)return{node:e,offset:t+1};--n}else if(sC(r)){let e=(r.textContent??``).length;if(n<=e){let e=VC(r,n);if(e)return e}n-=e}}return{node:e,offset:e.childNodes.length}}function HC(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function UC(e,t){let n=e=>{e.nodeType===Node.TEXT_NODE?t.onText(e.textContent??``):cC(e)?t.onChip(e):sC(e)&&e.tagName===`BR`?t.onBreak():e.childNodes.forEach(n)};e.childNodes.forEach(n)}function WC(e){let t=``;return UC(e,{onText:e=>{t+=e},onChip:e=>{t+=(hC(e)??``)+(_C(e)??``)},onBreak:()=>{t+=`
26
+ `}}),t}function GC(e){let t=[];return UC(e,{onText:e=>{e&&t.push({type:`text`,text:e})},onChip:e=>{let n=bC(e);n&&t.push(n)},onBreak:()=>{t.push({type:`text`,text:`
27
+ `})}}),t}function KC(e){try{let t=JSON.parse(e);if(!Array.isArray(t))return null;let n=[];for(let e of t){if(!HC(e))return null;if(e.type===`text`&&typeof e.text==`string`)n.push({type:`text`,text:e.text});else if(e.type===`chip`&&typeof e.trigger==`string`&&typeof e.value==`string`&&typeof e.displayText==`string`){let t={type:`chip`,trigger:e.trigger,value:e.value,displayText:e.displayText,...e.data===void 0?{}:{data:e.data},...e.autoResolved?{autoResolved:!0}:{}};n.push(t)}else return null}return n}catch{return null}}function qC(e,t,n){let r=MC();if(!r)return[...e,...t];let i=document.createRange();i.selectNodeContents(n),i.setEnd(r.startContainer,r.startOffset);let a=RC(i),o=[],s=0,c=!1,l=()=>{c||=(o.push(...t),!0)};for(let t of e){if(t.type===`chip`){let e=t.trigger.length+t.displayText.length;s>=a&&l(),o.push(t),s+=e;continue}let e=s+t.text.length;if(e<=a)o.push(t);else if(s>=a)l(),o.push(t);else{let e=a-s,n=t.text.slice(0,e),r=t.text.slice(e);n&&o.push({type:`text`,text:n}),l(),r&&o.push({type:`text`,text:r})}s=e}return l(),zS(o)}function JC(e,t){let n=RegExp(`(?:^|;)\\s*${t}\\s*:\\s*([^;]+)`,`i`).exec(e);return n?n[1].trim().toLowerCase():``}function YC(e){if(e===`bold`||e===`bolder`)return!0;let t=Number.parseInt(e,10);return!Number.isNaN(t)&&t>=600}function XC(e){let t=e.tagName,n=e.getAttribute(`style`)??``,r=JC(n,`font-weight`),i=r?YC(r):t===`B`||t===`STRONG`,a=JC(n,`font-style`),o=a?a===`italic`||a===`oblique`:t===`I`||t===`EM`,s=JC(n,`text-decoration`),c=t===`S`||t===`DEL`||t===`STRIKE`||s.includes(`line-through`);return{prefix:(c?`~~`:``)+(i?`**`:``)+(o?`*`:``),suffix:(o?`*`:``)+(i?`**`:``)+(c?`~~`:``)}}function ZC(e){return e.replace(/\s+/g,` `)}function QC(e){return e.replace(/\*/g,`\\*`)}function $C(e){let t=e.querySelector(`code`),n=`${e.className} ${t?.className??``}`,r=/(?:language|lang)-([\w-]+)/.exec(n);return r?r[1]:e.getAttribute(`lang`)??t?.getAttribute(`lang`)??``}function ew(e){return`\n\n\`\`\`${$C(e)}\n${(e.textContent??``).replace(/\n$/,``)}\n\`\`\`\n\n`}function tw(e){let t=e.textContent??``;return t.includes("`")?`\`\` ${t} \`\``:`\`${t}\``}function nw(e){return/^(https?:|mailto:)/i.test(e)}function rw(e,t){let n=e.getAttribute(`href`)??``,r=cw(e,t).trim();return nw(n)?!r||r===n?n:`[${r}](${n})`:r}function iw(e){let t=e.getAttribute(`src`)??``;return!t||!nw(t)?``:`![${e.getAttribute(`alt`)??``}](${t})`}function aw(e,t){return`\n\n${cw(e,t).trim().split(`
28
+ `).map(e=>e?`> ${e}`:`>`).join(`
29
+ `)}\n\n`}function ow(e,t){let n=e.tagName===`OL`,r=Number.parseInt(e.getAttribute(`start`)??``,10),i=Number.isNaN(r)?1:r,a=` `.repeat(t),o=[];for(let r of Array.from(e.childNodes)){if(!sC(r)||r.tagName!==`LI`)continue;let e=n?`${i}. `:`- `;i++;let s=``,c=``;for(let e of Array.from(r.childNodes))sC(e)&&(e.tagName===`UL`||e.tagName===`OL`)?c+=`\n${ow(e,t+1)}`:s+=lw(e,t);o.push(`${a}${e}${s.trim()}${c}`)}return o.join(`
30
+ `)}function sw(e,t){let n=Array.from(e.querySelectorAll(`tr`));if(n.length===0)return``;let r=n.map(e=>Array.from(e.children).filter(e=>e.tagName===`TD`||e.tagName===`TH`).map(e=>cw(e,t).replace(/\n+/g,` `).replace(/\|/g,`\\|`).trim())),i=r[0],a=i.map(()=>`---`),o=e=>`| ${e.join(` | `)} |`;return[o(i),o(a),...r.slice(1).map(o)].join(`
31
+ `)}function cw(e,t){let n=``;return e.childNodes.forEach(e=>{n+=lw(e,t)}),n}function lw(e,t){if(uC(e))return QC(ZC(e.textContent??``));if(!sC(e))return``;let n=e.tagName;switch(n){case`SCRIPT`:case`STYLE`:case`NOSCRIPT`:case`HEAD`:case`TITLE`:return``;case`BR`:return`
32
+ `;case`HR`:return`
33
+
34
+ ---
35
+
36
+ `;case`H1`:case`H2`:case`H3`:case`H4`:case`H5`:case`H6`:return`\n\n${`#`.repeat(Number(n[1]))} ${cw(e,t).trim()}\n\n`;case`P`:return`\n\n${cw(e,t).trim()}\n\n`;case`DIV`:return`\n${cw(e,t).trim()}\n`;case`BLOCKQUOTE`:return aw(e,t);case`UL`:case`OL`:return`\n\n${ow(e,t)}\n\n`;case`LI`:return`${cw(e,t).trim()}\n`;case`PRE`:return ew(e);case`CODE`:return tw(e);case`A`:return rw(e,t);case`IMG`:return iw(e);case`TABLE`:return`\n\n${sw(e,t)}\n\n`;default:{let{prefix:n,suffix:r}=XC(e);return n+cw(e,t)+r}}}function uw(e){return e.replace(/[ \t]+\n/g,`
37
+ `).replace(/\n[ \t]*\n[ \t\n]*/g,`
38
+
39
+ `).trim()}function dw(e){if(!e)return``;let t=new DOMParser().parseFromString(e,`text/html`);return t.body?uw(cw(t.body,0)):``}var fw=100;function pw(e){let{editorRef:t,readSegmentsFromDOM:n,onChange:r,renderSegmentsToDOM:i,runTriggerDetection:a,dismissTrigger:o,triggers:s,markdownEnabled:c,normalizeBullets:l,onPaste:u,onUndo:d,onRedo:f,onChipAdd:p,onImagePaste:m,onRawPaste:h}=e,g=(0,v.useRef)(!1),_=(0,v.useRef)({undoStack:[],redoStack:[]}),y=(0,v.useCallback)(e=>{let t=_.current;t.undoStack.push(e),t.undoStack.length>fw&&t.undoStack.shift(),t.redoStack=[]},[]),b=(0,v.useCallback)(()=>{_.current={undoStack:[],redoStack:[]}},[]),x=(0,v.useCallback)(e=>{if(h?.(e),e.defaultPrevented)return;e.preventDefault();let o=t.current;if(!o)return;let d=Array.from(e.clipboardData.files).find(e=>e.type.startsWith(`image/`))??Array.from(e.clipboardData.items).find(e=>e.type.startsWith(`image/`))?.getAsFile()??null;if(d){m?.(d);return}let f=n();y(f);let g=e.clipboardData.getData(`text/prompt-area-segments`);if(g){let e=KC(g);if(e&&e.length>0){let t=MC();if(!t)return;t.deleteContents();let s=qC(n(),e,o);r(s),i(s),u?.({segments:s,source:`internal`});for(let t of e)t.type===`chip`&&p?.(t);a();return}}let _=``;if(c){if(_=e.clipboardData.getData(`text/markdown`),_)_=_.replace(/\\([()])/g,`$1`);else{let t=e.clipboardData.getData(`text/html`);if(t)try{_=dw(t)}catch{_=``}}}if(_||=e.clipboardData.getData(`text/plain`),!_)return;c&&l&&(_=ZS(_,!0)),c&&$S(_)&&(_=eC(_).text);let v=MC();if(!v)return;v.deleteContents();let b=_.split(`
40
+ `),x=document.createDocumentFragment();for(let e=0;e<b.length;e++)b[e]&&x.appendChild(document.createTextNode(b[e])),e<b.length-1&&x.appendChild(document.createElement(`br`));v.insertNode(x),v.collapse(!1);let S=window.getSelection();S?.removeAllRanges(),S?.addRange(v),EC(o);let C=n(),w=NS(C,s);if(w!==C){r(w),i(w);for(let e of w)e.type===`chip`&&!C.some(t=>t.type===`chip`&&t.trigger===e.trigger&&t.value===e.value&&t.displayText===e.displayText)&&p?.(e)}else r(C);u?.({segments:w,source:`external`}),a()},[t,n,r,y,a,i,s,c,l,u,p,m,h]),S=(0,v.useCallback)(e=>{e.preventDefault();let t=MC();if(!t)return;let n=t.cloneContents(),r=WC(n);e.clipboardData.setData(`text/plain`,r);let i=GC(n);if(i.some(e=>e.type===`chip`)){let t=mC(i);t&&e.clipboardData.setData(`text/prompt-area-segments`,t)}},[]),C=(0,v.useCallback)(e=>{S(e);let i=MC();if(!i)return;let o=n();y(o),i.deleteContents();let s=t.current;s&&EC(s);let c=n();r(c),a()},[S,t,n,r,y,a]),w=(0,v.useCallback)(e=>{e.preventDefault()},[]),T=(0,v.useCallback)(e=>{e.preventDefault()},[]),E=(0,v.useCallback)(()=>{g.current=!0},[]),D=(0,v.useCallback)(()=>{g.current=!1,a()},[a]),O=(0,v.useCallback)(()=>{setTimeout(()=>{let e=t.current;if(!e)return;let n=document.activeElement;n&&e.parentElement?.contains(n)||o()},150)},[t,o]),k=(0,v.useCallback)(e=>{if(!(e.metaKey||e.ctrlKey)||e.key!==`z`)return!1;e.preventDefault();let t=_.current;if(e.shiftKey){if(t.redoStack.length===0)return!0;let e=t.redoStack.pop();if(!e)return!0;let a=n();t.undoStack.push(a),r(e),i(e),f?.(e)}else{if(t.undoStack.length===0)return!0;let e=t.undoStack.pop();if(!e)return!0;let a=n();t.redoStack.push(a),r(e),i(e),d?.(e)}return!0},[n,r,i,d,f]);return(0,v.useMemo)(()=>({handlePaste:x,handleCopy:S,handleCut:C,handleDrop:w,handleDragOver:T,handleCompositionStart:E,handleCompositionEnd:D,handleBlur:O,handleKeyDownForUndoRedo:k,pushUndo:y,resetUndoHistory:b,isComposing:g}),[x,S,C,w,T,E,D,O,k,y,b])}function mw({editorRef:e,triggers:t,markdownEnabled:n,submitOnEnter:r,onSubmit:i,onEscape:a,onChange:o,onChipAdd:s,onChipDelete:c,readSegmentsFromDOM:l,renderSegmentsToDOM:u,runTriggerDetection:d,dismissTrigger:f,buildInsertChip:p,selectSuggestionInternal:m,activeTrigger:h,suggestions:g,suggestionsLoading:_,suggestionsError:y,selectedSuggestionIndex:b,setSelectedSuggestionIndex:x,pushUndo:S,handleKeyDownForUndoRedo:C,lastRenderedValue:w,undoTimer:T,undoBaseState:E}){let D=(0,v.useCallback)((e,t)=>{let n=l(),r=xC(e,t);if(r===-1)return!1;let i=CC(e,r),a=n[i],s=jS(n,i);return o(s),u(s),a?.type===`chip`&&c?.(a),!0},[l,o,u,c]),O=(0,v.useCallback)((e,t)=>{let n=l(),r=xC(e,t);if(r===-1)return!1;let i=CC(e,r),a=n[i],s=MS(n,i);if(!s)return!1;let d=0;for(let e=0;e<i;e++){let t=n[e];t.type===`text`?d+=t.text.length:d+=t.trigger.length+t.displayText.length}return d+=s.revertedText.length,o(s.segments),u(s.segments),LC(e,d),a?.type===`chip`&&c?.(a),!0},[l,o,u,c]),k=(0,v.useCallback)(()=>{let t=e.current;if(!t)return!1;let n=MC();if(!n||!n.collapsed)return!1;let r=n.startContainer,i=n.startOffset;if(r===t&&i>0){let e=t.childNodes[i-1];if(e&&cC(e))return dC(e)?O(t,e):D(t,e)}if(r.nodeType===Node.TEXT_NODE&&i===0){let e=wC(t,r);if(!e)return!1;let n=e.previousSibling;for(;n&&n.nodeType===Node.TEXT_NODE&&n.textContent===``;)n=n.previousSibling;if(n&&cC(n))return dC(n)?O(t,n):D(t,n)}return!1},[D,O]),A=(0,v.useCallback)(()=>{let t=e.current;if(!t)return!1;let n=MC();if(!n||!n.collapsed)return!1;let r=n.startContainer,i=n.startOffset;if(r===t&&i<t.childNodes.length){let e=t.childNodes[i];if(e&&cC(e))return D(t,e)}if(r.nodeType===Node.TEXT_NODE&&i===(r.textContent??``).length){let e=wC(t,r);if(!e)return!1;let n=e.nextSibling;for(;n&&n.nodeType===Node.TEXT_NODE&&n.textContent===``;)n=n.nextSibling;if(n&&cC(n))return D(t,n)}return!1},[D]),j=(0,v.useCallback)(t=>{let n=l(),r=t.query,i={value:r,label:r},a={value:r,displayText:(t.config.onSelect?.(i)??r)||r,autoResolved:!0},c=kS(n,t,a);o(c.segments),u(c.segments),s?.({type:`chip`,trigger:t.config.char,...a});let d=e.current;d&&LC(d,c.cursorOffset),f()},[l,o,u,f,s]);return(0,v.useCallback)(s=>{let c=(e,t)=>{let{segments:r,cursorOffset:i}=t;if(n){let e=nC(r);r=e.segments,i=tC(i,e.edits)}w.current=r,o(r),u(r),LC(e,i)},v=e=>{if(!n)return!1;let t=l(),r=NC(e);if(r===null||!VS(SS(t),r))return!1;let i=US(t,r);return i&&c(e,i),!0};if((s.metaKey||s.ctrlKey)&&s.key===`z`&&E.current&&(T.current&&=(clearTimeout(T.current),null),S(E.current),E.current=null),C(s))return;if(n&&(s.metaKey||s.ctrlKey)&&!s.shiftKey&&(s.key===`b`||s.key===`i`)){s.preventDefault();let t=e.current;if(!t)return;let n=zC(t);if(!n||n.start===n.end)return;let r=s.key===`b`?`**`:`*`,i=l();S(i);let a=IS(i,n.start,n.end,r);if(!a)return;w.current=a.segments,o(a.segments),u(a.segments),BC(t,a.selectionStart,a.selectionEnd);return}if(!s.metaKey&&!s.ctrlKey&&!s.altKey&&!s.nativeEvent.isComposing&&s.key.length===1){let n=t.find(e=>e.mode===`launch`&&e.char===s.key),r=e.current;if(n?.onActivate&&r){let e=NC(r);if(e!==null){let t=l(),r=SS(t);if(DS(r,e,n.position)){s.preventDefault(),n.onActivate({text:r,cursorPosition:e,insertChip:p(FS(t,e,e,n.char),{config:n,startOffset:e,query:``})});return}}}}if(h&&h.config.mode===`dropdown`&&(g.length>0||_||y!==null||h.config.emptyMessage)){if(s.key===`ArrowDown`){s.preventDefault(),g.length>0&&x(e=>Math.min(e+1,g.length-1));return}if(s.key===`ArrowUp`){s.preventDefault(),g.length>0&&x(e=>Math.max(e-1,0));return}if(s.key===`Enter`||s.key===`Tab`){s.preventDefault();let e=g[b];e&&m(e);return}if(s.key===`Escape`){s.preventDefault(),f();return}}if(s.key===` `&&h&&h.config.resolveOnSpace&&h.query.trim().length>0){s.preventDefault(),j(h);return}if(n&&s.key===`Tab`&&!h){let t=e.current;if(t){let e=l(),n=SS(e),r=NC(t);if(r!==null&&VS(n,r)){s.preventDefault();let n=s.shiftKey?KS(e,r):GS(e,r);n&&c(t,n);return}}}let D=e=>{let t=zC(e);if(!t)return;let n=l();S(n);let r=FS(n,t.start,t.end,`
41
+ `);c(e,{segments:r,cursorOffset:t.start+1})};if(s.key===`Enter`&&s.shiftKey&&!s.nativeEvent.isComposing){s.preventDefault();let t=e.current;t&&!v(t)&&D(t);return}if(s.key===`Enter`&&!s.shiftKey&&!s.nativeEvent.isComposing){if(s.preventDefault(),r){i?.(l());return}let t=e.current;t&&!v(t)&&D(t);return}if(s.key===`Escape`&&a){a();return}if((s.key===`Backspace`||s.key===`Delete`)&&!s.nativeEvent.isComposing){let t=e.current;if(t){let e=zC(t);if(e&&e.start!==e.end){s.preventDefault();let n=l();S(n),c(t,{segments:FS(n,e.start,e.end,``),cursorOffset:e.start}),d();return}}}if(s.key===`Backspace`){let t=e.current;if(t){let e=l(),r=NC(t);if(n&&r!==null){let n=qS(e,r);if(n){s.preventDefault(),c(t,n),d();return}}}if(k()){s.preventDefault(),d();return}}if(s.key===`Delete`&&A()){s.preventDefault(),d();return}},[h,g,_,y,b,i,r,a,l,o,u,n,f,k,A,j,d,m,S,C,t,p])}function hw({editorRef:e,triggers:t,disabled:n,onChange:r,renderSegmentsToDOM:i,onChipClick:a,onChipAdd:o,onChipDelete:s,onLinkClick:c,setActiveTrigger:l,setSelectedSuggestionIndex:u,setTriggerRect:d,runSearch:f,activeTrigger:p,suggestions:m}){let h=(0,v.useRef)(null),g=(0,v.useRef)(null),_=(0,v.useRef)(null),y=(0,v.useCallback)(r=>{let i=r.target;if(!(i instanceof Node))return;let o=e.current;if(!o)return;let s=i;for(;s&&s!==o;){if(fC(s)){if(r.metaKey||r.ctrlKey){r.preventDefault(),c?.(s.href),window.open(s.href,`_blank`,`noopener,noreferrer`);return}break}if(cC(s)){let e=s.getBoundingClientRect(),i=document.createElement(`span`);i.className=`prompt-area-chip-ripple`;let c=Math.max(e.width,e.height);i.style.width=`${c}px`,i.style.height=`${c}px`,i.style.left=`${r.clientX-e.left-c/2}px`,i.style.top=`${r.clientY-e.top-c/2}px`,s.appendChild(i),i.addEventListener(`animationend`,()=>i.remove());let p=bC(s);if(p){let r=t.find(e=>e.char===p.trigger),i=_.current===s;if(_.current=null,!n&&!i&&r?.reopenOnChipClick&&r.mode===`dropdown`&&r.onSearch){let t=xC(o,s);h.current={chip:p,segIndex:CC(o,t)},g.current=s,l({config:r,startOffset:0,query:``}),u(0),d(e),f(``,r)}a?.(p)}return}s=s.parentNode}},[a,c,t,f,n]),b=(0,v.useCallback)(t=>{let n=t.target,r=e.current;if(!r||!(n instanceof Node)){_.current=null;return}let i=n;for(;i&&i!==r;){if(cC(i)){_.current=g.current===i?i:null;return}i=i.parentNode}_.current=null},[]),x=(0,v.useCallback)(()=>{h.current=null,g.current=null},[]),S=(0,v.useCallback)((t,a,c,l)=>{let u=h.current;if(!u)return!1;let d=e.current;if(d&&!n){let e=t[u.segIndex],n=e?.type===`chip`&&e.trigger===u.chip.trigger&&e.value===u.chip.value?u.segIndex:(()=>{let e=[];return t.forEach((t,n)=>{t.type===`chip`&&t.trigger===u.chip.trigger&&t.value===u.chip.value&&e.push(n)}),e.length===1?e[0]:-1})(),f=n===-1?void 0:t[n];if(f?.type===`chip`){let e={type:`chip`,trigger:c,...a},u=t.map((t,r)=>r===n?e:t),p=u[n+1],m=!p||p.type!==`text`||p.text.length===0;m&&(u=[...u.slice(0,n+1),{type:`text`,text:` `},...u.slice(n+1)]),l(t),r(u),i(u),(f.value!==e.value||f.displayText!==e.displayText||mC(f.data)!==mC(e.data))&&(s?.(f),o?.(e)),LC(d,SS(u.slice(0,n+1)).length+ +!!m)}}return!0},[n,r,i,o,s]);return(0,v.useEffect)(()=>{let e=h.current;if(!e||!p?.config.reopenOnChipClick)return;let t=m.findIndex(t=>t.value===e.chip.value);t>0&&u(t)},[m,p]),(0,v.useMemo)(()=>({handleClick:y,handleMouseDown:b,clear:x,trySelectEditingChip:S}),[y,b,x,S])}function gw(){let[e,t]=(0,v.useState)([]),[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(null),o=(0,v.useRef)(0),s=(0,v.useRef)(null),c=(0,v.useRef)(null),l=(0,v.useCallback)(()=>{s.current?.abort(),c.current&&clearTimeout(c.current),t([]),r(!1),a(null)},[]),u=(0,v.useCallback)((e,n)=>{if(!n.onSearch)return;s.current?.abort(),c.current&&clearTimeout(c.current),r(!0),a(null),o.current++;let i=o.current,l=new AbortController;s.current=l;let{onSearch:u,onSearchError:d,searchDebounceMs:f}=n,p=()=>{let n=u(e,{signal:l.signal});n instanceof Promise?n.then(e=>{l.signal.aborted||o.current!==i||(t(e),r(!1))},e=>{l.signal.aborted||o.current!==i||e instanceof DOMException&&e.name===`AbortError`||(a(e instanceof Error?e.message:`Search failed`),r(!1),d?.(e))}):(t(n),r(!1))};f&&f>0&&e.length>0?c.current=setTimeout(p,f):p()},[]);return(0,v.useEffect)(()=>()=>{s.current?.abort(),c.current&&clearTimeout(c.current)},[]),{suggestions:e,suggestionsLoading:n,suggestionsError:i,search:u,reset:l}}var _w=300,vw=[];function yw({value:e,onChange:t,triggers:n=vw,disabled:r=!1,onSubmit:i,onEscape:a,onChipClick:o,onChipAdd:s,onChipDelete:c,onLinkClick:l,onPaste:u,onRawPaste:d,onUndo:f,onRedo:p,onImagePaste:m,markdown:h=!0,normalizeBullets:g=!0,submitOnEnter:_=!0,maxLength:y}){let b=(0,v.useRef)(null),[x,S]=(0,v.useState)(null),[C,w]=(0,v.useState)(0),[T,E]=(0,v.useState)(null),{suggestions:D,suggestionsLoading:O,suggestionsError:k,search:A,reset:j}=gw(),M=(0,v.useRef)(!1),N=(0,v.useRef)([]),P=(0,v.useRef)(null),F=(0,v.useRef)(null),I=(0,v.useCallback)(()=>{let e=b.current;if(!e)return[];let t=[],n=!1,r=!1;for(let i=0;i<e.childNodes.length;i++){let a=e.childNodes[i];if(a.nodeType===Node.TEXT_NODE){let e=a.textContent??``;e&&(t.push({type:`text`,text:e}),n=!0)}else if(cC(a)){let e=bC(a);e&&(t.push(e),n=!0)}else if(lC(a)){if(a.dataset.sentinel){r=!0;continue}t.push({type:`text`,text:`
42
+ `})}else if(sC(a)){let e=a.textContent??``;e&&(t.push({type:`text`,text:e}),n=!0)}}return!n&&!r?[]:t},[]),L=(0,v.useCallback)(e=>{let t=b.current;if(!t)return;M.current=!0;let r=NC(t);for(;t.firstChild;)t.removeChild(t.firstChild);for(let r of e)if(r.type===`text`){let e=r.text.split(`
43
+ `);for(let n=0;n<e.length;n++)e[n]&&t.appendChild(document.createTextNode(e[n])),n<e.length-1&&t.appendChild(document.createElement(`br`))}else{let e=document.createElement(`span`);if(e.contentEditable=`false`,e.dataset.chipTrigger=r.trigger,e.dataset.chipValue=r.value,e.dataset.chipDisplay=r.displayText,r.data!==void 0){let t=mC(r.data);t&&(e.dataset.chipData=t)}r.autoResolved&&(e.dataset.chipAutoResolved=`true`);let i=n.find(e=>e.char===r.trigger),a=i?.chipStyle??`pill`;e.dataset.chipStyle=a,e.className=W(`prompt-area-chip`,a===`inline`&&`prompt-area-chip--inline`,i?.chipClassName),e.textContent=`${r.trigger}${r.displayText}`,e.setAttribute(`role`,`button`),e.setAttribute(`tabindex`,`-1`),t.appendChild(e)}if(t.lastChild&&lC(t.lastChild)){let e=document.createElement(`br`);e.dataset.sentinel=`true`,t.appendChild(e)}jC(t,h),r!==null&&LC(t,r),N.current=e,M.current=!1},[n,h]),ee=hw({editorRef:b,triggers:n,disabled:r,onChange:t,renderSegmentsToDOM:L,onChipClick:o,onChipAdd:s,onChipDelete:c,onLinkClick:l,setActiveTrigger:S,setSelectedSuggestionIndex:w,setTriggerRect:E,runSearch:A,activeTrigger:x,suggestions:D}),R=(0,v.useCallback)((e,n)=>r=>{let i=kS(e,n,{value:r.value,displayText:r.displayText,data:r.data});t(i.segments),L(i.segments),s?.({type:`chip`,trigger:n.config.char,value:r.value,displayText:r.displayText,...r.data===void 0?{}:{data:r.data}});let a=b.current;a&&LC(a,i.cursorOffset)},[t,L,s]),te=(0,v.useCallback)(()=>{let e=b.current;if(!e)return;let t=I(),r=SS(t),i=NC(e);if(i===null)return;let a=OS(r,i,n);if(ee.clear(),a){S(a),w(0);let n=PC(e,a.startOffset);if(n){let e=n.getBoundingClientRect();(e.height>0||e.left>0||e.top>0)&&E(e)}a.config.mode===`dropdown`&&a.config.onSearch&&A(a.query,a.config),a.config.mode===`callback`&&a.config.onActivate&&a.config.onActivate({text:r,cursorPosition:i,insertChip:R(t,a)})}else S(null),j()},[n,I,R,j,A,ee]),z=(0,v.useCallback)(()=>{ee.clear(),S(null),w(0),j()},[j,ee]),B=pw({editorRef:b,readSegmentsFromDOM:I,onChange:t,renderSegmentsToDOM:L,runTriggerDetection:te,dismissTrigger:z,triggers:n,markdownEnabled:h,normalizeBullets:g,onPaste:u,onRawPaste:d,onUndo:f,onRedo:p,onChipAdd:s,onImagePaste:m});(0,v.useLayoutEffect)(()=>{if(!M.current&&!LS(e,N.current)){if(h&&g){let n=QS(e,!0);if(n!==e){t(n);return}}if(RS(I(),e)){N.current=e;return}L(e)}},[e,I,L,h,g,t]);let V=(0,v.useRef)(h);(0,v.useLayoutEffect)(()=>{if(V.current===h)return;V.current=h;let n=g?QS(e,h):e;n===e?L(e):t(n)},[h,g,L,e,t]),(0,v.useEffect)(()=>()=>{P.current&&clearTimeout(P.current)},[]);let ne=(0,v.useCallback)(()=>{if(M.current)return;if(B.isComposing.current){let e=I();N.current=e,t(e);return}let e=b.current,n=e?NC(e):null;e&&EC(e);let r=I();if(y!=null&&e&&SS(r).length>y){let n=NC(e),i=wS(r,y);N.current=i,t(i),L(i),LC(e,n==null?y:Math.min(n,y)),te();return}if(h&&g&&e&&n!==null){let i=HS(r,n);if(i){N.current=i.segments,t(i.segments),L(i.segments),LC(e,i.cursorOffset),te();return}}let i=r,a=null;if(h&&n!==null&&$S(SS(r))){let e=nC(r);e.edits.length>0&&(i=e.segments,a=tC(n,e.edits))}F.current||=N.current,N.current=i,t(i),P.current&&clearTimeout(P.current),P.current=setTimeout(()=>{F.current&&=(B.pushUndo(F.current),null),P.current=null},_w),e&&(a===null?(jC(e,h),n!==null&&LC(e,n)):(L(i),LC(e,a))),te()},[t,I,te,L,h,g,y,B]),H=(0,v.useCallback)(e=>{if(!x)return;let n=I(),r=x.config.insertAsText?.(e);if(r!==void 0){let e=AS(n,x,r);B.pushUndo(n),t(e.segments),L(e.segments);let i=b.current;i&&LC(i,e.cursorOffset),z(),setTimeout(()=>{b.current?.focus()},0);return}let i=x.config.onSelect?.(e)??e.label,a={value:e.value,displayText:i||e.label,data:e.data};if(ee.trySelectEditingChip(n,a,x.config.char,B.pushUndo)){z(),setTimeout(()=>{b.current?.focus()},0);return}let o=kS(n,x,a);t(o.segments),L(o.segments),s?.({type:`chip`,trigger:x.config.char,...a});let c=b.current;c&&LC(c,o.cursorOffset),z(),setTimeout(()=>{b.current?.focus()},0)},[x,I,t,L,z,s,B,ee]),re=H,ie=mw({editorRef:b,triggers:n,markdownEnabled:h,submitOnEnter:_,onSubmit:i,onEscape:a,onChange:t,onChipAdd:s,onChipDelete:c,readSegmentsFromDOM:I,renderSegmentsToDOM:L,runTriggerDetection:te,dismissTrigger:z,buildInsertChip:R,selectSuggestionInternal:H,activeTrigger:x,suggestions:D,suggestionsLoading:O,suggestionsError:k,selectedSuggestionIndex:C,setSelectedSuggestionIndex:w,pushUndo:B.pushUndo,handleKeyDownForUndoRedo:B.handleKeyDownForUndoRedo,lastRenderedValue:N,undoTimer:P,undoBaseState:F}),ae=(0,v.useMemo)(()=>({focus:()=>b.current?.focus(),blur:()=>b.current?.blur(),insertChip:e=>{let n=I(),r={type:`chip`,...e},i=[...n,r,{type:`text`,text:` `}];t(i),L(i),s?.(r)},getPlainText:()=>SS(I()),clear:()=>{t([]);let e=b.current;if(e)for(;e.firstChild;)e.removeChild(e.firstChild);B.resetUndoHistory(),P.current&&=(clearTimeout(P.current),null),F.current=null},setText:e=>{B.pushUndo(I());let n=CS(e);t(n),L(n);let r=b.current;r&&LC(r,e.length)},appendText:e=>{let n=I();B.pushUndo(n);let r=n[n.length-1],i=r?.type===`text`?[...n.slice(0,-1),{type:`text`,text:r.text+e}]:[...n,{type:`text`,text:e}];t(i),L(i);let a=b.current;a&&LC(a,SS(i).length)},getCursorPosition:()=>{let e=b.current;return e?NC(e):null},setCursorPosition:e=>{let t=b.current;t&&LC(t,e)},setCursorToEnd:()=>{let e=b.current;e&&LC(e,SS(I()).length)},getSelection:()=>{let e=b.current;return e?zC(e):null},setSelection:(e,t)=>{let n=b.current;n&&BC(n,e,t)}}),[I,t,L,s,B]),oe=(0,v.useMemo)(()=>({onPaste:B.handlePaste,onCopy:B.handleCopy,onCut:B.handleCut,onDrop:B.handleDrop,onDragOver:B.handleDragOver,onCompositionStart:B.handleCompositionStart,onCompositionEnd:B.handleCompositionEnd,onBlur:B.handleBlur}),[B.handlePaste,B.handleCopy,B.handleCut,B.handleDrop,B.handleDragOver,B.handleCompositionStart,B.handleCompositionEnd,B.handleBlur]);return{editorRef:b,activeTrigger:x,suggestions:D,suggestionsLoading:O,suggestionsError:k,selectedSuggestionIndex:C,handleInput:ne,handleKeyDown:ie,handleClick:ee.handleClick,handleMouseDown:ee.handleMouseDown,selectSuggestion:re,dismissTrigger:z,handle:ae,triggerRect:T,eventHandlers:oe}}var bw=240;function xw({suggestions:e,loading:t,error:n,emptyMessage:r,selectedIndex:i,onSelect:a,onDismiss:o,triggerRect:s,triggerChar:c}){let l=(0,v.useRef)(null),u=(0,v.useRef)(null);if((0,v.useEffect)(()=>{u.current?.scrollIntoView({block:`nearest`})},[i]),(0,v.useEffect)(()=>{let e=e=>{let t=e.target;l.current&&t instanceof Node&&!l.current.contains(t)&&o()};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[o]),!s||e.length===0&&!t&&!n&&!r)return null;let d=Math.min(320,window.innerWidth-16),f=Math.min(s.left,window.innerWidth-d-8),p=window.innerHeight-s.bottom,m=p<bw&&s.top>p,h={position:`fixed`,left:`${Math.max(8,f)}px`,zIndex:50,maxWidth:`${d}px`,maxHeight:`${bw}px`,...m?{bottom:`${window.innerHeight-s.top+4}px`}:{top:`${s.bottom+4}px`}};return(0,U.jsx)(`div`,{ref:l,className:W(`min-w-[200px] overflow-y-auto`,`bg-surface rounded-xl border p-2 shadow-md`,`animate-in fade-in-0 zoom-in-95`),style:h,role:`listbox`,"aria-label":`${c} suggestions`,children:t?(0,U.jsx)(`div`,{role:`option`,"aria-selected":!1,className:`text-muted-foreground px-3 py-2 text-sm`,children:`Loading suggestions...`}):n?(0,U.jsx)(`div`,{role:`option`,"aria-selected":!1,className:`text-destructive px-3 py-2 text-sm`,children:n}):e.length===0&&r?(0,U.jsx)(`div`,{role:`option`,"aria-selected":!1,className:`text-muted-foreground px-3 py-2 text-sm`,children:r}):e.map((e,t)=>(0,U.jsxs)(`button`,{ref:t===i?u:void 0,type:`button`,role:`option`,"aria-selected":t===i,className:W(`text-foreground flex w-full items-start gap-2 rounded-lg px-3 py-2 text-left text-sm`,`hover:bg-surface-hover cursor-pointer transition-colors`,t===i&&`bg-surface-hover`),onMouseDown:t=>{t.preventDefault(),a(e)},children:[e.icon&&(0,U.jsx)(`span`,{className:`mt-0.5 shrink-0`,children:e.icon}),(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(`div`,{className:`truncate font-medium`,children:e.label}),e.description&&(0,U.jsx)(`div`,{className:`text-muted-foreground truncate text-xs`,children:e.description})]})]},e.value))})}function Sw({texts:e,interval:t=3e3}){let[n,r]=(0,v.useState)(0);return(0,v.useEffect)(()=>{if(e.length<=1)return;let n=setInterval(()=>{r(t=>(t+1)%e.length)},t);return()=>clearInterval(n)},[e.length,t]),(0,U.jsx)(`div`,{className:`pointer-events-none absolute top-0 left-0 overflow-hidden select-none`,style:{color:`var(--prompt-area-placeholder, var(--muted-foreground))`},"aria-hidden":`true`,children:(0,U.jsx)(`div`,{className:`animate-in fade-in-0 slide-in-from-top-4 duration-300 ease-in-out`,children:e[n]},n)})}function Cw({onClick:e,label:t,className:n}){return(0,U.jsx)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),e()},className:W(`absolute top-0.5 right-0.5 grid h-3.5 w-3.5 cursor-pointer place-items-center`,`rounded-full bg-black/60 text-white hover:bg-black/80 dark:bg-white/60 dark:text-black dark:hover:bg-white/80`,`transition-colors`,n),"aria-label":t,children:(0,U.jsxs)(`svg`,{width:`8`,height:`8`,viewBox:`0 0 10 10`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,children:[(0,U.jsx)(`line`,{x1:`2.75`,y1:`2.75`,x2:`7.25`,y2:`7.25`}),(0,U.jsx)(`line`,{x1:`7.25`,y1:`2.75`,x2:`2.75`,y2:`7.25`})]})})}function ww({images:e,onRemove:t,onClick:n,className:r}){return e.length===0?null:(0,U.jsx)(`div`,{className:W(`flex flex-wrap gap-2`,r),role:`list`,"aria-label":`Attached images`,children:e.map(e=>(0,U.jsxs)(`div`,{role:`listitem`,className:W(`border-border relative h-16 w-16 flex-shrink-0 overflow-hidden rounded-md border`,n&&`cursor-pointer`),onClick:()=>n?.(e),children:[(0,U.jsx)(`img`,{src:e.url,alt:e.alt??`Attached image`,className:`h-full w-full object-cover`}),e.loading&&(0,U.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-black/40`,children:(0,U.jsx)(`div`,{className:`h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent`})}),t&&(0,U.jsx)(Cw,{onClick:()=>t(e),label:`Remove ${e.alt??`image`}`})]},e.id))})}function Tw({className:e,children:t}){return(0,U.jsx)(`svg`,{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`,"aria-hidden":`true`,className:e,children:t})}var Ew=(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`}),(0,U.jsx)(`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`})]});function Dw({className:e}){return(0,U.jsx)(Tw,{className:e,children:Ew})}function Ow({className:e}){return(0,U.jsxs)(Tw,{className:e,children:[Ew,(0,U.jsx)(`path`,{d:`M10 9H8`}),(0,U.jsx)(`path`,{d:`M16 13H8`}),(0,U.jsx)(`path`,{d:`M16 17H8`})]})}function kw({className:e}){return(0,U.jsxs)(Tw,{className:e,children:[Ew,(0,U.jsx)(`path`,{d:`M8 13h2`}),(0,U.jsx)(`path`,{d:`M14 13h2`}),(0,U.jsx)(`path`,{d:`M8 17h2`}),(0,U.jsx)(`path`,{d:`M14 17h2`})]})}function Aw({className:e}){return(0,U.jsxs)(Tw,{className:e,children:[Ew,(0,U.jsx)(`path`,{d:`M10 12.5 8 15l2 2.5`}),(0,U.jsx)(`path`,{d:`m14 12.5 2 2.5-2 2.5`})]})}function jw({className:e}){return(0,U.jsxs)(Tw,{className:e,children:[(0,U.jsx)(`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`}),(0,U.jsx)(`circle`,{cx:`9`,cy:`9`,r:`2`}),(0,U.jsx)(`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`})]})}var Mw=3;function Nw(e){return e?e===`application/pdf`?`pdf`:e.includes(`spreadsheet`)||e===`text/csv`?`spreadsheet`:e.startsWith(`text/`)||e.includes(`javascript`)||e.includes(`json`)||e.includes(`xml`)?`code`:e.startsWith(`image/`)?`image`:`default`:`default`}var Pw={pdf:Ow,spreadsheet:kw,code:Aw,image:jw,default:Dw};function Fw(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:e<1073741824?`${(e/1048576).toFixed(1)} MB`:`${(e/1073741824).toFixed(1)} GB`}function Iw(e){let t=e.lastIndexOf(`.`);return t===-1||t===e.length-1?null:e.slice(t+1).toUpperCase()}function Lw({file:e,compact:t,onRemove:n,onClick:r}){let i=[Iw(e.name),e.size==null?null:Fw(e.size)].filter(Boolean).join(` · `);return(0,U.jsxs)(`div`,{role:`listitem`,className:W(`border-border relative flex flex-shrink-0 items-center gap-2 overflow-hidden rounded-lg border transition-colors`,`hover:bg-surface-hover`,t?`h-10 w-36 px-2`:`h-14 w-48 px-3`,r&&`cursor-pointer`),onClick:()=>r?.(e),children:[(()=>{let n=Pw[Nw(e.type)];return(0,U.jsx)(n,{className:W(`text-muted-foreground flex-shrink-0`,t?`h-4 w-4`:`h-5 w-5`)})})(),(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(`div`,{className:W(`truncate font-medium`,t?`text-xs`:`text-sm`),title:e.name,children:e.name}),!t&&i&&(0,U.jsx)(`div`,{className:`text-muted-foreground truncate text-xs`,children:i})]}),e.loading&&(0,U.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-black/40`,children:(0,U.jsx)(`div`,{className:`h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent`})}),n&&(0,U.jsx)(Cw,{onClick:()=>n(e),label:`Remove ${e.name}`})]})}function Rw({files:e,onRemove:t,onClick:n,className:r}){let[i,a]=(0,v.useState)(!1),o=(0,v.useRef)(null),s=(0,v.useRef)(null);if((0,v.useEffect)(()=>{if(!i)return;let e=e=>{let t=e.target;t instanceof Node&&o.current&&!o.current.contains(t)&&!s.current?.contains(t)&&a(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[i]),e.length===0)return null;let c=e.length>Mw,l=c,u=e.length-Mw,d=e.slice(0,Mw);return(0,U.jsxs)(`div`,{className:W(`relative`,r),children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap gap-2`,role:`list`,"aria-label":`Attached files`,children:[(c?d:e).map(e=>(0,U.jsx)(Lw,{file:e,compact:l,onRemove:t,onClick:n},e.id)),c&&(0,U.jsx)(`div`,{role:`listitem`,children:(0,U.jsx)(`button`,{ref:s,type:`button`,onClick:()=>a(e=>!e),className:W(`border-border text-muted-foreground hover:bg-surface-hover flex flex-shrink-0 cursor-pointer items-center justify-center rounded-lg border transition-colors`,l?`h-10 px-3 text-xs`:`h-14 px-4 text-sm`),children:i?`Show less`:`+${u} more`})})]}),i&&(0,U.jsx)(`div`,{ref:o,className:W(`bg-surface border-border absolute bottom-full left-0 z-10 mb-2 max-h-48 overflow-y-auto rounded-lg border p-2 shadow-lg`),children:(0,U.jsx)(`div`,{className:`flex flex-wrap gap-2`,role:`list`,"aria-label":`More attached files`,children:e.slice(Mw).map(e=>(0,U.jsx)(Lw,{file:e,compact:l,onRemove:t,onClick:n},e.id))})})]})}function zw({value:e,onChange:t,triggers:n,placeholder:r,className:i,disabled:a=!1,markdown:o,normalizeBullets:s,onSubmit:c,onEscape:l,onChipClick:u,onChipAdd:d,onChipDelete:f,onLinkClick:p,onPaste:m,onUndo:h,onRedo:g,minHeight:_=80,maxHeight:y,autoFocus:b=!1,autoGrow:x=!1,"aria-label":S,"data-test-id":C,images:w=[],imagePosition:T=`above`,onImagePaste:E,onImageRemove:D,onImageClick:O,files:k=[],filePosition:A=`above`,onFileRemove:j,onFileClick:M,onKeyDown:N,onBlur:P,onRawPaste:F,submitOnEnter:I,spellCheck:L,maxLength:ee,"aria-describedby":R,ref:te}){let{editorRef:z,activeTrigger:B,suggestions:V,suggestionsLoading:ne,suggestionsError:H,selectedSuggestionIndex:re,handleInput:ie,handleKeyDown:ae,handleClick:oe,handleMouseDown:se,selectSuggestion:ce,dismissTrigger:le,handle:ue,triggerRect:de,eventHandlers:fe}=yw({value:e,onChange:t,triggers:n,disabled:a,onSubmit:c,onEscape:l,onChipClick:u,onChipAdd:d,onChipDelete:f,onLinkClick:p,onPaste:m,onRawPaste:F,onUndo:h,onRedo:g,onImagePaste:E,markdown:o,normalizeBullets:s,submitOnEnter:I,maxLength:ee});(0,v.useImperativeHandle)(te,()=>ue,[ue]),(0,v.useEffect)(()=>{b&&z.current?.focus()},[b,z]);let[pe,me]=(0,v.useState)(!1),[he,ge]=(0,v.useState)(void 0),_e=(0,v.useCallback)(()=>{let e=z.current;if(!e)return;e.style.height=`auto`;let t=e.scrollHeight;e.style.height=`${t}px`,ge(t)},[z]),ve=(0,v.useCallback)(()=>{x&&(me(!0),_e())},[x,_e]),ye=(0,v.useCallback)(()=>{fe.onBlur(),x&&setTimeout(()=>{let e=z.current;if(!e)return;let t=document.activeElement;t&&e.parentElement?.contains(t)||(me(!1),ge(void 0))},150)},[fe,x,z]),be=(0,v.useCallback)(()=>{ie(),x&&pe&&_e()},[ie,x,pe,_e]);(0,v.useEffect)(()=>{x&&pe&&requestAnimationFrame(()=>_e())},[e,x,pe,_e]);let[xe,Se]=(0,v.useState)(!1),Ce=(0,v.useRef)(null);(0,v.useEffect)(()=>x?(Ce.current=setTimeout(()=>{if(pe){Se(!1);return}let e=z.current;e&&Se(e.scrollHeight>e.clientHeight)},pe?0:160),()=>{Ce.current!==null&&clearTimeout(Ce.current)}):void 0,[x,pe,e,z]);let we=(0,v.useMemo)(()=>{if(!x){let e={minHeight:`${_}px`};return y&&(e.maxHeight=`${y}px`,e.overflowY=`auto`),e}return{height:pe&&he?`${he}px`:`${_}px`,minHeight:`${_}px`,maxHeight:y?`${y}px`:`70dvh`,overflowY:pe?`auto`:`hidden`,transition:`height 150ms ease-out, min-height 240ms cubic-bezier(0.33, 1, 0.68, 1)`}},[x,_,y,pe,he]),Te=(0,v.useCallback)(e=>{N?.(e),!e.defaultPrevented&&ae(e)},[N,ae]),Ee=(0,v.useCallback)(e=>{P?.(e),ye()},[P,ye]),De=e.length===0||e.length===1&&e[0].type===`text`&&e[0].text===``,Oe=w.length>0?(0,U.jsx)(ww,{images:w,onRemove:D,onClick:O,className:T===`above`?`pb-2`:`pt-2`}):null,ke=k.length>0?(0,U.jsx)(Rw,{files:k,onRemove:j,onClick:M,className:A===`above`?`pb-2`:`pt-2`}):null;return(0,U.jsxs)(`div`,{className:W(`prompt-area-container relative text-sm leading-relaxed`,i),children:[T===`above`&&Oe,A===`above`&&ke,(0,U.jsxs)(`div`,{className:`relative`,children:[(0,U.jsx)(`div`,{ref:z,contentEditable:!a,suppressContentEditableWarning:!0,role:`textbox`,"aria-label":S??`Text input`,"aria-multiline":`true`,"aria-disabled":a||void 0,"aria-describedby":R,"data-test-id":C,spellCheck:L,className:W(`prompt-area-editor`,`w-full min-w-0 break-words whitespace-pre-wrap outline-none`,a&&`cursor-not-allowed opacity-50`),style:we,onFocus:ve,onInput:x?be:ie,onKeyDown:Te,onMouseDown:se,onClick:oe,onPaste:fe.onPaste,onCopy:fe.onCopy,onCut:fe.onCut,onDrop:fe.onDrop,onDragOver:fe.onDragOver,onCompositionStart:fe.onCompositionStart,onCompositionEnd:fe.onCompositionEnd,onBlur:Ee}),x&&xe&&!pe&&(0,U.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-auto absolute right-0 bottom-0 left-0 cursor-pointer`,style:{height:`32px`},onClick:()=>z.current?.focus(),children:(0,U.jsx)(`div`,{className:`h-full w-full`,style:{background:`linear-gradient(to bottom, transparent, color-mix(in srgb, var(--prompt-area-surface, var(--background)) 80%, transparent), var(--prompt-area-surface, var(--background)))`}})}),De&&r&&(Array.isArray(r)?(0,U.jsx)(Sw,{texts:r}):(0,U.jsx)(`div`,{className:`pointer-events-none absolute top-0 left-0 select-none`,style:{color:`var(--prompt-area-placeholder, var(--muted-foreground))`},"aria-hidden":`true`,children:r}))]}),A===`below`&&ke,T===`below`&&Oe,B&&B.config.mode===`dropdown`&&(0,U.jsx)(xw,{suggestions:V,loading:ne,error:H,emptyMessage:B.config.emptyMessage,selectedIndex:re,onSelect:ce,onDismiss:le,triggerRect:de,triggerChar:B.config.char})]})}function Bw(e={}){let{initialValue:t=[]}=e,[n,r]=(0,v.useState)(t),i=(0,v.useRef)(null),a=(0,v.useMemo)(()=>SS(n),[n]),o=(0,v.useMemo)(()=>n.length===0||n.every(e=>e.type===`text`&&e.text.trim()===``),[n]),s=(0,v.useMemo)(()=>n.some(e=>e.type===`chip`),[n]),c=(0,v.useMemo)(()=>n.filter(e=>e.type===`chip`),[n]);return{bind:(0,v.useMemo)(()=>({ref:i,value:n,onChange:r}),[n]),plainText:a,isEmpty:o,hasChips:s,chips:c,clear:(0,v.useCallback)(()=>{i.current?i.current.clear():r([])},[]),focus:(0,v.useCallback)(()=>i.current?.focus(),[]),blur:(0,v.useCallback)(()=>i.current?.blur(),[]),insertChip:(0,v.useCallback)(e=>i.current?.insertChip(e),[])}}function Vw(e={}){let{char:t=`@`,...n}=e;return{char:t,position:`any`,mode:`dropdown`,chipStyle:`pill`,accessibilityLabel:`mention`,...n}}function Hw(e={}){let{char:t=`/`,position:n=`any`,...r}=e;return{char:t,position:n,mode:`dropdown`,chipStyle:`inline`,accessibilityLabel:`command`,...r}}var Uw=[`attention`,`working`,`idle`,`ended`],Ww={attention:`Needs attention`,working:`Working`,idle:`Idle`,ended:`Ended`};function Gw(e){return e.pendingPermissionCount>0||e.status===`awaiting_approval`?`attention`:e.status===`failed`||e.status===`closed`?`ended`:e.status===`running`||e.status===`starting`||Kw(e).length>0?`working`:`idle`}function Kw(e){return(e.subagents??[]).filter(e=>e.status===`running`)}function qw(e){return(e.agentType?.trim()??``)!==``}function Jw(e){let t=e.agentType?.trim(),n=e.description?.trim();return t&&n?`${t} · ${n}`:t||n||`Sub-agent`}var Yw={search:``,gateways:[],adapters:[],states:[],projects:[],scoped:!0,groupBy:`state`,sortBy:`recent`};function Xw(e){return[...new Set(e.map(e=>e.adapter))].sort()}function Zw(e){let t=new Map;for(let n of e)t.set($w(n),eT(n));return[...t].map(([e,t])=>({key:e,label:t})).sort((e,t)=>e.label.toLowerCase().localeCompare(t.label.toLowerCase()))}function Qw(e){return e.title??e.id.slice(0,8)}function $w(e){return`${e.hostId}:${iT(e.info.project?.root??e.info.cwd)}`}function eT(e){let t=e.info.project?.name;if(t)return t;let n=iT(e.info.cwd);return n.slice(n.lastIndexOf(`/`)+1)||`No project`}function tT(e){let t=e.info.project?.root;if(t===void 0||!e.info.cwd)return;let n=iT(t),r=iT(e.info.cwd);if(r!==n&&r.startsWith(`${n}/`))return r.slice(n.length+1)||void 0}function nT(e){return typeof e.meta?.jobId==`string`}function rT(e,t){return!t||Qw(e.info).toLowerCase().includes(t)||e.info.cwd.toLowerCase().includes(t)||(e.info.project?.name.toLowerCase().includes(t)??!1)||e.hostName.toLowerCase().includes(t)||e.adapter.toLowerCase().includes(t)||e.info.id.startsWith(t)}function iT(e){return e.replace(/\\/g,`/`).replace(/\/+$/,``)}function aT(e,t){let n=iT(e),r=iT(t);return r===n||r.startsWith(`${n}/`)}function oT(e,t){return t.roots.some(t=>(t.hostId?t.hostId.toLowerCase()===e.hostId.toLowerCase():e.local)&&aT(t.path,e.info.cwd))}function sT(e,t){return e.scoped&&t!==void 0}function cT(e,t,n){let r=t.search.trim().toLowerCase(),i=sT(t,n)?n:void 0;return e.filter(e=>(t.gateways.length===0||t.gateways.includes(e.hostId))&&(t.adapters.length===0||t.adapters.includes(e.adapter))&&(t.states.length===0||t.states.includes(e.state))&&(!t.projects?.length||t.projects.includes($w(e)))&&(!i||oT(e,i))&&rT(e,r))}function lT(e,t){return t===`gateway`?e.hostId:t===`adapter`?e.adapter:t===`project`?$w(e):e.state}function uT(e,t){return t===`gateway`?e.hostName:t===`adapter`?e.adapter:t===`project`?eT(e):Ww[e.state]}function dT(e,t){return t===`state`?String(Uw.indexOf(e.state)):uT(e,t).toLowerCase()}function fT(e,t){return(t.info.lastActivityAt??t.info.createdAt)-(e.info.lastActivityAt??e.info.createdAt)}function pT(e,t,n){return n===`recent`?fT(e,t):n===`name`?Qw(e.info).localeCompare(Qw(t.info),void 0,{sensitivity:`base`})||fT(e,t):dT(e,n).localeCompare(dT(t,n))||fT(e,t)}function mT(e,t){let n=[...e].sort((e,n)=>pT(e,n,t.sortBy));if(t.groupBy===`none`)return n.length?[{key:`all`,rows:n}]:[];let r=t.groupBy,i=new Map;for(let e of n){let t=lT(e,r),n=i.get(t);n?n.rows.push(e):i.set(t,{key:t,label:uT(e,r),rank:dT(e,r),rows:[e]})}return[...i.values()].sort((e,t)=>e.rank.localeCompare(t.rank))}function hT(e,t,n,r){if(n>=r)return;let i=[];t&&sT(e,t)&&i.push(t.label);let a=+!!e.gateways.length+ +!!e.adapters.length+ +!!e.states.length+ +!!e.projects?.length;return a>0&&i.push(`${a} filter${a===1?``:`s`}`),e.search.trim()&&i.push(`search`),{shown:n,total:r,causes:i}}function gT(e){return e.search.trim().length>0||e.gateways.length>0||e.adapters.length>0||e.states.length>0||(e.projects?.length??0)>0}function _T(e){return{...Yw,scoped:!1,groupBy:e.groupBy,sortBy:e.sortBy}}function vT(e,t){let n={};for(let[t,r]of Object.entries(e.rateLimits??{}))n[t]={info:r,updatedAt:e.updatedAt??0};for(let[e,r]of Object.entries(t??{}))n[e]=r;return n}function yT(e){let t=Object.entries(e??{}).filter(([,e])=>e.info.utilization!==void 0).map(([e,t])=>({key:e,info:t.info,updatedAt:t.updatedAt,inferredReset:t.inferredReset})),n=[`five_hour`,`seven_day`].flatMap(e=>t.filter(t=>t.key===e)),r=t.filter(e=>e.key.startsWith(`seven_day_`)).sort((e,t)=>e.key.localeCompare(t.key));return[...n,...r]}function bT(e){if(!e)return;let t={};for(let[n,r]of Object.entries(e))t[n]=r.info;return t}var xT=2592e6,ST=6e4;function CT(e,t){return`${e}:${t}`}var wT=class{#e;#t;constructor(e){this.#e=e,this.#t={...e.read()}}get(e,t){return this.#t[CT(e,t)]}all(){return this.#t}mark(e,t,n,r=Date.now()){let i=CT(e,t),a=this.#t[i],o={itemCount:Math.max(a?.itemCount??0,n.itemCount??0),activity:Math.max(a?.activity??0,n.activity??0),prose:n.prose===void 0?a?.prose:Math.max(a?.prose??0,n.prose),turns:Math.max(a?.turns??0,n.turns??0),seenAt:r};return a&&a.itemCount===o.itemCount&&a.activity===o.activity&&a.prose===o.prose&&a.turns===o.turns&&o.seenAt-a.seenAt<ST?!1:(this.#t[i]=o,this.#e.write(this.#n(r)),!0)}forget(e,t){let n=CT(e,t);n in this.#t&&(delete this.#t[n],this.#e.write(this.#t))}#n(e){let t=e-xT;for(let[e,n]of Object.entries(this.#t))n.seenAt<t&&delete this.#t[e];return this.#t}};function TT(e,t){return e?t.proseCount===void 0?t.activityCount===void 0?Math.max(0,(t.turns??0)-e.turns):Math.max(0,t.activityCount-e.activity):Math.max(0,t.proseCount-(e.prose??t.proseCount)):0}var ET={claude:{interactiveApprovals:!0,permissionModes:[`default`,`acceptEdits`,`bypassPermissions`,`plan`,`dontAsk`,`auto`],defaultPermissionMode:`default`,resume:!0,resumeBackfill:!0,listSessions:!0,contextUsage:!0,rateLimits:!0,mcpStatus:!0,mcpServerActions:!0,sessionMcpServers:!0,slashCommands:!0,clearContext:!0,skillsList:!1,settingSources:!0,budgets:!0,attachments:[`image`,`pdf`,`text`],reasoningEfforts:[`low`,`medium`,`high`,`xhigh`,`max`],vfs:!1,hostCwd:!0,streaming:`token`},codex:{interactiveApprovals:!0,permissionModes:[`default`,`acceptEdits`,`bypassPermissions`,`auto`],defaultPermissionMode:`default`,resume:!0,resumeBackfill:!0,listSessions:!0,contextUsage:!0,rateLimits:!0,mcpStatus:!0,mcpServerActions:!1,sessionMcpServers:!1,slashCommands:!1,clearContext:!0,skillsList:!0,settingSources:!1,budgets:!1,attachments:[`image`,`text`],reasoningEfforts:[`minimal`,`low`,`medium`,`high`,`xhigh`],vfs:!1,hostCwd:!0,streaming:`token`},provider:{interactiveApprovals:!1,permissionModes:[`default`,`bypassPermissions`,`dontAsk`],defaultPermissionMode:`default`,resume:!1,resumeBackfill:!1,listSessions:!1,contextUsage:!1,rateLimits:!1,mcpStatus:!0,mcpServerActions:!1,sessionMcpServers:!1,slashCommands:!1,clearContext:!0,skillsList:!1,settingSources:!1,budgets:!1,attachments:[`image`,`pdf`,`text`],vfs:!0,hostCwd:!1,streaming:`token`}},DT={status:`starting`,capabilities:ET.claude,items:[],pendingApprovals:[],totalCostUsd:0,lastSeq:0},OT=`streaming`,kT=`streaming-thinking`,AT=/^<local-command-(stdout|stderr)>([\s\S]*?)<\/local-command-\1>$/,jT=/<command-name>([\s\S]*?)<\/command-name>/,MT=/<command-args>([\s\S]*?)<\/command-args>/;function NT(e){return e==null?OT:`${OT}:${e}`}function PT(e){return e==null?kT:`${kT}:${e}`}function FT(e){return e.kind===`assistant_text`&&e.id.startsWith(OT)||e.kind===`thinking`&&e.id.startsWith(kT)}function IT(e){return e===void 0?``:typeof e==`string`?e:e.map(e=>typeof e.text==`string`?e.text:``).filter(Boolean).join(`
44
+ `)}function LT(e,t){if(!Array.isArray(e))return;let n=e.flatMap(e=>e.type===`image_ref`?[{partIndex:Number(e.part_index),mediaType:String(e.media_type??`application/octet-stream`),bytes:Number(e.bytes??0),sourceSeq:t}]:[]);return n.length>0?n:void 0}function RT(e){return typeof e==`string`?[{type:`text`,text:e}]:e}function zT(e){if(e.type===`text`)return e.value;try{return JSON.stringify(e.value)}catch{return String(e.value)}}function BT(e){let t=jT.exec(e)?.[1]?.trim();if(!t)return;let n=MT.exec(e)?.[1]?.trim();return n?`${t} ${n}`:t}function VT(e,t){let n=e.findIndex(e=>e.id===t.id&&e.kind===t.kind);if(n===-1)return[...e,t];let r=[...e];return r[n]=t,r}function HT(e,t){let n=t.engine??e.engine;return{...e,status:e.lastSeq===0?t.status:e.status,model:e.model??t.model,permissionMode:e.permissionMode??t.permissionMode,cwd:e.cwd??t.cwd,sdkSessionId:e.sdkSessionId??t.sdkSessionId,engine:n,capabilities:t.capabilities??ET[n??`claude`],session:t}}function UT(e,t,n){let r=!1,i=e.items.map(e=>e.kind!==`tool_call`||e.id!==t||!e.result?.truncated?e:(r=!0,{...e,result:{text:n,isError:e.result.isError,...e.result.images&&{images:e.result.images}}}));return r?{...e,items:i}:e}function WT(e,t){if(t.seq<=e.lastSeq)return e;let n={...e,lastSeq:t.seq};switch(t.type){case`system_init`:return{...n,model:t.model,cwd:t.cwd,sdkSessionId:t.sdkSessionId,permissionMode:t.permissionMode};case`status_changed`:return{...n,status:t.status,statusDetail:t.detail};case`capabilities`:return{...n,models:t.models,commands:t.commands,defaultModel:t.defaultModel??n.defaultModel};case`skills`:return{...n,skills:t.skills};case`file_produced`:return{...n,producedFiles:{...n.producedFiles,[t.path]:{fileId:t.fileId,...t.mediaType?{mediaType:t.mediaType}:{},...t.bytes===void 0?{}:{bytes:t.bytes}}}};case`model_changed`:return t.model===void 0?n:{...n,model:t.model};case`permission_mode_changed`:return{...n,permissionMode:t.mode};case`context_usage`:return{...n,contextUsage:t.usage};case`rate_limit`:{let e=t.info.rateLimitType;return e?{...n,rateLimits:{...n.rateLimits,[e]:t.info},rateLimitsUpdatedAt:t.ts}:n}case`plan_info`:return{...n,subscriptionType:t.subscriptionType};case`conversation_reset`:return{...n,items:[],contextUsage:void 0,sdkSessionId:t.sdkSessionId??n.sdkSessionId};case`user_message`:{let e=n.items;for(let n of RT(t.message.content))if(n.type===`tool_result`){let r=n,i=r.is_error===!0;e=e.map(e=>e.kind===`tool_call`&&e.id===r.tool_use_id?{...e,status:i?`failed`:`settled`,result:{text:IT(r.content),isError:i,...r.truncated&&{truncated:!0,totalChars:r.total_chars,sourceSeq:t.seq},...LT(r.content,t.seq)&&{images:LT(r.content,t.seq)}},...t.patch&&{patch:t.patch}}:e)}else if(n.type===`text`&&!t.synthetic){let r=n.text,i=AT.exec(r.trim());e=i?VT(e,{kind:`notice`,id:t.uuid??`user-${t.seq}`,level:i[1]===`stderr`?`error`:`info`,text:i[2].trim()}):VT(e,{kind:`user`,id:t.uuid??`user-${t.seq}`,text:BT(r)??r,attachments:t.attachments,...t.parentToolUseId!=null&&{parentToolUseId:t.parentToolUseId}})}return{...n,items:e}}case`assistant_message`:{let e=NT(t.parentToolUseId),r=PT(t.parentToolUseId),i=n.items.find(e=>e.kind===`thinking`&&e.id===r)?.text??``,a=n.items.filter(t=>(t.kind!==`assistant_text`||t.id!==e)&&(t.kind!==`thinking`||t.id!==r));return RT(t.message.content).forEach((e,n)=>{let r=`${t.uuid}-${n}`;if(e.type===`text`)a=VT(a,{kind:`assistant_text`,id:r,text:e.text,streaming:!1,parentToolUseId:t.parentToolUseId});else if(e.type===`thinking`){let n=e.thinking||i;if(i=``,n.trim()===``)return;a=VT(a,{kind:`thinking`,id:r,text:n,parentToolUseId:t.parentToolUseId})}else if(e.type===`tool_use`){let n=e;a=VT(a,{kind:`tool_call`,id:n.id,name:n.name,input:n.input,parentToolUseId:t.parentToolUseId,status:`running`,ts:t.ts})}}),{...n,items:a}}case`stream_delta`:{let e=t.event;if(e.type!==`content_block_delta`)return n;if(e.delta?.type===`text_delta`){let r=NT(t.parentToolUseId),i={kind:`assistant_text`,id:r,text:(n.items.find(e=>e.kind===`assistant_text`&&e.id===r)?.text??``)+(e.delta.text??``),streaming:!0,parentToolUseId:t.parentToolUseId};return{...n,items:VT(n.items,i)}}if(e.delta?.type===`thinking_delta`){let r=PT(t.parentToolUseId),i=(n.items.find(e=>e.kind===`thinking`&&e.id===r)?.text??``)+(e.delta.thinking??``);if(i.trim()===``)return n;let a={kind:`thinking`,id:r,text:i,parentToolUseId:t.parentToolUseId};return{...n,items:VT(n.items,a)}}return n}case`turn_result`:return{...n,totalCostUsd:t.totalCostUsd,items:[...n.items.map(e=>{if(!FT(e))return e;let n=`parentToolUseId`in e&&e.parentToolUseId?`-${e.parentToolUseId}`:``;return e.kind===`assistant_text`?{...e,id:`text-${t.seq}${n}`,streaming:!1}:{...e,id:`thinking-${t.seq}${n}`}}),{kind:`turn_result`,id:`turn-${t.seq}`,subtype:t.subtype,isError:t.isError,durationMs:t.durationMs,totalCostUsd:t.totalCostUsd,errors:t.errors}]};case`permission_requested`:return{...n,pendingApprovals:[...n.pendingApprovals,t.request]};case`permission_resolved`:return{...n,pendingApprovals:n.pendingApprovals.filter(e=>e.id!==t.requestId)};case`execution_dispatched`:return{...n,items:n.items.map(e=>e.kind===`tool_call`&&e.id===t.executionId?{...e,status:t.deferred?`deferred`:`pending`,executionId:t.executionId,backend:t.backend}:e)};case`execution_result`:return{...n,items:n.items.map(e=>e.kind===`tool_call`&&e.id===t.executionId?{...e,status:`settled`,executionId:t.executionId,result:{text:zT(t.output),isError:!1},logs:t.logs??e.logs}:e)};case`execution_failed`:return{...n,items:n.items.map(e=>e.kind===`tool_call`&&e.id===t.executionId?{...e,status:`failed`,executionId:t.executionId,result:{text:`${t.reason}: ${t.error}`,isError:!0},logs:t.logs??e.logs}:e)};case`file_delivered`:return{...n,items:[...n.items,{kind:`file_delivered`,id:`file-${t.seq}`,path:t.path,bytes:t.bytes,description:t.description}]};case`session_error`:return{...n,items:[...n.items,{kind:`notice`,id:`err-${t.seq}`,level:`error`,text:t.message}]};case`session_closed`:return{...n,items:[...n.items,{kind:`notice`,id:`closed-${t.seq}`,level:`info`,text:`Session closed (${t.reason})`}]};default:return n}}var GT=5,KT=new Map;function qT(e,t){return`${e.identityKey}\u0000${t}`}function JT(e){return KT.get(e)}function YT(e,t){if(KT.delete(e),KT.set(e,t),KT.size>GT){let e=KT.keys().next().value;e!==void 0&&KT.delete(e)}}function XT(e){KT.delete(e)}function ZT(e,t){return`${e}:${t}`}function QT(e){let t=ZT(e.resyncSeq,e.key),n=e.cacheEnabled&&!e.skipCache?e.warm:void 0,r=e.seededFor!==t,i=r?n??DT:e.current;return{held:i,seed:r,seedToken:t,...i.lastSeq>0?{afterSeq:i.lastSeq}:{}}}function $T(e){return e.cacheEnabled&&!e.skipCache&&e.parting.lastSeq>0&&e.parting.session!==void 0}function eE(e,t){return t.type===`transcript_seed`?t.state:t.type===`transcript_hydrate_result`?UT(e,t.toolUseId,t.text):t.type===`attached`?HT(e,t.session):WT(e,t)}var tE=3;function nE(e){return e.replayingFrom===0&&e.session.lastSeq>0?e.session.lastSeq:void 0}function rE(e,t){return e.replayingFrom===0||t.lastSeq===0?!1:e.session.lastSeq<t.lastSeq||t.session!==void 0&&e.session.createdAt!==t.session.createdAt}var iE=1500;function aE(e,t,n){let[r,i]=(0,v.useReducer)(eE,void 0,()=>(n?.cacheTranscript!==!1&&t!==void 0?JT(qT(e,t)):void 0)??DT),[a,o]=(0,v.useState)(`reconnecting`),[s,c]=(0,v.useState)(),[l,u]=(0,v.useState)(),[d,f]=(0,v.useState)(0),[p,m]=(0,v.useState)(),h=(0,v.useRef)(null),g=(0,v.useRef)(n);g.current=n;let _=(0,v.useRef)(r);_.current=r;let y=(0,v.useRef)(ZT(0,t===void 0?``:qT(e,t))),b=(0,v.useRef)(!1);(0,v.useEffect)(()=>{if(!t)return;let n=g.current?.cacheTranscript!==!1,r=qT(e,t),a=QT({resyncSeq:d,key:r,seededFor:y.current,current:_.current,cacheEnabled:n,skipCache:b.current,warm:JT(r)});b.current=!1,a.seed&&(i({type:`transcript_seed`,state:a.held}),y.current=a.seedToken);let s=e.attach(t,{truncateResults:!0,imageRefs:!0,...a.afterSeq===void 0?{}:{afterSeq:a.afterSeq}});h.current=s,m(s);let l=s.on(`event`,e=>i(e)),p=s.on(`attached`,e=>{if(rE(e,_.current)){l(),XT(r),b.current=!0,f(e=>e+1);return}i(e),u(nE(e)),c(e.protocolVersion===1?void 0:e.protocolVersion)}),v=s.on(`connectionChange`,e=>o(e?`live`:`reconnecting`)),x=s.on(`reconnectAttempt`,e=>o(e>=tE?`offline`:`reconnecting`)),S=s.on(`protocolError`,e=>{g.current?.onProtocolError?.(e)});return()=>{l(),p(),v(),x(),S(),s.detach(),h.current=null,m(void 0),o(`reconnecting`),c(void 0),u(void 0);let e=_.current;$T({cacheEnabled:n,skipCache:b.current,parting:e})&&YT(r,e)}},[e,t,d]),(0,v.useEffect)(()=>{if(l===void 0)return;let e=setTimeout(()=>u(void 0),iE);return()=>clearTimeout(e)},[l]),(0,v.useEffect)(()=>{l!==void 0&&r.lastSeq>=l&&u(void 0)},[l,r.lastSeq]);let x=oE(e,t,r),S=a===`live`,C=l!==void 0&&r.lastSeq<l,w=(0,v.useCallback)(()=>h.current?.reconnectNow(),[]),T=(0,v.useCallback)(async n=>{if(!t)return!1;let r=_.current.items.find(e=>e.kind===`tool_call`&&e.id===n),a=r?.kind===`tool_call`?r.result:void 0;if(!a?.truncated||a.sourceSeq===void 0)return!1;try{let r=await e.toolResult(t,a.sourceSeq,n),o=typeof r.content==`string`?r.content:(r.content??[]).map(e=>typeof e.text==`string`?e.text:``).filter(Boolean).join(`
45
+ `);return i({type:`transcript_hydrate_result`,toolUseId:n,text:o}),!0}catch{return!1}},[e,t]);return(0,v.useMemo)(()=>({state:r,connected:S,connection:a,replaying:C,protocolMismatch:s,models:x,effectiveModel:r.model??r.defaultModel,handle:p,send:(e,t)=>h.current?.send(e,t),approve:(e,t)=>h.current?.approve(e,t),deny:(e,t,n)=>h.current?.deny(e,t,n),interrupt:()=>h.current?.interrupt(),clearContext:()=>h.current?.clearContext(),setPermissionMode:e=>h.current?.setPermissionMode(e),setModel:e=>h.current?.setModel(e),closeSession:()=>h.current?.closeSession(),reconnectNow:w,loadFullResult:T}),[r,S,a,C,s,x,p,w,T])}function oE(e,t,n){let[r,i]=(0,v.useState)([]),a=n.session?.profile,o=n.models,s=!!o?.length;return(0,v.useEffect)(()=>i([]),[t]),(0,v.useEffect)(()=>{if(!a||s)return;let t=!1;return e.listProfiles().then(e=>{t||i(e.profiles.find(e=>e.name===a)?.models??[])}).catch(()=>{}),()=>{t=!0}},[e,a,s]),s?o:r}var sE=new Map;function cE(e,t){return`${e.identityKey}\u0000${t}`}function lE(e){return sE.get(e)}function uE(e,t){t!==void 0&&sE.set(e,t)}var dE=`workerdeck.drafts.v1`,fE=20,pE;function mE(){try{return globalThis.localStorage}catch{return}}function hE(){if(pE)return pE;pE={};let e=mE()?.getItem(dE);if(e)try{let t=JSON.parse(e);for(let[e,n]of Object.entries(t))typeof n?.text==`string`&&typeof n.savedAt==`number`&&(pE[e]=n)}catch{}return pE}function gE(e){let t=Object.entries(e);if(t.length>fE){t.sort((e,t)=>t[1].savedAt-e[1].savedAt);for(let[n]of t.slice(fE))delete e[n]}try{mE()?.setItem(dE,JSON.stringify(e))}catch{}}function _E(e,t){return`${e.identityKey}\u0000${t}`}function vE(e){return hE()[e]?.text??``}function yE(e,t,n=Date.now()){let r=hE();if(t.trim()===``){if(r[e]===void 0)return;delete r[e]}else r[e]={text:t,savedAt:n};gE(r)}var bE=new Set([`application/json`,`application/xml`,`application/yaml`,`application/x-yaml`,`application/toml`,`application/javascript`,`application/typescript`,`application/x-sh`,`application/sql`]),xE=1568;function SE(e){let t=e.split(`;`)[0].trim().toLowerCase();if(t.startsWith(`image/`))return`image`;if(t===`application/pdf`)return`pdf`;if(t.startsWith(`text/`)||bE.has(t))return`text`}function CE(e,t,{capabilities:n,engine:r}){let[i,a]=(0,v.useState)([]),[o,s]=(0,v.useState)(),c=(0,v.useRef)(0),l=(0,v.useRef)(new Map),u=(0,v.useRef)([]);u.current=i.flatMap(e=>e.previewUrl?[e.previewUrl]:[]);let d=n.attachments;(0,v.useEffect)(()=>()=>{for(let e of u.current)URL.revokeObjectURL(e)},[]);let f=(0,v.useCallback)((e,t)=>{a(n=>n.map(n=>n.key===e?{...n,...t}:n))},[]),p=(0,v.useCallback)((n,r)=>{t&&(f(n,{status:`uploading`,error:void 0}),(async()=>{try{let i=await EE(r),a=await e.uploadAttachment(t,{name:r.name,mediaType:i.mediaType,data:i.body});f(n,{status:`ready`,id:a.id,bytes:a.bytes??r.size})}catch(e){f(n,{status:`failed`,error:e instanceof Error?e.message:`Upload failed`})}})())},[e,f,t]),m=(0,v.useCallback)(e=>{let t=[],n=[];for(let i of e){let e=i.type||`application/octet-stream`,a=SE(e);if(a&&!d.includes(a)){s(`The ${r??`claude`} engine does not take ${a} attachments.`);continue}let o=`att-${++c.current}`;t.push({key:o,name:i.name,mediaType:e,bytes:i.size,previewUrl:a===`image`?URL.createObjectURL(i):void 0,status:`uploading`}),n.push({key:o,file:i})}if(t.length!==0){a(e=>[...e,...t]),l.current=new Map([...l.current,...n.map(({key:e,file:t})=>[e,t])]);for(let{key:e,file:t}of n)p(e,t)}},[d,r,p]),h=(0,v.useCallback)(e=>{a(t=>{for(let n of t)e.includes(n.key)&&n.previewUrl&&URL.revokeObjectURL(n.previewUrl);return t.filter(t=>!e.includes(t.key))});for(let t of e)l.current.delete(t)},[]),g=(0,v.useCallback)(e=>h([e]),[h]),_=(0,v.useCallback)(()=>{a(e=>{for(let t of e)t.previewUrl&&URL.revokeObjectURL(t.previewUrl);return[]}),l.current.clear()},[]),y=(0,v.useCallback)(e=>{let t=l.current.get(e);t&&p(e,t)},[p]);return(0,v.useMemo)(()=>({items:i,readyIds:i.flatMap(e=>e.id?[e.id]:[]),uploading:i.some(e=>e.status===`uploading`),hasFailure:i.some(e=>e.status===`failed`),accept:wE(d),disabled:d.length===0||!t,add:m,retry:y,remove:g,clear:_,error:o,dismissError:()=>s(void 0)}),[i,d,t,m,y,g,_,o])}function wE(e){if(e.length===0)return``;let t=[];return e.includes(`image`)&&t.push(`image/*`),e.includes(`pdf`)&&t.push(`application/pdf`),e.includes(`text`)&&t.push(`text/*`,`.md`,`.json`,`.yaml`,`.yml`,`.toml`),e.length===3?``:t.join(`,`)}var TE=globalThis;async function EE(e){let t=e.type||`application/octet-stream`,{createImageBitmap:n,document:r}=TE;if(!n||!r||!t.startsWith(`image/`)||t===`image/gif`)return{body:e,mediaType:t};try{let i=await n(e),a=Math.max(i.width,i.height);if(a<=xE)return i.close(),{body:e,mediaType:t};let o=xE/a,s=r.createElement(`canvas`);s.width=Math.round(i.width*o),s.height=Math.round(i.height*o);let c=s.getContext(`2d`);if(!c)return i.close(),{body:e,mediaType:t};c.drawImage(i,0,0,s.width,s.height),i.close();let l=await new Promise(e=>s.toBlob(e,`image/jpeg`,.85));return l?{body:l,mediaType:`image/jpeg`}:{body:e,mediaType:t}}catch{return{body:e,mediaType:t}}}var DE=/^[A-Za-z0-9\-_.:]+$/,OE=new Set([`.`,`,`,`;`,`:`,`!`,`?`,`)`,`]`,`}`,`"`,`'`]);function kE(e){let t=[],n=/\S+/g,r;for(;(r=n.exec(e))!==null;){let n=r[0],i=n[0]===`@`?`file`:n[0]===`/`?`command`:void 0;if(!i)continue;let a=r.index+n.length;for(;a>r.index&&OE.has(e[a-1]);)a--;let o=e.slice(r.index+1,a);o&&(i===`command`&&!DE.test(o)||t.push({kind:i,start:r.index,end:a,text:e.slice(r.index,a)}))}return t}var AE=class{#e=new Map;on(e,t){let n=this.#e.get(e);return n||(n=new Set,this.#e.set(e,n)),n.add(t),()=>n.delete(t)}emit(e,t){let n=this.#e.get(e);if(n)for(let e of n)try{e(t)}catch{}}};function jE(e){return Math.min(500*2**e,1e4)}var ME=class{sessionId;#e;#t;#n;#r=new AE;#i;#a=!1;#o=0;#s=[];#c;constructor(e,t,n={}){this.#e=e,this.sessionId=t,this.#t={reconnect:!0,...n},this.#i=n.afterSeq??0,this.#c=setTimeout(()=>this.#u(),0)}get lastSeq(){return this.#i}on(e,t){return this.#r.on(e,t)}send(e,t){this.#l({type:`user_message`,text:e,attachmentIds:t?.length?t:void 0})}approve(e,t){this.#l({type:`permission_decision`,requestId:e,behavior:`allow`,updatedInput:t})}deny(e,t,n){this.#l({type:`permission_decision`,requestId:e,behavior:`deny`,message:t,interrupt:n})}interrupt(){this.#l({type:`interrupt`})}clearContext(){this.#l({type:`clear_context`})}setPermissionMode(e){this.#l({type:`set_permission_mode`,mode:e})}setModel(e){this.#l({type:`set_model`,model:e})}sendToolCallResult(e,t,n){this.#l({type:`tool_call_result`,executionId:e,output:t,logs:n})}sendToolCallError(e,t,n,r){this.#l({type:`tool_call_error`,executionId:e,reason:t,error:n,logs:r})}closeSession(){this.#l({type:`close`}),this.detach()}reconnectNow(){this.#a||this.#n&&this.#n.readyState===1||(clearTimeout(this.#c),this.#o=0,this.#u())}detach(){this.#a=!0,clearTimeout(this.#c),this.#n?.close(),this.#n=void 0}#l(e){let t=JSON.stringify(e);this.#n&&this.#n.readyState===1?this.#n.send(t):this.#s.push(t)}#u(){if(this.#a)return;let e=this.#e.openSocket(this.sessionId,this.#i,this.#t.truncateResults,this.#t.imageRefs);this.#n=e,e.onopen=()=>{this.#o=0,this.#r.emit(`connectionChange`,!0);for(let t of this.#s.splice(0))e.send(t)},e.onmessage=e=>{let t=JSON.parse(String(e.data));if(t.type===`attached`)this.#r.emit(`attached`,t);else if(t.type===`event`){if(t.event.seq<=this.#i)return;this.#i=t.event.seq,this.#r.emit(`event`,t.event)}else t.type===`tool_call_request`?this.#r.emit(`toolCallRequest`,t):t.type===`tool_call_canceled`?this.#r.emit(`toolCallCanceled`,{executionId:t.executionId,reason:t.reason}):t.type===`protocol_error`&&this.#r.emit(`protocolError`,t.message)},e.onclose=()=>{if(this.#r.emit(`connectionChange`,!1),this.#a||!this.#t.reconnect)return;let e=jE(this.#o++);this.#r.emit(`reconnectAttempt`,this.#o),this.#c=setTimeout(()=>this.#u(),e)},e.onerror=()=>{}}},NE=class{#e;#t;#n;#r=new AE;#i=!1;#a=0;#o;constructor(e,t={}){this.#e=e,this.#t=t.reconnect??!0,this.#o=setTimeout(()=>this.#s(),0)}on(e,t){return this.#r.on(e,t)}detach(){this.#i=!0,clearTimeout(this.#o),this.#n?.close(),this.#n=void 0}#s(){if(this.#i)return;let e=this.#e.openQueueSocket();this.#n=e,e.onopen=()=>{this.#a=0,this.#r.emit(`connectionChange`,!0)},e.onmessage=e=>{let t=JSON.parse(String(e.data));t.type===`queue_attached`?(this.#r.emit(`attached`,t.stats),this.#r.emit(`stats`,t.stats)):t.type===`job_event`?this.#r.emit(`event`,t.event):t.type===`queue_stats`&&this.#r.emit(`stats`,t.stats)},e.onclose=()=>{if(this.#r.emit(`connectionChange`,!1),this.#i||!this.#t)return;let e=jE(this.#a++);this.#o=setTimeout(()=>this.#s(),e)},e.onerror=()=>{}}};function PE(e){let t=e.baseUrl.trim();for(;t.endsWith(`/`);)t=t.slice(0,-1);if(t!==``){t.includes(`://`)||(t=`http://`+t),t.endsWith(`/v1`)||(t+=`/v1`);try{new URL(t)}catch{return}return t}}function FE(e){let t=PE(e);if(!t)return!1;try{let{hostname:e}=new URL(t);return e===`127.0.0.1`||e===`localhost`||e===`::1`||e===`[::1]`}catch{return!1}}function IE(e){let{baseUrl:t,key:n}=e;if(n===``)return{};let r=t.replace(/^http/,`ws`),i=e=>`${e}${e.includes(`?`)?`&`:`?`}key=${encodeURIComponent(n)}`;return{headers:{authorization:`Bearer ${n}`},buildWsUrl:(e,t)=>i(`${r}/sessions/${encodeURIComponent(e)}/ws?afterSeq=${t}`),buildQueueWsUrl:()=>i(`${r}/queue/ws`)}}var LE=class extends Error{status;constructor(e,t){super(e),this.name=`WorkerDeckError`,this.status=t}},RE=class{#e;#t;#n;constructor(e){this.#e=e,this.#t=e.fetchImpl??fetch.bind(globalThis),this.#n=e.WebSocketImpl??WebSocket}get identityKey(){let e=Object.entries(this.#e.headers??{}).map(([e,t])=>[e.toLowerCase(),t]);return e.sort(([e],[t])=>e<t?-1:+(e>t)),JSON.stringify([this.#e.baseUrl,e])}async createSession(e){return(await this.#i(`POST`,`/sessions`,e)).session}async listSessions(){return(await this.#i(`GET`,`/sessions`)).sessions}async getSession(e){return(await this.#i(`GET`,`/sessions/${encodeURIComponent(e)}`)).session}async updateSession(e,t){return(await this.#i(`PATCH`,`/sessions/${encodeURIComponent(e)}`,t)).session}async deleteSession(e){return(await this.#i(`DELETE`,`/sessions/${encodeURIComponent(e)}`)).session}async listSessionFiles(e){return(await this.#i(`GET`,`/sessions/${encodeURIComponent(e)}/files`)).files}async fetchSessionFile(e,t){return await(await this.#r(this.sessionFileUrl(e,t),{headers:this.#e.headers},`GET file failed`)).text()}async uploadAttachment(e,t){let n=`${this.#e.baseUrl}/sessions/${encodeURIComponent(e)}/attachments?name=${encodeURIComponent(t.name)}`;return(await(await this.#r(n,{method:`POST`,headers:{...this.#e.headers,"content-type":t.mediaType},body:t.data},`upload failed`)).json()).attachment}attachmentUrl(e,t){return`${this.#e.baseUrl}/sessions/${encodeURIComponent(e)}/attachments/${encodeURIComponent(t)}`}producedFileUrl(e,t){return`${this.#e.baseUrl}/sessions/${encodeURIComponent(e)}/produced/${encodeURIComponent(t)}`}async readProducedFile(e,t){return await(await this.#r(this.producedFileUrl(e,t),{headers:{...this.#e.headers}},`produced file request failed`)).blob()}projectIconUrl(e){return`${this.#e.baseUrl}/sessions/${encodeURIComponent(e)}/project/icon`}async projectIcon(e){return await(await this.#r(this.projectIconUrl(e),{headers:{...this.#e.headers}},`project icon request failed`)).blob()}async listMcpServers(e){return(await this.#i(`GET`,`/sessions/${encodeURIComponent(e)}/mcp`)).servers}async mcpServerAction(e,t,n){return(await this.#i(`POST`,`/sessions/${encodeURIComponent(e)}/mcp/${encodeURIComponent(t)}`,{action:n})).servers}sessionFileUrl(e,t){let n=t.split(`/`).filter(Boolean).map(encodeURIComponent).join(`/`);return`${this.#e.baseUrl}/sessions/${encodeURIComponent(e)}/files/${n}`}async resolvePermission(e,t,n){await this.#i(`POST`,`/sessions/${encodeURIComponent(e)}/permissions/${encodeURIComponent(t)}`,n)}async submitExecutionResult(e,t){return await this.#i(`POST`,`/executions/${encodeURIComponent(e)}/result`,t)}async listProfiles(){return await this.#i(`GET`,`/profiles`)}async getProfile(e){return await this.#i(`GET`,`/profiles/${encodeURIComponent(e)}`)}async createProfile(e){return(await this.#i(`POST`,`/profiles`,e)).profile}async updateProfile(e,t){return(await this.#i(`PATCH`,`/profiles/${encodeURIComponent(e)}`,t)).profile}async deleteProfile(e){await this.#i(`DELETE`,`/profiles/${encodeURIComponent(e)}`)}async listSdkSessions(e){let t=new URLSearchParams;e?.dir&&t.set(`dir`,e.dir),e?.limit!==void 0&&t.set(`limit`,String(e.limit)),e?.offset!==void 0&&t.set(`offset`,String(e.offset)),e?.profile&&t.set(`profile`,e.profile);let n=t.size>0?`?${t.toString()}`:``;return(await this.#i(`GET`,`/sdk-sessions${n}`)).sdkSessions}async listHostRoots(){return await this.#i(`GET`,`/fs/roots`)}async listHostDir(e){let t=`?path=${encodeURIComponent(e)}`;return await this.#i(`GET`,`/fs/list${t}`)}async findHostFiles(e,t=``,n){let r=new URLSearchParams({path:e,q:t});return n!==void 0&&r.set(`limit`,String(n)),await this.#i(`GET`,`/fs/find?${r.toString()}`)}async readHostFile(e){let t=`?path=${encodeURIComponent(e)}`;return await this.#i(`GET`,`/fs/read${t}`)}async writeHostFile(e){return await this.#i(`PUT`,`/fs/write`,e)}async createJob(e){return(await this.#i(`POST`,`/jobs`,e)).job}async listJobs(){return(await this.#i(`GET`,`/jobs`)).jobs}async getJob(e){return(await this.#i(`GET`,`/jobs/${encodeURIComponent(e)}`)).job}async cancelJob(e){return(await this.#i(`DELETE`,`/jobs/${encodeURIComponent(e)}`)).job}async queueStats(){return(await this.#i(`GET`,`/queue`)).stats}attach(e,t){return new ME(this,e,t)}attachQueue(e){return new NE(this,e)}openSocket(e,t,n=!1,r=!1){let i=`afterSeq=${t}`+(n?`&truncateResults=1`:``)+(r?`&imageRefs=1`:``),a=this.#e.buildWsUrl?.(e,t,n,r)??`${this.#e.baseUrl.replace(/^http/,`ws`)}/sessions/${encodeURIComponent(e)}/ws?${i}`;return new this.#n(a)}async toolResult(e,t,n,r){return await this.#i(`GET`,`/sessions/${encodeURIComponent(e)}/events/${t}/result?toolUseId=${encodeURIComponent(n)}`+(r?.imageRefs?`&imageRefs=1`:``))}async toolResultImage(e,t,n,r){let i=`/sessions/${encodeURIComponent(e)}/events/${t}/result?toolUseId=${encodeURIComponent(n)}&part=${r}`;return await(await this.#r(`${this.#e.baseUrl}${i}`,{headers:{...this.#e.headers}},`image part request failed`)).blob()}openQueueSocket(){let e=this.#e.buildQueueWsUrl?.()??`${this.#e.baseUrl.replace(/^http/,`ws`)}/queue/ws`;return new this.#n(e)}async#r(e,t,n){let r=await this.#t(e,t);if(!r.ok)throw new LE((await r.json().catch(()=>({}))).error??`${n} with ${r.status}`,r.status);return r}async#i(e,t,n){let r=await this.#t(`${this.#e.baseUrl}${t}`,{method:e,headers:{...n===void 0?{}:{"content-type":`application/json`},...this.#e.headers},body:n===void 0?void 0:JSON.stringify(n)}),i=await r.json().catch(()=>({}));if(!r.ok)throw new LE(i.error??`${e} ${t} failed with ${r.status}`,r.status);return i}};function zE(){let e=(0,v.useRef)(!0);return(0,v.useEffect)(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function BE(e){return e instanceof LE&&e.status===404}function VE(e,t,n){let r=[],i=t.get(e);if(!i)return r;let a=[{entries:i.entries,index:0,depth:0}];for(;a.length>0;){let e=a[a.length-1],i=e.entries[e.index];if(i===void 0){a.pop();continue}e.index+=1;let o=e.depth;if(i.type!==`dir`){r.push({entry:i,depth:o});continue}let s=n.has(i.path),c=t.get(i.path);r.push({entry:i,depth:o,expanded:s,loading:s&&!c,truncated:s?c?.truncated:void 0}),s&&c&&a.push({entries:c.entries,index:0,depth:o+1})}return r}function HE(e,t){let n=e.endsWith(`/`)?e.slice(0,-1):e;if(t===n||!t.startsWith(`${n}/`))return[];let r=t.slice(n.length+1).split(`/`),i=[],a=n;for(let e of r.slice(0,-1))a=`${a}/${e}`,i.push(a);return i}function UE(e,t){let[n,r]=(0,v.useState)(!1),i=(0,v.useRef)(t);(0,v.useEffect)(()=>{i.current!==t&&(i.current=t,r(!1))},[t]);let a=(0,v.useCallback)(async(i,a)=>{if(!t||n)return[];try{let n=await e.findHostFiles(t,i,a?.limit??8);return a?.signal?.aborted?[]:n.matches}catch(e){return BE(e)&&r(!0),[]}},[e,t,n]);return{available:!!t&&!n,search:a}}function WE(e){let[t,n]=(0,v.useState)({available:!1,canWrite:!1});return(0,v.useEffect)(()=>{let t=!1;return e.listHostRoots().then(e=>{t||n({available:!0,canWrite:e.canWrite})}).catch(()=>{t||n({available:!1,canWrite:!1})}),()=>{t=!0}},[e]),t}function GE(e,t){let[n,r]=(0,v.useState)(()=>new Map),[i,a]=(0,v.useState)(()=>new Set),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(),u=(0,v.useRef)(t);(0,v.useEffect)(()=>{u.current!==t&&(u.current=t,r(new Map),a(new Set),s(!1),l(void 0))},[t]);let d=zE(),f=(0,v.useRef)(new Set),p=(0,v.useCallback)((t,{force:n=!1}={})=>{o||!n&&f.current.has(t)||(f.current.add(t),e.listHostDir(t).then(e=>{d.current&&r(n=>{let r=new Map(n);return r.set(t,{entries:e.entries,truncated:e.truncated}),r})}).catch(e=>{if(d.current){if(f.current.delete(t),BE(e)){s(!0);return}l(e instanceof Error?e.message:`Could not read that directory`)}}))},[e,o]);(0,v.useEffect)(()=>{t&&p(t)},[t,p]);let m=(0,v.useCallback)(e=>{a(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),p(e)},[p]),h=(0,v.useCallback)(e=>{if(!t)return;let n=HE(t,e);if(n.length!==0){for(let e of n)p(e);a(e=>{let t=new Set(e);for(let e of n)t.add(e);return t})}},[t,p]),g=(0,v.useCallback)(e=>{let n=e??t;n&&(l(void 0),p(n,{force:!0}))},[t,p]),_=(0,v.useMemo)(()=>t?VE(t,n,i):[],[t,n,i]);return{available:!!t&&!o,root:t,rows:_,loading:!!t&&!o&&!n.has(t)&&!c,error:c,toggle:m,reveal:h,refresh:g}}var KE=new Map,qE=new Set,JE=new Set;function YE(e,t){let[n,r]=(0,v.useState)(()=>Object.fromEntries(KE));return(0,v.useEffect)(()=>{let n=!0;for(let i of e){let e=i.info.project?.icon;if(e?.type!==`image`)continue;let{hash:a}=e;if(KE.has(a)||qE.has(a)||JE.has(a))continue;let o=t(i.hostId);o&&(qE.add(a),o.projectIcon(i.info.id).then(e=>{KE.set(a,URL.createObjectURL(e)),n&&r(Object.fromEntries(KE))}).catch(()=>{JE.add(a)}).finally(()=>qE.delete(a)))}return()=>{n=!1}},[e,t]),n}function XE(e,t){let n=t?_E(e,t):void 0;return{initialText:(0,v.useMemo)(()=>n?vE(n):``,[n]),save:(0,v.useCallback)(e=>{n&&yE(n,e)},[n]),clear:(0,v.useCallback)(()=>{n&&yE(n,``)},[n])}}function ZE(e,t,n={}){let{intervalMs:r=6e4,enabled:i=!0}=n,a=t?cE(e,t):void 0,[o,s]=(0,v.useState)(()=>a?lE(a):void 0),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(0),f=(0,v.useCallback)(()=>d(e=>e+1),[]);(0,v.useEffect)(()=>s(a?lE(a):void 0),[a]);let p=zE();return(0,v.useEffect)(()=>{if(!t||!i||c)return;let n=!1,o=()=>{globalThis.document?.hidden||e.listProfiles().then(e=>{if(n||!p.current)return;let r=e.profiles.find(e=>e.name===t)?.usage;a&&uE(a,r),s(r)}).catch(e=>{n||!p.current||BE(e)&&l(!0)})};o();let u=setInterval(o,r);return()=>{n=!0,clearInterval(u)}},[e,t,i,c,r,u,a]),{usage:o,refresh:f}}function QE(e,t){let[n,r]=(0,v.useState)(),[i,a]=(0,v.useState)(!!t),[o,s]=(0,v.useState)();return(0,v.useEffect)(()=>{if(!t){r(void 0),a(!1),s(void 0);return}let n=!1;return a(!0),s(void 0),r(void 0),e.getSession(t).then(e=>{n||(r(e),a(!1))}).catch(e=>{n||(s(e instanceof Error?e.message:`Session not found`),a(!1))}),()=>{n=!0}},[e,t]),{info:n,loading:i,error:o}}function $E(e){return e.draft!==void 0&&e.draft!==e.content}function eD(e){return e.draft??e.content??``}var tD={files:[]};function nD(e,t){switch(t.type){case`open`:{if(e.files.some(e=>e.path===t.path))return e.activePath===t.path?e:{...e,activePath:t.path};let n={path:t.path,name:iD(t.path),status:`loading`};return{files:[...e.files,n],activePath:t.path}}case`close`:{let n=e.files.findIndex(e=>e.path===t.path);if(n===-1)return e;let r=e.files.filter(e=>e.path!==t.path);return e.activePath===t.path?{files:r,activePath:(r[n]??r[n-1])?.path}:{...e,files:r}}case`closeAll`:return tD;case`activate`:return e.files.some(e=>e.path===t.path)?e.activePath===t.path?e:{...e,activePath:t.path}:e;case`loaded`:return rD(e,t.path,()=>({path:t.path,name:iD(t.path),status:t.encoding===`utf8`?`ready`:`binary`,content:t.encoding===`utf8`?t.content:void 0,bytes:t.bytes,hash:t.hash,modifiedAt:t.modifiedAt}));case`failed`:return rD(e,t.path,e=>({...e,status:`error`,error:t.error}));case`edit`:return rD(e,t.path,e=>e.status===`ready`?{...e,draft:t.content}:e);case`revert`:return rD(e,t.path,e=>({...e,draft:void 0,saveError:void 0,conflict:!1}));case`saveStart`:return rD(e,t.path,e=>({...e,saving:!0,saveError:void 0,conflict:!1}));case`saved`:return rD(e,t.path,e=>({...e,saving:!1,saveError:void 0,conflict:!1,content:t.content,bytes:t.bytes,hash:t.hash,modifiedAt:t.modifiedAt,draft:e.draft===t.content?void 0:e.draft}));case`saveFailed`:return rD(e,t.path,e=>({...e,saving:!1,saveError:t.error,conflict:t.conflict??!1}));case`dismissConflict`:return rD(e,t.path,e=>({...e,conflict:!1,saveError:void 0}))}}function rD(e,t,n){let r=e.files.findIndex(e=>e.path===t);if(r===-1)return e;let i=e.files[r],a=n(i);if(a===i)return e;let o=e.files.slice();return o[r]=a,{...e,files:o}}function iD(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;return t.slice(t.lastIndexOf(`/`)+1)||t||e}function aD(e){let[t,n]=(0,v.useReducer)(nD,tD),r=(0,v.useRef)(new Set),i=(0,v.useRef)(!0);(0,v.useEffect)(()=>(i.current=!0,()=>{i.current=!1}),[]);let a=(0,v.useRef)(t);(0,v.useEffect)(()=>{a.current=t},[t]);let o=t.files.filter(e=>e.status===`loading`).map(e=>e.path).join(`
46
+ `),s=(0,v.useCallback)(t=>e.readHostFile(t).then(e=>{if(i.current)return n({type:`loaded`,path:t,content:e.content,encoding:e.encoding,bytes:e.bytes,hash:e.hash,modifiedAt:e.modifiedAt}),e}),[e]);(0,v.useEffect)(()=>{for(let e of o?o.split(`
47
+ `):[])r.current.has(e)||(r.current.add(e),s(e).catch(t=>{i.current&&n({type:`failed`,path:e,error:t instanceof Error?t.message:`Could not read that file`})}))},[s,o]);let c=(0,v.useCallback)(e=>n({type:`open`,path:e}),[]),l=(0,v.useCallback)(e=>{r.current.delete(e),n({type:`close`,path:e})},[]),u=(0,v.useCallback)(()=>{r.current.clear(),n({type:`closeAll`})},[]),d=(0,v.useCallback)(e=>n({type:`activate`,path:e}),[]),f=(0,v.useCallback)((e,t)=>n({type:`edit`,path:e,content:t}),[]),p=(0,v.useCallback)(e=>n({type:`revert`,path:e}),[]),m=(0,v.useCallback)(e=>n({type:`dismissConflict`,path:e}),[]),h=(0,v.useCallback)(e=>{r.current.add(e),s(e).catch(t=>{i.current&&n({type:`failed`,path:e,error:t instanceof Error?t.message:`Could not re-read that file`})})},[s]),g=(0,v.useCallback)(async(t,r,a)=>{try{let o=await e.writeHostFile({path:t,content:r,expectedHash:a});if(!i.current)return;n({type:`saved`,path:t,content:r,bytes:o.bytes,hash:o.hash,modifiedAt:o.modifiedAt})}catch(e){if(!i.current)return;let r=e instanceof LE&&e.status===409;n({type:`saveFailed`,path:t,conflict:r,error:r?`This file changed on disk since you opened it.`:e instanceof Error?e.message:`Could not save that file`})}},[e]),_=(0,v.useCallback)(async e=>{let t=a.current.files.find(t=>t.path===e);!t||t.saving||!$E(t)||(n({type:`saveStart`,path:e}),await g(e,eD(t),t.hash))},[g]),y=(0,v.useCallback)(async t=>{let r=a.current.files.find(e=>e.path===t);if(!r||r.saving)return;let o=eD(r);n({type:`saveStart`,path:t});try{let n=await e.readHostFile(t);if(!i.current)return;await g(t,o,n.hash)}catch(e){if(!i.current)return;n({type:`saveFailed`,path:t,error:e instanceof Error?e.message:`Could not save that file`})}},[e,g]),b=(0,v.useMemo)(()=>t.files.find(e=>e.path===t.activePath),[t.files,t.activePath]),x=(0,v.useMemo)(()=>t.files.some($E),[t.files]);return{...t,active:b,hasUnsaved:x,open:c,close:l,closeAll:u,activate:d,edit:f,save:_,revert:p,reload:h,overwrite:y,dismissConflict:m}}var oD=`modulepreload`,sD=function(e){return`/`+e},cD={},lD=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=sD(t,n),t=s(t),t in cD)return;cD[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:oD,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};function uD(e,t={}){let n=new Map,r,i=!1,a=e=>t.onExecution?.(e),o=(t,n,r,i)=>{e.sendToolCallError(t.executionId,n,r),a({executionId:t.executionId,toolName:t.toolName,status:`failed`,reason:n,startedAt:i,endedAt:Date.now()})},s=async(t,r)=>{let s=Date.now(),c=new AbortController;n.set(t.executionId,c),a({executionId:t.executionId,toolName:t.toolName,status:`running`,startedAt:s});try{let o=await r(t.input,{executionId:t.executionId,signal:c.signal});if(i||!n.has(t.executionId))return;`error`in o?(e.sendToolCallError(t.executionId,o.reason??`client_error`,o.error),a({executionId:t.executionId,toolName:t.toolName,status:`failed`,reason:o.reason??`client_error`,startedAt:s,endedAt:Date.now()})):(e.sendToolCallResult(t.executionId,{type:`json`,value:o.value}),a({executionId:t.executionId,toolName:t.toolName,status:`settled`,startedAt:s,endedAt:Date.now()}))}catch(e){if(i||!n.has(t.executionId))return;o(t,`host_error`,e instanceof Error?e.message:String(e),s)}finally{n.delete(t.executionId)}},c=async c=>{let l=Date.now(),u=t.clientTools?.[c.toolName];if(u)return s(c,u);if(!(t.tools??[`eval_script`]).includes(c.toolName)){o(c,`unsupported_tool`,`this client does not execute '${c.toolName}'`,l);return}let d=c.input?.script;if(typeof d!=`string`){o(c,`invalid_input`,"expected a string `script` input",l);return}let f=new AbortController;n.set(c.executionId,f),a({executionId:c.executionId,toolName:c.toolName,status:`running`,startedAt:l});try{let o=await lD(()=>import(`./src-C4bOKcbq.js`),[]),s=o.createVfs(c.vfsSeed),u=Math.min(c.limits?.timeoutMs??1/0,t.timeoutMs??5e3),p=Math.min(c.limits?.memoryLimitBytes??1/0,t.memoryLimitBytes??67108864),m=t.execute?await t.execute({script:d,vfs:s,timeoutMs:u,memoryLimitBytes:p,signal:f.signal}):await(async()=>(r??=(t.loadEngine??dD)(),o.runScript(await r,{script:d,vfs:s,timeoutMs:u,memoryLimitBytes:p,signal:f.signal,fetchText:t.fetchText})))();if(i||!n.has(c.executionId))return;let h=m.logs.map(e=>`[${e.level}] ${e.text}`);m.ok?(e.sendToolCallResult(c.executionId,{type:`json`,value:m.value},h),a({executionId:c.executionId,toolName:c.toolName,status:`settled`,startedAt:l,endedAt:Date.now()})):(e.sendToolCallError(c.executionId,m.reason,m.error,h),a({executionId:c.executionId,toolName:c.toolName,status:`failed`,reason:m.reason,startedAt:l,endedAt:Date.now()}))}catch(e){if(i||!n.has(c.executionId))return;o(c,`host_error`,e instanceof Error?e.message:String(e),l)}finally{n.delete(c.executionId)}},l=e.on(`toolCallRequest`,e=>void c(e)),u=e.on(`toolCallCanceled`,({executionId:e,reason:t})=>{let r=n.get(e);r&&(r.abort(),n.delete(e),a({executionId:e,toolName:``,status:`canceled`,reason:t,startedAt:Date.now(),endedAt:Date.now()}))});return{dispose:()=>{i=!0,l(),u();for(let e of n.values())e.abort();n.clear()}}}async function dD(){let[e,t]=await Promise.all([lD(()=>import(`./src-C4bOKcbq.js`),[]),lD(()=>import(`./dist-QWwtnke2.js`),[])]);return e.loadEngine(t)}function fD(e,t={}){let[n,r]=(0,v.useState)([]),i=(0,v.useRef)(t);return i.current=t,(0,v.useEffect)(()=>{if(!e||t.enabled===!1)return;let n=uD(e,{get tools(){let e=i.current.tools,t=i.current.clientTools;if(!t)return e;let n=Object.keys(t);return e?[...new Set([...e,...n])]:n},get clientTools(){return i.current.clientTools},get timeoutMs(){return i.current.timeoutMs},get memoryLimitBytes(){return i.current.memoryLimitBytes},get loadEngine(){return i.current.loadEngine},get execute(){return i.current.execute},get fetchText(){return i.current.fetchText},onExecution:e=>{i.current.onExecution?.(e);let t=i.current.historyLimit??50;r(n=>[...n.filter(t=>t.executionId!==e.executionId),e].slice(-t))}});return()=>n.dispose()},[e,t.enabled]),{executions:n}}function pD(e,t){let n=Math.max(0,Math.min(t,e.items.length)),r=e.items.slice(n),i=new Map,a=0,o=0,s=0,c=0,l=0;for(let e of r)switch(e.kind){case`turn_result`:a+=1,e.isError&&(l+=1);break;case`assistant_text`:o+=1;break;case`tool_call`:s+=1,i.set(e.name,(i.get(e.name)??0)+1),(e.status===`failed`||e.result?.isError)&&(l+=1);break;case`file_delivered`:c+=1;break;case`notice`:e.level===`error`&&(l+=1)}let u=[...i.entries()].sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0])).map(([e])=>e),d=e.pendingApprovals?.length??0;return{turns:a,replies:o,tools:s,toolNames:u,files:c,errors:l,pending:d,any:a+o+s+c+l+d>0}}function mD(e){if(!e.any)return;let t=[];if(e.turns>0?t.push(hD(e.turns,`turn`)):e.replies>0&&t.push(hD(e.replies,`reply`,`replies`)),e.tools>0){let n=e.toolNames.slice(0,3).join(`, `),r=e.toolNames.length-3;t.push(`${hD(e.tools,`tool call`)}${n?` (${n}${r>0?`, +${r}`:``})`:``}`)}return e.files>0&&t.push(hD(e.files,`file`)),e.errors>0&&t.push(hD(e.errors,`error`)),e.pending>0&&t.push(`${hD(e.pending,`approval`)} waiting`),t.join(` · `)}function hD(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}var gD=(0,v.createContext)(`cards`);function _D({value:e,children:t}){return(0,U.jsx)(gD.Provider,{value:e,children:t})}function vD(){return(0,v.useContext)(gD)}var yD=(0,v.createContext)(`comfortable`);function bD({value:e,children:t}){return(0,U.jsx)(yD.Provider,{value:e,children:t})}var xD={terminal:{comfortable:{className:`term-row-gap`,px:18},compact:{className:`term-row-gap`,px:18}},cards:{comfortable:{className:`pt-4`,px:16},compact:{className:`pt-2`,px:8}}};function SD(e){return e===void 0||Number.isNaN(e)?`—`:e===0?`$0.00`:e<.01?`<$0.01`:`$${e.toFixed(2)}`}function CD(e){if(e<1e3)return`${Math.round(e)}ms`;let t=e/1e3;return t<60?`${t.toFixed(1)}s`:`${Math.floor(t/60)}m ${Math.round(t%60)}s`}function wD(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(Math.round(e))}function TD(e){return e>=1048576?`${(e/1048576).toFixed(1)} MB`:e>=1024?`${(e/1024).toFixed(1)} KB`:`${e} B`}function ED(e,t=Date.now()){let n=e-t;if(n<=0)return`now`;let r=Math.ceil(n/6e4);if(r<1)return`<1m`;if(r<60)return`${r}m`;let i=Math.floor(r/1440);return i>=1?`${i}d ${Math.floor(r%1440/60)}h`:`${Math.floor(r/60)}h ${r%60}m`}function DD(e,t=Date.now()){if(!e)return`—`;let n=Math.max(0,t-e),r=Math.floor(n/1e3);if(r<60)return`just now`;let i=Math.floor(r/60);if(i<60)return`${i}m ago`;let a=Math.floor(i/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}function OD(e){if(e===`five_hour`)return`5-hour session`;if(e===`seven_day`)return`Weekly`;if(e===`seven_day_oauth_apps`)return`Weekly · apps`;let t=e=>e.replace(/\b\w/g,e=>e.toUpperCase());return e.startsWith(`seven_day_`)?`Weekly · ${t(e.slice(10).replaceAll(`_`,` `))}`:t(e.replaceAll(`_`,` `))}function kD(e){if(e===`five_hour`)return 18e3;if(e.startsWith(`seven_day`))return 604800}function AD(e,t=Date.now()){let n=Math.max(0,Math.floor((t-e)/1e3));if(n<60)return`${n} sec${n===1?``:`s`} ago`;if(n<3600){let e=Math.floor(n/60);return`${e} min${e===1?``:`s`} ago`}let r=Math.floor(n/3600);return`${r} hour${r===1?``:`s`} ago`}function jD(e,t=80){if(e==null)return``;if(typeof e==`object`){let n=e,r=n.command??n.file_path??n.path??n.url??n.pattern??n.query??n.description;if(typeof r==`string`)return r.length>t?r.slice(0,t-1)+`…`:r}let n=JSON.stringify(e)??``;return n.length>t?n.slice(0,t-1)+`…`:n}var MD={gpt:{name:`GPT`,joiner:`-`},deepseek:{name:`DeepSeek`},glm:{name:`GLM`},qwen:{name:`Qwen`},kimi:{name:`Kimi`},llama:{name:`Llama`},mistral:{name:`Mistral`},grok:{name:`Grok`}};function ND(e){if(!e)return;let t=(e.split(`[`)[0]??e).toLowerCase().split(`-`).filter(Boolean);t[0]===`claude`&&t.shift();let n=t.shift();if(!n)return e;let r=MD[n],i=r?.name??(/^o\d+$/.test(n)?n:`${n.charAt(0).toUpperCase()}${n.slice(1)}`),a=[],o=[];for(let e of t)/^\d{8}$/.test(e)||(/^\d+(\.\d+)?$/.test(e)?a.push(e):o.push(`${e.charAt(0).toUpperCase()}${e.slice(1)}`));return[a.length>0?`${i}${r?.joiner??` `}${a.join(`.`)}`:i,...o].join(` `)}function PD(e){switch(e){case`Bash`:case`BashOutput`:case`KillShell`:return Cy;case`Read`:return O_;case`Write`:return py;case`Edit`:case`MultiEdit`:case`NotebookEdit`:return jv;case`Glob`:return P_;case`Grep`:return ty;case`WebFetch`:return r_;case`WebSearch`:return W_;case`Task`:case`Agent`:return jy;case`TodoWrite`:return fy;case`Skill`:return uy;case`AskUserQuestion`:return pv;case`CodexCommand`:return Cy;case`CodexFileChange`:return E_;case`CodexWebSearch`:return W_;case`CodexImageGeneration`:case`CodexImageView`:return Z_;default:return e.startsWith(`mcp__`)?Bv:zy}}function FD(e){return e===`Bash`||e===`CodexCommand`}function ID(e){switch(e){case`Write`:case`Edit`:case`MultiEdit`:case`NotebookEdit`:case`Update`:case`CodexFileChange`:return!0;default:return!1}}var LD=[`⋄`,`◇`,`◈`,`◆`],RD=LD[LD.length-1];function zD(){let[e,t]=(0,v.useState)(!1);return(0,v.useEffect)(()=>{let e=window.matchMedia?.(`(prefers-reduced-motion: reduce)`);if(!e)return;t(e.matches);let n=()=>t(e.matches);return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}function BD(e){let t=zD(),n=e&&!t,[r,i]=(0,v.useState)(0);return(0,v.useEffect)(()=>{if(!n)return;let e=setInterval(()=>i(e=>e+1),150);return()=>clearInterval(e)},[n]),n?LD[r%LD.length]:RD}var VD={hover:!0,actions:!0},HD=(0,v.createContext)(VD);function UD(){return(0,v.useContext)(HD)}function WD(e){return e===!1?{hover:!1,actions:!1}:e===!0||e===void 0?VD:{...VD,...e}}function GD({value:e,children:t}){return(0,U.jsx)(HD.Provider,{value:e,children:t})}function KD({actions:e,children:t,className:n}){let{actions:r}=UD();return r?(0,U.jsxs)(`div`,{className:W(`term-hoverable`,n),children:[t,(0,U.jsx)(`div`,{className:`term-actions`,children:e})]}):(0,U.jsx)(U.Fragment,{children:t})}var qD=(0,v.createContext)(void 0);function JD({value:e,children:t}){return(0,U.jsx)(qD.Provider,{value:e,children:t})}function YD({id:e}){let t=(0,v.useContext)(qD);if(!t)return null;let n=t.has(e),r=n?`Remove bookmark`:`Bookmark`;return(0,U.jsx)(`button`,{type:`button`,className:`term-action`,title:r,"aria-label":r,"aria-pressed":n,onClick:n=>{n.stopPropagation(),t.toggle(e)},children:n?`★`:`☆`})}function XD({onOpen:e,label:t=`Open sub-agent`}){return(0,U.jsx)(`button`,{type:`button`,className:`term-action`,title:t,"aria-label":t,onClick:t=>{t.stopPropagation(),e()},children:`⤢`})}function ZD({text:e,label:t=`Copy`}){let[n,r]=(0,v.useState)(!1);return(0,U.jsx)(`button`,{type:`button`,className:`term-action`,title:t,"aria-label":t,onClick:t=>{t.stopPropagation(),pS(e).then(e=>{e&&(r(!0),setTimeout(()=>r(!1),1200))})},children:n?`✓`:`⧉`})}function QD({glyph:e,glyphTone:t,tone:n,bold:r,indent:i,columns:a,className:o,children:s,style:c,...l}){return(0,U.jsxs)(`div`,{className:W(`term-row`,o),"data-indent":i?String(i):void 0,"data-tone":n,"data-weight":r?`bold`:void 0,style:a===void 0?c:{...c,"--term-cell":`${a}ch`},...l,children:[(0,U.jsx)(`span`,{className:`term-gutter`,"data-tone":t,"aria-hidden":!0,children:e??` `}),(0,U.jsx)(`div`,{className:`term-body`,children:s})]})}function $D(){return(0,U.jsx)(`div`,{className:`term-blank`,"aria-hidden":!0})}function eO({className:e,...t}){return(0,U.jsx)(`div`,{className:W(`term-band`,e),...t})}function tO({tone:e,bold:t,className:n,...r}){return(0,U.jsx)(`span`,{"data-tone":e,"data-weight":t?`bold`:void 0,className:n,...r})}function nO(e){return e.startsWith(`+`)?`add`:e.startsWith(`-`)?`remove`:`context`}function rO(e){let t=e.oldStart,n=e.newStart,r=[];for(let i of e.lines){let e=nO(i),a=i.slice(1);e===`add`?r.push({kind:e,number:n++,text:a}):e===`remove`?r.push({kind:e,number:t++,text:a}):(r.push({kind:e,number:n,text:a}),t++,n++)}return r}var iO={context:` `,add:`+`,remove:`-`};function aO(e){let t=e,n=typeof t?.old_string==`string`?t.old_string:void 0,r=typeof t?.new_string==`string`?t.new_string:void 0;if(n===void 0&&r===void 0)return;let i=[...n?n.split(`
48
+ `).map(e=>`-${e}`):[],...r?r.split(`
49
+ `).map(e=>`+${e}`):[]];if(i.length!==0)return{...typeof t?.file_path==`string`&&{path:t.file_path},hunks:[{oldStart:0,oldLines:0,newStart:0,newLines:0,lines:i}]}}function oO({patch:e}){let t=e.hunks.map(rO),n=e.hunks.some(e=>e.newStart>0),r=n?String(Math.max(...t.flat().map(e=>e.number),1)).length:0,i=n?r+3:2;return(0,U.jsxs)(`div`,{className:`term-diff`,children:[t.map((e,t)=>(0,U.jsxs)(`div`,{children:[t>0?(0,U.jsx)(QD,{columns:i,glyph:` `.repeat(r)+` ⋮`,tone:`faint`}):null,e.map((e,t)=>(0,U.jsx)(QD,{columns:i,"data-diff":e.kind,glyph:n?`${String(e.number).padStart(r)} ${iO[e.kind]}`:iO[e.kind],children:e.text||` `},t))]},t)),e.truncated?(0,U.jsx)(QD,{columns:i,tone:`faint`,children:`… diff truncated`}):null]})}var sO=(function(e){if(e==null)return fO;if(typeof e==`function`)return dO(e);if(typeof e==`object`)return Array.isArray(e)?cO(e):lO(e);if(typeof e==`string`)return uO(e);throw Error(`Expected function, string, or object as test`)});function cO(e){let t=[],n=-1;for(;++n<e.length;)t[n]=sO(e[n]);return dO(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function lO(e){let t=e;return dO(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function uO(e){return dO(t);function t(t){return t&&t.type===e}}function dO(e){return t;function t(t,n,r){return!!(pO(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function fO(){return!0}function pO(e){return typeof e==`object`&&!!e&&`type`in e}function mO(e){return e}var hO=[],gO=`skip`;function _O(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=sO(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+mO(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=hO,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=vO(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function vO(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?hO:[e]}function yO(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),_O(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var bO={indicator:`indicator`,textOnly:`text-only`,remove:`remove`};function xO({defaultOrigin:e=``,allowedLinkPrefixes:t=[],allowedImagePrefixes:n=[],allowDataImages:r=!1,allowedProtocols:i=[],blockedImageClass:a=`inline-block bg-gray-200 dark:bg-gray-700 text-gray-600 dark:text-gray-400 px-3 py-1 rounded text-sm`,blockedLinkClass:o=`text-gray-500`,linkBlockPolicy:s=bO.indicator,imageBlockPolicy:c=bO.indicator}){let l=t.length&&!t.every(e=>e===`*`),u=n.length&&!n.every(e=>e===`*`);if(!e&&(l||u))throw Error(`defaultOrigin is required when allowedLinkPrefixes or allowedImagePrefixes are provided`);return l=>{let u=jO(e,t,n,r,i,a,o,s,c);DO(l),yO(l,u)}}function SO(e,t){if(typeof e!=`string`)return null;try{return new URL(e)}catch{if(t)try{return new URL(e,t)}catch{return null}if(e.startsWith(`/`)||e.startsWith(`./`)||e.startsWith(`../`))try{return new URL(e,`http://example.com`)}catch{return null}return null}}function CO(e){return typeof e==`string`?e.startsWith(`/`)||e.startsWith(`./`)||e.startsWith(`../`):!1}var wO=new Set([`https:`,`http:`,`irc:`,`ircs:`,`mailto:`,`xmpp:`,`blob:`]),TO=new Set([`javascript:`,`data:`,`file:`,`vbscript:`]);function EO(e,t,n,r=!1,i=!1,a=[]){if(!e)return null;if(typeof e==`string`&&e.startsWith(`#`)&&!i)try{if(new URL(e,`http://example.com`).hash===e)return e}catch{}if(typeof e==`string`&&e.startsWith(`data:`))return i&&r&&e.startsWith(`data:image/`)?e:null;if(typeof e==`string`&&e.startsWith(`blob:`)){try{if(new URL(e).protocol===`blob:`&&e.length>5){let t=e.substring(5);if(t&&t.length>0&&t!==`invalid`)return e}}catch{return null}return null}let o=SO(e,n);if(!o||TO.has(o.protocol)||!(wO.has(o.protocol)||a.includes(o.protocol)||a.includes(`*`)))return null;if(o.protocol===`mailto:`||!o.protocol.match(/^https?:$/))return o.href;let s=CO(e);return o&&t.some(e=>{let t=SO(e,n);return!t||t.origin!==o.origin?!1:o.href.startsWith(t.href)})?s?o.pathname+o.search+o.hash:o.href:t.includes(`*`)?o.protocol!==`https:`&&o.protocol!==`http:`?null:s?o.pathname+o.search+o.hash:o.href:null}function DO(e){if(`children`in e&&Array.isArray(e.children)){e.children=e.children.filter(e=>e!=null);for(let t of e.children)DO(t)}}var OO=Symbol(`node-seen`);function kO(e,t,n){return t===bO.remove?{type:`remove`}:t===bO.textOnly?{type:`replace`,element:{type:`element`,tagName:`span`,properties:{},children:[...e.children]}}:{type:`replace`,element:{type:`element`,tagName:`span`,properties:{title:`Blocked URL: `+String(e.properties.href),class:n},children:[...e.children,{type:`text`,value:` [blocked]`}]}}}function AO(e,t,n){if(t===bO.remove)return{type:`remove`};if(t===bO.textOnly){let t=String(e.properties.alt||``);return t?{type:`replace`,element:{type:`element`,tagName:`span`,properties:{},children:[{type:`text`,value:t}]}}:{type:`remove`}}return{type:`replace`,element:{type:`element`,tagName:`span`,properties:{class:n},children:[{type:`text`,value:`[Image blocked: `+String(e.properties.alt||`No description`)+`]`}]}}}var jO=(e,t,n,r,i,a,o,s,c)=>{let l=(u,d,f)=>{if(u.type!==`element`||u[OO])return!0;if(u.tagName===`a`){let n=EO(u.properties.href,t,e,!1,!1,i);if(n===null){if(u[OO]=!0,yO(u,l),f&&typeof d==`number`){let e=kO(u,s,o);if(e.type===`remove`)return f.children.splice(d,1),[gO,d];f.children[d]=e.element}return gO}return u.properties.href=n,u.properties.target=`_blank`,u.properties.rel=`noopener noreferrer`,!0}if(u.tagName===`img`){let t=EO(u.properties.src,n,e,r,!0,i);if(t===null){if(u[OO]=!0,yO(u,l),f&&typeof d==`number`){let e=AO(u,c,a);if(e.type===`remove`)return f.children.splice(d,1),[gO,d];f.children[d]=e.element}return gO}return u.properties.src=t,!0}return!0};return l},{defineProperty:MO}=Object,NO=typeof self==`object`?self:globalThis,PO=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new NO[e](t)},FO=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o){let i=r(t),a=r(n);i===`__proto__`?MO(e,i,{value:a,configurable:!0,enumerable:!0,writable:!0}):e[i]=a}return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof NO[e]==`function`?PO(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}case`-0`:return-0}return n(PO(a,o),i)};return r},IO=e=>FO(new Map,e)(0),LO=``,{toString:RO}={},{keys:zO,is:BO}=Object,VO=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=RO.call(e).slice(8,-1);switch(n){case`Array`:return[1,LO];case`Object`:return[2,LO];case`Date`:return[3,LO];case`RegExp`:return[4,LO];case`Map`:return[5,LO];case`Set`:return[6,LO];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},HO=([e,t])=>e===0&&(t===`function`||t===`symbol`),UO=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=o=>{if(n.has(o))return n.get(o);let[s,c]=VO(o);switch(s){case 0:{let t=o;switch(c){case`bigint`:s=8,t=o.toString();break;case`number`:if(!o&&BO(o,-0))return r.push([`-0`])-1;break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+c);t=null;break;case`undefined`:return i([-1],o)}return i([s,t],o)}case 1:{if(c){let e=o;return c===`DataView`?e=new Uint8Array(o.buffer):c===`ArrayBuffer`&&(e=new Uint8Array(o)),i([c,[...e]],o)}let e=[],t=i([s,e],o);for(let t of o)e.push(a(t));return t}case 2:{if(c)switch(c){case`BigInt`:return i([c,o.toString()],o);case`Boolean`:case`Number`:case`String`:return i([c,o.valueOf()],o)}if(t&&`toJSON`in o)return a(o.toJSON());let n=[],r=i([s,n],o);for(let t of zO(o))(e||!HO(VO(o[t])))&&n.push([a(t),a(o[t])]);return r}case 3:return i([s,isNaN(o.getTime())?LO:o.toISOString()],o);case 4:{let{source:e,flags:t}=o;return i([s,{source:e,flags:t}],o)}case 5:{let t=[],n=i([s,t],o);for(let[n,r]of o)(e||!(HO(VO(n))||HO(VO(r))))&&t.push([a(n),a(r)]);return n}case 6:{let t=[],n=i([s,t],o);for(let n of o)(e||!HO(VO(n)))&&t.push(a(n));return n}}let{message:l}=o;return i([s,{name:c,message:l}],o)};return a},WO=(e,{json:t,lossy:n}={})=>{let r=[];return UO(!(t||n),!!t,new Map,r)(e),r},GO=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?IO(WO(e,t)):structuredClone(e):(e,t)=>IO(WO(e,t)),KO=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};KO.prototype.normal={},KO.prototype.property={},KO.prototype.space=void 0;function qO(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new KO(n,r,t)}function JO(e){return e.toLowerCase()}var YO=class{constructor(e,t){this.attribute=t,this.property=e}};YO.prototype.attribute=``,YO.prototype.booleanish=!1,YO.prototype.boolean=!1,YO.prototype.commaOrSpaceSeparated=!1,YO.prototype.commaSeparated=!1,YO.prototype.defined=!1,YO.prototype.mustUseProperty=!1,YO.prototype.number=!1,YO.prototype.overloadedBoolean=!1,YO.prototype.property=``,YO.prototype.spaceSeparated=!1,YO.prototype.space=void 0;var XO=s({boolean:()=>QO,booleanish:()=>$O,commaOrSpaceSeparated:()=>ik,commaSeparated:()=>rk,number:()=>tk,overloadedBoolean:()=>ek,spaceSeparated:()=>nk}),ZO=0,QO=ak(),$O=ak(),ek=ak(),tk=ak(),nk=ak(),rk=ak(),ik=ak();function ak(){return 2**++ZO}var ok=Object.keys(XO),sk=class extends YO{constructor(e,t,n,r){let i=-1;if(super(e,t),ck(this,`space`,r),typeof n==`number`)for(;++i<ok.length;){let e=ok[i];ck(this,ok[i],(n&XO[e])===XO[e])}}};sk.prototype.defined=!0;function ck(e,t,n){n&&(e[t]=n)}function lk(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new sk(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[JO(r)]=r,n[JO(a.attribute)]=r}return new KO(t,n,e.space)}var uk=lk({properties:{ariaActiveDescendant:null,ariaAtomic:$O,ariaAutoComplete:null,ariaBusy:$O,ariaChecked:$O,ariaColCount:tk,ariaColIndex:tk,ariaColSpan:tk,ariaControls:nk,ariaCurrent:null,ariaDescribedBy:nk,ariaDetails:null,ariaDisabled:$O,ariaDropEffect:nk,ariaErrorMessage:null,ariaExpanded:$O,ariaFlowTo:nk,ariaGrabbed:$O,ariaHasPopup:null,ariaHidden:$O,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:nk,ariaLevel:tk,ariaLive:null,ariaModal:$O,ariaMultiLine:$O,ariaMultiSelectable:$O,ariaOrientation:null,ariaOwns:nk,ariaPlaceholder:null,ariaPosInSet:tk,ariaPressed:$O,ariaReadOnly:$O,ariaRelevant:null,ariaRequired:$O,ariaRoleDescription:nk,ariaRowCount:tk,ariaRowIndex:tk,ariaRowSpan:tk,ariaSelected:$O,ariaSetSize:tk,ariaSort:null,ariaValueMax:tk,ariaValueMin:tk,ariaValueNow:tk,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function dk(e,t){return t in e?e[t]:t}function fk(e,t){return dk(e,t.toLowerCase())}var pk=lk({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:rk,acceptCharset:nk,accessKey:nk,action:null,allow:null,allowFullScreen:QO,allowPaymentRequest:QO,allowUserMedia:QO,alpha:QO,alt:null,as:null,async:QO,autoCapitalize:null,autoComplete:nk,autoFocus:QO,autoPlay:QO,blocking:nk,capture:null,charSet:null,checked:QO,cite:null,className:nk,closedBy:null,colorSpace:null,cols:tk,colSpan:tk,command:null,commandFor:null,content:null,contentEditable:$O,controls:QO,controlsList:nk,coords:tk|rk,crossOrigin:null,data:null,dateTime:null,decoding:null,default:QO,defer:QO,dir:null,dirName:null,disabled:QO,download:ek,draggable:$O,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:QO,formTarget:null,headers:nk,height:tk,hidden:ek,high:tk,href:null,hrefLang:null,htmlFor:nk,httpEquiv:nk,id:null,imageSizes:null,imageSrcSet:null,inert:QO,inputMode:null,integrity:null,is:null,isMap:QO,itemId:null,itemProp:nk,itemRef:nk,itemScope:QO,itemType:nk,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:QO,low:tk,manifest:null,max:null,maxLength:tk,media:null,method:null,min:null,minLength:tk,multiple:QO,muted:QO,name:null,nonce:null,noModule:QO,noValidate:QO,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:QO,optimum:tk,pattern:null,ping:nk,placeholder:null,playsInline:QO,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:QO,referrerPolicy:null,rel:nk,required:QO,reversed:QO,rows:tk,rowSpan:tk,sandbox:nk,scope:null,scoped:QO,seamless:QO,selected:QO,shadowRootClonable:QO,shadowRootCustomElementRegistry:QO,shadowRootDelegatesFocus:QO,shadowRootMode:null,shadowRootSerializable:QO,shape:null,size:tk,sizes:null,slot:null,span:tk,spellCheck:$O,src:null,srcDoc:null,srcLang:null,srcSet:null,start:tk,step:null,style:null,tabIndex:tk,target:null,title:null,translate:null,type:null,typeMustMatch:QO,useMap:null,value:$O,width:tk,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:nk,axis:null,background:null,bgColor:null,border:tk,borderColor:null,bottomMargin:tk,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:QO,declare:QO,event:null,face:null,frame:null,frameBorder:null,hSpace:tk,leftMargin:tk,link:null,longDesc:null,lowSrc:null,marginHeight:tk,marginWidth:tk,noResize:QO,noHref:QO,noShade:QO,noWrap:QO,object:null,profile:null,prompt:null,rev:null,rightMargin:tk,rules:null,scheme:null,scrolling:$O,standby:null,summary:null,text:null,topMargin:tk,valueType:null,version:null,vAlign:null,vLink:null,vSpace:tk,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:QO,disablePictureInPicture:QO,disableRemotePlayback:QO,exportParts:rk,part:nk,prefix:null,property:null,results:tk,security:null,unselectable:null},space:`html`,transform:fk}),mk=lk({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:ik,accentHeight:tk,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:tk,amplitude:tk,arabicForm:null,ascent:tk,attributeName:null,attributeType:null,azimuth:tk,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:tk,by:null,calcMode:null,capHeight:tk,className:nk,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:tk,diffuseConstant:tk,direction:null,display:null,dur:null,divisor:tk,dominantBaseline:null,download:QO,dx:null,dy:null,edgeMode:null,editable:null,elevation:tk,enableBackground:null,end:null,event:null,exponent:tk,externalResourcesRequired:null,fill:null,fillOpacity:tk,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:rk,g2:rk,glyphName:rk,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:tk,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:tk,horizOriginX:tk,horizOriginY:tk,id:null,ideographic:tk,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:tk,k:tk,k1:tk,k2:tk,k3:tk,k4:tk,kernelMatrix:ik,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:tk,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:tk,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:tk,overlineThickness:tk,paintOrder:null,panose1:null,path:null,pathLength:tk,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:nk,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:tk,pointsAtY:tk,pointsAtZ:tk,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ik,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ik,rev:ik,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ik,requiredFeatures:ik,requiredFonts:ik,requiredFormats:ik,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:tk,specularExponent:tk,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:tk,strikethroughThickness:tk,string:null,stroke:null,strokeDashArray:ik,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:tk,strokeOpacity:tk,strokeWidth:null,style:null,surfaceScale:tk,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ik,tabIndex:tk,tableValues:null,target:null,targetX:tk,targetY:tk,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ik,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:tk,underlineThickness:tk,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:tk,values:null,vAlphabetic:tk,vMathematical:tk,vectorEffect:null,vHanging:tk,vIdeographic:tk,version:null,vertAdvY:tk,vertOriginX:tk,vertOriginY:tk,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:tk,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:dk}),hk=lk({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()}}),gk=lk({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:fk}),_k=lk({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),vk={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`},yk=/[A-Z]/g,bk=/-[a-z]/g,xk=/^data[-\w.:]+$/i;function Sk(e,t){let n=JO(t),r=t,i=YO;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&xk.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(bk,wk);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!bk.test(e)){let n=e.replace(yk,Ck);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=sk}return new i(r,t)}function Ck(e){return`-`+e.toLowerCase()}function wk(e){return e.charAt(1).toUpperCase()}var Tk=qO([uk,pk,hk,gk,_k],`html`),Ek=qO([uk,mk,hk,gk,_k],`svg`);function Dk(e){let t=[],n=String(e||``),r=n.indexOf(`,`),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);let e=n.slice(i,r).trim();(e||!a)&&t.push(e),i=r+1,r=n.indexOf(`,`,i)}return t}function Ok(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var kk=/[#.]/g;function Ak(e,t){let n=e||``,r={},i=0,a,o;for(;i<n.length;){kk.lastIndex=i;let e=kk.exec(n),t=n.slice(i,e?e.index:n.length);t&&(a?a===`#`?r.id=t:Array.isArray(r.className)?r.className.push(t):r.className=[t]:o=t,i+=t.length),e&&(a=e[0],i++)}return{type:`element`,tagName:o||t||`div`,properties:r,children:[]}}function jk(e){let t=String(e||``).trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function Mk(e){return e.join(` `).trim()}function Nk(e,t,n){let r=n?zk(n):void 0;function i(n,i,...a){let o;if(n==null){o={type:`root`,children:[]};let e=i;a.unshift(e)}else{o=Ak(n,t);let s=o.tagName.toLowerCase(),c=r?r.get(s):void 0;if(o.tagName=c||s,Pk(i))a.unshift(i);else for(let[t,n]of Object.entries(i))Fk(e,o.properties,t,n)}for(let e of a)Ik(o.children,e);return o.type===`element`&&o.tagName===`template`&&(o.content={type:`root`,children:o.children},o.children=[]),o}return i}function Pk(e){if(typeof e!=`object`||!e||Array.isArray(e))return!0;if(typeof e.type!=`string`)return!1;let t=e,n=Object.keys(e);for(let e of n){let n=t[e];if(n&&typeof n==`object`){if(!Array.isArray(n))return!0;let e=n;for(let t of e)if(typeof t!=`number`&&typeof t!=`string`)return!0}}return!!(`children`in e&&Array.isArray(e.children))}function Fk(e,t,n,r){let i=Sk(e,n),a;if(r!=null){if(typeof r==`number`){if(Number.isNaN(r))return;a=r}else a=typeof r==`boolean`?r:typeof r==`string`?i.spaceSeparated?jk(r):i.commaSeparated?Dk(r):i.commaOrSpaceSeparated?jk(Dk(r).join(` `)):Lk(i,i.property,r):Array.isArray(r)?[...r]:i.property===`style`?Rk(r):String(r);if(Array.isArray(a)){let e=[];for(let t of a)e.push(Lk(i,i.property,t));a=e}i.property===`className`&&Array.isArray(t.className)&&(a=t.className.concat(a)),t[i.property]=a}}function Ik(e,t){if(t!=null){if(typeof t==`number`||typeof t==`string`)e.push({type:`text`,value:String(t)});else if(Array.isArray(t))for(let n of t)Ik(e,n);else if(typeof t==`object`&&`type`in t)t.type===`root`?Ik(e,t.children):e.push(t);else throw Error("Expected node, nodes, or string, got `"+t+"`")}}function Lk(e,t,n){if(typeof n==`string`){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===``||JO(n)===JO(t)))return!0}return n}function Rk(e){let t=[];for(let[n,r]of Object.entries(e))t.push([n,r].join(`: `));return t.join(`; `)}function zk(e){let t=new Map;for(let n of e)t.set(n.toLowerCase(),n);return t}var Bk=`altGlyph.altGlyphDef.altGlyphItem.animateColor.animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.glyphRef.linearGradient.radialGradient.solidColor.textArea.textPath`.split(`.`),Vk=Nk(Tk,`div`),Hk=Nk(Ek,`g`,Bk);function Uk(e){let t=String(e),n=[];return{toOffset:i,toPoint:r};function r(e){if(typeof e==`number`&&e>-1&&e<=t.length){let r=0;for(;;){let i=n[r];if(i===void 0){let e=Wk(t,n[r-1]);i=e===-1?t.length+1:e+1,n[r]=i}if(i>e)return{line:r+1,column:e-(r>0?n[r-1]:0)+1,offset:e};r++}}}function i(e){if(e&&typeof e.line==`number`&&typeof e.column==`number`&&!Number.isNaN(e.line)&&!Number.isNaN(e.column)){for(;n.length<e.line;){let e=n[n.length-1],r=Wk(t,e),i=r===-1?t.length+1:r+1;if(e===i)break;n.push(i)}let r=(e.line>1?n[e.line-2]:0)+e.column-1;if(r<n[e.line-1])return r}}}function Wk(e,t){let n=e.indexOf(`\r`,t),r=e.indexOf(`
50
+ `,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}var Gk={html:`http://www.w3.org/1999/xhtml`,mathml:`http://www.w3.org/1998/Math/MathML`,svg:`http://www.w3.org/2000/svg`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`},Kk={}.hasOwnProperty,qk=Object.prototype;function Jk(e,t){let n=t||{};return Yk({file:n.file||void 0,location:!1,schema:n.space===`svg`?Ek:Tk,verbose:n.verbose||!1},e)}function Yk(e,t){let n;switch(t.nodeName){case`#comment`:{let r=t;return n={type:`comment`,value:r.data},Qk(e,r,n),n}case`#document`:case`#document-fragment`:{let r=t,i=`mode`in r?r.mode===`quirks`||r.mode===`limited-quirks`:!1;if(n={type:`root`,children:Xk(e,t.childNodes),data:{quirksMode:i}},e.file&&e.location){let t=String(e.file),r=Uk(t),i=r.toPoint(0),a=r.toPoint(t.length);n.position={start:i,end:a}}return n}case`#documentType`:{let r=t;return n={type:`doctype`},Qk(e,r,n),n}case`#text`:{let r=t;return n={type:`text`,value:r.value},Qk(e,r,n),n}default:return n=Zk(e,t),n}}function Xk(e,t){let n=-1,r=[];for(;++n<t.length;){let i=Yk(e,t[n]);r.push(i)}return r}function Zk(e,t){let n=e.schema;e.schema=t.namespaceURI===Gk.svg?Ek:Tk;let r=-1,i={};for(;++r<t.attrs.length;){let e=t.attrs[r],n=(e.prefix?e.prefix+`:`:``)+e.name;Kk.call(qk,n)||(i[n]=e.value)}let a=(e.schema.space===`svg`?Hk:Vk)(t.tagName,i,Xk(e,t.childNodes));if(Qk(e,t,a),a.tagName===`template`){let n=t,r=n.sourceCodeLocation,i=r&&r.startTag&&eA(r.startTag),o=r&&r.endTag&&eA(r.endTag),s=Yk(e,n.content);i&&o&&e.file&&(s.position={start:i.end,end:o.start}),a.content=s}return e.schema=n,a}function Qk(e,t,n){if(`sourceCodeLocation`in t&&t.sourceCodeLocation&&e.file){let r=$k(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function $k(e,t,n){let r=eA(n);if(t.type===`element`){let i=t.children[t.children.length-1];if(r&&!n.endTag&&i&&i.position&&i.position.end&&(r.end=Object.assign({},i.position.end)),e.verbose){let r={},i;if(n.attrs)for(i in n.attrs)Kk.call(n.attrs,i)&&(r[Sk(e.schema,i).property]=eA(n.attrs[i]));n.startTag;let a=eA(n.startTag),o=n.endTag?eA(n.endTag):void 0,s={opening:a};o&&(s.closing=o),s.properties=r,t.data={position:s}}}return r}function eA(e){let t=tA({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=tA({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function tA(e){return e.line&&e.column?e:void 0}var nA={}.hasOwnProperty;function rA(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&nA.call(t,e)){let n=String(t[e]);i=nA.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var iA={},aA={}.hasOwnProperty,oA=rA(`type`,{handlers:{root:cA,element:pA,text:dA,comment:fA,doctype:uA}});function sA(e,t){let n=(t||iA).space;return oA(e,n===`svg`?Ek:Tk)}function cA(e,t){let n={nodeName:`#document`,mode:(e.data||{}).quirksMode?`quirks`:`no-quirks`,childNodes:[]};return n.childNodes=hA(e.children,n,t),gA(e,n),n}function lA(e,t){let n={nodeName:`#document-fragment`,childNodes:[]};return n.childNodes=hA(e.children,n,t),gA(e,n),n}function uA(e){let t={nodeName:`#documentType`,name:`html`,publicId:``,systemId:``,parentNode:null};return gA(e,t),t}function dA(e){let t={nodeName:`#text`,value:e.value,parentNode:null};return gA(e,t),t}function fA(e){let t={nodeName:`#comment`,data:e.value,parentNode:null};return gA(e,t),t}function pA(e,t){let n=t,r=n;e.type===`element`&&e.tagName.toLowerCase()===`svg`&&n.space===`html`&&(r=Ek);let i=[],a;if(e.properties){for(a in e.properties)if(a!==`children`&&aA.call(e.properties,a)){let t=mA(r,a,e.properties[a]);t&&i.push(t)}}let o=r.space,s={nodeName:e.tagName,tagName:e.tagName,attrs:i,namespaceURI:Gk[o],childNodes:[],parentNode:null};return s.childNodes=hA(e.children,s,r),gA(e,s),e.tagName===`template`&&e.content&&(s.content=lA(e.content,r)),s}function mA(e,t,n){let r=Sk(e,t);if(n===!1||n==null||typeof n==`number`&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?Ok(n):Mk(n));let i={name:r.attribute,value:n===!0?``:String(n)};if(r.space&&r.space!==`html`&&r.space!==`svg`){let e=i.name.indexOf(`:`);e<0?i.prefix=``:(i.name=i.name.slice(e+1),i.prefix=r.attribute.slice(0,e)),i.namespace=Gk[r.space]}return i}function hA(e,t,n){let r=-1,i=[];if(e)for(;++r<e.length;){let a=oA(e[r],n);a.parentNode=t,i.push(a)}return i}function gA(e,t){let n=e.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,t.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}var _A=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],vA=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),K;(function(e){e[e.EOF=-1]=`EOF`,e[e.NULL=0]=`NULL`,e[e.TABULATION=9]=`TABULATION`,e[e.CARRIAGE_RETURN=13]=`CARRIAGE_RETURN`,e[e.LINE_FEED=10]=`LINE_FEED`,e[e.FORM_FEED=12]=`FORM_FEED`,e[e.SPACE=32]=`SPACE`,e[e.EXCLAMATION_MARK=33]=`EXCLAMATION_MARK`,e[e.QUOTATION_MARK=34]=`QUOTATION_MARK`,e[e.AMPERSAND=38]=`AMPERSAND`,e[e.APOSTROPHE=39]=`APOSTROPHE`,e[e.HYPHEN_MINUS=45]=`HYPHEN_MINUS`,e[e.SOLIDUS=47]=`SOLIDUS`,e[e.DIGIT_0=48]=`DIGIT_0`,e[e.DIGIT_9=57]=`DIGIT_9`,e[e.SEMICOLON=59]=`SEMICOLON`,e[e.LESS_THAN_SIGN=60]=`LESS_THAN_SIGN`,e[e.EQUALS_SIGN=61]=`EQUALS_SIGN`,e[e.GREATER_THAN_SIGN=62]=`GREATER_THAN_SIGN`,e[e.QUESTION_MARK=63]=`QUESTION_MARK`,e[e.LATIN_CAPITAL_A=65]=`LATIN_CAPITAL_A`,e[e.LATIN_CAPITAL_Z=90]=`LATIN_CAPITAL_Z`,e[e.RIGHT_SQUARE_BRACKET=93]=`RIGHT_SQUARE_BRACKET`,e[e.GRAVE_ACCENT=96]=`GRAVE_ACCENT`,e[e.LATIN_SMALL_A=97]=`LATIN_SMALL_A`,e[e.LATIN_SMALL_Z=122]=`LATIN_SMALL_Z`})(K||={});var yA={DASH_DASH:`--`,CDATA_START:`[CDATA[`,DOCTYPE:`doctype`,SCRIPT:`script`,PUBLIC:`public`,SYSTEM:`system`};function bA(e){return e>=55296&&e<=57343}function xA(e){return e>=56320&&e<=57343}function SA(e,t){return(e-55296)*1024+9216+t}function CA(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function wA(e){return e>=64976&&e<=65007||vA.has(e)}var q;(function(e){e.controlCharacterInInputStream=`control-character-in-input-stream`,e.noncharacterInInputStream=`noncharacter-in-input-stream`,e.surrogateInInputStream=`surrogate-in-input-stream`,e.nonVoidHtmlElementStartTagWithTrailingSolidus=`non-void-html-element-start-tag-with-trailing-solidus`,e.endTagWithAttributes=`end-tag-with-attributes`,e.endTagWithTrailingSolidus=`end-tag-with-trailing-solidus`,e.unexpectedSolidusInTag=`unexpected-solidus-in-tag`,e.unexpectedNullCharacter=`unexpected-null-character`,e.unexpectedQuestionMarkInsteadOfTagName=`unexpected-question-mark-instead-of-tag-name`,e.invalidFirstCharacterOfTagName=`invalid-first-character-of-tag-name`,e.unexpectedEqualsSignBeforeAttributeName=`unexpected-equals-sign-before-attribute-name`,e.missingEndTagName=`missing-end-tag-name`,e.unexpectedCharacterInAttributeName=`unexpected-character-in-attribute-name`,e.unknownNamedCharacterReference=`unknown-named-character-reference`,e.missingSemicolonAfterCharacterReference=`missing-semicolon-after-character-reference`,e.unexpectedCharacterAfterDoctypeSystemIdentifier=`unexpected-character-after-doctype-system-identifier`,e.unexpectedCharacterInUnquotedAttributeValue=`unexpected-character-in-unquoted-attribute-value`,e.eofBeforeTagName=`eof-before-tag-name`,e.eofInTag=`eof-in-tag`,e.missingAttributeValue=`missing-attribute-value`,e.missingWhitespaceBetweenAttributes=`missing-whitespace-between-attributes`,e.missingWhitespaceAfterDoctypePublicKeyword=`missing-whitespace-after-doctype-public-keyword`,e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers=`missing-whitespace-between-doctype-public-and-system-identifiers`,e.missingWhitespaceAfterDoctypeSystemKeyword=`missing-whitespace-after-doctype-system-keyword`,e.missingQuoteBeforeDoctypePublicIdentifier=`missing-quote-before-doctype-public-identifier`,e.missingQuoteBeforeDoctypeSystemIdentifier=`missing-quote-before-doctype-system-identifier`,e.missingDoctypePublicIdentifier=`missing-doctype-public-identifier`,e.missingDoctypeSystemIdentifier=`missing-doctype-system-identifier`,e.abruptDoctypePublicIdentifier=`abrupt-doctype-public-identifier`,e.abruptDoctypeSystemIdentifier=`abrupt-doctype-system-identifier`,e.cdataInHtmlContent=`cdata-in-html-content`,e.incorrectlyOpenedComment=`incorrectly-opened-comment`,e.eofInScriptHtmlCommentLikeText=`eof-in-script-html-comment-like-text`,e.eofInDoctype=`eof-in-doctype`,e.nestedComment=`nested-comment`,e.abruptClosingOfEmptyComment=`abrupt-closing-of-empty-comment`,e.eofInComment=`eof-in-comment`,e.incorrectlyClosedComment=`incorrectly-closed-comment`,e.eofInCdata=`eof-in-cdata`,e.absenceOfDigitsInNumericCharacterReference=`absence-of-digits-in-numeric-character-reference`,e.nullCharacterReference=`null-character-reference`,e.surrogateCharacterReference=`surrogate-character-reference`,e.characterReferenceOutsideUnicodeRange=`character-reference-outside-unicode-range`,e.controlCharacterReference=`control-character-reference`,e.noncharacterCharacterReference=`noncharacter-character-reference`,e.missingWhitespaceBeforeDoctypeName=`missing-whitespace-before-doctype-name`,e.missingDoctypeName=`missing-doctype-name`,e.invalidCharacterSequenceAfterDoctypeName=`invalid-character-sequence-after-doctype-name`,e.duplicateAttribute=`duplicate-attribute`,e.nonConformingDoctype=`non-conforming-doctype`,e.missingDoctype=`missing-doctype`,e.misplacedDoctype=`misplaced-doctype`,e.endTagWithoutMatchingOpenElement=`end-tag-without-matching-open-element`,e.closingOfElementWithOpenChildElements=`closing-of-element-with-open-child-elements`,e.disallowedContentInNoscriptInHead=`disallowed-content-in-noscript-in-head`,e.openElementsLeftAfterEof=`open-elements-left-after-eof`,e.abandonedHeadElementChild=`abandoned-head-element-child`,e.misplacedStartTagForHeadElement=`misplaced-start-tag-for-head-element`,e.nestedNoscriptInHead=`nested-noscript-in-head`,e.eofInElementThatCanContainOnlyText=`eof-in-element-that-can-contain-only-text`})(q||={});var TA=65536,EA=class{constructor(e){this.handler=e,this.html=``,this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=TA,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+Number(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e,t){let{line:n,col:r,offset:i}=this,a=r+t,o=i+t;return{code:e,startLine:n,endLine:n,startCol:a,endCol:a,startOffset:o,endOffset:o}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){let t=this.html.charCodeAt(this.pos+1);if(xA(t))return this.pos++,this._addGap(),SA(e,t)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,K.EOF;return this._err(q.surrogateInInputStream),e}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(e,t){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=t}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,t){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(t)return this.html.startsWith(e,this.pos);for(let t=0;t<e.length;t++)if((this.html.charCodeAt(this.pos+t)|32)!==e.charCodeAt(t))return!1;return!0}peek(e){let t=this.pos+e;if(t>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,K.EOF;let n=this.html.charCodeAt(t);return n===K.CARRIAGE_RETURN?K.LINE_FEED:n}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,K.EOF;let e=this.html.charCodeAt(this.pos);return e===K.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,K.LINE_FEED):e===K.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,bA(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===K.LINE_FEED||e===K.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){CA(e)?this._err(q.controlCharacterInInputStream):wA(e)&&this._err(q.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}},DA;(function(e){e[e.CHARACTER=0]=`CHARACTER`,e[e.NULL_CHARACTER=1]=`NULL_CHARACTER`,e[e.WHITESPACE_CHARACTER=2]=`WHITESPACE_CHARACTER`,e[e.START_TAG=3]=`START_TAG`,e[e.END_TAG=4]=`END_TAG`,e[e.COMMENT=5]=`COMMENT`,e[e.DOCTYPE=6]=`DOCTYPE`,e[e.EOF=7]=`EOF`,e[e.HIBERNATION=8]=`HIBERNATION`})(DA||={});function OA(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}var kA=new Uint16Array(`ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻\xA0ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌`.split(``).map(e=>e.charCodeAt(0))),AA=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);String.fromCodePoint;function jA(e){return e>=55296&&e<=57343||e>1114111?65533:AA.get(e)??e}var MA;(function(e){e[e.NUM=35]=`NUM`,e[e.SEMI=59]=`SEMI`,e[e.EQUALS=61]=`EQUALS`,e[e.ZERO=48]=`ZERO`,e[e.NINE=57]=`NINE`,e[e.LOWER_A=97]=`LOWER_A`,e[e.LOWER_F=102]=`LOWER_F`,e[e.LOWER_X=120]=`LOWER_X`,e[e.LOWER_Z=122]=`LOWER_Z`,e[e.UPPER_A=65]=`UPPER_A`,e[e.UPPER_F=70]=`UPPER_F`,e[e.UPPER_Z=90]=`UPPER_Z`})(MA||={});var NA=32,PA;(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.BRANCH_LENGTH=16256]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`})(PA||={});function FA(e){return e>=MA.ZERO&&e<=MA.NINE}function IA(e){return e>=MA.UPPER_A&&e<=MA.UPPER_F||e>=MA.LOWER_A&&e<=MA.LOWER_F}function LA(e){return e>=MA.UPPER_A&&e<=MA.UPPER_Z||e>=MA.LOWER_A&&e<=MA.LOWER_Z||FA(e)}function RA(e){return e===MA.EQUALS||LA(e)}var zA;(function(e){e[e.EntityStart=0]=`EntityStart`,e[e.NumericStart=1]=`NumericStart`,e[e.NumericDecimal=2]=`NumericDecimal`,e[e.NumericHex=3]=`NumericHex`,e[e.NamedEntity=4]=`NamedEntity`})(zA||={});var BA;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(BA||={});var VA=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=zA.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=BA.Strict}startEntity(e){this.decodeMode=e,this.state=zA.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case zA.EntityStart:return e.charCodeAt(t)===MA.NUM?(this.state=zA.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=zA.NamedEntity,this.stateNamedEntity(e,t));case zA.NumericStart:return this.stateNumericStart(e,t);case zA.NumericDecimal:return this.stateNumericDecimal(e,t);case zA.NumericHex:return this.stateNumericHex(e,t);case zA.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|NA)===MA.LOWER_X?(this.state=zA.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=zA.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,r){if(t!==n){let i=n-t;this.result=this.result*r**+i+Number.parseInt(e.substr(t,i),r),this.consumed+=i}}stateNumericHex(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(FA(r)||IA(r))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(FA(r))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)==null||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===MA.SEMI)this.consumed+=1;else if(this.decodeMode===BA.Strict)return 0;return this.emitCodePoint(jA(this.result),this.consumed),this.errors&&(e!==MA.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){let{decodeTree:n}=this,r=n[this.treeIndex],i=(r&PA.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){let a=e.charCodeAt(t);if(this.treeIndex=HA(n,r,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===BA.Attribute&&(i===0||RA(a))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&PA.VALUE_LENGTH)>>14,i!==0){if(a===MA.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==BA.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;let{result:t,decodeTree:n}=this,r=(n[t]&PA.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),(e=this.errors)==null||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){let{decodeTree:r}=this;return this.emitCodePoint(t===1?r[e]&~PA.VALUE_LENGTH:r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case zA.NamedEntity:return this.result!==0&&(this.decodeMode!==BA.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case zA.NumericDecimal:return this.emitNumericEntity(0,2);case zA.NumericHex:return this.emitNumericEntity(0,3);case zA.NumericStart:return(e=this.errors)==null||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case zA.EntityStart:return 0}}};function HA(e,t,n,r){let i=(t&PA.BRANCH_LENGTH)>>7,a=t&PA.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){let t=r-a;return t<0||t>=i?-1:e[n+t]-1}let o=n,s=o+i-1;for(;o<=s;){let t=o+s>>>1,n=e[t];if(n<r)o=t+1;else if(n>r)s=t-1;else return e[t+i]}return-1}var J;(function(e){e.HTML=`http://www.w3.org/1999/xhtml`,e.MATHML=`http://www.w3.org/1998/Math/MathML`,e.SVG=`http://www.w3.org/2000/svg`,e.XLINK=`http://www.w3.org/1999/xlink`,e.XML=`http://www.w3.org/XML/1998/namespace`,e.XMLNS=`http://www.w3.org/2000/xmlns/`})(J||={});var UA;(function(e){e.TYPE=`type`,e.ACTION=`action`,e.ENCODING=`encoding`,e.PROMPT=`prompt`,e.NAME=`name`,e.COLOR=`color`,e.FACE=`face`,e.SIZE=`size`})(UA||={});var WA;(function(e){e.NO_QUIRKS=`no-quirks`,e.QUIRKS=`quirks`,e.LIMITED_QUIRKS=`limited-quirks`})(WA||={});var Y;(function(e){e.A=`a`,e.ADDRESS=`address`,e.ANNOTATION_XML=`annotation-xml`,e.APPLET=`applet`,e.AREA=`area`,e.ARTICLE=`article`,e.ASIDE=`aside`,e.B=`b`,e.BASE=`base`,e.BASEFONT=`basefont`,e.BGSOUND=`bgsound`,e.BIG=`big`,e.BLOCKQUOTE=`blockquote`,e.BODY=`body`,e.BR=`br`,e.BUTTON=`button`,e.CAPTION=`caption`,e.CENTER=`center`,e.CODE=`code`,e.COL=`col`,e.COLGROUP=`colgroup`,e.DD=`dd`,e.DESC=`desc`,e.DETAILS=`details`,e.DIALOG=`dialog`,e.DIR=`dir`,e.DIV=`div`,e.DL=`dl`,e.DT=`dt`,e.EM=`em`,e.EMBED=`embed`,e.FIELDSET=`fieldset`,e.FIGCAPTION=`figcaption`,e.FIGURE=`figure`,e.FONT=`font`,e.FOOTER=`footer`,e.FOREIGN_OBJECT=`foreignObject`,e.FORM=`form`,e.FRAME=`frame`,e.FRAMESET=`frameset`,e.H1=`h1`,e.H2=`h2`,e.H3=`h3`,e.H4=`h4`,e.H5=`h5`,e.H6=`h6`,e.HEAD=`head`,e.HEADER=`header`,e.HGROUP=`hgroup`,e.HR=`hr`,e.HTML=`html`,e.I=`i`,e.IMG=`img`,e.IMAGE=`image`,e.INPUT=`input`,e.IFRAME=`iframe`,e.KEYGEN=`keygen`,e.LABEL=`label`,e.LI=`li`,e.LINK=`link`,e.LISTING=`listing`,e.MAIN=`main`,e.MALIGNMARK=`malignmark`,e.MARQUEE=`marquee`,e.MATH=`math`,e.MENU=`menu`,e.META=`meta`,e.MGLYPH=`mglyph`,e.MI=`mi`,e.MO=`mo`,e.MN=`mn`,e.MS=`ms`,e.MTEXT=`mtext`,e.NAV=`nav`,e.NOBR=`nobr`,e.NOFRAMES=`noframes`,e.NOEMBED=`noembed`,e.NOSCRIPT=`noscript`,e.OBJECT=`object`,e.OL=`ol`,e.OPTGROUP=`optgroup`,e.OPTION=`option`,e.P=`p`,e.PARAM=`param`,e.PLAINTEXT=`plaintext`,e.PRE=`pre`,e.RB=`rb`,e.RP=`rp`,e.RT=`rt`,e.RTC=`rtc`,e.RUBY=`ruby`,e.S=`s`,e.SCRIPT=`script`,e.SEARCH=`search`,e.SECTION=`section`,e.SELECT=`select`,e.SOURCE=`source`,e.SMALL=`small`,e.SPAN=`span`,e.STRIKE=`strike`,e.STRONG=`strong`,e.STYLE=`style`,e.SUB=`sub`,e.SUMMARY=`summary`,e.SUP=`sup`,e.TABLE=`table`,e.TBODY=`tbody`,e.TEMPLATE=`template`,e.TEXTAREA=`textarea`,e.TFOOT=`tfoot`,e.TD=`td`,e.TH=`th`,e.THEAD=`thead`,e.TITLE=`title`,e.TR=`tr`,e.TRACK=`track`,e.TT=`tt`,e.U=`u`,e.UL=`ul`,e.SVG=`svg`,e.VAR=`var`,e.WBR=`wbr`,e.XMP=`xmp`})(Y||={});var X;(function(e){e[e.UNKNOWN=0]=`UNKNOWN`,e[e.A=1]=`A`,e[e.ADDRESS=2]=`ADDRESS`,e[e.ANNOTATION_XML=3]=`ANNOTATION_XML`,e[e.APPLET=4]=`APPLET`,e[e.AREA=5]=`AREA`,e[e.ARTICLE=6]=`ARTICLE`,e[e.ASIDE=7]=`ASIDE`,e[e.B=8]=`B`,e[e.BASE=9]=`BASE`,e[e.BASEFONT=10]=`BASEFONT`,e[e.BGSOUND=11]=`BGSOUND`,e[e.BIG=12]=`BIG`,e[e.BLOCKQUOTE=13]=`BLOCKQUOTE`,e[e.BODY=14]=`BODY`,e[e.BR=15]=`BR`,e[e.BUTTON=16]=`BUTTON`,e[e.CAPTION=17]=`CAPTION`,e[e.CENTER=18]=`CENTER`,e[e.CODE=19]=`CODE`,e[e.COL=20]=`COL`,e[e.COLGROUP=21]=`COLGROUP`,e[e.DD=22]=`DD`,e[e.DESC=23]=`DESC`,e[e.DETAILS=24]=`DETAILS`,e[e.DIALOG=25]=`DIALOG`,e[e.DIR=26]=`DIR`,e[e.DIV=27]=`DIV`,e[e.DL=28]=`DL`,e[e.DT=29]=`DT`,e[e.EM=30]=`EM`,e[e.EMBED=31]=`EMBED`,e[e.FIELDSET=32]=`FIELDSET`,e[e.FIGCAPTION=33]=`FIGCAPTION`,e[e.FIGURE=34]=`FIGURE`,e[e.FONT=35]=`FONT`,e[e.FOOTER=36]=`FOOTER`,e[e.FOREIGN_OBJECT=37]=`FOREIGN_OBJECT`,e[e.FORM=38]=`FORM`,e[e.FRAME=39]=`FRAME`,e[e.FRAMESET=40]=`FRAMESET`,e[e.H1=41]=`H1`,e[e.H2=42]=`H2`,e[e.H3=43]=`H3`,e[e.H4=44]=`H4`,e[e.H5=45]=`H5`,e[e.H6=46]=`H6`,e[e.HEAD=47]=`HEAD`,e[e.HEADER=48]=`HEADER`,e[e.HGROUP=49]=`HGROUP`,e[e.HR=50]=`HR`,e[e.HTML=51]=`HTML`,e[e.I=52]=`I`,e[e.IMG=53]=`IMG`,e[e.IMAGE=54]=`IMAGE`,e[e.INPUT=55]=`INPUT`,e[e.IFRAME=56]=`IFRAME`,e[e.KEYGEN=57]=`KEYGEN`,e[e.LABEL=58]=`LABEL`,e[e.LI=59]=`LI`,e[e.LINK=60]=`LINK`,e[e.LISTING=61]=`LISTING`,e[e.MAIN=62]=`MAIN`,e[e.MALIGNMARK=63]=`MALIGNMARK`,e[e.MARQUEE=64]=`MARQUEE`,e[e.MATH=65]=`MATH`,e[e.MENU=66]=`MENU`,e[e.META=67]=`META`,e[e.MGLYPH=68]=`MGLYPH`,e[e.MI=69]=`MI`,e[e.MO=70]=`MO`,e[e.MN=71]=`MN`,e[e.MS=72]=`MS`,e[e.MTEXT=73]=`MTEXT`,e[e.NAV=74]=`NAV`,e[e.NOBR=75]=`NOBR`,e[e.NOFRAMES=76]=`NOFRAMES`,e[e.NOEMBED=77]=`NOEMBED`,e[e.NOSCRIPT=78]=`NOSCRIPT`,e[e.OBJECT=79]=`OBJECT`,e[e.OL=80]=`OL`,e[e.OPTGROUP=81]=`OPTGROUP`,e[e.OPTION=82]=`OPTION`,e[e.P=83]=`P`,e[e.PARAM=84]=`PARAM`,e[e.PLAINTEXT=85]=`PLAINTEXT`,e[e.PRE=86]=`PRE`,e[e.RB=87]=`RB`,e[e.RP=88]=`RP`,e[e.RT=89]=`RT`,e[e.RTC=90]=`RTC`,e[e.RUBY=91]=`RUBY`,e[e.S=92]=`S`,e[e.SCRIPT=93]=`SCRIPT`,e[e.SEARCH=94]=`SEARCH`,e[e.SECTION=95]=`SECTION`,e[e.SELECT=96]=`SELECT`,e[e.SOURCE=97]=`SOURCE`,e[e.SMALL=98]=`SMALL`,e[e.SPAN=99]=`SPAN`,e[e.STRIKE=100]=`STRIKE`,e[e.STRONG=101]=`STRONG`,e[e.STYLE=102]=`STYLE`,e[e.SUB=103]=`SUB`,e[e.SUMMARY=104]=`SUMMARY`,e[e.SUP=105]=`SUP`,e[e.TABLE=106]=`TABLE`,e[e.TBODY=107]=`TBODY`,e[e.TEMPLATE=108]=`TEMPLATE`,e[e.TEXTAREA=109]=`TEXTAREA`,e[e.TFOOT=110]=`TFOOT`,e[e.TD=111]=`TD`,e[e.TH=112]=`TH`,e[e.THEAD=113]=`THEAD`,e[e.TITLE=114]=`TITLE`,e[e.TR=115]=`TR`,e[e.TRACK=116]=`TRACK`,e[e.TT=117]=`TT`,e[e.U=118]=`U`,e[e.UL=119]=`UL`,e[e.SVG=120]=`SVG`,e[e.VAR=121]=`VAR`,e[e.WBR=122]=`WBR`,e[e.XMP=123]=`XMP`})(X||={});var GA=new Map([[Y.A,X.A],[Y.ADDRESS,X.ADDRESS],[Y.ANNOTATION_XML,X.ANNOTATION_XML],[Y.APPLET,X.APPLET],[Y.AREA,X.AREA],[Y.ARTICLE,X.ARTICLE],[Y.ASIDE,X.ASIDE],[Y.B,X.B],[Y.BASE,X.BASE],[Y.BASEFONT,X.BASEFONT],[Y.BGSOUND,X.BGSOUND],[Y.BIG,X.BIG],[Y.BLOCKQUOTE,X.BLOCKQUOTE],[Y.BODY,X.BODY],[Y.BR,X.BR],[Y.BUTTON,X.BUTTON],[Y.CAPTION,X.CAPTION],[Y.CENTER,X.CENTER],[Y.CODE,X.CODE],[Y.COL,X.COL],[Y.COLGROUP,X.COLGROUP],[Y.DD,X.DD],[Y.DESC,X.DESC],[Y.DETAILS,X.DETAILS],[Y.DIALOG,X.DIALOG],[Y.DIR,X.DIR],[Y.DIV,X.DIV],[Y.DL,X.DL],[Y.DT,X.DT],[Y.EM,X.EM],[Y.EMBED,X.EMBED],[Y.FIELDSET,X.FIELDSET],[Y.FIGCAPTION,X.FIGCAPTION],[Y.FIGURE,X.FIGURE],[Y.FONT,X.FONT],[Y.FOOTER,X.FOOTER],[Y.FOREIGN_OBJECT,X.FOREIGN_OBJECT],[Y.FORM,X.FORM],[Y.FRAME,X.FRAME],[Y.FRAMESET,X.FRAMESET],[Y.H1,X.H1],[Y.H2,X.H2],[Y.H3,X.H3],[Y.H4,X.H4],[Y.H5,X.H5],[Y.H6,X.H6],[Y.HEAD,X.HEAD],[Y.HEADER,X.HEADER],[Y.HGROUP,X.HGROUP],[Y.HR,X.HR],[Y.HTML,X.HTML],[Y.I,X.I],[Y.IMG,X.IMG],[Y.IMAGE,X.IMAGE],[Y.INPUT,X.INPUT],[Y.IFRAME,X.IFRAME],[Y.KEYGEN,X.KEYGEN],[Y.LABEL,X.LABEL],[Y.LI,X.LI],[Y.LINK,X.LINK],[Y.LISTING,X.LISTING],[Y.MAIN,X.MAIN],[Y.MALIGNMARK,X.MALIGNMARK],[Y.MARQUEE,X.MARQUEE],[Y.MATH,X.MATH],[Y.MENU,X.MENU],[Y.META,X.META],[Y.MGLYPH,X.MGLYPH],[Y.MI,X.MI],[Y.MO,X.MO],[Y.MN,X.MN],[Y.MS,X.MS],[Y.MTEXT,X.MTEXT],[Y.NAV,X.NAV],[Y.NOBR,X.NOBR],[Y.NOFRAMES,X.NOFRAMES],[Y.NOEMBED,X.NOEMBED],[Y.NOSCRIPT,X.NOSCRIPT],[Y.OBJECT,X.OBJECT],[Y.OL,X.OL],[Y.OPTGROUP,X.OPTGROUP],[Y.OPTION,X.OPTION],[Y.P,X.P],[Y.PARAM,X.PARAM],[Y.PLAINTEXT,X.PLAINTEXT],[Y.PRE,X.PRE],[Y.RB,X.RB],[Y.RP,X.RP],[Y.RT,X.RT],[Y.RTC,X.RTC],[Y.RUBY,X.RUBY],[Y.S,X.S],[Y.SCRIPT,X.SCRIPT],[Y.SEARCH,X.SEARCH],[Y.SECTION,X.SECTION],[Y.SELECT,X.SELECT],[Y.SOURCE,X.SOURCE],[Y.SMALL,X.SMALL],[Y.SPAN,X.SPAN],[Y.STRIKE,X.STRIKE],[Y.STRONG,X.STRONG],[Y.STYLE,X.STYLE],[Y.SUB,X.SUB],[Y.SUMMARY,X.SUMMARY],[Y.SUP,X.SUP],[Y.TABLE,X.TABLE],[Y.TBODY,X.TBODY],[Y.TEMPLATE,X.TEMPLATE],[Y.TEXTAREA,X.TEXTAREA],[Y.TFOOT,X.TFOOT],[Y.TD,X.TD],[Y.TH,X.TH],[Y.THEAD,X.THEAD],[Y.TITLE,X.TITLE],[Y.TR,X.TR],[Y.TRACK,X.TRACK],[Y.TT,X.TT],[Y.U,X.U],[Y.UL,X.UL],[Y.SVG,X.SVG],[Y.VAR,X.VAR],[Y.WBR,X.WBR],[Y.XMP,X.XMP]]);function KA(e){return GA.get(e)??X.UNKNOWN}var Z=X,qA={[J.HTML]:new Set([Z.ADDRESS,Z.APPLET,Z.AREA,Z.ARTICLE,Z.ASIDE,Z.BASE,Z.BASEFONT,Z.BGSOUND,Z.BLOCKQUOTE,Z.BODY,Z.BR,Z.BUTTON,Z.CAPTION,Z.CENTER,Z.COL,Z.COLGROUP,Z.DD,Z.DETAILS,Z.DIR,Z.DIV,Z.DL,Z.DT,Z.EMBED,Z.FIELDSET,Z.FIGCAPTION,Z.FIGURE,Z.FOOTER,Z.FORM,Z.FRAME,Z.FRAMESET,Z.H1,Z.H2,Z.H3,Z.H4,Z.H5,Z.H6,Z.HEAD,Z.HEADER,Z.HGROUP,Z.HR,Z.HTML,Z.IFRAME,Z.IMG,Z.INPUT,Z.LI,Z.LINK,Z.LISTING,Z.MAIN,Z.MARQUEE,Z.MENU,Z.META,Z.NAV,Z.NOEMBED,Z.NOFRAMES,Z.NOSCRIPT,Z.OBJECT,Z.OL,Z.P,Z.PARAM,Z.PLAINTEXT,Z.PRE,Z.SCRIPT,Z.SECTION,Z.SELECT,Z.SOURCE,Z.STYLE,Z.SUMMARY,Z.TABLE,Z.TBODY,Z.TD,Z.TEMPLATE,Z.TEXTAREA,Z.TFOOT,Z.TH,Z.THEAD,Z.TITLE,Z.TR,Z.TRACK,Z.UL,Z.WBR,Z.XMP]),[J.MATHML]:new Set([Z.MI,Z.MO,Z.MN,Z.MS,Z.MTEXT,Z.ANNOTATION_XML]),[J.SVG]:new Set([Z.TITLE,Z.FOREIGN_OBJECT,Z.DESC]),[J.XLINK]:new Set,[J.XML]:new Set,[J.XMLNS]:new Set},JA=new Set([Z.H1,Z.H2,Z.H3,Z.H4,Z.H5,Z.H6]);Y.STYLE,Y.SCRIPT,Y.XMP,Y.IFRAME,Y.NOEMBED,Y.NOFRAMES,Y.PLAINTEXT;var Q;(function(e){e[e.DATA=0]=`DATA`,e[e.RCDATA=1]=`RCDATA`,e[e.RAWTEXT=2]=`RAWTEXT`,e[e.SCRIPT_DATA=3]=`SCRIPT_DATA`,e[e.PLAINTEXT=4]=`PLAINTEXT`,e[e.TAG_OPEN=5]=`TAG_OPEN`,e[e.END_TAG_OPEN=6]=`END_TAG_OPEN`,e[e.TAG_NAME=7]=`TAG_NAME`,e[e.RCDATA_LESS_THAN_SIGN=8]=`RCDATA_LESS_THAN_SIGN`,e[e.RCDATA_END_TAG_OPEN=9]=`RCDATA_END_TAG_OPEN`,e[e.RCDATA_END_TAG_NAME=10]=`RCDATA_END_TAG_NAME`,e[e.RAWTEXT_LESS_THAN_SIGN=11]=`RAWTEXT_LESS_THAN_SIGN`,e[e.RAWTEXT_END_TAG_OPEN=12]=`RAWTEXT_END_TAG_OPEN`,e[e.RAWTEXT_END_TAG_NAME=13]=`RAWTEXT_END_TAG_NAME`,e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]=`SCRIPT_DATA_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_END_TAG_OPEN=15]=`SCRIPT_DATA_END_TAG_OPEN`,e[e.SCRIPT_DATA_END_TAG_NAME=16]=`SCRIPT_DATA_END_TAG_NAME`,e[e.SCRIPT_DATA_ESCAPE_START=17]=`SCRIPT_DATA_ESCAPE_START`,e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]=`SCRIPT_DATA_ESCAPE_START_DASH`,e[e.SCRIPT_DATA_ESCAPED=19]=`SCRIPT_DATA_ESCAPED`,e[e.SCRIPT_DATA_ESCAPED_DASH=20]=`SCRIPT_DATA_ESCAPED_DASH`,e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]=`SCRIPT_DATA_ESCAPED_DASH_DASH`,e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]=`SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]=`SCRIPT_DATA_ESCAPED_END_TAG_OPEN`,e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]=`SCRIPT_DATA_ESCAPED_END_TAG_NAME`,e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]=`SCRIPT_DATA_DOUBLE_ESCAPE_START`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]=`SCRIPT_DATA_DOUBLE_ESCAPED`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]=`SCRIPT_DATA_DOUBLE_ESCAPED_DASH`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]=`SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]=`SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]=`SCRIPT_DATA_DOUBLE_ESCAPE_END`,e[e.BEFORE_ATTRIBUTE_NAME=31]=`BEFORE_ATTRIBUTE_NAME`,e[e.ATTRIBUTE_NAME=32]=`ATTRIBUTE_NAME`,e[e.AFTER_ATTRIBUTE_NAME=33]=`AFTER_ATTRIBUTE_NAME`,e[e.BEFORE_ATTRIBUTE_VALUE=34]=`BEFORE_ATTRIBUTE_VALUE`,e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]=`ATTRIBUTE_VALUE_DOUBLE_QUOTED`,e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]=`ATTRIBUTE_VALUE_SINGLE_QUOTED`,e[e.ATTRIBUTE_VALUE_UNQUOTED=37]=`ATTRIBUTE_VALUE_UNQUOTED`,e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]=`AFTER_ATTRIBUTE_VALUE_QUOTED`,e[e.SELF_CLOSING_START_TAG=39]=`SELF_CLOSING_START_TAG`,e[e.BOGUS_COMMENT=40]=`BOGUS_COMMENT`,e[e.MARKUP_DECLARATION_OPEN=41]=`MARKUP_DECLARATION_OPEN`,e[e.COMMENT_START=42]=`COMMENT_START`,e[e.COMMENT_START_DASH=43]=`COMMENT_START_DASH`,e[e.COMMENT=44]=`COMMENT`,e[e.COMMENT_LESS_THAN_SIGN=45]=`COMMENT_LESS_THAN_SIGN`,e[e.COMMENT_LESS_THAN_SIGN_BANG=46]=`COMMENT_LESS_THAN_SIGN_BANG`,e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]=`COMMENT_LESS_THAN_SIGN_BANG_DASH`,e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]=`COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH`,e[e.COMMENT_END_DASH=49]=`COMMENT_END_DASH`,e[e.COMMENT_END=50]=`COMMENT_END`,e[e.COMMENT_END_BANG=51]=`COMMENT_END_BANG`,e[e.DOCTYPE=52]=`DOCTYPE`,e[e.BEFORE_DOCTYPE_NAME=53]=`BEFORE_DOCTYPE_NAME`,e[e.DOCTYPE_NAME=54]=`DOCTYPE_NAME`,e[e.AFTER_DOCTYPE_NAME=55]=`AFTER_DOCTYPE_NAME`,e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]=`AFTER_DOCTYPE_PUBLIC_KEYWORD`,e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]=`BEFORE_DOCTYPE_PUBLIC_IDENTIFIER`,e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]=`DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED`,e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]=`DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED`,e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]=`AFTER_DOCTYPE_PUBLIC_IDENTIFIER`,e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]=`BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS`,e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]=`AFTER_DOCTYPE_SYSTEM_KEYWORD`,e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]=`BEFORE_DOCTYPE_SYSTEM_IDENTIFIER`,e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]=`DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED`,e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]=`DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED`,e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]=`AFTER_DOCTYPE_SYSTEM_IDENTIFIER`,e[e.BOGUS_DOCTYPE=67]=`BOGUS_DOCTYPE`,e[e.CDATA_SECTION=68]=`CDATA_SECTION`,e[e.CDATA_SECTION_BRACKET=69]=`CDATA_SECTION_BRACKET`,e[e.CDATA_SECTION_END=70]=`CDATA_SECTION_END`,e[e.CHARACTER_REFERENCE=71]=`CHARACTER_REFERENCE`,e[e.AMBIGUOUS_AMPERSAND=72]=`AMBIGUOUS_AMPERSAND`})(Q||={});var YA={DATA:Q.DATA,RCDATA:Q.RCDATA,RAWTEXT:Q.RAWTEXT,SCRIPT_DATA:Q.SCRIPT_DATA,PLAINTEXT:Q.PLAINTEXT,CDATA_SECTION:Q.CDATA_SECTION};function XA(e){return e>=K.DIGIT_0&&e<=K.DIGIT_9}function ZA(e){return e>=K.LATIN_CAPITAL_A&&e<=K.LATIN_CAPITAL_Z}function QA(e){return e>=K.LATIN_SMALL_A&&e<=K.LATIN_SMALL_Z}function $A(e){return QA(e)||ZA(e)}function ej(e){return $A(e)||XA(e)}function tj(e){return e+32}function nj(e){return e===K.SPACE||e===K.LINE_FEED||e===K.TABULATION||e===K.FORM_FEED}function rj(e){return nj(e)||e===K.SOLIDUS||e===K.GREATER_THAN_SIGN}function ij(e){return e===K.NULL?q.nullCharacterReference:e>1114111?q.characterReferenceOutsideUnicodeRange:bA(e)?q.surrogateCharacterReference:wA(e)?q.noncharacterCharacterReference:CA(e)||e===K.CARRIAGE_RETURN?q.controlCharacterReference:null}var aj=class{constructor(e,t){this.options=e,this.handler=t,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName=``,this.active=!1,this.state=Q.DATA,this.returnState=Q.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:``,value:``},this.preprocessor=new EA(t),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new VA(kA,(e,t)=>{this.preprocessor.pos=this.entityStartPos+t-1,this._flushCodePointConsumedAsCharacterReference(e)},t.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(q.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:e=>{this._err(q.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+e)},validateNumericCharacterReference:e=>{let t=ij(e);t&&this._err(t,1)}}:void 0)}_err(e,t=0){var n,r;(r=(n=this.handler).onParseError)==null||r.call(n,this.preprocessor.getError(e,t))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;let e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw Error(`Parser was already resumed`);this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||e?.())}write(e,t,n){this.active=!0,this.preprocessor.write(e,t),this._runParsingLoop(),this.paused||n?.()}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(e){this.consumedAfterSnapshot+=e;for(let t=0;t<e;t++)this.preprocessor.advance()}_consumeSequenceIfMatch(e,t){return this.preprocessor.startsWith(e,t)?(this._advanceBy(e.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:DA.START_TAG,tagName:``,tagID:X.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:DA.END_TAG,tagName:``,tagID:X.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:DA.COMMENT,data:``,location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:DA.DOCTYPE,name:e,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(e,t){this.currentCharacterToken={type:e,chars:t,location:this.currentLocation}}_createAttr(e){this.currentAttr={name:e,value:``},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var e;let t=this.currentToken;if(OA(t,this.currentAttr.name)===null){if(t.attrs.push(this.currentAttr),t.location&&this.currentLocation){let n=(e=t.location).attrs??(e.attrs=Object.create(null));n[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(q.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(e){this._emitCurrentCharacterToken(e.location),this.currentToken=null,e.location&&(e.location.endLine=this.preprocessor.line,e.location.endCol=this.preprocessor.col+1,e.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){let e=this.currentToken;this.prepareToken(e),e.tagID=KA(e.tagName),e.type===DA.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(q.endTagWithAttributes),e.selfClosing&&this._err(q.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case DA.CHARACTER:this.handler.onCharacter(this.currentCharacterToken);break;case DA.NULL_CHARACTER:this.handler.onNullCharacter(this.currentCharacterToken);break;case DA.WHITESPACE_CHARACTER:this.handler.onWhitespaceCharacter(this.currentCharacterToken)}this.currentCharacterToken=null}}_emitEOFToken(){let e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:DA.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,t){if(this.currentCharacterToken){if(this.currentCharacterToken.type===e){this.currentCharacterToken.chars+=t;return}this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk()}this._createCharacterToken(e,t)}_emitCodePoint(e){let t=nj(e)?DA.WHITESPACE_CHARACTER:e===K.NULL?DA.NULL_CHARACTER:DA.CHARACTER;this._appendCharToCurrentCharacterToken(t,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(DA.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=Q.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?BA.Attribute:BA.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===Q.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===Q.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===Q.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case Q.DATA:this._stateData(e);break;case Q.RCDATA:this._stateRcdata(e);break;case Q.RAWTEXT:this._stateRawtext(e);break;case Q.SCRIPT_DATA:this._stateScriptData(e);break;case Q.PLAINTEXT:this._statePlaintext(e);break;case Q.TAG_OPEN:this._stateTagOpen(e);break;case Q.END_TAG_OPEN:this._stateEndTagOpen(e);break;case Q.TAG_NAME:this._stateTagName(e);break;case Q.RCDATA_LESS_THAN_SIGN:this._stateRcdataLessThanSign(e);break;case Q.RCDATA_END_TAG_OPEN:this._stateRcdataEndTagOpen(e);break;case Q.RCDATA_END_TAG_NAME:this._stateRcdataEndTagName(e);break;case Q.RAWTEXT_LESS_THAN_SIGN:this._stateRawtextLessThanSign(e);break;case Q.RAWTEXT_END_TAG_OPEN:this._stateRawtextEndTagOpen(e);break;case Q.RAWTEXT_END_TAG_NAME:this._stateRawtextEndTagName(e);break;case Q.SCRIPT_DATA_LESS_THAN_SIGN:this._stateScriptDataLessThanSign(e);break;case Q.SCRIPT_DATA_END_TAG_OPEN:this._stateScriptDataEndTagOpen(e);break;case Q.SCRIPT_DATA_END_TAG_NAME:this._stateScriptDataEndTagName(e);break;case Q.SCRIPT_DATA_ESCAPE_START:this._stateScriptDataEscapeStart(e);break;case Q.SCRIPT_DATA_ESCAPE_START_DASH:this._stateScriptDataEscapeStartDash(e);break;case Q.SCRIPT_DATA_ESCAPED:this._stateScriptDataEscaped(e);break;case Q.SCRIPT_DATA_ESCAPED_DASH:this._stateScriptDataEscapedDash(e);break;case Q.SCRIPT_DATA_ESCAPED_DASH_DASH:this._stateScriptDataEscapedDashDash(e);break;case Q.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataEscapedLessThanSign(e);break;case Q.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:this._stateScriptDataEscapedEndTagOpen(e);break;case Q.SCRIPT_DATA_ESCAPED_END_TAG_NAME:this._stateScriptDataEscapedEndTagName(e);break;case Q.SCRIPT_DATA_DOUBLE_ESCAPE_START:this._stateScriptDataDoubleEscapeStart(e);break;case Q.SCRIPT_DATA_DOUBLE_ESCAPED:this._stateScriptDataDoubleEscaped(e);break;case Q.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:this._stateScriptDataDoubleEscapedDash(e);break;case Q.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:this._stateScriptDataDoubleEscapedDashDash(e);break;case Q.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataDoubleEscapedLessThanSign(e);break;case Q.SCRIPT_DATA_DOUBLE_ESCAPE_END:this._stateScriptDataDoubleEscapeEnd(e);break;case Q.BEFORE_ATTRIBUTE_NAME:this._stateBeforeAttributeName(e);break;case Q.ATTRIBUTE_NAME:this._stateAttributeName(e);break;case Q.AFTER_ATTRIBUTE_NAME:this._stateAfterAttributeName(e);break;case Q.BEFORE_ATTRIBUTE_VALUE:this._stateBeforeAttributeValue(e);break;case Q.ATTRIBUTE_VALUE_DOUBLE_QUOTED:this._stateAttributeValueDoubleQuoted(e);break;case Q.ATTRIBUTE_VALUE_SINGLE_QUOTED:this._stateAttributeValueSingleQuoted(e);break;case Q.ATTRIBUTE_VALUE_UNQUOTED:this._stateAttributeValueUnquoted(e);break;case Q.AFTER_ATTRIBUTE_VALUE_QUOTED:this._stateAfterAttributeValueQuoted(e);break;case Q.SELF_CLOSING_START_TAG:this._stateSelfClosingStartTag(e);break;case Q.BOGUS_COMMENT:this._stateBogusComment(e);break;case Q.MARKUP_DECLARATION_OPEN:this._stateMarkupDeclarationOpen(e);break;case Q.COMMENT_START:this._stateCommentStart(e);break;case Q.COMMENT_START_DASH:this._stateCommentStartDash(e);break;case Q.COMMENT:this._stateComment(e);break;case Q.COMMENT_LESS_THAN_SIGN:this._stateCommentLessThanSign(e);break;case Q.COMMENT_LESS_THAN_SIGN_BANG:this._stateCommentLessThanSignBang(e);break;case Q.COMMENT_LESS_THAN_SIGN_BANG_DASH:this._stateCommentLessThanSignBangDash(e);break;case Q.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:this._stateCommentLessThanSignBangDashDash(e);break;case Q.COMMENT_END_DASH:this._stateCommentEndDash(e);break;case Q.COMMENT_END:this._stateCommentEnd(e);break;case Q.COMMENT_END_BANG:this._stateCommentEndBang(e);break;case Q.DOCTYPE:this._stateDoctype(e);break;case Q.BEFORE_DOCTYPE_NAME:this._stateBeforeDoctypeName(e);break;case Q.DOCTYPE_NAME:this._stateDoctypeName(e);break;case Q.AFTER_DOCTYPE_NAME:this._stateAfterDoctypeName(e);break;case Q.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._stateAfterDoctypePublicKeyword(e);break;case Q.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:this._stateBeforeDoctypePublicIdentifier(e);break;case Q.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypePublicIdentifierDoubleQuoted(e);break;case Q.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypePublicIdentifierSingleQuoted(e);break;case Q.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:this._stateAfterDoctypePublicIdentifier(e);break;case Q.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break;case Q.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._stateAfterDoctypeSystemKeyword(e);break;case Q.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:this._stateBeforeDoctypeSystemIdentifier(e);break;case Q.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypeSystemIdentifierDoubleQuoted(e);break;case Q.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypeSystemIdentifierSingleQuoted(e);break;case Q.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:this._stateAfterDoctypeSystemIdentifier(e);break;case Q.BOGUS_DOCTYPE:this._stateBogusDoctype(e);break;case Q.CDATA_SECTION:this._stateCdataSection(e);break;case Q.CDATA_SECTION_BRACKET:this._stateCdataSectionBracket(e);break;case Q.CDATA_SECTION_END:this._stateCdataSectionEnd(e);break;case Q.CHARACTER_REFERENCE:this._stateCharacterReference();break;case Q.AMBIGUOUS_AMPERSAND:this._stateAmbiguousAmpersand(e);break;default:throw Error(`Unknown state`)}}_stateData(e){switch(e){case K.LESS_THAN_SIGN:this.state=Q.TAG_OPEN;break;case K.AMPERSAND:this._startCharacterReference();break;case K.NULL:this._err(q.unexpectedNullCharacter),this._emitCodePoint(e);break;case K.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case K.AMPERSAND:this._startCharacterReference();break;case K.LESS_THAN_SIGN:this.state=Q.RCDATA_LESS_THAN_SIGN;break;case K.NULL:this._err(q.unexpectedNullCharacter),this._emitChars(`�`);break;case K.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case K.LESS_THAN_SIGN:this.state=Q.RAWTEXT_LESS_THAN_SIGN;break;case K.NULL:this._err(q.unexpectedNullCharacter),this._emitChars(`�`);break;case K.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case K.LESS_THAN_SIGN:this.state=Q.SCRIPT_DATA_LESS_THAN_SIGN;break;case K.NULL:this._err(q.unexpectedNullCharacter),this._emitChars(`�`);break;case K.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case K.NULL:this._err(q.unexpectedNullCharacter),this._emitChars(`�`);break;case K.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateTagOpen(e){if($A(e))this._createStartTagToken(),this.state=Q.TAG_NAME,this._stateTagName(e);else switch(e){case K.EXCLAMATION_MARK:this.state=Q.MARKUP_DECLARATION_OPEN;break;case K.SOLIDUS:this.state=Q.END_TAG_OPEN;break;case K.QUESTION_MARK:this._err(q.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=Q.BOGUS_COMMENT,this._stateBogusComment(e);break;case K.EOF:this._err(q.eofBeforeTagName),this._emitChars(`<`),this._emitEOFToken();break;default:this._err(q.invalidFirstCharacterOfTagName),this._emitChars(`<`),this.state=Q.DATA,this._stateData(e)}}_stateEndTagOpen(e){if($A(e))this._createEndTagToken(),this.state=Q.TAG_NAME,this._stateTagName(e);else switch(e){case K.GREATER_THAN_SIGN:this._err(q.missingEndTagName),this.state=Q.DATA;break;case K.EOF:this._err(q.eofBeforeTagName),this._emitChars(`</`),this._emitEOFToken();break;default:this._err(q.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=Q.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){let t=this.currentToken;switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:this.state=Q.BEFORE_ATTRIBUTE_NAME;break;case K.SOLIDUS:this.state=Q.SELF_CLOSING_START_TAG;break;case K.GREATER_THAN_SIGN:this.state=Q.DATA,this.emitCurrentTagToken();break;case K.NULL:this._err(q.unexpectedNullCharacter),t.tagName+=`�`;break;case K.EOF:this._err(q.eofInTag),this._emitEOFToken();break;default:t.tagName+=String.fromCodePoint(ZA(e)?tj(e):e)}}_stateRcdataLessThanSign(e){e===K.SOLIDUS?this.state=Q.RCDATA_END_TAG_OPEN:(this._emitChars(`<`),this.state=Q.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){$A(e)?(this.state=Q.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars(`</`),this.state=Q.RCDATA,this._stateRcdata(e))}handleSpecialEndTag(e){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();let t=this.currentToken;switch(t.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=Q.BEFORE_ATTRIBUTE_NAME,!1;case K.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=Q.SELF_CLOSING_START_TAG,!1;case K.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=Q.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=Q.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===K.SOLIDUS?this.state=Q.RAWTEXT_END_TAG_OPEN:(this._emitChars(`<`),this.state=Q.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){$A(e)?(this.state=Q.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars(`</`),this.state=Q.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=Q.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case K.SOLIDUS:this.state=Q.SCRIPT_DATA_END_TAG_OPEN;break;case K.EXCLAMATION_MARK:this.state=Q.SCRIPT_DATA_ESCAPE_START,this._emitChars(`<!`);break;default:this._emitChars(`<`),this.state=Q.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){$A(e)?(this.state=Q.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars(`</`),this.state=Q.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=Q.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===K.HYPHEN_MINUS?(this.state=Q.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars(`-`)):(this.state=Q.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===K.HYPHEN_MINUS?(this.state=Q.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars(`-`)):(this.state=Q.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case K.HYPHEN_MINUS:this.state=Q.SCRIPT_DATA_ESCAPED_DASH,this._emitChars(`-`);break;case K.LESS_THAN_SIGN:this.state=Q.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case K.NULL:this._err(q.unexpectedNullCharacter),this._emitChars(`�`);break;case K.EOF:this._err(q.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case K.HYPHEN_MINUS:this.state=Q.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars(`-`);break;case K.LESS_THAN_SIGN:this.state=Q.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case K.NULL:this._err(q.unexpectedNullCharacter),this.state=Q.SCRIPT_DATA_ESCAPED,this._emitChars(`�`);break;case K.EOF:this._err(q.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=Q.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case K.HYPHEN_MINUS:this._emitChars(`-`);break;case K.LESS_THAN_SIGN:this.state=Q.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case K.GREATER_THAN_SIGN:this.state=Q.SCRIPT_DATA,this._emitChars(`>`);break;case K.NULL:this._err(q.unexpectedNullCharacter),this.state=Q.SCRIPT_DATA_ESCAPED,this._emitChars(`�`);break;case K.EOF:this._err(q.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=Q.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===K.SOLIDUS?this.state=Q.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:$A(e)?(this._emitChars(`<`),this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars(`<`),this.state=Q.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){$A(e)?(this.state=Q.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars(`</`),this.state=Q.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=Q.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(yA.SCRIPT,!1)&&rj(this.preprocessor.peek(yA.SCRIPT.length))){this._emitCodePoint(e);for(let e=0;e<yA.SCRIPT.length;e++)this._emitCodePoint(this._consume());this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=Q.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case K.HYPHEN_MINUS:this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars(`-`);break;case K.LESS_THAN_SIGN:this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case K.NULL:this._err(q.unexpectedNullCharacter),this._emitChars(`�`);break;case K.EOF:this._err(q.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case K.HYPHEN_MINUS:this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars(`-`);break;case K.LESS_THAN_SIGN:this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case K.NULL:this._err(q.unexpectedNullCharacter),this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(`�`);break;case K.EOF:this._err(q.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case K.HYPHEN_MINUS:this._emitChars(`-`);break;case K.LESS_THAN_SIGN:this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case K.GREATER_THAN_SIGN:this.state=Q.SCRIPT_DATA,this._emitChars(`>`);break;case K.NULL:this._err(q.unexpectedNullCharacter),this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(`�`);break;case K.EOF:this._err(q.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===K.SOLIDUS?(this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars(`/`)):(this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(yA.SCRIPT,!1)&&rj(this.preprocessor.peek(yA.SCRIPT.length))){this._emitCodePoint(e);for(let e=0;e<yA.SCRIPT.length;e++)this._emitCodePoint(this._consume());this.state=Q.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:break;case K.SOLIDUS:case K.GREATER_THAN_SIGN:case K.EOF:this.state=Q.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case K.EQUALS_SIGN:this._err(q.unexpectedEqualsSignBeforeAttributeName),this._createAttr(`=`),this.state=Q.ATTRIBUTE_NAME;break;default:this._createAttr(``),this.state=Q.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:case K.SOLIDUS:case K.GREATER_THAN_SIGN:case K.EOF:this._leaveAttrName(),this.state=Q.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case K.EQUALS_SIGN:this._leaveAttrName(),this.state=Q.BEFORE_ATTRIBUTE_VALUE;break;case K.QUOTATION_MARK:case K.APOSTROPHE:case K.LESS_THAN_SIGN:this._err(q.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break;case K.NULL:this._err(q.unexpectedNullCharacter),this.currentAttr.name+=`�`;break;default:this.currentAttr.name+=String.fromCodePoint(ZA(e)?tj(e):e)}}_stateAfterAttributeName(e){switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:break;case K.SOLIDUS:this.state=Q.SELF_CLOSING_START_TAG;break;case K.EQUALS_SIGN:this.state=Q.BEFORE_ATTRIBUTE_VALUE;break;case K.GREATER_THAN_SIGN:this.state=Q.DATA,this.emitCurrentTagToken();break;case K.EOF:this._err(q.eofInTag),this._emitEOFToken();break;default:this._createAttr(``),this.state=Q.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:break;case K.QUOTATION_MARK:this.state=Q.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break;case K.APOSTROPHE:this.state=Q.ATTRIBUTE_VALUE_SINGLE_QUOTED;break;case K.GREATER_THAN_SIGN:this._err(q.missingAttributeValue),this.state=Q.DATA,this.emitCurrentTagToken();break;default:this.state=Q.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case K.QUOTATION_MARK:this.state=Q.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case K.AMPERSAND:this._startCharacterReference();break;case K.NULL:this._err(q.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case K.EOF:this._err(q.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case K.APOSTROPHE:this.state=Q.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case K.AMPERSAND:this._startCharacterReference();break;case K.NULL:this._err(q.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case K.EOF:this._err(q.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:this._leaveAttrValue(),this.state=Q.BEFORE_ATTRIBUTE_NAME;break;case K.AMPERSAND:this._startCharacterReference();break;case K.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=Q.DATA,this.emitCurrentTagToken();break;case K.NULL:this._err(q.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case K.QUOTATION_MARK:case K.APOSTROPHE:case K.LESS_THAN_SIGN:case K.EQUALS_SIGN:case K.GRAVE_ACCENT:this._err(q.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break;case K.EOF:this._err(q.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:this._leaveAttrValue(),this.state=Q.BEFORE_ATTRIBUTE_NAME;break;case K.SOLIDUS:this._leaveAttrValue(),this.state=Q.SELF_CLOSING_START_TAG;break;case K.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=Q.DATA,this.emitCurrentTagToken();break;case K.EOF:this._err(q.eofInTag),this._emitEOFToken();break;default:this._err(q.missingWhitespaceBetweenAttributes),this.state=Q.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case K.GREATER_THAN_SIGN:{let e=this.currentToken;e.selfClosing=!0,this.state=Q.DATA,this.emitCurrentTagToken();break}case K.EOF:this._err(q.eofInTag),this._emitEOFToken();break;default:this._err(q.unexpectedSolidusInTag),this.state=Q.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){let t=this.currentToken;switch(e){case K.GREATER_THAN_SIGN:this.state=Q.DATA,this.emitCurrentComment(t);break;case K.EOF:this.emitCurrentComment(t),this._emitEOFToken();break;case K.NULL:this._err(q.unexpectedNullCharacter),t.data+=`�`;break;default:t.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(yA.DASH_DASH,!0)?(this._createCommentToken(yA.DASH_DASH.length+1),this.state=Q.COMMENT_START):this._consumeSequenceIfMatch(yA.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(yA.DOCTYPE.length+1),this.state=Q.DOCTYPE):this._consumeSequenceIfMatch(yA.CDATA_START,!0)?this.inForeignNode?this.state=Q.CDATA_SECTION:(this._err(q.cdataInHtmlContent),this._createCommentToken(yA.CDATA_START.length+1),this.currentToken.data=`[CDATA[`,this.state=Q.BOGUS_COMMENT):this._ensureHibernation()||(this._err(q.incorrectlyOpenedComment),this._createCommentToken(2),this.state=Q.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case K.HYPHEN_MINUS:this.state=Q.COMMENT_START_DASH;break;case K.GREATER_THAN_SIGN:{this._err(q.abruptClosingOfEmptyComment),this.state=Q.DATA;let e=this.currentToken;this.emitCurrentComment(e);break}default:this.state=Q.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){let t=this.currentToken;switch(e){case K.HYPHEN_MINUS:this.state=Q.COMMENT_END;break;case K.GREATER_THAN_SIGN:this._err(q.abruptClosingOfEmptyComment),this.state=Q.DATA,this.emitCurrentComment(t);break;case K.EOF:this._err(q.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`-`,this.state=Q.COMMENT,this._stateComment(e)}}_stateComment(e){let t=this.currentToken;switch(e){case K.HYPHEN_MINUS:this.state=Q.COMMENT_END_DASH;break;case K.LESS_THAN_SIGN:t.data+=`<`,this.state=Q.COMMENT_LESS_THAN_SIGN;break;case K.NULL:this._err(q.unexpectedNullCharacter),t.data+=`�`;break;case K.EOF:this._err(q.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){let t=this.currentToken;switch(e){case K.EXCLAMATION_MARK:t.data+=`!`,this.state=Q.COMMENT_LESS_THAN_SIGN_BANG;break;case K.LESS_THAN_SIGN:t.data+=`<`;break;default:this.state=Q.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===K.HYPHEN_MINUS?this.state=Q.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=Q.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===K.HYPHEN_MINUS?this.state=Q.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=Q.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==K.GREATER_THAN_SIGN&&e!==K.EOF&&this._err(q.nestedComment),this.state=Q.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){let t=this.currentToken;switch(e){case K.HYPHEN_MINUS:this.state=Q.COMMENT_END;break;case K.EOF:this._err(q.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`-`,this.state=Q.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){let t=this.currentToken;switch(e){case K.GREATER_THAN_SIGN:this.state=Q.DATA,this.emitCurrentComment(t);break;case K.EXCLAMATION_MARK:this.state=Q.COMMENT_END_BANG;break;case K.HYPHEN_MINUS:t.data+=`-`;break;case K.EOF:this._err(q.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`--`,this.state=Q.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){let t=this.currentToken;switch(e){case K.HYPHEN_MINUS:t.data+=`--!`,this.state=Q.COMMENT_END_DASH;break;case K.GREATER_THAN_SIGN:this._err(q.incorrectlyClosedComment),this.state=Q.DATA,this.emitCurrentComment(t);break;case K.EOF:this._err(q.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`--!`,this.state=Q.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:this.state=Q.BEFORE_DOCTYPE_NAME;break;case K.GREATER_THAN_SIGN:this.state=Q.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break;case K.EOF:{this._err(q.eofInDoctype),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this._emitEOFToken();break}default:this._err(q.missingWhitespaceBeforeDoctypeName),this.state=Q.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(ZA(e))this._createDoctypeToken(String.fromCharCode(tj(e))),this.state=Q.DOCTYPE_NAME;else switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:break;case K.NULL:this._err(q.unexpectedNullCharacter),this._createDoctypeToken(`�`),this.state=Q.DOCTYPE_NAME;break;case K.GREATER_THAN_SIGN:{this._err(q.missingDoctypeName),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this.state=Q.DATA;break}case K.EOF:{this._err(q.eofInDoctype),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(e)),this.state=Q.DOCTYPE_NAME}}_stateDoctypeName(e){let t=this.currentToken;switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:this.state=Q.AFTER_DOCTYPE_NAME;break;case K.GREATER_THAN_SIGN:this.state=Q.DATA,this.emitCurrentDoctype(t);break;case K.NULL:this._err(q.unexpectedNullCharacter),t.name+=`�`;break;case K.EOF:this._err(q.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.name+=String.fromCodePoint(ZA(e)?tj(e):e)}}_stateAfterDoctypeName(e){let t=this.currentToken;switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:break;case K.GREATER_THAN_SIGN:this.state=Q.DATA,this.emitCurrentDoctype(t);break;case K.EOF:this._err(q.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._consumeSequenceIfMatch(yA.PUBLIC,!1)?this.state=Q.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(yA.SYSTEM,!1)?this.state=Q.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(q.invalidCharacterSequenceAfterDoctypeName),t.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){let t=this.currentToken;switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:this.state=Q.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break;case K.QUOTATION_MARK:this._err(q.missingWhitespaceAfterDoctypePublicKeyword),t.publicId=``,this.state=Q.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case K.APOSTROPHE:this._err(q.missingWhitespaceAfterDoctypePublicKeyword),t.publicId=``,this.state=Q.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case K.GREATER_THAN_SIGN:this._err(q.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=Q.DATA,this.emitCurrentDoctype(t);break;case K.EOF:this._err(q.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(q.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){let t=this.currentToken;switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:break;case K.QUOTATION_MARK:t.publicId=``,this.state=Q.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case K.APOSTROPHE:t.publicId=``,this.state=Q.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case K.GREATER_THAN_SIGN:this._err(q.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=Q.DATA,this.emitCurrentDoctype(t);break;case K.EOF:this._err(q.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(q.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){let t=this.currentToken;switch(e){case K.QUOTATION_MARK:this.state=Q.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case K.NULL:this._err(q.unexpectedNullCharacter),t.publicId+=`�`;break;case K.GREATER_THAN_SIGN:this._err(q.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=Q.DATA;break;case K.EOF:this._err(q.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e)}}_stateDoctypePublicIdentifierSingleQuoted(e){let t=this.currentToken;switch(e){case K.APOSTROPHE:this.state=Q.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case K.NULL:this._err(q.unexpectedNullCharacter),t.publicId+=`�`;break;case K.GREATER_THAN_SIGN:this._err(q.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=Q.DATA;break;case K.EOF:this._err(q.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e)}}_stateAfterDoctypePublicIdentifier(e){let t=this.currentToken;switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:this.state=Q.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break;case K.GREATER_THAN_SIGN:this.state=Q.DATA,this.emitCurrentDoctype(t);break;case K.QUOTATION_MARK:this._err(q.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case K.APOSTROPHE:this._err(q.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case K.EOF:this._err(q.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(q.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){let t=this.currentToken;switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:break;case K.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=Q.DATA;break;case K.QUOTATION_MARK:t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case K.APOSTROPHE:t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case K.EOF:this._err(q.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(q.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){let t=this.currentToken;switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:this.state=Q.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break;case K.QUOTATION_MARK:this._err(q.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case K.APOSTROPHE:this._err(q.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case K.GREATER_THAN_SIGN:this._err(q.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Q.DATA,this.emitCurrentDoctype(t);break;case K.EOF:this._err(q.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(q.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){let t=this.currentToken;switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:break;case K.QUOTATION_MARK:t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case K.APOSTROPHE:t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case K.GREATER_THAN_SIGN:this._err(q.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Q.DATA,this.emitCurrentDoctype(t);break;case K.EOF:this._err(q.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(q.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){let t=this.currentToken;switch(e){case K.QUOTATION_MARK:this.state=Q.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case K.NULL:this._err(q.unexpectedNullCharacter),t.systemId+=`�`;break;case K.GREATER_THAN_SIGN:this._err(q.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=Q.DATA;break;case K.EOF:this._err(q.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e)}}_stateDoctypeSystemIdentifierSingleQuoted(e){let t=this.currentToken;switch(e){case K.APOSTROPHE:this.state=Q.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case K.NULL:this._err(q.unexpectedNullCharacter),t.systemId+=`�`;break;case K.GREATER_THAN_SIGN:this._err(q.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=Q.DATA;break;case K.EOF:this._err(q.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e)}}_stateAfterDoctypeSystemIdentifier(e){let t=this.currentToken;switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:break;case K.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=Q.DATA;break;case K.EOF:this._err(q.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(q.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){let t=this.currentToken;switch(e){case K.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=Q.DATA;break;case K.NULL:this._err(q.unexpectedNullCharacter);break;case K.EOF:this.emitCurrentDoctype(t),this._emitEOFToken()}}_stateCdataSection(e){switch(e){case K.RIGHT_SQUARE_BRACKET:this.state=Q.CDATA_SECTION_BRACKET;break;case K.EOF:this._err(q.eofInCdata),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===K.RIGHT_SQUARE_BRACKET?this.state=Q.CDATA_SECTION_END:(this._emitChars(`]`),this.state=Q.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case K.GREATER_THAN_SIGN:this.state=Q.DATA;break;case K.RIGHT_SQUARE_BRACKET:this._emitChars(`]`);break;default:this._emitChars(`]]`),this.state=Q.CDATA_SECTION,this._stateCdataSection(e)}}_stateCharacterReference(){let e=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(e<0){if(this.preprocessor.lastChunkWritten)e=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}}e===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(K.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&ej(this.preprocessor.peek(1))?Q.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){ej(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===K.SEMICOLON&&this._err(q.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}},oj=new Set([X.DD,X.DT,X.LI,X.OPTGROUP,X.OPTION,X.P,X.RB,X.RP,X.RT,X.RTC]),sj=new Set([...oj,X.CAPTION,X.COLGROUP,X.TBODY,X.TD,X.TFOOT,X.TH,X.THEAD,X.TR]),cj=new Set([X.APPLET,X.CAPTION,X.HTML,X.MARQUEE,X.OBJECT,X.TABLE,X.TD,X.TEMPLATE,X.TH]),lj=new Set([...cj,X.OL,X.UL]),uj=new Set([...cj,X.BUTTON]),dj=new Set([X.ANNOTATION_XML,X.MI,X.MN,X.MO,X.MS,X.MTEXT]),fj=new Set([X.DESC,X.FOREIGN_OBJECT,X.TITLE]),pj=new Set([X.TR,X.TEMPLATE,X.HTML]),mj=new Set([X.TBODY,X.TFOOT,X.THEAD,X.TEMPLATE,X.HTML]),hj=new Set([X.TABLE,X.TEMPLATE,X.HTML]),gj=new Set([X.TD,X.TH]),_j=class{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(e,t,n){this.treeAdapter=t,this.handler=n,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=X.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===X.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===J.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(e,t){this.stackTop++,this.items[this.stackTop]=e,this.current=e,this.tagIDs[this.stackTop]=t,this.currentTagId=t,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(e,t,!0)}pop(){let e=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,t){let n=this._indexOf(e);this.items[n]=t,n===this.stackTop&&(this.current=t)}insertAfter(e,t,n){let r=this._indexOf(e)+1;this.items.splice(r,0,t),this.tagIDs.splice(r,0,n),this.stackTop++,r===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,r===this.stackTop)}popUntilTagNamePopped(e){let t=this.stackTop+1;do t=this.tagIDs.lastIndexOf(e,t-1);while(t>0&&this.treeAdapter.getNamespaceURI(this.items[t])!==J.HTML);this.shortenToLength(Math.max(t,0))}shortenToLength(e){for(;this.stackTop>=e;){let t=this.current;this.tmplCount>0&&this._isInTemplate()&&--this.tmplCount,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,this.stackTop<e)}}popUntilElementPopped(e){let t=this._indexOf(e);this.shortenToLength(Math.max(t,0))}popUntilPopped(e,t){let n=this._indexOfTagNames(e,t);this.shortenToLength(Math.max(n,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(JA,J.HTML)}popUntilTableCellPopped(){this.popUntilPopped(gj,J.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(e,t){for(let n=this.stackTop;n>=0;n--)if(e.has(this.tagIDs[n])&&this.treeAdapter.getNamespaceURI(this.items[n])===t)return n;return-1}clearBackTo(e,t){let n=this._indexOfTagNames(e,t);this.shortenToLength(n+1)}clearBackToTableContext(){this.clearBackTo(hj,J.HTML)}clearBackToTableBodyContext(){this.clearBackTo(mj,J.HTML)}clearBackToTableRowContext(){this.clearBackTo(pj,J.HTML)}remove(e){let t=this._indexOf(e);t>=0&&(t===this.stackTop?this.pop():(this.items.splice(t,1),this.tagIDs.splice(t,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===X.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){let t=this._indexOf(e)-1;return t>=0?this.items[t]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===X.HTML}hasInDynamicScope(e,t){for(let n=this.stackTop;n>=0;n--){let r=this.tagIDs[n];switch(this.treeAdapter.getNamespaceURI(this.items[n])){case J.HTML:if(r===e)return!0;if(t.has(r))return!1;break;case J.SVG:if(fj.has(r))return!1;break;case J.MATHML:if(dj.has(r))return!1}}return!0}hasInScope(e){return this.hasInDynamicScope(e,cj)}hasInListItemScope(e){return this.hasInDynamicScope(e,lj)}hasInButtonScope(e){return this.hasInDynamicScope(e,uj)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){let t=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case J.HTML:if(JA.has(t))return!0;if(cj.has(t))return!1;break;case J.SVG:if(fj.has(t))return!1;break;case J.MATHML:if(dj.has(t))return!1}}return!0}hasInTableScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===J.HTML)switch(this.tagIDs[t]){case e:return!0;case X.TABLE:case X.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===J.HTML)switch(this.tagIDs[e]){case X.TBODY:case X.THEAD:case X.TFOOT:return!0;case X.TABLE:case X.HTML:return!1}return!0}hasInSelectScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===J.HTML)switch(this.tagIDs[t]){case e:return!0;case X.OPTION:case X.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&oj.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&sj.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&sj.has(this.currentTagId);)this.pop()}},vj=3,yj;(function(e){e[e.Marker=0]=`Marker`,e[e.Element=1]=`Element`})(yj||={});var bj={type:yj.Marker},xj=class{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,t){let n=[],r=t.length,i=this.treeAdapter.getTagName(e),a=this.treeAdapter.getNamespaceURI(e);for(let e=0;e<this.entries.length;e++){let t=this.entries[e];if(t.type===yj.Marker)break;let{element:o}=t;if(this.treeAdapter.getTagName(o)===i&&this.treeAdapter.getNamespaceURI(o)===a){let t=this.treeAdapter.getAttrList(o);t.length===r&&n.push({idx:e,attrs:t})}}return n}_ensureNoahArkCondition(e){if(this.entries.length<vj)return;let t=this.treeAdapter.getAttrList(e),n=this._getNoahArkConditionCandidates(e,t);if(n.length<vj)return;let r=new Map(t.map(e=>[e.name,e.value])),i=0;for(let e=0;e<n.length;e++){let t=n[e];t.attrs.every(e=>r.get(e.name)===e.value)&&(i+=1,i>=vj&&this.entries.splice(t.idx,1))}}insertMarker(){this.entries.unshift(bj)}pushElement(e,t){this._ensureNoahArkCondition(e),this.entries.unshift({type:yj.Element,element:e,token:t})}insertElementAfterBookmark(e,t){let n=this.entries.indexOf(this.bookmark);this.entries.splice(n,0,{type:yj.Element,element:e,token:t})}removeEntry(e){let t=this.entries.indexOf(e);t!==-1&&this.entries.splice(t,1)}clearToLastMarker(){let e=this.entries.indexOf(bj);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){let t=this.entries.find(t=>t.type===yj.Marker||this.treeAdapter.getTagName(t.element)===e);return t&&t.type===yj.Element?t:null}getElementEntry(e){return this.entries.find(t=>t.type===yj.Element&&t.element===e)}},Sj={createDocument(){return{nodeName:`#document`,mode:WA.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:`#document-fragment`,childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:`#comment`,data:e,parentNode:null}},createTextNode(e){return{nodeName:`#text`,value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){let r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){let i=e.childNodes.find(e=>e.nodeName===`#documentType`);if(i)i.name=t,i.publicId=n,i.systemId=r;else{let i={nodeName:`#documentType`,name:t,publicId:n,systemId:r,parentNode:null};Sj.appendChild(e,i)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){let t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){let n=e.childNodes[e.childNodes.length-1];if(Sj.isTextNode(n)){n.value+=t;return}}Sj.appendChild(e,Sj.createTextNode(t))},insertTextBefore(e,t,n){let r=e.childNodes[e.childNodes.indexOf(n)-1];r&&Sj.isTextNode(r)?r.value+=t:Sj.insertBefore(e,Sj.createTextNode(t),n)},adoptAttributes(e,t){let n=new Set(e.attrs.map(e=>e.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName===`#text`},isCommentNode(e){return e.nodeName===`#comment`},isDocumentTypeNode(e){return e.nodeName===`#documentType`},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,`tagName`)},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},Cj=`html`,wj=`about:legacy-compat`,Tj=`http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd`,Ej=`+//silmaril//dtd html pro v0r11 19970101//,-//as//dtd html 3.0 aswedit + extensions//,-//advasoft ltd//dtd html 3.0 aswedit + extensions//,-//ietf//dtd html 2.0 level 1//,-//ietf//dtd html 2.0 level 2//,-//ietf//dtd html 2.0 strict level 1//,-//ietf//dtd html 2.0 strict level 2//,-//ietf//dtd html 2.0 strict//,-//ietf//dtd html 2.0//,-//ietf//dtd html 2.1e//,-//ietf//dtd html 3.0//,-//ietf//dtd html 3.2 final//,-//ietf//dtd html 3.2//,-//ietf//dtd html 3//,-//ietf//dtd html level 0//,-//ietf//dtd html level 1//,-//ietf//dtd html level 2//,-//ietf//dtd html level 3//,-//ietf//dtd html strict level 0//,-//ietf//dtd html strict level 1//,-//ietf//dtd html strict level 2//,-//ietf//dtd html strict level 3//,-//ietf//dtd html strict//,-//ietf//dtd html//,-//metrius//dtd metrius presentational//,-//microsoft//dtd internet explorer 2.0 html strict//,-//microsoft//dtd internet explorer 2.0 html//,-//microsoft//dtd internet explorer 2.0 tables//,-//microsoft//dtd internet explorer 3.0 html strict//,-//microsoft//dtd internet explorer 3.0 html//,-//microsoft//dtd internet explorer 3.0 tables//,-//netscape comm. corp.//dtd html//,-//netscape comm. corp.//dtd strict html//,-//o'reilly and associates//dtd html 2.0//,-//o'reilly and associates//dtd html extended 1.0//,-//o'reilly and associates//dtd html extended relaxed 1.0//,-//sq//dtd html 2.0 hotmetal + extensions//,-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//,-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//,-//spyglass//dtd html 2.0 extended//,-//sun microsystems corp.//dtd hotjava html//,-//sun microsystems corp.//dtd hotjava strict html//,-//w3c//dtd html 3 1995-03-24//,-//w3c//dtd html 3.2 draft//,-//w3c//dtd html 3.2 final//,-//w3c//dtd html 3.2//,-//w3c//dtd html 3.2s draft//,-//w3c//dtd html 4.0 frameset//,-//w3c//dtd html 4.0 transitional//,-//w3c//dtd html experimental 19960712//,-//w3c//dtd html experimental 970421//,-//w3c//dtd w3 html//,-//w3o//dtd w3 html 3.0//,-//webtechs//dtd mozilla html 2.0//,-//webtechs//dtd mozilla html//`.split(`,`),Dj=[...Ej,`-//w3c//dtd html 4.01 frameset//`,`-//w3c//dtd html 4.01 transitional//`],Oj=new Set([`-//w3o//dtd w3 html strict 3.0//en//`,`-/w3c/dtd html 4.0 transitional/en`,`html`]),kj=[`-//w3c//dtd xhtml 1.0 frameset//`,`-//w3c//dtd xhtml 1.0 transitional//`],Aj=[...kj,`-//w3c//dtd html 4.01 frameset//`,`-//w3c//dtd html 4.01 transitional//`];function jj(e,t){return t.some(t=>e.startsWith(t))}function Mj(e){return e.name===Cj&&e.publicId===null&&(e.systemId===null||e.systemId===wj)}function Nj(e){if(e.name!==Cj)return WA.QUIRKS;let{systemId:t}=e;if(t&&t.toLowerCase()===Tj)return WA.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),Oj.has(n))return WA.QUIRKS;let e=t===null?Dj:Ej;if(jj(n,e))return WA.QUIRKS;if(e=t===null?kj:Aj,jj(n,e))return WA.LIMITED_QUIRKS}return WA.NO_QUIRKS}var Pj={TEXT_HTML:`text/html`,APPLICATION_XML:`application/xhtml+xml`},Fj=`definitionurl`,Ij=`definitionURL`,Lj=new Map(`attributeName.attributeType.baseFrequency.baseProfile.calcMode.clipPathUnits.diffuseConstant.edgeMode.filterUnits.glyphRef.gradientTransform.gradientUnits.kernelMatrix.kernelUnitLength.keyPoints.keySplines.keyTimes.lengthAdjust.limitingConeAngle.markerHeight.markerUnits.markerWidth.maskContentUnits.maskUnits.numOctaves.pathLength.patternContentUnits.patternTransform.patternUnits.pointsAtX.pointsAtY.pointsAtZ.preserveAlpha.preserveAspectRatio.primitiveUnits.refX.refY.repeatCount.repeatDur.requiredExtensions.requiredFeatures.specularConstant.specularExponent.spreadMethod.startOffset.stdDeviation.stitchTiles.surfaceScale.systemLanguage.tableValues.targetX.targetY.textLength.viewBox.viewTarget.xChannelSelector.yChannelSelector.zoomAndPan`.split(`.`).map(e=>[e.toLowerCase(),e])),Rj=new Map([[`xlink:actuate`,{prefix:`xlink`,name:`actuate`,namespace:J.XLINK}],[`xlink:arcrole`,{prefix:`xlink`,name:`arcrole`,namespace:J.XLINK}],[`xlink:href`,{prefix:`xlink`,name:`href`,namespace:J.XLINK}],[`xlink:role`,{prefix:`xlink`,name:`role`,namespace:J.XLINK}],[`xlink:show`,{prefix:`xlink`,name:`show`,namespace:J.XLINK}],[`xlink:title`,{prefix:`xlink`,name:`title`,namespace:J.XLINK}],[`xlink:type`,{prefix:`xlink`,name:`type`,namespace:J.XLINK}],[`xml:lang`,{prefix:`xml`,name:`lang`,namespace:J.XML}],[`xml:space`,{prefix:`xml`,name:`space`,namespace:J.XML}],[`xmlns`,{prefix:``,name:`xmlns`,namespace:J.XMLNS}],[`xmlns:xlink`,{prefix:`xmlns`,name:`xlink`,namespace:J.XMLNS}]]),zj=new Map(`altGlyph.altGlyphDef.altGlyphItem.animateColor.animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.glyphRef.linearGradient.radialGradient.textPath`.split(`.`).map(e=>[e.toLowerCase(),e])),Bj=new Set([X.B,X.BIG,X.BLOCKQUOTE,X.BODY,X.BR,X.CENTER,X.CODE,X.DD,X.DIV,X.DL,X.DT,X.EM,X.EMBED,X.H1,X.H2,X.H3,X.H4,X.H5,X.H6,X.HEAD,X.HR,X.I,X.IMG,X.LI,X.LISTING,X.MENU,X.META,X.NOBR,X.OL,X.P,X.PRE,X.RUBY,X.S,X.SMALL,X.SPAN,X.STRONG,X.STRIKE,X.SUB,X.SUP,X.TABLE,X.TT,X.U,X.UL,X.VAR]);function Vj(e){let t=e.tagID;return t===X.FONT&&e.attrs.some(({name:e})=>e===UA.COLOR||e===UA.SIZE||e===UA.FACE)||Bj.has(t)}function Hj(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===Fj){e.attrs[t].name=Ij;break}}function Uj(e){for(let t=0;t<e.attrs.length;t++){let n=Lj.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function Wj(e){for(let t=0;t<e.attrs.length;t++){let n=Rj.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function Gj(e){let t=zj.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=KA(e.tagName))}function Kj(e,t){return t===J.MATHML&&(e===X.MI||e===X.MO||e===X.MN||e===X.MS||e===X.MTEXT)}function qj(e,t,n){if(t===J.MATHML&&e===X.ANNOTATION_XML){for(let e=0;e<n.length;e++)if(n[e].name===UA.ENCODING){let t=n[e].value.toLowerCase();return t===Pj.TEXT_HTML||t===Pj.APPLICATION_XML}}return t===J.SVG&&(e===X.FOREIGN_OBJECT||e===X.DESC||e===X.TITLE)}function Jj(e,t,n,r){return(!r||r===J.HTML)&&qj(e,t,n)||(!r||r===J.MATHML)&&Kj(e,t)}var Yj=`hidden`,Xj=8,Zj=3,$;(function(e){e[e.INITIAL=0]=`INITIAL`,e[e.BEFORE_HTML=1]=`BEFORE_HTML`,e[e.BEFORE_HEAD=2]=`BEFORE_HEAD`,e[e.IN_HEAD=3]=`IN_HEAD`,e[e.IN_HEAD_NO_SCRIPT=4]=`IN_HEAD_NO_SCRIPT`,e[e.AFTER_HEAD=5]=`AFTER_HEAD`,e[e.IN_BODY=6]=`IN_BODY`,e[e.TEXT=7]=`TEXT`,e[e.IN_TABLE=8]=`IN_TABLE`,e[e.IN_TABLE_TEXT=9]=`IN_TABLE_TEXT`,e[e.IN_CAPTION=10]=`IN_CAPTION`,e[e.IN_COLUMN_GROUP=11]=`IN_COLUMN_GROUP`,e[e.IN_TABLE_BODY=12]=`IN_TABLE_BODY`,e[e.IN_ROW=13]=`IN_ROW`,e[e.IN_CELL=14]=`IN_CELL`,e[e.IN_SELECT=15]=`IN_SELECT`,e[e.IN_SELECT_IN_TABLE=16]=`IN_SELECT_IN_TABLE`,e[e.IN_TEMPLATE=17]=`IN_TEMPLATE`,e[e.AFTER_BODY=18]=`AFTER_BODY`,e[e.IN_FRAMESET=19]=`IN_FRAMESET`,e[e.AFTER_FRAMESET=20]=`AFTER_FRAMESET`,e[e.AFTER_AFTER_BODY=21]=`AFTER_AFTER_BODY`,e[e.AFTER_AFTER_FRAMESET=22]=`AFTER_AFTER_FRAMESET`})($||={});var Qj={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},$j=new Set([X.TABLE,X.TBODY,X.TFOOT,X.THEAD,X.TR]),eM={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:Sj,onParseError:null},tM=class{constructor(e,t,n=null,r=null){this.fragmentContext=n,this.scriptHandler=r,this.currentToken=null,this.stopped=!1,this.insertionMode=$.INITIAL,this.originalInsertionMode=$.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...eM,...e},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=t??this.treeAdapter.createDocument(),this.tokenizer=new aj(this.options,this),this.activeFormattingElements=new xj(this.treeAdapter),this.fragmentContextID=n?KA(this.treeAdapter.getTagName(n)):X.UNKNOWN,this._setContextModes(n??this.document,this.fragmentContextID),this.openElements=new _j(this.document,this.treeAdapter,this)}static parse(e,t){let n=new this(t);return n.tokenizer.write(e,!0),n.document}static getFragmentParser(e,t){let n={...eM,...t};e??=n.treeAdapter.createElement(Y.TEMPLATE,J.HTML,[]);let r=n.treeAdapter.createElement(`documentmock`,J.HTML,[]),i=new this(n,r,e);return i.fragmentContextID===X.TEMPLATE&&i.tmplInsertionModeStack.unshift($.IN_TEMPLATE),i._initTokenizerForFragmentParsing(),i._insertFakeRootElement(),i._resetInsertionMode(),i._findFormInFragmentContext(),i}getFragment(){let e=this.treeAdapter.getFirstChild(this.document),t=this.treeAdapter.createDocumentFragment();return this._adoptNodes(e,t),t}_err(e,t,n){if(!this.onParseError)return;let r=e.location??Qj,i={code:t,startLine:r.startLine,startCol:r.startCol,startOffset:r.startOffset,endLine:n?r.startLine:r.endLine,endCol:n?r.startCol:r.endCol,endOffset:n?r.startOffset:r.endOffset};this.onParseError(i)}onItemPush(e,t,n){var r,i;(i=(r=this.treeAdapter).onItemPush)==null||i.call(r,e),n&&this.openElements.stackTop>0&&this._setContextModes(e,t)}onItemPop(e,t){var n,r;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),(r=(n=this.treeAdapter).onItemPop)==null||r.call(n,e,this.openElements.current),t){let e,t;this.openElements.stackTop===0&&this.fragmentContext?(e=this.fragmentContext,t=this.fragmentContextID):{current:e,currentTagId:t}=this.openElements,this._setContextModes(e,t)}}_setContextModes(e,t){let n=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===J.HTML;this.currentNotInHTML=!n,this.tokenizer.inForeignNode=!n&&e!==void 0&&t!==void 0&&!this._isIntegrationPoint(t,e)}_switchToTextParsing(e,t){this._insertElement(e,J.HTML),this.tokenizer.state=t,this.originalInsertionMode=this.insertionMode,this.insertionMode=$.TEXT}switchToPlaintextParsing(){this.insertionMode=$.TEXT,this.originalInsertionMode=$.IN_BODY,this.tokenizer.state=YA.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===Y.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==J.HTML))switch(this.fragmentContextID){case X.TITLE:case X.TEXTAREA:this.tokenizer.state=YA.RCDATA;break;case X.STYLE:case X.XMP:case X.IFRAME:case X.NOEMBED:case X.NOFRAMES:case X.NOSCRIPT:this.tokenizer.state=YA.RAWTEXT;break;case X.SCRIPT:this.tokenizer.state=YA.SCRIPT_DATA;break;case X.PLAINTEXT:this.tokenizer.state=YA.PLAINTEXT}}_setDocumentType(e){let t=e.name||``,n=e.publicId||``,r=e.systemId||``;if(this.treeAdapter.setDocumentType(this.document,t,n,r),e.location){let t=this.treeAdapter.getChildNodes(this.document).find(e=>this.treeAdapter.isDocumentTypeNode(e));t&&this.treeAdapter.setNodeSourceCodeLocation(t,e.location)}}_attachElementToTree(e,t){if(this.options.sourceCodeLocationInfo){let n=t&&{...t,startTag:t};this.treeAdapter.setNodeSourceCodeLocation(e,n)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{let t=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(t??this.document,e)}}_appendElement(e,t){let n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location)}_insertElement(e,t){let n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location),this.openElements.push(n,e.tagID)}_insertFakeElement(e,t){let n=this.treeAdapter.createElement(e,J.HTML,[]);this._attachElementToTree(n,null),this.openElements.push(n,t)}_insertTemplate(e){let t=this.treeAdapter.createElement(e.tagName,J.HTML,e.attrs),n=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(t,n),this._attachElementToTree(t,e.location),this.openElements.push(t,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,null)}_insertFakeRootElement(){let e=this.treeAdapter.createElement(Y.HTML,J.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,X.HTML)}_appendCommentNode(e,t){let n=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(t,n),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,e.location)}_insertCharacters(e){let t,n;if(this._shouldFosterParentOnInsertion()?({parent:t,beforeElement:n}=this._findFosterParentingLocation(),n?this.treeAdapter.insertTextBefore(t,e.chars,n):this.treeAdapter.insertText(t,e.chars)):(t=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(t,e.chars)),!e.location)return;let r=this.treeAdapter.getChildNodes(t),i=r[(n?r.lastIndexOf(n):r.length)-1];if(this.treeAdapter.getNodeSourceCodeLocation(i)){let{endLine:t,endCol:n,endOffset:r}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(i,{endLine:t,endCol:n,endOffset:r})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,e.location)}_adoptNodes(e,t){for(let n=this.treeAdapter.getFirstChild(e);n;n=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(n),this.treeAdapter.appendChild(t,n)}_setEndLocation(e,t){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&t.location){let n=t.location,r=this.treeAdapter.getTagName(e),i=t.type===DA.END_TAG&&r===t.tagName?{endTag:{...n},endLine:n.endLine,endCol:n.endCol,endOffset:n.endOffset}:{endLine:n.startLine,endCol:n.startCol,endOffset:n.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,i)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let t,n;return this.openElements.stackTop===0&&this.fragmentContext?(t=this.fragmentContext,n=this.fragmentContextID):{current:t,currentTagId:n}=this.openElements,e.tagID===X.SVG&&this.treeAdapter.getTagName(t)===Y.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(t)===J.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===X.MGLYPH||e.tagID===X.MALIGNMARK)&&n!==void 0&&!this._isIntegrationPoint(n,t,J.HTML)}_processToken(e){switch(e.type){case DA.CHARACTER:this.onCharacter(e);break;case DA.NULL_CHARACTER:this.onNullCharacter(e);break;case DA.COMMENT:this.onComment(e);break;case DA.DOCTYPE:this.onDoctype(e);break;case DA.START_TAG:this._processStartTag(e);break;case DA.END_TAG:this.onEndTag(e);break;case DA.EOF:this.onEof(e);break;case DA.WHITESPACE_CHARACTER:this.onWhitespaceCharacter(e)}}_isIntegrationPoint(e,t,n){return Jj(e,this.treeAdapter.getNamespaceURI(t),this.treeAdapter.getAttrList(t),n)}_reconstructActiveFormattingElements(){let e=this.activeFormattingElements.entries.length;if(e){let t=this.activeFormattingElements.entries.findIndex(e=>e.type===yj.Marker||this.openElements.contains(e.element)),n=t===-1?e-1:t-1;for(let e=n;e>=0;e--){let t=this.activeFormattingElements.entries[e];this._insertElement(t.token,this.treeAdapter.getNamespaceURI(t.element)),t.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=$.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(X.P),this.openElements.popUntilTagNamePopped(X.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case X.TR:this.insertionMode=$.IN_ROW;return;case X.TBODY:case X.THEAD:case X.TFOOT:this.insertionMode=$.IN_TABLE_BODY;return;case X.CAPTION:this.insertionMode=$.IN_CAPTION;return;case X.COLGROUP:this.insertionMode=$.IN_COLUMN_GROUP;return;case X.TABLE:this.insertionMode=$.IN_TABLE;return;case X.BODY:this.insertionMode=$.IN_BODY;return;case X.FRAMESET:this.insertionMode=$.IN_FRAMESET;return;case X.SELECT:this._resetInsertionModeForSelect(e);return;case X.TEMPLATE:this.insertionMode=this.tmplInsertionModeStack[0];return;case X.HTML:this.insertionMode=this.headElement?$.AFTER_HEAD:$.BEFORE_HEAD;return;case X.TD:case X.TH:if(e>0){this.insertionMode=$.IN_CELL;return}break;case X.HEAD:if(e>0){this.insertionMode=$.IN_HEAD;return}}this.insertionMode=$.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let t=e-1;t>0;t--){let e=this.openElements.tagIDs[t];if(e===X.TEMPLATE)break;if(e===X.TABLE){this.insertionMode=$.IN_SELECT_IN_TABLE;return}}this.insertionMode=$.IN_SELECT}_isElementCausesFosterParenting(e){return $j.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){let t=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case X.TEMPLATE:if(this.treeAdapter.getNamespaceURI(t)===J.HTML)return{parent:this.treeAdapter.getTemplateContent(t),beforeElement:null};break;case X.TABLE:{let n=this.treeAdapter.getParentNode(t);return n?{parent:n,beforeElement:t}:{parent:this.openElements.items[e-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){let t=this._findFosterParentingLocation();t.beforeElement?this.treeAdapter.insertBefore(t.parent,e,t.beforeElement):this.treeAdapter.appendChild(t.parent,e)}_isSpecialElement(e,t){return qA[this.treeAdapter.getNamespaceURI(e)].has(t)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){yP(this,e);return}switch(this.insertionMode){case $.INITIAL:mM(this,e);break;case $.BEFORE_HTML:_M(this,e);break;case $.BEFORE_HEAD:bM(this,e);break;case $.IN_HEAD:wM(this,e);break;case $.IN_HEAD_NO_SCRIPT:DM(this,e);break;case $.AFTER_HEAD:AM(this,e);break;case $.IN_BODY:case $.IN_CAPTION:case $.IN_CELL:case $.IN_TEMPLATE:NM(this,e);break;case $.TEXT:case $.IN_SELECT:case $.IN_SELECT_IN_TABLE:this._insertCharacters(e);break;case $.IN_TABLE:case $.IN_TABLE_BODY:case $.IN_ROW:ON(this,e);break;case $.IN_TABLE_TEXT:VN(this,e);break;case $.IN_COLUMN_GROUP:JN(this,e);break;case $.AFTER_BODY:uP(this,e);break;case $.AFTER_AFTER_BODY:gP(this,e)}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){vP(this,e);return}switch(this.insertionMode){case $.INITIAL:mM(this,e);break;case $.BEFORE_HTML:_M(this,e);break;case $.BEFORE_HEAD:bM(this,e);break;case $.IN_HEAD:wM(this,e);break;case $.IN_HEAD_NO_SCRIPT:DM(this,e);break;case $.AFTER_HEAD:AM(this,e);break;case $.TEXT:this._insertCharacters(e);break;case $.IN_TABLE:case $.IN_TABLE_BODY:case $.IN_ROW:ON(this,e);break;case $.IN_COLUMN_GROUP:JN(this,e);break;case $.AFTER_BODY:uP(this,e);break;case $.AFTER_AFTER_BODY:gP(this,e)}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){lM(this,e);return}switch(this.insertionMode){case $.INITIAL:case $.BEFORE_HTML:case $.BEFORE_HEAD:case $.IN_HEAD:case $.IN_HEAD_NO_SCRIPT:case $.AFTER_HEAD:case $.IN_BODY:case $.IN_TABLE:case $.IN_CAPTION:case $.IN_COLUMN_GROUP:case $.IN_TABLE_BODY:case $.IN_ROW:case $.IN_CELL:case $.IN_SELECT:case $.IN_SELECT_IN_TABLE:case $.IN_TEMPLATE:case $.IN_FRAMESET:case $.AFTER_FRAMESET:lM(this,e);break;case $.IN_TABLE_TEXT:HN(this,e);break;case $.AFTER_BODY:uM(this,e);break;case $.AFTER_AFTER_BODY:case $.AFTER_AFTER_FRAMESET:dM(this,e)}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case $.INITIAL:pM(this,e);break;case $.BEFORE_HEAD:case $.IN_HEAD:case $.IN_HEAD_NO_SCRIPT:case $.AFTER_HEAD:this._err(e,q.misplacedDoctype);break;case $.IN_TABLE_TEXT:HN(this,e)}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,q.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?xP(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case $.INITIAL:mM(this,e);break;case $.BEFORE_HTML:hM(this,e);break;case $.BEFORE_HEAD:vM(this,e);break;case $.IN_HEAD:xM(this,e);break;case $.IN_HEAD_NO_SCRIPT:TM(this,e);break;case $.AFTER_HEAD:OM(this,e);break;case $.IN_BODY:fN(this,e);break;case $.IN_TABLE:LN(this,e);break;case $.IN_TABLE_TEXT:HN(this,e);break;case $.IN_CAPTION:WN(this,e);break;case $.IN_COLUMN_GROUP:KN(this,e);break;case $.IN_TABLE_BODY:YN(this,e);break;case $.IN_ROW:ZN(this,e);break;case $.IN_CELL:$N(this,e);break;case $.IN_SELECT:tP(this,e);break;case $.IN_SELECT_IN_TABLE:rP(this,e);break;case $.IN_TEMPLATE:aP(this,e);break;case $.AFTER_BODY:cP(this,e);break;case $.IN_FRAMESET:dP(this,e);break;case $.AFTER_FRAMESET:pP(this,e);break;case $.AFTER_AFTER_BODY:hP(this,e);break;case $.AFTER_AFTER_FRAMESET:_P(this,e)}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?SP(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case $.INITIAL:mM(this,e);break;case $.BEFORE_HTML:gM(this,e);break;case $.BEFORE_HEAD:yM(this,e);break;case $.IN_HEAD:SM(this,e);break;case $.IN_HEAD_NO_SCRIPT:EM(this,e);break;case $.AFTER_HEAD:kM(this,e);break;case $.IN_BODY:wN(this,e);break;case $.TEXT:EN(this,e);break;case $.IN_TABLE:RN(this,e);break;case $.IN_TABLE_TEXT:HN(this,e);break;case $.IN_CAPTION:GN(this,e);break;case $.IN_COLUMN_GROUP:qN(this,e);break;case $.IN_TABLE_BODY:XN(this,e);break;case $.IN_ROW:QN(this,e);break;case $.IN_CELL:eP(this,e);break;case $.IN_SELECT:nP(this,e);break;case $.IN_SELECT_IN_TABLE:iP(this,e);break;case $.IN_TEMPLATE:oP(this,e);break;case $.AFTER_BODY:lP(this,e);break;case $.IN_FRAMESET:fP(this,e);break;case $.AFTER_FRAMESET:mP(this,e);break;case $.AFTER_AFTER_BODY:gP(this,e)}}onEof(e){switch(this.insertionMode){case $.INITIAL:mM(this,e);break;case $.BEFORE_HTML:_M(this,e);break;case $.BEFORE_HEAD:bM(this,e);break;case $.IN_HEAD:wM(this,e);break;case $.IN_HEAD_NO_SCRIPT:DM(this,e);break;case $.AFTER_HEAD:AM(this,e);break;case $.IN_BODY:case $.IN_TABLE:case $.IN_CAPTION:case $.IN_COLUMN_GROUP:case $.IN_TABLE_BODY:case $.IN_ROW:case $.IN_CELL:case $.IN_SELECT:case $.IN_SELECT_IN_TABLE:TN(this,e);break;case $.TEXT:DN(this,e);break;case $.IN_TABLE_TEXT:HN(this,e);break;case $.IN_TEMPLATE:sP(this,e);break;case $.AFTER_BODY:case $.IN_FRAMESET:case $.AFTER_FRAMESET:case $.AFTER_AFTER_BODY:case $.AFTER_AFTER_FRAMESET:fM(this,e)}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===K.LINE_FEED)){if(e.chars.length===1)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(e);return}switch(this.insertionMode){case $.IN_HEAD:case $.IN_HEAD_NO_SCRIPT:case $.AFTER_HEAD:case $.TEXT:case $.IN_COLUMN_GROUP:case $.IN_SELECT:case $.IN_SELECT_IN_TABLE:case $.IN_FRAMESET:case $.AFTER_FRAMESET:this._insertCharacters(e);break;case $.IN_BODY:case $.IN_CAPTION:case $.IN_CELL:case $.IN_TEMPLATE:case $.AFTER_BODY:case $.AFTER_AFTER_BODY:case $.AFTER_AFTER_FRAMESET:MM(this,e);break;case $.IN_TABLE:case $.IN_TABLE_BODY:case $.IN_ROW:ON(this,e);break;case $.IN_TABLE_TEXT:BN(this,e)}}};function nM(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):CN(e,t),n}function rM(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){let i=e.openElements.items[r];if(i===t.element)break;e._isSpecialElement(i,e.openElements.tagIDs[r])&&(n=i)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function iM(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let a=0,o=i;o!==n;a++,o=i){i=e.openElements.getCommonAncestor(o);let n=e.activeFormattingElements.getElementEntry(o),s=n&&a>=Zj;!n||s?(s&&e.activeFormattingElements.removeEntry(n),e.openElements.remove(o)):(o=aM(e,n),r===t&&(e.activeFormattingElements.bookmark=n),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(o,r),r=o)}return r}function aM(e,t){let n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function oM(e,t,n){let r=KA(e.treeAdapter.getTagName(t));if(e._isElementCausesFosterParenting(r))e._fosterParentElement(n);else{let i=e.treeAdapter.getNamespaceURI(t);r===X.TEMPLATE&&i===J.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function sM(e,t,n){let r=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,a=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,a),e.treeAdapter.appendChild(t,a),e.activeFormattingElements.insertElementAfterBookmark(a,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,a,i.tagID)}function cM(e,t){for(let n=0;n<Xj;n++){let n=nM(e,t);if(!n)break;let r=rM(e,n);if(!r)break;e.activeFormattingElements.bookmark=n;let i=iM(e,r,n.element),a=e.openElements.getCommonAncestor(n.element);e.treeAdapter.detachNode(i),a&&oM(e,a,i),sM(e,r,n)}}function lM(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function uM(e,t){e._appendCommentNode(t,e.openElements.items[0])}function dM(e,t){e._appendCommentNode(t,e.document)}function fM(e,t){if(e.stopped=!0,t.location){let n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){let n=e.openElements.items[0],r=e.treeAdapter.getNodeSourceCodeLocation(n);if(r&&!r.endTag&&(e._setEndLocation(n,t),e.openElements.stackTop>=1)){let n=e.openElements.items[1],r=e.treeAdapter.getNodeSourceCodeLocation(n);r&&!r.endTag&&e._setEndLocation(n,t)}}}}function pM(e,t){e._setDocumentType(t);let n=t.forceQuirks?WA.QUIRKS:Nj(t);Mj(t)||e._err(t,q.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=$.BEFORE_HTML}function mM(e,t){e._err(t,q.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,WA.QUIRKS),e.insertionMode=$.BEFORE_HTML,e._processToken(t)}function hM(e,t){t.tagID===X.HTML?(e._insertElement(t,J.HTML),e.insertionMode=$.BEFORE_HEAD):_M(e,t)}function gM(e,t){let n=t.tagID;(n===X.HTML||n===X.HEAD||n===X.BODY||n===X.BR)&&_M(e,t)}function _M(e,t){e._insertFakeRootElement(),e.insertionMode=$.BEFORE_HEAD,e._processToken(t)}function vM(e,t){switch(t.tagID){case X.HTML:fN(e,t);break;case X.HEAD:e._insertElement(t,J.HTML),e.headElement=e.openElements.current,e.insertionMode=$.IN_HEAD;break;default:bM(e,t)}}function yM(e,t){let n=t.tagID;n===X.HEAD||n===X.BODY||n===X.HTML||n===X.BR?bM(e,t):e._err(t,q.endTagWithoutMatchingOpenElement)}function bM(e,t){e._insertFakeElement(Y.HEAD,X.HEAD),e.headElement=e.openElements.current,e.insertionMode=$.IN_HEAD,e._processToken(t)}function xM(e,t){switch(t.tagID){case X.HTML:fN(e,t);break;case X.BASE:case X.BASEFONT:case X.BGSOUND:case X.LINK:case X.META:e._appendElement(t,J.HTML),t.ackSelfClosing=!0;break;case X.TITLE:e._switchToTextParsing(t,YA.RCDATA);break;case X.NOSCRIPT:e.options.scriptingEnabled?e._switchToTextParsing(t,YA.RAWTEXT):(e._insertElement(t,J.HTML),e.insertionMode=$.IN_HEAD_NO_SCRIPT);break;case X.NOFRAMES:case X.STYLE:e._switchToTextParsing(t,YA.RAWTEXT);break;case X.SCRIPT:e._switchToTextParsing(t,YA.SCRIPT_DATA);break;case X.TEMPLATE:e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=$.IN_TEMPLATE,e.tmplInsertionModeStack.unshift($.IN_TEMPLATE);break;case X.HEAD:e._err(t,q.misplacedStartTagForHeadElement);break;default:wM(e,t)}}function SM(e,t){switch(t.tagID){case X.HEAD:e.openElements.pop(),e.insertionMode=$.AFTER_HEAD;break;case X.BODY:case X.BR:case X.HTML:wM(e,t);break;case X.TEMPLATE:CM(e,t);break;default:e._err(t,q.endTagWithoutMatchingOpenElement)}}function CM(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==X.TEMPLATE&&e._err(t,q.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(X.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,q.endTagWithoutMatchingOpenElement)}function wM(e,t){e.openElements.pop(),e.insertionMode=$.AFTER_HEAD,e._processToken(t)}function TM(e,t){switch(t.tagID){case X.HTML:fN(e,t);break;case X.BASEFONT:case X.BGSOUND:case X.HEAD:case X.LINK:case X.META:case X.NOFRAMES:case X.STYLE:xM(e,t);break;case X.NOSCRIPT:e._err(t,q.nestedNoscriptInHead);break;default:DM(e,t)}}function EM(e,t){switch(t.tagID){case X.NOSCRIPT:e.openElements.pop(),e.insertionMode=$.IN_HEAD;break;case X.BR:DM(e,t);break;default:e._err(t,q.endTagWithoutMatchingOpenElement)}}function DM(e,t){let n=t.type===DA.EOF?q.openElementsLeftAfterEof:q.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=$.IN_HEAD,e._processToken(t)}function OM(e,t){switch(t.tagID){case X.HTML:fN(e,t);break;case X.BODY:e._insertElement(t,J.HTML),e.framesetOk=!1,e.insertionMode=$.IN_BODY;break;case X.FRAMESET:e._insertElement(t,J.HTML),e.insertionMode=$.IN_FRAMESET;break;case X.BASE:case X.BASEFONT:case X.BGSOUND:case X.LINK:case X.META:case X.NOFRAMES:case X.SCRIPT:case X.STYLE:case X.TEMPLATE:case X.TITLE:e._err(t,q.abandonedHeadElementChild),e.openElements.push(e.headElement,X.HEAD),xM(e,t),e.openElements.remove(e.headElement);break;case X.HEAD:e._err(t,q.misplacedStartTagForHeadElement);break;default:AM(e,t)}}function kM(e,t){switch(t.tagID){case X.BODY:case X.HTML:case X.BR:AM(e,t);break;case X.TEMPLATE:CM(e,t);break;default:e._err(t,q.endTagWithoutMatchingOpenElement)}}function AM(e,t){e._insertFakeElement(Y.BODY,X.BODY),e.insertionMode=$.IN_BODY,jM(e,t)}function jM(e,t){switch(t.type){case DA.CHARACTER:NM(e,t);break;case DA.WHITESPACE_CHARACTER:MM(e,t);break;case DA.COMMENT:lM(e,t);break;case DA.START_TAG:fN(e,t);break;case DA.END_TAG:wN(e,t);break;case DA.EOF:TN(e,t)}}function MM(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function NM(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function PM(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function FM(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function IM(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,J.HTML),e.insertionMode=$.IN_FRAMESET)}function LM(e,t){e.openElements.hasInButtonScope(X.P)&&e._closePElement(),e._insertElement(t,J.HTML)}function RM(e,t){e.openElements.hasInButtonScope(X.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&JA.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,J.HTML)}function zM(e,t){e.openElements.hasInButtonScope(X.P)&&e._closePElement(),e._insertElement(t,J.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function BM(e,t){let n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(X.P)&&e._closePElement(),e._insertElement(t,J.HTML),n||(e.formElement=e.openElements.current))}function VM(e,t){e.framesetOk=!1;let n=t.tagID;for(let t=e.openElements.stackTop;t>=0;t--){let r=e.openElements.tagIDs[t];if(n===X.LI&&r===X.LI||(n===X.DD||n===X.DT)&&(r===X.DD||r===X.DT)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.popUntilTagNamePopped(r);break}if(r!==X.ADDRESS&&r!==X.DIV&&r!==X.P&&e._isSpecialElement(e.openElements.items[t],r))break}e.openElements.hasInButtonScope(X.P)&&e._closePElement(),e._insertElement(t,J.HTML)}function HM(e,t){e.openElements.hasInButtonScope(X.P)&&e._closePElement(),e._insertElement(t,J.HTML),e.tokenizer.state=YA.PLAINTEXT}function UM(e,t){e.openElements.hasInScope(X.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(X.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,J.HTML),e.framesetOk=!1}function WM(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(Y.A);n&&(cM(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,J.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function GM(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,J.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function KM(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(X.NOBR)&&(cM(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,J.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function qM(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,J.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function JM(e,t){e.treeAdapter.getDocumentMode(e.document)!==WA.QUIRKS&&e.openElements.hasInButtonScope(X.P)&&e._closePElement(),e._insertElement(t,J.HTML),e.framesetOk=!1,e.insertionMode=$.IN_TABLE}function YM(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,J.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function XM(e){let t=OA(e,UA.TYPE);return t!=null&&t.toLowerCase()===Yj}function ZM(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,J.HTML),XM(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function QM(e,t){e._appendElement(t,J.HTML),t.ackSelfClosing=!0}function $M(e,t){e.openElements.hasInButtonScope(X.P)&&e._closePElement(),e._appendElement(t,J.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function eN(e,t){t.tagName=Y.IMG,t.tagID=X.IMG,YM(e,t)}function tN(e,t){e._insertElement(t,J.HTML),e.skipNextNewLine=!0,e.tokenizer.state=YA.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=$.TEXT}function nN(e,t){e.openElements.hasInButtonScope(X.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,YA.RAWTEXT)}function rN(e,t){e.framesetOk=!1,e._switchToTextParsing(t,YA.RAWTEXT)}function iN(e,t){e._switchToTextParsing(t,YA.RAWTEXT)}function aN(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,J.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===$.IN_TABLE||e.insertionMode===$.IN_CAPTION||e.insertionMode===$.IN_TABLE_BODY||e.insertionMode===$.IN_ROW||e.insertionMode===$.IN_CELL?$.IN_SELECT_IN_TABLE:$.IN_SELECT}function oN(e,t){e.openElements.currentTagId===X.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,J.HTML)}function sN(e,t){e.openElements.hasInScope(X.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,J.HTML)}function cN(e,t){e.openElements.hasInScope(X.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(X.RTC),e._insertElement(t,J.HTML)}function lN(e,t){e._reconstructActiveFormattingElements(),Hj(t),Wj(t),t.selfClosing?e._appendElement(t,J.MATHML):e._insertElement(t,J.MATHML),t.ackSelfClosing=!0}function uN(e,t){e._reconstructActiveFormattingElements(),Uj(t),Wj(t),t.selfClosing?e._appendElement(t,J.SVG):e._insertElement(t,J.SVG),t.ackSelfClosing=!0}function dN(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,J.HTML)}function fN(e,t){switch(t.tagID){case X.I:case X.S:case X.B:case X.U:case X.EM:case X.TT:case X.BIG:case X.CODE:case X.FONT:case X.SMALL:case X.STRIKE:case X.STRONG:GM(e,t);break;case X.A:WM(e,t);break;case X.H1:case X.H2:case X.H3:case X.H4:case X.H5:case X.H6:RM(e,t);break;case X.P:case X.DL:case X.OL:case X.UL:case X.DIV:case X.DIR:case X.NAV:case X.MAIN:case X.MENU:case X.ASIDE:case X.CENTER:case X.FIGURE:case X.FOOTER:case X.HEADER:case X.HGROUP:case X.DIALOG:case X.DETAILS:case X.ADDRESS:case X.ARTICLE:case X.SEARCH:case X.SECTION:case X.SUMMARY:case X.FIELDSET:case X.BLOCKQUOTE:case X.FIGCAPTION:LM(e,t);break;case X.LI:case X.DD:case X.DT:VM(e,t);break;case X.BR:case X.IMG:case X.WBR:case X.AREA:case X.EMBED:case X.KEYGEN:YM(e,t);break;case X.HR:$M(e,t);break;case X.RB:case X.RTC:sN(e,t);break;case X.RT:case X.RP:cN(e,t);break;case X.PRE:case X.LISTING:zM(e,t);break;case X.XMP:nN(e,t);break;case X.SVG:uN(e,t);break;case X.HTML:PM(e,t);break;case X.BASE:case X.LINK:case X.META:case X.STYLE:case X.TITLE:case X.SCRIPT:case X.BGSOUND:case X.BASEFONT:case X.TEMPLATE:xM(e,t);break;case X.BODY:FM(e,t);break;case X.FORM:BM(e,t);break;case X.NOBR:KM(e,t);break;case X.MATH:lN(e,t);break;case X.TABLE:JM(e,t);break;case X.INPUT:ZM(e,t);break;case X.PARAM:case X.TRACK:case X.SOURCE:QM(e,t);break;case X.IMAGE:eN(e,t);break;case X.BUTTON:UM(e,t);break;case X.APPLET:case X.OBJECT:case X.MARQUEE:qM(e,t);break;case X.IFRAME:rN(e,t);break;case X.SELECT:aN(e,t);break;case X.OPTION:case X.OPTGROUP:oN(e,t);break;case X.NOEMBED:case X.NOFRAMES:iN(e,t);break;case X.FRAMESET:IM(e,t);break;case X.TEXTAREA:tN(e,t);break;case X.NOSCRIPT:e.options.scriptingEnabled?iN(e,t):dN(e,t);break;case X.PLAINTEXT:HM(e,t);break;case X.COL:case X.TH:case X.TD:case X.TR:case X.HEAD:case X.FRAME:case X.TBODY:case X.TFOOT:case X.THEAD:case X.CAPTION:case X.COLGROUP:break;default:dN(e,t)}}function pN(e,t){if(e.openElements.hasInScope(X.BODY)&&(e.insertionMode=$.AFTER_BODY,e.options.sourceCodeLocationInfo)){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function mN(e,t){e.openElements.hasInScope(X.BODY)&&(e.insertionMode=$.AFTER_BODY,lP(e,t))}function hN(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function gN(e){let t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(X.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(X.FORM):n&&e.openElements.remove(n))}function _N(e){e.openElements.hasInButtonScope(X.P)||e._insertFakeElement(Y.P,X.P),e._closePElement()}function vN(e){e.openElements.hasInListItemScope(X.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(X.LI),e.openElements.popUntilTagNamePopped(X.LI))}function yN(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function bN(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function xN(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function SN(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(Y.BR,X.BR),e.openElements.pop(),e.framesetOk=!1}function CN(e,t){let n=t.tagName,r=t.tagID;for(let t=e.openElements.stackTop;t>0;t--){let i=e.openElements.items[t],a=e.openElements.tagIDs[t];if(r===a&&(r!==X.UNKNOWN||e.treeAdapter.getTagName(i)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=t&&e.openElements.shortenToLength(t);break}if(e._isSpecialElement(i,a))break}}function wN(e,t){switch(t.tagID){case X.A:case X.B:case X.I:case X.S:case X.U:case X.EM:case X.TT:case X.BIG:case X.CODE:case X.FONT:case X.NOBR:case X.SMALL:case X.STRIKE:case X.STRONG:cM(e,t);break;case X.P:_N(e);break;case X.DL:case X.UL:case X.OL:case X.DIR:case X.DIV:case X.NAV:case X.PRE:case X.MAIN:case X.MENU:case X.ASIDE:case X.BUTTON:case X.CENTER:case X.FIGURE:case X.FOOTER:case X.HEADER:case X.HGROUP:case X.DIALOG:case X.ADDRESS:case X.ARTICLE:case X.DETAILS:case X.SEARCH:case X.SECTION:case X.SUMMARY:case X.LISTING:case X.FIELDSET:case X.BLOCKQUOTE:case X.FIGCAPTION:hN(e,t);break;case X.LI:vN(e);break;case X.DD:case X.DT:yN(e,t);break;case X.H1:case X.H2:case X.H3:case X.H4:case X.H5:case X.H6:bN(e);break;case X.BR:SN(e);break;case X.BODY:pN(e,t);break;case X.HTML:mN(e,t);break;case X.FORM:gN(e);break;case X.APPLET:case X.OBJECT:case X.MARQUEE:xN(e,t);break;case X.TEMPLATE:CM(e,t);break;default:CN(e,t)}}function TN(e,t){e.tmplInsertionModeStack.length>0?sP(e,t):fM(e,t)}function EN(e,t){var n;t.tagID===X.SCRIPT&&((n=e.scriptHandler)==null||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function DN(e,t){e._err(t,q.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function ON(e,t){if(e.openElements.currentTagId!==void 0&&$j.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=$.IN_TABLE_TEXT,t.type){case DA.CHARACTER:VN(e,t);break;case DA.WHITESPACE_CHARACTER:BN(e,t)}else zN(e,t)}function kN(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,J.HTML),e.insertionMode=$.IN_CAPTION}function AN(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,J.HTML),e.insertionMode=$.IN_COLUMN_GROUP}function jN(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Y.COLGROUP,X.COLGROUP),e.insertionMode=$.IN_COLUMN_GROUP,KN(e,t)}function MN(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,J.HTML),e.insertionMode=$.IN_TABLE_BODY}function NN(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Y.TBODY,X.TBODY),e.insertionMode=$.IN_TABLE_BODY,YN(e,t)}function PN(e,t){e.openElements.hasInTableScope(X.TABLE)&&(e.openElements.popUntilTagNamePopped(X.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function FN(e,t){XM(t)?e._appendElement(t,J.HTML):zN(e,t),t.ackSelfClosing=!0}function IN(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,J.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function LN(e,t){switch(t.tagID){case X.TD:case X.TH:case X.TR:NN(e,t);break;case X.STYLE:case X.SCRIPT:case X.TEMPLATE:xM(e,t);break;case X.COL:jN(e,t);break;case X.FORM:IN(e,t);break;case X.TABLE:PN(e,t);break;case X.TBODY:case X.TFOOT:case X.THEAD:MN(e,t);break;case X.INPUT:FN(e,t);break;case X.CAPTION:kN(e,t);break;case X.COLGROUP:AN(e,t);break;default:zN(e,t)}}function RN(e,t){switch(t.tagID){case X.TABLE:e.openElements.hasInTableScope(X.TABLE)&&(e.openElements.popUntilTagNamePopped(X.TABLE),e._resetInsertionMode());break;case X.TEMPLATE:CM(e,t);break;case X.BODY:case X.CAPTION:case X.COL:case X.COLGROUP:case X.HTML:case X.TBODY:case X.TD:case X.TFOOT:case X.TH:case X.THEAD:case X.TR:break;default:zN(e,t)}}function zN(e,t){let n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,jM(e,t),e.fosterParentingEnabled=n}function BN(e,t){e.pendingCharacterTokens.push(t)}function VN(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function HN(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)zN(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}var UN=new Set([X.CAPTION,X.COL,X.COLGROUP,X.TBODY,X.TD,X.TFOOT,X.TH,X.THEAD,X.TR]);function WN(e,t){let n=t.tagID;UN.has(n)?e.openElements.hasInTableScope(X.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(X.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=$.IN_TABLE,LN(e,t)):fN(e,t)}function GN(e,t){let n=t.tagID;switch(n){case X.CAPTION:case X.TABLE:e.openElements.hasInTableScope(X.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(X.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=$.IN_TABLE,n===X.TABLE&&RN(e,t));break;case X.BODY:case X.COL:case X.COLGROUP:case X.HTML:case X.TBODY:case X.TD:case X.TFOOT:case X.TH:case X.THEAD:case X.TR:break;default:wN(e,t)}}function KN(e,t){switch(t.tagID){case X.HTML:fN(e,t);break;case X.COL:e._appendElement(t,J.HTML),t.ackSelfClosing=!0;break;case X.TEMPLATE:xM(e,t);break;default:JN(e,t)}}function qN(e,t){switch(t.tagID){case X.COLGROUP:e.openElements.currentTagId===X.COLGROUP&&(e.openElements.pop(),e.insertionMode=$.IN_TABLE);break;case X.TEMPLATE:CM(e,t);break;case X.COL:break;default:JN(e,t)}}function JN(e,t){e.openElements.currentTagId===X.COLGROUP&&(e.openElements.pop(),e.insertionMode=$.IN_TABLE,e._processToken(t))}function YN(e,t){switch(t.tagID){case X.TR:e.openElements.clearBackToTableBodyContext(),e._insertElement(t,J.HTML),e.insertionMode=$.IN_ROW;break;case X.TH:case X.TD:e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(Y.TR,X.TR),e.insertionMode=$.IN_ROW,ZN(e,t);break;case X.CAPTION:case X.COL:case X.COLGROUP:case X.TBODY:case X.TFOOT:case X.THEAD:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE,LN(e,t));break;default:LN(e,t)}}function XN(e,t){let n=t.tagID;switch(t.tagID){case X.TBODY:case X.TFOOT:case X.THEAD:e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE);break;case X.TABLE:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE,RN(e,t));break;case X.BODY:case X.CAPTION:case X.COL:case X.COLGROUP:case X.HTML:case X.TD:case X.TH:case X.TR:break;default:RN(e,t)}}function ZN(e,t){switch(t.tagID){case X.TH:case X.TD:e.openElements.clearBackToTableRowContext(),e._insertElement(t,J.HTML),e.insertionMode=$.IN_CELL,e.activeFormattingElements.insertMarker();break;case X.CAPTION:case X.COL:case X.COLGROUP:case X.TBODY:case X.TFOOT:case X.THEAD:case X.TR:e.openElements.hasInTableScope(X.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE_BODY,YN(e,t));break;default:LN(e,t)}}function QN(e,t){switch(t.tagID){case X.TR:e.openElements.hasInTableScope(X.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE_BODY);break;case X.TABLE:e.openElements.hasInTableScope(X.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE_BODY,XN(e,t));break;case X.TBODY:case X.TFOOT:case X.THEAD:(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(X.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE_BODY,XN(e,t));break;case X.BODY:case X.CAPTION:case X.COL:case X.COLGROUP:case X.HTML:case X.TD:case X.TH:break;default:RN(e,t)}}function $N(e,t){let n=t.tagID;UN.has(n)?(e.openElements.hasInTableScope(X.TD)||e.openElements.hasInTableScope(X.TH))&&(e._closeTableCell(),ZN(e,t)):fN(e,t)}function eP(e,t){let n=t.tagID;switch(n){case X.TD:case X.TH:e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=$.IN_ROW);break;case X.TABLE:case X.TBODY:case X.TFOOT:case X.THEAD:case X.TR:e.openElements.hasInTableScope(n)&&(e._closeTableCell(),QN(e,t));break;case X.BODY:case X.CAPTION:case X.COL:case X.COLGROUP:case X.HTML:break;default:wN(e,t)}}function tP(e,t){switch(t.tagID){case X.HTML:fN(e,t);break;case X.OPTION:e.openElements.currentTagId===X.OPTION&&e.openElements.pop(),e._insertElement(t,J.HTML);break;case X.OPTGROUP:e.openElements.currentTagId===X.OPTION&&e.openElements.pop(),e.openElements.currentTagId===X.OPTGROUP&&e.openElements.pop(),e._insertElement(t,J.HTML);break;case X.HR:e.openElements.currentTagId===X.OPTION&&e.openElements.pop(),e.openElements.currentTagId===X.OPTGROUP&&e.openElements.pop(),e._appendElement(t,J.HTML),t.ackSelfClosing=!0;break;case X.INPUT:case X.KEYGEN:case X.TEXTAREA:case X.SELECT:e.openElements.hasInSelectScope(X.SELECT)&&(e.openElements.popUntilTagNamePopped(X.SELECT),e._resetInsertionMode(),t.tagID!==X.SELECT&&e._processStartTag(t));break;case X.SCRIPT:case X.TEMPLATE:xM(e,t)}}function nP(e,t){switch(t.tagID){case X.OPTGROUP:e.openElements.stackTop>0&&e.openElements.currentTagId===X.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===X.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===X.OPTGROUP&&e.openElements.pop();break;case X.OPTION:e.openElements.currentTagId===X.OPTION&&e.openElements.pop();break;case X.SELECT:e.openElements.hasInSelectScope(X.SELECT)&&(e.openElements.popUntilTagNamePopped(X.SELECT),e._resetInsertionMode());break;case X.TEMPLATE:CM(e,t)}}function rP(e,t){let n=t.tagID;n===X.CAPTION||n===X.TABLE||n===X.TBODY||n===X.TFOOT||n===X.THEAD||n===X.TR||n===X.TD||n===X.TH?(e.openElements.popUntilTagNamePopped(X.SELECT),e._resetInsertionMode(),e._processStartTag(t)):tP(e,t)}function iP(e,t){let n=t.tagID;n===X.CAPTION||n===X.TABLE||n===X.TBODY||n===X.TFOOT||n===X.THEAD||n===X.TR||n===X.TD||n===X.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(X.SELECT),e._resetInsertionMode(),e.onEndTag(t)):nP(e,t)}function aP(e,t){switch(t.tagID){case X.BASE:case X.BASEFONT:case X.BGSOUND:case X.LINK:case X.META:case X.NOFRAMES:case X.SCRIPT:case X.STYLE:case X.TEMPLATE:case X.TITLE:xM(e,t);break;case X.CAPTION:case X.COLGROUP:case X.TBODY:case X.TFOOT:case X.THEAD:e.tmplInsertionModeStack[0]=$.IN_TABLE,e.insertionMode=$.IN_TABLE,LN(e,t);break;case X.COL:e.tmplInsertionModeStack[0]=$.IN_COLUMN_GROUP,e.insertionMode=$.IN_COLUMN_GROUP,KN(e,t);break;case X.TR:e.tmplInsertionModeStack[0]=$.IN_TABLE_BODY,e.insertionMode=$.IN_TABLE_BODY,YN(e,t);break;case X.TD:case X.TH:e.tmplInsertionModeStack[0]=$.IN_ROW,e.insertionMode=$.IN_ROW,ZN(e,t);break;default:e.tmplInsertionModeStack[0]=$.IN_BODY,e.insertionMode=$.IN_BODY,fN(e,t)}}function oP(e,t){t.tagID===X.TEMPLATE&&CM(e,t)}function sP(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(X.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):fM(e,t)}function cP(e,t){t.tagID===X.HTML?fN(e,t):uP(e,t)}function lP(e,t){if(t.tagID===X.HTML){if(e.fragmentContext||(e.insertionMode=$.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===X.HTML){e._setEndLocation(e.openElements.items[0],t);let n=e.openElements.items[1];n&&!e.treeAdapter.getNodeSourceCodeLocation(n)?.endTag&&e._setEndLocation(n,t)}}else uP(e,t)}function uP(e,t){e.insertionMode=$.IN_BODY,jM(e,t)}function dP(e,t){switch(t.tagID){case X.HTML:fN(e,t);break;case X.FRAMESET:e._insertElement(t,J.HTML);break;case X.FRAME:e._appendElement(t,J.HTML),t.ackSelfClosing=!0;break;case X.NOFRAMES:xM(e,t)}}function fP(e,t){t.tagID===X.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==X.FRAMESET&&(e.insertionMode=$.AFTER_FRAMESET))}function pP(e,t){switch(t.tagID){case X.HTML:fN(e,t);break;case X.NOFRAMES:xM(e,t)}}function mP(e,t){t.tagID===X.HTML&&(e.insertionMode=$.AFTER_AFTER_FRAMESET)}function hP(e,t){t.tagID===X.HTML?fN(e,t):gP(e,t)}function gP(e,t){e.insertionMode=$.IN_BODY,jM(e,t)}function _P(e,t){switch(t.tagID){case X.HTML:fN(e,t);break;case X.NOFRAMES:xM(e,t)}}function vP(e,t){t.chars=`�`,e._insertCharacters(t)}function yP(e,t){e._insertCharacters(t),e.framesetOk=!1}function bP(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==J.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function xP(e,t){if(Vj(t))bP(e),e._startTagOutsideForeignContent(t);else{let n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===J.MATHML?Hj(t):r===J.SVG&&(Gj(t),Uj(t)),Wj(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function SP(e,t){if(t.tagID===X.P||t.tagID===X.BR){bP(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){let r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===J.HTML){e._endTagOutsideForeignContent(t);break}let i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}Y.AREA,Y.BASE,Y.BASEFONT,Y.BGSOUND,Y.BR,Y.COL,Y.EMBED,Y.FRAME,Y.HR,Y.IMG,Y.INPUT,Y.KEYGEN,Y.LINK,Y.META,Y.PARAM,Y.SOURCE,Y.TRACK,Y.WBR;var CP=TP(`end`),wP=TP(`start`);function TP(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function EP(e){let t=wP(e),n=CP(e);if(t&&n)return{start:t,end:n}}var DP=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,OP=new Set([`mdxFlowExpression`,`mdxJsxFlowElement`,`mdxJsxTextElement`,`mdxTextExpression`,`mdxjsEsm`]),kP={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function AP(e,t){let n=WP(e),r=rA(`type`,{handlers:{root:MP,element:NP,text:PP,comment:LP,doctype:FP,raw:RP},unknown:zP}),i={parser:n?new tM(kP):tM.getFragmentParser(void 0,kP),handle(e){r(e,i)},stitches:!1,options:t||{}};r(e,i),BP(i,wP());let a=Jk(n?i.parser.document:i.parser.getFragment(),{file:i.options.file});return i.stitches&&yO(a,`comment`,function(e,t,n){let r=e;if(r.value.stitch&&n&&t!==void 0){let e=n.children;return e[t]=r.value.stitch,t}}),a.type===`root`&&a.children.length===1&&a.children[0].type===e.type?a.children[0]:a}function jP(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function MP(e,t){jP(e.children,t)}function NP(e,t){HP(e,t),jP(e.children,t),UP(e,t)}function PP(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);let n={type:DA.CHARACTER,chars:e.value,location:GP(e)};BP(t,wP(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function FP(e,t){let n={type:DA.DOCTYPE,name:`html`,forceQuirks:!1,publicId:``,systemId:``,location:GP(e)};BP(t,wP(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function IP(e,t){t.stitches=!0;let n=KP(e);`children`in e&&`children`in n&&(n.children=AP({type:`root`,children:e.children},t.options).children),LP({type:`comment`,value:{stitch:n}},t)}function LP(e,t){let n=e.value,r={type:DA.COMMENT,data:n,location:GP(e)};BP(t,wP(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function RP(e,t){if(t.parser.tokenizer.preprocessor.html=``,t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,VP(t,wP(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(DP,`&lt;$1$2`):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;let e=t.parser.tokenizer._consume();t.parser.tokenizer._callState(e)}}function zP(e,t){let n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))IP(n,t);else{let e=``;throw OP.has(n.type)&&(e=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),Error("Cannot compile `"+n.type+"` node"+e)}}function BP(e,t){VP(e,t);let n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=YA.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:``,value:``}}function VP(e,t){if(t&&t.offset!==void 0){let n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function HP(e,t){let n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===YA.PLAINTEXT)return;BP(t,wP(e));let r=t.parser.openElements.current,i=`namespaceURI`in r?r.namespaceURI:Gk.html;i===Gk.html&&n===`svg`&&(i=Gk.svg);let a=sA({...e,children:[]},{space:i===Gk.svg?`svg`:`html`}),o={type:DA.START_TAG,tagName:n,tagID:KA(n),selfClosing:!1,ackSelfClosing:!1,attrs:`attrs`in a?a.attrs:[],location:GP(e)};t.parser.currentToken=o,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function UP(e,t){let n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&_A.includes(n)||t.parser.tokenizer.state===YA.PLAINTEXT)return;BP(t,CP(e));let r={type:DA.END_TAG,tagName:n,tagID:KA(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:GP(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===YA.RCDATA||t.parser.tokenizer.state===YA.RAWTEXT||t.parser.tokenizer.state===YA.SCRIPT_DATA)&&(t.parser.tokenizer.state=YA.DATA)}function WP(e){let t=e.type===`root`?e.children[0]:e;return!!(t&&(t.type===`doctype`||t.type===`element`&&t.tagName.toLowerCase()===`html`))}function GP(e){let t=wP(e)||{line:void 0,column:void 0,offset:void 0},n=CP(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function KP(e){return`children`in e?GO({...e,children:[]}):GO(e)}function qP(e){return function(t,n){return AP(t,{...e,file:n})}}var JP=[`ariaDescribedBy`,`ariaLabel`,`ariaLabelledBy`],YP={ancestors:{tbody:[`table`],td:[`table`],th:[`table`],thead:[`table`],tfoot:[`table`],tr:[`table`]},attributes:{a:[...JP,`dataFootnoteBackref`,`dataFootnoteRef`,[`className`,`data-footnote-backref`],`href`],blockquote:[`cite`],code:[[`className`,/^language-./]],del:[`cite`],div:[`itemScope`,`itemType`],dl:[...JP],h2:[[`className`,`sr-only`]],img:[...JP,`longDesc`,`src`],input:[[`disabled`,!0],[`type`,`checkbox`]],ins:[`cite`],li:[[`className`,`task-list-item`]],ol:[...JP,[`className`,`contains-task-list`]],q:[`cite`],section:[`dataFootnotes`,[`className`,`footnotes`]],source:[`srcSet`],summary:[...JP],table:[...JP],ul:[...JP,[`className`,`contains-task-list`]],"*":`abbr.accept.acceptCharset.accessKey.action.align.alt.axis.border.cellPadding.cellSpacing.char.charOff.charSet.checked.clear.colSpan.color.cols.compact.coords.dateTime.dir.encType.frame.hSpace.headers.height.hrefLang.htmlFor.id.isMap.itemProp.label.lang.maxLength.media.method.multiple.name.noHref.noShade.noWrap.open.prompt.readOnly.rev.rowSpan.rows.rules.scope.selected.shape.size.span.start.summary.tabIndex.title.useMap.vAlign.value.width`.split(`.`)},clobber:[`ariaDescribedBy`,`ariaLabelledBy`,`id`,`name`],clobberPrefix:`user-content-`,protocols:{cite:[`http`,`https`],href:[`http`,`https`,`irc`,`ircs`,`mailto`,`xmpp`],longDesc:[`http`,`https`],src:[`http`,`https`]},required:{input:{disabled:!0,type:`checkbox`}},strip:[`script`],tagNames:`a.b.blockquote.br.code.dd.del.details.div.dl.dt.em.h1.h2.h3.h4.h5.h6.hr.i.img.input.ins.kbd.li.ol.p.picture.pre.q.rp.rt.ruby.s.samp.section.source.span.strike.strong.sub.summary.sup.table.tbody.td.tfoot.th.thead.tr.tt.ul.var`.split(`.`)},XP={}.hasOwnProperty;function ZP(e,t){let n={type:`root`,children:[]},r=QP({schema:t?{...YP,...t}:YP,stack:[]},e);return r&&(Array.isArray(r)?r.length===1?n=r[0]:n.children=r:n=r),n}function QP(e,t){if(t&&typeof t==`object`){let n=t;switch(typeof n.type==`string`?n.type:``){case`comment`:return $P(e,n);case`doctype`:return eF(e,n);case`element`:return tF(e,n);case`root`:return nF(e,n);case`text`:return rF(e,n)}}}function $P(e,t){if(e.schema.allowComments){let e=typeof t.value==`string`?t.value:``,n=e.indexOf(`-->`),r={type:`comment`,value:n<0?e:e.slice(0,n)};return uF(r,t),r}}function eF(e,t){if(e.schema.allowDoctypes){let e={type:`doctype`};return uF(e,t),e}}function tF(e,t){let n=typeof t.tagName==`string`?t.tagName:``;e.stack.push(n);let r=iF(e,t.children),i=aF(e,t.properties);e.stack.pop();let a=!1;if(n&&n!==`*`&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(a=!0,e.schema.ancestors&&XP.call(e.schema.ancestors,n))){let t=e.schema.ancestors[n],r=-1;for(a=!1;++r<t.length;)e.stack.includes(t[r])&&(a=!0)}if(!a)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;let o={type:`element`,tagName:n,properties:i,children:r};return uF(o,t),o}function nF(e,t){let n={type:`root`,children:iF(e,t.children)};return uF(n,t),n}function rF(e,t){let n={type:`text`,value:typeof t.value==`string`?t.value:``};return uF(n,t),n}function iF(e,t){let n=[];if(Array.isArray(t)){let r=t,i=-1;for(;++i<r.length;){let t=QP(e,r[i]);t&&(Array.isArray(t)?n.push(...t):n.push(t))}}return n}function aF(e,t){let n=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,a=r&&XP.call(r,n)?r[n]:void 0,o=r&&XP.call(r,`*`)?r[`*`]:void 0,s=t&&typeof t==`object`?t:{},c={},l;for(l in s)if(XP.call(s,l)){let t=s[l],n=oF(e,dF(a,l),l,t);n??=oF(e,dF(o,l),l,t),n!=null&&(c[l]=n)}if(i&&XP.call(i,n)){let e=i[n];for(l in e)XP.call(e,l)&&!XP.call(c,l)&&(c[l]=e[l])}return c}function oF(e,t,n,r){return t?Array.isArray(r)?sF(e,t,n,r):cF(e,t,n,r):void 0}function sF(e,t,n,r){let i=-1,a=[];for(;++i<r.length;){let o=cF(e,t,n,r[i]);(typeof o==`number`||typeof o==`string`)&&a.push(o)}return a}function cF(e,t,n,r){if((typeof r==`boolean`||typeof r==`number`||typeof r==`string`)&&lF(e,n,r)){if(typeof t==`object`&&t.length>1){let e=!1,n=0;for(;++n<t.length;){let i=t[n];if(i&&typeof i==`object`&&`flags`in i){if(i.test(String(r))){e=!0;break}}else if(i===r){e=!0;break}}if(!e)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function lF(e,t,n){let r=e.schema.protocols&&XP.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;let i=String(n),a=i.indexOf(`:`),o=i.indexOf(`?`),s=i.indexOf(`#`),c=i.indexOf(`/`);if(a<0||c>-1&&a>c||o>-1&&a>o||s>-1&&a>s)return!0;let l=-1;for(;++l<r.length;){let e=r[l];if(a===e.length&&i.slice(0,e.length)===e)return!0}return!1}function uF(e,t){let n=EP(t);t.data&&(e.data=GO(t.data)),n&&(e.position=n)}function dF(e,t){let n,r=-1;if(e)for(;++r<e.length;){let i=e[r],a=typeof i==`string`?i:i[0];if(a===t)return i;a===`data*`&&(n=i)}if(t.length>4&&t.slice(0,4).toLowerCase()===`data`)return n}function fF(e){return function(t){return ZP(t,e)}}function pF(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}var mF=EF(/[A-Za-z]/),hF=EF(/[\dA-Za-z]/),gF=EF(/[#-'*+\--9=?A-Z^-~]/);function _F(e){return e!==null&&(e<32||e===127)}var vF=EF(/\d/),yF=EF(/[\dA-Fa-f]/),bF=EF(/[!-/:-@[-`{-~]/);function xF(e){return e!==null&&e<-2}function SF(e){return e!==null&&(e<0||e===32)}function CF(e){return e===-2||e===-1||e===32}var wF=EF(/\p{P}|\p{S}/u),TF=EF(/\s/);function EF(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function DF(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function OF(e,t,n){let r=sO((n||{}).ignore||[]),i=kF(t),a=-1;for(;++a<i.length;)_O(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function kF(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([AF(e[0]),jF(e[1])])}return t}function AF(e){return typeof e==`string`?new RegExp(DF(e),`g`):e}function jF(e){return typeof e==`function`?e:function(){return e}}var MF=`phrasing`,NF=[`autolink`,`link`,`image`,`label`];function PF(){return{transforms:[HF],enter:{literalAutolink:IF,literalAutolinkEmail:LF,literalAutolinkHttp:LF,literalAutolinkWww:LF},exit:{literalAutolink:VF,literalAutolinkEmail:BF,literalAutolinkHttp:RF,literalAutolinkWww:zF}}}function FF(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:MF,notInConstruct:NF},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:MF,notInConstruct:NF},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:MF,notInConstruct:NF}]}}function IF(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function LF(e){this.config.enter.autolinkProtocol.call(this,e)}function RF(e){this.config.exit.autolinkProtocol.call(this,e)}function zF(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function BF(e){this.config.exit.autolinkEmail.call(this,e)}function VF(e){this.exit(e)}function HF(e){OF(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,UF],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,WF]],{ignore:[`link`,`linkReference`]})}function UF(e,t,n,r,i){let a=``;if(!qF(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!GF(n)))return!1;let o=KF(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function WF(e,t,n,r){return!qF(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function GF(e){let 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 KF(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=pF(e,`(`),a=pF(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function qF(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||TF(n)||wF(n))&&(!t||n!==47)}function JF(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}iI.peek=rI;function YF(){this.buffer()}function XF(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function ZF(){this.buffer()}function QF(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function $F(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=JF(this.sliceSerialize(e)).toLowerCase(),n.label=t}function eI(e){this.exit(e)}function tI(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=JF(this.sliceSerialize(e)).toLowerCase(),n.label=t}function nI(e){this.exit(e)}function rI(){return`[`}function iI(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function aI(){return{enter:{gfmFootnoteCallString:YF,gfmFootnoteCall:XF,gfmFootnoteDefinitionLabelString:ZF,gfmFootnoteDefinition:QF},exit:{gfmFootnoteCallString:$F,gfmFootnoteCall:eI,gfmFootnoteDefinitionLabelString:tI,gfmFootnoteDefinition:nI}}}function oI(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:iI},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
51
+ `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?cI:sI))),s(),o}}function sI(e,t,n){return t===0?e:cI(e,t,n)}function cI(e,t,n){return(n?``:` `)+e}var lI=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];mI.peek=hI;function uI(){return{canContainEols:[`delete`],enter:{strikethrough:fI},exit:{strikethrough:pI}}}function dI(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:lI}],handlers:{delete:mI}}}function fI(e){this.enter({type:`delete`,children:[]},e)}function pI(e){this.exit(e)}function mI(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function hI(){return`~`}function gI(e){return e.length}function _I(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||gI,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=vI(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=yI(r[d]);else{let e=yI(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&(n.alignDelimiters!==!1||i!==``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
52
+ `)}function vI(e){return e==null?``:String(e)}function yI(e){let 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 bI(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),xI);return i(),o}function xI(e,t,n){return`>`+(n?``:` `)+e}function SI(e,t){return CI(e,t.inConstruct,!0)&&!CI(e,t.notInConstruct,!1)}function CI(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 wI(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
53
+ `&&SI(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
54
+ `}function TI(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function EI(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 DI(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function OI(e,t,n,r){let i=DI(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(EI(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,kI);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(TI(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
55
+ `,encode:["`"],...s.current()})),t()}return u+=s.move(`
56
+ `),a&&(u+=s.move(a+`
57
+ `)),u+=s.move(c),l(),u}function kI(e,t,n){return(n?``:` `)+e}function AI(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function jI(e,t,n,r){let i=AI(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
58
+ `,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function MI(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function NI(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function PI(e){if(e===null||SF(e)||TF(e))return 1;if(wF(e))return 2}function FI(e,t,n){let r=PI(e),i=PI(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}II.peek=LI;function II(e,t,n,r){let i=MI(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=FI(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=NI(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=FI(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+NI(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function LI(e,t,n){return n.options.emphasis||`*`}var RI={};function zI(e,t){let n=t||RI;return BI(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function BI(e,t,n){if(HI(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 VI(e.children,t,n)}return Array.isArray(e)?VI(e,t,n):``}function VI(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=BI(e[i],t,n);return r.join(``)}function HI(e){return!!(e&&typeof e==`object`)}function UI(e,t){let n=!1;return yO(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&zI(e)&&(t.options.setext||n))}function WI(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(UI(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
59
+ `,after:`
60
+ `});return r(),t(),o+`
61
+ `+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
62
+ `))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
63
+ `,...a.current()});return/^[\t ]/.test(l)&&(l=NI(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}GI.peek=KI;function GI(e){return e.value||``}function KI(){return`<`}qI.peek=JI;function qI(e,t,n,r){let i=AI(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function JI(){return`!`}YI.peek=XI;function YI(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function XI(){return`!`}ZI.peek=QI;function ZI(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function QI(){return"`"}function $I(e,t){let n=zI(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))}eL.peek=tL;function eL(e,t,n,r){let i=AI(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if($I(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function tL(e,t,n){return $I(e,n)?`<`:`[`}nL.peek=rL;function nL(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function rL(){return`[`}function iL(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function aL(e){let t=iL(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function oL(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function sL(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function cL(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?oL(n):iL(n),s=e.ordered?o===`.`?`)`:`.`:aL(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.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&&(c=!0),sL(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function lL(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function uL(e,t,n,r){let i=lL(n),a=n.bulletCurrent||iL(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function dL(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var fL=sO([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function pL(e,t,n,r){return(e.children.some(function(e){return fL(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function mL(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}hL.peek=gL;function hL(e,t,n,r){let i=mL(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=FI(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=NI(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=FI(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+NI(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function gL(e,t,n){return n.options.strong||`*`}function _L(e,t,n,r){return n.safe(e.value,r)}function vL(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function yL(e,t,n){let r=(sL(n)+(n.options.ruleSpaces?` `:``)).repeat(vL(n));return n.options.ruleSpaces?r.slice(0,-1):r}var bL={blockquote:bI,break:wI,code:OI,definition:jI,emphasis:II,hardBreak:wI,heading:WI,html:GI,image:qI,imageReference:YI,inlineCode:ZI,link:eL,linkReference:nL,list:cL,listItem:uL,paragraph:dL,root:pL,strong:hL,text:_L,thematicBreak:yL},xL=document.createElement(`i`);function SL(e){let t=`&`+e+`;`;xL.innerHTML=t;let n=xL.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function CL(e,t){let 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)}var wL=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function TL(e){return e.replace(wL,EL)}function EL(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return CL(n.slice(t?2:1),t?16:10)}return SL(n)||e}function DL(){return{enter:{table:OL,tableData:ML,tableHeader:ML,tableRow:AL},exit:{codeText:NL,table:kL,tableData:jL,tableHeader:jL,tableRow:jL}}}function OL(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function kL(e){this.exit(e),this.data.inTable=void 0}function AL(e){this.enter({type:`tableRow`,children:[]},e)}function jL(e){this.exit(e)}function ML(e){this.enter({type:`tableCell`,children:[]},e)}function NL(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,PL));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function PL(e,t){return t===`|`?t:e}function FL(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
64
+ `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
65
+ `))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return _I(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=bL.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function IL(){return{exit:{taskListCheckValueChecked:RL,taskListCheckValueUnchecked:RL,paragraph:zL}}}function LL(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:BL}}}function RL(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function zL(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function BL(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=bL.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function VL(){return[PF(),aI(),uI(),DL(),IL()]}function HL(e){return{extensions:[FF(),oI(e),dI(),FL(e),LL()]}}function UL(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function WL(e,t){return e.length>0?(UL(e,e.length,0,t),e):t}var GL={}.hasOwnProperty;function KL(e){let t={},n=-1;for(;++n<e.length;)qL(t,e[n]);return t}function qL(e,t){let n;for(n in t){let r=(GL.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){GL.call(r,a)||(r[a]=[]);let e=i[a];JL(r[a],Array.isArray(e)?e:e?[e]:[])}}}function JL(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);UL(e,0,0,r)}var YL={tokenize:lR,partial:!0},XL={tokenize:uR,partial:!0},ZL={tokenize:dR,partial:!0},QL={tokenize:fR,partial:!0},$L={tokenize:pR,partial:!0},eR={name:`wwwAutolink`,tokenize:sR,previous:mR},tR={name:`protocolAutolink`,tokenize:cR,previous:hR},nR={name:`emailAutolink`,tokenize:oR,previous:gR},rR={};function iR(){return{text:rR}}for(var aR=48;aR<123;)rR[aR]=nR,aR++,aR===58?aR=65:aR===91&&(aR=97);rR[43]=nR,rR[45]=nR,rR[46]=nR,rR[95]=nR,rR[72]=[nR,tR],rR[104]=[nR,tR],rR[87]=[nR,eR],rR[119]=[nR,eR];function oR(e,t,n){let r=this,i,a;return o;function o(t){return!_R(t)||!gR.call(r,r.previous)||vR(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return _R(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check($L,u,l)(t):t===45||t===95||hF(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&mF(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function sR(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!mR.call(r,r.previous)||vR(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(YL,e.attempt(XL,e.attempt(ZL,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function cR(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&hR.call(r,r.previous)&&!vR(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(mF(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||_F(t)||SF(t)||TF(t)||wF(t)?n(t):e.attempt(XL,e.attempt(ZL,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function lR(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function uR(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(QL,c,s)(t):t===null||SF(t)||TF(t)||t!==45&&wF(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function dR(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(QL,t,a)(o):o===null||SF(o)||TF(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function fR(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||SF(o)||TF(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||SF(e)||TF(e)?t(e):r(e)}function a(e){return mF(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):mF(t)?(e.consume(t),o):n(t)}}function pR(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return hF(e)?n(e):t(e)}}function mR(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||SF(e)}function hR(e){return!mF(e)}function gR(e){return!(e===47||_R(e))}function _R(e){return e===43||e===45||e===46||e===95||hF(e)}function vR(e){let t=e.length,n=!1;for(;t--;){let 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}function yR(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&hF(e.charCodeAt(n+1))&&hF(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function bR(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var xR={name:`attention`,resolveAll:SR,tokenize:CR};function SR(e,t){let n=-1,r,i,a,o,s,c,l,u;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;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};wR(d,-c),wR(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=WL(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=WL(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=WL(l,bR(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=WL(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=WL(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,UL(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function CR(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=PI(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=PI(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function wR(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var TR={name:`autolink`,tokenize:ER};function ER(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return mF(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||hF(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||hF(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||_F(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):gF(t)?(e.consume(t),l):n(t)}function u(e){return hF(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||hF(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}function DR(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return CF(r)?(e.enter(n),s(r)):t(r)}function s(r){return CF(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var OR={partial:!0,tokenize:kR};function kR(e,t,n){return r;function r(t){return CF(t)?DR(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||xF(e)?t(e):n(e)}}var AR={continuation:{tokenize:MR},exit:NR,name:`blockQuote`,tokenize:jR};function jR(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return CF(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function MR(e,t,n){let r=this;return i;function i(t){return CF(t)?DR(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(AR,t,n)(r)}}function NR(e){e.exit(`blockQuote`)}var PR={name:`characterEscape`,tokenize:FR};function FR(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return bF(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var IR={name:`characterReference`,tokenize:LR};function LR(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=hF,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=yF,u):(e.enter(`characterReferenceValue`),a=7,o=vF,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===hF&&!SL(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var RR={partial:!0,tokenize:VR},zR={concrete:!0,name:`codeFenced`,tokenize:BR};function BR(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),CF(t)?DR(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||xF(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(RR,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||xF(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):CF(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),DR(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||xF(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||xF(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&CF(t)?DR(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||xF(t)?e.check(RR,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||xF(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),CF(t)?DR(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),CF(t)?DR(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||xF(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function VR(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var HR={name:`codeIndented`,tokenize:WR},UR={partial:!0,tokenize:GR};function WR(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),DR(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):xF(t)?e.attempt(UR,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||xF(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function GR(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):xF(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):DR(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):xF(e)?i(e):n(e)}}var KR={name:`codeText`,previous:JR,resolve:qR,tokenize:YR};function qR(e){let t=e.length-4,n=3,r,i;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;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function JR(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function YR(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):xF(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||xF(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var XR=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&ZR(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),ZR(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),ZR(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);ZR(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);ZR(this.left,t.reverse())}}}};function ZR(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 QR(e){let t={},n=-1,r,i,a,o,s,c,l,u=new XR(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,$R(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return UL(e,0,1/0,u.slice(0)),!l}function $R(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var ez={resolve:nz,tokenize:rz},tz={partial:!0,tokenize:iz};function nz(e){return QR(e),e}function rz(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):xF(t)?e.check(tz,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function iz(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),DR(e,a,`linePrefix`)}function a(i){if(i===null||xF(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function az(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||_F(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||xF(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||SF(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||_F(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function oz(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):xF(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||xF(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!CF(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function sz(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):xF(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),DR(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||xF(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function cz(e,t){let n;return r;function r(i){return xF(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):CF(i)?DR(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var lz={name:`definition`,tokenize:dz},uz={partial:!0,tokenize:fz};function dz(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return oz.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=JF(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return SF(t)?cz(e,l)(t):l(t)}function l(t){return az(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(uz,d,d)(t)}function d(t){return CF(t)?DR(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||xF(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function fz(e,t,n){return r;function r(t){return SF(t)?cz(e,i)(t):n(t)}function i(t){return sz(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return CF(t)?DR(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||xF(e)?t(e):n(e)}}var pz={name:`hardBreakEscape`,tokenize:mz};function mz(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return xF(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var hz={name:`headingAtx`,resolve:gz,tokenize:_z};function gz(e,t){let n=e.length-2,r=3,i,a;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&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},UL(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function _z(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||SF(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||xF(n)?(e.exit(`atxHeading`),t(n)):CF(n)?DR(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||SF(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var vz=`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`.split(`.`),yz=[`pre`,`script`,`style`,`textarea`],bz={concrete:!0,name:`htmlFlow`,resolveTo:Cz,tokenize:wz},xz={partial:!0,tokenize:Ez},Sz={partial:!0,tokenize:Tz};function Cz(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 wz(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:I):mF(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):mF(a)?(e.consume(a),i=4,r.interrupt?t:I):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:I):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return mF(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||SF(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&yz.includes(l)?(i=1,r.interrupt?t(s):O(s)):vz.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||hF(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return CF(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||mF(t)?(e.consume(t),b):CF(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||hF(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):CF(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):CF(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||xF(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||SF(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||CF(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||xF(t)?O(t):CF(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),N):t===62&&i===4?(e.consume(t),L):t===63&&i===3?(e.consume(t),I):t===93&&i===5?(e.consume(t),F):xF(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(xz,ee,k)(t)):t===null||xF(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(Sz,A,ee)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||xF(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),I):O(t)}function N(t){return t===47?(e.consume(t),o=``,P):O(t)}function P(t){if(t===62){let n=o.toLowerCase();return yz.includes(n)?(e.consume(t),L):O(t)}return mF(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),P):O(t)}function F(t){return t===93?(e.consume(t),I):O(t)}function I(t){return t===62?(e.consume(t),L):t===45&&i===2?(e.consume(t),I):O(t)}function L(t){return t===null||xF(t)?(e.exit(`htmlFlowData`),ee(t)):(e.consume(t),L)}function ee(n){return e.exit(`htmlFlow`),t(n)}}function Tz(e,t,n){let r=this;return i;function i(t){return xF(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function Ez(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(OR,t,n)}}var Dz={name:`htmlText`,tokenize:Oz};function Oz(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):mF(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):mF(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):xF(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):xF(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):xF(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):xF(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return mF(t)?(e.consume(t),S):n(t)}function S(t){return t===45||hF(t)?(e.consume(t),S):C(t)}function C(t){return xF(t)?(o=C,N(t)):CF(t)?(e.consume(t),C):M(t)}function w(t){return t===45||hF(t)?(e.consume(t),w):t===47||t===62||SF(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||mF(t)?(e.consume(t),E):xF(t)?(o=T,N(t)):CF(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||hF(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):xF(t)?(o=D,N(t)):CF(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):xF(t)?(o=O,N(t)):CF(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):xF(t)?(o=k,N(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||SF(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||SF(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),P}function P(t){return CF(t)?DR(e,F,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):F(t)}function F(t){return e.enter(`htmlTextData`),o(t)}}var kz={name:`labelEnd`,resolveAll:Nz,resolveTo:Pz,tokenize:Fz},Az={tokenize:Iz},jz={tokenize:Lz},Mz={tokenize:Rz};function Nz(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&UL(e,0,e.length,n),e}function Pz(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=WL(s,e.slice(a+1,a+r+3)),s=WL(s,[[`enter`,u,t]]),s=WL(s,bR(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=WL(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=WL(s,e.slice(o+1)),s=WL(s,[[`exit`,c,t]]),UL(e,a,e.length,s),e}function Fz(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(JF(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(Az,u,o?u:d)(t):t===91?e.attempt(jz,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(Mz,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function Iz(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return SF(t)?cz(e,a)(t):a(t)}function a(t){return t===41?u(t):az(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return SF(t)?cz(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?sz(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return SF(t)?cz(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function Lz(e,t,n){let r=this;return i;function i(t){return oz.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(JF(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function Rz(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var zz={name:`labelStartImage`,resolveAll:kz.resolveAll,tokenize:Bz};function Bz(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var Vz={name:`labelStartLink`,resolveAll:kz.resolveAll,tokenize:Hz};function Hz(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var Uz={name:`lineEnding`,tokenize:Wz};function Wz(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),DR(e,t,`linePrefix`)}}var Gz={name:`thematicBreak`,tokenize:Kz};function Kz(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||xF(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),CF(t)?DR(e,s,`whitespace`)(t):s(t))}}var qz={continuation:{tokenize:Zz},exit:$z,name:`list`,tokenize:Xz},Jz={partial:!0,tokenize:eB},Yz={partial:!0,tokenize:Qz};function Xz(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:vF(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(Gz,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return vF(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(OR,r.interrupt?n:u,e.attempt(Jz,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return CF(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function Zz(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(OR,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,DR(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!CF(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Yz,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,DR(e,e.attempt(qz,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function Qz(e,t,n){let r=this;return DR(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function $z(e){e.exit(this.containerState.type)}function eB(e,t,n){let r=this;return DR(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!CF(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var tB={name:`setextUnderline`,resolveTo:nB,tokenize:rB};function nB(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function rB(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),CF(t)?DR(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||xF(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var iB={tokenize:fB,partial:!0};function aB(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:lB,continuation:{tokenize:uB},exit:dB}},text:{91:{name:`gfmFootnoteCall`,tokenize:cB},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:oB,resolveTo:sB}}}}function oB(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=JF(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function sB(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`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function cB(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||SF(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(JF(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return SF(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function lB(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||SF(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=JF(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return SF(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),DR(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function uB(e,t,n){return e.check(OR,t,e.attempt(iB,t,n))}function dB(e){e.exit(`gfmFootnoteDefinition`)}function fB(e,t,n){let r=this;return DR(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function pB(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&UL(o,o.length,0,bR(s,e.slice(r+1,n),t)),UL(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),UL(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=PI(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=PI(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var mB=class{constructor(){this.map=[]}add(e,t,n){hB(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function hB(e,t,n,r){let i=0;if(n!==0||r.length!==0){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function gB(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function _B(){return{flow:{null:{name:`table`,tokenize:vB,resolveAll:yB}}}}function vB(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):xF(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):CF(t)?DR(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||SF(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,CF(t)?DR(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return CF(t)?DR(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||xF(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return CF(t)?DR(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||xF(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||xF(n)?(e.exit(`tableRow`),t(n)):CF(n)?DR(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||SF(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function yB(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new mB;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(xB(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=bB(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=bB(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=bB(f,t,o,i,n,d)):(o[0]=o[1],d=bB(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&xB(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=gB(t.events,n))}return e}function bB(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},SB(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=SB(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=SB(t.events,n[2]),a=SB(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},SB(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function xB(e,t,n,r,i){let a=[],o=SB(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function SB(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var CB={name:`tasklistCheck`,tokenize:TB};function wB(){return{text:{91:CB}}}function TB(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return SF(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return xF(r)?t(r):CF(r)?e.check({tokenize:EB},t,n)(r):n(r)}}function EB(e,t,n){return DR(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function DB(e){return KL([iR(),aB(),pB(e),_B(),wB()])}var OB={};function kB(e){let t=this,n=e||OB,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(DB(n)),a.push(VL()),o.push(HL(n))}var AB=Object.defineProperty,jB=Object.defineProperties,MB=Object.getOwnPropertyDescriptors,NB=Object.getOwnPropertySymbols,PB=Object.prototype.hasOwnProperty,FB=Object.prototype.propertyIsEnumerable,IB=(e,t,n)=>t in e?AB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,LB=(e,t)=>{for(var n in t||={})PB.call(t,n)&&IB(e,n,t[n]);if(NB)for(var n of NB(t))FB.call(t,n)&&IB(e,n,t[n]);return e},RB=(e,t)=>jB(e,MB(t)),zB=e=>{let t=new Uint8Array(e.length+1),n=!1,r=!1,i=0;for(;i<e.length;){if(e[i]===`\\`&&i+1<e.length&&e[i+1]==="`"){let e=n||r?1:0;t[i+1]=e,t[i+2]=e,i+=2;continue}if(e.substring(i,i+3)==="```"){r=!r;let a=n||r?1:0,o=Math.min(i+3,e.length);for(let e=i+1;e<=o;e+=1)t[e]=a;i=o;continue}!r&&e[i]==="`"&&(n=!n),t[i+1]=n||r?1:0,i+=1}return t},BB=null,VB=(e,t)=>{let n=BB;return(n===null||n.text!==e)&&(n={text:e,lookup:zB(e)},BB=n),n.lookup[Math.min(t,e.length)]===1},HB=(e,t)=>{let n=e.substring(t,t+3)==="```",r=t>0&&e.substring(t-1,t+2)==="```",i=t>1&&e.substring(t-2,t+1)==="```";return n||r||i},UB=e=>{let t=0;for(let n=0;n<e.length;n+=1){if(e[n]===`\\`&&n+1<e.length&&e[n+1]==="`"){n+=1;continue}e[n]==="`"&&!HB(e,n)&&(t+=1)}return t},WB=(e,t)=>{let n=!1,r=!1,i=-1;for(let a=0;a<e.length;a+=1){if(e[a]===`\\`&&a+1<e.length&&e[a+1]==="`"){a+=1;continue}if(e.substring(a,a+3)==="```"){r=!r,a+=2;continue}if(!r&&e[a]==="`"){if(n){if(i<t&&t<a)return!0;n=!1,i=-1}else n=!0,i=a}}return!1},GB=/^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm,KB=e=>!e||typeof e!=`string`||!e.includes(`>`)?e:e.replace(GB,(t,n,r,i)=>VB(e,i)?t:`${n}\\>${r}`),qB=/(\*\*)([^*]*\*?)$/,JB=/(__)([^_]*?)$/,YB=/(\*\*\*)([^*]*?)$/,XB=/(\*)([^*]*?)$/,ZB=/(_)([^_]*?)$/,QB=/(`)([^`]*?)$/,$B=/(~~)([^~]*?)$/,eV=/^[\s_~*`]*$/,tV=/^[\s]*[-*+][\s]+$/,nV=/[\p{L}\p{N}_]/u,rV=/^```[^`\n]*```?$/,iV=/^\*{4,}$/,aV=/(__)([^_]+)_$/,oV=/(~~)([^~]+)~$/,sV=/~~/g,cV=e=>{if(!e)return!1;let t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||t===95||nV.test(e)},lV=(e,t)=>{let n=1;for(let r=t-1;r>=0;--r)if(e[r]===`]`)n+=1;else if(e[r]===`[`&&(--n,n===0))return r;return-1},uV=(e,t)=>{let n=1;for(let r=t+1;r<e.length;r+=1)if(e[r]===`[`)n+=1;else if(e[r]===`]`&&(--n,n===0))return r;return-1},dV=e=>e===`inlineLatex`||e===`blockLatex`,fV=(e,t)=>t===`[`&&e===`none`?`blockLatex`:t===`]`&&e===`blockLatex`?`none`:t===`(`&&e===`none`?`inlineLatex`:t===`)`&&e===`inlineLatex`?`none`:null,pV=(e,t)=>t?e===`blockDollar`?`none`:`blockDollar`:e===`blockDollar`?e:e===`inlineDollar`?`none`:`inlineDollar`,mV=(e,t)=>{let n=`none`;for(let r=0;r<e.length&&r<t;r+=1){if(e[r]===`\\`&&e[r+1]===`$`){r+=1;continue}if(e[r]===`\\`){let t=fV(n,e[r+1]);if(t!==null){n=t,r+=1;continue}}if(e[r]===`$`&&!dV(n)){let t=e[r+1]===`$`;n=pV(n,t),t&&(r+=1)}}return n!==`none`},hV=(e,t)=>{for(let n=t;n<e.length;n+=1){if(e[n]===`)`)return!0;if(e[n]===`
66
+ `)return!1}return!1},gV=(e,t)=>{for(let n=t-1;n>=0;--n){if(e[n]===`)`)return!1;if(e[n]===`(`)return n>0&&e[n-1]===`]`&&hV(e,t);if(e[n]===`
67
+ `)return!1}return!1},_V=(e,t)=>{for(let n=t-1;n>=0;--n){if(e[n]===`>`)return!1;if(e[n]===`<`){let t=n+1<e.length?e[n+1]:``;return t>=`a`&&t<=`z`||t>=`A`&&t<=`Z`||t===`/`}if(e[n]===`
68
+ `)return!1}return!1},vV=(e,t,n)=>{let r=0;for(let n=t-1;n>=0;--n)if(e[n]===`
69
+ `){r=n+1;break}let i=e.length;for(let n=t;n<e.length;n+=1)if(e[n]===`
70
+ `){i=n;break}let a=e.substring(r,i),o=0,s=!1;for(let e of a)if(e===n)o+=1;else if(e!==` `&&e!==` `){s=!0;break}return o>=3&&!s},yV=e=>e.includes(`$`)||e.includes(`\\(`)||e.includes(`\\[`),bV=(e,t,n,r)=>n===`\\`||yV(e)&&mV(e,t)?!0:n!==`*`&&r===`*`?(t<e.length-2?e[t+2]:``)!==`*`:n===`*`||(!n||n===` `||n===` `||n===`
71
+ `)&&(!r||r===` `||r===` `||r===`
72
+ `),xV=e=>e===` `||e===` `||e===`
73
+ `,SV=(e,t)=>!!(e&&t&&cV(e)&&cV(t)),CV=(e,t,n,r)=>{let i=SV(e,t),a=!!t&&!xV(t),o=!!e&&!xV(e);return i&&n%2==0&&!r?{count:!1}:o&&n%2==1||a?{count:!0,inWordAsteriskChain:i}:{count:!1}},wV=e=>{let t=0,n=!1,r=!1,i=e.length;for(let a=0;a<i;a+=1){if(e[a]==="`"&&a+2<i&&e[a+1]==="`"&&e[a+2]==="`"){n=!n,a+=2;continue}if(n)continue;if(e[a]!==`*`){cV(e[a])||(r=!1);continue}let o=a>0?e[a-1]:``,s=a<i-1?e[a+1]:``;if(bV(e,a,o,s))continue;let c=CV(o,s,t,r);c.count&&(t+=1,r=c.inWordAsteriskChain)}return t},TV=(e,t,n,r)=>!!(n===`\\`||yV(e)&&mV(e,t)||gV(e,t)||_V(e,t)||n===`_`||r===`_`||n&&r&&cV(n)&&cV(r)),EV=e=>{let t=0,n=!1,r=e.length;for(let i=0;i<r;i+=1){if(e[i]==="`"&&i+2<r&&e[i+1]==="`"&&e[i+2]==="`"){n=!n,i+=2;continue}if(n||e[i]!==`_`)continue;let a=i>0?e[i-1]:``,o=i<r-1?e[i+1]:``;TV(e,i,a,o)||(t+=1)}return t},DV=e=>{let t=0,n=0,r=!1;for(let i=0;i<e.length;i+=1){if(e[i]==="`"&&i+2<e.length&&e[i+1]==="`"&&e[i+2]==="`"){n>=3&&(t+=Math.floor(n/3)),n=0,r=!r,i+=2;continue}r||(e[i]===`*`?n+=1:(n>=3&&(t+=Math.floor(n/3)),n=0))}return n>=3&&(t+=Math.floor(n/3)),t},OV=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]==="`"&&r+2<e.length&&e[r+1]==="`"&&e[r+2]==="`"){n=!n,r+=2;continue}n||e[r]===`*`&&r+1<e.length&&e[r+1]===`*`&&(t+=1,r+=1)}return t},kV=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]==="`"&&r+2<e.length&&e[r+1]==="`"&&e[r+2]==="`"){n=!n,r+=2;continue}n||e[r]===`_`&&r+1<e.length&&e[r+1]===`_`&&(t+=1,r+=1)}return t},AV=(e,t,n)=>{if(!t||eV.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
74
+ `),i=r===-1?0:r+1,a=e.substring(i,n);return tV.test(a)&&t.includes(`
75
+ `)?!0:vV(e,n,`*`)},jV=e=>{let t=e.match(qB);if(!t)return e;let n=t[2],r=e.lastIndexOf(t[1]);return VB(e,r)||WB(e,r)||AV(e,n,r)?e:OV(e)%2==1?n.endsWith(`*`)?`${e}*`:`${e}**`:e},MV=(e,t,n)=>{if(!t||eV.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
76
+ `),i=r===-1?0:r+1,a=e.substring(i,n);return tV.test(a)&&t.includes(`
77
+ `)?!0:vV(e,n,`_`)},NV=e=>{let t=e.match(JB);if(!t){let t=e.match(aV);if(t){let n=e.lastIndexOf(t[1]);if(!(VB(e,n)||WB(e,n))&&kV(e)%2==1)return`${e}_`}return e}let n=t[2],r=e.lastIndexOf(t[1]);return VB(e,r)||WB(e,r)||MV(e,n,r)?e:kV(e)%2==1?`${e}__`:e},PV=e=>{let t=!1;for(let n=0;n<e.length;n+=1){if(e[n]==="`"&&n+2<e.length&&e[n+1]==="`"&&e[n+2]==="`"){t=!t,n+=2;continue}if(!t&&e[n]===`*`&&e[n-1]!==`*`&&e[n+1]!==`*`&&e[n-1]!==`\\`&&!mV(e,n)){let t=n>0?e[n-1]:``,r=n<e.length-1?e[n+1]:``,i=!t||xV(t),a=!r||xV(r);if(i&&a||t&&r&&cV(t)&&cV(r)||a)continue;return n}}return-1},FV=e=>{if(!e.match(XB))return e;let t=PV(e);if(t===-1||VB(e,t)||WB(e,t))return e;let n=e.substring(t+1);return!n||eV.test(n)?e:wV(e)%2==1?`${e}*`:e},IV=e=>{let t=!1;for(let n=0;n<e.length;n+=1){if(e[n]==="`"&&n+2<e.length&&e[n+1]==="`"&&e[n+2]==="`"){t=!t,n+=2;continue}if(!t&&e[n]===`_`&&e[n-1]!==`_`&&e[n+1]!==`_`&&e[n-1]!==`\\`&&!mV(e,n)&&!gV(e,n)){let t=n>0?e[n-1]:``,r=n<e.length-1?e[n+1]:``;if(t&&r&&cV(t)&&cV(r))continue;return n}}return-1},LV=e=>{let t=e.length;for(;t>0&&e[t-1]===`
78
+ `;)--t;return t<e.length?`${e.slice(0,t)}_${e.slice(t)}`:`${e}_`},RV=e=>{if(!e.endsWith(`**`))return null;let t=e.slice(0,-2);if(OV(t)%2!=1)return null;let n=t.indexOf(`**`),r=IV(t);return n!==-1&&r!==-1&&n<r?`${t}_**`:null},zV=e=>{if(!e.match(ZB))return e;let t=IV(e);if(t===-1)return e;let n=e.substring(t+1);if(!n||eV.test(n)||VB(e,t)||WB(e,t))return e;if(EV(e)%2==1){let t=RV(e);return t===null?LV(e):t}return e},BV=e=>{let t=OV(e),n=wV(e);return t%2==0&&n%2==0},VV=(e,t,n)=>!t||eV.test(t)||VB(e,n)||WB(e,n)?!0:vV(e,n,`*`),HV=e=>{if(iV.test(e))return e;let t=e.match(YB);if(!t)return e;let n=t[2];return VV(e,n,e.lastIndexOf(t[1]))?e:DV(e)%2==1?BV(e)?e:`${e}***`:e},UV=/<[a-zA-Z/][^>]*$/,WV=e=>{let t=e.match(UV);return!t||t.index===void 0||VB(e,t.index)?e:e.substring(0,t.index).trimEnd()},GV=e=>!e.match(rV)||e.includes(`
79
+ `)?null:e.endsWith("``")&&!e.endsWith("```")?`${e}\``:e,KV=e=>(e.match(/```/g)||[]).length%2==1,qV=e=>{let t=GV(e);if(t!==null)return t;let n=e.match(QB);if(n&&!KV(e)){let t=n[2];if(!t||eV.test(t))return e;if(UB(e)%2==1)return`${e}\``}return e},JV=(e,t)=>t>=2&&e.substring(t-2,t+1)==="```"||t>=1&&e.substring(t-1,t+2)==="```"||t<=e.length-3&&e.substring(t,t+3)==="```",YV=e=>{let t=0,n=!1;for(let r=0;r<e.length-1;r+=1)e[r]==="`"&&!JV(e,r)&&(n=!n),!n&&e[r]===`$`&&e[r+1]===`$`&&(t+=1,r+=1);return t},XV=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]===`\\`){r+=1;continue}if(e[r]==="`"&&!JV(e,r)){n=!n;continue}!n&&e[r]===`$`&&(r+1<e.length&&e[r+1]===`$`?r+=1:t+=1)}return t},ZV=e=>{if(e.endsWith(`$`)&&!e.endsWith(`$$`))return`${e}$`;let t=e.indexOf(`$$`);return t!==-1&&e.indexOf(`
80
+ `,t)!==-1&&!e.endsWith(`
81
+ `)?`${e}
82
+ $$`:`${e}$$`},QV=e=>YV(e)%2==0?e:ZV(e),$V=e=>XV(e)%2==1?`${e}$`:e,eH=(e,t,n)=>{if(e.substring(t+2).includes(`)`))return null;let r=lV(e,t);if(r===-1||VB(e,r))return null;let i=r>0&&e[r-1]===`!`,a=i?r-1:r,o=e.substring(0,a);if(i)return o;let s=e.substring(r+1,t);return n===`text-only`?`${o}${s}`:`${o}[${s}](streamdown:incomplete-link)`},tH=(e,t)=>{for(let n=0;n<t;n++)if(e[n]===`[`&&!VB(e,n)){if(n>0&&e[n-1]===`!`)continue;let t=uV(e,n);if(t===-1)return n;if(t+1<e.length&&e[t+1]===`(`){let r=e.indexOf(`)`,t+2);r!==-1&&(n=r)}}return t},nH=(e,t,n)=>{let r=t>0&&e[t-1]===`!`,i=r?t-1:t;if(!e.substring(t+1).includes(`]`)){let a=e.substring(0,i);if(r)return a;if(n===`text-only`){let n=tH(e,t);return e.substring(0,n)+e.substring(n+1)}return`${e}](streamdown:incomplete-link)`}if(uV(e,t)===-1){let a=e.substring(0,i);if(r)return a;if(n===`text-only`){let n=tH(e,t);return e.substring(0,n)+e.substring(n+1)}return`${e}](streamdown:incomplete-link)`}return null},rH=(e,t=`protocol`)=>{let n=e.lastIndexOf(`](`);if(n!==-1&&!VB(e,n)){let r=eH(e,n,t);if(r!==null)return r}for(let n=e.length-1;n>=0;--n)if(e[n]===`[`&&!VB(e,n)){let r=nH(e,n,t);if(r!==null)return r}return e},iH=/^-{1,2}$/,aH=/^[\s]*-{1,2}[\s]+$/,oH=/^={1,2}$/,sH=/^[\s]*={1,2}[\s]+$/,cH=e=>{if(!e||typeof e!=`string`)return e;let t=e.lastIndexOf(`
83
+ `);if(t===-1)return e;let n=e.substring(t+1),r=e.substring(0,t),i=n.trim();if(iH.test(i)&&!n.match(aH)){let t=r.split(`
84
+ `).at(-1);if(t&&t.trim().length>0)return`${e}\u200B`}if(oH.test(i)&&!n.match(sH)){let t=r.split(`
85
+ `).at(-1);if(t&&t.trim().length>0)return`${e}\u200B`}return e},lH=/([\p{L}\p{N}_])~(?!~)(?=[\p{L}\p{N}_])/gu,uH=e=>!e||typeof e!=`string`||!e.includes(`~`)?e:e.replace(lH,(t,n,r)=>VB(e,r+n.length)?t:`${n}\\~`),dH=e=>{let t=e.match($B);if(t){let n=t[2];if(!n||eV.test(n))return e;let r=e.lastIndexOf(t[1]);if(VB(e,r)||WB(e,r))return e;if(e.match(sV)?.length%2==1)return`${e}~~`}else{let t=e.match(oV);if(t){let n=e.lastIndexOf(t[0].slice(0,2));if(VB(e,n)||WB(e,n))return e;if(e.match(sV)?.length%2==1)return`${e}~`}}return e},fH=e=>e!==!1,pH=e=>e===!0,mH={SINGLE_TILDE:0,COMPARISON_OPERATORS:5,HTML_TAGS:10,SETEXT_HEADINGS:15,LINKS:20,BOLD_ITALIC:30,BOLD:35,ITALIC_DOUBLE_UNDERSCORE:40,ITALIC_SINGLE_ASTERISK:41,ITALIC_SINGLE_UNDERSCORE:42,INLINE_CODE:50,STRIKETHROUGH:60,KATEX:70,INLINE_KATEX:75,DEFAULT:100},hH=[{handler:{name:`singleTilde`,handle:uH,priority:mH.SINGLE_TILDE},optionKey:`singleTilde`},{handler:{name:`comparisonOperators`,handle:KB,priority:mH.COMPARISON_OPERATORS},optionKey:`comparisonOperators`},{handler:{name:`htmlTags`,handle:WV,priority:mH.HTML_TAGS},optionKey:`htmlTags`},{handler:{name:`setextHeadings`,handle:cH,priority:mH.SETEXT_HEADINGS},optionKey:`setextHeadings`},{handler:{name:`links`,handle:rH,priority:mH.LINKS},optionKey:`links`,earlyReturn:e=>e.endsWith(`](streamdown:incomplete-link)`)},{handler:{name:`boldItalic`,handle:HV,priority:mH.BOLD_ITALIC},optionKey:`boldItalic`},{handler:{name:`bold`,handle:jV,priority:mH.BOLD},optionKey:`bold`},{handler:{name:`italicDoubleUnderscore`,handle:NV,priority:mH.ITALIC_DOUBLE_UNDERSCORE},optionKey:`italic`},{handler:{name:`italicSingleAsterisk`,handle:FV,priority:mH.ITALIC_SINGLE_ASTERISK},optionKey:`italic`},{handler:{name:`italicSingleUnderscore`,handle:zV,priority:mH.ITALIC_SINGLE_UNDERSCORE},optionKey:`italic`},{handler:{name:`inlineCode`,handle:qV,priority:mH.INLINE_CODE},optionKey:`inlineCode`},{handler:{name:`strikethrough`,handle:dH,priority:mH.STRIKETHROUGH},optionKey:`strikethrough`},{handler:{name:`katex`,handle:QV,priority:mH.KATEX},optionKey:`katex`},{handler:{name:`inlineKatex`,handle:$V,priority:mH.INLINE_KATEX},optionKey:`inlineKatex`}],gH=e=>{let t=e?.linkMode??`protocol`;return hH.filter(({handler:t,optionKey:n})=>t.name===`links`?fH(e?.links)||fH(e?.images):t.name===`inlineKatex`?pH(e?.inlineKatex):fH(e?.[n])).map(({handler:e,earlyReturn:n})=>e.name===`links`?{handler:RB(LB({},e),{handle:e=>rH(e,t)}),earlyReturn:t===`protocol`?n:void 0}:{handler:e,earlyReturn:n})},_H=(e,t)=>{if(!e||typeof e!=`string`)return e;let n=e.endsWith(` `)&&!e.endsWith(` `)?e.slice(0,-1):e,r=gH(t),i=(t?.handlers??[]).map(e=>({handler:RB(LB({},e),{priority:e.priority??mH.DEFAULT}),earlyReturn:void 0})),a=[...r,...i].sort((e,t)=>(e.handler.priority??0)-(t.handler.priority??0));for(let{handler:e,earlyReturn:t}of a)if(n=e.handle(n),t!=null&&t(n))return n;return n},vH=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,yH=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,bH={};function xH(e,t){return((t||bH).jsx?yH:vH).test(e)}var SH=/[ \t\n\f\r]/g;function CH(e){return typeof e==`object`?e.type===`text`&&wH(e.value):wH(e)}function wH(e){return e.replace(SH,``)===``}var TH=o(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
86
+ `);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),EH=o((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t(TH());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),DH=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),OH=o(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(EH()),r=DH();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i}));function kH(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?jH(e.position):`start`in e||`end`in e?jH(e):`line`in e||`column`in e?AH(e):``}function AH(e){return MH(e&&e.line)+`:`+MH(e&&e.column)}function jH(e){return AH(e&&e.start)+`-`+AH(e&&e.end)}function MH(e){return e&&typeof e==`number`?e:1}var NH=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=kH(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};NH.prototype.file=``,NH.prototype.name=``,NH.prototype.reason=``,NH.prototype.message=``,NH.prototype.stack=``,NH.prototype.column=void 0,NH.prototype.line=void 0,NH.prototype.ancestors=void 0,NH.prototype.cause=void 0,NH.prototype.fatal=void 0,NH.prototype.place=void 0,NH.prototype.ruleId=void 0,NH.prototype.source=void 0;var PH=l(OH(),1),FH={}.hasOwnProperty,IH=new Map,LH=/[A-Z]/g,RH=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),zH=new Set([`td`,`th`]),BH=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function VH(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=QH(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=ZH(n,t.jsx,t.jsxs)}let i={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`?Ek:Tk,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=HH(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function HH(e,t,n){if(t.type===`element`)return UH(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return WH(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return KH(e,t,n);if(t.type===`mdxjsEsm`)return GH(e,t);if(t.type===`root`)return qH(e,t,n);if(t.type===`text`)return JH(e,t)}function UH(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=Ek,e.schema=i),e.ancestors.push(t);let a=iU(e,t.tagName,!1),o=$H(e,t),s=tU(e,t);return RH.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!CH(e)})),YH(e,o,a,t),XH(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function WH(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}aU(e,t.position)}function GH(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);aU(e,t.position)}function KH(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=Ek,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:iU(e,t.name,!0),o=eU(e,t),s=tU(e,t);return YH(e,o,a,t),XH(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function qH(e,t,n){let r={};return XH(r,tU(e,t)),e.create(t,e.Fragment,r,n)}function JH(e,t){return t.value}function YH(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function XH(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function ZH(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function QH(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=wP(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function $H(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&FH.call(t.properties,i)){let a=nU(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&zH.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function eU(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else aU(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else aU(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function tU(e,t){let n=[],r=-1,i=e.passKeys?new Map:IH;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=HH(e,a,o);s!==void 0&&n.push(s)}return n}function nU(e,t,n){let r=Sk(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Ok(n):Mk(n)),r.property===`style`){let t=typeof n==`object`?n:rU(e,String(n));return e.stylePropertyNameCase===`css`&&(t=oU(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?vk[r.property]||r.property:r.attribute,n]}}function rU(e,t){try{return(0,PH.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new NH("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=BH+`#cannot-parse-style-attribute`,r}}function iU(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=xH(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=xH(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return FH.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);aU(e)}function aU(e,t){let n=new NH("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=BH+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function oU(e){let t={},n;for(n in e)FH.call(e,n)&&(t[sU(n)]=e[n]);return t}function sU(e){let t=e.replace(LH,cU);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function cU(e){return`-`+e.toLowerCase()}var lU={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`]},uU={tokenize:dU};function dU(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),DR(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return xF(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var fU={tokenize:mU},pU={tokenize:hU};function mU(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return UL(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(pU,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(pU,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return xF(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;UL(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function hU(e,t,n){return DR(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}var gU={tokenize:_U};function _U(e){let t=this,n=e.attempt(OR,r,e.attempt(this.parser.constructs.flowInitial,i,DR(e,e.attempt(this.parser.constructs.flow,i,e.attempt(ez,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var vU={resolveAll:SU()},yU=xU(`string`),bU=xU(`text`);function xU(e){return{resolveAll:SU(e===`text`?CU:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function SU(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function CU(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var wU=s({attentionMarkers:()=>MU,contentInitial:()=>EU,disable:()=>NU,document:()=>TU,flow:()=>OU,flowInitial:()=>DU,insideSpan:()=>jU,string:()=>kU,text:()=>AU}),TU={42:qz,43:qz,45:qz,48:qz,49:qz,50:qz,51:qz,52:qz,53:qz,54:qz,55:qz,56:qz,57:qz,62:AR},EU={91:lz},DU={[-2]:HR,[-1]:HR,32:HR},OU={35:hz,42:Gz,45:[tB,Gz],60:bz,61:tB,95:Gz,96:zR,126:zR},kU={38:IR,92:PR},AU={[-5]:Uz,[-4]:Uz,[-3]:Uz,33:zz,38:IR,42:xR,60:[TR,Dz],91:Vz,92:[pz,PR],93:kz,95:xR,96:KR},jU={null:[xR,vU]},MU={null:[42,95]},NU={null:[]};function PU(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=WL(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=bR(a,l.events,l),l.events):[]}function f(e,t){return IU(p(e),t)}function p(e){return FU(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){xF(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&UL(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function FU(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function IU(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
87
+ `;break;case-3:o=`\r
88
+ `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function LU(e){let t={constructs:KL([wU,...(e||{}).extensions||[]]),content:n(uU),defined:[],document:n(fU),flow:n(gU),lazy:{},string:n(yU),text:n(bU)};return t;function n(e){return n;function n(n){return PU(t,e,n)}}}function RU(e){for(;!QR(e););return e}var zU=/[\0\t\n\r]/g;function BU(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(zU.lastIndex=u,c=zU.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var VU={}.hasOwnProperty;function HU(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),UU(n)(RU(LU(n).document().write(BU()(e,t,!0))))}function UU(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(fe),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(ce),blockQuote:a(re),characterEscape:T,characterReference:T,codeFenced:a(ie),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(ie,o),codeText:a(ae,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(oe),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(se),hardBreakEscape:a(le),hardBreakTrailing:a(le),htmlFlow:a(ue,o),htmlFlowData:T,htmlText:a(ue,o),htmlTextData:T,image:a(de),label:o,link:a(fe),listItem:a(me),listItemValue:f,listOrdered:a(pe,d),listUnordered:a(pe),paragraph:a(he),reference:R,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(ce),strong:a(ge),thematicBreak:a(ve)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:H,autolinkProtocol:ne,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:z,characterReferenceMarkerNumeric:z,characterReferenceValue:B,characterReference:V,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(j),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(N),label:F,labelText:P,lineEnding:D,link:c(M),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:te,resourceDestinationString:I,resourceTitleString:L,resource:ee,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};GU(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];VU.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||qU).call(a,void 0,e[0])}for(r.position={start:WU(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:WU(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:WU(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||qU).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+kH({start:e.start,end:e.end})+`): it’s not open`);n.position.end=WU(e.end)}function u(){return zI(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=JF(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=_e(),n.position={start:WU(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=WU(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=WU(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function N(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function P(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=TL(t),n.identifier=JF(t).toLowerCase()}function F(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function I(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function L(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function ee(){this.data.inReference=void 0}function R(){this.data.referenceType=`collapsed`}function te(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=JF(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function z(e){this.data.characterReferenceType=e.type}function B(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=CL(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=SL(t);let i=this.stack[this.stack.length-1];i.value+=r}function V(e){let t=this.stack.pop();t.position.end=WU(e.end)}function ne(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function H(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function re(){return{type:`blockquote`,children:[]}}function ie(){return{type:`code`,lang:null,meta:null,value:``}}function ae(){return{type:`inlineCode`,value:``}}function oe(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function se(){return{type:`emphasis`,children:[]}}function ce(){return{type:`heading`,depth:0,children:[]}}function le(){return{type:`break`}}function ue(){return{type:`html`,value:``}}function de(){return{type:`image`,title:null,url:``,alt:null}}function fe(){return{type:`link`,title:null,url:``,children:[]}}function pe(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function me(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function he(){return{type:`paragraph`,children:[]}}function ge(){return{type:`strong`,children:[]}}function _e(){return{type:`text`,value:``}}function ve(){return{type:`thematicBreak`}}}function WU(e){return{line:e.line,column:e.column,offset:e.offset}}function GU(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?GU(e,r):KU(e,r)}}function KU(e,t){let n;for(n in t)if(VU.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function qU(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+kH({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+kH({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+kH({start:t.start,end:t.end})+`) is still open`)}function JU(e){let t=this;t.parser=n;function n(n){return HU(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function YU(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function XU(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
89
+ `}]}function ZU(e,t){let n=t.value?t.value+`
90
+ `:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function QU(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function $U(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function eW(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=yR(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function tW(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function nW(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function rW(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function iW(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return rW(e,t);let i={src:yR(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function aW(e,t){let n={src:yR(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function oW(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function sW(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return rW(e,t);let i={href:yR(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function cW(e,t){let n={href:yR(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function lW(e,t,n){let r=e.all(t),i=n?uW(n):dW(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
91
+ `}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
92
+ `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function uW(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=dW(n[r])}return t}function dW(e){return e.spread??e.children.length>1}function fW(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function pW(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function mW(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function hW(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function gW(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=wP(t.children[1]),o=CP(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function _W(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function vW(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var yW=9,bW=32;function xW(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(SW(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(SW(t.slice(i),i>0,!1)),a.join(``)}function SW(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===yW||t===bW;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===yW||t===bW;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function CW(e,t){let n={type:`text`,value:xW(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function wW(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var TW={blockquote:YU,break:XU,code:ZU,delete:QU,emphasis:$U,footnoteReference:eW,heading:tW,html:nW,imageReference:iW,image:aW,inlineCode:oW,linkReference:sW,link:cW,listItem:lW,list:fW,paragraph:pW,root:mW,strong:hW,table:gW,tableCell:vW,tableRow:_W,text:CW,thematicBreak:wW,toml:EW,yaml:EW,definition:EW,footnoteDefinition:EW};function EW(){}function DW(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function OW(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function kW(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||DW,r=e.options.footnoteBackLabel||OW,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=yR(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...GO(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
93
+ `},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
94
+ `}]}}var AW={}.hasOwnProperty,jW={};function MW(e,t){let n=t||jW,r=new Map,i=new Map,a={all:s,applyData:PW,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...TW,...n.handlers},one:o,options:n,patch:NW,wrap:IW};return yO(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(AW.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=GO(n);return r.children=a.all(e),r}return GO(e)}return(a.options.unknownHandler||FW)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=LW(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=LW(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function NW(e,t){e.position&&(t.position=EP(e))}function PW(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,GO(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function FW(e,t){let n=t.data||{},r=`value`in t&&!(AW.call(n,`hProperties`)||AW.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 IW(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
95
+ `});++r<e.length;)r&&n.push({type:`text`,value:`
96
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
97
+ `}),n}function LW(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function RW(e,t){let n=MW(e,t),r=n.one(e,void 0),i=kW(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
98
+ `},i)),a}function zW(e,t){return e&&`run`in e?async function(n,r){let i=RW(n,{file:r,...t});await e.run(i,r)}:function(n,r){return RW(n,{file:r,...e||t})}}function BW(e){if(e)throw e}var VW=o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function HW(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function UW(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?WW(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function WW(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var GW={basename:KW,dirname:qW,extname:JW,join:YW,sep:`/`};function KW(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);QW(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function qW(e){if(QW(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||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function JW(e){QW(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function YW(...e){let t=-1,n;for(;++t<e.length;)QW(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:XW(n)}function XW(e){QW(e);let t=e.codePointAt(0)===47,n=ZW(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function ZW(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function QW(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var $W={cwd:eG};function eG(){return`/`}function tG(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function nG(e){if(typeof e==`string`)e=new URL(e);else if(!tG(e)){let t=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:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return rG(e)}function rG(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var iG=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],aG=class{constructor(e){let t;t=e?tG(e)?{path:e}:typeof e==`string`||lG(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:$W.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<iG.length;){let e=iG[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)iG.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?GW.basename(this.path):void 0}set basename(e){sG(e,`basename`),oG(e,`basename`),this.path=GW.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?GW.dirname(this.path):void 0}set dirname(e){cG(this.basename,`dirname`),this.path=GW.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?GW.extname(this.path):void 0}set extname(e){if(oG(e,`extname`),cG(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=GW.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){tG(e)&&(e=nG(e)),sG(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?GW.basename(this.path,this.extname):void 0}set stem(e){sG(e,`stem`),oG(e,`stem`),this.path=GW.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new NH(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function oG(e,t){if(e&&e.includes(GW.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+GW.sep+"`")}function sG(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function cG(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function lG(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var uG=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),dG=l(VW(),1),fG={}.hasOwnProperty,pG=new class e extends uG{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=UW()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,dG.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(gG(`data`,this.frozen),this.namespace[e]=t,this):fG.call(this.namespace,e)&&this.namespace[e]||void 0:e?(gG(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=yG(e),n=this.parser||this.Parser;return mG(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),mG(`process`,this.parser||this.Parser),hG(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=yG(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);xG(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),mG(`processSync`,this.parser||this.Parser),hG(`processSync`,this.compiler||this.Compiler),this.process(e,r),vG(`processSync`,`process`,t),n;function r(e,r){t=!0,BW(e),n=r}}run(e,t,n){_G(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=yG(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),vG(`runSync`,`run`,n),r;function i(e,t){BW(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=yG(t),r=this.compiler||this.Compiler;return hG(`stringify`,r),_G(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(gG(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw 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");o(e.plugins),e.settings&&(r.settings=(0,dG.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];HW(o)&&HW(r)&&(r=(0,dG.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function mG(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function hG(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function gG(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function _G(e){if(!HW(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function vG(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function yG(e){return bG(e)?e:new aG(e)}function bG(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function xG(e){return typeof e==`string`||SG(e)}function SG(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}function CG(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var wG=CG();function TG(e){wG=e}var EG={exec:()=>null};function DG(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(kG.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var OG=(()=>{try{return!0}catch{return!1}})(),kG={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,`i`),blockquoteBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}>`)},AG=/^(?:[ \t]*(?:\n|$))+/,jG=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,MG=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,NG=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,PG=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,FG=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,IG=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,LG=DG(IG).replace(/bull/g,FG).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),RG=DG(IG).replace(/bull/g,FG).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),zG=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,BG=/^[^\n]+/,VG=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,HG=DG(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,VG).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),UG=DG(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,FG).getRegex(),WG=`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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,GG=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,KG=DG(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,GG).replace(`tag`,WG).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),qG=DG(zG).replace(`hr`,NG).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,WG).getRegex(),JG={blockquote:DG(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,qG).getRegex(),code:jG,def:HG,fences:MG,heading:PG,hr:NG,html:KG,lheading:LG,list:UG,newline:AG,paragraph:qG,table:EG,text:BG},YG=DG(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,NG).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,WG).getRegex(),XG={...JG,lheading:RG,table:YG,paragraph:DG(zG).replace(`hr`,NG).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,YG).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,WG).getRegex()},ZG={...JG,html:DG(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,GG).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:EG,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:DG(zG).replace(`hr`,NG).replace(`heading`,` *#{1,6} *[^
99
+ ]`).replace(`lheading`,LG).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},QG=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,$G=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,eK=/^( {2,}|\\)\n(?!\s*$)/,tK=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,nK=/[\p{P}\p{S}]/u,rK=/[\s\p{P}\p{S}]/u,iK=/[^\s\p{P}\p{S}]/u,aK=DG(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,rK).getRegex(),oK=/(?!~)[\p{P}\p{S}]/u,sK=/(?!~)[\s\p{P}\p{S}]/u,cK=/(?:[^\s\p{P}\p{S}]|~)/u,lK=DG(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,OG?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),uK=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,dK=DG(uK,`u`).replace(/punct/g,nK).getRegex(),fK=DG(uK,`u`).replace(/punct/g,oK).getRegex(),pK=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,mK=DG(pK,`gu`).replace(/notPunctSpace/g,iK).replace(/punctSpace/g,rK).replace(/punct/g,nK).getRegex(),hK=DG(pK,`gu`).replace(/notPunctSpace/g,cK).replace(/punctSpace/g,sK).replace(/punct/g,oK).getRegex(),gK=DG(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,iK).replace(/punctSpace/g,rK).replace(/punct/g,nK).getRegex(),_K=DG(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,nK).getRegex(),vK=DG(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,iK).replace(/punctSpace/g,rK).replace(/punct/g,nK).getRegex(),yK=DG(/\\(punct)/,`gu`).replace(/punct/g,nK).getRegex(),bK=DG(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),xK=DG(GG).replace(`(?:-->|$)`,`-->`).getRegex(),SK=DG(`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,xK).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),CK=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,wK=DG(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,CK).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),TK=DG(/^!?\[(label)\]\[(ref)\]/).replace(`label`,CK).replace(`ref`,VG).getRegex(),EK=DG(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,VG).getRegex(),DK=DG(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,TK).replace(`nolink`,EK).getRegex(),OK=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,kK={_backpedal:EG,anyPunctuation:yK,autolink:bK,blockSkip:lK,br:eK,code:$G,del:EG,delLDelim:EG,delRDelim:EG,emStrongLDelim:dK,emStrongRDelimAst:mK,emStrongRDelimUnd:gK,escape:QG,link:wK,nolink:EK,punctuation:aK,reflink:TK,reflinkSearch:DK,tag:SK,text:tK,url:EG},AK={...kK,link:DG(/^!?\[(label)\]\((.*?)\)/).replace(`label`,CK).getRegex(),reflink:DG(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,CK).getRegex()},jK={...kK,emStrongRDelimAst:hK,emStrongLDelim:fK,delLDelim:_K,delRDelim:vK,url:DG(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,OK).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:DG(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,OK).getRegex()},MK={...jK,br:DG(eK).replace(`{2,}`,`*`).getRegex(),text:DG(jK.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},NK={normal:JG,gfm:XG,pedantic:ZG},PK={normal:kK,gfm:jK,breaks:MK,pedantic:AK},FK={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},IK=e=>FK[e];function LK(e,t){if(t){if(kG.escapeTest.test(e))return e.replace(kG.escapeReplace,IK)}else if(kG.escapeTestNoEncode.test(e))return e.replace(kG.escapeReplaceNoEncode,IK);return e}function RK(e){try{e=encodeURI(e).replace(kG.percentDecode,`%`)}catch{return null}return e}function zK(e,t){let n=e.replace(kG.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(kG.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(kG.slashPipe,`|`);return n}function BK(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function VK(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function HK(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function UK(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`);r.state.inLink=!0;let c={type:e[0].charAt(0)===`!`?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,c}function WK(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
100
+ `).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e}).join(`
101
+ `)}var GK=class{options;rules;lexer;constructor(e){this.options=e||wG}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,``);return{type:`code`,raw:t[0],codeBlockStyle:`indented`,text:this.options.pedantic?e:BK(e,`
102
+ `)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=WK(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=BK(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:BK(t[0],`
103
+ `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=BK(t[0],`
104
+ `).split(`
105
+ `),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o;for(o=0;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
106
+ `),c=s.replace(this.rules.other.blockquoteSetextReplace,`
107
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
108
+ ${s}`:s,r=r?`${r}
109
+ ${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`)break;if(u?.type===`blockquote`){let t=u,a=t.raw+`
110
+ `+e.join(`
111
+ `),o=this.blockquote(a);i[i.length-1]=o,n=n.substring(0,n.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}if(u?.type===`list`){let t=u,a=t.raw+`
112
+ `+e.join(`
113
+ `),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
114
+ `);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=HK(t[2].split(`
115
+ `,1)[0],t[1].length),l=e.split(`
116
+ `,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=c.search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(l)&&(r+=l+`
117
+ `,e=e.substring(l.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d),f=this.rules.other.blockquoteBeginRegex(d);for(;e;){let p=e.split(`
118
+ `,1)[0],m;if(l=p,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting,` `),m=l):m=l.replace(this.rules.other.tabCharGlobal,` `),i.test(l)||a.test(l)||o.test(l)||f.test(l)||t.test(l)||n.test(l))break;if(m.search(this.rules.other.nonSpaceChar)>=d||!l.trim())s+=`
119
+ `+m.slice(d);else{if(u||c.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=`
120
+ `+l}u=!l.trim(),r+=p+`
121
+ `,e=e.substring(p.length+1),c=m.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items){if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),e.task){if(e.text=e.text.replace(this.rules.other.listReplaceTask,``),e.tokens[0]?.type===`text`||e.tokens[0]?.type===`paragraph`){e.tokens[0].raw=e.tokens[0].raw.replace(this.rules.other.listReplaceTask,``),e.tokens[0].text=e.tokens[0].text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}}let t=this.rules.other.listTaskCheckbox.exec(e.raw);if(t){let n={type:`checkbox`,raw:t[0]+` `,checked:t[0]!==`[ ]`};e.checked=n.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=n.raw+e.tokens[0].raw,e.tokens[0].text=n.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(n)):e.tokens.unshift({type:`paragraph`,raw:n.raw,text:n.raw,tokens:[n]}):e.tokens.unshift(n)}}if(!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:`html`,block:!0,raw:t[0],pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:t[0],href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=zK(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
122
+ `):[],a={type:`table`,raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(zK(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:t[0],depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
123
+ `?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=BK(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=VK(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),UK(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return UK(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=0,c=r[0][0]===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);(r=c.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);let t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+a);if(Math.min(n,a)%2){let e=c.slice(1,-1);return{type:`em`,raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}let l=c.slice(2,-2);return{type:`strong`,raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},KK=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||wG,this.options.tokenizer=this.options.tokenizer||new GK,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:kG,block:NK.normal,inline:PK.normal};this.options.pedantic?(t.block=NK.pedantic,t.inline=PK.pedantic):this.options.gfm&&(t.block=NK.gfm,t.inline=this.options.breaks?PK.breaks:PK.gfm),this.tokenizer.rules=t}static get rules(){return{block:NK,inline:PK}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(kG.carriageReturn,`
124
+ `),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(kG.tabCharGlobal,` `).replace(kG.spaceLine,``));e;){let r;if(this.options.extensions?.block?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);r.raw.length===1&&n!==void 0?n.raw+=`
125
+ `:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
126
+ `)?``:`
127
+ `)+r.raw,n.text+=`
128
+ `+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
129
+ `)?``:`
130
+ `)+r.raw,n.text+=`
131
+ `+r.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},t.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){let a=t.at(-1);n&&a?.type===`paragraph`?(a.raw+=(a.raw.endsWith(`
132
+ `)?``:`
133
+ `)+r.raw,a.text+=`
134
+ `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(r),n=i.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
135
+ `)?``:`
136
+ `)+r.raw,n.text+=`
137
+ `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=e,r=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!==null;)e.includes(r[0].slice(r[0].lastIndexOf(`[`)+1,-1))&&(n=n.slice(0,r.index)+`[`+`a`.repeat(r[0].length-2)+`]`+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!==null;)n=n.slice(0,r.index)+`++`+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!==null;)i=r[2]?r[2].length:0,n=n.slice(0,r.index+i)+`[`+`a`.repeat(r[0].length-i-2)+`]`+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let a=!1,o=``;for(;e;){a||(o=``),a=!1;let r;if(this.options.extensions?.inline?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);r.type===`text`&&n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(i)){e=e.substring(r.raw.length),r.raw.slice(-1)!==`_`&&(o=r.raw.slice(-1)),a=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}return t}},qK=class{options;parser;constructor(e){this.options=e||wG}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(kG.notSpaceStart)?.[0],i=e.replace(kG.endingNewline,``)+`
138
+ `;return r?`<pre><code class="language-`+LK(r)+`">`+(n?i:LK(i,!0))+`</code></pre>
139
+ `:`<pre><code>`+(n?i:LK(i,!0))+`</code></pre>
140
+ `}blockquote({tokens:e}){return`<blockquote>
141
+ ${this.parser.parse(e)}</blockquote>
142
+ `}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
143
+ `}hr(e){return`<hr>
144
+ `}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
145
+ `+r+`</`+i+`>
146
+ `}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
147
+ `}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
148
+ `}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
149
+ <thead>
150
+ `+t+`</thead>
151
+ `+r+`</table>
152
+ `}tablerow({text:e}){return`<tr>
153
+ ${e}</tr>
154
+ `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
155
+ `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${LK(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=RK(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+LK(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=RK(e);if(i===null)return LK(n);e=i;let a=`<img src="${e}" alt="${LK(n)}"`;return t&&(a+=` title="${LK(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:LK(e.text)}},JK=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},YK=class e{options;renderer;textRenderer;constructor(e){this.options=e||wG,this.options.renderer=this.options.renderer||new qK,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new JK}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},XK=class{options;block;constructor(e){this.options=e||wG}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?KK.lex:KK.lexInline}provideParser(e=this.block){return e?YK.parse:YK.parseInline}},ZK=new class{defaults=CG();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=YK;Renderer=qK;TextRenderer=JK;Lexer=KK;Tokenizer=GK;Hooks=XK;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new qK(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new GK(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new XK;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=XK.passThroughHooks.has(n)?e=>{if(this.defaults.async&&XK.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return KK.lex(e,t??this.defaults)}parser(e,t){return YK.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?KK.lex:KK.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?YK.parse:YK.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?KK.lex:KK.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?YK.parse:YK.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
156
+ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+LK(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function QK(e,t){return ZK.parse(e,t)}QK.options=QK.setOptions=function(e){return ZK.setOptions(e),QK.defaults=ZK.defaults,TG(QK.defaults),QK},QK.getDefaults=CG,QK.defaults=wG,QK.use=function(...e){return ZK.use(...e),QK.defaults=ZK.defaults,TG(QK.defaults),QK},QK.walkTokens=function(e,t){return ZK.walkTokens(e,t)},QK.parseInline=ZK.parseInline,QK.Parser=YK,QK.parser=YK.parse,QK.Renderer=qK,QK.TextRenderer=JK,QK.Lexer=KK,QK.lexer=KK.lex,QK.Tokenizer=GK,QK.Hooks=XK,QK.parse=QK,QK.options,QK.setOptions,QK.use,QK.walkTokens,QK.parseInline,YK.parse,KK.lex;var $K=300,eq=`300px`,tq=500;function nq(e={}){let{immediate:t=!1,debounceDelay:n=$K,rootMargin:r=eq,idleTimeout:i=tq}=e,[a,o]=(0,v.useState)(!1),s=(0,v.useRef)(null),c=(0,v.useRef)(null),l=(0,v.useRef)(null),u=(0,v.useMemo)(()=>e=>{let t=Date.now();return window.setTimeout(()=>{e({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-t))})},1)},[]),d=(0,v.useMemo)(()=>typeof window<`u`&&window.requestIdleCallback?(e,t)=>window.requestIdleCallback(e,t):u,[u]),f=(0,v.useMemo)(()=>typeof window<`u`&&window.cancelIdleCallback?e=>window.cancelIdleCallback(e):e=>{clearTimeout(e)},[]);return(0,v.useEffect)(()=>{if(t){o(!0);return}let e=s.current;if(!e)return;c.current&&=(clearTimeout(c.current),null),l.current&&=(f(l.current),null);let a=()=>{c.current&&=(clearTimeout(c.current),null),l.current&&=(f(l.current),null)},u=e=>{l.current=d(t=>{t.timeRemaining()>0||t.didTimeout?(o(!0),e.disconnect()):l.current=d(()=>{o(!0),e.disconnect()},{timeout:i/2})},{timeout:i})},p=e=>{a(),c.current=window.setTimeout(()=>{var t;let n=e.takeRecords();(n.length===0||(t=n.at(-1)?.isIntersecting)!=null&&t)&&u(e)},n)},m=(e,t)=>{e.isIntersecting?p(t):a()},h=new IntersectionObserver(e=>{for(let t of e)m(t,h)},{rootMargin:r,threshold:0});return h.observe(e),()=>{c.current&&clearTimeout(c.current),l.current&&f(l.current),h.disconnect()}},[t,n,r,i,f,d]),{shouldRender:a,containerRef:s}}var rq=320,iq=4,aq=()=>typeof performance>`u`?Date.now():performance.now();function oq(e){let t=e?.now??aq,n=e?.maxBacklogMs??rq,r=0,i=0;return{now:t,beginPass(e){i=Math.min(Math.max(r,e),e+n)},mark(){return i},rewind(e){i=e},take(e,t,r){if(e<=0)return{baseDelay:0,step:Math.max(0,t)};let a=Math.max(0,t),o=a===0?0:Math.min(a,iq),s=Math.max(i,r),c=r+n,l=s+Math.max(0,e-1)*a,u=a;if(l>c&&e>1){if(s<c){let t=c-s;u=Math.max(o,t/(e-1))}else u=o}let d=Math.max(0,Math.round(s-r));return i=s+e*u,{baseDelay:d,step:u}},commitPass(){r=i}}}var sq=/\s/,cq=/^\s+$/,lq=new Set([`pre`,`svg`,`math`,`annotation`]),uq=new Set([`img`,`hr`]),dq=e=>typeof e==`object`&&!!e&&`type`in e&&e.type===`element`,fq=e=>e.some(e=>dq(e)&&lq.has(e.tagName)),pq=e=>{for(let t=e.length-1;t>=0;t--){let n=e[t];if(dq(n)&&n.tagName===`li`)return n}},mq=(e,t,n,r)=>{e.properties??={},e.properties[`data-sd-animate-marker`]=!0;let i=typeof e.properties.style==`string`?`${e.properties.style};`:``;e.properties.style=`${i}--sd-marker-duration:${t}ms;--sd-marker-delay:${Math.round(n)}ms;--sd-marker-easing:${r}`},hq=new Set([`ul`,`ol`,`li`]),gq=e=>{for(let t of e.children)if(dq(t)){if(t.tagName===`input`)return t;if(hq.has(t.tagName))continue;let e=gq(t);if(e)return e}},_q=(e,t,n,r)=>{e.properties??={},e.properties[`data-sd-animate`]=!0;let i=typeof e.properties.style==`string`?`${e.properties.style};`:``;e.properties.style=`${i}--sd-animation:sd-${t.animation};--sd-duration:${n}ms;--sd-easing:${t.easing};--sd-delay:${Math.round(r)}ms`},vq=(e,t,n,r)=>{let i=gq(e);i&&_q(i,t,n,r)},yq=(e,t,n,r,i,a)=>{if(fq(t))return;let o=r.prevContentLength,s=i.count;i.count+=1;let c=o>0&&s<o,l=c?0:a.baseDelay+i.newIndex++*a.step;_q(e,n,c?0:n.duration,l)},bq=e=>{var t;for(let n=e.length-1;n>=0;--n){let r=e[n];if(dq(r)){if((t=r.properties)!=null&&t[`data-sd-animated`])break;r.properties={...r.properties,"data-sd-animated":!0}}}},xq=e=>{let t=[],n=``,r=!1;for(let i of e){let e=sq.test(i);if(e!==r&&n){if(e){n+=i,r=!0;continue}t.push(n),n=``}n+=i,r=e}return n&&t.push(n),t},Sq=e=>{let t=[],n=``;for(let r of e)sq.test(r)?t.length>0&&!cq.test(t.at(-1))?t[t.length-1]+=r:n+=r:(n&&=(t.push(n),``),t.push(r));return n&&(t.length>0?t[t.length-1]+=n:t.push(n)),t},Cq=(e,t,n,r,i,a)=>{let o=`--sd-animation:sd-${t};--sd-duration:${i?0:n}ms;--sd-easing:${r}`;return a&&(o+=`;--sd-delay:${Math.round(a)}ms`),{type:`element`,tagName:`span`,properties:{"data-sd-animate":!0,style:o},children:[{type:`text`,value:e}]}},wq=(e,t)=>!(e>0&&t<e),Tq=e=>dq(e)&&uq.has(e.tagName),Eq=(e,t,n)=>{let r=0,i=0;return _O(e,e=>e.type===`text`||Tq(e),(e,a)=>{if(fq(a))return gO;if(Tq(e)){wq(n,i)&&(r+=1),i+=1;return}let o=e.value;if(!o.trim()){i+=o.length;return}let s=t.sep===`char`?Sq(o):xq(o);for(let e of s){let t=i;i+=e.length,!cq.test(e)&&wq(n,t)&&(r+=1)}}),r},Dq=(e,t,n,r,i,a)=>{var o;let s=t.at(-1);if(!(s&&`children`in s))return;if(fq(t))return gO;let c=s,l=c.children.indexOf(e);if(l===-1)return;let u=e.value;if(!u.trim()){i.count+=u.length;return}let d=n.sep===`char`?Sq(u):xq(u),f=r.prevContentLength,p=!1,m=pq(t),h=!!(m&&!((o=m.properties)!=null&&o[`data-sd-animate-marker`])),g=!1,_=d.map(e=>{let t=i.count;if(i.count+=e.length,cq.test(e))return{type:`text`,value:e};let r=f>0&&t<f,o=r?0:a.baseDelay+i.newIndex++*a.step;if(p=!0,m&&h&&!g){let e=r?0:n.duration;mq(m,e,o,n.easing),vq(m,n,e,o),g=!0}return Cq(e,n.animation,n.duration,n.easing,r,o)});return p&&bq(t),c.children.splice(l,1,..._),l+_.length},Oq=0;function kq(e){let t={animation:e?.animation??`fadeIn`,duration:e?.duration??150,easing:e?.easing??`ease`,sep:e?.sep??`word`,stagger:e?.stagger??40,timeline:e?.timeline},n={committedCharCount:0,prevContentLength:0,lastRenderCharCount:0,pendingMark:null},r=Oq++,i=()=>e=>{let r={count:0,newIndex:0};n.prevContentLength=n.committedCharCount;let i=t.timeline,a=i?.now()??aq();i&&(n.pendingMark===null?n.pendingMark=i.mark():i.rewind(n.pendingMark));let o=i?i.take(Eq(e,t,n.prevContentLength),t.stagger,a):{baseDelay:0,step:t.stagger};_O(e,e=>e.type===`text`||Tq(e),(e,i)=>{if(e.type===`text`)return Dq(e,i,t,n,r,o);yq(e,i,t,n,r,o)}),n.lastRenderCharCount=r.count,n.prevContentLength=0};return Object.defineProperty(i,"name",{value:`rehypeAnimate$${r}`}),{name:`animate`,type:`animate`,rehypePlugin:i,setPrevContentLength(e){n.committedCharCount=e,n.prevContentLength=e},getLastRenderCharCount(){return n.lastRenderCharCount},commit(){n.committedCharCount=n.lastRenderCharCount,n.pendingMark=null}}}kq();var Aq=(0,v.createContext)(!1),jq=()=>(0,v.useContext)(Aq),Mq=(...e)=>no(vi(e)),Nq=(e,t)=>{if(!e||!t)return t;let n=`${e}:`;return t.split(/\s+/).filter(Boolean).map(t=>t.startsWith(n)?t:`${e}:${t}`).join(` `)},Pq=e=>e?(...t)=>Nq(e,no(vi(t))):Mq,Fq=(e,t,n)=>{let r=typeof t==`string`&&n.startsWith(`text/csv`)?``:``,i=typeof t==`string`?new Blob([r+t],{type:n}):t,a=URL.createObjectURL(i),o=document.createElement(`a`);o.href=a,o.download=e,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(a)},Iq=(0,v.createContext)(Mq),Lq=()=>(0,v.useContext)(Iq),Rq=8,zq=e=>{if(e!==void 0&&e!==0&&e!==1/0){if(typeof e==`number`)return Number.isFinite(e)&&e>0?`${e}px`:void 0;if(e!==`0`&&e!==`none`&&e!==`Infinity`)return e}},Bq=(e,t,n)=>{let r=(0,v.useRef)(null),i=(0,v.useRef)(!0),a=(0,v.useRef)(!1);return(0,v.useEffect)(()=>{let e=r.current;if(!(e&&t))return;let n=()=>{let t=e.scrollHeight-e.scrollTop-e.clientHeight<Rq;i.current=t};return e.addEventListener(`scroll`,n,{passive:!0}),()=>e.removeEventListener(`scroll`,n)},[t]),(0,v.useEffect)(()=>{e&&!a.current&&(i.current=!0),e||(i.current=!0),a.current=e},[e]),(0,v.useEffect)(()=>{let n=r.current;n&&t&&e&&i.current&&n.scrollTo({top:n.scrollHeight,behavior:`instant`})},[e,t,n]),r},Vq=Mq(`block`),Hq=Mq(`block`,`before:content-[counter(line)]`,`before:inline-block`,`before:[counter-increment:line]`,`before:w-6`,`before:mr-4`,`before:text-[13px]`,`before:text-right`,`before:text-muted-foreground/50`,`before:font-mono`,`before:select-none`),Uq=e=>{let t={};for(let n of e.split(`;`)){let e=n.indexOf(`:`);if(e>0){let r=n.slice(0,e).trim(),i=n.slice(e+1).trim();r&&i&&(t[r]=i)}}return t},Wq=(0,v.memo)(({children:e,result:t,language:n,className:r,maxHeight:i,startLine:a,lineNumbers:o=!0,...s})=>{let c=Lq(),{isAnimating:l}=(0,v.useContext)(DX),u=zq(i),d=Bq(l,!!u,t),f=(0,v.useMemo)(()=>c(Hq),[c]),p=(0,v.useMemo)(()=>c(Vq),[c]),m=(0,v.useMemo)(()=>{let e={};return t.bg&&(e[`--sdm-bg`]=t.bg),t.fg&&(e[`--sdm-fg`]=t.fg),t.rootStyle&&Object.assign(e,Uq(t.rootStyle)),e},[t.bg,t.fg,t.rootStyle]);return(0,U.jsx)(`div`,{className:c(r,u?`overflow-y-auto`:null,`overflow-x-auto rounded-md border border-border bg-background p-4 text-sm`),"data-language":n,"data-streamdown":`code-block-body`,ref:d,style:u?{maxHeight:u}:void 0,...s,children:(0,U.jsx)(`pre`,{className:c(r,`bg-[var(--sdm-bg,inherit)]`,`dark:bg-[var(--shiki-dark-bg,var(--sdm-bg,inherit))]`),style:m,children:(0,U.jsx)(`code`,{className:o?c(`[counter-increment:line_0] [counter-reset:line]`):void 0,style:o&&a&&a>1?{counterReset:`line ${a-1}`}:void 0,children:t.tokens.map((e,t)=>(0,U.jsx)(`span`,{className:o?f:p,children:e.length===0||e.length===1&&e[0].content===``?`
157
+ `:e.map((e,t)=>{let n={},r=!!e.bgColor;if(e.color&&(n[`--sdm-c`]=e.color),e.bgColor&&(n[`--sdm-tbg`]=e.bgColor),e.htmlStyle)for(let[t,i]of Object.entries(e.htmlStyle))t===`color`?n[`--sdm-c`]=i:t===`background-color`?(n[`--sdm-tbg`]=i,r=!0):n[t]=i;return(0,U.jsx)(`span`,{className:c(`text-[var(--sdm-c,inherit)]`,`dark:text-[var(--shiki-dark,var(--sdm-c,inherit))]`,r&&`bg-[var(--sdm-tbg)]`,r&&`dark:bg-[var(--shiki-dark-bg,var(--sdm-tbg))]`),style:n,...e.htmlAttrs,children:e.content},t)})},t))})})})}),Gq=({className:e,language:t,style:n,isIncomplete:r,...i})=>{let a=Lq();return(0,U.jsx)(`div`,{className:a(`my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2`,e),"data-incomplete":r||void 0,"data-language":t,"data-streamdown":`code-block`,style:{contentVisibility:`auto`,containIntrinsicSize:`auto 200px`,...n},...i})},Kq=(0,v.createContext)({code:``}),qq=()=>(0,v.useContext)(Kq),Jq=({language:e})=>{let t=Lq();return(0,U.jsx)(`div`,{className:t(`flex h-8 items-center text-muted-foreground text-xs`),"data-language":e,"data-streamdown":`code-block-header`,children:(0,U.jsx)(`span`,{className:t(`ml-1 font-mono lowercase`),children:e})})},Yq=e=>{let t=e.length;for(;t>0&&e[t-1]===`
158
+ `;)t--;return e.slice(0,t)},Xq=(0,v.lazy)(()=>lD(()=>import(`./highlighted-body-KPVGNVTW-CVEvHk7T.js`).then(e=>({default:e.HighlightedCodeBlockBody})),[])),Zq=({code:e,language:t,className:n,children:r,isIncomplete:i=!1,startLine:a,lineNumbers:o,...s})=>{let c=Lq(),{codeBlockMaxHeight:l}=(0,v.useContext)(DX),u=(0,v.useMemo)(()=>Yq(e),[e]),d=(0,v.useMemo)(()=>({bg:`transparent`,fg:`inherit`,tokens:u.split(`
159
+ `).map(e=>[{content:e,color:`inherit`,bgColor:`transparent`,htmlStyle:{},offset:0}])}),[u]);return(0,U.jsx)(Kq.Provider,{value:{code:e},children:(0,U.jsxs)(Gq,{dir:`ltr`,isIncomplete:i,language:t,children:[(0,U.jsx)(Jq,{language:t}),r?(0,U.jsx)(`div`,{className:c(`pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end`),children:(0,U.jsx)(`div`,{className:c(`pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur`),"data-streamdown":`code-block-actions`,children:r})}):null,(0,U.jsx)(v.Suspense,{fallback:(0,U.jsx)(Wq,{className:n,language:t,lineNumbers:o,maxHeight:l,result:d,startLine:a,...s}),children:(0,U.jsx)(Xq,{className:n,code:u,language:t,lineNumbers:o,maxHeight:l,raw:d,startLine:a,...s})})]})})},Qq={CheckIcon:e=>(0,U.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,U.jsx)(`path`,{clipRule:`evenodd`,d:`M15.5607 3.99999L15.0303 4.53032L6.23744 13.3232C5.55403 14.0066 4.44599 14.0066 3.76257 13.3232L4.2929 12.7929L3.76257 13.3232L0.969676 10.5303L0.439346 9.99999L1.50001 8.93933L2.03034 9.46966L4.82323 12.2626C4.92086 12.3602 5.07915 12.3602 5.17678 12.2626L13.9697 3.46966L14.5 2.93933L15.5607 3.99999Z`,fill:`currentColor`,fillRule:`evenodd`})}),CopyIcon:e=>(0,U.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,U.jsx)(`path`,{clipRule:`evenodd`,d:`M2.75 0.5C1.7835 0.5 1 1.2835 1 2.25V9.75C1 10.7165 1.7835 11.5 2.75 11.5H3.75H4.5V10H3.75H2.75C2.61193 10 2.5 9.88807 2.5 9.75V2.25C2.5 2.11193 2.61193 2 2.75 2H8.25C8.38807 2 8.5 2.11193 8.5 2.25V3H10V2.25C10 1.2835 9.2165 0.5 8.25 0.5H2.75ZM7.75 4.5C6.7835 4.5 6 5.2835 6 6.25V13.75C6 14.7165 6.7835 15.5 7.75 15.5H13.25C14.2165 15.5 15 14.7165 15 13.75V6.25C15 5.2835 14.2165 4.5 13.25 4.5H7.75ZM7.5 6.25C7.5 6.11193 7.61193 6 7.75 6H13.25C13.3881 6 13.5 6.11193 13.5 6.25V13.75C13.5 13.8881 13.3881 14 13.25 14H7.75C7.61193 14 7.5 13.8881 7.5 13.75V6.25Z`,fill:`currentColor`,fillRule:`evenodd`})}),DownloadIcon:e=>(0,U.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,U.jsx)(`path`,{clipRule:`evenodd`,d:`M8.75 1V1.75V8.68934L10.7197 6.71967L11.25 6.18934L12.3107 7.25L11.7803 7.78033L8.70711 10.8536C8.31658 11.2441 7.68342 11.2441 7.29289 10.8536L4.21967 7.78033L3.68934 7.25L4.75 6.18934L5.28033 6.71967L7.25 8.68934V1.75V1H8.75ZM13.5 9.25V13.5H2.5V9.25V8.5H1V9.25V14C1 14.5523 1.44771 15 2 15H14C14.5523 15 15 14.5523 15 14V9.25V8.5H13.5V9.25Z`,fill:`currentColor`,fillRule:`evenodd`})}),ExternalLinkIcon:e=>(0,U.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,U.jsx)(`path`,{clipRule:`evenodd`,d:`M13.5 10.25V13.25C13.5 13.3881 13.3881 13.5 13.25 13.5H2.75C2.61193 13.5 2.5 13.3881 2.5 13.25L2.5 2.75C2.5 2.61193 2.61193 2.5 2.75 2.5H5.75H6.5V1H5.75H2.75C1.7835 1 1 1.7835 1 2.75V13.25C1 14.2165 1.7835 15 2.75 15H13.25C14.2165 15 15 14.2165 15 13.25V10.25V9.5H13.5V10.25ZM9 1H9.75H14.2495C14.6637 1 14.9995 1.33579 14.9995 1.75V6.25V7H13.4995V6.25V3.56066L8.53033 8.52978L8 9.06011L6.93934 7.99945L7.46967 7.46912L12.4388 2.5H9.75H9V1Z`,fill:`currentColor`,fillRule:`evenodd`})}),Loader2Icon:e=>(0,U.jsxs)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:[(0,U.jsx)(`path`,{d:`M8 0V4`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,U.jsx)(`path`,{d:`M8 16V12`,opacity:`0.5`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,U.jsx)(`path`,{d:`M3.29773 1.52783L5.64887 4.7639`,opacity:`0.9`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,U.jsx)(`path`,{d:`M12.7023 1.52783L10.3511 4.7639`,opacity:`0.1`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,U.jsx)(`path`,{d:`M12.7023 14.472L10.3511 11.236`,opacity:`0.4`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,U.jsx)(`path`,{d:`M3.29773 14.472L5.64887 11.236`,opacity:`0.6`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,U.jsx)(`path`,{d:`M15.6085 5.52783L11.8043 6.7639`,opacity:`0.2`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,U.jsx)(`path`,{d:`M0.391602 10.472L4.19583 9.23598`,opacity:`0.7`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,U.jsx)(`path`,{d:`M15.6085 10.4722L11.8043 9.2361`,opacity:`0.3`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,U.jsx)(`path`,{d:`M0.391602 5.52783L4.19583 6.7639`,opacity:`0.8`,stroke:`currentColor`,strokeWidth:`1.5`})]}),Maximize2Icon:e=>(0,U.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,U.jsx)(`path`,{clipRule:`evenodd`,d:`M1 5.25V6H2.5V5.25V2.5H5.25H6V1H5.25H2C1.44772 1 1 1.44772 1 2V5.25ZM5.25 14.9994H6V13.4994H5.25H2.5V10.7494V9.99939H1V10.7494V13.9994C1 14.5517 1.44772 14.9994 2 14.9994H5.25ZM15 10V10.75V14C15 14.5523 14.5523 15 14 15H10.75H10V13.5H10.75H13.5V10.75V10H15ZM10.75 1H10V2.5H10.75H13.5V5.25V6H15V5.25V2C15 1.44772 14.5523 1 14 1H10.75Z`,fill:`currentColor`,fillRule:`evenodd`})}),RotateCcwIcon:e=>(0,U.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,U.jsx)(`path`,{clipRule:`evenodd`,d:`M13.5 8C13.5 4.96643 11.0257 2.5 7.96452 2.5C5.42843 2.5 3.29365 4.19393 2.63724 6.5H5.25H6V8H5.25H0.75C0.335787 8 0 7.66421 0 7.25V2.75V2H1.5V2.75V5.23347C2.57851 2.74164 5.06835 1 7.96452 1C11.8461 1 15 4.13001 15 8C15 11.87 11.8461 15 7.96452 15C5.62368 15 3.54872 13.8617 2.27046 12.1122L1.828 11.5066L3.03915 10.6217L3.48161 11.2273C4.48831 12.6051 6.12055 13.5 7.96452 13.5C11.0257 13.5 13.5 11.0336 13.5 8Z`,fill:`currentColor`,fillRule:`evenodd`})}),XIcon:e=>(0,U.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,U.jsx)(`path`,{clipRule:`evenodd`,d:`M12.4697 13.5303L13 14.0607L14.0607 13L13.5303 12.4697L9.06065 7.99999L13.5303 3.53032L14.0607 2.99999L13 1.93933L12.4697 2.46966L7.99999 6.93933L3.53032 2.46966L2.99999 1.93933L1.93933 2.99999L2.46966 3.53032L6.93933 7.99999L2.46966 12.4697L1.93933 13L2.99999 14.0607L3.53032 13.5303L7.99999 9.06065L12.4697 13.5303Z`,fill:`currentColor`,fillRule:`evenodd`})}),ZoomInIcon:e=>(0,U.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,U.jsx)(`path`,{clipRule:`evenodd`,d:`M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H5.875V4.75V4.125H7.125V4.75V5.875H8.25H8.875V7.125H8.25H7.125V8.25V8.875H5.875V8.25V7.125H4.75H4.125V5.875Z`,fill:`currentColor`,fillRule:`evenodd`})}),ZoomOutIcon:e=>(0,U.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,U.jsx)(`path`,{clipRule:`evenodd`,d:`M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H8.25H8.875V7.125H8.25H4.75H4.125V5.875Z`,fill:`currentColor`,fillRule:`evenodd`})})},$q=(0,v.createContext)(Qq),eJ=(e,t)=>{if(e===t)return!0;if(!(e&&t))return e===t;let n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(n=>e[n]===t[n])},tJ=({icons:e,children:t})=>{let n=(0,v.useRef)(e),r=(0,v.useRef)(e?{...Qq,...e}:Qq);eJ(n.current,e)||(n.current=e,r.current=e?{...Qq,...e}:Qq);let i=r.current;return(0,U.jsx)($q.Provider,{value:i,children:t})},nJ=()=>(0,v.useContext)($q),rJ={copyCode:`Copy Code`,downloadFile:`Download file`,downloadDiagram:`Download diagram`,downloadDiagramAsSvg:`Download diagram as SVG`,downloadDiagramAsPng:`Download diagram as PNG`,downloadDiagramAsMmd:`Download diagram as MMD`,viewFullscreen:`View fullscreen`,exitFullscreen:`Exit fullscreen`,mermaidFormatSvg:`SVG`,mermaidFormatPng:`PNG`,mermaidFormatMmd:`MMD`,zoomIn:`Zoom in`,zoomOut:`Zoom out`,resetView:`Reset zoom and pan`,copyTable:`Copy table`,copyTableAsMarkdown:`Copy table as Markdown`,copyTableAsCsv:`Copy table as CSV`,copyTableAsTsv:`Copy table as TSV`,downloadTable:`Download table`,downloadTableAsCsv:`Download table as CSV`,downloadTableAsMarkdown:`Download table as Markdown`,tableFormatMarkdown:`Markdown`,tableFormatCsv:`CSV`,tableFormatTsv:`TSV`,imageNotAvailable:`Image not available`,downloadImage:`Download image`,openExternalLink:`Open external link?`,externalLinkWarning:`You're about to visit an external website.`,close:`Close`,copyLink:`Copy link`,copied:`Copied`,openLink:`Open link`},iJ=(0,v.createContext)(rJ),aJ=()=>(0,v.useContext)(iJ),oJ=({onCopy:e,onError:t,timeout:n=2e3,children:r,className:i,code:a,...o})=>{let s=Lq(),[c,l]=(0,v.useState)(!1),u=(0,v.useRef)(0),{code:d}=qq(),{isAnimating:f}=(0,v.useContext)(DX),p=aJ(),m=a??d,h=async()=>{var r;if(typeof window>`u`||!((r=navigator==null?void 0:navigator.clipboard)!=null&&r.writeText)){t?.(Error(`Clipboard API not available`));return}try{c||(await navigator.clipboard.writeText(m),l(!0),e?.(),u.current=window.setTimeout(()=>l(!1),n))}catch(e){t?.(e)}};(0,v.useEffect)(()=>()=>{window.clearTimeout(u.current)},[]);let g=nJ(),_=c?g.CheckIcon:g.CopyIcon;return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`button`,{"aria-label":p.copyCode,className:s(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),"data-streamdown":`code-block-copy-button`,disabled:f,onClick:h,title:p.copyCode,type:`button`,...o,children:r??(0,U.jsx)(_,{"aria-hidden":`true`,size:14})}),c&&(0,U.jsx)(`output`,{"aria-live":`polite`,className:`sr-only`,children:p.copied})]})},sJ=(e,t,n)=>{if(typeof e==`boolean`)return n;let r=e[t];if(typeof r!=`object`)return n;let i=r.download;return typeof i==`object`&&i.filename||n},cJ={"1c":`1c`,"1c-query":`1cq`,abap:`abap`,"actionscript-3":`as`,ada:`ada`,adoc:`adoc`,"angular-html":`html`,"angular-ts":`ts`,apache:`conf`,apex:`cls`,apl:`apl`,applescript:`applescript`,ara:`ara`,asciidoc:`adoc`,asm:`asm`,astro:`astro`,awk:`awk`,ballerina:`bal`,bash:`sh`,bat:`bat`,batch:`bat`,be:`be`,beancount:`beancount`,berry:`berry`,bibtex:`bib`,bicep:`bicep`,blade:`blade.php`,bsl:`bsl`,c:`c`,"c#":`cs`,"c++":`cpp`,cadence:`cdc`,cairo:`cairo`,cdc:`cdc`,clarity:`clar`,clj:`clj`,clojure:`clj`,"closure-templates":`soy`,cmake:`cmake`,cmd:`cmd`,cobol:`cob`,codeowners:`CODEOWNERS`,codeql:`ql`,coffee:`coffee`,coffeescript:`coffee`,"common-lisp":`lisp`,console:`sh`,coq:`v`,cpp:`cpp`,cql:`cql`,crystal:`cr`,cs:`cs`,csharp:`cs`,css:`css`,csv:`csv`,cue:`cue`,cypher:`cql`,d:`d`,dart:`dart`,dax:`dax`,desktop:`desktop`,diff:`diff`,docker:`dockerfile`,dockerfile:`dockerfile`,dotenv:`env`,"dream-maker":`dm`,edge:`edge`,elisp:`el`,elixir:`ex`,elm:`elm`,"emacs-lisp":`el`,erb:`erb`,erl:`erl`,erlang:`erl`,f:`f`,"f#":`fs`,f03:`f03`,f08:`f08`,f18:`f18`,f77:`f77`,f90:`f90`,f95:`f95`,fennel:`fnl`,fish:`fish`,fluent:`ftl`,for:`for`,"fortran-fixed-form":`f`,"fortran-free-form":`f90`,fs:`fs`,fsharp:`fs`,fsl:`fsl`,ftl:`ftl`,gdresource:`tres`,gdscript:`gd`,gdshader:`gdshader`,genie:`gs`,gherkin:`feature`,"git-commit":`gitcommit`,"git-rebase":`gitrebase`,gjs:`js`,gleam:`gleam`,"glimmer-js":`js`,"glimmer-ts":`ts`,glsl:`glsl`,gnuplot:`plt`,go:`go`,gql:`gql`,graphql:`graphql`,groovy:`groovy`,gts:`gts`,hack:`hack`,haml:`haml`,handlebars:`hbs`,haskell:`hs`,haxe:`hx`,hbs:`hbs`,hcl:`hcl`,hjson:`hjson`,hlsl:`hlsl`,hs:`hs`,html:`html`,"html-derivative":`html`,http:`http`,hxml:`hxml`,hy:`hy`,imba:`imba`,ini:`ini`,jade:`jade`,java:`java`,javascript:`js`,jinja:`jinja`,jison:`jison`,jl:`jl`,js:`js`,json:`json`,json5:`json5`,jsonc:`jsonc`,jsonl:`jsonl`,jsonnet:`jsonnet`,jssm:`jssm`,jsx:`jsx`,julia:`jl`,kotlin:`kt`,kql:`kql`,kt:`kt`,kts:`kts`,kusto:`kql`,latex:`tex`,lean:`lean`,lean4:`lean`,less:`less`,liquid:`liquid`,lisp:`lisp`,lit:`lit`,llvm:`ll`,log:`log`,logo:`logo`,lua:`lua`,luau:`luau`,make:`mak`,makefile:`mak`,markdown:`md`,marko:`marko`,matlab:`m`,md:`md`,mdc:`mdc`,mdx:`mdx`,mediawiki:`wiki`,mermaid:`mmd`,mips:`s`,mipsasm:`s`,mmd:`mmd`,mojo:`mojo`,move:`move`,nar:`nar`,narrat:`narrat`,nextflow:`nf`,nf:`nf`,nginx:`conf`,nim:`nim`,nix:`nix`,nu:`nu`,nushell:`nu`,objc:`m`,"objective-c":`m`,"objective-cpp":`mm`,ocaml:`ml`,pascal:`pas`,perl:`pl`,perl6:`p6`,php:`php`,plsql:`pls`,po:`po`,polar:`polar`,postcss:`pcss`,pot:`pot`,potx:`potx`,powerquery:`pq`,powershell:`ps1`,prisma:`prisma`,prolog:`pl`,properties:`properties`,proto:`proto`,protobuf:`proto`,ps:`ps`,ps1:`ps1`,pug:`pug`,puppet:`pp`,purescript:`purs`,py:`py`,python:`py`,ql:`ql`,qml:`qml`,qmldir:`qmldir`,qss:`qss`,r:`r`,racket:`rkt`,raku:`raku`,razor:`cshtml`,rb:`rb`,reg:`reg`,regex:`regex`,regexp:`regexp`,rel:`rel`,riscv:`s`,rs:`rs`,rst:`rst`,ruby:`rb`,rust:`rs`,sas:`sas`,sass:`sass`,scala:`scala`,scheme:`scm`,scss:`scss`,sdbl:`sdbl`,sh:`sh`,shader:`shader`,shaderlab:`shader`,shell:`sh`,shellscript:`sh`,shellsession:`sh`,smalltalk:`st`,solidity:`sol`,soy:`soy`,sparql:`rq`,spl:`spl`,splunk:`spl`,sql:`sql`,"ssh-config":`config`,stata:`do`,styl:`styl`,stylus:`styl`,svelte:`svelte`,swift:`swift`,"system-verilog":`sv`,systemd:`service`,talon:`talon`,talonscript:`talon`,tasl:`tasl`,tcl:`tcl`,templ:`templ`,terraform:`tf`,tex:`tex`,tf:`tf`,tfvars:`tfvars`,toml:`toml`,ts:`ts`,"ts-tags":`ts`,tsp:`tsp`,tsv:`tsv`,tsx:`tsx`,turtle:`ttl`,twig:`twig`,typ:`typ`,typescript:`ts`,typespec:`tsp`,typst:`typ`,v:`v`,vala:`vala`,vb:`vb`,verilog:`v`,vhdl:`vhdl`,vim:`vim`,viml:`vim`,vimscript:`vim`,vue:`vue`,"vue-html":`html`,"vue-vine":`vine`,vy:`vy`,vyper:`vy`,wasm:`wasm`,wenyan:`wy`,wgsl:`wgsl`,wiki:`wiki`,wikitext:`wiki`,wit:`wit`,wl:`wl`,wolfram:`wl`,xml:`xml`,xsl:`xsl`,yaml:`yaml`,yml:`yml`,zenscript:`zs`,zig:`zig`,zsh:`zsh`,文言:`wy`},lJ=({onDownload:e,onError:t,language:n,children:r,className:i,code:a,...o})=>{let s=Lq(),{code:c}=qq(),{isAnimating:l,controls:u}=(0,v.useContext)(DX),d=aJ(),f=nJ(),p=a??c,m=n&&n in cJ?cJ[n]:`txt`,h=`${sJ(u,`code`,`file`)}.${m}`;return(0,U.jsx)(`button`,{"aria-label":d.downloadFile,className:s(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),"data-streamdown":`code-block-download-button`,disabled:l,onClick:()=>{try{Fq(h,p,`text/plain`),e?.()}catch(e){t?.(e)}},title:d.downloadFile,type:`button`,...o,children:r??(0,U.jsx)(f.DownloadIcon,{size:14})})},uJ=()=>{let{Loader2Icon:e}=nJ(),t=Lq();return(0,U.jsxs)(`div`,{className:t(`w-full divide-y divide-border overflow-hidden rounded-xl border border-border`),children:[(0,U.jsx)(`div`,{className:t(`h-[46px] w-full bg-muted/80`)}),(0,U.jsx)(`div`,{className:t(`flex w-full items-center justify-center p-4`),children:(0,U.jsx)(e,{className:t(`size-4 animate-spin`)})})]})},dJ=/\.[^/.]+$/,fJ=({node:e,className:t,src:n,alt:r,onLoad:i,onError:a,showControls:o=!0,showDownloadControl:s=!0,...c})=>{let{DownloadIcon:l}=nJ(),u=Lq(),d=(0,v.useRef)(null),[f,p]=(0,v.useState)(!1),[m,h]=(0,v.useState)(!1),g=aJ(),_=c.width!=null||c.height!=null,y=(f||_)&&!m&&o&&s,b=m&&!_;(0,v.useEffect)(()=>{let e=d.current;if(e!=null&&e.complete){let t=e.naturalWidth>0;p(t),h(!t)}},[]);let x=(0,v.useCallback)(e=>{p(!0),h(!1),i?.(e)},[i]),S=(0,v.useCallback)(e=>{p(!1),h(!0),a?.(e)},[a]),C=async()=>{if(n)try{let e=await(await fetch(n)).blob(),t=new URL(n,window.location.origin).pathname.split(`/`).pop()||``,i=t.split(`.`).pop(),a=t.includes(`.`)&&i!==void 0&&i.length<=4,o=``;if(a)o=t;else{let n=e.type,i=`png`;n.includes(`jpeg`)||n.includes(`jpg`)?i=`jpg`:n.includes(`png`)?i=`png`:n.includes(`svg`)?i=`svg`:n.includes(`gif`)?i=`gif`:n.includes(`webp`)&&(i=`webp`),o=`${(r||t||`image`).replace(dJ,``)}.${i}`}Fq(o,e,e.type)}catch{window.open(n,`_blank`)}};return n?(0,U.jsxs)(`div`,{className:u(`group relative my-4 inline-block`),"data-streamdown":`image-wrapper`,children:[(0,U.jsx)(`img`,{alt:r,className:u(`max-w-full rounded-lg`,b&&`hidden`,t),"data-streamdown":`image`,onError:S,onLoad:x,ref:d,src:n,...c}),b&&(0,U.jsx)(`span`,{className:u(`text-muted-foreground text-xs italic`),"data-streamdown":`image-fallback`,children:g.imageNotAvailable}),o&&(0,U.jsx)(`div`,{className:u(`pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block`),"data-streamdown":`image-overlay`}),y&&(0,U.jsx)(`button`,{className:u(`absolute right-2 bottom-2 flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-border bg-background/90 shadow-sm backdrop-blur-sm transition-all duration-200 hover:bg-background`,`opacity-0 group-hover:opacity-100`),onClick:C,title:g.downloadImage,type:`button`,children:(0,U.jsx)(l,{size:14})})]}):null},pJ=0,mJ=()=>{pJ+=1,pJ===1&&(document.body.style.overflow=`hidden`)},hJ=()=>{pJ=Math.max(0,pJ-1),pJ===0&&(document.body.style.overflow=``)},gJ=({url:e,isOpen:t,onClose:n,onConfirm:r})=>{let{CheckIcon:i,CopyIcon:a,ExternalLinkIcon:o,XIcon:s}=nJ(),c=Lq(),[l,u]=(0,v.useState)(!1),d=aJ(),f=(0,v.useCallback)(async()=>{try{await navigator.clipboard.writeText(e),u(!0),setTimeout(()=>u(!1),2e3)}catch{}},[e]),p=(0,v.useCallback)(()=>{r(),n()},[r,n]);if((0,v.useEffect)(()=>{if(t){mJ();let e=e=>{e.key===`Escape`&&n()};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),hJ()}}},[t,n]),!t||typeof document>`u`)return null;let m=(0,U.jsx)(`div`,{className:c(`fixed inset-0 z-50 flex items-center justify-center bg-background/50 backdrop-blur-sm`),"data-streamdown":`link-safety-modal`,onClick:n,onKeyDown:e=>{e.key===`Escape`&&n()},role:`button`,tabIndex:0,children:(0,U.jsxs)(`div`,{className:c(`relative mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border bg-background p-6 shadow-lg`),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:[(0,U.jsx)(`button`,{className:c(`absolute top-4 right-4 rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`),onClick:n,title:d.close,type:`button`,children:(0,U.jsx)(s,{size:16})}),(0,U.jsxs)(`div`,{className:c(`flex flex-col gap-2`),children:[(0,U.jsxs)(`div`,{className:c(`flex items-center gap-2 font-semibold text-lg`),children:[(0,U.jsx)(o,{size:20}),(0,U.jsx)(`span`,{children:d.openExternalLink})]}),(0,U.jsx)(`p`,{className:c(`text-muted-foreground text-sm`),children:d.externalLinkWarning})]}),(0,U.jsx)(`div`,{className:c(`break-all rounded-md bg-muted p-3 font-mono text-sm`,e.length>100&&`max-h-32 overflow-y-auto`),children:e}),(0,U.jsxs)(`div`,{className:c(`flex gap-2`),children:[(0,U.jsx)(`button`,{className:c(`flex flex-1 items-center justify-center gap-2 rounded-md border bg-background px-4 py-2 font-medium text-sm transition-all hover:bg-muted`),onClick:f,type:`button`,children:l?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(i,{size:14}),(0,U.jsx)(`span`,{children:d.copied})]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(a,{size:14}),(0,U.jsx)(`span`,{children:d.copyLink})]})}),(0,U.jsxs)(`button`,{className:c(`flex flex-1 items-center justify-center gap-2 rounded-md bg-primary px-4 py-2 font-medium text-primary-foreground text-sm transition-all hover:bg-primary/90`),onClick:p,type:`button`,children:[(0,U.jsx)(o,{size:14}),(0,U.jsx)(`span`,{children:d.openLink})]})]})]})});return(0,td.createPortal)(m,document.body)},_J=(0,v.createContext)(null),vJ=()=>(0,v.useContext)(_J),yJ=()=>vJ()?.code??null,bJ=()=>vJ()?.mermaid??null,xJ=e=>{var t;let n=vJ();return n!=null&&n.renderers&&e&&(t=n.renderers.find(t=>Array.isArray(t.language)?t.language.includes(e):t.language===e))!=null?t:null},SJ=e=>{if(typeof DOMParser>`u`||typeof XMLSerializer>`u`)return e;let t=new DOMParser().parseFromString(e,`text/html`).querySelector(`svg`);return t?new XMLSerializer().serializeToString(t):e},CJ=(e,t)=>new Promise((t,n)=>{let r=`data:image/svg+xml;base64,`+btoa(unescape(encodeURIComponent(e))),i=new Image;i.crossOrigin=`anonymous`,i.onload=()=>{let e=document.createElement(`canvas`),r=i.width*5,a=i.height*5;e.width=r,e.height=a;let o=e.getContext(`2d`);if(!o){n(Error(`Failed to create 2D canvas context for PNG export`));return}o.drawImage(i,0,0,r,a),e.toBlob(e=>{if(!e){n(Error(`Failed to create PNG blob`));return}t(e)},`image/png`)},i.onerror=()=>n(Error(`Failed to load SVG image`)),i.src=r}),wJ=({chart:e,children:t,className:n,onDownload:r,config:i,onError:a})=>{let o=Lq(),[s,c]=(0,v.useState)(!1),l=(0,v.useRef)(null),{isAnimating:u,controls:d}=(0,v.useContext)(DX),f=nJ(),p=bJ(),m=aJ(),h=sJ(d,`mermaid`,`diagram`),g=async t=>{try{if(t===`mmd`){Fq(`${h}.mmd`,e,`text/plain`),c(!1),r?.(t);return}if(!p){a?.(Error(`Mermaid plugin not available`));return}let n=p.getMermaid(i),o=e.split(``).reduce((e,t)=>(e<<5)-e+t.charCodeAt(0)|0,0),s=`mermaid-${Math.abs(o)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:l}=await n.render(s,e);if(!l){a?.(Error(`SVG not found. Please wait for the diagram to render.`));return}let u=SJ(l);if(t===`svg`){Fq(`${h}.svg`,u,`image/svg+xml`),c(!1),r?.(t);return}if(t===`png`){let e=await CJ(u);Fq(`${h}.png`,e,`image/png`),r?.(t),c(!1);return}}catch(e){a?.(e)}};return(0,v.useEffect)(()=>{let e=e=>{let t=e.composedPath();l.current&&!t.includes(l.current)&&c(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,U.jsxs)(`div`,{className:o(`relative`),ref:l,children:[(0,U.jsx)(`button`,{"aria-label":m.downloadDiagram,className:o(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,n),disabled:u,onClick:()=>c(!s),title:m.downloadDiagram,type:`button`,children:t??(0,U.jsx)(f.DownloadIcon,{"aria-hidden":`true`,size:14})}),s?(0,U.jsxs)(`div`,{className:o(`absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,U.jsx)(`button`,{"aria-label":m.downloadDiagramAsSvg,className:o(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>g(`svg`),title:m.downloadDiagramAsSvg,type:`button`,children:m.mermaidFormatSvg}),(0,U.jsx)(`button`,{"aria-label":m.downloadDiagramAsPng,className:o(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>g(`png`),title:m.downloadDiagramAsPng,type:`button`,children:m.mermaidFormatPng}),(0,U.jsx)(`button`,{"aria-label":m.downloadDiagramAsMmd,className:o(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>g(`mmd`),title:m.downloadDiagramAsMmd,type:`button`,children:m.mermaidFormatMmd})]}):null]})},TJ=({chart:e,config:t,onFullscreen:n,onExit:r,className:i,...a})=>{let{Maximize2Icon:o,XIcon:s}=nJ(),c=Lq(),[l,u]=(0,v.useState)(!1),{isAnimating:d,controls:f}=(0,v.useContext)(DX),p=aJ(),m=(()=>{if(typeof f==`boolean`)return f;let e=f.mermaid;return e===!1?!1:e===!0||e===void 0||e.panZoom!==!1})(),h=(()=>{if(typeof f==`boolean`)return f;let e=f.mermaid;return e===!1?!1:e===!0||e===void 0||e.download!==!1})(),g=(()=>{if(typeof f==`boolean`)return f;let e=f.mermaid;return e===!1?!1:e===!0||e===void 0||e.copy!==!1})(),_=()=>{u(!l)};return(0,v.useEffect)(()=>{if(l){mJ();let e=e=>{e.key===`Escape`&&u(!1)};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),hJ()}}},[l]),(0,v.useEffect)(()=>{l?n?.():r&&r()},[l,n,r]),(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`button`,{className:c(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),disabled:d,onClick:_,title:p.viewFullscreen,type:`button`,...a,"aria-label":p.viewFullscreen,children:(0,U.jsx)(o,{"aria-hidden":`true`,size:14})}),l?(0,td.createPortal)((0,U.jsxs)(`div`,{"aria-label":p.viewFullscreen,"aria-modal":`true`,className:c(`fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm`),"data-streamdown":`mermaid-fullscreen`,onClick:_,onKeyDown:e=>{e.key===`Escape`&&_()},role:`dialog`,children:[(0,U.jsxs)(`div`,{className:c(`absolute top-4 right-4 z-10 flex items-center gap-1`),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:[h?(0,U.jsx)(wJ,{chart:e,config:t}):null,g?(0,U.jsx)(oJ,{code:e}):null,(0,U.jsx)(`button`,{"aria-label":p.exitFullscreen,className:c(`rounded-md p-2 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`),onClick:_,title:p.exitFullscreen,type:`button`,children:(0,U.jsx)(s,{"aria-hidden":`true`,size:20})})]}),(0,U.jsx)(`div`,{className:c(`flex size-full items-center justify-center p-4`),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:(0,U.jsx)(jX,{chart:e,className:c(`size-full [&_svg]:h-auto [&_svg]:w-auto`),config:t,fullscreen:!0,showControls:m})})]}),document.body):null]})};function EJ(e){if(e.nodeType===Node.TEXT_NODE)return e.textContent??``;if(e.nodeType!==Node.ELEMENT_NODE)return``;let t=e;return t.tagName===`BR`?`
160
+ `:Array.from(t.childNodes).map(EJ).join(``)}var DJ=e=>{let t=[],n=[],r=e.querySelectorAll(`thead th`);for(let e of r)t.push(EJ(e).trim());let i=e.querySelectorAll(`tbody tr`);for(let e of i){let t=[],r=e.querySelectorAll(`td`);for(let e of r)t.push(EJ(e).trim());n.push(t)}return{headers:t,rows:n}},OJ=e=>{if(typeof e!=`object`)return`,`;let t=e.table;return typeof t==`object`?t.csvSeparator??`,`:`,`},kJ=(e,t=`,`)=>{let n;n=t===`auto`?Intl.NumberFormat().format(1.1).includes(`,`)?`;`:`,`:t;let{headers:r,rows:i}=e,a=e=>{let t=!1;for(let r of e)if(r===n||r===`"`||r===`
161
+ `||r===`\r`){t=!0;break}return t?`"${e.replace(/"/g,`""`)}"`:e},o=r.length>0?i.length+1:i.length,s=Array(o),c=0;r.length>0&&(s[c]=r.map(a).join(n),c+=1);for(let e of i)s[c]=e.map(a).join(n),c+=1;return s.join(`
162
+ `)},AJ=e=>{let{headers:t,rows:n}=e,r=e=>{let t=!1;for(let n of e)if(n===` `||n===`
163
+ `||n===`\r`){t=!0;break}if(!t)return e;let n=[];for(let t of e)t===` `?n.push(`\\t`):t===`
164
+ `?n.push(`\\n`):t===`\r`?n.push(`\\r`):n.push(t);return n.join(``)},i=t.length>0?n.length+1:n.length,a=Array(i),o=0;t.length>0&&(a[o]=t.map(r).join(` `),o+=1);for(let e of n)a[o]=e.map(r).join(` `),o+=1;return a.join(`
165
+ `)},jJ=e=>{let t=!1;for(let n of e)if(n===`\\`||n===`|`||n===`
166
+ `){t=!0;break}if(!t)return e;let n=[];for(let t of e)t===`\\`?n.push(`\\\\`):t===`|`?n.push(`\\|`):t===`
167
+ `?n.push(`<br>`):n.push(t);return n.join(``)},MJ=e=>{let{headers:t,rows:n}=e;if(t.length===0)return``;let r=Array(n.length+2),i=0,a=t.map(e=>jJ(e));r[i]=`| ${a.join(` | `)} |`,i+=1;let o=Array(t.length);for(let e=0;e<t.length;e+=1)o[e]=`---`;r[i]=`| ${o.join(` | `)} |`,i+=1;for(let e of n)if(e.length<t.length){let n=Array(t.length);for(let r=0;r<t.length;r+=1)n[r]=r<e.length?jJ(e[r]):``;r[i]=`| ${n.join(` | `)} |`,i+=1}else{let t=e.map(e=>jJ(e));r[i]=`| ${t.join(` | `)} |`,i+=1}return r.join(`
168
+ `)},NJ=({children:e,className:t,onCopy:n,onError:r,timeout:i=2e3})=>{let a=Lq(),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(!1),u=(0,v.useRef)(null),d=(0,v.useRef)(0),{isAnimating:f,controls:p}=(0,v.useContext)(DX),m=aJ(),h=OJ(p),g=async e=>{var t;if(typeof window>`u`||!((t=navigator==null?void 0:navigator.clipboard)!=null&&t.write)){r?.(Error(`Clipboard API not available`));return}try{let t=(u.current?.closest(`[data-streamdown="table-wrapper"]`))?.querySelector(`table`);if(!t){r?.(Error(`Table not found`));return}let a=DJ(t),o=``;o=e===`csv`?kJ(a,h):e===`tsv`?AJ(a):MJ(a);let c=new ClipboardItem({"text/plain":new Blob([o],{type:`text/plain`}),"text/html":new Blob([t.outerHTML],{type:`text/html`})});await navigator.clipboard.write([c]),l(!0),s(!1),n?.(e),d.current=window.setTimeout(()=>l(!1),i)}catch(e){r?.(e)}};(0,v.useEffect)(()=>{let e=e=>{let t=e.composedPath();u.current&&!t.includes(u.current)&&s(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e),window.clearTimeout(d.current)}},[]);let _=nJ(),y=c?_.CheckIcon:_.CopyIcon;return(0,U.jsxs)(`div`,{className:a(`relative`),ref:u,children:[(0,U.jsx)(`button`,{className:a(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:f,onClick:()=>s(!o),title:m.copyTable,type:`button`,children:e??(0,U.jsx)(y,{height:14,width:14})}),o?(0,U.jsxs)(`div`,{className:a(`absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,U.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>g(`md`),title:m.copyTableAsMarkdown,type:`button`,children:m.tableFormatMarkdown}),(0,U.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>g(`csv`),title:m.copyTableAsCsv,type:`button`,children:m.tableFormatCsv}),(0,U.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>g(`tsv`),title:m.copyTableAsTsv,type:`button`,children:m.tableFormatTsv})]}):null]})},PJ=({children:e,className:t,onDownload:n,onError:r})=>{let i=Lq(),[a,o]=(0,v.useState)(!1),s=(0,v.useRef)(null),{isAnimating:c,controls:l}=(0,v.useContext)(DX),u=aJ(),d=nJ(),f=OJ(l),p=e=>{try{let t=(s.current?.closest(`[data-streamdown="table-wrapper"]`))?.querySelector(`table`);if(!t){r?.(Error(`Table not found`));return}let i=DJ(t),a=e===`csv`?kJ(i,f):MJ(i),c=e===`csv`?`csv`:`md`;Fq(`${sJ(l,`table`,`table`)}.${c}`,a,e===`csv`?`text/csv`:`text/markdown`),o(!1),n?.(e)}catch(e){r?.(e)}};return(0,v.useEffect)(()=>{let e=e=>{let t=e.composedPath();s.current&&!t.includes(s.current)&&o(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,U.jsxs)(`div`,{className:i(`relative`),ref:s,children:[(0,U.jsx)(`button`,{className:i(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:c,onClick:()=>o(!a),title:u.downloadTable,type:`button`,children:e??(0,U.jsx)(d.DownloadIcon,{size:14})}),a?(0,U.jsxs)(`div`,{className:i(`absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,U.jsx)(`button`,{className:i(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>p(`csv`),title:u.downloadTableAsCsv,type:`button`,children:u.tableFormatCsv}),(0,U.jsx)(`button`,{className:i(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>p(`markdown`),title:u.downloadTableAsMarkdown,type:`button`,children:u.tableFormatMarkdown})]}):null]})},FJ=({children:e,className:t,showCopy:n=!0,showDownload:r=!0})=>{let{Maximize2Icon:i,XIcon:a}=nJ(),o=Lq(),[s,c]=(0,v.useState)(!1),{isAnimating:l}=(0,v.useContext)(DX),u=aJ(),d=()=>{c(!0)},f=()=>{c(!1)};return(0,v.useEffect)(()=>{if(s){mJ();let e=e=>{e.key===`Escape`&&c(!1)};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),hJ()}}},[s]),(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`button`,{className:o(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:l,onClick:d,title:u.viewFullscreen,type:`button`,children:(0,U.jsx)(i,{size:14})}),s?(0,td.createPortal)((0,U.jsx)(`div`,{"aria-label":u.viewFullscreen,"aria-modal":`true`,className:o(`fixed inset-0 z-50 flex flex-col bg-background`),"data-streamdown":`table-fullscreen`,onClick:f,onKeyDown:e=>{e.key===`Escape`&&f()},role:`dialog`,children:(0,U.jsxs)(`div`,{className:o(`flex h-full flex-col`),"data-streamdown":`table-wrapper`,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:[(0,U.jsxs)(`div`,{className:o(`flex items-center justify-end gap-1 p-4`),children:[n?(0,U.jsx)(NJ,{}):null,r?(0,U.jsx)(PJ,{}):null,(0,U.jsx)(`button`,{className:o(`rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`),onClick:f,title:u.exitFullscreen,type:`button`,children:(0,U.jsx)(a,{size:20})})]}),(0,U.jsx)(`div`,{className:o(`flex-1 overflow-auto p-4 pt-0 [&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10`),children:(0,U.jsx)(`table`,{className:o(`w-full border-collapse border border-border`),"data-streamdown":`table`,children:e})})]})}),document.body):null]})},IJ=({children:e,className:t,maxHeight:n,showControls:r,showCopy:i=!0,showDownload:a=!0,showFullscreen:o=!0,...s})=>{let c=Lq(),{isAnimating:l}=(0,v.useContext)(DX),u=zq(n),d=Bq(l,!!u,e),f=r&&i,p=r&&a,m=r&&o,h=f||p||m;return(0,U.jsxs)(`div`,{className:c(`my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2`),"data-streamdown":`table-wrapper`,children:[h?(0,U.jsxs)(`div`,{className:c(`flex items-center justify-end gap-1`),children:[f?(0,U.jsx)(NJ,{}):null,p?(0,U.jsx)(PJ,{}):null,m?(0,U.jsx)(FJ,{showCopy:f,showDownload:p,children:e}):null]}):null,(0,U.jsx)(`div`,{className:c(`border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background`),ref:d,style:u?{maxHeight:u}:void 0,children:(0,U.jsx)(`table`,{className:c(`w-full divide-y divide-border`,t),"data-streamdown":`table`,...s,children:e})})]})},LJ=/startLine=(\d+)/,RJ=/\bnoLineNumbers\b/,zJ=(0,v.lazy)(()=>lD(()=>import(`./mermaid-HWGCJPDP-DOqoEVZq.js`).then(e=>({default:e.Mermaid})),[])),BJ=/language-([^\s]+)/,VJ=`node`;function HJ(e,t){let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;let r=e,i=t;for(let e of n)if(e!==VJ&&!Object.is(r[e],i[e]))return!1;return!0}function UJ(e,t){return e?.properties?.metastring===t?.properties?.metastring}var WJ=(e,t)=>typeof e==`boolean`?e:e[t]!==!1,GJ=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.table;return n===!1?!1:n===!0||n===void 0||n[t]!==!1},KJ=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.code;return n===!1?!1:n===!0||n===void 0||n[t]!==!1},qJ=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.mermaid;return n===!1?!1:n===!0||n===void 0||n[t]!==!1},JJ=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.image;return n===!1?!1:n===!0||n===void 0||n[t]!==!1},YJ=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=Lq();return(0,U.jsx)(`ol`,{className:i(`list-inside list-decimal whitespace-normal [li_&]:pl-6`,t),"data-streamdown":`ordered-list`,...r,children:e})},(e,t)=>HJ(e,t));YJ.displayName=`MarkdownOl`;var XJ=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=Lq();return(0,U.jsx)(`li`,{className:i(`py-1 [&>p]:inline`,t),"data-streamdown":`list-item`,...r,children:e})},(e,t)=>HJ(e,t));XJ.displayName=`MarkdownLi`;var ZJ=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=Lq();return(0,U.jsx)(`ul`,{className:i(`list-inside list-disc whitespace-normal [li_&]:pl-6`,t),"data-streamdown":`unordered-list`,...r,children:e})},(e,t)=>HJ(e,t));ZJ.displayName=`MarkdownUl`;var QJ=(0,v.memo)(({className:e,node:t,...n})=>{let r=Lq();return(0,U.jsx)(`hr`,{className:r(`my-6 border-border`,e),"data-streamdown":`horizontal-rule`,...n})},(e,t)=>HJ(e,t));QJ.displayName=`MarkdownHr`;var $J=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=Lq();return(0,U.jsx)(`span`,{className:i(`font-semibold`,t),"data-streamdown":`strong`,...r,children:e})},(e,t)=>HJ(e,t));$J.displayName=`MarkdownStrong`;var eY=(0,v.memo)(({children:e,className:t,href:n,node:r,...i})=>{let a=Lq(),{linkSafety:o}=(0,v.useContext)(DX),[s,c]=(0,v.useState)(!1),l=n===`streamdown:incomplete-link`,u=(0,v.useCallback)(async e=>{if(!(!(o!=null&&o.enabled&&n)||l)){if(e.preventDefault(),o.onLinkCheck&&await o.onLinkCheck(n)){window.open(n,`_blank`,`noreferrer`);return}c(!0)}},[o,n,l]),d=(0,v.useCallback)(()=>{n&&window.open(n,`_blank`,`noreferrer`)},[n]),f=(0,v.useCallback)(()=>{c(!1)},[]),p={url:n??``,isOpen:s,onClose:f,onConfirm:d};return o!=null&&o.enabled&&n?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`button`,{className:a(`wrap-anywhere appearance-none text-left font-medium text-primary underline`,t),"data-incomplete":l,"data-streamdown":`link`,onClick:u,type:`button`,children:e}),o.renderModal?o.renderModal(p):(0,U.jsx)(gJ,{...p})]}):(0,U.jsx)(`a`,{className:a(`wrap-anywhere font-medium text-primary underline`,t),"data-incomplete":l,"data-streamdown":`link`,href:n,rel:`noreferrer`,target:`_blank`,...i,children:e})},(e,t)=>HJ(e,t));eY.displayName=`MarkdownA`;var tY=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=Lq();return(0,U.jsx)(`h1`,{className:i(`mt-6 mb-2 font-semibold text-3xl`,t),"data-streamdown":`heading-1`,...r,children:e})},(e,t)=>HJ(e,t));tY.displayName=`MarkdownH1`;var nY=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=Lq();return(0,U.jsx)(`h2`,{className:i(`mt-6 mb-2 font-semibold text-2xl`,t),"data-streamdown":`heading-2`,...r,children:e})},(e,t)=>HJ(e,t));nY.displayName=`MarkdownH2`;var rY=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=Lq();return(0,U.jsx)(`h3`,{className:i(`mt-6 mb-2 font-semibold text-xl`,t),"data-streamdown":`heading-3`,...r,children:e})},(e,t)=>HJ(e,t));rY.displayName=`MarkdownH3`;var iY=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=Lq();return(0,U.jsx)(`h4`,{className:i(`mt-6 mb-2 font-semibold text-lg`,t),"data-streamdown":`heading-4`,...r,children:e})},(e,t)=>HJ(e,t));iY.displayName=`MarkdownH4`;var aY=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=Lq();return(0,U.jsx)(`h5`,{className:i(`mt-6 mb-2 font-semibold text-base`,t),"data-streamdown":`heading-5`,...r,children:e})},(e,t)=>HJ(e,t));aY.displayName=`MarkdownH5`;var oY=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=Lq();return(0,U.jsx)(`h6`,{className:i(`mt-6 mb-2 font-semibold text-sm`,t),"data-streamdown":`heading-6`,...r,children:e})},(e,t)=>HJ(e,t));oY.displayName=`MarkdownH6`;var sY=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let{controls:i,tableMaxHeight:a}=(0,v.useContext)(DX),o=WJ(i,`table`),s=GJ(i,`copy`),c=GJ(i,`download`),l=GJ(i,`fullscreen`);return(0,U.jsx)(IJ,{className:t,maxHeight:a,showControls:o,showCopy:s,showDownload:c,showFullscreen:l,...r,children:e})},(e,t)=>HJ(e,t));sY.displayName=`MarkdownTable`;var cY=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=Lq();return(0,U.jsx)(`thead`,{className:i(`bg-muted/80`,t),"data-streamdown":`table-header`,...r,children:e})},(e,t)=>HJ(e,t));cY.displayName=`MarkdownThead`;var lY=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=Lq();return(0,U.jsx)(`tbody`,{className:i(`divide-y divide-border`,t),"data-streamdown":`table-body`,...r,children:e})},(e,t)=>HJ(e,t));lY.displayName=`MarkdownTbody`;var uY=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=Lq();return(0,U.jsx)(`tr`,{className:i(`border-border`,t),"data-streamdown":`table-row`,...r,children:e})},(e,t)=>HJ(e,t));uY.displayName=`MarkdownTr`;var dY=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=Lq();return(0,U.jsx)(`th`,{className:i(`whitespace-nowrap px-4 py-2 text-left font-semibold text-sm`,t),"data-streamdown":`table-header-cell`,...r,children:e})},(e,t)=>HJ(e,t));dY.displayName=`MarkdownTh`;var fY=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=Lq();return(0,U.jsx)(`td`,{className:i(`px-4 py-2 text-sm`,t),"data-streamdown":`table-cell`,...r,children:e})},(e,t)=>HJ(e,t));fY.displayName=`MarkdownTd`;var pY=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=Lq();return(0,U.jsx)(`blockquote`,{className:i(`my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic`,t),"data-streamdown":`blockquote`,...r,children:e})},(e,t)=>HJ(e,t));pY.displayName=`MarkdownBlockquote`;var mY=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=Lq();return(0,U.jsx)(`sup`,{className:i(`text-sm`,t),"data-streamdown":`superscript`,...r,children:e})},(e,t)=>HJ(e,t));mY.displayName=`MarkdownSup`;var hY=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=Lq();return(0,U.jsx)(`sub`,{className:i(`text-sm`,t),"data-streamdown":`subscript`,...r,children:e})},(e,t)=>HJ(e,t));hY.displayName=`MarkdownSub`;var gY=(0,v.memo)(({children:e,className:t,node:n,...r})=>{if(`data-footnotes`in r){let n=e=>{if(!(0,v.isValidElement)(e))return!1;let t=Array.isArray(e.props.children)?e.props.children:[e.props.children],n=!1,r=!1;for(let e of t)if(e){if(typeof e==`string`)e.trim()!==``&&(n=!0);else if((0,v.isValidElement)(e)){if(e.props?.[`data-footnote-backref`]!==void 0)r=!0;else{let t=Array.isArray(e.props.children)?e.props.children:[e.props.children];for(let e of t){if(typeof e==`string`&&e.trim()!==``){n=!0;break}if((0,v.isValidElement)(e)&&e.props?.[`data-footnote-backref`]===void 0){n=!0;break}}}}}return r&&!n},i=Array.isArray(e)?e.map(e=>{if(!(0,v.isValidElement)(e))return e;if(e.type===YJ){let t=(Array.isArray(e.props.children)?e.props.children:[e.props.children]).filter(e=>!n(e));return t.length===0?null:{...e,props:{...e.props,children:t}}}return e}):e;return(Array.isArray(i)?i.some(e=>e!==null):i!==null)?(0,U.jsx)(`section`,{className:t,...r,children:i}):null}return(0,U.jsx)(`section`,{className:t,...r,children:e})},(e,t)=>HJ(e,t));gY.displayName=`MarkdownSection`;var _Y=(0,v.memo)(({node:e,className:t,children:n,...r})=>{let i=Lq(),a=!(`data-block`in r),{mermaid:o,controls:s,lineNumbers:c}=(0,v.useContext)(DX),l=bJ(),u=jq(),d=(t?.match(BJ))?.at(1)??``,f=xJ(d);if(a)return(0,U.jsx)(`code`,{className:i(`rounded bg-muted px-1.5 py-0.5 font-mono text-sm`,t),"data-streamdown":`inline-code`,...r,children:n});let p=e?.properties?.metastring,m=p?.match(LJ),h=m?Number.parseInt(m[1],10):void 0,g=h!==void 0&&h>=1?h:void 0,_=!(p&&RJ.test(p))&&c!==!1,y=``;if((0,v.isValidElement)(n)&&n.props&&typeof n.props==`object`&&`children`in n.props&&typeof n.props.children==`string`?y=n.props.children:typeof n==`string`&&(y=n),f){let e=f.component;return(0,U.jsx)(v.Suspense,{fallback:(0,U.jsx)(uJ,{}),children:(0,U.jsx)(e,{code:y,isIncomplete:u,language:d,meta:p})})}if(d===`mermaid`&&l){let e=WJ(s,`mermaid`),n=qJ(s,`download`),r=qJ(s,`copy`),a=qJ(s,`fullscreen`),c=qJ(s,`panZoom`),l=e&&(n||r||a);return(0,U.jsx)(v.Suspense,{fallback:(0,U.jsx)(uJ,{}),children:(0,U.jsxs)(`div`,{className:i(`group relative my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2`,t),"data-streamdown":`mermaid-block`,children:[(0,U.jsx)(`div`,{className:i(`flex h-8 items-center text-muted-foreground text-xs`),children:(0,U.jsx)(`span`,{className:i(`ml-1 font-mono lowercase`),children:`mermaid`})}),l?(0,U.jsx)(`div`,{className:i(`pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end`),children:(0,U.jsxs)(`div`,{className:i(`pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur`),"data-streamdown":`mermaid-block-actions`,children:[n?(0,U.jsx)(wJ,{chart:y,config:o?.config}):null,r?(0,U.jsx)(oJ,{code:y}):null,a?(0,U.jsx)(TJ,{chart:y,config:o?.config}):null]})}):null,(0,U.jsx)(`div`,{className:i(`rounded-md border border-border bg-background`),children:(0,U.jsx)(zJ,{chart:y,config:o?.config,showControls:c})})]})})}let b=WJ(s,`code`),x=KJ(s,`download`),S=KJ(s,`copy`),{"data-block":C,...w}=r;return(0,U.jsx)(Zq,{className:t,code:y,isIncomplete:u,language:d,lineNumbers:_,startLine:g,...w,children:b?(0,U.jsxs)(U.Fragment,{children:[x?(0,U.jsx)(lJ,{code:y,language:d}):null,S?(0,U.jsx)(oJ,{}):null]}):null})},(e,t)=>HJ(e,t)&&UJ(e.node,t.node));_Y.displayName=`MarkdownCode`;var vY=(0,v.memo)(({node:e,className:t,...n})=>{let{controls:r}=(0,v.useContext)(DX),i=WJ(r,`image`),a=i&&JJ(r,`download`);return(0,U.jsx)(fJ,{className:t,node:e,showControls:i,showDownloadControl:a,...n})},(e,t)=>HJ(e,t));vY.displayName=`MarkdownImg`;var yY=(0,v.memo)(({children:e,node:t,...n})=>{let r=(Array.isArray(e)?e:[e]).filter(e=>e!=null&&e!==``);if(r.length===1&&(0,v.isValidElement)(r[0])){let t=r[0].props.node?.tagName;if(t===`img`||t===`code`&&`data-block`in r[0].props)return(0,U.jsx)(U.Fragment,{children:e})}return(0,U.jsx)(`p`,{...n,children:e})},(e,t)=>HJ(e,t));yY.displayName=`MarkdownParagraph`;var bY={ol:YJ,li:XJ,ul:ZJ,hr:QJ,strong:$J,a:eY,h1:tY,h2:nY,h3:rY,h4:iY,h5:aY,h6:oY,table:sY,thead:cY,tbody:lY,tr:uY,th:dY,td:fY,blockquote:pY,code:_Y,img:vY,pre:({children:e})=>(0,v.isValidElement)(e)?(0,v.cloneElement)(e,{"data-block":`true`}):e,sup:mY,sub:hY,p:yY,section:gY},xY=/[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/,SY=/\p{L}/u;function CY(e){let t=e.replace(/(```|~~~)[\s\S]*?\1/g,``).replace(/^#{1,6}\s+/gm,``).replace(/(\*{1,3}|_{1,3})/g,``).replace(/`[^`]*`/g,``).replace(/\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/^[\s>*\-+\d.]+/gm,``),n,r=0,i=0;for(let e of t){if(xY.test(e)){n??=`rtl`,i+=1;continue}SY.test(e)&&(n??=`ltr`,r+=1)}return i>r?`rtl`:r>i?`ltr`:n??`ltr`}var wY=/^[ \t]{0,3}(`{3,}|~{3,})/,TY=/^\|?[ \t]*:?-{1,}:?[ \t]*(\|[ \t]*:?-{1,}:?[ \t]*)*\|?$/,EY=e=>{let t=e.split(`
169
+ `),n=null,r=0;for(let e of t){let t=wY.exec(e);if(n===null){if(t){let e=t[1];n=e[0],r=e.length}}else if(t){let e=t[1],i=e[0],a=e.length;i===n&&a>=r&&(n=null,r=0)}}return n!==null},DY=e=>{let t=e.split(`
170
+ `);for(let e of t){let t=e.trim();if(t.length>0&&t.includes(`|`)&&TY.test(t))return!0}return!1},OY=()=>e=>{yO(e,`html`,(e,t,n)=>{!n||typeof t!=`number`||(n.children[t]={type:`text`,value:e.value})})},kY=[],AY={allowDangerousHtml:!0},jY=new WeakMap,MY=new class{constructor(){this.cache=new Map,this.keyCache=new WeakMap,this.maxSize=100}generateCacheKey(e){let t=this.keyCache.get(e);if(t)return t;let n=e.rehypePlugins,r=e.remarkPlugins,i=e.remarkRehypeOptions;if(!(n||r||i)){let t=`default`;return this.keyCache.set(e,t),t}let a=e=>{if(!e||e.length===0)return``;let t=``;for(let n=0;n<e.length;n+=1){let r=e[n];if(n>0&&(t+=`,`),Array.isArray(r)){let[e,n]=r;if(typeof e==`function`){let n=jY.get(e);n||(n=e.name,jY.set(e,n)),t+=n}else t+=String(e);t+=`:`,t+=JSON.stringify(n)}else if(typeof r==`function`){let e=jY.get(r);e||(e=r.name,jY.set(r,e)),t+=e}else t+=String(r)}return t},o=a(n),s=`${a(r)}::${o}::${i?JSON.stringify(i):``}`;return this.keyCache.set(e,s),s}get(e){let t=this.generateCacheKey(e),n=this.cache.get(t);return n&&(this.cache.delete(t),this.cache.set(t,n)),n}set(e,t){let n=this.generateCacheKey(e);if(this.cache.size>=this.maxSize){let e=this.cache.keys().next().value;e&&this.cache.delete(e)}this.cache.set(n,t)}clear(){this.cache.clear()}},NY=e=>{let t=PY(e),n=e.children||``;return VY(t.runSync(t.parse(n),n),e)},PY=e=>{let t=MY.get(e);if(t)return t;let n=IY(e);return MY.set(e,n),n},FY=e=>e.some(e=>Array.isArray(e)?e[0]===qP:e===qP),IY=e=>{let t=e.rehypePlugins||kY,n=e.remarkPlugins||kY,r=FY(t)?n:[...n,OY],i=e.remarkRehypeOptions?{...AY,...e.remarkRehypeOptions}:AY;return pG().use(JU).use(r).use(zW,i).use(t)},LY=e=>e,RY=(e,t,n,r)=>{n?e.children.splice(t,1):e.children[t]={type:`text`,value:r}},zY=(e,t)=>{for(let n in lU)if(Object.hasOwn(lU,n)&&Object.hasOwn(e.properties,n)){let r=e.properties[n],i=lU[n];(i===null||i.includes(e.tagName))&&(e.properties[n]=t(String(r||``),n,e)??void 0)}},BY=(e,t,n,r,i,a)=>{let o=!1;return r?o=!r.includes(e.tagName):i&&(o=i.includes(e.tagName)),!o&&a&&typeof t==`number`&&(o=!a(e,t,n)),o},VY=(e,t)=>{let{allowElement:n,allowedElements:r,disallowedElements:i,skipHtml:a,unwrapDisallowed:o,urlTransform:s}=t;if(n||r||i||a||s){let t=s||LY;yO(e,(e,s,c)=>{if(e.type===`raw`&&c&&typeof s==`number`)return RY(c,s,a,e.value),s;if(e.type===`element`&&(zY(e,t),BY(e,s,c,r,i,n)&&c&&typeof s==`number`))return o&&e.children?c.children.splice(s,1,...e.children):c.children.splice(s,1),s})}return VH(e,{Fragment:U.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:U.jsx,jsxs:U.jsxs,passKeys:!0,passNode:!0})},HY=/\[\^[\w-]{1,200}\](?!:)/,UY=/\[\^[\w-]{1,200}\]:/,WY=/<([A-Za-z][\w:-]*)[\s>/]/,GY=new Set([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`]),KY=new Map,qY=new Map,JY=e=>{let t=e.toLowerCase(),n=KY.get(t);if(n)return n;let r=RegExp(`<${t}(?=[\\s>/])[^>]*>`,`gi`);return KY.set(t,r),r},YY=e=>{let t=e.toLowerCase(),n=qY.get(t);if(n)return n;let r=RegExp(`</${t}(?=[\\s>])[^>]*>`,`gi`);return qY.set(t,r),r},XY=(e,t)=>{if(GY.has(t.toLowerCase()))return 0;let n=e.match(JY(t));if(!n)return 0;let r=0;for(let e of n)e.trimEnd().endsWith(`/>`)||(r+=1);return r},ZY=(e,t)=>{let n=e.match(YY(t));return n?n.length:0},QY=e=>{let t=0;for(let n=0;n<e.length-1;n+=1)e[n]===`$`&&e[n+1]===`$`&&(t+=1,n+=1);return t},$Y=e=>{let t=HY.test(e),n=UY.test(e);if(t||n)return[e];let r=KK.lex(e,{gfm:!0}),i=[],a=[],o=!1;for(let e of r){let t=e.raw,n=i.length;if(a.length>0){i[n-1]+=t;let e=a.at(-1),r=XY(t,e),o=ZY(t,e);for(let t=0;t<r;t+=1)a.push(e);for(let t=0;t<o;t+=1)a.length>0&&a.at(-1)===e&&a.pop();continue}if(e.type===`html`&&e.block){let e=t.match(WY);if(e){let n=e[1];XY(t,n)>ZY(t,n)&&a.push(n)}}if(n>0&&!o){let e=i[n-1];if(QY(e)%2==1){i[n-1]=e+t;continue}}i.push(t),e.type!==`space`&&(o=e.type===`code`)}return i},eX=/^\n*/,tX=/\n*$/,nX=/\n\n/g,rX=(e,t,n)=>t.includes(`
171
+ `)?`${e}${t.replace(nX,`
172
+ <!---->
173
+ `).replace(eX,`
174
+
175
+ `).replace(tX,`
176
+
177
+ `)}${n}
178
+
179
+ `:e+t+n,iX=(e,t)=>{let n=RegExp(`<(${t})(?=[\\s>/])([^>]*)>`,`gi`),r=``,i=0,a=n.exec(e);for(;a;){let t=a[0],o=a[1],s=a.index+t.length,c=e.slice(s);if(RegExp(`</${o}\\s*>`,`i`).test(c)){a=n.exec(e);continue}if(r+=e.slice(i,a.index),c.length===0){r+=t,i=s,a=n.exec(e);continue}if(c.startsWith(`
180
+
181
+ `)){let n=c.slice(2).replace(nX,`
182
+ <!---->
183
+ `);r+=`${t}
184
+
185
+ ${n}`,i=e.length;break}if(!c.startsWith(`
186
+ `)){r+=t,i=s,a=n.exec(e);continue}let l=c.slice(1);if(l.trim().length===0){r+=t,i=s,a=n.exec(e);continue}let u=l.replace(nX,`
187
+ <!---->
188
+ `);r+=`${t}
189
+
190
+ ${u}`,i=e.length;break}return i===0?e:r+e.slice(i)},aX=(e,t)=>{if(!t.length)return e;let n=e;for(let e of t){let t=RegExp(`(<${e}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${e}\\s*>)`,`gi`);n=n.replace(t,(e,t,n,r)=>rX(t,n,r)),n=iX(n,e)}return n},oX=/([\\`*_~[\]|])/g,sX=e=>e.replace(oX,`\\$1`),cX=(e,t)=>{if(!t.length)return e;let n=e;for(let e of t){let t=RegExp(`(<${e}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${e}\\s*>)`,`gi`);n=n.replace(t,(e,t,n,r)=>t+sX(n).replace(/\n\n/g,`&#10;&#10;`)+r)}return n},lX=new Set([`blockquote`,`dd`,`dt`,`figcaption`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`li`,`p`,`td`,`th`]),uX=new Set([`code`,`kbd`,`pre`,`samp`,`var`]);function dX(e){return e.children.map(e=>e.type===`text`?e.value:e.type===`element`&&!uX.has(e.tagName)?dX(e):``).join(``)}function fX(){return e=>{yO(e,`element`,e=>{if(uX.has(e.tagName)){e.properties??={},e.properties.dir=`ltr`;return}lX.has(e.tagName)&&(e.properties??={},typeof e.properties.dir!=`string`&&(e.properties.dir=CY(dX(e))))})}}var pX=e=>e.type===`text`?e.value:`children`in e&&Array.isArray(e.children)?e.children.map(pX).join(``):``,mX=e=>t=>{if(!e||e.length===0)return;let n=new Set(e.map(e=>e.toLowerCase()));yO(t,`element`,e=>{if(n.has(e.tagName.toLowerCase())){let t=pX(e);e.children=t?[{type:`text`,value:t}]:[]}})},hX=()=>e=>{yO(e,`code`,e=>{e.meta&&(e.data=e.data??{},e.data.hProperties={...e.data.hProperties??{},metastring:e.meta})})},gX=/^[ \t]*<[\w!/?-]/,_X=/(^|\n)[ \t]{4,}(?=<[\w!/?-])/g,vX=e=>typeof e!=`string`||e.length===0||!gX.test(e)?e:e.replace(_X,`$1`),yX={...YP,clobberPrefix:``,protocols:{...YP.protocols,href:[...YP.protocols?.href??[],`tel`,`streamdown`]},attributes:{...YP.attributes,code:[...YP.attributes?.code??[],`metastring`]}},bX={raw:qP,sanitize:[fF,yX],harden:[xO,{allowedImagePrefixes:[`*`],allowedLinkPrefixes:[`*`],allowedProtocols:[`*`],defaultOrigin:void 0,allowDataImages:!0}]},xX={gfm:[kB,{}],codeMeta:hX},SX=Object.values(bX),CX=Object.values(xX),wX={block:` ▋`,circle:` ●`},TX=[`github-light`,`github-dark`],EX={enabled:!0},DX=(0,v.createContext)({codeBlockMaxHeight:400,shikiTheme:TX,controls:!0,isAnimating:!1,lineNumbers:!0,mode:`streaming`,mermaid:void 0,linkSafety:EX,tableMaxHeight:300}),OX=(0,v.memo)(({content:e,shouldParseIncompleteMarkdown:t,shouldNormalizeHtmlIndentation:n,index:r,isIncomplete:i,dir:a,animatePlugin:o,...s})=>{(0,v.useLayoutEffect)(()=>{o?.commit()});let c=typeof e==`string`&&n?vX(e):e,l=(0,U.jsx)(NY,{...s,children:c});return(0,U.jsx)(Aq.Provider,{value:i,children:a?(0,U.jsx)(`div`,{dir:a,style:{display:`contents`},children:l}):l})},(e,t)=>{if(e.content!==t.content||e.shouldNormalizeHtmlIndentation!==t.shouldNormalizeHtmlIndentation||e.index!==t.index||e.isIncomplete!==t.isIncomplete||e.dir!==t.dir)return!1;if(e.components!==t.components){let n=Object.keys(e.components||{}),r=Object.keys(t.components||{});if(n.length!==r.length||n.some(n=>e.components?.[n]!==t.components?.[n]))return!1}return e.rehypePlugins===t.rehypePlugins&&e.remarkPlugins===t.remarkPlugins&&!!e.animatePlugin==!!t.animatePlugin});OX.displayName=`Block`;var kX=(0,v.memo)(({children:e,mode:t=`streaming`,dir:n,parseIncompleteMarkdown:r=!0,normalizeHtmlIndentation:i=!1,components:a,rehypePlugins:o=SX,remarkPlugins:s=CX,className:c,shikiTheme:l,mermaid:u,codeBlockMaxHeight:d=400,controls:f=!0,isAnimating:p=!1,tableMaxHeight:m=300,animated:h,BlockComponent:g=OX,parseMarkdownIntoBlocksFn:_=$Y,caret:y,plugins:b,remend:x,linkSafety:S=EX,lineNumbers:C=!0,allowedTags:w,literalTagContent:T,translations:E,icons:D,prefix:O,onAnimationStart:k,onAnimationEnd:A,...j})=>{let M=(0,v.useId)(),N=(0,v.useMemo)(()=>Pq(O),[O]),P=(0,v.useRef)(null),F=(0,v.useRef)(k),I=(0,v.useRef)(A);F.current=k,I.current=A,(0,v.useEffect)(()=>{var e,n,r;if(t===`static`)return;let i=P.current;if(P.current=p,i===null){p&&((e=F.current)==null||e.call(F));return}p&&!i?(n=F.current)==null||n.call(F):!p&&i&&((r=I.current)==null||r.call(I))},[p,t]);let L=(0,v.useMemo)(()=>w?Object.keys(w):[],[w]),ee=(0,v.useMemo)(()=>{if(typeof e!=`string`)return``;let n=t===`streaming`&&r?_H(e,x):e;return T&&T.length>0&&(n=cX(n,T)),L.length>0&&(n=aX(n,L)),n},[e,t,r,x,L,T]),R=(0,v.useMemo)(()=>_(ee),[ee,_]),te=(0,v.useMemo)(()=>n===`auto`?R.map(CY):void 0,[R,n]),z=(0,v.useMemo)(()=>R.map((e,t)=>`${M}-${t}`),[R.length,M]),B=(0,v.useMemo)(()=>h===!0?`true`:h?JSON.stringify(h):``,[h]),V=(0,v.useRef)(null),ne=(0,v.useRef)([]),H=(0,v.useRef)([]),re=(0,v.useRef)(null),ie=(0,v.useRef)(``);B?(ie.current===B?V.current||=oq():(ie.current=B,V.current=oq({maxBacklogMs:B===`true`?void 0:h.maxBacklogMs}),ne.current=[],H.current=[]),p&&V.current&&V.current.beginPass(V.current.now())):(V.current=null,ne.current=[],H.current=[],ie.current=``),(0,v.useLayoutEffect)(()=>{var e;p&&((e=V.current)==null||e.commitPass())});let ae=(0,v.useMemo)(()=>({codeBlockMaxHeight:d,shikiTheme:l??(b?.code)?.getThemes()??TX,controls:f,isAnimating:p,lineNumbers:C,mode:t,mermaid:u,linkSafety:S,tableMaxHeight:m}),[d,l,f,p,C,t,u,S,b?.code,m]),oe=(0,v.useMemo)(()=>E?JSON.stringify(E):``,[E]),se=(0,v.useMemo)(()=>({...rJ,...E}),[oe]),ce=(0,v.useMemo)(()=>{let{inlineCode:e,...t}=a??{},n={...bY,...t};if(e){let t=n.code;n.code=n=>`data-block`in n?t?(0,v.createElement)(t,n):null:(0,v.createElement)(e,n)}return n},[a]),le=(0,v.useMemo)(()=>{let e=[];return b!=null&&b.cjk&&(e=[...e,...b.cjk.remarkPluginsBefore]),e=[...e,...s],b!=null&&b.cjk&&(e=[...e,...b.cjk.remarkPluginsAfter]),b!=null&&b.math&&(e=[...e,b.math.remarkPlugin]),e},[s,b?.math,b?.cjk]),ue=(0,v.useMemo)(()=>{let e=o;if(w&&Object.keys(w).length>0&&o===SX){let t={...yX,tagNames:[...yX.tagNames??[],...Object.keys(w)],attributes:{...yX.attributes,...w}};e=[bX.raw,[fF,t],bX.harden]}return T&&T.length>0&&(e=[...e,[mX,T]]),b!=null&&b.math&&(e=[...e,b.math.rehypePlugin]),n===`auto`&&t===`static`&&(e=[...e,fX]),e},[o,b?.math,w,T,n,t]),de=(0,v.useMemo)(()=>{if(!p||R.length===0)return!1;let e=R.at(-1);return EY(e)||DY(e)},[p,R]),fe=(0,v.useMemo)(()=>y&&p&&!de?{"--streamdown-caret":`"${wX[y]}"`}:void 0,[y,p,de]),pe=e=>{let t=null;if(V.current&&p){if(!ne.current[e]){let{maxBacklogMs:t,...n}=B&&B!==`true`?h:{};ne.current[e]=kq({...n,timeline:V.current})}t=ne.current[e]}re.current!==ue&&(H.current=[],re.current=ue),t&&!H.current[e]&&(H.current[e]=[...ue,t.rehypePlugin]);let n=t&&H.current[e]?H.current[e]:ue;return{blockAnimatePlugin:t,blockRehypePlugins:n}};return t===`static`?(0,U.jsx)(iJ.Provider,{value:se,children:(0,U.jsx)(_J.Provider,{value:b??null,children:(0,U.jsx)(DX.Provider,{value:ae,children:(0,U.jsx)(tJ,{icons:D,children:(0,U.jsx)(Iq.Provider,{value:N,children:(0,U.jsx)(`div`,{className:N(`space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0`,c),dir:n===`auto`?void 0:n,children:(0,U.jsx)(NY,{components:ce,rehypePlugins:ue,remarkPlugins:le,...j,children:ee})})})})})})}):(0,U.jsx)(iJ.Provider,{value:se,children:(0,U.jsx)(_J.Provider,{value:b??null,children:(0,U.jsx)(DX.Provider,{value:ae,children:(0,U.jsx)(tJ,{icons:D,children:(0,U.jsx)(Iq.Provider,{value:N,children:(0,U.jsxs)(`div`,{className:N(`space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0`,y&&!de?`[&>*:last-child]:after:inline [&>*:last-child]:after:align-baseline [&>*:last-child]:after:content-[var(--streamdown-caret)]`:null,c),style:fe,children:[R.length===0&&y&&p&&(0,U.jsx)(`span`,{}),R.map((e,t)=>{let a=t===R.length-1,o=p&&a&&EY(e),{blockAnimatePlugin:s,blockRehypePlugins:c}=pe(t);return(0,U.jsx)(g,{animatePlugin:s,components:ce,content:e,dir:te?.[t]??(n===`auto`?void 0:n),index:t,isIncomplete:o,rehypePlugins:c,remarkPlugins:le,shouldNormalizeHtmlIndentation:i,shouldParseIncompleteMarkdown:r,...j},z[t])})]})})})})})})},(e,t)=>e.children===t.children&&e.shikiTheme===t.shikiTheme&&e.isAnimating===t.isAnimating&&e.animated===t.animated&&e.mode===t.mode&&e.plugins===t.plugins&&e.className===t.className&&e.linkSafety===t.linkSafety&&e.lineNumbers===t.lineNumbers&&e.codeBlockMaxHeight===t.codeBlockMaxHeight&&e.tableMaxHeight===t.tableMaxHeight&&e.normalizeHtmlIndentation===t.normalizeHtmlIndentation&&e.literalTagContent===t.literalTagContent&&JSON.stringify(e.translations)===JSON.stringify(t.translations)&&e.prefix===t.prefix&&e.dir===t.dir);kX.displayName=`Streamdown`;var AX=({children:e,className:t,minZoom:n=.5,maxZoom:r=3,zoomStep:i=.1,showControls:a=!0,initialZoom:o=1,fullscreen:s=!1})=>{let{RotateCcwIcon:c,ZoomInIcon:l,ZoomOutIcon:u}=nJ(),d=Lq(),f=aJ(),p=(0,v.useRef)(null),m=(0,v.useRef)(null),[h,g]=(0,v.useState)(o),[_,y]=(0,v.useState)({x:0,y:0}),[b,x]=(0,v.useState)(!1),[S,C]=(0,v.useState)({x:0,y:0}),[w,T]=(0,v.useState)({x:0,y:0}),E=(0,v.useCallback)(e=>{g(t=>Math.max(n,Math.min(r,t+e)))},[n,r]),D=(0,v.useCallback)(()=>{E(i)},[E,i]),O=(0,v.useCallback)(()=>{E(-i)},[E,i]),k=(0,v.useCallback)(()=>{g(o),y({x:0,y:0})},[o]),A=(0,v.useCallback)(e=>{e.preventDefault();let t=e.deltaY>0?-i:i;E(t)},[E,i]),j=(0,v.useCallback)(e=>{if(e.button!==0||e.isPrimary===!1)return;x(!0),C({x:e.clientX,y:e.clientY}),T(_);let t=e.currentTarget;t instanceof HTMLElement&&t.setPointerCapture(e.pointerId)},[_]),M=(0,v.useCallback)(e=>{if(!b)return;e.preventDefault();let t=e.clientX-S.x,n=e.clientY-S.y;y({x:w.x+t,y:w.y+n})},[b,S,w]),N=(0,v.useCallback)(e=>{x(!1);let t=e.currentTarget;t instanceof HTMLElement&&t.releasePointerCapture(e.pointerId)},[]);return(0,v.useEffect)(()=>{let e=p.current;if(e)return e.addEventListener(`wheel`,A,{passive:!1}),()=>{e.removeEventListener(`wheel`,A)}},[A]),(0,v.useEffect)(()=>{let e=m.current;if(e&&b)return document.body.style.userSelect=`none`,e.addEventListener(`pointermove`,M,{passive:!1}),e.addEventListener(`pointerup`,N),e.addEventListener(`pointercancel`,N),()=>{document.body.style.userSelect=``,e.removeEventListener(`pointermove`,M),e.removeEventListener(`pointerup`,N),e.removeEventListener(`pointercancel`,N)}},[b,M,N]),(0,U.jsxs)(`div`,{className:d(`relative flex flex-col`,s?`h-full w-full`:`min-h-28 w-full`,t),ref:p,style:{cursor:b?`grabbing`:`grab`},children:[a?(0,U.jsxs)(`div`,{className:d(`absolute z-10 flex flex-col gap-1 rounded-md border border-border bg-background/80 p-1 supports-[backdrop-filter]:bg-background/70 supports-[backdrop-filter]:backdrop-blur-sm`,s?`bottom-4 left-4`:`bottom-2 left-2`),children:[(0,U.jsx)(`button`,{"aria-label":f.zoomIn,className:d(`flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`),disabled:h>=r,onClick:D,title:f.zoomIn,type:`button`,children:(0,U.jsx)(l,{"aria-hidden":`true`,size:16})}),(0,U.jsx)(`button`,{"aria-label":f.zoomOut,className:d(`flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`),disabled:h<=n,onClick:O,title:f.zoomOut,type:`button`,children:(0,U.jsx)(u,{"aria-hidden":`true`,size:16})}),(0,U.jsx)(`button`,{"aria-label":f.resetView,className:d(`flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`),onClick:k,title:f.resetView,type:`button`,children:(0,U.jsx)(c,{"aria-hidden":`true`,size:16})})]}):null,(0,U.jsx)(`div`,{className:d(`flex-1 origin-center transition-transform duration-150 ease-out`,s?`flex h-full w-full items-center justify-center`:`flex w-full items-center justify-center`),onPointerDown:j,ref:m,role:`application`,style:{transform:`translate(${_.x}px, ${_.y}px) scale(${h})`,transformOrigin:`center center`,touchAction:`none`,willChange:`transform`},children:e})]})},jX=({chart:e,className:t,config:n,fullscreen:r=!1,showControls:i=!0})=>{let a=Lq(),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(``),[m,h]=(0,v.useState)(0),{mermaid:g}=(0,v.useContext)(DX),_=bJ(),y=g?.errorComponent,{shouldRender:b,containerRef:x}=nq({immediate:r});if((0,v.useEffect)(()=>{if(b){if(!_){s(`Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.`);return}(async()=>{try{s(null),l(!0);let t=_.getMermaid(n),r=e.split(``).reduce((e,t)=>(e<<5)-e+t.charCodeAt(0)|0,0),i=`mermaid-${Math.abs(r)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:a}=await t.render(i,e);d(a),p(a)}catch(e){if(!(f||u)){let t=e instanceof Error?e.message:`Failed to render Mermaid chart`;s(t)}}finally{l(!1)}})()}},[e,n,m,b,_]),!(b||u||f))return(0,U.jsx)(`div`,{className:a(`my-4 min-h-[200px]`,t),ref:x});if(c&&!u&&!f)return(0,U.jsx)(`div`,{className:a(`my-4 flex justify-center p-4`,t),ref:x,children:(0,U.jsxs)(`div`,{className:a(`flex items-center space-x-2 text-muted-foreground`),children:[(0,U.jsx)(`div`,{className:a(`h-4 w-4 animate-spin rounded-full border-current border-b-2`)}),(0,U.jsx)(`span`,{className:a(`text-sm`),children:`Loading diagram...`})]})});if(o&&!u&&!f)return y?(0,U.jsx)(`div`,{ref:x,children:(0,U.jsx)(y,{chart:e,error:o,retry:()=>h(e=>e+1)})}):(0,U.jsxs)(`div`,{className:a(`rounded-md bg-red-50 p-4`,t),ref:x,children:[(0,U.jsxs)(`p`,{className:a(`font-mono text-red-700 text-sm`),children:[`Mermaid Error: `,o]}),(0,U.jsxs)(`details`,{className:a(`mt-2`),children:[(0,U.jsx)(`summary`,{className:a(`cursor-pointer text-red-600 text-xs`),children:`Show Code`}),(0,U.jsx)(`pre`,{className:a(`mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs`),children:e})]})]});let S=u||f;return(0,U.jsx)(`div`,{className:a(`size-full`,t),"data-streamdown":`mermaid`,ref:x,children:(0,U.jsx)(AX,{className:a(r?`size-full overflow-hidden`:`overflow-hidden`,t),fullscreen:r,maxZoom:3,minZoom:.5,showControls:i,zoomStep:.1,children:(0,U.jsx)(`div`,{"aria-label":`Mermaid chart`,className:a(`flex justify-center`,r?`size-full items-center`:null),dangerouslySetInnerHTML:{__html:S},role:`img`})})})};function MX(e){if(e==null||typeof e==`boolean`)return``;if(typeof e==`string`||typeof e==`number`)return String(e);if(Array.isArray(e))return e.map(MX).join(``);let t=e;return t.props?MX(t.props.children):``}function NX(e){let t=(Array.isArray(e)?e.find(Boolean):e)?.props?.className;return/language-([\w-]+)/.exec(t??``)?.[1]}function PX({code:e,language:t}){return(0,U.jsx)(KD,{className:`term-block`,actions:(0,U.jsx)(ZD,{text:e,label:`Copy code`}),children:(0,U.jsx)(eO,{className:`term-code`,"data-language":t,children:(0,U.jsx)(`pre`,{className:`term-pre`,children:e})})})}function FX(e){return function({children:t}){return(0,U.jsx)(`div`,{className:`term-block`,"data-tone":e,"data-weight":`bold`,children:t})}}var IX={p:({children:e})=>(0,U.jsx)(`div`,{className:`term-block`,children:e}),h1:FX(`bright`),h2:FX(`bright`),h3:FX(`bright`),h4:FX(`fg`),h5:FX(`fg`),h6:FX(`fg`),ul:({children:e})=>(0,U.jsx)(`ul`,{className:`term-block term-list`,children:e}),ol:({children:e})=>(0,U.jsx)(`ol`,{className:`term-block term-list term-list-ordered`,children:e}),li:({children:e})=>(0,U.jsxs)(`li`,{className:`term-row term-li`,children:[(0,U.jsx)(`span`,{className:`term-gutter`,"aria-hidden":!0}),(0,U.jsx)(`div`,{className:`term-body`,children:e})]}),blockquote:({children:e})=>(0,U.jsx)(`blockquote`,{className:`term-block term-quote`,"data-tone":`dim`,children:e}),hr:()=>(0,U.jsx)(`div`,{className:`term-block term-rule`,"aria-hidden":!0}),pre:({children:e})=>(0,U.jsx)(PX,{code:MX(e),language:NX(e)}),code:({children:e})=>(0,U.jsx)(`code`,{className:`term-inline-code`,"data-tone":`blue`,children:e}),strong:({children:e})=>(0,U.jsx)(`strong`,{"data-tone":`bright`,"data-weight":`bold`,children:e}),em:({children:e})=>(0,U.jsx)(`em`,{className:`term-em`,children:e}),a:({children:e,href:t})=>(0,U.jsx)(`a`,{className:`term-link`,"data-tone":`blue`,href:t,target:`_blank`,rel:`noreferrer`,children:e}),table:({children:e})=>(0,U.jsx)(`div`,{className:`term-block term-table-wrap`,children:(0,U.jsx)(`table`,{className:`term-table`,children:e})}),thead:({children:e})=>(0,U.jsx)(`thead`,{className:`term-thead`,children:e}),tbody:({children:e})=>(0,U.jsx)(`tbody`,{children:e}),tr:({children:e})=>(0,U.jsx)(`tr`,{children:e}),th:({children:e})=>(0,U.jsx)(`th`,{"data-tone":`bright`,"data-weight":`bold`,children:e}),td:({children:e})=>(0,U.jsx)(`td`,{children:e})},LX=(0,v.memo)(function({children:e,streaming:t,className:n}){return(0,U.jsx)(kX,{mode:t?`streaming`:`static`,parseIncompleteMarkdown:t,controls:!1,components:IX,className:W(`term-md`,n),children:e})},(e,t)=>e.children===t.children&&e.streaming===t.streaming&&e.className===t.className),RX=4;function zX({onPress:e,expanded:t,className:n,children:r}){let i=(0,v.useRef)(null);return(0,U.jsx)(`div`,{role:`button`,tabIndex:0,"aria-expanded":t,className:W(`term-press`,n),onPointerDown:e=>{i.current={x:e.clientX,y:e.clientY}},onClick:t=>{let n=i.current;if(i.current=null,n&&Math.abs(t.clientX-n.x)+Math.abs(t.clientY-n.y)>RX)return;let r=window.getSelection?.();r&&!r.isCollapsed&&r.containsNode(t.currentTarget,!0)||e()},onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),e())},children:r})}function BX(e){let t=(0,v.useRef)(null),n=(0,v.useRef)(e);return(0,v.useEffect)(()=>{let r=e&&!n.current;if(n.current=e,!r)return;let i=t.current;if(!i)return;let a=requestAnimationFrame(()=>{let e=VX(i);if(!e)return;let t=i.getBoundingClientRect().top-e.getBoundingClientRect().top+e.scrollTop;if(t>=e.scrollTop)return;let n=Number.parseFloat(getComputedStyle(i).lineHeight)||0;e.scrollTop=Math.max(0,t-n)});return()=>cancelAnimationFrame(a)},[e]),t}function VX(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t).overflowY;if((e===`auto`||e===`scroll`)&&t.scrollHeight>t.clientHeight)return t;t=t.parentElement}return null}function HX(e){return`image · ${TD(e.bytes)}`}var UX=`image unavailable`,WX=4,GX=400;function KX(e,t){let n=[],r=0,i=!1;for(let t of e.slice(0,WX)){if(n.length===0&&t.length>GX){n.push(`${t.slice(0,GX)}…`),r=GX,i=!0;break}if(n.length>0&&r+t.length>GX)break;n.push(t),r+=t.length+1}let a=e.join(`
191
+ `).length,o=t??a;if(i||t!==void 0&&o>a)return{shown:n,more:`… +${(o-r).toLocaleString()} chars`};let s=e.length-n.length;return{shown:n,more:s>0?`… +${s} line${s===1?``:`s`}`:void 0}}var qX=async()=>!1,JX=(0,v.createContext)(qX);function YX({value:e,children:t}){return(0,U.jsx)(JX.Provider,{value:e??qX,children:t})}function XX(){return(0,v.useContext)(JX)}var ZX=async()=>void 0,QX=(0,v.createContext)(ZX);function $X({value:e,children:t}){return(0,U.jsx)(QX.Provider,{value:e??ZX,children:t})}function eZ(){return(0,v.useContext)(QX)}var tZ=150;function nZ(e){let t=eZ(),[n,r]=(0,v.useState)({failed:!1}),{toolUseId:i,sourceSeq:a,partIndex:o,mediaType:s,bytes:c}=e;return(0,v.useEffect)(()=>{let e=!0;r({failed:!1});let n=setTimeout(()=>{t({toolUseId:i,sourceSeq:a,partIndex:o,mediaType:s,bytes:c}).then(t=>{e&&r({src:t,failed:t===void 0})}).catch(()=>{e&&r({failed:!0})})},tZ);return()=>{e=!1,clearTimeout(n)}},[t,i,a,o,s,c]),n}var rZ=67108864;function iZ(e,t){let n=(0,v.useRef)(new Map);return(0,v.useEffect)(()=>()=>{for(let e of n.current.values())e.url&&URL.revokeObjectURL(e.url);n.current.clear()},[]),(0,v.useCallback)(r=>{if(!t)return Promise.resolve(void 0);let i=`${t}:${r.sourceSeq}:${r.toolUseId}:${r.partIndex}`,a=n.current.get(i);if(a)return n.current.delete(i),n.current.set(i,a),a.pending;let o=e.toolResultImage(t,r.sourceSeq,r.toolUseId,r.partIndex).then(e=>{if(e.size===0)return;let t=URL.createObjectURL(e),r=n.current.get(i);return r?(r.url=t,r.bytes=e.size,aZ(n.current,i)):URL.revokeObjectURL(t),t}).catch(()=>void 0);return n.current.set(i,{pending:o,bytes:r.bytes}),o},[e,t])}function aZ(e,t){let n=0;for(let t of e.values())n+=t.bytes;for(let[r,i]of e){if(n<=rZ)return;r!==t&&(i.url&&URL.revokeObjectURL(i.url),e.delete(r),n-=i.bytes)}}function oZ(e,t){return e.parentToolUseId===t.parentToolUseId}function sZ(e){if(FD(e))return`shell`;let t=/^mcp__([^_]+(?:_[^_]+)*?)__/.exec(e);return t?.[1]?t[1].replace(/_/g,`-`):e.toLowerCase()}function cZ(e,t){let n=t?`Running `:`Ran `,r=t?`…`:``,i=e.length,a=new Map;for(let t of e){let e=sZ(t.name);a.set(e,(a.get(e)??0)+1)}if(a.size===1&&a.has(`shell`))return`${n}${i} shell command${i===1?``:`s`}${r}`;let o=[...a.entries()].sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0])).map(([e,t])=>`${t} ${e}`).join(`, `);return`${n}${i} tool${i===1?``:`s`} · ${o}${r}`}function lZ(e,t=80){return e.length>t?e.slice(0,t-1)+`…`:e}function uZ(e){return typeof e==`string`&&e.trim()!==``?e.trim():void 0}function dZ(e){return`${e.name}(${fZ(e)})`}function fZ(e){let t=e.input,n=uZ(t?.description),r=uZ(t?.subagent_type);return r&&n?`${r} · ${lZ(n)}`:r??(n?lZ(n):jD(e.input))}function pZ(e){let t=e.input;return uZ(t?.prompt)}function mZ(e){return e.status===`running`||e.status===`pending`}function hZ(e){return e.status===`failed`||e.result?.isError===!0}function gZ(e){let t=e[e.length-1];return t!==void 0&&hZ(t)}function _Z(e,t){return mZ(e)||t.some(e=>e.kind===`tool_call`&&mZ(e))}function vZ(e){return hZ(e)}function yZ(e,t){let n=_Z(e,t),r=t.reduce((e,t)=>e+ +(t.kind===`tool_call`),0),i=dZ(e);return r===0?n?`${i} · working…`:`${i} · done`:`${i} · ${r} tool${r===1?``:`s`}${n?`…`:``}`}var bZ=8,xZ={pending:`☐`,in_progress:`◐`,completed:`☒`};function SZ(e){if(typeof e!=`object`||!e)return;let t=e,n=t.status;if(n!==`pending`&&n!==`in_progress`&&n!==`completed`)return;let r=typeof t.content==`string`?t.content.trim():``;if(r===``)return;let i=typeof t.activeForm==`string`?t.activeForm.trim():``;return{status:n,text:n===`in_progress`&&i!==``?i:r}}function CZ(e){let t=e?.todos;if(!Array.isArray(t)||t.length===0)return;let n=[];for(let e of t){let t=SZ(e);if(t===void 0)return;n.push(t)}return n}function wZ(e,t){if(e!==`TodoWrite`)return;let n=CZ(t);if(n===void 0)return;let r=n.reduce((e,t)=>e+ +(t.status===`completed`),0),i=n.slice(0,bZ),a=n.length-i.length;return{summary:`${r}/${n.length} done`,shown:i,more:a>0?`… +${a} more`:void 0}}function TZ(e){return`${xZ[e.status]} ${e.text}`}var EZ=2e3;function DZ(e,t){let n=[],r=0;for(let i of e){if(n.length>0&&r+i.length>t)break;n.push(i),r+=i.length+1}return n}function OZ({item:e}){return(0,U.jsx)(KD,{actions:(0,U.jsx)(YD,{id:e.id}),children:(0,U.jsxs)(`div`,{className:`term-user`,children:[e.attachments?.length?(0,U.jsx)(QD,{glyph:`❯`,glyphTone:`dim`,tone:`dim`,children:e.attachments.map(e=>e.name).join(`, `)}):null,e.text?e.text.split(`
192
+ `).map((e,t)=>(0,U.jsx)(QD,{glyph:t===0?`❯`:void 0,glyphTone:`dim`,tone:`fg`,children:e||`\xA0`},t)):null]})})}function kZ({item:e}){return(0,U.jsx)(KD,{actions:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(YD,{id:e.id}),e.streaming?null:(0,U.jsx)(ZD,{text:e.text,label:`Copy message`})]}),children:(0,U.jsx)(QD,{glyph:`●`,glyphTone:`fg`,tone:`fg`,children:(0,U.jsx)(LX,{streaming:e.streaming,children:e.text})})})}function AZ({item:e}){return(0,U.jsx)(QD,{glyph:`✻`,glyphTone:`dim`,tone:`dim`,children:(0,U.jsx)(`span`,{className:`term-em`,children:e.text})})}var jZ={running:`blue`,pending:`blue`,deferred:`yellow`,settled:`dim`,failed:`red`};function MZ({item:e}){let[t,n]=(0,v.useState)(!1),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(!1),s=XX(),c=BX(t),l=e.status??(e.result===void 0?`running`:`settled`),u=l===`running`||l===`pending`,d=l===`failed`||e.result?.isError===!0,f=BD(u),p=e.result?.text??``,m=p.trimEnd().split(`
193
+ `),h=KX(m,e.result?.totalChars),g=t?r?m:DZ(m,EZ):h.shown,_=m.length-g.length,y=t&&!r&&_>0,b=e.result?.truncated===!0,x=b?(e.result?.totalChars??0)-p.length:0,S=d?`red`:l===`settled`&&ID(e.name)?`green`:jZ[l]??`dim`,C=e.input?.command,w=typeof C==`string`?C:p,T=wZ(e.name,e.input);return(0,U.jsx)(`div`,{ref:c,className:t?`term-open`:void 0,children:(0,U.jsxs)(KD,{actions:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(YD,{id:e.id}),w?(0,U.jsx)(ZD,{text:w,label:`Copy`}):null]}),children:[(0,U.jsx)(zX,{onPress:()=>n(e=>!e),expanded:t,children:(0,U.jsxs)(QD,{glyph:u?f:`●`,glyphTone:S,tone:`fg`,children:[(0,U.jsx)(tO,{bold:!0,tone:`bright`,children:e.name}),(0,U.jsxs)(tO,{tone:`dim`,children:[`(`,T?T.summary:jD(e.input),`)`]}),e.backend&&e.backend!==`server`?(0,U.jsxs)(tO,{tone:`faint`,children:[` · `,e.backend]}):null]})}),e.result?.images?.map(t=>(0,U.jsx)(FZ,{toolUseId:e.id,image:t},t.partIndex)),e.patch&&!t?(0,U.jsx)(oO,{patch:e.patch}):T&&!t?(0,U.jsx)(PZ,{preview:T}):p?(0,U.jsxs)(U.Fragment,{children:[g.map((e,t)=>(0,U.jsx)(QD,{indent:1,columns:3,glyph:t===0?`⎿`:void 0,tone:d?`red`:`dim`,children:e||`\xA0`},t)),t?y||b?(0,U.jsx)(QD,{indent:1,columns:3,tone:`faint`,children:a?(0,U.jsxs)(U.Fragment,{children:[`… fetching `,(e.result?.totalChars??0).toLocaleString(),` chars`]}):y||b?(0,U.jsx)(`button`,{type:`button`,className:`term-press term-link`,onClick:()=>{i(!0),b&&(o(!0),s(e.id).finally(()=>o(!1)))},children:b?`… +${x.toLocaleString()} chars — fetch the rest`:`… +${_} line${_===1?``:`s`} — show all ${p.length.toLocaleString()} chars`}):(0,U.jsxs)(U.Fragment,{children:[`… +`,_,` line`,_===1?``:`s`]})}):_>0?(0,U.jsxs)(QD,{indent:1,columns:3,tone:`faint`,children:[`… +`,_,` line`,_===1?``:`s`]}):null:h.more?(0,U.jsx)(QD,{indent:1,columns:3,tone:`faint`,children:h.more}):null]}):null]})})}var NZ={pending:`dim`,in_progress:`blue`,completed:`faint`};function PZ({preview:e}){return(0,U.jsxs)(U.Fragment,{children:[e.shown.map((e,t)=>(0,U.jsx)(QD,{indent:1,columns:3,glyph:t===0?`⎿`:void 0,tone:NZ[e.status],children:TZ(e)},t)),e.more?(0,U.jsx)(QD,{indent:1,columns:3,tone:`faint`,children:e.more}):null]})}function FZ({toolUseId:e,image:t}){let{src:n,failed:r}=nZ({toolUseId:e,...t});return(0,U.jsx)(QD,{indent:1,columns:3,children:(0,U.jsx)(`div`,{className:`term-image`,"data-state":n?`loaded`:r?`failed`:`pending`,style:{height:`calc(var(--term-line) * 12)`},children:n?(0,U.jsx)(`img`,{src:n,alt:HX(t)}):(0,U.jsx)(tO,{tone:`faint`,children:r?UX:HX(t)})})})}function IZ({items:e}){let[t,n]=(0,v.useState)(!1),r=BX(t),i=e.some(e=>{let t=e.status??(e.result===void 0?`running`:`settled`);return t===`running`||t===`pending`}),a=gZ(e),o=BD(i);return(0,U.jsxs)(`div`,{ref:r,className:t?`term-open`:void 0,children:[(0,U.jsx)(zX,{onPress:()=>n(e=>!e),expanded:t,children:(0,U.jsx)(QD,{glyph:i?o:void 0,glyphTone:i?`mark`:void 0,tone:a?`red`:`dim`,children:cZ(e,i)})}),t?(0,U.jsx)(`div`,{children:e.map(e=>(0,U.jsx)(MZ,{item:e},e.id))}):null]})}function LZ({item:e}){return(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(QD,{tone:e.isError?`red`:`faint`,children:[e.isError?e.subtype:`done`,` · `,CD(e.durationMs),` · `,SD(e.totalCostUsd)]}),e.errors?.map((e,t)=>(0,U.jsx)(QD,{tone:`red`,children:e},t))]})}function RZ({item:e}){let t=e.level===`error`;return(0,U.jsx)(QD,{glyph:`!`,glyphTone:t?`red`:`yellow`,tone:t?`red`:`dim`,children:e.text})}function zZ({item:e,href:t}){return(0,U.jsxs)(QD,{glyph:`⤓`,glyphTone:`blue`,tone:`dim`,children:[t?(0,U.jsx)(`a`,{className:`term-link`,"data-tone":`blue`,href:t,download:!0,children:e.path}):(0,U.jsx)(tO,{tone:`blue`,children:e.path}),(0,U.jsxs)(tO,{tone:`faint`,children:[` · `,TD(e.bytes)]}),e.description?(0,U.jsxs)(tO,{tone:`faint`,children:[` · `,e.description]}):null]})}function BZ(e){let[t,n]=(0,v.useState)(()=>Date.now());return(0,v.useEffect)(()=>{if(!e)return;let t=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(t)},[e]),t}function VZ({label:e,startedAt:t,tokens:n}){let r=BD(!0),i=BZ(t!==void 0),a=[t===void 0?void 0:CD(i-t),n?`↓ ${(n/1e3).toFixed(1)}k tokens`:void 0].filter(Boolean);return(0,U.jsxs)(QD,{glyph:r,glyphTone:`mark`,tone:`mark`,children:[e,a.length?(0,U.jsxs)(tO,{tone:`faint`,children:[` (`,a.join(` · `),`)`]}):null]})}function HZ({fontSize:e,lineHeight:t,bleed:n,affordances:r,className:i,style:a,children:o,...s}){let c=WD(r);return(0,U.jsx)(`div`,{"data-terminal":``,"data-affordances":[c.hover&&`hover`,c.actions&&`actions`].filter(Boolean).join(` `)||void 0,className:W(`min-w-0`,i),style:{...e!==void 0&&{"--term-font-size":`${Math.round(e)}px`},...t!==void 0&&{"--term-line":`${Math.round(t)}px`},...n!==void 0&&{"--term-bleed":n},...a},...s,children:(0,U.jsx)(GD,{value:c,children:o})})}function UZ(e){return e.replace(/\s*\(MCP\)$/i,``)}function WZ(e){let t=e.defaultPrompt?.trim()||`$${e.name}`;return/\s$/.test(t)?t:t+` `}function GZ(e,t){let n=e.toLowerCase(),r=t.map(e=>e.toLowerCase());return r.some(e=>e.startsWith(n))?2:+!!r.some(e=>e.includes(n))}function KZ({onSend:e,onInterrupt:t,busy:n,disabled:r,placeholder:i=`Message the agent…`,commands:a,skills:o,onSearchFiles:s,attachments:c,toolbar:l,layout:u=`stacked`,fontSize:d,lineHeight:f,affordances:p,draft:m,className:h,ref:g}){let _=u===`inline`,y=vD()===`terminal`,[b]=(0,v.useState)(()=>m?.initialText??``),{bind:x,plainText:S,isEmpty:C,clear:w,focus:T}=Bw(b===``?void 0:{initialValue:CS(b)}),E=(0,v.useRef)(null),[D,O]=(0,v.useState)(!1);(0,v.useImperativeHandle)(g,()=>({insertText:e=>{let t=S.length>0&&!/\s$/.test(S)?` `:``;x.ref.current?.appendText(t+e),T()},focus:T}),[x.ref,S,T]);let k=(0,v.useMemo)(()=>{let e=[],t=(o??[]).filter(e=>e.enabled);if(a&&a.length>0){let t=new Set,n=a.flatMap(e=>{let n=UZ(e.name);return t.has(n)?[]:(t.add(n),[{...e,name:n}])});e.push(Hw({onSearch:e=>{let t=[];for(let r of n){let n=GZ(e,[r.name,...r.aliases??[],...r.name.split(`:`)]);n!==0&&t.push({score:n,suggestion:{value:r.name,label:`/${r.name}${r.argumentHint?` ${r.argumentHint}`:``}`,description:r.description}})}return t.sort((e,t)=>t.score-e.score),t.map(({suggestion:e})=>e)},onSelect:e=>e.value,chipClassName:`font-mono`}))}return t.length>0&&e.push(Hw({char:`$`,accessibilityLabel:`skill`,onSearch:e=>{let n=[];for(let r of t){let t=GZ(e,[r.name,...r.name.split(/[-:_]/)]);if(t===0)continue;let i=r.shortDescription??r.description;n.push({score:t,suggestion:{value:r.name,label:r.displayName??r.name,description:i?`Skill · ${i}`:`Skill · inserts a message you can edit`,icon:(0,U.jsx)(uy,{className:`size-3.5 text-fg-3`})}})}return n.sort((e,t)=>t.score-e.score),n.map(({suggestion:e})=>e)},insertAsText:e=>{let n=t.find(t=>t.name===e.value);return n?WZ(n):`$${e.value} `}})),s&&e.push(Vw({searchDebounceMs:150,onSearch:async(e,t)=>(await s(e,t)).map(e=>({value:e.relative,label:e.relative,description:e.path})),onSelect:e=>e.value,chipStyle:`inline`,chipClassName:`font-mono`,emptyMessage:`No matching files`})),e.length>0?e:void 0},[a,o,s]),A=m?.save;(0,v.useEffect)(()=>{A?.(S)},[S,A]);let j=c?.items??[],M=!r&&(!C||j.length>0)&&!c?.uploading&&!c?.hasFailure,N=()=>{M&&(e(S.trim(),c?.readyIds??[]),c?.clear(),m?.clear(),w(),T())},P=e=>{e&&e.length>0&&c?.add(e)},F=c&&!c.disabled?(0,U.jsx)(`input`,{ref:E,type:`file`,multiple:!0,accept:c.accept||void 0,className:`hidden`,onChange:e=>{P(e.target.files),e.target.value=``}}):null,I=!!c&&!c.disabled,L=I?(0,U.jsxs)(U.Fragment,{children:[F,(0,U.jsx)(ao,{variant:`ghost`,size:`icon-sm`,"aria-label":`Attach files`,disabled:r,onClick:()=>E.current?.click(),children:(0,U.jsx)(kv,{className:`size-4`})})]}):null,ee=n?(0,U.jsx)(qZ,{gutter:!0,label:`Interrupt`,tone:`yellow`,onClick:t,children:`✕`}):I?(0,U.jsx)(qZ,{gutter:!0,label:`Attach files`,disabled:r,onClick:()=>E.current?.click(),children:`+`}):(0,U.jsx)(`span`,{"aria-hidden":!0,className:`term-gutter`,"data-tone":`blue`,children:`❯`}),R=y?(0,U.jsx)(qZ,{label:`Send`,disabled:!M,onClick:N,tone:M?`blue`:void 0,children:`↵`}):n&&!M?(0,U.jsx)(ao,{variant:`outline`,size:`icon-sm`,"aria-label":`Interrupt`,className:`rounded-full`,onClick:t,children:(0,U.jsx)(gy,{className:`size-3`})}):(0,U.jsx)(ao,{size:`icon-sm`,"aria-label":`Send`,className:`rounded-full`,disabled:!M,onClick:N,children:(0,U.jsx)(Ag,{className:`size-4`})}),te={onDragOver:e=>{c&&!c.disabled&&(e.preventDefault(),O(!0))},onDragLeave:()=>O(!1),onDrop:e=>{!c||c.disabled||(e.preventDefault(),O(!1),P(e.dataTransfer.files))}},z=c?.error?(0,U.jsxs)(`div`,{className:W(`mx-auto mt-1 flex w-full max-w-[var(--wd-transcript-max-width)] items-center gap-2 text-label text-danger`),children:[(0,U.jsx)(Dy,{className:`size-3 shrink-0`}),(0,U.jsx)(`span`,{className:`min-w-0 flex-1`,children:c.error}),(0,U.jsx)(`button`,{type:`button`,onClick:c.dismissError,"aria-label":`Dismiss`,className:`shrink-0 opacity-70 hover:opacity-100`,children:(0,U.jsx)(By,{className:`size-3`})})]}):null;if(y){let e=f??18;return(0,U.jsxs)(`div`,{"data-slot":`composer`,className:W(`shrink-0`,h),children:[(0,U.jsx)(HZ,{...te,fontSize:d,lineHeight:f,affordances:p,bleed:`1ch`,"data-dragging":D||void 0,className:W(`term-composer`,r&&`opacity-60`),children:(0,U.jsxs)(`div`,{className:`term-composer-body`,children:[j.length>0&&c?(0,U.jsx)(JZ,{attachments:c}):null,(0,U.jsxs)(`div`,{className:`term-row`,children:[I?F:null,ee,(0,U.jsxs)(`div`,{className:`flex min-w-0 items-start`,children:[(0,U.jsx)(zw,{...x,triggers:k,markdown:!1,normalizeBullets:!1,onSubmit:N,disabled:r,placeholder:r?`Session ended`:i,minHeight:e,maxHeight:e*10,"aria-label":`Message the agent`,className:`term-composer-field min-w-0 flex-1`,onImagePaste:e=>c?.add([e])}),R]})]}),l?(0,U.jsxs)(`div`,{className:`term-row`,children:[(0,U.jsx)(`span`,{"aria-hidden":!0,className:`term-gutter`}),(0,U.jsx)(`div`,{className:`flex min-w-0 items-center gap-[1ch]`,children:l})]}):null]})}),z]})}return(0,U.jsxs)(`div`,{"data-slot":`composer`,className:W(`px-[var(--wd-composer-padding)] pb-[var(--wd-composer-padding)]`,h),children:[(0,U.jsxs)(`div`,{...te,className:W(`mx-auto w-full max-w-[var(--wd-transcript-max-width)] overflow-hidden border border-border bg-bg`,`transition-colors rounded-lg shadow-(--shadow-xs)`,`focus-within:border-ring focus-within:ring-2 focus-within:ring-ring/30`,D&&`border-ring ring-2 ring-ring/30`,r&&`opacity-60`),children:[j.length>0&&c?(0,U.jsx)(JZ,{attachments:c}):null,_?(0,U.jsxs)(`div`,{className:`flex items-end gap-1 p-1`,children:[L,(0,U.jsx)(zw,{...x,triggers:k,markdown:!1,normalizeBullets:!1,onSubmit:N,disabled:r,placeholder:r?`Session ended`:i,minHeight:20,maxHeight:192,"aria-label":`Message the agent`,className:`min-w-0 flex-1 py-1 text-body-sm text-text`,onImagePaste:e=>c?.add([e])}),R]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(zw,{...x,triggers:k,markdown:!1,normalizeBullets:!1,onSubmit:N,disabled:r,placeholder:r?`Session ended`:i,minHeight:28,maxHeight:192,"aria-label":`Message the agent`,className:`px-3 pt-2.5 pb-0 text-body-sm text-text`,onImagePaste:e=>c?.add([e])}),(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-2 pb-2`,children:[(0,U.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[L,l]}),R]})]})]}),z]})}function qZ({tone:e,label:t,disabled:n,onClick:r,gutter:i,className:a,children:o}){return(0,U.jsx)(`button`,{type:`button`,"aria-label":t,title:t,disabled:n,onClick:r,"data-tone":e,"data-gutter":i||void 0,className:W(`term-glyph`,a),children:o})}function JZ({attachments:e}){let t=vD()===`terminal`;return(0,U.jsx)(`div`,{className:W(`flex gap-2 overflow-x-auto`,t?`term-attachments`:`border-b border-border px-2 py-2`),children:e.items.map(t=>(0,U.jsx)(YZ,{item:t,onRetry:()=>e.retry(t.key),onRemove:()=>e.remove(t.key)},t.key))})}function YZ({item:e,onRetry:t,onRemove:n}){let r=e.status===`failed`,i=vD()===`terminal`,a=i?``:`rounded-md`;return(0,U.jsxs)(`div`,{className:`group relative shrink-0`,title:r?`${e.name} — ${e.error}`:`${e.name} · ${TD(e.bytes)}`,children:[(0,U.jsx)(`div`,{className:W(`flex size-14 items-center justify-center overflow-hidden bg-surface`,a,i?`term-attachment`:`border border-border`,r&&`border-danger/50`),"data-failed":i&&r?``:void 0,children:e.previewUrl?(0,U.jsx)(`img`,{src:e.previewUrl,alt:e.name,className:`size-full object-cover`}):(0,U.jsxs)(`div`,{className:`flex flex-col items-center gap-0.5 text-fg-3`,children:[(0,U.jsx)(O_,{className:`size-4`}),(0,U.jsx)(`span`,{className:`max-w-12 truncate text-[9px] font-semibold uppercase`,children:XZ(e.name)})]})}),e.status===`uploading`?(0,U.jsx)(`div`,{className:W(`absolute inset-0 flex items-center justify-center bg-black/35`,a),children:(0,U.jsx)(gS,{className:`size-4 text-white`})}):null,r?(0,U.jsx)(`button`,{type:`button`,onClick:t,"aria-label":`Retry ${e.name}`,className:W(`absolute inset-0 flex items-center justify-center bg-black/45 text-warning`,a),children:(0,U.jsx)(Jv,{className:`size-4`})}):null,(0,U.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Remove ${e.name}`,className:W(`absolute flex size-4 items-center justify-center bg-surface text-fg-3 hover:text-fg-1`,i?`term-attachment-remove`:`-top-1 -right-1 rounded-full border border-border shadow-(--shadow-xs)`),children:(0,U.jsx)(By,{className:`size-2.5`})})]})}function XZ(e){let t=e.lastIndexOf(`.`);return t>0?e.slice(t+1).toUpperCase():`FILE`}function ZZ(e){return typeof CSS<`u`&&CSS.supports(`color`,e)?e:void 0}function QZ(e){return e===void 0?`none`:e>=95?`error`:e>=80?`warning`:`none`}function $Z(e){let t=QZ(e);return t===`error`?`text-danger`:t===`warning`?`text-warning`:`text-fg-3`}function eQ(e){return e>=90?`bg-danger`:e>=70?`bg-warning`:`bg-accent`}function tQ({usage:e,open:t,onOpenChange:n,className:r}){return(0,U.jsx)(ix,{open:t,onOpenChange:n,children:(0,U.jsxs)(ax,{className:r,children:[(0,U.jsx)(ox,{title:`Context`,description:e?.model}),(0,U.jsx)(sx,{children:e?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`flex items-baseline justify-between gap-4`,children:[(0,U.jsx)(`span`,{className:`text-label text-fg-3`,children:`Used`}),(0,U.jsxs)(`span`,{className:`font-mono text-body-sm text-fg-1`,children:[wD(e.totalTokens),` / `,wD(e.maxTokens),` · `,e.percentage.toFixed(0),`%`]})]}),(0,U.jsx)(`div`,{className:`mt-2 h-2 overflow-hidden rounded-full bg-border`,children:(0,U.jsx)(`div`,{className:W(`h-full rounded-full`,eQ(e.percentage)),style:{width:`${Math.min(100,Math.max(2,e.percentage))}%`}})}),e.categories.length>0?(0,U.jsxs)(`div`,{className:`mt-5`,children:[(0,U.jsx)(`h3`,{className:`text-label font-medium text-fg-3`,children:`Breakdown`}),(0,U.jsx)(`div`,{className:`mt-2 flex flex-col gap-3`,children:e.categories.map(t=>{let n=t.tokens/Math.max(e.maxTokens,1)*100,r=ZZ(t.color);return(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,U.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`size-2 shrink-0 rounded-full bg-fg-4`,style:r?{backgroundColor:r}:void 0}),(0,U.jsx)(`span`,{className:`truncate text-body-sm text-fg-1`,children:t.name})]}),(0,U.jsx)(`span`,{className:`shrink-0 font-mono text-label text-fg-3`,children:wD(t.tokens)})]}),(0,U.jsx)(`div`,{className:`mt-1 h-1 overflow-hidden rounded-full bg-border`,children:(0,U.jsx)(`div`,{className:`h-full rounded-full bg-fg-4`,style:{width:`${Math.min(100,n)}%`,backgroundColor:r}})})]},t.name)})})]}):null]}):(0,U.jsx)(`p`,{className:`py-6 text-center text-body-sm text-fg-4`,children:`No reading yet — the context window is measured after a turn completes.`})})]})})}function nQ({type:e}){return e===`dir`?(0,U.jsx)(I_,{className:`size-3.5 shrink-0 text-accent`}):e===`symlink`?(0,U.jsx)(ov,{className:`size-3.5 shrink-0 text-fg-4`}):(0,U.jsx)(k_,{className:`size-3.5 shrink-0 text-fg-4`})}function rQ({client:e,cwd:t,open:n,onOpenChange:r}){let[i,a]=(0,v.useState)(t),[o,s]=(0,v.useState)([]),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(),[m,h]=(0,v.useState)(),[g,_]=(0,v.useState)(!1),[y,b]=(0,v.useState)(),x=(0,v.useCallback)(async t=>{_(!0),b(void 0);try{let n=await e.listHostDir(t);a(n.path),s(n.entries),l(n.truncated??!1)}catch(e){b(e instanceof Error?e.message:`Could not read that directory`)}finally{_(!1)}},[e]);(0,v.useEffect)(()=>{n&&(h(void 0),d(``),p(void 0),b(void 0),t&&x(t))},[n,t,x]),(0,v.useEffect)(()=>{if(!n||!t)return;let r=u.trim();if(!r){p(void 0);return}let i=setTimeout(()=>{e.findHostFiles(t,r,40).then(e=>p(e.matches)).catch(()=>p([]))},150);return()=>clearTimeout(i)},[e,t,u,n]);let S=async t=>{_(!0),b(void 0);try{let n=await e.readHostFile(t);h({path:n.path,bytes:n.bytes,content:n.encoding===`utf8`?n.content:`(binary file — not shown)`})}catch(e){b(e instanceof Error?e.message:`Could not read that file`)}finally{_(!1)}},C=i&&t&&i!==t?i.slice(0,i.lastIndexOf(`/`))||`/`:void 0,w=f??o;return(0,U.jsx)(ix,{open:n,onOpenChange:r,children:(0,U.jsxs)(ax,{size:`lg`,children:[(0,U.jsx)(ox,{title:m?m.path.split(`/`).pop():`Files`,description:m?m.path:i,actions:m?(0,U.jsxs)(ao,{variant:`ghost`,size:`xs`,onClick:()=>h(void 0),children:[(0,U.jsx)($g,{className:`size-3.5`}),`Back`]}):C?(0,U.jsxs)(ao,{variant:`ghost`,size:`xs`,onClick:()=>void x(C),children:[(0,U.jsx)($g,{className:`size-3.5`}),`Up`]}):null}),(0,U.jsxs)(sx,{className:`flex flex-col gap-3`,children:[y?(0,U.jsx)(`div`,{className:`rounded-md bg-danger-bg px-3 py-2 text-body-sm text-danger`,children:y}):null,m?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`p`,{className:`text-label text-fg-4`,children:TD(m.bytes)}),(0,U.jsx)(_S,{code:m.content,label:m.path.split(`/`).pop()})]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`relative`,children:[(0,U.jsx)(ty,{className:`absolute top-1/2 left-2 size-3.5 -translate-y-1/2 text-fg-4`}),(0,U.jsx)(po,{value:u,onChange:e=>d(e.target.value),placeholder:`Search this project…`,className:`pl-7`,spellCheck:!1})]}),g&&w.length===0?(0,U.jsx)(`div`,{className:`py-6 text-center`,children:(0,U.jsx)(gS,{className:`size-4 text-fg-4`})}):w.length===0?(0,U.jsx)(`p`,{className:`py-6 text-center text-body-sm text-fg-4`,children:f?`No matching files.`:`This directory is empty.`}):(0,U.jsx)(`ul`,{className:`flex flex-col`,children:f?f.map(e=>(0,U.jsx)(`li`,{children:(0,U.jsxs)(`button`,{type:`button`,onClick:()=>void S(e.path),className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-surface-hover`,children:[(0,U.jsx)(k_,{className:`size-3.5 shrink-0 text-fg-4`}),(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-label text-fg-1`,children:e.relative})]})},e.path)):o.map(e=>(0,U.jsx)(`li`,{children:(0,U.jsxs)(`button`,{type:`button`,onClick:()=>e.type===`dir`?void x(e.path):void S(e.path),className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-surface-hover`,children:[(0,U.jsx)(nQ,{type:e.type}),(0,U.jsxs)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-label text-fg-1`,children:[e.name,e.type===`dir`?`/`:``]}),e.bytes===void 0?null:(0,U.jsx)(`span`,{className:`shrink-0 text-label text-fg-4`,children:TD(e.bytes)})]})},e.path))}),c&&!f?(0,U.jsx)(`p`,{className:`text-label text-fg-4`,children:`More entries than the server will return — use the search box.`}):null]})]})]})})}var iQ={connected:`success`,failed:`danger`,"needs-auth":`warning`,pending:`info`,disabled:`neutral`};function aQ({client:e,sessionId:t,open:n,onOpenChange:r,canManageServers:i=!0,className:a}){let[o,s]=(0,v.useState)(),[c,l]=(0,v.useState)(),[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)(),[m,h]=(0,v.useState)(),[g,_]=(0,v.useState)(),y=(0,v.useCallback)(async()=>{if(t){d(!0),l(void 0);try{s(await e.listMcpServers(t))}catch(e){l(e instanceof Error?e.message:`Could not read MCP status`)}finally{d(!1)}}},[e,t]);(0,v.useEffect)(()=>{n&&(h(void 0),_(void 0),y())},[n,y]);let b=async(n,r)=>{if(t){p(n),l(void 0);try{s(await e.mcpServerAction(t,n,r))}catch(e){l(e instanceof Error?e.message:`Could not ${r} ${n}`)}finally{p(void 0)}}},x=o?.find(e=>e.name===m),S=x?.tools?.find(e=>e.name===g),C=S?.name??x?.name??`MCP servers`;return(0,U.jsx)(ix,{open:n,onOpenChange:r,children:(0,U.jsxs)(ax,{className:a,children:[(0,U.jsx)(ox,{title:C,description:S?`${x?.name} tool`:x?x.serverInfo?.name:void 0,actions:m?(0,U.jsxs)(ao,{variant:`ghost`,size:`xs`,onClick:()=>g?_(void 0):h(void 0),children:[(0,U.jsx)($g,{className:`size-3.5`}),`Back`]}):(0,U.jsxs)(ao,{variant:`ghost`,size:`xs`,onClick:()=>void y(),disabled:u,children:[u?(0,U.jsx)(gS,{className:`size-3 text-current`}):(0,U.jsx)(Jv,{className:`size-3`}),`Refresh`]})}),(0,U.jsxs)(sx,{children:[c?(0,U.jsx)(`div`,{className:`mb-3 rounded-md bg-danger-bg px-3 py-2 text-body-sm text-danger`,children:c}):null,S?(0,U.jsx)(cQ,{tool:S}):x?(0,U.jsx)(sQ,{server:x,busy:f===x.name,canManage:i,onAct:e=>void b(x.name,e),onSelectTool:_}):c&&!o?null:(0,U.jsx)(oQ,{servers:o,loading:u,onSelect:h})]})]})})}function oQ({servers:e,loading:t,onSelect:n}){if(t&&!e)return(0,U.jsx)(`div`,{className:`py-6 text-center`,children:(0,U.jsx)(gS,{className:`size-4 text-fg-4`})});if(!e?.length)return(0,U.jsx)(`p`,{className:`py-6 text-center text-body-sm text-fg-4`,children:`No MCP servers configured for this session.`});let r=[...new Set(e.map(e=>e.scope??`other`))];return(0,U.jsx)(`div`,{className:`flex flex-col gap-4`,children:r.map(t=>(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{className:`text-label font-medium text-fg-3 capitalize`,children:t}),(0,U.jsx)(`ul`,{className:`mt-1 flex flex-col`,children:e.filter(e=>(e.scope??`other`)===t).map(e=>(0,U.jsx)(`li`,{children:(0,U.jsxs)(`button`,{type:`button`,onClick:()=>n(e.name),className:`flex w-full items-center gap-2 rounded-md px-2 py-2 text-left transition-colors hover:bg-surface-hover`,children:[(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-body-sm text-fg-1`,children:e.name}),e.tools?.length?(0,U.jsxs)(`span`,{className:`shrink-0 text-label text-fg-4`,children:[e.tools.length,` tools`]}):null,(0,U.jsx)(so,{variant:iQ[e.status]??`neutral`,dot:!0,className:`shrink-0`,children:e.status}),(0,U.jsx)(e_,{className:`size-3.5 shrink-0 text-fg-4`})]})},e.name))})]},t))})}function sQ({server:e,busy:t,canManage:n,onAct:r,onSelectTool:i}){let a=e.status===`disabled`;return(0,U.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(cx,{label:`Status`,children:(0,U.jsx)(so,{variant:iQ[e.status]??`neutral`,dot:!0,children:e.status})}),e.transport?(0,U.jsx)(cx,{label:`Transport`,children:e.transport}):null,e.scope?(0,U.jsx)(cx,{label:`Scope`,children:e.scope}):null,e.serverInfo?(0,U.jsxs)(cx,{label:`Server`,children:[e.serverInfo.name,` `,e.serverInfo.version]}):null,e.command?(0,U.jsx)(cx,{label:`Command`,mono:!0,children:[e.command,...e.args??[]].join(` `)}):null,e.url?(0,U.jsx)(cx,{label:`URL`,mono:!0,children:e.url}):null]}),e.error?(0,U.jsx)(`div`,{className:`rounded-md bg-danger-bg px-3 py-2 text-body-sm break-words text-danger`,children:e.error}):null,n?(0,U.jsxs)(`div`,{className:`flex gap-2`,children:[(0,U.jsxs)(ao,{variant:`outline`,size:`sm`,disabled:t,onClick:()=>r(`reconnect`),children:[t?(0,U.jsx)(gS,{className:`size-3 text-current`}):(0,U.jsx)(Jv,{className:`size-3`}),`Reconnect`]}),(0,U.jsxs)(ao,{variant:`outline`,size:`sm`,disabled:t,onClick:()=>r(a?`enable`:`disable`),children:[a?(0,U.jsx)(zv,{className:`size-3`}):(0,U.jsx)(Rv,{className:`size-3`}),a?`Enable`:`Disable`]})]}):null,(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{className:`text-label font-medium text-fg-3`,children:`Tools`}),e.tools?.length?(0,U.jsx)(`ul`,{className:`mt-1 flex flex-col`,children:e.tools.map(e=>(0,U.jsx)(`li`,{children:(0,U.jsxs)(`button`,{type:`button`,onClick:()=>i(e.name),className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-surface-hover`,children:[(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-label text-fg-1`,children:e.name}),(0,U.jsx)(e_,{className:`size-3.5 shrink-0 text-fg-4`})]})},e.name))}):(0,U.jsx)(`p`,{className:`py-2 text-body-sm text-fg-4`,children:e.status===`connected`?`This server exposes no tools.`:`Tools are listed once the server connects.`})]})]})}function cQ({tool:e}){let t=e.annotations;return(0,U.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[e.description?(0,U.jsx)(`p`,{className:`text-body-sm whitespace-pre-wrap text-fg-2`,children:e.description}):(0,U.jsx)(`p`,{className:`text-body-sm text-fg-4`,children:`This tool carries no description.`}),t?(0,U.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[t.readOnly?(0,U.jsx)(so,{variant:`success`,children:`read-only`}):null,t.destructive?(0,U.jsx)(so,{variant:`danger`,children:`destructive`}):null,t.openWorld?(0,U.jsx)(so,{variant:`warning`,children:`open world`}):null]}):null,e.inputSchema===void 0?(0,U.jsx)(`p`,{className:W(`text-label text-fg-4`),children:`Parameters aren’t available: this engine names and describes each tool but reports no input schema.`}):(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{className:`text-label font-medium text-fg-3`,children:`Parameters`}),(0,U.jsx)(`pre`,{className:`mt-1 max-h-64 overflow-auto rounded-md bg-surface px-3 py-2 text-label text-fg-2`,children:lQ(e.inputSchema)})]})]})}function lQ(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}var uQ={user:`Personal`,repo:`This project`,system:`System`,admin:`Managed`};function dQ({skills:e,open:t,onOpenChange:n,onUse:r,className:i}){let[a,o]=(0,v.useState)(),s=e?.find(e=>e.name===a);return(0,U.jsx)(ix,{open:t,onOpenChange:e=>{e||o(void 0),n(e)},children:(0,U.jsxs)(ax,{className:i,children:[(0,U.jsx)(ox,{title:s?s.displayName??s.name:`Skills`,description:s?s.name===(s.displayName??s.name)?void 0:s.name:`Capabilities the agent can choose to use. Not commands — the model picks them from their descriptions.`,actions:s?(0,U.jsxs)(ao,{variant:`ghost`,size:`xs`,onClick:()=>o(void 0),children:[(0,U.jsx)($g,{className:`size-3.5`}),`Back`]}):void 0}),(0,U.jsx)(sx,{children:s?(0,U.jsx)(pQ,{skill:s,onUse:r,onUsed:()=>n(!1)}):(0,U.jsx)(fQ,{skills:e,onSelect:o})})]})})}function fQ({skills:e,onSelect:t}){if(!e)return(0,U.jsx)(`p`,{className:`py-6 text-center text-body-sm text-fg-4`,children:`Skills are listed once the session connects — send a message first.`});if(e.length===0)return(0,U.jsx)(`p`,{className:`py-6 text-center text-body-sm text-fg-4`,children:`This session found no skills.`});let n=[...new Set(e.map(e=>e.scope??`other`))];return(0,U.jsx)(`div`,{className:`flex flex-col gap-4`,children:n.map(n=>(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{className:`text-label font-medium text-fg-3`,children:uQ[n]??n}),(0,U.jsx)(`ul`,{className:`mt-1 flex flex-col`,children:e.filter(e=>(e.scope??`other`)===n).map(e=>(0,U.jsx)(`li`,{children:(0,U.jsxs)(`button`,{type:`button`,onClick:()=>t(e.name),className:`flex w-full items-start gap-2 rounded-md px-2 py-2 text-left transition-colors hover:bg-surface-hover`,children:[(0,U.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(`span`,{className:`block truncate text-body-sm text-fg-1`,children:e.displayName??e.name}),e.shortDescription??e.description?(0,U.jsx)(`span`,{className:`block truncate text-label text-fg-4`,children:e.shortDescription??e.description}):null]}),e.enabled?null:(0,U.jsx)(so,{variant:`neutral`,className:`mt-0.5 shrink-0`,children:`off`}),(0,U.jsx)(e_,{className:`mt-0.5 size-3.5 shrink-0 text-fg-4`})]})},e.name))})]},n))})}function pQ({skill:e,onUse:t,onUsed:n}){return(0,U.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,U.jsxs)(`div`,{children:[e.scope?(0,U.jsx)(cx,{label:`Scope`,children:uQ[e.scope]??e.scope}):null,(0,U.jsx)(cx,{label:`Status`,children:(0,U.jsx)(so,{variant:e.enabled?`success`:`neutral`,dot:!0,children:e.enabled?`enabled`:`disabled`})})]}),e.description?(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{className:`text-label font-medium text-fg-3`,children:`Description`}),(0,U.jsx)(`p`,{className:`mt-1 text-body-sm whitespace-pre-wrap text-fg-2`,children:e.description})]}):(0,U.jsx)(`p`,{className:`text-body-sm text-fg-4`,children:`This skill carries no description.`}),t&&e.enabled?(0,U.jsxs)(`div`,{children:[(0,U.jsx)(ao,{variant:`outline`,size:`sm`,onClick:()=>{t(e),n()},children:`Use this skill`}),(0,U.jsx)(`p`,{className:`mt-1.5 text-label text-fg-4`,children:`Writes an opening message into the composer for you to edit — it isn’t sent, and there is no command that runs a skill directly.`})]}):null]})}function mQ(e){return e==="default"}function hQ(e){return e.replace(/\[.*\]$/,``)}function gQ(e){let t=e.toLowerCase().split(`-`);return t[0]===`claude`&&t.shift(),t[0]??``}function _Q(e,t){if(t===e.value||t===e.resolvedModel)return!0;let n=hQ(t);if(e.resolvedModel)return n===hQ(e.resolvedModel);let r=gQ(n);return r!==``&&r===gQ(hQ(e.value))}function vQ(e,t){if(t)return e.filter(e=>!mQ(e.value)).find(e=>_Q(e,t))}function yQ({models:e,model:t,onModelChange:n,variant:r=`toolbar`,disabled:i,className:a}){let o=vQ(e,t)??(t?void 0:e.find(e=>mQ(e.value)));return(0,U.jsxs)(Uy,{items:e.map(e=>({value:e.value,label:e.displayName})),value:o?.value??null,onValueChange:e=>{typeof e==`string`&&e!==o?.value&&n(mQ(e)?void 0:e)},disabled:i,children:[(0,U.jsx)(Ky,{"aria-label":`Model`,className:W(r===`toolbar`&&`h-6 max-w-56 border-transparent bg-transparent text-fg-3 hover:bg-surface-hover`,a),children:(0,U.jsx)(`span`,{className:W(`truncate`,r===`toolbar`&&`font-mono text-label`),children:(0,U.jsx)(Wy,{placeholder:t??`model`})})}),(0,U.jsx)(qy,{className:`min-w-72`,children:e.map(e=>(0,U.jsxs)(Jy,{value:e.value,children:[(0,U.jsx)(Gy,{children:(0,U.jsx)(`span`,{className:`font-medium`,children:e.displayName})}),e.description?(0,U.jsx)(`span`,{className:`text-label text-fg-4`,children:e.description}):null]},e.value))})]})}var bQ=[{value:`default`,label:`Manual`,shortLabel:`Manual`,description:`Always ask before making changes`,icon:q_},{value:`acceptEdits`,label:`Accept edits`,shortLabel:`Edits`,description:`Automatically accept all file edits`,icon:u_},{value:`plan`,label:`Plan`,shortLabel:`Plan`,description:`Create a plan before making changes`,icon:s_},{value:`auto`,label:`Auto`,shortLabel:`Auto`,description:`The agent handles permission decisions`,icon:Vy},{value:`dontAsk`,label:`Don't ask`,shortLabel:`Don't ask`,description:`Never ask — deny anything not pre-approved`,icon:iy},{value:`bypassPermissions`,label:`Bypass permissions`,shortLabel:`Bypass`,description:`Skip every approval — the agent is unsupervised`,icon:Dy,dangerous:!0}];function xQ(e){return bQ.find(t=>t.value===e)}function SQ(e,t){return(e?bQ.filter(t=>e.includes(t.value)):bQ).map(e=>({value:e.value,label:e.label,description:e.value===`bypassPermissions`&&t===!1?`Only available to a session started in this mode`:e.description,dangerous:e.dangerous,disabled:e.value===`bypassPermissions`&&t===!1}))}function CQ({mode:e,onModeChange:t,modes:n,canBypass:r,variant:i=`toolbar`,disabled:a,className:o}){let s=e===`bypassPermissions`,c=n?bQ.filter(e=>n.includes(e.value)):bQ,l=e=>e.value===`bypassPermissions`&&r===!1;return(0,U.jsxs)(Uy,{items:c.map(e=>({value:e.value,label:e.label})),value:e??null,onValueChange:n=>{typeof n==`string`&&n!==e&&t(n)},disabled:a,children:[(0,U.jsx)(Ky,{"aria-label":`Permission mode`,className:W(i===`toolbar`&&`h-6 max-w-44 border-transparent bg-transparent hover:bg-surface-hover`,s?`text-danger`:i===`toolbar`?`text-fg-3`:void 0,o),children:(0,U.jsx)(`span`,{className:W(`truncate`,i===`toolbar`&&`text-label`),children:(0,U.jsx)(Wy,{placeholder:`permissions`})})}),(0,U.jsx)(qy,{className:`min-w-64`,children:c.map(e=>{let t=l(e);return(0,U.jsxs)(Jy,{value:e.value,disabled:t,children:[(0,U.jsx)(Gy,{children:(0,U.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(e.icon,{className:W(`size-3.5 shrink-0`,e.dangerous?`text-danger`:`text-fg-3`)}),(0,U.jsx)(`span`,{className:W(`font-medium`,e.dangerous&&`text-danger`),children:e.label})]})}),(0,U.jsx)(`span`,{className:W(`pl-5.5 text-label`,t?`text-fg-4`:e.dangerous?`text-danger/80`:`text-fg-4`),children:t?`Only available to a session started in this mode`:e.description})]},e.value)})})]})}function wQ(e){if(e?.toolName!==`ExitPlanMode`)return;let t=e.input;if(typeof t!=`object`||!t)return;let n=t.plan;if(typeof n==`string`&&n.trim().length!==0)return n}var TQ=(0,v.memo)(function({children:e,streaming:t,className:n}){return(0,U.jsx)(kX,{mode:t?`streaming`:`static`,parseIncompleteMarkdown:t,shikiTheme:[`github-light`,`github-dark`],linkSafety:{enabled:!1},className:W(`size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0`,n),children:e})},(e,t)=>e.children===t.children&&e.streaming===t.streaming&&e.className===t.className);function EQ({request:e,onApprove:t,onDeny:n,className:r}){let[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(``),u=t=>{let r=c.trim();n(e.id,r||void 0,t||void 0),l(``),s(!1)},d=wQ(e),f=jD(e.input),p=PD(e.toolName);return(0,U.jsxs)(`div`,{"data-slot":`permission-prompt`,className:W(`rounded-lg border border-warning/40 bg-warning-bg p-3`,r),children:[(0,U.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,U.jsx)(q_,{className:`mt-0.5 size-4 shrink-0 text-warning`}),(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(`div`,{className:`text-body-sm font-medium text-fg-1`,children:d?`Plan ready for review`:e.title??e.displayName??`Permission needed`}),e.description?(0,U.jsx)(`div`,{className:`mt-0.5 text-label text-fg-3`,children:e.description}):null,e.decisionReason?(0,U.jsx)(`div`,{className:`mt-0.5 text-label text-fg-4`,children:e.decisionReason}):null,d?(0,U.jsx)(`div`,{className:`mt-1.5 max-h-72 overflow-y-auto rounded-md bg-code-bg px-2.5 py-2 text-body-sm text-fg-2`,children:(0,U.jsx)(TQ,{children:d})}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`mt-1.5 flex min-w-0 items-center gap-2`,children:[(0,U.jsx)(p,{className:`size-3 shrink-0 text-fg-3`}),(0,U.jsx)(`span`,{className:`shrink-0 font-mono text-label font-medium text-fg-2`,children:e.toolName}),f?(0,U.jsx)(`span`,{className:`min-w-0 truncate font-mono text-label text-fg-4`,children:f}):null]}),(0,U.jsxs)(`button`,{type:`button`,className:`mt-1 font-mono text-label text-fg-3 underline-offset-2 hover:underline`,onClick:()=>a(e=>!e),children:[i?`Hide`:`Show`,` `,e.toolName,` input`]}),i?(0,U.jsx)(`pre`,{className:`mt-1.5 max-h-48 overflow-auto rounded-md bg-code-bg px-2.5 py-1.5 font-mono text-label whitespace-pre-wrap text-fg-2`,children:JSON.stringify(e.input,null,2)}):null]})]}),(0,U.jsxs)(`div`,{className:`flex shrink-0 flex-wrap justify-end gap-1.5`,children:[(0,U.jsx)(ao,{size:`sm`,onClick:()=>t(e.id),children:d?`Approve plan`:`Allow`}),(0,U.jsx)(ao,{size:`sm`,variant:`outline`,onClick:()=>s(e=>!e),children:d?`Keep planning`:`Deny`}),(0,U.jsx)(ao,{size:`sm`,variant:`outline`,onClick:()=>u(!0),children:d?`Stop the turn`:`Deny & stop`})]})]}),o?(0,U.jsxs)(`div`,{className:`mt-2.5 flex items-center gap-2 border-t border-warning/30 pt-2.5`,children:[(0,U.jsx)(po,{autoFocus:!0,value:c,onChange:e=>l(e.target.value),onKeyDown:e=>{e.key===`Enter`&&u(!1),e.key===`Escape`&&s(!1)},placeholder:d?`What should change? (optional) — the agent keeps planning and reads this`:`Reason (optional) — the agent reads this and can try something else`,className:`h-7 flex-1`}),(0,U.jsx)(ao,{size:`sm`,variant:`outline`,onClick:()=>s(!1),children:`Cancel`}),(0,U.jsx)(ao,{size:`sm`,variant:`destructive`,onClick:()=>u(!1),children:d?`Keep planning`:`Deny`})]}):null]})}function DQ({task:e,items:t,label:n,onBack:r,terminal:i,fontSize:a,lineHeight:o}){let s=e?_Z(e,t):!1,c=e?vZ(e):!1,l=BD(s),u=t.reduce((e,t)=>e+ +(t.kind===`tool_call`),0),d=s?e?.ts:void 0,f=BZ(d!==void 0),p=d===void 0?void 0:CD(f-d),m=e?fZ(e):n,h=e?c?`failed`:s?`${l} working…`:`done`:void 0,g=[u>0?`${u} tool${u===1?``:`s`}`:void 0,p].filter(Boolean).join(` · `);return i?(0,U.jsx)(HZ,{fontSize:a,lineHeight:o,className:`shrink-0`,children:(0,U.jsx)(`button`,{type:`button`,onClick:r,"aria-label":`Back to the session`,className:`block w-full cursor-pointer text-left`,children:(0,U.jsxs)(QD,{glyph:`←`,glyphTone:`dim`,indent:1,tone:c?`red`:`green`,children:[m,h?(0,U.jsxs)(tO,{tone:c?`red`:s?`mark`:`dim`,children:[` · `,h]}):null,g?(0,U.jsxs)(tO,{tone:`faint`,children:[` · `,g]}):null]})})}):(0,U.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-border px-3 py-1.5`,children:[(0,U.jsxs)(ao,{variant:`ghost`,size:`sm`,onClick:r,className:`h-6 gap-1 px-1.5`,children:[(0,U.jsx)(Og,{className:`size-3.5`}),`Back`]}),(0,U.jsx)(`span`,{className:W(`min-w-0 flex-1 truncate text-body-sm`,c?`text-danger`:`text-fg-2`),children:m}),h?(0,U.jsx)(`span`,{className:W(`shrink-0 text-label`,c?`text-danger`:s?`text-accent`:`text-fg-3`),children:h}):null,g?(0,U.jsx)(`span`,{className:`shrink-0 text-label text-fg-4`,children:g}):null]})}function OQ(e){return(`parentToolUseId`in e?e.parentToolUseId:void 0)??void 0}function kQ(e,t){return e.filter(e=>OQ(e)===t)}function AQ(e){return e.kind===`tool_call`}function jQ(e){return e.children.flatMap(e=>`run`in e?e.run:[e.item])}function MQ(e,t,n){let r=e.at(-1);if(AQ(t)){r&&`run`in r&&oZ(r.run[0],t)?(r.run.push(t),r.indices.push(n)):e.push({key:`run:${t.id}`,run:[t],indices:[n],index:n});return}e.push({key:`${t.kind}:${t.id}`,item:t,index:n})}function NQ(e,t=0,n=!0){if(!n)return e.map((e,n)=>({key:`${e.kind}:${e.id}`,item:e,index:t+n}));let r=new Set;for(let t of e)t.kind===`tool_call`&&OQ(t)===void 0&&r.add(t.id);let i=new Map;e.forEach((e,n)=>{let a=OQ(e);if(a!==void 0&&r.has(a)){let r=i.get(a);r?r.push({item:e,index:t+n}):i.set(a,[{item:e,index:t+n}])}});let a=[];for(let[n,r]of e.entries()){let e=t+n,o=OQ(r);if(!(o!==void 0&&i.has(o))){if(r.kind===`tool_call`){let t=i.get(r.id);if(t){let n=[];for(let e of t)MQ(n,e.item,e.index);a.push({key:`task:${r.id}`,task:r,children:n,childIndices:t.map(e=>e.index),index:e});continue}}MQ(a,r,e)}}return a}function PQ(e,t){return e.kind!==`tool_call`||t.kind!==`tool_call`}function FQ(e,t){let n=e=>`item`in e?e.item.kind:`tool_call`;return n(e)!==`tool_call`||n(t)!==`tool_call`}function IQ(e){let{sessionId:t,items:n,session:r,reveal:i,openSubagent:a,onSubagentChange:o}=e,[s,c]=(0,v.useState)(void 0),[l,u]=(0,v.useState)(void 0);(0,v.useEffect)(()=>{c(void 0),u(void 0)},[t]);let d=(0,v.useCallback)(()=>{c(e=>{e!==void 0&&u({toolUseId:e,nonce:Date.now()})})},[]),f=a?.nonce,p=a?.toolUseId;(0,v.useEffect)(()=>{p===void 0?d():c(p)},[f]);let m=i?.nonce;(0,v.useEffect)(()=>{m!==void 0&&c(void 0)},[m]),(0,v.useEffect)(()=>{if(s===void 0)return;let e=e=>{e.key!==`Escape`||e.defaultPrevented||d()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[s,d]);let h=(0,v.useRef)(o);h.current=o;let g=(0,v.useRef)(void 0);return(0,v.useEffect)(()=>{g.current!==s&&(g.current=s,h.current?.(s))},[s]),{subagentId:s,enterSubagent:c,leaveSubagent:d,returnReveal:l,frameItems:(0,v.useMemo)(()=>s===void 0?[]:kQ(n,s),[n,s]),task:(0,v.useMemo)(()=>s===void 0?void 0:n.find(e=>e.kind===`tool_call`&&e.id===s),[n,s]),fallbackLabel:(0,v.useMemo)(()=>{let e=r?.subagents?.find(e=>e.toolUseId===s);return e?Jw(e):`Sub-agent`},[r,s])}}var LQ=[{value:`auto`,label:`Auto-answer`,description:`pick each question’s recommended option`},{value:`ask`,label:`Ask`,description:`wait for a watcher or webhook controller to answer`},{value:`deny`,label:`Disabled`,description:`the agent is told to decide on its own`}];function RQ(e){return(Array.isArray(e.questions)?e.questions:[]).flatMap(e=>{let t=e;if(typeof t.question!=`string`||!Array.isArray(t.options))return[];let n=t.options.filter(e=>typeof e?.label==`string`);return n.length===0?[]:[{question:t.question,header:typeof t.header==`string`?t.header:``,options:n,multiSelect:t.multiSelect===!0}]})}var zQ={labels:[],other:``,otherActive:!1};function BQ(e){let t=[...e.labels];return e.otherActive&&e.other.trim()&&t.push(e.other.trim()),t.join(`, `)}function VQ({request:e,onAnswer:t,onDismiss:n,className:r}){let i=RQ(e.input),[a,o]=(0,v.useState)(()=>i.map(()=>zQ)),s=(e,t)=>{o(n=>n.map((n,r)=>r===e?{...n,...t}:n))},c=(e,t,n)=>{let r=a[e]??zQ;n?s(e,{labels:r.labels.includes(t)?r.labels.filter(e=>e!==t):[...r.labels,t]}):s(e,{labels:r.labels[0]===t?[]:[t],otherActive:!1})},l=i.every((e,t)=>BQ(a[t]??zQ)!==``);return(0,U.jsx)(`div`,{"data-slot":`question-prompt`,className:W(`rounded-lg border border-info/40 bg-info-bg p-3`,r),children:(0,U.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,U.jsx)(pv,{className:`mt-0.5 size-4 shrink-0 text-info`}),(0,U.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3`,children:[i.map((e,t)=>{let n=a[t]??zQ;return(0,U.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.header?(0,U.jsx)(so,{variant:`info`,children:e.header}):null,(0,U.jsx)(`span`,{className:`text-body-sm font-medium text-fg-1`,children:e.question})]}),(0,U.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[e.options.map(r=>{let i=n.labels.includes(r.label);return(0,U.jsxs)(`button`,{type:`button`,onClick:()=>c(t,r.label,e.multiSelect===!0),className:W(`rounded-md border px-2.5 py-1.5 text-left transition-colors`,i?`border-info bg-bg`:`border-border bg-bg/50 hover:border-border-strong hover:bg-bg`),children:[(0,U.jsx)(`span`,{className:`block text-body-sm font-medium text-fg-1`,children:r.label}),r.description?(0,U.jsx)(`span`,{className:`block text-label text-fg-4`,children:r.description}):null,i&&r.preview?(0,U.jsx)(`pre`,{className:`mt-1.5 max-h-40 overflow-auto rounded-md bg-code-bg px-2.5 py-1.5 font-mono text-label whitespace-pre-wrap text-fg-2`,children:r.preview}):null]},r.label)}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`button`,{type:`button`,onClick:()=>s(t,{otherActive:!n.otherActive}),className:W(`shrink-0 rounded-md border px-2.5 py-1.5 text-body-sm font-medium transition-colors`,n.otherActive?`border-info bg-bg text-fg-1`:`border-border bg-bg/50 text-fg-3 hover:border-border-strong hover:bg-bg`),children:`Other…`}),n.otherActive?(0,U.jsx)(po,{autoFocus:!0,value:n.other,onChange:e=>s(t,{other:e.target.value}),placeholder:`Type your own answer`,className:`flex-1`}):null]})]})]},t)}),(0,U.jsx)(`div`,{children:(0,U.jsx)(ao,{size:`sm`,onClick:()=>{let n={};i.forEach((e,t)=>{n[e.question]=BQ(a[t]??zQ)}),t(e.id,{...e.input,answers:n})},disabled:!l,children:`Answer`})})]}),(0,U.jsx)(ao,{variant:`ghost`,size:`icon-sm`,"aria-label":`Dismiss question`,className:`shrink-0`,onClick:()=>n(e.id,`Question dismissed by user`),children:(0,U.jsx)(By,{className:`size-3.5`})})]})})}function HQ({dashed:e}){return(0,U.jsx)(`div`,{className:W(`term-rule-row`,e&&`term-rule-dashed`),"aria-hidden":!0})}function UQ({children:e}){return(0,U.jsx)(QD,{tone:`faint`,children:e})}function WQ({children:e,className:t}){return(0,U.jsx)(`div`,{className:W(`term-box`,t),children:e})}function GQ({title:e,subject:t}){return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(QD,{tone:`blue`,bold:!0,children:e}),t?(0,U.jsx)(QD,{tone:`dim`,children:t}):null]})}var KQ={check:[`[ ]`,`[✓]`],radio:[`( )`,`(•)`]};function qQ(e){return!(e instanceof HTMLElement)||!(e.tagName===`INPUT`||e.tagName===`TEXTAREA`||e.isContentEditable)?!1:(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement?e.value:e.textContent??``).trim().length>0}function JQ({options:e,focused:t,onFocus:n,onChoose:r,active:i=!0,autoFocus:a=!0,label:o}){let s=(0,v.useRef)([]);(0,v.useEffect)(()=>{i&&(!s.current.some(e=>e!==null&&e===document.activeElement)&&(!a||qQ(document.activeElement))||s.current[t]?.focus())},[i,t,a]);let c=r=>{e.length>0&&n((t+r+e.length)%e.length)};return(0,U.jsx)(`div`,{role:`group`,"aria-label":o,onKeyDown:t=>{if(t.key===`ArrowDown`){c(1),t.preventDefault();return}if(t.key===`ArrowUp`){c(-1),t.preventDefault();return}let i=Number(t.key);Number.isInteger(i)&&i>=1&&i<=Math.min(e.length,9)&&(n(i-1),r(i-1),t.preventDefault())},children:e.map((e,i)=>{let a=i===t;return(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`button`,{ref:e=>{s.current[i]=e},type:`button`,tabIndex:a?0:-1,"aria-pressed":e.checked,onFocus:()=>n(i),onClick:()=>r(i),className:`term-press`,children:(0,U.jsxs)(QD,{columns:5,glyph:`${a?`❯`:` `} ${i+1}.`,glyphTone:a?`fg`:`faint`,tone:e.danger?`red`:e.selected?`green`:`fg`,"data-focused":a?``:void 0,children:[e.checked===void 0?null:(0,U.jsxs)(tO,{tone:e.checked?`green`:`faint`,children:[KQ[e.marker??`check`][+!!e.checked],` `]}),(0,U.jsx)(tO,{bold:a||e.selected,children:e.label})]})}),e.description?(0,U.jsx)(QD,{columns:5,tone:`dim`,children:e.description}):null,e.detail?(0,U.jsx)(`div`,{className:`term-detail`,children:e.detail}):null]},e.key)})})}function YQ({value:e,onChange:t,onSubmit:n,onCancel:r,placeholder:i}){return(0,U.jsx)(QD,{columns:5,glyph:` ›`,glyphTone:`dim`,children:(0,U.jsx)(`input`,{autoFocus:!0,value:e,placeholder:i,onChange:e=>t(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),n()),e.key===`Escape`&&(e.stopPropagation(),r())},className:`term-input`})})}function XQ({tabs:e,active:t,onSelect:n}){return(0,U.jsxs)(QD,{glyph:`←`,glyphTone:`faint`,children:[e.map((e,r)=>(0,U.jsxs)(`button`,{type:`button`,tabIndex:-1,onClick:()=>n(r),className:W(`term-tab`,r===t&&`term-tab-active`),children:[e.glyph,` `,e.label]},e.key)),(0,U.jsx)(tO,{tone:`faint`,children:` →`})]})}var ZQ={maxHeight:`min(24rem, 50vh)`,overflowY:`auto`};function QQ({request:e,onApprove:t,onDeny:n,className:r}){let[i,a]=(0,v.useState)(0),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(``),u=t=>{let r=c.trim();n(e.id,r||void 0,t||void 0),l(``),s(!1)},d=wQ(e),f=d?void 0:aO(e.input),p=d?``:jD(e.input),m=d?`Plan ready for review`:e.displayName??e.title??`Permission needed`,h=f?.path??(p||void 0),g=o?(0,U.jsx)(YQ,{value:c,onChange:l,onSubmit:()=>u(!1),onCancel:()=>s(!1),placeholder:d?`What should change? (optional) — the agent keeps planning and reads this`:`Reason (optional) — the agent reads this and can try something else`}):void 0,_=d?[{key:`allow`,label:`Approve plan`},{key:`deny`,label:`Keep planning — tell it what to change`,detail:g},{key:`stop`,label:`No, and stop the turn`,danger:!0}]:[{key:`allow`,label:`Yes`},{key:`deny`,label:`No, and tell the agent what to do differently`,detail:g},{key:`stop`,label:`No, and stop the turn`,danger:!0}];return(0,U.jsxs)(`div`,{"data-slot":`permission-prompt`,className:r,onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),u(!1))},children:[(0,U.jsx)(HQ,{}),(0,U.jsx)(GQ,{title:m,subject:h}),(0,U.jsx)($D,{}),d?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{style:ZQ,children:(0,U.jsx)(LX,{children:d})}),(0,U.jsx)($D,{}),(0,U.jsx)(HQ,{dashed:!0})]}):f?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(oO,{patch:f}),(0,U.jsx)($D,{}),(0,U.jsx)(HQ,{dashed:!0})]}):e.description?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(QD,{tone:`dim`,children:e.description}),(0,U.jsx)($D,{})]}):null,e.decisionReason?(0,U.jsx)(QD,{tone:`faint`,children:e.decisionReason}):null,(0,U.jsx)(QD,{children:d?`Ready to implement this plan?`:e.title??`Do you want to proceed?`}),(0,U.jsx)(JQ,{label:m,options:_,focused:i,onFocus:a,active:!o,onChoose:n=>{n===0?t(e.id):n===1?s(!0):u(!0)}}),(0,U.jsx)($D,{}),(0,U.jsx)(UQ,{children:`Enter to select · ↑/↓ to navigate · 1–3 to choose · Esc to cancel`})]})}var $Q={labels:[],other:``,otherActive:!1};function e$(e){let t=[...e.labels];return e.otherActive&&e.other.trim()&&t.push(e.other.trim()),t.join(`, `)}function t$({request:e,onAnswer:t,onDismiss:n,className:r}){let i=RQ(e.input),[a,o]=(0,v.useState)(()=>i.map(()=>$Q)),[s,c]=(0,v.useState)(()=>i.map(()=>0)),[l,u]=(0,v.useState)(0),[d,f]=(0,v.useState)(0),p=l>=i.length,m=a[l]??$Q,h=e=>e$(a[e]??$Q)!==``,g=i.every((e,t)=>h(t)),_=(e,t)=>o(n=>n.map((n,r)=>r===e?{...n,...t}:n)),y=(e,t,n)=>{o(r=>r.map((r,i)=>i===e?n?{...r,labels:r.labels.includes(t)?r.labels.filter(e=>e!==t):[...r.labels,t]}:{...r,labels:[t],otherActive:!1}:r))},b=()=>{let n={};i.forEach((e,t)=>{n[e.question]=e$(a[t]??$Q)}),t(e.id,{...e.input,answers:n})},x=()=>n(e.id,`Question dismissed by user`),S=e=>u(t=>Math.min(i.length,Math.max(0,t+e)));return(0,U.jsxs)(`div`,{"data-slot":`question-prompt`,className:r,onKeyDown:e=>{if(e.key===`Escape`){e.preventDefault(),x();return}e.key===`Tab`&&(e.preventDefault(),S(e.shiftKey?-1:1))},children:[(0,U.jsx)(HQ,{}),(0,U.jsx)(XQ,{tabs:[...i.map((e,t)=>({key:`q${t}`,label:e.header||`Question ${t+1}`,glyph:h(t)?`▣`:`▢`})),{key:`submit`,label:`Submit`,glyph:`✓`}],active:l,onSelect:u}),(0,U.jsx)($D,{}),p?(0,U.jsx)(r$,{questions:i,answers:i.map((e,t)=>e$(a[t]??$Q)),complete:g,cursor:d,onCursor:f,onSubmit:b,onCancel:x}):(0,U.jsx)(n$,{question:i[l],selection:m,cursor:s[l]??0,onCursor:e=>c(t=>t.map((t,n)=>n===l?e:t)),onToggle:e=>y(l,e,i[l].multiSelect===!0),onOther:e=>_(l,e),onAdvance:()=>S(1),onDismiss:x},l),(0,U.jsx)($D,{}),(0,U.jsx)(UQ,{children:`Enter to select · ↑/↓ to navigate · Tab to switch questions · Esc to cancel`})]})}function n$({question:e,selection:t,cursor:n,onCursor:r,onToggle:i,onOther:a,onAdvance:o,onDismiss:s}){let c=e.multiSelect===!0,l=[...e.options.map((e,r)=>{let i=t.labels.includes(e.label);return{key:e.label,label:e.label,description:e.description,checked:c?i:void 0,marker:`check`,selected:!c&&i,detail:e.preview&&n===r?(0,U.jsx)(WQ,{children:e.preview.split(`
194
+ `).map((e,t)=>(0,U.jsx)(QD,{columns:0,tone:`dim`,children:e||` `},t))}):void 0}}),{key:`__other`,label:`Other…`,checked:t.otherActive,marker:`check`,detail:t.otherActive?(0,U.jsx)(YQ,{value:t.other,onChange:e=>a({other:e}),onSubmit:o,onCancel:()=>a({otherActive:!1,other:``}),placeholder:`Type your own answer`}):void 0},...c?[{key:`__next`,label:`Submit`}]:[],{key:`__chat`,label:`Chat about this`}];return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(QD,{bold:!0,tone:`bright`,children:e.question}),(0,U.jsx)($D,{}),(0,U.jsx)(JQ,{label:e.question,options:l,focused:n,active:!t.otherActive,onFocus:r,onChoose:n=>{if(n<e.options.length){i(e.options[n].label),c||o();return}if(n===e.options.length){a({otherActive:!t.otherActive});return}if(c&&n===e.options.length+1){o();return}s()}})]})}function r$({questions:e,answers:t,complete:n,cursor:r,onCursor:i,onSubmit:a,onCancel:o}){return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(QD,{bold:!0,tone:`bright`,children:`Review your answers`}),(0,U.jsx)($D,{}),e.map((e,n)=>(0,U.jsxs)(`div`,{children:[(0,U.jsx)(QD,{glyph:`●`,glyphTone:`dim`,children:e.question}),(0,U.jsx)(QD,{indent:1,glyph:`→`,glyphTone:`green`,children:(0,U.jsx)(tO,{tone:t[n]?`green`:`faint`,children:t[n]||`not answered`})})]},n)),(0,U.jsx)($D,{}),(0,U.jsx)(QD,{children:n?`Ready to submit your answers?`:`Some questions are unanswered.`}),(0,U.jsx)(JQ,{label:`Submit answers`,options:[{key:`submit`,label:n?`Submit answers`:`Submit anyway`},{key:`cancel`,label:`Cancel`,danger:!0}],focused:r,onFocus:i,onChoose:e=>e===0?a():o()})]})}function i$({state:e,client:t,sessionId:n,open:r,onOpenChange:i}){let a=e.session,o=e.permissionMode?xQ(e.permissionMode):void 0;return(0,U.jsx)(ix,{open:r,onOpenChange:i,children:(0,U.jsxs)(ax,{children:[(0,U.jsx)(ox,{title:`Session info`,description:a?.title}),(0,U.jsx)(sx,{children:(0,U.jsxs)(`div`,{className:`flex flex-col divide-y divide-border`,children:[(0,U.jsxs)(`div`,{className:`pb-2`,children:[(0,U.jsx)(cx,{label:`Engine`,children:e.engine??`claude`}),a?.profile?(0,U.jsx)(cx,{label:`Profile`,children:a.profile}):null,e.model?(0,U.jsx)(cx,{label:`Model`,mono:!0,children:e.model}):null,o?(0,U.jsx)(cx,{label:`Permission mode`,children:o.label}):null,a?.apiKeySource?(0,U.jsx)(cx,{label:`Credentials`,children:a.apiKeySource}):null]}),(0,U.jsxs)(`div`,{className:`py-2`,children:[e.cwd?(0,U.jsx)(a$,{label:`Working directory`,value:e.cwd}):null,e.sdkSessionId?(0,U.jsx)(a$,{label:`Engine session id`,value:e.sdkSessionId}):null,a?(0,U.jsx)(a$,{label:`Gateway session id`,value:a.id}):null]}),(0,U.jsxs)(`div`,{className:`py-2`,children:[a?.createdAt?(0,U.jsx)(cx,{label:`Started`,children:DD(a.createdAt)}):null,a?.numTurns===void 0?null:(0,U.jsx)(cx,{label:`Turns`,children:a.numTurns}),(0,U.jsx)(cx,{label:`Cost`,mono:!0,children:SD(e.totalCostUsd)})]}),e.capabilities.vfs?(0,U.jsx)(o$,{client:t,sessionId:n,open:r}):null]})})]})})}function a$({label:e,value:t}){return(0,U.jsxs)(`div`,{className:`flex items-start justify-between gap-2 py-1.5`,children:[(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(`div`,{className:`text-label text-fg-3`,children:e}),(0,U.jsx)(`div`,{className:`mt-0.5 font-mono text-label break-all text-fg-1`,children:t})]}),(0,U.jsx)(hS,{value:t,"aria-label":`Copy ${e.toLowerCase()}`})]})}function o$({client:e,sessionId:t,open:n}){let[r,i]=(0,v.useState)(),[a,o]=(0,v.useState)(!1);return(0,v.useEffect)(()=>{if(!n||!t)return;let r=!1;return o(!0),e.listSessionFiles(t).then(e=>{r||i(e)}).catch(()=>{r||i([])}).finally(()=>{r||o(!1)}),()=>{r=!0}},[e,t,n]),(0,U.jsxs)(`div`,{className:`pt-3`,children:[(0,U.jsx)(`h3`,{className:`text-label font-medium text-fg-3`,children:`Files`}),a?(0,U.jsx)(`div`,{className:`py-3 text-center`,children:(0,U.jsx)(gS,{className:`size-4 text-fg-4`})}):r?.length?(0,U.jsx)(`ul`,{className:`mt-1 flex flex-col`,children:r.map(n=>(0,U.jsx)(`li`,{children:(0,U.jsxs)(`a`,{href:t?e.sessionFileUrl(t,n.path):void 0,className:`flex items-center gap-2 rounded-md px-1 py-1.5 hover:bg-surface-hover`,children:[(0,U.jsx)(S_,{className:`size-3.5 shrink-0 text-fg-4`}),(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-label text-fg-1`,children:n.path}),(0,U.jsx)(`span`,{className:`shrink-0 text-label text-fg-4`,children:TD(n.bytes)})]})},n.path))}):(0,U.jsx)(`p`,{className:`py-2 text-body-sm text-fg-4`,children:`Nothing delivered yet.`})]})}var s$={starting:{label:`Starting`,variant:`info`,busy:!0},running:{label:`Running`,variant:`info`,busy:!0},awaiting_approval:{label:`Needs approval`,variant:`warning`,busy:!0},idle:{label:`Idle`,variant:`success`,busy:!1},parked:{label:`Parked`,variant:`accent`,busy:!1},failed:{label:`Failed`,variant:`danger`,busy:!1},closed:{label:`Closed`,variant:`neutral`,busy:!1}};function c$(e=3e4){let[t,n]=(0,v.useState)(()=>Date.now());return(0,v.useEffect)(()=>{let t=setInterval(()=>n(Date.now()),e);return()=>clearInterval(t)},[e]),t}function l$({usage:e}){return(0,U.jsx)(Nx,{content:(0,U.jsxs)(`div`,{className:`flex min-w-44 flex-col gap-1 py-0.5`,children:[e.categories.map(e=>(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`size-2 shrink-0 rounded-full bg-fg-4`,style:ZZ(e.color)?{backgroundColor:e.color}:void 0}),(0,U.jsx)(`span`,{className:`flex-1`,children:e.name}),(0,U.jsx)(`span`,{className:`font-mono text-fg-3`,children:wD(e.tokens)})]},e.name)),(0,U.jsxs)(`div`,{className:`mt-0.5 flex items-center justify-between gap-2 border-t border-border pt-1`,children:[(0,U.jsx)(`span`,{children:`Total`}),(0,U.jsxs)(`span`,{className:`font-mono text-fg-3`,children:[wD(e.totalTokens),` / `,wD(e.maxTokens),` (`,e.percentage.toFixed(0),`%)`]})]})]}),children:(0,U.jsxs)(`span`,{className:W(`inline-flex cursor-default items-center gap-1 font-mono text-label`,$Z(e.percentage)),children:[`Ctx `,wD(e.totalTokens)]})})}function u$({label:e,info:t,now:n}){let r=t.utilization,i=t.resetsAt===void 0?void 0:t.resetsAt*1e3;return(0,U.jsx)(Nx,{content:(0,U.jsxs)(`div`,{className:`flex min-w-36 flex-col gap-1 py-0.5`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,U.jsxs)(`span`,{children:[e,` usage`]}),(0,U.jsx)(`span`,{className:`font-mono text-fg-3`,children:r===void 0?`—`:`${r.toFixed(1)}%`})]}),i===void 0?null:(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,U.jsx)(`span`,{children:`Resets in`}),(0,U.jsx)(`span`,{className:`font-mono text-fg-3`,children:ED(i,n)})]}),t.isUsingOverage?(0,U.jsx)(`div`,{className:`text-warning`,children:`Using overage`}):null,t.status===`rejected`?(0,U.jsx)(`div`,{className:`text-danger`,children:`Limit reached`}):null]}),children:(0,U.jsxs)(`span`,{className:W(`cursor-default font-mono text-label whitespace-nowrap`,t.status===`rejected`?`text-danger`:$Z(r??0)),children:[(0,U.jsx)(xS,{value:r??0,className:`mr-1 inline-block align-middle`}),e,r===void 0?``:` ${r.toFixed(0)}%`,i===void 0?null:(0,U.jsxs)(`span`,{className:`text-fg-4`,children:[` · `,ED(i,n)]})]})})}function d$({onClick:e,hint:t,children:n}){return e?(0,U.jsx)(`button`,{type:`button`,onClick:e,"aria-label":t,className:`rounded-md py-0.5 leading-4 transition-colors outline-none hover:bg-surface-hover focus-visible:bg-surface-hover`,children:n}):(0,U.jsx)(U.Fragment,{children:n})}function f$({state:e,rateLimits:t,connected:n,connection:r,onOpenStatus:i,onOpenContext:a,onOpenUsage:o,controls:s,actions:c,placement:l=`top`,className:u}){let d=s$[e.status],f=c$(),p=t??e.rateLimits,m=p?.five_hour,h=p?.seven_day,g=r??(n===!1?`reconnecting`:`live`),_=vD()===`terminal`;return(0,U.jsxs)(`div`,{"data-slot":`status-bar`,className:W(`flex h-[var(--wd-status-bar-height)] items-baseline gap-2 border-border bg-surface p-1.5`,l===`bottom`?_?void 0:`border-t`:`border-b`,u),children:[(0,U.jsx)(d$,{onClick:i,hint:`Session info`,children:g===`live`?(0,U.jsxs)(so,{variant:d.variant,dot:!d.busy,className:`items-baseline`,children:[d.busy?(0,U.jsx)(gS,{className:`size-3 self-center text-current`}):null,d.label]}):(0,U.jsxs)(so,{variant:g===`offline`?`danger`:`warning`,dot:!1,className:`items-baseline`,children:[g===`offline`?(0,U.jsx)(Ly,{className:`size-3 self-center text-current`}):(0,U.jsx)(Wv,{className:`size-3 animate-spin self-center text-current`}),g===`offline`?`Offline`:`Reconnecting…`]})}),e.capabilities.contextUsage&&e.contextUsage?(0,U.jsx)(d$,{onClick:a,hint:`Context breakdown`,children:(0,U.jsx)(l$,{usage:e.contextUsage})}):null,m||h?(0,U.jsx)(d$,{onClick:o,hint:`Plan usage`,children:(0,U.jsxs)(`span`,{className:`inline-flex items-baseline gap-2`,children:[m?(0,U.jsx)(u$,{label:`Session`,info:m,now:f}):null,h?(0,U.jsx)(u$,{label:`Weekly`,info:h,now:f}):null]})}):null,s?(0,U.jsx)(`span`,{className:`self-center`,children:s}):null,(0,U.jsx)(`span`,{className:`flex-1`}),(0,U.jsx)(`span`,{className:`font-mono text-label text-fg-3`,children:SD(e.totalCostUsd)}),c?(0,U.jsx)(`span`,{className:`self-center`,children:c}):null]})}var p$={damping:.7,stiffness:.05,mass:1.25},m$=70,h$=1e3/60,g$=350,_$=!1;globalThis.document?.addEventListener(`mousedown`,()=>{_$=!0}),globalThis.document?.addEventListener(`mouseup`,()=>{_$=!1}),globalThis.document?.addEventListener(`click`,()=>{_$=!1});var v$=(e={})=>{let[t,n]=(0,v.useState)(!1),[r,i]=(0,v.useState)(e.initial!==!1),[a,o]=(0,v.useState)(!1),s=(0,v.useRef)(null);s.current=e;let c=(0,v.useCallback)(()=>{if(!_$)return!1;let e=window.getSelection();if(!e||!e.rangeCount)return!1;let t=e.getRangeAt(0);return t.commonAncestorContainer.contains(g.current)||g.current?.contains(t.commonAncestorContainer)},[]),l=(0,v.useCallback)(e=>{d.isAtBottom=e,i(e)},[]),u=(0,v.useCallback)(e=>{d.escapedFromLock=e,n(e)},[]),d=(0,v.useMemo)(()=>{let n;return{escapedFromLock:t,isAtBottom:r,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return g.current?.scrollTop??0},set scrollTop(e){if(g.current){let{scrollBehavior:t}=getComputedStyle(g.current);t!==`auto`&&(g.current.style.scrollBehavior=`auto`),g.current.scrollTop=e,d.ignoreScrollToTop=g.current.scrollTop,t!==`auto`&&(g.current.style.scrollBehavior=t)}},get targetScrollTop(){return!g.current||!_.current?0:g.current.scrollHeight-1-g.current.clientHeight},get calculatedTargetScrollTop(){if(!g.current||!_.current)return 0;let{targetScrollTop:t}=this;if(!e.targetScrollTop)return t;if(n?.targetScrollTop===t)return n.calculatedScrollTop;let r=Math.max(Math.min(e.targetScrollTop(t,{scrollElement:g.current,contentElement:_.current}),t),0);return n={targetScrollTop:t,calculatedScrollTop:r},requestAnimationFrame(()=>{n=void 0}),r},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=m$}}},[]),f=(0,v.useCallback)((e={})=>{typeof e==`string`&&(e={animation:e}),e.preserveScrollPosition||l(!0);let t=Date.now()+(Number(e.wait)||0),n=x$(s.current,e.animation),{ignoreEscapes:r=!1}=e,i,a=d.calculatedTargetScrollTop;e.duration instanceof Promise?e.duration.finally(()=>{i=Date.now()}):i=t+(e.duration??0);let o=async()=>{let e=new Promise(requestAnimationFrame).then(()=>{if(!d.isAtBottom)return d.animation=void 0,!1;let{scrollTop:l}=d,u=performance.now(),p=(u-(d.lastTick??u))/h$;if(d.animation||={behavior:n,promise:e,ignoreEscapes:r},d.animation.behavior===n&&(d.lastTick=u),c()||t>Date.now())return o();if(l<Math.min(a,d.calculatedTargetScrollTop)){if(d.animation?.behavior===n){if(n===`instant`)return d.scrollTop=d.calculatedTargetScrollTop,o();d.velocity=(n.damping*d.velocity+n.stiffness*d.scrollDifference)/n.mass,d.accumulated+=d.velocity*p,d.scrollTop+=d.accumulated,d.scrollTop!==l&&(d.accumulated=0)}return o()}return i>Date.now()?(a=d.calculatedTargetScrollTop,o()):(d.animation=void 0,d.scrollTop<d.calculatedTargetScrollTop?f({animation:x$(s.current,s.current.resize),ignoreEscapes:r,duration:Math.max(0,i-Date.now())||void 0}):d.isAtBottom)});return e.then(e=>(requestAnimationFrame(()=>{d.animation||(d.lastTick=void 0,d.velocity=0)}),e))};return e.wait!==!0&&(d.animation=void 0),d.animation?.behavior===n?d.animation.promise:o()},[l,c,d]),p=(0,v.useCallback)(()=>{u(!0),l(!1)},[u,l]),m=(0,v.useCallback)(({target:e})=>{if(e!==g.current)return;let{scrollTop:t,ignoreScrollToTop:n}=d,{lastScrollTop:r=t}=d;d.lastScrollTop=t,d.ignoreScrollToTop=void 0,n&&n>t&&(r=n),o(d.isNearBottom),setTimeout(()=>{if(d.resizeDifference||t===n)return;if(c()){u(!0),l(!1);return}let e=t>r,i=t<r;if(d.animation?.ignoreEscapes){d.scrollTop=r;return}i&&(u(!0),l(!1)),e&&u(!1),!d.escapedFromLock&&d.isNearBottom&&l(!0)},1)},[u,l,c,d]),h=(0,v.useCallback)(({target:e,deltaY:t})=>{let n=e;for(;![`scroll`,`auto`].includes(getComputedStyle(n).overflow);){if(!n.parentElement)return;n=n.parentElement}n===g.current&&t<0&&g.current.scrollHeight>g.current.clientHeight&&!d.animation?.ignoreEscapes&&(u(!0),l(!1))},[u,l,d]),g=y$(e=>{g.current?.removeEventListener(`scroll`,m),g.current?.removeEventListener(`wheel`,h),e?.addEventListener(`scroll`,m,{passive:!0}),e?.addEventListener(`wheel`,h,{passive:!0})},[]),_=y$(e=>{if(d.resizeObserver?.disconnect(),d.resizeObserver=void 0,!e)return;let t;d.resizeObserver=new ResizeObserver(([e])=>{let{height:n}=e.contentRect,r=n-(t??n);if(d.resizeDifference=r,d.scrollTop>d.targetScrollTop&&(d.scrollTop=d.targetScrollTop),o(d.isNearBottom),r>=0){let e=x$(s.current,t?s.current.resize:s.current.initial);f({animation:e,wait:!0,preserveScrollPosition:!0,duration:e===`instant`?void 0:g$})}else d.isNearBottom&&(u(!1),l(!0));t=n,requestAnimationFrame(()=>{setTimeout(()=>{d.resizeDifference===r&&(d.resizeDifference=0)},1)})}),d.resizeObserver?.observe(e)},[]);return{contentRef:_,scrollRef:g,scrollToBottom:f,stopScroll:p,isAtBottom:r||a,isNearBottom:a,escapedFromLock:t,state:d}};function y$(e,t){let n=(0,v.useCallback)(t=>(n.current=t,e(t)),t);return n}var b$=new Map;function x$(...e){let t={...p$},n=!1;for(let r of e){if(r===`instant`){n=!0;continue}typeof r==`object`&&(n=!1,t.damping=r.damping??t.damping,t.stiffness=r.stiffness??t.stiffness,t.mass=r.mass??t.mass)}let r=JSON.stringify(t);return b$.has(r)||b$.set(r,Object.freeze(t)),n?`instant`:b$.get(r)}var S$=(0,v.createContext)(null),C$=typeof window<`u`?v.useLayoutEffect:v.useEffect;function w$({instance:e,children:t,resize:n,initial:r,mass:i,damping:a,stiffness:o,targetScrollTop:s,contextRef:c,...l}){let u=(0,v.useRef)(null),d=v$({mass:i,damping:a,stiffness:o,resize:n,initial:r,targetScrollTop:v.useCallback((e,t)=>(b?.targetScrollTop??s)?.(e,t)??e,[s])}),{scrollRef:f,contentRef:p,scrollToBottom:m,stopScroll:h,isAtBottom:g,escapedFromLock:_,state:y}=e??d,b=(0,v.useMemo)(()=>({scrollToBottom:m,stopScroll:h,scrollRef:f,isAtBottom:g,escapedFromLock:_,contentRef:p,state:y,get targetScrollTop(){return u.current},set targetScrollTop(e){u.current=e}}),[m,g,p,f,h,_,y]);return(0,v.useImperativeHandle)(c,()=>b,[b]),C$(()=>{f.current&&getComputedStyle(f.current).overflow===`visible`&&(f.current.style.overflow=`auto`)},[]),v.createElement(S$.Provider,{value:b},v.createElement(`div`,{...l},typeof t==`function`?t(b):t))}(function(e){function t({children:e,scrollClassName:t,...n}){let r=T$();return v.createElement(`div`,{ref:r.scrollRef,style:{height:`100%`,width:`100%`,scrollbarGutter:`stable both-edges`},className:t},v.createElement(`div`,{...n,ref:r.contentRef},typeof e==`function`?e(r):e))}e.Content=t})(w$||={});function T$(){let e=(0,v.useContext)(S$);if(!e)throw Error(`use-stick-to-bottom component context must be used within a StickToBottom component`);return e}function E$({className:e,children:t,...n}){return(0,U.jsx)(w$,{"data-slot":`conversation`,className:W(`relative flex-1 overflow-y-auto`,e),initial:`instant`,resize:`instant`,role:`log`,...n,children:t})}function D$({className:e,children:t,...n}){return(0,U.jsx)(w$.Content,{"data-slot":`conversation-content`,className:W(`mx-auto flex w-full max-w-[var(--wd-transcript-max-width)] flex-col gap-4 px-4 py-4`,e),...n,children:t})}function O$({className:e}){let{isAtBottom:t,scrollToBottom:n}=T$();return t?null:(0,U.jsx)(ao,{variant:`outline`,size:`icon`,"aria-label":`Scroll to bottom`,"data-slot":`conversation-scroll-button`,className:W(`absolute bottom-4 left-1/2 -translate-x-1/2 rounded-full shadow-(--shadow-md)`,e),onClick:()=>void n(`instant`),children:(0,U.jsx)(Dg,{className:`size-4`})})}function k$({label:e,className:t}){return(0,U.jsxs)(`div`,{"data-slot":`loader`,className:W(`flex items-center gap-2 py-1 text-body-sm text-fg-4`,t),children:[(0,U.jsx)(`span`,{className:`flex items-center gap-1`,children:[0,1,2].map(e=>(0,U.jsx)(`span`,{className:`size-1.5 animate-pulse rounded-full bg-fg-4`,style:{animationDelay:`${e*160}ms`}},e))}),e?(0,U.jsx)(`span`,{children:e}):null]})}function A$({cwd:e,hasCommands:t,hasSkills:n,canBrowseFiles:r,className:i}){let a=[{icon:hv,text:`Tell the agent what to do.`},...t?[{icon:my,text:`Type / for the CLI’s slash commands.`}]:[],...n?[{icon:uy,text:`Type $ to draft a message for one of the agent’s skills.`}]:[],...r?[{icon:jg,text:`Type @ to search this project’s files.`}]:[]];return(0,U.jsxs)(`div`,{className:W(`flex flex-col items-center gap-4 py-10`,i),children:[(0,U.jsx)(`div`,{className:`flex size-12 items-center justify-center rounded-xl bg-surface text-fg-3`,children:(0,U.jsx)(Cy,{className:`size-5`})}),e?(0,U.jsx)(`p`,{className:`max-w-full truncate font-mono text-label text-fg-4`,children:e}):null,(0,U.jsx)(`ul`,{className:`w-full max-w-sm divide-y divide-border overflow-hidden rounded-lg bg-surface`,children:a.map(e=>(0,U.jsxs)(`li`,{className:`flex items-center gap-3 px-3.5 py-2.5`,children:[(0,U.jsx)(e.icon,{className:`size-4 shrink-0 text-fg-4`}),(0,U.jsx)(`span`,{className:`text-body-sm text-fg-3`,children:e.text})]},e.text))})]})}function j$(e,t,n){let r=Array(e);return new Proxy(r,{get(r,i,a){if(typeof i==`string`){let a=i.charCodeAt(0);if(a>=48&&a<=57){let a=+i;if(Number.isInteger(a)&&a>=0&&a<e){let e=r[a];if(!e){let i=t[a*2];e=r[a]={index:a,key:n(a),start:i,size:t[a*2+1],end:i+t[a*2+1],lane:0}}return e}}if(i===`length`)return e}return Reflect.get(r,i,a)}})}function M$(e,t,n){let r=n.initialDeps??[],i,a=!0;function o(){let o=e();return o.length!==r.length||o.some((e,t)=>r[t]!==e)?(r=o,i=t(...o),n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1,i):i}return o.updateDeps=e=>{r=e},o}function N$(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var P$=(e,t)=>Math.abs(e-t)<1.01,F$=(e,t,n)=>{let r;return Object.assign(function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)},{cancel:()=>{e.clearTimeout(r)}})},I$,L$=()=>{if(I$!==void 0)return I$;if(typeof navigator>`u`)return I$=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return I$=!0;let e=navigator.maxTouchPoints;return I$=navigator.platform===`MacIntel`&&e!==void 0&&e>0},R$=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},z$=e=>e,B$=e=>{let t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,r=Array(n);for(let e=0;e<n;e++)r[e]=t+e;return r},V$=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(R$(n)),!r.ResizeObserver)return()=>{};let a=new r.ResizeObserver(t=>{let r=()=>{let e=t[0];if(e?.borderBoxSize){let t=e.borderBoxSize[0];if(t){i({width:t.inlineSize,height:t.blockSize});return}}i(R$(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return a.observe(n,{box:`border-box`}),()=>{a.unobserve(n)}},H$={passive:!0},U$=typeof window>`u`||`onscrollend`in window,W$=(e,t,n)=>{let r=e.scrollElement;if(!r)return;let i=e.targetWindow;if(!i)return;let a=e.options.useScrollendEvent&&U$,o=0,s=a?null:F$(i,()=>t(o,!1),e.options.isScrollingResetDelay),c=e=>()=>{o=n(r),s?.(),t(o,e)},l=c(!0),u=c(!1);return r.addEventListener(`scroll`,l,H$),a&&r.addEventListener(`scrollend`,u,H$),()=>{r.removeEventListener(`scroll`,l),a&&r.removeEventListener(`scrollend`,u),s?.cancel()}},G$=(e,t)=>W$(e,t,t=>{let{horizontal:n,isRtl:r}=e.options;return n?t.scrollLeft*(r&&-1||1):t.scrollTop}),K$=(e,t,n)=>{if(n.options.useCachedMeasurements){let t=n.indexFromElement(e),r=n.options.getItemKey(t);return n.itemSizeCache.get(r)??n.options.estimateSize(t)}if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}if(!t){let t=n.indexFromElement(e),r=n.options.getItemKey(t),i=n.itemSizeCache.get(r);if(i!==void 0)return i}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},q$=(e,{adjustments:t=0,behavior:n},r)=>{var i,a;(a=(i=r.scrollElement)?.scrollTo)==null||a.call(i,{[r.options.horizontal?`left`:`top`]:e+t,behavior:n})},J$=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=(()=>{let e=null,t=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{let t=e.target,n=this.indexFromElement(t);if(!t.isConnected){this.observer.unobserve(t);for(let[e,n]of this.elementsCache)if(n===t){this.elementsCache.delete(e);break}return}this.isIndexInRange(n)&&this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}));return{disconnect:()=>{var n;(n=t())==null||n.disconnect(),e=null},observe:e=>t()?.observe(e,{box:`border-box`}),unobserve:e=>t()?.unobserve(e)}})(),this.range=null,this.setOptions=e=>{let t={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:z$,rangeExtractor:B$,onChange:()=>{},measureElement:K$,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,anchorTo:`start`,followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:`estimate`,useCachedMeasurements:!1};for(let n in e){let r=e[n];r!==void 0&&(t[n]=r)}let n=this.options,r=null,i=null,a=!1;if(n!==void 0&&n.enabled&&t.enabled&&t.anchorTo===`end`&&this.scrollElement!==null){let e=n.count,o=t.count,s=this.getMeasurements(),c=e>0?s[0]?.key??n.getItemKey(0):null,l=e>0?s[e-1]?.key??n.getItemKey(e-1):null;if(o!==e||e>0&&o>0&&(t.getItemKey(0)!==c||t.getItemKey(o-1)!==l)){a=!0;let c=e>0?this.getVirtualItemForOffset(this.getScrollOffset())??s[0]:null;c&&(r=[c.key,this.getScrollOffset()-c.start]);let u=t.followOnAppend===!0?`auto`:t.followOnAppend||null;u&&o>e&&this.isAtEnd(n.scrollEndThreshold)&&(e===0||t.getItemKey(o-1)!==l)&&(i=u)}}this.options=t,a&&(this.pendingMin=0,this.itemSizeCacheVersion++);let o=!1,s=0;if(r&&this.scrollOffset!==null){let[e,t]=r,n=this.getMeasurements(),{count:i,getItemKey:a}=this.options,c=0;for(;c<i&&a(c)!==e;)c++;if(c<i){let e=n[c];if(e){let n=Math.max(0,e.start+t);n!==this.scrollOffset&&(s=n-this.scrollOffset,this.scrollOffset=n,o=!0)}}}(o||i)&&(this.pendingScrollAnchor=[o?r[0]:null,o?r[1]:0,i,s])},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=M$(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.isScrolling=!1,this.scrollDirection=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}if(this.scrollElement=e,this.targetWindow=this.scrollElement&&`ownerDocument`in this.scrollElement?this.scrollElement.ownerDocument.defaultView:this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{if(t&&this._intendedScrollOffset===null&&e===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(e-this._intendedScrollOffset)<1.5&&(e=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;let n=this.getScrollOffset();this.scrollDirection=t?n===e?this.scrollDirection:n<e?`forward`:`backward`:null,this.scrollOffset=e,this.isScrolling=t,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),`addEventListener`in this.scrollElement){let e=this.scrollElement,t=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},n=()=>{this._iosTouching=!1,!(!L$()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};e.addEventListener(`touchstart`,t,H$),e.addEventListener(`touchend`,n,H$),this.unsubs.push(()=>{e.removeEventListener(`touchstart`,t),e.removeEventListener(`touchend`,n),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}let t=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,t&&this.scrollElement&&this.options.enabled){let[e,n,r,i]=t;e!==null&&!r&&(L$()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?i!==0&&(this._iosDeferredAdjustment+=i):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),r&&this.scrollToEnd({behavior:r})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;let e=this.getScrollOffset(),t=this.getMaxScrollOffset();if(e<0||e>t)return;if(this._iosDeferredAdjustment<0&&e>=t-1){this._iosDeferredAdjustment=0;return}let n=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(e,{adjustments:this.scrollAdjustments+=n,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=M$(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(e,t,n,r,i,a,o,s)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s}),{key:!1}),this.isIndexInRange=e=>e>=0&&e<this.options.count,this.getMeasurements=M$(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s},c)=>{let l=this.itemSizeCache;if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let u=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),a===1){let i=e*2,a=this._flatMeasurements;if(!a||a.length<i){let e=new Float64Array(i);a&&u>0&&e.set(a.subarray(0,u*2)),a=e,this._flatMeasurements=a}let o;if(u===0)o=t+n;else{let e=u-1;o=a[e*2]+a[e*2+1]+s}for(let t=u;t<e;t++){let e=r(t),n=l.get(e),i=typeof n==`number`?n:this.options.estimateSize(t);a[t*2]=o,a[t*2+1]=i,o+=i+s}let c=j$(e,a,r);return this.measurementsCache=c,c}let d=this.measurementsCache.slice(0,u),f=Array(a).fill(void 0),p=new Float64Array(a),m=0;for(let e=0;e<u;e++){let t=d[e];t&&(f[t.lane]===void 0&&m++,f[t.lane]=e,p[t.lane]=t.end)}for(let i=u;i<e;i++){let e=r(i),c=this.laneAssignments.get(i),u,h,g=o===`estimate`||l.has(e);if(c!==void 0&&this.options.lanes>1){u=c;let e=f[u],r=e===void 0?void 0:d[e];h=r?r.end+s:t+n}else if(m===a){let e=0,t=p[0],n=f[0];for(let r=1;r<a;r++){let i=p[r];(i<t||i===t&&f[r]<n)&&(e=r,t=i,n=f[r])}u=e,h=t+s,g&&this.laneAssignments.set(i,u)}else u=i%this.options.lanes,h=t+n,g&&this.laneAssignments.set(i,u);let _=l.get(e),v=typeof _==`number`?_:this.options.estimateSize(i),y=h+v;d[i]={index:i,start:h,size:v,end:y,key:e,lane:u},f[u]===void 0&&m++,f[u]=i,p[u]=y}return this.measurementsCache=d,d},{key:!1,debug:()=>this.options.debug}),this.calculateRange=M$(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>e.length===0||t===0?(this.range=null,null):(this.range=Z$(e,t,n,r,r===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=M$(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,r,i)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!this.scrollState||this.scrollState.behavior!==`smooth`)return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e);if(!this.isIndexInRange(t))return;let n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{if(!this.isIndexInRange(e))return;let n,r,i,a=this._flatMeasurements;if(this.options.lanes===1&&a!==null)i=this.options.getItemKey(e),r=a[e*2],n=a[e*2+1];else{let t=this.measurementsCache[e];if(!t)return;i=t.key,r=t.start,n=t.size}let o=this.itemSizeCache.get(i)??n,s=t-o;if(s!==0){let a=this.options.anchorTo===`end`&&this.scrollState?.behavior!==`smooth`&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,c=a?this.getTotalSize():0,l=this.getScrollOffset()+this.scrollAdjustments,u=this.itemSizeCache.has(i)?r+o<=l&&this.scrollDirection!==`backward`:r<l,d=this.scrollState?.behavior!==`smooth`&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?u:this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e]??{index:e,key:i,start:r,size:n,end:r+n,lane:0},s,this));(this.pendingMin===null||e<this.pendingMin)&&(this.pendingMin=e),this.itemSizeCache.set(i,t),this.itemSizeCacheVersion++;let f=!1;a?f=this.applyScrollAdjustment(this.getTotalSize()-c):d&&(f=this.applyScrollAdjustment(s)),this.notify(f)}},this.getVirtualItems=M$(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let n=[];for(let r=0,i=e.length;r<i;r++){let i=t[e[r]];n.push(i)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length===0)return;let n=this._flatMeasurements,r=this.options.lanes===1&&n!=null;return N$(t[Y$(0,t.length-1,r?e=>n[e*2]:e=>N$(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if(`scrollHeight`in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(e=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=e,this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.measurementsCache[e];if(!i)return;if(t===`auto`){if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t]}if(t===`end`&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{this._iosDeferredAdjustment=0;let r=this.getOffsetForAlignment(e,t),i=this.now();this.scrollState={index:null,align:t,behavior:n,startedAt:i,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{this._iosDeferredAdjustment=0,e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r,o=this.now();this.scrollState={index:e,align:a,behavior:n,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getScrollOffset()+e,r=this.now();this.scrollState={index:null,align:`start`,behavior:t,startedAt:r,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:e=`auto`}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:`end`,behavior:e});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:e})},this.getTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1){let n=e.length-1,r=this._flatMeasurements;t=r==null?e[n]?.end??0:r[n*2]+r[n*2+1]}else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let e=[];if(this.itemSizeCache.size===0)return e;let t=this.getMeasurements();for(let n of t)n&&this.itemSizeCache.has(n.key)&&e.push({index:n.index,key:n.key,start:n.start,size:n.size,end:n.end,lane:n.lane});return e},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this._intendedScrollOffset=e+(t??0),this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}applyScrollAdjustment(e,t){return e===0?!1:L$()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?(this._iosDeferredAdjustment+=e,!1):(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=e,behavior:t}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId??=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()})}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let e=this.scrollState.index==null?void 0:this.getOffsetForIndex(this.scrollState.index,this.scrollState.align),t=e?e[0]:this.scrollState.lastTargetOffset,n=t!==this.scrollState.lastTargetOffset;if(!n&&P$(t,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1){this.getScrollOffset()!==t&&this._scrollToOffset(t,{adjustments:void 0,behavior:`auto`}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,n){let e=this.getSize()||600,n=Math.abs(t-this.getScrollOffset()),r=this.scrollState.behavior===`smooth`&&n>e;this.scrollState.lastTargetOffset=t,r||(this.scrollState.behavior=`auto`),this._scrollToOffset(t,{adjustments:void 0,behavior:r?`smooth`:`auto`})}this.scheduleScrollReconcile()}},Y$=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else if(a>r)t=i-1;else return i}return e>0?e-1:0};function X$(e,t,n){let r=0;for(;r<=t;){let i=(r+t)/2|0,a=e[i*2];if(a<n)r=i+1;else if(a>n)t=i-1;else return i}return r>0?r-1:0}function Z$(e,t,n,r,i){let a=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:a};if(r===1&&i!==null){let e=X$(i,a,n),r=e,o=n+t;for(;r<a&&i[r*2]+i[r*2+1]<o;)r++;return{startIndex:e,endIndex:r}}let o=Y$(0,a,t=>e[t].start,n),s=o;if(r===1)for(;s<a&&e[s].end<n+t;)s++;else if(r>1){let i=Array(r).fill(0);for(;s<a&&i.some(e=>e<n+t);){let t=e[s];i[t.lane]=t.end,s++}let c=Array(r).fill(n+t);for(;o>=0&&c.some(e=>e>=n);){let t=e[o];c[t.lane]=t.start,o--}o=Math.max(0,o-o%r),s=Math.min(a,s+(r-1-s%r))}return{startIndex:o,endIndex:s}}var Q$=typeof document<`u`?v.useLayoutEffect:v.useEffect;function $$({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n=`transform`,...r}){let i=v.useReducer(e=>e+1,0)[1],a=v.useRef({enabled:t,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});a.current.enabled=t,a.current.mode=n;let o=e=>{let t=a.current;if(!t.enabled||!t.container)return;let n=e.getTotalSize();if(n!==t.lastSize){t.lastSize=n;let r=e.options.horizontal?`width`:`height`;t.container.style[r]=`${n}px`}},s=e=>{let t=a.current;if(!t.enabled||!t.container)return;o(e);let n=!!e.options.horizontal,r=t.mode===`transform`,i=n?`left`:`top`,s=e.options.scrollMargin,c=e.getVirtualItems();for(let a of c){let o=a.start-s,c=e.elementsCache.get(a.key);c&&t.lastPositions.get(c)!==o&&(t.lastPositions.set(c,o),r?c.style.transform=n?`translate3d(${o}px, 0, 0)`:`translate3d(0, ${o}px, 0)`:c.style[i]=`${o}px`)}},c={...r,onChange:(t,n)=>{var o;let c=a.current,l=!0;if(c.enabled){s(t);let e=t.range,n=c.prevRange;l=!n||n.isScrolling!==t.isScrolling||n.startIndex!==e?.startIndex||n.endIndex!==e?.endIndex,l&&(c.prevRange=e?{startIndex:e.startIndex,endIndex:e.endIndex,isScrolling:t.isScrolling}:null)}l&&(e&&n?(0,td.flushSync)(i):i()),(o=r.onChange)==null||o.call(r,t,n)}},[l]=v.useState(()=>{let e=new J$(c);return Object.assign(e,{containerRef:t=>{let n=a.current;if(n.container=t,n.lastSize=null,t&&n.enabled){let r=e.getTotalSize();n.lastSize=r;let i=e.options.horizontal?`width`:`height`;t.style[i]=`${r}px`}}})});return l.setOptions(c),Q$(()=>l._didMount(),[]),Q$(()=>(o(l),l._willUpdate())),Q$(()=>{s(l)}),l}function e1(e){return $$({observeElementRect:V$,observeElementOffset:G$,scrollToFn:q$,...e})}function t1(e,t,n){return{width:e,ch:t,line:n,cache:new WeakMap}}function n1(e,t){if(!(`item`in e))return O1(e,t).px;let n=t.cache.get(e.item);if(n)return n.px;let r=D1(e.item,t);return t.cache.set(e.item,r),r.px}function r1(e,t){let n=Math.max(1,Math.floor(t.width/t.ch+_1));return(Math.min(g1(e,n).lines,4)+1)*t.line}function i1(e){let t=document.createElement(`span`);t.textContent=`0`.repeat(200),t.style.position=`absolute`,t.style.visibility=`hidden`,t.style.whiteSpace=`pre`,e.appendChild(t);let n=t.getBoundingClientRect().width/200;return t.remove(),n}var a1=new Intl.Segmenter(`en`,{granularity:`grapheme`}),o1=[[4352,4447],[11904,12350],[12353,13311],[13312,19903],[19968,40959],[40960,42191],[44032,55203],[63744,64255],[65072,65103],[65280,65376],[65504,65510],[131072,262141]];function s1(e){return o1.some(([t,n])=>e>=t&&e<=n)}var c1=/\p{Extended_Pictographic}/u;function l1(e){if(c1.test(e)||e.includes(`‍`)||e.includes(`️`))return{w:2,exact:!1};let t=e.codePointAt(0)??0;return s1(t)?{w:2,exact:!1}:t<32?{w:0,exact:!0}:{w:1,exact:!0}}var u1=2,d1=new Set([`-`,`–`,`—`,`?`]),f1=/^[\x20-\x7e]*$/;function p1(e){let t=[],n=0,r=()=>{n>0&&t.push({kind:`word`,w:n,exact:!0}),n=0};for(let i=0;i<e.length;i++){let a=e.charCodeAt(i);if(a===32){r();let e=t[t.length-1];e?.kind===`space`?e.w+=1:t.push({kind:`space`,w:1,exact:!0});continue}if(n+=1,a===45||a===63){let t=e.charCodeAt(i+1);t>=48&&t<=57||r()}}return r(),t}function m1(e){if(f1.test(e))return p1(e);let t=[],n={w:0,exact:!0},r=0,i=()=>{n.w>0&&t.push({kind:`word`,w:n.w,exact:n.exact}),n={w:0,exact:!0}},a=[...a1.segment(e)].map(e=>e.segment);for(let[e,o]of a.entries()){if(o===` `){i();let e=t.at(-1);e?.kind===`space`?e.w+=1:t.push({kind:`space`,w:1,exact:!0}),r+=1;continue}if(o===` `){i();let e=u1-r%u1||u1,n=t.at(-1);n?.kind===`space`?n.w+=e:t.push({kind:`space`,w:e,exact:!0}),r+=e;continue}let{w:s,exact:c}=l1(o);if(s1(o.codePointAt(0)??0)||c1.test(o)){i(),t.push({kind:`word`,w:s,exact:c}),r+=s;continue}n.w+=s,n.exact=n.exact&&c,r+=s,d1.has(o)&&!/^\d/.test(a[e+1]??``)&&i()}return i(),t}function h1(e,t){if(t<=0)return{lines:1,exact:!1};let n=m1(e),r=1,i=0,a=!0;for(let e of n){if(a&&=e.exact,e.kind===`space`){i+=e.w;continue}if(i+e.w<=t){i+=e.w;continue}if(e.w<=t){r+=1,i=e.w;continue}i>0&&(r+=1);let n=Math.ceil(e.w/t);r+=n-1,i=e.w-(n-1)*t}return{lines:r,exact:a}}function g1(e,t){let n=0,r=!0;for(let i of e.split(`
195
+ `)){let e=h1(i,t);n+=Math.max(1,e.lines),r&&=e.exact}return{lines:Math.max(1,n),exact:r}}var _1=1e-4;function v1(e,t){return{px:e.px+t.px,exact:e.exact&&t.exact}}function y1(e,t,{indentCells:n=0,gutterCells:r=2,extraPx:i=0}={}){let a=t.width-i-(n+r)*t.ch,{lines:o,exact:s}=g1(e,Math.floor(a/t.ch+_1));return{px:o*t.line,exact:s}}function b1(e){return e.replace(/!\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/``([^`]+)``/g,`$1`).replace(/`([^`]+)`/g,`$1`).replace(/\*\*([^*]+)\*\*/g,`$1`).replace(/__([^_]+)__/g,`$1`).replace(/\*([^*\s][^*]*)\*/g,`$1`).replace(/(^|\W)_([^_]+)_(?=\W|$)/g,`$1$2`).replace(/\\([\\`*_{}[\]()#+.!-])/g,`$1`)}function x1(e){let t=[],n=[];for(let r of e){let e=/(?:\s{2}|\\)$/.test(r);n.push(b1(r.replace(/(?:\s+|\\)$/,``))),e&&(t.push(n.join(` `)),n=[])}return n.length&&t.push(n.join(` `)),t}function S1(e){let t=e.split(`
196
+ `),n=[],r=0,i=e=>e!==void 0&&e.trim()===``;for(;r<t.length;){let e=t[r];if(e.trim()===``){r+=1;continue}if(e.startsWith("```")){let e=[];for(r+=1;r<t.length&&!t[r].startsWith("```");)e.push(t[r]),r+=1;r+=1,n.push({t:`fence`,code:e.join(`
197
+ `)});continue}let a=/^(#{1,6})\s+(.*)$/.exec(e);if(a){n.push({t:`h`,text:b1(a[2])}),r+=1;continue}if(/^(-{3,}|\*{3,}|_{3,})\s*$/.test(e)){n.push({t:`hr`}),r+=1;continue}if(/^>\s?/.test(e)){let e=[];for(;r<t.length&&/^>\s?/.test(t[r]);)e.push(t[r].replace(/^>\s?/,``)),r+=1;let i=[],a=[];for(let t of e)t.trim()===``?(a.length&&i.push(x1(a)),a=[]):a.push(t);a.length&&i.push(x1(a)),n.push({t:`quote`,paras:i});continue}let o=e=>{let t=/^(\s*)([-*+]|\d+\.)\s+(.*)$/.exec(e);if(t)return{depth:Math.floor(t[1].length/2),ordered:/\d/.test(t[2]),text:t[3]}};if(o(e)){let e=[],a=[],s;for(;r<t.length;){let n=o(t[r]);if(!n){if(i(t[r])&&o(t[r+1]??``)){r+=1;continue}break}if(n.depth===0){if(s!==void 0&&n.ordered!==s)break;s=n.ordered}a[n.depth]=n.ordered?3:2;let c=a.slice(0,n.depth).reduce((e,t)=>e+(t??2),0),l=[n.text];for(r+=1;r<t.length&&t[r].trim()!==``&&!o(t[r]);)l.push(t[r].trimStart()),r+=1;e.push({lines:x1(l),gutter:a[n.depth],indent:c})}n.push({t:`list`,items:e});continue}if(e.trimStart().startsWith(`|`)){let e=0;for(;r<t.length&&t[r].trimStart().startsWith(`|`);)t[r].trim().replace(/^\||\|$/g,``).split(`|`).map(e=>e.trim()).every(e=>/^:?-+:?$/.test(e))||(e+=1),r+=1;n.push({t:`table`,rows:Math.max(1,e)});continue}let s=[e];for(r+=1;r<t.length&&t[r].trim()!==``&&!t[r].startsWith("```")&&!/^(#{1,6})\s+/.test(t[r])&&!/^>\s?/.test(t[r])&&!o(t[r])&&!t[r].trimStart().startsWith(`|`)&&!/^(-{3,}|\*{3,}|_{3,})\s*$/.test(t[r]);)s.push(t[r]),r+=1;n.push({t:`p`,lines:x1(s)})}return n}function C1(e,t,n=0){let r=t.width-n-2*t.ch,i=Math.floor(r/t.ch+_1),a=S1(e),o={px:0,exact:!0};for(let[e,n]of a.entries())switch(e>0&&(o=v1(o,{px:t.line,exact:!0})),n.t){case`p`:for(let e of n.lines){let n=g1(e,i);o=v1(o,{px:n.lines*t.line,exact:n.exact})}break;case`h`:{let e=g1(n.text,i);o=v1(o,{px:e.lines*t.line,exact:e.exact});break}case`fence`:{let e=0,r=!0;for(let a of n.code.split(`
198
+ `)){let n=h1(a,i);e+=Math.max(1,n.lines)*t.line,r&&=n.exact}o=v1(o,{px:Math.max(e,t.line),exact:r});break}case`list`:{let e=0,r=!0;for(let a of n.items)for(let n of a.lines){let o=g1(n,i-a.indent-a.gutter);e+=o.lines*t.line,r&&=o.exact}o=v1(o,{px:e,exact:r});break}case`quote`:{let e=0,r=!0;for(let[a,o]of n.paras.entries()){a>0&&(e+=t.line);for(let n of o){let a=g1(n,i-2);e+=a.lines*t.line,r&&=a.exact}}o=v1(o,{px:e,exact:r});break}case`table`:o=v1(o,{px:n.rows*t.line,exact:!0});break;case`hr`:o=v1(o,{px:t.line,exact:!0})}return{px:Math.max(o.px,t.line),exact:o.exact}}function w1(e,t,n=0){let r=e.hunks.map(e=>{let t=e.newStart,n=e.oldStart;return e.lines.map(e=>{let r=e.startsWith(`+`)?`add`:e.startsWith(`-`)?`remove`:`context`,i=e.slice(1),a=r===`add`?t++:r===`remove`?n++:t;return r===`context`&&(n++,t++),{number:a,text:i}})}),i=e.hunks.some(e=>e.newStart>0),a=i?String(Math.max(...r.flat().map(e=>e.number),1)).length:0,o=i?a+3:2,s={px:0,exact:!0};for(let[e,i]of r.entries()){e>0&&(s=v1(s,{px:t.line,exact:!0}));for(let e of i)s=v1(s,y1(e.text||` `,t,{indentCells:2,gutterCells:o,extraPx:n}))}return e.truncated&&(s=v1(s,{px:t.line,exact:!0})),s}function T1(e,t,n){let r=wZ(e.name,e.input),i=r?r.summary:jD(e.input),a=e.backend&&e.backend!==`server`?` · ${e.backend}`:``,o=y1(`${e.name}(${i})${a}`,t,{gutterCells:2,extraPx:n}),s=e.result?.images;if(s?.length&&(o=v1(o,{px:s.length*12*t.line,exact:!0})),e.patch)return v1(o,w1(e.patch,t,n));if(r){for(let e of r.shown)o=v1(o,y1(TZ(e),t,{indentCells:3,gutterCells:3,extraPx:n}));return r.more&&(o=v1(o,y1(r.more,t,{indentCells:3,gutterCells:3,extraPx:n}))),o}let c=e.result?.text??``;if(!c)return o;let{shown:l,more:u}=KX(c.trimEnd().split(`
199
+ `),e.result?.totalChars);for(let e of l)o=v1(o,y1(e||` `,t,{indentCells:3,gutterCells:3,extraPx:n}));return u&&(o=v1(o,y1(u,t,{indentCells:3,gutterCells:3,extraPx:n}))),o}function E1(e){return`parentToolUseId`in e&&e.parentToolUseId!=null?14:0}function D1(e,t){let n=E1(e);switch(e.kind){case`user`:{let r={px:0,exact:!0};if(e.attachments?.length&&(r=v1(r,y1(e.attachments.map(e=>e.name).join(`, `),t,{extraPx:n}))),e.text)for(let i of e.text.split(`
200
+ `))r=v1(r,y1(i||` `,t,{extraPx:n}));return r}case`assistant_text`:return C1(e.text,t,n);case`thinking`:return y1(e.text,t,{extraPx:n});case`tool_call`:return T1(e,t,n);case`turn_result`:{let r=y1(`${e.isError?e.subtype:`done`} · ${CD(e.durationMs)} · ${SD(e.totalCostUsd)}`,t,{extraPx:n});for(let i of e.errors??[])r=v1(r,y1(i,t,{extraPx:n}));return r}case`notice`:return y1(e.text,t,{extraPx:n});case`file_delivered`:return y1(`${e.path} · ${TD(e.bytes)}`+(e.description?` · ${e.description}`:``),t,{extraPx:n});default:return{px:0,exact:!1}}}function O1(e,t){if(`task`in e)return y1(yZ(e.task,jQ(e)),t);if(`run`in e){let n=e.run.some(e=>e.status===`running`||e.status===`pending`);return y1(cZ(e.run,n),t)}return D1(e.item,t)}function k1(e,t){let n;for(let r of e.marks)(!n||Math.abs(r.y-t)<Math.abs(n.y-t))&&(n=r);return n?.mark}var A1={user:`l`,subagent:`l`,turn:`r`,turnFailed:`r`,toolFailed:`r`,error:`r`,approval:`f`,recap:`f`,bookmark:`f`},j1={approval:7,error:6,turnFailed:5,toolFailed:4,user:3,turn:2,bookmark:1,subagent:1,recap:0},M1={user:`you`,subagent:`sub-agent`,turn:`response · turn end`,turnFailed:`turn failed`,toolFailed:`tool failed`,error:`error`,approval:`pending approval`,recap:`catch-up boundary`,bookmark:`bookmark`},N1=2;function P1(e,t,n){return t>0?e/Math.max(t,n):0}function F1(e){return`${e.isError?e.subtype:`done`} · ${CD(e.durationMs)} · ${SD(e.totalCostUsd)}`}function I1(e){switch(e.kind){case`user`:case`assistant_text`:case`thinking`:case`notice`:return e.text;case`tool_call`:return`${e.name}(${jD(e.input)})`;case`turn_result`:return F1(e);case`file_delivered`:return e.path;default:return``}}function L1(e,t){let{items:n,bookmarks:r,frameParentId:i,recapRow:a,pendingApprovals:o,rowIndexFor:s,offsetOfRow:c,sizeOfRow:l,positionInRow:u,totalSize:d,viewportH:f}=e,p=[],m=new Set;for(let e of n){let t=OQ(e);t!==void 0&&m.add(t)}let h=new Map;n.forEach((e,t)=>{e.kind===`tool_call`&&OQ(e)===i&&h.set(s(t),t)});let g={},_=()=>{let e=g.response??g.turn;e!==void 0&&p.push({kind:g.failed?`turnFailed`:`turn`,itemIndex:e,rowIndex:s(e),turnIndex:g.turn}),g={}};n.forEach((e,t)=>{if(e.kind===`tool_call`&&m.has(e.id)&&p.push({kind:`subagent`,itemIndex:t,rowIndex:s(t)}),e.kind===`user`&&OQ(e)===i)_(),p.push({kind:`user`,itemIndex:t,rowIndex:s(t)});else if(e.kind===`turn_result`)g.turn=t,g.failed=e.isError,_();else if(e.kind===`notice`&&e.level===`error`)p.push({kind:`error`,itemIndex:t,rowIndex:s(t)});else if(e.kind===`tool_call`&&(e.status===`failed`||e.result?.isError===!0)&&h.get(s(t))===t)p.push({kind:`toolFailed`,itemIndex:t,rowIndex:s(t)});else if(e.kind===`assistant_text`&&OQ(e)===i){if(i!==void 0){p.push({kind:`turn`,itemIndex:t,rowIndex:s(t)});return}g.response=t}}),_();for(let e of r)e>=0&&e<n.length&&p.push({kind:`bookmark`,itemIndex:e,rowIndex:s(e)});a&&p.push({kind:`recap`,itemIndex:-1,rowIndex:a.rowIndex});let v=P1(t,d,f),y=new Map;for(let e of p){let n=e.itemIndex>=0?u?.(e.itemIndex):void 0,r=l(e.rowIndex),i=n?N1:Math.max(N1,Math.round(r*v)),a=Math.min(Math.max(0,t-i),Math.round((c(e.rowIndex)+(n?n.ordinal/n.count*r:0))*v)),o=A1[e.kind],s=y.get(o)??[];s.push({mark:e,y:a,h:i}),y.set(o,s)}let b=[];for(let[e,t]of y){t.sort((e,t)=>e.y-t.y);let n=null;for(let{mark:r,y:i,h:a}of t)n&&i<=n.y+n.h+1?(n.h=Math.max(n.h,i+a-n.y),j1[r.kind]>j1[n.kind]&&(n.kind=r.kind),n.marks.push({mark:r,y:i})):(n={lane:e,kind:r.kind,y:i,h:a,marks:[{mark:r,y:i}]},b.push(n))}return o.length>0&&b.push({lane:A1.approval,kind:`approval`,y:Math.max(0,t-N1),h:N1,marks:[]}),b}function R1(e,t,{items:n,pendingApprovals:r,recapRow:i}){let a=e.marks.length>1?` · ${e.marks.length} marks`:``,o=null;if(e.kind===`approval`){let e=r[0];o=e?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{"data-tone":`bright`,children:e.title??`Permission required`}),(0,U.jsx)(`div`,{className:`term-scrub-ex`,"data-tone":`fg`,children:`${e.displayName??e.toolName}(${jD(e.input)})`})]}):null}else if(e.kind===`recap`&&!t)o=(0,U.jsxs)(`div`,{"data-tone":`faint`,children:[`※ `,i?.label]});else if(t){let e=n[t.itemIndex];if(t.kind===`recap`)o=(0,U.jsxs)(`div`,{"data-tone":`faint`,children:[`※ `,i?.label]});else if(t.kind===`turn`||t.kind===`turnFailed`){let r=t.turnIndex===void 0?void 0:n[t.turnIndex];o=(0,U.jsxs)(U.Fragment,{children:[e?.kind===`assistant_text`?(0,U.jsxs)(`div`,{className:`term-scrub-ex`,"data-tone":`fg`,children:[(0,U.jsx)(`span`,{"data-tone":`dim`,children:`● `}),e.text]}):null,r?.kind===`turn_result`?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{"data-tone":r.isError?`red`:`faint`,children:F1(r)}),r.errors?.map((e,t)=>(0,U.jsx)(`div`,{"data-tone":`red`,children:e},t))]}):null]})}else if(e){let n=t.kind===`toolFailed`&&e.kind===`tool_call`?e.result?.text.split(`
201
+ `).find(e=>e.trim()!==``):void 0;o=(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`term-scrub-ex`,"data-tone":t.kind===`error`||t.kind===`toolFailed`?`red`:`fg`,children:[t.kind===`user`?(0,U.jsx)(`span`,{"data-tone":`dim`,children:`❯ `}):null,I1(e)]}),n?(0,U.jsx)(`div`,{className:`term-scrub-ex`,"data-tone":`red`,children:n}):null]})}}return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{"data-tone":`faint`,children:[M1[t?.kind??e.kind],a]}),o]})}function z1(e){let{scrollOffset:t,viewportH:n,totalSize:r,onJumpToRow:i,interactive:a,fontSize:o,lineHeight:s}=e,c=T$(),l=(0,v.useRef)(null),u=(0,v.useRef)(null),[d,f]=(0,v.useState)(0),[p,m]=(0,v.useState)(null),h=(0,v.useRef)(null);(0,v.useEffect)(()=>{let e=l.current;if(!e)return;let t=new ResizeObserver(()=>f(e.clientHeight));return t.observe(e),f(e.clientHeight),()=>t.disconnect()},[]);let[g,_]=(0,v.useState)(t);(0,v.useEffect)(()=>{let e=c.scrollRef.current;if(!e)return;let t=()=>_(e.scrollTop);return e.addEventListener(`scroll`,t,{passive:!0}),_(e.scrollTop),()=>e.removeEventListener(`scroll`,t)},[c.scrollRef]),(0,v.useEffect)(()=>{m(null)},[e.items]),(0,v.useEffect)(()=>{if(!a)return;let e=l.current;if(!e)return;let t=e=>{let t=c.scrollRef.current;t&&(t.scrollTop+=e.deltaY,e.preventDefault())};return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},[a,c.scrollRef]),(0,v.useLayoutEffect)(()=>{let e=u.current;if(!e||!p)return;let t=e.offsetHeight,n=l.current?.clientHeight??0;e.style.top=`${Math.max(4,Math.min(n-t-4,p.y-t/2))}px`},[p]);let y=(0,v.useMemo)(()=>d>0?L1(e,d):[],[e.items,e.bookmarks,e.recapRow,e.pendingApprovals,r,d,n]),b=P1(d,r,n),x=Math.max(2,Math.min(d,Math.round(n*b))),S=Math.max(0,Math.min(d-x,Math.round(g*b))),C=e=>{let t=l.current,n=c.scrollRef.current;if(!t||!n)return;let r=t.getBoundingClientRect();n.scrollTop=Math.min(1,Math.max(0,(e-r.top)/r.height))*n.scrollHeight-n.clientHeight/2},w=e=>e-(l.current?.getBoundingClientRect().top??0),T=(e,t)=>{if(e.kind===`approval`&&e.marks.length===0){c.scrollToBottom();return}let n=k1(e,w(t));n&&i(n.rowIndex)},E=(e,t)=>{let n=w(t),r=k1(e,n);m(t=>t&&t.cluster===e&&t.mark===r?t:{cluster:e,mark:r,y:Math.min(Math.max(n,e.y),e.y+e.h)})},D=Math.max(1,r-n);return(0,U.jsx)(HZ,{fontSize:o,lineHeight:s,className:`term-scrubber`,"data-interactive":a||void 0,...a?{role:`scrollbar`,"aria-orientation":`vertical`,"aria-label":`Transcript overview`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.min(100,Math.max(0,Math.round(g/D*100)))}:{"aria-hidden":!0},children:(0,U.jsxs)(`div`,{ref:l,className:`term-scrubber-body`,...a?{onPointerDown:e=>{c.stopScroll(),h.current={y:e.clientY,moved:!1,target:e.target},e.currentTarget.setPointerCapture(e.pointerId)},onPointerMove:e=>{let t=h.current;t&&(!t.moved&&Math.abs(e.clientY-t.y)<3||(t.moved=!0,m(null),C(e.clientY)))},onPointerUp:e=>{let t=h.current;if(h.current=null,!t||t.moved)return;let n=t.target?.closest?.(`[data-ci]`),r=n?Number(n.dataset.ci):NaN;Number.isInteger(r)&&y[r]?T(y[r],e.clientY):C(e.clientY)}}:null,children:[(0,U.jsx)(`div`,{className:`term-scrub-band`,style:{top:S,height:x}}),y.map((e,t)=>(0,U.jsx)(`div`,{"data-ci":t,className:`term-scrub-mark`,"data-lane":e.lane,"data-kind":e.kind,style:{top:e.y,height:e.h},...a?{onPointerEnter:t=>E(e,t.clientY),onPointerMove:t=>{h.current||E(e,t.clientY)},onPointerLeave:()=>m(null)}:null},t)),p?(0,U.jsx)(`div`,{ref:u,className:`term-scrub-peek`,style:{top:p.y},children:R1(p.cluster,p.mark,e)}):null]})})}function B1(e,t){let n;for(let r of e.marks)(!n||Math.abs(r.y-t)<Math.abs(n.y-t))&&(n=r);return n?.mark}var V1={user:`l`,subagent:`l`,turn:`r`,turnFailed:`r`,toolFailed:`r`,error:`r`,approval:`f`,recap:`f`,bookmark:`f`},H1={approval:7,error:6,turnFailed:5,toolFailed:4,user:3,turn:2,bookmark:1,subagent:1,recap:0},U1={user:`you`,subagent:`sub-agent`,turn:`response · turn end`,turnFailed:`turn failed`,toolFailed:`tool failed`,error:`error`,approval:`pending approval`,recap:`catch-up boundary`,bookmark:`bookmark`};function W1(e){return`${e.isError?e.subtype:`done`} · ${CD(e.durationMs)} · ${SD(e.totalCostUsd)}`}function G1(e){switch(e.kind){case`user`:case`assistant_text`:case`thinking`:case`notice`:return e.text;case`tool_call`:return`${e.name}(${jD(e.input)})`;case`turn_result`:return W1(e);case`file_delivered`:return e.path;default:return``}}function K1(e,{frameParentId:t,bookmarks:n=[],recapItemIndex:r}={}){let i=[],a=new Set;for(let t of e){let e=OQ(t);e!==void 0&&a.add(e)}let o={},s=()=>{let e=o.response??o.turn;e!==void 0&&i.push({kind:o.failed?`turnFailed`:`turn`,itemIndex:e,turnIndex:o.turn}),o={}};e.forEach((e,n)=>{if(e.kind===`tool_call`&&a.has(e.id)&&i.push({kind:`subagent`,itemIndex:n}),e.kind===`user`&&OQ(e)===t)s(),i.push({kind:`user`,itemIndex:n});else if(e.kind===`turn_result`)o.turn=n,o.failed=e.isError,s();else if(e.kind===`notice`&&e.level===`error`)i.push({kind:`error`,itemIndex:n});else if(e.kind===`tool_call`&&OQ(e)===t&&(e.status===`failed`||e.result?.isError===!0))i.push({kind:`toolFailed`,itemIndex:n});else if(e.kind===`assistant_text`&&OQ(e)===t){if(t!==void 0){i.push({kind:`turn`,itemIndex:n});return}o.response=n}}),s();for(let t of n)t>=0&&t<e.length&&i.push({kind:`bookmark`,itemIndex:t});return r!==void 0&&i.push({kind:`recap`,itemIndex:r}),i}function q1(e,t,n){let r=Math.max(1,n),i=Math.max(2,Math.round(t/r)),a=new Map;for(let n of e){let e=Math.min(Math.max(0,t-i),Math.round(n.itemIndex/r*t)),o=V1[n.kind],s=a.get(o)??[];s.push({mark:n,y:e}),a.set(o,s)}let o=[];for(let[e,t]of a){t.sort((e,t)=>e.y-t.y);let n=null;for(let{mark:r,y:a}of t)n&&a<=n.y+n.h+1?(n.h=Math.max(n.h,a+i-n.y),H1[r.kind]>H1[n.kind]&&(n.kind=r.kind),n.marks.push({mark:r,y:a})):(n={lane:e,kind:r.kind,y:a,h:i,marks:[{mark:r,y:a}]},o.push(n))}return o}function J1(e){return{lane:V1.approval,kind:`approval`,y:Math.max(0,e-2),h:2,marks:[]}}function Y1(e,t,n,r){let i=e.marks.length>1?` · ${e.marks.length} marks`:``,a=null;if(e.kind===`approval`){let e=r[0];a=e?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{children:e.title??`Permission required`}),(0,U.jsx)(`div`,{className:`wd-scrub-ex`,"data-tone":`muted`,children:`${e.displayName??e.toolName}(${jD(e.input)})`})]}):null}else if(t&&t.kind!==`recap`){let e=n[t.itemIndex];if(t.kind===`turn`||t.kind===`turnFailed`){let r=t.turnIndex===void 0?void 0:n[t.turnIndex];a=(0,U.jsxs)(U.Fragment,{children:[e?.kind===`assistant_text`?(0,U.jsx)(`div`,{className:`wd-scrub-ex`,children:e.text}):null,r?.kind===`turn_result`?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{"data-tone":r.isError?`danger`:`muted`,children:W1(r)}),r.errors?.map((e,t)=>(0,U.jsx)(`div`,{"data-tone":`danger`,children:e},t))]}):null]})}else if(e){let n=t.kind===`toolFailed`&&e.kind===`tool_call`?e.result?.text.split(`
202
+ `).find(e=>e.trim()!==``):void 0;a=(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`wd-scrub-ex`,"data-tone":t.kind===`error`||t.kind===`toolFailed`?`danger`:void 0,children:[t.kind===`user`?(0,U.jsx)(`span`,{"data-tone":`muted`,children:`❯ `}):null,G1(e)]}),n?(0,U.jsx)(`div`,{className:`wd-scrub-ex`,"data-tone":`danger`,children:n}):null]})}}return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{"data-tone":`muted`,children:[U1[t?.kind??e.kind],i]}),a]})}function X1({items:e,pendingApprovals:t,recapItemIndex:n,bookmarks:r,frameParentId:i,interactive:a=!1,onJumpToItem:o,className:s}){let c=(0,v.useRef)(null),l=(0,v.useRef)(null),[u,d]=(0,v.useState)(0),[f,p]=(0,v.useState)(null);(0,v.useEffect)(()=>{let e=c.current;if(!e)return;let t=new ResizeObserver(()=>d(e.clientHeight));return t.observe(e),d(e.clientHeight),()=>t.disconnect()},[]),(0,v.useEffect)(()=>{p(null)},[e]),(0,v.useLayoutEffect)(()=>{let e=l.current;if(!e||!f)return;let t=e.offsetHeight,n=c.current?.clientHeight??0;e.style.top=`${Math.max(4,Math.min(n-t-4,f.y-t/2))}px`},[f]);let m=(0,v.useMemo)(()=>{if(u<=0)return[];let a=q1(K1(e,{frameParentId:i,bookmarks:r,recapItemIndex:n}),u,e.length);return t.length>0&&a.push(J1(u)),a},[e,i,r,n,t,u]),h=e=>e-(c.current?.getBoundingClientRect().top??0),g=(t,n)=>{if(t.kind===`approval`&&t.marks.length===0){e.length>0&&o?.(e.length-1);return}let r=B1(t,h(n));r&&o?.(r.itemIndex)},_=(e,t)=>{let n=h(t),r=B1(e,n);p(t=>t&&t.cluster===e&&t.mark===r?t:{cluster:e,mark:r,y:Math.min(Math.max(n,e.y),e.y+e.h)})};return(0,U.jsxs)(`div`,{ref:c,className:W(`wd-scrubber`,s),"data-interactive":a||void 0,"aria-hidden":!0,children:[m.map((e,t)=>(0,U.jsx)(`div`,{className:`wd-scrub-mark`,"data-lane":e.lane,"data-kind":e.kind,style:{top:e.y,height:e.h},...a?{onClick:t=>g(e,t.clientY),onPointerEnter:t=>_(e,t.clientY),onPointerMove:t=>_(e,t.clientY),onPointerLeave:()=>p(null)}:null},t)),f?(0,U.jsx)(`div`,{ref:l,className:`wd-scrub-peek`,style:{top:f.y},children:Y1(f.cluster,f.mark,e,t)}):null]})}var Z1=new WeakMap,Q1=new WeakMap;function $1(e){if(e){if(`item`in e)return e.item;if(`run`in e)return e.run[0];if(`task`in e)return e.task}}function e0(e,t){let n=$1(e[t-1]),r=$1(e[t]);return!n||!r||PQ(n,r)}function t0(e){let t=Z1.get(e);if(t)return t;let n=new Map;return e.forEach((e,t)=>{if(`task`in e)for(let r of e.childIndices)n.set(r,t)}),Z1.set(e,n),n}function n0(e,t){let n=t0(e).get(t);if(n!==void 0)return n;let r=0,i=e.length-1,a=0;for(;r<=i;){let n=r+i>>1,o=e[n],s;if(`index`in o)s=o.index;else{let t=e[n+1];s=t&&`index`in t?t.index:2**53-1}s<=t?(`index`in o&&(a=n),r=n+1):i=n-1}return a}function r0(e){let t=Q1.get(e);if(t)return t;let n=new Map;for(let t of e)if(`task`in t){let e=t.childIndices.length;t.childIndices.forEach((t,r)=>n.set(t,{ordinal:r,count:e}))}else if(`run`in t&&t.run.length>1){let e=t.run.length;t.indices.forEach((t,r)=>n.set(t,{ordinal:r,count:e}))}return Q1.set(e,n),n}function i0(e,t){return r0(e).get(t)}function a0(e){let{terminal:t,fontSize:n,lineHeight:r,rowsRef:i}=e,[a,o]=(0,v.useState)(null);return(0,v.useEffect)(()=>{if(!t)return;let e=i.current;if(!e)return;let n,r=()=>{let t=Number.parseFloat(getComputedStyle(e).getPropertyValue(`--term-line`)),n=e.clientWidth,r=i1(e);!t||!n||!r||o(e=>e&&e.width===n&&e.ch===r&&e.line===t?e:t1(n,r,t))},a=new ResizeObserver(()=>{clearTimeout(n),n=setTimeout(r,150)});return a.observe(e),r(),()=>{a.disconnect(),clearTimeout(n)}},[t,n,r,i]),a}var o0=4,s0=50;function c0(e){let{state:t}=e;t.escapedFromLock=!1;let n=e.scrollToBottom({animation:`instant`,ignoreEscapes:!0,duration:750});t.animation={behavior:`instant`,ignoreEscapes:!0,promise:Promise.resolve(n)},t.scrollTop=t.calculatedTargetScrollTop}function l0(e){let{rows:t,terminal:n,stickyPrompt:r,epoch:i,promptRows:a,scrollElement:o,rowsRef:s,virtualizer:c,stick:l,jumpToRecapRef:u,repinRef:d}=e,f=(0,v.useRef)(void 0);(0,v.useEffect)(()=>()=>clearTimeout(f.current),[]);let p=(e,u=`center`)=>{if(e<0||e>=t.length||!o)return;if(l.stopScroll(),clearTimeout(f.current),u===`start`){let l=e=>n&&i&&e>0&&e0(t,e)?i.line:0,u=()=>{let t=(c.measurementsCache[e]?.start??0)+(s.current?s.current.getBoundingClientRect().top-o.getBoundingClientRect().top+o.scrollTop:0)+l(e);return n&&r&&i&&!a.includes(e)&&a.some(t=>t<e)&&(t-=i.line),Math.round(t)},d=e=>{let t=u();o.scrollTo({top:t,behavior:`instant`}),!(e>=o0)&&(f.current=setTimeout(()=>{Math.abs(o.scrollTop-u())>1&&d(e+1)},s0))};d(0);return}let d=t=>{let n=o.querySelector(`[data-index="${e}"]`);if(n){n.scrollIntoView({behavior:`instant`,block:u});return}t>=o0||(c.scrollToIndex(e,{align:u,behavior:`auto`}),f.current=setTimeout(()=>d(t+1),s0))};d(0)};return(0,v.useEffect)(()=>{if(u)return u.current=()=>{p(t.findIndex(e=>e.key===`recap`),`start`)},()=>{u.current=null}}),(0,v.useEffect)(()=>{if(d)return d.current=()=>{clearTimeout(f.current),c0(l)},()=>{d.current=null}}),p}function u0({item:e,fileUrl:t}){switch(e.kind){case`user`:return(0,U.jsx)(OZ,{item:e});case`assistant_text`:return(0,U.jsx)(kZ,{item:e});case`thinking`:return(0,U.jsx)(AZ,{item:e});case`tool_call`:return(0,U.jsx)(MZ,{item:e});case`turn_result`:return(0,U.jsx)(LZ,{item:e});case`notice`:return(0,U.jsx)(RZ,{item:e});case`file_delivered`:return(0,U.jsx)(zZ,{item:e,href:t?.(e.path)});default:return null}}function d0({text:e,terminal:t}){let[n,r]=(0,v.useState)(!1);return t?(0,U.jsx)(`div`,{"data-slot":`brief`,children:(0,U.jsx)(zX,{onPress:()=>r(e=>!e),expanded:n,children:(0,U.jsx)(QD,{glyph:`>`,glyphTone:`blue`,tone:`dim`,children:(0,U.jsx)(`span`,{className:W(`whitespace-pre-wrap`,!n&&`term-brief-clip`),style:n?void 0:{WebkitLineClamp:4},children:e})})})}):(0,U.jsx)(`div`,{"data-slot":`brief`,className:`px-4 py-2 text-body-sm whitespace-pre-wrap text-fg-2`,children:e})}function f0({block:e,fileUrl:t,onOpenSubagent:n}){let[r,i]=(0,v.useState)(!1),a=BX(r),o=(0,v.useMemo)(()=>jQ(e),[e]),s=o.some(e=>e.kind===`user`)?void 0:pZ(e.task),c=_Z(e.task,o),l=vZ(e.task),u=BD(c),d=(0,U.jsxs)(`div`,{ref:a,className:r?`term-open`:void 0,children:[(0,U.jsx)(zX,{onPress:()=>i(e=>!e),expanded:r,children:(0,U.jsx)(QD,{glyph:c?u:`●`,glyphTone:l?`red`:c?`mark`:`dim`,tone:l?`red`:`green`,children:yZ(e.task,o)})}),r?(0,U.jsxs)(`div`,{className:`term-nested`,children:[s?(0,U.jsx)(d0,{text:s,terminal:!0}):null,e.children.map((n,r)=>(0,U.jsxs)(v.Fragment,{children:[r>0&&FQ(e.children[r-1],n)?(0,U.jsx)($D,{}):null,`run`in n?(0,U.jsx)(IZ,{items:n.run}):(0,U.jsx)(u0,{item:n.item,fileUrl:t})]},n.key))]}):null]});return n===void 0?d:(0,U.jsx)(KD,{actions:(0,U.jsx)(XD,{onOpen:()=>n(e.task.id)}),children:d})}function p0({item:e,href:t,className:n}){let r=e.path.split(`/`).pop()||e.path;return(0,U.jsxs)(`div`,{"data-slot":`file-delivered`,className:W(`flex w-full items-center gap-3 rounded-lg border border-border bg-surface px-3 py-2.5`,n),children:[(0,U.jsx)(O_,{className:`size-4 shrink-0 text-fg-3`}),(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(`div`,{className:`truncate font-mono text-body-sm font-medium text-fg-1`,children:r}),(0,U.jsxs)(`div`,{className:`truncate text-label text-fg-4`,children:[TD(e.bytes),e.description?` · ${e.description}`:``]})]}),t?(0,U.jsxs)(`a`,{href:t,download:r,className:W(`flex shrink-0 items-center gap-1.5 rounded-md border border-border px-2.5 py-1.5`,`text-body-sm text-fg-2 transition-colors hover:bg-surface-hover`),children:[(0,U.jsx)(S_,{className:`size-3.5`}),`Download`]}):null]})}function m0({from:e,className:t,children:n,...r}){return(0,U.jsx)(`div`,{"data-slot":`message`,"data-from":e,className:W(`flex w-full flex-col items-start gap-1`,t),...r,children:n})}function h0({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`message-content`,className:W(`min-w-0 text-body-sm leading-6 text-fg-1`,`in-data-[from=user]:max-w-[85%] in-data-[from=user]:rounded-lg in-data-[from=user]:rounded-bl-sm`,`in-data-[from=user]:bg-accent-bg in-data-[from=user]:px-3 in-data-[from=user]:py-2`,`in-data-[from=user]:whitespace-pre-wrap`,`in-data-[from=assistant]:w-full`,e),...t})}function g0({text:e,className:t}){let n=kE(e);if(n.length===0)return(0,U.jsx)(`span`,{className:t,children:e});let r=[],i=0;for(let[t,a]of n.entries())a.start>i&&r.push(e.slice(i,a.start)),r.push((0,U.jsx)(`span`,{className:W(`font-mono`,a.kind===`file`?`text-accent`:`text-info`),children:a.text},`${a.start}-${t}`)),i=a.end;return i<e.length&&r.push(e.slice(i)),(0,U.jsx)(`span`,{className:t,children:r.map((e,t)=>(0,U.jsx)(v.Fragment,{children:e},t))})}function _0({children:e,isStreaming:t=!1,defaultOpen:n,className:r}){let[i,a]=(0,v.useState)(n??t),o=(0,v.useRef)(!1);(0,v.useEffect)(()=>{if(!o.current){if(t)a(!0);else{let e=setTimeout(()=>a(!1),600);return()=>clearTimeout(e)}}},[t]);let s=e.trim()!==``;return!s&&!t?null:(0,U.jsxs)(`div`,{"data-slot":`reasoning`,"data-streaming":t||void 0,className:W(`w-full`,r),children:[(0,U.jsxs)(`button`,{type:`button`,disabled:!s,onClick:()=>{o.current=!0,a(e=>!e)},className:`flex items-center gap-1.5 text-label text-fg-3 transition-colors outline-none disabled:cursor-default hover:text-fg-1 disabled:hover:text-fg-3`,children:[(0,U.jsx)(Bg,{className:`size-3.5`}),(0,U.jsx)(`span`,{children:t?`Thinking…`:`Thought process`}),s?(0,U.jsx)(Qg,{className:W(`size-3.5 transition-transform`,i&&`rotate-180`)}):null]}),i&&s?(0,U.jsx)(`div`,{className:`mt-2 border-l-2 border-border pl-3 text-body-sm text-fg-3 [&_*]:text-fg-3`,children:(0,U.jsx)(TQ,{streaming:t,children:e})}):null]})}var v0=2e3,y0=new Set([`CodexImageGeneration`,`CodexImageView`]);function b0(e){if(!y0.has(e.name))return;let t=e.input,n=t?.savedPath??t?.path;return typeof n==`string`?n:void 0}var x0={running:{label:`Running`,variant:`info`,busy:!0},pending:{label:`Executing`,variant:`info`,busy:!0},deferred:{label:`Deferred`,variant:`accent`,busy:!1},settled:{label:`Done`,variant:`success`,busy:!1},failed:{label:`Error`,variant:`danger`,busy:!1}},S0={ts:`ts`,tsx:`tsx`,js:`js`,jsx:`jsx`,mjs:`js`,cjs:`js`,json:`json`,jsonc:`json`,md:`md`,mdx:`md`,css:`css`,scss:`scss`,html:`html`,xml:`xml`,yml:`yaml`,yaml:`yaml`,toml:`toml`,py:`python`,rb:`ruby`,go:`go`,rs:`rust`,java:`java`,kt:`kotlin`,swift:`swift`,c:`c`,h:`c`,cpp:`cpp`,hpp:`cpp`,cs:`csharp`,php:`php`,sh:`bash`,bash:`bash`,zsh:`bash`,fish:`fish`,sql:`sql`,graphql:`graphql`,dockerfile:`dockerfile`,diff:`diff`,patch:`diff`};function C0(e){if(e.name===`Bash`||e.name===`CodexCommand`)return`bash`;if(e.name===`CodexFileChange`)return`diff`;let t=e.input,n=t?.file_path??t?.path;return typeof n==`string`?S0[n.slice(n.lastIndexOf(`.`)+1).toLowerCase()]:void 0}function w0({item:e,hostImage:t,className:n}){let[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(!1),l=XX(),u=b0(e),d=e.status??(e.result===void 0?`running`:`settled`),f=x0[d],p=d===`failed`||e.result?.isError===!0,m=PD(e.name),h=e.result?.text??``,g=!a&&h.length>v0,_=g?h.slice(0,v0):h,y=e.result?.truncated===!0,b=e.result?.totalChars??h.length,x=r?(0,U.jsxs)(`div`,{className:`flex flex-col gap-2 border-t border-border p-2.5`,children:[(0,U.jsx)(T0,{code:JSON.stringify(e.input,null,2),language:`json`,label:`Parameters`}),e.logs?.length?(0,U.jsx)(T0,{code:e.logs.join(`
203
+ `),label:`Logs`}):null,e.result===void 0?null:(0,U.jsxs)(`div`,{children:[(0,U.jsx)(T0,{code:_||`(empty result)`,language:C0(e),label:p?`Error`:`Result`,className:W(p&&`border-danger/40 [&_pre]:text-danger`)}),s?(0,U.jsxs)(`p`,{className:`mt-1 text-label text-fg-3`,children:[`Fetching `,b.toLocaleString(),` chars…`]}):g||y?(0,U.jsxs)(`button`,{type:`button`,className:`mt-1 text-label text-fg-3 underline-offset-2 hover:underline`,onClick:()=>{o(!0),y&&(c(!0),l(e.id).finally(()=>c(!1)))},children:[`Show all `,b.toLocaleString(),` chars`]}):null]})]}):null,S=u&&t?(0,U.jsx)(D0,{path:u,load:t}):null,C=e.result?.images?.length?(0,U.jsx)(`div`,{className:`flex flex-col gap-2 border-t border-border p-2.5`,children:e.result.images.map(t=>(0,U.jsx)(E0,{toolUseId:e.id,image:t},t.partIndex))}):null;return(0,U.jsxs)(`div`,{"data-slot":`tool-call`,"data-state":d,className:W(`w-full overflow-hidden rounded-lg border border-border bg-surface`,n),children:[(0,U.jsxs)(`button`,{type:`button`,onClick:()=>i(e=>!e),className:W(`flex w-full items-center gap-2 px-3 py-2 text-left transition-colors outline-none`,`hover:bg-surface-hover focus-visible:bg-surface-hover`),children:[(0,U.jsx)(m,{className:`size-3.5 shrink-0 text-fg-3`}),(0,U.jsx)(`span`,{className:`shrink-0 font-mono text-body-sm font-medium text-fg-1`,children:e.name}),e.backend&&e.backend!==`server`?(0,U.jsx)(so,{variant:`neutral`,className:`shrink-0`,children:e.backend}):null,(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-label text-fg-4`,children:jD(e.input)}),(0,U.jsxs)(so,{variant:f.variant,dot:!f.busy,className:`shrink-0 gap-1`,children:[f.busy?(0,U.jsx)(gS,{className:`size-3 text-current`}):null,d===`deferred`?(0,U.jsx)(c_,{className:`size-3 text-current`}):null,f.label]}),(0,U.jsx)(Qg,{className:W(`size-3.5 shrink-0 text-fg-4 transition-transform`,r&&`rotate-180`)})]}),S,C,x]})}function T0({code:e,label:t,className:n}){return(0,U.jsx)(_S,{code:e,label:t,variant:`panel`,className:n})}function E0({toolUseId:e,image:t}){let{src:n,failed:r}=nZ({toolUseId:e,...t});return(0,U.jsx)(`div`,{className:`flex h-60 items-start overflow-hidden rounded-md border border-border bg-surface-hover`,children:n?(0,U.jsx)(`img`,{src:n,alt:HX(t),className:`h-full max-w-full object-contain`}):(0,U.jsx)(`span`,{className:`p-2 text-label text-fg-4`,children:r?UX:HX(t)})})}function D0({path:e,load:t}){let[n,r]=(0,v.useState)();return(0,v.useEffect)(()=>{let n=!1;return r(void 0),t(e).then(e=>{n||r(e)}).catch(()=>{}),()=>{n=!0}},[e,t]),n?(0,U.jsx)(`div`,{className:`border-t border-border p-2.5`,children:(0,U.jsx)(`img`,{src:n,alt:e.split(`/`).pop()??`Generated image`,className:`max-h-96 w-auto max-w-full rounded-md border border-border`})}):null}function O0({item:e}){return(0,U.jsxs)(`div`,{"data-slot":`turn-result`,className:`py-1`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`div`,{className:`h-px flex-1 bg-border`}),(0,U.jsxs)(`span`,{className:W(`font-mono text-label`,e.isError?`text-danger`:`text-fg-4`),children:[e.isError?e.subtype:`turn done`,` · `,CD(e.durationMs),` · `,SD(e.totalCostUsd)]}),(0,U.jsx)(`div`,{className:`h-px flex-1 bg-border`})]}),e.errors?.length?(0,U.jsx)(`ul`,{className:`mt-1 flex flex-col gap-0.5 text-center`,children:e.errors.map((e,t)=>(0,U.jsx)(`li`,{className:`text-label break-words text-danger`,children:e},t))}):null]})}function k0({item:e}){return(0,U.jsx)(`div`,{"data-slot":`notice`,className:W(`rounded-md border px-3 py-2 text-body-sm`,e.level===`error`?`border-transparent bg-danger-bg text-danger`:`border-border bg-surface text-fg-3`),children:e.text})}function A0({item:e,fileUrl:t,attachmentUrl:n,hostImage:r,terminal:i}){if(i)return(0,U.jsx)(u0,{item:e,fileUrl:t});switch(e.kind){case`user`:return(0,U.jsxs)(m0,{from:`user`,children:[e.attachments?.length?(0,U.jsx)(M0,{attachments:e.attachments,attachmentUrl:n}):null,e.text?(0,U.jsx)(h0,{children:(0,U.jsx)(g0,{text:e.text})}):null]});case`assistant_text`:return(0,U.jsx)(m0,{from:`assistant`,children:(0,U.jsx)(h0,{children:(0,U.jsx)(TQ,{streaming:e.streaming,children:e.text})})});case`thinking`:return(0,U.jsx)(_0,{isStreaming:e.id===`streaming-thinking`,children:e.text});case`tool_call`:return(0,U.jsx)(w0,{item:e,hostImage:r});case`turn_result`:return(0,U.jsx)(O0,{item:e});case`notice`:return(0,U.jsx)(k0,{item:e});case`file_delivered`:return(0,U.jsx)(p0,{item:e,href:t?.(e.path)});default:return null}}function j0({line:e,since:t,terminal:n}){let r=t===void 0?void 0:DD(t),i=r?`${e} · last here ${r}`:e;return n?(0,U.jsx)(`div`,{"data-slot":`recap`,children:(0,U.jsxs)(QD,{glyph:`※`,glyphTone:`faint`,tone:`faint`,children:[`recap: `,i]})}):(0,U.jsxs)(`div`,{"data-slot":`recap`,className:`flex items-center gap-2 py-1`,children:[(0,U.jsx)(`div`,{className:`h-px flex-1 bg-border`}),(0,U.jsxs)(`span`,{className:`font-mono text-label text-fg-3`,children:[`※ recap: `,i]}),(0,U.jsx)(`div`,{className:`h-px flex-1 bg-border`})]})}function M0({attachments:e,attachmentUrl:t}){return(0,U.jsx)(`div`,{className:`mb-1 flex flex-wrap justify-start gap-1.5`,children:e.map(e=>{let n=t?.(e.id);return e.mediaType.startsWith(`image/`)&&n?(0,U.jsx)(`img`,{src:n,alt:e.name,className:`size-20 rounded-md border border-border object-cover`},e.id):(0,U.jsx)(`span`,{className:`rounded-full border border-border bg-surface px-2.5 py-1 text-body-xs text-fg-3`,children:e.name},e.id)})})}function N0(e,t){return e!==void 0&&t<e}function P0(e,t){let n=`parentToolUseId`in e?e.parentToolUseId:void 0;return n!=null&&n!==t?`border-l-2 border-border pl-3`:void 0}function F0(e){return e.text||(e.attachments??[]).map(e=>e.name).join(`, `)}function I0({top:e,height:t,gapClass:n,gapPx:r,terminal:i,scrollRoot:a,index:o,measureRef:s,head:c,content:l}){let u=(0,v.useRef)(null),d=(0,v.useRef)(null);return(0,v.useEffect)(()=>{let e=u.current,t=d.current;if(!e||!t||!a)return;let n=()=>{let n=t.getBoundingClientRect().top<a.getBoundingClientRect().top;e.toggleAttribute(`data-stuck`,n)};return n(),a.addEventListener(`scroll`,n,{passive:!0}),()=>a.removeEventListener(`scroll`,n)},[a,e,t,n]),(0,U.jsxs)(`div`,{"data-sticky-lane":i?`terminal`:`cards`,className:`absolute inset-x-0`,style:{top:e,height:t},children:[(0,U.jsx)(`div`,{"data-sticky-headlane":``,"aria-hidden":!0,children:(0,U.jsx)(`div`,{ref:u,"data-sticky-head":``,className:i&&n||void 0,children:c})}),(0,U.jsx)(`div`,{ref:d,"aria-hidden":!0,className:`absolute left-0 w-px`,style:{top:n?i?`var(--term-line)`:r:0,height:1}}),(0,U.jsx)(`div`,{ref:s,"data-index":o,className:n||void 0,children:l})]})}function L0({rows:e,boundary:t,since:n,terminal:r,replaying:i,stickyPrompt:a,frameParentId:o,onOpenSubagent:s,gap:c,fontSize:l,lineHeight:u,items:d,pendingApprovals:f,scrubber:p,bookmarks:m,affordances:h,fileUrl:g,attachmentUrl:_,hostImage:y,jumpToRecapRef:b,repinRef:x,reveal:S}){let C=T$(),[w,T]=(0,v.useState)(null),E=(0,v.useMemo)(()=>e.flatMap((e,t)=>`item`in e&&e.item.kind===`user`&&OQ(e.item)===void 0?[t]:[]),[e]),D=(0,v.useRef)({enabled:!1,promptRows:[]});D.current={enabled:a,promptRows:E},(0,v.useEffect)(()=>{T(C.scrollRef.current)},[C.scrollRef]),(0,v.useEffect)(()=>{if(!w)return;let e=w.clientHeight,t=new ResizeObserver(()=>{let t=w.clientHeight;t!==e&&(e=t,C.state.isAtBottom&&C.scrollToBottom(`instant`))});return t.observe(w),()=>t.disconnect()},[w,C]);let O=(0,v.useRef)(i);(0,v.useLayoutEffect)(()=>{let e=O.current;O.current=i,!(!e||i)&&C.state.isAtBottom&&(C.state.scrollTop=C.state.calculatedTargetScrollTop)},[i,C]);let k=(0,v.useRef)(null),A=a0({terminal:r,fontSize:l,lineHeight:u,rowsRef:k}),j=e1({count:e.length,getScrollElement:()=>(w&&j.scrollElement!==w&&(j.scrollOffset=w.scrollTop),w),estimateSize:t=>{if(r&&A){let n=e[t],r=t>0&&e0(e,t)?A.line:0;return n&&`text`in n&&n.key===`brief`?r1(n.text,A)+r:n&&!(`line`in n)?n1(n,A)+r:A.line+r}return(r?36:100)+c.px},overscan:8,getItemKey:t=>e[t].key,rangeExtractor:(0,v.useCallback)(e=>{let t=new Set(B$(e)),{enabled:n,promptRows:r}=D.current;if(n){let e=j.scrollOffset??0,n=-1;for(let t of r)if((j.measurementsCache[t]?.start??1/0)<=e)n=t;else break;n>=0&&t.add(n)}return[...t].sort((e,t)=>e-t)},[]),useFlushSync:!0});j.shouldAdjustScrollPositionOnItemSizeChange=(e,t,n)=>{if(C.state.isAtBottom)return!1;let r=(n.scrollOffset??0)+n.scrollAdjustments;return n.itemSizeCache.has(e.key)?e.end<=r&&n.scrollDirection!==`backward`:e.start<r},(0,v.useEffect)(()=>{if(!r||!A)return;j.measure();let e=k.current;if(e){j.getTotalSize();for(let t of e.querySelectorAll(`[data-index]`)){let e=Number(t.getAttribute(`data-index`));Number.isInteger(e)&&e>=0&&j.resizeItem(e,t.getBoundingClientRect().height)}}},[r,A,j]);let M=l0({rows:e,terminal:r,stickyPrompt:a,epoch:A,promptRows:E,scrollElement:w,rowsRef:k,virtualizer:j,stick:C,jumpToRecapRef:b,repinRef:x}),N=S?.nonce,P=S?.toolUseId;(0,v.useEffect)(()=>{if(P===void 0)return;let t=d.findIndex(e=>e.kind===`tool_call`&&e.id===P);t<0||M(n0(e,t),`start`)},[N]);let F=WD(h).hover,I=(0,v.useMemo)(()=>{if(!m?.length)return[];let e=new Map(d.map((e,t)=>[e.id,t]));return m.map(t=>e.get(t)).filter(e=>e!==void 0)},[m,d]),L=e.findIndex(e=>e.key===`recap`),ee=L>=0?{rowIndex:L,label:e[L].line}:void 0;(0,v.useEffect)(()=>{if(!(!r||!p||!F||!w))return w.setAttribute(`data-term-scrubber-host`,``),()=>w.removeAttribute(`data-term-scrubber-host`)},[r,p,F,w]);let R=j.measurementsCache;return(0,U.jsxs)(`div`,{ref:k,"data-slot":`transcript-rows`,className:`relative w-full`,style:{height:j.getTotalSize()},children:[j.getVirtualItems().map(i=>{let l=e[i.index],u=i.index>0&&(!r||e0(e,i.index))?c.className:void 0,d=`run`in l?(0,U.jsx)(`div`,{className:W(N0(t,l.index)&&`opacity-45`),children:(0,U.jsx)(IZ,{items:l.run})}):`item`in l?(0,U.jsx)(`div`,{className:W(N0(t,l.index)&&`opacity-45`,P0(l.item,o)),children:(0,U.jsx)(A0,{item:l.item,fileUrl:g,attachmentUrl:_,hostImage:y,terminal:r})}):`text`in l&&l.key===`brief`?(0,U.jsx)(d0,{text:l.text,terminal:r}):`line`in l?(0,U.jsx)(j0,{line:l.line,since:n,terminal:r}):(0,U.jsx)(`div`,{className:W(N0(t,l.index)&&`opacity-45`),children:(0,U.jsx)(f0,{block:l,fileUrl:g,onOpenSubagent:s})});if(a&&`item`in l&&l.item.kind===`user`&&OQ(l.item)===void 0){let e=E.find(e=>e>i.index),t=e===void 0?j.getTotalSize():R[e]?.start??i.start;return(0,U.jsx)(I0,{top:i.start,height:Math.max(t-i.start,0),gapClass:u,gapPx:c.px,terminal:r,scrollRoot:w,index:i.index,measureRef:j.measureElement,head:r?d:F0(l.item),content:d},l.key)}return(0,U.jsx)(`div`,{ref:j.measureElement,"data-index":i.index,className:W(`absolute inset-x-0 top-0`,u),style:{transform:`translateY(${i.start}px)`},children:d},l.key)}),p&&w?.parentElement?(0,td.createPortal)(r?(0,U.jsx)(z1,{items:d,pendingApprovals:f,recapRow:ee,bookmarks:I,frameParentId:o,rowIndexFor:t=>n0(e,t),positionInRow:t=>i0(e,t),offsetOfRow:e=>j.measurementsCache[e]?.start??0,sizeOfRow:e=>j.measurementsCache[e]?.size??0,totalSize:j.getTotalSize(),scrollOffset:j.scrollOffset??0,viewportH:j.scrollRect?.height??0,onJumpToRow:e=>M(e,`start`),interactive:F,fontSize:l,lineHeight:u}):(0,U.jsx)(X1,{items:d,pendingApprovals:f,recapItemIndex:L>=0?t:void 0,bookmarks:I,frameParentId:o,interactive:F,onJumpToItem:t=>M(n0(e,t),`start`)}),w.parentElement):null]})}function R0(e){let t=e===`running`||e===`starting`,[n,r]=(0,v.useState)(void 0);return(0,v.useEffect)(()=>{r(e=>t?e??Date.now():void 0)},[t]),t?n:void 0}function z0(e){if(e.status!==`running`&&e.status!==`starting`)return!1;let t=e.items.at(-1);return t?t.kind===`assistant_text`&&t.streaming||t.kind===`thinking`&&t.id===`streaming-thinking`?!1:t.kind!==`turn_result`||e.status===`running`:!0}function B0({active:e,fontSize:t,lineHeight:n,affordances:r,children:i}){return e?(0,U.jsx)(HZ,{fontSize:t,lineHeight:n,affordances:r,bleed:`1ch`,className:`term-transcript`,children:i}):(0,U.jsx)(U.Fragment,{children:i})}function V0({state:e,fileUrl:t,attachmentUrl:n,canBrowseFiles:r,hostImage:i,variant:a=`cards`,density:o=`comfortable`,fontSize:s,lineHeight:c,affordances:l,stickyPrompt:u=!1,scrubber:d,bookmarks:f,replaying:p=!1,catchUp:m,jumpToRecapRef:h,repinRef:g,reveal:_,frame:y,onOpenSubagent:b,emptyState:x,className:S}){let C=a===`terminal`,w=(0,v.useMemo)(()=>y?kQ(e.items,y.parentToolUseId):e.items,[e.items,y]),T=(0,v.useMemo)(()=>y?e.items.find(e=>e.kind===`tool_call`&&e.id===y.parentToolUseId):void 0,[e.items,y]),E=xD[a][o],D=R0(e.status),O=!y&&m&&m.from>0&&m.from<e.items.length?m.from:void 0,k=(0,v.useMemo)(()=>O===void 0?void 0:mD(pD(e,O)),[e,O]),A=(0,v.useMemo)(()=>y&&T&&!w.some(e=>e.kind===`user`)?pZ(T):void 0,[y,T,w]),j=(0,v.useMemo)(()=>{let e=(e,t)=>NQ(w.slice(e,t),e,C);return O===void 0||!k?[...A?[{key:`brief`,text:A}]:[],...e(0,w.length)]:[...e(0,O),{key:`recap`,line:k},...e(O,w.length)]},[w,O,k,C,A]);return(0,U.jsx)(_D,{value:a,children:(0,U.jsxs)(E$,{className:W(p&&`invisible`,S),children:[(0,U.jsx)(D$,{className:W(C&&`gap-0 p-0`),children:(0,U.jsxs)(B0,{active:C,fontSize:s,lineHeight:c,affordances:l,children:[y?T===void 0&&!p?(0,U.jsx)(`div`,{className:W(C?`term-row text-fg-4`:`p-4 text-body-sm text-fg-4`),children:`This sub-agent's work is not in this transcript.`}):null:w.length===0&&e.status!==`starting`?x===void 0?(0,U.jsx)(A$,{cwd:e.cwd,hasCommands:!!e.commands?.length,hasSkills:!!e.skills?.some(e=>e.enabled),canBrowseFiles:r}):x:null,y&&T===void 0&&!p?null:(0,U.jsx)(L0,{rows:j,boundary:O,since:m?.since,terminal:C,replaying:p,stickyPrompt:!y&&u,gap:E,fontSize:s,lineHeight:c,items:w,pendingApprovals:e.pendingApprovals,scrubber:d,bookmarks:y?void 0:f,affordances:l,fileUrl:t,attachmentUrl:n,hostImage:i,jumpToRecapRef:h,repinRef:g,reveal:y?void 0:_,frameParentId:y?.parentToolUseId,onOpenSubagent:y?void 0:b}),(y?T!==void 0&&_Z(T,w):z0(e))?C?(0,U.jsxs)(U.Fragment,{children:[e.items.length>0?(0,U.jsx)(`div`,{className:`term-blank`,"aria-hidden":!0}):null,(0,U.jsx)(VZ,{label:e.status===`starting`?`Starting…`:`Working…`,startedAt:D,tokens:e.contextUsage?.totalTokens})]}):(0,U.jsx)(k$,{label:e.status===`starting`?`Starting session…`:void 0,startedAt:D,tokens:e.contextUsage?.totalTokens}):null]})}),(0,U.jsx)(O$,{}),p?(0,U.jsx)(`div`,{"data-slot":`transcript-hold`,"aria-hidden":!0,className:`wd-hold-appear visible pointer-events-none absolute inset-0 overflow-hidden`,children:(0,U.jsx)(`div`,{className:W(`mx-auto w-full max-w-[var(--wd-transcript-max-width)]`,!C&&`px-4 py-4`),children:C?(0,U.jsx)(HZ,{fontSize:s,lineHeight:c,affordances:!1,bleed:`1ch`,className:`term-transcript`,children:(0,U.jsx)(VZ,{label:`Loading…`})}):(0,U.jsx)(k$,{label:`Loading session…`})})}):null]})})}function H0(e=!0){let[t,n]=(0,v.useState)(()=>Date.now());return(0,v.useEffect)(()=>{if(!e)return;n(Date.now());let t=setInterval(()=>n(Date.now()),6e4);return()=>clearInterval(t)},[e]),t}function U0({windows:e,now:t,className:n}){let r=H0(t===void 0),i=t??r;return(0,U.jsx)(`div`,{className:W(`flex flex-col gap-5`,n),children:e.map(e=>(0,U.jsx)(W0,{window:e,now:i},e.key))})}function W0({window:e,now:t}){let{key:n,info:r,updatedAt:i,inferredReset:a}=e,o=r.utilization??0,s=r.resetsAt===void 0?void 0:r.resetsAt*1e3,c=kD(n),l=s===void 0?void 0:(s-t)/1e3,u=c!==void 0&&l!==void 0&&l>0&&l<c?(c-l)/c:void 0;return(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,U.jsx)(`span`,{className:`truncate text-body-sm text-fg-1`,children:OD(n)}),(0,U.jsxs)(`span`,{className:W(`shrink-0 font-mono text-body-sm font-medium`,r.status===`rejected`?`text-danger`:`text-fg-1`),children:[o.toFixed(0),`% used`]})]}),(0,U.jsxs)(`div`,{className:`relative mt-2 h-2 rounded-full bg-border`,children:[(0,U.jsx)(`div`,{className:W(`h-full rounded-full`,eQ(o)),style:{width:`${Math.min(100,Math.max(2,o))}%`}}),u===void 0?null:(0,U.jsx)(`span`,{"aria-hidden":!0,title:`Spent evenly, usage would be here by now`,className:`absolute -top-1 h-4 w-0.5 -translate-x-1/2 rounded-full bg-fg-1`,style:{left:`${Math.min(100,Math.max(0,u*100))}%`}})]}),(0,U.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-3 text-label text-fg-4`,children:[s===void 0?null:(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,U.jsx)(qv,{className:`size-3`}),` Resets in `,ED(s,t)]}),r.isUsingOverage?(0,U.jsx)(`span`,{className:`text-warning`,children:`overage`}):null,r.status===`rejected`?(0,U.jsx)(`span`,{className:`text-danger`,children:`limit reached`}):null,a?(0,U.jsx)(`span`,{children:`window reset · nothing reported since`}):null,i&&!a?(0,U.jsx)(`span`,{children:AD(i,t)}):null]})]})}function G0({rateLimits:e,subscriptionType:t,engine:n,totalCostUsd:r,updatedAt:i,open:a,onOpenChange:o,className:s}){let c=H0(a);return(0,U.jsx)(ix,{open:a,onOpenChange:o,children:(0,U.jsxs)(ax,{className:s,children:[(0,U.jsx)(ox,{title:`Usage`,description:n===`claude`?`Claude Code`:n,actions:t?(0,U.jsx)(so,{variant:`accent`,className:`mt-0.5 shrink-0 capitalize`,children:t}):null}),(0,U.jsxs)(sx,{children:[e.length===0?(0,U.jsx)(`p`,{className:`py-6 text-center text-body-sm text-fg-4`,children:n===`claude`?`This session reports no plan windows — API-key sessions have none, and a subscription session reports them once a turn has run.`:`Plan windows are a claude.ai subscription thing; this session runs on the ${n} engine.`}):(0,U.jsx)(U0,{windows:e,now:c}),(0,U.jsxs)(`div`,{className:`mt-5 flex items-baseline justify-between gap-4 border-t border-border pt-3`,children:[(0,U.jsx)(`span`,{className:`text-label text-fg-3`,children:`This session has cost`}),(0,U.jsx)(`span`,{className:`font-mono text-body-sm text-fg-1`,children:SD(r)})]}),i?(0,U.jsxs)(`p`,{className:`mt-2 text-label text-fg-4`,children:[`Updated `,AD(i,c)]}):null]})]})})}function K0({terminal:e,metrics:t,affordances:n,children:r}){return e?(0,U.jsx)(HZ,{fontSize:t?.fontSize,lineHeight:t?.lineHeight,affordances:n,bleed:`1ch`,className:`term-transcript`,children:r}):(0,U.jsx)(`div`,{className:`mx-auto flex w-full max-w-[var(--wd-transcript-max-width)] flex-col gap-2`,children:r})}var q0=[`button`,`a`,`input`,`textarea`,`select`,`summary`,`img`,`[contenteditable="true"]`,`[role="button"]`,`[role="menuitem"]`,`[role="checkbox"]`,`[role="radio"]`,`[role="tab"]`].join(`,`);function J0({client:e,sessionId:t,header:n,panelSurface:r=`internal`,statusSurface:i=`internal`,statusPlacement:a=`top`,onOpenPanel:o,onVitals:s,transcriptVariant:c=`cards`,transcriptDensity:l=`comfortable`,transcriptFont:u=`sans`,affordances:d,terminalMetrics:f,scrubber:p=!1,bookmarks:m,onToggleBookmark:h,reveal:g,openSubagent:_,onSubagentChange:y,stickyPrompt:b=!1,controlsSurface:x=`internal`,onControls:S,focusComposerOnClick:C=!1,unseen:w,readOnly:T=!1,toolHost:E,clientTools:D,cacheTranscript:O,emptyState:k,onLinkClick:A,fontSize:j,className:M}){let N=f?.fontSize??j,P=f?.lineHeight??(j===void 0?void 0:Math.round(18/13*j)),F=r===`external`,I=i===`external`,L=x===`status`&&!I,ee=x===`external`||L,[R,te]=(0,v.useState)(void 0),[z,B]=(0,v.useState)(),{state:V,connection:ne,replaying:H,protocolMismatch:re,models:ie,effectiveModel:ae,handle:oe,send:se,approve:ce,deny:le,interrupt:ue,setModel:de,setPermissionMode:fe,reconnectNow:pe,loadFullResult:me}=aE(e,t,{onProtocolError:te,cacheTranscript:O});(0,v.useEffect)(()=>te(void 0),[t]);let{subagentId:he,enterSubagent:ge,leaveSubagent:_e,returnReveal:ve,frameItems:ye,task:be,fallbackLabel:xe}=IQ({sessionId:t,items:V.items,session:V.session,reveal:g,openSubagent:_,onSubagentChange:y}),[Se,Ce]=(0,v.useState)(!1);(0,v.useEffect)(()=>{Ce(!1)},[t]);let[we]=(0,v.useState)(w),Te=Se?void 0:we,Ee=Te?Math.max(0,V.items.length-Te.itemCount):0,De=(0,v.useCallback)(e=>{F?o?.(e):B(e)},[F,o]);(0,v.useEffect)(()=>{let e=()=>{document.visibilityState===`visible`&&pe()};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[pe]),fD(oe,E===!1?{enabled:!1}:D?{...E,clientTools:{...E?.clientTools,...D}}:E);let Oe=c===`terminal`,ke=V.capabilities,{usage:Ae}=ZE(e,V.session?.profile,{enabled:ke.rateLimits}),je=(0,v.useMemo)(()=>vT({rateLimits:V.rateLimits,updatedAt:V.rateLimitsUpdatedAt},Ae),[V.rateLimits,V.rateLimitsUpdatedAt,Ae]),Me=(0,v.useMemo)(()=>Object.keys(je).length>0?bT(je):void 0,[je]),Ne=(0,v.useMemo)(()=>{let e=Object.values(je).map(e=>e.updatedAt);return e.length>0?Math.max(...e):void 0},[je]),Pe=(0,v.useRef)(s);Pe.current=s;let Fe=ae??V.model,Ie=(0,v.useMemo)(()=>SQ(ke.permissionModes,V.session?.canBypassPermissions),[ke.permissionModes,V.session?.canBypassPermissions]);(0,v.useEffect)(()=>{Pe.current?.({status:V.status,connection:ne,engine:V.engine,capabilities:V.capabilities,model:Fe,models:ie,permissionMode:V.permissionMode,permissionModes:Ie,skills:V.skills,cwd:V.cwd,contextUsage:V.contextUsage,rateLimits:Me,rateLimitsUpdatedAt:Ne,itemCount:V.items.length,totalCostUsd:V.totalCostUsd})},[V.status,ne,V.engine,V.capabilities,Fe,ie,V.permissionMode,Ie,V.skills,V.cwd,V.contextUsage,Me,Ne,V.items.length,V.totalCostUsd]);let Le=(0,v.useRef)(S);Le.current=S;let Re=(0,v.useRef)({setModel:de,setPermissionMode:fe,interrupt:ue});Re.current={setModel:de,setPermissionMode:fe,interrupt:ue};let ze=(0,v.useRef)({setModel:e=>Re.current.setModel(e),setPermissionMode:e=>Re.current.setPermissionMode(e),interrupt:()=>Re.current.interrupt(),focusComposer:()=>Ze.current?.focus(),insertComposerText:e=>Ze.current?.insertText(e)});(0,v.useEffect)(()=>{let e=Le.current;return e?.(ze.current),()=>e?.(void 0)},[t]);let Be=(0,v.useMemo)(()=>new Set(m??[]),[m]),Ve=(0,v.useMemo)(()=>h?{has:e=>Be.has(e),toggle:h}:void 0,[Be,h]),He=V.status===`running`||V.status===`awaiting_approval`,Ue=V.status===`failed`||V.status===`closed`,We=CE(e,t,{capabilities:ke,engine:V.engine}),Ge=UE(e,V.cwd),Ke=XE(e,t),qe=(0,v.useCallback)((e,t)=>Ge.search(e,{...t,limit:8}),[Ge.search]),Je=(0,v.useMemo)(()=>yT(je),[je]),Ye=Y0(e,t,V.producedFiles),Xe=iZ(e,t),Ze=(0,v.useRef)(null),Qe=(0,v.useRef)(null),$e=(0,v.useRef)(null),et=(0,v.useMemo)(()=>{if(V.commands)return V.commands.some(e=>e.name===`model`)?V.commands:[{name:`model`,description:`Switch the model for this session`,argumentHint:`<model>`},...V.commands]},[V.commands]),tt=(e,t)=>{if(t.length===0){let t=/^\/model\s+(\S+)$/.exec(e);if(t){de(t[1]);return}if(ke.mcpStatus&&e.trim()===`/mcp`){De(`mcp`);return}}Ce(!0),$e.current?.(),se(e,t)},nt=(0,U.jsxs)($b,{children:[(0,U.jsx)(ex,{render:(0,U.jsx)(ao,{variant:`ghost`,size:`icon-sm`,"aria-label":`Session actions`,children:(0,U.jsx)(C_,{className:`size-4`})})}),(0,U.jsxs)(tx,{children:[ke.contextUsage?(0,U.jsxs)(nx,{onClick:()=>De(`context`),children:[(0,U.jsx)(Xg,{className:`size-3.5 text-fg-3`}),` Context`]}):null,ke.rateLimits?(0,U.jsxs)(nx,{onClick:()=>De(`usage`),children:[(0,U.jsx)(z_,{className:`size-3.5 text-fg-3`}),` Usage`]}):null,(0,U.jsxs)(nx,{onClick:()=>De(`info`),children:[(0,U.jsx)(Q_,{className:`size-3.5 text-fg-3`}),` Session info`]}),ke.mcpStatus?(0,U.jsxs)(nx,{onClick:()=>De(`mcp`),children:[(0,U.jsx)(Iv,{className:`size-3.5 text-fg-3`}),` MCP servers`]}):null,ke.skillsList?(0,U.jsxs)(nx,{onClick:()=>De(`skills`),children:[(0,U.jsx)(uy,{className:`size-3.5 text-fg-3`}),` Skills`]}):null,Ge.available?(0,U.jsxs)(nx,{onClick:()=>De(`files`),children:[(0,U.jsx)(F_,{className:`size-3.5 text-fg-3`}),` Project files`]}):null]})]}),rt=F?null:nt,it=typeof n==`function`,at=(0,U.jsxs)(U.Fragment,{children:[ie.length?(0,U.jsx)(yQ,{models:ie,model:ae,onModelChange:de,disabled:Ue,className:L?`h-5`:void 0}):null,V.permissionMode?(0,U.jsx)(CQ,{mode:V.permissionMode,onModeChange:fe,modes:ke.permissionModes,canBypass:V.session?.canBypassPermissions,disabled:Ue,className:L?`h-5`:void 0}):null]}),ot=I?null:(0,U.jsx)(f$,{state:V,rateLimits:Me,connection:ne,placement:a,controls:L&&!T?at:void 0,onOpenStatus:F&&!o?void 0:()=>De(`info`),onOpenContext:F&&!o?void 0:()=>De(`context`),onOpenUsage:F&&!o?void 0:()=>De(`usage`),actions:it?void 0:rt}),st=(0,v.useRef)(null);return(0,v.useEffect)(()=>{if(!A)return;let e=st.current;if(!e)return;let t=e=>{let t=e.target?.closest?.(`a[href]`);if(!t)return;let n=t.getAttribute(`href`);n&&A(n)&&(e.preventDefault(),e.stopPropagation())};return e.addEventListener(`click`,t,!0),()=>e.removeEventListener(`click`,t,!0)},[A]),(0,U.jsx)(_D,{value:c,children:(0,U.jsx)(bD,{value:l,children:(0,U.jsx)(YX,{value:me,children:(0,U.jsx)($X,{value:Xe,children:(0,U.jsxs)(`div`,{ref:st,"data-slot":`session-panel`,"data-agent-font":u,onClick:e=>{!C||T||e.target?.closest(q0)||window.getSelection()?.isCollapsed!==!1&&Ze.current?.focus()},className:W(`flex h-full min-h-0 flex-col overflow-hidden bg-bg`,M),style:j===void 0?void 0:{"--wd-font-size":`${Math.round(j)}px`},children:[it?n({actions:rt}):n,a===`top`?ot:null,re===void 0?null:(0,U.jsxs)(Z0,{level:`warning`,children:[`Server speaks protocol v`,re,`, this build renders v`,1,`. Some events may not render.`]}),R?(0,U.jsx)(Z0,{level:`error`,onDismiss:()=>te(void 0),children:R}):null,he===void 0?null:(0,U.jsx)(DQ,{task:be,items:ye,label:xe,onBack:_e,terminal:Oe,fontSize:N,lineHeight:P}),(0,U.jsx)(JD,{value:Ve,children:(0,U.jsx)(V0,{state:V,fileUrl:t?n=>e.sessionFileUrl(t,n):void 0,attachmentUrl:t?n=>e.attachmentUrl(t,n):void 0,canBrowseFiles:Ge.available,hostImage:Ye,variant:c,density:l,fontSize:N,lineHeight:P,affordances:d,stickyPrompt:b,scrubber:p,bookmarks:m,replaying:H,catchUp:Te&&Ee>0?{from:Te.itemCount,since:Te.since}:void 0,reveal:ve??g,frame:he===void 0?void 0:{parentToolUseId:he},onOpenSubagent:ge,emptyState:k,jumpToRecapRef:Qe,repinRef:$e},he??`session`)}),Te&&Ee>0&&!H&&he===void 0?(0,U.jsx)(`div`,{className:`px-3 pb-1`,children:(0,U.jsxs)(`div`,{"data-slot":`catch-up`,className:`mx-auto flex w-full max-w-[var(--wd-transcript-max-width)] items-center gap-2 text-label text-fg-3`,children:[(0,U.jsx)(`span`,{"aria-hidden":!0,className:W(`select-none`,Oe?`text-fg-3`:`text-accent`),children:`※`}),(0,U.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[Ee,` new `,Ee===1?`row`:`rows`,Te.since===void 0?``:` since you were last here`]}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>Qe.current?.(),className:`shrink-0 underline-offset-2 hover:text-fg-1 hover:underline`,children:`jump`}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>Ce(!0),className:`shrink-0 underline-offset-2 hover:text-fg-1 hover:underline`,children:`dismiss`})]})}):null,!T&&ke.interactiveApprovals&&V.pendingApprovals.length>0?(0,U.jsx)(`div`,{className:W(Oe?`pb-2`:`px-3 pb-2`),children:(0,U.jsx)(K0,{terminal:Oe,metrics:{fontSize:N,lineHeight:P},affordances:d,children:V.pendingApprovals.map(e=>{let t=e.toolName===`AskUserQuestion`&&RQ(e.input).length>0;return Oe?t?(0,U.jsx)(t$,{request:e,onAnswer:ce,onDismiss:e=>le(e,`Question dismissed by user`)},e.id):(0,U.jsx)(QQ,{request:e,onApprove:ce,onDeny:le},e.id):t?(0,U.jsx)(VQ,{request:e,onAnswer:ce,onDismiss:e=>le(e,`Question dismissed by user`)},e.id):(0,U.jsx)(EQ,{request:e,onApprove:ce,onDeny:le},e.id)})})}):null,T||he!==void 0?null:(0,U.jsx)(KZ,{ref:Ze,onSend:tt,onInterrupt:ue,busy:He,disabled:Ue||!t,commands:ke.slashCommands?et:void 0,skills:ke.skillsList?V.skills:void 0,attachments:We,draft:Ke,onSearchFiles:Ge.available?qe:void 0,layout:ee?`inline`:`stacked`,toolbar:ee?void 0:at,fontSize:N,lineHeight:P,affordances:d}),a===`bottom`?ot:null,F?null:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(i$,{state:V,client:e,sessionId:t,open:z===`info`,onOpenChange:e=>B(e?`info`:void 0)}),(0,U.jsx)(tQ,{usage:V.contextUsage,open:z===`context`,onOpenChange:e=>B(e?`context`:void 0)}),(0,U.jsx)(G0,{rateLimits:Je,subscriptionType:V.subscriptionType,engine:V.engine??`claude`,totalCostUsd:V.totalCostUsd,updatedAt:Ne,open:z===`usage`,onOpenChange:e=>B(e?`usage`:void 0)}),(0,U.jsx)(aQ,{client:e,sessionId:t,canManageServers:ke.mcpServerActions,open:z===`mcp`,onOpenChange:e=>B(e?`mcp`:void 0)}),(0,U.jsx)(dQ,{skills:V.skills,open:z===`skills`,onOpenChange:e=>B(e?`skills`:void 0),onUse:e=>Ze.current?.insertText(WZ(e))}),(0,U.jsx)(rQ,{client:e,cwd:V.cwd,open:z===`files`,onOpenChange:e=>B(e?`files`:void 0)})]})]})})})})})}function Y0(e,t,n){let r=(0,v.useRef)(new Map),i=(0,v.useRef)([]);return(0,v.useEffect)(()=>()=>{for(let e of i.current)URL.revokeObjectURL(e);i.current=[]},[]),(0,v.useCallback)(a=>{let o=n?.[a],s=o?`produced:${o.fileId}`:`fs:${a}`,c=r.current.get(s);if(c)return c;let l=o&&t?e.readProducedFile(t,o.fileId).then(e=>{if(e.size===0)return;let t=URL.createObjectURL(e);return i.current.push(t),t}).catch(()=>void 0):e.readHostFile(a).then(e=>{if(e.encoding!==`base64`)return;let t=X0[a.slice(a.lastIndexOf(`.`)+1).toLowerCase()];return t?`data:${t};base64,${e.content}`:void 0}).catch(()=>void 0);return r.current.set(s,l),l},[e,t,n])}var X0={png:`image/png`,jpg:`image/jpeg`,jpeg:`image/jpeg`,gif:`image/gif`,webp:`image/webp`};function Z0({level:e,onDismiss:t,children:n}){return(0,U.jsx)(`div`,{className:`px-3 pt-2`,children:(0,U.jsxs)(`div`,{role:`alert`,className:W(`mx-auto flex w-full max-w-[var(--wd-transcript-max-width)] items-start gap-2 rounded-md border px-3 py-2 text-body-sm`,e===`error`?`border-danger/40 bg-danger-bg text-danger`:`border-warning/40 bg-warning-bg text-warning`),children:[(0,U.jsx)(Dy,{className:`mt-0.5 size-3.5 shrink-0`}),(0,U.jsx)(`span`,{className:`min-w-0 flex-1 break-words`,children:n}),t?(0,U.jsx)(`button`,{type:`button`,onClick:t,"aria-label":`Dismiss`,className:`shrink-0 opacity-70 transition-opacity hover:opacity-100`,children:(0,U.jsx)(By,{className:`size-3.5`})}):null]})})}var Q0={anchor:Eg,atom:Mg,beaker:Ng,bike:Fg,binary:Ig,blocks:Lg,bot:Rg,box:zg,brain:Bg,briefcase:Vg,brush:Hg,bug:Ug,"building-2":Wg,cable:Gg,camera:qg,car:Jg,cat:Yg,"circuit-board":o_,cloud:l_,code:u_,coffee:d_,cog:f_,compass:p_,container:m_,cpu:g_,"credit-card":__,database:v_,diamond:y_,dog:b_,feather:T_,film:A_,flame:j_,"flask-conical":M_,folder:I_,"gamepad-2":R_,gauge:z_,gem:B_,ghost:H_,gift:V_,"git-branch":U_,globe:W_,"graduation-cap":G_,hammer:K_,hexagon:J_,house:Y_,image:Z_,key:$_,landmark:ev,laptop:tv,layers:nv,leaf:rv,library:iv,lightbulb:av,lock:uv,mail:dv,map:fv,"message-circle":mv,mic:gv,monitor:_v,moon:vv,mountain:yv,music:bv,network:xv,newspaper:Sv,notebook:Cv,orbit:wv,package:Tv,palette:Ev,"pen-tool":Av,phone:Nv,"piggy-bank":Pv,plane:Fv,plug:Iv,puzzle:Bv,radar:Vv,radio:Hv,receipt:Uv,rocket:Gv,ruler:Yv,satellite:Xv,scale:Qv,scissors:$v,server:ny,shield:ay,ship:oy,"shopping-cart":sy,signal:cy,smartphone:ly,sparkles:uy,sprout:dy,square:gy,star:_y,sun:vy,table:yy,tag:by,target:xy,telescope:Sy,terminal:Cy,"test-tube":wy,"tree-pine":Ey,trophy:Oy,truck:ky,umbrella:Ay,users:My,wallet:Ny,wand:Py,waves:Fy,webhook:Iy,wifi:Ry,wrench:zy,zap:Vy};function $0({icon:e,src:t,name:n,className:r}){if(!e)return null;if(e.type===`image`)return t?(0,U.jsx)(`img`,{src:t,alt:``,"aria-hidden":!0,title:n,className:W(`inline-block size-3 shrink-0 object-contain`,r)}):null;let i=Q0[e.name]??I_;return(0,U.jsx)(i,{className:W(`inline-block size-3 shrink-0`,r)})}function e2({usage:e,size:t=11,className:n}){return e===void 0?null:(0,U.jsx)(`span`,{title:`Context ${e.percentage.toFixed(0)}% · ${wD(e.totalTokens)} / ${wD(e.maxTokens)}`,className:W(`shrink-0 leading-none`,$Z(e.percentage),n),children:(0,U.jsx)(xS,{value:e.percentage,size:t,strokeWidth:2})})}var t2={claude:{title:`Claude`,d:`M4.709 15.955l4.72-2.647.08-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0 11.784l.055-.352.48-.321.686.06 1.52.103 2.278.158 1.652.097 2.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686 1.908 1.476 2.491 1.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97 2.97 0 01-.104-.729L6.283.134 6.696 0l.996.134.42.364.62 1.414 1.002 2.229 1.555 3.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.584.28.48.685-.067.444-.286 1.851-.559 2.903-.364 1.942h.212l.243-.242.985-1.306 1.652-2.064.73-.82.85-.904.547-.431h1.033l.76 1.129-.34 1.166-1.064 1.347-.881 1.142-1.264 1.7-.79 1.36.073.11.188-.02 2.856-.606 1.543-.28 1.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.049.061 1.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093 1.068 2.006 1.81 2.509 2.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649 2.345 3.521.122 1.08-.17.353-.608.213-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674 7.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434 1.967-2.18 2.945-1.726 1.845-.414.164-.717-.37.067-.662.401-.589 2.388-3.036 1.44-1.882.93-1.086-.006-.158h-.055L4.132 18.56l-1.13.146-.487-.456.061-.746.231-.243 1.908-1.312-.006.006z`},codex:{title:`OpenAI`,d:`M9.205 8.658v-2.26c0-.19.072-.333.238-.428l4.543-2.616c.619-.357 1.356-.523 2.117-.523 2.854 0 4.662 2.212 4.662 4.566 0 .167 0 .357-.024.547l-4.71-2.759a.797.797 0 00-.856 0l-5.97 3.473zm10.609 8.8V12.06c0-.333-.143-.57-.429-.737l-5.97-3.473 1.95-1.118a.433.433 0 01.476 0l4.543 2.617c1.309.76 2.189 2.378 2.189 3.948 0 1.808-1.07 3.473-2.76 4.163zM7.802 12.703l-1.95-1.142c-.167-.095-.239-.238-.239-.428V5.899c0-2.545 1.95-4.472 4.591-4.472 1 0 1.927.333 2.712.928L8.23 5.067c-.285.166-.428.404-.428.737v6.898zM12 15.128l-2.795-1.57v-3.33L12 8.658l2.795 1.57v3.33L12 15.128zm1.796 7.23c-1 0-1.927-.332-2.712-.927l4.686-2.712c.285-.166.428-.404.428-.737v-6.898l1.974 1.142c.167.095.238.238.238.428v5.233c0 2.545-1.974 4.472-4.614 4.472zm-5.637-5.303l-4.544-2.617c-1.308-.761-2.188-2.378-2.188-3.948A4.482 4.482 0 014.21 6.327v5.423c0 .333.143.571.428.738l5.947 3.449-1.95 1.118a.432.432 0 01-.476 0zm-.262 3.9c-2.688 0-4.662-2.021-4.662-4.519 0-.19.024-.38.047-.57l4.686 2.71c.286.167.571.167.856 0l5.97-3.448v2.26c0 .19-.07.333-.237.428l-4.543 2.616c-.619.357-1.356.523-2.117.523zm5.899 2.83a5.947 5.947 0 005.827-4.756C22.287 18.339 24 15.84 24 13.296c0-1.665-.713-3.282-1.998-4.448.119-.5.19-.999.19-1.498 0-3.401-2.759-5.947-5.946-5.947-.642 0-1.26.095-1.88.31A5.962 5.962 0 0010.205 0a5.947 5.947 0 00-5.827 4.757C1.713 5.447 0 7.945 0 10.49c0 1.666.713 3.283 1.998 4.448-.119.5-.19 1-.19 1.499 0 3.401 2.759 5.946 5.946 5.946.642 0 1.26-.095 1.88-.309a5.96 5.96 0 004.162 1.713z`},gemini:{title:`Gemini`,d:`M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z`},deepseek:{title:`DeepSeek`,d:`M23.748 4.482c-.254-.124-.364.113-.512.234-.051.039-.094.09-.137.136-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.156-.708-.311-.955-.65-.172-.241-.219-.51-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.093.172.187.129.323-.082.28-.18.552-.266.833-.055.179-.137.217-.329.14a5.526 5.526 0 01-1.736-1.18c-.857-.828-1.631-1.742-2.597-2.458a11.365 11.365 0 00-.689-.471c-.985-.957.13-1.743.388-1.836.27-.098.093-.432-.779-.428-.872.004-1.67.295-2.687.684a3.055 3.055 0 01-.465.137 9.597 9.597 0 00-2.883-.102c-1.885.21-3.39 1.102-4.497 2.623C.082 8.606-.231 10.684.152 12.85c.403 2.284 1.569 4.175 3.36 5.653 1.858 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.133-.284 4.994-1.86.47.234.962.327 1.78.397.63.059 1.236-.03 1.705-.128.735-.156.684-.837.419-.961-2.155-1.004-1.682-.595-2.113-.926 1.096-1.296 2.746-2.642 3.392-7.003.05-.347.007-.565 0-.845-.004-.17.035-.237.23-.256a4.173 4.173 0 001.545-.475c1.396-.763 1.96-2.015 2.093-3.517.02-.23-.004-.467-.247-.588zM11.581 18c-2.089-1.642-3.102-2.183-3.52-2.16-.392.024-.321.471-.235.763.09.288.207.486.371.739.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.167-1.361-.802-2.5-1.86-3.301-3.307-.774-1.393-1.224-2.887-1.298-4.482-.02-.386.093-.522.477-.592a4.696 4.696 0 011.529-.039c2.132.312 3.946 1.265 5.468 2.774.868.86 1.525 1.887 2.202 2.891.72 1.066 1.494 2.082 2.48 2.914.348.292.625.514.891.677-.802.09-2.14.11-3.054-.614zm1-6.44a.306.306 0 01.415-.287.302.302 0 01.2.288.306.306 0 01-.31.307.303.303 0 01-.304-.308zm3.11 1.596c-.2.081-.399.151-.59.16a1.245 1.245 0 01-.798-.254c-.274-.23-.47-.358-.552-.758a1.73 1.73 0 01.016-.588c.07-.327-.008-.537-.239-.727-.187-.156-.426-.199-.688-.199a.559.559 0 01-.254-.078c-.11-.054-.2-.19-.114-.358.028-.054.16-.186.192-.21.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.391.451.462.576.685.914.176.265.336.537.445.848.067.195-.019.354-.25.452z`},moonshot:{title:`Moonshot`,d:`M1.052 16.916l9.539 2.552a21.007 21.007 0 00.06 2.033l5.956 1.593a11.997 11.997 0 01-5.586.865l-.18-.016-.044-.004-.084-.009-.094-.01a11.605 11.605 0 01-.157-.02l-.107-.014-.11-.016a11.962 11.962 0 01-.32-.051l-.042-.008-.075-.013-.107-.02-.07-.015-.093-.019-.075-.016-.095-.02-.097-.023-.094-.022-.068-.017-.088-.022-.09-.024-.095-.025-.082-.023-.109-.03-.062-.02-.084-.025-.093-.028-.105-.034-.058-.019-.08-.026-.09-.031-.066-.024a6.293 6.293 0 01-.044-.015l-.068-.025-.101-.037-.057-.022-.08-.03-.087-.035-.088-.035-.079-.032-.095-.04-.063-.028-.063-.027a5.655 5.655 0 01-.041-.018l-.066-.03-.103-.047-.052-.024-.096-.046-.062-.03-.084-.04-.086-.044-.093-.047-.052-.027-.103-.055-.057-.03-.058-.032a6.49 6.49 0 01-.046-.026l-.094-.053-.06-.034-.051-.03-.072-.041-.082-.05-.093-.056-.052-.032-.084-.053-.061-.039-.079-.05-.07-.047-.053-.035a7.785 7.785 0 01-.054-.036l-.044-.03-.044-.03a6.066 6.066 0 01-.04-.028l-.057-.04-.076-.054-.069-.05-.074-.054-.056-.042-.076-.057-.076-.059-.086-.067-.045-.035-.064-.052-.074-.06-.089-.073-.046-.039-.046-.039a7.516 7.516 0 01-.043-.037l-.045-.04-.061-.053-.07-.062-.068-.06-.062-.058-.067-.062-.053-.05-.088-.084a13.28 13.28 0 01-.099-.097l-.029-.028-.041-.042-.069-.07-.05-.051-.05-.053a6.457 6.457 0 01-.168-.179l-.08-.088-.062-.07-.071-.08-.042-.049-.053-.062-.058-.068-.046-.056a7.175 7.175 0 01-.027-.033l-.045-.055-.066-.082-.041-.052-.05-.064-.02-.025a11.99 11.99 0 01-1.44-2.402zm-1.02-5.794l11.353 3.037a20.468 20.468 0 00-.469 2.011l10.817 2.894a12.076 12.076 0 01-1.845 2.005L.657 15.923l-.016-.046-.035-.104a11.965 11.965 0 01-.05-.153l-.007-.023a11.896 11.896 0 01-.207-.741l-.03-.126-.018-.08-.021-.097-.018-.081-.018-.09-.017-.084-.018-.094c-.026-.141-.05-.283-.071-.426l-.017-.118-.011-.083-.013-.102a12.01 12.01 0 01-.019-.161l-.005-.047a12.12 12.12 0 01-.034-2.145zm1.593-5.15l11.948 3.196c-.368.605-.705 1.231-1.01 1.875l11.295 3.022c-.142.82-.368 1.612-.668 2.365l-11.55-3.09L.124 10.26l.015-.1.008-.049.01-.067.015-.087.018-.098c.026-.148.056-.295.088-.442l.028-.124.02-.085.024-.097c.022-.09.045-.18.07-.268l.028-.102.023-.083.03-.1.025-.082.03-.096.026-.082.031-.095a11.896 11.896 0 011.01-2.232zm4.442-4.4L17.352 4.59a20.77 20.77 0 00-1.688 1.721l7.823 2.093c.267.852.442 1.744.513 2.665L2.106 5.213l.045-.065.027-.04.04-.055.046-.065.055-.076.054-.072.064-.086.05-.065.057-.073.055-.07.06-.074.055-.069.065-.077.054-.066.066-.077.053-.06.072-.082.053-.06.067-.074.054-.058.073-.078.058-.06.063-.067.168-.17.1-.098.059-.056.076-.071a12.084 12.084 0 012.272-1.677zM12.017 0h.097l.082.001.069.001.054.002.068.002.046.001.076.003.047.002.06.003.054.002.087.005.105.007.144.011.088.007.044.004.077.008.082.008.047.005.102.012.05.006.108.014.081.01.042.006.065.01.207.032.07.012.065.011.14.026.092.018.11.022.046.01.075.016.041.01L14.7.3l.042.01.065.015.049.012.071.017.096.024.112.03.113.03.113.032.05.015.07.02.078.024.073.023.05.016.05.016.076.025.099.033.102.036.048.017.064.023.093.034.11.041.116.045.1.04.047.02.06.024.041.018.063.026.04.018.057.025.11.048.1.046.074.035.075.036.06.028.092.046.091.045.102.052.053.028.049.026.046.024.06.033.041.022.052.029.088.05.106.06.087.051.057.034.053.032.096.059.088.055.098.062.036.024.064.041.084.056.04.027.062.042.062.043.023.017c.054.037.108.075.161.114l.083.06.065.048.056.043.086.065.082.064.04.03.05.041.086.069.079.065.085.071c.712.6 1.353 1.283 1.909 2.031L7.222.994l.062-.027.065-.028.081-.034.086-.035c.113-.045.227-.09.341-.131l.096-.035.093-.033.084-.03.096-.031c.087-.03.176-.058.264-.085l.091-.027.086-.025.102-.03.085-.023.1-.026L9.04.37l.09-.023.091-.022.095-.022.09-.02.098-.021.091-.02.095-.018.092-.018.1-.018.091-.016.098-.017.092-.014.097-.015.092-.013.102-.013.091-.012.105-.012.09-.01.105-.01c.093-.01.186-.018.28-.024l.106-.008.09-.005.11-.006.093-.004.1-.004.097-.002.099-.002.197-.002z`}};function n2(e,t){if(e===`claude`)return`claude`;if(e===`codex`)return`codex`;let n=t?.toLowerCase()??``;if(n){if(n.includes(`gemini`))return`gemini`;if(n.includes(`deepseek`))return`deepseek`;if(n.includes(`moonshot`)||n.includes(`kimi`))return`moonshot`;if(n.includes(`claude`))return`claude`;if(n.startsWith(`gpt`)||n.startsWith(`o1`)||n.startsWith(`o3`)||n.includes(`openai`))return`codex`}}var r2={claude:`text-vendor-claude`,codex:`text-vendor-openai`},i2={claude:`text-vendor-claude`};function a2(e,t){return r2[n2(e,t)??``]??`text-fg-3`}function o2(e,t){return i2[n2(e,t)??``]??`text-fg-3`}function s2({engine:e,model:t,className:n}){let r=t2[n2(e,t)??``];return r?(0,U.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,fillRule:`evenodd`,role:`img`,"aria-label":r.title,className:W(`size-3 shrink-0 text-fg-3`,n),children:[(0,U.jsx)(`title`,{children:r.title}),(0,U.jsx)(`path`,{d:r.d})]}):(0,U.jsx)(`span`,{"aria-hidden":!0,title:e,className:W(`shrink-0 text-fg-3`,n),children:`·`})}function c2({row:e,className:t}){let{info:n}=e,r=W(`size-4 shrink-0`,t);if(e.state===`attention`)return(0,U.jsx)(Pg,{className:W(r,`animate-pulse text-warning`)});if(e.state===`working`)return(0,U.jsx)(gS,{className:W(r,`text-info`)});switch(n.status){case`failed`:return(0,U.jsx)(n_,{className:W(r,`text-danger`)});case`closed`:return(0,U.jsx)(a_,{className:W(r,`text-fg-4`)});case`parked`:return(0,U.jsx)(i_,{className:W(r,`text-fg-3`)});default:return(0,U.jsx)(vv,{className:W(r,`text-fg-4`)})}}function l2(e,t){let n=(e.subagents??[]).map(e=>{let n=qw(e)?`agent`:`task`;return{key:e.toolUseId,label:Jw(e),noun:`agent`,kind:n,state:u2(e.status),detail:e.toolCount>0?String(e.toolCount):void 0,title:`${Jw(e)} · ${e.toolCount} tool${e.toolCount===1?``:`s`}`,onSelect:()=>t(e.toolUseId,n)}});return[...n.filter(e=>e.kind===`agent`),...n.filter(e=>e.kind===`task`)]}function u2(e){switch(e){case`running`:return`running`;case`failed`:return`failed`;default:return`done`}}function d2(e){return e.filter(e=>e.state===`running`).length}function f2({expanded:e,running:t,total:n,noun:r,onToggle:i}){let a=t>0&&t<n?`${t}/${n}`:String(n),o=t>0&&t<n?`${t} of ${n} ${r}s running`:`${n} ${r}${n===1?``:`s`}`,s=e?Qg:e_;return(0,U.jsxs)(`button`,{type:`button`,"aria-expanded":e,"aria-label":`${e?`Hide`:`Show`} ${o}`,title:`${e?`Hide`:`Show`} ${o}`,onClick:e=>{e.stopPropagation(),i()},className:W(`flex shrink-0 items-center gap-0.5 rounded-[4px] py-0.5 pr-1 pl-0.5 outline-none`,`text-[0.75rem] leading-3 hover:bg-row-hover hover:text-fg-2`,t>0?`text-info`:`text-fg-4`),children:[(0,U.jsx)(s,{className:`size-3`}),(0,U.jsx)(`span`,{className:`tabular-nums`,children:a})]})}function p2({step:e,active:t=!1,onSelect:n}){let r=e.kind===`agent`,i=t&&r,a=e.state===`failed`?`text-danger`:r?`text-success`:`text-fg-4`;return(0,U.jsxs)(`button`,{type:`button`,title:e.title,"aria-current":i||void 0,onClick:e=>{e.stopPropagation(),n()},className:W(`flex w-full items-center gap-1.5 rounded-[4px] py-1 pr-2.5 pl-3.5`,`text-left text-micro outline-none`,i?`bg-row-selected`:`hover:bg-row-active`,a),children:[(0,U.jsx)(m2,{state:e.state,kind:e.kind}),(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label}),e.detail?(0,U.jsx)(`span`,{className:`shrink-0 tabular-nums text-fg-4`,children:e.detail}):null,r?(0,U.jsx)(kg,{className:`size-3.5 shrink-0 text-fg-4`}):null]})}function m2({state:e,kind:t}){if(t===`task`&&e!==`running`&&e!==`failed`)return(0,U.jsx)(x_,{className:`size-[11px] shrink-0`});switch(e){case`running`:return(0,U.jsx)(gS,{className:`size-[11px] shrink-0`});case`failed`:return(0,U.jsx)(n_,{className:`size-[11px] shrink-0`});case`pending`:return(0,U.jsx)(i_,{className:`size-[11px] shrink-0`});default:return(0,U.jsx)(Zg,{className:`size-[11px] shrink-0`})}}function h2({row:e,active:t=!1,activeStepKey:n,showGateway:r,showProject:i=!0,projectIcons:a,expanded:o,onExpandedChange:s,onSelect:c,onSelectSubagent:l,onRevealStep:u,onRename:d,renameOn:f=`doubleClick`,editing:p,onEditingChange:m,actions:h,className:g}){let{info:_}=e,[y,b]=(0,v.useState)(!1),x=o??y,S=e=>{b(e),s?.(e)},[C,w]=(0,v.useState)(!1),T=p??C,E=e=>{w(e),m?.(e)},D=_.engine??`claude`,O=i?eT(e):tT(e),k=i?_.project?.icon:void 0,A=k?.type===`image`?a?.[k.hash]:void 0,j=SD(_.totalCostUsd),M=[r?e.hostName:void 0,_.profile?`@${_.profile}`:void 0,j===`—`?void 0:j].filter(e=>!!e),N=ND(_.model),P=[];N&&P.push((0,U.jsx)(`span`,{className:o2(D,_.model),children:N},`model`)),O!==void 0&&P.push((0,U.jsxs)(`span`,{children:[(0,U.jsx)($0,{icon:k,src:A,name:O,className:`mr-1.5 size-4 align-[-0.3em]`}),O]},`project`));for(let e of M)P.push((0,U.jsx)(`span`,{children:e},e));let F=l2(_,(e,t)=>t===`agent`?l?l(e):c?.():u?u(e):c?.()),I=F.some(e=>e.kind===`agent`&&e.key===n);return(0,U.jsxs)(`div`,{"data-slot":`session-item`,"data-active":t||void 0,role:`button`,tabIndex:0,onClick:e=>{e.detail>1||T||c?.()},onKeyDown:e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),c?.())},className:W(`group flex w-full cursor-pointer flex-col p-1 text-left outline-none`,`rounded-[4px] transition-colors focus-visible:ring-2 focus-visible:ring-ring`,I?`bg-row-selected-weak`:t?`bg-row-selected`:`hover:bg-row-hover`,g),children:[(0,U.jsxs)(`div`,{className:`flex flex-col gap-1 py-0.5 pr-0.5 pl-1.5`,children:[(0,U.jsxs)(`div`,{className:`flex h-5 items-center gap-1.5 overflow-hidden`,children:[(0,U.jsx)(g2,{children:(0,U.jsx)(c2,{row:e})}),T&&d?(0,U.jsx)(_2,{initial:_.title??``,onCommit:e=>{E(!1),e!==(_.title??``)&&d(e)},onCancel:()=>E(!1)}):(0,U.jsx)(`span`,{onDoubleClick:d&&f===`doubleClick`?e=>{e.stopPropagation(),E(!0)}:void 0,className:`min-w-0 flex-1 truncate text-body-sm font-medium tracking-[-0.005em] text-fg-1`,children:Qw(_)}),e.unseen>0?(0,U.jsx)(`span`,{title:`${e.unseen} new message${e.unseen===1?``:`s`}`,className:W(`flex h-4 min-w-6 shrink-0 items-center justify-center rounded-full px-2`,`text-[0.75rem] leading-none tracking-[-0.005em] tabular-nums`,e.state===`working`||e.state===`attention`?`bg-accent text-accent-fg`:`bg-badge text-badge-fg`),children:e.unseen}):null,(0,U.jsx)(e2,{usage:_.contextUsage,size:16,className:`p-0.5`})]}),(0,U.jsxs)(`div`,{className:`flex h-5 items-center gap-1.5 overflow-hidden text-body-sm tracking-[-0.005em]`,children:[(0,U.jsx)(g2,{children:(0,U.jsx)(s2,{engine:D,model:_.model,className:W(`size-4`,a2(D,_.model))})}),(0,U.jsx)(`span`,{className:`min-w-0 truncate text-fg-4`,children:P.map((e,t)=>(0,U.jsxs)(v.Fragment,{children:[t>0?` · `:``,e]},t))}),(0,U.jsxs)(`span`,{className:`shrink-0 text-fg-4`,children:[P.length>0?`· `:``,DD(_.lastActivityAt??_.createdAt)]}),(0,U.jsx)(`span`,{className:`min-w-0 flex-1`}),F.length>0?(0,U.jsx)(f2,{expanded:x,running:d2(F),total:F.length,noun:F[0].noun,onToggle:()=>S(!x)}):null,h]})]}),x&&F.length>0?(0,U.jsx)(`div`,{className:`flex flex-col`,children:F.map(e=>(0,U.jsx)(p2,{step:e,active:e.key===n,onSelect:e.onSelect},e.key))}):null]})}function g2({children:e}){return(0,U.jsx)(`span`,{className:`flex size-4 shrink-0 items-center justify-center`,children:e})}function _2({initial:e,onCommit:t,onCancel:n}){let[r,i]=(0,v.useState)(e),a=(0,v.useRef)(null);return(0,v.useEffect)(()=>{a.current?.focus(),a.current?.select()},[]),(0,v.useEffect)(()=>{let e=()=>{a.current?.focus(),a.current?.select()};return window.addEventListener(`focus`,e),()=>window.removeEventListener(`focus`,e)},[]),(0,U.jsx)(`input`,{ref:a,value:r,spellCheck:!1,placeholder:`Session name`,"aria-label":`Session name`,onClick:e=>e.stopPropagation(),onDoubleClick:e=>e.stopPropagation(),onChange:e=>i(e.target.value),onBlur:()=>{document.hasFocus()&&t(r.trim())},onKeyDown:e=>{e.stopPropagation(),e.key===`Enter`?t(r.trim()):e.key===`Escape`&&n()},className:W(`-my-0.5 min-w-0 flex-1 rounded-sm border border-ring bg-bg px-1 py-px`,`text-body-sm leading-5 text-fg-1 outline-none`)})}function v2(e){return W(`px-2 py-1.5 hover:bg-row-hover`,e?`mr-1 ml-0 rounded-r-md border-l-4 border-l-accent`:`mx-1 rounded-md`)}function y2({rows:e,config:t,onConfigChange:n,scope:r,activeId:i,activeSubagentId:a,onSelect:o,onDelete:s,onRename:c,onClearContext:l,onSelectSubagent:u,onRevealStep:d,emptyState:f,showControls:p=!0,projectIcons:m,className:h}){let g=(0,v.useMemo)(()=>cT(e,t,r),[e,t,r]),_=(0,v.useMemo)(()=>mT(g,t),[g,t]),y=hT(t,r,g.length,e.length),b=(0,v.useMemo)(()=>Xw(e),[e]),x=(0,v.useMemo)(()=>Zw(e),[e]),S=(0,v.useMemo)(()=>{let t=new Map;for(let n of e)t.set(n.hostId,n.hostName);return[...t].map(([e,t])=>({id:e,name:t}))},[e]),C=e=>n({...t,...e});return(0,U.jsxs)(`div`,{"data-slot":`session-browser`,className:W(`flex flex-col gap-3`,h),children:[(0,U.jsxs)(`div`,{className:W(`flex flex-col gap-1.5 px-2`,!p&&`hidden`),children:[(0,U.jsxs)(`div`,{className:`relative`,children:[(0,U.jsx)(ty,{className:`pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-fg-4`}),(0,U.jsx)(po,{value:t.search,onChange:e=>C({search:e.target.value}),placeholder:`Search sessions`,"aria-label":`Search sessions`,className:`pl-8`})]}),(0,U.jsx)(C2,{label:`State`,children:(0,U.jsx)(w2,{label:`State`,value:t.states,options:Uw.map(e=>({value:e,label:Ww[e]})),onChange:e=>C({states:e})})}),b.length>1?(0,U.jsx)(C2,{label:`Engine`,children:(0,U.jsx)(w2,{label:`Engine`,value:t.adapters,options:b.map(e=>({value:e,label:e})),onChange:e=>C({adapters:e})})}):null,S.length>1?(0,U.jsx)(C2,{label:`Gateway`,children:(0,U.jsx)(w2,{label:`Gateway`,value:t.gateways,options:S.map(e=>({value:e.id,label:e.name})),onChange:e=>C({gateways:e})})}):null,x.length>1?(0,U.jsx)(C2,{label:`Project`,children:(0,U.jsx)(w2,{label:`Project`,value:t.projects??[],options:x.map(e=>({value:e.key,label:e.label})),onChange:e=>C({projects:e})})}):null,(0,U.jsx)(C2,{label:`Group`,children:(0,U.jsx)(T2,{label:`Group`,value:t.groupBy,options:[{value:`none`,label:`No grouping`},{value:`state`,label:`By state`},{value:`adapter`,label:`By engine`},...x.length>1?[{value:`project`,label:`By project`}]:[],...S.length>1?[{value:`gateway`,label:`By gateway`}]:[]],onChange:e=>C({groupBy:e})})}),(0,U.jsx)(C2,{label:`Sort`,children:(0,U.jsx)(T2,{label:`Sort`,value:t.sortBy,options:[{value:`recent`,label:`Recent`},{value:`name`,label:`Name`},{value:`state`,label:`State`},...x.length>1?[{value:`project`,label:`Project`}]:[],...S.length>1?[{value:`gateway`,label:`Gateway`}]:[]],onChange:e=>C({sortBy:e})})})]}),y?(0,U.jsxs)(`div`,{className:`flex items-center gap-2 px-3 text-label text-fg-4`,children:[(0,U.jsxs)(`span`,{children:[y.shown,` of `,y.total,y.causes.length?` · ${y.causes.join(` · `)}`:null]}),(0,U.jsx)(`button`,{type:`button`,className:`text-fg-3 underline underline-offset-2 hover:text-fg-1`,onClick:()=>n(_T(t)),children:`Show all`})]}):null,e.length===0?f??(0,U.jsx)(yS,{icon:(0,U.jsx)(nv,{}),title:`No sessions yet`}):g.length===0?gT(t)?(0,U.jsx)(yS,{icon:(0,U.jsx)(ey,{}),title:`No matches`,description:`No session matches the current search and filters.`,action:`Clear filters`,onAction:()=>n(_T(t))}):(0,U.jsx)(yS,{icon:(0,U.jsx)(nv,{}),title:`Nothing here`,description:`No session to show.`}):(0,U.jsx)(`div`,{className:`flex flex-col gap-4 px-1`,children:_.map(e=>(0,U.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[t.groupBy!==`none`&&e.label?(0,U.jsxs)(`div`,{className:`flex items-center gap-2 px-2 text-label font-medium text-fg-4`,children:[t.groupBy===`project`?(0,U.jsx)($0,{icon:e.rows[0]?.info.project?.icon,src:b2(e.rows[0],m),name:e.label}):null,(0,U.jsx)(`span`,{className:`uppercase tracking-wide`,children:e.label}),(0,U.jsx)(`span`,{className:`text-fg-4/70`,children:e.rows.length})]}):null,e.rows.map(e=>(0,U.jsx)(x2,{row:e,active:e.info.id===i,activeSubagentId:a,showGateway:S.length>1&&t.groupBy!==`gateway`,showProject:t.groupBy!==`project`,projectIcons:m,onSelect:o,onDelete:s,onRename:c,onClearContext:l,onSelectSubagent:u,onRevealStep:d},`${e.hostId}:${e.info.id}`))]},e.key))})]})}function b2(e,t){let n=e?.info.project?.icon;return n?.type===`image`?t?.[n.hash]:void 0}function x2({row:e,active:t,activeSubagentId:n,showGateway:r,showProject:i=!0,projectIcons:a,onSelect:o,onDelete:s,onRename:c,onClearContext:l,onSelectSubagent:u,onRevealStep:d}){let{info:f}=e,[p,m]=(0,v.useState)(!1);return(0,U.jsx)(h2,{row:e,active:t===!0,activeStepKey:n,showGateway:r,showProject:i,projectIcons:a,onSelect:()=>o?.(e),onSelectSubagent:u?t=>u(e,t):void 0,onRevealStep:d?t=>d(e,t):void 0,onRename:c?t=>c(e,t):void 0,renameOn:`external`,editing:p,onEditingChange:m,actions:(0,U.jsxs)(U.Fragment,{children:[c&&!p?(0,U.jsx)(S2,{label:`Rename session`,onClick:()=>m(!0),children:(0,U.jsx)(Mv,{className:`size-3 text-fg-3`})}):null,l&&f.capabilities?.clearContext?(0,U.jsx)(S2,{label:`Clear context`,title:`Clear the conversation — the session keeps running and the old conversation stays resumable`,onClick:()=>l(e),children:(0,U.jsx)(w_,{className:`size-3 text-fg-3`})}):null,s?(0,U.jsx)(S2,{label:`Close session`,onClick:()=>s(e),children:(0,U.jsx)(Ty,{className:`size-3 text-fg-3`})}):null]})})}function S2({label:e,title:t,onClick:n,children:r}){return(0,U.jsx)(ao,{variant:`ghost`,size:`icon-sm`,"aria-label":e,title:t??e,className:`size-5 shrink-0 opacity-0 transition-opacity group-hover:opacity-100`,onClick:e=>{e.stopPropagation(),n()},children:r})}function C2({label:e,children:t}){return(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`span`,{"aria-hidden":!0,className:`w-14 shrink-0 truncate text-label text-fg-3`,children:e}),(0,U.jsx)(`div`,{className:`min-w-0 flex-1`,children:t})]})}function w2({label:e,value:t,options:n,onChange:r}){return(0,U.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,U.jsxs)(Uy,{multiple:!0,value:t,onValueChange:e=>r(e),children:[(0,U.jsx)(Ky,{"aria-label":e,className:`min-w-0 flex-1`,children:(0,U.jsx)(Wy,{children:t.length===0?`All`:t.length===1?n.find(e=>e.value===t[0])?.label??`All`:`${t.length} selected`})}),(0,U.jsx)(qy,{children:n.map(e=>(0,U.jsx)(Jy,{value:e.value,children:(0,U.jsx)(Gy,{children:e.label})},e.value))})]}),t.length>0?(0,U.jsx)(ao,{variant:`ghost`,size:`icon-sm`,"aria-label":`Clear ${e}`,onClick:()=>r([]),children:(0,U.jsx)(By,{className:`size-3 text-fg-4`})}):null]})}function T2({label:e,value:t,options:n,onChange:r}){return(0,U.jsxs)(Uy,{value:t,onValueChange:e=>r(e),children:[(0,U.jsx)(Ky,{"aria-label":e,className:`w-full min-w-0`,children:(0,U.jsx)(Wy,{children:n.find(e=>e.value===t)?.label??e})}),(0,U.jsx)(qy,{children:n.map(e=>(0,U.jsx)(Jy,{value:e.value,children:(0,U.jsx)(Gy,{children:e.label})},e.value))})]})}function E2(){let[e,t]=(0,v.useState)(T());return(0,U.jsx)(ao,{variant:`ghost`,size:`icon-sm`,"aria-label":`Toggle theme`,onClick:()=>t(O()),children:e===`dark`?(0,U.jsx)(vy,{className:`size-4`}):(0,U.jsx)(vv,{className:`size-4`})})}var D2=[{value:`default`,displayName:`Default (recommended)`,description:`The CLI's configured default model`},{value:`fable`,displayName:`Fable`,description:`Fable 5.1 · Most capable for your hardest and longest-running tasks`},{value:`opus`,displayName:`Opus`,description:`Opus 5 with 1M context · Best for everyday, complex tasks`},{value:`sonnet`,displayName:`Sonnet`,description:`Sonnet 5 · Efficient for routine tasks`},{value:`haiku`,displayName:`Haiku`,description:`Haiku 4.5 · Fastest for quick answers`}],O2=`workerdeck.transcript-density`;function k2(){return b(O2)===`compact`?`compact`:`comfortable`}function A2(e){x(O2,e)}var j2=`workerdeck.transcript-variant`;function M2(){let e=b(j2);return e===`terminal`||e===`lines`?`terminal`:`cards`}function N2(e){x(j2,e)}var P2=`workerdeck.transcript-font`;function F2(){return b(P2)===`mono`?`mono`:`sans`}function I2(e){x(P2,e)}var L2=`workerdeck.font-size`;function R2(){let e=b(L2);if(e===void 0)return;let t=Number(e);return Number.isFinite(t)&&t>=8&&t<=24?Math.round(t):void 0}function z2(e){x(L2,e===void 0?void 0:String(Math.round(e)))}function B2({label:e,options:t,read:n,write:r,onChange:i}){let[a,o]=(0,v.useState)(n);return(0,U.jsxs)(Uy,{value:a,onValueChange:e=>{o(e),r(e),i?.(e)},children:[(0,U.jsx)(Ky,{"aria-label":e,className:`min-w-40`,children:(0,U.jsx)(Wy,{children:t.find(e=>e.value===a)?.label})}),(0,U.jsx)(qy,{children:t.map(e=>(0,U.jsx)(Jy,{value:e.value,children:(0,U.jsx)(Gy,{children:e.label})},e.value))})]})}function V2({title:e,children:t}){return(0,U.jsxs)(`section`,{className:`flex flex-col gap-3`,children:[(0,U.jsx)(`h3`,{className:`text-label font-medium tracking-wide text-fg-3 uppercase`,children:e}),t]})}function H2({open:e,onOpenChange:t}){let[n,r]=(0,v.useState)(M2);return(0,U.jsx)(ix,{open:e,onOpenChange:t,children:(0,U.jsxs)(ax,{size:`md`,className:`w-[min(30rem,calc(100vw-2rem))]`,children:[(0,U.jsx)(ox,{title:`Settings`,description:`Preferences held by this browser. What a run defaults to lives on its profile; server policy lives where the gateway runs.`}),(0,U.jsx)(sx,{children:(0,U.jsx)(`div`,{className:`flex flex-col gap-6`,children:(0,U.jsxs)(V2,{title:`Appearance`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`span`,{className:`text-body-sm text-fg-2`,children:`Theme`}),(0,U.jsx)(E2,{})]}),(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`span`,{className:`text-body-sm text-fg-2`,children:`Agent view style`}),(0,U.jsx)(B2,{label:`Agent view style`,options:[{value:`cards`,label:`Cards`},{value:`terminal`,label:`Terminal`}],read:M2,write:N2,onChange:r})]}),(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`span`,{className:`text-body-sm text-fg-2`,children:`Font size`}),(0,U.jsx)(B2,{label:`Font size`,options:[{value:``,label:`Default`},{value:`11`,label:`11 px`},{value:`12`,label:`12 px`},{value:`13`,label:`13 px`},{value:`14`,label:`14 px`},{value:`15`,label:`15 px`},{value:`16`,label:`16 px`}],read:()=>String(R2()??``),write:e=>z2(e?Number(e):void 0)})]}),n===`cards`?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`span`,{className:`text-body-sm text-fg-2`,children:`Agent view density`}),(0,U.jsx)(B2,{label:`Agent view density`,options:[{value:`comfortable`,label:`Comfortable`},{value:`compact`,label:`Compact`}],read:k2,write:A2})]}),(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`span`,{className:`text-body-sm text-fg-2`,children:`Agent view font`}),(0,U.jsx)(B2,{label:`Agent view font`,options:[{value:`sans`,label:`Regular`},{value:`mono`,label:`Monospace`}],read:F2,write:I2})]})]}):null]})})})]})})}function U2({className:e}){return(0,U.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,className:e,children:[(0,U.jsx)(`path`,{d:`M12 3 20.5 7.75 12 12.5 3.5 7.75Z`}),(0,U.jsx)(`path`,{d:`M3.5 12.25 12 17l8.5-4.75`}),(0,U.jsx)(`path`,{d:`M3.5 16.5 12 21.25l8.5-4.75`}),(0,U.jsx)(`path`,{d:`M12 6.15 14.85 7.75 12 9.35 9.15 7.75Z`,fill:`#2fbf71`,stroke:`none`})]})}function W2(e){let t=e,n=new Set,r=()=>t,i=()=>{for(let e of n)e()},a=e=>(n.add(e),()=>void n.delete(e));return{get:r,subscribe:a,set:e=>{t=e,i()},patch:e=>{t={...t,...e},i()},use:()=>(0,v.useSyncExternalStore)(a,r,r)}}var G2=`workerdeck.hosts.v1`;function K2(e){return`workerdeck.host.${e}.key`}var q2=`gateway`,J2=W2({hosts:[],ready:!1});function Y2(e){t4.clear(),J2.set(e)}function X2(){let e=S(G2,[]);return Array.isArray(e)?e.map(({implicit:e,...t})=>t):[]}function Z2(e){C(G2,e.filter(e=>!e.implicit))}function Q2(){if(typeof crypto.randomUUID==`function`)return crypto.randomUUID();let e=crypto.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=[...e].map(e=>e.toString(16).padStart(2,`0`)).join(``);return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}function $2(e){return b(K2(e))??``}function e4(e,t){x(K2(e),t===``?void 0:t)}var t4=new Map;function n4(e){let t=t4.get(e);if(t)return t;let n=J2.get().hosts.find(t=>t.id===e);if(!n)return;let r=PE(n);if(r===void 0)return;let i=new RE({baseUrl:r,...n.implicit?{}:IE({baseUrl:r,key:$2(n.id)})});return t4.set(e,i),i}function r4(){return J2.get().hosts.find(e=>e.implicit)??J2.get().hosts[0]}function i4(){let e=r4();return e?n4(e.id):void 0}function a4(e){return FE(e)}function o4(e,t){let n=X2(),r=n.some(t=>t.id===e.id)?n.map(t=>t.id===e.id?e:t):[...n,e];Z2(r),e4(e.id,t),Y2({...J2.get(),hosts:[...J2.get().hosts.filter(e=>e.implicit),...r]})}function s4(e){let t=X2().filter(t=>t.id!==e);Z2(t),e4(e,``),Y2({...J2.get(),hosts:[...J2.get().hosts.filter(e=>e.implicit),...t]})}async function c4(){try{let e=await fetch(`${location.origin}/auth/status`,{headers:{accept:`application/json`}});if(!e.ok||!e.headers.get(`content-type`)?.includes(`application/json`))return!1;let t=await e.json();return typeof t==`object`&&!!t&&`enabled`in t}catch{return!1}}var l4=!1;function u4(){if(l4)return;l4=!0;let e=X2();Y2({hosts:e,ready:!1}),c4().then(t=>{Y2({hosts:t?[{id:q2,name:`This gateway`,baseUrl:location.origin,implicit:!0},...e]:e,ready:!0})})}function d4(e){return u4(),J2.subscribe(e)}function f4(){return(0,v.useSyncExternalStore)(d4,J2.get,J2.get)}function p4(){return u4(),J2.get().hosts}function m4(e){return d4(e)}function h4({host:e,submitLabel:t=`Save`,onSaved:n,actions:r}){let[i,a]=(0,v.useState)(e.name),[o,s]=(0,v.useState)(e.baseUrl),[c,l]=(0,v.useState)(()=>$2(e.id));return(0,U.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,U.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,U.jsx)(`span`,{className:`text-label text-fg-3`,children:`Name`}),(0,U.jsx)(po,{value:i,onChange:e=>a(e.target.value),placeholder:`Mac mini`})]}),(0,U.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,U.jsx)(`span`,{className:`text-label text-fg-3`,children:`Address`}),(0,U.jsx)(po,{value:o,onChange:e=>s(e.target.value),placeholder:`http://toby.ts.net:8787`,spellCheck:!1,className:`font-mono`})]}),(0,U.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,U.jsx)(`span`,{className:`text-label text-fg-3`,children:`Auth key`}),(0,U.jsx)(po,{type:`password`,value:c,onChange:e=>l(e.target.value),placeholder:`Leave empty for an unauthenticated gateway`,spellCheck:!1}),(0,U.jsx)(`span`,{className:`text-label text-fg-4`,children:`Stored in this browser’s local storage, and sent on the WebSocket URL when attaching. Use a gateway you control, over a network you trust.`})]}),(0,U.jsxs)(`div`,{className:`mt-1 flex justify-end gap-2`,children:[r,(0,U.jsx)(ao,{onClick:()=>{if(PE({baseUrl:o})===void 0){Xx.error(`That address is not a URL`);return}if(!i.trim()){Xx.error(`Give the gateway a name`);return}let t={id:e.id,name:i.trim(),baseUrl:o.trim()};o4(t,c),n(t)},children:t})]})]})}function g4({open:e,onOpenChange:t,onCreated:n}){let[r,i]=(0,v.useState)(()=>_4());return(0,U.jsx)(ix,{open:e,onOpenChange:e=>{e&&i(_4()),t(e)},children:(0,U.jsxs)(ax,{children:[(0,U.jsx)(ox,{title:`Add gateway`,description:`A workerdeck gateway you run — typically over Tailscale.`}),(0,U.jsx)(sx,{children:(0,U.jsx)(h4,{host:r,submitLabel:`Add gateway`,onSaved:n,actions:(0,U.jsx)(ao,{variant:`outline`,onClick:()=>t(!1),children:`Cancel`})})})]})})}function _4(){return{id:Q2(),name:``,baseUrl:``}}function v4({host:e,onClose:t,onRemoved:n}){return(0,U.jsx)(ix,{open:!0,onOpenChange:e=>!e&&t(),children:(0,U.jsxs)(ax,{children:[(0,U.jsx)(ox,{title:`Remove ${e.name}?`,description:`Its auth key is deleted from this browser. The gateway itself keeps running.`}),(0,U.jsx)(sx,{children:(0,U.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,U.jsx)(ao,{variant:`outline`,onClick:t,children:`Cancel`}),(0,U.jsx)(ao,{variant:`destructive`,onClick:()=>{s4(e.id),n()},children:`Remove`})]})})]})})}function y4(e){return e===`sessions`?`workerdeck.sessions-sidebar-width`:`workerdeck.${e}-sidebar-width`}function b4(e){return e===`sessions`?`workerdeck.sessions-sidebar-collapsed`:`workerdeck.${e}-sidebar-collapsed`}function x4(e){let t=Number(b(y4(e)));return t?Math.min(520,Math.max(240,t)):300}function S4(e,t){x(y4(e),String(t))}function C4(e){return b(b4(e))===`1`}function w4(e,t){x(b4(e),t?`1`:`0`)}var T4=`workerdeck.sessions-filters-shown`;function E4(){return b(T4)===`1`}function D4(e){x(T4,e?`1`:`0`)}function O4({section:e,title:t,badge:n,actions:r,children:i,rail:a,railActions:o}){let[s,c]=(0,v.useState)(()=>x4(e)),[l,u]=(0,v.useState)(()=>C4(e)),d=t=>{u(t),w4(e,t)};return l?(0,U.jsxs)(`div`,{className:`flex min-h-0 w-11 shrink-0 flex-col items-center gap-1 border-r border-border bg-sidebar py-1.5`,children:[(0,U.jsx)(ao,{variant:`ghost`,size:`icon-sm`,"aria-label":`Expand ${t.toLowerCase()}`,onClick:()=>d(!1),children:(0,U.jsx)(Dv,{className:`size-4`})}),o,a?(0,U.jsx)(`div`,{className:`flex min-h-0 w-full flex-1 flex-col items-center gap-0.5 overflow-y-auto pt-1`,children:a}):null]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{style:{width:s},className:`flex min-h-0 shrink-0 flex-col border-r border-border bg-sidebar`,children:[(0,U.jsxs)(`header`,{className:`flex h-9 shrink-0 items-center gap-1 pr-1 pl-3`,children:[(0,U.jsx)(`span`,{className:`truncate text-label font-medium tracking-wide text-fg-3 uppercase`,children:t}),n,(0,U.jsx)(`span`,{className:`flex-1`}),(0,U.jsx)(ao,{variant:`ghost`,size:`icon-sm`,"aria-label":`Collapse ${t.toLowerCase()}`,onClick:()=>d(!0),children:(0,U.jsx)(Ov,{className:`size-3.5`})}),r]}),i]}),(0,U.jsx)(vS,{orientation:`vertical`,value:s,onValueChange:t=>{c(t),S4(e,t)},min:240,max:520,defaultValue:300,"aria-label":`Resize ${t.toLowerCase()} sidebar`})]})}function k4({children:e,className:t}){return(0,U.jsx)(`div`,{className:W(`min-h-0 flex-1 overflow-y-auto pb-2`,t),children:e})}function A4({title:e,status:t,description:n,actions:r,active:i,onSelect:a,onDoubleClick:o}){return(0,U.jsxs)(`div`,{"data-slot":`sidebar-row`,"data-active":i||void 0,onClick:a,onDoubleClick:o,className:W(`group flex cursor-pointer flex-col gap-0.5 text-left transition-colors`,v2(i===!0)),children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,U.jsx)(`button`,{type:`button`,className:W(`min-w-0 flex-1 truncate text-left text-body-sm outline-none`,i?`font-medium text-fg-1`:`text-fg-2`),children:e}),t]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-1 text-label text-fg-4`,children:[(0,U.jsx)(`button`,{type:`button`,tabIndex:-1,className:`flex min-w-0 flex-1 items-center gap-1.5 truncate text-left font-mono outline-none`,children:n}),r]})]})}function j4({label:e,onClick:t,children:n}){return(0,U.jsx)(`button`,{type:`button`,"aria-label":e,title:e,onClick:e=>{e.stopPropagation(),t()},className:`flex size-5 shrink-0 items-center justify-center rounded text-fg-3 opacity-0 transition-opacity outline-none hover:bg-surface-hover hover:text-fg-1 group-hover:opacity-100`,children:n})}var M4=`workerdeck.watermarks.v1`,N4=W2(0),P4=new wT({read:()=>S(M4,void 0),write:e=>{C(M4,e),N4.set(N4.get()+1)}});function F4(){return N4.use(),{unseenFor:(0,v.useCallback)((e,t)=>TT(P4.get(e,t.id),{proseCount:t.proseCount,activityCount:t.activityCount,turns:t.numTurns}),[]),watermarks:P4}}function I4(e,t){let n=P4.get(e,t);return n?{itemCount:n.itemCount,since:n.seenAt}:void 0}function L4(e,t){let n=(0,v.useRef)({});return(0,v.useCallback)(r=>{!t||document.hidden||(n.current={...n.current,...r},P4.mark(e,t,n.current))},[e,t])}function R4(e){let{unseenFor:t}=F4();return(0,v.useMemo)(()=>e.reduce((e,n)=>e+t(n.hostId,n.info),0),[e,t])}var z4=5e3,B4=1200,V4=700,H4=W2({snapshots:[],loaded:!1}),U4=H4.set,W4,G4=0,K4;function q4(){return W4??=(async()=>{G4=Date.now();try{let e=p4(),t=new Map(H4.get().snapshots.map(e=>[e.host.id,e]));U4({snapshots:await Promise.all(e.map(async e=>{let n=n4(e.id);if(!n)return{host:e,sessions:[],error:`unusable address`};try{return{host:e,sessions:await n.listSessions()}}catch(n){return{host:e,sessions:t.get(e.id)?.sessions??[],error:n instanceof Error?n.message:String(n)}}})),loaded:!0})}finally{W4=void 0}})(),W4}function J4(){if(K4!==void 0)return;let e=Math.max(0,V4-(Date.now()-G4));K4=setTimeout(()=>{K4=void 0,q4()},e)}var Y4,X4;function Z4(e){let t=e?B4:z4;(Y4===void 0||X4!==t)&&(Y4!==void 0&&clearInterval(Y4),X4=t,Y4=setInterval(()=>void q4(),t))}function Q4(){let e=H4.use();(0,v.useEffect)(()=>m4(()=>void q4()),[]);let t=e.snapshots.some(e=>e.sessions.some(e=>{let t=Gw(e);return t===`working`||t===`attention`}));return(0,v.useEffect)(()=>{Z4(t),H4.get().loaded||q4()},[t]),{...e,refresh:q4}}function $4(e){let{unseenFor:t}=F4();return(0,v.useMemo)(()=>e.flatMap(({host:e,sessions:n})=>n.filter(e=>!nT(e)).map(n=>({hostId:e.id,hostName:e.name,local:a4(e),adapter:n.engine??`claude`,state:Gw(n),info:n,unseen:t(e.id,n)}))),[e,t])}function e3(){let e=kr(),t=gi({select:e=>e.location.pathname.match(/^\/gateways\/(.+)$/)?.[1]}),{hosts:n,ready:r}=f4(),{snapshots:i}=Q4(),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(),l=i.filter(e=>e.error===void 0).length,u=(0,U.jsx)(ao,{variant:`ghost`,size:`icon-sm`,"aria-label":`Add gateway`,onClick:()=>o(!0),children:(0,U.jsx)(Lv,{className:`size-4`})});return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(O4,{section:`gateways`,title:`Gateways`,badge:r&&n.length>0?(0,U.jsxs)(`span`,{className:`shrink-0 text-label text-fg-4`,children:[l,`/`,n.length]}):void 0,actions:u,railActions:u,children:(0,U.jsxs)(k4,{children:[r&&n.length===0?(0,U.jsx)(yS,{icon:(0,U.jsx)(ny,{}),title:`No gateways yet`,description:(0,U.jsxs)(U.Fragment,{children:[`Add one with `,(0,U.jsx)(bS,{children:`+`}),` above.`]})}):null,n.map(n=>{let r=i.find(e=>e.host.id===n.id),a=r===void 0?`pending`:r.error?`error`:`ok`;return(0,U.jsx)(A4,{active:n.id===t,onSelect:()=>void e({to:`/gateways/$hostId`,params:{hostId:n.id}}),title:n.name,status:(0,U.jsxs)(U.Fragment,{children:[n.implicit?(0,U.jsx)(`span`,{className:`shrink-0 text-label text-fg-4`,children:`this page`}):null,(0,U.jsx)(`span`,{"aria-hidden":!0,title:r?.error??(a===`ok`?`Connected`:`Connecting…`),className:W(`size-1.5 shrink-0 rounded-full`,a===`ok`?`bg-success`:a===`error`?`bg-danger`:`bg-fg-4`)})]}),description:n.baseUrl,actions:n.implicit?null:(0,U.jsx)(j4,{label:`Remove ${n.name}`,onClick:()=>c(n),children:(0,U.jsx)(Ty,{className:`size-3`})})},n.id)})]})}),s?(0,U.jsx)(v4,{host:s,onClose:()=>c(void 0),onRemoved:()=>{let n=s.id===t;c(void 0),n&&e({to:`/gateways`})}}):null,(0,U.jsx)(g4,{open:a,onOpenChange:o,onCreated:t=>{o(!1),e({to:`/gateways/$hostId`,params:{hostId:t.id}})}})]})}function t3({value:e,onChange:t,models:n=D2,className:r}){return(0,U.jsx)(yQ,{variant:`form`,models:n,model:e||void 0,onModelChange:e=>t(e??``),className:r})}function n3({profiles:e,value:t,onChange:n,className:r}){return e.length===0?null:(0,U.jsxs)(`label`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,U.jsx)(`span`,{className:`text-label font-medium text-fg-3`,children:`Profile`}),(0,U.jsxs)(Uy,{items:e.map(e=>({value:e.name,label:e.name})),value:t,onValueChange:e=>n(e),children:[(0,U.jsx)(Ky,{className:r,children:(0,U.jsx)(Wy,{})}),(0,U.jsx)(qy,{children:e.map(e=>(0,U.jsx)(Jy,{value:e.name,children:(0,U.jsx)(Gy,{children:(0,U.jsxs)(`span`,{className:e.available===!1?`text-fg-4`:void 0,title:e.unavailableReason,children:[e.description?`${e.name} — ${e.description}`:e.name,e.available===!1?` (unavailable)`:``]})})},e.name))})]})]})}function r3(){return i4()}function i3(e,t,n){let r=e?.capabilities??ET[e?.engine??`claude`],i=r.permissionModes.includes(t)?t:r.defaultPermissionMode,a,o;if(e?.models?.length)a=e.models,o=e.defaultModel;else if(e?.engine===`provider`){let t=e.provider;a=(t?.models?.length?t.models:t?.model?[t.model]:[]).map(e=>({value:e,displayName:e})),o=t?.model}else a=D2.filter(e=>e.value!=="default");let s=a.find(e=>e.value===n||e.resolvedModel===n),c=s||n===``?n:``;return{capabilities:r,modes:r.permissionModes,models:[{value:`default`,displayName:`Profile default`,description:o??`the profile's configured model`},...a],mode:i,model:c,reasoningEfforts:(s?s.reasoningEfforts:void 0)??r.reasoningEfforts??[]}}var a3={profiles:[]},o3,s3,c3=new Set;async function l3(){let e=await(r3()?.listProfiles().catch(()=>a3)??Promise.resolve(a3));o3=e;for(let t of c3)t(e);return e}function u3(){let[e,t]=(0,v.useState)(o3??a3);(0,v.useEffect)(()=>(c3.add(t),o3||(s3??=l3()),()=>{c3.delete(t)}),[]);let n=(0,v.useCallback)(async()=>{s3=l3(),await s3},[]);return{...e,refresh:n}}function d3(){return u3().profiles}var f3=`workerdeck.last-profile`;function p3(){let e=d3(),[t,n]=(0,v.useState)(()=>b(f3)??``),r=e.some(e=>e.name===t)?t:e[0]?.name??``;return{profiles:e,profile:r,selected:e.find(e=>e.name===r),select:e=>{n(e),x(f3,e)}}}var m3=`workerdeck.last-cwd`;function h3(e){let[t,n]=(0,v.useState)([]);return(0,v.useEffect)(()=>{r3()?.listHostRoots().then(e=>n(e.roots.map(e=>e.path))).catch(()=>n([]))},[]),(0,v.useMemo)(()=>{let n=b(m3),r=[...n?[n]:[],...[...e].sort((e,t)=>(t.lastActivityAt??t.createdAt)-(e.lastActivityAt??e.createdAt)).map(e=>e.cwd),...t];return[...new Set(r)].slice(0,12)},[e,t])}var g3={session:`default`,job:`acceptEdits`};function _3(e){let[t,n]=(0,v.useState)(()=>b(m3)??``),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(void 0),[l,u]=(0,v.useState)(``),{profiles:d,profile:f,selected:p,select:m}=p3(),h=i3(p,s??p?.defaults?.permissionMode??g3[e],a);return{cwd:t,setCwd:n,prompt:r,setPrompt:i,mode:h.mode,setMode:c,model:a,setModel:o,effort:l,setEffort:u,profiles:d,profile:f,selectProfile:m,engine:h,sessionFields:e=>({cwd:h.capabilities.hostCwd===!1?void 0:t.trim(),profile:f||void 0,prompt:e.prompt,permissionMode:h.mode,model:h.model.trim()||void 0,resume:e.resume,reasoningEffort:l&&h.reasoningEfforts.includes(l)?l:void 0,...h.capabilities.settingSources?{settingSources:[`user`,`project`],allowDangerouslySkipPermissions:e.allowBypass||void 0}:{}}),rememberCwd:e=>x(m3,t.trim()||e)}}function v3({form:e,sessions:t,promptLabel:n,promptPlaceholder:r=`e.g. /verify-content 42, or a task description`,extras:i,actions:a,onProfileChange:o}){let s=h3(t),c=(0,v.useId)(),{engine:l}=e;return(0,U.jsxs)(U.Fragment,{children:[l.capabilities.hostCwd!==!1&&(0,U.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,U.jsx)(`span`,{className:`text-label font-medium text-fg-3`,children:`Working directory`}),(0,U.jsx)(po,{value:e.cwd,list:c,onChange:t=>e.setCwd(t.target.value),placeholder:`/path/to/project`,spellCheck:!1,className:`font-mono`}),(0,U.jsx)(`datalist`,{id:c,children:s.map(e=>(0,U.jsx)(`option`,{value:e},e))})]}),(0,U.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,U.jsx)(`span`,{className:`text-label font-medium text-fg-3`,children:n}),(0,U.jsx)(mo,{value:e.prompt,onChange:t=>e.setPrompt(t.target.value),rows:2,placeholder:r})]}),(0,U.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3`,children:[(0,U.jsx)(n3,{profiles:e.profiles,value:e.profile,onChange:t=>{e.selectProfile(t),o?.(t)},className:`min-w-32`}),(0,U.jsxs)(`label`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,U.jsx)(`span`,{className:`text-label font-medium text-fg-3`,children:`Permission mode`}),(0,U.jsx)(CQ,{variant:`form`,mode:l.mode,onModeChange:e.setMode,modes:l.modes,className:`min-w-44`})]}),i,(0,U.jsxs)(`label`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,U.jsx)(`span`,{className:`text-label font-medium text-fg-3`,children:`Model`}),(0,U.jsx)(t3,{value:l.model,onChange:e.setModel,models:l.models,className:`min-w-40`})]}),l.reasoningEfforts.length>0?(0,U.jsxs)(`label`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,U.jsx)(`span`,{className:`text-label font-medium text-fg-3`,children:`Effort`}),(0,U.jsxs)(Uy,{items:[{value:`default`,label:`Default`},...l.reasoningEfforts.map(e=>({value:e,label:e}))],value:e.effort||`default`,onValueChange:t=>e.setEffort(t==="default"?``:String(t)),children:[(0,U.jsx)(Ky,{className:`min-w-28`,children:(0,U.jsx)(Wy,{})}),(0,U.jsx)(qy,{children:[`default`,...l.reasoningEfforts].map(e=>(0,U.jsx)(Jy,{value:e,children:(0,U.jsx)(Gy,{children:e})},e))})]})]}):null,a]})]})}var y3=15e3,b3=W2({jobs:[],stats:void 0,enabled:!0,live:!1,error:void 0}),x3=b3.patch,S3;function C3(){return S3??=(async()=>{try{let e=r3();if(!e)return;let[t,n]=await Promise.all([e.listJobs(),e.queueStats()]);x3({jobs:t,stats:n,enabled:!0,error:void 0})}catch(e){let t=e instanceof Error?e.message:String(e);/not configured/i.test(t)?x3({enabled:!1,error:void 0}):x3({error:t})}finally{S3=void 0}})(),S3}var w3=0,T3,E3;function D3(e){let t=b3.subscribe(e);return++w3===1&&(C3(),T3=setInterval(()=>void C3(),y3)),()=>{t(),--w3===0&&(clearInterval(T3),T3=void 0,E3?.(),E3=void 0,x3({live:!1}))}}function O3(){if(E3||!b3.get().enabled||b3.get().stats===void 0||w3===0)return;let e=r3();if(!e)return;let t=e.attachQueue(),n=[t.on(`attached`,()=>void C3()),t.on(`stats`,e=>x3({stats:e})),t.on(`connectionChange`,e=>x3({live:e})),t.on(`event`,e=>{x3({jobs:b3.get().jobs.some(t=>t.id===e.job.id)?b3.get().jobs.map(t=>t.id===e.job.id?e.job:t):[...b3.get().jobs,e.job]})})];E3=()=>{for(let e of n)e();t.detach()}}function k3(){let e=(0,v.useSyncExternalStore)(D3,b3.get,b3.get);return(0,v.useEffect)(O3,[e.enabled,e.stats]),{...e,refresh:C3}}function A3({stats:e}){let t=e.dailyTokenLimit!==void 0&&e.dailyTokenLimit>0?e.dailyTokensUsed/e.dailyTokenLimit*100:void 0;return(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center justify-center gap-x-5 gap-y-2 rounded-md border border-border bg-surface px-3 py-2 text-body-sm text-fg-2`,children:[(0,U.jsxs)(`span`,{children:[`Running`,` `,(0,U.jsxs)(`span`,{className:`font-mono text-fg-1`,children:[e.running,`/`,e.maxConcurrency]})]}),(0,U.jsxs)(`span`,{children:[`Queued `,(0,U.jsx)(`span`,{className:`font-mono text-fg-1`,children:e.queued})]}),e.parked>0?(0,U.jsxs)(`span`,{children:[`Parked `,(0,U.jsx)(`span`,{className:`font-mono text-fg-1`,children:e.parked})]}):null,(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[t===void 0?null:(0,U.jsx)(xS,{value:t,className:t>=95?`text-danger`:t>=80?`text-warning`:`text-fg-3`}),`Daily tokens`,` `,(0,U.jsxs)(`span`,{className:`font-mono text-fg-1`,children:[wD(e.dailyTokensUsed),e.dailyTokenLimit===void 0?``:` / ${wD(e.dailyTokenLimit)}`]})]}),e.sessionTokenLimit===void 0?null:(0,U.jsxs)(`span`,{children:[`Per-job cap `,(0,U.jsx)(`span`,{className:`font-mono text-fg-1`,children:wD(e.sessionTokenLimit)})]}),e.paused?(0,U.jsx)(so,{variant:`warning`,dot:!0,children:`Paused — daily budget exhausted`}):null]})}function j3({onScheduled:e}){let{snapshots:t}=Q4(),n=t.find(e=>e.host.id===r4()?.id)?.sessions??[],r=_3(`job`),[i,a]=(0,v.useState)(`auto`),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(``),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(``),[m,h]=(0,v.useState)(!1),{engine:g}=r,_=async()=>{if(!r.cwd.trim()||!r.prompt.trim()){Xx.error(`Working directory and prompt are required`);return}let t=c.trim()?Number(c.trim()):void 0;if(t!==void 0&&(!Number.isFinite(t)||t<=0)){Xx.error(`Max tokens must be a positive number`);return}let n=u.trim()?Number(u.trim()):void 0;if(n!==void 0&&(!Number.isInteger(n)||n<1)){Xx.error(`Attempts must be a whole number of at least 1`);return}h(!0);try{r.rememberCwd(r.cwd.trim()),await r3().createJob({session:{...r.sessionFields({allowBypass:o}),prompt:r.prompt.trim(),questionBehavior:g.capabilities.interactiveApprovals?i:void 0},maxTokens:t,attempts:n,webhook:f.trim()?{url:f.trim()}:void 0}),r.setPrompt(``),Xx.success(`Job scheduled`),e()}catch(e){Xx.error(e instanceof Error?e.message:`Failed to schedule job`)}finally{h(!1)}};return(0,U.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,U.jsx)(v3,{form:r,sessions:n,promptLabel:`Prompt (the task — runs unattended)`,extras:g.capabilities.interactiveApprovals?(0,U.jsxs)(`label`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,U.jsx)(`span`,{className:`text-label font-medium text-fg-3`,children:`Questions`}),(0,U.jsxs)(Uy,{items:LQ.map(e=>({value:e.value,label:e.label})),value:i,onValueChange:e=>a(e),children:[(0,U.jsx)(Ky,{className:`min-w-36`,children:(0,U.jsx)(Wy,{})}),(0,U.jsx)(qy,{children:LQ.map(e=>(0,U.jsx)(Jy,{value:e.value,children:(0,U.jsx)(Gy,{children:`${e.label} — ${e.description}`})},e.value))})]})]}):null,actions:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`label`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,U.jsx)(`span`,{className:`text-label font-medium text-fg-3`,children:`Max tokens (optional)`}),(0,U.jsx)(po,{value:c,onChange:e=>l(e.target.value),placeholder:`per-job cap`,inputMode:`numeric`,className:`min-w-28 font-mono`})]}),(0,U.jsxs)(`label`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,U.jsx)(`span`,{className:`text-label font-medium text-fg-3`,children:`Attempts (optional)`}),(0,U.jsx)(po,{value:u,onChange:e=>d(e.target.value),placeholder:`1`,inputMode:`numeric`,className:`min-w-20 font-mono`})]}),(0,U.jsxs)(`label`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,U.jsx)(`span`,{className:`text-label font-medium text-fg-3`,children:`Webhook URL (optional)`}),(0,U.jsx)(po,{value:f,onChange:e=>p(e.target.value),placeholder:`https://…/hook`,spellCheck:!1,className:`min-w-44 font-mono`})]}),(0,U.jsxs)(ao,{className:`ml-auto`,onClick:()=>void _(),disabled:m,children:[m?(0,U.jsx)(gS,{className:`size-3.5 text-current`}):(0,U.jsx)(Lv,{className:`size-4`}),`Schedule`]})]})}),g.capabilities.settingSources?(0,U.jsxs)(`label`,{className:`flex w-fit cursor-pointer items-center gap-2 text-body-sm text-fg-2`,title:`Spawns the CLI with --dangerously-skip-permissions available, so the mode can be switched on while watching the run. The job still starts in the mode selected above.`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:o,onChange:e=>s(e.target.checked),className:`size-3.5 accent-(--color-fg-1)`}),`Allow switching to `,(0,U.jsx)(`code`,{className:`font-mono`,children:`bypassPermissions`}),` mid-run`,(0,U.jsx)(`span`,{className:`text-label text-fg-4`,children:`(dangerous)`})]}):null,(0,U.jsxs)(`p`,{className:`text-label text-fg-4`,children:[`Unattended runs still surface permission prompts — the job's page is read-only, so answer them from the session itself, or pick a mode that doesn't ask. Unanswered prompts deny after the server's timeout. With Questions set to Ask, webhook deliveries carry the full question so a controller can answer via `,(0,U.jsx)(`code`,{className:`font-mono`,children:`POST /sessions/:id/permissions/:requestId`}),`.`]})]})}function M3({open:e,onOpenChange:t,onScheduled:n}){return(0,U.jsx)(ix,{open:e,onOpenChange:t,children:(0,U.jsxs)(ax,{size:`lg`,children:[(0,U.jsx)(ox,{title:`Schedule a job`,description:`A one-shot run the queue executes unattended.`}),(0,U.jsx)(sx,{children:e?(0,U.jsx)(j3,{onScheduled:n}):null})]})})}function N3(){let{stats:e,enabled:t,error:n}=k3();return(0,U.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 p-8 text-center`,children:[n?(0,U.jsxs)(`div`,{className:`rounded-md bg-danger-bg px-3 py-2 text-body-sm text-danger`,children:[`Can't reach the worker server: `,n,`. Start it with `,(0,U.jsx)(`code`,{className:`font-mono`,children:`pnpm server`}),`.`]}):null,t?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(yS,{icon:(0,U.jsx)(sv,{}),title:`No job selected`,description:(0,U.jsxs)(U.Fragment,{children:[`Pick one on the left, or schedule one with `,(0,U.jsx)(bS,{children:`+`}),` above.`]})}),e?(0,U.jsx)(`div`,{className:`mt-2 w-full max-w-xl`,children:(0,U.jsx)(A3,{stats:e})}):null]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Kg,{className:`size-8 text-fg-4`}),(0,U.jsx)(`p`,{className:`text-body-sm text-fg-3`,children:`The server has no job queue configured.`}),(0,U.jsxs)(`p`,{className:`max-w-md text-label text-fg-4`,children:[`Pass `,(0,U.jsxs)(`code`,{className:`font-mono`,children:[`queue: `,`{ maxConcurrency, … }`]}),` to`,` `,(0,U.jsx)(`code`,{className:`font-mono`,children:`createWorkerServer`}),` — the dev server enables it by default.`]})]})]})}var P3={queued:{label:`Queued`,variant:`neutral`},running:{label:`Running`,variant:`info`,busy:!0},parked:{label:`Parked`,variant:`accent`},succeeded:{label:`Succeeded`,variant:`success`},failed:{label:`Failed`,variant:`danger`},canceled:{label:`Canceled`,variant:`warning`}},F3=[`queued`,`running`,`parked`];function I3(){let e=kr(),t=gi({select:e=>e.location.pathname.match(/^\/jobs\/(.+)$/)?.[1]}),{jobs:n,enabled:r,live:i,refresh:a}=k3(),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(``),[u,d]=(0,v.useState)(!1),f=c.trim().toLowerCase(),p=[...n].sort((e,t)=>t.createdAt-e.createdAt).filter(e=>(!u||F3.includes(e.status))&&(!f||e.prompt.toLowerCase().includes(f)||e.cwd.toLowerCase().includes(f)||(e.profile?.toLowerCase().includes(f)??!1)||e.id.startsWith(f))),m=n.length-p.length,h=r?(0,U.jsx)(ao,{variant:`ghost`,size:`icon-sm`,"aria-label":`Schedule a job`,onClick:()=>s(!0),children:(0,U.jsx)(Lv,{className:`size-4`})}):void 0;return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(O4,{section:`jobs`,title:`Jobs`,badge:r?(0,U.jsx)(`span`,{"aria-hidden":!0,title:i?`Streaming over the queue socket`:`Polling`,className:W(`size-1.5 shrink-0 rounded-full`,i?`bg-success`:`bg-fg-4`)}):void 0,actions:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(ao,{variant:`ghost`,size:`icon-sm`,"aria-label":`Refresh`,onClick:()=>void a(),children:(0,U.jsx)(Wv,{className:`size-3.5`})}),h]}),railActions:h,children:r?(0,U.jsxs)(U.Fragment,{children:[n.length>0?(0,U.jsxs)(`div`,{className:`flex items-center gap-1 px-2 pb-2`,children:[(0,U.jsx)(po,{value:c,onChange:e=>l(e.target.value),placeholder:`Search jobs`,"aria-label":`Search jobs`,className:`h-7 min-w-0 flex-1 text-body-sm`}),(0,U.jsx)(ao,{variant:u?`default`:`outline`,size:`xs`,"aria-pressed":u,onClick:()=>d(!u),children:`Active`})]}):null,(0,U.jsxs)(k4,{children:[n.length===0?(0,U.jsx)(yS,{icon:(0,U.jsx)(cv,{}),title:`No jobs yet`,description:(0,U.jsxs)(U.Fragment,{children:[`Schedule one with `,(0,U.jsx)(bS,{children:`+`}),` above.`]})}):p.length===0?(0,U.jsx)(yS,{icon:(0,U.jsx)(ey,{}),title:`No matches`,description:`No job matches the active filter.`,action:`Show all`,onAction:()=>d(!1)}):null,p.map(n=>(0,U.jsx)(L3,{job:n,active:n.id===t,onOpen:()=>void e({to:`/jobs/$jobId`,params:{jobId:n.id}}),onChanged:()=>void a()},n.id)),m>0?(0,U.jsxs)(`p`,{className:`px-1 pt-2 text-center text-label text-fg-4`,children:[p.length,` of `,n.length]}):null]})]}):(0,U.jsx)(yS,{icon:(0,U.jsx)(cv,{}),title:`No job queue`,description:`This gateway runs without one, so there is nothing to schedule against.`})}),(0,U.jsx)(M3,{open:o,onOpenChange:s,onScheduled:()=>{s(!1),a()}})]})}function L3({job:e,active:t,onOpen:n,onChanged:r}){let i=P3[e.status],a=e.status===`queued`||e.status===`running`||e.status===`parked`,o=[DD(e.finishedAt??e.startedAt??e.createdAt),e.cwd.split(`/`).filter(Boolean).pop()??e.cwd];return e.profile&&o.push(`@${e.profile}`),e.usage.totalCostUsd>0&&o.push(SD(e.usage.totalCostUsd)),(0,U.jsx)(A4,{active:t,onSelect:n,title:e.prompt,status:(0,U.jsxs)(so,{variant:i.variant,dot:!i.busy,className:`shrink-0`,children:[i.busy?(0,U.jsx)(gS,{className:`size-3 text-current`}):null,i.label]}),description:o.join(` · `),actions:a?(0,U.jsx)(j4,{label:`Cancel job`,onClick:()=>{r3()?.cancelJob(e.id).then(r).catch(e=>Xx.error(e instanceof Error?e.message:`Cancel failed`))},children:(0,U.jsx)(By,{className:`size-3`})}):null})}var R3=[`web_search`,`download`,`web_fetch`,`deliver_file`];function z3(e){return e.split(`,`).map(e=>e.trim()).filter(Boolean)}function B3({label:e,children:t}){return(0,U.jsxs)(`label`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,U.jsx)(`span`,{className:`text-label font-medium text-fg-3`,children:e}),t]})}function V3({onCreated:e}){let[t,n]=(0,v.useState)(`provider`),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(``),[d,f]=(0,v.useState)(``),[p,m]=(0,v.useState)(``),[h,g]=(0,v.useState)(``),[_,y]=(0,v.useState)([]),[b,x]=(0,v.useState)(``),[S,C]=(0,v.useState)(``),[w,T]=(0,v.useState)(!1),E=t===`provider`,D=async()=>{if(!r.trim()){Xx.error(`Name is required`);return}let n={name:r.trim(),engine:t};if(a.trim()&&(n.description=a.trim()),E){n.provider={id:s.trim(),model:l.trim()||void 0,models:z3(d).length>0?z3(d):void 0,apiKeyEnv:p.trim()||void 0};let e={};_.length>0&&(e.capabilities=_),z3(b).length>0&&(e.mcpServers=z3(b)),S.trim()&&(e.instructions=S.trim()),Object.keys(e).length>0&&(n.session=e)}else n.configDir=h.trim();T(!0);try{await r3().createProfile(n),Xx.success(`Profile '${n.name}' created`),e(n.name)}catch(e){Xx.error(e instanceof Error?e.message:`Failed to create profile`)}finally{T(!1)}};return(0,U.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3`,children:[(0,U.jsx)(B3,{label:`Engine`,children:(0,U.jsxs)(Uy,{items:[{value:`provider`,label:`provider`},{value:`claude`,label:`claude`}],value:t,onValueChange:e=>n(e),children:[(0,U.jsx)(Ky,{className:`min-w-32`,children:(0,U.jsx)(Wy,{})}),(0,U.jsxs)(qy,{children:[(0,U.jsx)(Jy,{value:`provider`,children:(0,U.jsx)(Gy,{children:`provider — model-agnostic engine`})}),(0,U.jsx)(Jy,{value:`claude`,children:(0,U.jsx)(Gy,{children:`claude — Agent SDK + config dir`})})]})]})}),(0,U.jsx)(B3,{label:`Name`,children:(0,U.jsx)(po,{value:r,onChange:e=>i(e.target.value),placeholder:`kimi`})}),(0,U.jsx)(B3,{label:`Description (optional)`,children:(0,U.jsx)(po,{value:a,onChange:e=>o(e.target.value),placeholder:`what this profile is for`})})]}),E?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3`,children:[(0,U.jsx)(B3,{label:`Provider id`,children:(0,U.jsx)(po,{value:s,onChange:e=>c(e.target.value),placeholder:`anthropic / openai / moonshotai`,className:`font-mono`})}),(0,U.jsx)(B3,{label:`Default model`,children:(0,U.jsx)(po,{value:l,onChange:e=>u(e.target.value),placeholder:`kimi-k3`,className:`font-mono`})}),(0,U.jsx)(B3,{label:`Models offered (comma-separated)`,children:(0,U.jsx)(po,{value:d,onChange:e=>f(e.target.value),placeholder:`kimi-k3, kimi-k2`,className:`font-mono`})}),(0,U.jsx)(B3,{label:`API key variable`,children:(0,U.jsx)(po,{value:p,onChange:e=>m(e.target.value),placeholder:`MOONSHOT_API_KEY`,className:`font-mono`})})]}),(0,U.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3`,children:[(0,U.jsx)(B3,{label:`Capabilities granted`,children:(0,U.jsx)(`div`,{className:`flex flex-wrap gap-3 py-1.5`,children:R3.map(e=>(0,U.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-1.5 text-body-sm text-fg-2`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:_.includes(e),onChange:t=>y(n=>t.target.checked?[...n,e]:n.filter(t=>t!==e)),className:`size-3.5 accent-(--color-fg-1)`}),(0,U.jsx)(`code`,{className:`font-mono text-label`,children:e})]},e))})}),(0,U.jsx)(B3,{label:`MCP servers (names, comma-separated)`,children:(0,U.jsx)(po,{value:b,onChange:e=>x(e.target.value),placeholder:`deepwiki`,className:`font-mono`})})]}),(0,U.jsx)(B3,{label:`Instructions (optional)`,children:(0,U.jsx)(po,{value:S,onChange:e=>C(e.target.value),placeholder:`prepended to the session's system prompt`})}),(0,U.jsx)(`p`,{className:`text-label text-fg-4`,children:`Leave capabilities and MCP servers empty to inherit whatever the server's engine factory wired — that factory is the ceiling either way, so a grant here can never exceed it. MCP servers are named, never configured: their transport config (and any credentials in it) stays on the server.`})]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(B3,{label:`Config directory`,children:(0,U.jsx)(po,{value:h,onChange:e=>g(e.target.value),placeholder:`/Users/you/.claude`,spellCheck:!1,className:`font-mono`})}),(0,U.jsxs)(`p`,{className:`text-label text-fg-4`,children:[`Must resolve inside the server's `,(0,U.jsx)(`code`,{className:`font-mono`,children:`allowedConfigDirRoots`}),` — a config directory is a credential store, so the server bounds which ones a managed profile may point at.`]})]}),(0,U.jsx)(`div`,{className:`flex justify-end`,children:(0,U.jsxs)(ao,{onClick:()=>void D(),disabled:w,children:[w?(0,U.jsx)(gS,{className:`size-3.5 text-current`}):(0,U.jsx)(Lv,{className:`size-4`}),`Create profile`]})})]})}function H3({open:e,onOpenChange:t,onCreated:n}){return(0,U.jsx)(ix,{open:e,onOpenChange:t,children:(0,U.jsxs)(ax,{size:`lg`,children:[(0,U.jsx)(ox,{title:`New profile`,description:`What a session runs as — a Claude config directory, or a model provider.`}),(0,U.jsx)(sx,{children:e?(0,U.jsx)(V3,{onCreated:n}):null})]})})}function U3(){let e=kr(),t=gi({select:e=>e.location.pathname.match(/^\/profiles\/(.+)$/)?.[1]}),{profiles:n,canManage:r,refresh:i}=u3(),[a,o]=(0,v.useState)(!1),s=r?(0,U.jsx)(ao,{variant:`ghost`,size:`icon-sm`,"aria-label":`New profile`,onClick:()=>o(!0),children:(0,U.jsx)(Lv,{className:`size-4`})}):void 0;return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(O4,{section:`profiles`,title:`Profiles`,badge:n.length>0?(0,U.jsx)(`span`,{className:`shrink-0 text-label text-fg-4`,children:n.length}):void 0,actions:s,railActions:s,children:(0,U.jsxs)(k4,{children:[n.length===0?(0,U.jsx)(yS,{icon:(0,U.jsx)(X_,{}),title:r?`No profiles yet`:`No profiles`,description:r?(0,U.jsxs)(U.Fragment,{children:[`Add one with `,(0,U.jsx)(bS,{children:`+`}),` above.`]}):`This gateway declares none, and this login may not add them.`}):null,n.map(n=>(0,U.jsx)(A4,{active:n.name===t,onSelect:()=>void e({to:`/profiles/$profileName`,params:{profileName:n.name}}),title:n.name,status:n.managed?null:(0,U.jsx)(so,{variant:`neutral`,className:`shrink-0`,children:`declared`}),description:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(s2,{engine:n.engine??`claude`,model:n.defaults?.model??n.provider?.model,className:`size-3 shrink-0 text-fg-3`}),(0,U.jsx)(`span`,{className:`min-w-0 truncate`,children:n.configDir??(n.provider?`${n.provider.id}${n.provider.model?` · ${n.provider.model}`:``}`:n.engine??`claude`)})]})},n.name))]})}),(0,U.jsx)(H3,{open:a,onOpenChange:o,onCreated:t=>{o(!1),i(),e({to:`/profiles/$profileName`,params:{profileName:t}})}})]})}function W3({sessions:e,onCreated:t}){let n=_3(`session`),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(),[s,c]=(0,v.useState)(!1),{engine:l}=n,u=async e=>{let r=e?.cwd??n.cwd.trim();if(!r){Xx.error(`Working directory is required`);return}i(!0);try{n.rememberCwd(r),t((await r3().createSession({...n.sessionFields({prompt:e?void 0:n.prompt.trim()||void 0,resume:e?.sessionId,allowBypass:!0}),cwd:r})).id)}catch(e){Xx.error(e instanceof Error?e.message:`Failed to create session`)}finally{i(!1)}},d=async()=>{if(!n.cwd.trim()){Xx.error(`Set a working directory first — resumable sessions are listed per project`);return}c(!0);try{o(await r3().listSdkSessions({dir:n.cwd.trim(),limit:20,profile:n.profile||void 0}))}catch(e){Xx.error(e instanceof Error?e.message:`Failed to list resumable sessions`)}finally{c(!1)}};return(0,U.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,U.jsx)(v3,{form:n,sessions:e,promptLabel:`Initial prompt (optional)`,onProfileChange:()=>o(void 0),actions:(0,U.jsxs)(ao,{className:`ml-auto`,onClick:()=>void u(),disabled:r,children:[r?(0,U.jsx)(gS,{className:`size-3.5 text-current`}):(0,U.jsx)(Lv,{className:`size-4`}),`Create`]})}),l.capabilities.listSessions?(0,U.jsxs)(`div`,{className:`mt-1 border-t border-border pt-3`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`span`,{className:`text-label font-medium text-fg-3`,children:`Resume a previous session`}),(0,U.jsxs)(ao,{variant:`ghost`,size:`xs`,onClick:()=>void d(),disabled:s,children:[s?(0,U.jsx)(gS,{className:`size-3 text-current`}):(0,U.jsx)(Kv,{className:`size-3`}),a?`Reload`:`Browse`]})]}),a===void 0?null:a.length===0?(0,U.jsx)(`div`,{className:`py-3 text-center text-body-sm text-fg-4`,children:`No stored sessions for this directory.`}):(0,U.jsx)(`ul`,{className:`mt-2 flex flex-col gap-1`,children:a.map(e=>(0,U.jsxs)(`li`,{className:`flex items-center gap-2 rounded-md px-2 py-1.5 hover:bg-surface-hover`,children:[(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(`div`,{className:`truncate text-body-sm text-fg-1`,children:e.customTitle??e.summary}),(0,U.jsxs)(`div`,{className:`flex gap-2 font-mono text-label text-fg-4`,children:[e.gitBranch?(0,U.jsx)(`span`,{className:`truncate`,children:e.gitBranch}):null,(0,U.jsx)(`span`,{className:`shrink-0`,children:DD(e.lastModified)})]})]}),(0,U.jsx)(ao,{variant:`outline`,size:`xs`,onClick:()=>void u(e),disabled:r,children:`Resume`})]},e.sessionId))})]}):null]})}function G3({open:e,onOpenChange:t,sessions:n,onCreated:r}){return(0,U.jsx)(ix,{open:e,onOpenChange:t,children:(0,U.jsxs)(ax,{size:`lg`,children:[(0,U.jsx)(ox,{title:`New session`,description:`Pick a directory and an engine.`}),(0,U.jsx)(sx,{children:(0,U.jsx)(W3,{sessions:n,onCreated:r})})]})})}function K3(){return(0,U.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8`,children:(0,U.jsx)(yS,{icon:(0,U.jsx)(U2,{}),title:`No session open`,description:(0,U.jsxs)(U.Fragment,{children:[`Pick one on the left, or start a new one with `,(0,U.jsx)(bS,{children:`+`}),` above.`]})})})}var q3=`workerdeck.view-config`;function J3(){let[e,t]=(0,v.useState)(()=>({...Yw,...S(q3,{}),search:``,scoped:!1}));return[e,(0,v.useCallback)(e=>{t(e),C(q3,e)},[])]}function Y3(){let e=kr(),t=gi({select:e=>e.location.pathname.match(/^\/sessions\/[^/]+\/(.+)$/)?.[1]??void 0}),n=Or({strict:!1}).subagent,{snapshots:r,refresh:i}=Q4(),a=$4(r),o=YE(a,n4),s=r.filter(e=>e.error!==void 0),c=r4(),l=r.find(e=>e.host.id===c?.id)?.sessions??[],u=t=>{c&&e({to:`/sessions/$hostId/$sessionId`,params:{hostId:c.id,sessionId:t},search:{}})},[d,f]=J3(),[p,m]=(0,v.useState)(!1),[h,g]=(0,v.useState)(E4),_=(0,v.useMemo)(()=>cT(a,d),[a,d]),y=t=>void e({to:`/sessions/$hostId/$sessionId`,params:{hostId:t.hostId,sessionId:t.info.id},search:{}}),b=(0,v.useRef)(0),x=(t,n)=>void e({to:`/sessions/$hostId/$sessionId`,params:{hostId:t.hostId,sessionId:t.info.id},search:{subagent:n,sn:++b.current}}),S=(0,v.useRef)(0),C=(t,n)=>void e({to:`/sessions/$hostId/$sessionId`,params:{hostId:t.hostId,sessionId:t.info.id},search:{reveal:n,rn:++S.current}}),w=(e,t)=>{n4(e.hostId)?.updateSession(e.info.id,{title:t||null}).then(()=>i()).catch(e=>Xx.error(e instanceof Error?e.message:`Rename failed`))},T=(0,U.jsx)(ao,{variant:`ghost`,size:`icon-sm`,"aria-label":`New session`,onClick:()=>m(!0),children:(0,U.jsx)(Lv,{className:`size-4`})});return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(O4,{section:`sessions`,title:`Sessions`,railActions:T,actions:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(ao,{variant:`ghost`,size:`icon-sm`,"aria-label":h?`Hide filters`:`Show filters`,"aria-pressed":h,onClick:()=>{g(!h),D4(!h)},children:(0,U.jsx)(L_,{className:W(`size-3.5`,h&&`fill-current text-fg-1`)})}),(0,U.jsx)(ao,{variant:`ghost`,size:`icon-sm`,"aria-label":`Refresh`,onClick:()=>void i(),children:(0,U.jsx)(Wv,{className:`size-3.5`})}),T]}),rail:_.map(e=>(0,U.jsxs)(`button`,{type:`button`,title:`${Qw(e.info)} — ${e.state}`,"aria-label":Qw(e.info),onClick:()=>y(e),className:W(`flex w-full flex-col items-center gap-0.5 border-l-2 py-1.5`,e.info.id===t?`border-l-accent bg-row-active`:`border-l-transparent hover:bg-row-hover`),children:[(0,U.jsx)(s2,{engine:e.adapter,model:e.info.model,className:`size-4`}),(0,U.jsx)(c2,{row:e})]},e.info.id)),children:[s.map(({host:e,error:t})=>(0,U.jsxs)(`div`,{className:`mx-2 mb-2 rounded-md bg-danger-bg px-2 py-1.5 text-label text-danger`,children:[`Can’t reach `,e.name,`: `,t]},e.id)),(0,U.jsx)(k4,{children:(0,U.jsx)(y2,{rows:a,config:d,onConfigChange:f,showControls:h,projectIcons:o,activeId:t,activeSubagentId:n,onSelect:y,onSelectSubagent:x,onRevealStep:C,onRename:w,onClearContext:e=>{let t=n4(e.hostId);if(!t)return;let n=t.attach(e.info.id,{reconnect:!1}),r=setTimeout(()=>{n.detach(),Xx.error(`Clear failed — the gateway did not answer`)},5e3);n.on(`attached`,()=>{n.clearContext(),setTimeout(()=>{clearTimeout(r),n.detach(),Xx.success(`Context cleared — the previous conversation stays resumable`),i()},150)})},onDelete:e=>{n4(e.hostId)?.deleteSession(e.info.id).then(()=>i()).catch(e=>Xx.error(e instanceof Error?e.message:`Delete failed`))},emptyState:(0,U.jsx)(yS,{icon:(0,U.jsx)(nv,{}),title:`No sessions yet`,description:(0,U.jsxs)(U.Fragment,{children:[`Start one with `,(0,U.jsx)(bS,{children:`+`}),` above.`]})})})})]}),(0,U.jsx)(G3,{open:p,onOpenChange:m,sessions:l,onCreated:e=>{m(!1),u(e),i()}})]})}function X3(){let{snapshots:e}=Q4(),t=R4($4(e));(0,v.useEffect)(()=>{document.title=t>0?`(${t}) workerdeck`:`workerdeck`},[t])}var Z3=[{id:`sessions`,label:`Sessions`,icon:hy,path:`/sessions`,sidebar:Y3},{id:`gateways`,label:`Gateways`,icon:Iv,path:`/gateways`,sidebar:e3},{id:`jobs`,label:`Jobs`,icon:sv,path:`/jobs`,sidebar:I3},{id:`profiles`,label:`Profiles`,icon:jy,path:`/profiles`,sidebar:U3}],Q3=`workerdeck.sidebar-collapsed`;function $3({children:e}){X3();let t=gi({select:e=>e.location.pathname}),n=[...Z3].sort((e,t)=>t.path.length-e.path.length).find(e=>t.startsWith(e.path)),r=n?.sidebar,[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(()=>b(Q3)===`1`),c=()=>{s(e=>(x(Q3,e?`0`:`1`),!e))},l=`flex size-7 items-center justify-center rounded-md text-fg-3 transition-colors outline-none hover:bg-row-hover hover:text-fg-1`,u=e=>W(`flex items-center rounded-md text-body-sm transition-colors outline-none`,o?`justify-center p-2`:`gap-2 px-2 py-1.5`,e?`bg-surface font-medium text-fg-1 shadow-(--shadow-xs)`:`text-fg-3 hover:bg-row-hover hover:text-fg-1`);return(0,U.jsxs)(`div`,{className:`flex h-dvh bg-sidebar`,children:[(0,U.jsxs)(`aside`,{className:W(`flex shrink-0 flex-col gap-1 p-3 transition-[width] duration-150`,o?`w-14 items-center`:`w-52`),children:[(0,U.jsxs)(`div`,{className:W(`flex items-center py-2`,o?`justify-center`:`gap-2 px-2`),children:[(0,U.jsx)(U2,{className:`size-4 shrink-0 text-fg-1`}),!o&&(0,U.jsx)(`span`,{className:`text-body-sm font-semibold tracking-tight text-fg-1`,children:`workerdeck`})]}),(0,U.jsx)(`nav`,{className:W(`mt-1 flex flex-1 flex-col gap-0.5`,o&&`items-center`),children:Z3.map(e=>(0,U.jsxs)(Gr,{to:e.path,title:o?e.label:void 0,"aria-label":e.label,onClick:t=>{e.id===n?.id&&t.preventDefault()},className:u(e.id===n?.id),children:[(0,U.jsx)(e.icon,{className:`size-4 shrink-0`}),!o&&e.label]},e.id))}),(0,U.jsxs)(`div`,{className:W(`mt-1 grid place-items-center gap-1`,o?`grid-rows-3`:`grid-cols-3`),children:[(0,U.jsx)(`button`,{type:`button`,onClick:()=>a(!0),title:`Settings`,"aria-label":`Settings`,className:l,children:(0,U.jsx)(ry,{className:`size-4`})}),(0,U.jsx)(E2,{}),(0,U.jsx)(`button`,{type:`button`,onClick:c,title:o?`Expand sidebar`:`Collapse sidebar`,"aria-label":o?`Expand sidebar`:`Collapse sidebar`,className:l,children:o?(0,U.jsx)(Dv,{className:`size-4`}):(0,U.jsx)(Ov,{className:`size-4`})})]})]}),(0,U.jsxs)(`div`,{className:`app-frame frame-shine m-2 ml-0 flex min-w-0 flex-1 overflow-hidden rounded-xl`,children:[r?(0,U.jsx)(r,{},n?.id):null,(0,U.jsx)(`main`,{className:`flex min-w-0 flex-1 flex-col overflow-hidden`,children:e??(0,U.jsx)(oi,{})})]}),(0,U.jsx)(H2,{open:i,onOpenChange:a})]})}function e6({crumbs:e,actions:t,children:n}){return(0,U.jsxs)(`div`,{className:`flex h-11 shrink-0 items-center gap-2 border-b border-border bg-surface px-3`,children:[(0,U.jsx)(`nav`,{"aria-label":`Breadcrumb`,className:`flex min-w-0 items-center gap-1`,children:e.map((e,t)=>(0,U.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,children:[t>0?(0,U.jsx)(e_,{"aria-hidden":!0,className:`size-3 shrink-0 text-fg-4`}):null,e.to?(0,U.jsx)(Gr,{to:e.to,className:`shrink-0 text-body-sm text-fg-3 outline-none hover:text-fg-1`,children:e.label}):(0,U.jsx)(`span`,{"aria-current":`page`,className:`min-w-0 truncate text-body-sm font-medium text-fg-1`,title:e.label,children:e.label})]},e.label))}),n,(0,U.jsx)(`span`,{className:`flex-1`}),t]})}function t6({children:e}){return(0,U.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:(0,U.jsx)(`div`,{className:`mx-auto flex w-full max-w-3xl flex-col gap-5 px-6 py-6`,children:e})})}function n6({label:e,children:t}){return(0,U.jsxs)(`div`,{className:`flex items-baseline justify-between gap-4 py-1.5`,children:[(0,U.jsx)(`span`,{className:`shrink-0 text-label font-medium text-fg-3`,children:e}),(0,U.jsx)(`span`,{className:`min-w-0 text-right text-body-sm text-fg-1`,children:t})]})}function r6(){let{hostId:e}=Dr({from:`/gateways/$hostId`}),t=kr(),{hosts:n,ready:r}=f4(),{snapshots:i}=Q4(),[a,o]=(0,v.useState)(!1),s=n.find(t=>t.id===e),c=i.find(t=>t.host.id===e);if((0,v.useEffect)(()=>{!r||s||t({to:`/gateways`})},[r,s,t]),!s)return null;let l=c===void 0?`pending`:c.error?`error`:`ok`;return(0,U.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,U.jsx)(e6,{crumbs:[{label:`Gateways`,to:`/gateways`},{label:s.name}],actions:s.implicit?null:(0,U.jsxs)(ao,{variant:`outline`,size:`xs`,onClick:()=>o(!0),children:[(0,U.jsx)(Ty,{className:`size-3`}),`Remove`]}),children:(0,U.jsx)(`span`,{className:`min-w-0 truncate font-mono text-label text-fg-4`,title:s.baseUrl,children:s.baseUrl})}),(0,U.jsxs)(t6,{children:[(0,U.jsxs)(co,{children:[(0,U.jsx)(lo,{children:(0,U.jsx)(uo,{children:`Connection`})}),(0,U.jsxs)(fo,{className:`flex flex-col divide-y divide-border`,children:[(0,U.jsx)(n6,{label:`Status`,children:l===`ok`?(0,U.jsx)(so,{variant:`success`,dot:!0,children:`Connected`}):l===`error`?(0,U.jsx)(so,{variant:`danger`,dot:!0,children:`Unreachable`}):(0,U.jsx)(so,{variant:`neutral`,dot:!0,children:`Connecting…`})}),c?.error?(0,U.jsx)(n6,{label:`Last error`,children:(0,U.jsx)(`span`,{className:`text-danger`,children:c.error})}):null,(0,U.jsx)(n6,{label:`Live sessions`,children:c?c.sessions.length:(0,U.jsx)(`span`,{className:`text-fg-4`,children:`—`})}),(0,U.jsx)(n6,{label:`Reachability`,children:a4(s)?`This machine (loopback)`:`Remote`}),(0,U.jsx)(n6,{label:`Credential`,children:s.implicit?(0,U.jsx)(`span`,{className:`text-fg-4`,children:`the login cookie it set — same origin`}):(0,U.jsx)(`span`,{className:`text-fg-4`,children:`an auth key held in this browser`})})]})]}),s.implicit?(0,U.jsx)(`p`,{className:`text-label text-fg-4`,children:`This is the gateway that served the page. Its address is this origin and its credential is the cookie it already set, so there is nothing here to change — and nothing to remove, since removing it would just be closing the tab.`}):(0,U.jsxs)(co,{children:[(0,U.jsx)(lo,{children:(0,U.jsx)(uo,{children:`Settings`})}),(0,U.jsx)(fo,{children:(0,U.jsx)(h4,{host:s,onSaved:e=>Xx.success(`Saved ${e.name}`)},s.id)})]}),a?(0,U.jsx)(v4,{host:s,onClose:()=>o(!1),onRemoved:()=>{o(!1),t({to:`/gateways`})}}):null]})]})}function i6(){return(0,U.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8`,children:(0,U.jsx)(yS,{icon:(0,U.jsx)(Iv,{}),title:`No gateway selected`,description:(0,U.jsxs)(U.Fragment,{children:[`Pick one on the left, or add one with `,(0,U.jsx)(bS,{children:`+`}),` above.`]})})})}function a6({files:e,activePath:t,onActivate:n,onClose:r,className:i}){return(0,U.jsx)(jx,{delay:500,closeDelay:0,children:(0,U.jsx)(`div`,{"data-slot":`editor-tabs`,role:`tablist`,"aria-label":`Open files`,className:W(`flex shrink-0 items-stretch overflow-x-auto border-b border-border bg-surface`,i),children:e.map(i=>(0,U.jsx)(o6,{file:i,active:i.path===t,onActivate:()=>n(i.path),onClose:()=>r(i.path),onArrow:t=>{let r=e[e.findIndex(e=>e.path===i.path)+t];r&&n(r.path)}},i.path))})})}function o6({file:e,active:t,onActivate:n,onClose:r,onArrow:i}){let a=$E(e),o=(0,v.useRef)(null);return(0,v.useEffect)(()=>{t&&o.current?.scrollIntoView({block:`nearest`,inline:`nearest`})},[t]),(0,U.jsxs)(Nx,{side:`bottom`,render:(0,U.jsx)(`div`,{ref:o,role:`tab`,tabIndex:t?0:-1,"aria-selected":t,onClick:n,onAuxClick:e=>{e.button===1&&(e.preventDefault(),r())},onKeyDown:e=>{if(e.key===`ArrowRight`)i(1);else if(e.key===`ArrowLeft`)i(-1);else if(e.key===`Enter`||e.key===` `)n();else return;e.preventDefault()},className:W(`group flex min-w-0 shrink-0 cursor-pointer items-center gap-1.5 border-r border-border px-3 py-1.5 transition-colors`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent focus-visible:ring-inset`,t?`bg-bg text-fg-1`:`text-fg-3 hover:bg-surface-hover hover:text-fg-2`)}),content:(0,U.jsxs)(`span`,{className:`flex flex-col gap-0.5`,children:[(0,U.jsx)(`span`,{className:`font-mono break-all`,children:e.path}),e.bytes===void 0?null:(0,U.jsx)(`span`,{className:`text-fg-4`,children:TD(e.bytes)})]}),children:[(0,U.jsx)(`span`,{className:W(`max-w-40 truncate font-mono text-label`,a&&`italic`),children:e.name}),e.status===`error`?(0,U.jsx)(`span`,{className:`shrink-0 text-danger`,children:`!`}):null,(0,U.jsxs)(`button`,{type:`button`,"aria-label":a?`Close ${e.name} (unsaved changes)`:`Close ${e.name}`,onClick:e=>{e.stopPropagation(),r()},className:W(`shrink-0 rounded p-0.5 text-fg-4 transition-opacity hover:bg-surface-hover hover:text-fg-1`,t||a?`opacity-70`:`opacity-0 group-hover:opacity-70 focus-visible:opacity-100`),children:[(0,U.jsx)(`span`,{className:W(`block`,a&&`group-hover:hidden`),children:a?(0,U.jsx)(`span`,{className:`block size-3 rounded-full bg-fg-2`}):(0,U.jsx)(By,{className:`size-3`})}),a?(0,U.jsx)(`span`,{className:`hidden group-hover:block`,children:(0,U.jsx)(By,{className:`size-3`})}):null]})]})}var s6=12;function c6({tree:e,search:t,activePath:n,onOpenFile:r,onCollapse:i,style:a,className:o}){let[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(),d=s.trim().length>0;return(0,v.useEffect)(()=>{if(!t?.available)return;let e=s.trim();if(!e){u(void 0);return}let n=new AbortController,r=setTimeout(()=>{t.search(e,{limit:60,signal:n.signal}).then(e=>{n.signal.aborted||u(e)})},150);return()=>{n.abort(),clearTimeout(r)}},[t,s]),(0,U.jsxs)(`div`,{"data-slot":`file-tree`,style:a,className:W(`flex min-h-0 min-w-0 flex-col bg-surface`,o),children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-1 px-2 pt-2`,children:[t?.available?(0,U.jsxs)(`div`,{className:`relative min-w-0 flex-1`,children:[(0,U.jsx)(ty,{className:`absolute top-1/2 left-2 size-3.5 -translate-y-1/2 text-fg-4`}),(0,U.jsx)(po,{value:s,onChange:e=>c(e.target.value),placeholder:`Search files…`,className:`h-7 pr-7 pl-7 text-label`,spellCheck:!1}),d?(0,U.jsx)(`button`,{type:`button`,onClick:()=>c(``),"aria-label":`Clear search`,className:`absolute top-1/2 right-1.5 -translate-y-1/2 text-fg-4 transition-colors hover:text-fg-2`,children:(0,U.jsx)(By,{className:`size-3.5`})}):null]}):(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate px-1 text-label text-fg-4`,children:e.root}),(0,U.jsx)(ao,{variant:`ghost`,size:`icon-sm`,"aria-label":`Refresh the file tree`,onClick:()=>e.refresh(),children:(0,U.jsx)(Wv,{className:`size-3.5 text-fg-3`})}),i?(0,U.jsx)(ao,{variant:`ghost`,size:`icon-sm`,"aria-label":`Hide project files`,onClick:i,children:(0,U.jsx)(Ov,{className:`size-3.5 text-fg-3`})}):null]}),(0,U.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto px-1 py-1`,children:e.error?(0,U.jsx)(`p`,{className:`px-2 py-3 text-body-sm text-danger`,children:e.error}):d?l===void 0?(0,U.jsx)(`div`,{className:`py-6 text-center`,children:(0,U.jsx)(gS,{className:`size-4 text-fg-4`})}):l.length===0?(0,U.jsx)(`p`,{className:`px-2 py-6 text-center text-body-sm text-fg-4`,children:`No matching files.`}):(0,U.jsx)(`ul`,{children:l.map(e=>(0,U.jsx)(`li`,{children:(0,U.jsx)(l6,{label:u6(e.relative),detail:d6(e.relative),title:e.relative,icon:(0,U.jsx)(k_,{className:`size-3.5 shrink-0 text-fg-4`}),active:e.path===n,onClick:()=>r(e.path)})},e.path))}):e.loading?(0,U.jsx)(`div`,{className:`py-6 text-center`,children:(0,U.jsx)(gS,{className:`size-4 text-fg-4`})}):e.rows.length===0?(0,U.jsx)(`p`,{className:`px-2 py-6 text-center text-body-sm text-fg-4`,children:`This project is empty.`}):(0,U.jsx)(`ul`,{role:`tree`,"aria-label":`Project files`,children:e.rows.map(t=>(0,U.jsxs)(`li`,{role:`treeitem`,"aria-expanded":t.expanded,"aria-level":t.depth+1,children:[(0,U.jsx)(l6,{label:t.entry.name,indent:t.depth,active:t.entry.path===n,icon:t.entry.type===`dir`?t.loading?(0,U.jsx)(gS,{className:`size-3.5 shrink-0 text-fg-4`}):t.expanded?(0,U.jsx)(N_,{className:`size-3.5 shrink-0 text-accent`}):(0,U.jsx)(I_,{className:`size-3.5 shrink-0 text-accent`}):(0,U.jsx)(nQ,{type:t.entry.type}),chevron:t.entry.type===`dir`?(0,U.jsx)(e_,{className:W(`size-3 shrink-0 text-fg-4 transition-transform`,t.expanded&&`rotate-90`)}):void 0,onClick:()=>t.entry.type===`dir`?e.toggle(t.entry.path):r(t.entry.path)}),t.truncated?(0,U.jsx)(`p`,{className:`truncate py-0.5 text-label text-fg-4`,style:{paddingLeft:(t.depth+1)*s6+22},children:`More entries than the server will return — use search.`}):null]},t.entry.path))})})]})}function l6({label:e,detail:t,title:n,icon:r,chevron:i,indent:a=0,active:o,onClick:s}){let c=(0,v.useRef)(null);return(0,v.useEffect)(()=>{o&&c.current?.scrollIntoView({block:`nearest`})},[o]),(0,U.jsxs)(`button`,{ref:c,type:`button`,onClick:s,title:n??e,style:{paddingLeft:a*s6+4},className:W(`flex w-full items-center gap-1 rounded py-1 pr-2 text-left transition-colors`,o?`bg-surface-hover text-fg-1`:`text-fg-2 hover:bg-surface-hover`),children:[(0,U.jsx)(`span`,{className:`flex size-3 shrink-0 items-center justify-center`,children:i}),r,(0,U.jsx)(`span`,{className:`shrink-0 truncate text-label`,children:e}),t?(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-label text-fg-4`,children:t}):null]})}function u6(e){return e.slice(e.lastIndexOf(`/`)+1)}function d6(e){let t=e.lastIndexOf(`/`);return t===-1?void 0:e.slice(0,t)}function f6({path:e,value:t,onChange:n,onSave:r,readOnly:i,className:a}){let o=(0,v.useRef)(null),s=(0,v.useRef)(null),c=(0,v.useRef)(null),[l,u]=(0,v.useState)(!1),d=p6(),f=(0,v.useRef)({onChange:n,onSave:r});return f.current={onChange:n,onSave:r},(0,v.useEffect)(()=>{let n=!1;return g6().then(r=>{if(n||!o.current)return;c.current=r;let a=r.editor.create(o.current,{value:t,language:_6(e),readOnly:i,automaticLayout:!0,theme:m6(document.documentElement.getAttribute(`data-theme`)),minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:12,lineHeight:20,fontFamily:`ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace`,renderLineHighlight:`line`,smoothScrolling:!0,padding:{top:8,bottom:8},scrollbar:{verticalScrollbarSize:10,horizontalScrollbarSize:10},wordBasedSuggestions:`off`,quickSuggestions:!1});s.current=a,a.onDidChangeModelContent(()=>{f.current.onChange?.(a.getValue())}),a.addCommand(r.KeyMod.CtrlCmd|r.KeyCode.KeyS,()=>{f.current.onSave?.()}),u(!0)}),()=>{n=!0,s.current?.dispose(),s.current=null,u(!1)}},[]),(0,v.useEffect)(()=>{let n=c.current,r=s.current;if(!n||!r||!l)return;let i=n.Uri.parse(`workerdeck://host${e}`),a=n.editor.getModel(i)??n.editor.createModel(t,_6(e),i);r.getModel()!==a&&r.setModel(a)},[e,l,t]),(0,v.useEffect)(()=>{let e=s.current;if(!e||!l)return;let n=e.getModel();!n||n.getValue()===t||n.pushEditOperations([],[{range:n.getFullModelRange(),text:t}],()=>null)},[t,l]),(0,v.useEffect)(()=>{l&&s.current?.updateOptions({readOnly:i})},[i,l]),(0,v.useEffect)(()=>{l&&c.current?.editor.setTheme(m6(d))},[d,l]),(0,U.jsxs)(`div`,{className:W(`relative min-h-0 min-w-0 flex-1`,a),children:[(0,U.jsx)(`div`,{ref:o,className:`absolute inset-0`}),l?null:(0,U.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-bg`,children:(0,U.jsx)(gS,{className:`size-4 text-fg-4`})})]})}function p6(){let[e,t]=(0,v.useState)(()=>typeof document>`u`?null:document.documentElement.getAttribute(`data-theme`));return(0,v.useEffect)(()=>{let e=document.documentElement,n=()=>t(e.getAttribute(`data-theme`));n();let r=new MutationObserver(n);return r.observe(e,{attributes:!0,attributeFilter:[`data-theme`]}),()=>r.disconnect()},[]),e}function m6(e){return e===`light`?`wd-light`:`wd-dark`}var h6;function g6(){return h6??=(async()=>{let e=await lD(()=>import(`./vs-CgLI4CIR.js`).then(e=>e.t),__vite__mapDeps([0,1]));return e.editor.defineTheme(`wd-dark`,{base:`vs-dark`,inherit:!0,rules:[],colors:{"editor.background":`#00000000`}}),e.editor.defineTheme(`wd-light`,{base:`vs`,inherit:!0,rules:[],colors:{"editor.background":`#00000000`}}),e})(),h6}function _6(e){let t=e.slice(e.lastIndexOf(`/`)+1);return v6[t.toLowerCase()]||(y6[t.slice(t.lastIndexOf(`.`)+1).toLowerCase()]??`plaintext`)}var v6={dockerfile:`dockerfile`,makefile:`plaintext`,".gitignore":`plaintext`,".env":`shell`},y6={ts:`typescript`,tsx:`typescript`,mts:`typescript`,cts:`typescript`,js:`javascript`,jsx:`javascript`,mjs:`javascript`,cjs:`javascript`,json:`json`,jsonc:`json`,md:`markdown`,mdx:`markdown`,css:`css`,scss:`scss`,less:`less`,html:`html`,htm:`html`,xml:`xml`,svg:`xml`,yml:`yaml`,yaml:`yaml`,toml:`plaintext`,sh:`shell`,bash:`shell`,zsh:`shell`,fish:`shell`,py:`python`,rb:`ruby`,rs:`rust`,go:`go`,swift:`swift`,java:`java`,kt:`kotlin`,c:`c`,h:`c`,cpp:`cpp`,cc:`cpp`,hpp:`cpp`,cs:`csharp`,php:`php`,sql:`sql`,graphql:`graphql`,gql:`graphql`,lua:`lua`,r:`r`,pl:`perl`,dart:`dart`,scala:`scala`,ini:`ini`,cfg:`ini`,conf:`ini`,txt:`plaintext`,log:`plaintext`};function b6({file:e,canWrite:t,onChange:n,onSave:r,onRevert:i,onReload:a,onOverwrite:o,onDismissConflict:s,className:c}){return e?(0,U.jsxs)(`div`,{"data-slot":`file-viewer`,className:W(`flex min-h-0 min-w-0 flex-1 flex-col bg-bg`,c),children:[e.conflict?(0,U.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2 border-b border-warning/40 bg-warning-bg px-3 py-2`,children:[(0,U.jsx)(Dy,{className:`size-3.5 shrink-0 text-warning`}),(0,U.jsx)(`span`,{className:`min-w-0 flex-1 text-body-sm text-warning`,children:`This file changed on disk since you opened it.`}),(0,U.jsx)(ao,{variant:`outline`,size:`xs`,onClick:()=>a?.(e.path),children:`Use the version on disk`}),(0,U.jsx)(ao,{variant:`outline`,size:`xs`,onClick:()=>o?.(e.path),children:`Keep mine`}),(0,U.jsx)(ao,{variant:`ghost`,size:`xs`,onClick:()=>s?.(e.path),children:`Dismiss`})]}):e.saveError?(0,U.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-danger/40 bg-danger-bg px-3 py-2`,children:[(0,U.jsx)(Dy,{className:`size-3.5 shrink-0 text-danger`}),(0,U.jsx)(`span`,{className:`min-w-0 flex-1 text-body-sm text-danger`,children:e.saveError}),(0,U.jsx)(ao,{variant:`ghost`,size:`xs`,onClick:()=>s?.(e.path),children:`Dismiss`})]}):null,e.status===`loading`?(0,U.jsx)(x6,{children:(0,U.jsx)(gS,{className:`size-4 text-fg-4`})}):e.status===`error`?(0,U.jsxs)(x6,{children:[(0,U.jsx)(Dy,{className:`size-4 text-danger`}),(0,U.jsx)(`p`,{className:`text-body-sm text-danger`,children:e.error})]}):e.status===`binary`?(0,U.jsxs)(x6,{children:[(0,U.jsx)(D_,{className:`size-4 text-fg-4`}),(0,U.jsx)(`p`,{className:`text-body-sm text-fg-4`,children:`This file isn’t text.`}),(0,U.jsx)(`p`,{className:`text-label text-fg-4`,children:`It can’t be edited here without corrupting it.`})]}):(0,U.jsx)(f6,{path:e.path,value:eD(e),readOnly:!t,onChange:n?t=>n(e.path,t):void 0,onSave:r?()=>r(e.path):void 0}),e.status===`ready`&&(e.saving||$E(e)||!t)?(0,U.jsx)(`div`,{className:`flex shrink-0 items-center gap-2 border-t border-border px-3 py-1`,children:e.saving?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(gS,{className:`size-3 text-fg-4`}),(0,U.jsx)(`span`,{className:`text-label text-fg-4`,children:`Saving…`})]}):t?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{className:`text-label text-fg-3`,children:`Unsaved changes`}),(0,U.jsx)(`span`,{className:`flex-1`}),(0,U.jsx)(ao,{variant:`ghost`,size:`xs`,onClick:()=>i?.(e.path),children:`Revert`}),(0,U.jsxs)(ao,{variant:`outline`,size:`xs`,onClick:()=>r?.(e.path),children:[`Save`,(0,U.jsx)(`span`,{className:`ml-1 text-fg-4`,children:`⌘S`})]})]}):(0,U.jsx)(`span`,{className:`text-label text-fg-4`,children:`Read-only — this gateway doesn’t allow writes.`})}):null]}):null}function x6({children:e}){return(0,U.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col items-center justify-center gap-2 p-6`,children:e})}var S6=`wd-path-link`,C6=/^(\/[^\s:'"`()[\]{}]+|[\w.@~-]+(?:\/[\w.@~-]+)+)(?::(\d+))?$/,w6=/^([\w.@-]+\.[A-Za-z0-9]{1,10})(?::(\d+))?$/,T6=.6;function E6(e,t){let n=e.trim();if(!n||n.endsWith(`/`))return;let r=C6.exec(n)??(t?w6.exec(n):null);if(r)return{path:r[1],line:r[2]?Number(r[2]):void 0}}function D6(e){if(!e)return;let t=e.closest(`code`)!==null,n=e.textContent??``,r=E6(n,t);if(r&&!(!t&&r.path.length<n.trim().length*T6))return r}function O6({container:e,onOpen:t,enabled:n=!0,ignore:r}){(0,v.useEffect)(()=>{let i=e.current;if(!i||!n)return;let a=e=>r!==void 0&&e?.closest(r)!==null&&e!==void 0,o,s=()=>{o?.classList.remove(S6),o=void 0},c=e=>{if(!e.metaKey&&!e.ctrlKey)return;let n=e.target instanceof HTMLElement?e.target:void 0;if(a(n))return;let r=D6(n);r&&(e.preventDefault(),e.stopPropagation(),s(),t(r))},l=e=>{if(!e.metaKey&&!e.ctrlKey)return s();let t=e.target instanceof HTMLElement?e.target:void 0;t!==o&&(s(),!(!t||a(t)||!D6(t))&&(o=t,t.classList.add(S6)))},u=e=>{!e.metaKey&&!e.ctrlKey&&s()};return i.addEventListener(`click`,c,!0),i.addEventListener(`mousemove`,l),document.addEventListener(`keydown`,u),document.addEventListener(`keyup`,u),window.addEventListener(`blur`,s),()=>{s(),i.removeEventListener(`click`,c,!0),i.removeEventListener(`mousemove`,l),document.removeEventListener(`keydown`,u),document.removeEventListener(`keyup`,u),window.removeEventListener(`blur`,s)}},[e,t,n,r])}function k6(e,t){return e.startsWith(`/`)||!t?e:`${t.replace(/\/$/,``)}/${e.replace(/^\.\//,``)}`}var A6=180,j6=520,M6=220,N6=120;function P6({client:e,sessionId:t,header:n,transcriptVariant:r,transcriptDensity:i,transcriptFont:a,scrubber:o,bookmarks:s,onToggleBookmark:c,stickyPrompt:l,openSubagent:u,reveal:d,onSubagentChange:f,statusPlacement:p,controlsSurface:m,fontSize:h,onLinkClick:g,unseen:_,readOnly:y,onVitals:b,defaultRailWidth:x=260,defaultRailCollapsed:S,onRailChange:C,className:w}){let{info:T}=QE(e,t),E=T?.cwd,D=GE(e,E),O=UE(e,E),k=aD(e),{canWrite:A}=WE(e);(0,v.useEffect)(()=>{if(!k.hasUnsaved)return;let e=e=>e.preventDefault();return window.addEventListener(`beforeunload`,e),()=>window.removeEventListener(`beforeunload`,e)},[k.hasUnsaved]);let j=I6(),[M,N]=(0,v.useState)(S??!1),[P,F]=(0,v.useState)(x),I=(0,v.useRef)(C);I.current=C,(0,v.useEffect)(()=>{I.current?.({width:P,collapsed:M})},[P,M]);let[L,ee]=(0,v.useState)(360),R=k.files.length>0,te=!j,z=D.available&&!M;(0,v.useEffect)(()=>{te&&N(!0)},[te]);let B=(0,v.useCallback)(e=>{let t=k.files.find(t=>t.path===e);if(t&&$E(t)){let e=t.name;if(!window.confirm(`${e} has unsaved changes. Close it and lose them?`))return}k.close(e)},[k]),V=(0,v.useRef)(null),ne=F6(V);O6({container:V,onOpen:(0,v.useCallback)(({path:e})=>k.open(k6(e,E)),[k.open,E]),enabled:D.available,ignore:`.monaco-editor`});let H=Math.max(N6,ne-M6),[re,ie]=(0,v.useState)(null),ae=n===void 0||re===null?void 0:typeof n==`function`?e=>(0,td.createPortal)(n(e),re):(0,td.createPortal)(n,re);return(0,U.jsxs)(`div`,{"data-slot":`session-workspace`,className:W(`flex h-full min-h-0 w-full flex-col overflow-hidden bg-bg`,w),children:[n===void 0?null:(0,U.jsx)(`div`,{ref:ie,className:`shrink-0`}),(0,U.jsxs)(`div`,{className:`relative flex min-h-0 flex-1`,children:[z?(0,U.jsx)(c6,{tree:D,search:O,activePath:k.activePath,onOpenFile:k.open,onCollapse:()=>N(!0),style:{width:te?Math.min(P,320):P},className:W(`shrink-0 border-r border-border`,te&&`absolute inset-y-0 left-0 z-20 shadow-lg`)}):D.available?(0,U.jsx)(`div`,{className:`flex w-8 shrink-0 flex-col items-center border-r border-border bg-surface pt-1.5`,children:(0,U.jsx)(ao,{variant:`ghost`,size:`icon-sm`,"aria-label":`Show project files`,onClick:()=>N(!1),children:(0,U.jsx)(Dv,{className:`size-4 text-fg-3`})})}):null,z&&!te?(0,U.jsx)(vS,{orientation:`vertical`,value:P,onValueChange:F,min:A6,max:j6,defaultValue:x,"aria-label":`Resize the file tree`}):null,(0,U.jsxs)(`div`,{ref:V,className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:[R?(0,U.jsxs)(`div`,{className:`flex min-h-0 shrink-0 flex-col overflow-hidden`,style:{height:Math.min(L,H||L)},children:[(0,U.jsx)(a6,{files:k.files,activePath:k.activePath,onActivate:k.activate,onClose:B}),(0,U.jsx)(b6,{file:k.active,canWrite:A,onChange:k.edit,onSave:e=>void k.save(e),onRevert:k.revert,onReload:k.reload,onOverwrite:e=>void k.overwrite(e),onDismissConflict:k.dismissConflict})]}):null,R?(0,U.jsx)(vS,{orientation:`horizontal`,value:Math.min(L,H||L),onValueChange:ee,min:N6,max:H,"aria-label":`Resize the open file`}):null,(0,U.jsx)(J0,{client:e,sessionId:t,header:ae,transcriptVariant:r,transcriptDensity:i,transcriptFont:a,scrubber:o,bookmarks:s,onToggleBookmark:c,stickyPrompt:l,openSubagent:u,reveal:d,onSubagentChange:f,controlsSurface:m,fontSize:h,onLinkClick:g,statusPlacement:p,unseen:_,readOnly:y,onVitals:b,className:`min-h-0 flex-1`})]}),te&&z?(0,U.jsx)(`button`,{type:`button`,"aria-label":`Close the file tree`,onClick:()=>N(!0),className:`absolute inset-0 z-10 bg-black/30`}):null]})]})}function F6(e){let[t,n]=(0,v.useState)(0);return(0,v.useLayoutEffect)(()=>{let t=e.current;if(!t)return;let r=new ResizeObserver(([e])=>{e&&n(e.contentRect.height)});return r.observe(t),()=>r.disconnect()},[e]),t}function I6(){let[e,t]=(0,v.useState)(!0);return(0,v.useEffect)(()=>{let e=window.matchMedia(`(min-width: 768px)`),n=()=>t(e.matches);return n(),e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}var L6=`workerdeck.rail`,R6={width:260,collapsed:!1};function z6(){let e=S(L6,{});return{width:Math.min(520,Math.max(180,Number(e.width)||R6.width)),collapsed:e.collapsed===!0}}function B6(e){C(L6,e)}function V6(){let{jobId:e}=Dr({from:`/jobs/$jobId`}),t=kr(),{jobs:n,refresh:r}=k3(),{snapshots:i}=Q4(),a=n.find(t=>t.id===e),o=r3(),s=r4()?.id,c=a?.sessionId!==void 0&&(i.find(e=>e.host.id===s)?.sessions.some(e=>e.id===a.sessionId)??!1),[l,u]=(0,v.useState)(!1);(0,v.useEffect)(()=>{n.length>0&&u(!0)},[n.length]),(0,v.useEffect)(()=>{!l||a||(Xx.error(`That job is no longer in the queue`),t({to:`/jobs`}))},[l,a,t]);let[d]=(0,v.useState)(k2),[f]=(0,v.useState)(M2),[p]=(0,v.useState)(F2),[m]=(0,v.useState)(R2),[h]=(0,v.useState)(z6);if(!a)return null;let g=(0,U.jsx)(H6,{job:a,onChanged:()=>void r()});return!o||!c||!a.sessionId?(0,U.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[g,(0,U.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-2 p-8 text-center`,children:[(0,U.jsx)(`p`,{className:`text-body-sm text-fg-3`,children:a.sessionId?`This job’s session is no longer on the gateway.`:`This job never got as far as a session.`}),(0,U.jsx)(`p`,{className:`max-w-md text-label text-fg-4`,children:`The queue keeps the job record — status, usage, error — but the transcript lives with the session, and that one has been closed or swept.`})]})]}):(0,U.jsx)(P6,{client:o,sessionId:a.sessionId,readOnly:!0,transcriptVariant:f,transcriptDensity:d,transcriptFont:p,fontSize:m,scrubber:!0,stickyPrompt:!0,statusPlacement:`bottom`,defaultRailWidth:h.width,defaultRailCollapsed:h.collapsed,onRailChange:B6,header:({actions:e})=>(0,U.jsx)(H6,{job:a,onChanged:()=>void r(),actions:e})},a.sessionId)}function H6({job:e,onChanged:t,actions:n}){let r=P3[e.status],i=e.status===`queued`||e.status===`running`||e.status===`parked`,a=async()=>{try{await r3().cancelJob(e.id),t()}catch(e){Xx.error(e instanceof Error?e.message:`Cancel failed`)}};return(0,U.jsxs)(e6,{crumbs:[{label:`Jobs`,to:`/jobs`},{label:e.prompt}],actions:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(so,{variant:`neutral`,className:`shrink-0`,children:`read-only`}),(0,U.jsx)(hS,{value:e.id,"aria-label":`Copy job id`}),i?(0,U.jsxs)(ao,{variant:`outline`,size:`xs`,onClick:()=>void a(),children:[(0,U.jsx)(By,{className:`size-3`}),`Cancel`]}):null,n]}),children:[(0,U.jsxs)(so,{variant:r.variant,dot:!r.busy,className:`shrink-0`,children:[r.busy?(0,U.jsx)(gS,{className:`size-3 text-current`}):null,r.label]}),(0,U.jsxs)(`div`,{className:`flex min-w-0 items-center gap-x-3 font-mono text-label text-fg-4`,children:[(0,U.jsx)(`span`,{className:`truncate`,children:e.cwd}),e.profile?(0,U.jsxs)(`span`,{className:`shrink-0`,children:[`@`,e.profile]}):null,(0,U.jsx)(`span`,{className:`shrink-0`,children:DD(e.finishedAt??e.startedAt??e.createdAt)}),e.maxAttempts!==void 0&&e.maxAttempts>1?(0,U.jsxs)(`span`,{className:`shrink-0`,children:[`attempt `,e.attempt??1,`/`,e.maxAttempts,e.status===`queued`&&e.nextRunAt!==void 0&&e.nextRunAt>Date.now()?` — retry pending`:``]}):null,e.usage.tokens>0?(0,U.jsxs)(`span`,{className:`shrink-0`,children:[wD(e.usage.tokens),` tok`]}):null,e.usage.totalCostUsd>0?(0,U.jsx)(`span`,{className:`shrink-0`,children:SD(e.usage.totalCostUsd)}):null,e.error?(0,U.jsx)(`span`,{className:`truncate text-danger`,children:e.error}):null]})]})}function U6({profile:e,onSaved:t}){let n=e.engine===`provider`,[r,i]=(0,v.useState)(e.description??``),[a,o]=(0,v.useState)(e.defaults?.model??``),[s,c]=(0,v.useState)(e.defaults?.permissionMode),[l,u]=(0,v.useState)(e.provider?.model??``),[d,f]=(0,v.useState)((e.provider?.models??[]).join(`, `)),[p,m]=(0,v.useState)(e.session?.capabilities),[h,g]=(0,v.useState)((e.session?.mcpServers??[]).join(`, `)),[_,y]=(0,v.useState)(e.session?.instructions??``),[b,x]=(0,v.useState)(!1),S=i3(e,s??`default`,a),C=S.models.map(t=>t.value==="default"?{...t,displayName:`Unset`,description:e.defaultModel??`whatever the engine's own config picks`}:t),w=async()=>{let i={description:r.trim()||void 0,defaults:{model:a.trim()||void 0,permissionMode:s}};n&&(i.provider={...e.provider,id:e.provider?.id??``,model:l.trim()||void 0,models:z3(d).length>0?z3(d):void 0},i.session={capabilities:p,mcpServers:z3(h).length>0?z3(h):void 0,instructions:_.trim()||void 0}),x(!0);try{t(await r3().updateProfile(e.name,i)),Xx.success(`Profile saved`)}catch(e){Xx.error(e instanceof Error?e.message:`Failed to save profile`)}finally{x(!1)}};return(0,U.jsxs)(co,{children:[(0,U.jsx)(lo,{children:(0,U.jsx)(uo,{children:`Edit profile`})}),(0,U.jsxs)(fo,{className:`flex flex-col gap-3`,children:[(0,U.jsx)(B3,{label:`Description`,children:(0,U.jsx)(po,{value:r,onChange:e=>i(e.target.value)})}),(0,U.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3`,children:[(0,U.jsx)(B3,{label:`Default model`,children:C.length>1?(0,U.jsx)(t3,{value:a,onChange:o,models:C}):(0,U.jsx)(po,{value:a,onChange:e=>o(e.target.value),placeholder:`unset — request / engine default`,className:`font-mono`})}),(0,U.jsx)(B3,{label:`Default permission mode`,children:(0,U.jsx)(CQ,{variant:`form`,mode:s,onModeChange:c,modes:S.modes})})]}),n?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3`,children:[(0,U.jsx)(B3,{label:`Default model id`,children:(0,U.jsx)(po,{value:l,onChange:e=>u(e.target.value),className:`font-mono`})}),(0,U.jsx)(B3,{label:`Models offered (comma-separated)`,children:(0,U.jsx)(po,{value:d,onChange:e=>f(e.target.value),className:`font-mono`})})]}),(0,U.jsx)(B3,{label:`Capabilities granted`,children:(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 py-1.5`,children:[(0,U.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-1.5 text-body-sm text-fg-2`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:p===void 0,onChange:e=>m(e.target.checked?void 0:[]),className:`size-3.5 accent-(--color-fg-1)`}),`not declared`]}),R3.map(e=>(0,U.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-1.5 text-body-sm text-fg-2`,children:[(0,U.jsx)(`input`,{type:`checkbox`,disabled:p===void 0,checked:p?.includes(e)??!1,onChange:t=>m(n=>t.target.checked?[...n??[],e]:(n??[]).filter(t=>t!==e)),className:`size-3.5 accent-(--color-fg-1) disabled:opacity-40`}),(0,U.jsx)(`code`,{className:`font-mono text-label`,children:e})]},e))]})}),(0,U.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3`,children:[(0,U.jsx)(B3,{label:`MCP servers (names, comma-separated)`,children:(0,U.jsx)(po,{value:h,onChange:e=>g(e.target.value),className:`font-mono`})}),(0,U.jsx)(B3,{label:`Instructions`,children:(0,U.jsx)(po,{value:_,onChange:e=>y(e.target.value)})})]})]}):null,(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,U.jsx)(`p`,{className:`text-label text-fg-4`,children:`Name and engine are fixed — sessions and jobs are pinned to the name, and the engine decides what the rest of these fields mean.`}),(0,U.jsxs)(ao,{onClick:()=>void w(),disabled:b,children:[b?(0,U.jsx)(gS,{className:`size-3.5 text-current`}):(0,U.jsx)(Zv,{className:`size-4`}),`Save`]})]})]})]})}function W6(e){window.location.href=`vscode://file${e}`}function G6(){return(0,U.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8`,children:(0,U.jsx)(yS,{icon:(0,U.jsx)(jy,{}),title:`No profile selected`,description:`A profile is what a session runs as — its config directory and credentials, or a model provider.`})})}function K6({items:e,empty:t}){return e.length===0?(0,U.jsx)(`span`,{className:`text-fg-4`,children:t}):(0,U.jsx)(`span`,{className:`flex flex-wrap justify-end gap-1`,children:e.map(e=>(0,U.jsx)(so,{variant:`neutral`,children:e},e))})}function q6(){let{profileName:e}=Dr({from:`/profiles/$profileName`}),t=kr(),{refresh:n}=u3(),[r,i]=(0,v.useState)(),[a,o]=(0,v.useState)();(0,v.useEffect)(()=>{let t=!0,n=()=>{r3()?.getProfile(e).then(e=>{t&&i(e)}).catch(e=>{t&&o(e instanceof Error?e.message:`Failed to load profile`)})};n();let r=setInterval(n,6e4);return()=>{t=!1,clearInterval(r)}},[e]);let s=r?.profile,c=r?.config,l=(0,v.useMemo)(()=>yT(s?.usage),[s?.usage]),u=async()=>{try{await r3().deleteProfile(e),await n(),Xx.success(`Profile '${e}' deleted`),t({to:`/profiles`})}catch(e){Xx.error(e instanceof Error?e.message:`Delete failed`)}};return(0,U.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,U.jsx)(e6,{crumbs:[{label:`Profiles`,to:`/profiles`},{label:e}],actions:(0,U.jsxs)(U.Fragment,{children:[s?.configDir?(0,U.jsxs)(ao,{variant:`outline`,size:`xs`,onClick:()=>W6(s.configDir),children:[(0,U.jsx)(u_,{className:`size-3`}),`Open in VSCode`]}):null,s?.managed?(0,U.jsxs)(ao,{variant:`outline`,size:`xs`,onClick:()=>void u(),children:[(0,U.jsx)(Ty,{className:`size-3`}),`Delete`]}):null]}),children:s?.description?(0,U.jsx)(`span`,{className:`min-w-0 truncate text-label text-fg-4`,children:s.description}):null}),(0,U.jsxs)(t6,{children:[a?(0,U.jsx)(`div`,{className:`rounded-md bg-danger-bg px-3 py-2 text-body-sm text-danger`,children:a}):null,!r&&!a?(0,U.jsx)(gS,{className:`mx-auto size-5 text-fg-4`}):null,s&&c?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(co,{children:[(0,U.jsx)(lo,{children:(0,U.jsx)(uo,{children:`Worker defaults`})}),(0,U.jsxs)(fo,{className:`flex flex-col divide-y divide-border`,children:[(0,U.jsx)(n6,{label:`Engine`,children:(0,U.jsx)(so,{variant:`neutral`,children:s.engine??`claude`})}),s.engine===`provider`?(0,U.jsx)(n6,{label:`Provider`,children:(0,U.jsx)(`span`,{className:`font-mono text-label`,children:s.provider?.id})}):(0,U.jsx)(n6,{label:`Config directory`,children:(0,U.jsx)(`span`,{className:`font-mono text-label`,children:s.configDir})}),(0,U.jsx)(n6,{label:`Default model`,children:s.defaults?.model??s.provider?.model??(0,U.jsx)(`span`,{className:`text-fg-4`,children:`request / engine default`})}),(0,U.jsx)(n6,{label:`Default permission mode`,children:s.defaults?.permissionMode??(0,U.jsx)(`span`,{className:`text-fg-4`,children:`request / engine default`})}),s.engine===`provider`?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(n6,{label:`Models offered`,children:(0,U.jsx)(K6,{items:s.provider?.models??[],empty:`the default model only`})}),(0,U.jsx)(n6,{label:`API key variable`,children:s.provider?.apiKeyEnv?(0,U.jsx)(`span`,{className:`font-mono text-label`,children:s.provider.apiKeyEnv}):(0,U.jsx)(`span`,{className:`text-fg-4`,children:`provider SDK default`})})]}):null]})]}),l.length>0?(0,U.jsxs)(co,{children:[(0,U.jsx)(lo,{children:(0,U.jsx)(uo,{children:`Plan usage`})}),(0,U.jsx)(fo,{children:(0,U.jsx)(U0,{windows:l})})]}):null,s.engine===`provider`?(0,U.jsxs)(co,{children:[(0,U.jsx)(lo,{children:(0,U.jsx)(uo,{children:`Session grants`})}),(0,U.jsxs)(fo,{className:`flex flex-col divide-y divide-border`,children:[(0,U.jsx)(n6,{label:`Capabilities`,children:(0,U.jsx)(K6,{items:s.session?.capabilities??[],empty:`not declared — whatever the server wired`})}),(0,U.jsx)(n6,{label:`MCP servers`,children:(0,U.jsx)(K6,{items:s.session?.mcpServers??[],empty:`not declared — every connected server`})}),(0,U.jsx)(n6,{label:`Instructions`,children:s.session?.instructions?`${s.session.instructions.length} characters`:(0,U.jsx)(`span`,{className:`text-fg-4`,children:`none`})})]})]}):null,s.engine===`provider`?null:(0,U.jsxs)(co,{children:[(0,U.jsx)(lo,{children:(0,U.jsx)(uo,{children:`Claude Code configuration`})}),(0,U.jsxs)(fo,{className:`flex flex-col divide-y divide-border`,children:[c.settings?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(n6,{label:`Model (settings.json)`,children:c.settings.model??(0,U.jsx)(`span`,{className:`text-fg-4`,children:`not set`})}),(0,U.jsx)(n6,{label:`Default permission mode`,children:c.settings.defaultPermissionMode??(0,U.jsx)(`span`,{className:`text-fg-4`,children:`not set`})}),(0,U.jsx)(n6,{label:`Permission rules`,children:(0,U.jsx)(`span`,{className:`font-mono text-label`,children:c.settings.permissionRules?`${c.settings.permissionRules.allow} allow · ${c.settings.permissionRules.ask} ask · ${c.settings.permissionRules.deny} deny`:`—`})}),(0,U.jsx)(n6,{label:`Env vars (names only)`,children:(0,U.jsx)(K6,{items:c.settings.envKeys??[],empty:`none`})}),(0,U.jsx)(n6,{label:`Hooks`,children:(0,U.jsx)(K6,{items:c.settings.hooks??[],empty:`none`})})]}):(0,U.jsx)(n6,{label:`settings.json`,children:(0,U.jsx)(`span`,{className:`text-fg-4`,children:`not found`})}),(0,U.jsx)(n6,{label:`User memory (CLAUDE.md)`,children:c.hasUserMemory?`present`:(0,U.jsx)(`span`,{className:`text-fg-4`,children:`none`})}),(0,U.jsx)(n6,{label:`Skills`,children:(0,U.jsx)(K6,{items:c.skills,empty:`none`})}),(0,U.jsx)(n6,{label:`Agents`,children:(0,U.jsx)(K6,{items:c.agents,empty:`none`})}),(0,U.jsx)(n6,{label:`Commands`,children:(0,U.jsx)(K6,{items:c.commands,empty:`none`})})]})]}),s.managed?(0,U.jsx)(U6,{profile:s,onSaved:e=>i({...r,profile:e})}):null,(0,U.jsxs)(`p`,{className:`text-label text-fg-4`,children:[s.managed?`Stored on the server and editable here. `:`View only — this profile is declared in the server options. `,`Other profile configuration lives on the server (the `,(0,U.jsx)(`code`,{className:`font-mono`,children:`profiles`}),` option; for Claude profiles, the config directory itself, e.g. via VSCode). Provider credentials are resolved from the server's environment and never leave it.`]})]}):null]})]})}var J6=`workerdeck.bookmarks.v1`;function Y6(e,t){return`${e}:${t}`}function X6(e,t){let[n,r]=(0,v.useState)(()=>S(J6,{}));return{bookmarks:(0,v.useMemo)(()=>n[Y6(e,t)]??[],[n,e,t]),toggle:(0,v.useCallback)(n=>{r(r=>{let i=Y6(e,t),a=r[i]??[],o=a.includes(n)?a.filter(e=>e!==n):[...a,n],s={...r,[i]:o};return o.length===0&&delete s[i],C(J6,s),s})},[e,t])}}function Z6(){let{hostId:e,sessionId:t}=Dr({from:`/sessions/$hostId/$sessionId`}),{ready:n}=f4(),r=kr(),i=n4(e);return(0,v.useEffect)(()=>{!n||i||(Xx.error(`That gateway is not configured here`),r({to:`/sessions`}))},[n,i,r]),i?(0,U.jsx)(Q6,{hostId:e,sessionId:t,client:i},`${e}:${t}`):null}function Q6({hostId:e,sessionId:t,client:n}){let r=kr(),{subagent:i,sn:a,reveal:o,rn:s}=Or({from:`/sessions/$hostId/$sessionId`}),{info:c,error:l}=QE(n,t),u=L4(e,t),{bookmarks:d,toggle:f}=X6(e,t),[p]=(0,v.useState)(()=>I4(e,t)),[m]=(0,v.useState)(k2),[h]=(0,v.useState)(M2),[g]=(0,v.useState)(F2),[_]=(0,v.useState)(R2),[y]=(0,v.useState)(z6);(0,v.useEffect)(()=>{l&&(Xx.error(`Session not found`),r({to:`/sessions`}))},[l,r]);let[b,x]=(0,v.useState)(()=>!document.hidden);(0,v.useEffect)(()=>{let e=()=>x(!document.hidden);return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]);let{snapshots:S}=Q4(),C=(0,v.useMemo)(()=>S.find(t=>t.host.id===e)?.sessions.find(e=>e.id===t),[S,e,t]);(0,v.useEffect)(()=>{!C||!b||u({activity:C.activityCount,prose:C.proseCount,turns:C.numTurns})},[C?.activityCount,C?.proseCount,C?.numTurns,b,u]);let w=async()=>{try{await n.deleteSession(t)}catch{}r({to:`/sessions`})},T=c?.cwd?.split(`/`).filter(Boolean).pop();return(0,U.jsx)(P6,{client:n,sessionId:t,transcriptVariant:h,transcriptDensity:m,transcriptFont:g,fontSize:_,openSubagent:i?{toolUseId:i,nonce:a??0}:void 0,reveal:o?{toolUseId:o,nonce:s??0}:void 0,onSubagentChange:n=>{n!==i&&r({to:`/sessions/$hostId/$sessionId`,params:{hostId:e,sessionId:t},search:n===void 0?{}:e=>({subagent:n,sn:e.sn}),replace:!0})},scrubber:!0,bookmarks:d,onToggleBookmark:f,stickyPrompt:!0,statusPlacement:`bottom`,controlsSurface:`status`,defaultRailWidth:y.width,defaultRailCollapsed:y.collapsed,onRailChange:B6,unseen:p,onVitals:e=>{u({itemCount:e.itemCount}),J4()},header:({actions:e})=>(0,U.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border bg-surface px-3 py-2`,children:[(0,U.jsx)(`span`,{className:`truncate text-body-sm font-medium text-fg-1`,children:c?.title??T??t.slice(0,8)}),c?.engine&&c.engine!==`claude`?(0,U.jsx)(so,{variant:`neutral`,className:`shrink-0`,children:c.engine}):null,c?.cwd?(0,U.jsx)(`span`,{className:`min-w-0 truncate font-mono text-label text-fg-4`,title:c.cwd,children:c.cwd}):null,(0,U.jsx)(`span`,{className:`flex-1`}),(0,U.jsx)(hS,{value:t,"aria-label":`Copy session id`}),(0,U.jsxs)(mb,{children:[(0,U.jsx)(hb,{render:(0,U.jsx)(ao,{variant:`ghost`,size:`icon-sm`,"aria-label":`Close session`,children:(0,U.jsx)(Ty,{className:`size-4 text-fg-3`})})}),(0,U.jsxs)(_b,{children:[(0,U.jsx)(vb,{children:`Close this session?`}),(0,U.jsx)(yb,{children:`The run is terminated on the server. You can pick it up later from “Resume a previous session” — the transcript is kept by the engine, not by the gateway.`}),(0,U.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[(0,U.jsx)(gb,{render:(0,U.jsx)(ao,{variant:`outline`,children:`Cancel`})}),(0,U.jsx)(ao,{variant:`destructive`,onClick:()=>void w(),children:`Close session`})]})]})]}),e]})},t)}var $6=Yr({component:$3}),e8=qr({getParentRoute:()=>$6,path:`/`,beforeLoad:()=>{throw gt({to:`/sessions`})}}),t8=qr({getParentRoute:()=>$6,path:`/sessions`,component:K3}),n8=qr({getParentRoute:()=>$6,path:`/sessions/$hostId/$sessionId`,component:Z6,validateSearch:e=>({subagent:typeof e.subagent==`string`?e.subagent:void 0,sn:typeof e.sn==`number`?e.sn:void 0,reveal:typeof e.reveal==`string`?e.reveal:void 0,rn:typeof e.rn==`number`?e.rn:void 0})}),r8=qr({getParentRoute:()=>$6,path:`/sessions/$sessionId`,beforeLoad:({params:e})=>{throw gt({to:`/sessions/$hostId/$sessionId`,params:{hostId:q2,sessionId:e.sessionId},search:{}})}}),i8=qr({getParentRoute:()=>$6,path:`/gateways`,component:i6}),a8=qr({getParentRoute:()=>$6,path:`/gateways/$hostId`,component:r6}),o8=qr({getParentRoute:()=>$6,path:`/jobs`,component:N3}),s8=qr({getParentRoute:()=>$6,path:`/jobs/$jobId`,component:V6}),c8=qr({getParentRoute:()=>$6,path:`/profiles`,component:G6}),l8=qr({getParentRoute:()=>$6,path:`/profiles/$profileName`,component:q6}),u8=qr({getParentRoute:()=>$6,path:`/settings`,beforeLoad:()=>{throw gt({to:`/sessions`})}}),d8=fi({routeTree:$6.addChildren([e8,t8,n8,r8,i8,a8,o8,s8,c8,l8,u8]),history:kt()});function f8(){return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(hi,{router:d8}),(0,U.jsx)(fS,{})]})}E();var p8=document.getElementById(`root`);if(!p8)throw Error(`Root element #root not found`);(0,y.createRoot)(p8).render((0,U.jsx)(v.StrictMode,{children:(0,U.jsx)(f8,{})}));export{lD as a,s as c,Wq as i,l,DX as n,Vn as o,jX as r,d as s,yJ as t};