@appkit/llamacpp-cli 1.14.1 → 2.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 (230) hide show
  1. package/README.md +276 -280
  2. package/dist/cli.js +133 -23
  3. package/dist/cli.js.map +1 -1
  4. package/dist/commands/admin/config.d.ts +1 -1
  5. package/dist/commands/admin/config.js +5 -5
  6. package/dist/commands/admin/config.js.map +1 -1
  7. package/dist/commands/admin/log-config.d.ts +11 -0
  8. package/dist/commands/admin/log-config.d.ts.map +1 -0
  9. package/dist/commands/admin/log-config.js +159 -0
  10. package/dist/commands/admin/log-config.js.map +1 -0
  11. package/dist/commands/admin/logs.d.ts +2 -3
  12. package/dist/commands/admin/logs.d.ts.map +1 -1
  13. package/dist/commands/admin/logs.js +6 -48
  14. package/dist/commands/admin/logs.js.map +1 -1
  15. package/dist/commands/admin/status.d.ts.map +1 -1
  16. package/dist/commands/admin/status.js +1 -0
  17. package/dist/commands/admin/status.js.map +1 -1
  18. package/dist/commands/config.d.ts +1 -0
  19. package/dist/commands/config.d.ts.map +1 -1
  20. package/dist/commands/config.js +63 -196
  21. package/dist/commands/config.js.map +1 -1
  22. package/dist/commands/create.d.ts +3 -2
  23. package/dist/commands/create.d.ts.map +1 -1
  24. package/dist/commands/create.js +24 -97
  25. package/dist/commands/create.js.map +1 -1
  26. package/dist/commands/delete.d.ts.map +1 -1
  27. package/dist/commands/delete.js +7 -24
  28. package/dist/commands/delete.js.map +1 -1
  29. package/dist/commands/internal/server-wrapper.d.ts +15 -0
  30. package/dist/commands/internal/server-wrapper.d.ts.map +1 -0
  31. package/dist/commands/internal/server-wrapper.js +126 -0
  32. package/dist/commands/internal/server-wrapper.js.map +1 -0
  33. package/dist/commands/logs-all.d.ts +0 -2
  34. package/dist/commands/logs-all.d.ts.map +1 -1
  35. package/dist/commands/logs-all.js +1 -61
  36. package/dist/commands/logs-all.js.map +1 -1
  37. package/dist/commands/logs.d.ts +2 -5
  38. package/dist/commands/logs.d.ts.map +1 -1
  39. package/dist/commands/logs.js +104 -120
  40. package/dist/commands/logs.js.map +1 -1
  41. package/dist/commands/migrate-labels.d.ts +12 -0
  42. package/dist/commands/migrate-labels.d.ts.map +1 -0
  43. package/dist/commands/migrate-labels.js +160 -0
  44. package/dist/commands/migrate-labels.js.map +1 -0
  45. package/dist/commands/ps.d.ts.map +1 -1
  46. package/dist/commands/ps.js +2 -1
  47. package/dist/commands/ps.js.map +1 -1
  48. package/dist/commands/rm.d.ts.map +1 -1
  49. package/dist/commands/rm.js +22 -48
  50. package/dist/commands/rm.js.map +1 -1
  51. package/dist/commands/router/config.d.ts +1 -1
  52. package/dist/commands/router/config.js +6 -6
  53. package/dist/commands/router/config.js.map +1 -1
  54. package/dist/commands/router/logs.d.ts +2 -4
  55. package/dist/commands/router/logs.d.ts.map +1 -1
  56. package/dist/commands/router/logs.js +34 -189
  57. package/dist/commands/router/logs.js.map +1 -1
  58. package/dist/commands/router/status.d.ts.map +1 -1
  59. package/dist/commands/router/status.js +1 -0
  60. package/dist/commands/router/status.js.map +1 -1
  61. package/dist/commands/server-show.d.ts.map +1 -1
  62. package/dist/commands/server-show.js +3 -0
  63. package/dist/commands/server-show.js.map +1 -1
  64. package/dist/commands/start.d.ts.map +1 -1
  65. package/dist/commands/start.js +21 -72
  66. package/dist/commands/start.js.map +1 -1
  67. package/dist/commands/stop.d.ts.map +1 -1
  68. package/dist/commands/stop.js +10 -26
  69. package/dist/commands/stop.js.map +1 -1
  70. package/dist/launchers/llamacpp-admin +8 -0
  71. package/dist/launchers/llamacpp-router +8 -0
  72. package/dist/launchers/llamacpp-server +8 -0
  73. package/dist/lib/admin-manager.d.ts +4 -0
  74. package/dist/lib/admin-manager.d.ts.map +1 -1
  75. package/dist/lib/admin-manager.js +42 -18
  76. package/dist/lib/admin-manager.js.map +1 -1
  77. package/dist/lib/admin-server.d.ts +48 -1
  78. package/dist/lib/admin-server.d.ts.map +1 -1
  79. package/dist/lib/admin-server.js +632 -238
  80. package/dist/lib/admin-server.js.map +1 -1
  81. package/dist/lib/config-generator.d.ts +1 -0
  82. package/dist/lib/config-generator.d.ts.map +1 -1
  83. package/dist/lib/config-generator.js +12 -5
  84. package/dist/lib/config-generator.js.map +1 -1
  85. package/dist/lib/keyboard-manager.d.ts +162 -0
  86. package/dist/lib/keyboard-manager.d.ts.map +1 -0
  87. package/dist/lib/keyboard-manager.js +247 -0
  88. package/dist/lib/keyboard-manager.js.map +1 -0
  89. package/dist/lib/label-migration.d.ts +65 -0
  90. package/dist/lib/label-migration.d.ts.map +1 -0
  91. package/dist/lib/label-migration.js +458 -0
  92. package/dist/lib/label-migration.js.map +1 -0
  93. package/dist/lib/launchctl-manager.d.ts +9 -0
  94. package/dist/lib/launchctl-manager.d.ts.map +1 -1
  95. package/dist/lib/launchctl-manager.js +65 -19
  96. package/dist/lib/launchctl-manager.js.map +1 -1
  97. package/dist/lib/log-management-service.d.ts +51 -0
  98. package/dist/lib/log-management-service.d.ts.map +1 -0
  99. package/dist/lib/log-management-service.js +124 -0
  100. package/dist/lib/log-management-service.js.map +1 -0
  101. package/dist/lib/log-workers.d.ts +70 -0
  102. package/dist/lib/log-workers.d.ts.map +1 -0
  103. package/dist/lib/log-workers.js +217 -0
  104. package/dist/lib/log-workers.js.map +1 -0
  105. package/dist/lib/model-downloader.d.ts +9 -1
  106. package/dist/lib/model-downloader.d.ts.map +1 -1
  107. package/dist/lib/model-downloader.js +98 -1
  108. package/dist/lib/model-downloader.js.map +1 -1
  109. package/dist/lib/model-management-service.d.ts +60 -0
  110. package/dist/lib/model-management-service.d.ts.map +1 -0
  111. package/dist/lib/model-management-service.js +246 -0
  112. package/dist/lib/model-management-service.js.map +1 -0
  113. package/dist/lib/model-management-service.test.d.ts +2 -0
  114. package/dist/lib/model-management-service.test.d.ts.map +1 -0
  115. package/dist/lib/model-management-service.test.js.map +1 -0
  116. package/dist/lib/model-scanner.d.ts +15 -3
  117. package/dist/lib/model-scanner.d.ts.map +1 -1
  118. package/dist/lib/model-scanner.js +174 -17
  119. package/dist/lib/model-scanner.js.map +1 -1
  120. package/dist/lib/openapi-spec.d.ts +1335 -0
  121. package/dist/lib/openapi-spec.d.ts.map +1 -0
  122. package/dist/lib/openapi-spec.js +1017 -0
  123. package/dist/lib/openapi-spec.js.map +1 -0
  124. package/dist/lib/router-logger.d.ts +1 -1
  125. package/dist/lib/router-logger.d.ts.map +1 -1
  126. package/dist/lib/router-logger.js +13 -11
  127. package/dist/lib/router-logger.js.map +1 -1
  128. package/dist/lib/router-manager.d.ts +4 -0
  129. package/dist/lib/router-manager.d.ts.map +1 -1
  130. package/dist/lib/router-manager.js +30 -18
  131. package/dist/lib/router-manager.js.map +1 -1
  132. package/dist/lib/router-server.d.ts +4 -7
  133. package/dist/lib/router-server.d.ts.map +1 -1
  134. package/dist/lib/router-server.js +71 -182
  135. package/dist/lib/router-server.js.map +1 -1
  136. package/dist/lib/server-config-service.d.ts +51 -0
  137. package/dist/lib/server-config-service.d.ts.map +1 -0
  138. package/dist/lib/server-config-service.js +310 -0
  139. package/dist/lib/server-config-service.js.map +1 -0
  140. package/dist/lib/server-config-service.test.d.ts +2 -0
  141. package/dist/lib/server-config-service.test.d.ts.map +1 -0
  142. package/dist/lib/server-config-service.test.js.map +1 -0
  143. package/dist/lib/server-lifecycle-service.d.ts +172 -0
  144. package/dist/lib/server-lifecycle-service.d.ts.map +1 -0
  145. package/dist/lib/server-lifecycle-service.js +619 -0
  146. package/dist/lib/server-lifecycle-service.js.map +1 -0
  147. package/dist/lib/state-manager.d.ts +18 -1
  148. package/dist/lib/state-manager.d.ts.map +1 -1
  149. package/dist/lib/state-manager.js +51 -2
  150. package/dist/lib/state-manager.js.map +1 -1
  151. package/dist/lib/status-checker.d.ts +11 -4
  152. package/dist/lib/status-checker.d.ts.map +1 -1
  153. package/dist/lib/status-checker.js +34 -1
  154. package/dist/lib/status-checker.js.map +1 -1
  155. package/dist/lib/validation-service.d.ts +43 -0
  156. package/dist/lib/validation-service.d.ts.map +1 -0
  157. package/dist/lib/validation-service.js +112 -0
  158. package/dist/lib/validation-service.js.map +1 -0
  159. package/dist/lib/validation-service.test.d.ts +2 -0
  160. package/dist/lib/validation-service.test.d.ts.map +1 -0
  161. package/dist/lib/validation-service.test.js.map +1 -0
  162. package/dist/scripts/http-log-filter.sh +8 -0
  163. package/dist/tui/ConfigApp.d.ts.map +1 -1
  164. package/dist/tui/ConfigApp.js +222 -184
  165. package/dist/tui/ConfigApp.js.map +1 -1
  166. package/dist/tui/HistoricalMonitorApp.d.ts.map +1 -1
  167. package/dist/tui/HistoricalMonitorApp.js +12 -0
  168. package/dist/tui/HistoricalMonitorApp.js.map +1 -1
  169. package/dist/tui/ModelsApp.d.ts.map +1 -1
  170. package/dist/tui/ModelsApp.js +93 -17
  171. package/dist/tui/ModelsApp.js.map +1 -1
  172. package/dist/tui/MonitorApp.d.ts.map +1 -1
  173. package/dist/tui/MonitorApp.js +1 -3
  174. package/dist/tui/MonitorApp.js.map +1 -1
  175. package/dist/tui/MultiServerMonitorApp.d.ts +3 -3
  176. package/dist/tui/MultiServerMonitorApp.d.ts.map +1 -1
  177. package/dist/tui/MultiServerMonitorApp.js +724 -508
  178. package/dist/tui/MultiServerMonitorApp.js.map +1 -1
  179. package/dist/tui/RootNavigator.d.ts.map +1 -1
  180. package/dist/tui/RootNavigator.js +17 -1
  181. package/dist/tui/RootNavigator.js.map +1 -1
  182. package/dist/tui/RouterApp.d.ts +6 -0
  183. package/dist/tui/RouterApp.d.ts.map +1 -0
  184. package/dist/tui/RouterApp.js +928 -0
  185. package/dist/tui/RouterApp.js.map +1 -0
  186. package/dist/tui/SearchApp.d.ts.map +1 -1
  187. package/dist/tui/SearchApp.js +27 -6
  188. package/dist/tui/SearchApp.js.map +1 -1
  189. package/dist/tui/shared/modal-controller.d.ts +65 -0
  190. package/dist/tui/shared/modal-controller.d.ts.map +1 -0
  191. package/dist/tui/shared/modal-controller.js +625 -0
  192. package/dist/tui/shared/modal-controller.js.map +1 -0
  193. package/dist/tui/shared/overlay-utils.d.ts +7 -0
  194. package/dist/tui/shared/overlay-utils.d.ts.map +1 -0
  195. package/dist/tui/shared/overlay-utils.js +54 -0
  196. package/dist/tui/shared/overlay-utils.js.map +1 -0
  197. package/dist/types/admin-config.d.ts +15 -2
  198. package/dist/types/admin-config.d.ts.map +1 -1
  199. package/dist/types/model-info.d.ts +5 -0
  200. package/dist/types/model-info.d.ts.map +1 -1
  201. package/dist/types/router-config.d.ts +2 -2
  202. package/dist/types/router-config.d.ts.map +1 -1
  203. package/dist/types/server-config.d.ts +8 -0
  204. package/dist/types/server-config.d.ts.map +1 -1
  205. package/dist/types/server-config.js +25 -0
  206. package/dist/types/server-config.js.map +1 -1
  207. package/dist/utils/http-log-filter.d.ts +10 -0
  208. package/dist/utils/http-log-filter.d.ts.map +1 -0
  209. package/dist/utils/http-log-filter.js +84 -0
  210. package/dist/utils/http-log-filter.js.map +1 -0
  211. package/dist/utils/log-parser.d.ts.map +1 -1
  212. package/dist/utils/log-parser.js +7 -4
  213. package/dist/utils/log-parser.js.map +1 -1
  214. package/dist/utils/log-utils.d.ts +59 -4
  215. package/dist/utils/log-utils.d.ts.map +1 -1
  216. package/dist/utils/log-utils.js +150 -11
  217. package/dist/utils/log-utils.js.map +1 -1
  218. package/dist/utils/shard-utils.d.ts +72 -0
  219. package/dist/utils/shard-utils.d.ts.map +1 -0
  220. package/dist/utils/shard-utils.js +168 -0
  221. package/dist/utils/shard-utils.js.map +1 -0
  222. package/package.json +18 -4
  223. package/src/launchers/llamacpp-admin +8 -0
  224. package/src/launchers/llamacpp-router +8 -0
  225. package/src/launchers/llamacpp-server +8 -0
  226. package/web/dist/assets/index-Byhoy86V.css +1 -0
  227. package/web/dist/assets/index-HSrgvray.js +50 -0
  228. package/web/dist/index.html +2 -2
  229. package/web/dist/assets/index-Bin89Lwr.css +0 -1
  230. package/web/dist/assets/index-CVmonw3T.js +0 -17
@@ -0,0 +1,50 @@
1
+ (function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))i(u);new MutationObserver(u=>{for(const o of u)if(o.type==="childList")for(const c of o.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&i(c)}).observe(document,{childList:!0,subtree:!0});function a(u){const o={};return u.integrity&&(o.integrity=u.integrity),u.referrerPolicy&&(o.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?o.credentials="include":u.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(u){if(u.ep)return;u.ep=!0;const o=a(u);fetch(u.href,o)}})();function x0(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var vc={exports:{}},Ka={};var Xp;function yv(){if(Xp)return Ka;Xp=1;var t=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function a(i,u,o){var c=null;if(o!==void 0&&(c=""+o),u.key!==void 0&&(c=""+u.key),"key"in u){o={};for(var m in u)m!=="key"&&(o[m]=u[m])}else o=u;return u=o.ref,{$$typeof:t,type:i,key:c,ref:u!==void 0?u:null,props:o}}return Ka.Fragment=l,Ka.jsx=a,Ka.jsxs=a,Ka}var $p;function bv(){return $p||($p=1,vc.exports=yv()),vc.exports}var d=bv(),Sc={exports:{}},ye={};var Zp;function vv(){if(Zp)return ye;Zp=1;var t=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),c=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),v=Symbol.iterator;function S(O){return O===null||typeof O!="object"?null:(O=v&&O[v]||O["@@iterator"],typeof O=="function"?O:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,k={};function C(O,$,j){this.props=O,this.context=$,this.refs=k,this.updater=j||N}C.prototype.isReactComponent={},C.prototype.setState=function(O,$){if(typeof O!="object"&&typeof O!="function"&&O!=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,O,$,"setState")},C.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function M(){}M.prototype=C.prototype;function D(O,$,j){this.props=O,this.context=$,this.refs=k,this.updater=j||N}var F=D.prototype=new M;F.constructor=D,E(F,C.prototype),F.isPureReactComponent=!0;var V=Array.isArray;function q(){}var K={H:null,A:null,T:null,S:null},ne=Object.prototype.hasOwnProperty;function le(O,$,j){var ue=j.ref;return{$$typeof:t,type:O,key:$,ref:ue!==void 0?ue:null,props:j}}function T(O,$){return le(O.type,$,O.props)}function P(O){return typeof O=="object"&&O!==null&&O.$$typeof===t}function H(O){var $={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(j){return $[j]})}var ie=/\/+/g;function re(O,$){return typeof O=="object"&&O!==null&&O.key!=null?H(""+O.key):$.toString(36)}function te(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(q,q):(O.status="pending",O.then(function($){O.status==="pending"&&(O.status="fulfilled",O.value=$)},function($){O.status==="pending"&&(O.status="rejected",O.reason=$)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function U(O,$,j,ue,ge){var fe=typeof O;(fe==="undefined"||fe==="boolean")&&(O=null);var Ee=!1;if(O===null)Ee=!0;else switch(fe){case"bigint":case"string":case"number":Ee=!0;break;case"object":switch(O.$$typeof){case t:case l:Ee=!0;break;case y:return Ee=O._init,U(Ee(O._payload),$,j,ue,ge)}}if(Ee)return ge=ge(O),Ee=ue===""?"."+re(O,0):ue,V(ge)?(j="",Ee!=null&&(j=Ee.replace(ie,"$&/")+"/"),U(ge,$,j,"",function(Zt){return Zt})):ge!=null&&(P(ge)&&(ge=T(ge,j+(ge.key==null||O&&O.key===ge.key?"":(""+ge.key).replace(ie,"$&/")+"/")+Ee)),$.push(ge)),1;Ee=0;var $e=ue===""?".":ue+":";if(V(O))for(var Be=0;Be<O.length;Be++)ue=O[Be],fe=$e+re(ue,Be),Ee+=U(ue,$,j,fe,ge);else if(Be=S(O),typeof Be=="function")for(O=Be.call(O),Be=0;!(ue=O.next()).done;)ue=ue.value,fe=$e+re(ue,Be++),Ee+=U(ue,$,j,fe,ge);else if(fe==="object"){if(typeof O.then=="function")return U(te(O),$,j,ue,ge);throw $=String(O),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return Ee}function ee(O,$,j){if(O==null)return O;var ue=[],ge=0;return U(O,ue,"","",function(fe){return $.call(j,fe,ge++)}),ue}function L(O){if(O._status===-1){var $=O._result;$=$(),$.then(function(j){(O._status===0||O._status===-1)&&(O._status=1,O._result=j)},function(j){(O._status===0||O._status===-1)&&(O._status=2,O._result=j)}),O._status===-1&&(O._status=0,O._result=$)}if(O._status===1)return O._result.default;throw O._result}var pe=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)},R={map:ee,forEach:function(O,$,j){ee(O,function(){$.apply(this,arguments)},j)},count:function(O){var $=0;return ee(O,function(){$++}),$},toArray:function(O){return ee(O,function($){return $})||[]},only:function(O){if(!P(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return ye.Activity=x,ye.Children=R,ye.Component=C,ye.Fragment=a,ye.Profiler=u,ye.PureComponent=D,ye.StrictMode=i,ye.Suspense=p,ye.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=K,ye.__COMPILER_RUNTIME={__proto__:null,c:function(O){return K.H.useMemoCache(O)}},ye.cache=function(O){return function(){return O.apply(null,arguments)}},ye.cacheSignal=function(){return null},ye.cloneElement=function(O,$,j){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var ue=E({},O.props),ge=O.key;if($!=null)for(fe in $.key!==void 0&&(ge=""+$.key),$)!ne.call($,fe)||fe==="key"||fe==="__self"||fe==="__source"||fe==="ref"&&$.ref===void 0||(ue[fe]=$[fe]);var fe=arguments.length-2;if(fe===1)ue.children=j;else if(1<fe){for(var Ee=Array(fe),$e=0;$e<fe;$e++)Ee[$e]=arguments[$e+2];ue.children=Ee}return le(O.type,ge,ue)},ye.createContext=function(O){return O={$$typeof:c,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:o,_context:O},O},ye.createElement=function(O,$,j){var ue,ge={},fe=null;if($!=null)for(ue in $.key!==void 0&&(fe=""+$.key),$)ne.call($,ue)&&ue!=="key"&&ue!=="__self"&&ue!=="__source"&&(ge[ue]=$[ue]);var Ee=arguments.length-2;if(Ee===1)ge.children=j;else if(1<Ee){for(var $e=Array(Ee),Be=0;Be<Ee;Be++)$e[Be]=arguments[Be+2];ge.children=$e}if(O&&O.defaultProps)for(ue in Ee=O.defaultProps,Ee)ge[ue]===void 0&&(ge[ue]=Ee[ue]);return le(O,fe,ge)},ye.createRef=function(){return{current:null}},ye.forwardRef=function(O){return{$$typeof:m,render:O}},ye.isValidElement=P,ye.lazy=function(O){return{$$typeof:y,_payload:{_status:-1,_result:O},_init:L}},ye.memo=function(O,$){return{$$typeof:g,type:O,compare:$===void 0?null:$}},ye.startTransition=function(O){var $=K.T,j={};K.T=j;try{var ue=O(),ge=K.S;ge!==null&&ge(j,ue),typeof ue=="object"&&ue!==null&&typeof ue.then=="function"&&ue.then(q,pe)}catch(fe){pe(fe)}finally{$!==null&&j.types!==null&&($.types=j.types),K.T=$}},ye.unstable_useCacheRefresh=function(){return K.H.useCacheRefresh()},ye.use=function(O){return K.H.use(O)},ye.useActionState=function(O,$,j){return K.H.useActionState(O,$,j)},ye.useCallback=function(O,$){return K.H.useCallback(O,$)},ye.useContext=function(O){return K.H.useContext(O)},ye.useDebugValue=function(){},ye.useDeferredValue=function(O,$){return K.H.useDeferredValue(O,$)},ye.useEffect=function(O,$){return K.H.useEffect(O,$)},ye.useEffectEvent=function(O){return K.H.useEffectEvent(O)},ye.useId=function(){return K.H.useId()},ye.useImperativeHandle=function(O,$,j){return K.H.useImperativeHandle(O,$,j)},ye.useInsertionEffect=function(O,$){return K.H.useInsertionEffect(O,$)},ye.useLayoutEffect=function(O,$){return K.H.useLayoutEffect(O,$)},ye.useMemo=function(O,$){return K.H.useMemo(O,$)},ye.useOptimistic=function(O,$){return K.H.useOptimistic(O,$)},ye.useReducer=function(O,$,j){return K.H.useReducer(O,$,j)},ye.useRef=function(O){return K.H.useRef(O)},ye.useState=function(O){return K.H.useState(O)},ye.useSyncExternalStore=function(O,$,j){return K.H.useSyncExternalStore(O,$,j)},ye.useTransition=function(){return K.H.useTransition()},ye.version="19.2.4",ye}var Jp;function xf(){return Jp||(Jp=1,Sc.exports=vv()),Sc.exports}var A=xf(),wc={exports:{}},Ia={},Nc={exports:{}},jc={};var Pp;function Sv(){return Pp||(Pp=1,(function(t){function l(U,ee){var L=U.length;U.push(ee);e:for(;0<L;){var pe=L-1>>>1,R=U[pe];if(0<u(R,ee))U[pe]=ee,U[L]=R,L=pe;else break e}}function a(U){return U.length===0?null:U[0]}function i(U){if(U.length===0)return null;var ee=U[0],L=U.pop();if(L!==ee){U[0]=L;e:for(var pe=0,R=U.length,O=R>>>1;pe<O;){var $=2*(pe+1)-1,j=U[$],ue=$+1,ge=U[ue];if(0>u(j,L))ue<R&&0>u(ge,j)?(U[pe]=ge,U[ue]=L,pe=ue):(U[pe]=j,U[$]=L,pe=$);else if(ue<R&&0>u(ge,L))U[pe]=ge,U[ue]=L,pe=ue;else break e}}return ee}function u(U,ee){var L=U.sortIndex-ee.sortIndex;return L!==0?L:U.id-ee.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var c=Date,m=c.now();t.unstable_now=function(){return c.now()-m}}var p=[],g=[],y=1,x=null,v=3,S=!1,N=!1,E=!1,k=!1,C=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,D=typeof setImmediate<"u"?setImmediate:null;function F(U){for(var ee=a(g);ee!==null;){if(ee.callback===null)i(g);else if(ee.startTime<=U)i(g),ee.sortIndex=ee.expirationTime,l(p,ee);else break;ee=a(g)}}function V(U){if(E=!1,F(U),!N)if(a(p)!==null)N=!0,q||(q=!0,H());else{var ee=a(g);ee!==null&&te(V,ee.startTime-U)}}var q=!1,K=-1,ne=5,le=-1;function T(){return k?!0:!(t.unstable_now()-le<ne)}function P(){if(k=!1,q){var U=t.unstable_now();le=U;var ee=!0;try{e:{N=!1,E&&(E=!1,M(K),K=-1),S=!0;var L=v;try{t:{for(F(U),x=a(p);x!==null&&!(x.expirationTime>U&&T());){var pe=x.callback;if(typeof pe=="function"){x.callback=null,v=x.priorityLevel;var R=pe(x.expirationTime<=U);if(U=t.unstable_now(),typeof R=="function"){x.callback=R,F(U),ee=!0;break t}x===a(p)&&i(p),F(U)}else i(p);x=a(p)}if(x!==null)ee=!0;else{var O=a(g);O!==null&&te(V,O.startTime-U),ee=!1}}break e}finally{x=null,v=L,S=!1}ee=void 0}}finally{ee?H():q=!1}}}var H;if(typeof D=="function")H=function(){D(P)};else if(typeof MessageChannel<"u"){var ie=new MessageChannel,re=ie.port2;ie.port1.onmessage=P,H=function(){re.postMessage(null)}}else H=function(){C(P,0)};function te(U,ee){K=C(function(){U(t.unstable_now())},ee)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(U){U.callback=null},t.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ne=0<U?Math.floor(1e3/U):5},t.unstable_getCurrentPriorityLevel=function(){return v},t.unstable_next=function(U){switch(v){case 1:case 2:case 3:var ee=3;break;default:ee=v}var L=v;v=ee;try{return U()}finally{v=L}},t.unstable_requestPaint=function(){k=!0},t.unstable_runWithPriority=function(U,ee){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var L=v;v=U;try{return ee()}finally{v=L}},t.unstable_scheduleCallback=function(U,ee,L){var pe=t.unstable_now();switch(typeof L=="object"&&L!==null?(L=L.delay,L=typeof L=="number"&&0<L?pe+L:pe):L=pe,U){case 1:var R=-1;break;case 2:R=250;break;case 5:R=1073741823;break;case 4:R=1e4;break;default:R=5e3}return R=L+R,U={id:y++,callback:ee,priorityLevel:U,startTime:L,expirationTime:R,sortIndex:-1},L>pe?(U.sortIndex=L,l(g,U),a(p)===null&&U===a(g)&&(E?(M(K),K=-1):E=!0,te(V,L-pe))):(U.sortIndex=R,l(p,U),N||S||(N=!0,q||(q=!0,H()))),U},t.unstable_shouldYield=T,t.unstable_wrapCallback=function(U){var ee=v;return function(){var L=v;v=ee;try{return U.apply(this,arguments)}finally{v=L}}}})(jc)),jc}var Wp;function wv(){return Wp||(Wp=1,Nc.exports=Sv()),Nc.exports}var Cc={exports:{}},bt={};var eg;function Nv(){if(eg)return bt;eg=1;var t=xf();function l(p){var g="https://react.dev/errors/"+p;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)g+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+p+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var i={d:{f:a,r:function(){throw Error(l(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},u=Symbol.for("react.portal");function o(p,g,y){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:x==null?null:""+x,children:p,containerInfo:g,implementation:y}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(p,g){if(p==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return bt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,bt.createPortal=function(p,g){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(l(299));return o(p,g,null,y)},bt.flushSync=function(p){var g=c.T,y=i.p;try{if(c.T=null,i.p=2,p)return p()}finally{c.T=g,i.p=y,i.d.f()}},bt.preconnect=function(p,g){typeof p=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,i.d.C(p,g))},bt.prefetchDNS=function(p){typeof p=="string"&&i.d.D(p)},bt.preinit=function(p,g){if(typeof p=="string"&&g&&typeof g.as=="string"){var y=g.as,x=m(y,g.crossOrigin),v=typeof g.integrity=="string"?g.integrity:void 0,S=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;y==="style"?i.d.S(p,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:x,integrity:v,fetchPriority:S}):y==="script"&&i.d.X(p,{crossOrigin:x,integrity:v,fetchPriority:S,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},bt.preinitModule=function(p,g){if(typeof p=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var y=m(g.as,g.crossOrigin);i.d.M(p,{crossOrigin:y,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&i.d.M(p)},bt.preload=function(p,g){if(typeof p=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var y=g.as,x=m(y,g.crossOrigin);i.d.L(p,y,{crossOrigin:x,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},bt.preloadModule=function(p,g){if(typeof p=="string")if(g){var y=m(g.as,g.crossOrigin);i.d.m(p,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:y,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else i.d.m(p)},bt.requestFormReset=function(p){i.d.r(p)},bt.unstable_batchedUpdates=function(p,g){return p(g)},bt.useFormState=function(p,g,y){return c.H.useFormState(p,g,y)},bt.useFormStatus=function(){return c.H.useHostTransitionStatus()},bt.version="19.2.4",bt}var tg;function jv(){if(tg)return Cc.exports;tg=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(l){console.error(l)}}return t(),Cc.exports=Nv(),Cc.exports}var ng;function Cv(){if(ng)return Ia;ng=1;var t=wv(),l=xf(),a=jv();function i(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)n+="&args[]="+encodeURIComponent(arguments[r])}return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var n=e,r=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(r=n.return),e=n.return;while(e)}return n.tag===3?r:null}function c(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function m(e){if(e.tag===31){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function p(e){if(o(e)!==e)throw Error(i(188))}function g(e){var n=e.alternate;if(!n){if(n=o(e),n===null)throw Error(i(188));return n!==e?null:e}for(var r=e,s=n;;){var f=r.return;if(f===null)break;var h=f.alternate;if(h===null){if(s=f.return,s!==null){r=s;continue}break}if(f.child===h.child){for(h=f.child;h;){if(h===r)return p(f),e;if(h===s)return p(f),n;h=h.sibling}throw Error(i(188))}if(r.return!==s.return)r=f,s=h;else{for(var b=!1,w=f.child;w;){if(w===r){b=!0,r=f,s=h;break}if(w===s){b=!0,s=f,r=h;break}w=w.sibling}if(!b){for(w=h.child;w;){if(w===r){b=!0,r=h,s=f;break}if(w===s){b=!0,s=h,r=f;break}w=w.sibling}if(!b)throw Error(i(189))}}if(r.alternate!==s)throw Error(i(190))}if(r.tag!==3)throw Error(i(188));return r.stateNode.current===r?e:n}function y(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=y(e),n!==null)return n;e=e.sibling}return null}var x=Object.assign,v=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),D=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),V=Symbol.for("react.suspense"),q=Symbol.for("react.suspense_list"),K=Symbol.for("react.memo"),ne=Symbol.for("react.lazy"),le=Symbol.for("react.activity"),T=Symbol.for("react.memo_cache_sentinel"),P=Symbol.iterator;function H(e){return e===null||typeof e!="object"?null:(e=P&&e[P]||e["@@iterator"],typeof e=="function"?e:null)}var ie=Symbol.for("react.client.reference");function re(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ie?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case E:return"Fragment";case C:return"Profiler";case k:return"StrictMode";case V:return"Suspense";case q:return"SuspenseList";case le:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case N:return"Portal";case D:return e.displayName||"Context";case M:return(e._context.displayName||"Context")+".Consumer";case F:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case K:return n=e.displayName||null,n!==null?n:re(e.type)||"Memo";case ne:n=e._payload,e=e._init;try{return re(e(n))}catch{}}return null}var te=Array.isArray,U=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L={pending:!1,data:null,method:null,action:null},pe=[],R=-1;function O(e){return{current:e}}function $(e){0>R||(e.current=pe[R],pe[R]=null,R--)}function j(e,n){R++,pe[R]=e.current,e.current=n}var ue=O(null),ge=O(null),fe=O(null),Ee=O(null);function $e(e,n){switch(j(fe,n),j(ge,e),j(ue,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?xp(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=xp(n),e=yp(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}$(ue),j(ue,e)}function Be(){$(ue),$(ge),$(fe)}function Zt(e){e.memoizedState!==null&&j(Ee,e);var n=ue.current,r=yp(n,e.type);n!==r&&(j(ge,e),j(ue,r))}function kn(e){ge.current===e&&($(ue),$(ge)),Ee.current===e&&($(Ee),Qa._currentValue=L)}var Wr,mi;function En(e){if(Wr===void 0)try{throw Error()}catch(r){var n=r.stack.trim().match(/\n( *(at )?)/);Wr=n&&n[1]||"",mi=-1<r.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<r.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+Wr+e+mi}var Pl=!1;function Wl(e,n){if(!e||Pl)return"";Pl=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(n){var W=function(){throw Error()};if(Object.defineProperty(W.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(W,[])}catch(I){var G=I}Reflect.construct(e,[],W)}else{try{W.call()}catch(I){G=I}e.call(W.prototype)}}else{try{throw Error()}catch(I){G=I}(W=e())&&typeof W.catch=="function"&&W.catch(function(){})}}catch(I){if(I&&G&&typeof I.stack=="string")return[I.stack,G.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=s.DetermineComponentFrameRoot(),b=h[0],w=h[1];if(b&&w){var z=b.split(`
4
+ `),Y=w.split(`
5
+ `);for(f=s=0;s<z.length&&!z[s].includes("DetermineComponentFrameRoot");)s++;for(;f<Y.length&&!Y[f].includes("DetermineComponentFrameRoot");)f++;if(s===z.length||f===Y.length)for(s=z.length-1,f=Y.length-1;1<=s&&0<=f&&z[s]!==Y[f];)f--;for(;1<=s&&0<=f;s--,f--)if(z[s]!==Y[f]){if(s!==1||f!==1)do if(s--,f--,0>f||z[s]!==Y[f]){var X=`
6
+ `+z[s].replace(" at new "," at ");return e.displayName&&X.includes("<anonymous>")&&(X=X.replace("<anonymous>",e.displayName)),X}while(1<=s&&0<=f);break}}}finally{Pl=!1,Error.prepareStackTrace=r}return(r=e?e.displayName||e.name:"")?En(r):""}function pi(e,n){switch(e.tag){case 26:case 27:case 5:return En(e.type);case 16:return En("Lazy");case 13:return e.child!==n&&n!==null?En("Suspense Fallback"):En("Suspense");case 19:return En("SuspenseList");case 0:case 15:return Wl(e.type,!1);case 11:return Wl(e.type.render,!1);case 1:return Wl(e.type,!0);case 31:return En("Activity");default:return""}}function gi(e){try{var n="",r=null;do n+=pi(e,r),r=e,e=e.return;while(e);return n}catch(s){return`
7
+ Error generating stack: `+s.message+`
8
+ `+s.stack}}var er=Object.prototype.hasOwnProperty,tr=t.unstable_scheduleCallback,ea=t.unstable_cancelCallback,ru=t.unstable_shouldYield,au=t.unstable_requestPaint,Nt=t.unstable_now,iu=t.unstable_getCurrentPriorityLevel,Z=t.unstable_ImmediatePriority,se=t.unstable_UserBlockingPriority,xe=t.unstable_NormalPriority,we=t.unstable_LowPriority,Le=t.unstable_IdlePriority,qt=t.log,Tn=t.unstable_setDisableYieldValue,jt=null,ut=null;function Tt(e){if(typeof qt=="function"&&Tn(e),ut&&typeof ut.setStrictMode=="function")try{ut.setStrictMode(jt,e)}catch{}}var Ye=Math.clz32?Math.clz32:ry,Zn=Math.log,cn=Math.LN2;function ry(e){return e>>>=0,e===0?32:31-(Zn(e)/cn|0)|0}var xi=256,yi=262144,bi=4194304;function Cl(e){var n=e&42;if(n!==0)return n;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 vi(e,n,r){var s=e.pendingLanes;if(s===0)return 0;var f=0,h=e.suspendedLanes,b=e.pingedLanes;e=e.warmLanes;var w=s&134217727;return w!==0?(s=w&~h,s!==0?f=Cl(s):(b&=w,b!==0?f=Cl(b):r||(r=w&~e,r!==0&&(f=Cl(r))))):(w=s&~h,w!==0?f=Cl(w):b!==0?f=Cl(b):r||(r=s&~e,r!==0&&(f=Cl(r)))),f===0?0:n!==0&&n!==f&&(n&h)===0&&(h=f&-f,r=n&-n,h>=r||h===32&&(r&4194048)!==0)?n:f}function ta(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function ay(e,n){switch(e){case 1:case 2:case 4:case 8:case 64:return n+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 n+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 Pf(){var e=bi;return bi<<=1,(bi&62914560)===0&&(bi=4194304),e}function su(e){for(var n=[],r=0;31>r;r++)n.push(e);return n}function na(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function iy(e,n,r,s,f,h){var b=e.pendingLanes;e.pendingLanes=r,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=r,e.entangledLanes&=r,e.errorRecoveryDisabledLanes&=r,e.shellSuspendCounter=0;var w=e.entanglements,z=e.expirationTimes,Y=e.hiddenUpdates;for(r=b&~r;0<r;){var X=31-Ye(r),W=1<<X;w[X]=0,z[X]=-1;var G=Y[X];if(G!==null)for(Y[X]=null,X=0;X<G.length;X++){var I=G[X];I!==null&&(I.lane&=-536870913)}r&=~W}s!==0&&Wf(e,s,0),h!==0&&f===0&&e.tag!==0&&(e.suspendedLanes|=h&~(b&~n))}function Wf(e,n,r){e.pendingLanes|=n,e.suspendedLanes&=~n;var s=31-Ye(n);e.entangledLanes|=n,e.entanglements[s]=e.entanglements[s]|1073741824|r&261930}function ed(e,n){var r=e.entangledLanes|=n;for(e=e.entanglements;r;){var s=31-Ye(r),f=1<<s;f&n|e[s]&n&&(e[s]|=n),r&=~f}}function td(e,n){var r=n&-n;return r=(r&42)!==0?1:uu(r),(r&(e.suspendedLanes|n))!==0?0:r}function uu(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 ou(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function nd(){var e=ee.p;return e!==0?e:(e=window.event,e===void 0?32:Fp(e.type))}function ld(e,n){var r=ee.p;try{return ee.p=e,n()}finally{ee.p=r}}var Jn=Math.random().toString(36).slice(2),mt="__reactFiber$"+Jn,At="__reactProps$"+Jn,nr="__reactContainer$"+Jn,cu="__reactEvents$"+Jn,sy="__reactListeners$"+Jn,uy="__reactHandles$"+Jn,rd="__reactResources$"+Jn,la="__reactMarker$"+Jn;function fu(e){delete e[mt],delete e[At],delete e[cu],delete e[sy],delete e[uy]}function lr(e){var n=e[mt];if(n)return n;for(var r=e.parentNode;r;){if(n=r[nr]||r[mt]){if(r=n.alternate,n.child!==null||r!==null&&r.child!==null)for(e=Cp(e);e!==null;){if(r=e[mt])return r;e=Cp(e)}return n}e=r,r=e.parentNode}return null}function rr(e){if(e=e[mt]||e[nr]){var n=e.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return e}return null}function ra(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(i(33))}function ar(e){var n=e[rd];return n||(n=e[rd]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function dt(e){e[la]=!0}var ad=new Set,id={};function kl(e,n){ir(e,n),ir(e+"Capture",n)}function ir(e,n){for(id[e]=n,e=0;e<n.length;e++)ad.add(n[e])}var oy=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]*$"),sd={},ud={};function cy(e){return er.call(ud,e)?!0:er.call(sd,e)?!1:oy.test(e)?ud[e]=!0:(sd[e]=!0,!1)}function Si(e,n,r){if(cy(n))if(r===null)e.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":e.removeAttribute(n);return;case"boolean":var s=n.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(n);return}}e.setAttribute(n,""+r)}}function wi(e,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.setAttribute(n,""+r)}}function An(e,n,r,s){if(s===null)e.removeAttribute(r);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(r);return}e.setAttributeNS(n,r,""+s)}}function Jt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function od(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function fy(e,n,r){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,n);if(!e.hasOwnProperty(n)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var f=s.get,h=s.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return f.call(this)},set:function(b){r=""+b,h.call(this,b)}}),Object.defineProperty(e,n,{enumerable:s.enumerable}),{getValue:function(){return r},setValue:function(b){r=""+b},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function du(e){if(!e._valueTracker){var n=od(e)?"checked":"value";e._valueTracker=fy(e,n,""+e[n])}}function cd(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var r=n.getValue(),s="";return e&&(s=od(e)?e.checked?"true":"false":e.value),e=s,e!==r?(n.setValue(e),!0):!1}function Ni(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var dy=/[\n"\\]/g;function Pt(e){return e.replace(dy,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function hu(e,n,r,s,f,h,b,w){e.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.type=b:e.removeAttribute("type"),n!=null?b==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+Jt(n)):e.value!==""+Jt(n)&&(e.value=""+Jt(n)):b!=="submit"&&b!=="reset"||e.removeAttribute("value"),n!=null?mu(e,b,Jt(n)):r!=null?mu(e,b,Jt(r)):s!=null&&e.removeAttribute("value"),f==null&&h!=null&&(e.defaultChecked=!!h),f!=null&&(e.checked=f&&typeof f!="function"&&typeof f!="symbol"),w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?e.name=""+Jt(w):e.removeAttribute("name")}function fd(e,n,r,s,f,h,b,w){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.type=h),n!=null||r!=null){if(!(h!=="submit"&&h!=="reset"||n!=null)){du(e);return}r=r!=null?""+Jt(r):"",n=n!=null?""+Jt(n):r,w||n===e.value||(e.value=n),e.defaultValue=n}s=s??f,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=w?e.checked:!!s,e.defaultChecked=!!s,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(e.name=b),du(e)}function mu(e,n,r){n==="number"&&Ni(e.ownerDocument)===e||e.defaultValue===""+r||(e.defaultValue=""+r)}function sr(e,n,r,s){if(e=e.options,n){n={};for(var f=0;f<r.length;f++)n["$"+r[f]]=!0;for(r=0;r<e.length;r++)f=n.hasOwnProperty("$"+e[r].value),e[r].selected!==f&&(e[r].selected=f),f&&s&&(e[r].defaultSelected=!0)}else{for(r=""+Jt(r),n=null,f=0;f<e.length;f++){if(e[f].value===r){e[f].selected=!0,s&&(e[f].defaultSelected=!0);return}n!==null||e[f].disabled||(n=e[f])}n!==null&&(n.selected=!0)}}function dd(e,n,r){if(n!=null&&(n=""+Jt(n),n!==e.value&&(e.value=n),r==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=r!=null?""+Jt(r):""}function hd(e,n,r,s){if(n==null){if(s!=null){if(r!=null)throw Error(i(92));if(te(s)){if(1<s.length)throw Error(i(93));s=s[0]}r=s}r==null&&(r=""),n=r}r=Jt(n),e.defaultValue=r,s=e.textContent,s===r&&s!==""&&s!==null&&(e.value=s),du(e)}function ur(e,n){if(n){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=n;return}}e.textContent=n}var hy=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 md(e,n,r){var s=n.indexOf("--")===0;r==null||typeof r=="boolean"||r===""?s?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="":s?e.setProperty(n,r):typeof r!="number"||r===0||hy.has(n)?n==="float"?e.cssFloat=r:e[n]=(""+r).trim():e[n]=r+"px"}function pd(e,n,r){if(n!=null&&typeof n!="object")throw Error(i(62));if(e=e.style,r!=null){for(var s in r)!r.hasOwnProperty(s)||n!=null&&n.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var f in n)s=n[f],n.hasOwnProperty(f)&&r[f]!==s&&md(e,f,s)}else for(var h in n)n.hasOwnProperty(h)&&md(e,h,n[h])}function pu(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 my=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"]]),py=/^[\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 ji(e){return py.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Rn(){}var gu=null;function xu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var or=null,cr=null;function gd(e){var n=rr(e);if(n&&(e=n.stateNode)){var r=e[At]||null;e:switch(e=n.stateNode,n.type){case"input":if(hu(e,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name),n=r.name,r.type==="radio"&&n!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll('input[name="'+Pt(""+n)+'"][type="radio"]'),n=0;n<r.length;n++){var s=r[n];if(s!==e&&s.form===e.form){var f=s[At]||null;if(!f)throw Error(i(90));hu(s,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(n=0;n<r.length;n++)s=r[n],s.form===e.form&&cd(s)}break e;case"textarea":dd(e,r.value,r.defaultValue);break e;case"select":n=r.value,n!=null&&sr(e,!!r.multiple,n,!1)}}}var yu=!1;function xd(e,n,r){if(yu)return e(n,r);yu=!0;try{var s=e(n);return s}finally{if(yu=!1,(or!==null||cr!==null)&&(fs(),or&&(n=or,e=cr,cr=or=null,gd(n),e)))for(n=0;n<e.length;n++)gd(e[n])}}function aa(e,n){var r=e.stateNode;if(r===null)return null;var s=r[At]||null;if(s===null)return null;r=s[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(i(231,n,typeof r));return r}var Mn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),bu=!1;if(Mn)try{var ia={};Object.defineProperty(ia,"passive",{get:function(){bu=!0}}),window.addEventListener("test",ia,ia),window.removeEventListener("test",ia,ia)}catch{bu=!1}var Pn=null,vu=null,Ci=null;function yd(){if(Ci)return Ci;var e,n=vu,r=n.length,s,f="value"in Pn?Pn.value:Pn.textContent,h=f.length;for(e=0;e<r&&n[e]===f[e];e++);var b=r-e;for(s=1;s<=b&&n[r-s]===f[h-s];s++);return Ci=f.slice(e,1<s?1-s:void 0)}function ki(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function Ei(){return!0}function bd(){return!1}function Rt(e){function n(r,s,f,h,b){this._reactName=r,this._targetInst=f,this.type=s,this.nativeEvent=h,this.target=b,this.currentTarget=null;for(var w in e)e.hasOwnProperty(w)&&(r=e[w],this[w]=r?r(h):h[w]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?Ei:bd,this.isPropagationStopped=bd,this}return x(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Ei)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Ei)},persist:function(){},isPersistent:Ei}),n}var El={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ti=Rt(El),sa=x({},El,{view:0,detail:0}),gy=Rt(sa),Su,wu,ua,Ai=x({},sa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ju,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!==ua&&(ua&&e.type==="mousemove"?(Su=e.screenX-ua.screenX,wu=e.screenY-ua.screenY):wu=Su=0,ua=e),Su)},movementY:function(e){return"movementY"in e?e.movementY:wu}}),vd=Rt(Ai),xy=x({},Ai,{dataTransfer:0}),yy=Rt(xy),by=x({},sa,{relatedTarget:0}),Nu=Rt(by),vy=x({},El,{animationName:0,elapsedTime:0,pseudoElement:0}),Sy=Rt(vy),wy=x({},El,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Ny=Rt(wy),jy=x({},El,{data:0}),Sd=Rt(jy),Cy={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ky={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"},Ey={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ty(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=Ey[e])?!!n[e]:!1}function ju(){return Ty}var Ay=x({},sa,{key:function(e){if(e.key){var n=Cy[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=ki(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?ky[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ju,charCode:function(e){return e.type==="keypress"?ki(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ki(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Ry=Rt(Ay),My=x({},Ai,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),wd=Rt(My),zy=x({},sa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ju}),Oy=Rt(zy),_y=x({},El,{propertyName:0,elapsedTime:0,pseudoElement:0}),Dy=Rt(_y),Ly=x({},Ai,{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}),Uy=Rt(Ly),qy=x({},El,{newState:0,oldState:0}),By=Rt(qy),Hy=[9,13,27,32],Cu=Mn&&"CompositionEvent"in window,oa=null;Mn&&"documentMode"in document&&(oa=document.documentMode);var Fy=Mn&&"TextEvent"in window&&!oa,Nd=Mn&&(!Cu||oa&&8<oa&&11>=oa),jd=" ",Cd=!1;function kd(e,n){switch(e){case"keyup":return Hy.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ed(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var fr=!1;function Qy(e,n){switch(e){case"compositionend":return Ed(n);case"keypress":return n.which!==32?null:(Cd=!0,jd);case"textInput":return e=n.data,e===jd&&Cd?null:e;default:return null}}function Yy(e,n){if(fr)return e==="compositionend"||!Cu&&kd(e,n)?(e=yd(),Ci=vu=Pn=null,fr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return Nd&&n.locale!=="ko"?null:n.data;default:return null}}var Gy={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 Td(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!Gy[e.type]:n==="textarea"}function Ad(e,n,r,s){or?cr?cr.push(s):cr=[s]:or=s,n=ys(n,"onChange"),0<n.length&&(r=new Ti("onChange","change",null,r,s),e.push({event:r,listeners:n}))}var ca=null,fa=null;function Vy(e){fp(e,0)}function Ri(e){var n=ra(e);if(cd(n))return e}function Rd(e,n){if(e==="change")return n}var Md=!1;if(Mn){var ku;if(Mn){var Eu="oninput"in document;if(!Eu){var zd=document.createElement("div");zd.setAttribute("oninput","return;"),Eu=typeof zd.oninput=="function"}ku=Eu}else ku=!1;Md=ku&&(!document.documentMode||9<document.documentMode)}function Od(){ca&&(ca.detachEvent("onpropertychange",_d),fa=ca=null)}function _d(e){if(e.propertyName==="value"&&Ri(fa)){var n=[];Ad(n,fa,e,xu(e)),xd(Vy,n)}}function Ky(e,n,r){e==="focusin"?(Od(),ca=n,fa=r,ca.attachEvent("onpropertychange",_d)):e==="focusout"&&Od()}function Iy(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ri(fa)}function Xy(e,n){if(e==="click")return Ri(n)}function $y(e,n){if(e==="input"||e==="change")return Ri(n)}function Zy(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var Bt=typeof Object.is=="function"?Object.is:Zy;function da(e,n){if(Bt(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var r=Object.keys(e),s=Object.keys(n);if(r.length!==s.length)return!1;for(s=0;s<r.length;s++){var f=r[s];if(!er.call(n,f)||!Bt(e[f],n[f]))return!1}return!0}function Dd(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ld(e,n){var r=Dd(e);e=0;for(var s;r;){if(r.nodeType===3){if(s=e+r.textContent.length,e<=n&&s>=n)return{node:r,offset:n-e};e=s}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Dd(r)}}function Ud(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?Ud(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function qd(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=Ni(e.document);n instanceof e.HTMLIFrameElement;){try{var r=typeof n.contentWindow.location.href=="string"}catch{r=!1}if(r)e=n.contentWindow;else break;n=Ni(e.document)}return n}function Tu(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}var Jy=Mn&&"documentMode"in document&&11>=document.documentMode,dr=null,Au=null,ha=null,Ru=!1;function Bd(e,n,r){var s=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Ru||dr==null||dr!==Ni(s)||(s=dr,"selectionStart"in s&&Tu(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),ha&&da(ha,s)||(ha=s,s=ys(Au,"onSelect"),0<s.length&&(n=new Ti("onSelect","select",null,n,r),e.push({event:n,listeners:s}),n.target=dr)))}function Tl(e,n){var r={};return r[e.toLowerCase()]=n.toLowerCase(),r["Webkit"+e]="webkit"+n,r["Moz"+e]="moz"+n,r}var hr={animationend:Tl("Animation","AnimationEnd"),animationiteration:Tl("Animation","AnimationIteration"),animationstart:Tl("Animation","AnimationStart"),transitionrun:Tl("Transition","TransitionRun"),transitionstart:Tl("Transition","TransitionStart"),transitioncancel:Tl("Transition","TransitionCancel"),transitionend:Tl("Transition","TransitionEnd")},Mu={},Hd={};Mn&&(Hd=document.createElement("div").style,"AnimationEvent"in window||(delete hr.animationend.animation,delete hr.animationiteration.animation,delete hr.animationstart.animation),"TransitionEvent"in window||delete hr.transitionend.transition);function Al(e){if(Mu[e])return Mu[e];if(!hr[e])return e;var n=hr[e],r;for(r in n)if(n.hasOwnProperty(r)&&r in Hd)return Mu[e]=n[r];return e}var Fd=Al("animationend"),Qd=Al("animationiteration"),Yd=Al("animationstart"),Py=Al("transitionrun"),Wy=Al("transitionstart"),eb=Al("transitioncancel"),Gd=Al("transitionend"),Vd=new Map,zu="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(" ");zu.push("scrollEnd");function fn(e,n){Vd.set(e,n),kl(n,[e])}var Mi=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Wt=[],mr=0,Ou=0;function zi(){for(var e=mr,n=Ou=mr=0;n<e;){var r=Wt[n];Wt[n++]=null;var s=Wt[n];Wt[n++]=null;var f=Wt[n];Wt[n++]=null;var h=Wt[n];if(Wt[n++]=null,s!==null&&f!==null){var b=s.pending;b===null?f.next=f:(f.next=b.next,b.next=f),s.pending=f}h!==0&&Kd(r,f,h)}}function Oi(e,n,r,s){Wt[mr++]=e,Wt[mr++]=n,Wt[mr++]=r,Wt[mr++]=s,Ou|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function _u(e,n,r,s){return Oi(e,n,r,s),_i(e)}function Rl(e,n){return Oi(e,null,null,n),_i(e)}function Kd(e,n,r){e.lanes|=r;var s=e.alternate;s!==null&&(s.lanes|=r);for(var f=!1,h=e.return;h!==null;)h.childLanes|=r,s=h.alternate,s!==null&&(s.childLanes|=r),h.tag===22&&(e=h.stateNode,e===null||e._visibility&1||(f=!0)),e=h,h=h.return;return e.tag===3?(h=e.stateNode,f&&n!==null&&(f=31-Ye(r),e=h.hiddenUpdates,s=e[f],s===null?e[f]=[n]:s.push(n),n.lane=r|536870912),h):null}function _i(e){if(50<Da)throw Da=0,Go=null,Error(i(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var pr={};function tb(e,n,r,s){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ht(e,n,r,s){return new tb(e,n,r,s)}function Du(e){return e=e.prototype,!(!e||!e.isReactComponent)}function zn(e,n){var r=e.alternate;return r===null?(r=Ht(e.tag,n,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=n,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&65011712,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,n=e.dependencies,r.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r.refCleanup=e.refCleanup,r}function Id(e,n){e.flags&=65011714;var r=e.alternate;return r===null?(e.childLanes=0,e.lanes=n,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=r.childLanes,e.lanes=r.lanes,e.child=r.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=r.memoizedProps,e.memoizedState=r.memoizedState,e.updateQueue=r.updateQueue,e.type=r.type,n=r.dependencies,e.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),e}function Di(e,n,r,s,f,h){var b=0;if(s=e,typeof e=="function")Du(e)&&(b=1);else if(typeof e=="string")b=iv(e,r,ue.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case le:return e=Ht(31,r,n,f),e.elementType=le,e.lanes=h,e;case E:return Ml(r.children,f,h,n);case k:b=8,f|=24;break;case C:return e=Ht(12,r,n,f|2),e.elementType=C,e.lanes=h,e;case V:return e=Ht(13,r,n,f),e.elementType=V,e.lanes=h,e;case q:return e=Ht(19,r,n,f),e.elementType=q,e.lanes=h,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case D:b=10;break e;case M:b=9;break e;case F:b=11;break e;case K:b=14;break e;case ne:b=16,s=null;break e}b=29,r=Error(i(130,e===null?"null":typeof e,"")),s=null}return n=Ht(b,r,n,f),n.elementType=e,n.type=s,n.lanes=h,n}function Ml(e,n,r,s){return e=Ht(7,e,s,n),e.lanes=r,e}function Lu(e,n,r){return e=Ht(6,e,null,n),e.lanes=r,e}function Xd(e){var n=Ht(18,null,null,0);return n.stateNode=e,n}function Uu(e,n,r){return n=Ht(4,e.children!==null?e.children:[],e.key,n),n.lanes=r,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var $d=new WeakMap;function en(e,n){if(typeof e=="object"&&e!==null){var r=$d.get(e);return r!==void 0?r:(n={value:e,source:n,stack:gi(n)},$d.set(e,n),n)}return{value:e,source:n,stack:gi(n)}}var gr=[],xr=0,Li=null,ma=0,tn=[],nn=0,Wn=null,xn=1,yn="";function On(e,n){gr[xr++]=ma,gr[xr++]=Li,Li=e,ma=n}function Zd(e,n,r){tn[nn++]=xn,tn[nn++]=yn,tn[nn++]=Wn,Wn=e;var s=xn;e=yn;var f=32-Ye(s)-1;s&=~(1<<f),r+=1;var h=32-Ye(n)+f;if(30<h){var b=f-f%5;h=(s&(1<<b)-1).toString(32),s>>=b,f-=b,xn=1<<32-Ye(n)+f|r<<f|s,yn=h+e}else xn=1<<h|r<<f|s,yn=e}function qu(e){e.return!==null&&(On(e,1),Zd(e,1,0))}function Bu(e){for(;e===Li;)Li=gr[--xr],gr[xr]=null,ma=gr[--xr],gr[xr]=null;for(;e===Wn;)Wn=tn[--nn],tn[nn]=null,yn=tn[--nn],tn[nn]=null,xn=tn[--nn],tn[nn]=null}function Jd(e,n){tn[nn++]=xn,tn[nn++]=yn,tn[nn++]=Wn,xn=n.id,yn=n.overflow,Wn=e}var pt=null,Ie=null,Re=!1,el=null,ln=!1,Hu=Error(i(519));function tl(e){var n=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw pa(en(n,e)),Hu}function Pd(e){var n=e.stateNode,r=e.type,s=e.memoizedProps;switch(n[mt]=e,n[At]=s,r){case"dialog":je("cancel",n),je("close",n);break;case"iframe":case"object":case"embed":je("load",n);break;case"video":case"audio":for(r=0;r<Ua.length;r++)je(Ua[r],n);break;case"source":je("error",n);break;case"img":case"image":case"link":je("error",n),je("load",n);break;case"details":je("toggle",n);break;case"input":je("invalid",n),fd(n,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":je("invalid",n);break;case"textarea":je("invalid",n),hd(n,s.value,s.defaultValue,s.children)}r=s.children,typeof r!="string"&&typeof r!="number"&&typeof r!="bigint"||n.textContent===""+r||s.suppressHydrationWarning===!0||pp(n.textContent,r)?(s.popover!=null&&(je("beforetoggle",n),je("toggle",n)),s.onScroll!=null&&je("scroll",n),s.onScrollEnd!=null&&je("scrollend",n),s.onClick!=null&&(n.onclick=Rn),n=!0):n=!1,n||tl(e,!0)}function Wd(e){for(pt=e.return;pt;)switch(pt.tag){case 5:case 31:case 13:ln=!1;return;case 27:case 3:ln=!0;return;default:pt=pt.return}}function yr(e){if(e!==pt)return!1;if(!Re)return Wd(e),Re=!0,!1;var n=e.tag,r;if((r=n!==3&&n!==27)&&((r=n===5)&&(r=e.type,r=!(r!=="form"&&r!=="button")||ac(e.type,e.memoizedProps)),r=!r),r&&Ie&&tl(e),Wd(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));Ie=jp(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));Ie=jp(e)}else n===27?(n=Ie,pl(e.type)?(e=cc,cc=null,Ie=e):Ie=n):Ie=pt?an(e.stateNode.nextSibling):null;return!0}function zl(){Ie=pt=null,Re=!1}function Fu(){var e=el;return e!==null&&(_t===null?_t=e:_t.push.apply(_t,e),el=null),e}function pa(e){el===null?el=[e]:el.push(e)}var Qu=O(null),Ol=null,_n=null;function nl(e,n,r){j(Qu,n._currentValue),n._currentValue=r}function Dn(e){e._currentValue=Qu.current,$(Qu)}function Yu(e,n,r){for(;e!==null;){var s=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,s!==null&&(s.childLanes|=n)):s!==null&&(s.childLanes&n)!==n&&(s.childLanes|=n),e===r)break;e=e.return}}function Gu(e,n,r,s){var f=e.child;for(f!==null&&(f.return=e);f!==null;){var h=f.dependencies;if(h!==null){var b=f.child;h=h.firstContext;e:for(;h!==null;){var w=h;h=f;for(var z=0;z<n.length;z++)if(w.context===n[z]){h.lanes|=r,w=h.alternate,w!==null&&(w.lanes|=r),Yu(h.return,r,e),s||(b=null);break e}h=w.next}}else if(f.tag===18){if(b=f.return,b===null)throw Error(i(341));b.lanes|=r,h=b.alternate,h!==null&&(h.lanes|=r),Yu(b,r,e),b=null}else b=f.child;if(b!==null)b.return=f;else for(b=f;b!==null;){if(b===e){b=null;break}if(f=b.sibling,f!==null){f.return=b.return,b=f;break}b=b.return}f=b}}function br(e,n,r,s){e=null;for(var f=n,h=!1;f!==null;){if(!h){if((f.flags&524288)!==0)h=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var b=f.alternate;if(b===null)throw Error(i(387));if(b=b.memoizedProps,b!==null){var w=f.type;Bt(f.pendingProps.value,b.value)||(e!==null?e.push(w):e=[w])}}else if(f===Ee.current){if(b=f.alternate,b===null)throw Error(i(387));b.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(e!==null?e.push(Qa):e=[Qa])}f=f.return}e!==null&&Gu(n,e,r,s),n.flags|=262144}function Ui(e){for(e=e.firstContext;e!==null;){if(!Bt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function _l(e){Ol=e,_n=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function gt(e){return eh(Ol,e)}function qi(e,n){return Ol===null&&_l(e),eh(e,n)}function eh(e,n){var r=n._currentValue;if(n={context:n,memoizedValue:r,next:null},_n===null){if(e===null)throw Error(i(308));_n=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else _n=_n.next=n;return r}var nb=typeof AbortController<"u"?AbortController:function(){var e=[],n=this.signal={aborted:!1,addEventListener:function(r,s){e.push(s)}};this.abort=function(){n.aborted=!0,e.forEach(function(r){return r()})}},lb=t.unstable_scheduleCallback,rb=t.unstable_NormalPriority,lt={$$typeof:D,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Vu(){return{controller:new nb,data:new Map,refCount:0}}function ga(e){e.refCount--,e.refCount===0&&lb(rb,function(){e.controller.abort()})}var xa=null,Ku=0,vr=0,Sr=null;function ab(e,n){if(xa===null){var r=xa=[];Ku=0,vr=Zo(),Sr={status:"pending",value:void 0,then:function(s){r.push(s)}}}return Ku++,n.then(th,th),n}function th(){if(--Ku===0&&xa!==null){Sr!==null&&(Sr.status="fulfilled");var e=xa;xa=null,vr=0,Sr=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function ib(e,n){var r=[],s={status:"pending",value:null,reason:null,then:function(f){r.push(f)}};return e.then(function(){s.status="fulfilled",s.value=n;for(var f=0;f<r.length;f++)(0,r[f])(n)},function(f){for(s.status="rejected",s.reason=f,f=0;f<r.length;f++)(0,r[f])(void 0)}),s}var nh=U.S;U.S=function(e,n){Bm=Nt(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&ab(e,n),nh!==null&&nh(e,n)};var Dl=O(null);function Iu(){var e=Dl.current;return e!==null?e:Ge.pooledCache}function Bi(e,n){n===null?j(Dl,Dl.current):j(Dl,n.pool)}function lh(){var e=Iu();return e===null?null:{parent:lt._currentValue,pool:e}}var wr=Error(i(460)),Xu=Error(i(474)),Hi=Error(i(542)),Fi={then:function(){}};function rh(e){return e=e.status,e==="fulfilled"||e==="rejected"}function ah(e,n,r){switch(r=e[r],r===void 0?e.push(n):r!==n&&(n.then(Rn,Rn),n=r),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,sh(e),e;default:if(typeof n.status=="string")n.then(Rn,Rn);else{if(e=Ge,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=n,e.status="pending",e.then(function(s){if(n.status==="pending"){var f=n;f.status="fulfilled",f.value=s}},function(s){if(n.status==="pending"){var f=n;f.status="rejected",f.reason=s}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,sh(e),e}throw Ul=n,wr}}function Ll(e){try{var n=e._init;return n(e._payload)}catch(r){throw r!==null&&typeof r=="object"&&typeof r.then=="function"?(Ul=r,wr):r}}var Ul=null;function ih(){if(Ul===null)throw Error(i(459));var e=Ul;return Ul=null,e}function sh(e){if(e===wr||e===Hi)throw Error(i(483))}var Nr=null,ya=0;function Qi(e){var n=ya;return ya+=1,Nr===null&&(Nr=[]),ah(Nr,e,n)}function ba(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function Yi(e,n){throw n.$$typeof===v?Error(i(525)):(e=Object.prototype.toString.call(n),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)))}function uh(e){function n(B,_){if(e){var Q=B.deletions;Q===null?(B.deletions=[_],B.flags|=16):Q.push(_)}}function r(B,_){if(!e)return null;for(;_!==null;)n(B,_),_=_.sibling;return null}function s(B){for(var _=new Map;B!==null;)B.key!==null?_.set(B.key,B):_.set(B.index,B),B=B.sibling;return _}function f(B,_){return B=zn(B,_),B.index=0,B.sibling=null,B}function h(B,_,Q){return B.index=Q,e?(Q=B.alternate,Q!==null?(Q=Q.index,Q<_?(B.flags|=67108866,_):Q):(B.flags|=67108866,_)):(B.flags|=1048576,_)}function b(B){return e&&B.alternate===null&&(B.flags|=67108866),B}function w(B,_,Q,J){return _===null||_.tag!==6?(_=Lu(Q,B.mode,J),_.return=B,_):(_=f(_,Q),_.return=B,_)}function z(B,_,Q,J){var de=Q.type;return de===E?X(B,_,Q.props.children,J,Q.key):_!==null&&(_.elementType===de||typeof de=="object"&&de!==null&&de.$$typeof===ne&&Ll(de)===_.type)?(_=f(_,Q.props),ba(_,Q),_.return=B,_):(_=Di(Q.type,Q.key,Q.props,null,B.mode,J),ba(_,Q),_.return=B,_)}function Y(B,_,Q,J){return _===null||_.tag!==4||_.stateNode.containerInfo!==Q.containerInfo||_.stateNode.implementation!==Q.implementation?(_=Uu(Q,B.mode,J),_.return=B,_):(_=f(_,Q.children||[]),_.return=B,_)}function X(B,_,Q,J,de){return _===null||_.tag!==7?(_=Ml(Q,B.mode,J,de),_.return=B,_):(_=f(_,Q),_.return=B,_)}function W(B,_,Q){if(typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint")return _=Lu(""+_,B.mode,Q),_.return=B,_;if(typeof _=="object"&&_!==null){switch(_.$$typeof){case S:return Q=Di(_.type,_.key,_.props,null,B.mode,Q),ba(Q,_),Q.return=B,Q;case N:return _=Uu(_,B.mode,Q),_.return=B,_;case ne:return _=Ll(_),W(B,_,Q)}if(te(_)||H(_))return _=Ml(_,B.mode,Q,null),_.return=B,_;if(typeof _.then=="function")return W(B,Qi(_),Q);if(_.$$typeof===D)return W(B,qi(B,_),Q);Yi(B,_)}return null}function G(B,_,Q,J){var de=_!==null?_.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return de!==null?null:w(B,_,""+Q,J);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case S:return Q.key===de?z(B,_,Q,J):null;case N:return Q.key===de?Y(B,_,Q,J):null;case ne:return Q=Ll(Q),G(B,_,Q,J)}if(te(Q)||H(Q))return de!==null?null:X(B,_,Q,J,null);if(typeof Q.then=="function")return G(B,_,Qi(Q),J);if(Q.$$typeof===D)return G(B,_,qi(B,Q),J);Yi(B,Q)}return null}function I(B,_,Q,J,de){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return B=B.get(Q)||null,w(_,B,""+J,de);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case S:return B=B.get(J.key===null?Q:J.key)||null,z(_,B,J,de);case N:return B=B.get(J.key===null?Q:J.key)||null,Y(_,B,J,de);case ne:return J=Ll(J),I(B,_,Q,J,de)}if(te(J)||H(J))return B=B.get(Q)||null,X(_,B,J,de,null);if(typeof J.then=="function")return I(B,_,Q,Qi(J),de);if(J.$$typeof===D)return I(B,_,Q,qi(_,J),de);Yi(_,J)}return null}function oe(B,_,Q,J){for(var de=null,ze=null,ce=_,ve=_=0,Ae=null;ce!==null&&ve<Q.length;ve++){ce.index>ve?(Ae=ce,ce=null):Ae=ce.sibling;var Oe=G(B,ce,Q[ve],J);if(Oe===null){ce===null&&(ce=Ae);break}e&&ce&&Oe.alternate===null&&n(B,ce),_=h(Oe,_,ve),ze===null?de=Oe:ze.sibling=Oe,ze=Oe,ce=Ae}if(ve===Q.length)return r(B,ce),Re&&On(B,ve),de;if(ce===null){for(;ve<Q.length;ve++)ce=W(B,Q[ve],J),ce!==null&&(_=h(ce,_,ve),ze===null?de=ce:ze.sibling=ce,ze=ce);return Re&&On(B,ve),de}for(ce=s(ce);ve<Q.length;ve++)Ae=I(ce,B,ve,Q[ve],J),Ae!==null&&(e&&Ae.alternate!==null&&ce.delete(Ae.key===null?ve:Ae.key),_=h(Ae,_,ve),ze===null?de=Ae:ze.sibling=Ae,ze=Ae);return e&&ce.forEach(function(vl){return n(B,vl)}),Re&&On(B,ve),de}function me(B,_,Q,J){if(Q==null)throw Error(i(151));for(var de=null,ze=null,ce=_,ve=_=0,Ae=null,Oe=Q.next();ce!==null&&!Oe.done;ve++,Oe=Q.next()){ce.index>ve?(Ae=ce,ce=null):Ae=ce.sibling;var vl=G(B,ce,Oe.value,J);if(vl===null){ce===null&&(ce=Ae);break}e&&ce&&vl.alternate===null&&n(B,ce),_=h(vl,_,ve),ze===null?de=vl:ze.sibling=vl,ze=vl,ce=Ae}if(Oe.done)return r(B,ce),Re&&On(B,ve),de;if(ce===null){for(;!Oe.done;ve++,Oe=Q.next())Oe=W(B,Oe.value,J),Oe!==null&&(_=h(Oe,_,ve),ze===null?de=Oe:ze.sibling=Oe,ze=Oe);return Re&&On(B,ve),de}for(ce=s(ce);!Oe.done;ve++,Oe=Q.next())Oe=I(ce,B,ve,Oe.value,J),Oe!==null&&(e&&Oe.alternate!==null&&ce.delete(Oe.key===null?ve:Oe.key),_=h(Oe,_,ve),ze===null?de=Oe:ze.sibling=Oe,ze=Oe);return e&&ce.forEach(function(xv){return n(B,xv)}),Re&&On(B,ve),de}function Qe(B,_,Q,J){if(typeof Q=="object"&&Q!==null&&Q.type===E&&Q.key===null&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case S:e:{for(var de=Q.key;_!==null;){if(_.key===de){if(de=Q.type,de===E){if(_.tag===7){r(B,_.sibling),J=f(_,Q.props.children),J.return=B,B=J;break e}}else if(_.elementType===de||typeof de=="object"&&de!==null&&de.$$typeof===ne&&Ll(de)===_.type){r(B,_.sibling),J=f(_,Q.props),ba(J,Q),J.return=B,B=J;break e}r(B,_);break}else n(B,_);_=_.sibling}Q.type===E?(J=Ml(Q.props.children,B.mode,J,Q.key),J.return=B,B=J):(J=Di(Q.type,Q.key,Q.props,null,B.mode,J),ba(J,Q),J.return=B,B=J)}return b(B);case N:e:{for(de=Q.key;_!==null;){if(_.key===de)if(_.tag===4&&_.stateNode.containerInfo===Q.containerInfo&&_.stateNode.implementation===Q.implementation){r(B,_.sibling),J=f(_,Q.children||[]),J.return=B,B=J;break e}else{r(B,_);break}else n(B,_);_=_.sibling}J=Uu(Q,B.mode,J),J.return=B,B=J}return b(B);case ne:return Q=Ll(Q),Qe(B,_,Q,J)}if(te(Q))return oe(B,_,Q,J);if(H(Q)){if(de=H(Q),typeof de!="function")throw Error(i(150));return Q=de.call(Q),me(B,_,Q,J)}if(typeof Q.then=="function")return Qe(B,_,Qi(Q),J);if(Q.$$typeof===D)return Qe(B,_,qi(B,Q),J);Yi(B,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,_!==null&&_.tag===6?(r(B,_.sibling),J=f(_,Q),J.return=B,B=J):(r(B,_),J=Lu(Q,B.mode,J),J.return=B,B=J),b(B)):r(B,_)}return function(B,_,Q,J){try{ya=0;var de=Qe(B,_,Q,J);return Nr=null,de}catch(ce){if(ce===wr||ce===Hi)throw ce;var ze=Ht(29,ce,null,B.mode);return ze.lanes=J,ze.return=B,ze}}}var ql=uh(!0),oh=uh(!1),ll=!1;function $u(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Zu(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function rl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function al(e,n,r){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(_e&2)!==0){var f=s.pending;return f===null?n.next=n:(n.next=f.next,f.next=n),s.pending=n,n=_i(e),Kd(e,null,r),n}return Oi(e,s,n,r),_i(e)}function va(e,n,r){if(n=n.updateQueue,n!==null&&(n=n.shared,(r&4194048)!==0)){var s=n.lanes;s&=e.pendingLanes,r|=s,n.lanes=r,ed(e,r)}}function Ju(e,n){var r=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,r===s)){var f=null,h=null;if(r=r.firstBaseUpdate,r!==null){do{var b={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};h===null?f=h=b:h=h.next=b,r=r.next}while(r!==null);h===null?f=h=n:h=h.next=n}else f=h=n;r={baseState:s.baseState,firstBaseUpdate:f,lastBaseUpdate:h,shared:s.shared,callbacks:s.callbacks},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=n:e.next=n,r.lastBaseUpdate=n}var Pu=!1;function Sa(){if(Pu){var e=Sr;if(e!==null)throw e}}function wa(e,n,r,s){Pu=!1;var f=e.updateQueue;ll=!1;var h=f.firstBaseUpdate,b=f.lastBaseUpdate,w=f.shared.pending;if(w!==null){f.shared.pending=null;var z=w,Y=z.next;z.next=null,b===null?h=Y:b.next=Y,b=z;var X=e.alternate;X!==null&&(X=X.updateQueue,w=X.lastBaseUpdate,w!==b&&(w===null?X.firstBaseUpdate=Y:w.next=Y,X.lastBaseUpdate=z))}if(h!==null){var W=f.baseState;b=0,X=Y=z=null,w=h;do{var G=w.lane&-536870913,I=G!==w.lane;if(I?(Te&G)===G:(s&G)===G){G!==0&&G===vr&&(Pu=!0),X!==null&&(X=X.next={lane:0,tag:w.tag,payload:w.payload,callback:null,next:null});e:{var oe=e,me=w;G=n;var Qe=r;switch(me.tag){case 1:if(oe=me.payload,typeof oe=="function"){W=oe.call(Qe,W,G);break e}W=oe;break e;case 3:oe.flags=oe.flags&-65537|128;case 0:if(oe=me.payload,G=typeof oe=="function"?oe.call(Qe,W,G):oe,G==null)break e;W=x({},W,G);break e;case 2:ll=!0}}G=w.callback,G!==null&&(e.flags|=64,I&&(e.flags|=8192),I=f.callbacks,I===null?f.callbacks=[G]:I.push(G))}else I={lane:G,tag:w.tag,payload:w.payload,callback:w.callback,next:null},X===null?(Y=X=I,z=W):X=X.next=I,b|=G;if(w=w.next,w===null){if(w=f.shared.pending,w===null)break;I=w,w=I.next,I.next=null,f.lastBaseUpdate=I,f.shared.pending=null}}while(!0);X===null&&(z=W),f.baseState=z,f.firstBaseUpdate=Y,f.lastBaseUpdate=X,h===null&&(f.shared.lanes=0),cl|=b,e.lanes=b,e.memoizedState=W}}function ch(e,n){if(typeof e!="function")throw Error(i(191,e));e.call(n)}function fh(e,n){var r=e.callbacks;if(r!==null)for(e.callbacks=null,e=0;e<r.length;e++)ch(r[e],n)}var jr=O(null),Gi=O(0);function dh(e,n){e=Gn,j(Gi,e),j(jr,n),Gn=e|n.baseLanes}function Wu(){j(Gi,Gn),j(jr,jr.current)}function eo(){Gn=Gi.current,$(jr),$(Gi)}var Ft=O(null),rn=null;function il(e){var n=e.alternate;j(tt,tt.current&1),j(Ft,e),rn===null&&(n===null||jr.current!==null||n.memoizedState!==null)&&(rn=e)}function to(e){j(tt,tt.current),j(Ft,e),rn===null&&(rn=e)}function hh(e){e.tag===22?(j(tt,tt.current),j(Ft,e),rn===null&&(rn=e)):sl()}function sl(){j(tt,tt.current),j(Ft,Ft.current)}function Qt(e){$(Ft),rn===e&&(rn=null),$(tt)}var tt=O(0);function Vi(e){for(var n=e;n!==null;){if(n.tag===13){var r=n.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||uc(r)||oc(r)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var Ln=0,be=null,He=null,rt=null,Ki=!1,Cr=!1,Bl=!1,Ii=0,Na=0,kr=null,sb=0;function We(){throw Error(i(321))}function no(e,n){if(n===null)return!1;for(var r=0;r<n.length&&r<e.length;r++)if(!Bt(e[r],n[r]))return!1;return!0}function lo(e,n,r,s,f,h){return Ln=h,be=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,U.H=e===null||e.memoizedState===null?Zh:bo,Bl=!1,h=r(s,f),Bl=!1,Cr&&(h=ph(n,r,s,f)),mh(e),h}function mh(e){U.H=ka;var n=He!==null&&He.next!==null;if(Ln=0,rt=He=be=null,Ki=!1,Na=0,kr=null,n)throw Error(i(300));e===null||at||(e=e.dependencies,e!==null&&Ui(e)&&(at=!0))}function ph(e,n,r,s){be=e;var f=0;do{if(Cr&&(kr=null),Na=0,Cr=!1,25<=f)throw Error(i(301));if(f+=1,rt=He=null,e.updateQueue!=null){var h=e.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}U.H=Jh,h=n(r,s)}while(Cr);return h}function ub(){var e=U.H,n=e.useState()[0];return n=typeof n.then=="function"?ja(n):n,e=e.useState()[0],(He!==null?He.memoizedState:null)!==e&&(be.flags|=1024),n}function ro(){var e=Ii!==0;return Ii=0,e}function ao(e,n,r){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~r}function io(e){if(Ki){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}Ki=!1}Ln=0,rt=He=be=null,Cr=!1,Na=Ii=0,kr=null}function Ct(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return rt===null?be.memoizedState=rt=e:rt=rt.next=e,rt}function nt(){if(He===null){var e=be.alternate;e=e!==null?e.memoizedState:null}else e=He.next;var n=rt===null?be.memoizedState:rt.next;if(n!==null)rt=n,He=e;else{if(e===null)throw be.alternate===null?Error(i(467)):Error(i(310));He=e,e={memoizedState:He.memoizedState,baseState:He.baseState,baseQueue:He.baseQueue,queue:He.queue,next:null},rt===null?be.memoizedState=rt=e:rt=rt.next=e}return rt}function Xi(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ja(e){var n=Na;return Na+=1,kr===null&&(kr=[]),e=ah(kr,e,n),n=be,(rt===null?n.memoizedState:rt.next)===null&&(n=n.alternate,U.H=n===null||n.memoizedState===null?Zh:bo),e}function $i(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return ja(e);if(e.$$typeof===D)return gt(e)}throw Error(i(438,String(e)))}function so(e){var n=null,r=be.updateQueue;if(r!==null&&(n=r.memoCache),n==null){var s=be.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(n={data:s.data.map(function(f){return f.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),r===null&&(r=Xi(),be.updateQueue=r),r.memoCache=n,r=n.data[n.index],r===void 0)for(r=n.data[n.index]=Array(e),s=0;s<e;s++)r[s]=T;return n.index++,r}function Un(e,n){return typeof n=="function"?n(e):n}function Zi(e){var n=nt();return uo(n,He,e)}function uo(e,n,r){var s=e.queue;if(s===null)throw Error(i(311));s.lastRenderedReducer=r;var f=e.baseQueue,h=s.pending;if(h!==null){if(f!==null){var b=f.next;f.next=h.next,h.next=b}n.baseQueue=f=h,s.pending=null}if(h=e.baseState,f===null)e.memoizedState=h;else{n=f.next;var w=b=null,z=null,Y=n,X=!1;do{var W=Y.lane&-536870913;if(W!==Y.lane?(Te&W)===W:(Ln&W)===W){var G=Y.revertLane;if(G===0)z!==null&&(z=z.next={lane:0,revertLane:0,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null}),W===vr&&(X=!0);else if((Ln&G)===G){Y=Y.next,G===vr&&(X=!0);continue}else W={lane:0,revertLane:Y.revertLane,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},z===null?(w=z=W,b=h):z=z.next=W,be.lanes|=G,cl|=G;W=Y.action,Bl&&r(h,W),h=Y.hasEagerState?Y.eagerState:r(h,W)}else G={lane:W,revertLane:Y.revertLane,gesture:Y.gesture,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},z===null?(w=z=G,b=h):z=z.next=G,be.lanes|=W,cl|=W;Y=Y.next}while(Y!==null&&Y!==n);if(z===null?b=h:z.next=w,!Bt(h,e.memoizedState)&&(at=!0,X&&(r=Sr,r!==null)))throw r;e.memoizedState=h,e.baseState=b,e.baseQueue=z,s.lastRenderedState=h}return f===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function oo(e){var n=nt(),r=n.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=e;var s=r.dispatch,f=r.pending,h=n.memoizedState;if(f!==null){r.pending=null;var b=f=f.next;do h=e(h,b.action),b=b.next;while(b!==f);Bt(h,n.memoizedState)||(at=!0),n.memoizedState=h,n.baseQueue===null&&(n.baseState=h),r.lastRenderedState=h}return[h,s]}function gh(e,n,r){var s=be,f=nt(),h=Re;if(h){if(r===void 0)throw Error(i(407));r=r()}else r=n();var b=!Bt((He||f).memoizedState,r);if(b&&(f.memoizedState=r,at=!0),f=f.queue,ho(bh.bind(null,s,f,e),[e]),f.getSnapshot!==n||b||rt!==null&&rt.memoizedState.tag&1){if(s.flags|=2048,Er(9,{destroy:void 0},yh.bind(null,s,f,r,n),null),Ge===null)throw Error(i(349));h||(Ln&127)!==0||xh(s,n,r)}return r}function xh(e,n,r){e.flags|=16384,e={getSnapshot:n,value:r},n=be.updateQueue,n===null?(n=Xi(),be.updateQueue=n,n.stores=[e]):(r=n.stores,r===null?n.stores=[e]:r.push(e))}function yh(e,n,r,s){n.value=r,n.getSnapshot=s,vh(n)&&Sh(e)}function bh(e,n,r){return r(function(){vh(n)&&Sh(e)})}function vh(e){var n=e.getSnapshot;e=e.value;try{var r=n();return!Bt(e,r)}catch{return!0}}function Sh(e){var n=Rl(e,2);n!==null&&Dt(n,e,2)}function co(e){var n=Ct();if(typeof e=="function"){var r=e;if(e=r(),Bl){Tt(!0);try{r()}finally{Tt(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Un,lastRenderedState:e},n}function wh(e,n,r,s){return e.baseState=r,uo(e,He,typeof s=="function"?s:Un)}function ob(e,n,r,s,f){if(Wi(e))throw Error(i(485));if(e=n.action,e!==null){var h={payload:f,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(b){h.listeners.push(b)}};U.T!==null?r(!0):h.isTransition=!1,s(h),r=n.pending,r===null?(h.next=n.pending=h,Nh(n,h)):(h.next=r.next,n.pending=r.next=h)}}function Nh(e,n){var r=n.action,s=n.payload,f=e.state;if(n.isTransition){var h=U.T,b={};U.T=b;try{var w=r(f,s),z=U.S;z!==null&&z(b,w),jh(e,n,w)}catch(Y){fo(e,n,Y)}finally{h!==null&&b.types!==null&&(h.types=b.types),U.T=h}}else try{h=r(f,s),jh(e,n,h)}catch(Y){fo(e,n,Y)}}function jh(e,n,r){r!==null&&typeof r=="object"&&typeof r.then=="function"?r.then(function(s){Ch(e,n,s)},function(s){return fo(e,n,s)}):Ch(e,n,r)}function Ch(e,n,r){n.status="fulfilled",n.value=r,kh(n),e.state=r,n=e.pending,n!==null&&(r=n.next,r===n?e.pending=null:(r=r.next,n.next=r,Nh(e,r)))}function fo(e,n,r){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do n.status="rejected",n.reason=r,kh(n),n=n.next;while(n!==s)}e.action=null}function kh(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function Eh(e,n){return n}function Th(e,n){if(Re){var r=Ge.formState;if(r!==null){e:{var s=be;if(Re){if(Ie){t:{for(var f=Ie,h=ln;f.nodeType!==8;){if(!h){f=null;break t}if(f=an(f.nextSibling),f===null){f=null;break t}}h=f.data,f=h==="F!"||h==="F"?f:null}if(f){Ie=an(f.nextSibling),s=f.data==="F!";break e}}tl(s)}s=!1}s&&(n=r[0])}}return r=Ct(),r.memoizedState=r.baseState=n,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Eh,lastRenderedState:n},r.queue=s,r=Ih.bind(null,be,s),s.dispatch=r,s=co(!1),h=yo.bind(null,be,!1,s.queue),s=Ct(),f={state:n,dispatch:null,action:e,pending:null},s.queue=f,r=ob.bind(null,be,f,h,r),f.dispatch=r,s.memoizedState=e,[n,r,!1]}function Ah(e){var n=nt();return Rh(n,He,e)}function Rh(e,n,r){if(n=uo(e,n,Eh)[0],e=Zi(Un)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var s=ja(n)}catch(b){throw b===wr?Hi:b}else s=n;n=nt();var f=n.queue,h=f.dispatch;return r!==n.memoizedState&&(be.flags|=2048,Er(9,{destroy:void 0},cb.bind(null,f,r),null)),[s,h,e]}function cb(e,n){e.action=n}function Mh(e){var n=nt(),r=He;if(r!==null)return Rh(n,r,e);nt(),n=n.memoizedState,r=nt();var s=r.queue.dispatch;return r.memoizedState=e,[n,s,!1]}function Er(e,n,r,s){return e={tag:e,create:r,deps:s,inst:n,next:null},n=be.updateQueue,n===null&&(n=Xi(),be.updateQueue=n),r=n.lastEffect,r===null?n.lastEffect=e.next=e:(s=r.next,r.next=e,e.next=s,n.lastEffect=e),e}function zh(){return nt().memoizedState}function Ji(e,n,r,s){var f=Ct();be.flags|=e,f.memoizedState=Er(1|n,{destroy:void 0},r,s===void 0?null:s)}function Pi(e,n,r,s){var f=nt();s=s===void 0?null:s;var h=f.memoizedState.inst;He!==null&&s!==null&&no(s,He.memoizedState.deps)?f.memoizedState=Er(n,h,r,s):(be.flags|=e,f.memoizedState=Er(1|n,h,r,s))}function Oh(e,n){Ji(8390656,8,e,n)}function ho(e,n){Pi(2048,8,e,n)}function fb(e){be.flags|=4;var n=be.updateQueue;if(n===null)n=Xi(),be.updateQueue=n,n.events=[e];else{var r=n.events;r===null?n.events=[e]:r.push(e)}}function _h(e){var n=nt().memoizedState;return fb({ref:n,nextImpl:e}),function(){if((_e&2)!==0)throw Error(i(440));return n.impl.apply(void 0,arguments)}}function Dh(e,n){return Pi(4,2,e,n)}function Lh(e,n){return Pi(4,4,e,n)}function Uh(e,n){if(typeof n=="function"){e=e();var r=n(e);return function(){typeof r=="function"?r():n(null)}}if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function qh(e,n,r){r=r!=null?r.concat([e]):null,Pi(4,4,Uh.bind(null,n,e),r)}function mo(){}function Bh(e,n){var r=nt();n=n===void 0?null:n;var s=r.memoizedState;return n!==null&&no(n,s[1])?s[0]:(r.memoizedState=[e,n],e)}function Hh(e,n){var r=nt();n=n===void 0?null:n;var s=r.memoizedState;if(n!==null&&no(n,s[1]))return s[0];if(s=e(),Bl){Tt(!0);try{e()}finally{Tt(!1)}}return r.memoizedState=[s,n],s}function po(e,n,r){return r===void 0||(Ln&1073741824)!==0&&(Te&261930)===0?e.memoizedState=n:(e.memoizedState=r,e=Fm(),be.lanes|=e,cl|=e,r)}function Fh(e,n,r,s){return Bt(r,n)?r:jr.current!==null?(e=po(e,r,s),Bt(e,n)||(at=!0),e):(Ln&42)===0||(Ln&1073741824)!==0&&(Te&261930)===0?(at=!0,e.memoizedState=r):(e=Fm(),be.lanes|=e,cl|=e,n)}function Qh(e,n,r,s,f){var h=ee.p;ee.p=h!==0&&8>h?h:8;var b=U.T,w={};U.T=w,yo(e,!1,n,r);try{var z=f(),Y=U.S;if(Y!==null&&Y(w,z),z!==null&&typeof z=="object"&&typeof z.then=="function"){var X=ib(z,s);Ca(e,n,X,Vt(e))}else Ca(e,n,s,Vt(e))}catch(W){Ca(e,n,{then:function(){},status:"rejected",reason:W},Vt())}finally{ee.p=h,b!==null&&w.types!==null&&(b.types=w.types),U.T=b}}function db(){}function go(e,n,r,s){if(e.tag!==5)throw Error(i(476));var f=Yh(e).queue;Qh(e,f,n,L,r===null?db:function(){return Gh(e),r(s)})}function Yh(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:L,baseState:L,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Un,lastRenderedState:L},next:null};var r={};return n.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Un,lastRenderedState:r},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function Gh(e){var n=Yh(e);n.next===null&&(n=e.alternate.memoizedState),Ca(e,n.next.queue,{},Vt())}function xo(){return gt(Qa)}function Vh(){return nt().memoizedState}function Kh(){return nt().memoizedState}function hb(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var r=Vt();e=rl(r);var s=al(n,e,r);s!==null&&(Dt(s,n,r),va(s,n,r)),n={cache:Vu()},e.payload=n;return}n=n.return}}function mb(e,n,r){var s=Vt();r={lane:s,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Wi(e)?Xh(n,r):(r=_u(e,n,r,s),r!==null&&(Dt(r,e,s),$h(r,n,s)))}function Ih(e,n,r){var s=Vt();Ca(e,n,r,s)}function Ca(e,n,r,s){var f={lane:s,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(Wi(e))Xh(n,f);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=n.lastRenderedReducer,h!==null))try{var b=n.lastRenderedState,w=h(b,r);if(f.hasEagerState=!0,f.eagerState=w,Bt(w,b))return Oi(e,n,f,0),Ge===null&&zi(),!1}catch{}if(r=_u(e,n,f,s),r!==null)return Dt(r,e,s),$h(r,n,s),!0}return!1}function yo(e,n,r,s){if(s={lane:2,revertLane:Zo(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Wi(e)){if(n)throw Error(i(479))}else n=_u(e,r,s,2),n!==null&&Dt(n,e,2)}function Wi(e){var n=e.alternate;return e===be||n!==null&&n===be}function Xh(e,n){Cr=Ki=!0;var r=e.pending;r===null?n.next=n:(n.next=r.next,r.next=n),e.pending=n}function $h(e,n,r){if((r&4194048)!==0){var s=n.lanes;s&=e.pendingLanes,r|=s,n.lanes=r,ed(e,r)}}var ka={readContext:gt,use:$i,useCallback:We,useContext:We,useEffect:We,useImperativeHandle:We,useLayoutEffect:We,useInsertionEffect:We,useMemo:We,useReducer:We,useRef:We,useState:We,useDebugValue:We,useDeferredValue:We,useTransition:We,useSyncExternalStore:We,useId:We,useHostTransitionStatus:We,useFormState:We,useActionState:We,useOptimistic:We,useMemoCache:We,useCacheRefresh:We};ka.useEffectEvent=We;var Zh={readContext:gt,use:$i,useCallback:function(e,n){return Ct().memoizedState=[e,n===void 0?null:n],e},useContext:gt,useEffect:Oh,useImperativeHandle:function(e,n,r){r=r!=null?r.concat([e]):null,Ji(4194308,4,Uh.bind(null,n,e),r)},useLayoutEffect:function(e,n){return Ji(4194308,4,e,n)},useInsertionEffect:function(e,n){Ji(4,2,e,n)},useMemo:function(e,n){var r=Ct();n=n===void 0?null:n;var s=e();if(Bl){Tt(!0);try{e()}finally{Tt(!1)}}return r.memoizedState=[s,n],s},useReducer:function(e,n,r){var s=Ct();if(r!==void 0){var f=r(n);if(Bl){Tt(!0);try{r(n)}finally{Tt(!1)}}}else f=n;return s.memoizedState=s.baseState=f,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:f},s.queue=e,e=e.dispatch=mb.bind(null,be,e),[s.memoizedState,e]},useRef:function(e){var n=Ct();return e={current:e},n.memoizedState=e},useState:function(e){e=co(e);var n=e.queue,r=Ih.bind(null,be,n);return n.dispatch=r,[e.memoizedState,r]},useDebugValue:mo,useDeferredValue:function(e,n){var r=Ct();return po(r,e,n)},useTransition:function(){var e=co(!1);return e=Qh.bind(null,be,e.queue,!0,!1),Ct().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,r){var s=be,f=Ct();if(Re){if(r===void 0)throw Error(i(407));r=r()}else{if(r=n(),Ge===null)throw Error(i(349));(Te&127)!==0||xh(s,n,r)}f.memoizedState=r;var h={value:r,getSnapshot:n};return f.queue=h,Oh(bh.bind(null,s,h,e),[e]),s.flags|=2048,Er(9,{destroy:void 0},yh.bind(null,s,h,r,n),null),r},useId:function(){var e=Ct(),n=Ge.identifierPrefix;if(Re){var r=yn,s=xn;r=(s&~(1<<32-Ye(s)-1)).toString(32)+r,n="_"+n+"R_"+r,r=Ii++,0<r&&(n+="H"+r.toString(32)),n+="_"}else r=sb++,n="_"+n+"r_"+r.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:xo,useFormState:Th,useActionState:Th,useOptimistic:function(e){var n=Ct();n.memoizedState=n.baseState=e;var r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=r,n=yo.bind(null,be,!0,r),r.dispatch=n,[e,n]},useMemoCache:so,useCacheRefresh:function(){return Ct().memoizedState=hb.bind(null,be)},useEffectEvent:function(e){var n=Ct(),r={impl:e};return n.memoizedState=r,function(){if((_e&2)!==0)throw Error(i(440));return r.impl.apply(void 0,arguments)}}},bo={readContext:gt,use:$i,useCallback:Bh,useContext:gt,useEffect:ho,useImperativeHandle:qh,useInsertionEffect:Dh,useLayoutEffect:Lh,useMemo:Hh,useReducer:Zi,useRef:zh,useState:function(){return Zi(Un)},useDebugValue:mo,useDeferredValue:function(e,n){var r=nt();return Fh(r,He.memoizedState,e,n)},useTransition:function(){var e=Zi(Un)[0],n=nt().memoizedState;return[typeof e=="boolean"?e:ja(e),n]},useSyncExternalStore:gh,useId:Vh,useHostTransitionStatus:xo,useFormState:Ah,useActionState:Ah,useOptimistic:function(e,n){var r=nt();return wh(r,He,e,n)},useMemoCache:so,useCacheRefresh:Kh};bo.useEffectEvent=_h;var Jh={readContext:gt,use:$i,useCallback:Bh,useContext:gt,useEffect:ho,useImperativeHandle:qh,useInsertionEffect:Dh,useLayoutEffect:Lh,useMemo:Hh,useReducer:oo,useRef:zh,useState:function(){return oo(Un)},useDebugValue:mo,useDeferredValue:function(e,n){var r=nt();return He===null?po(r,e,n):Fh(r,He.memoizedState,e,n)},useTransition:function(){var e=oo(Un)[0],n=nt().memoizedState;return[typeof e=="boolean"?e:ja(e),n]},useSyncExternalStore:gh,useId:Vh,useHostTransitionStatus:xo,useFormState:Mh,useActionState:Mh,useOptimistic:function(e,n){var r=nt();return He!==null?wh(r,He,e,n):(r.baseState=e,[e,r.queue.dispatch])},useMemoCache:so,useCacheRefresh:Kh};Jh.useEffectEvent=_h;function vo(e,n,r,s){n=e.memoizedState,r=r(s,n),r=r==null?n:x({},n,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var So={enqueueSetState:function(e,n,r){e=e._reactInternals;var s=Vt(),f=rl(s);f.payload=n,r!=null&&(f.callback=r),n=al(e,f,s),n!==null&&(Dt(n,e,s),va(n,e,s))},enqueueReplaceState:function(e,n,r){e=e._reactInternals;var s=Vt(),f=rl(s);f.tag=1,f.payload=n,r!=null&&(f.callback=r),n=al(e,f,s),n!==null&&(Dt(n,e,s),va(n,e,s))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var r=Vt(),s=rl(r);s.tag=2,n!=null&&(s.callback=n),n=al(e,s,r),n!==null&&(Dt(n,e,r),va(n,e,r))}};function Ph(e,n,r,s,f,h,b){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,h,b):n.prototype&&n.prototype.isPureReactComponent?!da(r,s)||!da(f,h):!0}function Wh(e,n,r,s){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(r,s),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(r,s),n.state!==e&&So.enqueueReplaceState(n,n.state,null)}function Hl(e,n){var r=n;if("ref"in n){r={};for(var s in n)s!=="ref"&&(r[s]=n[s])}if(e=e.defaultProps){r===n&&(r=x({},r));for(var f in e)r[f]===void 0&&(r[f]=e[f])}return r}function em(e){Mi(e)}function tm(e){console.error(e)}function nm(e){Mi(e)}function es(e,n){try{var r=e.onUncaughtError;r(n.value,{componentStack:n.stack})}catch(s){setTimeout(function(){throw s})}}function lm(e,n,r){try{var s=e.onCaughtError;s(r.value,{componentStack:r.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function wo(e,n,r){return r=rl(r),r.tag=3,r.payload={element:null},r.callback=function(){es(e,n)},r}function rm(e){return e=rl(e),e.tag=3,e}function am(e,n,r,s){var f=r.type.getDerivedStateFromError;if(typeof f=="function"){var h=s.value;e.payload=function(){return f(h)},e.callback=function(){lm(n,r,s)}}var b=r.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(e.callback=function(){lm(n,r,s),typeof f!="function"&&(fl===null?fl=new Set([this]):fl.add(this));var w=s.stack;this.componentDidCatch(s.value,{componentStack:w!==null?w:""})})}function pb(e,n,r,s,f){if(r.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(n=r.alternate,n!==null&&br(n,r,f,!0),r=Ft.current,r!==null){switch(r.tag){case 31:case 13:return rn===null?ds():r.alternate===null&&et===0&&(et=3),r.flags&=-257,r.flags|=65536,r.lanes=f,s===Fi?r.flags|=16384:(n=r.updateQueue,n===null?r.updateQueue=new Set([s]):n.add(s),Io(e,s,f)),!1;case 22:return r.flags|=65536,s===Fi?r.flags|=16384:(n=r.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([s])},r.updateQueue=n):(r=n.retryQueue,r===null?n.retryQueue=new Set([s]):r.add(s)),Io(e,s,f)),!1}throw Error(i(435,r.tag))}return Io(e,s,f),ds(),!1}if(Re)return n=Ft.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=f,s!==Hu&&(e=Error(i(422),{cause:s}),pa(en(e,r)))):(s!==Hu&&(n=Error(i(423),{cause:s}),pa(en(n,r))),e=e.current.alternate,e.flags|=65536,f&=-f,e.lanes|=f,s=en(s,r),f=wo(e.stateNode,s,f),Ju(e,f),et!==4&&(et=2)),!1;var h=Error(i(520),{cause:s});if(h=en(h,r),_a===null?_a=[h]:_a.push(h),et!==4&&(et=2),n===null)return!0;s=en(s,r),r=n;do{switch(r.tag){case 3:return r.flags|=65536,e=f&-f,r.lanes|=e,e=wo(r.stateNode,s,e),Ju(r,e),!1;case 1:if(n=r.type,h=r.stateNode,(r.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(fl===null||!fl.has(h))))return r.flags|=65536,f&=-f,r.lanes|=f,f=rm(f),am(f,e,r,s),Ju(r,f),!1}r=r.return}while(r!==null);return!1}var No=Error(i(461)),at=!1;function xt(e,n,r,s){n.child=e===null?oh(n,null,r,s):ql(n,e.child,r,s)}function im(e,n,r,s,f){r=r.render;var h=n.ref;if("ref"in s){var b={};for(var w in s)w!=="ref"&&(b[w]=s[w])}else b=s;return _l(n),s=lo(e,n,r,b,h,f),w=ro(),e!==null&&!at?(ao(e,n,f),qn(e,n,f)):(Re&&w&&qu(n),n.flags|=1,xt(e,n,s,f),n.child)}function sm(e,n,r,s,f){if(e===null){var h=r.type;return typeof h=="function"&&!Du(h)&&h.defaultProps===void 0&&r.compare===null?(n.tag=15,n.type=h,um(e,n,h,s,f)):(e=Di(r.type,null,s,n,n.mode,f),e.ref=n.ref,e.return=n,n.child=e)}if(h=e.child,!Mo(e,f)){var b=h.memoizedProps;if(r=r.compare,r=r!==null?r:da,r(b,s)&&e.ref===n.ref)return qn(e,n,f)}return n.flags|=1,e=zn(h,s),e.ref=n.ref,e.return=n,n.child=e}function um(e,n,r,s,f){if(e!==null){var h=e.memoizedProps;if(da(h,s)&&e.ref===n.ref)if(at=!1,n.pendingProps=s=h,Mo(e,f))(e.flags&131072)!==0&&(at=!0);else return n.lanes=e.lanes,qn(e,n,f)}return jo(e,n,r,s,f)}function om(e,n,r,s){var f=s.children,h=e!==null?e.memoizedState:null;if(e===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((n.flags&128)!==0){if(h=h!==null?h.baseLanes|r:r,e!==null){for(s=n.child=e.child,f=0;s!==null;)f=f|s.lanes|s.childLanes,s=s.sibling;s=f&~h}else s=0,n.child=null;return cm(e,n,h,r,s)}if((r&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&Bi(n,h!==null?h.cachePool:null),h!==null?dh(n,h):Wu(),hh(n);else return s=n.lanes=536870912,cm(e,n,h!==null?h.baseLanes|r:r,r,s)}else h!==null?(Bi(n,h.cachePool),dh(n,h),sl(),n.memoizedState=null):(e!==null&&Bi(n,null),Wu(),sl());return xt(e,n,f,r),n.child}function Ea(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function cm(e,n,r,s,f){var h=Iu();return h=h===null?null:{parent:lt._currentValue,pool:h},n.memoizedState={baseLanes:r,cachePool:h},e!==null&&Bi(n,null),Wu(),hh(n),e!==null&&br(e,n,s,!0),n.childLanes=f,null}function ts(e,n){return n=ls({mode:n.mode,children:n.children},e.mode),n.ref=e.ref,e.child=n,n.return=e,n}function fm(e,n,r){return ql(n,e.child,null,r),e=ts(n,n.pendingProps),e.flags|=2,Qt(n),n.memoizedState=null,e}function gb(e,n,r){var s=n.pendingProps,f=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(Re){if(s.mode==="hidden")return e=ts(n,s),n.lanes=536870912,Ea(null,e);if(to(n),(e=Ie)?(e=Np(e,ln),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:Wn!==null?{id:xn,overflow:yn}:null,retryLane:536870912,hydrationErrors:null},r=Xd(e),r.return=n,n.child=r,pt=n,Ie=null)):e=null,e===null)throw tl(n);return n.lanes=536870912,null}return ts(n,s)}var h=e.memoizedState;if(h!==null){var b=h.dehydrated;if(to(n),f)if(n.flags&256)n.flags&=-257,n=fm(e,n,r);else if(n.memoizedState!==null)n.child=e.child,n.flags|=128,n=null;else throw Error(i(558));else if(at||br(e,n,r,!1),f=(r&e.childLanes)!==0,at||f){if(s=Ge,s!==null&&(b=td(s,r),b!==0&&b!==h.retryLane))throw h.retryLane=b,Rl(e,b),Dt(s,e,b),No;ds(),n=fm(e,n,r)}else e=h.treeContext,Ie=an(b.nextSibling),pt=n,Re=!0,el=null,ln=!1,e!==null&&Jd(n,e),n=ts(n,s),n.flags|=4096;return n}return e=zn(e.child,{mode:s.mode,children:s.children}),e.ref=n.ref,n.child=e,e.return=n,e}function ns(e,n){var r=n.ref;if(r===null)e!==null&&e.ref!==null&&(n.flags|=4194816);else{if(typeof r!="function"&&typeof r!="object")throw Error(i(284));(e===null||e.ref!==r)&&(n.flags|=4194816)}}function jo(e,n,r,s,f){return _l(n),r=lo(e,n,r,s,void 0,f),s=ro(),e!==null&&!at?(ao(e,n,f),qn(e,n,f)):(Re&&s&&qu(n),n.flags|=1,xt(e,n,r,f),n.child)}function dm(e,n,r,s,f,h){return _l(n),n.updateQueue=null,r=ph(n,s,r,f),mh(e),s=ro(),e!==null&&!at?(ao(e,n,h),qn(e,n,h)):(Re&&s&&qu(n),n.flags|=1,xt(e,n,r,h),n.child)}function hm(e,n,r,s,f){if(_l(n),n.stateNode===null){var h=pr,b=r.contextType;typeof b=="object"&&b!==null&&(h=gt(b)),h=new r(s,h),n.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=So,n.stateNode=h,h._reactInternals=n,h=n.stateNode,h.props=s,h.state=n.memoizedState,h.refs={},$u(n),b=r.contextType,h.context=typeof b=="object"&&b!==null?gt(b):pr,h.state=n.memoizedState,b=r.getDerivedStateFromProps,typeof b=="function"&&(vo(n,r,b,s),h.state=n.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(b=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),b!==h.state&&So.enqueueReplaceState(h,h.state,null),wa(n,s,h,f),Sa(),h.state=n.memoizedState),typeof h.componentDidMount=="function"&&(n.flags|=4194308),s=!0}else if(e===null){h=n.stateNode;var w=n.memoizedProps,z=Hl(r,w);h.props=z;var Y=h.context,X=r.contextType;b=pr,typeof X=="object"&&X!==null&&(b=gt(X));var W=r.getDerivedStateFromProps;X=typeof W=="function"||typeof h.getSnapshotBeforeUpdate=="function",w=n.pendingProps!==w,X||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(w||Y!==b)&&Wh(n,h,s,b),ll=!1;var G=n.memoizedState;h.state=G,wa(n,s,h,f),Sa(),Y=n.memoizedState,w||G!==Y||ll?(typeof W=="function"&&(vo(n,r,W,s),Y=n.memoizedState),(z=ll||Ph(n,r,z,s,G,Y,b))?(X||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(n.flags|=4194308)):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=s,n.memoizedState=Y),h.props=s,h.state=Y,h.context=b,s=z):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),s=!1)}else{h=n.stateNode,Zu(e,n),b=n.memoizedProps,X=Hl(r,b),h.props=X,W=n.pendingProps,G=h.context,Y=r.contextType,z=pr,typeof Y=="object"&&Y!==null&&(z=gt(Y)),w=r.getDerivedStateFromProps,(Y=typeof w=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(b!==W||G!==z)&&Wh(n,h,s,z),ll=!1,G=n.memoizedState,h.state=G,wa(n,s,h,f),Sa();var I=n.memoizedState;b!==W||G!==I||ll||e!==null&&e.dependencies!==null&&Ui(e.dependencies)?(typeof w=="function"&&(vo(n,r,w,s),I=n.memoizedState),(X=ll||Ph(n,r,X,s,G,I,z)||e!==null&&e.dependencies!==null&&Ui(e.dependencies))?(Y||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(s,I,z),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(s,I,z)),typeof h.componentDidUpdate=="function"&&(n.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof h.componentDidUpdate!="function"||b===e.memoizedProps&&G===e.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&G===e.memoizedState||(n.flags|=1024),n.memoizedProps=s,n.memoizedState=I),h.props=s,h.state=I,h.context=z,s=X):(typeof h.componentDidUpdate!="function"||b===e.memoizedProps&&G===e.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&G===e.memoizedState||(n.flags|=1024),s=!1)}return h=s,ns(e,n),s=(n.flags&128)!==0,h||s?(h=n.stateNode,r=s&&typeof r.getDerivedStateFromError!="function"?null:h.render(),n.flags|=1,e!==null&&s?(n.child=ql(n,e.child,null,f),n.child=ql(n,null,r,f)):xt(e,n,r,f),n.memoizedState=h.state,e=n.child):e=qn(e,n,f),e}function mm(e,n,r,s){return zl(),n.flags|=256,xt(e,n,r,s),n.child}var Co={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ko(e){return{baseLanes:e,cachePool:lh()}}function Eo(e,n,r){return e=e!==null?e.childLanes&~r:0,n&&(e|=Gt),e}function pm(e,n,r){var s=n.pendingProps,f=!1,h=(n.flags&128)!==0,b;if((b=h)||(b=e!==null&&e.memoizedState===null?!1:(tt.current&2)!==0),b&&(f=!0,n.flags&=-129),b=(n.flags&32)!==0,n.flags&=-33,e===null){if(Re){if(f?il(n):sl(),(e=Ie)?(e=Np(e,ln),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:Wn!==null?{id:xn,overflow:yn}:null,retryLane:536870912,hydrationErrors:null},r=Xd(e),r.return=n,n.child=r,pt=n,Ie=null)):e=null,e===null)throw tl(n);return oc(e)?n.lanes=32:n.lanes=536870912,null}var w=s.children;return s=s.fallback,f?(sl(),f=n.mode,w=ls({mode:"hidden",children:w},f),s=Ml(s,f,r,null),w.return=n,s.return=n,w.sibling=s,n.child=w,s=n.child,s.memoizedState=ko(r),s.childLanes=Eo(e,b,r),n.memoizedState=Co,Ea(null,s)):(il(n),To(n,w))}var z=e.memoizedState;if(z!==null&&(w=z.dehydrated,w!==null)){if(h)n.flags&256?(il(n),n.flags&=-257,n=Ao(e,n,r)):n.memoizedState!==null?(sl(),n.child=e.child,n.flags|=128,n=null):(sl(),w=s.fallback,f=n.mode,s=ls({mode:"visible",children:s.children},f),w=Ml(w,f,r,null),w.flags|=2,s.return=n,w.return=n,s.sibling=w,n.child=s,ql(n,e.child,null,r),s=n.child,s.memoizedState=ko(r),s.childLanes=Eo(e,b,r),n.memoizedState=Co,n=Ea(null,s));else if(il(n),oc(w)){if(b=w.nextSibling&&w.nextSibling.dataset,b)var Y=b.dgst;b=Y,s=Error(i(419)),s.stack="",s.digest=b,pa({value:s,source:null,stack:null}),n=Ao(e,n,r)}else if(at||br(e,n,r,!1),b=(r&e.childLanes)!==0,at||b){if(b=Ge,b!==null&&(s=td(b,r),s!==0&&s!==z.retryLane))throw z.retryLane=s,Rl(e,s),Dt(b,e,s),No;uc(w)||ds(),n=Ao(e,n,r)}else uc(w)?(n.flags|=192,n.child=e.child,n=null):(e=z.treeContext,Ie=an(w.nextSibling),pt=n,Re=!0,el=null,ln=!1,e!==null&&Jd(n,e),n=To(n,s.children),n.flags|=4096);return n}return f?(sl(),w=s.fallback,f=n.mode,z=e.child,Y=z.sibling,s=zn(z,{mode:"hidden",children:s.children}),s.subtreeFlags=z.subtreeFlags&65011712,Y!==null?w=zn(Y,w):(w=Ml(w,f,r,null),w.flags|=2),w.return=n,s.return=n,s.sibling=w,n.child=s,Ea(null,s),s=n.child,w=e.child.memoizedState,w===null?w=ko(r):(f=w.cachePool,f!==null?(z=lt._currentValue,f=f.parent!==z?{parent:z,pool:z}:f):f=lh(),w={baseLanes:w.baseLanes|r,cachePool:f}),s.memoizedState=w,s.childLanes=Eo(e,b,r),n.memoizedState=Co,Ea(e.child,s)):(il(n),r=e.child,e=r.sibling,r=zn(r,{mode:"visible",children:s.children}),r.return=n,r.sibling=null,e!==null&&(b=n.deletions,b===null?(n.deletions=[e],n.flags|=16):b.push(e)),n.child=r,n.memoizedState=null,r)}function To(e,n){return n=ls({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function ls(e,n){return e=Ht(22,e,null,n),e.lanes=0,e}function Ao(e,n,r){return ql(n,e.child,null,r),e=To(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function gm(e,n,r){e.lanes|=n;var s=e.alternate;s!==null&&(s.lanes|=n),Yu(e.return,n,r)}function Ro(e,n,r,s,f,h){var b=e.memoizedState;b===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:s,tail:r,tailMode:f,treeForkCount:h}:(b.isBackwards=n,b.rendering=null,b.renderingStartTime=0,b.last=s,b.tail=r,b.tailMode=f,b.treeForkCount=h)}function xm(e,n,r){var s=n.pendingProps,f=s.revealOrder,h=s.tail;s=s.children;var b=tt.current,w=(b&2)!==0;if(w?(b=b&1|2,n.flags|=128):b&=1,j(tt,b),xt(e,n,s,r),s=Re?ma:0,!w&&e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&gm(e,r,n);else if(e.tag===19)gm(e,r,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(f){case"forwards":for(r=n.child,f=null;r!==null;)e=r.alternate,e!==null&&Vi(e)===null&&(f=r),r=r.sibling;r=f,r===null?(f=n.child,n.child=null):(f=r.sibling,r.sibling=null),Ro(n,!1,f,r,h,s);break;case"backwards":case"unstable_legacy-backwards":for(r=null,f=n.child,n.child=null;f!==null;){if(e=f.alternate,e!==null&&Vi(e)===null){n.child=f;break}e=f.sibling,f.sibling=r,r=f,f=e}Ro(n,!0,r,null,h,s);break;case"together":Ro(n,!1,null,null,void 0,s);break;default:n.memoizedState=null}return n.child}function qn(e,n,r){if(e!==null&&(n.dependencies=e.dependencies),cl|=n.lanes,(r&n.childLanes)===0)if(e!==null){if(br(e,n,r,!1),(r&n.childLanes)===0)return null}else return null;if(e!==null&&n.child!==e.child)throw Error(i(153));if(n.child!==null){for(e=n.child,r=zn(e,e.pendingProps),n.child=r,r.return=n;e.sibling!==null;)e=e.sibling,r=r.sibling=zn(e,e.pendingProps),r.return=n;r.sibling=null}return n.child}function Mo(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&Ui(e)))}function xb(e,n,r){switch(n.tag){case 3:$e(n,n.stateNode.containerInfo),nl(n,lt,e.memoizedState.cache),zl();break;case 27:case 5:Zt(n);break;case 4:$e(n,n.stateNode.containerInfo);break;case 10:nl(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,to(n),null;break;case 13:var s=n.memoizedState;if(s!==null)return s.dehydrated!==null?(il(n),n.flags|=128,null):(r&n.child.childLanes)!==0?pm(e,n,r):(il(n),e=qn(e,n,r),e!==null?e.sibling:null);il(n);break;case 19:var f=(e.flags&128)!==0;if(s=(r&n.childLanes)!==0,s||(br(e,n,r,!1),s=(r&n.childLanes)!==0),f){if(s)return xm(e,n,r);n.flags|=128}if(f=n.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),j(tt,tt.current),s)break;return null;case 22:return n.lanes=0,om(e,n,r,n.pendingProps);case 24:nl(n,lt,e.memoizedState.cache)}return qn(e,n,r)}function ym(e,n,r){if(e!==null)if(e.memoizedProps!==n.pendingProps)at=!0;else{if(!Mo(e,r)&&(n.flags&128)===0)return at=!1,xb(e,n,r);at=(e.flags&131072)!==0}else at=!1,Re&&(n.flags&1048576)!==0&&Zd(n,ma,n.index);switch(n.lanes=0,n.tag){case 16:e:{var s=n.pendingProps;if(e=Ll(n.elementType),n.type=e,typeof e=="function")Du(e)?(s=Hl(e,s),n.tag=1,n=hm(null,n,e,s,r)):(n.tag=0,n=jo(null,n,e,s,r));else{if(e!=null){var f=e.$$typeof;if(f===F){n.tag=11,n=im(null,n,e,s,r);break e}else if(f===K){n.tag=14,n=sm(null,n,e,s,r);break e}}throw n=re(e)||e,Error(i(306,n,""))}}return n;case 0:return jo(e,n,n.type,n.pendingProps,r);case 1:return s=n.type,f=Hl(s,n.pendingProps),hm(e,n,s,f,r);case 3:e:{if($e(n,n.stateNode.containerInfo),e===null)throw Error(i(387));s=n.pendingProps;var h=n.memoizedState;f=h.element,Zu(e,n),wa(n,s,null,r);var b=n.memoizedState;if(s=b.cache,nl(n,lt,s),s!==h.cache&&Gu(n,[lt],r,!0),Sa(),s=b.element,h.isDehydrated)if(h={element:s,isDehydrated:!1,cache:b.cache},n.updateQueue.baseState=h,n.memoizedState=h,n.flags&256){n=mm(e,n,s,r);break e}else if(s!==f){f=en(Error(i(424)),n),pa(f),n=mm(e,n,s,r);break e}else for(e=n.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,Ie=an(e.firstChild),pt=n,Re=!0,el=null,ln=!0,r=oh(n,null,s,r),n.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(zl(),s===f){n=qn(e,n,r);break e}xt(e,n,s,r)}n=n.child}return n;case 26:return ns(e,n),e===null?(r=Ap(n.type,null,n.pendingProps,null))?n.memoizedState=r:Re||(r=n.type,e=n.pendingProps,s=bs(fe.current).createElement(r),s[mt]=n,s[At]=e,yt(s,r,e),dt(s),n.stateNode=s):n.memoizedState=Ap(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return Zt(n),e===null&&Re&&(s=n.stateNode=kp(n.type,n.pendingProps,fe.current),pt=n,ln=!0,f=Ie,pl(n.type)?(cc=f,Ie=an(s.firstChild)):Ie=f),xt(e,n,n.pendingProps.children,r),ns(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&Re&&((f=s=Ie)&&(s=Ib(s,n.type,n.pendingProps,ln),s!==null?(n.stateNode=s,pt=n,Ie=an(s.firstChild),ln=!1,f=!0):f=!1),f||tl(n)),Zt(n),f=n.type,h=n.pendingProps,b=e!==null?e.memoizedProps:null,s=h.children,ac(f,h)?s=null:b!==null&&ac(f,b)&&(n.flags|=32),n.memoizedState!==null&&(f=lo(e,n,ub,null,null,r),Qa._currentValue=f),ns(e,n),xt(e,n,s,r),n.child;case 6:return e===null&&Re&&((e=r=Ie)&&(r=Xb(r,n.pendingProps,ln),r!==null?(n.stateNode=r,pt=n,Ie=null,e=!0):e=!1),e||tl(n)),null;case 13:return pm(e,n,r);case 4:return $e(n,n.stateNode.containerInfo),s=n.pendingProps,e===null?n.child=ql(n,null,s,r):xt(e,n,s,r),n.child;case 11:return im(e,n,n.type,n.pendingProps,r);case 7:return xt(e,n,n.pendingProps,r),n.child;case 8:return xt(e,n,n.pendingProps.children,r),n.child;case 12:return xt(e,n,n.pendingProps.children,r),n.child;case 10:return s=n.pendingProps,nl(n,n.type,s.value),xt(e,n,s.children,r),n.child;case 9:return f=n.type._context,s=n.pendingProps.children,_l(n),f=gt(f),s=s(f),n.flags|=1,xt(e,n,s,r),n.child;case 14:return sm(e,n,n.type,n.pendingProps,r);case 15:return um(e,n,n.type,n.pendingProps,r);case 19:return xm(e,n,r);case 31:return gb(e,n,r);case 22:return om(e,n,r,n.pendingProps);case 24:return _l(n),s=gt(lt),e===null?(f=Iu(),f===null&&(f=Ge,h=Vu(),f.pooledCache=h,h.refCount++,h!==null&&(f.pooledCacheLanes|=r),f=h),n.memoizedState={parent:s,cache:f},$u(n),nl(n,lt,f)):((e.lanes&r)!==0&&(Zu(e,n),wa(n,null,null,r),Sa()),f=e.memoizedState,h=n.memoizedState,f.parent!==s?(f={parent:s,cache:s},n.memoizedState=f,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=f),nl(n,lt,s)):(s=h.cache,nl(n,lt,s),s!==f.cache&&Gu(n,[lt],r,!0))),xt(e,n,n.pendingProps.children,r),n.child;case 29:throw n.pendingProps}throw Error(i(156,n.tag))}function Bn(e){e.flags|=4}function zo(e,n,r,s,f){if((n=(e.mode&32)!==0)&&(n=!1),n){if(e.flags|=16777216,(f&335544128)===f)if(e.stateNode.complete)e.flags|=8192;else if(Vm())e.flags|=8192;else throw Ul=Fi,Xu}else e.flags&=-16777217}function bm(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!_p(n))if(Vm())e.flags|=8192;else throw Ul=Fi,Xu}function rs(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?Pf():536870912,e.lanes|=n,Mr|=n)}function Ta(e,n){if(!Re)switch(e.tailMode){case"hidden":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var s=null;r!==null;)r.alternate!==null&&(s=r),r=r.sibling;s===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function Xe(e){var n=e.alternate!==null&&e.alternate.child===e.child,r=0,s=0;if(n)for(var f=e.child;f!==null;)r|=f.lanes|f.childLanes,s|=f.subtreeFlags&65011712,s|=f.flags&65011712,f.return=e,f=f.sibling;else for(f=e.child;f!==null;)r|=f.lanes|f.childLanes,s|=f.subtreeFlags,s|=f.flags,f.return=e,f=f.sibling;return e.subtreeFlags|=s,e.childLanes=r,n}function yb(e,n,r){var s=n.pendingProps;switch(Bu(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xe(n),null;case 1:return Xe(n),null;case 3:return r=n.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),n.memoizedState.cache!==s&&(n.flags|=2048),Dn(lt),Be(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(yr(n)?Bn(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Fu())),Xe(n),null;case 26:var f=n.type,h=n.memoizedState;return e===null?(Bn(n),h!==null?(Xe(n),bm(n,h)):(Xe(n),zo(n,f,null,s,r))):h?h!==e.memoizedState?(Bn(n),Xe(n),bm(n,h)):(Xe(n),n.flags&=-16777217):(e=e.memoizedProps,e!==s&&Bn(n),Xe(n),zo(n,f,e,s,r)),null;case 27:if(kn(n),r=fe.current,f=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==s&&Bn(n);else{if(!s){if(n.stateNode===null)throw Error(i(166));return Xe(n),null}e=ue.current,yr(n)?Pd(n):(e=kp(f,s,r),n.stateNode=e,Bn(n))}return Xe(n),null;case 5:if(kn(n),f=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==s&&Bn(n);else{if(!s){if(n.stateNode===null)throw Error(i(166));return Xe(n),null}if(h=ue.current,yr(n))Pd(n);else{var b=bs(fe.current);switch(h){case 1:h=b.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:h=b.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":h=b.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":h=b.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":h=b.createElement("div"),h.innerHTML="<script><\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof s.is=="string"?b.createElement("select",{is:s.is}):b.createElement("select"),s.multiple?h.multiple=!0:s.size&&(h.size=s.size);break;default:h=typeof s.is=="string"?b.createElement(f,{is:s.is}):b.createElement(f)}}h[mt]=n,h[At]=s;e:for(b=n.child;b!==null;){if(b.tag===5||b.tag===6)h.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===n)break e;for(;b.sibling===null;){if(b.return===null||b.return===n)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}n.stateNode=h;e:switch(yt(h,f,s),f){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&Bn(n)}}return Xe(n),zo(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,r),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==s&&Bn(n);else{if(typeof s!="string"&&n.stateNode===null)throw Error(i(166));if(e=fe.current,yr(n)){if(e=n.stateNode,r=n.memoizedProps,s=null,f=pt,f!==null)switch(f.tag){case 27:case 5:s=f.memoizedProps}e[mt]=n,e=!!(e.nodeValue===r||s!==null&&s.suppressHydrationWarning===!0||pp(e.nodeValue,r)),e||tl(n,!0)}else e=bs(e).createTextNode(s),e[mt]=n,n.stateNode=e}return Xe(n),null;case 31:if(r=n.memoizedState,e===null||e.memoizedState!==null){if(s=yr(n),r!==null){if(e===null){if(!s)throw Error(i(318));if(e=n.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(557));e[mt]=n}else zl(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Xe(n),e=!1}else r=Fu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),e=!0;if(!e)return n.flags&256?(Qt(n),n):(Qt(n),null);if((n.flags&128)!==0)throw Error(i(558))}return Xe(n),null;case 13:if(s=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(f=yr(n),s!==null&&s.dehydrated!==null){if(e===null){if(!f)throw Error(i(318));if(f=n.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(i(317));f[mt]=n}else zl(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Xe(n),f=!1}else f=Fu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=f),f=!0;if(!f)return n.flags&256?(Qt(n),n):(Qt(n),null)}return Qt(n),(n.flags&128)!==0?(n.lanes=r,n):(r=s!==null,e=e!==null&&e.memoizedState!==null,r&&(s=n.child,f=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(f=s.alternate.memoizedState.cachePool.pool),h=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(h=s.memoizedState.cachePool.pool),h!==f&&(s.flags|=2048)),r!==e&&r&&(n.child.flags|=8192),rs(n,n.updateQueue),Xe(n),null);case 4:return Be(),e===null&&ec(n.stateNode.containerInfo),Xe(n),null;case 10:return Dn(n.type),Xe(n),null;case 19:if($(tt),s=n.memoizedState,s===null)return Xe(n),null;if(f=(n.flags&128)!==0,h=s.rendering,h===null)if(f)Ta(s,!1);else{if(et!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(h=Vi(e),h!==null){for(n.flags|=128,Ta(s,!1),e=h.updateQueue,n.updateQueue=e,rs(n,e),n.subtreeFlags=0,e=r,r=n.child;r!==null;)Id(r,e),r=r.sibling;return j(tt,tt.current&1|2),Re&&On(n,s.treeForkCount),n.child}e=e.sibling}s.tail!==null&&Nt()>os&&(n.flags|=128,f=!0,Ta(s,!1),n.lanes=4194304)}else{if(!f)if(e=Vi(h),e!==null){if(n.flags|=128,f=!0,e=e.updateQueue,n.updateQueue=e,rs(n,e),Ta(s,!0),s.tail===null&&s.tailMode==="hidden"&&!h.alternate&&!Re)return Xe(n),null}else 2*Nt()-s.renderingStartTime>os&&r!==536870912&&(n.flags|=128,f=!0,Ta(s,!1),n.lanes=4194304);s.isBackwards?(h.sibling=n.child,n.child=h):(e=s.last,e!==null?e.sibling=h:n.child=h,s.last=h)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Nt(),e.sibling=null,r=tt.current,j(tt,f?r&1|2:r&1),Re&&On(n,s.treeForkCount),e):(Xe(n),null);case 22:case 23:return Qt(n),eo(),s=n.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(n.flags|=8192):s&&(n.flags|=8192),s?(r&536870912)!==0&&(n.flags&128)===0&&(Xe(n),n.subtreeFlags&6&&(n.flags|=8192)):Xe(n),r=n.updateQueue,r!==null&&rs(n,r.retryQueue),r=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),s=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),s!==r&&(n.flags|=2048),e!==null&&$(Dl),null;case 24:return r=null,e!==null&&(r=e.memoizedState.cache),n.memoizedState.cache!==r&&(n.flags|=2048),Dn(lt),Xe(n),null;case 25:return null;case 30:return null}throw Error(i(156,n.tag))}function bb(e,n){switch(Bu(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return Dn(lt),Be(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return kn(n),null;case 31:if(n.memoizedState!==null){if(Qt(n),n.alternate===null)throw Error(i(340));zl()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(Qt(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(i(340));zl()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return $(tt),null;case 4:return Be(),null;case 10:return Dn(n.type),null;case 22:case 23:return Qt(n),eo(),e!==null&&$(Dl),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return Dn(lt),null;case 25:return null;default:return null}}function vm(e,n){switch(Bu(n),n.tag){case 3:Dn(lt),Be();break;case 26:case 27:case 5:kn(n);break;case 4:Be();break;case 31:n.memoizedState!==null&&Qt(n);break;case 13:Qt(n);break;case 19:$(tt);break;case 10:Dn(n.type);break;case 22:case 23:Qt(n),eo(),e!==null&&$(Dl);break;case 24:Dn(lt)}}function Aa(e,n){try{var r=n.updateQueue,s=r!==null?r.lastEffect:null;if(s!==null){var f=s.next;r=f;do{if((r.tag&e)===e){s=void 0;var h=r.create,b=r.inst;s=h(),b.destroy=s}r=r.next}while(r!==f)}}catch(w){qe(n,n.return,w)}}function ul(e,n,r){try{var s=n.updateQueue,f=s!==null?s.lastEffect:null;if(f!==null){var h=f.next;s=h;do{if((s.tag&e)===e){var b=s.inst,w=b.destroy;if(w!==void 0){b.destroy=void 0,f=n;var z=r,Y=w;try{Y()}catch(X){qe(f,z,X)}}}s=s.next}while(s!==h)}}catch(X){qe(n,n.return,X)}}function Sm(e){var n=e.updateQueue;if(n!==null){var r=e.stateNode;try{fh(n,r)}catch(s){qe(e,e.return,s)}}}function wm(e,n,r){r.props=Hl(e.type,e.memoizedProps),r.state=e.memoizedState;try{r.componentWillUnmount()}catch(s){qe(e,n,s)}}function Ra(e,n){try{var r=e.ref;if(r!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof r=="function"?e.refCleanup=r(s):r.current=s}}catch(f){qe(e,n,f)}}function bn(e,n){var r=e.ref,s=e.refCleanup;if(r!==null)if(typeof s=="function")try{s()}catch(f){qe(e,n,f)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof r=="function")try{r(null)}catch(f){qe(e,n,f)}else r.current=null}function Nm(e){var n=e.type,r=e.memoizedProps,s=e.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":r.autoFocus&&s.focus();break e;case"img":r.src?s.src=r.src:r.srcSet&&(s.srcset=r.srcSet)}}catch(f){qe(e,e.return,f)}}function Oo(e,n,r){try{var s=e.stateNode;Fb(s,e.type,r,n),s[At]=n}catch(f){qe(e,e.return,f)}}function jm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&pl(e.type)||e.tag===4}function _o(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||jm(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&&pl(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Do(e,n,r){var s=e.tag;if(s===5||s===6)e=e.stateNode,n?(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r).insertBefore(e,n):(n=r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,n.appendChild(e),r=r._reactRootContainer,r!=null||n.onclick!==null||(n.onclick=Rn));else if(s!==4&&(s===27&&pl(e.type)&&(r=e.stateNode,n=null),e=e.child,e!==null))for(Do(e,n,r),e=e.sibling;e!==null;)Do(e,n,r),e=e.sibling}function as(e,n,r){var s=e.tag;if(s===5||s===6)e=e.stateNode,n?r.insertBefore(e,n):r.appendChild(e);else if(s!==4&&(s===27&&pl(e.type)&&(r=e.stateNode),e=e.child,e!==null))for(as(e,n,r),e=e.sibling;e!==null;)as(e,n,r),e=e.sibling}function Cm(e){var n=e.stateNode,r=e.memoizedProps;try{for(var s=e.type,f=n.attributes;f.length;)n.removeAttributeNode(f[0]);yt(n,s,r),n[mt]=e,n[At]=r}catch(h){qe(e,e.return,h)}}var Hn=!1,it=!1,Lo=!1,km=typeof WeakSet=="function"?WeakSet:Set,ht=null;function vb(e,n){if(e=e.containerInfo,lc=ks,e=qd(e),Tu(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var s=r.getSelection&&r.getSelection();if(s&&s.rangeCount!==0){r=s.anchorNode;var f=s.anchorOffset,h=s.focusNode;s=s.focusOffset;try{r.nodeType,h.nodeType}catch{r=null;break e}var b=0,w=-1,z=-1,Y=0,X=0,W=e,G=null;t:for(;;){for(var I;W!==r||f!==0&&W.nodeType!==3||(w=b+f),W!==h||s!==0&&W.nodeType!==3||(z=b+s),W.nodeType===3&&(b+=W.nodeValue.length),(I=W.firstChild)!==null;)G=W,W=I;for(;;){if(W===e)break t;if(G===r&&++Y===f&&(w=b),G===h&&++X===s&&(z=b),(I=W.nextSibling)!==null)break;W=G,G=W.parentNode}W=I}r=w===-1||z===-1?null:{start:w,end:z}}else r=null}r=r||{start:0,end:0}}else r=null;for(rc={focusedElem:e,selectionRange:r},ks=!1,ht=n;ht!==null;)if(n=ht,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,ht=e;else for(;ht!==null;){switch(n=ht,h=n.alternate,e=n.flags,n.tag){case 0:if((e&4)!==0&&(e=n.updateQueue,e=e!==null?e.events:null,e!==null))for(r=0;r<e.length;r++)f=e[r],f.ref.impl=f.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&h!==null){e=void 0,r=n,f=h.memoizedProps,h=h.memoizedState,s=r.stateNode;try{var oe=Hl(r.type,f);e=s.getSnapshotBeforeUpdate(oe,h),s.__reactInternalSnapshotBeforeUpdate=e}catch(me){qe(r,r.return,me)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,r=e.nodeType,r===9)sc(e);else if(r===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":sc(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(i(163))}if(e=n.sibling,e!==null){e.return=n.return,ht=e;break}ht=n.return}}function Em(e,n,r){var s=r.flags;switch(r.tag){case 0:case 11:case 15:Qn(e,r),s&4&&Aa(5,r);break;case 1:if(Qn(e,r),s&4)if(e=r.stateNode,n===null)try{e.componentDidMount()}catch(b){qe(r,r.return,b)}else{var f=Hl(r.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(f,n,e.__reactInternalSnapshotBeforeUpdate)}catch(b){qe(r,r.return,b)}}s&64&&Sm(r),s&512&&Ra(r,r.return);break;case 3:if(Qn(e,r),s&64&&(e=r.updateQueue,e!==null)){if(n=null,r.child!==null)switch(r.child.tag){case 27:case 5:n=r.child.stateNode;break;case 1:n=r.child.stateNode}try{fh(e,n)}catch(b){qe(r,r.return,b)}}break;case 27:n===null&&s&4&&Cm(r);case 26:case 5:Qn(e,r),n===null&&s&4&&Nm(r),s&512&&Ra(r,r.return);break;case 12:Qn(e,r);break;case 31:Qn(e,r),s&4&&Rm(e,r);break;case 13:Qn(e,r),s&4&&Mm(e,r),s&64&&(e=r.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(r=Ab.bind(null,r),$b(e,r))));break;case 22:if(s=r.memoizedState!==null||Hn,!s){n=n!==null&&n.memoizedState!==null||it,f=Hn;var h=it;Hn=s,(it=n)&&!h?Yn(e,r,(r.subtreeFlags&8772)!==0):Qn(e,r),Hn=f,it=h}break;case 30:break;default:Qn(e,r)}}function Tm(e){var n=e.alternate;n!==null&&(e.alternate=null,Tm(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&fu(n)),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 Ze=null,Mt=!1;function Fn(e,n,r){for(r=r.child;r!==null;)Am(e,n,r),r=r.sibling}function Am(e,n,r){if(ut&&typeof ut.onCommitFiberUnmount=="function")try{ut.onCommitFiberUnmount(jt,r)}catch{}switch(r.tag){case 26:it||bn(r,n),Fn(e,n,r),r.memoizedState?r.memoizedState.count--:r.stateNode&&(r=r.stateNode,r.parentNode.removeChild(r));break;case 27:it||bn(r,n);var s=Ze,f=Mt;pl(r.type)&&(Ze=r.stateNode,Mt=!1),Fn(e,n,r),Ba(r.stateNode),Ze=s,Mt=f;break;case 5:it||bn(r,n);case 6:if(s=Ze,f=Mt,Ze=null,Fn(e,n,r),Ze=s,Mt=f,Ze!==null)if(Mt)try{(Ze.nodeType===9?Ze.body:Ze.nodeName==="HTML"?Ze.ownerDocument.body:Ze).removeChild(r.stateNode)}catch(h){qe(r,n,h)}else try{Ze.removeChild(r.stateNode)}catch(h){qe(r,n,h)}break;case 18:Ze!==null&&(Mt?(e=Ze,Sp(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,r.stateNode),Br(e)):Sp(Ze,r.stateNode));break;case 4:s=Ze,f=Mt,Ze=r.stateNode.containerInfo,Mt=!0,Fn(e,n,r),Ze=s,Mt=f;break;case 0:case 11:case 14:case 15:ul(2,r,n),it||ul(4,r,n),Fn(e,n,r);break;case 1:it||(bn(r,n),s=r.stateNode,typeof s.componentWillUnmount=="function"&&wm(r,n,s)),Fn(e,n,r);break;case 21:Fn(e,n,r);break;case 22:it=(s=it)||r.memoizedState!==null,Fn(e,n,r),it=s;break;default:Fn(e,n,r)}}function Rm(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Br(e)}catch(r){qe(n,n.return,r)}}}function Mm(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Br(e)}catch(r){qe(n,n.return,r)}}function Sb(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new km),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new km),n;default:throw Error(i(435,e.tag))}}function is(e,n){var r=Sb(e);n.forEach(function(s){if(!r.has(s)){r.add(s);var f=Rb.bind(null,e,s);s.then(f,f)}})}function zt(e,n){var r=n.deletions;if(r!==null)for(var s=0;s<r.length;s++){var f=r[s],h=e,b=n,w=b;e:for(;w!==null;){switch(w.tag){case 27:if(pl(w.type)){Ze=w.stateNode,Mt=!1;break e}break;case 5:Ze=w.stateNode,Mt=!1;break e;case 3:case 4:Ze=w.stateNode.containerInfo,Mt=!0;break e}w=w.return}if(Ze===null)throw Error(i(160));Am(h,b,f),Ze=null,Mt=!1,h=f.alternate,h!==null&&(h.return=null),f.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)zm(n,e),n=n.sibling}var dn=null;function zm(e,n){var r=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:zt(n,e),Ot(e),s&4&&(ul(3,e,e.return),Aa(3,e),ul(5,e,e.return));break;case 1:zt(n,e),Ot(e),s&512&&(it||r===null||bn(r,r.return)),s&64&&Hn&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(r=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=r===null?s:r.concat(s))));break;case 26:var f=dn;if(zt(n,e),Ot(e),s&512&&(it||r===null||bn(r,r.return)),s&4){var h=r!==null?r.memoizedState:null;if(s=e.memoizedState,r===null)if(s===null)if(e.stateNode===null){e:{s=e.type,r=e.memoizedProps,f=f.ownerDocument||f;t:switch(s){case"title":h=f.getElementsByTagName("title")[0],(!h||h[la]||h[mt]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=f.createElement(s),f.head.insertBefore(h,f.querySelector("head > title"))),yt(h,s,r),h[mt]=e,dt(h),s=h;break e;case"link":var b=zp("link","href",f).get(s+(r.href||""));if(b){for(var w=0;w<b.length;w++)if(h=b[w],h.getAttribute("href")===(r.href==null||r.href===""?null:r.href)&&h.getAttribute("rel")===(r.rel==null?null:r.rel)&&h.getAttribute("title")===(r.title==null?null:r.title)&&h.getAttribute("crossorigin")===(r.crossOrigin==null?null:r.crossOrigin)){b.splice(w,1);break t}}h=f.createElement(s),yt(h,s,r),f.head.appendChild(h);break;case"meta":if(b=zp("meta","content",f).get(s+(r.content||""))){for(w=0;w<b.length;w++)if(h=b[w],h.getAttribute("content")===(r.content==null?null:""+r.content)&&h.getAttribute("name")===(r.name==null?null:r.name)&&h.getAttribute("property")===(r.property==null?null:r.property)&&h.getAttribute("http-equiv")===(r.httpEquiv==null?null:r.httpEquiv)&&h.getAttribute("charset")===(r.charSet==null?null:r.charSet)){b.splice(w,1);break t}}h=f.createElement(s),yt(h,s,r),f.head.appendChild(h);break;default:throw Error(i(468,s))}h[mt]=e,dt(h),s=h}e.stateNode=s}else Op(f,e.type,e.stateNode);else e.stateNode=Mp(f,s,e.memoizedProps);else h!==s?(h===null?r.stateNode!==null&&(r=r.stateNode,r.parentNode.removeChild(r)):h.count--,s===null?Op(f,e.type,e.stateNode):Mp(f,s,e.memoizedProps)):s===null&&e.stateNode!==null&&Oo(e,e.memoizedProps,r.memoizedProps)}break;case 27:zt(n,e),Ot(e),s&512&&(it||r===null||bn(r,r.return)),r!==null&&s&4&&Oo(e,e.memoizedProps,r.memoizedProps);break;case 5:if(zt(n,e),Ot(e),s&512&&(it||r===null||bn(r,r.return)),e.flags&32){f=e.stateNode;try{ur(f,"")}catch(oe){qe(e,e.return,oe)}}s&4&&e.stateNode!=null&&(f=e.memoizedProps,Oo(e,f,r!==null?r.memoizedProps:f)),s&1024&&(Lo=!0);break;case 6:if(zt(n,e),Ot(e),s&4){if(e.stateNode===null)throw Error(i(162));s=e.memoizedProps,r=e.stateNode;try{r.nodeValue=s}catch(oe){qe(e,e.return,oe)}}break;case 3:if(ws=null,f=dn,dn=vs(n.containerInfo),zt(n,e),dn=f,Ot(e),s&4&&r!==null&&r.memoizedState.isDehydrated)try{Br(n.containerInfo)}catch(oe){qe(e,e.return,oe)}Lo&&(Lo=!1,Om(e));break;case 4:s=dn,dn=vs(e.stateNode.containerInfo),zt(n,e),Ot(e),dn=s;break;case 12:zt(n,e),Ot(e);break;case 31:zt(n,e),Ot(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,is(e,s)));break;case 13:zt(n,e),Ot(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(us=Nt()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,is(e,s)));break;case 22:f=e.memoizedState!==null;var z=r!==null&&r.memoizedState!==null,Y=Hn,X=it;if(Hn=Y||f,it=X||z,zt(n,e),it=X,Hn=Y,Ot(e),s&8192)e:for(n=e.stateNode,n._visibility=f?n._visibility&-2:n._visibility|1,f&&(r===null||z||Hn||it||Fl(e)),r=null,n=e;;){if(n.tag===5||n.tag===26){if(r===null){z=r=n;try{if(h=z.stateNode,f)b=h.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{w=z.stateNode;var W=z.memoizedProps.style,G=W!=null&&W.hasOwnProperty("display")?W.display:null;w.style.display=G==null||typeof G=="boolean"?"":(""+G).trim()}}catch(oe){qe(z,z.return,oe)}}}else if(n.tag===6){if(r===null){z=n;try{z.stateNode.nodeValue=f?"":z.memoizedProps}catch(oe){qe(z,z.return,oe)}}}else if(n.tag===18){if(r===null){z=n;try{var I=z.stateNode;f?wp(I,!0):wp(z.stateNode,!1)}catch(oe){qe(z,z.return,oe)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===e)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;r===n&&(r=null),n=n.return}r===n&&(r=null),n.sibling.return=n.return,n=n.sibling}s&4&&(s=e.updateQueue,s!==null&&(r=s.retryQueue,r!==null&&(s.retryQueue=null,is(e,r))));break;case 19:zt(n,e),Ot(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,is(e,s)));break;case 30:break;case 21:break;default:zt(n,e),Ot(e)}}function Ot(e){var n=e.flags;if(n&2){try{for(var r,s=e.return;s!==null;){if(jm(s)){r=s;break}s=s.return}if(r==null)throw Error(i(160));switch(r.tag){case 27:var f=r.stateNode,h=_o(e);as(e,h,f);break;case 5:var b=r.stateNode;r.flags&32&&(ur(b,""),r.flags&=-33);var w=_o(e);as(e,w,b);break;case 3:case 4:var z=r.stateNode.containerInfo,Y=_o(e);Do(e,Y,z);break;default:throw Error(i(161))}}catch(X){qe(e,e.return,X)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function Om(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;Om(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function Qn(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)Em(e,n.alternate,n),n=n.sibling}function Fl(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:ul(4,n,n.return),Fl(n);break;case 1:bn(n,n.return);var r=n.stateNode;typeof r.componentWillUnmount=="function"&&wm(n,n.return,r),Fl(n);break;case 27:Ba(n.stateNode);case 26:case 5:bn(n,n.return),Fl(n);break;case 22:n.memoizedState===null&&Fl(n);break;case 30:Fl(n);break;default:Fl(n)}e=e.sibling}}function Yn(e,n,r){for(r=r&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var s=n.alternate,f=e,h=n,b=h.flags;switch(h.tag){case 0:case 11:case 15:Yn(f,h,r),Aa(4,h);break;case 1:if(Yn(f,h,r),s=h,f=s.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(Y){qe(s,s.return,Y)}if(s=h,f=s.updateQueue,f!==null){var w=s.stateNode;try{var z=f.shared.hiddenCallbacks;if(z!==null)for(f.shared.hiddenCallbacks=null,f=0;f<z.length;f++)ch(z[f],w)}catch(Y){qe(s,s.return,Y)}}r&&b&64&&Sm(h),Ra(h,h.return);break;case 27:Cm(h);case 26:case 5:Yn(f,h,r),r&&s===null&&b&4&&Nm(h),Ra(h,h.return);break;case 12:Yn(f,h,r);break;case 31:Yn(f,h,r),r&&b&4&&Rm(f,h);break;case 13:Yn(f,h,r),r&&b&4&&Mm(f,h);break;case 22:h.memoizedState===null&&Yn(f,h,r),Ra(h,h.return);break;case 30:break;default:Yn(f,h,r)}n=n.sibling}}function Uo(e,n){var r=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),e=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(e=n.memoizedState.cachePool.pool),e!==r&&(e!=null&&e.refCount++,r!=null&&ga(r))}function qo(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&ga(e))}function hn(e,n,r,s){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)_m(e,n,r,s),n=n.sibling}function _m(e,n,r,s){var f=n.flags;switch(n.tag){case 0:case 11:case 15:hn(e,n,r,s),f&2048&&Aa(9,n);break;case 1:hn(e,n,r,s);break;case 3:hn(e,n,r,s),f&2048&&(e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&ga(e)));break;case 12:if(f&2048){hn(e,n,r,s),e=n.stateNode;try{var h=n.memoizedProps,b=h.id,w=h.onPostCommit;typeof w=="function"&&w(b,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(z){qe(n,n.return,z)}}else hn(e,n,r,s);break;case 31:hn(e,n,r,s);break;case 13:hn(e,n,r,s);break;case 23:break;case 22:h=n.stateNode,b=n.alternate,n.memoizedState!==null?h._visibility&2?hn(e,n,r,s):Ma(e,n):h._visibility&2?hn(e,n,r,s):(h._visibility|=2,Tr(e,n,r,s,(n.subtreeFlags&10256)!==0||!1)),f&2048&&Uo(b,n);break;case 24:hn(e,n,r,s),f&2048&&qo(n.alternate,n);break;default:hn(e,n,r,s)}}function Tr(e,n,r,s,f){for(f=f&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var h=e,b=n,w=r,z=s,Y=b.flags;switch(b.tag){case 0:case 11:case 15:Tr(h,b,w,z,f),Aa(8,b);break;case 23:break;case 22:var X=b.stateNode;b.memoizedState!==null?X._visibility&2?Tr(h,b,w,z,f):Ma(h,b):(X._visibility|=2,Tr(h,b,w,z,f)),f&&Y&2048&&Uo(b.alternate,b);break;case 24:Tr(h,b,w,z,f),f&&Y&2048&&qo(b.alternate,b);break;default:Tr(h,b,w,z,f)}n=n.sibling}}function Ma(e,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var r=e,s=n,f=s.flags;switch(s.tag){case 22:Ma(r,s),f&2048&&Uo(s.alternate,s);break;case 24:Ma(r,s),f&2048&&qo(s.alternate,s);break;default:Ma(r,s)}n=n.sibling}}var za=8192;function Ar(e,n,r){if(e.subtreeFlags&za)for(e=e.child;e!==null;)Dm(e,n,r),e=e.sibling}function Dm(e,n,r){switch(e.tag){case 26:Ar(e,n,r),e.flags&za&&e.memoizedState!==null&&sv(r,dn,e.memoizedState,e.memoizedProps);break;case 5:Ar(e,n,r);break;case 3:case 4:var s=dn;dn=vs(e.stateNode.containerInfo),Ar(e,n,r),dn=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=za,za=16777216,Ar(e,n,r),za=s):Ar(e,n,r));break;default:Ar(e,n,r)}}function Lm(e){var n=e.alternate;if(n!==null&&(e=n.child,e!==null)){n.child=null;do n=e.sibling,e.sibling=null,e=n;while(e!==null)}}function Oa(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];ht=s,qm(s,e)}Lm(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Um(e),e=e.sibling}function Um(e){switch(e.tag){case 0:case 11:case 15:Oa(e),e.flags&2048&&ul(9,e,e.return);break;case 3:Oa(e);break;case 12:Oa(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,ss(e)):Oa(e);break;default:Oa(e)}}function ss(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];ht=s,qm(s,e)}Lm(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:ul(8,n,n.return),ss(n);break;case 22:r=n.stateNode,r._visibility&2&&(r._visibility&=-3,ss(n));break;default:ss(n)}e=e.sibling}}function qm(e,n){for(;ht!==null;){var r=ht;switch(r.tag){case 0:case 11:case 15:ul(8,r,n);break;case 23:case 22:if(r.memoizedState!==null&&r.memoizedState.cachePool!==null){var s=r.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:ga(r.memoizedState.cache)}if(s=r.child,s!==null)s.return=r,ht=s;else e:for(r=e;ht!==null;){s=ht;var f=s.sibling,h=s.return;if(Tm(s),s===r){ht=null;break e}if(f!==null){f.return=h,ht=f;break e}ht=h}}}var wb={getCacheForType:function(e){var n=gt(lt),r=n.data.get(e);return r===void 0&&(r=e(),n.data.set(e,r)),r},cacheSignal:function(){return gt(lt).controller.signal}},Nb=typeof WeakMap=="function"?WeakMap:Map,_e=0,Ge=null,Ne=null,Te=0,Ue=0,Yt=null,ol=!1,Rr=!1,Bo=!1,Gn=0,et=0,cl=0,Ql=0,Ho=0,Gt=0,Mr=0,_a=null,_t=null,Fo=!1,us=0,Bm=0,os=1/0,cs=null,fl=null,ot=0,dl=null,zr=null,Vn=0,Qo=0,Yo=null,Hm=null,Da=0,Go=null;function Vt(){return(_e&2)!==0&&Te!==0?Te&-Te:U.T!==null?Zo():nd()}function Fm(){if(Gt===0)if((Te&536870912)===0||Re){var e=yi;yi<<=1,(yi&3932160)===0&&(yi=262144),Gt=e}else Gt=536870912;return e=Ft.current,e!==null&&(e.flags|=32),Gt}function Dt(e,n,r){(e===Ge&&(Ue===2||Ue===9)||e.cancelPendingCommit!==null)&&(Or(e,0),hl(e,Te,Gt,!1)),na(e,r),((_e&2)===0||e!==Ge)&&(e===Ge&&((_e&2)===0&&(Ql|=r),et===4&&hl(e,Te,Gt,!1)),vn(e))}function Qm(e,n,r){if((_e&6)!==0)throw Error(i(327));var s=!r&&(n&127)===0&&(n&e.expiredLanes)===0||ta(e,n),f=s?kb(e,n):Ko(e,n,!0),h=s;do{if(f===0){Rr&&!s&&hl(e,n,0,!1);break}else{if(r=e.current.alternate,h&&!jb(r)){f=Ko(e,n,!1),h=!1;continue}if(f===2){if(h=n,e.errorRecoveryDisabledLanes&h)var b=0;else b=e.pendingLanes&-536870913,b=b!==0?b:b&536870912?536870912:0;if(b!==0){n=b;e:{var w=e;f=_a;var z=w.current.memoizedState.isDehydrated;if(z&&(Or(w,b).flags|=256),b=Ko(w,b,!1),b!==2){if(Bo&&!z){w.errorRecoveryDisabledLanes|=h,Ql|=h,f=4;break e}h=_t,_t=f,h!==null&&(_t===null?_t=h:_t.push.apply(_t,h))}f=b}if(h=!1,f!==2)continue}}if(f===1){Or(e,0),hl(e,n,0,!0);break}e:{switch(s=e,h=f,h){case 0:case 1:throw Error(i(345));case 4:if((n&4194048)!==n)break;case 6:hl(s,n,Gt,!ol);break e;case 2:_t=null;break;case 3:case 5:break;default:throw Error(i(329))}if((n&62914560)===n&&(f=us+300-Nt(),10<f)){if(hl(s,n,Gt,!ol),vi(s,0,!0)!==0)break e;Vn=n,s.timeoutHandle=bp(Ym.bind(null,s,r,_t,cs,Fo,n,Gt,Ql,Mr,ol,h,"Throttled",-0,0),f);break e}Ym(s,r,_t,cs,Fo,n,Gt,Ql,Mr,ol,h,null,-0,0)}}break}while(!0);vn(e)}function Ym(e,n,r,s,f,h,b,w,z,Y,X,W,G,I){if(e.timeoutHandle=-1,W=n.subtreeFlags,W&8192||(W&16785408)===16785408){W={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Rn},Dm(n,h,W);var oe=(h&62914560)===h?us-Nt():(h&4194048)===h?Bm-Nt():0;if(oe=uv(W,oe),oe!==null){Vn=h,e.cancelPendingCommit=oe(Jm.bind(null,e,n,h,r,s,f,b,w,z,X,W,null,G,I)),hl(e,h,b,!Y);return}}Jm(e,n,h,r,s,f,b,w,z)}function jb(e){for(var n=e;;){var r=n.tag;if((r===0||r===11||r===15)&&n.flags&16384&&(r=n.updateQueue,r!==null&&(r=r.stores,r!==null)))for(var s=0;s<r.length;s++){var f=r[s],h=f.getSnapshot;f=f.value;try{if(!Bt(h(),f))return!1}catch{return!1}}if(r=n.child,n.subtreeFlags&16384&&r!==null)r.return=n,n=r;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function hl(e,n,r,s){n&=~Ho,n&=~Ql,e.suspendedLanes|=n,e.pingedLanes&=~n,s&&(e.warmLanes|=n),s=e.expirationTimes;for(var f=n;0<f;){var h=31-Ye(f),b=1<<h;s[h]=-1,f&=~b}r!==0&&Wf(e,r,n)}function fs(){return(_e&6)===0?(La(0),!1):!0}function Vo(){if(Ne!==null){if(Ue===0)var e=Ne.return;else e=Ne,_n=Ol=null,io(e),Nr=null,ya=0,e=Ne;for(;e!==null;)vm(e.alternate,e),e=e.return;Ne=null}}function Or(e,n){var r=e.timeoutHandle;r!==-1&&(e.timeoutHandle=-1,Gb(r)),r=e.cancelPendingCommit,r!==null&&(e.cancelPendingCommit=null,r()),Vn=0,Vo(),Ge=e,Ne=r=zn(e.current,null),Te=n,Ue=0,Yt=null,ol=!1,Rr=ta(e,n),Bo=!1,Mr=Gt=Ho=Ql=cl=et=0,_t=_a=null,Fo=!1,(n&8)!==0&&(n|=n&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=n;0<s;){var f=31-Ye(s),h=1<<f;n|=e[f],s&=~h}return Gn=n,zi(),r}function Gm(e,n){be=null,U.H=ka,n===wr||n===Hi?(n=ih(),Ue=3):n===Xu?(n=ih(),Ue=4):Ue=n===No?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Yt=n,Ne===null&&(et=1,es(e,en(n,e.current)))}function Vm(){var e=Ft.current;return e===null?!0:(Te&4194048)===Te?rn===null:(Te&62914560)===Te||(Te&536870912)!==0?e===rn:!1}function Km(){var e=U.H;return U.H=ka,e===null?ka:e}function Im(){var e=U.A;return U.A=wb,e}function ds(){et=4,ol||(Te&4194048)!==Te&&Ft.current!==null||(Rr=!0),(cl&134217727)===0&&(Ql&134217727)===0||Ge===null||hl(Ge,Te,Gt,!1)}function Ko(e,n,r){var s=_e;_e|=2;var f=Km(),h=Im();(Ge!==e||Te!==n)&&(cs=null,Or(e,n)),n=!1;var b=et;e:do try{if(Ue!==0&&Ne!==null){var w=Ne,z=Yt;switch(Ue){case 8:Vo(),b=6;break e;case 3:case 2:case 9:case 6:Ft.current===null&&(n=!0);var Y=Ue;if(Ue=0,Yt=null,_r(e,w,z,Y),r&&Rr){b=0;break e}break;default:Y=Ue,Ue=0,Yt=null,_r(e,w,z,Y)}}Cb(),b=et;break}catch(X){Gm(e,X)}while(!0);return n&&e.shellSuspendCounter++,_n=Ol=null,_e=s,U.H=f,U.A=h,Ne===null&&(Ge=null,Te=0,zi()),b}function Cb(){for(;Ne!==null;)Xm(Ne)}function kb(e,n){var r=_e;_e|=2;var s=Km(),f=Im();Ge!==e||Te!==n?(cs=null,os=Nt()+500,Or(e,n)):Rr=ta(e,n);e:do try{if(Ue!==0&&Ne!==null){n=Ne;var h=Yt;t:switch(Ue){case 1:Ue=0,Yt=null,_r(e,n,h,1);break;case 2:case 9:if(rh(h)){Ue=0,Yt=null,$m(n);break}n=function(){Ue!==2&&Ue!==9||Ge!==e||(Ue=7),vn(e)},h.then(n,n);break e;case 3:Ue=7;break e;case 4:Ue=5;break e;case 7:rh(h)?(Ue=0,Yt=null,$m(n)):(Ue=0,Yt=null,_r(e,n,h,7));break;case 5:var b=null;switch(Ne.tag){case 26:b=Ne.memoizedState;case 5:case 27:var w=Ne;if(b?_p(b):w.stateNode.complete){Ue=0,Yt=null;var z=w.sibling;if(z!==null)Ne=z;else{var Y=w.return;Y!==null?(Ne=Y,hs(Y)):Ne=null}break t}}Ue=0,Yt=null,_r(e,n,h,5);break;case 6:Ue=0,Yt=null,_r(e,n,h,6);break;case 8:Vo(),et=6;break e;default:throw Error(i(462))}}Eb();break}catch(X){Gm(e,X)}while(!0);return _n=Ol=null,U.H=s,U.A=f,_e=r,Ne!==null?0:(Ge=null,Te=0,zi(),et)}function Eb(){for(;Ne!==null&&!ru();)Xm(Ne)}function Xm(e){var n=ym(e.alternate,e,Gn);e.memoizedProps=e.pendingProps,n===null?hs(e):Ne=n}function $m(e){var n=e,r=n.alternate;switch(n.tag){case 15:case 0:n=dm(r,n,n.pendingProps,n.type,void 0,Te);break;case 11:n=dm(r,n,n.pendingProps,n.type.render,n.ref,Te);break;case 5:io(n);default:vm(r,n),n=Ne=Id(n,Gn),n=ym(r,n,Gn)}e.memoizedProps=e.pendingProps,n===null?hs(e):Ne=n}function _r(e,n,r,s){_n=Ol=null,io(n),Nr=null,ya=0;var f=n.return;try{if(pb(e,f,n,r,Te)){et=1,es(e,en(r,e.current)),Ne=null;return}}catch(h){if(f!==null)throw Ne=f,h;et=1,es(e,en(r,e.current)),Ne=null;return}n.flags&32768?(Re||s===1?e=!0:Rr||(Te&536870912)!==0?e=!1:(ol=e=!0,(s===2||s===9||s===3||s===6)&&(s=Ft.current,s!==null&&s.tag===13&&(s.flags|=16384))),Zm(n,e)):hs(n)}function hs(e){var n=e;do{if((n.flags&32768)!==0){Zm(n,ol);return}e=n.return;var r=yb(n.alternate,n,Gn);if(r!==null){Ne=r;return}if(n=n.sibling,n!==null){Ne=n;return}Ne=n=e}while(n!==null);et===0&&(et=5)}function Zm(e,n){do{var r=bb(e.alternate,e);if(r!==null){r.flags&=32767,Ne=r;return}if(r=e.return,r!==null&&(r.flags|=32768,r.subtreeFlags=0,r.deletions=null),!n&&(e=e.sibling,e!==null)){Ne=e;return}Ne=e=r}while(e!==null);et=6,Ne=null}function Jm(e,n,r,s,f,h,b,w,z){e.cancelPendingCommit=null;do ms();while(ot!==0);if((_e&6)!==0)throw Error(i(327));if(n!==null){if(n===e.current)throw Error(i(177));if(h=n.lanes|n.childLanes,h|=Ou,iy(e,r,h,b,w,z),e===Ge&&(Ne=Ge=null,Te=0),zr=n,dl=e,Vn=r,Qo=h,Yo=f,Hm=s,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Mb(xe,function(){return np(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||s){s=U.T,U.T=null,f=ee.p,ee.p=2,b=_e,_e|=4;try{vb(e,n,r)}finally{_e=b,ee.p=f,U.T=s}}ot=1,Pm(),Wm(),ep()}}function Pm(){if(ot===1){ot=0;var e=dl,n=zr,r=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||r){r=U.T,U.T=null;var s=ee.p;ee.p=2;var f=_e;_e|=4;try{zm(n,e);var h=rc,b=qd(e.containerInfo),w=h.focusedElem,z=h.selectionRange;if(b!==w&&w&&w.ownerDocument&&Ud(w.ownerDocument.documentElement,w)){if(z!==null&&Tu(w)){var Y=z.start,X=z.end;if(X===void 0&&(X=Y),"selectionStart"in w)w.selectionStart=Y,w.selectionEnd=Math.min(X,w.value.length);else{var W=w.ownerDocument||document,G=W&&W.defaultView||window;if(G.getSelection){var I=G.getSelection(),oe=w.textContent.length,me=Math.min(z.start,oe),Qe=z.end===void 0?me:Math.min(z.end,oe);!I.extend&&me>Qe&&(b=Qe,Qe=me,me=b);var B=Ld(w,me),_=Ld(w,Qe);if(B&&_&&(I.rangeCount!==1||I.anchorNode!==B.node||I.anchorOffset!==B.offset||I.focusNode!==_.node||I.focusOffset!==_.offset)){var Q=W.createRange();Q.setStart(B.node,B.offset),I.removeAllRanges(),me>Qe?(I.addRange(Q),I.extend(_.node,_.offset)):(Q.setEnd(_.node,_.offset),I.addRange(Q))}}}}for(W=[],I=w;I=I.parentNode;)I.nodeType===1&&W.push({element:I,left:I.scrollLeft,top:I.scrollTop});for(typeof w.focus=="function"&&w.focus(),w=0;w<W.length;w++){var J=W[w];J.element.scrollLeft=J.left,J.element.scrollTop=J.top}}ks=!!lc,rc=lc=null}finally{_e=f,ee.p=s,U.T=r}}e.current=n,ot=2}}function Wm(){if(ot===2){ot=0;var e=dl,n=zr,r=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||r){r=U.T,U.T=null;var s=ee.p;ee.p=2;var f=_e;_e|=4;try{Em(e,n.alternate,n)}finally{_e=f,ee.p=s,U.T=r}}ot=3}}function ep(){if(ot===4||ot===3){ot=0,au();var e=dl,n=zr,r=Vn,s=Hm;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?ot=5:(ot=0,zr=dl=null,tp(e,e.pendingLanes));var f=e.pendingLanes;if(f===0&&(fl=null),ou(r),n=n.stateNode,ut&&typeof ut.onCommitFiberRoot=="function")try{ut.onCommitFiberRoot(jt,n,void 0,(n.current.flags&128)===128)}catch{}if(s!==null){n=U.T,f=ee.p,ee.p=2,U.T=null;try{for(var h=e.onRecoverableError,b=0;b<s.length;b++){var w=s[b];h(w.value,{componentStack:w.stack})}}finally{U.T=n,ee.p=f}}(Vn&3)!==0&&ms(),vn(e),f=e.pendingLanes,(r&261930)!==0&&(f&42)!==0?e===Go?Da++:(Da=0,Go=e):Da=0,La(0)}}function tp(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,ga(n)))}function ms(){return Pm(),Wm(),ep(),np()}function np(){if(ot!==5)return!1;var e=dl,n=Qo;Qo=0;var r=ou(Vn),s=U.T,f=ee.p;try{ee.p=32>r?32:r,U.T=null,r=Yo,Yo=null;var h=dl,b=Vn;if(ot=0,zr=dl=null,Vn=0,(_e&6)!==0)throw Error(i(331));var w=_e;if(_e|=4,Um(h.current),_m(h,h.current,b,r),_e=w,La(0,!1),ut&&typeof ut.onPostCommitFiberRoot=="function")try{ut.onPostCommitFiberRoot(jt,h)}catch{}return!0}finally{ee.p=f,U.T=s,tp(e,n)}}function lp(e,n,r){n=en(r,n),n=wo(e.stateNode,n,2),e=al(e,n,2),e!==null&&(na(e,2),vn(e))}function qe(e,n,r){if(e.tag===3)lp(e,e,r);else for(;n!==null;){if(n.tag===3){lp(n,e,r);break}else if(n.tag===1){var s=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(fl===null||!fl.has(s))){e=en(r,e),r=rm(2),s=al(n,r,2),s!==null&&(am(r,s,n,e),na(s,2),vn(s));break}}n=n.return}}function Io(e,n,r){var s=e.pingCache;if(s===null){s=e.pingCache=new Nb;var f=new Set;s.set(n,f)}else f=s.get(n),f===void 0&&(f=new Set,s.set(n,f));f.has(r)||(Bo=!0,f.add(r),e=Tb.bind(null,e,n,r),n.then(e,e))}function Tb(e,n,r){var s=e.pingCache;s!==null&&s.delete(n),e.pingedLanes|=e.suspendedLanes&r,e.warmLanes&=~r,Ge===e&&(Te&r)===r&&(et===4||et===3&&(Te&62914560)===Te&&300>Nt()-us?(_e&2)===0&&Or(e,0):Ho|=r,Mr===Te&&(Mr=0)),vn(e)}function rp(e,n){n===0&&(n=Pf()),e=Rl(e,n),e!==null&&(na(e,n),vn(e))}function Ab(e){var n=e.memoizedState,r=0;n!==null&&(r=n.retryLane),rp(e,r)}function Rb(e,n){var r=0;switch(e.tag){case 31:case 13:var s=e.stateNode,f=e.memoizedState;f!==null&&(r=f.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(i(314))}s!==null&&s.delete(n),rp(e,r)}function Mb(e,n){return tr(e,n)}var ps=null,Dr=null,Xo=!1,gs=!1,$o=!1,ml=0;function vn(e){e!==Dr&&e.next===null&&(Dr===null?ps=Dr=e:Dr=Dr.next=e),gs=!0,Xo||(Xo=!0,Ob())}function La(e,n){if(!$o&&gs){$o=!0;do for(var r=!1,s=ps;s!==null;){if(e!==0){var f=s.pendingLanes;if(f===0)var h=0;else{var b=s.suspendedLanes,w=s.pingedLanes;h=(1<<31-Ye(42|e)+1)-1,h&=f&~(b&~w),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(r=!0,up(s,h))}else h=Te,h=vi(s,s===Ge?h:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(h&3)===0||ta(s,h)||(r=!0,up(s,h));s=s.next}while(r);$o=!1}}function zb(){ap()}function ap(){gs=Xo=!1;var e=0;ml!==0&&Yb()&&(e=ml);for(var n=Nt(),r=null,s=ps;s!==null;){var f=s.next,h=ip(s,n);h===0?(s.next=null,r===null?ps=f:r.next=f,f===null&&(Dr=r)):(r=s,(e!==0||(h&3)!==0)&&(gs=!0)),s=f}ot!==0&&ot!==5||La(e),ml!==0&&(ml=0)}function ip(e,n){for(var r=e.suspendedLanes,s=e.pingedLanes,f=e.expirationTimes,h=e.pendingLanes&-62914561;0<h;){var b=31-Ye(h),w=1<<b,z=f[b];z===-1?((w&r)===0||(w&s)!==0)&&(f[b]=ay(w,n)):z<=n&&(e.expiredLanes|=w),h&=~w}if(n=Ge,r=Te,r=vi(e,e===n?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,r===0||e===n&&(Ue===2||Ue===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&ea(s),e.callbackNode=null,e.callbackPriority=0;if((r&3)===0||ta(e,r)){if(n=r&-r,n===e.callbackPriority)return n;switch(s!==null&&ea(s),ou(r)){case 2:case 8:r=se;break;case 32:r=xe;break;case 268435456:r=Le;break;default:r=xe}return s=sp.bind(null,e),r=tr(r,s),e.callbackPriority=n,e.callbackNode=r,n}return s!==null&&s!==null&&ea(s),e.callbackPriority=2,e.callbackNode=null,2}function sp(e,n){if(ot!==0&&ot!==5)return e.callbackNode=null,e.callbackPriority=0,null;var r=e.callbackNode;if(ms()&&e.callbackNode!==r)return null;var s=Te;return s=vi(e,e===Ge?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(Qm(e,s,n),ip(e,Nt()),e.callbackNode!=null&&e.callbackNode===r?sp.bind(null,e):null)}function up(e,n){if(ms())return null;Qm(e,n,!0)}function Ob(){Vb(function(){(_e&6)!==0?tr(Z,zb):ap()})}function Zo(){if(ml===0){var e=vr;e===0&&(e=xi,xi<<=1,(xi&261888)===0&&(xi=256)),ml=e}return ml}function op(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:ji(""+e)}function cp(e,n){var r=n.ownerDocument.createElement("input");return r.name=n.name,r.value=n.value,e.id&&r.setAttribute("form",e.id),n.parentNode.insertBefore(r,n),e=new FormData(e),r.parentNode.removeChild(r),e}function _b(e,n,r,s,f){if(n==="submit"&&r&&r.stateNode===f){var h=op((f[At]||null).action),b=s.submitter;b&&(n=(n=b[At]||null)?op(n.formAction):b.getAttribute("formAction"),n!==null&&(h=n,b=null));var w=new Ti("action","action",null,s,f);e.push({event:w,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(ml!==0){var z=b?cp(f,b):new FormData(f);go(r,{pending:!0,data:z,method:f.method,action:h},null,z)}}else typeof h=="function"&&(w.preventDefault(),z=b?cp(f,b):new FormData(f),go(r,{pending:!0,data:z,method:f.method,action:h},h,z))},currentTarget:f}]})}}for(var Jo=0;Jo<zu.length;Jo++){var Po=zu[Jo],Db=Po.toLowerCase(),Lb=Po[0].toUpperCase()+Po.slice(1);fn(Db,"on"+Lb)}fn(Fd,"onAnimationEnd"),fn(Qd,"onAnimationIteration"),fn(Yd,"onAnimationStart"),fn("dblclick","onDoubleClick"),fn("focusin","onFocus"),fn("focusout","onBlur"),fn(Py,"onTransitionRun"),fn(Wy,"onTransitionStart"),fn(eb,"onTransitionCancel"),fn(Gd,"onTransitionEnd"),ir("onMouseEnter",["mouseout","mouseover"]),ir("onMouseLeave",["mouseout","mouseover"]),ir("onPointerEnter",["pointerout","pointerover"]),ir("onPointerLeave",["pointerout","pointerover"]),kl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),kl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),kl("onBeforeInput",["compositionend","keypress","textInput","paste"]),kl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),kl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),kl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ua="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(" "),Ub=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ua));function fp(e,n){n=(n&4)!==0;for(var r=0;r<e.length;r++){var s=e[r],f=s.event;s=s.listeners;e:{var h=void 0;if(n)for(var b=s.length-1;0<=b;b--){var w=s[b],z=w.instance,Y=w.currentTarget;if(w=w.listener,z!==h&&f.isPropagationStopped())break e;h=w,f.currentTarget=Y;try{h(f)}catch(X){Mi(X)}f.currentTarget=null,h=z}else for(b=0;b<s.length;b++){if(w=s[b],z=w.instance,Y=w.currentTarget,w=w.listener,z!==h&&f.isPropagationStopped())break e;h=w,f.currentTarget=Y;try{h(f)}catch(X){Mi(X)}f.currentTarget=null,h=z}}}}function je(e,n){var r=n[cu];r===void 0&&(r=n[cu]=new Set);var s=e+"__bubble";r.has(s)||(dp(n,e,2,!1),r.add(s))}function Wo(e,n,r){var s=0;n&&(s|=4),dp(r,e,s,n)}var xs="_reactListening"+Math.random().toString(36).slice(2);function ec(e){if(!e[xs]){e[xs]=!0,ad.forEach(function(r){r!=="selectionchange"&&(Ub.has(r)||Wo(r,!1,e),Wo(r,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[xs]||(n[xs]=!0,Wo("selectionchange",!1,n))}}function dp(e,n,r,s){switch(Fp(n)){case 2:var f=fv;break;case 8:f=dv;break;default:f=pc}r=f.bind(null,n,r,e),f=void 0,!bu||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(f=!0),s?f!==void 0?e.addEventListener(n,r,{capture:!0,passive:f}):e.addEventListener(n,r,!0):f!==void 0?e.addEventListener(n,r,{passive:f}):e.addEventListener(n,r,!1)}function tc(e,n,r,s,f){var h=s;if((n&1)===0&&(n&2)===0&&s!==null)e:for(;;){if(s===null)return;var b=s.tag;if(b===3||b===4){var w=s.stateNode.containerInfo;if(w===f)break;if(b===4)for(b=s.return;b!==null;){var z=b.tag;if((z===3||z===4)&&b.stateNode.containerInfo===f)return;b=b.return}for(;w!==null;){if(b=lr(w),b===null)return;if(z=b.tag,z===5||z===6||z===26||z===27){s=h=b;continue e}w=w.parentNode}}s=s.return}xd(function(){var Y=h,X=xu(r),W=[];e:{var G=Vd.get(e);if(G!==void 0){var I=Ti,oe=e;switch(e){case"keypress":if(ki(r)===0)break e;case"keydown":case"keyup":I=Ry;break;case"focusin":oe="focus",I=Nu;break;case"focusout":oe="blur",I=Nu;break;case"beforeblur":case"afterblur":I=Nu;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":I=vd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":I=yy;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":I=Oy;break;case Fd:case Qd:case Yd:I=Sy;break;case Gd:I=Dy;break;case"scroll":case"scrollend":I=gy;break;case"wheel":I=Uy;break;case"copy":case"cut":case"paste":I=Ny;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":I=wd;break;case"toggle":case"beforetoggle":I=By}var me=(n&4)!==0,Qe=!me&&(e==="scroll"||e==="scrollend"),B=me?G!==null?G+"Capture":null:G;me=[];for(var _=Y,Q;_!==null;){var J=_;if(Q=J.stateNode,J=J.tag,J!==5&&J!==26&&J!==27||Q===null||B===null||(J=aa(_,B),J!=null&&me.push(qa(_,J,Q))),Qe)break;_=_.return}0<me.length&&(G=new I(G,oe,null,r,X),W.push({event:G,listeners:me}))}}if((n&7)===0){e:{if(G=e==="mouseover"||e==="pointerover",I=e==="mouseout"||e==="pointerout",G&&r!==gu&&(oe=r.relatedTarget||r.fromElement)&&(lr(oe)||oe[nr]))break e;if((I||G)&&(G=X.window===X?X:(G=X.ownerDocument)?G.defaultView||G.parentWindow:window,I?(oe=r.relatedTarget||r.toElement,I=Y,oe=oe?lr(oe):null,oe!==null&&(Qe=o(oe),me=oe.tag,oe!==Qe||me!==5&&me!==27&&me!==6)&&(oe=null)):(I=null,oe=Y),I!==oe)){if(me=vd,J="onMouseLeave",B="onMouseEnter",_="mouse",(e==="pointerout"||e==="pointerover")&&(me=wd,J="onPointerLeave",B="onPointerEnter",_="pointer"),Qe=I==null?G:ra(I),Q=oe==null?G:ra(oe),G=new me(J,_+"leave",I,r,X),G.target=Qe,G.relatedTarget=Q,J=null,lr(X)===Y&&(me=new me(B,_+"enter",oe,r,X),me.target=Q,me.relatedTarget=Qe,J=me),Qe=J,I&&oe)t:{for(me=qb,B=I,_=oe,Q=0,J=B;J;J=me(J))Q++;J=0;for(var de=_;de;de=me(de))J++;for(;0<Q-J;)B=me(B),Q--;for(;0<J-Q;)_=me(_),J--;for(;Q--;){if(B===_||_!==null&&B===_.alternate){me=B;break t}B=me(B),_=me(_)}me=null}else me=null;I!==null&&hp(W,G,I,me,!1),oe!==null&&Qe!==null&&hp(W,Qe,oe,me,!0)}}e:{if(G=Y?ra(Y):window,I=G.nodeName&&G.nodeName.toLowerCase(),I==="select"||I==="input"&&G.type==="file")var ze=Rd;else if(Td(G))if(Md)ze=$y;else{ze=Iy;var ce=Ky}else I=G.nodeName,!I||I.toLowerCase()!=="input"||G.type!=="checkbox"&&G.type!=="radio"?Y&&pu(Y.elementType)&&(ze=Rd):ze=Xy;if(ze&&(ze=ze(e,Y))){Ad(W,ze,r,X);break e}ce&&ce(e,G,Y),e==="focusout"&&Y&&G.type==="number"&&Y.memoizedProps.value!=null&&mu(G,"number",G.value)}switch(ce=Y?ra(Y):window,e){case"focusin":(Td(ce)||ce.contentEditable==="true")&&(dr=ce,Au=Y,ha=null);break;case"focusout":ha=Au=dr=null;break;case"mousedown":Ru=!0;break;case"contextmenu":case"mouseup":case"dragend":Ru=!1,Bd(W,r,X);break;case"selectionchange":if(Jy)break;case"keydown":case"keyup":Bd(W,r,X)}var ve;if(Cu)e:{switch(e){case"compositionstart":var Ae="onCompositionStart";break e;case"compositionend":Ae="onCompositionEnd";break e;case"compositionupdate":Ae="onCompositionUpdate";break e}Ae=void 0}else fr?kd(e,r)&&(Ae="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(Ae="onCompositionStart");Ae&&(Nd&&r.locale!=="ko"&&(fr||Ae!=="onCompositionStart"?Ae==="onCompositionEnd"&&fr&&(ve=yd()):(Pn=X,vu="value"in Pn?Pn.value:Pn.textContent,fr=!0)),ce=ys(Y,Ae),0<ce.length&&(Ae=new Sd(Ae,e,null,r,X),W.push({event:Ae,listeners:ce}),ve?Ae.data=ve:(ve=Ed(r),ve!==null&&(Ae.data=ve)))),(ve=Fy?Qy(e,r):Yy(e,r))&&(Ae=ys(Y,"onBeforeInput"),0<Ae.length&&(ce=new Sd("onBeforeInput","beforeinput",null,r,X),W.push({event:ce,listeners:Ae}),ce.data=ve)),_b(W,e,Y,r,X)}fp(W,n)})}function qa(e,n,r){return{instance:e,listener:n,currentTarget:r}}function ys(e,n){for(var r=n+"Capture",s=[];e!==null;){var f=e,h=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||h===null||(f=aa(e,r),f!=null&&s.unshift(qa(e,f,h)),f=aa(e,n),f!=null&&s.push(qa(e,f,h))),e.tag===3)return s;e=e.return}return[]}function qb(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function hp(e,n,r,s,f){for(var h=n._reactName,b=[];r!==null&&r!==s;){var w=r,z=w.alternate,Y=w.stateNode;if(w=w.tag,z!==null&&z===s)break;w!==5&&w!==26&&w!==27||Y===null||(z=Y,f?(Y=aa(r,h),Y!=null&&b.unshift(qa(r,Y,z))):f||(Y=aa(r,h),Y!=null&&b.push(qa(r,Y,z)))),r=r.return}b.length!==0&&e.push({event:n,listeners:b})}var Bb=/\r\n?/g,Hb=/\u0000|\uFFFD/g;function mp(e){return(typeof e=="string"?e:""+e).replace(Bb,`
9
+ `).replace(Hb,"")}function pp(e,n){return n=mp(n),mp(e)===n}function Fe(e,n,r,s,f,h){switch(r){case"children":typeof s=="string"?n==="body"||n==="textarea"&&s===""||ur(e,s):(typeof s=="number"||typeof s=="bigint")&&n!=="body"&&ur(e,""+s);break;case"className":wi(e,"class",s);break;case"tabIndex":wi(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":wi(e,r,s);break;case"style":pd(e,s,h);break;case"data":if(n!=="object"){wi(e,"data",s);break}case"src":case"href":if(s===""&&(n!=="a"||r!=="href")){e.removeAttribute(r);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(r);break}s=ji(""+s),e.setAttribute(r,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(r,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof h=="function"&&(r==="formAction"?(n!=="input"&&Fe(e,n,"name",f.name,f,null),Fe(e,n,"formEncType",f.formEncType,f,null),Fe(e,n,"formMethod",f.formMethod,f,null),Fe(e,n,"formTarget",f.formTarget,f,null)):(Fe(e,n,"encType",f.encType,f,null),Fe(e,n,"method",f.method,f,null),Fe(e,n,"target",f.target,f,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(r);break}s=ji(""+s),e.setAttribute(r,s);break;case"onClick":s!=null&&(e.onclick=Rn);break;case"onScroll":s!=null&&je("scroll",e);break;case"onScrollEnd":s!=null&&je("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(i(61));if(r=s.__html,r!=null){if(f.children!=null)throw Error(i(60));e.innerHTML=r}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}r=ji(""+s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",r);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(r,""+s):e.removeAttribute(r);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":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(r,""):e.removeAttribute(r);break;case"capture":case"download":s===!0?e.setAttribute(r,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(r,s):e.removeAttribute(r);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(r,s):e.removeAttribute(r);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(r):e.setAttribute(r,s);break;case"popover":je("beforetoggle",e),je("toggle",e),Si(e,"popover",s);break;case"xlinkActuate":An(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":An(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":An(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":An(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":An(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":An(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":An(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":An(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":An(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":Si(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=="N")&&(r=my.get(r)||r,Si(e,r,s))}}function nc(e,n,r,s,f,h){switch(r){case"style":pd(e,s,h);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(i(61));if(r=s.__html,r!=null){if(f.children!=null)throw Error(i(60));e.innerHTML=r}}break;case"children":typeof s=="string"?ur(e,s):(typeof s=="number"||typeof s=="bigint")&&ur(e,""+s);break;case"onScroll":s!=null&&je("scroll",e);break;case"onScrollEnd":s!=null&&je("scrollend",e);break;case"onClick":s!=null&&(e.onclick=Rn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!id.hasOwnProperty(r))e:{if(r[0]==="o"&&r[1]==="n"&&(f=r.endsWith("Capture"),n=r.slice(2,f?r.length-7:void 0),h=e[At]||null,h=h!=null?h[r]:null,typeof h=="function"&&e.removeEventListener(n,h,f),typeof s=="function")){typeof h!="function"&&h!==null&&(r in e?e[r]=null:e.hasAttribute(r)&&e.removeAttribute(r)),e.addEventListener(n,s,f);break e}r in e?e[r]=s:s===!0?e.setAttribute(r,""):Si(e,r,s)}}}function yt(e,n,r){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":je("error",e),je("load",e);var s=!1,f=!1,h;for(h in r)if(r.hasOwnProperty(h)){var b=r[h];if(b!=null)switch(h){case"src":s=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,n));default:Fe(e,n,h,b,r,null)}}f&&Fe(e,n,"srcSet",r.srcSet,r,null),s&&Fe(e,n,"src",r.src,r,null);return;case"input":je("invalid",e);var w=h=b=f=null,z=null,Y=null;for(s in r)if(r.hasOwnProperty(s)){var X=r[s];if(X!=null)switch(s){case"name":f=X;break;case"type":b=X;break;case"checked":z=X;break;case"defaultChecked":Y=X;break;case"value":h=X;break;case"defaultValue":w=X;break;case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(i(137,n));break;default:Fe(e,n,s,X,r,null)}}fd(e,h,w,z,Y,b,f,!1);return;case"select":je("invalid",e),s=b=h=null;for(f in r)if(r.hasOwnProperty(f)&&(w=r[f],w!=null))switch(f){case"value":h=w;break;case"defaultValue":b=w;break;case"multiple":s=w;default:Fe(e,n,f,w,r,null)}n=h,r=b,e.multiple=!!s,n!=null?sr(e,!!s,n,!1):r!=null&&sr(e,!!s,r,!0);return;case"textarea":je("invalid",e),h=f=s=null;for(b in r)if(r.hasOwnProperty(b)&&(w=r[b],w!=null))switch(b){case"value":s=w;break;case"defaultValue":f=w;break;case"children":h=w;break;case"dangerouslySetInnerHTML":if(w!=null)throw Error(i(91));break;default:Fe(e,n,b,w,r,null)}hd(e,s,f,h);return;case"option":for(z in r)r.hasOwnProperty(z)&&(s=r[z],s!=null)&&(z==="selected"?e.selected=s&&typeof s!="function"&&typeof s!="symbol":Fe(e,n,z,s,r,null));return;case"dialog":je("beforetoggle",e),je("toggle",e),je("cancel",e),je("close",e);break;case"iframe":case"object":je("load",e);break;case"video":case"audio":for(s=0;s<Ua.length;s++)je(Ua[s],e);break;case"image":je("error",e),je("load",e);break;case"details":je("toggle",e);break;case"embed":case"source":case"link":je("error",e),je("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(Y in r)if(r.hasOwnProperty(Y)&&(s=r[Y],s!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,n));default:Fe(e,n,Y,s,r,null)}return;default:if(pu(n)){for(X in r)r.hasOwnProperty(X)&&(s=r[X],s!==void 0&&nc(e,n,X,s,r,void 0));return}}for(w in r)r.hasOwnProperty(w)&&(s=r[w],s!=null&&Fe(e,n,w,s,r,null))}function Fb(e,n,r,s){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,h=null,b=null,w=null,z=null,Y=null,X=null;for(I in r){var W=r[I];if(r.hasOwnProperty(I)&&W!=null)switch(I){case"checked":break;case"value":break;case"defaultValue":z=W;default:s.hasOwnProperty(I)||Fe(e,n,I,null,s,W)}}for(var G in s){var I=s[G];if(W=r[G],s.hasOwnProperty(G)&&(I!=null||W!=null))switch(G){case"type":h=I;break;case"name":f=I;break;case"checked":Y=I;break;case"defaultChecked":X=I;break;case"value":b=I;break;case"defaultValue":w=I;break;case"children":case"dangerouslySetInnerHTML":if(I!=null)throw Error(i(137,n));break;default:I!==W&&Fe(e,n,G,I,s,W)}}hu(e,b,w,z,Y,X,h,f);return;case"select":I=b=w=G=null;for(h in r)if(z=r[h],r.hasOwnProperty(h)&&z!=null)switch(h){case"value":break;case"multiple":I=z;default:s.hasOwnProperty(h)||Fe(e,n,h,null,s,z)}for(f in s)if(h=s[f],z=r[f],s.hasOwnProperty(f)&&(h!=null||z!=null))switch(f){case"value":G=h;break;case"defaultValue":w=h;break;case"multiple":b=h;default:h!==z&&Fe(e,n,f,h,s,z)}n=w,r=b,s=I,G!=null?sr(e,!!r,G,!1):!!s!=!!r&&(n!=null?sr(e,!!r,n,!0):sr(e,!!r,r?[]:"",!1));return;case"textarea":I=G=null;for(w in r)if(f=r[w],r.hasOwnProperty(w)&&f!=null&&!s.hasOwnProperty(w))switch(w){case"value":break;case"children":break;default:Fe(e,n,w,null,s,f)}for(b in s)if(f=s[b],h=r[b],s.hasOwnProperty(b)&&(f!=null||h!=null))switch(b){case"value":G=f;break;case"defaultValue":I=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(i(91));break;default:f!==h&&Fe(e,n,b,f,s,h)}dd(e,G,I);return;case"option":for(var oe in r)G=r[oe],r.hasOwnProperty(oe)&&G!=null&&!s.hasOwnProperty(oe)&&(oe==="selected"?e.selected=!1:Fe(e,n,oe,null,s,G));for(z in s)G=s[z],I=r[z],s.hasOwnProperty(z)&&G!==I&&(G!=null||I!=null)&&(z==="selected"?e.selected=G&&typeof G!="function"&&typeof G!="symbol":Fe(e,n,z,G,s,I));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 me in r)G=r[me],r.hasOwnProperty(me)&&G!=null&&!s.hasOwnProperty(me)&&Fe(e,n,me,null,s,G);for(Y in s)if(G=s[Y],I=r[Y],s.hasOwnProperty(Y)&&G!==I&&(G!=null||I!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(i(137,n));break;default:Fe(e,n,Y,G,s,I)}return;default:if(pu(n)){for(var Qe in r)G=r[Qe],r.hasOwnProperty(Qe)&&G!==void 0&&!s.hasOwnProperty(Qe)&&nc(e,n,Qe,void 0,s,G);for(X in s)G=s[X],I=r[X],!s.hasOwnProperty(X)||G===I||G===void 0&&I===void 0||nc(e,n,X,G,s,I);return}}for(var B in r)G=r[B],r.hasOwnProperty(B)&&G!=null&&!s.hasOwnProperty(B)&&Fe(e,n,B,null,s,G);for(W in s)G=s[W],I=r[W],!s.hasOwnProperty(W)||G===I||G==null&&I==null||Fe(e,n,W,G,s,I)}function gp(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Qb(){if(typeof performance.getEntriesByType=="function"){for(var e=0,n=0,r=performance.getEntriesByType("resource"),s=0;s<r.length;s++){var f=r[s],h=f.transferSize,b=f.initiatorType,w=f.duration;if(h&&w&&gp(b)){for(b=0,w=f.responseEnd,s+=1;s<r.length;s++){var z=r[s],Y=z.startTime;if(Y>w)break;var X=z.transferSize,W=z.initiatorType;X&&gp(W)&&(z=z.responseEnd,b+=X*(z<w?1:(w-Y)/(z-Y)))}if(--s,n+=8*(h+b)/(f.duration/1e3),e++,10<e)break}}if(0<e)return n/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var lc=null,rc=null;function bs(e){return e.nodeType===9?e:e.ownerDocument}function xp(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 yp(e,n){if(e===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&n==="foreignObject"?0:e}function ac(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var ic=null;function Yb(){var e=window.event;return e&&e.type==="popstate"?e===ic?!1:(ic=e,!0):(ic=null,!1)}var bp=typeof setTimeout=="function"?setTimeout:void 0,Gb=typeof clearTimeout=="function"?clearTimeout:void 0,vp=typeof Promise=="function"?Promise:void 0,Vb=typeof queueMicrotask=="function"?queueMicrotask:typeof vp<"u"?function(e){return vp.resolve(null).then(e).catch(Kb)}:bp;function Kb(e){setTimeout(function(){throw e})}function pl(e){return e==="head"}function Sp(e,n){var r=n,s=0;do{var f=r.nextSibling;if(e.removeChild(r),f&&f.nodeType===8)if(r=f.data,r==="/$"||r==="/&"){if(s===0){e.removeChild(f),Br(n);return}s--}else if(r==="$"||r==="$?"||r==="$~"||r==="$!"||r==="&")s++;else if(r==="html")Ba(e.ownerDocument.documentElement);else if(r==="head"){r=e.ownerDocument.head,Ba(r);for(var h=r.firstChild;h;){var b=h.nextSibling,w=h.nodeName;h[la]||w==="SCRIPT"||w==="STYLE"||w==="LINK"&&h.rel.toLowerCase()==="stylesheet"||r.removeChild(h),h=b}}else r==="body"&&Ba(e.ownerDocument.body);r=f}while(r);Br(n)}function wp(e,n){var r=e;e=0;do{var s=r.nextSibling;if(r.nodeType===1?n?(r._stashedDisplay=r.style.display,r.style.display="none"):(r.style.display=r._stashedDisplay||"",r.getAttribute("style")===""&&r.removeAttribute("style")):r.nodeType===3&&(n?(r._stashedText=r.nodeValue,r.nodeValue=""):r.nodeValue=r._stashedText||""),s&&s.nodeType===8)if(r=s.data,r==="/$"){if(e===0)break;e--}else r!=="$"&&r!=="$?"&&r!=="$~"&&r!=="$!"||e++;r=s}while(r)}function sc(e){var n=e.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var r=n;switch(n=n.nextSibling,r.nodeName){case"HTML":case"HEAD":case"BODY":sc(r),fu(r);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(r.rel.toLowerCase()==="stylesheet")continue}e.removeChild(r)}}function Ib(e,n,r,s){for(;e.nodeType===1;){var f=r;if(e.nodeName.toLowerCase()!==n.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[la])switch(n){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(h=e.getAttribute("rel"),h==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(h!==f.rel||e.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||e.getAttribute("title")!==(f.title==null?null:f.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(h=e.getAttribute("src"),(h!==(f.src==null?null:f.src)||e.getAttribute("type")!==(f.type==null?null:f.type)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&h&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(n==="input"&&e.type==="hidden"){var h=f.name==null?null:""+f.name;if(f.type==="hidden"&&e.getAttribute("name")===h)return e}else return e;if(e=an(e.nextSibling),e===null)break}return null}function Xb(e,n,r){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!r||(e=an(e.nextSibling),e===null))return null;return e}function Np(e,n){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=an(e.nextSibling),e===null))return null;return e}function uc(e){return e.data==="$?"||e.data==="$~"}function oc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function $b(e,n){var r=e.ownerDocument;if(e.data==="$~")e._reactRetry=n;else if(e.data!=="$?"||r.readyState!=="loading")n();else{var s=function(){n(),r.removeEventListener("DOMContentLoaded",s)};r.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function an(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return e}var cc=null;function jp(e){e=e.nextSibling;for(var n=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"||r==="/&"){if(n===0)return an(e.nextSibling);n--}else r!=="$"&&r!=="$!"&&r!=="$?"&&r!=="$~"&&r!=="&"||n++}e=e.nextSibling}return null}function Cp(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"){if(n===0)return e;n--}else r!=="/$"&&r!=="/&"||n++}e=e.previousSibling}return null}function kp(e,n,r){switch(n=bs(r),e){case"html":if(e=n.documentElement,!e)throw Error(i(452));return e;case"head":if(e=n.head,!e)throw Error(i(453));return e;case"body":if(e=n.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function Ba(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);fu(e)}var sn=new Map,Ep=new Set;function vs(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Kn=ee.d;ee.d={f:Zb,r:Jb,D:Pb,C:Wb,L:ev,m:tv,X:lv,S:nv,M:rv};function Zb(){var e=Kn.f(),n=fs();return e||n}function Jb(e){var n=rr(e);n!==null&&n.tag===5&&n.type==="form"?Gh(n):Kn.r(e)}var Lr=typeof document>"u"?null:document;function Tp(e,n,r){var s=Lr;if(s&&typeof n=="string"&&n){var f=Pt(n);f='link[rel="'+e+'"][href="'+f+'"]',typeof r=="string"&&(f+='[crossorigin="'+r+'"]'),Ep.has(f)||(Ep.add(f),e={rel:e,crossOrigin:r,href:n},s.querySelector(f)===null&&(n=s.createElement("link"),yt(n,"link",e),dt(n),s.head.appendChild(n)))}}function Pb(e){Kn.D(e),Tp("dns-prefetch",e,null)}function Wb(e,n){Kn.C(e,n),Tp("preconnect",e,n)}function ev(e,n,r){Kn.L(e,n,r);var s=Lr;if(s&&e&&n){var f='link[rel="preload"][as="'+Pt(n)+'"]';n==="image"&&r&&r.imageSrcSet?(f+='[imagesrcset="'+Pt(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(f+='[imagesizes="'+Pt(r.imageSizes)+'"]')):f+='[href="'+Pt(e)+'"]';var h=f;switch(n){case"style":h=Ur(e);break;case"script":h=qr(e)}sn.has(h)||(e=x({rel:"preload",href:n==="image"&&r&&r.imageSrcSet?void 0:e,as:n},r),sn.set(h,e),s.querySelector(f)!==null||n==="style"&&s.querySelector(Ha(h))||n==="script"&&s.querySelector(Fa(h))||(n=s.createElement("link"),yt(n,"link",e),dt(n),s.head.appendChild(n)))}}function tv(e,n){Kn.m(e,n);var r=Lr;if(r&&e){var s=n&&typeof n.as=="string"?n.as:"script",f='link[rel="modulepreload"][as="'+Pt(s)+'"][href="'+Pt(e)+'"]',h=f;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=qr(e)}if(!sn.has(h)&&(e=x({rel:"modulepreload",href:e},n),sn.set(h,e),r.querySelector(f)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(Fa(h)))return}s=r.createElement("link"),yt(s,"link",e),dt(s),r.head.appendChild(s)}}}function nv(e,n,r){Kn.S(e,n,r);var s=Lr;if(s&&e){var f=ar(s).hoistableStyles,h=Ur(e);n=n||"default";var b=f.get(h);if(!b){var w={loading:0,preload:null};if(b=s.querySelector(Ha(h)))w.loading=5;else{e=x({rel:"stylesheet",href:e,"data-precedence":n},r),(r=sn.get(h))&&fc(e,r);var z=b=s.createElement("link");dt(z),yt(z,"link",e),z._p=new Promise(function(Y,X){z.onload=Y,z.onerror=X}),z.addEventListener("load",function(){w.loading|=1}),z.addEventListener("error",function(){w.loading|=2}),w.loading|=4,Ss(b,n,s)}b={type:"stylesheet",instance:b,count:1,state:w},f.set(h,b)}}}function lv(e,n){Kn.X(e,n);var r=Lr;if(r&&e){var s=ar(r).hoistableScripts,f=qr(e),h=s.get(f);h||(h=r.querySelector(Fa(f)),h||(e=x({src:e,async:!0},n),(n=sn.get(f))&&dc(e,n),h=r.createElement("script"),dt(h),yt(h,"link",e),r.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},s.set(f,h))}}function rv(e,n){Kn.M(e,n);var r=Lr;if(r&&e){var s=ar(r).hoistableScripts,f=qr(e),h=s.get(f);h||(h=r.querySelector(Fa(f)),h||(e=x({src:e,async:!0,type:"module"},n),(n=sn.get(f))&&dc(e,n),h=r.createElement("script"),dt(h),yt(h,"link",e),r.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},s.set(f,h))}}function Ap(e,n,r,s){var f=(f=fe.current)?vs(f):null;if(!f)throw Error(i(446));switch(e){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(n=Ur(r.href),r=ar(f).hoistableStyles,s=r.get(n),s||(s={type:"style",instance:null,count:0,state:null},r.set(n,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(r.rel==="stylesheet"&&typeof r.href=="string"&&typeof r.precedence=="string"){e=Ur(r.href);var h=ar(f).hoistableStyles,b=h.get(e);if(b||(f=f.ownerDocument||f,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(e,b),(h=f.querySelector(Ha(e)))&&!h._p&&(b.instance=h,b.state.loading=5),sn.has(e)||(r={rel:"preload",as:"style",href:r.href,crossOrigin:r.crossOrigin,integrity:r.integrity,media:r.media,hrefLang:r.hrefLang,referrerPolicy:r.referrerPolicy},sn.set(e,r),h||av(f,e,r,b.state))),n&&s===null)throw Error(i(528,""));return b}if(n&&s!==null)throw Error(i(529,""));return null;case"script":return n=r.async,r=r.src,typeof r=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=qr(r),r=ar(f).hoistableScripts,s=r.get(n),s||(s={type:"script",instance:null,count:0,state:null},r.set(n,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Ur(e){return'href="'+Pt(e)+'"'}function Ha(e){return'link[rel="stylesheet"]['+e+"]"}function Rp(e){return x({},e,{"data-precedence":e.precedence,precedence:null})}function av(e,n,r,s){e.querySelector('link[rel="preload"][as="style"]['+n+"]")?s.loading=1:(n=e.createElement("link"),s.preload=n,n.addEventListener("load",function(){return s.loading|=1}),n.addEventListener("error",function(){return s.loading|=2}),yt(n,"link",r),dt(n),e.head.appendChild(n))}function qr(e){return'[src="'+Pt(e)+'"]'}function Fa(e){return"script[async]"+e}function Mp(e,n,r){if(n.count++,n.instance===null)switch(n.type){case"style":var s=e.querySelector('style[data-href~="'+Pt(r.href)+'"]');if(s)return n.instance=s,dt(s),s;var f=x({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),dt(s),yt(s,"style",f),Ss(s,r.precedence,e),n.instance=s;case"stylesheet":f=Ur(r.href);var h=e.querySelector(Ha(f));if(h)return n.state.loading|=4,n.instance=h,dt(h),h;s=Rp(r),(f=sn.get(f))&&fc(s,f),h=(e.ownerDocument||e).createElement("link"),dt(h);var b=h;return b._p=new Promise(function(w,z){b.onload=w,b.onerror=z}),yt(h,"link",s),n.state.loading|=4,Ss(h,r.precedence,e),n.instance=h;case"script":return h=qr(r.src),(f=e.querySelector(Fa(h)))?(n.instance=f,dt(f),f):(s=r,(f=sn.get(h))&&(s=x({},r),dc(s,f)),e=e.ownerDocument||e,f=e.createElement("script"),dt(f),yt(f,"link",s),e.head.appendChild(f),n.instance=f);case"void":return null;default:throw Error(i(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(s=n.instance,n.state.loading|=4,Ss(s,r.precedence,e));return n.instance}function Ss(e,n,r){for(var s=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=s.length?s[s.length-1]:null,h=f,b=0;b<s.length;b++){var w=s[b];if(w.dataset.precedence===n)h=w;else if(h!==f)break}h?h.parentNode.insertBefore(e,h.nextSibling):(n=r.nodeType===9?r.head:r,n.insertBefore(e,n.firstChild))}function fc(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function dc(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var ws=null;function zp(e,n,r){if(ws===null){var s=new Map,f=ws=new Map;f.set(r,s)}else f=ws,s=f.get(r),s||(s=new Map,f.set(r,s));if(s.has(e))return s;for(s.set(e,null),r=r.getElementsByTagName(e),f=0;f<r.length;f++){var h=r[f];if(!(h[la]||h[mt]||e==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var b=h.getAttribute(n)||"";b=e+b;var w=s.get(b);w?w.push(h):s.set(b,[h])}}return s}function Op(e,n,r){e=e.ownerDocument||e,e.head.insertBefore(r,n==="title"?e.querySelector("head > title"):null)}function iv(e,n,r){if(r===1||n.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;return n.rel==="stylesheet"?(e=n.disabled,typeof n.precedence=="string"&&e==null):!0;case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function _p(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function sv(e,n,r,s){if(r.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(r.state.loading&4)===0){if(r.instance===null){var f=Ur(s.href),h=n.querySelector(Ha(f));if(h){n=h._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=Ns.bind(e),n.then(e,e)),r.state.loading|=4,r.instance=h,dt(h);return}h=n.ownerDocument||n,s=Rp(s),(f=sn.get(f))&&fc(s,f),h=h.createElement("link"),dt(h);var b=h;b._p=new Promise(function(w,z){b.onload=w,b.onerror=z}),yt(h,"link",s),r.instance=h}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(r,n),(n=r.state.preload)&&(r.state.loading&3)===0&&(e.count++,r=Ns.bind(e),n.addEventListener("load",r),n.addEventListener("error",r))}}var hc=0;function uv(e,n){return e.stylesheets&&e.count===0&&Cs(e,e.stylesheets),0<e.count||0<e.imgCount?function(r){var s=setTimeout(function(){if(e.stylesheets&&Cs(e,e.stylesheets),e.unsuspend){var h=e.unsuspend;e.unsuspend=null,h()}},6e4+n);0<e.imgBytes&&hc===0&&(hc=62500*Qb());var f=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Cs(e,e.stylesheets),e.unsuspend)){var h=e.unsuspend;e.unsuspend=null,h()}},(e.imgBytes>hc?50:800)+n);return e.unsuspend=r,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(f)}}:null}function Ns(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Cs(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var js=null;function Cs(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,js=new Map,n.forEach(ov,e),js=null,Ns.call(e))}function ov(e,n){if(!(n.state.loading&4)){var r=js.get(e);if(r)var s=r.get(null);else{r=new Map,js.set(e,r);for(var f=e.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<f.length;h++){var b=f[h];(b.nodeName==="LINK"||b.getAttribute("media")!=="not all")&&(r.set(b.dataset.precedence,b),s=b)}s&&r.set(null,s)}f=n.instance,b=f.getAttribute("data-precedence"),h=r.get(b)||s,h===s&&r.set(null,f),r.set(b,f),this.count++,s=Ns.bind(this),f.addEventListener("load",s),f.addEventListener("error",s),h?h.parentNode.insertBefore(f,h.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(f,e.firstChild)),n.state.loading|=4}}var Qa={$$typeof:D,Provider:null,Consumer:null,_currentValue:L,_currentValue2:L,_threadCount:0};function cv(e,n,r,s,f,h,b,w,z){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=su(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=su(0),this.hiddenUpdates=su(null),this.identifierPrefix=s,this.onUncaughtError=f,this.onCaughtError=h,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=z,this.incompleteTransitions=new Map}function Dp(e,n,r,s,f,h,b,w,z,Y,X,W){return e=new cv(e,n,r,b,z,Y,X,W,w),n=1,h===!0&&(n|=24),h=Ht(3,null,null,n),e.current=h,h.stateNode=e,n=Vu(),n.refCount++,e.pooledCache=n,n.refCount++,h.memoizedState={element:s,isDehydrated:r,cache:n},$u(h),e}function Lp(e){return e?(e=pr,e):pr}function Up(e,n,r,s,f,h){f=Lp(f),s.context===null?s.context=f:s.pendingContext=f,s=rl(n),s.payload={element:r},h=h===void 0?null:h,h!==null&&(s.callback=h),r=al(e,s,n),r!==null&&(Dt(r,e,n),va(r,e,n))}function qp(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<n?r:n}}function mc(e,n){qp(e,n),(e=e.alternate)&&qp(e,n)}function Bp(e){if(e.tag===13||e.tag===31){var n=Rl(e,67108864);n!==null&&Dt(n,e,67108864),mc(e,67108864)}}function Hp(e){if(e.tag===13||e.tag===31){var n=Vt();n=uu(n);var r=Rl(e,n);r!==null&&Dt(r,e,n),mc(e,n)}}var ks=!0;function fv(e,n,r,s){var f=U.T;U.T=null;var h=ee.p;try{ee.p=2,pc(e,n,r,s)}finally{ee.p=h,U.T=f}}function dv(e,n,r,s){var f=U.T;U.T=null;var h=ee.p;try{ee.p=8,pc(e,n,r,s)}finally{ee.p=h,U.T=f}}function pc(e,n,r,s){if(ks){var f=gc(s);if(f===null)tc(e,n,s,Es,r),Qp(e,s);else if(mv(f,e,n,r,s))s.stopPropagation();else if(Qp(e,s),n&4&&-1<hv.indexOf(e)){for(;f!==null;){var h=rr(f);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var b=Cl(h.pendingLanes);if(b!==0){var w=h;for(w.pendingLanes|=2,w.entangledLanes|=2;b;){var z=1<<31-Ye(b);w.entanglements[1]|=z,b&=~z}vn(h),(_e&6)===0&&(os=Nt()+500,La(0))}}break;case 31:case 13:w=Rl(h,2),w!==null&&Dt(w,h,2),fs(),mc(h,2)}if(h=gc(s),h===null&&tc(e,n,s,Es,r),h===f)break;f=h}f!==null&&s.stopPropagation()}else tc(e,n,s,null,r)}}function gc(e){return e=xu(e),xc(e)}var Es=null;function xc(e){if(Es=null,e=lr(e),e!==null){var n=o(e);if(n===null)e=null;else{var r=n.tag;if(r===13){if(e=c(n),e!==null)return e;e=null}else if(r===31){if(e=m(n),e!==null)return e;e=null}else if(r===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null)}}return Es=e,null}function Fp(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(iu()){case Z:return 2;case se:return 8;case xe:case we:return 32;case Le:return 268435456;default:return 32}default:return 32}}var yc=!1,gl=null,xl=null,yl=null,Ya=new Map,Ga=new Map,bl=[],hv="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 Qp(e,n){switch(e){case"focusin":case"focusout":gl=null;break;case"dragenter":case"dragleave":xl=null;break;case"mouseover":case"mouseout":yl=null;break;case"pointerover":case"pointerout":Ya.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ga.delete(n.pointerId)}}function Va(e,n,r,s,f,h){return e===null||e.nativeEvent!==h?(e={blockedOn:n,domEventName:r,eventSystemFlags:s,nativeEvent:h,targetContainers:[f]},n!==null&&(n=rr(n),n!==null&&Bp(n)),e):(e.eventSystemFlags|=s,n=e.targetContainers,f!==null&&n.indexOf(f)===-1&&n.push(f),e)}function mv(e,n,r,s,f){switch(n){case"focusin":return gl=Va(gl,e,n,r,s,f),!0;case"dragenter":return xl=Va(xl,e,n,r,s,f),!0;case"mouseover":return yl=Va(yl,e,n,r,s,f),!0;case"pointerover":var h=f.pointerId;return Ya.set(h,Va(Ya.get(h)||null,e,n,r,s,f)),!0;case"gotpointercapture":return h=f.pointerId,Ga.set(h,Va(Ga.get(h)||null,e,n,r,s,f)),!0}return!1}function Yp(e){var n=lr(e.target);if(n!==null){var r=o(n);if(r!==null){if(n=r.tag,n===13){if(n=c(r),n!==null){e.blockedOn=n,ld(e.priority,function(){Hp(r)});return}}else if(n===31){if(n=m(r),n!==null){e.blockedOn=n,ld(e.priority,function(){Hp(r)});return}}else if(n===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ts(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var r=gc(e.nativeEvent);if(r===null){r=e.nativeEvent;var s=new r.constructor(r.type,r);gu=s,r.target.dispatchEvent(s),gu=null}else return n=rr(r),n!==null&&Bp(n),e.blockedOn=r,!1;n.shift()}return!0}function Gp(e,n,r){Ts(e)&&r.delete(n)}function pv(){yc=!1,gl!==null&&Ts(gl)&&(gl=null),xl!==null&&Ts(xl)&&(xl=null),yl!==null&&Ts(yl)&&(yl=null),Ya.forEach(Gp),Ga.forEach(Gp)}function As(e,n){e.blockedOn===n&&(e.blockedOn=null,yc||(yc=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,pv)))}var Rs=null;function Vp(e){Rs!==e&&(Rs=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Rs===e&&(Rs=null);for(var n=0;n<e.length;n+=3){var r=e[n],s=e[n+1],f=e[n+2];if(typeof s!="function"){if(xc(s||r)===null)continue;break}var h=rr(r);h!==null&&(e.splice(n,3),n-=3,go(h,{pending:!0,data:f,method:r.method,action:s},s,f))}}))}function Br(e){function n(z){return As(z,e)}gl!==null&&As(gl,e),xl!==null&&As(xl,e),yl!==null&&As(yl,e),Ya.forEach(n),Ga.forEach(n);for(var r=0;r<bl.length;r++){var s=bl[r];s.blockedOn===e&&(s.blockedOn=null)}for(;0<bl.length&&(r=bl[0],r.blockedOn===null);)Yp(r),r.blockedOn===null&&bl.shift();if(r=(e.ownerDocument||e).$$reactFormReplay,r!=null)for(s=0;s<r.length;s+=3){var f=r[s],h=r[s+1],b=f[At]||null;if(typeof h=="function")b||Vp(r);else if(b){var w=null;if(h&&h.hasAttribute("formAction")){if(f=h,b=h[At]||null)w=b.formAction;else if(xc(f)!==null)continue}else w=b.action;typeof w=="function"?r[s+1]=w:(r.splice(s,3),s-=3),Vp(r)}}}function Kp(){function e(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(b){return f=b})},focusReset:"manual",scroll:"manual"})}function n(){f!==null&&(f(),f=null),s||setTimeout(r,20)}function r(){if(!s&&!navigation.transition){var h=navigation.currentEntry;h&&h.url!=null&&navigation.navigate(h.url,{state:h.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,f=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(r,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),f!==null&&(f(),f=null)}}}function bc(e){this._internalRoot=e}Ms.prototype.render=bc.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(i(409));var r=n.current,s=Vt();Up(r,s,e,n,null,null)},Ms.prototype.unmount=bc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;Up(e.current,2,null,e,null,null),fs(),n[nr]=null}};function Ms(e){this._internalRoot=e}Ms.prototype.unstable_scheduleHydration=function(e){if(e){var n=nd();e={blockedOn:null,target:e,priority:n};for(var r=0;r<bl.length&&n!==0&&n<bl[r].priority;r++);bl.splice(r,0,e),r===0&&Yp(e)}};var Ip=l.version;if(Ip!=="19.2.4")throw Error(i(527,Ip,"19.2.4"));ee.findDOMNode=function(e){var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(i(188)):(e=Object.keys(e).join(","),Error(i(268,e)));return e=g(n),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var gv={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:U,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var zs=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zs.isDisabled&&zs.supportsFiber)try{jt=zs.inject(gv),ut=zs}catch{}}return Ia.createRoot=function(e,n){if(!u(e))throw Error(i(299));var r=!1,s="",f=em,h=tm,b=nm;return n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onUncaughtError!==void 0&&(f=n.onUncaughtError),n.onCaughtError!==void 0&&(h=n.onCaughtError),n.onRecoverableError!==void 0&&(b=n.onRecoverableError)),n=Dp(e,1,!1,null,null,r,s,null,f,h,b,Kp),e[nr]=n.current,ec(e),new bc(n)},Ia.hydrateRoot=function(e,n,r){if(!u(e))throw Error(i(299));var s=!1,f="",h=em,b=tm,w=nm,z=null;return r!=null&&(r.unstable_strictMode===!0&&(s=!0),r.identifierPrefix!==void 0&&(f=r.identifierPrefix),r.onUncaughtError!==void 0&&(h=r.onUncaughtError),r.onCaughtError!==void 0&&(b=r.onCaughtError),r.onRecoverableError!==void 0&&(w=r.onRecoverableError),r.formState!==void 0&&(z=r.formState)),n=Dp(e,1,!0,n,r??null,s,f,z,h,b,w,Kp),n.context=Lp(null),r=n.current,s=Vt(),s=uu(s),f=rl(s),f.callback=null,al(r,f,s),r=s,n.current.lanes=r,na(n,r),vn(n),e[nr]=n.current,ec(e),new Ms(n)},Ia.version="19.2.4",Ia}var lg;function kv(){if(lg)return wc.exports;lg=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(l){console.error(l)}}return t(),wc.exports=Cv(),wc.exports}var Ev=kv(),Kr=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Tv={setTimeout:(t,l)=>setTimeout(t,l),clearTimeout:t=>clearTimeout(t),setInterval:(t,l)=>setInterval(t,l),clearInterval:t=>clearInterval(t)},Av=class{#e=Tv;#t=!1;setTimeoutProvider(t){this.#e=t}setTimeout(t,l){return this.#e.setTimeout(t,l)}clearTimeout(t){this.#e.clearTimeout(t)}setInterval(t,l){return this.#e.setInterval(t,l)}clearInterval(t){this.#e.clearInterval(t)}},Vl=new Av;function Rv(t){setTimeout(t,0)}var Xl=typeof window>"u"||"Deno"in globalThis;function kt(){}function Mv(t,l){return typeof t=="function"?t(l):t}function Kc(t){return typeof t=="number"&&t>=0&&t!==1/0}function y0(t,l){return Math.max(t+(l||0)-Date.now(),0)}function wl(t,l){return typeof t=="function"?t(l):t}function un(t,l){return typeof t=="function"?t(l):t}function rg(t,l){const{type:a="all",exact:i,fetchStatus:u,predicate:o,queryKey:c,stale:m}=t;if(c){if(i){if(l.queryHash!==yf(c,l.options))return!1}else if(!li(l.queryKey,c))return!1}if(a!=="all"){const p=l.isActive();if(a==="active"&&!p||a==="inactive"&&p)return!1}return!(typeof m=="boolean"&&l.isStale()!==m||u&&u!==l.state.fetchStatus||o&&!o(l))}function ag(t,l){const{exact:a,status:i,predicate:u,mutationKey:o}=t;if(o){if(!l.options.mutationKey)return!1;if(a){if($l(l.options.mutationKey)!==$l(o))return!1}else if(!li(l.options.mutationKey,o))return!1}return!(i&&l.state.status!==i||u&&!u(l))}function yf(t,l){return(l?.queryKeyHashFn||$l)(t)}function $l(t){return JSON.stringify(t,(l,a)=>Ic(a)?Object.keys(a).sort().reduce((i,u)=>(i[u]=a[u],i),{}):a)}function li(t,l){return t===l?!0:typeof t!=typeof l?!1:t&&l&&typeof t=="object"&&typeof l=="object"?Object.keys(l).every(a=>li(t[a],l[a])):!1}var zv=Object.prototype.hasOwnProperty;function b0(t,l,a=0){if(t===l)return t;if(a>500)return l;const i=ig(t)&&ig(l);if(!i&&!(Ic(t)&&Ic(l)))return l;const o=(i?t:Object.keys(t)).length,c=i?l:Object.keys(l),m=c.length,p=i?new Array(m):{};let g=0;for(let y=0;y<m;y++){const x=i?y:c[y],v=t[x],S=l[x];if(v===S){p[x]=v,(i?y<o:zv.call(t,x))&&g++;continue}if(v===null||S===null||typeof v!="object"||typeof S!="object"){p[x]=S;continue}const N=b0(v,S,a+1);p[x]=N,N===v&&g++}return o===m&&g===o?t:p}function Qs(t,l){if(!l||Object.keys(t).length!==Object.keys(l).length)return!1;for(const a in t)if(t[a]!==l[a])return!1;return!0}function ig(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Ic(t){if(!sg(t))return!1;const l=t.constructor;if(l===void 0)return!0;const a=l.prototype;return!(!sg(a)||!a.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function sg(t){return Object.prototype.toString.call(t)==="[object Object]"}function Ov(t){return new Promise(l=>{Vl.setTimeout(l,t)})}function Xc(t,l,a){return typeof a.structuralSharing=="function"?a.structuralSharing(t,l):a.structuralSharing!==!1?b0(t,l):l}function Ir(t){return t}function _v(t,l,a=0){const i=[...t,l];return a&&i.length>a?i.slice(1):i}function Dv(t,l,a=0){const i=[l,...t];return a&&i.length>a?i.slice(0,-1):i}var bf=Symbol();function v0(t,l){return!t.queryFn&&l?.initialPromise?()=>l.initialPromise:!t.queryFn||t.queryFn===bf?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function vf(t,l){return typeof t=="function"?t(...l):!!t}function Lv(t,l,a){let i=!1,u;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(u??=l(),i||(i=!0,u.aborted?a():u.addEventListener("abort",a,{once:!0})),u)}),t}var Uv=class extends Kr{#e;#t;#n;constructor(){super(),this.#n=t=>{if(!Xl&&window.addEventListener){const l=()=>t();return window.addEventListener("visibilitychange",l,!1),()=>{window.removeEventListener("visibilitychange",l)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#n=t,this.#t?.(),this.#t=t(l=>{typeof l=="boolean"?this.setFocused(l):this.onFocus()})}setFocused(t){this.#e!==t&&(this.#e=t,this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(l=>{l(t)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Sf=new Uv;function $c(){let t,l;const a=new Promise((u,o)=>{t=u,l=o});a.status="pending",a.catch(()=>{});function i(u){Object.assign(a,u),delete a.resolve,delete a.reject}return a.resolve=u=>{i({status:"fulfilled",value:u}),t(u)},a.reject=u=>{i({status:"rejected",reason:u}),l(u)},a}var qv=Rv;function Bv(){let t=[],l=0,a=m=>{m()},i=m=>{m()},u=qv;const o=m=>{l?t.push(m):u(()=>{a(m)})},c=()=>{const m=t;t=[],m.length&&u(()=>{i(()=>{m.forEach(p=>{a(p)})})})};return{batch:m=>{let p;l++;try{p=m()}finally{l--,l||c()}return p},batchCalls:m=>(...p)=>{o(()=>{m(...p)})},schedule:o,setNotifyFunction:m=>{a=m},setBatchNotifyFunction:m=>{i=m},setScheduler:m=>{u=m}}}var ct=Bv(),Hv=class extends Kr{#e=!0;#t;#n;constructor(){super(),this.#n=t=>{if(!Xl&&window.addEventListener){const l=()=>t(!0),a=()=>t(!1);return window.addEventListener("online",l,!1),window.addEventListener("offline",a,!1),()=>{window.removeEventListener("online",l),window.removeEventListener("offline",a)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#n=t,this.#t?.(),this.#t=t(this.setOnline.bind(this))}setOnline(t){this.#e!==t&&(this.#e=t,this.listeners.forEach(a=>{a(t)}))}isOnline(){return this.#e}},Ys=new Hv;function Fv(t){return Math.min(1e3*2**t,3e4)}function S0(t){return(t??"online")==="online"?Ys.isOnline():!0}var Zc=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function w0(t){let l=!1,a=0,i;const u=$c(),o=()=>u.status!=="pending",c=E=>{if(!o()){const k=new Zc(E);v(k),t.onCancel?.(k)}},m=()=>{l=!0},p=()=>{l=!1},g=()=>Sf.isFocused()&&(t.networkMode==="always"||Ys.isOnline())&&t.canRun(),y=()=>S0(t.networkMode)&&t.canRun(),x=E=>{o()||(i?.(),u.resolve(E))},v=E=>{o()||(i?.(),u.reject(E))},S=()=>new Promise(E=>{i=k=>{(o()||g())&&E(k)},t.onPause?.()}).then(()=>{i=void 0,o()||t.onContinue?.()}),N=()=>{if(o())return;let E;const k=a===0?t.initialPromise:void 0;try{E=k??t.fn()}catch(C){E=Promise.reject(C)}Promise.resolve(E).then(x).catch(C=>{if(o())return;const M=t.retry??(Xl?0:3),D=t.retryDelay??Fv,F=typeof D=="function"?D(a,C):D,V=M===!0||typeof M=="number"&&a<M||typeof M=="function"&&M(a,C);if(l||!V){v(C);return}a++,t.onFail?.(a,C),Ov(F).then(()=>g()?void 0:S()).then(()=>{l?v(C):N()})})};return{promise:u,status:()=>u.status,cancel:c,continue:()=>(i?.(),u),cancelRetry:m,continueRetry:p,canStart:y,start:()=>(y()?N():S().then(N),u)}}var N0=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Kc(this.gcTime)&&(this.#e=Vl.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Xl?1/0:300*1e3))}clearGcTimeout(){this.#e&&(Vl.clearTimeout(this.#e),this.#e=void 0)}},Qv=class extends N0{#e;#t;#n;#r;#l;#i;#s;constructor(t){super(),this.#s=!1,this.#i=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#r=t.client,this.#n=this.#r.getQueryCache(),this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#e=og(this.options),this.state=t.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#l?.promise}setOptions(t){if(this.options={...this.#i,...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const l=og(this.options);l.data!==void 0&&(this.setState(ug(l.data,l.dataUpdatedAt)),this.#e=l)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(t,l){const a=Xc(this.state.data,t,this.options);return this.#a({data:a,type:"success",dataUpdatedAt:l?.updatedAt,manual:l?.manual}),a}setState(t,l){this.#a({type:"setState",state:t,setStateOptions:l})}cancel(t){const l=this.#l?.promise;return this.#l?.cancel(t),l?l.then(kt).catch(kt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(t=>un(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===bf||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>wl(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!y0(this.state.dataUpdatedAt,t)}onFocus(){this.observers.find(l=>l.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#l?.continue()}onOnline(){this.observers.find(l=>l.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#l?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(l=>l!==t),this.observers.length||(this.#l&&(this.#s?this.#l.cancel({revert:!0}):this.#l.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#a({type:"invalidate"})}async fetch(t,l){if(this.state.fetchStatus!=="idle"&&this.#l?.status()!=="rejected"){if(this.state.data!==void 0&&l?.cancelRefetch)this.cancel({silent:!0});else if(this.#l)return this.#l.continueRetry(),this.#l.promise}if(t&&this.setOptions(t),!this.options.queryFn){const m=this.observers.find(p=>p.options.queryFn);m&&this.setOptions(m.options)}const a=new AbortController,i=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(this.#s=!0,a.signal)})},u=()=>{const m=v0(this.options,l),g=(()=>{const y={client:this.#r,queryKey:this.queryKey,meta:this.meta};return i(y),y})();return this.#s=!1,this.options.persister?this.options.persister(m,g,this):m(g)},c=(()=>{const m={fetchOptions:l,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:u};return i(m),m})();this.options.behavior?.onFetch(c,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==c.fetchOptions?.meta)&&this.#a({type:"fetch",meta:c.fetchOptions?.meta}),this.#l=w0({initialPromise:l?.initialPromise,fn:c.fetchFn,onCancel:m=>{m instanceof Zc&&m.revert&&this.setState({...this.#t,fetchStatus:"idle"}),a.abort()},onFail:(m,p)=>{this.#a({type:"failed",failureCount:m,error:p})},onPause:()=>{this.#a({type:"pause"})},onContinue:()=>{this.#a({type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0});try{const m=await this.#l.start();if(m===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(m),this.#n.config.onSuccess?.(m,this),this.#n.config.onSettled?.(m,this.state.error,this),m}catch(m){if(m instanceof Zc){if(m.silent)return this.#l.promise;if(m.revert){if(this.state.data===void 0)throw m;return this.state.data}}throw this.#a({type:"error",error:m}),this.#n.config.onError?.(m,this),this.#n.config.onSettled?.(this.state.data,m,this),m}finally{this.scheduleGc()}}#a(t){const l=a=>{switch(t.type){case"failed":return{...a,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...a,fetchStatus:"paused"};case"continue":return{...a,fetchStatus:"fetching"};case"fetch":return{...a,...j0(a.data,this.options),fetchMeta:t.meta??null};case"success":const i={...a,...ug(t.data,t.dataUpdatedAt),dataUpdateCount:a.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=t.manual?i:void 0,i;case"error":const u=t.error;return{...a,error:u,errorUpdateCount:a.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:a.fetchFailureCount+1,fetchFailureReason:u,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...a,isInvalidated:!0};case"setState":return{...a,...t.state}}};this.state=l(this.state),ct.batch(()=>{this.observers.forEach(a=>{a.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:t})})}};function j0(t,l){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:S0(l.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function ug(t,l){return{data:t,dataUpdatedAt:l??Date.now(),error:null,isInvalidated:!1,status:"success"}}function og(t){const l=typeof t.initialData=="function"?t.initialData():t.initialData,a=l!==void 0,i=a?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:l,dataUpdateCount:0,dataUpdatedAt:a?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:a?"success":"pending",fetchStatus:"idle"}}var Yv=class extends Kr{constructor(t,l){super(),this.options=l,this.#e=t,this.#a=null,this.#s=$c(),this.bindMethods(),this.setOptions(l)}#e;#t=void 0;#n=void 0;#r=void 0;#l;#i;#s;#a;#p;#d;#h;#o;#c;#u;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),cg(this.#t,this.options)?this.#f():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Jc(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Jc(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#v(),this.#S(),this.#t.removeObserver(this)}setOptions(t){const l=this.options,a=this.#t;if(this.options=this.#e.defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof un(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#w(),this.#t.setOptions(this.options),l._defaulted&&!Qs(this.options,l)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const i=this.hasListeners();i&&fg(this.#t,a,this.options,l)&&this.#f(),this.updateResult(),i&&(this.#t!==a||un(this.options.enabled,this.#t)!==un(l.enabled,this.#t)||wl(this.options.staleTime,this.#t)!==wl(l.staleTime,this.#t))&&this.#g();const u=this.#x();i&&(this.#t!==a||un(this.options.enabled,this.#t)!==un(l.enabled,this.#t)||u!==this.#u)&&this.#y(u)}getOptimisticResult(t){const l=this.#e.getQueryCache().build(this.#e,t),a=this.createResult(l,t);return Vv(this,a)&&(this.#r=a,this.#i=this.options,this.#l=this.#t.state),a}getCurrentResult(){return this.#r}trackResult(t,l){return new Proxy(t,{get:(a,i)=>(this.trackProp(i),l?.(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#s.status==="pending"&&this.#s.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(a,i))})}trackProp(t){this.#m.add(t)}getCurrentQuery(){return this.#t}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const l=this.#e.defaultQueryOptions(t),a=this.#e.getQueryCache().build(this.#e,l);return a.fetch().then(()=>this.createResult(a,l))}fetch(t){return this.#f({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#f(t){this.#w();let l=this.#t.fetch(this.options,t);return t?.throwOnError||(l=l.catch(kt)),l}#g(){this.#v();const t=wl(this.options.staleTime,this.#t);if(Xl||this.#r.isStale||!Kc(t))return;const a=y0(this.#r.dataUpdatedAt,t)+1;this.#o=Vl.setTimeout(()=>{this.#r.isStale||this.updateResult()},a)}#x(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(t){this.#S(),this.#u=t,!(Xl||un(this.options.enabled,this.#t)===!1||!Kc(this.#u)||this.#u===0)&&(this.#c=Vl.setInterval(()=>{(this.options.refetchIntervalInBackground||Sf.isFocused())&&this.#f()},this.#u))}#b(){this.#g(),this.#y(this.#x())}#v(){this.#o&&(Vl.clearTimeout(this.#o),this.#o=void 0)}#S(){this.#c&&(Vl.clearInterval(this.#c),this.#c=void 0)}createResult(t,l){const a=this.#t,i=this.options,u=this.#r,o=this.#l,c=this.#i,p=t!==a?t.state:this.#n,{state:g}=t;let y={...g},x=!1,v;if(l._optimisticResults){const ne=this.hasListeners(),le=!ne&&cg(t,l),T=ne&&fg(t,a,l,i);(le||T)&&(y={...y,...j0(g.data,t.options)}),l._optimisticResults==="isRestoring"&&(y.fetchStatus="idle")}let{error:S,errorUpdatedAt:N,status:E}=y;v=y.data;let k=!1;if(l.placeholderData!==void 0&&v===void 0&&E==="pending"){let ne;u?.isPlaceholderData&&l.placeholderData===c?.placeholderData?(ne=u.data,k=!0):ne=typeof l.placeholderData=="function"?l.placeholderData(this.#h?.state.data,this.#h):l.placeholderData,ne!==void 0&&(E="success",v=Xc(u?.data,ne,l),x=!0)}if(l.select&&v!==void 0&&!k)if(u&&v===o?.data&&l.select===this.#p)v=this.#d;else try{this.#p=l.select,v=l.select(v),v=Xc(u?.data,v,l),this.#d=v,this.#a=null}catch(ne){this.#a=ne}this.#a&&(S=this.#a,v=this.#d,N=Date.now(),E="error");const C=y.fetchStatus==="fetching",M=E==="pending",D=E==="error",F=M&&C,V=v!==void 0,K={status:E,fetchStatus:y.fetchStatus,isPending:M,isSuccess:E==="success",isError:D,isInitialLoading:F,isLoading:F,data:v,dataUpdatedAt:y.dataUpdatedAt,error:S,errorUpdatedAt:N,failureCount:y.fetchFailureCount,failureReason:y.fetchFailureReason,errorUpdateCount:y.errorUpdateCount,isFetched:y.dataUpdateCount>0||y.errorUpdateCount>0,isFetchedAfterMount:y.dataUpdateCount>p.dataUpdateCount||y.errorUpdateCount>p.errorUpdateCount,isFetching:C,isRefetching:C&&!M,isLoadingError:D&&!V,isPaused:y.fetchStatus==="paused",isPlaceholderData:x,isRefetchError:D&&V,isStale:wf(t,l),refetch:this.refetch,promise:this.#s,isEnabled:un(l.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const ne=K.data!==void 0,le=K.status==="error"&&!ne,T=ie=>{le?ie.reject(K.error):ne&&ie.resolve(K.data)},P=()=>{const ie=this.#s=K.promise=$c();T(ie)},H=this.#s;switch(H.status){case"pending":t.queryHash===a.queryHash&&T(H);break;case"fulfilled":(le||K.data!==H.value)&&P();break;case"rejected":(!le||K.error!==H.reason)&&P();break}}return K}updateResult(){const t=this.#r,l=this.createResult(this.#t,this.options);if(this.#l=this.#t.state,this.#i=this.options,this.#l.data!==void 0&&(this.#h=this.#t),Qs(l,t))return;this.#r=l;const a=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,u=typeof i=="function"?i():i;if(u==="all"||!u&&!this.#m.size)return!0;const o=new Set(u??this.#m);return this.options.throwOnError&&o.add("error"),Object.keys(this.#r).some(c=>{const m=c;return this.#r[m]!==t[m]&&o.has(m)})};this.#N({listeners:a()})}#w(){const t=this.#e.getQueryCache().build(this.#e,this.options);if(t===this.#t)return;const l=this.#t;this.#t=t,this.#n=t.state,this.hasListeners()&&(l?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#N(t){ct.batch(()=>{t.listeners&&this.listeners.forEach(l=>{l(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function Gv(t,l){return un(l.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&l.retryOnMount===!1)}function cg(t,l){return Gv(t,l)||t.state.data!==void 0&&Jc(t,l,l.refetchOnMount)}function Jc(t,l,a){if(un(l.enabled,t)!==!1&&wl(l.staleTime,t)!=="static"){const i=typeof a=="function"?a(t):a;return i==="always"||i!==!1&&wf(t,l)}return!1}function fg(t,l,a,i){return(t!==l||un(i.enabled,t)===!1)&&(!a.suspense||t.state.status!=="error")&&wf(t,a)}function wf(t,l){return un(l.enabled,t)!==!1&&t.isStaleByTime(wl(l.staleTime,t))}function Vv(t,l){return!Qs(t.getCurrentResult(),l)}function dg(t){return{onFetch:(l,a)=>{const i=l.options,u=l.fetchOptions?.meta?.fetchMore?.direction,o=l.state.data?.pages||[],c=l.state.data?.pageParams||[];let m={pages:[],pageParams:[]},p=0;const g=async()=>{let y=!1;const x=N=>{Lv(N,()=>l.signal,()=>y=!0)},v=v0(l.options,l.fetchOptions),S=async(N,E,k)=>{if(y)return Promise.reject();if(E==null&&N.pages.length)return Promise.resolve(N);const M=(()=>{const q={client:l.client,queryKey:l.queryKey,pageParam:E,direction:k?"backward":"forward",meta:l.options.meta};return x(q),q})(),D=await v(M),{maxPages:F}=l.options,V=k?Dv:_v;return{pages:V(N.pages,D,F),pageParams:V(N.pageParams,E,F)}};if(u&&o.length){const N=u==="backward",E=N?Kv:hg,k={pages:o,pageParams:c},C=E(i,k);m=await S(k,C,N)}else{const N=t??o.length;do{const E=p===0?c[0]??i.initialPageParam:hg(i,m);if(p>0&&E==null)break;m=await S(m,E),p++}while(p<N)}return m};l.options.persister?l.fetchFn=()=>l.options.persister?.(g,{client:l.client,queryKey:l.queryKey,meta:l.options.meta,signal:l.signal},a):l.fetchFn=g}}}function hg(t,{pages:l,pageParams:a}){const i=l.length-1;return l.length>0?t.getNextPageParam(l[i],l,a[i],a):void 0}function Kv(t,{pages:l,pageParams:a}){return l.length>0?t.getPreviousPageParam?.(l[0],l,a[0],a):void 0}var Iv=class extends N0{#e;#t;#n;#r;constructor(t){super(),this.#e=t.client,this.mutationId=t.mutationId,this.#n=t.mutationCache,this.#t=[],this.state=t.state||C0(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#t.includes(t)||(this.#t.push(t),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#t=this.#t.filter(l=>l!==t),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(t){const l=()=>{this.#l({type:"continue"})},a={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=w0({fn:()=>this.options.mutationFn?this.options.mutationFn(t,a):Promise.reject(new Error("No mutationFn found")),onFail:(o,c)=>{this.#l({type:"failed",failureCount:o,error:c})},onPause:()=>{this.#l({type:"pause"})},onContinue:l,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const i=this.state.status==="pending",u=!this.#r.canStart();try{if(i)l();else{this.#l({type:"pending",variables:t,isPaused:u}),this.#n.config.onMutate&&await this.#n.config.onMutate(t,this,a);const c=await this.options.onMutate?.(t,a);c!==this.state.context&&this.#l({type:"pending",context:c,variables:t,isPaused:u})}const o=await this.#r.start();return await this.#n.config.onSuccess?.(o,t,this.state.context,this,a),await this.options.onSuccess?.(o,t,this.state.context,a),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,a),await this.options.onSettled?.(o,null,t,this.state.context,a),this.#l({type:"success",data:o}),o}catch(o){try{await this.#n.config.onError?.(o,t,this.state.context,this,a)}catch(c){Promise.reject(c)}try{await this.options.onError?.(o,t,this.state.context,a)}catch(c){Promise.reject(c)}try{await this.#n.config.onSettled?.(void 0,o,this.state.variables,this.state.context,this,a)}catch(c){Promise.reject(c)}try{await this.options.onSettled?.(void 0,o,t,this.state.context,a)}catch(c){Promise.reject(c)}throw this.#l({type:"error",error:o}),o}finally{this.#n.runNext(this)}}#l(t){const l=a=>{switch(t.type){case"failed":return{...a,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...a,isPaused:!0};case"continue":return{...a,isPaused:!1};case"pending":return{...a,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...a,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...a,data:void 0,error:t.error,failureCount:a.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=l(this.state),ct.batch(()=>{this.#t.forEach(a=>{a.onMutationUpdate(t)}),this.#n.notify({mutation:this,type:"updated",action:t})})}};function C0(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Xv=class extends Kr{constructor(t={}){super(),this.config=t,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(t,l,a){const i=new Iv({client:t,mutationCache:this,mutationId:++this.#n,options:t.defaultMutationOptions(l),state:a});return this.add(i),i}add(t){this.#e.add(t);const l=Os(t);if(typeof l=="string"){const a=this.#t.get(l);a?a.push(t):this.#t.set(l,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#e.delete(t)){const l=Os(t);if(typeof l=="string"){const a=this.#t.get(l);if(a)if(a.length>1){const i=a.indexOf(t);i!==-1&&a.splice(i,1)}else a[0]===t&&this.#t.delete(l)}}this.notify({type:"removed",mutation:t})}canRun(t){const l=Os(t);if(typeof l=="string"){const i=this.#t.get(l)?.find(u=>u.state.status==="pending");return!i||i===t}else return!0}runNext(t){const l=Os(t);return typeof l=="string"?this.#t.get(l)?.find(i=>i!==t&&i.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){ct.batch(()=>{this.#e.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(t){const l={exact:!0,...t};return this.getAll().find(a=>ag(l,a))}findAll(t={}){return this.getAll().filter(l=>ag(t,l))}notify(t){ct.batch(()=>{this.listeners.forEach(l=>{l(t)})})}resumePausedMutations(){const t=this.getAll().filter(l=>l.state.isPaused);return ct.batch(()=>Promise.all(t.map(l=>l.continue().catch(kt))))}};function Os(t){return t.options.scope?.id}var $v=class extends Kr{#e;#t=void 0;#n;#r;constructor(l,a){super(),this.#e=l,this.setOptions(a),this.bindMethods(),this.#l()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(l){const a=this.options;this.options=this.#e.defaultMutationOptions(l),Qs(this.options,a)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),a?.mutationKey&&this.options.mutationKey&&$l(a.mutationKey)!==$l(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(l){this.#l(),this.#i(l)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#l(),this.#i()}mutate(l,a){return this.#r=a,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(l)}#l(){const l=this.#n?.state??C0();this.#t={...l,isPending:l.status==="pending",isSuccess:l.status==="success",isError:l.status==="error",isIdle:l.status==="idle",mutate:this.mutate,reset:this.reset}}#i(l){ct.batch(()=>{if(this.#r&&this.hasListeners()){const a=this.#t.variables,i=this.#t.context,u={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(l?.type==="success"){try{this.#r.onSuccess?.(l.data,a,i,u)}catch(o){Promise.reject(o)}try{this.#r.onSettled?.(l.data,null,a,i,u)}catch(o){Promise.reject(o)}}else if(l?.type==="error"){try{this.#r.onError?.(l.error,a,i,u)}catch(o){Promise.reject(o)}try{this.#r.onSettled?.(void 0,l.error,a,i,u)}catch(o){Promise.reject(o)}}}this.listeners.forEach(a=>{a(this.#t)})})}},Zv=class extends Kr{constructor(t={}){super(),this.config=t,this.#e=new Map}#e;build(t,l,a){const i=l.queryKey,u=l.queryHash??yf(i,l);let o=this.get(u);return o||(o=new Qv({client:t,queryKey:i,queryHash:u,options:t.defaultQueryOptions(l),state:a,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){this.#e.has(t.queryHash)||(this.#e.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const l=this.#e.get(t.queryHash);l&&(t.destroy(),l===t&&this.#e.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){ct.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#e.get(t)}getAll(){return[...this.#e.values()]}find(t){const l={exact:!0,...t};return this.getAll().find(a=>rg(l,a))}findAll(t={}){const l=this.getAll();return Object.keys(t).length>0?l.filter(a=>rg(t,a)):l}notify(t){ct.batch(()=>{this.listeners.forEach(l=>{l(t)})})}onFocus(){ct.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){ct.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Jv=class{#e;#t;#n;#r;#l;#i;#s;#a;constructor(t={}){this.#e=t.queryCache||new Zv,this.#t=t.mutationCache||new Xv,this.#n=t.defaultOptions||{},this.#r=new Map,this.#l=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#s=Sf.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#a=Ys.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#s?.(),this.#s=void 0,this.#a?.(),this.#a=void 0)}isFetching(t){return this.#e.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#t.findAll({...t,status:"pending"}).length}getQueryData(t){const l=this.defaultQueryOptions({queryKey:t});return this.#e.get(l.queryHash)?.state.data}ensureQueryData(t){const l=this.defaultQueryOptions(t),a=this.#e.build(this,l),i=a.state.data;return i===void 0?this.fetchQuery(t):(t.revalidateIfStale&&a.isStaleByTime(wl(l.staleTime,a))&&this.prefetchQuery(l),Promise.resolve(i))}getQueriesData(t){return this.#e.findAll(t).map(({queryKey:l,state:a})=>{const i=a.data;return[l,i]})}setQueryData(t,l,a){const i=this.defaultQueryOptions({queryKey:t}),o=this.#e.get(i.queryHash)?.state.data,c=Mv(l,o);if(c!==void 0)return this.#e.build(this,i).setData(c,{...a,manual:!0})}setQueriesData(t,l,a){return ct.batch(()=>this.#e.findAll(t).map(({queryKey:i})=>[i,this.setQueryData(i,l,a)]))}getQueryState(t){const l=this.defaultQueryOptions({queryKey:t});return this.#e.get(l.queryHash)?.state}removeQueries(t){const l=this.#e;ct.batch(()=>{l.findAll(t).forEach(a=>{l.remove(a)})})}resetQueries(t,l){const a=this.#e;return ct.batch(()=>(a.findAll(t).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...t},l)))}cancelQueries(t,l={}){const a={revert:!0,...l},i=ct.batch(()=>this.#e.findAll(t).map(u=>u.cancel(a)));return Promise.all(i).then(kt).catch(kt)}invalidateQueries(t,l={}){return ct.batch(()=>(this.#e.findAll(t).forEach(a=>{a.invalidate()}),t?.refetchType==="none"?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},l)))}refetchQueries(t,l={}){const a={...l,cancelRefetch:l.cancelRefetch??!0},i=ct.batch(()=>this.#e.findAll(t).filter(u=>!u.isDisabled()&&!u.isStatic()).map(u=>{let o=u.fetch(void 0,a);return a.throwOnError||(o=o.catch(kt)),u.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(i).then(kt)}fetchQuery(t){const l=this.defaultQueryOptions(t);l.retry===void 0&&(l.retry=!1);const a=this.#e.build(this,l);return a.isStaleByTime(wl(l.staleTime,a))?a.fetch(l):Promise.resolve(a.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(kt).catch(kt)}fetchInfiniteQuery(t){return t.behavior=dg(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(kt).catch(kt)}ensureInfiniteQueryData(t){return t.behavior=dg(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return Ys.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(t){this.#n=t}setQueryDefaults(t,l){this.#r.set($l(t),{queryKey:t,defaultOptions:l})}getQueryDefaults(t){const l=[...this.#r.values()],a={};return l.forEach(i=>{li(t,i.queryKey)&&Object.assign(a,i.defaultOptions)}),a}setMutationDefaults(t,l){this.#l.set($l(t),{mutationKey:t,defaultOptions:l})}getMutationDefaults(t){const l=[...this.#l.values()],a={};return l.forEach(i=>{li(t,i.mutationKey)&&Object.assign(a,i.defaultOptions)}),a}defaultQueryOptions(t){if(t._defaulted)return t;const l={...this.#n.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return l.queryHash||(l.queryHash=yf(l.queryKey,l)),l.refetchOnReconnect===void 0&&(l.refetchOnReconnect=l.networkMode!=="always"),l.throwOnError===void 0&&(l.throwOnError=!!l.suspense),!l.networkMode&&l.persister&&(l.networkMode="offlineFirst"),l.queryFn===bf&&(l.enabled=!1),l}defaultMutationOptions(t){return t?._defaulted?t:{...this.#n.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},k0=A.createContext(void 0),ft=t=>{const l=A.useContext(k0);if(!l)throw new Error("No QueryClient set, use QueryClientProvider to set one");return l},Pv=({client:t,children:l})=>(A.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),d.jsx(k0.Provider,{value:t,children:l})),E0=A.createContext(!1),Wv=()=>A.useContext(E0);E0.Provider;function e1(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var t1=A.createContext(e1()),n1=()=>A.useContext(t1),l1=(t,l,a)=>{const i=a?.state.error&&typeof t.throwOnError=="function"?vf(t.throwOnError,[a.state.error,a]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||i)&&(l.isReset()||(t.retryOnMount=!1))},r1=t=>{A.useEffect(()=>{t.clearReset()},[t])},a1=({result:t,errorResetBoundary:l,throwOnError:a,query:i,suspense:u})=>t.isError&&!l.isReset()&&!t.isFetching&&i&&(u&&t.data===void 0||vf(a,[t.error,i])),i1=t=>{if(t.suspense){const a=u=>u==="static"?u:Math.max(u??1e3,1e3),i=t.staleTime;t.staleTime=typeof i=="function"?(...u)=>a(i(...u)):a(i),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},s1=(t,l)=>t.isLoading&&t.isFetching&&!l,u1=(t,l)=>t?.suspense&&l.isPending,mg=(t,l,a)=>l.fetchOptimistic(t).catch(()=>{a.clearReset()});function o1(t,l,a){const i=Wv(),u=n1(),o=ft(),c=o.defaultQueryOptions(t);o.getDefaultOptions().queries?._experimental_beforeQuery?.(c);const m=o.getQueryCache().get(c.queryHash);c._optimisticResults=i?"isRestoring":"optimistic",i1(c),l1(c,u,m),r1(u);const p=!o.getQueryCache().get(c.queryHash),[g]=A.useState(()=>new l(o,c)),y=g.getOptimisticResult(c),x=!i&&t.subscribed!==!1;if(A.useSyncExternalStore(A.useCallback(v=>{const S=x?g.subscribe(ct.batchCalls(v)):kt;return g.updateResult(),S},[g,x]),()=>g.getCurrentResult(),()=>g.getCurrentResult()),A.useEffect(()=>{g.setOptions(c)},[c,g]),u1(c,y))throw mg(c,g,u);if(a1({result:y,errorResetBoundary:u,throwOnError:c.throwOnError,query:m,suspense:c.suspense}))throw y.error;return o.getDefaultOptions().queries?._experimental_afterQuery?.(c,y),c.experimental_prefetchInRender&&!Xl&&s1(y,i)&&(p?mg(c,g,u):m?.promise)?.catch(kt).finally(()=>{g.updateResult()}),c.notifyOnChangeProps?y:g.trackResult(y)}function Xt(t,l){return o1(t,Yv)}function St(t,l){const a=ft(),[i]=A.useState(()=>new $v(a,t));A.useEffect(()=>{i.setOptions(t)},[i,t]);const u=A.useSyncExternalStore(A.useCallback(c=>i.subscribe(ct.batchCalls(c)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),o=A.useCallback((c,m)=>{i.mutate(c,m).catch(kt)},[i]);if(u.error&&vf(i.options.throwOnError,[u.error]))throw u.error;return{...u,mutate:o,mutateAsync:u.mutate}}var pg="popstate";function c1(t={}){function l(i,u){let{pathname:o,search:c,hash:m}=i.location;return Pc("",{pathname:o,search:c,hash:m},u.state&&u.state.usr||null,u.state&&u.state.key||"default")}function a(i,u){return typeof u=="string"?u:ri(u)}return d1(l,a,null,t)}function Je(t,l){if(t===!1||t===null||typeof t>"u")throw new Error(l)}function pn(t,l){if(!t){typeof console<"u"&&console.warn(l);try{throw new Error(l)}catch{}}}function f1(){return Math.random().toString(36).substring(2,10)}function gg(t,l){return{usr:t.state,key:t.key,idx:l}}function Pc(t,l,a=null,i){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof l=="string"?Xr(l):l,state:a,key:l&&l.key||i||f1()}}function ri({pathname:t="/",search:l="",hash:a=""}){return l&&l!=="?"&&(t+=l.charAt(0)==="?"?l:"?"+l),a&&a!=="#"&&(t+=a.charAt(0)==="#"?a:"#"+a),t}function Xr(t){let l={};if(t){let a=t.indexOf("#");a>=0&&(l.hash=t.substring(a),t=t.substring(0,a));let i=t.indexOf("?");i>=0&&(l.search=t.substring(i),t=t.substring(0,i)),t&&(l.pathname=t)}return l}function d1(t,l,a,i={}){let{window:u=document.defaultView,v5Compat:o=!1}=i,c=u.history,m="POP",p=null,g=y();g==null&&(g=0,c.replaceState({...c.state,idx:g},""));function y(){return(c.state||{idx:null}).idx}function x(){m="POP";let k=y(),C=k==null?null:k-g;g=k,p&&p({action:m,location:E.location,delta:C})}function v(k,C){m="PUSH";let M=Pc(E.location,k,C);g=y()+1;let D=gg(M,g),F=E.createHref(M);try{c.pushState(D,"",F)}catch(V){if(V instanceof DOMException&&V.name==="DataCloneError")throw V;u.location.assign(F)}o&&p&&p({action:m,location:E.location,delta:1})}function S(k,C){m="REPLACE";let M=Pc(E.location,k,C);g=y();let D=gg(M,g),F=E.createHref(M);c.replaceState(D,"",F),o&&p&&p({action:m,location:E.location,delta:0})}function N(k){return h1(k)}let E={get action(){return m},get location(){return t(u,c)},listen(k){if(p)throw new Error("A history only accepts one active listener");return u.addEventListener(pg,x),p=k,()=>{u.removeEventListener(pg,x),p=null}},createHref(k){return l(u,k)},createURL:N,encodeLocation(k){let C=N(k);return{pathname:C.pathname,search:C.search,hash:C.hash}},push:v,replace:S,go(k){return c.go(k)}};return E}function h1(t,l=!1){let a="http://localhost";typeof window<"u"&&(a=window.location.origin!=="null"?window.location.origin:window.location.href),Je(a,"No window.location.(origin|href) available to create URL");let i=typeof t=="string"?t:ri(t);return i=i.replace(/ $/,"%20"),!l&&i.startsWith("//")&&(i=a+i),new URL(i,a)}function T0(t,l,a="/"){return m1(t,l,a,!1)}function m1(t,l,a,i){let u=typeof l=="string"?Xr(l):l,o=Xn(u.pathname||"/",a);if(o==null)return null;let c=A0(t);p1(c);let m=null;for(let p=0;m==null&&p<c.length;++p){let g=k1(o);m=j1(c[p],g,i)}return m}function A0(t,l=[],a=[],i="",u=!1){let o=(c,m,p=u,g)=>{let y={relativePath:g===void 0?c.path||"":g,caseSensitive:c.caseSensitive===!0,childrenIndex:m,route:c};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(i)&&p)return;Je(y.relativePath.startsWith(i),`Absolute route path "${y.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(i.length)}let x=In([i,y.relativePath]),v=a.concat(y);c.children&&c.children.length>0&&(Je(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${x}".`),A0(c.children,l,v,x,p)),!(c.path==null&&!c.index)&&l.push({path:x,score:w1(x,c.index),routesMeta:v})};return t.forEach((c,m)=>{if(c.path===""||!c.path?.includes("?"))o(c,m);else for(let p of R0(c.path))o(c,m,!0,p)}),l}function R0(t){let l=t.split("/");if(l.length===0)return[];let[a,...i]=l,u=a.endsWith("?"),o=a.replace(/\?$/,"");if(i.length===0)return u?[o,""]:[o];let c=R0(i.join("/")),m=[];return m.push(...c.map(p=>p===""?o:[o,p].join("/"))),u&&m.push(...c),m.map(p=>t.startsWith("/")&&p===""?"/":p)}function p1(t){t.sort((l,a)=>l.score!==a.score?a.score-l.score:N1(l.routesMeta.map(i=>i.childrenIndex),a.routesMeta.map(i=>i.childrenIndex)))}var g1=/^:[\w-]+$/,x1=3,y1=2,b1=1,v1=10,S1=-2,xg=t=>t==="*";function w1(t,l){let a=t.split("/"),i=a.length;return a.some(xg)&&(i+=S1),l&&(i+=y1),a.filter(u=>!xg(u)).reduce((u,o)=>u+(g1.test(o)?x1:o===""?b1:v1),i)}function N1(t,l){return t.length===l.length&&t.slice(0,-1).every((i,u)=>i===l[u])?t[t.length-1]-l[l.length-1]:0}function j1(t,l,a=!1){let{routesMeta:i}=t,u={},o="/",c=[];for(let m=0;m<i.length;++m){let p=i[m],g=m===i.length-1,y=o==="/"?l:l.slice(o.length)||"/",x=Gs({path:p.relativePath,caseSensitive:p.caseSensitive,end:g},y),v=p.route;if(!x&&g&&a&&!i[i.length-1].route.index&&(x=Gs({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},y)),!x)return null;Object.assign(u,x.params),c.push({params:u,pathname:In([o,x.pathname]),pathnameBase:R1(In([o,x.pathnameBase])),route:v}),x.pathnameBase!=="/"&&(o=In([o,x.pathnameBase]))}return c}function Gs(t,l){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[a,i]=C1(t.path,t.caseSensitive,t.end),u=l.match(a);if(!u)return null;let o=u[0],c=o.replace(/(.)\/+$/,"$1"),m=u.slice(1);return{params:i.reduce((g,{paramName:y,isOptional:x},v)=>{if(y==="*"){let N=m[v]||"";c=o.slice(0,o.length-N.length).replace(/(.)\/+$/,"$1")}const S=m[v];return x&&!S?g[y]=void 0:g[y]=(S||"").replace(/%2F/g,"/"),g},{}),pathname:o,pathnameBase:c,pattern:t}}function C1(t,l=!1,a=!0){pn(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let i=[],u="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,m,p)=>(i.push({paramName:m,isOptional:p!=null}),p?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(i.push({paramName:"*"}),u+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?u+="\\/*$":t!==""&&t!=="/"&&(u+="(?:(?=\\/|$))"),[new RegExp(u,l?void 0:"i"),i]}function k1(t){try{return t.split("/").map(l=>decodeURIComponent(l).replace(/\//g,"%2F")).join("/")}catch(l){return pn(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${l}).`),t}}function Xn(t,l){if(l==="/")return t;if(!t.toLowerCase().startsWith(l.toLowerCase()))return null;let a=l.endsWith("/")?l.length-1:l.length,i=t.charAt(a);return i&&i!=="/"?null:t.slice(a)||"/"}var E1=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function T1(t,l="/"){let{pathname:a,search:i="",hash:u=""}=typeof t=="string"?Xr(t):t,o;return a?(a=a.replace(/\/\/+/g,"/"),a.startsWith("/")?o=yg(a.substring(1),"/"):o=yg(a,l)):o=l,{pathname:o,search:M1(i),hash:z1(u)}}function yg(t,l){let a=l.replace(/\/+$/,"").split("/");return t.split("/").forEach(u=>{u===".."?a.length>1&&a.pop():u!=="."&&a.push(u)}),a.length>1?a.join("/"):"/"}function kc(t,l,a,i){return`Cannot include a '${t}' character in a manually specified \`to.${l}\` field [${JSON.stringify(i)}]. Please separate it out to the \`to.${a}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function A1(t){return t.filter((l,a)=>a===0||l.route.path&&l.route.path.length>0)}function Nf(t){let l=A1(t);return l.map((a,i)=>i===l.length-1?a.pathname:a.pathnameBase)}function jf(t,l,a,i=!1){let u;typeof t=="string"?u=Xr(t):(u={...t},Je(!u.pathname||!u.pathname.includes("?"),kc("?","pathname","search",u)),Je(!u.pathname||!u.pathname.includes("#"),kc("#","pathname","hash",u)),Je(!u.search||!u.search.includes("#"),kc("#","search","hash",u)));let o=t===""||u.pathname==="",c=o?"/":u.pathname,m;if(c==null)m=a;else{let x=l.length-1;if(!i&&c.startsWith("..")){let v=c.split("/");for(;v[0]==="..";)v.shift(),x-=1;u.pathname=v.join("/")}m=x>=0?l[x]:"/"}let p=T1(u,m),g=c&&c!=="/"&&c.endsWith("/"),y=(o||c===".")&&a.endsWith("/");return!p.pathname.endsWith("/")&&(g||y)&&(p.pathname+="/"),p}var In=t=>t.join("/").replace(/\/\/+/g,"/"),R1=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),M1=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,z1=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,O1=class{constructor(t,l,a,i=!1){this.status=t,this.statusText=l||"",this.internal=i,a instanceof Error?(this.data=a.toString(),this.error=a):this.data=a}};function _1(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function D1(t){return t.map(l=>l.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var M0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function z0(t,l){let a=t;if(typeof a!="string"||!E1.test(a))return{absoluteURL:void 0,isExternal:!1,to:a};let i=a,u=!1;if(M0)try{let o=new URL(window.location.href),c=a.startsWith("//")?new URL(o.protocol+a):new URL(a),m=Xn(c.pathname,l);c.origin===o.origin&&m!=null?a=m+c.search+c.hash:u=!0}catch{pn(!1,`<Link to="${a}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:i,isExternal:u,to:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var O0=["POST","PUT","PATCH","DELETE"];new Set(O0);var L1=["GET",...O0];new Set(L1);var $r=A.createContext(null);$r.displayName="DataRouter";var Js=A.createContext(null);Js.displayName="DataRouterState";var U1=A.createContext(!1),_0=A.createContext({isTransitioning:!1});_0.displayName="ViewTransition";var q1=A.createContext(new Map);q1.displayName="Fetchers";var B1=A.createContext(null);B1.displayName="Await";var $t=A.createContext(null);$t.displayName="Navigation";var ui=A.createContext(null);ui.displayName="Location";var gn=A.createContext({outlet:null,matches:[],isDataRoute:!1});gn.displayName="Route";var Cf=A.createContext(null);Cf.displayName="RouteError";var D0="REACT_ROUTER_ERROR",H1="REDIRECT",F1="ROUTE_ERROR_RESPONSE";function Q1(t){if(t.startsWith(`${D0}:${H1}:{`))try{let l=JSON.parse(t.slice(28));if(typeof l=="object"&&l&&typeof l.status=="number"&&typeof l.statusText=="string"&&typeof l.location=="string"&&typeof l.reloadDocument=="boolean"&&typeof l.replace=="boolean")return l}catch{}}function Y1(t){if(t.startsWith(`${D0}:${F1}:{`))try{let l=JSON.parse(t.slice(40));if(typeof l=="object"&&l&&typeof l.status=="number"&&typeof l.statusText=="string")return new O1(l.status,l.statusText,l.data)}catch{}}function G1(t,{relative:l}={}){Je(Zr(),"useHref() may be used only in the context of a <Router> component.");let{basename:a,navigator:i}=A.useContext($t),{hash:u,pathname:o,search:c}=oi(t,{relative:l}),m=o;return a!=="/"&&(m=o==="/"?a:In([a,o])),i.createHref({pathname:m,search:c,hash:u})}function Zr(){return A.useContext(ui)!=null}function jn(){return Je(Zr(),"useLocation() may be used only in the context of a <Router> component."),A.useContext(ui).location}var L0="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function U0(t){A.useContext($t).static||A.useLayoutEffect(t)}function Nl(){let{isDataRoute:t}=A.useContext(gn);return t?lS():V1()}function V1(){Je(Zr(),"useNavigate() may be used only in the context of a <Router> component.");let t=A.useContext($r),{basename:l,navigator:a}=A.useContext($t),{matches:i}=A.useContext(gn),{pathname:u}=jn(),o=JSON.stringify(Nf(i)),c=A.useRef(!1);return U0(()=>{c.current=!0}),A.useCallback((p,g={})=>{if(pn(c.current,L0),!c.current)return;if(typeof p=="number"){a.go(p);return}let y=jf(p,JSON.parse(o),u,g.relative==="path");t==null&&l!=="/"&&(y.pathname=y.pathname==="/"?l:In([l,y.pathname])),(g.replace?a.replace:a.push)(y,g.state,g)},[l,a,o,u,t])}A.createContext(null);function q0(){let{matches:t}=A.useContext(gn),l=t[t.length-1];return l?l.params:{}}function oi(t,{relative:l}={}){let{matches:a}=A.useContext(gn),{pathname:i}=jn(),u=JSON.stringify(Nf(a));return A.useMemo(()=>jf(t,JSON.parse(u),i,l==="path"),[t,u,i,l])}function K1(t,l){return B0(t,l)}function B0(t,l,a,i,u){Je(Zr(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=A.useContext($t),{matches:c}=A.useContext(gn),m=c[c.length-1],p=m?m.params:{},g=m?m.pathname:"/",y=m?m.pathnameBase:"/",x=m&&m.route;{let M=x&&x.path||"";F0(g,!x||M.endsWith("*")||M.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${g}" (under <Route path="${M}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
10
+
11
+ Please change the parent <Route path="${M}"> to <Route path="${M==="/"?"*":`${M}/*`}">.`)}let v=jn(),S;if(l){let M=typeof l=="string"?Xr(l):l;Je(y==="/"||M.pathname?.startsWith(y),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${y}" but pathname "${M.pathname}" was given in the \`location\` prop.`),S=M}else S=v;let N=S.pathname||"/",E=N;if(y!=="/"){let M=y.replace(/^\//,"").split("/");E="/"+N.replace(/^\//,"").split("/").slice(M.length).join("/")}let k=T0(t,{pathname:E});pn(x||k!=null,`No routes matched location "${S.pathname}${S.search}${S.hash}" `),pn(k==null||k[k.length-1].route.element!==void 0||k[k.length-1].route.Component!==void 0||k[k.length-1].route.lazy!==void 0,`Matched leaf route at location "${S.pathname}${S.search}${S.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let C=J1(k&&k.map(M=>Object.assign({},M,{params:Object.assign({},p,M.params),pathname:In([y,o.encodeLocation?o.encodeLocation(M.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:M.pathname]),pathnameBase:M.pathnameBase==="/"?y:In([y,o.encodeLocation?o.encodeLocation(M.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:M.pathnameBase])})),c,a,i,u);return l&&C?A.createElement(ui.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...S},navigationType:"POP"}},C):C}function I1(){let t=nS(),l=_1(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),a=t instanceof Error?t.stack:null,i="rgba(200,200,200, 0.5)",u={padding:"0.5rem",backgroundColor:i},o={padding:"2px 4px",backgroundColor:i},c=null;return console.error("Error handled by React Router default ErrorBoundary:",t),c=A.createElement(A.Fragment,null,A.createElement("p",null,"💿 Hey developer 👋"),A.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",A.createElement("code",{style:o},"ErrorBoundary")," or"," ",A.createElement("code",{style:o},"errorElement")," prop on your route.")),A.createElement(A.Fragment,null,A.createElement("h2",null,"Unexpected Application Error!"),A.createElement("h3",{style:{fontStyle:"italic"}},l),a?A.createElement("pre",{style:u},a):null,c)}var X1=A.createElement(I1,null),H0=class extends A.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,l){return l.location!==t.location||l.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:l.error,location:l.location,revalidation:t.revalidation||l.revalidation}}componentDidCatch(t,l){this.props.onError?this.props.onError(t,l):console.error("React Router caught the following error during render",t)}render(){let t=this.state.error;if(this.context&&typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){const a=Y1(t.digest);a&&(t=a)}let l=t!==void 0?A.createElement(gn.Provider,{value:this.props.routeContext},A.createElement(Cf.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?A.createElement($1,{error:t},l):l}};H0.contextType=U1;var Ec=new WeakMap;function $1({children:t,error:l}){let{basename:a}=A.useContext($t);if(typeof l=="object"&&l&&"digest"in l&&typeof l.digest=="string"){let i=Q1(l.digest);if(i){let u=Ec.get(l);if(u)throw u;let o=z0(i.location,a);if(M0&&!Ec.get(l))if(o.isExternal||i.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const c=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:i.replace}));throw Ec.set(l,c),c}return A.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return t}function Z1({routeContext:t,match:l,children:a}){let i=A.useContext($r);return i&&i.static&&i.staticContext&&(l.route.errorElement||l.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=l.route.id),A.createElement(gn.Provider,{value:t},a)}function J1(t,l=[],a=null,i=null,u=null){if(t==null){if(!a)return null;if(a.errors)t=a.matches;else if(l.length===0&&!a.initialized&&a.matches.length>0)t=a.matches;else return null}let o=t,c=a?.errors;if(c!=null){let y=o.findIndex(x=>x.route.id&&c?.[x.route.id]!==void 0);Je(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(c).join(",")}`),o=o.slice(0,Math.min(o.length,y+1))}let m=!1,p=-1;if(a)for(let y=0;y<o.length;y++){let x=o[y];if((x.route.HydrateFallback||x.route.hydrateFallbackElement)&&(p=y),x.route.id){let{loaderData:v,errors:S}=a,N=x.route.loader&&!v.hasOwnProperty(x.route.id)&&(!S||S[x.route.id]===void 0);if(x.route.lazy||N){m=!0,p>=0?o=o.slice(0,p+1):o=[o[0]];break}}}let g=a&&i?(y,x)=>{i(y,{location:a.location,params:a.matches?.[0]?.params??{},unstable_pattern:D1(a.matches),errorInfo:x})}:void 0;return o.reduceRight((y,x,v)=>{let S,N=!1,E=null,k=null;a&&(S=c&&x.route.id?c[x.route.id]:void 0,E=x.route.errorElement||X1,m&&(p<0&&v===0?(F0("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),N=!0,k=null):p===v&&(N=!0,k=x.route.hydrateFallbackElement||null)));let C=l.concat(o.slice(0,v+1)),M=()=>{let D;return S?D=E:N?D=k:x.route.Component?D=A.createElement(x.route.Component,null):x.route.element?D=x.route.element:D=y,A.createElement(Z1,{match:x,routeContext:{outlet:y,matches:C,isDataRoute:a!=null},children:D})};return a&&(x.route.ErrorBoundary||x.route.errorElement||v===0)?A.createElement(H0,{location:a.location,revalidation:a.revalidation,component:E,error:S,children:M(),routeContext:{outlet:null,matches:C,isDataRoute:!0},onError:g}):M()},null)}function kf(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function P1(t){let l=A.useContext($r);return Je(l,kf(t)),l}function W1(t){let l=A.useContext(Js);return Je(l,kf(t)),l}function eS(t){let l=A.useContext(gn);return Je(l,kf(t)),l}function Ef(t){let l=eS(t),a=l.matches[l.matches.length-1];return Je(a.route.id,`${t} can only be used on routes that contain a unique "id"`),a.route.id}function tS(){return Ef("useRouteId")}function nS(){let t=A.useContext(Cf),l=W1("useRouteError"),a=Ef("useRouteError");return t!==void 0?t:l.errors?.[a]}function lS(){let{router:t}=P1("useNavigate"),l=Ef("useNavigate"),a=A.useRef(!1);return U0(()=>{a.current=!0}),A.useCallback(async(u,o={})=>{pn(a.current,L0),a.current&&(typeof u=="number"?await t.navigate(u):await t.navigate(u,{fromRouteId:l,...o}))},[t,l])}var bg={};function F0(t,l,a){!l&&!bg[t]&&(bg[t]=!0,pn(!1,a))}A.memo(rS);function rS({routes:t,future:l,state:a,onError:i}){return B0(t,void 0,a,i,l)}function aS({to:t,replace:l,state:a,relative:i}){Je(Zr(),"<Navigate> may be used only in the context of a <Router> component.");let{static:u}=A.useContext($t);pn(!u,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:o}=A.useContext(gn),{pathname:c}=jn(),m=Nl(),p=jf(t,Nf(o),c,i==="path"),g=JSON.stringify(p);return A.useEffect(()=>{m(JSON.parse(g),{replace:l,state:a,relative:i})},[m,g,i,l,a]),null}function Sn(t){Je(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function iS({basename:t="/",children:l=null,location:a,navigationType:i="POP",navigator:u,static:o=!1,unstable_useTransitions:c}){Je(!Zr(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let m=t.replace(/^\/*/,"/"),p=A.useMemo(()=>({basename:m,navigator:u,static:o,unstable_useTransitions:c,future:{}}),[m,u,o,c]);typeof a=="string"&&(a=Xr(a));let{pathname:g="/",search:y="",hash:x="",state:v=null,key:S="default"}=a,N=A.useMemo(()=>{let E=Xn(g,m);return E==null?null:{location:{pathname:E,search:y,hash:x,state:v,key:S},navigationType:i}},[m,g,y,x,v,S,i]);return pn(N!=null,`<Router basename="${m}"> is not able to match the URL "${g}${y}${x}" because it does not start with the basename, so the <Router> won't render anything.`),N==null?null:A.createElement($t.Provider,{value:p},A.createElement(ui.Provider,{children:l,value:N}))}function sS({children:t,location:l}){return K1(Wc(t),l)}function Wc(t,l=[]){let a=[];return A.Children.forEach(t,(i,u)=>{if(!A.isValidElement(i))return;let o=[...l,u];if(i.type===A.Fragment){a.push.apply(a,Wc(i.props.children,o));return}Je(i.type===Sn,`[${typeof i.type=="string"?i.type:i.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Je(!i.props.index||!i.props.children,"An index route cannot have child routes.");let c={id:i.props.id||o.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,middleware:i.props.middleware,loader:i.props.loader,action:i.props.action,hydrateFallbackElement:i.props.hydrateFallbackElement,HydrateFallback:i.props.HydrateFallback,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.hasErrorBoundary===!0||i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(c.children=Wc(i.props.children,o)),a.push(c)}),a}var Bs="get",Hs="application/x-www-form-urlencoded";function Ps(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function uS(t){return Ps(t)&&t.tagName.toLowerCase()==="button"}function oS(t){return Ps(t)&&t.tagName.toLowerCase()==="form"}function cS(t){return Ps(t)&&t.tagName.toLowerCase()==="input"}function fS(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function dS(t,l){return t.button===0&&(!l||l==="_self")&&!fS(t)}var _s=null;function hS(){if(_s===null)try{new FormData(document.createElement("form"),0),_s=!1}catch{_s=!0}return _s}var mS=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Tc(t){return t!=null&&!mS.has(t)?(pn(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Hs}"`),null):t}function pS(t,l){let a,i,u,o,c;if(oS(t)){let m=t.getAttribute("action");i=m?Xn(m,l):null,a=t.getAttribute("method")||Bs,u=Tc(t.getAttribute("enctype"))||Hs,o=new FormData(t)}else if(uS(t)||cS(t)&&(t.type==="submit"||t.type==="image")){let m=t.form;if(m==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let p=t.getAttribute("formaction")||m.getAttribute("action");if(i=p?Xn(p,l):null,a=t.getAttribute("formmethod")||m.getAttribute("method")||Bs,u=Tc(t.getAttribute("formenctype"))||Tc(m.getAttribute("enctype"))||Hs,o=new FormData(m,t),!hS()){let{name:g,type:y,value:x}=t;if(y==="image"){let v=g?`${g}.`:"";o.append(`${v}x`,"0"),o.append(`${v}y`,"0")}else g&&o.append(g,x)}}else{if(Ps(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');a=Bs,i=null,u=Hs,c=t}return o&&u==="text/plain"&&(c=o,o=void 0),{action:i,method:a.toLowerCase(),encType:u,formData:o,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Tf(t,l){if(t===!1||t===null||typeof t>"u")throw new Error(l)}function gS(t,l,a,i){let u=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return a?u.pathname.endsWith("/")?u.pathname=`${u.pathname}_.${i}`:u.pathname=`${u.pathname}.${i}`:u.pathname==="/"?u.pathname=`_root.${i}`:l&&Xn(u.pathname,l)==="/"?u.pathname=`${l.replace(/\/$/,"")}/_root.${i}`:u.pathname=`${u.pathname.replace(/\/$/,"")}.${i}`,u}async function xS(t,l){if(t.id in l)return l[t.id];try{let a=await import(t.module);return l[t.id]=a,a}catch(a){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(a),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function yS(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function bS(t,l,a){let i=await Promise.all(t.map(async u=>{let o=l.routes[u.route.id];if(o){let c=await xS(o,a);return c.links?c.links():[]}return[]}));return NS(i.flat(1).filter(yS).filter(u=>u.rel==="stylesheet"||u.rel==="preload").map(u=>u.rel==="stylesheet"?{...u,rel:"prefetch",as:"style"}:{...u,rel:"prefetch"}))}function vg(t,l,a,i,u,o){let c=(p,g)=>a[g]?p.route.id!==a[g].route.id:!0,m=(p,g)=>a[g].pathname!==p.pathname||a[g].route.path?.endsWith("*")&&a[g].params["*"]!==p.params["*"];return o==="assets"?l.filter((p,g)=>c(p,g)||m(p,g)):o==="data"?l.filter((p,g)=>{let y=i.routes[p.route.id];if(!y||!y.hasLoader)return!1;if(c(p,g)||m(p,g))return!0;if(p.route.shouldRevalidate){let x=p.route.shouldRevalidate({currentUrl:new URL(u.pathname+u.search+u.hash,window.origin),currentParams:a[0]?.params||{},nextUrl:new URL(t,window.origin),nextParams:p.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function vS(t,l,{includeHydrateFallback:a}={}){return SS(t.map(i=>{let u=l.routes[i.route.id];if(!u)return[];let o=[u.module];return u.clientActionModule&&(o=o.concat(u.clientActionModule)),u.clientLoaderModule&&(o=o.concat(u.clientLoaderModule)),a&&u.hydrateFallbackModule&&(o=o.concat(u.hydrateFallbackModule)),u.imports&&(o=o.concat(u.imports)),o}).flat(1))}function SS(t){return[...new Set(t)]}function wS(t){let l={},a=Object.keys(t).sort();for(let i of a)l[i]=t[i];return l}function NS(t,l){let a=new Set;return new Set(l),t.reduce((i,u)=>{let o=JSON.stringify(wS(u));return a.has(o)||(a.add(o),i.push({key:o,link:u})),i},[])}function Q0(){let t=A.useContext($r);return Tf(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function jS(){let t=A.useContext(Js);return Tf(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var Af=A.createContext(void 0);Af.displayName="FrameworkContext";function Y0(){let t=A.useContext(Af);return Tf(t,"You must render this element inside a <HydratedRouter> element"),t}function CS(t,l){let a=A.useContext(Af),[i,u]=A.useState(!1),[o,c]=A.useState(!1),{onFocus:m,onBlur:p,onMouseEnter:g,onMouseLeave:y,onTouchStart:x}=l,v=A.useRef(null);A.useEffect(()=>{if(t==="render"&&c(!0),t==="viewport"){let E=C=>{C.forEach(M=>{c(M.isIntersecting)})},k=new IntersectionObserver(E,{threshold:.5});return v.current&&k.observe(v.current),()=>{k.disconnect()}}},[t]),A.useEffect(()=>{if(i){let E=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(E)}}},[i]);let S=()=>{u(!0)},N=()=>{u(!1),c(!1)};return a?t!=="intent"?[o,v,{}]:[o,v,{onFocus:Xa(m,S),onBlur:Xa(p,N),onMouseEnter:Xa(g,S),onMouseLeave:Xa(y,N),onTouchStart:Xa(x,S)}]:[!1,v,{}]}function Xa(t,l){return a=>{t&&t(a),a.defaultPrevented||l(a)}}function kS({page:t,...l}){let{router:a}=Q0(),i=A.useMemo(()=>T0(a.routes,t,a.basename),[a.routes,t,a.basename]);return i?A.createElement(TS,{page:t,matches:i,...l}):null}function ES(t){let{manifest:l,routeModules:a}=Y0(),[i,u]=A.useState([]);return A.useEffect(()=>{let o=!1;return bS(t,l,a).then(c=>{o||u(c)}),()=>{o=!0}},[t,l,a]),i}function TS({page:t,matches:l,...a}){let i=jn(),{future:u,manifest:o,routeModules:c}=Y0(),{basename:m}=Q0(),{loaderData:p,matches:g}=jS(),y=A.useMemo(()=>vg(t,l,g,o,i,"data"),[t,l,g,o,i]),x=A.useMemo(()=>vg(t,l,g,o,i,"assets"),[t,l,g,o,i]),v=A.useMemo(()=>{if(t===i.pathname+i.search+i.hash)return[];let E=new Set,k=!1;if(l.forEach(M=>{let D=o.routes[M.route.id];!D||!D.hasLoader||(!y.some(F=>F.route.id===M.route.id)&&M.route.id in p&&c[M.route.id]?.shouldRevalidate||D.hasClientLoader?k=!0:E.add(M.route.id))}),E.size===0)return[];let C=gS(t,m,u.unstable_trailingSlashAwareDataRequests,"data");return k&&E.size>0&&C.searchParams.set("_routes",l.filter(M=>E.has(M.route.id)).map(M=>M.route.id).join(",")),[C.pathname+C.search]},[m,u.unstable_trailingSlashAwareDataRequests,p,i,o,y,l,t,c]),S=A.useMemo(()=>vS(x,o),[x,o]),N=ES(x);return A.createElement(A.Fragment,null,v.map(E=>A.createElement("link",{key:E,rel:"prefetch",as:"fetch",href:E,...a})),S.map(E=>A.createElement("link",{key:E,rel:"modulepreload",href:E,...a})),N.map(({key:E,link:k})=>A.createElement("link",{key:E,nonce:a.nonce,...k,crossOrigin:k.crossOrigin??a.crossOrigin})))}function AS(...t){return l=>{t.forEach(a=>{typeof a=="function"?a(l):a!=null&&(a.current=l)})}}var RS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{RS&&(window.__reactRouterVersion="7.13.0")}catch{}function MS({basename:t,children:l,unstable_useTransitions:a,window:i}){let u=A.useRef();u.current==null&&(u.current=c1({window:i,v5Compat:!0}));let o=u.current,[c,m]=A.useState({action:o.action,location:o.location}),p=A.useCallback(g=>{a===!1?m(g):A.startTransition(()=>m(g))},[a]);return A.useLayoutEffect(()=>o.listen(p),[o,p]),A.createElement(iS,{basename:t,children:l,location:c.location,navigationType:c.action,navigator:o,unstable_useTransitions:a})}var G0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Kl=A.forwardRef(function({onClick:l,discover:a="render",prefetch:i="none",relative:u,reloadDocument:o,replace:c,state:m,target:p,to:g,preventScrollReset:y,viewTransition:x,unstable_defaultShouldRevalidate:v,...S},N){let{basename:E,unstable_useTransitions:k}=A.useContext($t),C=typeof g=="string"&&G0.test(g),M=z0(g,E);g=M.to;let D=G1(g,{relative:u}),[F,V,q]=CS(i,S),K=DS(g,{replace:c,state:m,target:p,preventScrollReset:y,relative:u,viewTransition:x,unstable_defaultShouldRevalidate:v,unstable_useTransitions:k});function ne(T){l&&l(T),T.defaultPrevented||K(T)}let le=A.createElement("a",{...S,...q,href:M.absoluteURL||D,onClick:M.isExternal||o?l:ne,ref:AS(N,V),target:p,"data-discover":!C&&a==="render"?"true":void 0});return F&&!C?A.createElement(A.Fragment,null,le,A.createElement(kS,{page:D})):le});Kl.displayName="Link";var zS=A.forwardRef(function({"aria-current":l="page",caseSensitive:a=!1,className:i="",end:u=!1,style:o,to:c,viewTransition:m,children:p,...g},y){let x=oi(c,{relative:g.relative}),v=jn(),S=A.useContext(Js),{navigator:N,basename:E}=A.useContext($t),k=S!=null&&HS(x)&&m===!0,C=N.encodeLocation?N.encodeLocation(x).pathname:x.pathname,M=v.pathname,D=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;a||(M=M.toLowerCase(),D=D?D.toLowerCase():null,C=C.toLowerCase()),D&&E&&(D=Xn(D,E)||D);const F=C!=="/"&&C.endsWith("/")?C.length-1:C.length;let V=M===C||!u&&M.startsWith(C)&&M.charAt(F)==="/",q=D!=null&&(D===C||!u&&D.startsWith(C)&&D.charAt(C.length)==="/"),K={isActive:V,isPending:q,isTransitioning:k},ne=V?l:void 0,le;typeof i=="function"?le=i(K):le=[i,V?"active":null,q?"pending":null,k?"transitioning":null].filter(Boolean).join(" ");let T=typeof o=="function"?o(K):o;return A.createElement(Kl,{...g,"aria-current":ne,className:le,ref:y,style:T,to:c,viewTransition:m},typeof p=="function"?p(K):p)});zS.displayName="NavLink";var OS=A.forwardRef(({discover:t="render",fetcherKey:l,navigate:a,reloadDocument:i,replace:u,state:o,method:c=Bs,action:m,onSubmit:p,relative:g,preventScrollReset:y,viewTransition:x,unstable_defaultShouldRevalidate:v,...S},N)=>{let{unstable_useTransitions:E}=A.useContext($t),k=qS(),C=BS(m,{relative:g}),M=c.toLowerCase()==="get"?"get":"post",D=typeof m=="string"&&G0.test(m),F=V=>{if(p&&p(V),V.defaultPrevented)return;V.preventDefault();let q=V.nativeEvent.submitter,K=q?.getAttribute("formmethod")||c,ne=()=>k(q||V.currentTarget,{fetcherKey:l,method:K,navigate:a,replace:u,state:o,relative:g,preventScrollReset:y,viewTransition:x,unstable_defaultShouldRevalidate:v});E&&a!==!1?A.startTransition(()=>ne()):ne()};return A.createElement("form",{ref:N,method:M,action:C,onSubmit:i?p:F,...S,"data-discover":!D&&t==="render"?"true":void 0})});OS.displayName="Form";function _S(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function V0(t){let l=A.useContext($r);return Je(l,_S(t)),l}function DS(t,{target:l,replace:a,state:i,preventScrollReset:u,relative:o,viewTransition:c,unstable_defaultShouldRevalidate:m,unstable_useTransitions:p}={}){let g=Nl(),y=jn(),x=oi(t,{relative:o});return A.useCallback(v=>{if(dS(v,l)){v.preventDefault();let S=a!==void 0?a:ri(y)===ri(x),N=()=>g(t,{replace:S,state:i,preventScrollReset:u,relative:o,viewTransition:c,unstable_defaultShouldRevalidate:m});p?A.startTransition(()=>N()):N()}},[y,g,x,a,i,l,t,u,o,c,m,p])}var LS=0,US=()=>`__${String(++LS)}__`;function qS(){let{router:t}=V0("useSubmit"),{basename:l}=A.useContext($t),a=tS(),i=t.fetch,u=t.navigate;return A.useCallback(async(o,c={})=>{let{action:m,method:p,encType:g,formData:y,body:x}=pS(o,l);if(c.navigate===!1){let v=c.fetcherKey||US();await i(v,a,c.action||m,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:y,body:x,formMethod:c.method||p,formEncType:c.encType||g,flushSync:c.flushSync})}else await u(c.action||m,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:y,body:x,formMethod:c.method||p,formEncType:c.encType||g,replace:c.replace,state:c.state,fromRouteId:a,flushSync:c.flushSync,viewTransition:c.viewTransition})},[i,u,l,a])}function BS(t,{relative:l}={}){let{basename:a}=A.useContext($t),i=A.useContext(gn);Je(i,"useFormAction must be used inside a RouteContext");let[u]=i.matches.slice(-1),o={...oi(t||".",{relative:l})},c=jn();if(t==null){o.search=c.search;let m=new URLSearchParams(o.search),p=m.getAll("index");if(p.some(y=>y==="")){m.delete("index"),p.filter(x=>x).forEach(x=>m.append("index",x));let y=m.toString();o.search=y?`?${y}`:""}}return(!t||t===".")&&u.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),a!=="/"&&(o.pathname=o.pathname==="/"?a:In([a,o.pathname])),ri(o)}function HS(t,{relative:l}={}){let a=A.useContext(_0);Je(a!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=V0("useViewTransitionState"),u=oi(t,{relative:l});if(!a.isTransitioning)return!1;let o=Xn(a.currentLocation.pathname,i)||a.currentLocation.pathname,c=Xn(a.nextLocation.pathname,i)||a.nextLocation.pathname;return Gs(u.pathname,c)!=null||Gs(u.pathname,o)!=null}const K0=(...t)=>t.filter((l,a,i)=>!!l&&l.trim()!==""&&i.indexOf(l)===a).join(" ").trim();const FS=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const QS=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(l,a,i)=>i?i.toUpperCase():a.toLowerCase());const Sg=t=>{const l=QS(t);return l.charAt(0).toUpperCase()+l.slice(1)};var YS={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"};const GS=t=>{for(const l in t)if(l.startsWith("aria-")||l==="role"||l==="title")return!0;return!1};const VS=A.forwardRef(({color:t="currentColor",size:l=24,strokeWidth:a=2,absoluteStrokeWidth:i,className:u="",children:o,iconNode:c,...m},p)=>A.createElement("svg",{ref:p,...YS,width:l,height:l,stroke:t,strokeWidth:i?Number(a)*24/Number(l):a,className:K0("lucide",u),...!o&&!GS(m)&&{"aria-hidden":"true"},...m},[...c.map(([g,y])=>A.createElement(g,y)),...Array.isArray(o)?o:[o]]));const De=(t,l)=>{const a=A.forwardRef(({className:i,...u},o)=>A.createElement(VS,{ref:o,iconNode:l,className:K0(`lucide-${FS(Sg(t))}`,`lucide-${t}`,i),...u}));return a.displayName=Sg(t),a};const KS=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],IS=De("activity",KS);const XS=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],ci=De("arrow-left",XS);const $S=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ZS=De("check",$S);const JS=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Nn=De("chevron-down",JS);const PS=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],WS=De("chevron-right",PS);const e2=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Gl=De("chevron-up",e2);const t2=[["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"}]],Rf=De("circle-alert",t2);const n2=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],l2=De("circle-check-big",n2);const r2=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],ef=De("clock",r2);const a2=[["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"}]],wg=De("cpu",a2);const i2=[["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"}]],Vs=De("database",i2);const s2=[["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"}]],ai=De("download",s2);const u2=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],o2=De("external-link",u2);const c2=[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]],Ks=De("hard-drive",c2);const f2=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],d2=De("heart",f2);const h2=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],I0=De("layout-grid",h2);const m2=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],X0=De("list",m2);const p2=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Pe=De("loader-circle",p2);const g2=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],x2=De("log-out",g2);const y2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],tf=De("plus",y2);const b2=[["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"}]],v2=De("rotate-ccw",b2);const S2=[["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"}]],w2=De("rotate-cw",S2);const N2=[["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"}]],$0=De("save",N2);const j2=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Z0=De("search",j2);const C2=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],k2=De("send",C2);const E2=[["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"}]],T2=De("server",E2);const A2=[["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"}]],nf=De("settings",A2);const R2=[["path",{d:"m18 14 4 4-4 4",key:"10pe0f"}],["path",{d:"m18 2 4 4-4 4",key:"pucp1d"}],["path",{d:"M2 18h1.973a4 4 0 0 0 3.3-1.7l5.454-8.6a4 4 0 0 1 3.3-1.7H22",key:"1ailkh"}],["path",{d:"M2 6h1.972a4 4 0 0 1 3.6 2.2",key:"km57vx"}],["path",{d:"M22 18h-6.041a4 4 0 0 1-3.3-1.8l-.359-.45",key:"os18l9"}]],M2=De("shuffle",R2);const z2=[["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"}]],Il=De("trash-2",z2);const O2=[["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"}]],lf=De("triangle-alert",O2);const _2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Gr=De("x",_2),Ng="";class D2{apiKey=null;setApiKey(l){this.apiKey=l,localStorage.setItem("llamacpp_api_key",l)}getApiKey(){return this.apiKey||(this.apiKey=localStorage.getItem("llamacpp_api_key")),this.apiKey}clearApiKey(){this.apiKey=null,localStorage.removeItem("llamacpp_api_key")}async request(l,a={}){const i=this.getApiKey(),u={"Content-Type":"application/json",...a.headers};i&&l!=="/health"&&(u.Authorization=`Bearer ${i}`);const o=await fetch(`${Ng}${l}`,{...a,headers:u});if(!o.ok){const c=await o.json();throw new Error(c.details||c.error)}return o.json()}async getHealth(){return this.request("/health")}async getSystemStatus(){return this.request("/api/status")}async listServers(){return this.request("/api/servers")}async getServer(l){return this.request(`/api/servers/${l}`)}async createServer(l){return this.request("/api/servers",{method:"POST",body:JSON.stringify(l)})}async updateServer(l,a){return this.request(`/api/servers/${l}`,{method:"PATCH",body:JSON.stringify(a)})}async deleteServer(l){return this.request(`/api/servers/${l}`,{method:"DELETE"})}async startServer(l){return this.request(`/api/servers/${l}/start`,{method:"POST"})}async stopServer(l){return this.request(`/api/servers/${l}/stop`,{method:"POST"})}async restartServer(l){return this.request(`/api/servers/${l}/restart`,{method:"POST"})}async getServerLogs(l,a="all",i=100){return this.request(`/api/servers/${l}/logs?type=${a}&lines=${i}`)}async getServerSlots(l){return this.request(`/api/servers/${l}/slots`)}async listModels(){return this.request("/api/models")}async getModel(l){return this.request(`/api/models/${encodeURIComponent(l)}`)}async searchModels(l,a=20){return this.request(`/api/models/search?q=${encodeURIComponent(l)}&limit=${a}`)}async getModelFiles(l){return this.request(`/api/models/${encodeURIComponent(l)}/files`)}async downloadModel(l,a){return this.request("/api/models/download",{method:"POST",body:JSON.stringify({repo:l,filename:a})})}async deleteModel(l,a=!1){return this.request(`/api/models/${encodeURIComponent(l)}?cascade=${a}`,{method:"DELETE"})}async listDownloadJobs(){return this.request("/api/jobs")}async getDownloadJob(l){return this.request(`/api/jobs/${l}`)}async cancelDownloadJob(l){return this.request(`/api/jobs/${l}`,{method:"DELETE"})}async getRouter(){return this.request("/api/router")}async startRouter(){return this.request("/api/router/start",{method:"POST"})}async stopRouter(){return this.request("/api/router/stop",{method:"POST"})}async restartRouter(){return this.request("/api/router/restart",{method:"POST"})}async getRouterLogs(l="both",a=100){return this.request(`/api/router/logs?type=${l}&lines=${a}`)}async updateRouter(l){return this.request("/api/router",{method:"PATCH",body:JSON.stringify(l)})}async getAdmin(){return this.request("/api/admin")}async getAdminLogs(){return this.request("/api/admin/logs")}async getAdminServiceLogs(l="both",a=100){return this.request(`/api/admin/service-logs?type=${l}&lines=${a}`)}async rotateLogs(l){return this.request("/api/admin/logs/rotate",{method:"POST",body:JSON.stringify(l)})}async clearArchivedLogs(l){return this.request("/api/admin/logs/clear-archived",{method:"POST",body:JSON.stringify(l)})}async updateLogConfig(l){return this.request("/api/admin/logs/config",{method:"PATCH",body:JSON.stringify(l)})}async*streamChatMessage(l,a,i){const u=await fetch(`${Ng}/v1/messages`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:l,messages:a,max_tokens:i?.max_tokens||4096,temperature:i?.temperature||.7,stream:!0})});if(!u.ok){const p=await u.json();throw new Error(p.error||p.details||"Chat request failed")}const o=u.body.getReader(),c=new TextDecoder;let m="";try{for(;;){const{done:p,value:g}=await o.read();if(p)break;m+=c.decode(g,{stream:!0});const y=m.split(`
12
+ `);m=y.pop()||"";for(const x of y)if(x.startsWith("data: ")){const v=x.slice(6);if(v==="[DONE]")return;try{yield JSON.parse(v)}catch{}}}}finally{o.releaseLock()}}}const ke=new D2;function L2({onLogout:t,searchQuery:l="",onSearchChange:a}){const i=jn(),u=()=>{ke.clearApiKey(),t?.()};return d.jsx("nav",{className:"border-b border-neutral-200 bg-white",children:d.jsx("div",{className:"max-w-7xl mx-auto px-6",children:d.jsxs("div",{className:"flex items-center justify-between h-16",children:[d.jsxs("div",{className:"flex items-center space-x-10",children:[d.jsx(Kl,{to:"/",className:"hidden md:flex items-center",children:d.jsx("span",{className:"text-xl font-bold text-neutral-900 tracking-tight",children:"LLAMA CPP"})}),d.jsxs("div",{className:"flex items-center space-x-1",children:[d.jsx(Kl,{to:"/servers",className:`px-3 py-2 text-sm font-medium transition-colors rounded-md ${i.pathname==="/servers"||i.pathname==="/"?"text-neutral-900 bg-neutral-100":"text-neutral-600 hover:text-neutral-900 hover:bg-neutral-50"}`,children:"Servers"}),d.jsx(Kl,{to:"/models",className:`px-3 py-2 text-sm font-medium transition-colors rounded-md ${i.pathname==="/models"?"text-neutral-900 bg-neutral-100":"text-neutral-600 hover:text-neutral-900 hover:bg-neutral-50"}`,children:"Models"}),d.jsx(Kl,{to:"/manage",className:`px-3 py-2 text-sm font-medium transition-colors rounded-md ${i.pathname==="/manage"?"text-neutral-900 bg-neutral-100":"text-neutral-600 hover:text-neutral-900 hover:bg-neutral-50"}`,children:"Manage"})]})]}),d.jsxs("div",{className:"flex items-center space-x-3",children:[a&&d.jsxs("div",{className:"relative",children:[d.jsx(Z0,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-neutral-400 pointer-events-none"}),d.jsx("input",{type:"search",placeholder:"Search models...",value:l,onChange:o=>a(o.target.value),className:"w-72 pl-9 pr-4 py-2 text-sm text-neutral-900 placeholder:text-neutral-400 border border-neutral-200 rounded-md bg-white hover:border-neutral-300 focus:outline-none focus:border-neutral-400 transition-colors"})]}),d.jsx("button",{onClick:u,className:"p-2 text-neutral-500 hover:text-neutral-700 hover:bg-neutral-100 rounded-md transition-colors cursor-pointer",title:"Logout",children:d.jsx(x2,{className:"w-4 h-4"})})]})]})})})}function U2({onAuthenticated:t}){const[l,a]=A.useState(""),[i,u]=A.useState(""),[o,c]=A.useState(!1),m=async p=>{p.preventDefault(),u(""),c(!0);try{ke.setApiKey(l),await ke.getSystemStatus(),t()}catch{u("Invalid API key"),ke.clearApiKey()}finally{c(!1)}};return d.jsx("div",{className:"min-h-screen bg-white flex items-center justify-center p-4",children:d.jsxs("div",{className:"w-full max-w-sm",children:[d.jsxs("div",{className:"text-center mb-8",children:[d.jsx("svg",{className:"w-12 h-12 mx-auto mb-4",viewBox:"0 0 24 24",fill:"none",children:d.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z",fill:"currentColor"})}),d.jsx("h1",{className:"text-xl font-medium text-gray-900",children:"llama.cpp Admin"})]}),d.jsxs("form",{onSubmit:m,className:"space-y-4",children:[d.jsx("div",{children:d.jsx("input",{type:"password",value:l,onChange:p=>a(p.target.value),placeholder:"Enter API key",className:"w-full px-4 py-2.5 text-sm border border-gray-200 rounded-lg bg-gray-50 focus:bg-white focus:outline-none focus:ring-2 focus:ring-gray-200 focus:border-transparent",autoFocus:!0})}),i&&d.jsx("p",{className:"text-sm text-red-600",children:i}),d.jsx("button",{type:"submit",disabled:o||!l,className:"w-full py-2.5 px-4 bg-gray-900 hover:bg-gray-800 disabled:bg-gray-300 text-white text-sm font-medium rounded-lg transition-colors cursor-pointer disabled:cursor-not-allowed",children:o?"Connecting...":"Connect"})]}),d.jsxs("p",{className:"mt-6 text-center text-xs text-gray-500",children:["Run ",d.jsx("code",{className:"bg-gray-100 px-1.5 py-0.5 rounded text-gray-600",children:"llamacpp admin status"})," to get your API key"]})]})})}function J0(){return Xt({queryKey:["servers"],queryFn:()=>ke.listServers(),refetchInterval:5e3})}function q2(t){return Xt({queryKey:["servers",t],queryFn:()=>ke.getServer(t),enabled:!!t})}function B2(){const t=ft();return St({mutationFn:l=>ke.createServer(l),onSuccess:()=>{t.invalidateQueries({queryKey:["servers"]}),t.invalidateQueries({queryKey:["system"]})}})}function H2(){const t=ft();return St({mutationFn:({id:l,data:a})=>ke.updateServer(l,a),onSuccess:(l,a)=>{t.invalidateQueries({queryKey:["servers"]}),t.invalidateQueries({queryKey:["servers",a.id]})}})}function F2(){const t=ft();return St({mutationFn:l=>ke.deleteServer(l),onSuccess:()=>{t.invalidateQueries({queryKey:["servers"]}),t.invalidateQueries({queryKey:["system"]})}})}function Q2(){const t=ft();return St({mutationFn:l=>ke.startServer(l),onSuccess:(l,a)=>{t.invalidateQueries({queryKey:["servers"]}),t.invalidateQueries({queryKey:["servers",a]})}})}function Y2(){const t=ft();return St({mutationFn:l=>ke.stopServer(l),onSuccess:(l,a)=>{t.invalidateQueries({queryKey:["servers"]}),t.invalidateQueries({queryKey:["servers",a]})}})}function G2(t,l=500){return Xt({queryKey:["serverLogs",t,l],queryFn:()=>ke.getServerLogs(t,"all",l),enabled:!!t,refetchInterval:2e3})}function V2(t){return Xt({queryKey:["serverSlots",t],queryFn:()=>ke.getServerSlots(t),enabled:!!t,refetchInterval:3e3,placeholderData:Ir})}function Mf(){return Xt({queryKey:["models"],queryFn:()=>ke.listModels(),refetchInterval:1e4})}function K2(){const t=ft();return St({mutationFn:({name:l,cascade:a})=>ke.deleteModel(l,a),onSuccess:()=>{t.invalidateQueries({queryKey:["models"]}),t.invalidateQueries({queryKey:["servers"]}),t.invalidateQueries({queryKey:["system"]})}})}function I2(){return St({mutationFn:({repo:t,filename:l})=>ke.downloadModel(t,l)})}function X2(){return St({mutationFn:({query:t,limit:l=20})=>ke.searchModels(t,l)})}function $2(t){return Xt({queryKey:["modelFiles",t],queryFn:()=>ke.getModelFiles(t),enabled:!!t})}function P0(t=!0){return Xt({queryKey:["downloadJobs"],queryFn:()=>ke.listDownloadJobs(),refetchInterval:t?1e3:!1,enabled:t})}function Z2(t){return Xt({queryKey:["downloadJobs",t],queryFn:()=>ke.getDownloadJob(t),enabled:!!t,refetchInterval:500})}function J2(){const t=ft();return St({mutationFn:l=>ke.cancelDownloadJob(l),onSuccess:()=>{t.invalidateQueries({queryKey:["downloadJobs"]})}})}function zf(){return Xt({queryKey:["router"],queryFn:()=>ke.getRouter(),refetchInterval:5e3,placeholderData:Ir})}function P2(){const t=ft();return St({mutationFn:()=>ke.startRouter(),onSuccess:()=>{t.invalidateQueries({queryKey:["router"]})}})}function W2(){const t=ft();return St({mutationFn:()=>ke.stopRouter(),onSuccess:()=>{t.invalidateQueries({queryKey:["router"]})}})}function W0(){const t=ft();return St({mutationFn:()=>ke.restartRouter(),onSuccess:()=>{t.invalidateQueries({queryKey:["router"]})}})}function ew(t=500){return Xt({queryKey:["routerLogs",t],queryFn:()=>ke.getRouterLogs("both",t),refetchInterval:2e3,placeholderData:Ir})}function tw(){const t=ft();return St({mutationFn:l=>ke.updateRouter(l),onSuccess:()=>{t.invalidateQueries({queryKey:["router"]})}})}function nw(){return Xt({queryKey:["admin"],queryFn:()=>ke.getAdmin(),refetchInterval:5e3,placeholderData:Ir})}function lw(){return Xt({queryKey:["adminLogs"],queryFn:()=>ke.getAdminLogs(),refetchInterval:1e4,placeholderData:Ir})}function rw(t=500){return Xt({queryKey:["adminServiceLogs",t],queryFn:()=>ke.getAdminServiceLogs("both",t),refetchInterval:2e3,placeholderData:Ir})}function aw(){const t=ft();return St({mutationFn:l=>ke.rotateLogs(l),onSuccess:()=>{t.invalidateQueries({queryKey:["adminLogs"]})}})}function iw(){const t=ft();return St({mutationFn:l=>ke.clearArchivedLogs(l),onSuccess:()=>{t.invalidateQueries({queryKey:["adminLogs"]})}})}function sw(){const t=ft();return St({mutationFn:l=>ke.updateLogConfig(l),onSuccess:()=>{t.invalidateQueries({queryKey:["adminLogs"]})}})}function uw(t){const[l,a]=A.useState([]),[i,u]=A.useState(!1),[o,c]=A.useState(null),[m,p]=A.useState(null);return{messages:l,setMessages:a,isStreaming:i,error:o,sendMessage:async(y,x)=>{c(null),u(!0),p(null);const v=[...l,{role:"user",content:y}];a(v);try{let S="",N=0;const E=Date.now(),k=ke.streamChatMessage(t,v,x);for await(const C of k)if(C.type==="content_block_delta"){const M=C.delta?.text||"";S+=M,N++;const D=(Date.now()-E)/1e3,F=D>0?N/D:0;p(F),a([...v,{role:"assistant",content:S}])}S&&a([...v,{role:"assistant",content:S}])}catch(S){c(S.message),a(v)}finally{u(!1),p(null)}},tokensPerSecond:m}}function ow({server:t,isOpen:l,onClose:a,onUpdateStart:i}){const u=H2(),{data:o,isLoading:c}=Mf(),[m,p]=A.useState({model:"",alias:"",port:9e3,host:"127.0.0.1",threads:4,ctxSize:4096,gpuLayers:60,verbose:!1,customFlags:""}),[g,y]=A.useState(!0),[x,v]=A.useState(null),[S,N]=A.useState("60"),[E,k]=A.useState("4"),C=o?.models||[],M=H=>H.isSharded&&H.baseModelName?H.baseModelName:H.filename,D=H=>M(H).replace(".gguf",""),F=H=>C.find(ie=>ie.filename===H||ie.baseModelName===H?!0:ie.isSharded&&ie.shardPaths?ie.shardPaths.some(re=>re.endsWith(H)):!1);A.useEffect(()=>{if(t){const H=F(t.modelName),ie=H?M(H):t.modelName;p({model:ie,alias:t.alias||"",port:t.port,host:t.host,threads:t.threads,ctxSize:t.ctxSize,gpuLayers:t.gpuLayers,verbose:t.verbose,customFlags:t.customFlags?.join(", ")||""}),N(t.gpuLayers.toString()),k(t.threads.toString()),v(null)}},[t,C]);const V=async H=>{if(H.preventDefault(),!!t){v(null);try{const ie=m.customFlags.split(",").map(te=>te.trim()).filter(te=>te.length>0),re=m.model!==t.modelName?m.model:void 0;i?.(),await u.mutateAsync({id:t.id,data:{...re&&{model:re},alias:m.alias.trim()||null,port:m.port,host:m.host,threads:m.threads,ctxSize:m.ctxSize,gpuLayers:isNaN(m.gpuLayers)?60:m.gpuLayers,verbose:m.verbose,customFlags:ie.length>0?ie:void 0,restart:t.status==="running"&&g}}),a()}catch(ie){v(ie.message)}}},q=H=>H>=1048576?`${(H/1048576).toFixed(1)}M tokens`:H>=1024?`${(H/1024).toFixed(0)}K tokens`:`${H} tokens`,K=H=>H>=1e9?`${(H/1e9).toFixed(1)} GB`:H>=1e6?`${(H/1e6).toFixed(1)} MB`:`${(H/1e3).toFixed(1)} KB`;if(!l||!t)return null;const ne=F(t.modelName),le=ne?M(ne):t.modelName,T=m.model!==le,P=ne?D(ne):t.modelName.replace(".gguf","");return d.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:d.jsxs("div",{className:"bg-white rounded-xl shadow-xl w-full max-w-2xl mx-4 max-h-[90vh] flex flex-col",children:[d.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-200",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:"Configure Server"}),d.jsx("p",{className:"text-sm text-gray-500",children:P})]}),d.jsx("button",{onClick:a,className:"p-1 hover:bg-gray-100 rounded-lg transition-colors cursor-pointer",children:d.jsx(Gr,{className:"w-5 h-5"})})]}),d.jsxs("form",{onSubmit:V,className:"flex-1 overflow-y-auto p-4 space-y-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Model"}),c?d.jsx("div",{className:"flex items-center justify-center py-4",children:d.jsx(Pe,{className:"w-5 h-5 animate-spin text-gray-400"})}):C.length===0?d.jsx("div",{className:"text-center py-4 text-sm text-gray-500",children:"No models available"}):d.jsx("select",{value:m.model,onChange:H=>p({...m,model:H.target.value}),className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-gray-200 focus:border-transparent bg-white",children:C.map(H=>{const ie=M(H),re=F(t.modelName),te=re&&M(re)===ie,U=H.serversUsing>0&&!te,ee=te||!U;let L=D(H);return te?L+=" (current)":U&&(L+=" (in use)"),L+=` - ${K(H.size)}`,d.jsx("option",{value:ie,disabled:!ee,children:L},H.filename)})}),T&&d.jsxs("div",{className:"flex items-start gap-2 mt-2 p-2 bg-amber-50 border border-amber-200 rounded-lg",children:[d.jsx(lf,{className:"w-4 h-4 text-amber-600 flex-shrink-0 mt-0.5"}),d.jsx("p",{className:"text-xs text-amber-700",children:"Changing the model will stop the server and update its configuration. This may take a few moments."})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Alias (optional)"}),d.jsx("input",{type:"text",value:m.alias,onChange:H=>p({...m,alias:H.target.value}),placeholder:"e.g., thinking, coder, gpt-oss",pattern:"[a-zA-Z0-9_-]*",maxLength:64,className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-gray-200 focus:border-transparent"}),d.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Friendly name (leave empty to remove)"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Port"}),d.jsx("input",{type:"number",value:m.port,onChange:H=>p({...m,port:parseInt(H.target.value)||9e3}),min:1024,max:65535,className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-gray-200 focus:border-transparent"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Host"}),d.jsxs("select",{value:m.host,onChange:H=>p({...m,host:H.target.value}),className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-gray-200 focus:border-transparent bg-white",children:[d.jsx("option",{value:"127.0.0.1",children:"127.0.0.1 (localhost only)"}),d.jsx("option",{value:"0.0.0.0",children:"0.0.0.0 (all interfaces)"})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Threads"}),d.jsx("input",{type:"number",value:E,onChange:H=>{const ie=H.target.value;if(k(ie),ie!==""&&ie!=="-"){const re=parseInt(ie);isNaN(re)||p({...m,threads:re})}},onBlur:()=>{const H=parseInt(E);(isNaN(H)||E===""||E==="-"||H<-1||H>256)&&(k("4"),p({...m,threads:4}))},min:-1,max:256,className:`w-full px-3 py-2 text-sm border rounded-lg focus:outline-none focus:ring-2 focus:border-transparent ${(()=>{const H=parseInt(E);return E!==""&&E!=="-"&&!isNaN(H)&&(H<-1||H>256)?"border-red-500 focus:ring-red-200":"border-gray-200 focus:ring-gray-200"})()}`}),d.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[d.jsx("button",{type:"button",onClick:()=>{p({...m,threads:-1}),k("-1")},className:"text-xs text-gray-600 hover:text-gray-900 hover:underline cursor-pointer",children:"Auto (-1)"}),d.jsx("span",{className:"text-xs text-gray-500",children:"Number of CPU threads for inference"})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Context Size"}),d.jsx("input",{type:"number",value:m.ctxSize||"",onChange:H=>p({...m,ctxSize:H.target.value===""?0:parseInt(H.target.value)}),min:512,max:2097152,className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-gray-200 focus:border-transparent"}),d.jsxs("div",{className:"flex items-center justify-between mt-1",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{type:"button",onClick:()=>p({...m,ctxSize:16384}),className:"text-xs text-gray-600 hover:text-gray-900 hover:underline cursor-pointer",children:"16k"}),d.jsx("button",{type:"button",onClick:()=>p({...m,ctxSize:32768}),className:"text-xs text-gray-600 hover:text-gray-900 hover:underline cursor-pointer",children:"32k"}),d.jsx("button",{type:"button",onClick:()=>p({...m,ctxSize:65536}),className:"text-xs text-gray-600 hover:text-gray-900 hover:underline cursor-pointer",children:"64k"}),d.jsx("button",{type:"button",onClick:()=>p({...m,ctxSize:131072}),className:"text-xs text-gray-600 hover:text-gray-900 hover:underline cursor-pointer",children:"128k"}),d.jsx("button",{type:"button",onClick:()=>p({...m,ctxSize:262144}),className:"text-xs text-gray-600 hover:text-gray-900 hover:underline cursor-pointer",children:"256k"})]}),m.ctxSize>0&&d.jsx("span",{className:"text-xs text-gray-500",children:q(m.ctxSize)})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"GPU Layers"}),d.jsx("input",{type:"number",value:S,onChange:H=>{const ie=H.target.value;if(N(ie),ie!==""&&ie!=="-"){const re=parseInt(ie);isNaN(re)||p({...m,gpuLayers:re})}},onBlur:()=>{const H=parseInt(S);(isNaN(H)||S===""||S==="-"||H<-1||H>999)&&(N("60"),p({...m,gpuLayers:60}))},min:-1,max:999,className:`w-full px-3 py-2 text-sm border rounded-lg focus:outline-none focus:ring-2 focus:border-transparent ${(()=>{const H=parseInt(S);return S!==""&&S!=="-"&&!isNaN(H)&&(H<-1||H>999)?"border-red-500 focus:ring-red-200":"border-gray-200 focus:ring-gray-200"})()}`}),d.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[d.jsx("button",{type:"button",onClick:()=>{p({...m,gpuLayers:-1}),N("-1")},className:"text-xs text-gray-600 hover:text-gray-900 hover:underline cursor-pointer",children:"All (-1)"}),d.jsx("button",{type:"button",onClick:()=>{p({...m,gpuLayers:60}),N("60")},className:"text-xs text-gray-600 hover:text-gray-900 hover:underline cursor-pointer",children:"Recommended (60)"}),d.jsx("button",{type:"button",onClick:()=>{p({...m,gpuLayers:0}),N("0")},className:"text-xs text-gray-600 hover:text-gray-900 hover:underline cursor-pointer",children:"CPU only (0)"})]})]}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{children:[d.jsx("label",{className:"text-sm font-medium text-gray-700",children:"Verbose Logging"}),d.jsx("p",{className:"text-xs text-gray-500",children:"Log HTTP requests and responses"})]}),d.jsx("button",{type:"button",onClick:()=>p({...m,verbose:!m.verbose}),className:`relative w-11 h-6 rounded-full transition-colors cursor-pointer ${m.verbose?"bg-gray-900":"bg-gray-200"}`,children:d.jsx("span",{className:`absolute top-0.5 left-0.5 w-5 h-5 bg-white rounded-full shadow transition-transform ${m.verbose?"translate-x-5":""}`})})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Custom Flags"}),d.jsx("input",{type:"text",value:m.customFlags,onChange:H=>p({...m,customFlags:H.target.value}),placeholder:"--flash-attn, --cont-batching",className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-gray-200 focus:border-transparent"}),d.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Comma-separated additional flags"})]}),t.status==="running"&&d.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-gray-100",children:[d.jsx("input",{type:"checkbox",id:"restartAfterSave",checked:g,onChange:H=>y(H.target.checked),className:"w-4 h-4 text-gray-900 border-gray-300 rounded focus:ring-gray-200"}),d.jsx("label",{htmlFor:"restartAfterSave",className:"text-sm text-gray-700",children:"Restart server to apply changes"})]}),x&&d.jsx("div",{className:"p-3 bg-red-50 border border-red-200 rounded-lg",children:d.jsx("p",{className:"text-sm text-red-700",children:x})})]}),d.jsxs("div",{className:"flex items-center justify-end gap-2 px-4 py-3 border-t border-gray-200 bg-gray-50 rounded-b-xl",children:[d.jsx("button",{type:"button",onClick:a,className:"px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-100 rounded-lg transition-colors cursor-pointer",children:"Cancel"}),d.jsx("button",{onClick:V,disabled:u.isPending,className:"inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-gray-900 hover:bg-gray-800 rounded-lg transition-colors disabled:opacity-50 cursor-pointer disabled:cursor-wait",children:u.isPending?d.jsxs(d.Fragment,{children:[d.jsx(Pe,{className:"w-4 h-4 animate-spin"}),"Saving..."]}):d.jsx(d.Fragment,{children:t.status==="running"&&g?d.jsxs(d.Fragment,{children:[d.jsx(v2,{className:"w-4 h-4"}),"Save & Restart"]}):d.jsxs(d.Fragment,{children:[d.jsx($0,{className:"w-4 h-4"}),"Save"]})})})]})]})})}function cw(t){const l=navigator.hardwareConcurrency||8,a=Math.max(1,Math.floor(l/2));let i;return t<1e9?i=2048:t<3e9?i=4096:t<6e9?i=8192:i=16384,{threads:a,ctxSize:i,gpuLayers:60}}function fw({isOpen:t,onClose:l}){const a=B2(),{data:i,isLoading:u}=Mf(),[o,c]=A.useState({model:"",alias:"",port:"",host:"127.0.0.1",threads:4,ctxSize:4096,gpuLayers:60,verbose:!1,customFlags:""}),[m,p]=A.useState(null),[g,y]=A.useState("60"),[x,v]=A.useState("4"),S=i?.models||[],N=F=>F.isSharded&&F.baseModelName?F.baseModelName:F.filename,E=F=>N(F).replace(".gguf","");A.useEffect(()=>{t&&(c({model:"",alias:"",port:"",host:"127.0.0.1",threads:4,ctxSize:4096,gpuLayers:60,verbose:!1,customFlags:""}),y("60"),v("4"),p(null))},[t]),A.useEffect(()=>{if(o.model){const F=S.find(V=>N(V)===o.model);if(F){const V=cw(F.size);c(q=>({...q,threads:V.threads,ctxSize:V.ctxSize,gpuLayers:V.gpuLayers})),y(V.gpuLayers.toString()),v(V.threads.toString())}}},[o.model,S]);const k=async F=>{if(F.preventDefault(),!o.model){p("Please select a model");return}p(null);try{const V=o.customFlags.split(",").map(q=>q.trim()).filter(q=>q.length>0);await a.mutateAsync({model:o.model,alias:o.alias.trim()||void 0,port:o.port?parseInt(o.port):void 0,host:o.host,threads:o.threads,ctxSize:o.ctxSize,gpuLayers:isNaN(o.gpuLayers)?60:o.gpuLayers,verbose:o.verbose,customFlags:V.length>0?V:void 0}),l()}catch(V){p(V.message)}},C=F=>F>=1e9?`${(F/1e9).toFixed(1)} GB`:F>=1e6?`${(F/1e6).toFixed(1)} MB`:`${(F/1e3).toFixed(1)} KB`,M=F=>F>=1048576?`${(F/1048576).toFixed(1)}M tokens`:F>=1024?`${(F/1024).toFixed(0)}K tokens`:`${F} tokens`,D=S.find(F=>N(F)===o.model);return t?d.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:d.jsxs("div",{className:"bg-white rounded-xl shadow-xl w-full max-w-2xl mx-4 max-h-[90vh] flex flex-col",children:[d.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-200",children:[d.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:"Create Server"}),d.jsx("button",{onClick:l,className:"p-1 hover:bg-gray-100 rounded-lg transition-colors cursor-pointer",children:d.jsx(Gr,{className:"w-5 h-5"})})]}),d.jsxs("form",{onSubmit:k,className:"flex-1 overflow-y-auto p-4 space-y-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Model"}),u?d.jsx("div",{className:"flex items-center justify-center py-4",children:d.jsx(Pe,{className:"w-5 h-5 animate-spin text-gray-400"})}):S.length===0?d.jsx("div",{className:"text-center py-4 text-sm text-gray-500",children:"No models available. Download a model first."}):d.jsx("div",{className:"space-y-1 max-h-48 overflow-y-auto border border-gray-200 rounded-lg",children:S.map(F=>{const V=F.serversUsing>0,q=N(F),K=E(F);return d.jsx("button",{type:"button",onClick:()=>c({...o,model:q}),className:`w-full text-left px-3 py-2 transition-colors ${o.model===q?"bg-gray-100 cursor-pointer":"hover:bg-gray-50 cursor-pointer"}`,children:d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[d.jsx(Ks,{className:"w-4 h-4 text-gray-400 flex-shrink-0"}),d.jsx("span",{className:"text-sm text-gray-900 truncate",children:K})]}),d.jsxs("div",{className:"flex items-center gap-2 ml-2",children:[d.jsx("span",{className:"text-xs text-gray-500",children:C(F.size)}),V&&d.jsxs("span",{className:"text-xs text-gray-500",children:["(",F.serversUsing," server",F.serversUsing>1?"s":"",")"]})]})]})},F.filename)})}),D&&d.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:[C(D.size)," · Smart defaults applied"]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Alias (optional)"}),d.jsx("input",{type:"text",value:o.alias,onChange:F=>c({...o,alias:F.target.value}),placeholder:"e.g., thinking, coder, gpt-oss",pattern:"[a-zA-Z0-9_-]*",maxLength:64,className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-gray-200 focus:border-transparent"}),d.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Friendly name for this server (alphanumeric, hyphens, underscores)"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Port"}),d.jsx("input",{type:"number",value:o.port,onChange:F=>c({...o,port:F.target.value}),placeholder:"Auto-assign (9000-9999)",min:1024,max:65535,className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-gray-200 focus:border-transparent"}),d.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Leave empty to auto-assign"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Host"}),d.jsxs("select",{value:o.host,onChange:F=>c({...o,host:F.target.value}),className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-gray-200 focus:border-transparent bg-white",children:[d.jsx("option",{value:"127.0.0.1",children:"127.0.0.1 (localhost only)"}),d.jsx("option",{value:"0.0.0.0",children:"0.0.0.0 (all interfaces)"})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Threads"}),d.jsx("input",{type:"number",value:x,onChange:F=>{const V=F.target.value;if(v(V),V!==""&&V!=="-"){const q=parseInt(V);isNaN(q)||c({...o,threads:q})}},onBlur:()=>{const F=parseInt(x);(isNaN(F)||x===""||x==="-"||F<-1||F>256)&&(v("4"),c({...o,threads:4}))},min:-1,max:256,className:`w-full px-3 py-2 text-sm border rounded-lg focus:outline-none focus:ring-2 focus:border-transparent ${(()=>{const F=parseInt(x);return x!==""&&x!=="-"&&!isNaN(F)&&(F<-1||F>256)?"border-red-500 focus:ring-red-200":"border-gray-200 focus:ring-gray-200"})()}`}),d.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[d.jsx("button",{type:"button",onClick:()=>{c({...o,threads:-1}),v("-1")},className:"text-xs text-gray-600 hover:text-gray-900 hover:underline cursor-pointer",children:"Auto (-1)"}),d.jsx("span",{className:"text-xs text-gray-500",children:"Number of CPU threads for inference"})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Context Size"}),d.jsx("input",{type:"number",value:o.ctxSize||"",onChange:F=>c({...o,ctxSize:F.target.value===""?0:parseInt(F.target.value)}),min:512,max:2097152,className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-gray-200 focus:border-transparent"}),d.jsxs("div",{className:"flex items-center justify-between mt-1",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{type:"button",onClick:()=>c({...o,ctxSize:16384}),className:"text-xs text-gray-600 hover:text-gray-900 hover:underline cursor-pointer",children:"16k"}),d.jsx("button",{type:"button",onClick:()=>c({...o,ctxSize:32768}),className:"text-xs text-gray-600 hover:text-gray-900 hover:underline cursor-pointer",children:"32k"}),d.jsx("button",{type:"button",onClick:()=>c({...o,ctxSize:65536}),className:"text-xs text-gray-600 hover:text-gray-900 hover:underline cursor-pointer",children:"64k"}),d.jsx("button",{type:"button",onClick:()=>c({...o,ctxSize:131072}),className:"text-xs text-gray-600 hover:text-gray-900 hover:underline cursor-pointer",children:"128k"}),d.jsx("button",{type:"button",onClick:()=>c({...o,ctxSize:262144}),className:"text-xs text-gray-600 hover:text-gray-900 hover:underline cursor-pointer",children:"256k"})]}),o.ctxSize>0&&d.jsx("span",{className:"text-xs text-gray-500",children:M(o.ctxSize)})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"GPU Layers"}),d.jsx("input",{type:"number",value:g,onChange:F=>{const V=F.target.value;if(y(V),V!==""&&V!=="-"){const q=parseInt(V);isNaN(q)||c({...o,gpuLayers:q})}},onBlur:()=>{const F=parseInt(g);(isNaN(F)||g===""||g==="-"||F<-1||F>999)&&(y("60"),c({...o,gpuLayers:60}))},min:-1,max:999,className:`w-full px-3 py-2 text-sm border rounded-lg focus:outline-none focus:ring-2 focus:border-transparent ${(()=>{const F=parseInt(g);return g!==""&&g!=="-"&&!isNaN(F)&&(F<-1||F>999)?"border-red-500 focus:ring-red-200":"border-gray-200 focus:ring-gray-200"})()}`}),d.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[d.jsx("button",{type:"button",onClick:()=>{c({...o,gpuLayers:-1}),y("-1")},className:"text-xs text-gray-600 hover:text-gray-900 hover:underline cursor-pointer",children:"All (-1)"}),d.jsx("button",{type:"button",onClick:()=>{c({...o,gpuLayers:60}),y("60")},className:"text-xs text-gray-600 hover:text-gray-900 hover:underline cursor-pointer",children:"Recommended (60)"}),d.jsx("button",{type:"button",onClick:()=>{c({...o,gpuLayers:0}),y("0")},className:"text-xs text-gray-600 hover:text-gray-900 hover:underline cursor-pointer",children:"CPU only (0)"})]})]}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{children:[d.jsx("label",{className:"text-sm font-medium text-gray-700",children:"Verbose Logging"}),d.jsx("p",{className:"text-xs text-gray-500",children:"Log HTTP requests and responses"})]}),d.jsx("button",{type:"button",onClick:()=>c({...o,verbose:!o.verbose}),className:`relative w-11 h-6 rounded-full transition-colors cursor-pointer ${o.verbose?"bg-gray-900":"bg-gray-200"}`,children:d.jsx("span",{className:`absolute top-0.5 left-0.5 w-5 h-5 bg-white rounded-full shadow transition-transform ${o.verbose?"translate-x-5":""}`})})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Custom Flags"}),d.jsx("input",{type:"text",value:o.customFlags,onChange:F=>c({...o,customFlags:F.target.value}),placeholder:"--flash-attn, --cont-batching",className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-gray-200 focus:border-transparent"}),d.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Comma-separated additional flags"})]}),m&&d.jsxs("div",{className:"flex items-start gap-2 p-3 bg-red-50 border border-red-200 rounded-lg",children:[d.jsx(Rf,{className:"w-4 h-4 text-red-500 flex-shrink-0 mt-0.5"}),d.jsx("p",{className:"text-sm text-red-700",children:m})]})]}),d.jsxs("div",{className:"flex items-center justify-end gap-2 px-4 py-3 border-t border-gray-200 bg-gray-50 rounded-b-xl",children:[d.jsx("button",{type:"button",onClick:l,className:"px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-100 rounded-lg transition-colors cursor-pointer",children:"Cancel"}),d.jsx("button",{onClick:k,disabled:a.isPending||!o.model,className:"inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-gray-900 hover:bg-gray-800 rounded-lg transition-colors disabled:opacity-50 cursor-pointer disabled:cursor-not-allowed",children:a.isPending?d.jsxs(d.Fragment,{children:[d.jsx(Pe,{className:"w-4 h-4 animate-spin"}),"Creating..."]}):d.jsxs(d.Fragment,{children:[d.jsx(tf,{className:"w-4 h-4"}),"Create Server"]})})]})]})}):null}function dw(){const t=Nl(),l=ft(),{data:a,isLoading:i}=J0(),{data:u}=zf(),o=Q2(),c=Y2(),m=F2(),[p,g]=A.useState(null),[y,x]=A.useState(null),[v,S]=A.useState(null),[N,E]=A.useState(null),[k,C]=A.useState(!1),[M,D]=A.useState("all"),[F,V]=A.useState(()=>localStorage.getItem("llamacpp_servers_view")||"grid"),q=L=>{V(L),localStorage.setItem("llamacpp_servers_view",L)},K=A.useRef(null),ne=a?.servers||[];A.useEffect(()=>{if(K.current&&p){const{id:L,expectedStatus:pe}=K.current,R=ne.find(O=>O.id===L);R&&R.status===pe&&(K.current=null,g(null))}if(v&&ne.length>0){const L=setTimeout(()=>{S(null)},1e3);return()=>clearTimeout(L)}},[ne,p,v]);const le=async L=>{g({id:L,action:"start"}),K.current={id:L,expectedStatus:"running"};try{await o.mutateAsync(L),await l.refetchQueries({queryKey:["servers"]})}catch{K.current=null,g(null)}},T=async L=>{g({id:L,action:"stop"}),K.current={id:L,expectedStatus:"stopped"};try{await c.mutateAsync(L),await l.refetchQueries({queryKey:["servers"]})}catch{K.current=null,g(null)}},P=async L=>{x(null),g({id:L,action:"delete"});try{await m.mutateAsync(L),await l.refetchQueries({queryKey:["servers"]})}catch{}finally{g(null)}},H=L=>{const pe=L.id;if(v===pe)return d.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2 py-1 rounded-md text-xs font-medium bg-neutral-100 text-neutral-700",children:[d.jsx(Pe,{className:"w-3 h-3 animate-spin"}),"Updating"]});if(p?.id===pe){if(p.action==="delete")return d.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2 py-1 rounded-md text-xs font-medium bg-red-50 text-red-600",children:[d.jsx(Pe,{className:"w-3 h-3 animate-spin"}),"Removing"]});if(p.action==="stop")return d.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2 py-1 rounded-md text-xs font-medium bg-neutral-100 text-neutral-700",children:[d.jsx(Pe,{className:"w-3 h-3 animate-spin"}),"Stopping"]});if(p.action==="start")return d.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2 py-1 rounded-md text-xs font-medium bg-neutral-100 text-neutral-700",children:[d.jsx(Pe,{className:"w-3 h-3 animate-spin"}),"Starting"]})}return L.status==="running"?L.healthy===!1?d.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2 py-1 rounded-md text-xs font-medium bg-red-50 text-red-700 border border-red-200/50",children:[d.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-red-500"}),"Unhealthy"]}):d.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2 py-1 rounded-md text-xs font-medium bg-green-50 text-green-700 border border-green-200/50",children:[d.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-green-500"}),"Running"]}):L.status==="crashed"?d.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2 py-1 rounded-md text-xs font-medium bg-red-50 text-red-700 border border-red-200/50",children:[d.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-red-500"}),"Crashed"]}):d.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2 py-1 rounded-md text-xs font-medium bg-neutral-100 text-neutral-600",children:[d.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-neutral-400"}),"Stopped"]})},ie=L=>L>=1024?`${(L/1024).toFixed(0)}K`:L.toString();if(i)return d.jsx("div",{className:"max-w-7xl mx-auto px-6 py-12",children:d.jsx("p",{className:"text-neutral-500 text-center",children:"Loading..."})});const re=ne.filter(L=>L.status==="running"),te=ne.filter(L=>M==="all"?!0:M==="running"?L.status==="running":M==="stopped"?L.status!=="running":!0),U=te.filter(L=>L.status==="running"),ee=te.filter(L=>L.status!=="running");return d.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-8",children:[d.jsxs("div",{className:"flex items-center justify-between mb-6",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-semibold text-neutral-900 tracking-tight",children:"Servers"}),d.jsxs("p",{className:"text-sm text-neutral-600 mt-1",children:[ne.length," server",ne.length!==1?"s":"",re.length>0&&` • ${re.length} running`]})]}),d.jsxs("button",{onClick:()=>C(!0),className:"inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-neutral-900 hover:bg-neutral-800 rounded-md transition-colors cursor-pointer",children:[d.jsx(tf,{className:"w-4 h-4"}),"Create Server"]})]}),d.jsxs("div",{className:"flex items-center justify-between mb-6",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{onClick:()=>D("all"),className:`px-3 py-1.5 text-sm font-medium rounded-full border transition-all cursor-pointer ${M==="all"?"bg-neutral-900 text-white border-neutral-900":"bg-white text-neutral-600 border-neutral-200 hover:border-neutral-300"}`,children:"All"}),d.jsx("button",{onClick:()=>D("running"),className:`px-3 py-1.5 text-sm font-medium rounded-full border transition-all cursor-pointer ${M==="running"?"bg-neutral-900 text-white border-neutral-900":"bg-white text-neutral-600 border-neutral-200 hover:border-neutral-300"}`,children:"Running"}),d.jsx("button",{onClick:()=>D("stopped"),className:`px-3 py-1.5 text-sm font-medium rounded-full border transition-all cursor-pointer ${M==="stopped"?"bg-neutral-900 text-white border-neutral-900":"bg-white text-neutral-600 border-neutral-200 hover:border-neutral-300"}`,children:"Stopped"})]}),d.jsxs("div",{className:"flex items-center gap-1 p-1 bg-white border border-neutral-200 rounded-lg",children:[d.jsx("button",{onClick:()=>q("grid"),className:`p-1.5 rounded transition-colors cursor-pointer ${F==="grid"?"bg-neutral-900 text-white":"text-neutral-600 hover:text-neutral-900 hover:bg-neutral-50"}`,title:"Grid view",children:d.jsx(I0,{className:"w-4 h-4"})}),d.jsx("button",{onClick:()=>q("list"),className:`p-1.5 rounded transition-colors cursor-pointer ${F==="list"?"bg-neutral-900 text-white":"text-neutral-600 hover:text-neutral-900 hover:bg-neutral-50"}`,title:"List view",children:d.jsx(X0,{className:"w-4 h-4"})})]})]}),F==="grid"?d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[U.map(L=>d.jsxs("div",{className:"group bg-white border border-neutral-200 rounded-lg p-5 hover:border-neutral-300 hover:shadow-sm transition-all",children:[d.jsxs("div",{className:"mb-4",children:[d.jsxs("h3",{className:"text-base font-semibold text-neutral-900 truncate mb-1",children:[L.modelName.replace(".gguf",""),L.alias&&d.jsxs("span",{className:"ml-2 text-sm font-normal text-cyan-600",children:["(",L.alias,")"]})]}),d.jsxs("p",{className:"text-sm text-neutral-500",children:["localhost:",L.port]})]}),d.jsxs("div",{className:"space-y-2 mb-4",children:[d.jsxs("div",{className:"flex items-center gap-2 text-xs text-neutral-600",children:[d.jsx(wg,{className:"w-3.5 h-3.5 text-neutral-400"}),d.jsxs("span",{children:[L.threads," threads"]})]}),d.jsxs("div",{className:"flex items-center gap-2 text-xs text-neutral-600",children:[d.jsx(Vs,{className:"w-3.5 h-3.5 text-neutral-400"}),d.jsxs("span",{children:[ie(L.ctxSize)," context • ",L.gpuLayers," GPU layers"]})]})]}),d.jsxs("div",{className:"flex items-center justify-between gap-2",children:[d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx("button",{onClick:()=>t(`/servers/${L.id}/logs`),disabled:p?.id===L.id||v===L.id,className:"px-3 py-1.5 text-xs font-medium text-neutral-600 hover:text-neutral-900 hover:bg-neutral-50 rounded-md transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-wait",title:"Logs",children:"Logs"}),d.jsx("button",{onClick:()=>t(`/servers/${L.port}/chat`),disabled:L.status!=="running"||!u?.isRunning||p?.id===L.id||v===L.id,className:"px-3 py-1.5 text-xs font-medium text-neutral-600 hover:text-blue-600 hover:bg-blue-50 rounded-md transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",title:u?.isRunning?L.status!=="running"?"Server must be running to chat":"Chat":"Router must be running to chat",children:"Chat"}),d.jsx("button",{onClick:()=>E(L),disabled:p?.id===L.id||v===L.id,className:"px-3 py-1.5 text-xs font-medium text-neutral-600 hover:text-neutral-900 hover:bg-neutral-50 rounded-md transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-wait",title:"Config",children:"Config"}),d.jsx("button",{onClick:()=>T(L.id),disabled:p?.id===L.id||v===L.id,className:"px-3 py-1.5 text-xs font-medium text-neutral-600 hover:text-red-600 hover:bg-red-50 rounded-md transition-colors disabled:opacity-50 cursor-pointer disabled:cursor-wait",title:"Stop",children:"Stop"}),y===L.id?d.jsxs("span",{className:"flex items-center gap-1",children:[d.jsx("span",{className:"text-xs text-neutral-500 mr-1",children:"Remove?"}),d.jsx("button",{onClick:()=>P(L.id),disabled:p?.id===L.id,className:"px-2 py-1 text-xs font-medium text-red-600 hover:text-red-700 hover:bg-red-50 rounded-md transition-colors cursor-pointer disabled:opacity-50",children:"Yes"}),d.jsx("button",{onClick:()=>x(null),className:"px-2 py-1 text-xs font-medium text-neutral-500 hover:text-neutral-700 hover:bg-neutral-100 rounded-md transition-colors cursor-pointer",children:"No"})]}):d.jsx("button",{onClick:()=>x(L.id),disabled:p?.id===L.id||v===L.id,className:"px-3 py-1.5 text-xs font-medium text-neutral-600 hover:text-red-600 hover:bg-red-50 rounded-md transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-wait",title:"Remove server",children:d.jsx(Il,{className:"w-3.5 h-3.5"})})]}),H(L)]})]},L.id)),ee.map(L=>d.jsxs("div",{className:"group bg-white border border-neutral-200 rounded-lg p-5 hover:border-neutral-300 hover:shadow-sm transition-all opacity-60 hover:opacity-100",children:[d.jsxs("div",{className:"mb-4",children:[d.jsxs("h3",{className:"text-base font-semibold text-neutral-900 truncate mb-1",children:[L.modelName.replace(".gguf",""),L.alias&&d.jsxs("span",{className:"ml-2 text-sm font-normal text-cyan-600",children:["(",L.alias,")"]})]}),d.jsxs("p",{className:"text-sm text-neutral-500",children:["localhost:",L.port]})]}),d.jsxs("div",{className:"space-y-2 mb-4",children:[d.jsxs("div",{className:"flex items-center gap-2 text-xs text-neutral-600",children:[d.jsx(wg,{className:"w-3.5 h-3.5 text-neutral-400"}),d.jsxs("span",{children:[L.threads," threads"]})]}),d.jsxs("div",{className:"flex items-center gap-2 text-xs text-neutral-600",children:[d.jsx(Vs,{className:"w-3.5 h-3.5 text-neutral-400"}),d.jsxs("span",{children:[ie(L.ctxSize)," context"]})]})]}),d.jsxs("div",{className:"flex items-center justify-between gap-2",children:[d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx("button",{onClick:()=>t(`/servers/${L.id}/logs`),disabled:p?.id===L.id||v===L.id,className:"px-3 py-1.5 text-xs font-medium text-neutral-600 hover:text-neutral-900 hover:bg-neutral-50 rounded-md transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-wait",title:"Logs",children:"Logs"}),d.jsx("button",{onClick:()=>t(`/servers/${L.port}/chat`),disabled:L.status!=="running"||!u?.isRunning||p?.id===L.id||v===L.id,className:"px-3 py-1.5 text-xs font-medium text-neutral-600 hover:text-blue-600 hover:bg-blue-50 rounded-md transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",title:u?.isRunning?L.status!=="running"?"Server must be running to chat":"Chat":"Router must be running to chat",children:"Chat"}),d.jsx("button",{onClick:()=>E(L),disabled:p?.id===L.id||v===L.id,className:"px-3 py-1.5 text-xs font-medium text-neutral-600 hover:text-neutral-900 hover:bg-neutral-50 rounded-md transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-wait",title:"Config",children:"Config"}),d.jsx("button",{onClick:()=>le(L.id),disabled:p?.id===L.id||v===L.id,className:"px-3 py-1.5 text-xs font-medium text-neutral-600 hover:text-green-600 hover:bg-green-50 rounded-md transition-colors disabled:opacity-50 cursor-pointer disabled:cursor-wait",title:"Start",children:"Start"}),y===L.id?d.jsxs("span",{className:"flex items-center gap-1",children:[d.jsx("span",{className:"text-xs text-neutral-500 mr-1",children:"Remove?"}),d.jsx("button",{onClick:()=>P(L.id),disabled:p?.id===L.id,className:"px-2 py-1 text-xs font-medium text-red-600 hover:text-red-700 hover:bg-red-50 rounded-md transition-colors cursor-pointer disabled:opacity-50",children:"Yes"}),d.jsx("button",{onClick:()=>x(null),className:"px-2 py-1 text-xs font-medium text-neutral-500 hover:text-neutral-700 hover:bg-neutral-100 rounded-md transition-colors cursor-pointer",children:"No"})]}):d.jsx("button",{onClick:()=>x(L.id),disabled:p?.id===L.id||v===L.id,className:"px-3 py-1.5 text-xs font-medium text-neutral-600 hover:text-red-600 hover:bg-red-50 rounded-md transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-wait",title:"Remove server",children:d.jsx(Il,{className:"w-3.5 h-3.5"})})]}),H(L)]})]},L.id))]}):d.jsx("div",{className:"bg-white border border-neutral-200 rounded-lg divide-y divide-neutral-200",children:[...U,...ee].map(L=>d.jsx("div",{className:`group px-5 py-4 hover:bg-neutral-50 transition-colors ${L.status!=="running"?"opacity-60":""}`,children:d.jsxs("div",{className:"flex items-center justify-between gap-4",children:[d.jsx("div",{className:"flex items-center gap-4 flex-1 min-w-0",children:d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("h3",{className:"text-sm font-semibold text-neutral-900 truncate",children:[L.modelName.replace(".gguf",""),L.alias&&d.jsxs("span",{className:"ml-2 text-sm font-normal text-cyan-600",children:["(",L.alias,")"]})]}),d.jsxs("div",{className:"flex items-center gap-3 mt-1",children:[d.jsxs("span",{className:"text-xs text-neutral-600",children:["localhost:",L.port]}),d.jsx("span",{className:"text-xs text-neutral-400",children:"•"}),d.jsxs("span",{className:"text-xs text-neutral-600",children:[L.threads," threads"]}),d.jsx("span",{className:"text-xs text-neutral-400",children:"•"}),d.jsxs("span",{className:"text-xs text-neutral-600",children:[ie(L.ctxSize)," context"]}),d.jsx("span",{className:"text-xs text-neutral-400",children:"•"}),d.jsxs("span",{className:"text-xs text-neutral-600",children:[L.gpuLayers," GPU layers"]})]})]})}),d.jsxs("div",{className:"flex items-center gap-3",children:[H(L),d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx("button",{onClick:()=>t(`/servers/${L.id}/logs`),disabled:p?.id===L.id||v===L.id,className:"px-3 py-1.5 text-xs font-medium text-neutral-600 hover:text-neutral-900 hover:bg-neutral-50 rounded-md transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-wait",title:"Logs",children:"Logs"}),d.jsx("button",{onClick:()=>t(`/servers/${L.port}/chat`),disabled:L.status!=="running"||!u?.isRunning||p?.id===L.id||v===L.id,className:"px-3 py-1.5 text-xs font-medium text-neutral-600 hover:text-blue-600 hover:bg-blue-50 rounded-md transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",title:u?.isRunning?L.status!=="running"?"Server must be running to chat":"Chat":"Router must be running to chat",children:"Chat"}),d.jsx("button",{onClick:()=>E(L),disabled:p?.id===L.id||v===L.id,className:"px-3 py-1.5 text-xs font-medium text-neutral-600 hover:text-neutral-900 hover:bg-neutral-50 rounded-md transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-wait",title:"Config",children:"Config"}),L.status==="running"?d.jsx("button",{onClick:()=>T(L.id),disabled:p?.id===L.id||v===L.id,className:"px-3 py-1.5 text-xs font-medium text-neutral-600 hover:text-red-600 hover:bg-red-50 rounded-md transition-colors disabled:opacity-50 cursor-pointer disabled:cursor-wait",title:"Stop",children:"Stop"}):d.jsx("button",{onClick:()=>le(L.id),disabled:p?.id===L.id||v===L.id,className:"px-3 py-1.5 text-xs font-medium text-neutral-600 hover:text-green-600 hover:bg-green-50 rounded-md transition-colors disabled:opacity-50 cursor-pointer disabled:cursor-wait",title:"Start",children:"Start"}),y===L.id?d.jsxs("span",{className:"flex items-center gap-1",children:[d.jsx("span",{className:"text-xs text-neutral-500 mr-1",children:"Remove?"}),d.jsx("button",{onClick:()=>P(L.id),disabled:p?.id===L.id,className:"px-2 py-1 text-xs font-medium text-red-600 hover:text-red-700 hover:bg-red-50 rounded-md transition-colors cursor-pointer disabled:opacity-50",children:"Yes"}),d.jsx("button",{onClick:()=>x(null),className:"px-2 py-1 text-xs font-medium text-neutral-500 hover:text-neutral-700 hover:bg-neutral-100 rounded-md transition-colors cursor-pointer",children:"No"})]}):d.jsx("button",{onClick:()=>x(L.id),disabled:p?.id===L.id||v===L.id,className:"px-3 py-1.5 text-xs font-medium text-neutral-600 hover:text-red-600 hover:bg-red-50 rounded-md transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-wait",title:"Remove server",children:d.jsx(Il,{className:"w-3.5 h-3.5"})})]})]})]})},L.id))}),te.length===0&&ne.length>0&&d.jsxs("div",{className:"text-center py-16 bg-white border border-neutral-200 rounded-lg",children:[d.jsxs("p",{className:"text-neutral-600 text-base mb-2",children:["No ",M," servers"]}),d.jsx("p",{className:"text-sm text-neutral-500",children:"Try a different filter or create a new server"})]}),ne.length===0&&d.jsxs("div",{className:"text-center py-16 bg-white border border-neutral-200 rounded-lg",children:[d.jsx("p",{className:"text-neutral-600 text-base mb-2",children:"No servers configured"}),d.jsx("p",{className:"text-sm text-neutral-500 mb-6",children:"Create your first server to get started"}),d.jsxs("button",{onClick:()=>C(!0),className:"inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-neutral-900 hover:bg-neutral-800 rounded-md transition-colors cursor-pointer",children:[d.jsx(tf,{className:"w-4 h-4"}),"Create Server"]})]}),d.jsx(ow,{server:N,isOpen:N!==null,onClose:()=>E(null),onUpdateStart:()=>{N&&S(N.id)}}),d.jsx(fw,{isOpen:k,onClose:()=>C(!1)})]})}const hw={30:"text-black",31:"text-red-400",32:"text-green-400",33:"text-yellow-400",34:"text-blue-400",35:"text-purple-400",36:"text-cyan-400",37:"text-gray-300",90:"text-gray-500",91:"text-red-300",92:"text-green-300",93:"text-yellow-300",94:"text-blue-300",95:"text-purple-300",96:"text-cyan-300",97:"text-white"};function mw(t){const l=[],a=/[\x1b\u001b]\[(\d+)m/g;let i=0,u,o;const c=a.test(t);if(a.lastIndex=0,!c)return t&&l.push({text:t,color:void 0}),l;for(;(o=a.exec(t))!==null;){const m=o.index,p=o[1];if(m>i){const g=t.substring(i,m);g&&l.push({text:g,color:u})}p==="0"?u=void 0:u=hw[p],i=a.lastIndex}if(i<t.length){const m=t.substring(i);m&&l.push({text:m,color:u})}return l}function Of(t,l){const a=mw(t);return a.length===0?null:a.length===1&&!a[0].color?d.jsx("span",{className:"text-gray-100",children:a[0].text}):d.jsx(d.Fragment,{children:a.map((i,u)=>d.jsx("span",{className:i.color||"text-gray-100",children:i.text},`${l}-${u}`))})}function Wa(t){return t.replace(/[\x1b\u001b]\[\d+m/g,"")}const rf=["/health","/slots","/props"],jg=new Map;function pw(){return new Date().toISOString().substring(0,19).replace("T"," ")}function Cg(t,l){const a=t.match(/\[(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2})\]/);if(a)return a[1];const i=t.match(/^(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2})/);if(i)return i[1];const u=jg.get(l);if(u)return u;const o=pw();return jg.set(l,o),o}function kg(t){const l=t.indexOf("{");if(l===-1)return null;try{return JSON.parse(t.substring(l))}catch{return null}}function gw(t){const a=(t.messages||[]).find(u=>u.role==="user");if(!a||!a.content)return"";let i;return Array.isArray(a.content)?i=a.content.find(o=>o.type==="text")?.text||"":i=a.content,i=i.replace(/\n/g," ").replace(/\s+/g," ").trim(),i.length>50?i.substring(0,47)+"...":i}function xw(t){const l=t.__verbose?.timings;if(l)return Math.round((l.prompt_ms||0)+(l.predicted_ms||0));const a=t.timings;return a?Math.round((a.prompt_ms||0)+(a.predicted_ms||0)):0}function yw(t){const l=t.match(/^(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2})\s+(GET|POST|PUT|DELETE|PATCH)\s+(\S+)\s+(\S+)\s+(\d+)/);if(!l)return null;const[,a,,i]=l,u=rf.some(o=>i===o);return{raw:t,formatted:t,timestamp:a,type:"request",isHealthCheck:u}}function bw(t){const l=[];let a=[],i=!1;const u=p=>(p.includes("log_server_r: request:")||p.includes("log_server_r: done request:"))&&!p.includes("{")&&/(?:done )?request: (POST|GET|PUT|DELETE)/.test(p),o=p=>{try{const g=p[0],y=p.join(`
13
+ `),x=Cg(g,y),v=g.match(/(?:done )?request: (POST|GET|PUT|DELETE) (\/[^\s]+) ([^\s]+) (\d+)/);if(!v)return null;const[,S,N,E,k]=v,C=p.find(le=>le.includes("log_server_r: request:")&&le.includes("{"));let M="";if(C){const le=kg(C);le&&(M=gw(le))}const D=p.find(le=>le.includes("log_server_r: response:"));let F=0,V=0,q=0;if(D){const le=kg(D);le&&(F=le.usage?.prompt_tokens||0,V=le.usage?.completion_tokens||0,q=xw(le))}const K=`${x} ${S} ${N} ${E} ${k} "${M}" ${F} ${V} ${q}`,ne=rf.some(le=>N===le);return{raw:p.join(`
14
+ `),formatted:K,timestamp:x,type:"request",isHealthCheck:ne}}catch{return null}},c=p=>{try{const g=Cg(p,p),y=p.match(/(?:done )?request: (POST|GET|PUT|DELETE) ([^\s]+) ([^\s]+) (\d+)/);if(!y)return null;const[,x,v,S,N]=y,E=`${g} ${x} ${v} ${S} ${N} "" 0 0 0`,k=rf.some(C=>v===C);return{raw:p,formatted:E,timestamp:g,type:"request",isHealthCheck:k}}catch{return null}},m=p=>{const g=p.trim();return g.toLowerCase().includes("error")||g.toLowerCase().includes("failed")||g.toLowerCase().includes("exception")||g.includes("ERR")||g.includes("FATAL")?{raw:p,type:"error"}:g.toLowerCase().includes("warn")||g.toLowerCase().includes("warning")||g.includes("WARN")?{raw:p,type:"warning"}:{raw:p,type:"system"}};for(const p of t){const g=yw(p);if(g){l.push(g);continue}if(u(p)){if(i){const y=o(a);y&&l.push(y),a=[],i=!1}i=!0,a=[p]}else if(i){if(a.push(p),p.includes("log_server_r: response:")){const y=o(a);y&&l.push(y),a=[],i=!1}}else{const y=p.trim();y&&!y.includes("log_server_r")&&l.push(m(p))}}if(i&&a.length===1){const p=c(a[0]);p&&l.push(p)}return l}function vw(){const{id:t}=q0(),l=Nl(),[a,i]=A.useState("newest"),[u,o]=A.useState(()=>{const le=localStorage.getItem("serverLogs.viewMode");return le==="verbose"?"system":le==="activity"||le==="system"?le:"activity"}),[c,m]=A.useState(!1),[p,g]=A.useState(!1),[y,x]=A.useState(!1);A.useEffect(()=>{localStorage.setItem("serverLogs.viewMode",u)},[u]);const v=A.useRef(null),S=A.useRef(null),{data:N,isLoading:E}=q2(t||""),{data:k,isLoading:C}=G2(t||null,5e4),{data:M}=V2(t||null),D=N?.server;A.useEffect(()=>{p&&v.current&&(v.current.scrollTop=v.current.scrollHeight)},[k,p,a]),A.useEffect(()=>{const le=T=>{S.current&&!S.current.contains(T.target)&&m(!1)};return document.addEventListener("mousedown",le),()=>document.removeEventListener("mousedown",le)},[]);const F=()=>{if(!k)return{logs:[],hasRawLogs:!1,formattedCount:0};if(u==="system"){const U=[...(k.stderr||"").split(`
15
+ `),...(k.stdout||"").split(`
16
+ `)].filter(pe=>Wa(pe).trim().length>0),ee=U.slice(-200).map(pe=>({raw:pe,type:"system"}));return{logs:a==="newest"?[...ee].reverse():ee,hasRawLogs:U.length>0,formattedCount:0}}const le=(k.http||"").split(`
17
+ `).filter(U=>Wa(U).trim().length>0),T=[...(k.stderr||"").split(`
18
+ `),...(k.stdout||"").split(`
19
+ `)].filter(U=>Wa(U).trim().length>0),P=[...le,...T],H=bw(P),ie=P.length>0,re=H.filter(U=>U.formatted&&!U.isHealthCheck).length;let te=H.filter(U=>U.timestamp&&U.formatted);return y||(te=te.filter(U=>!U.isHealthCheck)),a==="oldest"?{logs:te,hasRawLogs:ie,formattedCount:re}:{logs:[...te].reverse(),hasRawLogs:ie,formattedCount:re}},{logs:V,hasRawLogs:q,formattedCount:K}=F(),ne=le=>{switch(le){case"request":return"text-blue-400";case"error":return"text-red-400";case"warning":return"text-yellow-400";default:return"text-gray-400"}};return E?d.jsx("div",{className:"max-w-6xl mx-auto px-4 py-12",children:d.jsx("p",{className:"text-gray-500 text-center",children:"Loading..."})}):D?d.jsxs("div",{className:"h-[calc(100vh-56px)] flex flex-col",children:[d.jsx("div",{className:"flex items-center px-4 py-3 border-b border-gray-200 bg-white",children:d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("button",{onClick:()=>l("/servers"),className:"p-1.5 text-gray-500 hover:text-gray-700 hover:bg-gray-100 rounded-lg transition-colors cursor-pointer",children:d.jsx(ci,{className:"w-5 h-5"})}),d.jsxs("div",{children:[d.jsx("h1",{className:"text-lg font-semibold text-gray-900",children:"Server Logs"}),d.jsxs("p",{className:"text-sm text-gray-500 flex items-center gap-2",children:[d.jsxs("span",{children:[D.modelName.replace(".gguf","")," · Port ",D.port]}),M&&M.totalSlots>0&&d.jsxs("span",{className:`flex items-center gap-1 text-xs font-medium px-2 py-0.5 rounded-full ${M.activeSlots>0?"bg-green-100 text-green-700":"bg-gray-100 text-gray-500"}`,children:[d.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${M.activeSlots>0?"bg-green-500":"bg-gray-400"}`}),M.activeSlots>0?`${M.activeSlots}/${M.totalSlots} active`:`${M.totalSlots} idle`]})]})]})]})}),!D.verbose&&d.jsx("div",{className:"px-4 py-2 bg-yellow-50 border-b border-yellow-200",children:d.jsx("p",{className:"text-sm text-yellow-800",children:"ℹ️ Verbose logging is disabled. Activity logs will show basic HTTP format without detailed request/response data."})}),d.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-100 bg-gray-50",children:[d.jsx("div",{className:"flex items-center gap-2",children:d.jsxs("div",{className:"flex items-center bg-white border border-gray-200 rounded-lg overflow-hidden",children:[d.jsx("button",{onClick:()=>o("activity"),className:`px-3 py-1.5 text-sm font-medium transition-colors cursor-pointer ${u==="activity"?"bg-gray-100 text-gray-900":"text-gray-600 hover:bg-gray-50"}`,children:"Activity"}),d.jsx("button",{onClick:()=>o("system"),className:`px-3 py-1.5 text-sm font-medium transition-colors cursor-pointer ${u==="system"?"bg-gray-100 text-gray-900":"text-gray-600 hover:bg-gray-50"}`,children:"System"})]})}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs("button",{onClick:()=>x(!y),className:`flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg border transition-colors cursor-pointer ${y?"bg-blue-50 text-blue-700 border-blue-200":"bg-white text-gray-500 border-gray-200 hover:border-gray-300 hover:bg-gray-50"}`,title:"Show /health, /slots, /props requests (filtered by default)",children:[y&&d.jsx(ZS,{className:"w-4 h-4"}),"Health Checks"]}),d.jsxs("div",{className:"relative",ref:S,children:[d.jsxs("button",{onClick:()=>m(!c),className:"flex items-center gap-2 px-3 py-1.5 text-sm font-medium text-gray-600 bg-white border border-gray-200 rounded-lg hover:border-gray-300 transition-colors cursor-pointer",children:[a==="newest"?"Newest":"Oldest",d.jsx(Nn,{className:"w-4 h-4"})]}),c&&d.jsxs("div",{className:"absolute right-0 top-full mt-1 w-32 bg-white border border-gray-200 rounded-lg shadow-lg z-10",children:[d.jsx("button",{onClick:()=>{i("newest"),m(!1)},className:`w-full text-left px-3 py-2 text-sm transition-colors cursor-pointer ${a==="newest"?"bg-gray-100 text-gray-900":"text-gray-600 hover:bg-gray-50"}`,children:"Newest"}),d.jsx("button",{onClick:()=>{i("oldest"),m(!1)},className:`w-full text-left px-3 py-2 text-sm transition-colors cursor-pointer ${a==="oldest"?"bg-gray-100 text-gray-900":"text-gray-600 hover:bg-gray-50"}`,children:"Oldest"})]})]})]})]}),d.jsx("div",{ref:v,className:"flex-1 overflow-y-auto bg-gray-900 p-4 font-mono text-sm",onScroll:le=>{const T=le.target,P=T.scrollHeight-T.scrollTop<=T.clientHeight+50;g(P)},children:C?d.jsx("div",{className:"flex items-center justify-center h-full",children:d.jsx(Pe,{className:"w-6 h-6 animate-spin text-gray-400"})}):V.length===0?d.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-gray-500",children:[d.jsx(Il,{className:"w-8 h-8 mb-2 opacity-50"}),d.jsxs("p",{children:["No ",u==="activity"?"activity ":u==="system"?"system ":"","logs found"]}),u==="activity"&&q&&K===0?d.jsxs("p",{className:"text-sm mt-1",children:["No HTTP requests yet."," ",d.jsx("button",{onClick:()=>o("system"),className:"text-blue-400 hover:text-blue-300 underline cursor-pointer",children:"View system logs"})]}):null]}):d.jsx("div",{className:"space-y-0.5",children:V.map((le,T)=>{const P=le.formatted||le.raw;return d.jsx("div",{className:`${ne(le.type)} break-all whitespace-pre-wrap leading-relaxed`,children:Of(P,T)},T)})})}),d.jsx("div",{className:"px-4 py-2 border-t border-gray-200 bg-gray-50 text-sm text-gray-500",children:d.jsxs("span",{children:[V.length," ",V.length===1?"line":"lines"]})})]}):d.jsxs("div",{className:"max-w-6xl mx-auto px-4 py-12",children:[d.jsx("p",{className:"text-gray-500 text-center",children:"Server not found"}),d.jsx("div",{className:"text-center mt-4",children:d.jsx(Kl,{to:"/servers",className:"text-sm text-blue-600 hover:text-blue-800",children:"Back to Servers"})})]})}function Sw(t,l){const a={};return(t[t.length-1]===""?[...t,""]:t).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}const ww=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Nw=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,jw={};function Eg(t,l){return(jw.jsx?Nw:ww).test(t)}const Cw=/[ \t\n\f\r]/g;function kw(t){return typeof t=="object"?t.type==="text"?Tg(t.value):!1:Tg(t)}function Tg(t){return t.replace(Cw,"")===""}class fi{constructor(l,a,i){this.normal=a,this.property=l,i&&(this.space=i)}}fi.prototype.normal={};fi.prototype.property={};fi.prototype.space=void 0;function ex(t,l){const a={},i={};for(const u of t)Object.assign(a,u.property),Object.assign(i,u.normal);return new fi(a,i,l)}function af(t){return t.toLowerCase()}class Ut{constructor(l,a){this.attribute=a,this.property=l}}Ut.prototype.attribute="";Ut.prototype.booleanish=!1;Ut.prototype.boolean=!1;Ut.prototype.commaOrSpaceSeparated=!1;Ut.prototype.commaSeparated=!1;Ut.prototype.defined=!1;Ut.prototype.mustUseProperty=!1;Ut.prototype.number=!1;Ut.prototype.overloadedBoolean=!1;Ut.prototype.property="";Ut.prototype.spaceSeparated=!1;Ut.prototype.space=void 0;let Ew=0;const Se=Jl(),st=Jl(),sf=Jl(),ae=Jl(),Ke=Jl(),Yr=Jl(),Kt=Jl();function Jl(){return 2**++Ew}const uf=Object.freeze(Object.defineProperty({__proto__:null,boolean:Se,booleanish:st,commaOrSpaceSeparated:Kt,commaSeparated:Yr,number:ae,overloadedBoolean:sf,spaceSeparated:Ke},Symbol.toStringTag,{value:"Module"})),Ac=Object.keys(uf);class _f extends Ut{constructor(l,a,i,u){let o=-1;if(super(l,a),Ag(this,"space",u),typeof i=="number")for(;++o<Ac.length;){const c=Ac[o];Ag(this,Ac[o],(i&uf[c])===uf[c])}}}_f.prototype.defined=!0;function Ag(t,l,a){a&&(t[l]=a)}function Jr(t){const l={},a={};for(const[i,u]of Object.entries(t.properties)){const o=new _f(i,t.transform(t.attributes||{},i),u,t.space);t.mustUseProperty&&t.mustUseProperty.includes(i)&&(o.mustUseProperty=!0),l[i]=o,a[af(i)]=i,a[af(o.attribute)]=i}return new fi(l,a,t.space)}const tx=Jr({properties:{ariaActiveDescendant:null,ariaAtomic:st,ariaAutoComplete:null,ariaBusy:st,ariaChecked:st,ariaColCount:ae,ariaColIndex:ae,ariaColSpan:ae,ariaControls:Ke,ariaCurrent:null,ariaDescribedBy:Ke,ariaDetails:null,ariaDisabled:st,ariaDropEffect:Ke,ariaErrorMessage:null,ariaExpanded:st,ariaFlowTo:Ke,ariaGrabbed:st,ariaHasPopup:null,ariaHidden:st,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ke,ariaLevel:ae,ariaLive:null,ariaModal:st,ariaMultiLine:st,ariaMultiSelectable:st,ariaOrientation:null,ariaOwns:Ke,ariaPlaceholder:null,ariaPosInSet:ae,ariaPressed:st,ariaReadOnly:st,ariaRelevant:null,ariaRequired:st,ariaRoleDescription:Ke,ariaRowCount:ae,ariaRowIndex:ae,ariaRowSpan:ae,ariaSelected:st,ariaSetSize:ae,ariaSort:null,ariaValueMax:ae,ariaValueMin:ae,ariaValueNow:ae,ariaValueText:null,role:null},transform(t,l){return l==="role"?l:"aria-"+l.slice(4).toLowerCase()}});function nx(t,l){return l in t?t[l]:l}function lx(t,l){return nx(t,l.toLowerCase())}const Tw=Jr({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Yr,acceptCharset:Ke,accessKey:Ke,action:null,allow:null,allowFullScreen:Se,allowPaymentRequest:Se,allowUserMedia:Se,alt:null,as:null,async:Se,autoCapitalize:null,autoComplete:Ke,autoFocus:Se,autoPlay:Se,blocking:Ke,capture:null,charSet:null,checked:Se,cite:null,className:Ke,cols:ae,colSpan:null,content:null,contentEditable:st,controls:Se,controlsList:Ke,coords:ae|Yr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Se,defer:Se,dir:null,dirName:null,disabled:Se,download:sf,draggable:st,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Se,formTarget:null,headers:Ke,height:ae,hidden:sf,high:ae,href:null,hrefLang:null,htmlFor:Ke,httpEquiv:Ke,id:null,imageSizes:null,imageSrcSet:null,inert:Se,inputMode:null,integrity:null,is:null,isMap:Se,itemId:null,itemProp:Ke,itemRef:Ke,itemScope:Se,itemType:Ke,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Se,low:ae,manifest:null,max:null,maxLength:ae,media:null,method:null,min:null,minLength:ae,multiple:Se,muted:Se,name:null,nonce:null,noModule:Se,noValidate:Se,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:Se,optimum:ae,pattern:null,ping:Ke,placeholder:null,playsInline:Se,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Se,referrerPolicy:null,rel:Ke,required:Se,reversed:Se,rows:ae,rowSpan:ae,sandbox:Ke,scope:null,scoped:Se,seamless:Se,selected:Se,shadowRootClonable:Se,shadowRootDelegatesFocus:Se,shadowRootMode:null,shape:null,size:ae,sizes:null,slot:null,span:ae,spellCheck:st,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ae,step:null,style:null,tabIndex:ae,target:null,title:null,translate:null,type:null,typeMustMatch:Se,useMap:null,value:st,width:ae,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ke,axis:null,background:null,bgColor:null,border:ae,borderColor:null,bottomMargin:ae,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Se,declare:Se,event:null,face:null,frame:null,frameBorder:null,hSpace:ae,leftMargin:ae,link:null,longDesc:null,lowSrc:null,marginHeight:ae,marginWidth:ae,noResize:Se,noHref:Se,noShade:Se,noWrap:Se,object:null,profile:null,prompt:null,rev:null,rightMargin:ae,rules:null,scheme:null,scrolling:st,standby:null,summary:null,text:null,topMargin:ae,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ae,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Se,disableRemotePlayback:Se,prefix:null,property:null,results:ae,security:null,unselectable:null},space:"html",transform:lx}),Aw=Jr({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",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:Kt,accentHeight:ae,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ae,amplitude:ae,arabicForm:null,ascent:ae,attributeName:null,attributeType:null,azimuth:ae,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ae,by:null,calcMode:null,capHeight:ae,className:Ke,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:ae,diffuseConstant:ae,direction:null,display:null,dur:null,divisor:ae,dominantBaseline:null,download:Se,dx:null,dy:null,edgeMode:null,editable:null,elevation:ae,enableBackground:null,end:null,event:null,exponent:ae,externalResourcesRequired:null,fill:null,fillOpacity:ae,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:Yr,g2:Yr,glyphName:Yr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ae,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ae,horizOriginX:ae,horizOriginY:ae,id:null,ideographic:ae,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ae,k:ae,k1:ae,k2:ae,k3:ae,k4:ae,kernelMatrix:Kt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ae,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ae,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:ae,overlineThickness:ae,paintOrder:null,panose1:null,path:null,pathLength:ae,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ke,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ae,pointsAtY:ae,pointsAtZ:ae,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Kt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Kt,rev:Kt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Kt,requiredFeatures:Kt,requiredFonts:Kt,requiredFormats:Kt,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:ae,specularExponent:ae,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ae,strikethroughThickness:ae,string:null,stroke:null,strokeDashArray:Kt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ae,strokeOpacity:ae,strokeWidth:null,style:null,surfaceScale:ae,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Kt,tabIndex:ae,tableValues:null,target:null,targetX:ae,targetY:ae,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Kt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ae,underlineThickness:ae,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ae,values:null,vAlphabetic:ae,vMathematical:ae,vectorEffect:null,vHanging:ae,vIdeographic:ae,version:null,vertAdvY:ae,vertOriginX:ae,vertOriginY:ae,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ae,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:nx}),rx=Jr({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,l){return"xlink:"+l.slice(5).toLowerCase()}}),ax=Jr({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:lx}),ix=Jr({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,l){return"xml:"+l.slice(3).toLowerCase()}}),Rw={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"},Mw=/[A-Z]/g,Rg=/-[a-z]/g,zw=/^data[-\w.:]+$/i;function Ow(t,l){const a=af(l);let i=l,u=Ut;if(a in t.normal)return t.property[t.normal[a]];if(a.length>4&&a.slice(0,4)==="data"&&zw.test(l)){if(l.charAt(4)==="-"){const o=l.slice(5).replace(Rg,Dw);i="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=l.slice(4);if(!Rg.test(o)){let c=o.replace(Mw,_w);c.charAt(0)!=="-"&&(c="-"+c),l="data"+c}}u=_f}return new u(i,l)}function _w(t){return"-"+t.toLowerCase()}function Dw(t){return t.charAt(1).toUpperCase()}const Lw=ex([tx,Tw,rx,ax,ix],"html"),Df=ex([tx,Aw,rx,ax,ix],"svg");function Uw(t){return t.join(" ").trim()}var Hr={},Rc,Mg;function qw(){if(Mg)return Rc;Mg=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,l=/\n/g,a=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,u=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,m=/^\s+|\s+$/g,p=`
20
+ `,g="/",y="*",x="",v="comment",S="declaration";function N(k,C){if(typeof k!="string")throw new TypeError("First argument must be a string");if(!k)return[];C=C||{};var M=1,D=1;function F(re){var te=re.match(l);te&&(M+=te.length);var U=re.lastIndexOf(p);D=~U?re.length-U:D+re.length}function V(){var re={line:M,column:D};return function(te){return te.position=new q(re),le(),te}}function q(re){this.start=re,this.end={line:M,column:D},this.source=C.source}q.prototype.content=k;function K(re){var te=new Error(C.source+":"+M+":"+D+": "+re);if(te.reason=re,te.filename=C.source,te.line=M,te.column=D,te.source=k,!C.silent)throw te}function ne(re){var te=re.exec(k);if(te){var U=te[0];return F(U),k=k.slice(U.length),te}}function le(){ne(a)}function T(re){var te;for(re=re||[];te=P();)te!==!1&&re.push(te);return re}function P(){var re=V();if(!(g!=k.charAt(0)||y!=k.charAt(1))){for(var te=2;x!=k.charAt(te)&&(y!=k.charAt(te)||g!=k.charAt(te+1));)++te;if(te+=2,x===k.charAt(te-1))return K("End of comment missing");var U=k.slice(2,te-2);return D+=2,F(U),k=k.slice(te),D+=2,re({type:v,comment:U})}}function H(){var re=V(),te=ne(i);if(te){if(P(),!ne(u))return K("property missing ':'");var U=ne(o),ee=re({type:S,property:E(te[0].replace(t,x)),value:U?E(U[0].replace(t,x)):x});return ne(c),ee}}function ie(){var re=[];T(re);for(var te;te=H();)te!==!1&&(re.push(te),T(re));return re}return le(),ie()}function E(k){return k?k.replace(m,x):x}return Rc=N,Rc}var zg;function Bw(){if(zg)return Hr;zg=1;var t=Hr&&Hr.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Hr,"__esModule",{value:!0}),Hr.default=a;const l=t(qw());function a(i,u){let o=null;if(!i||typeof i!="string")return o;const c=(0,l.default)(i),m=typeof u=="function";return c.forEach(p=>{if(p.type!=="declaration")return;const{property:g,value:y}=p;m?u(g,y,p):y&&(o=o||{},o[g]=y)}),o}return Hr}var $a={},Og;function Hw(){if(Og)return $a;Og=1,Object.defineProperty($a,"__esModule",{value:!0}),$a.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,l=/-([a-z])/g,a=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,u=/^-(ms)-/,o=function(g){return!g||a.test(g)||t.test(g)},c=function(g,y){return y.toUpperCase()},m=function(g,y){return"".concat(y,"-")},p=function(g,y){return y===void 0&&(y={}),o(g)?g:(g=g.toLowerCase(),y.reactCompat?g=g.replace(u,m):g=g.replace(i,m),g.replace(l,c))};return $a.camelCase=p,$a}var Za,_g;function Fw(){if(_g)return Za;_g=1;var t=Za&&Za.__importDefault||function(u){return u&&u.__esModule?u:{default:u}},l=t(Bw()),a=Hw();function i(u,o){var c={};return!u||typeof u!="string"||(0,l.default)(u,function(m,p){m&&p&&(c[(0,a.camelCase)(m,o)]=p)}),c}return i.default=i,Za=i,Za}var Qw=Fw();const Yw=x0(Qw),sx=ux("end"),Lf=ux("start");function ux(t){return l;function l(a){const i=a&&a.position&&a.position[t]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function Gw(t){const l=Lf(t),a=sx(t);if(l&&a)return{start:l,end:a}}function ei(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?Dg(t.position):"start"in t||"end"in t?Dg(t):"line"in t||"column"in t?of(t):""}function of(t){return Lg(t&&t.line)+":"+Lg(t&&t.column)}function Dg(t){return of(t&&t.start)+"-"+of(t&&t.end)}function Lg(t){return t&&typeof t=="number"?t:1}class wt extends Error{constructor(l,a,i){super(),typeof a=="string"&&(i=a,a=void 0);let u="",o={},c=!1;if(a&&("line"in a&&"column"in a?o={place:a}:"start"in a&&"end"in a?o={place:a}:"type"in a?o={ancestors:[a],place:a.position}:o={...a}),typeof l=="string"?u=l:!o.cause&&l&&(c=!0,u=l.message,o.cause=l),!o.ruleId&&!o.source&&typeof i=="string"){const p=i.indexOf(":");p===-1?o.ruleId=i:(o.source=i.slice(0,p),o.ruleId=i.slice(p+1))}if(!o.place&&o.ancestors&&o.ancestors){const p=o.ancestors[o.ancestors.length-1];p&&(o.place=p.position)}const m=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=m?m.column:void 0,this.fatal=void 0,this.file="",this.message=u,this.line=m?m.line:void 0,this.name=ei(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=c&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}wt.prototype.file="";wt.prototype.name="";wt.prototype.reason="";wt.prototype.message="";wt.prototype.stack="";wt.prototype.column=void 0;wt.prototype.line=void 0;wt.prototype.ancestors=void 0;wt.prototype.cause=void 0;wt.prototype.fatal=void 0;wt.prototype.place=void 0;wt.prototype.ruleId=void 0;wt.prototype.source=void 0;const Uf={}.hasOwnProperty,Vw=new Map,Kw=/[A-Z]/g,Iw=new Set(["table","tbody","thead","tfoot","tr"]),Xw=new Set(["td","th"]),ox="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function $w(t,l){if(!l||l.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const a=l.filePath||void 0;let i;if(l.development){if(typeof l.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=lN(a,l.jsxDEV)}else{if(typeof l.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof l.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");i=nN(a,l.jsx,l.jsxs)}const u={Fragment:l.Fragment,ancestors:[],components:l.components||{},create:i,elementAttributeNameCase:l.elementAttributeNameCase||"react",evaluater:l.createEvaluater?l.createEvaluater():void 0,filePath:a,ignoreInvalidStyle:l.ignoreInvalidStyle||!1,passKeys:l.passKeys!==!1,passNode:l.passNode||!1,schema:l.space==="svg"?Df:Lw,stylePropertyNameCase:l.stylePropertyNameCase||"dom",tableCellAlignToStyle:l.tableCellAlignToStyle!==!1},o=cx(u,t,void 0);return o&&typeof o!="string"?o:u.create(t,u.Fragment,{children:o||void 0},void 0)}function cx(t,l,a){if(l.type==="element")return Zw(t,l,a);if(l.type==="mdxFlowExpression"||l.type==="mdxTextExpression")return Jw(t,l);if(l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement")return Ww(t,l,a);if(l.type==="mdxjsEsm")return Pw(t,l);if(l.type==="root")return eN(t,l,a);if(l.type==="text")return tN(t,l)}function Zw(t,l,a){const i=t.schema;let u=i;l.tagName.toLowerCase()==="svg"&&i.space==="html"&&(u=Df,t.schema=u),t.ancestors.push(l);const o=dx(t,l.tagName,!1),c=rN(t,l);let m=Bf(t,l);return Iw.has(l.tagName)&&(m=m.filter(function(p){return typeof p=="string"?!kw(p):!0})),fx(t,c,o,l),qf(c,m),t.ancestors.pop(),t.schema=i,t.create(l,o,c,a)}function Jw(t,l){if(l.data&&l.data.estree&&t.evaluater){const i=l.data.estree.body[0];return i.type,t.evaluater.evaluateExpression(i.expression)}ii(t,l.position)}function Pw(t,l){if(l.data&&l.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(l.data.estree);ii(t,l.position)}function Ww(t,l,a){const i=t.schema;let u=i;l.name==="svg"&&i.space==="html"&&(u=Df,t.schema=u),t.ancestors.push(l);const o=l.name===null?t.Fragment:dx(t,l.name,!0),c=aN(t,l),m=Bf(t,l);return fx(t,c,o,l),qf(c,m),t.ancestors.pop(),t.schema=i,t.create(l,o,c,a)}function eN(t,l,a){const i={};return qf(i,Bf(t,l)),t.create(l,t.Fragment,i,a)}function tN(t,l){return l.value}function fx(t,l,a,i){typeof a!="string"&&a!==t.Fragment&&t.passNode&&(l.node=i)}function qf(t,l){if(l.length>0){const a=l.length>1?l:l[0];a&&(t.children=a)}}function nN(t,l,a){return i;function i(u,o,c,m){const g=Array.isArray(c.children)?a:l;return m?g(o,c,m):g(o,c)}}function lN(t,l){return a;function a(i,u,o,c){const m=Array.isArray(o.children),p=Lf(i);return l(u,o,c,m,{columnNumber:p?p.column-1:void 0,fileName:t,lineNumber:p?p.line:void 0},void 0)}}function rN(t,l){const a={};let i,u;for(u in l.properties)if(u!=="children"&&Uf.call(l.properties,u)){const o=iN(t,u,l.properties[u]);if(o){const[c,m]=o;t.tableCellAlignToStyle&&c==="align"&&typeof m=="string"&&Xw.has(l.tagName)?i=m:a[c]=m}}if(i){const o=a.style||(a.style={});o[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return a}function aN(t,l){const a={};for(const i of l.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&t.evaluater){const o=i.data.estree.body[0];o.type;const c=o.expression;c.type;const m=c.properties[0];m.type,Object.assign(a,t.evaluater.evaluateExpression(m.argument))}else ii(t,l.position);else{const u=i.name;let o;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&t.evaluater){const m=i.value.data.estree.body[0];m.type,o=t.evaluater.evaluateExpression(m.expression)}else ii(t,l.position);else o=i.value===null?!0:i.value;a[u]=o}return a}function Bf(t,l){const a=[];let i=-1;const u=t.passKeys?new Map:Vw;for(;++i<l.children.length;){const o=l.children[i];let c;if(t.passKeys){const p=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(p){const g=u.get(p)||0;c=p+"-"+g,u.set(p,g+1)}}const m=cx(t,o,c);m!==void 0&&a.push(m)}return a}function iN(t,l,a){const i=Ow(t.schema,l);if(!(a==null||typeof a=="number"&&Number.isNaN(a))){if(Array.isArray(a)&&(a=i.commaSeparated?Sw(a):Uw(a)),i.property==="style"){let u=typeof a=="object"?a:sN(t,String(a));return t.stylePropertyNameCase==="css"&&(u=uN(u)),["style",u]}return[t.elementAttributeNameCase==="react"&&i.space?Rw[i.property]||i.property:i.attribute,a]}}function sN(t,l){try{return Yw(l,{reactCompat:!0})}catch(a){if(t.ignoreInvalidStyle)return{};const i=a,u=new wt("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw u.file=t.filePath||void 0,u.url=ox+"#cannot-parse-style-attribute",u}}function dx(t,l,a){let i;if(!a)i={type:"Literal",value:l};else if(l.includes(".")){const u=l.split(".");let o=-1,c;for(;++o<u.length;){const m=Eg(u[o])?{type:"Identifier",name:u[o]}:{type:"Literal",value:u[o]};c=c?{type:"MemberExpression",object:c,property:m,computed:!!(o&&m.type==="Literal"),optional:!1}:m}i=c}else i=Eg(l)&&!/^[a-z]/.test(l)?{type:"Identifier",name:l}:{type:"Literal",value:l};if(i.type==="Literal"){const u=i.value;return Uf.call(t.components,u)?t.components[u]:u}if(t.evaluater)return t.evaluater.evaluateExpression(i);ii(t)}function ii(t,l){const a=new wt("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:l,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw a.file=t.filePath||void 0,a.url=ox+"#cannot-handle-mdx-estrees-without-createevaluater",a}function uN(t){const l={};let a;for(a in t)Uf.call(t,a)&&(l[oN(a)]=t[a]);return l}function oN(t){let l=t.replace(Kw,cN);return l.slice(0,3)==="ms-"&&(l="-"+l),l}function cN(t){return"-"+t.toLowerCase()}const Mc={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"]},fN={};function Hf(t,l){const a=fN,i=typeof a.includeImageAlt=="boolean"?a.includeImageAlt:!0,u=typeof a.includeHtml=="boolean"?a.includeHtml:!0;return hx(t,i,u)}function hx(t,l,a){if(dN(t)){if("value"in t)return t.type==="html"&&!a?"":t.value;if(l&&"alt"in t&&t.alt)return t.alt;if("children"in t)return Ug(t.children,l,a)}return Array.isArray(t)?Ug(t,l,a):""}function Ug(t,l,a){const i=[];let u=-1;for(;++u<t.length;)i[u]=hx(t[u],l,a);return i.join("")}function dN(t){return!!(t&&typeof t=="object")}const qg=document.createElement("i");function Ff(t){const l="&"+t+";";qg.innerHTML=l;const a=qg.textContent;return a.charCodeAt(a.length-1)===59&&t!=="semi"||a===l?!1:a}function It(t,l,a,i){const u=t.length;let o=0,c;if(l<0?l=-l>u?0:u+l:l=l>u?u:l,a=a>0?a:0,i.length<1e4)c=Array.from(i),c.unshift(l,a),t.splice(...c);else for(a&&t.splice(l,a);o<i.length;)c=i.slice(o,o+1e4),c.unshift(l,0),t.splice(...c),o+=1e4,l+=1e4}function on(t,l){return t.length>0?(It(t,t.length,0,l),t):l}const Bg={}.hasOwnProperty;function mx(t){const l={};let a=-1;for(;++a<t.length;)hN(l,t[a]);return l}function hN(t,l){let a;for(a in l){const u=(Bg.call(t,a)?t[a]:void 0)||(t[a]={}),o=l[a];let c;if(o)for(c in o){Bg.call(u,c)||(u[c]=[]);const m=o[c];mN(u[c],Array.isArray(m)?m:m?[m]:[])}}}function mN(t,l){let a=-1;const i=[];for(;++a<l.length;)(l[a].add==="after"?t:i).push(l[a]);It(t,0,0,i)}function px(t,l){const a=Number.parseInt(t,l);return a<9||a===11||a>13&&a<32||a>126&&a<160||a>55295&&a<57344||a>64975&&a<65008||(a&65535)===65535||(a&65535)===65534||a>1114111?"�":String.fromCodePoint(a)}function mn(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Et=jl(/[A-Za-z]/),vt=jl(/[\dA-Za-z]/),pN=jl(/[#-'*+\--9=?A-Z^-~]/);function Is(t){return t!==null&&(t<32||t===127)}const cf=jl(/\d/),gN=jl(/[\dA-Fa-f]/),xN=jl(/[!-/:-@[-`{-~]/);function he(t){return t!==null&&t<-2}function Ve(t){return t!==null&&(t<0||t===32)}function Ce(t){return t===-2||t===-1||t===32}const Ws=jl(new RegExp("\\p{P}|\\p{S}","u")),Zl=jl(/\s/);function jl(t){return l;function l(a){return a!==null&&a>-1&&t.test(String.fromCharCode(a))}}function Pr(t){const l=[];let a=-1,i=0,u=0;for(;++a<t.length;){const o=t.charCodeAt(a);let c="";if(o===37&&vt(t.charCodeAt(a+1))&&vt(t.charCodeAt(a+2)))u=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(c=String.fromCharCode(o));else if(o>55295&&o<57344){const m=t.charCodeAt(a+1);o<56320&&m>56319&&m<57344?(c=String.fromCharCode(o,m),u=1):c="�"}else c=String.fromCharCode(o);c&&(l.push(t.slice(i,a),encodeURIComponent(c)),i=a+u+1,c=""),u&&(a+=u,u=0)}return l.join("")+t.slice(i)}function Me(t,l,a,i){const u=i?i-1:Number.POSITIVE_INFINITY;let o=0;return c;function c(p){return Ce(p)?(t.enter(a),m(p)):l(p)}function m(p){return Ce(p)&&o++<u?(t.consume(p),m):(t.exit(a),l(p))}}const yN={tokenize:bN};function bN(t){const l=t.attempt(this.parser.constructs.contentInitial,i,u);let a;return l;function i(m){if(m===null){t.consume(m);return}return t.enter("lineEnding"),t.consume(m),t.exit("lineEnding"),Me(t,l,"linePrefix")}function u(m){return t.enter("paragraph"),o(m)}function o(m){const p=t.enter("chunkText",{contentType:"text",previous:a});return a&&(a.next=p),a=p,c(m)}function c(m){if(m===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(m);return}return he(m)?(t.consume(m),t.exit("chunkText"),o):(t.consume(m),c)}}const vN={tokenize:SN},Hg={tokenize:wN};function SN(t){const l=this,a=[];let i=0,u,o,c;return m;function m(D){if(i<a.length){const F=a[i];return l.containerState=F[1],t.attempt(F[0].continuation,p,g)(D)}return g(D)}function p(D){if(i++,l.containerState._closeFlow){l.containerState._closeFlow=void 0,u&&M();const F=l.events.length;let V=F,q;for(;V--;)if(l.events[V][0]==="exit"&&l.events[V][1].type==="chunkFlow"){q=l.events[V][1].end;break}C(i);let K=F;for(;K<l.events.length;)l.events[K][1].end={...q},K++;return It(l.events,V+1,0,l.events.slice(F)),l.events.length=K,g(D)}return m(D)}function g(D){if(i===a.length){if(!u)return v(D);if(u.currentConstruct&&u.currentConstruct.concrete)return N(D);l.interrupt=!!(u.currentConstruct&&!u._gfmTableDynamicInterruptHack)}return l.containerState={},t.check(Hg,y,x)(D)}function y(D){return u&&M(),C(i),v(D)}function x(D){return l.parser.lazy[l.now().line]=i!==a.length,c=l.now().offset,N(D)}function v(D){return l.containerState={},t.attempt(Hg,S,N)(D)}function S(D){return i++,a.push([l.currentConstruct,l.containerState]),v(D)}function N(D){if(D===null){u&&M(),C(0),t.consume(D);return}return u=u||l.parser.flow(l.now()),t.enter("chunkFlow",{_tokenizer:u,contentType:"flow",previous:o}),E(D)}function E(D){if(D===null){k(t.exit("chunkFlow"),!0),C(0),t.consume(D);return}return he(D)?(t.consume(D),k(t.exit("chunkFlow")),i=0,l.interrupt=void 0,m):(t.consume(D),E)}function k(D,F){const V=l.sliceStream(D);if(F&&V.push(null),D.previous=o,o&&(o.next=D),o=D,u.defineSkip(D.start),u.write(V),l.parser.lazy[D.start.line]){let q=u.events.length;for(;q--;)if(u.events[q][1].start.offset<c&&(!u.events[q][1].end||u.events[q][1].end.offset>c))return;const K=l.events.length;let ne=K,le,T;for(;ne--;)if(l.events[ne][0]==="exit"&&l.events[ne][1].type==="chunkFlow"){if(le){T=l.events[ne][1].end;break}le=!0}for(C(i),q=K;q<l.events.length;)l.events[q][1].end={...T},q++;It(l.events,ne+1,0,l.events.slice(K)),l.events.length=q}}function C(D){let F=a.length;for(;F-- >D;){const V=a[F];l.containerState=V[1],V[0].exit.call(l,t)}a.length=D}function M(){u.write([null]),o=void 0,u=void 0,l.containerState._closeFlow=void 0}}function wN(t,l,a){return Me(t,t.attempt(this.parser.constructs.document,l,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Vr(t){if(t===null||Ve(t)||Zl(t))return 1;if(Ws(t))return 2}function eu(t,l,a){const i=[];let u=-1;for(;++u<t.length;){const o=t[u].resolveAll;o&&!i.includes(o)&&(l=o(l,a),i.push(o))}return l}const ff={name:"attention",resolveAll:NN,tokenize:jN};function NN(t,l){let a=-1,i,u,o,c,m,p,g,y;for(;++a<t.length;)if(t[a][0]==="enter"&&t[a][1].type==="attentionSequence"&&t[a][1]._close){for(i=a;i--;)if(t[i][0]==="exit"&&t[i][1].type==="attentionSequence"&&t[i][1]._open&&l.sliceSerialize(t[i][1]).charCodeAt(0)===l.sliceSerialize(t[a][1]).charCodeAt(0)){if((t[i][1]._close||t[a][1]._open)&&(t[a][1].end.offset-t[a][1].start.offset)%3&&!((t[i][1].end.offset-t[i][1].start.offset+t[a][1].end.offset-t[a][1].start.offset)%3))continue;p=t[i][1].end.offset-t[i][1].start.offset>1&&t[a][1].end.offset-t[a][1].start.offset>1?2:1;const x={...t[i][1].end},v={...t[a][1].start};Fg(x,-p),Fg(v,p),c={type:p>1?"strongSequence":"emphasisSequence",start:x,end:{...t[i][1].end}},m={type:p>1?"strongSequence":"emphasisSequence",start:{...t[a][1].start},end:v},o={type:p>1?"strongText":"emphasisText",start:{...t[i][1].end},end:{...t[a][1].start}},u={type:p>1?"strong":"emphasis",start:{...c.start},end:{...m.end}},t[i][1].end={...c.start},t[a][1].start={...m.end},g=[],t[i][1].end.offset-t[i][1].start.offset&&(g=on(g,[["enter",t[i][1],l],["exit",t[i][1],l]])),g=on(g,[["enter",u,l],["enter",c,l],["exit",c,l],["enter",o,l]]),g=on(g,eu(l.parser.constructs.insideSpan.null,t.slice(i+1,a),l)),g=on(g,[["exit",o,l],["enter",m,l],["exit",m,l],["exit",u,l]]),t[a][1].end.offset-t[a][1].start.offset?(y=2,g=on(g,[["enter",t[a][1],l],["exit",t[a][1],l]])):y=0,It(t,i-1,a-i+3,g),a=i+g.length-y-2;break}}for(a=-1;++a<t.length;)t[a][1].type==="attentionSequence"&&(t[a][1].type="data");return t}function jN(t,l){const a=this.parser.constructs.attentionMarkers.null,i=this.previous,u=Vr(i);let o;return c;function c(p){return o=p,t.enter("attentionSequence"),m(p)}function m(p){if(p===o)return t.consume(p),m;const g=t.exit("attentionSequence"),y=Vr(p),x=!y||y===2&&u||a.includes(p),v=!u||u===2&&y||a.includes(i);return g._open=!!(o===42?x:x&&(u||!v)),g._close=!!(o===42?v:v&&(y||!x)),l(p)}}function Fg(t,l){t.column+=l,t.offset+=l,t._bufferIndex+=l}const CN={name:"autolink",tokenize:kN};function kN(t,l,a){let i=0;return u;function u(S){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(S),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),o}function o(S){return Et(S)?(t.consume(S),c):S===64?a(S):g(S)}function c(S){return S===43||S===45||S===46||vt(S)?(i=1,m(S)):g(S)}function m(S){return S===58?(t.consume(S),i=0,p):(S===43||S===45||S===46||vt(S))&&i++<32?(t.consume(S),m):(i=0,g(S))}function p(S){return S===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(S),t.exit("autolinkMarker"),t.exit("autolink"),l):S===null||S===32||S===60||Is(S)?a(S):(t.consume(S),p)}function g(S){return S===64?(t.consume(S),y):pN(S)?(t.consume(S),g):a(S)}function y(S){return vt(S)?x(S):a(S)}function x(S){return S===46?(t.consume(S),i=0,y):S===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(S),t.exit("autolinkMarker"),t.exit("autolink"),l):v(S)}function v(S){if((S===45||vt(S))&&i++<63){const N=S===45?v:x;return t.consume(S),N}return a(S)}}const di={partial:!0,tokenize:EN};function EN(t,l,a){return i;function i(o){return Ce(o)?Me(t,u,"linePrefix")(o):u(o)}function u(o){return o===null||he(o)?l(o):a(o)}}const gx={continuation:{tokenize:AN},exit:RN,name:"blockQuote",tokenize:TN};function TN(t,l,a){const i=this;return u;function u(c){if(c===62){const m=i.containerState;return m.open||(t.enter("blockQuote",{_container:!0}),m.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(c),t.exit("blockQuoteMarker"),o}return a(c)}function o(c){return Ce(c)?(t.enter("blockQuotePrefixWhitespace"),t.consume(c),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),l):(t.exit("blockQuotePrefix"),l(c))}}function AN(t,l,a){const i=this;return u;function u(c){return Ce(c)?Me(t,o,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):o(c)}function o(c){return t.attempt(gx,l,a)(c)}}function RN(t){t.exit("blockQuote")}const xx={name:"characterEscape",tokenize:MN};function MN(t,l,a){return i;function i(o){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(o),t.exit("escapeMarker"),u}function u(o){return xN(o)?(t.enter("characterEscapeValue"),t.consume(o),t.exit("characterEscapeValue"),t.exit("characterEscape"),l):a(o)}}const yx={name:"characterReference",tokenize:zN};function zN(t,l,a){const i=this;let u=0,o,c;return m;function m(x){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(x),t.exit("characterReferenceMarker"),p}function p(x){return x===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(x),t.exit("characterReferenceMarkerNumeric"),g):(t.enter("characterReferenceValue"),o=31,c=vt,y(x))}function g(x){return x===88||x===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(x),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),o=6,c=gN,y):(t.enter("characterReferenceValue"),o=7,c=cf,y(x))}function y(x){if(x===59&&u){const v=t.exit("characterReferenceValue");return c===vt&&!Ff(i.sliceSerialize(v))?a(x):(t.enter("characterReferenceMarker"),t.consume(x),t.exit("characterReferenceMarker"),t.exit("characterReference"),l)}return c(x)&&u++<o?(t.consume(x),y):a(x)}}const Qg={partial:!0,tokenize:_N},Yg={concrete:!0,name:"codeFenced",tokenize:ON};function ON(t,l,a){const i=this,u={partial:!0,tokenize:V};let o=0,c=0,m;return p;function p(q){return g(q)}function g(q){const K=i.events[i.events.length-1];return o=K&&K[1].type==="linePrefix"?K[2].sliceSerialize(K[1],!0).length:0,m=q,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),y(q)}function y(q){return q===m?(c++,t.consume(q),y):c<3?a(q):(t.exit("codeFencedFenceSequence"),Ce(q)?Me(t,x,"whitespace")(q):x(q))}function x(q){return q===null||he(q)?(t.exit("codeFencedFence"),i.interrupt?l(q):t.check(Qg,E,F)(q)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),v(q))}function v(q){return q===null||he(q)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),x(q)):Ce(q)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),Me(t,S,"whitespace")(q)):q===96&&q===m?a(q):(t.consume(q),v)}function S(q){return q===null||he(q)?x(q):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),N(q))}function N(q){return q===null||he(q)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),x(q)):q===96&&q===m?a(q):(t.consume(q),N)}function E(q){return t.attempt(u,F,k)(q)}function k(q){return t.enter("lineEnding"),t.consume(q),t.exit("lineEnding"),C}function C(q){return o>0&&Ce(q)?Me(t,M,"linePrefix",o+1)(q):M(q)}function M(q){return q===null||he(q)?t.check(Qg,E,F)(q):(t.enter("codeFlowValue"),D(q))}function D(q){return q===null||he(q)?(t.exit("codeFlowValue"),M(q)):(t.consume(q),D)}function F(q){return t.exit("codeFenced"),l(q)}function V(q,K,ne){let le=0;return T;function T(te){return q.enter("lineEnding"),q.consume(te),q.exit("lineEnding"),P}function P(te){return q.enter("codeFencedFence"),Ce(te)?Me(q,H,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(te):H(te)}function H(te){return te===m?(q.enter("codeFencedFenceSequence"),ie(te)):ne(te)}function ie(te){return te===m?(le++,q.consume(te),ie):le>=c?(q.exit("codeFencedFenceSequence"),Ce(te)?Me(q,re,"whitespace")(te):re(te)):ne(te)}function re(te){return te===null||he(te)?(q.exit("codeFencedFence"),K(te)):ne(te)}}}function _N(t,l,a){const i=this;return u;function u(c){return c===null?a(c):(t.enter("lineEnding"),t.consume(c),t.exit("lineEnding"),o)}function o(c){return i.parser.lazy[i.now().line]?a(c):l(c)}}const zc={name:"codeIndented",tokenize:LN},DN={partial:!0,tokenize:UN};function LN(t,l,a){const i=this;return u;function u(g){return t.enter("codeIndented"),Me(t,o,"linePrefix",5)(g)}function o(g){const y=i.events[i.events.length-1];return y&&y[1].type==="linePrefix"&&y[2].sliceSerialize(y[1],!0).length>=4?c(g):a(g)}function c(g){return g===null?p(g):he(g)?t.attempt(DN,c,p)(g):(t.enter("codeFlowValue"),m(g))}function m(g){return g===null||he(g)?(t.exit("codeFlowValue"),c(g)):(t.consume(g),m)}function p(g){return t.exit("codeIndented"),l(g)}}function UN(t,l,a){const i=this;return u;function u(c){return i.parser.lazy[i.now().line]?a(c):he(c)?(t.enter("lineEnding"),t.consume(c),t.exit("lineEnding"),u):Me(t,o,"linePrefix",5)(c)}function o(c){const m=i.events[i.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?l(c):he(c)?u(c):a(c)}}const qN={name:"codeText",previous:HN,resolve:BN,tokenize:FN};function BN(t){let l=t.length-4,a=3,i,u;if((t[a][1].type==="lineEnding"||t[a][1].type==="space")&&(t[l][1].type==="lineEnding"||t[l][1].type==="space")){for(i=a;++i<l;)if(t[i][1].type==="codeTextData"){t[a][1].type="codeTextPadding",t[l][1].type="codeTextPadding",a+=2,l-=2;break}}for(i=a-1,l++;++i<=l;)u===void 0?i!==l&&t[i][1].type!=="lineEnding"&&(u=i):(i===l||t[i][1].type==="lineEnding")&&(t[u][1].type="codeTextData",i!==u+2&&(t[u][1].end=t[i-1][1].end,t.splice(u+2,i-u-2),l-=i-u-2,i=u+2),u=void 0);return t}function HN(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function FN(t,l,a){let i=0,u,o;return c;function c(x){return t.enter("codeText"),t.enter("codeTextSequence"),m(x)}function m(x){return x===96?(t.consume(x),i++,m):(t.exit("codeTextSequence"),p(x))}function p(x){return x===null?a(x):x===32?(t.enter("space"),t.consume(x),t.exit("space"),p):x===96?(o=t.enter("codeTextSequence"),u=0,y(x)):he(x)?(t.enter("lineEnding"),t.consume(x),t.exit("lineEnding"),p):(t.enter("codeTextData"),g(x))}function g(x){return x===null||x===32||x===96||he(x)?(t.exit("codeTextData"),p(x)):(t.consume(x),g)}function y(x){return x===96?(t.consume(x),u++,y):u===i?(t.exit("codeTextSequence"),t.exit("codeText"),l(x)):(o.type="codeTextData",g(x))}}class QN{constructor(l){this.left=l?[...l]:[],this.right=[]}get(l){if(l<0||l>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+l+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return l<this.left.length?this.left[l]:this.right[this.right.length-l+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(l,a){const i=a??Number.POSITIVE_INFINITY;return i<this.left.length?this.left.slice(l,i):l>this.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-l+this.left.length).reverse():this.left.slice(l).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(l,a,i){const u=a||0;this.setCursor(Math.trunc(l));const o=this.right.splice(this.right.length-u,Number.POSITIVE_INFINITY);return i&&Ja(this.left,i),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(l){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(l)}pushMany(l){this.setCursor(Number.POSITIVE_INFINITY),Ja(this.left,l)}unshift(l){this.setCursor(0),this.right.push(l)}unshiftMany(l){this.setCursor(0),Ja(this.right,l.reverse())}setCursor(l){if(!(l===this.left.length||l>this.left.length&&this.right.length===0||l<0&&this.left.length===0))if(l<this.left.length){const a=this.left.splice(l,Number.POSITIVE_INFINITY);Ja(this.right,a.reverse())}else{const a=this.right.splice(this.left.length+this.right.length-l,Number.POSITIVE_INFINITY);Ja(this.left,a.reverse())}}}function Ja(t,l){let a=0;if(l.length<1e4)t.push(...l);else for(;a<l.length;)t.push(...l.slice(a,a+1e4)),a+=1e4}function bx(t){const l={};let a=-1,i,u,o,c,m,p,g;const y=new QN(t);for(;++a<y.length;){for(;a in l;)a=l[a];if(i=y.get(a),a&&i[1].type==="chunkFlow"&&y.get(a-1)[1].type==="listItemPrefix"&&(p=i[1]._tokenizer.events,o=0,o<p.length&&p[o][1].type==="lineEndingBlank"&&(o+=2),o<p.length&&p[o][1].type==="content"))for(;++o<p.length&&p[o][1].type!=="content";)p[o][1].type==="chunkText"&&(p[o][1]._isInFirstContentOfListItem=!0,o++);if(i[0]==="enter")i[1].contentType&&(Object.assign(l,YN(y,a)),a=l[a],g=!0);else if(i[1]._container){for(o=a,u=void 0;o--;)if(c=y.get(o),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(u&&(y.get(u)[1].type="lineEndingBlank"),c[1].type="lineEnding",u=o);else if(!(c[1].type==="linePrefix"||c[1].type==="listItemIndent"))break;u&&(i[1].end={...y.get(u)[1].start},m=y.slice(u,a),m.unshift(i),y.splice(u,a-u+1,m))}}return It(t,0,Number.POSITIVE_INFINITY,y.slice(0)),!g}function YN(t,l){const a=t.get(l)[1],i=t.get(l)[2];let u=l-1;const o=[];let c=a._tokenizer;c||(c=i.parser[a.contentType](a.start),a._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));const m=c.events,p=[],g={};let y,x,v=-1,S=a,N=0,E=0;const k=[E];for(;S;){for(;t.get(++u)[1]!==S;);o.push(u),S._tokenizer||(y=i.sliceStream(S),S.next||y.push(null),x&&c.defineSkip(S.start),S._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(y),S._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),x=S,S=S.next}for(S=a;++v<m.length;)m[v][0]==="exit"&&m[v-1][0]==="enter"&&m[v][1].type===m[v-1][1].type&&m[v][1].start.line!==m[v][1].end.line&&(E=v+1,k.push(E),S._tokenizer=void 0,S.previous=void 0,S=S.next);for(c.events=[],S?(S._tokenizer=void 0,S.previous=void 0):k.pop(),v=k.length;v--;){const C=m.slice(k[v],k[v+1]),M=o.pop();p.push([M,M+C.length-1]),t.splice(M,2,C)}for(p.reverse(),v=-1;++v<p.length;)g[N+p[v][0]]=N+p[v][1],N+=p[v][1]-p[v][0]-1;return g}const GN={resolve:KN,tokenize:IN},VN={partial:!0,tokenize:XN};function KN(t){return bx(t),t}function IN(t,l){let a;return i;function i(m){return t.enter("content"),a=t.enter("chunkContent",{contentType:"content"}),u(m)}function u(m){return m===null?o(m):he(m)?t.check(VN,c,o)(m):(t.consume(m),u)}function o(m){return t.exit("chunkContent"),t.exit("content"),l(m)}function c(m){return t.consume(m),t.exit("chunkContent"),a.next=t.enter("chunkContent",{contentType:"content",previous:a}),a=a.next,u}}function XN(t,l,a){const i=this;return u;function u(c){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(c),t.exit("lineEnding"),Me(t,o,"linePrefix")}function o(c){if(c===null||he(c))return a(c);const m=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?l(c):t.interrupt(i.parser.constructs.flow,a,l)(c)}}function vx(t,l,a,i,u,o,c,m,p){const g=p||Number.POSITIVE_INFINITY;let y=0;return x;function x(C){return C===60?(t.enter(i),t.enter(u),t.enter(o),t.consume(C),t.exit(o),v):C===null||C===32||C===41||Is(C)?a(C):(t.enter(i),t.enter(c),t.enter(m),t.enter("chunkString",{contentType:"string"}),E(C))}function v(C){return C===62?(t.enter(o),t.consume(C),t.exit(o),t.exit(u),t.exit(i),l):(t.enter(m),t.enter("chunkString",{contentType:"string"}),S(C))}function S(C){return C===62?(t.exit("chunkString"),t.exit(m),v(C)):C===null||C===60||he(C)?a(C):(t.consume(C),C===92?N:S)}function N(C){return C===60||C===62||C===92?(t.consume(C),S):S(C)}function E(C){return!y&&(C===null||C===41||Ve(C))?(t.exit("chunkString"),t.exit(m),t.exit(c),t.exit(i),l(C)):y<g&&C===40?(t.consume(C),y++,E):C===41?(t.consume(C),y--,E):C===null||C===32||C===40||Is(C)?a(C):(t.consume(C),C===92?k:E)}function k(C){return C===40||C===41||C===92?(t.consume(C),E):E(C)}}function Sx(t,l,a,i,u,o){const c=this;let m=0,p;return g;function g(S){return t.enter(i),t.enter(u),t.consume(S),t.exit(u),t.enter(o),y}function y(S){return m>999||S===null||S===91||S===93&&!p||S===94&&!m&&"_hiddenFootnoteSupport"in c.parser.constructs?a(S):S===93?(t.exit(o),t.enter(u),t.consume(S),t.exit(u),t.exit(i),l):he(S)?(t.enter("lineEnding"),t.consume(S),t.exit("lineEnding"),y):(t.enter("chunkString",{contentType:"string"}),x(S))}function x(S){return S===null||S===91||S===93||he(S)||m++>999?(t.exit("chunkString"),y(S)):(t.consume(S),p||(p=!Ce(S)),S===92?v:x)}function v(S){return S===91||S===92||S===93?(t.consume(S),m++,x):x(S)}}function wx(t,l,a,i,u,o){let c;return m;function m(v){return v===34||v===39||v===40?(t.enter(i),t.enter(u),t.consume(v),t.exit(u),c=v===40?41:v,p):a(v)}function p(v){return v===c?(t.enter(u),t.consume(v),t.exit(u),t.exit(i),l):(t.enter(o),g(v))}function g(v){return v===c?(t.exit(o),p(c)):v===null?a(v):he(v)?(t.enter("lineEnding"),t.consume(v),t.exit("lineEnding"),Me(t,g,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),y(v))}function y(v){return v===c||v===null||he(v)?(t.exit("chunkString"),g(v)):(t.consume(v),v===92?x:y)}function x(v){return v===c||v===92?(t.consume(v),y):y(v)}}function ti(t,l){let a;return i;function i(u){return he(u)?(t.enter("lineEnding"),t.consume(u),t.exit("lineEnding"),a=!0,i):Ce(u)?Me(t,i,a?"linePrefix":"lineSuffix")(u):l(u)}}const $N={name:"definition",tokenize:JN},ZN={partial:!0,tokenize:PN};function JN(t,l,a){const i=this;let u;return o;function o(S){return t.enter("definition"),c(S)}function c(S){return Sx.call(i,t,m,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(S)}function m(S){return u=mn(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),S===58?(t.enter("definitionMarker"),t.consume(S),t.exit("definitionMarker"),p):a(S)}function p(S){return Ve(S)?ti(t,g)(S):g(S)}function g(S){return vx(t,y,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(S)}function y(S){return t.attempt(ZN,x,x)(S)}function x(S){return Ce(S)?Me(t,v,"whitespace")(S):v(S)}function v(S){return S===null||he(S)?(t.exit("definition"),i.parser.defined.push(u),l(S)):a(S)}}function PN(t,l,a){return i;function i(m){return Ve(m)?ti(t,u)(m):a(m)}function u(m){return wx(t,o,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(m)}function o(m){return Ce(m)?Me(t,c,"whitespace")(m):c(m)}function c(m){return m===null||he(m)?l(m):a(m)}}const WN={name:"hardBreakEscape",tokenize:ej};function ej(t,l,a){return i;function i(o){return t.enter("hardBreakEscape"),t.consume(o),u}function u(o){return he(o)?(t.exit("hardBreakEscape"),l(o)):a(o)}}const tj={name:"headingAtx",resolve:nj,tokenize:lj};function nj(t,l){let a=t.length-2,i=3,u,o;return t[i][1].type==="whitespace"&&(i+=2),a-2>i&&t[a][1].type==="whitespace"&&(a-=2),t[a][1].type==="atxHeadingSequence"&&(i===a-1||a-4>i&&t[a-2][1].type==="whitespace")&&(a-=i+1===a?2:4),a>i&&(u={type:"atxHeadingText",start:t[i][1].start,end:t[a][1].end},o={type:"chunkText",start:t[i][1].start,end:t[a][1].end,contentType:"text"},It(t,i,a-i+1,[["enter",u,l],["enter",o,l],["exit",o,l],["exit",u,l]])),t}function lj(t,l,a){let i=0;return u;function u(y){return t.enter("atxHeading"),o(y)}function o(y){return t.enter("atxHeadingSequence"),c(y)}function c(y){return y===35&&i++<6?(t.consume(y),c):y===null||Ve(y)?(t.exit("atxHeadingSequence"),m(y)):a(y)}function m(y){return y===35?(t.enter("atxHeadingSequence"),p(y)):y===null||he(y)?(t.exit("atxHeading"),l(y)):Ce(y)?Me(t,m,"whitespace")(y):(t.enter("atxHeadingText"),g(y))}function p(y){return y===35?(t.consume(y),p):(t.exit("atxHeadingSequence"),m(y))}function g(y){return y===null||y===35||Ve(y)?(t.exit("atxHeadingText"),m(y)):(t.consume(y),g)}}const rj=["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"],Gg=["pre","script","style","textarea"],aj={concrete:!0,name:"htmlFlow",resolveTo:uj,tokenize:oj},ij={partial:!0,tokenize:fj},sj={partial:!0,tokenize:cj};function uj(t){let l=t.length;for(;l--&&!(t[l][0]==="enter"&&t[l][1].type==="htmlFlow"););return l>1&&t[l-2][1].type==="linePrefix"&&(t[l][1].start=t[l-2][1].start,t[l+1][1].start=t[l-2][1].start,t.splice(l-2,2)),t}function oj(t,l,a){const i=this;let u,o,c,m,p;return g;function g(j){return y(j)}function y(j){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(j),x}function x(j){return j===33?(t.consume(j),v):j===47?(t.consume(j),o=!0,E):j===63?(t.consume(j),u=3,i.interrupt?l:R):Et(j)?(t.consume(j),c=String.fromCharCode(j),k):a(j)}function v(j){return j===45?(t.consume(j),u=2,S):j===91?(t.consume(j),u=5,m=0,N):Et(j)?(t.consume(j),u=4,i.interrupt?l:R):a(j)}function S(j){return j===45?(t.consume(j),i.interrupt?l:R):a(j)}function N(j){const ue="CDATA[";return j===ue.charCodeAt(m++)?(t.consume(j),m===ue.length?i.interrupt?l:H:N):a(j)}function E(j){return Et(j)?(t.consume(j),c=String.fromCharCode(j),k):a(j)}function k(j){if(j===null||j===47||j===62||Ve(j)){const ue=j===47,ge=c.toLowerCase();return!ue&&!o&&Gg.includes(ge)?(u=1,i.interrupt?l(j):H(j)):rj.includes(c.toLowerCase())?(u=6,ue?(t.consume(j),C):i.interrupt?l(j):H(j)):(u=7,i.interrupt&&!i.parser.lazy[i.now().line]?a(j):o?M(j):D(j))}return j===45||vt(j)?(t.consume(j),c+=String.fromCharCode(j),k):a(j)}function C(j){return j===62?(t.consume(j),i.interrupt?l:H):a(j)}function M(j){return Ce(j)?(t.consume(j),M):T(j)}function D(j){return j===47?(t.consume(j),T):j===58||j===95||Et(j)?(t.consume(j),F):Ce(j)?(t.consume(j),D):T(j)}function F(j){return j===45||j===46||j===58||j===95||vt(j)?(t.consume(j),F):V(j)}function V(j){return j===61?(t.consume(j),q):Ce(j)?(t.consume(j),V):D(j)}function q(j){return j===null||j===60||j===61||j===62||j===96?a(j):j===34||j===39?(t.consume(j),p=j,K):Ce(j)?(t.consume(j),q):ne(j)}function K(j){return j===p?(t.consume(j),p=null,le):j===null||he(j)?a(j):(t.consume(j),K)}function ne(j){return j===null||j===34||j===39||j===47||j===60||j===61||j===62||j===96||Ve(j)?V(j):(t.consume(j),ne)}function le(j){return j===47||j===62||Ce(j)?D(j):a(j)}function T(j){return j===62?(t.consume(j),P):a(j)}function P(j){return j===null||he(j)?H(j):Ce(j)?(t.consume(j),P):a(j)}function H(j){return j===45&&u===2?(t.consume(j),U):j===60&&u===1?(t.consume(j),ee):j===62&&u===4?(t.consume(j),O):j===63&&u===3?(t.consume(j),R):j===93&&u===5?(t.consume(j),pe):he(j)&&(u===6||u===7)?(t.exit("htmlFlowData"),t.check(ij,$,ie)(j)):j===null||he(j)?(t.exit("htmlFlowData"),ie(j)):(t.consume(j),H)}function ie(j){return t.check(sj,re,$)(j)}function re(j){return t.enter("lineEnding"),t.consume(j),t.exit("lineEnding"),te}function te(j){return j===null||he(j)?ie(j):(t.enter("htmlFlowData"),H(j))}function U(j){return j===45?(t.consume(j),R):H(j)}function ee(j){return j===47?(t.consume(j),c="",L):H(j)}function L(j){if(j===62){const ue=c.toLowerCase();return Gg.includes(ue)?(t.consume(j),O):H(j)}return Et(j)&&c.length<8?(t.consume(j),c+=String.fromCharCode(j),L):H(j)}function pe(j){return j===93?(t.consume(j),R):H(j)}function R(j){return j===62?(t.consume(j),O):j===45&&u===2?(t.consume(j),R):H(j)}function O(j){return j===null||he(j)?(t.exit("htmlFlowData"),$(j)):(t.consume(j),O)}function $(j){return t.exit("htmlFlow"),l(j)}}function cj(t,l,a){const i=this;return u;function u(c){return he(c)?(t.enter("lineEnding"),t.consume(c),t.exit("lineEnding"),o):a(c)}function o(c){return i.parser.lazy[i.now().line]?a(c):l(c)}}function fj(t,l,a){return i;function i(u){return t.enter("lineEnding"),t.consume(u),t.exit("lineEnding"),t.attempt(di,l,a)}}const dj={name:"htmlText",tokenize:hj};function hj(t,l,a){const i=this;let u,o,c;return m;function m(R){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(R),p}function p(R){return R===33?(t.consume(R),g):R===47?(t.consume(R),V):R===63?(t.consume(R),D):Et(R)?(t.consume(R),ne):a(R)}function g(R){return R===45?(t.consume(R),y):R===91?(t.consume(R),o=0,N):Et(R)?(t.consume(R),M):a(R)}function y(R){return R===45?(t.consume(R),S):a(R)}function x(R){return R===null?a(R):R===45?(t.consume(R),v):he(R)?(c=x,ee(R)):(t.consume(R),x)}function v(R){return R===45?(t.consume(R),S):x(R)}function S(R){return R===62?U(R):R===45?v(R):x(R)}function N(R){const O="CDATA[";return R===O.charCodeAt(o++)?(t.consume(R),o===O.length?E:N):a(R)}function E(R){return R===null?a(R):R===93?(t.consume(R),k):he(R)?(c=E,ee(R)):(t.consume(R),E)}function k(R){return R===93?(t.consume(R),C):E(R)}function C(R){return R===62?U(R):R===93?(t.consume(R),C):E(R)}function M(R){return R===null||R===62?U(R):he(R)?(c=M,ee(R)):(t.consume(R),M)}function D(R){return R===null?a(R):R===63?(t.consume(R),F):he(R)?(c=D,ee(R)):(t.consume(R),D)}function F(R){return R===62?U(R):D(R)}function V(R){return Et(R)?(t.consume(R),q):a(R)}function q(R){return R===45||vt(R)?(t.consume(R),q):K(R)}function K(R){return he(R)?(c=K,ee(R)):Ce(R)?(t.consume(R),K):U(R)}function ne(R){return R===45||vt(R)?(t.consume(R),ne):R===47||R===62||Ve(R)?le(R):a(R)}function le(R){return R===47?(t.consume(R),U):R===58||R===95||Et(R)?(t.consume(R),T):he(R)?(c=le,ee(R)):Ce(R)?(t.consume(R),le):U(R)}function T(R){return R===45||R===46||R===58||R===95||vt(R)?(t.consume(R),T):P(R)}function P(R){return R===61?(t.consume(R),H):he(R)?(c=P,ee(R)):Ce(R)?(t.consume(R),P):le(R)}function H(R){return R===null||R===60||R===61||R===62||R===96?a(R):R===34||R===39?(t.consume(R),u=R,ie):he(R)?(c=H,ee(R)):Ce(R)?(t.consume(R),H):(t.consume(R),re)}function ie(R){return R===u?(t.consume(R),u=void 0,te):R===null?a(R):he(R)?(c=ie,ee(R)):(t.consume(R),ie)}function re(R){return R===null||R===34||R===39||R===60||R===61||R===96?a(R):R===47||R===62||Ve(R)?le(R):(t.consume(R),re)}function te(R){return R===47||R===62||Ve(R)?le(R):a(R)}function U(R){return R===62?(t.consume(R),t.exit("htmlTextData"),t.exit("htmlText"),l):a(R)}function ee(R){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(R),t.exit("lineEnding"),L}function L(R){return Ce(R)?Me(t,pe,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):pe(R)}function pe(R){return t.enter("htmlTextData"),c(R)}}const Qf={name:"labelEnd",resolveAll:xj,resolveTo:yj,tokenize:bj},mj={tokenize:vj},pj={tokenize:Sj},gj={tokenize:wj};function xj(t){let l=-1;const a=[];for(;++l<t.length;){const i=t[l][1];if(a.push(t[l]),i.type==="labelImage"||i.type==="labelLink"||i.type==="labelEnd"){const u=i.type==="labelImage"?4:2;i.type="data",l+=u}}return t.length!==a.length&&It(t,0,t.length,a),t}function yj(t,l){let a=t.length,i=0,u,o,c,m;for(;a--;)if(u=t[a][1],o){if(u.type==="link"||u.type==="labelLink"&&u._inactive)break;t[a][0]==="enter"&&u.type==="labelLink"&&(u._inactive=!0)}else if(c){if(t[a][0]==="enter"&&(u.type==="labelImage"||u.type==="labelLink")&&!u._balanced&&(o=a,u.type!=="labelLink")){i=2;break}}else u.type==="labelEnd"&&(c=a);const p={type:t[o][1].type==="labelLink"?"link":"image",start:{...t[o][1].start},end:{...t[t.length-1][1].end}},g={type:"label",start:{...t[o][1].start},end:{...t[c][1].end}},y={type:"labelText",start:{...t[o+i+2][1].end},end:{...t[c-2][1].start}};return m=[["enter",p,l],["enter",g,l]],m=on(m,t.slice(o+1,o+i+3)),m=on(m,[["enter",y,l]]),m=on(m,eu(l.parser.constructs.insideSpan.null,t.slice(o+i+4,c-3),l)),m=on(m,[["exit",y,l],t[c-2],t[c-1],["exit",g,l]]),m=on(m,t.slice(c+1)),m=on(m,[["exit",p,l]]),It(t,o,t.length,m),t}function bj(t,l,a){const i=this;let u=i.events.length,o,c;for(;u--;)if((i.events[u][1].type==="labelImage"||i.events[u][1].type==="labelLink")&&!i.events[u][1]._balanced){o=i.events[u][1];break}return m;function m(v){return o?o._inactive?x(v):(c=i.parser.defined.includes(mn(i.sliceSerialize({start:o.end,end:i.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(v),t.exit("labelMarker"),t.exit("labelEnd"),p):a(v)}function p(v){return v===40?t.attempt(mj,y,c?y:x)(v):v===91?t.attempt(pj,y,c?g:x)(v):c?y(v):x(v)}function g(v){return t.attempt(gj,y,x)(v)}function y(v){return l(v)}function x(v){return o._balanced=!0,a(v)}}function vj(t,l,a){return i;function i(x){return t.enter("resource"),t.enter("resourceMarker"),t.consume(x),t.exit("resourceMarker"),u}function u(x){return Ve(x)?ti(t,o)(x):o(x)}function o(x){return x===41?y(x):vx(t,c,m,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(x)}function c(x){return Ve(x)?ti(t,p)(x):y(x)}function m(x){return a(x)}function p(x){return x===34||x===39||x===40?wx(t,g,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(x):y(x)}function g(x){return Ve(x)?ti(t,y)(x):y(x)}function y(x){return x===41?(t.enter("resourceMarker"),t.consume(x),t.exit("resourceMarker"),t.exit("resource"),l):a(x)}}function Sj(t,l,a){const i=this;return u;function u(m){return Sx.call(i,t,o,c,"reference","referenceMarker","referenceString")(m)}function o(m){return i.parser.defined.includes(mn(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?l(m):a(m)}function c(m){return a(m)}}function wj(t,l,a){return i;function i(o){return t.enter("reference"),t.enter("referenceMarker"),t.consume(o),t.exit("referenceMarker"),u}function u(o){return o===93?(t.enter("referenceMarker"),t.consume(o),t.exit("referenceMarker"),t.exit("reference"),l):a(o)}}const Nj={name:"labelStartImage",resolveAll:Qf.resolveAll,tokenize:jj};function jj(t,l,a){const i=this;return u;function u(m){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(m),t.exit("labelImageMarker"),o}function o(m){return m===91?(t.enter("labelMarker"),t.consume(m),t.exit("labelMarker"),t.exit("labelImage"),c):a(m)}function c(m){return m===94&&"_hiddenFootnoteSupport"in i.parser.constructs?a(m):l(m)}}const Cj={name:"labelStartLink",resolveAll:Qf.resolveAll,tokenize:kj};function kj(t,l,a){const i=this;return u;function u(c){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(c),t.exit("labelMarker"),t.exit("labelLink"),o}function o(c){return c===94&&"_hiddenFootnoteSupport"in i.parser.constructs?a(c):l(c)}}const Oc={name:"lineEnding",tokenize:Ej};function Ej(t,l){return a;function a(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),Me(t,l,"linePrefix")}}const Fs={name:"thematicBreak",tokenize:Tj};function Tj(t,l,a){let i=0,u;return o;function o(g){return t.enter("thematicBreak"),c(g)}function c(g){return u=g,m(g)}function m(g){return g===u?(t.enter("thematicBreakSequence"),p(g)):i>=3&&(g===null||he(g))?(t.exit("thematicBreak"),l(g)):a(g)}function p(g){return g===u?(t.consume(g),i++,p):(t.exit("thematicBreakSequence"),Ce(g)?Me(t,m,"whitespace")(g):m(g))}}const Lt={continuation:{tokenize:zj},exit:_j,name:"list",tokenize:Mj},Aj={partial:!0,tokenize:Dj},Rj={partial:!0,tokenize:Oj};function Mj(t,l,a){const i=this,u=i.events[i.events.length-1];let o=u&&u[1].type==="linePrefix"?u[2].sliceSerialize(u[1],!0).length:0,c=0;return m;function m(S){const N=i.containerState.type||(S===42||S===43||S===45?"listUnordered":"listOrdered");if(N==="listUnordered"?!i.containerState.marker||S===i.containerState.marker:cf(S)){if(i.containerState.type||(i.containerState.type=N,t.enter(N,{_container:!0})),N==="listUnordered")return t.enter("listItemPrefix"),S===42||S===45?t.check(Fs,a,g)(S):g(S);if(!i.interrupt||S===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),p(S)}return a(S)}function p(S){return cf(S)&&++c<10?(t.consume(S),p):(!i.interrupt||c<2)&&(i.containerState.marker?S===i.containerState.marker:S===41||S===46)?(t.exit("listItemValue"),g(S)):a(S)}function g(S){return t.enter("listItemMarker"),t.consume(S),t.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||S,t.check(di,i.interrupt?a:y,t.attempt(Aj,v,x))}function y(S){return i.containerState.initialBlankLine=!0,o++,v(S)}function x(S){return Ce(S)?(t.enter("listItemPrefixWhitespace"),t.consume(S),t.exit("listItemPrefixWhitespace"),v):a(S)}function v(S){return i.containerState.size=o+i.sliceSerialize(t.exit("listItemPrefix"),!0).length,l(S)}}function zj(t,l,a){const i=this;return i.containerState._closeFlow=void 0,t.check(di,u,o);function u(m){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,Me(t,l,"listItemIndent",i.containerState.size+1)(m)}function o(m){return i.containerState.furtherBlankLines||!Ce(m)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,c(m)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,t.attempt(Rj,l,c)(m))}function c(m){return i.containerState._closeFlow=!0,i.interrupt=void 0,Me(t,t.attempt(Lt,l,a),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m)}}function Oj(t,l,a){const i=this;return Me(t,u,"listItemIndent",i.containerState.size+1);function u(o){const c=i.events[i.events.length-1];return c&&c[1].type==="listItemIndent"&&c[2].sliceSerialize(c[1],!0).length===i.containerState.size?l(o):a(o)}}function _j(t){t.exit(this.containerState.type)}function Dj(t,l,a){const i=this;return Me(t,u,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function u(o){const c=i.events[i.events.length-1];return!Ce(o)&&c&&c[1].type==="listItemPrefixWhitespace"?l(o):a(o)}}const Vg={name:"setextUnderline",resolveTo:Lj,tokenize:Uj};function Lj(t,l){let a=t.length,i,u,o;for(;a--;)if(t[a][0]==="enter"){if(t[a][1].type==="content"){i=a;break}t[a][1].type==="paragraph"&&(u=a)}else t[a][1].type==="content"&&t.splice(a,1),!o&&t[a][1].type==="definition"&&(o=a);const c={type:"setextHeading",start:{...t[i][1].start},end:{...t[t.length-1][1].end}};return t[u][1].type="setextHeadingText",o?(t.splice(u,0,["enter",c,l]),t.splice(o+1,0,["exit",t[i][1],l]),t[i][1].end={...t[o][1].end}):t[i][1]=c,t.push(["exit",c,l]),t}function Uj(t,l,a){const i=this;let u;return o;function o(g){let y=i.events.length,x;for(;y--;)if(i.events[y][1].type!=="lineEnding"&&i.events[y][1].type!=="linePrefix"&&i.events[y][1].type!=="content"){x=i.events[y][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||x)?(t.enter("setextHeadingLine"),u=g,c(g)):a(g)}function c(g){return t.enter("setextHeadingLineSequence"),m(g)}function m(g){return g===u?(t.consume(g),m):(t.exit("setextHeadingLineSequence"),Ce(g)?Me(t,p,"lineSuffix")(g):p(g))}function p(g){return g===null||he(g)?(t.exit("setextHeadingLine"),l(g)):a(g)}}const qj={tokenize:Bj};function Bj(t){const l=this,a=t.attempt(di,i,t.attempt(this.parser.constructs.flowInitial,u,Me(t,t.attempt(this.parser.constructs.flow,u,t.attempt(GN,u)),"linePrefix")));return a;function i(o){if(o===null){t.consume(o);return}return t.enter("lineEndingBlank"),t.consume(o),t.exit("lineEndingBlank"),l.currentConstruct=void 0,a}function u(o){if(o===null){t.consume(o);return}return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),l.currentConstruct=void 0,a}}const Hj={resolveAll:jx()},Fj=Nx("string"),Qj=Nx("text");function Nx(t){return{resolveAll:jx(t==="text"?Yj:void 0),tokenize:l};function l(a){const i=this,u=this.parser.constructs[t],o=a.attempt(u,c,m);return c;function c(y){return g(y)?o(y):m(y)}function m(y){if(y===null){a.consume(y);return}return a.enter("data"),a.consume(y),p}function p(y){return g(y)?(a.exit("data"),o(y)):(a.consume(y),p)}function g(y){if(y===null)return!0;const x=u[y];let v=-1;if(x)for(;++v<x.length;){const S=x[v];if(!S.previous||S.previous.call(i,i.previous))return!0}return!1}}}function jx(t){return l;function l(a,i){let u=-1,o;for(;++u<=a.length;)o===void 0?a[u]&&a[u][1].type==="data"&&(o=u,u++):(!a[u]||a[u][1].type!=="data")&&(u!==o+2&&(a[o][1].end=a[u-1][1].end,a.splice(o+2,u-o-2),u=o+2),o=void 0);return t?t(a,i):a}}function Yj(t,l){let a=0;for(;++a<=t.length;)if((a===t.length||t[a][1].type==="lineEnding")&&t[a-1][1].type==="data"){const i=t[a-1][1],u=l.sliceStream(i);let o=u.length,c=-1,m=0,p;for(;o--;){const g=u[o];if(typeof g=="string"){for(c=g.length;g.charCodeAt(c-1)===32;)m++,c--;if(c)break;c=-1}else if(g===-2)p=!0,m++;else if(g!==-1){o++;break}}if(l._contentTypeTextTrailing&&a===t.length&&(m=0),m){const g={type:a===t.length||p||m<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?c:i.start._bufferIndex+c,_index:i.start._index+o,line:i.end.line,column:i.end.column-m,offset:i.end.offset-m},end:{...i.end}};i.end={...g.start},i.start.offset===i.end.offset?Object.assign(i,g):(t.splice(a,0,["enter",g,l],["exit",g,l]),a+=2)}a++}return t}const Gj={42:Lt,43:Lt,45:Lt,48:Lt,49:Lt,50:Lt,51:Lt,52:Lt,53:Lt,54:Lt,55:Lt,56:Lt,57:Lt,62:gx},Vj={91:$N},Kj={[-2]:zc,[-1]:zc,32:zc},Ij={35:tj,42:Fs,45:[Vg,Fs],60:aj,61:Vg,95:Fs,96:Yg,126:Yg},Xj={38:yx,92:xx},$j={[-5]:Oc,[-4]:Oc,[-3]:Oc,33:Nj,38:yx,42:ff,60:[CN,dj],91:Cj,92:[WN,xx],93:Qf,95:ff,96:qN},Zj={null:[ff,Hj]},Jj={null:[42,95]},Pj={null:[]},Wj=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Jj,contentInitial:Vj,disable:Pj,document:Gj,flow:Ij,flowInitial:Kj,insideSpan:Zj,string:Xj,text:$j},Symbol.toStringTag,{value:"Module"}));function eC(t,l,a){let i={_bufferIndex:-1,_index:0,line:a&&a.line||1,column:a&&a.column||1,offset:a&&a.offset||0};const u={},o=[];let c=[],m=[];const p={attempt:K(V),check:K(q),consume:M,enter:D,exit:F,interrupt:K(q,{interrupt:!0})},g={code:null,containerState:{},defineSkip:E,events:[],now:N,parser:t,previous:null,sliceSerialize:v,sliceStream:S,write:x};let y=l.tokenize.call(g,p);return l.resolveAll&&o.push(l),g;function x(P){return c=on(c,P),k(),c[c.length-1]!==null?[]:(ne(l,0),g.events=eu(o,g.events,g),g.events)}function v(P,H){return nC(S(P),H)}function S(P){return tC(c,P)}function N(){const{_bufferIndex:P,_index:H,line:ie,column:re,offset:te}=i;return{_bufferIndex:P,_index:H,line:ie,column:re,offset:te}}function E(P){u[P.line]=P.column,T()}function k(){let P;for(;i._index<c.length;){const H=c[i._index];if(typeof H=="string")for(P=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===P&&i._bufferIndex<H.length;)C(H.charCodeAt(i._bufferIndex));else C(H)}}function C(P){y=y(P)}function M(P){he(P)?(i.line++,i.column=1,i.offset+=P===-3?2:1,T()):P!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===c[i._index].length&&(i._bufferIndex=-1,i._index++)),g.previous=P}function D(P,H){const ie=H||{};return ie.type=P,ie.start=N(),g.events.push(["enter",ie,g]),m.push(ie),ie}function F(P){const H=m.pop();return H.end=N(),g.events.push(["exit",H,g]),H}function V(P,H){ne(P,H.from)}function q(P,H){H.restore()}function K(P,H){return ie;function ie(re,te,U){let ee,L,pe,R;return Array.isArray(re)?$(re):"tokenize"in re?$([re]):O(re);function O(fe){return Ee;function Ee($e){const Be=$e!==null&&fe[$e],Zt=$e!==null&&fe.null,kn=[...Array.isArray(Be)?Be:Be?[Be]:[],...Array.isArray(Zt)?Zt:Zt?[Zt]:[]];return $(kn)($e)}}function $(fe){return ee=fe,L=0,fe.length===0?U:j(fe[L])}function j(fe){return Ee;function Ee($e){return R=le(),pe=fe,fe.partial||(g.currentConstruct=fe),fe.name&&g.parser.constructs.disable.null.includes(fe.name)?ge():fe.tokenize.call(H?Object.assign(Object.create(g),H):g,p,ue,ge)($e)}}function ue(fe){return P(pe,R),te}function ge(fe){return R.restore(),++L<ee.length?j(ee[L]):U}}}function ne(P,H){P.resolveAll&&!o.includes(P)&&o.push(P),P.resolve&&It(g.events,H,g.events.length-H,P.resolve(g.events.slice(H),g)),P.resolveTo&&(g.events=P.resolveTo(g.events,g))}function le(){const P=N(),H=g.previous,ie=g.currentConstruct,re=g.events.length,te=Array.from(m);return{from:re,restore:U};function U(){i=P,g.previous=H,g.currentConstruct=ie,g.events.length=re,m=te,T()}}function T(){i.line in u&&i.column<2&&(i.column=u[i.line],i.offset+=u[i.line]-1)}}function tC(t,l){const a=l.start._index,i=l.start._bufferIndex,u=l.end._index,o=l.end._bufferIndex;let c;if(a===u)c=[t[a].slice(i,o)];else{if(c=t.slice(a,u),i>-1){const m=c[0];typeof m=="string"?c[0]=m.slice(i):c.shift()}o>0&&c.push(t[u].slice(0,o))}return c}function nC(t,l){let a=-1;const i=[];let u;for(;++a<t.length;){const o=t[a];let c;if(typeof o=="string")c=o;else switch(o){case-5:{c="\r";break}case-4:{c=`
21
+ `;break}case-3:{c=`\r
22
+ `;break}case-2:{c=l?" ":" ";break}case-1:{if(!l&&u)continue;c=" ";break}default:c=String.fromCharCode(o)}u=o===-2,i.push(c)}return i.join("")}function lC(t){const i={constructs:mx([Wj,...(t||{}).extensions||[]]),content:u(yN),defined:[],document:u(vN),flow:u(qj),lazy:{},string:u(Fj),text:u(Qj)};return i;function u(o){return c;function c(m){return eC(i,o,m)}}}function rC(t){for(;!bx(t););return t}const Kg=/[\0\t\n\r]/g;function aC(){let t=1,l="",a=!0,i;return u;function u(o,c,m){const p=[];let g,y,x,v,S;for(o=l+(typeof o=="string"?o.toString():new TextDecoder(c||void 0).decode(o)),x=0,l="",a&&(o.charCodeAt(0)===65279&&x++,a=void 0);x<o.length;){if(Kg.lastIndex=x,g=Kg.exec(o),v=g&&g.index!==void 0?g.index:o.length,S=o.charCodeAt(v),!g){l=o.slice(x);break}if(S===10&&x===v&&i)p.push(-3),i=void 0;else switch(i&&(p.push(-5),i=void 0),x<v&&(p.push(o.slice(x,v)),t+=v-x),S){case 0:{p.push(65533),t++;break}case 9:{for(y=Math.ceil(t/4)*4,p.push(-2);t++<y;)p.push(-1);break}case 10:{p.push(-4),t=1;break}default:i=!0,t=1}x=v+1}return m&&(i&&p.push(-5),l&&p.push(l),p.push(null)),p}}const iC=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function sC(t){return t.replace(iC,uC)}function uC(t,l,a){if(l)return l;if(a.charCodeAt(0)===35){const u=a.charCodeAt(1),o=u===120||u===88;return px(a.slice(o?2:1),o?16:10)}return Ff(a)||t}const Cx={}.hasOwnProperty;function oC(t,l,a){return typeof l!="string"&&(a=l,l=void 0),cC(a)(rC(lC(a).document().write(aC()(t,l,!0))))}function cC(t){const l={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(er),autolinkProtocol:le,autolinkEmail:le,atxHeading:o(Pl),blockQuote:o(Zt),characterEscape:le,characterReference:le,codeFenced:o(kn),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:o(kn,c),codeText:o(Wr,c),codeTextData:le,data:le,codeFlowValue:le,definition:o(mi),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:o(En),hardBreakEscape:o(Wl),hardBreakTrailing:o(Wl),htmlFlow:o(pi,c),htmlFlowData:le,htmlText:o(pi,c),htmlTextData:le,image:o(gi),label:c,link:o(er),listItem:o(ea),listItemValue:v,listOrdered:o(tr,x),listUnordered:o(tr),paragraph:o(ru),reference:j,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:o(Pl),strong:o(au),thematicBreak:o(iu)},exit:{atxHeading:p(),atxHeadingSequence:V,autolink:p(),autolinkEmail:Be,autolinkProtocol:$e,blockQuote:p(),characterEscapeValue:T,characterReferenceMarkerHexadecimal:ge,characterReferenceMarkerNumeric:ge,characterReferenceValue:fe,characterReference:Ee,codeFenced:p(k),codeFencedFence:E,codeFencedFenceInfo:S,codeFencedFenceMeta:N,codeFlowValue:T,codeIndented:p(C),codeText:p(te),codeTextData:T,data:T,definition:p(),definitionDestinationString:F,definitionLabelString:M,definitionTitleString:D,emphasis:p(),hardBreakEscape:p(H),hardBreakTrailing:p(H),htmlFlow:p(ie),htmlFlowData:T,htmlText:p(re),htmlTextData:T,image:p(ee),label:pe,labelText:L,lineEnding:P,link:p(U),listItem:p(),listOrdered:p(),listUnordered:p(),paragraph:p(),referenceString:ue,resourceDestinationString:R,resourceTitleString:O,resource:$,setextHeading:p(ne),setextHeadingLineSequence:K,setextHeadingText:q,strong:p(),thematicBreak:p()}};kx(l,(t||{}).mdastExtensions||[]);const a={};return i;function i(Z){let se={type:"root",children:[]};const xe={stack:[se],tokenStack:[],config:l,enter:m,exit:g,buffer:c,resume:y,data:a},we=[];let Le=-1;for(;++Le<Z.length;)if(Z[Le][1].type==="listOrdered"||Z[Le][1].type==="listUnordered")if(Z[Le][0]==="enter")we.push(Le);else{const qt=we.pop();Le=u(Z,qt,Le)}for(Le=-1;++Le<Z.length;){const qt=l[Z[Le][0]];Cx.call(qt,Z[Le][1].type)&&qt[Z[Le][1].type].call(Object.assign({sliceSerialize:Z[Le][2].sliceSerialize},xe),Z[Le][1])}if(xe.tokenStack.length>0){const qt=xe.tokenStack[xe.tokenStack.length-1];(qt[1]||Ig).call(xe,void 0,qt[0])}for(se.position={start:Sl(Z.length>0?Z[0][1].start:{line:1,column:1,offset:0}),end:Sl(Z.length>0?Z[Z.length-2][1].end:{line:1,column:1,offset:0})},Le=-1;++Le<l.transforms.length;)se=l.transforms[Le](se)||se;return se}function u(Z,se,xe){let we=se-1,Le=-1,qt=!1,Tn,jt,ut,Tt;for(;++we<=xe;){const Ye=Z[we];switch(Ye[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ye[0]==="enter"?Le++:Le--,Tt=void 0;break}case"lineEndingBlank":{Ye[0]==="enter"&&(Tn&&!Tt&&!Le&&!ut&&(ut=we),Tt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Tt=void 0}if(!Le&&Ye[0]==="enter"&&Ye[1].type==="listItemPrefix"||Le===-1&&Ye[0]==="exit"&&(Ye[1].type==="listUnordered"||Ye[1].type==="listOrdered")){if(Tn){let Zn=we;for(jt=void 0;Zn--;){const cn=Z[Zn];if(cn[1].type==="lineEnding"||cn[1].type==="lineEndingBlank"){if(cn[0]==="exit")continue;jt&&(Z[jt][1].type="lineEndingBlank",qt=!0),cn[1].type="lineEnding",jt=Zn}else if(!(cn[1].type==="linePrefix"||cn[1].type==="blockQuotePrefix"||cn[1].type==="blockQuotePrefixWhitespace"||cn[1].type==="blockQuoteMarker"||cn[1].type==="listItemIndent"))break}ut&&(!jt||ut<jt)&&(Tn._spread=!0),Tn.end=Object.assign({},jt?Z[jt][1].start:Ye[1].end),Z.splice(jt||we,0,["exit",Tn,Ye[2]]),we++,xe++}if(Ye[1].type==="listItemPrefix"){const Zn={type:"listItem",_spread:!1,start:Object.assign({},Ye[1].start),end:void 0};Tn=Zn,Z.splice(we,0,["enter",Zn,Ye[2]]),we++,xe++,ut=void 0,Tt=!0}}}return Z[se][1]._spread=qt,xe}function o(Z,se){return xe;function xe(we){m.call(this,Z(we),we),se&&se.call(this,we)}}function c(){this.stack.push({type:"fragment",children:[]})}function m(Z,se,xe){this.stack[this.stack.length-1].children.push(Z),this.stack.push(Z),this.tokenStack.push([se,xe||void 0]),Z.position={start:Sl(se.start),end:void 0}}function p(Z){return se;function se(xe){Z&&Z.call(this,xe),g.call(this,xe)}}function g(Z,se){const xe=this.stack.pop(),we=this.tokenStack.pop();if(we)we[0].type!==Z.type&&(se?se.call(this,Z,we[0]):(we[1]||Ig).call(this,Z,we[0]));else throw new Error("Cannot close `"+Z.type+"` ("+ei({start:Z.start,end:Z.end})+"): it’s not open");xe.position.end=Sl(Z.end)}function y(){return Hf(this.stack.pop())}function x(){this.data.expectingFirstListItemValue=!0}function v(Z){if(this.data.expectingFirstListItemValue){const se=this.stack[this.stack.length-2];se.start=Number.parseInt(this.sliceSerialize(Z),10),this.data.expectingFirstListItemValue=void 0}}function S(){const Z=this.resume(),se=this.stack[this.stack.length-1];se.lang=Z}function N(){const Z=this.resume(),se=this.stack[this.stack.length-1];se.meta=Z}function E(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function k(){const Z=this.resume(),se=this.stack[this.stack.length-1];se.value=Z.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function C(){const Z=this.resume(),se=this.stack[this.stack.length-1];se.value=Z.replace(/(\r?\n|\r)$/g,"")}function M(Z){const se=this.resume(),xe=this.stack[this.stack.length-1];xe.label=se,xe.identifier=mn(this.sliceSerialize(Z)).toLowerCase()}function D(){const Z=this.resume(),se=this.stack[this.stack.length-1];se.title=Z}function F(){const Z=this.resume(),se=this.stack[this.stack.length-1];se.url=Z}function V(Z){const se=this.stack[this.stack.length-1];if(!se.depth){const xe=this.sliceSerialize(Z).length;se.depth=xe}}function q(){this.data.setextHeadingSlurpLineEnding=!0}function K(Z){const se=this.stack[this.stack.length-1];se.depth=this.sliceSerialize(Z).codePointAt(0)===61?1:2}function ne(){this.data.setextHeadingSlurpLineEnding=void 0}function le(Z){const xe=this.stack[this.stack.length-1].children;let we=xe[xe.length-1];(!we||we.type!=="text")&&(we=Nt(),we.position={start:Sl(Z.start),end:void 0},xe.push(we)),this.stack.push(we)}function T(Z){const se=this.stack.pop();se.value+=this.sliceSerialize(Z),se.position.end=Sl(Z.end)}function P(Z){const se=this.stack[this.stack.length-1];if(this.data.atHardBreak){const xe=se.children[se.children.length-1];xe.position.end=Sl(Z.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&l.canContainEols.includes(se.type)&&(le.call(this,Z),T.call(this,Z))}function H(){this.data.atHardBreak=!0}function ie(){const Z=this.resume(),se=this.stack[this.stack.length-1];se.value=Z}function re(){const Z=this.resume(),se=this.stack[this.stack.length-1];se.value=Z}function te(){const Z=this.resume(),se=this.stack[this.stack.length-1];se.value=Z}function U(){const Z=this.stack[this.stack.length-1];if(this.data.inReference){const se=this.data.referenceType||"shortcut";Z.type+="Reference",Z.referenceType=se,delete Z.url,delete Z.title}else delete Z.identifier,delete Z.label;this.data.referenceType=void 0}function ee(){const Z=this.stack[this.stack.length-1];if(this.data.inReference){const se=this.data.referenceType||"shortcut";Z.type+="Reference",Z.referenceType=se,delete Z.url,delete Z.title}else delete Z.identifier,delete Z.label;this.data.referenceType=void 0}function L(Z){const se=this.sliceSerialize(Z),xe=this.stack[this.stack.length-2];xe.label=sC(se),xe.identifier=mn(se).toLowerCase()}function pe(){const Z=this.stack[this.stack.length-1],se=this.resume(),xe=this.stack[this.stack.length-1];if(this.data.inReference=!0,xe.type==="link"){const we=Z.children;xe.children=we}else xe.alt=se}function R(){const Z=this.resume(),se=this.stack[this.stack.length-1];se.url=Z}function O(){const Z=this.resume(),se=this.stack[this.stack.length-1];se.title=Z}function $(){this.data.inReference=void 0}function j(){this.data.referenceType="collapsed"}function ue(Z){const se=this.resume(),xe=this.stack[this.stack.length-1];xe.label=se,xe.identifier=mn(this.sliceSerialize(Z)).toLowerCase(),this.data.referenceType="full"}function ge(Z){this.data.characterReferenceType=Z.type}function fe(Z){const se=this.sliceSerialize(Z),xe=this.data.characterReferenceType;let we;xe?(we=px(se,xe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):we=Ff(se);const Le=this.stack[this.stack.length-1];Le.value+=we}function Ee(Z){const se=this.stack.pop();se.position.end=Sl(Z.end)}function $e(Z){T.call(this,Z);const se=this.stack[this.stack.length-1];se.url=this.sliceSerialize(Z)}function Be(Z){T.call(this,Z);const se=this.stack[this.stack.length-1];se.url="mailto:"+this.sliceSerialize(Z)}function Zt(){return{type:"blockquote",children:[]}}function kn(){return{type:"code",lang:null,meta:null,value:""}}function Wr(){return{type:"inlineCode",value:""}}function mi(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function En(){return{type:"emphasis",children:[]}}function Pl(){return{type:"heading",depth:0,children:[]}}function Wl(){return{type:"break"}}function pi(){return{type:"html",value:""}}function gi(){return{type:"image",title:null,url:"",alt:null}}function er(){return{type:"link",title:null,url:"",children:[]}}function tr(Z){return{type:"list",ordered:Z.type==="listOrdered",start:null,spread:Z._spread,children:[]}}function ea(Z){return{type:"listItem",spread:Z._spread,checked:null,children:[]}}function ru(){return{type:"paragraph",children:[]}}function au(){return{type:"strong",children:[]}}function Nt(){return{type:"text",value:""}}function iu(){return{type:"thematicBreak"}}}function Sl(t){return{line:t.line,column:t.column,offset:t.offset}}function kx(t,l){let a=-1;for(;++a<l.length;){const i=l[a];Array.isArray(i)?kx(t,i):fC(t,i)}}function fC(t,l){let a;for(a in l)if(Cx.call(l,a))switch(a){case"canContainEols":{const i=l[a];i&&t[a].push(...i);break}case"transforms":{const i=l[a];i&&t[a].push(...i);break}case"enter":case"exit":{const i=l[a];i&&Object.assign(t[a],i);break}}}function Ig(t,l){throw t?new Error("Cannot close `"+t.type+"` ("+ei({start:t.start,end:t.end})+"): a different token (`"+l.type+"`, "+ei({start:l.start,end:l.end})+") is open"):new Error("Cannot close document, a token (`"+l.type+"`, "+ei({start:l.start,end:l.end})+") is still open")}function dC(t){const l=this;l.parser=a;function a(i){return oC(i,{...l.data("settings"),...t,extensions:l.data("micromarkExtensions")||[],mdastExtensions:l.data("fromMarkdownExtensions")||[]})}}function hC(t,l){const a={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(l),!0)};return t.patch(l,a),t.applyData(l,a)}function mC(t,l){const a={type:"element",tagName:"br",properties:{},children:[]};return t.patch(l,a),[t.applyData(l,a),{type:"text",value:`
23
+ `}]}function pC(t,l){const a=l.value?l.value+`
24
+ `:"",i={},u=l.lang?l.lang.split(/\s+/):[];u.length>0&&(i.className=["language-"+u[0]]);let o={type:"element",tagName:"code",properties:i,children:[{type:"text",value:a}]};return l.meta&&(o.data={meta:l.meta}),t.patch(l,o),o=t.applyData(l,o),o={type:"element",tagName:"pre",properties:{},children:[o]},t.patch(l,o),o}function gC(t,l){const a={type:"element",tagName:"del",properties:{},children:t.all(l)};return t.patch(l,a),t.applyData(l,a)}function xC(t,l){const a={type:"element",tagName:"em",properties:{},children:t.all(l)};return t.patch(l,a),t.applyData(l,a)}function yC(t,l){const a=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",i=String(l.identifier).toUpperCase(),u=Pr(i.toLowerCase()),o=t.footnoteOrder.indexOf(i);let c,m=t.footnoteCounts.get(i);m===void 0?(m=0,t.footnoteOrder.push(i),c=t.footnoteOrder.length):c=o+1,m+=1,t.footnoteCounts.set(i,m);const p={type:"element",tagName:"a",properties:{href:"#"+a+"fn-"+u,id:a+"fnref-"+u+(m>1?"-"+m:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(c)}]};t.patch(l,p);const g={type:"element",tagName:"sup",properties:{},children:[p]};return t.patch(l,g),t.applyData(l,g)}function bC(t,l){const a={type:"element",tagName:"h"+l.depth,properties:{},children:t.all(l)};return t.patch(l,a),t.applyData(l,a)}function vC(t,l){if(t.options.allowDangerousHtml){const a={type:"raw",value:l.value};return t.patch(l,a),t.applyData(l,a)}}function Ex(t,l){const a=l.referenceType;let i="]";if(a==="collapsed"?i+="[]":a==="full"&&(i+="["+(l.label||l.identifier)+"]"),l.type==="imageReference")return[{type:"text",value:"!["+l.alt+i}];const u=t.all(l),o=u[0];o&&o.type==="text"?o.value="["+o.value:u.unshift({type:"text",value:"["});const c=u[u.length-1];return c&&c.type==="text"?c.value+=i:u.push({type:"text",value:i}),u}function SC(t,l){const a=String(l.identifier).toUpperCase(),i=t.definitionById.get(a);if(!i)return Ex(t,l);const u={src:Pr(i.url||""),alt:l.alt};i.title!==null&&i.title!==void 0&&(u.title=i.title);const o={type:"element",tagName:"img",properties:u,children:[]};return t.patch(l,o),t.applyData(l,o)}function wC(t,l){const a={src:Pr(l.url)};l.alt!==null&&l.alt!==void 0&&(a.alt=l.alt),l.title!==null&&l.title!==void 0&&(a.title=l.title);const i={type:"element",tagName:"img",properties:a,children:[]};return t.patch(l,i),t.applyData(l,i)}function NC(t,l){const a={type:"text",value:l.value.replace(/\r?\n|\r/g," ")};t.patch(l,a);const i={type:"element",tagName:"code",properties:{},children:[a]};return t.patch(l,i),t.applyData(l,i)}function jC(t,l){const a=String(l.identifier).toUpperCase(),i=t.definitionById.get(a);if(!i)return Ex(t,l);const u={href:Pr(i.url||"")};i.title!==null&&i.title!==void 0&&(u.title=i.title);const o={type:"element",tagName:"a",properties:u,children:t.all(l)};return t.patch(l,o),t.applyData(l,o)}function CC(t,l){const a={href:Pr(l.url)};l.title!==null&&l.title!==void 0&&(a.title=l.title);const i={type:"element",tagName:"a",properties:a,children:t.all(l)};return t.patch(l,i),t.applyData(l,i)}function kC(t,l,a){const i=t.all(l),u=a?EC(a):Tx(l),o={},c=[];if(typeof l.checked=="boolean"){const y=i[0];let x;y&&y.type==="element"&&y.tagName==="p"?x=y:(x={type:"element",tagName:"p",properties:{},children:[]},i.unshift(x)),x.children.length>0&&x.children.unshift({type:"text",value:" "}),x.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:l.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let m=-1;for(;++m<i.length;){const y=i[m];(u||m!==0||y.type!=="element"||y.tagName!=="p")&&c.push({type:"text",value:`
25
+ `}),y.type==="element"&&y.tagName==="p"&&!u?c.push(...y.children):c.push(y)}const p=i[i.length-1];p&&(u||p.type!=="element"||p.tagName!=="p")&&c.push({type:"text",value:`
26
+ `});const g={type:"element",tagName:"li",properties:o,children:c};return t.patch(l,g),t.applyData(l,g)}function EC(t){let l=!1;if(t.type==="list"){l=t.spread||!1;const a=t.children;let i=-1;for(;!l&&++i<a.length;)l=Tx(a[i])}return l}function Tx(t){const l=t.spread;return l??t.children.length>1}function TC(t,l){const a={},i=t.all(l);let u=-1;for(typeof l.start=="number"&&l.start!==1&&(a.start=l.start);++u<i.length;){const c=i[u];if(c.type==="element"&&c.tagName==="li"&&c.properties&&Array.isArray(c.properties.className)&&c.properties.className.includes("task-list-item")){a.className=["contains-task-list"];break}}const o={type:"element",tagName:l.ordered?"ol":"ul",properties:a,children:t.wrap(i,!0)};return t.patch(l,o),t.applyData(l,o)}function AC(t,l){const a={type:"element",tagName:"p",properties:{},children:t.all(l)};return t.patch(l,a),t.applyData(l,a)}function RC(t,l){const a={type:"root",children:t.wrap(t.all(l))};return t.patch(l,a),t.applyData(l,a)}function MC(t,l){const a={type:"element",tagName:"strong",properties:{},children:t.all(l)};return t.patch(l,a),t.applyData(l,a)}function zC(t,l){const a=t.all(l),i=a.shift(),u=[];if(i){const c={type:"element",tagName:"thead",properties:{},children:t.wrap([i],!0)};t.patch(l.children[0],c),u.push(c)}if(a.length>0){const c={type:"element",tagName:"tbody",properties:{},children:t.wrap(a,!0)},m=Lf(l.children[1]),p=sx(l.children[l.children.length-1]);m&&p&&(c.position={start:m,end:p}),u.push(c)}const o={type:"element",tagName:"table",properties:{},children:t.wrap(u,!0)};return t.patch(l,o),t.applyData(l,o)}function OC(t,l,a){const i=a?a.children:void 0,o=(i?i.indexOf(l):1)===0?"th":"td",c=a&&a.type==="table"?a.align:void 0,m=c?c.length:l.children.length;let p=-1;const g=[];for(;++p<m;){const x=l.children[p],v={},S=c?c[p]:void 0;S&&(v.align=S);let N={type:"element",tagName:o,properties:v,children:[]};x&&(N.children=t.all(x),t.patch(x,N),N=t.applyData(x,N)),g.push(N)}const y={type:"element",tagName:"tr",properties:{},children:t.wrap(g,!0)};return t.patch(l,y),t.applyData(l,y)}function _C(t,l){const a={type:"element",tagName:"td",properties:{},children:t.all(l)};return t.patch(l,a),t.applyData(l,a)}const Xg=9,$g=32;function DC(t){const l=String(t),a=/\r?\n|\r/g;let i=a.exec(l),u=0;const o=[];for(;i;)o.push(Zg(l.slice(u,i.index),u>0,!0),i[0]),u=i.index+i[0].length,i=a.exec(l);return o.push(Zg(l.slice(u),u>0,!1)),o.join("")}function Zg(t,l,a){let i=0,u=t.length;if(l){let o=t.codePointAt(i);for(;o===Xg||o===$g;)i++,o=t.codePointAt(i)}if(a){let o=t.codePointAt(u-1);for(;o===Xg||o===$g;)u--,o=t.codePointAt(u-1)}return u>i?t.slice(i,u):""}function LC(t,l){const a={type:"text",value:DC(String(l.value))};return t.patch(l,a),t.applyData(l,a)}function UC(t,l){const a={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(l,a),t.applyData(l,a)}const qC={blockquote:hC,break:mC,code:pC,delete:gC,emphasis:xC,footnoteReference:yC,heading:bC,html:vC,imageReference:SC,image:wC,inlineCode:NC,linkReference:jC,link:CC,listItem:kC,list:TC,paragraph:AC,root:RC,strong:MC,table:zC,tableCell:_C,tableRow:OC,text:LC,thematicBreak:UC,toml:Ds,yaml:Ds,definition:Ds,footnoteDefinition:Ds};function Ds(){}const Ax=-1,tu=0,ni=1,Xs=2,Yf=3,Gf=4,Vf=5,Kf=6,Rx=7,Mx=8,Jg=typeof self=="object"?self:globalThis,BC=(t,l)=>{const a=(u,o)=>(t.set(o,u),u),i=u=>{if(t.has(u))return t.get(u);const[o,c]=l[u];switch(o){case tu:case Ax:return a(c,u);case ni:{const m=a([],u);for(const p of c)m.push(i(p));return m}case Xs:{const m=a({},u);for(const[p,g]of c)m[i(p)]=i(g);return m}case Yf:return a(new Date(c),u);case Gf:{const{source:m,flags:p}=c;return a(new RegExp(m,p),u)}case Vf:{const m=a(new Map,u);for(const[p,g]of c)m.set(i(p),i(g));return m}case Kf:{const m=a(new Set,u);for(const p of c)m.add(i(p));return m}case Rx:{const{name:m,message:p}=c;return a(new Jg[m](p),u)}case Mx:return a(BigInt(c),u);case"BigInt":return a(Object(BigInt(c)),u);case"ArrayBuffer":return a(new Uint8Array(c).buffer,c);case"DataView":{const{buffer:m}=new Uint8Array(c);return a(new DataView(m),c)}}return a(new Jg[o](c),u)};return i},Pg=t=>BC(new Map,t)(0),Fr="",{toString:HC}={},{keys:FC}=Object,Pa=t=>{const l=typeof t;if(l!=="object"||!t)return[tu,l];const a=HC.call(t).slice(8,-1);switch(a){case"Array":return[ni,Fr];case"Object":return[Xs,Fr];case"Date":return[Yf,Fr];case"RegExp":return[Gf,Fr];case"Map":return[Vf,Fr];case"Set":return[Kf,Fr];case"DataView":return[ni,a]}return a.includes("Array")?[ni,a]:a.includes("Error")?[Rx,a]:[Xs,a]},Ls=([t,l])=>t===tu&&(l==="function"||l==="symbol"),QC=(t,l,a,i)=>{const u=(c,m)=>{const p=i.push(c)-1;return a.set(m,p),p},o=c=>{if(a.has(c))return a.get(c);let[m,p]=Pa(c);switch(m){case tu:{let y=c;switch(p){case"bigint":m=Mx,y=c.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+p);y=null;break;case"undefined":return u([Ax],c)}return u([m,y],c)}case ni:{if(p){let v=c;return p==="DataView"?v=new Uint8Array(c.buffer):p==="ArrayBuffer"&&(v=new Uint8Array(c)),u([p,[...v]],c)}const y=[],x=u([m,y],c);for(const v of c)y.push(o(v));return x}case Xs:{if(p)switch(p){case"BigInt":return u([p,c.toString()],c);case"Boolean":case"Number":case"String":return u([p,c.valueOf()],c)}if(l&&"toJSON"in c)return o(c.toJSON());const y=[],x=u([m,y],c);for(const v of FC(c))(t||!Ls(Pa(c[v])))&&y.push([o(v),o(c[v])]);return x}case Yf:return u([m,c.toISOString()],c);case Gf:{const{source:y,flags:x}=c;return u([m,{source:y,flags:x}],c)}case Vf:{const y=[],x=u([m,y],c);for(const[v,S]of c)(t||!(Ls(Pa(v))||Ls(Pa(S))))&&y.push([o(v),o(S)]);return x}case Kf:{const y=[],x=u([m,y],c);for(const v of c)(t||!Ls(Pa(v)))&&y.push(o(v));return x}}const{message:g}=c;return u([m,{name:p,message:g}],c)};return o},Wg=(t,{json:l,lossy:a}={})=>{const i=[];return QC(!(l||a),!!l,new Map,i)(t),i},$s=typeof structuredClone=="function"?(t,l)=>l&&("json"in l||"lossy"in l)?Pg(Wg(t,l)):structuredClone(t):(t,l)=>Pg(Wg(t,l));function YC(t,l){const a=[{type:"text",value:"↩"}];return l>1&&a.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(l)}]}),a}function GC(t,l){return"Back to reference "+(t+1)+(l>1?"-"+l:"")}function VC(t){const l=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",a=t.options.footnoteBackContent||YC,i=t.options.footnoteBackLabel||GC,u=t.options.footnoteLabel||"Footnotes",o=t.options.footnoteLabelTagName||"h2",c=t.options.footnoteLabelProperties||{className:["sr-only"]},m=[];let p=-1;for(;++p<t.footnoteOrder.length;){const g=t.footnoteById.get(t.footnoteOrder[p]);if(!g)continue;const y=t.all(g),x=String(g.identifier).toUpperCase(),v=Pr(x.toLowerCase());let S=0;const N=[],E=t.footnoteCounts.get(x);for(;E!==void 0&&++S<=E;){N.length>0&&N.push({type:"text",value:" "});let M=typeof a=="string"?a:a(p,S);typeof M=="string"&&(M={type:"text",value:M}),N.push({type:"element",tagName:"a",properties:{href:"#"+l+"fnref-"+v+(S>1?"-"+S:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(p,S),className:["data-footnote-backref"]},children:Array.isArray(M)?M:[M]})}const k=y[y.length-1];if(k&&k.type==="element"&&k.tagName==="p"){const M=k.children[k.children.length-1];M&&M.type==="text"?M.value+=" ":k.children.push({type:"text",value:" "}),k.children.push(...N)}else y.push(...N);const C={type:"element",tagName:"li",properties:{id:l+"fn-"+v},children:t.wrap(y,!0)};t.patch(g,C),m.push(C)}if(m.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...$s(c),id:"footnote-label"},children:[{type:"text",value:u}]},{type:"text",value:`
27
+ `},{type:"element",tagName:"ol",properties:{},children:t.wrap(m,!0)},{type:"text",value:`
28
+ `}]}}const nu=(function(t){if(t==null)return $C;if(typeof t=="function")return lu(t);if(typeof t=="object")return Array.isArray(t)?KC(t):IC(t);if(typeof t=="string")return XC(t);throw new Error("Expected function, string, or object as test")});function KC(t){const l=[];let a=-1;for(;++a<t.length;)l[a]=nu(t[a]);return lu(i);function i(...u){let o=-1;for(;++o<l.length;)if(l[o].apply(this,u))return!0;return!1}}function IC(t){const l=t;return lu(a);function a(i){const u=i;let o;for(o in t)if(u[o]!==l[o])return!1;return!0}}function XC(t){return lu(l);function l(a){return a&&a.type===t}}function lu(t){return l;function l(a,i,u){return!!(ZC(a)&&t.call(this,a,typeof i=="number"?i:void 0,u||void 0))}}function $C(){return!0}function ZC(t){return t!==null&&typeof t=="object"&&"type"in t}const zx=[],JC=!0,df=!1,PC="skip";function Ox(t,l,a,i){let u;typeof l=="function"&&typeof a!="function"?(i=a,a=l):u=l;const o=nu(u),c=i?-1:1;m(t,void 0,[])();function m(p,g,y){const x=p&&typeof p=="object"?p:{};if(typeof x.type=="string"){const S=typeof x.tagName=="string"?x.tagName:typeof x.name=="string"?x.name:void 0;Object.defineProperty(v,"name",{value:"node ("+(p.type+(S?"<"+S+">":""))+")"})}return v;function v(){let S=zx,N,E,k;if((!l||o(p,g,y[y.length-1]||void 0))&&(S=WC(a(p,y)),S[0]===df))return S;if("children"in p&&p.children){const C=p;if(C.children&&S[0]!==PC)for(E=(i?C.children.length:-1)+c,k=y.concat(C);E>-1&&E<C.children.length;){const M=C.children[E];if(N=m(M,E,k)(),N[0]===df)return N;E=typeof N[1]=="number"?N[1]:E+c}}return S}}}function WC(t){return Array.isArray(t)?t:typeof t=="number"?[JC,t]:t==null?zx:[t]}function If(t,l,a,i){let u,o,c;typeof l=="function"&&typeof a!="function"?(o=void 0,c=l,u=a):(o=l,c=a,u=i),Ox(t,o,m,u);function m(p,g){const y=g[g.length-1],x=y?y.children.indexOf(p):void 0;return c(p,x,y)}}const hf={}.hasOwnProperty,e5={};function t5(t,l){const a=l||e5,i=new Map,u=new Map,o=new Map,c={...qC,...a.handlers},m={all:g,applyData:l5,definitionById:i,footnoteById:u,footnoteCounts:o,footnoteOrder:[],handlers:c,one:p,options:a,patch:n5,wrap:a5};return If(t,function(y){if(y.type==="definition"||y.type==="footnoteDefinition"){const x=y.type==="definition"?i:u,v=String(y.identifier).toUpperCase();x.has(v)||x.set(v,y)}}),m;function p(y,x){const v=y.type,S=m.handlers[v];if(hf.call(m.handlers,v)&&S)return S(m,y,x);if(m.options.passThrough&&m.options.passThrough.includes(v)){if("children"in y){const{children:E,...k}=y,C=$s(k);return C.children=m.all(y),C}return $s(y)}return(m.options.unknownHandler||r5)(m,y,x)}function g(y){const x=[];if("children"in y){const v=y.children;let S=-1;for(;++S<v.length;){const N=m.one(v[S],y);if(N){if(S&&v[S-1].type==="break"&&(!Array.isArray(N)&&N.type==="text"&&(N.value=e0(N.value)),!Array.isArray(N)&&N.type==="element")){const E=N.children[0];E&&E.type==="text"&&(E.value=e0(E.value))}Array.isArray(N)?x.push(...N):x.push(N)}}}return x}}function n5(t,l){t.position&&(l.position=Gw(t))}function l5(t,l){let a=l;if(t&&t.data){const i=t.data.hName,u=t.data.hChildren,o=t.data.hProperties;if(typeof i=="string")if(a.type==="element")a.tagName=i;else{const c="children"in a?a.children:[a];a={type:"element",tagName:i,properties:{},children:c}}a.type==="element"&&o&&Object.assign(a.properties,$s(o)),"children"in a&&a.children&&u!==null&&u!==void 0&&(a.children=u)}return a}function r5(t,l){const a=l.data||{},i="value"in l&&!(hf.call(a,"hProperties")||hf.call(a,"hChildren"))?{type:"text",value:l.value}:{type:"element",tagName:"div",properties:{},children:t.all(l)};return t.patch(l,i),t.applyData(l,i)}function a5(t,l){const a=[];let i=-1;for(l&&a.push({type:"text",value:`
29
+ `});++i<t.length;)i&&a.push({type:"text",value:`
30
+ `}),a.push(t[i]);return l&&t.length>0&&a.push({type:"text",value:`
31
+ `}),a}function e0(t){let l=0,a=t.charCodeAt(l);for(;a===9||a===32;)l++,a=t.charCodeAt(l);return t.slice(l)}function t0(t,l){const a=t5(t,l),i=a.one(t,void 0),u=VC(a),o=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return u&&o.children.push({type:"text",value:`
32
+ `},u),o}function i5(t,l){return t&&"run"in t?async function(a,i){const u=t0(a,{file:i,...l});await t.run(u,i)}:function(a,i){return t0(a,{file:i,...t||l})}}function n0(t){if(t)throw t}var _c,l0;function s5(){if(l0)return _c;l0=1;var t=Object.prototype.hasOwnProperty,l=Object.prototype.toString,a=Object.defineProperty,i=Object.getOwnPropertyDescriptor,u=function(g){return typeof Array.isArray=="function"?Array.isArray(g):l.call(g)==="[object Array]"},o=function(g){if(!g||l.call(g)!=="[object Object]")return!1;var y=t.call(g,"constructor"),x=g.constructor&&g.constructor.prototype&&t.call(g.constructor.prototype,"isPrototypeOf");if(g.constructor&&!y&&!x)return!1;var v;for(v in g);return typeof v>"u"||t.call(g,v)},c=function(g,y){a&&y.name==="__proto__"?a(g,y.name,{enumerable:!0,configurable:!0,value:y.newValue,writable:!0}):g[y.name]=y.newValue},m=function(g,y){if(y==="__proto__")if(t.call(g,y)){if(i)return i(g,y).value}else return;return g[y]};return _c=function p(){var g,y,x,v,S,N,E=arguments[0],k=1,C=arguments.length,M=!1;for(typeof E=="boolean"&&(M=E,E=arguments[1]||{},k=2),(E==null||typeof E!="object"&&typeof E!="function")&&(E={});k<C;++k)if(g=arguments[k],g!=null)for(y in g)x=m(E,y),v=m(g,y),E!==v&&(M&&v&&(o(v)||(S=u(v)))?(S?(S=!1,N=x&&u(x)?x:[]):N=x&&o(x)?x:{},c(E,{name:y,newValue:p(M,N,v)})):typeof v<"u"&&c(E,{name:y,newValue:v}));return E},_c}var u5=s5();const Dc=x0(u5);function mf(t){if(typeof t!="object"||t===null)return!1;const l=Object.getPrototypeOf(t);return(l===null||l===Object.prototype||Object.getPrototypeOf(l)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function o5(){const t=[],l={run:a,use:i};return l;function a(...u){let o=-1;const c=u.pop();if(typeof c!="function")throw new TypeError("Expected function as last argument, not "+c);m(null,...u);function m(p,...g){const y=t[++o];let x=-1;if(p){c(p);return}for(;++x<u.length;)(g[x]===null||g[x]===void 0)&&(g[x]=u[x]);u=g,y?c5(y,m)(...g):c(null,...g)}}function i(u){if(typeof u!="function")throw new TypeError("Expected `middelware` to be a function, not "+u);return t.push(u),l}}function c5(t,l){let a;return i;function i(...c){const m=t.length>c.length;let p;m&&c.push(u);try{p=t.apply(this,c)}catch(g){const y=g;if(m&&a)throw y;return u(y)}m||(p&&p.then&&typeof p.then=="function"?p.then(o,u):p instanceof Error?u(p):o(p))}function u(c,...m){a||(a=!0,l(c,...m))}function o(c){u(null,c)}}const wn={basename:f5,dirname:d5,extname:h5,join:m5,sep:"/"};function f5(t,l){if(l!==void 0&&typeof l!="string")throw new TypeError('"ext" argument must be a string');hi(t);let a=0,i=-1,u=t.length,o;if(l===void 0||l.length===0||l.length>t.length){for(;u--;)if(t.codePointAt(u)===47){if(o){a=u+1;break}}else i<0&&(o=!0,i=u+1);return i<0?"":t.slice(a,i)}if(l===t)return"";let c=-1,m=l.length-1;for(;u--;)if(t.codePointAt(u)===47){if(o){a=u+1;break}}else c<0&&(o=!0,c=u+1),m>-1&&(t.codePointAt(u)===l.codePointAt(m--)?m<0&&(i=u):(m=-1,i=c));return a===i?i=c:i<0&&(i=t.length),t.slice(a,i)}function d5(t){if(hi(t),t.length===0)return".";let l=-1,a=t.length,i;for(;--a;)if(t.codePointAt(a)===47){if(i){l=a;break}}else i||(i=!0);return l<0?t.codePointAt(0)===47?"/":".":l===1&&t.codePointAt(0)===47?"//":t.slice(0,l)}function h5(t){hi(t);let l=t.length,a=-1,i=0,u=-1,o=0,c;for(;l--;){const m=t.codePointAt(l);if(m===47){if(c){i=l+1;break}continue}a<0&&(c=!0,a=l+1),m===46?u<0?u=l:o!==1&&(o=1):u>-1&&(o=-1)}return u<0||a<0||o===0||o===1&&u===a-1&&u===i+1?"":t.slice(u,a)}function m5(...t){let l=-1,a;for(;++l<t.length;)hi(t[l]),t[l]&&(a=a===void 0?t[l]:a+"/"+t[l]);return a===void 0?".":p5(a)}function p5(t){hi(t);const l=t.codePointAt(0)===47;let a=g5(t,!l);return a.length===0&&!l&&(a="."),a.length>0&&t.codePointAt(t.length-1)===47&&(a+="/"),l?"/"+a:a}function g5(t,l){let a="",i=0,u=-1,o=0,c=-1,m,p;for(;++c<=t.length;){if(c<t.length)m=t.codePointAt(c);else{if(m===47)break;m=47}if(m===47){if(!(u===c-1||o===1))if(u!==c-1&&o===2){if(a.length<2||i!==2||a.codePointAt(a.length-1)!==46||a.codePointAt(a.length-2)!==46){if(a.length>2){if(p=a.lastIndexOf("/"),p!==a.length-1){p<0?(a="",i=0):(a=a.slice(0,p),i=a.length-1-a.lastIndexOf("/")),u=c,o=0;continue}}else if(a.length>0){a="",i=0,u=c,o=0;continue}}l&&(a=a.length>0?a+"/..":"..",i=2)}else a.length>0?a+="/"+t.slice(u+1,c):a=t.slice(u+1,c),i=c-u-1;u=c,o=0}else m===46&&o>-1?o++:o=-1}return a}function hi(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const x5={cwd:y5};function y5(){return"/"}function pf(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function b5(t){if(typeof t=="string")t=new URL(t);else if(!pf(t)){const l=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw l.code="ERR_INVALID_ARG_TYPE",l}if(t.protocol!=="file:"){const l=new TypeError("The URL must be of scheme file");throw l.code="ERR_INVALID_URL_SCHEME",l}return v5(t)}function v5(t){if(t.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const l=t.pathname;let a=-1;for(;++a<l.length;)if(l.codePointAt(a)===37&&l.codePointAt(a+1)===50){const i=l.codePointAt(a+2);if(i===70||i===102){const u=new TypeError("File URL path must not include encoded / characters");throw u.code="ERR_INVALID_FILE_URL_PATH",u}}return decodeURIComponent(l)}const Lc=["history","path","basename","stem","extname","dirname"];class _x{constructor(l){let a;l?pf(l)?a={path:l}:typeof l=="string"||S5(l)?a={value:l}:a=l:a={},this.cwd="cwd"in a?"":x5.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<Lc.length;){const o=Lc[i];o in a&&a[o]!==void 0&&a[o]!==null&&(this[o]=o==="history"?[...a[o]]:a[o])}let u;for(u in a)Lc.includes(u)||(this[u]=a[u])}get basename(){return typeof this.path=="string"?wn.basename(this.path):void 0}set basename(l){qc(l,"basename"),Uc(l,"basename"),this.path=wn.join(this.dirname||"",l)}get dirname(){return typeof this.path=="string"?wn.dirname(this.path):void 0}set dirname(l){r0(this.basename,"dirname"),this.path=wn.join(l||"",this.basename)}get extname(){return typeof this.path=="string"?wn.extname(this.path):void 0}set extname(l){if(Uc(l,"extname"),r0(this.dirname,"extname"),l){if(l.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(l.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=wn.join(this.dirname,this.stem+(l||""))}get path(){return this.history[this.history.length-1]}set path(l){pf(l)&&(l=b5(l)),qc(l,"path"),this.path!==l&&this.history.push(l)}get stem(){return typeof this.path=="string"?wn.basename(this.path,this.extname):void 0}set stem(l){qc(l,"stem"),Uc(l,"stem"),this.path=wn.join(this.dirname||"",l+(this.extname||""))}fail(l,a,i){const u=this.message(l,a,i);throw u.fatal=!0,u}info(l,a,i){const u=this.message(l,a,i);return u.fatal=void 0,u}message(l,a,i){const u=new wt(l,a,i);return this.path&&(u.name=this.path+":"+u.name,u.file=this.path),u.fatal=!1,this.messages.push(u),u}toString(l){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(l||void 0).decode(this.value)}}function Uc(t,l){if(t&&t.includes(wn.sep))throw new Error("`"+l+"` cannot be a path: did not expect `"+wn.sep+"`")}function qc(t,l){if(!t)throw new Error("`"+l+"` cannot be empty")}function r0(t,l){if(!t)throw new Error("Setting `"+l+"` requires `path` to be set too")}function S5(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const w5=(function(t){const i=this.constructor.prototype,u=i[t],o=function(){return u.apply(o,arguments)};return Object.setPrototypeOf(o,i),o}),N5={}.hasOwnProperty;class Xf extends w5{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=o5()}copy(){const l=new Xf;let a=-1;for(;++a<this.attachers.length;){const i=this.attachers[a];l.use(...i)}return l.data(Dc(!0,{},this.namespace)),l}data(l,a){return typeof l=="string"?arguments.length===2?(Fc("data",this.frozen),this.namespace[l]=a,this):N5.call(this.namespace,l)&&this.namespace[l]||void 0:l?(Fc("data",this.frozen),this.namespace=l,this):this.namespace}freeze(){if(this.frozen)return this;const l=this;for(;++this.freezeIndex<this.attachers.length;){const[a,...i]=this.attachers[this.freezeIndex];if(i[0]===!1)continue;i[0]===!0&&(i[0]=void 0);const u=a.call(l,...i);typeof u=="function"&&this.transformers.use(u)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(l){this.freeze();const a=Us(l),i=this.parser||this.Parser;return Bc("parse",i),i(String(a),a)}process(l,a){const i=this;return this.freeze(),Bc("process",this.parser||this.Parser),Hc("process",this.compiler||this.Compiler),a?u(void 0,a):new Promise(u);function u(o,c){const m=Us(l),p=i.parse(m);i.run(p,m,function(y,x,v){if(y||!x||!v)return g(y);const S=x,N=i.stringify(S,v);k5(N)?v.value=N:v.result=N,g(y,v)});function g(y,x){y||!x?c(y):o?o(x):a(void 0,x)}}}processSync(l){let a=!1,i;return this.freeze(),Bc("processSync",this.parser||this.Parser),Hc("processSync",this.compiler||this.Compiler),this.process(l,u),i0("processSync","process",a),i;function u(o,c){a=!0,n0(o),i=c}}run(l,a,i){a0(l),this.freeze();const u=this.transformers;return!i&&typeof a=="function"&&(i=a,a=void 0),i?o(void 0,i):new Promise(o);function o(c,m){const p=Us(a);u.run(l,p,g);function g(y,x,v){const S=x||l;y?m(y):c?c(S):i(void 0,S,v)}}}runSync(l,a){let i=!1,u;return this.run(l,a,o),i0("runSync","run",i),u;function o(c,m){n0(c),u=m,i=!0}}stringify(l,a){this.freeze();const i=Us(a),u=this.compiler||this.Compiler;return Hc("stringify",u),a0(l),u(l,i)}use(l,...a){const i=this.attachers,u=this.namespace;if(Fc("use",this.frozen),l!=null)if(typeof l=="function")p(l,a);else if(typeof l=="object")Array.isArray(l)?m(l):c(l);else throw new TypeError("Expected usable value, not `"+l+"`");return this;function o(g){if(typeof g=="function")p(g,[]);else if(typeof g=="object")if(Array.isArray(g)){const[y,...x]=g;p(y,x)}else c(g);else throw new TypeError("Expected usable value, not `"+g+"`")}function c(g){if(!("plugins"in g)&&!("settings"in g))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");m(g.plugins),g.settings&&(u.settings=Dc(!0,u.settings,g.settings))}function m(g){let y=-1;if(g!=null)if(Array.isArray(g))for(;++y<g.length;){const x=g[y];o(x)}else throw new TypeError("Expected a list of plugins, not `"+g+"`")}function p(g,y){let x=-1,v=-1;for(;++x<i.length;)if(i[x][0]===g){v=x;break}if(v===-1)i.push([g,...y]);else if(y.length>0){let[S,...N]=y;const E=i[v][1];mf(E)&&mf(S)&&(S=Dc(!0,E,S)),i[v]=[g,S,...N]}}}}const j5=new Xf().freeze();function Bc(t,l){if(typeof l!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function Hc(t,l){if(typeof l!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function Fc(t,l){if(l)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function a0(t){if(!mf(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function i0(t,l,a){if(!a)throw new Error("`"+t+"` finished async. Use `"+l+"` instead")}function Us(t){return C5(t)?t:new _x(t)}function C5(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function k5(t){return typeof t=="string"||E5(t)}function E5(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const T5="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",s0=[],u0={allowDangerousHtml:!0},A5=/^(https?|ircs?|mailto|xmpp)$/i,R5=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function M5(t){const l=z5(t),a=O5(t);return _5(l.runSync(l.parse(a),a),t)}function z5(t){const l=t.rehypePlugins||s0,a=t.remarkPlugins||s0,i=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...u0}:u0;return j5().use(dC).use(a).use(i5,i).use(l)}function O5(t){const l=t.children||"",a=new _x;return typeof l=="string"&&(a.value=l),a}function _5(t,l){const a=l.allowedElements,i=l.allowElement,u=l.components,o=l.disallowedElements,c=l.skipHtml,m=l.unwrapDisallowed,p=l.urlTransform||D5;for(const y of R5)Object.hasOwn(l,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+T5+y.id,void 0);return If(t,g),$w(t,{Fragment:d.Fragment,components:u,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0});function g(y,x,v){if(y.type==="raw"&&v&&typeof x=="number")return c?v.children.splice(x,1):v.children[x]={type:"text",value:y.value},x;if(y.type==="element"){let S;for(S in Mc)if(Object.hasOwn(Mc,S)&&Object.hasOwn(y.properties,S)){const N=y.properties[S],E=Mc[S];(E===null||E.includes(y.tagName))&&(y.properties[S]=p(String(N||""),S,y))}}if(y.type==="element"){let S=a?!a.includes(y.tagName):o?o.includes(y.tagName):!1;if(!S&&i&&typeof x=="number"&&(S=!i(y,x,v)),S&&v&&typeof x=="number")return m&&y.children?v.children.splice(x,1,...y.children):v.children.splice(x,1),x}}}function D5(t){const l=t.indexOf(":"),a=t.indexOf("?"),i=t.indexOf("#"),u=t.indexOf("/");return l===-1||u!==-1&&l>u||a!==-1&&l>a||i!==-1&&l>i||A5.test(t.slice(0,l))?t:""}function o0(t,l){const a=String(t);if(typeof l!="string")throw new TypeError("Expected character");let i=0,u=a.indexOf(l);for(;u!==-1;)i++,u=a.indexOf(l,u+l.length);return i}function L5(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function U5(t,l,a){const u=nu((a||{}).ignore||[]),o=q5(l);let c=-1;for(;++c<o.length;)Ox(t,"text",m);function m(g,y){let x=-1,v;for(;++x<y.length;){const S=y[x],N=v?v.children:void 0;if(u(S,N?N.indexOf(S):void 0,v))return;v=S}if(v)return p(g,y)}function p(g,y){const x=y[y.length-1],v=o[c][0],S=o[c][1];let N=0;const k=x.children.indexOf(g);let C=!1,M=[];v.lastIndex=0;let D=v.exec(g.value);for(;D;){const F=D.index,V={index:D.index,input:D.input,stack:[...y,g]};let q=S(...D,V);if(typeof q=="string"&&(q=q.length>0?{type:"text",value:q}:void 0),q===!1?v.lastIndex=F+1:(N!==F&&M.push({type:"text",value:g.value.slice(N,F)}),Array.isArray(q)?M.push(...q):q&&M.push(q),N=F+D[0].length,C=!0),!v.global)break;D=v.exec(g.value)}return C?(N<g.value.length&&M.push({type:"text",value:g.value.slice(N)}),x.children.splice(k,1,...M)):M=[g],k+M.length}}function q5(t){const l=[];if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");const a=!t[0]||Array.isArray(t[0])?t:[t];let i=-1;for(;++i<a.length;){const u=a[i];l.push([B5(u[0]),H5(u[1])])}return l}function B5(t){return typeof t=="string"?new RegExp(L5(t),"g"):t}function H5(t){return typeof t=="function"?t:function(){return t}}const Qc="phrasing",Yc=["autolink","link","image","label"];function F5(){return{transforms:[X5],enter:{literalAutolink:Y5,literalAutolinkEmail:Gc,literalAutolinkHttp:Gc,literalAutolinkWww:Gc},exit:{literalAutolink:I5,literalAutolinkEmail:K5,literalAutolinkHttp:G5,literalAutolinkWww:V5}}}function Q5(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Qc,notInConstruct:Yc},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Qc,notInConstruct:Yc},{character:":",before:"[ps]",after:"\\/",inConstruct:Qc,notInConstruct:Yc}]}}function Y5(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function Gc(t){this.config.enter.autolinkProtocol.call(this,t)}function G5(t){this.config.exit.autolinkProtocol.call(this,t)}function V5(t){this.config.exit.data.call(this,t);const l=this.stack[this.stack.length-1];l.type,l.url="http://"+this.sliceSerialize(t)}function K5(t){this.config.exit.autolinkEmail.call(this,t)}function I5(t){this.exit(t)}function X5(t){U5(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,$5],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Z5]],{ignore:["link","linkReference"]})}function $5(t,l,a,i,u){let o="";if(!Dx(u)||(/^w/i.test(l)&&(a=l+a,l="",o="http://"),!J5(a)))return!1;const c=P5(a+i);if(!c[0])return!1;const m={type:"link",title:null,url:o+l+c[0],children:[{type:"text",value:l+c[0]}]};return c[1]?[m,{type:"text",value:c[1]}]:m}function Z5(t,l,a,i){return!Dx(i,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+l+"@"+a,children:[{type:"text",value:l+"@"+a}]}}function J5(t){const l=t.split(".");return!(l.length<2||l[l.length-1]&&(/_/.test(l[l.length-1])||!/[a-zA-Z\d]/.test(l[l.length-1]))||l[l.length-2]&&(/_/.test(l[l.length-2])||!/[a-zA-Z\d]/.test(l[l.length-2])))}function P5(t){const l=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!l)return[t,void 0];t=t.slice(0,l.index);let a=l[0],i=a.indexOf(")");const u=o0(t,"(");let o=o0(t,")");for(;i!==-1&&u>o;)t+=a.slice(0,i+1),a=a.slice(i+1),i=a.indexOf(")"),o++;return[t,a]}function Dx(t,l){const a=t.input.charCodeAt(t.index-1);return(t.index===0||Zl(a)||Ws(a))&&(!l||a!==47)}Lx.peek=sk;function W5(){this.buffer()}function ek(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function tk(){this.buffer()}function nk(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function lk(t){const l=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=mn(this.sliceSerialize(t)).toLowerCase(),a.label=l}function rk(t){this.exit(t)}function ak(t){const l=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=mn(this.sliceSerialize(t)).toLowerCase(),a.label=l}function ik(t){this.exit(t)}function sk(){return"["}function Lx(t,l,a,i){const u=a.createTracker(i);let o=u.move("[^");const c=a.enter("footnoteReference"),m=a.enter("reference");return o+=u.move(a.safe(a.associationId(t),{after:"]",before:o})),m(),c(),o+=u.move("]"),o}function uk(){return{enter:{gfmFootnoteCallString:W5,gfmFootnoteCall:ek,gfmFootnoteDefinitionLabelString:tk,gfmFootnoteDefinition:nk},exit:{gfmFootnoteCallString:lk,gfmFootnoteCall:rk,gfmFootnoteDefinitionLabelString:ak,gfmFootnoteDefinition:ik}}}function ok(t){let l=!1;return t&&t.firstLineBlank&&(l=!0),{handlers:{footnoteDefinition:a,footnoteReference:Lx},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function a(i,u,o,c){const m=o.createTracker(c);let p=m.move("[^");const g=o.enter("footnoteDefinition"),y=o.enter("label");return p+=m.move(o.safe(o.associationId(i),{before:p,after:"]"})),y(),p+=m.move("]:"),i.children&&i.children.length>0&&(m.shift(4),p+=m.move((l?`
33
+ `:" ")+o.indentLines(o.containerFlow(i,m.current()),l?Ux:ck))),g(),p}}function ck(t,l,a){return l===0?t:Ux(t,l,a)}function Ux(t,l,a){return(a?"":" ")+t}const fk=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];qx.peek=gk;function dk(){return{canContainEols:["delete"],enter:{strikethrough:mk},exit:{strikethrough:pk}}}function hk(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:fk}],handlers:{delete:qx}}}function mk(t){this.enter({type:"delete",children:[]},t)}function pk(t){this.exit(t)}function qx(t,l,a,i){const u=a.createTracker(i),o=a.enter("strikethrough");let c=u.move("~~");return c+=a.containerPhrasing(t,{...u.current(),before:c,after:"~"}),c+=u.move("~~"),o(),c}function gk(){return"~"}function xk(t){return t.length}function yk(t,l){const a=l||{},i=(a.align||[]).concat(),u=a.stringLength||xk,o=[],c=[],m=[],p=[];let g=0,y=-1;for(;++y<t.length;){const E=[],k=[];let C=-1;for(t[y].length>g&&(g=t[y].length);++C<t[y].length;){const M=bk(t[y][C]);if(a.alignDelimiters!==!1){const D=u(M);k[C]=D,(p[C]===void 0||D>p[C])&&(p[C]=D)}E.push(M)}c[y]=E,m[y]=k}let x=-1;if(typeof i=="object"&&"length"in i)for(;++x<g;)o[x]=c0(i[x]);else{const E=c0(i);for(;++x<g;)o[x]=E}x=-1;const v=[],S=[];for(;++x<g;){const E=o[x];let k="",C="";E===99?(k=":",C=":"):E===108?k=":":E===114&&(C=":");let M=a.alignDelimiters===!1?1:Math.max(1,p[x]-k.length-C.length);const D=k+"-".repeat(M)+C;a.alignDelimiters!==!1&&(M=k.length+M+C.length,M>p[x]&&(p[x]=M),S[x]=M),v[x]=D}c.splice(1,0,v),m.splice(1,0,S),y=-1;const N=[];for(;++y<c.length;){const E=c[y],k=m[y];x=-1;const C=[];for(;++x<g;){const M=E[x]||"";let D="",F="";if(a.alignDelimiters!==!1){const V=p[x]-(k[x]||0),q=o[x];q===114?D=" ".repeat(V):q===99?V%2?(D=" ".repeat(V/2+.5),F=" ".repeat(V/2-.5)):(D=" ".repeat(V/2),F=D):F=" ".repeat(V)}a.delimiterStart!==!1&&!x&&C.push("|"),a.padding!==!1&&!(a.alignDelimiters===!1&&M==="")&&(a.delimiterStart!==!1||x)&&C.push(" "),a.alignDelimiters!==!1&&C.push(D),C.push(M),a.alignDelimiters!==!1&&C.push(F),a.padding!==!1&&C.push(" "),(a.delimiterEnd!==!1||x!==g-1)&&C.push("|")}N.push(a.delimiterEnd===!1?C.join("").replace(/ +$/,""):C.join(""))}return N.join(`
34
+ `)}function bk(t){return t==null?"":String(t)}function c0(t){const l=typeof t=="string"?t.codePointAt(0):0;return l===67||l===99?99:l===76||l===108?108:l===82||l===114?114:0}function vk(t,l,a,i){const u=a.enter("blockquote"),o=a.createTracker(i);o.move("> "),o.shift(2);const c=a.indentLines(a.containerFlow(t,o.current()),Sk);return u(),c}function Sk(t,l,a){return">"+(a?"":" ")+t}function wk(t,l){return f0(t,l.inConstruct,!0)&&!f0(t,l.notInConstruct,!1)}function f0(t,l,a){if(typeof l=="string"&&(l=[l]),!l||l.length===0)return a;let i=-1;for(;++i<l.length;)if(t.includes(l[i]))return!0;return!1}function d0(t,l,a,i){let u=-1;for(;++u<a.unsafe.length;)if(a.unsafe[u].character===`
35
+ `&&wk(a.stack,a.unsafe[u]))return/[ \t]/.test(i.before)?"":" ";return`\\
36
+ `}function Nk(t,l){const a=String(t);let i=a.indexOf(l),u=i,o=0,c=0;if(typeof l!="string")throw new TypeError("Expected substring");for(;i!==-1;)i===u?++o>c&&(c=o):o=1,u=i+l.length,i=a.indexOf(l,u);return c}function jk(t,l){return!!(l.options.fences===!1&&t.value&&!t.lang&&/[^ \r\n]/.test(t.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(t.value))}function Ck(t){const l=t.options.fence||"`";if(l!=="`"&&l!=="~")throw new Error("Cannot serialize code with `"+l+"` for `options.fence`, expected `` ` `` or `~`");return l}function kk(t,l,a,i){const u=Ck(a),o=t.value||"",c=u==="`"?"GraveAccent":"Tilde";if(jk(t,a)){const x=a.enter("codeIndented"),v=a.indentLines(o,Ek);return x(),v}const m=a.createTracker(i),p=u.repeat(Math.max(Nk(o,u)+1,3)),g=a.enter("codeFenced");let y=m.move(p);if(t.lang){const x=a.enter(`codeFencedLang${c}`);y+=m.move(a.safe(t.lang,{before:y,after:" ",encode:["`"],...m.current()})),x()}if(t.lang&&t.meta){const x=a.enter(`codeFencedMeta${c}`);y+=m.move(" "),y+=m.move(a.safe(t.meta,{before:y,after:`
37
+ `,encode:["`"],...m.current()})),x()}return y+=m.move(`
38
+ `),o&&(y+=m.move(o+`
39
+ `)),y+=m.move(p),g(),y}function Ek(t,l,a){return(a?"":" ")+t}function $f(t){const l=t.options.quote||'"';if(l!=='"'&&l!=="'")throw new Error("Cannot serialize title with `"+l+"` for `options.quote`, expected `\"`, or `'`");return l}function Tk(t,l,a,i){const u=$f(a),o=u==='"'?"Quote":"Apostrophe",c=a.enter("definition");let m=a.enter("label");const p=a.createTracker(i);let g=p.move("[");return g+=p.move(a.safe(a.associationId(t),{before:g,after:"]",...p.current()})),g+=p.move("]: "),m(),!t.url||/[\0- \u007F]/.test(t.url)?(m=a.enter("destinationLiteral"),g+=p.move("<"),g+=p.move(a.safe(t.url,{before:g,after:">",...p.current()})),g+=p.move(">")):(m=a.enter("destinationRaw"),g+=p.move(a.safe(t.url,{before:g,after:t.title?" ":`
40
+ `,...p.current()}))),m(),t.title&&(m=a.enter(`title${o}`),g+=p.move(" "+u),g+=p.move(a.safe(t.title,{before:g,after:u,...p.current()})),g+=p.move(u),m()),c(),g}function Ak(t){const l=t.options.emphasis||"*";if(l!=="*"&&l!=="_")throw new Error("Cannot serialize emphasis with `"+l+"` for `options.emphasis`, expected `*`, or `_`");return l}function si(t){return"&#x"+t.toString(16).toUpperCase()+";"}function Zs(t,l,a){const i=Vr(t),u=Vr(l);return i===void 0?u===void 0?a==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:u===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:i===1?u===void 0?{inside:!1,outside:!1}:u===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:u===void 0?{inside:!1,outside:!1}:u===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Bx.peek=Rk;function Bx(t,l,a,i){const u=Ak(a),o=a.enter("emphasis"),c=a.createTracker(i),m=c.move(u);let p=c.move(a.containerPhrasing(t,{after:u,before:m,...c.current()}));const g=p.charCodeAt(0),y=Zs(i.before.charCodeAt(i.before.length-1),g,u);y.inside&&(p=si(g)+p.slice(1));const x=p.charCodeAt(p.length-1),v=Zs(i.after.charCodeAt(0),x,u);v.inside&&(p=p.slice(0,-1)+si(x));const S=c.move(u);return o(),a.attentionEncodeSurroundingInfo={after:v.outside,before:y.outside},m+p+S}function Rk(t,l,a){return a.options.emphasis||"*"}function Mk(t,l){let a=!1;return If(t,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return a=!0,df}),!!((!t.depth||t.depth<3)&&Hf(t)&&(l.options.setext||a))}function zk(t,l,a,i){const u=Math.max(Math.min(6,t.depth||1),1),o=a.createTracker(i);if(Mk(t,a)){const y=a.enter("headingSetext"),x=a.enter("phrasing"),v=a.containerPhrasing(t,{...o.current(),before:`
41
+ `,after:`
42
+ `});return x(),y(),v+`
43
+ `+(u===1?"=":"-").repeat(v.length-(Math.max(v.lastIndexOf("\r"),v.lastIndexOf(`
44
+ `))+1))}const c="#".repeat(u),m=a.enter("headingAtx"),p=a.enter("phrasing");o.move(c+" ");let g=a.containerPhrasing(t,{before:"# ",after:`
45
+ `,...o.current()});return/^[\t ]/.test(g)&&(g=si(g.charCodeAt(0))+g.slice(1)),g=g?c+" "+g:c,a.options.closeAtx&&(g+=" "+c),p(),m(),g}Hx.peek=Ok;function Hx(t){return t.value||""}function Ok(){return"<"}Fx.peek=_k;function Fx(t,l,a,i){const u=$f(a),o=u==='"'?"Quote":"Apostrophe",c=a.enter("image");let m=a.enter("label");const p=a.createTracker(i);let g=p.move("![");return g+=p.move(a.safe(t.alt,{before:g,after:"]",...p.current()})),g+=p.move("]("),m(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(m=a.enter("destinationLiteral"),g+=p.move("<"),g+=p.move(a.safe(t.url,{before:g,after:">",...p.current()})),g+=p.move(">")):(m=a.enter("destinationRaw"),g+=p.move(a.safe(t.url,{before:g,after:t.title?" ":")",...p.current()}))),m(),t.title&&(m=a.enter(`title${o}`),g+=p.move(" "+u),g+=p.move(a.safe(t.title,{before:g,after:u,...p.current()})),g+=p.move(u),m()),g+=p.move(")"),c(),g}function _k(){return"!"}Qx.peek=Dk;function Qx(t,l,a,i){const u=t.referenceType,o=a.enter("imageReference");let c=a.enter("label");const m=a.createTracker(i);let p=m.move("![");const g=a.safe(t.alt,{before:p,after:"]",...m.current()});p+=m.move(g+"]["),c();const y=a.stack;a.stack=[],c=a.enter("reference");const x=a.safe(a.associationId(t),{before:p,after:"]",...m.current()});return c(),a.stack=y,o(),u==="full"||!g||g!==x?p+=m.move(x+"]"):u==="shortcut"?p=p.slice(0,-1):p+=m.move("]"),p}function Dk(){return"!"}Yx.peek=Lk;function Yx(t,l,a){let i=t.value||"",u="`",o=-1;for(;new RegExp("(^|[^`])"+u+"([^`]|$)").test(i);)u+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++o<a.unsafe.length;){const c=a.unsafe[o],m=a.compilePattern(c);let p;if(c.atBreak)for(;p=m.exec(i);){let g=p.index;i.charCodeAt(g)===10&&i.charCodeAt(g-1)===13&&g--,i=i.slice(0,g)+" "+i.slice(p.index+1)}}return u+i+u}function Lk(){return"`"}function Gx(t,l){const a=Hf(t);return!!(!l.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(a===t.url||"mailto:"+a===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}Vx.peek=Uk;function Vx(t,l,a,i){const u=$f(a),o=u==='"'?"Quote":"Apostrophe",c=a.createTracker(i);let m,p;if(Gx(t,a)){const y=a.stack;a.stack=[],m=a.enter("autolink");let x=c.move("<");return x+=c.move(a.containerPhrasing(t,{before:x,after:">",...c.current()})),x+=c.move(">"),m(),a.stack=y,x}m=a.enter("link"),p=a.enter("label");let g=c.move("[");return g+=c.move(a.containerPhrasing(t,{before:g,after:"](",...c.current()})),g+=c.move("]("),p(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(p=a.enter("destinationLiteral"),g+=c.move("<"),g+=c.move(a.safe(t.url,{before:g,after:">",...c.current()})),g+=c.move(">")):(p=a.enter("destinationRaw"),g+=c.move(a.safe(t.url,{before:g,after:t.title?" ":")",...c.current()}))),p(),t.title&&(p=a.enter(`title${o}`),g+=c.move(" "+u),g+=c.move(a.safe(t.title,{before:g,after:u,...c.current()})),g+=c.move(u),p()),g+=c.move(")"),m(),g}function Uk(t,l,a){return Gx(t,a)?"<":"["}Kx.peek=qk;function Kx(t,l,a,i){const u=t.referenceType,o=a.enter("linkReference");let c=a.enter("label");const m=a.createTracker(i);let p=m.move("[");const g=a.containerPhrasing(t,{before:p,after:"]",...m.current()});p+=m.move(g+"]["),c();const y=a.stack;a.stack=[],c=a.enter("reference");const x=a.safe(a.associationId(t),{before:p,after:"]",...m.current()});return c(),a.stack=y,o(),u==="full"||!g||g!==x?p+=m.move(x+"]"):u==="shortcut"?p=p.slice(0,-1):p+=m.move("]"),p}function qk(){return"["}function Zf(t){const l=t.options.bullet||"*";if(l!=="*"&&l!=="+"&&l!=="-")throw new Error("Cannot serialize items with `"+l+"` for `options.bullet`, expected `*`, `+`, or `-`");return l}function Bk(t){const l=Zf(t),a=t.options.bulletOther;if(!a)return l==="*"?"-":"*";if(a!=="*"&&a!=="+"&&a!=="-")throw new Error("Cannot serialize items with `"+a+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(a===l)throw new Error("Expected `bullet` (`"+l+"`) and `bulletOther` (`"+a+"`) to be different");return a}function Hk(t){const l=t.options.bulletOrdered||".";if(l!=="."&&l!==")")throw new Error("Cannot serialize items with `"+l+"` for `options.bulletOrdered`, expected `.` or `)`");return l}function Ix(t){const l=t.options.rule||"*";if(l!=="*"&&l!=="-"&&l!=="_")throw new Error("Cannot serialize rules with `"+l+"` for `options.rule`, expected `*`, `-`, or `_`");return l}function Fk(t,l,a,i){const u=a.enter("list"),o=a.bulletCurrent;let c=t.ordered?Hk(a):Zf(a);const m=t.ordered?c==="."?")":".":Bk(a);let p=l&&a.bulletLastUsed?c===a.bulletLastUsed:!1;if(!t.ordered){const y=t.children?t.children[0]:void 0;if((c==="*"||c==="-")&&y&&(!y.children||!y.children[0])&&a.stack[a.stack.length-1]==="list"&&a.stack[a.stack.length-2]==="listItem"&&a.stack[a.stack.length-3]==="list"&&a.stack[a.stack.length-4]==="listItem"&&a.indexStack[a.indexStack.length-1]===0&&a.indexStack[a.indexStack.length-2]===0&&a.indexStack[a.indexStack.length-3]===0&&(p=!0),Ix(a)===c&&y){let x=-1;for(;++x<t.children.length;){const v=t.children[x];if(v&&v.type==="listItem"&&v.children&&v.children[0]&&v.children[0].type==="thematicBreak"){p=!0;break}}}}p&&(c=m),a.bulletCurrent=c;const g=a.containerFlow(t,i);return a.bulletLastUsed=c,a.bulletCurrent=o,u(),g}function Qk(t){const l=t.options.listItemIndent||"one";if(l!=="tab"&&l!=="one"&&l!=="mixed")throw new Error("Cannot serialize items with `"+l+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return l}function Yk(t,l,a,i){const u=Qk(a);let o=a.bulletCurrent||Zf(a);l&&l.type==="list"&&l.ordered&&(o=(typeof l.start=="number"&&l.start>-1?l.start:1)+(a.options.incrementListMarker===!1?0:l.children.indexOf(t))+o);let c=o.length+1;(u==="tab"||u==="mixed"&&(l&&l.type==="list"&&l.spread||t.spread))&&(c=Math.ceil(c/4)*4);const m=a.createTracker(i);m.move(o+" ".repeat(c-o.length)),m.shift(c);const p=a.enter("listItem"),g=a.indentLines(a.containerFlow(t,m.current()),y);return p(),g;function y(x,v,S){return v?(S?"":" ".repeat(c))+x:(S?o:o+" ".repeat(c-o.length))+x}}function Gk(t,l,a,i){const u=a.enter("paragraph"),o=a.enter("phrasing"),c=a.containerPhrasing(t,i);return o(),u(),c}const Vk=nu(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Kk(t,l,a,i){return(t.children.some(function(c){return Vk(c)})?a.containerPhrasing:a.containerFlow).call(a,t,i)}function Ik(t){const l=t.options.strong||"*";if(l!=="*"&&l!=="_")throw new Error("Cannot serialize strong with `"+l+"` for `options.strong`, expected `*`, or `_`");return l}Xx.peek=Xk;function Xx(t,l,a,i){const u=Ik(a),o=a.enter("strong"),c=a.createTracker(i),m=c.move(u+u);let p=c.move(a.containerPhrasing(t,{after:u,before:m,...c.current()}));const g=p.charCodeAt(0),y=Zs(i.before.charCodeAt(i.before.length-1),g,u);y.inside&&(p=si(g)+p.slice(1));const x=p.charCodeAt(p.length-1),v=Zs(i.after.charCodeAt(0),x,u);v.inside&&(p=p.slice(0,-1)+si(x));const S=c.move(u+u);return o(),a.attentionEncodeSurroundingInfo={after:v.outside,before:y.outside},m+p+S}function Xk(t,l,a){return a.options.strong||"*"}function $k(t,l,a,i){return a.safe(t.value,i)}function Zk(t){const l=t.options.ruleRepetition||3;if(l<3)throw new Error("Cannot serialize rules with repetition `"+l+"` for `options.ruleRepetition`, expected `3` or more");return l}function Jk(t,l,a){const i=(Ix(a)+(a.options.ruleSpaces?" ":"")).repeat(Zk(a));return a.options.ruleSpaces?i.slice(0,-1):i}const $x={blockquote:vk,break:d0,code:kk,definition:Tk,emphasis:Bx,hardBreak:d0,heading:zk,html:Hx,image:Fx,imageReference:Qx,inlineCode:Yx,link:Vx,linkReference:Kx,list:Fk,listItem:Yk,paragraph:Gk,root:Kk,strong:Xx,text:$k,thematicBreak:Jk};function Pk(){return{enter:{table:Wk,tableData:h0,tableHeader:h0,tableRow:tE},exit:{codeText:nE,table:eE,tableData:Vc,tableHeader:Vc,tableRow:Vc}}}function Wk(t){const l=t._align;this.enter({type:"table",align:l.map(function(a){return a==="none"?null:a}),children:[]},t),this.data.inTable=!0}function eE(t){this.exit(t),this.data.inTable=void 0}function tE(t){this.enter({type:"tableRow",children:[]},t)}function Vc(t){this.exit(t)}function h0(t){this.enter({type:"tableCell",children:[]},t)}function nE(t){let l=this.resume();this.data.inTable&&(l=l.replace(/\\([\\|])/g,lE));const a=this.stack[this.stack.length-1];a.type,a.value=l,this.exit(t)}function lE(t,l){return l==="|"?l:t}function rE(t){const l=t||{},a=l.tableCellPadding,i=l.tablePipeAlign,u=l.stringLength,o=a?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
46
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:v,table:c,tableCell:p,tableRow:m}};function c(S,N,E,k){return g(y(S,E,k),S.align)}function m(S,N,E,k){const C=x(S,E,k),M=g([C]);return M.slice(0,M.indexOf(`
47
+ `))}function p(S,N,E,k){const C=E.enter("tableCell"),M=E.enter("phrasing"),D=E.containerPhrasing(S,{...k,before:o,after:o});return M(),C(),D}function g(S,N){return yk(S,{align:N,alignDelimiters:i,padding:a,stringLength:u})}function y(S,N,E){const k=S.children;let C=-1;const M=[],D=N.enter("table");for(;++C<k.length;)M[C]=x(k[C],N,E);return D(),M}function x(S,N,E){const k=S.children;let C=-1;const M=[],D=N.enter("tableRow");for(;++C<k.length;)M[C]=p(k[C],S,N,E);return D(),M}function v(S,N,E){let k=$x.inlineCode(S,N,E);return E.stack.includes("tableCell")&&(k=k.replace(/\|/g,"\\$&")),k}}function aE(){return{exit:{taskListCheckValueChecked:m0,taskListCheckValueUnchecked:m0,paragraph:sE}}}function iE(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:uE}}}function m0(t){const l=this.stack[this.stack.length-2];l.type,l.checked=t.type==="taskListCheckValueChecked"}function sE(t){const l=this.stack[this.stack.length-2];if(l&&l.type==="listItem"&&typeof l.checked=="boolean"){const a=this.stack[this.stack.length-1];a.type;const i=a.children[0];if(i&&i.type==="text"){const u=l.children;let o=-1,c;for(;++o<u.length;){const m=u[o];if(m.type==="paragraph"){c=m;break}}c===a&&(i.value=i.value.slice(1),i.value.length===0?a.children.shift():a.position&&i.position&&typeof i.position.start.offset=="number"&&(i.position.start.column++,i.position.start.offset++,a.position.start=Object.assign({},i.position.start)))}}this.exit(t)}function uE(t,l,a,i){const u=t.children[0],o=typeof t.checked=="boolean"&&u&&u.type==="paragraph",c="["+(t.checked?"x":" ")+"] ",m=a.createTracker(i);o&&m.move(c);let p=$x.listItem(t,l,a,{...i,...m.current()});return o&&(p=p.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,g)),p;function g(y){return y+c}}function oE(){return[F5(),uk(),dk(),Pk(),aE()]}function cE(t){return{extensions:[Q5(),ok(t),hk(),rE(t),iE()]}}const fE={tokenize:xE,partial:!0},Zx={tokenize:yE,partial:!0},Jx={tokenize:bE,partial:!0},Px={tokenize:vE,partial:!0},dE={tokenize:SE,partial:!0},Wx={name:"wwwAutolink",tokenize:pE,previous:ty},ey={name:"protocolAutolink",tokenize:gE,previous:ny},$n={name:"emailAutolink",tokenize:mE,previous:ly},Cn={};function hE(){return{text:Cn}}let Yl=48;for(;Yl<123;)Cn[Yl]=$n,Yl++,Yl===58?Yl=65:Yl===91&&(Yl=97);Cn[43]=$n;Cn[45]=$n;Cn[46]=$n;Cn[95]=$n;Cn[72]=[$n,ey];Cn[104]=[$n,ey];Cn[87]=[$n,Wx];Cn[119]=[$n,Wx];function mE(t,l,a){const i=this;let u,o;return c;function c(x){return!gf(x)||!ly.call(i,i.previous)||Jf(i.events)?a(x):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),m(x))}function m(x){return gf(x)?(t.consume(x),m):x===64?(t.consume(x),p):a(x)}function p(x){return x===46?t.check(dE,y,g)(x):x===45||x===95||vt(x)?(o=!0,t.consume(x),p):y(x)}function g(x){return t.consume(x),u=!0,p}function y(x){return o&&u&&Et(i.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),l(x)):a(x)}}function pE(t,l,a){const i=this;return u;function u(c){return c!==87&&c!==119||!ty.call(i,i.previous)||Jf(i.events)?a(c):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(fE,t.attempt(Zx,t.attempt(Jx,o),a),a)(c))}function o(c){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),l(c)}}function gE(t,l,a){const i=this;let u="",o=!1;return c;function c(x){return(x===72||x===104)&&ny.call(i,i.previous)&&!Jf(i.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),u+=String.fromCodePoint(x),t.consume(x),m):a(x)}function m(x){if(Et(x)&&u.length<5)return u+=String.fromCodePoint(x),t.consume(x),m;if(x===58){const v=u.toLowerCase();if(v==="http"||v==="https")return t.consume(x),p}return a(x)}function p(x){return x===47?(t.consume(x),o?g:(o=!0,p)):a(x)}function g(x){return x===null||Is(x)||Ve(x)||Zl(x)||Ws(x)?a(x):t.attempt(Zx,t.attempt(Jx,y),a)(x)}function y(x){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),l(x)}}function xE(t,l,a){let i=0;return u;function u(c){return(c===87||c===119)&&i<3?(i++,t.consume(c),u):c===46&&i===3?(t.consume(c),o):a(c)}function o(c){return c===null?a(c):l(c)}}function yE(t,l,a){let i,u,o;return c;function c(g){return g===46||g===95?t.check(Px,p,m)(g):g===null||Ve(g)||Zl(g)||g!==45&&Ws(g)?p(g):(o=!0,t.consume(g),c)}function m(g){return g===95?i=!0:(u=i,i=void 0),t.consume(g),c}function p(g){return u||i||!o?a(g):l(g)}}function bE(t,l){let a=0,i=0;return u;function u(c){return c===40?(a++,t.consume(c),u):c===41&&i<a?o(c):c===33||c===34||c===38||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===60||c===63||c===93||c===95||c===126?t.check(Px,l,o)(c):c===null||Ve(c)||Zl(c)?l(c):(t.consume(c),u)}function o(c){return c===41&&i++,t.consume(c),u}}function vE(t,l,a){return i;function i(m){return m===33||m===34||m===39||m===41||m===42||m===44||m===46||m===58||m===59||m===63||m===95||m===126?(t.consume(m),i):m===38?(t.consume(m),o):m===93?(t.consume(m),u):m===60||m===null||Ve(m)||Zl(m)?l(m):a(m)}function u(m){return m===null||m===40||m===91||Ve(m)||Zl(m)?l(m):i(m)}function o(m){return Et(m)?c(m):a(m)}function c(m){return m===59?(t.consume(m),i):Et(m)?(t.consume(m),c):a(m)}}function SE(t,l,a){return i;function i(o){return t.consume(o),u}function u(o){return vt(o)?a(o):l(o)}}function ty(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||Ve(t)}function ny(t){return!Et(t)}function ly(t){return!(t===47||gf(t))}function gf(t){return t===43||t===45||t===46||t===95||vt(t)}function Jf(t){let l=t.length,a=!1;for(;l--;){const i=t[l][1];if((i.type==="labelLink"||i.type==="labelImage")&&!i._balanced){a=!0;break}if(i._gfmAutolinkLiteralWalkedInto){a=!1;break}}return t.length>0&&!a&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),a}const wE={tokenize:RE,partial:!0};function NE(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:EE,continuation:{tokenize:TE},exit:AE}},text:{91:{name:"gfmFootnoteCall",tokenize:kE},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:jE,resolveTo:CE}}}}function jE(t,l,a){const i=this;let u=i.events.length;const o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let c;for(;u--;){const p=i.events[u][1];if(p.type==="labelImage"){c=p;break}if(p.type==="gfmFootnoteCall"||p.type==="labelLink"||p.type==="label"||p.type==="image"||p.type==="link")break}return m;function m(p){if(!c||!c._balanced)return a(p);const g=mn(i.sliceSerialize({start:c.end,end:i.now()}));return g.codePointAt(0)!==94||!o.includes(g.slice(1))?a(p):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(p),t.exit("gfmFootnoteCallLabelMarker"),l(p))}}function CE(t,l){let a=t.length;for(;a--;)if(t[a][1].type==="labelImage"&&t[a][0]==="enter"){t[a][1];break}t[a+1][1].type="data",t[a+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},t[a+3][1].start),end:Object.assign({},t[t.length-1][1].end)},u={type:"gfmFootnoteCallMarker",start:Object.assign({},t[a+3][1].end),end:Object.assign({},t[a+3][1].end)};u.end.column++,u.end.offset++,u.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},u.end),end:Object.assign({},t[t.length-1][1].start)},c={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},m=[t[a+1],t[a+2],["enter",i,l],t[a+3],t[a+4],["enter",u,l],["exit",u,l],["enter",o,l],["enter",c,l],["exit",c,l],["exit",o,l],t[t.length-2],t[t.length-1],["exit",i,l]];return t.splice(a,t.length-a+1,...m),t}function kE(t,l,a){const i=this,u=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let o=0,c;return m;function m(x){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(x),t.exit("gfmFootnoteCallLabelMarker"),p}function p(x){return x!==94?a(x):(t.enter("gfmFootnoteCallMarker"),t.consume(x),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",g)}function g(x){if(o>999||x===93&&!c||x===null||x===91||Ve(x))return a(x);if(x===93){t.exit("chunkString");const v=t.exit("gfmFootnoteCallString");return u.includes(mn(i.sliceSerialize(v)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(x),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),l):a(x)}return Ve(x)||(c=!0),o++,t.consume(x),x===92?y:g}function y(x){return x===91||x===92||x===93?(t.consume(x),o++,g):g(x)}}function EE(t,l,a){const i=this,u=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let o,c=0,m;return p;function p(N){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(N),t.exit("gfmFootnoteDefinitionLabelMarker"),g}function g(N){return N===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(N),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",y):a(N)}function y(N){if(c>999||N===93&&!m||N===null||N===91||Ve(N))return a(N);if(N===93){t.exit("chunkString");const E=t.exit("gfmFootnoteDefinitionLabelString");return o=mn(i.sliceSerialize(E)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(N),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),v}return Ve(N)||(m=!0),c++,t.consume(N),N===92?x:y}function x(N){return N===91||N===92||N===93?(t.consume(N),c++,y):y(N)}function v(N){return N===58?(t.enter("definitionMarker"),t.consume(N),t.exit("definitionMarker"),u.includes(o)||u.push(o),Me(t,S,"gfmFootnoteDefinitionWhitespace")):a(N)}function S(N){return l(N)}}function TE(t,l,a){return t.check(di,l,t.attempt(wE,l,a))}function AE(t){t.exit("gfmFootnoteDefinition")}function RE(t,l,a){const i=this;return Me(t,u,"gfmFootnoteDefinitionIndent",5);function u(o){const c=i.events[i.events.length-1];return c&&c[1].type==="gfmFootnoteDefinitionIndent"&&c[2].sliceSerialize(c[1],!0).length===4?l(o):a(o)}}function ME(t){let a=(t||{}).singleTilde;const i={name:"strikethrough",tokenize:o,resolveAll:u};return a==null&&(a=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function u(c,m){let p=-1;for(;++p<c.length;)if(c[p][0]==="enter"&&c[p][1].type==="strikethroughSequenceTemporary"&&c[p][1]._close){let g=p;for(;g--;)if(c[g][0]==="exit"&&c[g][1].type==="strikethroughSequenceTemporary"&&c[g][1]._open&&c[p][1].end.offset-c[p][1].start.offset===c[g][1].end.offset-c[g][1].start.offset){c[p][1].type="strikethroughSequence",c[g][1].type="strikethroughSequence";const y={type:"strikethrough",start:Object.assign({},c[g][1].start),end:Object.assign({},c[p][1].end)},x={type:"strikethroughText",start:Object.assign({},c[g][1].end),end:Object.assign({},c[p][1].start)},v=[["enter",y,m],["enter",c[g][1],m],["exit",c[g][1],m],["enter",x,m]],S=m.parser.constructs.insideSpan.null;S&&It(v,v.length,0,eu(S,c.slice(g+1,p),m)),It(v,v.length,0,[["exit",x,m],["enter",c[p][1],m],["exit",c[p][1],m],["exit",y,m]]),It(c,g-1,p-g+3,v),p=g+v.length-2;break}}for(p=-1;++p<c.length;)c[p][1].type==="strikethroughSequenceTemporary"&&(c[p][1].type="data");return c}function o(c,m,p){const g=this.previous,y=this.events;let x=0;return v;function v(N){return g===126&&y[y.length-1][1].type!=="characterEscape"?p(N):(c.enter("strikethroughSequenceTemporary"),S(N))}function S(N){const E=Vr(g);if(N===126)return x>1?p(N):(c.consume(N),x++,S);if(x<2&&!a)return p(N);const k=c.exit("strikethroughSequenceTemporary"),C=Vr(N);return k._open=!C||C===2&&!!E,k._close=!E||E===2&&!!C,m(N)}}}class zE{constructor(){this.map=[]}add(l,a,i){OE(this,l,a,i)}consume(l){if(this.map.sort(function(o,c){return o[0]-c[0]}),this.map.length===0)return;let a=this.map.length;const i=[];for(;a>0;)a-=1,i.push(l.slice(this.map[a][0]+this.map[a][1]),this.map[a][2]),l.length=this.map[a][0];i.push(l.slice()),l.length=0;let u=i.pop();for(;u;){for(const o of u)l.push(o);u=i.pop()}this.map.length=0}}function OE(t,l,a,i){let u=0;if(!(a===0&&i.length===0)){for(;u<t.map.length;){if(t.map[u][0]===l){t.map[u][1]+=a,t.map[u][2].push(...i);return}u+=1}t.map.push([l,a,i])}}function _E(t,l){let a=!1;const i=[];for(;l<t.length;){const u=t[l];if(a){if(u[0]==="enter")u[1].type==="tableContent"&&i.push(t[l+1][1].type==="tableDelimiterMarker"?"left":"none");else if(u[1].type==="tableContent"){if(t[l-1][1].type==="tableDelimiterMarker"){const o=i.length-1;i[o]=i[o]==="left"?"center":"right"}}else if(u[1].type==="tableDelimiterRow")break}else u[0]==="enter"&&u[1].type==="tableDelimiterRow"&&(a=!0);l+=1}return i}function DE(){return{flow:{null:{name:"table",tokenize:LE,resolveAll:UE}}}}function LE(t,l,a){const i=this;let u=0,o=0,c;return m;function m(T){let P=i.events.length-1;for(;P>-1;){const re=i.events[P][1].type;if(re==="lineEnding"||re==="linePrefix")P--;else break}const H=P>-1?i.events[P][1].type:null,ie=H==="tableHead"||H==="tableRow"?q:p;return ie===q&&i.parser.lazy[i.now().line]?a(T):ie(T)}function p(T){return t.enter("tableHead"),t.enter("tableRow"),g(T)}function g(T){return T===124||(c=!0,o+=1),y(T)}function y(T){return T===null?a(T):he(T)?o>1?(o=0,i.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(T),t.exit("lineEnding"),S):a(T):Ce(T)?Me(t,y,"whitespace")(T):(o+=1,c&&(c=!1,u+=1),T===124?(t.enter("tableCellDivider"),t.consume(T),t.exit("tableCellDivider"),c=!0,y):(t.enter("data"),x(T)))}function x(T){return T===null||T===124||Ve(T)?(t.exit("data"),y(T)):(t.consume(T),T===92?v:x)}function v(T){return T===92||T===124?(t.consume(T),x):x(T)}function S(T){return i.interrupt=!1,i.parser.lazy[i.now().line]?a(T):(t.enter("tableDelimiterRow"),c=!1,Ce(T)?Me(t,N,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):N(T))}function N(T){return T===45||T===58?k(T):T===124?(c=!0,t.enter("tableCellDivider"),t.consume(T),t.exit("tableCellDivider"),E):V(T)}function E(T){return Ce(T)?Me(t,k,"whitespace")(T):k(T)}function k(T){return T===58?(o+=1,c=!0,t.enter("tableDelimiterMarker"),t.consume(T),t.exit("tableDelimiterMarker"),C):T===45?(o+=1,C(T)):T===null||he(T)?F(T):V(T)}function C(T){return T===45?(t.enter("tableDelimiterFiller"),M(T)):V(T)}function M(T){return T===45?(t.consume(T),M):T===58?(c=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(T),t.exit("tableDelimiterMarker"),D):(t.exit("tableDelimiterFiller"),D(T))}function D(T){return Ce(T)?Me(t,F,"whitespace")(T):F(T)}function F(T){return T===124?N(T):T===null||he(T)?!c||u!==o?V(T):(t.exit("tableDelimiterRow"),t.exit("tableHead"),l(T)):V(T)}function V(T){return a(T)}function q(T){return t.enter("tableRow"),K(T)}function K(T){return T===124?(t.enter("tableCellDivider"),t.consume(T),t.exit("tableCellDivider"),K):T===null||he(T)?(t.exit("tableRow"),l(T)):Ce(T)?Me(t,K,"whitespace")(T):(t.enter("data"),ne(T))}function ne(T){return T===null||T===124||Ve(T)?(t.exit("data"),K(T)):(t.consume(T),T===92?le:ne)}function le(T){return T===92||T===124?(t.consume(T),ne):ne(T)}}function UE(t,l){let a=-1,i=!0,u=0,o=[0,0,0,0],c=[0,0,0,0],m=!1,p=0,g,y,x;const v=new zE;for(;++a<t.length;){const S=t[a],N=S[1];S[0]==="enter"?N.type==="tableHead"?(m=!1,p!==0&&(p0(v,l,p,g,y),y=void 0,p=0),g={type:"table",start:Object.assign({},N.start),end:Object.assign({},N.end)},v.add(a,0,[["enter",g,l]])):N.type==="tableRow"||N.type==="tableDelimiterRow"?(i=!0,x=void 0,o=[0,0,0,0],c=[0,a+1,0,0],m&&(m=!1,y={type:"tableBody",start:Object.assign({},N.start),end:Object.assign({},N.end)},v.add(a,0,[["enter",y,l]])),u=N.type==="tableDelimiterRow"?2:y?3:1):u&&(N.type==="data"||N.type==="tableDelimiterMarker"||N.type==="tableDelimiterFiller")?(i=!1,c[2]===0&&(o[1]!==0&&(c[0]=c[1],x=qs(v,l,o,u,void 0,x),o=[0,0,0,0]),c[2]=a)):N.type==="tableCellDivider"&&(i?i=!1:(o[1]!==0&&(c[0]=c[1],x=qs(v,l,o,u,void 0,x)),o=c,c=[o[1],a,0,0])):N.type==="tableHead"?(m=!0,p=a):N.type==="tableRow"||N.type==="tableDelimiterRow"?(p=a,o[1]!==0?(c[0]=c[1],x=qs(v,l,o,u,a,x)):c[1]!==0&&(x=qs(v,l,c,u,a,x)),u=0):u&&(N.type==="data"||N.type==="tableDelimiterMarker"||N.type==="tableDelimiterFiller")&&(c[3]=a)}for(p!==0&&p0(v,l,p,g,y),v.consume(l.events),a=-1;++a<l.events.length;){const S=l.events[a];S[0]==="enter"&&S[1].type==="table"&&(S[1]._align=_E(l.events,a))}return t}function qs(t,l,a,i,u,o){const c=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",m="tableContent";a[0]!==0&&(o.end=Object.assign({},Qr(l.events,a[0])),t.add(a[0],0,[["exit",o,l]]));const p=Qr(l.events,a[1]);if(o={type:c,start:Object.assign({},p),end:Object.assign({},p)},t.add(a[1],0,[["enter",o,l]]),a[2]!==0){const g=Qr(l.events,a[2]),y=Qr(l.events,a[3]),x={type:m,start:Object.assign({},g),end:Object.assign({},y)};if(t.add(a[2],0,[["enter",x,l]]),i!==2){const v=l.events[a[2]],S=l.events[a[3]];if(v[1].end=Object.assign({},S[1].end),v[1].type="chunkText",v[1].contentType="text",a[3]>a[2]+1){const N=a[2]+1,E=a[3]-a[2]-1;t.add(N,E,[])}}t.add(a[3]+1,0,[["exit",x,l]])}return u!==void 0&&(o.end=Object.assign({},Qr(l.events,u)),t.add(u,0,[["exit",o,l]]),o=void 0),o}function p0(t,l,a,i,u){const o=[],c=Qr(l.events,a);u&&(u.end=Object.assign({},c),o.push(["exit",u,l])),i.end=Object.assign({},c),o.push(["exit",i,l]),t.add(a+1,0,o)}function Qr(t,l){const a=t[l],i=a[0]==="enter"?"start":"end";return a[1][i]}const qE={name:"tasklistCheck",tokenize:HE};function BE(){return{text:{91:qE}}}function HE(t,l,a){const i=this;return u;function u(p){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?a(p):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(p),t.exit("taskListCheckMarker"),o)}function o(p){return Ve(p)?(t.enter("taskListCheckValueUnchecked"),t.consume(p),t.exit("taskListCheckValueUnchecked"),c):p===88||p===120?(t.enter("taskListCheckValueChecked"),t.consume(p),t.exit("taskListCheckValueChecked"),c):a(p)}function c(p){return p===93?(t.enter("taskListCheckMarker"),t.consume(p),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),m):a(p)}function m(p){return he(p)?l(p):Ce(p)?t.check({tokenize:FE},l,a)(p):a(p)}}function FE(t,l,a){return Me(t,i,"whitespace");function i(u){return u===null?a(u):l(u)}}function QE(t){return mx([hE(),NE(),ME(t),DE(),BE()])}const YE={};function GE(t){const l=this,a=t||YE,i=l.data(),u=i.micromarkExtensions||(i.micromarkExtensions=[]),o=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),c=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);u.push(QE(a)),o.push(oE()),c.push(cE(a))}function VE(){const{port:t}=q0(),l=Nl(),{data:a}=J0(),i=a?.servers.find(M=>M.port===parseInt(t||"0")),u=i?.modelName||"",{messages:o,setMessages:c,isStreaming:m,error:p,sendMessage:g,tokensPerSecond:y}=uw(u),[x,v]=A.useState(""),S=A.useRef(null),N=A.useRef(null);A.useEffect(()=>{if(!t)return;const M=`chat_history_port_${t}`,D=localStorage.getItem(M);if(D)try{const F=JSON.parse(D);c(F)}catch(F){console.error("Failed to parse stored messages:",F)}},[t,c]),A.useEffect(()=>{if(!t||o.length===0)return;const M=`chat_history_port_${t}`;localStorage.setItem(M,JSON.stringify(o))},[o,t]),A.useEffect(()=>{S.current?.scrollIntoView({behavior:"smooth"})},[o]),A.useEffect(()=>{N.current?.focus()},[]);const E=async M=>{if(M.preventDefault(),!x.trim()||m)return;const D=x.trim();v(""),await g(D)},k=M=>{M.key==="Enter"&&!M.shiftKey&&(M.preventDefault(),E(M))},C=()=>{if(confirm("Clear chat history?")&&(c([]),t)){const M=`chat_history_port_${t}`;localStorage.removeItem(M)}};return i?d.jsxs("div",{className:"flex flex-col h-[calc(100vh-4rem)] max-w-4xl mx-auto",children:[d.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-neutral-200 bg-white",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("button",{onClick:()=>l("/servers"),className:"p-2 text-neutral-600 hover:text-neutral-900 hover:bg-neutral-100 rounded-md transition-colors",title:"Back to servers",children:d.jsx(ci,{className:"w-5 h-5"})}),d.jsxs("div",{children:[d.jsx("h1",{className:"text-lg font-semibold text-neutral-900",children:i.modelName.replace(".gguf","")}),d.jsxs("p",{className:"text-sm text-neutral-600",children:["localhost:",i.port]})]})]}),d.jsxs("button",{onClick:C,disabled:o.length===0||m,className:"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium text-neutral-600 hover:text-red-600 hover:bg-red-50 rounded-md transition-colors disabled:opacity-50 disabled:cursor-not-allowed",title:"Clear history",children:[d.jsx(Il,{className:"w-4 h-4"}),"Clear History"]})]}),d.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-4 bg-neutral-50",children:[o.length===0?d.jsx("div",{className:"flex items-center justify-center h-full",children:d.jsxs("div",{className:"text-center",children:[d.jsxs("p",{className:"text-neutral-500 text-base",children:["Start a conversation with ",i.modelName.replace(".gguf","")]}),d.jsx("p",{className:"text-sm text-neutral-400 mt-2",children:"Type your message below"})]})}):d.jsxs("div",{className:"space-y-4",children:[o.map((M,D)=>d.jsx("div",{className:`flex ${M.role==="user"?"justify-end":"justify-start"}`,children:d.jsxs("div",{className:`max-w-[80%] rounded-lg px-4 py-3 ${M.role==="user"?"bg-neutral-900 text-white":"bg-white text-neutral-900 border border-neutral-200"}`,children:[d.jsx("p",{className:"text-sm font-medium mb-1 opacity-70",children:M.role==="user"?"You":"Assistant"}),d.jsx("div",{className:"text-sm",children:M.role==="assistant"?d.jsx("div",{className:"prose prose-sm max-w-none prose-neutral prose-p:my-2 prose-headings:my-2 prose-ul:my-2 prose-ol:my-2 prose-li:my-0 prose-pre:my-2 prose-code:text-xs prose-code:bg-neutral-100 prose-code:px-1 prose-code:py-0.5 prose-code:rounded prose-strong:font-semibold prose-strong:text-neutral-900",children:d.jsx(M5,{remarkPlugins:[GE],children:M.content})}):d.jsx("div",{className:"whitespace-pre-wrap break-words",children:M.content})})]})},D)),m&&d.jsx("div",{className:"flex justify-start",children:d.jsx("div",{className:"bg-white border border-neutral-200 rounded-lg px-4 py-3",children:d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(Pe,{className:"w-4 h-4 animate-spin text-neutral-600"}),y!==null&&d.jsxs("span",{className:"text-xs text-neutral-600",children:[y.toFixed(1)," tok/s"]})]})})}),d.jsx("div",{ref:S})]}),p&&d.jsx("div",{className:"mt-4 p-4 bg-red-50 border border-red-200 rounded-lg",children:d.jsxs("div",{className:"flex items-start gap-2",children:[d.jsx(Rf,{className:"w-5 h-5 text-red-600 flex-shrink-0 mt-0.5"}),d.jsxs("div",{className:"flex-1",children:[d.jsx("p",{className:"text-sm font-medium text-red-900",children:"Error"}),d.jsx("p",{className:"text-sm text-red-700 mt-1",children:p})]})]})})]}),d.jsxs("div",{className:"border-t border-neutral-200 bg-white px-6 py-4",children:[d.jsxs("form",{onSubmit:E,className:"flex items-end gap-3",children:[d.jsx("div",{className:"flex-1",children:d.jsx("textarea",{ref:N,value:x,onChange:M=>v(M.target.value),onKeyDown:k,disabled:m,placeholder:"Type your message... (Enter to send, Shift+Enter for new line)",className:"w-full px-4 py-3 border border-neutral-200 rounded-lg resize-none focus:outline-none focus:ring-2 focus:ring-neutral-900 focus:border-transparent disabled:opacity-50 disabled:cursor-not-allowed",rows:3})}),d.jsx("button",{type:"submit",disabled:!x.trim()||m,className:"flex items-center justify-center w-12 h-12 bg-neutral-900 text-white rounded-lg hover:bg-neutral-800 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",title:"Send message",children:m?d.jsx(Pe,{className:"w-5 h-5 animate-spin"}):d.jsx(k2,{className:"w-5 h-5"})})]}),d.jsx("p",{className:"text-xs text-neutral-500 mt-2",children:"Press Enter to send • Shift+Enter for new line"})]})]}):d.jsx("div",{className:"flex items-center justify-center h-[calc(100vh-4rem)]",children:d.jsx("div",{className:"text-neutral-500",children:"Loading server..."})})}function KE({isOpen:t,onClose:l,onDownloadComplete:a}){const[i,u]=A.useState("search"),[o,c]=A.useState(""),[m,p]=A.useState(null),[g,y]=A.useState(null),x=A.useRef(null),v=X2(),S=I2(),{data:N,isLoading:E}=$2(i==="files"&&m?m.modelId:null),{data:k}=Z2(g);A.useEffect(()=>{t&&i==="search"&&setTimeout(()=>x.current?.focus(),100)},[t,i]),A.useEffect(()=>{t||(u("search"),c(""),p(null),y(null),v.reset())},[t]),A.useEffect(()=>{k?.job?.status==="completed"?(a(),l()):k?.job?.status},[k?.job?.status,a,l]);const C=K=>{K.preventDefault(),o.trim()&&v.mutate({query:o.trim()})},M=K=>{p(K),u("files")},D=async K=>{if(m)try{const ne=await S.mutateAsync({repo:m.modelId,filename:K});y(ne.jobId),u("downloading")}catch{}},F=()=>{i==="files"&&(u("search"),p(null))},V=K=>K>=1e6?`${(K/1e6).toFixed(1)}M`:K>=1e3?`${(K/1e3).toFixed(1)}K`:K.toString(),q=K=>K>=1e9?`${(K/1e9).toFixed(1)} GB`:K>=1e6?`${(K/1e6).toFixed(1)} MB`:`${(K/1e3).toFixed(1)} KB`;return t?d.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:d.jsxs("div",{className:"bg-white rounded-xl shadow-xl w-full max-w-2xl mx-4 max-h-[80vh] flex flex-col",children:[d.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-200",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[i==="files"&&d.jsx("button",{onClick:F,className:"p-1 hover:bg-gray-100 rounded-lg transition-colors cursor-pointer",children:d.jsx(ci,{className:"w-5 h-5"})}),d.jsxs("h2",{className:"text-lg font-semibold text-gray-900",children:[i==="search"&&"Pull Model",i==="files"&&m?.modelName,i==="downloading"&&"Downloading"]})]}),d.jsx("button",{onClick:l,className:"p-1 hover:bg-gray-100 rounded-lg transition-colors cursor-pointer",children:d.jsx(Gr,{className:"w-5 h-5"})})]}),d.jsxs("div",{className:"flex-1 overflow-y-auto",children:[i==="search"&&d.jsxs("div",{className:"p-4",children:[d.jsx("form",{onSubmit:C,children:d.jsxs("div",{className:"relative",children:[d.jsx(Z0,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400"}),d.jsx("input",{ref:x,type:"text",value:o,onChange:K=>c(K.target.value),placeholder:"Search Hugging Face models...",className:"w-full pl-10 pr-4 py-2.5 text-sm border border-gray-200 rounded-lg bg-gray-50 focus:bg-white focus:outline-none focus:ring-2 focus:ring-gray-200 focus:border-transparent"})]})}),d.jsxs("div",{className:"mt-4",children:[v.isPending&&d.jsx("div",{className:"flex items-center justify-center py-8",children:d.jsx(Pe,{className:"w-6 h-6 animate-spin text-gray-400"})}),v.isError&&d.jsx("p",{className:"text-center py-8 text-red-600 text-sm",children:"Search failed. Please try again."}),v.isSuccess&&v.data.results.length===0&&d.jsxs("p",{className:"text-center py-8 text-gray-500 text-sm",children:['No GGUF models found for "',o,'"']}),v.isSuccess&&v.data.results.length>0&&d.jsx("div",{className:"space-y-1",children:v.data.results.map(K=>d.jsx("button",{onClick:()=>M(K),className:"w-full text-left px-3 py-3 hover:bg-gray-50 rounded-lg transition-colors group cursor-pointer",children:d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("div",{className:"font-medium text-gray-900 truncate",children:K.modelName}),d.jsx("div",{className:"text-sm text-gray-500 truncate",children:K.author})]}),d.jsxs("div",{className:"flex items-center gap-3 ml-4",children:[d.jsxs("span",{className:"flex items-center gap-1 text-xs text-gray-500",children:[d.jsx(ai,{className:"w-3.5 h-3.5"}),V(K.downloads)]}),d.jsxs("span",{className:"flex items-center gap-1 text-xs text-gray-500",children:[d.jsx(d2,{className:"w-3.5 h-3.5"}),V(K.likes)]}),d.jsx(WS,{className:"w-4 h-4 text-gray-400 opacity-0 group-hover:opacity-100 transition-opacity"})]})]})},K.modelId))}),!v.isPending&&!v.isSuccess&&d.jsx("p",{className:"text-center py-8 text-gray-500 text-sm",children:"Search for GGUF models on Hugging Face"})]})]}),i==="files"&&d.jsxs("div",{className:"p-4",children:[E&&d.jsx("div",{className:"flex items-center justify-center py-8",children:d.jsx(Pe,{className:"w-6 h-6 animate-spin text-gray-400"})}),N&&N.files.length===0&&d.jsx("p",{className:"text-center py-8 text-gray-500 text-sm",children:"No GGUF files found in this repository"}),N&&N.files.length>0&&d.jsx("div",{className:"space-y-1",children:N.files.map(K=>d.jsx("button",{onClick:()=>D(K),disabled:S.isPending,className:"w-full text-left px-3 py-3 hover:bg-gray-50 rounded-lg transition-colors group disabled:opacity-50 cursor-pointer disabled:cursor-not-allowed",children:d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[d.jsx(Ks,{className:"w-4 h-4 text-gray-400 flex-shrink-0"}),d.jsx("span",{className:"text-sm text-gray-900 truncate",children:K})]}),d.jsx(ai,{className:"w-4 h-4 text-gray-400 opacity-0 group-hover:opacity-100 transition-opacity flex-shrink-0 ml-2"})]})},K))})]}),i==="downloading"&&d.jsx("div",{className:"p-6",children:d.jsx("div",{className:"text-center",children:k?.job?.status==="failed"?d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"w-12 h-12 mx-auto mb-4 rounded-full bg-red-100 flex items-center justify-center",children:d.jsx(Gr,{className:"w-6 h-6 text-red-600"})}),d.jsx("h3",{className:"font-medium text-gray-900 mb-2",children:"Download Failed"}),d.jsx("p",{className:"text-sm text-gray-500 mb-4",children:k.job.error}),d.jsx("button",{onClick:F,className:"px-4 py-2 text-sm font-medium text-gray-700 bg-gray-100 hover:bg-gray-200 rounded-lg transition-colors cursor-pointer",children:"Try Again"})]}):d.jsxs(d.Fragment,{children:[d.jsx(Pe,{className:"w-12 h-12 mx-auto mb-4 animate-spin text-gray-400"}),d.jsx("h3",{className:"font-medium text-gray-900 mb-1",children:k?.job?.filename||"Starting download..."}),k?.job?.progress&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"w-full bg-gray-200 rounded-full h-2 mb-2",children:d.jsx("div",{className:"bg-gray-900 h-2 rounded-full transition-all duration-300",style:{width:`${k.job.progress.percentage}%`}})}),d.jsxs("p",{className:"text-sm text-gray-500",children:[q(k.job.progress.downloaded)," / ",q(k.job.progress.total)," · ",k.job.progress.speed]})]}),!k?.job?.progress&&d.jsx("p",{className:"text-sm text-gray-500",children:"Connecting..."})]})})})]})]})}):null}function IE(){const{data:t}=P0(!0),l=J2(),i=(t?.jobs||[]).filter(o=>o.status==="pending"||o.status==="downloading");if(i.length===0)return null;const u=o=>{l.mutate(o)};return d.jsx("div",{className:"fixed bottom-4 right-4 z-40 w-80",children:d.jsxs("div",{className:"bg-white rounded-lg shadow-lg border border-gray-200 overflow-hidden",children:[d.jsxs("div",{className:"px-4 py-2.5 bg-gray-50 border-b border-gray-200 flex items-center gap-2",children:[d.jsx(ai,{className:"w-4 h-4 text-gray-600"}),d.jsxs("span",{className:"text-sm font-medium text-gray-700",children:[i.length," download",i.length!==1?"s":""," in progress"]})]}),d.jsx("div",{className:"max-h-60 overflow-y-auto divide-y divide-gray-100",children:i.map(o=>d.jsx(XE,{job:o,onCancel:()=>u(o.id)},o.id))})]})})}function XE({job:t,onCancel:l}){const a=u=>u>=1e9?`${(u/1e9).toFixed(1)} GB`:u>=1e6?`${(u/1e6).toFixed(1)} MB`:`${(u/1e3).toFixed(1)} KB`,i=()=>{switch(t.status){case"completed":return d.jsx(l2,{className:"w-4 h-4 text-green-500"});case"failed":case"cancelled":return d.jsx(Rf,{className:"w-4 h-4 text-red-500"});default:return d.jsx(Pe,{className:"w-4 h-4 text-gray-400 animate-spin"})}};return d.jsxs("div",{className:"px-4 py-3",children:[d.jsxs("div",{className:"flex items-center justify-between mb-1",children:[d.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[i(),d.jsx("span",{className:"text-sm font-medium text-gray-900 truncate",children:t.filename})]}),(t.status==="pending"||t.status==="downloading")&&d.jsx("button",{onClick:l,className:"p-1 hover:bg-gray-100 rounded transition-colors cursor-pointer",title:"Cancel download",children:d.jsx(Gr,{className:"w-4 h-4 text-gray-400"})})]}),t.progress&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"w-full bg-gray-200 rounded-full h-1.5 mb-1",children:d.jsx("div",{className:"bg-gray-700 h-1.5 rounded-full transition-all duration-300",style:{width:`${t.progress.percentage}%`}})}),d.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-500",children:[d.jsxs("span",{children:[a(t.progress.downloaded)," / ",a(t.progress.total)]}),d.jsx("span",{children:t.progress.speed})]})]}),t.status==="pending"&&!t.progress&&d.jsx("p",{className:"text-xs text-gray-500",children:"Starting..."}),t.status==="failed"&&t.error&&d.jsx("p",{className:"text-xs text-red-500 truncate",children:t.error}),t.status==="cancelled"&&d.jsx("p",{className:"text-xs text-gray-500",children:"Cancelled"})]})}function $E({searchQuery:t=""}){const l=ft(),{data:a,isLoading:i}=Mf(),u=K2(),{data:o}=P0(!0),[c,m]=A.useState(null),[p,g]=A.useState(!1),[y,x]=A.useState("all"),[v,S]=A.useState(()=>localStorage.getItem("llamacpp_models_view")||"grid"),N=T=>{S(T),localStorage.setItem("llamacpp_models_view",T)},E=(o?.jobs||[]).some(T=>T.status==="pending"||T.status==="downloading"),k=()=>{l.invalidateQueries({queryKey:["models"]})},C=a?.models||[],M=A.useMemo(()=>{let T=C;if(t){const P=t.toLowerCase();T=T.filter(H=>H.filename.toLowerCase().includes(P))}return y==="active"?T=T.filter(P=>P.serversUsing>0):y==="inactive"&&(T=T.filter(P=>P.serversUsing===0)),T},[C,t,y]),D=T=>T.isSharded&&T.baseModelName?T.baseModelName:T.filename,F=async T=>{const P=D(T),H=ne(T);if(T.serversUsing>0){if(!confirm(`Model "${H}" is used by ${T.serversUsing} server(s). Delete the model AND all associated servers?`))return}else if(!confirm(`Delete model "${H}"? This cannot be undone.`))return;m(P);try{await u.mutateAsync({name:P,cascade:T.serversUsing>0})}finally{m(null)}},V=T=>T>=1e9?`${(T/1e9).toFixed(1)} GB`:T>=1e6?`${(T/1e6).toFixed(1)} MB`:`${(T/1e3).toFixed(1)} KB`,q=T=>{const P=typeof T=="string"?new Date(T):T,ie=new Date().getTime()-P.getTime(),re=Math.floor(ie/(1e3*60*60*24));return re===0?"Today":re===1?"Yesterday":re<7?`${re}d ago`:re<30?`${Math.floor(re/7)}w ago`:P.toLocaleDateString("en-US",{month:"short",day:"numeric"})},K=T=>{if(T.isSharded){const P=T.shardPaths?.length||0,H=T.shardCount||0;if(P<H)return`${P}/${H} incomplete`}else{if(!T.exists)return"missing";if(T.size===0)return"empty"}return null},ne=T=>{if(T.isSharded){const P=T.shardPaths?.length||0,H=T.shardCount||0;return P<H?`${T.baseModelName} (${P}/${H} incomplete)`:`${T.baseModelName} (${P}/${H})`}return T.filename.replace(".gguf","")};if(i)return d.jsx("div",{className:"max-w-7xl mx-auto px-6 py-12",children:d.jsx("p",{className:"text-neutral-500 text-center",children:"Loading..."})});const le=C.filter(T=>T.serversUsing>0);return d.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-8",children:[d.jsxs("div",{className:"flex items-center justify-between mb-6",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-semibold text-neutral-900 tracking-tight",children:"Models"}),d.jsxs("p",{className:"text-sm text-neutral-600 mt-1",children:[C.length," model",C.length!==1?"s":""," available",le.length>0&&` • ${le.length} active`]})]}),d.jsxs("button",{onClick:()=>g(!0),className:"inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-neutral-900 hover:bg-neutral-800 rounded-md transition-colors cursor-pointer",children:[d.jsx(ai,{className:"w-4 h-4"}),"Pull Model"]})]}),d.jsxs("div",{className:"flex items-center justify-between mb-6",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{onClick:()=>x("all"),className:`px-3 py-1.5 text-sm font-medium rounded-full border transition-all cursor-pointer ${y==="all"?"bg-neutral-900 text-white border-neutral-900":"bg-white text-neutral-600 border-neutral-200 hover:border-neutral-300"}`,children:"All"}),d.jsx("button",{onClick:()=>x("active"),className:`px-3 py-1.5 text-sm font-medium rounded-full border transition-all cursor-pointer ${y==="active"?"bg-neutral-900 text-white border-neutral-900":"bg-white text-neutral-600 border-neutral-200 hover:border-neutral-300"}`,children:"Active"}),d.jsx("button",{onClick:()=>x("inactive"),className:`px-3 py-1.5 text-sm font-medium rounded-full border transition-all cursor-pointer ${y==="inactive"?"bg-neutral-900 text-white border-neutral-900":"bg-white text-neutral-600 border-neutral-200 hover:border-neutral-300"}`,children:"Inactive"})]}),d.jsxs("div",{className:"flex items-center gap-1 p-1 bg-white border border-neutral-200 rounded-lg",children:[d.jsx("button",{onClick:()=>N("grid"),className:`p-1.5 rounded transition-colors cursor-pointer ${v==="grid"?"bg-neutral-900 text-white":"text-neutral-600 hover:text-neutral-900 hover:bg-neutral-50"}`,title:"Grid view",children:d.jsx(I0,{className:"w-4 h-4"})}),d.jsx("button",{onClick:()=>N("list"),className:`p-1.5 rounded transition-colors cursor-pointer ${v==="list"?"bg-neutral-900 text-white":"text-neutral-600 hover:text-neutral-900 hover:bg-neutral-50"}`,title:"List view",children:d.jsx(X0,{className:"w-4 h-4"})})]})]}),M.length===0?d.jsx("div",{className:"text-center py-16 bg-white border border-neutral-200 rounded-lg",children:t?d.jsxs(d.Fragment,{children:[d.jsxs("p",{className:"text-neutral-600 text-base mb-2",children:['No models matching "',t,'"']}),d.jsx("p",{className:"text-sm text-neutral-500",children:"Try a different search term"})]}):y!=="all"&&C.length>0?d.jsxs(d.Fragment,{children:[d.jsxs("p",{className:"text-neutral-600 text-base mb-2",children:["No ",y," models"]}),d.jsx("p",{className:"text-sm text-neutral-500",children:"Try a different filter"})]}):d.jsxs(d.Fragment,{children:[d.jsx("p",{className:"text-neutral-600 text-base mb-2",children:"No models found"}),d.jsx("p",{className:"text-sm text-neutral-500 mb-6",children:"Download models from Hugging Face to get started"}),d.jsxs("button",{onClick:()=>g(!0),className:"inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-neutral-900 hover:bg-neutral-800 rounded-md transition-colors cursor-pointer",children:[d.jsx(ai,{className:"w-4 h-4"}),"Pull Model"]})]})}):v==="grid"?d.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:M.map(T=>{const P=K(T),H=ne(T);return d.jsxs("div",{className:"group bg-white border border-neutral-200 rounded-lg p-5 hover:border-neutral-300 hover:shadow-sm transition-all",children:[d.jsx("div",{className:"flex items-start justify-between mb-4",children:d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("div",{className:"flex items-start gap-2 mb-2",children:[P&&d.jsx(lf,{className:"w-4 h-4 text-amber-500 flex-shrink-0 mt-0.5"}),d.jsx("h3",{className:`text-base font-semibold truncate ${P?"text-amber-600":"text-neutral-900"}`,children:H})]}),d.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[P&&d.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded-md border border-amber-200/50 bg-amber-50 text-xs font-medium text-amber-700",children:P}),T.serversUsing>0&&d.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded-md border border-green-200/50 bg-green-50 text-xs font-medium text-green-700",children:"active"}),T.isSharded&&!P&&d.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded-md border border-blue-200/50 bg-blue-50 text-xs font-medium text-blue-700",children:"sharded"}),d.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded-md border border-neutral-200 bg-neutral-50 text-xs font-medium text-neutral-600",children:"gguf"})]})]})}),");",d.jsxs("div",{className:"space-y-2 mb-4",children:[d.jsxs("div",{className:"flex items-center gap-2 text-xs text-neutral-600",children:[d.jsx(Ks,{className:"w-3.5 h-3.5 text-neutral-400"}),d.jsx("span",{children:V(T.size)})]}),d.jsxs("div",{className:"flex items-center gap-2 text-xs text-neutral-600",children:[d.jsx(T2,{className:"w-3.5 h-3.5 text-neutral-400"}),d.jsxs("span",{children:[T.serversUsing," server",T.serversUsing!==1?"s":""]})]}),d.jsxs("div",{className:"flex items-center gap-2 text-xs text-neutral-600",children:[d.jsx(ef,{className:"w-3.5 h-3.5 text-neutral-400"}),d.jsx("span",{children:q(T.modified)})]})]}),d.jsx("button",{onClick:()=>F(T),disabled:c===D(T),className:"w-full flex items-center justify-center gap-1.5 px-3 py-1.5 text-xs font-medium text-neutral-600 hover:text-red-600 hover:bg-red-50 rounded-md transition-colors opacity-0 group-hover:opacity-100 disabled:opacity-100 cursor-pointer disabled:cursor-wait",children:c===D(T)?d.jsxs(d.Fragment,{children:[d.jsx(Pe,{className:"w-3.5 h-3.5 animate-spin"}),"Deleting"]}):d.jsxs(d.Fragment,{children:[d.jsx(Il,{className:"w-3.5 h-3.5"}),"Delete"]})})]},T.filename)})}):d.jsx("div",{className:"bg-white border border-neutral-200 rounded-lg divide-y divide-neutral-200",children:M.map(T=>{const P=K(T),H=ne(T);return d.jsx("div",{className:"group px-5 py-4 hover:bg-neutral-50 transition-colors",children:d.jsxs("div",{className:"flex items-center justify-between gap-4",children:[d.jsxs("div",{className:"flex items-center gap-4 flex-1 min-w-0",children:[P?d.jsx(lf,{className:"w-5 h-5 text-amber-500 flex-shrink-0"}):d.jsx(Ks,{className:"w-5 h-5 text-neutral-400 flex-shrink-0"}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("h3",{className:`text-sm font-semibold truncate ${P?"text-amber-600":"text-neutral-900"}`,children:H}),d.jsxs("div",{className:"flex items-center gap-3 mt-1",children:[d.jsx("span",{className:"text-xs text-neutral-600",children:V(T.size)}),d.jsx("span",{className:"text-xs text-neutral-400",children:"•"}),d.jsxs("span",{className:"text-xs text-neutral-600",children:[T.serversUsing," server",T.serversUsing!==1?"s":""]}),d.jsx("span",{className:"text-xs text-neutral-400",children:"•"}),d.jsx("span",{className:"text-xs text-neutral-600",children:q(T.modified)})]})]})]}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsxs("div",{className:"flex items-center gap-1.5",children:[P&&d.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded-md border border-amber-200/50 bg-amber-50 text-xs font-medium text-amber-700",children:P}),T.serversUsing>0&&d.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded-md border border-green-200/50 bg-green-50 text-xs font-medium text-green-700",children:"active"}),T.isSharded&&!P&&d.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded-md border border-blue-200/50 bg-blue-50 text-xs font-medium text-blue-700",children:"sharded"}),d.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded-md border border-neutral-200 bg-neutral-50 text-xs font-medium text-neutral-600",children:"gguf"})]}),d.jsx("button",{onClick:()=>F(T),disabled:c===D(T),className:"flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-neutral-600 hover:text-red-600 hover:bg-red-50 rounded-md transition-colors cursor-pointer disabled:cursor-wait",children:c===D(T)?d.jsxs(d.Fragment,{children:[d.jsx(Pe,{className:"w-3.5 h-3.5 animate-spin"}),"Deleting"]}):d.jsxs(d.Fragment,{children:[d.jsx(Il,{className:"w-3.5 h-3.5"}),"Delete"]})})]})]})},T.filename)})}),d.jsx(KE,{isOpen:p,onClose:()=>g(!1),onDownloadComplete:k}),E&&d.jsx(IE,{})]})}function ZE(){const t=Nl();return A.useEffect(()=>{t("/manage",{replace:!0})},[t]),null}function JE(){const t=Nl(),[l,a]=A.useState("activity"),[i,u]=A.useState("newest"),[o,c]=A.useState(!1),[m,p]=A.useState(!1),g=A.useRef(null),y=A.useRef(null),{data:x}=zf(),{data:v,isLoading:S}=ew(5e4);A.useEffect(()=>{m&&g.current&&(g.current.scrollTop=g.current.scrollHeight)},[v,m,i]),A.useEffect(()=>{const k=C=>{y.current&&!y.current.contains(C.target)&&c(!1)};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[]);const E=(()=>{if(!v)return[];console.log("[RouterLogs] Data lengths:",{stdout:v.stdout?.length||0,stderr:v.stderr?.length||0,logType:l});let k;l==="activity"?k=v.stdout||"":k=v.stderr||"";const C=k.split(`
48
+ `).filter(M=>Wa(M).trim().length>0);return console.log("[RouterLogs] After filtering:",{logType:l,totalLines:k.split(`
49
+ `).length,filteredLines:C.length,firstLine:C[0]?.substring(0,100)}),i==="oldest"?C:[...C].reverse()})();return d.jsxs("div",{className:"h-[calc(100vh-56px)] flex flex-col",children:[d.jsx("div",{className:"flex items-center px-4 py-3 border-b border-gray-200 bg-white",children:d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("button",{onClick:()=>t("/manage"),className:"p-1.5 text-gray-500 hover:text-gray-700 hover:bg-gray-100 rounded-lg transition-colors cursor-pointer",children:d.jsx(ci,{className:"w-5 h-5"})}),d.jsxs("div",{children:[d.jsx("h1",{className:"text-lg font-semibold text-gray-900",children:"Router Logs"}),d.jsx("p",{className:"text-sm text-gray-500",children:"Unified model routing service"})]})]})}),x?.config&&!x.config.logging&&d.jsx("div",{className:"px-4 py-2 bg-yellow-50 border-b border-yellow-200",children:d.jsx("p",{className:"text-sm text-yellow-800",children:"ℹ️ Logging is disabled. Enable logging in router configuration to view activity logs."})}),d.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-100 bg-gray-50",children:[d.jsx("div",{className:"flex items-center gap-2",children:d.jsxs("div",{className:"flex items-center bg-white border border-gray-200 rounded-lg overflow-hidden",children:[d.jsx("button",{onClick:()=>a("activity"),className:`px-3 py-1.5 text-sm font-medium transition-colors cursor-pointer ${l==="activity"?"bg-gray-100 text-gray-900":"text-gray-600 hover:bg-gray-50"}`,children:"Activity"}),d.jsx("button",{onClick:()=>a("system"),className:`px-3 py-1.5 text-sm font-medium transition-colors cursor-pointer ${l==="system"?"bg-gray-100 text-gray-900":"text-gray-600 hover:bg-gray-50"}`,children:"System"})]})}),d.jsxs("div",{className:"relative",ref:y,children:[d.jsxs("button",{onClick:()=>c(!o),className:"flex items-center gap-2 px-3 py-1.5 text-sm font-medium text-gray-600 bg-white border border-gray-200 rounded-lg hover:border-gray-300 transition-colors cursor-pointer",children:[i==="newest"?"Newest":"Oldest",d.jsx(Nn,{className:"w-4 h-4"})]}),o&&d.jsxs("div",{className:"absolute right-0 top-full mt-1 w-32 bg-white border border-gray-200 rounded-lg shadow-lg z-10",children:[d.jsx("button",{onClick:()=>{u("newest"),c(!1)},className:`w-full text-left px-3 py-2 text-sm transition-colors cursor-pointer ${i==="newest"?"bg-gray-100 text-gray-900":"text-gray-600 hover:bg-gray-50"}`,children:"Newest"}),d.jsx("button",{onClick:()=>{u("oldest"),c(!1)},className:`w-full text-left px-3 py-2 text-sm transition-colors cursor-pointer ${i==="oldest"?"bg-gray-100 text-gray-900":"text-gray-600 hover:bg-gray-50"}`,children:"Oldest"})]})]})]}),d.jsx("div",{ref:g,className:"flex-1 overflow-y-auto bg-gray-900 p-4 font-mono text-sm",onScroll:k=>{const C=k.target,M=C.scrollHeight-C.scrollTop<=C.clientHeight+50;p(M)},children:S?d.jsx("div",{className:"flex items-center justify-center h-full",children:d.jsx(Pe,{className:"w-6 h-6 animate-spin text-gray-400"})}):E.length===0?d.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-gray-500",children:[d.jsx("p",{children:"No logs found"}),d.jsx("p",{className:"text-sm mt-1",children:"Router may not be running or has no activity yet"})]}):d.jsx("div",{className:"space-y-0.5",children:E.map((k,C)=>d.jsx("div",{className:"break-all whitespace-pre-wrap leading-relaxed",children:Of(k,C)},C))})}),d.jsx("div",{className:"px-4 py-2 border-t border-gray-200 bg-gray-50 text-sm text-gray-500",children:d.jsxs("span",{children:[E.length," ",E.length===1?"line":"lines"]})})]})}function PE({adminData:t,isOpen:l,onToggle:a}){return d.jsxs("div",{className:"bg-white border border-neutral-200 rounded-lg mb-6 overflow-hidden",children:[d.jsxs("button",{onClick:a,className:"w-full px-5 py-4 flex items-center justify-between hover:bg-neutral-50 transition-colors",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:"w-10 h-10 rounded-lg bg-purple-50 flex items-center justify-center",children:d.jsx(nf,{className:"w-5 h-5 text-purple-600"})}),d.jsxs("div",{className:"text-left",children:[d.jsx("h3",{className:"text-base font-semibold text-neutral-900",children:"Admin Service"}),d.jsx("p",{className:"text-sm text-neutral-500",children:"Management API and web interface on port 9200"})]})]}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2 py-1 rounded-md text-xs font-medium bg-green-50 text-green-700 border border-green-200/50",children:[d.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-green-500"}),"Running"]}),l?d.jsx(Gl,{className:"w-5 h-5 text-neutral-400"}):d.jsx(Nn,{className:"w-5 h-5 text-neutral-400"})]})]}),l&&d.jsx("div",{className:"border-t border-neutral-200 px-5 py-4",children:d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"flex items-center gap-2 pb-4 border-b border-neutral-200",children:[d.jsx("a",{href:"/admin/logs",className:"px-3 py-1.5 text-xs font-medium text-neutral-700 bg-neutral-100 rounded-md hover:bg-neutral-200 transition-colors",children:"Logs"}),d.jsxs("a",{href:"/api-docs/",target:"_blank",rel:"noopener noreferrer",className:"px-3 py-1.5 text-xs font-medium text-neutral-700 bg-neutral-100 rounded-md hover:bg-neutral-200 transition-colors flex items-center gap-1.5",children:["API Docs",d.jsx(o2,{className:"w-3 h-3"})]})]}),t?.config&&d.jsxs("div",{className:"space-y-2",children:[d.jsx("h4",{className:"text-xs font-semibold text-neutral-900 mb-2",children:"Service Information"}),d.jsxs("div",{className:"flex items-center gap-2 text-xs text-neutral-600",children:[d.jsx("span",{className:"text-neutral-400 w-32",children:"Host:"}),d.jsx("span",{children:t.config.host})]}),d.jsxs("div",{className:"flex items-center gap-2 text-xs text-neutral-600",children:[d.jsx("span",{className:"text-neutral-400 w-32",children:"Port:"}),d.jsx("span",{children:t.config.port})]}),d.jsxs("div",{className:"flex items-center gap-2 text-xs text-neutral-600",children:[d.jsx("span",{className:"text-neutral-400 w-32",children:"Logging:"}),d.jsx("span",{children:t.config.logging?"Enabled":"Disabled"})]}),d.jsxs("div",{className:"flex items-center gap-2 text-xs text-neutral-600",children:[d.jsx("span",{className:"text-neutral-400 w-32",children:"Request Timeout:"}),d.jsxs("span",{children:[(t.config.requestTimeout/1e3).toFixed(0),"s"]})]})]})]})})]})}function WE({isOpen:t,onToggle:l,routerData:a,routerActionLoading:i,onStart:u,onStop:o,onRestart:c,onConfigure:m}){const p=()=>{if(!a)return d.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2 py-1 rounded-md text-xs font-medium bg-neutral-100 text-neutral-700",children:[d.jsx(Pe,{className:"w-3 h-3 animate-spin"}),"Loading"]});if(i)return d.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2 py-1 rounded-md text-xs font-medium bg-neutral-100 text-neutral-700",children:[d.jsx(Pe,{className:"w-3 h-3 animate-spin"}),i==="start"&&"Starting",i==="stop"&&"Stopping",i==="restart"&&"Restarting"]});const g=a.status==="not_configured",y=a.isRunning||!1;return g?d.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2 py-1 rounded-md text-xs font-medium bg-neutral-100 text-neutral-600",children:[d.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-neutral-400"}),"Not Configured"]}):y?d.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2 py-1 rounded-md text-xs font-medium bg-green-50 text-green-700 border border-green-200/50",children:[d.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-green-500"}),"Running"]}):d.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2 py-1 rounded-md text-xs font-medium bg-neutral-100 text-neutral-600",children:[d.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-neutral-400"}),"Stopped"]})};return d.jsxs("div",{className:"bg-white border border-neutral-200 rounded-lg mb-6 overflow-hidden",children:[d.jsxs("button",{onClick:l,className:"w-full px-5 py-4 flex items-center justify-between hover:bg-neutral-50 transition-colors",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:"w-10 h-10 rounded-lg bg-blue-50 flex items-center justify-center",children:d.jsx(M2,{className:"w-5 h-5 text-blue-600"})}),d.jsxs("div",{className:"text-left",children:[d.jsx("h3",{className:"text-base font-semibold text-neutral-900",children:"Router Service"}),d.jsx("p",{className:"text-sm text-neutral-500",children:a?.status==="not_configured"?"Not yet configured":`Unified model routing on port ${a?.config?.port||"N/A"}`})]})]}),d.jsxs("div",{className:"flex items-center gap-3",children:[p(),t?d.jsx(Gl,{className:"w-5 h-5 text-neutral-400"}):d.jsx(Nn,{className:"w-5 h-5 text-neutral-400"})]})]}),t&&d.jsx("div",{className:"border-t border-neutral-200 px-5 py-4",children:d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"flex items-center gap-2 pb-4 border-b border-neutral-200",children:[a?.status!=="not_configured"&&a?.isRunning&&d.jsx("a",{href:"/router/logs",className:"px-3 py-1.5 text-xs font-medium text-neutral-700 bg-neutral-100 rounded-md hover:bg-neutral-200 transition-colors",children:"Logs"}),a?.status!=="not_configured"&&d.jsx("button",{onClick:m,disabled:i!==null,className:"px-3 py-1.5 text-xs font-medium text-neutral-700 bg-neutral-100 rounded-md hover:bg-neutral-200 transition-colors disabled:opacity-50 disabled:cursor-wait",children:"Configure"}),a?.status!=="not_configured"&&a?.isRunning&&d.jsxs(d.Fragment,{children:[d.jsx("button",{onClick:c,disabled:i!==null,className:"px-3 py-1.5 text-xs font-medium text-neutral-700 bg-neutral-100 rounded-md hover:bg-neutral-200 transition-colors disabled:opacity-50 disabled:cursor-wait",children:"Restart"}),d.jsx("button",{onClick:o,disabled:i!==null,className:"px-3 py-1.5 text-xs font-medium text-red-700 bg-red-50 rounded-md hover:bg-red-100 transition-colors disabled:opacity-50 disabled:cursor-wait",children:"Stop"})]}),(a?.status==="not_configured"||!a?.isRunning)&&d.jsx("button",{onClick:u,disabled:i!==null,className:"px-3 py-1.5 text-xs font-medium text-green-700 bg-green-50 rounded-md hover:bg-green-100 transition-colors disabled:opacity-50 disabled:cursor-wait",children:"Start"})]}),a?.status!=="not_configured"&&a?.config&&d.jsxs("div",{className:"space-y-2",children:[d.jsx("h4",{className:"text-xs font-semibold text-neutral-900 mb-2",children:"Configuration"}),d.jsxs("div",{className:"flex items-center gap-2 text-xs text-neutral-600",children:[d.jsx("span",{className:"text-neutral-400 w-32",children:"Host:"}),d.jsx("span",{children:a.config.host})]}),d.jsxs("div",{className:"flex items-center gap-2 text-xs text-neutral-600",children:[d.jsx("span",{className:"text-neutral-400 w-32",children:"Port:"}),d.jsx("span",{children:a.config.port})]}),d.jsxs("div",{className:"flex items-center gap-2 text-xs text-neutral-600",children:[d.jsx("span",{className:"text-neutral-400 w-32",children:"Request Timeout:"}),d.jsxs("span",{children:[(a.config.requestTimeout/1e3).toFixed(0),"s"]})]}),d.jsxs("div",{className:"flex items-center gap-2 text-xs text-neutral-600",children:[d.jsx("span",{className:"text-neutral-400 w-32",children:"Logging:"}),d.jsx("span",{children:a.config.logging?"Enabled":"Disabled"})]})]}),a?.status!=="not_configured"&&a&&d.jsxs("div",{className:"pt-4 border-t border-neutral-200",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[d.jsx(IS,{className:"w-3.5 h-3.5 text-neutral-400"}),d.jsx("h4",{className:"text-xs font-semibold text-neutral-900",children:"Available Models"})]}),a.availableModels.length>0?d.jsx("div",{className:"flex flex-wrap gap-2",children:a.availableModels.map(g=>d.jsx("span",{className:"inline-flex items-center px-2 py-1 text-xs font-medium text-neutral-700 bg-neutral-100 rounded-md",children:g.replace(".gguf","")},g))}):d.jsx("p",{className:"text-xs text-neutral-500",children:"No models available. Start some servers to enable routing."})]}),a?.status==="not_configured"&&d.jsx("div",{className:"pt-2",children:d.jsx("p",{className:"text-sm text-neutral-600",children:'Click "Start" to configure and launch the router service. The router will automatically discover and route requests to running servers.'})})]})})]})}function e3({isOpen:t,onToggle:l,logsData:a,onRotateLogs:i,onClearArchived:u,onUpdateConfig:o,formatSize:c,updateConfigPending:m}){const[p,g]=A.useState(!1),[y,x]=A.useState(!1),[v,S]=A.useState(!1),[N,E]=A.useState(!1),[k,C]=A.useState({}),M=a?.config||{autoRotate:{enabled:!1,intervalHours:24,thresholdMB:100},autoDelete:{enabled:!1,intervalHours:24,afterDays:30}},D={autoRotate:{...M.autoRotate,...k.autoRotate},autoDelete:{...M.autoDelete,...k.autoDelete}},F=async()=>{await o(k),C({}),g(!1)};return d.jsxs("div",{className:"bg-white border border-neutral-200 rounded-lg mb-6 overflow-hidden",children:[d.jsxs("button",{onClick:l,className:"w-full px-5 py-4 flex items-center justify-between hover:bg-neutral-50 transition-colors",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:"w-10 h-10 rounded-lg bg-orange-50 flex items-center justify-center",children:d.jsx(Vs,{className:"w-5 h-5 text-orange-600"})}),d.jsxs("div",{className:"text-left",children:[d.jsx("h3",{className:"text-base font-semibold text-neutral-900",children:"Log Management"}),d.jsxs("p",{className:"text-sm text-neutral-500",children:[c(a?.summary.grandTotal||0)," across ",a?.servers.length||0," servers"]})]})]}),d.jsxs("div",{className:"flex items-center gap-3",children:[a?.config.autoRotate.enabled?d.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2 py-1 rounded-md text-xs font-medium bg-green-50 text-green-700 border border-green-200/50",children:[d.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-green-500"}),"Auto-Rotation On"]}):d.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2 py-1 rounded-md text-xs font-medium bg-neutral-100 text-neutral-600",children:[d.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-neutral-400"}),"Auto-Rotation Off"]}),t?d.jsx(Gl,{className:"w-5 h-5 text-neutral-400"}):d.jsx(Nn,{className:"w-5 h-5 text-neutral-400"})]})]}),t&&d.jsxs("div",{className:"border-t border-neutral-200",children:[d.jsx("div",{className:"px-5 py-4 border-b border-neutral-200",children:d.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3 mb-4",children:[d.jsxs("div",{className:"text-center p-3 bg-blue-50 rounded-lg border border-blue-200",children:[d.jsx("p",{className:"text-xs text-blue-700 mb-1 font-medium",children:"Total Size"}),d.jsx("p",{className:"text-lg font-semibold text-blue-900",children:c(a?.summary.grandTotal||0)})]}),d.jsxs("div",{className:"text-center p-3 bg-neutral-50 rounded-lg",children:[d.jsx("p",{className:"text-xs text-neutral-500 mb-1",children:"Current"}),d.jsx("p",{className:"text-lg font-semibold text-neutral-900",children:c(a?.summary.totalCurrent||0)})]}),d.jsxs("div",{className:"text-center p-3 bg-neutral-50 rounded-lg",children:[d.jsx("p",{className:"text-xs text-neutral-500 mb-1",children:"Archived"}),d.jsx("p",{className:"text-lg font-semibold text-neutral-900",children:c(a?.summary.totalArchived||0)})]}),d.jsxs("div",{className:"text-center p-3 bg-neutral-50 rounded-lg",children:[d.jsx("p",{className:"text-xs text-neutral-500 mb-1",children:"Servers"}),d.jsx("p",{className:"text-lg font-semibold text-neutral-900",children:a?.servers.length||0})]})]})}),d.jsxs("div",{className:"border-b border-neutral-200",children:[d.jsxs("button",{onClick:()=>g(!p),className:"w-full px-5 py-4 flex items-center justify-between hover:bg-neutral-50 transition-colors",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(nf,{className:"w-5 h-5 text-neutral-600"}),d.jsxs("div",{className:"text-left",children:[d.jsx("h3",{className:"text-base font-semibold text-neutral-900",children:"Automation Configuration"}),d.jsx("p",{className:"text-sm text-neutral-500",children:"Auto-rotation and auto-deletion settings"})]})]}),p?d.jsx(Gl,{className:"w-5 h-5 text-neutral-400"}):d.jsx(Nn,{className:"w-5 h-5 text-neutral-400"})]}),p&&d.jsxs("div",{className:"px-5 pb-5 border-t border-neutral-200",children:[d.jsxs("div",{className:"grid grid-cols-2 gap-6 mt-4",children:[d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("h4",{className:"text-sm font-semibold text-neutral-900",children:"Auto-Rotation"}),d.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[d.jsx("input",{type:"checkbox",checked:D.autoRotate.enabled,onChange:V=>C({...k,autoRotate:{...k.autoRotate,enabled:V.target.checked}}),className:"sr-only peer"}),d.jsx("div",{className:"w-11 h-6 bg-neutral-200 peer-focus:outline-none peer-focus:ring-2 peer-focus:ring-blue-300 rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-neutral-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-blue-600"})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-neutral-700 mb-1",children:"Check Interval (hours)"}),d.jsx("input",{type:"number",min:"1",value:D.autoRotate.intervalHours,onChange:V=>C({...k,autoRotate:{...k.autoRotate,intervalHours:parseInt(V.target.value)||1}}),className:"w-full px-3 py-2 text-sm border border-neutral-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-neutral-700 mb-1",children:"Size Threshold (MB)"}),d.jsx("input",{type:"number",min:"1",value:D.autoRotate.thresholdMB,onChange:V=>C({...k,autoRotate:{...k.autoRotate,thresholdMB:parseInt(V.target.value)||1}}),className:"w-full px-3 py-2 text-sm border border-neutral-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),a?.workers.autoRotate.lastRun&&d.jsxs("div",{className:"text-xs text-neutral-500 flex items-center gap-1.5",children:[d.jsx(ef,{className:"w-3.5 h-3.5"}),"Last run: ",new Date(a.workers.autoRotate.lastRun).toLocaleString()]})]}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("h4",{className:"text-sm font-semibold text-neutral-900",children:"Auto-Delete"}),d.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[d.jsx("input",{type:"checkbox",checked:D.autoDelete.enabled,onChange:V=>C({...k,autoDelete:{...k.autoDelete,enabled:V.target.checked}}),className:"sr-only peer"}),d.jsx("div",{className:"w-11 h-6 bg-neutral-200 peer-focus:outline-none peer-focus:ring-2 peer-focus:ring-blue-300 rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-neutral-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-blue-600"})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-neutral-700 mb-1",children:"Check Interval (hours)"}),d.jsx("input",{type:"number",min:"1",value:D.autoDelete.intervalHours,onChange:V=>C({...k,autoDelete:{...k.autoDelete,intervalHours:parseInt(V.target.value)||1}}),className:"w-full px-3 py-2 text-sm border border-neutral-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-neutral-700 mb-1",children:"Delete After (days)"}),d.jsx("input",{type:"number",min:"0",value:D.autoDelete.afterDays,onChange:V=>C({...k,autoDelete:{...k.autoDelete,afterDays:parseInt(V.target.value)||0}}),className:"w-full px-3 py-2 text-sm border border-neutral-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),a?.workers.autoDelete.lastRun&&d.jsxs("div",{className:"text-xs text-neutral-500 flex items-center gap-1.5",children:[d.jsx(ef,{className:"w-3.5 h-3.5"}),"Last run: ",new Date(a.workers.autoDelete.lastRun).toLocaleString()]})]})]}),Object.keys(k).length>0&&d.jsxs("div",{className:"flex gap-2 mt-4 pt-4 border-t border-neutral-200",children:[d.jsx("button",{onClick:F,disabled:m,className:"flex-1 px-4 py-2 text-sm font-medium text-white bg-blue-600 rounded-md hover:bg-blue-700 transition-colors disabled:opacity-50",children:m?"Saving...":"Save Configuration"}),d.jsx("button",{onClick:()=>C({}),className:"px-4 py-2 text-sm font-medium text-neutral-700 bg-white border border-neutral-300 rounded-md hover:bg-neutral-50 transition-colors",children:"Cancel"})]})]})]}),d.jsxs("div",{className:"border-b border-neutral-200",children:[d.jsxs("button",{onClick:()=>x(!y),className:"w-full px-5 py-4 flex items-center justify-between hover:bg-neutral-50 transition-colors",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(Vs,{className:"w-5 h-5 text-neutral-600"}),d.jsxs("div",{className:"text-left",children:[d.jsx("h3",{className:"text-base font-semibold text-neutral-900",children:"Server Logs"}),d.jsxs("p",{className:"text-sm text-neutral-500",children:[a?.servers.length||0," servers •"," ",c(a?.servers.reduce((V,q)=>V+q.currentTotal+q.archived.totalSize,0)||0)]})]})]}),y?d.jsx(Gl,{className:"w-5 h-5 text-neutral-400"}):d.jsx(Nn,{className:"w-5 h-5 text-neutral-400"})]}),y&&d.jsx("div",{className:"border-t border-neutral-200",children:a?.servers&&a.servers.length>0?d.jsx("div",{className:"divide-y divide-neutral-200",children:a.servers.map(V=>d.jsx(t3,{server:V,onRotate:i,onClearArchived:u,formatSize:c},V.serverId))}):d.jsx("div",{className:"px-5 py-8 text-center",children:d.jsx("p",{className:"text-sm text-neutral-500",children:"No servers configured"})})})]}),d.jsxs("div",{className:"border-b border-neutral-200",children:[d.jsxs("button",{onClick:()=>S(!v),className:"w-full px-5 py-4 flex items-center justify-between hover:bg-neutral-50 transition-colors",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(w2,{className:"w-5 h-5 text-neutral-600"}),d.jsxs("div",{className:"text-left",children:[d.jsx("h3",{className:"text-base font-semibold text-neutral-900",children:"Router Logs"}),d.jsx("p",{className:"text-sm text-neutral-500",children:c((a?.router.currentTotal||0)+(a?.router.archived.totalSize||0))})]})]}),v?d.jsx(Gl,{className:"w-5 h-5 text-neutral-400"}):d.jsx(Nn,{className:"w-5 h-5 text-neutral-400"})]}),v&&a?.router&&d.jsx("div",{className:"border-t border-neutral-200",children:d.jsx(g0,{type:"router",log:a.router,onRotate:i,onClearArchived:u,formatSize:c})})]}),d.jsxs("div",{className:"border-b border-neutral-200",children:[d.jsxs("button",{onClick:()=>E(!N),className:"w-full px-5 py-4 flex items-center justify-between hover:bg-neutral-50 transition-colors",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(nf,{className:"w-5 h-5 text-neutral-600"}),d.jsxs("div",{className:"text-left",children:[d.jsx("h3",{className:"text-base font-semibold text-neutral-900",children:"Admin Logs"}),d.jsx("p",{className:"text-sm text-neutral-500",children:c((a?.admin.currentTotal||0)+(a?.admin.archived.totalSize||0))})]})]}),N?d.jsx(Gl,{className:"w-5 h-5 text-neutral-400"}):d.jsx(Nn,{className:"w-5 h-5 text-neutral-400"})]}),N&&a?.admin&&d.jsx("div",{className:"border-t border-neutral-200",children:d.jsx(g0,{type:"admin",log:a.admin,onRotate:i,onClearArchived:u,formatSize:c})})]})]})]})}function t3({server:t,onRotate:l,onClearArchived:a,formatSize:i}){const u=(t.stdout?.size||0)+(t.stderr?.size||0)+(t.httpLog?.size||0),o=u>0?u:t.currentTotal,c=o+t.archived.totalSize;return d.jsxs("div",{className:"px-5 py-4 hover:bg-neutral-50 transition-colors",children:[d.jsx("h3",{className:"text-sm font-semibold text-neutral-900 mb-3",children:t.serverId}),d.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4 text-xs",children:[d.jsxs("div",{children:[d.jsx("span",{className:"text-neutral-500 block mb-2",children:"Current"}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-neutral-900 font-medium",children:i(o)}),d.jsx("button",{onClick:()=>l("server",t.serverId,["stdout","stderr","httpLog"]),disabled:o===0,className:"px-2 py-1 text-xs font-medium text-neutral-700 bg-neutral-100 rounded hover:bg-neutral-200 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:"Archive"})]})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-neutral-500 block mb-2",children:"Archived"}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs("span",{className:"text-neutral-900 font-medium",children:[t.archived.count," (",i(t.archived.totalSize),")"]}),d.jsx("button",{onClick:()=>a(t.serverId),disabled:t.archived.count===0,className:"px-2 py-1 text-xs font-medium text-neutral-700 bg-neutral-100 rounded hover:bg-neutral-200 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:"Delete"})]})]}),d.jsxs("div",{className:"hidden md:block",children:[d.jsx("span",{className:"text-neutral-500 block mb-2",children:"Total"}),d.jsx("span",{className:"text-neutral-900 font-semibold",children:i(c)})]})]})]})}function g0({type:t,log:l,onRotate:a,onClearArchived:i,formatSize:u}){const o=(l?.stdout.size||0)+(l?.stderr.size||0),c=o+(l?.archived.totalSize||0);return d.jsxs("div",{className:"px-5 py-4 hover:bg-neutral-50 transition-colors",children:[d.jsx("h3",{className:"text-sm font-semibold text-neutral-900 mb-3",children:t==="router"?"Router Logs":"Admin Logs"}),d.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4 text-xs",children:[d.jsxs("div",{children:[d.jsx("span",{className:"text-neutral-500 block mb-2",children:"Current"}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-neutral-900 font-medium",children:u(o)}),d.jsx("button",{onClick:()=>a(t,void 0,["stdout","stderr"]),disabled:o===0,className:"px-2 py-1 text-xs font-medium text-neutral-700 bg-neutral-100 rounded hover:bg-neutral-200 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:"Archive"})]})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-neutral-500 block mb-2",children:"Archived"}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs("span",{className:"text-neutral-900 font-medium",children:[l?.archived.count||0," (",u(l?.archived.totalSize||0),")"]}),d.jsx("button",{onClick:()=>i(t),disabled:(l?.archived.count||0)===0,className:"px-2 py-1 text-xs font-medium text-neutral-700 bg-neutral-100 rounded hover:bg-neutral-200 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:"Delete"})]})]}),d.jsxs("div",{className:"hidden md:block",children:[d.jsx("span",{className:"text-neutral-500 block mb-2",children:"Total"}),d.jsx("span",{className:"text-neutral-900 font-semibold",children:u(c)})]})]})]})}function n3({router:t,isOpen:l,onClose:a}){const i=tw(),u=W0(),[o,c]=A.useState({port:9100,host:"127.0.0.1",logging:!1,requestTimeout:12e4,healthCheckInterval:5e3}),[m,p]=A.useState(!0),[g,y]=A.useState(null),[x,v]=A.useState(!1);A.useEffect(()=>{l&&t?.config&&(y(null),v(!1),c({port:t.config.port,host:t.config.host,logging:t.config.logging,requestTimeout:t.config.requestTimeout,healthCheckInterval:t.config.healthCheckInterval}))},[l]);const S=async N=>{if(N.preventDefault(),!(!t||x)){y(null),v(!0);try{(await i.mutateAsync({port:o.port,host:o.host,logging:o.logging,requestTimeout:o.requestTimeout,healthCheckInterval:o.healthCheckInterval})).needsRestart&&t.isRunning?m?(await u.mutateAsync(),a()):(v(!1),y("Changes saved. Restart the router to apply them.")):a()}catch(E){v(!1),y(E.message)}}};return!l||!t?null:d.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:d.jsxs("div",{className:"bg-white rounded-xl shadow-xl w-full max-w-2xl mx-4 max-h-[90vh] flex flex-col",children:[d.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-200",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:"Configure Router"}),d.jsx("p",{className:"text-sm text-gray-500",children:"Unified model routing service"})]}),d.jsx("button",{onClick:a,className:"p-1 hover:bg-gray-100 rounded-lg transition-colors cursor-pointer",children:d.jsx(Gr,{className:"w-5 h-5"})})]}),d.jsxs("form",{onSubmit:S,className:"flex-1 overflow-y-auto p-4 space-y-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Port"}),d.jsx("input",{type:"number",value:o.port,onChange:N=>c({...o,port:parseInt(N.target.value)||9100}),min:1024,max:65535,className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-gray-200 focus:border-transparent"}),d.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Router service port (requires restart)"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Host"}),d.jsxs("select",{value:o.host,onChange:N=>c({...o,host:N.target.value}),className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-gray-200 focus:border-transparent bg-white",children:[d.jsx("option",{value:"127.0.0.1",children:"127.0.0.1 (localhost only)"}),d.jsx("option",{value:"0.0.0.0",children:"0.0.0.0 (all interfaces)"})]}),d.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Network interface (requires restart)"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Request Timeout"}),d.jsx("input",{type:"number",value:o.requestTimeout/1e3,onChange:N=>c({...o,requestTimeout:(parseInt(N.target.value)||120)*1e3}),min:10,max:600,step:10,className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-gray-200 focus:border-transparent"}),d.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:[o.requestTimeout/1e3,"s - Maximum time to wait for backend responses"]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Health Check Interval"}),d.jsx("input",{type:"number",value:o.healthCheckInterval/1e3,onChange:N=>c({...o,healthCheckInterval:(parseInt(N.target.value)||5)*1e3}),min:1,max:60,className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-gray-200 focus:border-transparent"}),d.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:[o.healthCheckInterval/1e3,"s - How often to check backend server health"]})]}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{children:[d.jsx("label",{className:"text-sm font-medium text-gray-700",children:"Logging"}),d.jsx("p",{className:"text-xs text-gray-500",children:"Enable logging to file (requires restart)"})]}),d.jsx("button",{type:"button",onClick:()=>c({...o,logging:!o.logging}),className:`relative w-11 h-6 rounded-full transition-colors cursor-pointer ${o.logging?"bg-gray-900":"bg-gray-200"}`,children:d.jsx("span",{className:`absolute top-0.5 left-0.5 w-5 h-5 bg-white rounded-full shadow transition-transform ${o.logging?"translate-x-5":""}`})})]}),t.isRunning&&d.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-gray-100",children:[d.jsx("input",{type:"checkbox",id:"restartAfterSave",checked:m,onChange:N=>p(N.target.checked),className:"w-4 h-4 text-gray-900 border-gray-300 rounded focus:ring-gray-200"}),d.jsx("label",{htmlFor:"restartAfterSave",className:"text-sm text-gray-700",children:"Restart router to apply changes"})]}),g&&d.jsx("div",{className:"p-3 bg-red-50 border border-red-200 rounded-lg",children:d.jsx("p",{className:"text-sm text-red-700",children:g})})]}),d.jsxs("div",{className:"flex items-center justify-end gap-2 px-4 py-3 border-t border-gray-200",children:[d.jsx("button",{type:"button",onClick:a,className:"px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-100 rounded-lg transition-colors cursor-pointer",children:"Cancel"}),d.jsx("button",{onClick:S,disabled:x,className:"inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-gray-900 hover:bg-gray-800 rounded-lg transition-colors disabled:opacity-50 disabled:cursor-wait cursor-pointer",children:x?d.jsxs(d.Fragment,{children:[d.jsx(Pe,{className:"w-4 h-4 animate-spin"}),"Saving..."]}):d.jsxs(d.Fragment,{children:[d.jsx($0,{className:"w-4 h-4"}),"Save Changes"]})})]})]})})}function l3(){const t=ft(),{data:l,isLoading:a}=lw(),{data:i}=nw(),u=aw(),o=iw(),c=sw(),{data:m}=zf(),p=P2(),g=W2(),y=W0(),[x,v]=A.useState(!1),[S,N]=A.useState(!1),[E,k]=A.useState(!1),[C,M]=A.useState({isOpen:!1,title:"",message:"",onConfirm:()=>{}}),[D,F]=A.useState(!1),[V,q]=A.useState(!1),[K,ne]=A.useState(null),le=U=>{if(U===0)return"0 B";const ee=1024,L=["B","KB","MB","GB"],pe=Math.floor(Math.log(U)/Math.log(ee));return`${(U/Math.pow(ee,pe)).toFixed(2)} ${L[pe]}`},T=async(U,ee,L)=>{await u.mutateAsync({type:U,serverId:ee,streams:L})},P=U=>{M({isOpen:!0,title:"Delete Archived Logs",message:`Are you sure you want to delete all archived logs for ${U||"all services"}?`,onConfirm:async()=>{F(!0);try{await o.mutateAsync({serverId:U}),M({...C,isOpen:!1})}finally{F(!1)}}})},H=async U=>{await c.mutateAsync(U)},ie=async()=>{ne("start");try{await p.mutateAsync(),await t.refetchQueries({queryKey:["router"]})}finally{ne(null)}},re=async()=>{ne("stop");try{await g.mutateAsync(),await t.refetchQueries({queryKey:["router"]})}finally{ne(null)}},te=async()=>{ne("restart");try{await y.mutateAsync(),await t.refetchQueries({queryKey:["router"]})}finally{ne(null)}};return a&&!l?d.jsx("div",{className:"max-w-7xl mx-auto px-6 py-12",children:d.jsx("p",{className:"text-neutral-500 text-center",children:"Loading..."})}):d.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-8",children:[d.jsxs("div",{className:"mb-8",children:[d.jsx("h1",{className:"text-2xl font-semibold text-neutral-900 tracking-tight",children:"Service Management"}),d.jsx("p",{className:"text-sm text-neutral-600 mt-1",children:"Manage services, logs, and system configuration"})]}),d.jsx(PE,{adminData:i,isOpen:x,onToggle:()=>v(!x)}),d.jsx(WE,{isOpen:S,onToggle:()=>N(!S),routerData:m,routerActionLoading:K,onStart:ie,onStop:re,onRestart:te,onConfigure:()=>q(!0)}),d.jsx(e3,{isOpen:E,onToggle:()=>k(!E),logsData:l,onRotateLogs:T,onClearArchived:P,onUpdateConfig:H,formatSize:le,updateConfigPending:c.isPending}),C.isOpen&&d.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:d.jsxs("div",{className:"bg-white rounded-lg p-6 max-w-md w-full mx-4",children:[d.jsx("h3",{className:"text-lg font-semibold text-neutral-900 mb-2",children:C.title}),d.jsx("p",{className:"text-sm text-neutral-600 mb-6",children:C.message}),d.jsxs("div",{className:"flex gap-2 justify-end",children:[d.jsx("button",{onClick:()=>M({...C,isOpen:!1}),disabled:D,className:"px-4 py-2 text-sm font-medium text-neutral-700 bg-white border border-neutral-300 rounded-md hover:bg-neutral-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Cancel"}),d.jsxs("button",{onClick:C.onConfirm,disabled:D,className:"px-4 py-2 text-sm font-medium text-white bg-red-600 rounded-md hover:bg-red-700 disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2",children:[D&&d.jsx(Pe,{className:"w-4 h-4 animate-spin"}),D?"Processing...":"Delete"]})]})]})}),d.jsx(n3,{router:m||null,isOpen:V,onClose:()=>q(!1)})]})}function r3(){const t=Nl(),[l,a]=A.useState("activity"),[i,u]=A.useState("newest"),[o,c]=A.useState(!1),[m,p]=A.useState(!1),g=A.useRef(null),y=A.useRef(null),{data:x,isLoading:v}=rw(5e4);A.useEffect(()=>{m&&g.current&&(g.current.scrollTop=g.current.scrollHeight)},[x,m,i]),A.useEffect(()=>{const E=k=>{y.current&&!y.current.contains(k.target)&&c(!1)};return document.addEventListener("mousedown",E),()=>document.removeEventListener("mousedown",E)},[]);const N=(()=>{if(!x)return[];let E;l==="activity"?E=x.stdout||"":E=x.stderr||"";const k=E.split(`
50
+ `).filter(C=>Wa(C).trim().length>0);return i==="oldest"?k:[...k].reverse()})();return d.jsxs("div",{className:"h-[calc(100vh-56px)] flex flex-col",children:[d.jsx("div",{className:"flex items-center px-4 py-3 border-b border-gray-200 bg-white",children:d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("button",{onClick:()=>t("/manage"),className:"p-1.5 text-gray-500 hover:text-gray-700 hover:bg-gray-100 rounded-lg transition-colors cursor-pointer",children:d.jsx(ci,{className:"w-5 h-5"})}),d.jsxs("div",{children:[d.jsx("h1",{className:"text-lg font-semibold text-gray-900",children:"Admin Logs"}),d.jsx("p",{className:"text-sm text-gray-500",children:"Admin API service logs"})]})]})}),d.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-100 bg-gray-50",children:[d.jsx("div",{className:"flex items-center gap-2",children:d.jsxs("div",{className:"flex items-center bg-white border border-gray-200 rounded-lg overflow-hidden",children:[d.jsx("button",{onClick:()=>a("activity"),className:`px-3 py-1.5 text-sm font-medium transition-colors cursor-pointer ${l==="activity"?"bg-gray-100 text-gray-900":"text-gray-600 hover:bg-gray-50"}`,children:"Activity"}),d.jsx("button",{onClick:()=>a("system"),className:`px-3 py-1.5 text-sm font-medium transition-colors cursor-pointer ${l==="system"?"bg-gray-100 text-gray-900":"text-gray-600 hover:bg-gray-50"}`,children:"System"})]})}),d.jsxs("div",{className:"relative",ref:y,children:[d.jsxs("button",{onClick:()=>c(!o),className:"flex items-center gap-2 px-3 py-1.5 text-sm font-medium text-gray-600 bg-white border border-gray-200 rounded-lg hover:border-gray-300 transition-colors cursor-pointer",children:[i==="newest"?"Newest":"Oldest",d.jsx(Nn,{className:"w-4 h-4"})]}),o&&d.jsxs("div",{className:"absolute right-0 top-full mt-1 w-32 bg-white border border-gray-200 rounded-lg shadow-lg z-10",children:[d.jsx("button",{onClick:()=>{u("newest"),c(!1)},className:`w-full text-left px-3 py-2 text-sm transition-colors cursor-pointer ${i==="newest"?"bg-gray-100 text-gray-900":"text-gray-600 hover:bg-gray-50"}`,children:"Newest"}),d.jsx("button",{onClick:()=>{u("oldest"),c(!1)},className:`w-full text-left px-3 py-2 text-sm transition-colors cursor-pointer ${i==="oldest"?"bg-gray-100 text-gray-900":"text-gray-600 hover:bg-gray-50"}`,children:"Oldest"})]})]})]}),d.jsx("div",{ref:g,className:"flex-1 overflow-y-auto bg-gray-900 p-4 font-mono text-sm",onScroll:E=>{const k=E.target,C=k.scrollHeight-k.scrollTop<=k.clientHeight+50;p(C)},children:v?d.jsx("div",{className:"flex items-center justify-center h-full",children:d.jsx(Pe,{className:"w-6 h-6 animate-spin text-gray-400"})}):N.length===0?d.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-gray-500",children:[d.jsx("p",{children:"No logs found"}),d.jsx("p",{className:"text-sm mt-1",children:"Admin service may not be running or has no activity yet"})]}):d.jsx("div",{className:"space-y-0.5",children:N.map((E,k)=>d.jsx("div",{className:"break-all whitespace-pre-wrap leading-relaxed",children:Of(E,k)},k))})}),d.jsx("div",{className:"px-4 py-2 border-t border-gray-200 bg-gray-50 text-sm text-gray-500",children:d.jsxs("span",{children:[N.length," ",N.length===1?"line":"lines"]})})]})}const a3=new Jv({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}});function i3({onLogout:t}){const[l,a]=A.useState(""),u=jn().pathname==="/models";return d.jsxs("div",{className:"min-h-screen bg-neutral-50",children:[d.jsx(L2,{onLogout:t,searchQuery:u?l:void 0,onSearchChange:u?a:void 0}),d.jsxs(sS,{children:[d.jsx(Sn,{path:"/",element:d.jsx(aS,{to:"/servers",replace:!0})}),d.jsx(Sn,{path:"/servers",element:d.jsx(dw,{})}),d.jsx(Sn,{path:"/servers/:id/logs",element:d.jsx(vw,{})}),d.jsx(Sn,{path:"/servers/:port/chat",element:d.jsx(VE,{})}),d.jsx(Sn,{path:"/models",element:d.jsx($E,{searchQuery:l})}),d.jsx(Sn,{path:"/router",element:d.jsx(ZE,{})}),d.jsx(Sn,{path:"/router/logs",element:d.jsx(JE,{})}),d.jsx(Sn,{path:"/manage",element:d.jsx(l3,{})}),d.jsx(Sn,{path:"/admin/logs",element:d.jsx(r3,{})})]})]})}function s3(){const[t,l]=A.useState(null);return A.useEffect(()=>{!!ke.getApiKey()?ke.getSystemStatus().then(()=>l(!0)).catch(()=>{ke.clearApiKey(),l(!1)}):l(!1)},[]),t===null?d.jsx("div",{className:"min-h-screen bg-neutral-50 flex items-center justify-center",children:d.jsx("div",{className:"text-neutral-400",children:"Loading..."})}):t?d.jsx(Pv,{client:a3,children:d.jsx(MS,{children:d.jsx(i3,{onLogout:()=>l(!1)})})}):d.jsx(U2,{onAuthenticated:()=>l(!0)})}Ev.createRoot(document.getElementById("root")).render(d.jsx(A.StrictMode,{children:d.jsx(s3,{})}));