@polderlabs/bizar 4.9.0 → 5.0.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 (107) hide show
  1. package/bizar-dash/dist/assets/icons-CFqu2M-c.js +656 -0
  2. package/bizar-dash/dist/assets/icons-CFqu2M-c.js.map +1 -0
  3. package/bizar-dash/dist/assets/{index-DU61awG3.js → index-DmpSFPJY.js} +1 -1
  4. package/bizar-dash/dist/assets/{index-DU61awG3.js.map → index-DmpSFPJY.js.map} +1 -1
  5. package/bizar-dash/dist/assets/main-Dl8yY5_H.js +16 -0
  6. package/bizar-dash/dist/assets/main-Dl8yY5_H.js.map +1 -0
  7. package/bizar-dash/dist/assets/{main-DfmIfOUS.css → main-ZAfGKENE.css} +1 -1
  8. package/bizar-dash/dist/assets/markdown-DIquRulQ.js +29 -0
  9. package/bizar-dash/dist/assets/markdown-DIquRulQ.js.map +1 -0
  10. package/bizar-dash/dist/assets/mobile-C2gysFOZ.js +2 -0
  11. package/bizar-dash/dist/assets/mobile-C2gysFOZ.js.map +1 -0
  12. package/bizar-dash/dist/assets/mobile-DHXXbn1A.js +1 -0
  13. package/bizar-dash/dist/assets/{mobile-CL5uUQEC.js.map → mobile-DHXXbn1A.js.map} +1 -1
  14. package/bizar-dash/dist/assets/react-vendor-DZRUXSPQ.js +40 -0
  15. package/bizar-dash/dist/assets/react-vendor-DZRUXSPQ.js.map +1 -0
  16. package/bizar-dash/dist/index.html +6 -3
  17. package/bizar-dash/dist/mobile.html +5 -2
  18. package/bizar-dash/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -1
  19. package/bizar-dash/skills/eval/SKILL.md +237 -0
  20. package/bizar-dash/src/server/api.mjs +28 -0
  21. package/bizar-dash/src/server/auth.mjs +155 -1
  22. package/bizar-dash/src/server/eval-store.mjs +226 -0
  23. package/bizar-dash/src/server/eval.mjs +347 -0
  24. package/bizar-dash/src/server/ocr.mjs +55 -0
  25. package/bizar-dash/src/server/plugins/registry.mjs +363 -0
  26. package/bizar-dash/src/server/plugins/sandbox.mjs +655 -0
  27. package/bizar-dash/src/server/plugins/store.mjs +659 -0
  28. package/bizar-dash/src/server/routes/clipboard.mjs +173 -0
  29. package/bizar-dash/src/server/routes/eval.mjs +147 -0
  30. package/bizar-dash/src/server/routes/ocr.mjs +182 -0
  31. package/bizar-dash/src/server/routes/plugins.mjs +220 -0
  32. package/bizar-dash/src/server/routes/users.mjs +84 -0
  33. package/bizar-dash/src/server/routes/voice.mjs +131 -0
  34. package/bizar-dash/src/server/routes/workspaces.mjs +204 -0
  35. package/bizar-dash/src/server/voice-store.mjs +202 -0
  36. package/bizar-dash/src/server/voice-transcribe.mjs +72 -0
  37. package/bizar-dash/src/server/workspaces.mjs +626 -0
  38. package/bizar-dash/src/web/components/InviteDialog.tsx +205 -0
  39. package/bizar-dash/src/web/components/ScreenshotCapture.tsx +138 -0
  40. package/bizar-dash/src/web/components/ScreenshotOCR.tsx +42 -0
  41. package/bizar-dash/src/web/components/VoiceNotesPanel.tsx +182 -0
  42. package/bizar-dash/src/web/components/VoiceRecorder.tsx +104 -0
  43. package/bizar-dash/src/web/components/WorkspaceSelector.tsx +158 -0
  44. package/bizar-dash/src/web/styles/memory.css +82 -0
  45. package/bizar-dash/src/web/views/Memory.tsx +17 -2
  46. package/bizar-dash/src/web/views/Settings.tsx +3 -0
  47. package/bizar-dash/src/web/views/Workspace.tsx +294 -0
  48. package/bizar-dash/src/web/views/memory/FromScreenshotPanel.tsx +23 -0
  49. package/bizar-dash/src/web/views/memory/VaultFromClipboardPanel.tsx +101 -0
  50. package/bizar-dash/src/web/views/settings/WorkspacesSection.tsx +189 -0
  51. package/bizar-dash/tests/bundle-analysis.test.mjs +5 -2
  52. package/bizar-dash/tests/clipboard.test.mjs +147 -0
  53. package/bizar-dash/tests/components/screenshot-ocr.test.tsx +75 -0
  54. package/bizar-dash/tests/components/workspace-selector.test.tsx +73 -0
  55. package/bizar-dash/tests/deploy-templates.test.mjs +100 -0
  56. package/bizar-dash/tests/eval/fixtures.test.mjs +141 -0
  57. package/bizar-dash/tests/eval/report.test.mjs +284 -0
  58. package/bizar-dash/tests/eval/runner.test.mjs +471 -0
  59. package/bizar-dash/tests/ocr.test.mjs +87 -0
  60. package/bizar-dash/tests/plugins-registry.test.mjs +387 -0
  61. package/bizar-dash/tests/plugins-sandbox.test.mjs +374 -0
  62. package/bizar-dash/tests/plugins-store.test.mjs +455 -0
  63. package/bizar-dash/tests/users.test.mjs +108 -0
  64. package/bizar-dash/tests/voice-recorder.test.tsx +95 -0
  65. package/bizar-dash/tests/voice-store.test.mjs +148 -0
  66. package/bizar-dash/tests/voice-transcribe.test.mjs +87 -0
  67. package/bizar-dash/tests/workspaces.test.mjs +527 -0
  68. package/cli/bin.mjs +72 -2
  69. package/cli/commands/clip.mjs +146 -0
  70. package/cli/commands/deploy/cloudflare.mjs +250 -0
  71. package/cli/commands/deploy/docker.mjs +221 -0
  72. package/cli/commands/deploy/fly.mjs +161 -0
  73. package/cli/commands/deploy/vercel.mjs +225 -0
  74. package/cli/commands/deploy.mjs +240 -0
  75. package/cli/commands/eval.mjs +378 -0
  76. package/cli/commands/marketplace.mjs +64 -0
  77. package/cli/commands/ocr.mjs +165 -0
  78. package/cli/commands/plugin.mjs +358 -0
  79. package/cli/commands/voice.mjs +211 -0
  80. package/cli/commands/workspace.mjs +247 -0
  81. package/package.json +12 -8
  82. package/templates/deploy/cloudflare/README.md +32 -0
  83. package/templates/deploy/cloudflare/functions-index.template.js +15 -0
  84. package/templates/deploy/cloudflare/wrangler.toml.template +9 -0
  85. package/templates/deploy/docker/.env.template +16 -0
  86. package/templates/deploy/docker/README.md +58 -0
  87. package/templates/deploy/docker/docker-compose.template.yml +23 -0
  88. package/templates/deploy/fly/README.md +35 -0
  89. package/templates/deploy/fly/fly.toml.template +28 -0
  90. package/templates/deploy/vercel/README.md +29 -0
  91. package/templates/deploy/vercel/api-index.template.js +18 -0
  92. package/templates/deploy/vercel/vercel.json.template +16 -0
  93. package/templates/eval-fixtures/README.md +58 -0
  94. package/templates/eval-fixtures/code-search-basic.json +28 -0
  95. package/templates/eval-fixtures/latency-bounds.json +16 -0
  96. package/templates/eval-fixtures/regression-suite.json +79 -0
  97. package/templates/eval-fixtures/response-format.json +30 -0
  98. package/templates/eval-fixtures/tool-call-correctness.json +24 -0
  99. package/templates/plugin-template/README.md +121 -0
  100. package/templates/plugin-template/index.js +66 -0
  101. package/templates/plugin-template/plugin.json +42 -0
  102. package/templates/plugin-template/tests/plugin.test.js +83 -0
  103. package/bizar-dash/dist/assets/main-DaC1Lc6q.js +0 -366
  104. package/bizar-dash/dist/assets/main-DaC1Lc6q.js.map +0 -1
  105. package/bizar-dash/dist/assets/mobile-CL5uUQEC.js +0 -1
  106. package/bizar-dash/dist/assets/mobile-D5WTWvuh.js +0 -338
  107. package/bizar-dash/dist/assets/mobile-D5WTWvuh.js.map +0 -1
@@ -1,338 +0,0 @@
1
- var Ym=Object.defineProperty;var Km=(e,t,n)=>t in e?Ym(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var et=(e,t,n)=>Km(e,typeof t!="symbol"?t+"":t,n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const l of i)if(l.type==="childList")for(const s of l.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const l={};return i.integrity&&(l.integrity=i.integrity),i.referrerPolicy&&(l.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?l.credentials="include":i.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(i){if(i.ep)return;i.ep=!0;const l=n(i);fetch(i.href,l)}})();var bl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ta(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var gf={exports:{}},ts={},yf={exports:{}},ue={};/**
2
- * @license React
3
- * react.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var Ei=Symbol.for("react.element"),Gm=Symbol.for("react.portal"),Xm=Symbol.for("react.fragment"),Zm=Symbol.for("react.strict_mode"),Jm=Symbol.for("react.profiler"),eg=Symbol.for("react.provider"),tg=Symbol.for("react.context"),ng=Symbol.for("react.forward_ref"),rg=Symbol.for("react.suspense"),ig=Symbol.for("react.memo"),lg=Symbol.for("react.lazy"),Qu=Symbol.iterator;function sg(e){return e===null||typeof e!="object"?null:(e=Qu&&e[Qu]||e["@@iterator"],typeof e=="function"?e:null)}var xf={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},vf=Object.assign,kf={};function Tr(e,t,n){this.props=e,this.context=t,this.refs=kf,this.updater=n||xf}Tr.prototype.isReactComponent={};Tr.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Tr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function wf(){}wf.prototype=Tr.prototype;function za(e,t,n){this.props=e,this.context=t,this.refs=kf,this.updater=n||xf}var Ia=za.prototype=new wf;Ia.constructor=za;vf(Ia,Tr.prototype);Ia.isPureReactComponent=!0;var Yu=Array.isArray,bf=Object.prototype.hasOwnProperty,Pa={current:null},Sf={key:!0,ref:!0,__self:!0,__source:!0};function jf(e,t,n){var r,i={},l=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(l=""+t.key),t)bf.call(t,r)&&!Sf.hasOwnProperty(r)&&(i[r]=t[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1<a){for(var u=Array(a),d=0;d<a;d++)u[d]=arguments[d+2];i.children=u}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)i[r]===void 0&&(i[r]=a[r]);return{$$typeof:Ei,type:e,key:l,ref:s,props:i,_owner:Pa.current}}function og(e,t){return{$$typeof:Ei,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function La(e){return typeof e=="object"&&e!==null&&e.$$typeof===Ei}function ag(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Ku=/\/+/g;function Is(e,t){return typeof e=="object"&&e!==null&&e.key!=null?ag(""+e.key):t.toString(36)}function ol(e,t,n,r,i){var l=typeof e;(l==="undefined"||l==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(l){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case Ei:case Gm:s=!0}}if(s)return s=e,i=i(s),e=r===""?"."+Is(s,0):r,Yu(i)?(n="",e!=null&&(n=e.replace(Ku,"$&/")+"/"),ol(i,t,n,"",function(d){return d})):i!=null&&(La(i)&&(i=og(i,n+(!i.key||s&&s.key===i.key?"":(""+i.key).replace(Ku,"$&/")+"/")+e)),t.push(i)),1;if(s=0,r=r===""?".":r+":",Yu(e))for(var a=0;a<e.length;a++){l=e[a];var u=r+Is(l,a);s+=ol(l,t,n,u,i)}else if(u=sg(e),typeof u=="function")for(e=u.call(e),a=0;!(l=e.next()).done;)l=l.value,u=r+Is(l,a++),s+=ol(l,t,n,u,i);else if(l==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function Fi(e,t,n){if(e==null)return e;var r=[],i=0;return ol(e,r,"","",function(l){return t.call(n,l,i++)}),r}function ug(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Xe={current:null},al={transition:null},cg={ReactCurrentDispatcher:Xe,ReactCurrentBatchConfig:al,ReactCurrentOwner:Pa};function Cf(){throw Error("act(...) is not supported in production builds of React.")}ue.Children={map:Fi,forEach:function(e,t,n){Fi(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Fi(e,function(){t++}),t},toArray:function(e){return Fi(e,function(t){return t})||[]},only:function(e){if(!La(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ue.Component=Tr;ue.Fragment=Xm;ue.Profiler=Jm;ue.PureComponent=za;ue.StrictMode=Zm;ue.Suspense=rg;ue.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=cg;ue.act=Cf;ue.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=vf({},e.props),i=e.key,l=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(l=t.ref,s=Pa.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(u in t)bf.call(t,u)&&!Sf.hasOwnProperty(u)&&(r[u]=t[u]===void 0&&a!==void 0?a[u]:t[u])}var u=arguments.length-2;if(u===1)r.children=n;else if(1<u){a=Array(u);for(var d=0;d<u;d++)a[d]=arguments[d+2];r.children=a}return{$$typeof:Ei,type:e.type,key:i,ref:l,props:r,_owner:s}};ue.createContext=function(e){return e={$$typeof:tg,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:eg,_context:e},e.Consumer=e};ue.createElement=jf;ue.createFactory=function(e){var t=jf.bind(null,e);return t.type=e,t};ue.createRef=function(){return{current:null}};ue.forwardRef=function(e){return{$$typeof:ng,render:e}};ue.isValidElement=La;ue.lazy=function(e){return{$$typeof:lg,_payload:{_status:-1,_result:e},_init:ug}};ue.memo=function(e,t){return{$$typeof:ig,type:e,compare:t===void 0?null:t}};ue.startTransition=function(e){var t=al.transition;al.transition={};try{e()}finally{al.transition=t}};ue.unstable_act=Cf;ue.useCallback=function(e,t){return Xe.current.useCallback(e,t)};ue.useContext=function(e){return Xe.current.useContext(e)};ue.useDebugValue=function(){};ue.useDeferredValue=function(e){return Xe.current.useDeferredValue(e)};ue.useEffect=function(e,t){return Xe.current.useEffect(e,t)};ue.useId=function(){return Xe.current.useId()};ue.useImperativeHandle=function(e,t,n){return Xe.current.useImperativeHandle(e,t,n)};ue.useInsertionEffect=function(e,t){return Xe.current.useInsertionEffect(e,t)};ue.useLayoutEffect=function(e,t){return Xe.current.useLayoutEffect(e,t)};ue.useMemo=function(e,t){return Xe.current.useMemo(e,t)};ue.useReducer=function(e,t,n){return Xe.current.useReducer(e,t,n)};ue.useRef=function(e){return Xe.current.useRef(e)};ue.useState=function(e){return Xe.current.useState(e)};ue.useSyncExternalStore=function(e,t,n){return Xe.current.useSyncExternalStore(e,t,n)};ue.useTransition=function(){return Xe.current.useTransition()};ue.version="18.3.1";yf.exports=ue;var k=yf.exports;const dC=Ta(k);/**
10
- * @license React
11
- * react-jsx-runtime.production.min.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var dg=k,fg=Symbol.for("react.element"),pg=Symbol.for("react.fragment"),hg=Object.prototype.hasOwnProperty,mg=dg.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,gg={key:!0,ref:!0,__self:!0,__source:!0};function Nf(e,t,n){var r,i={},l=null,s=null;n!==void 0&&(l=""+n),t.key!==void 0&&(l=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)hg.call(t,r)&&!gg.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:fg,type:e,key:l,ref:s,props:i,_owner:mg.current}}ts.Fragment=pg;ts.jsx=Nf;ts.jsxs=Nf;gf.exports=ts;var o=gf.exports,Ef={exports:{}},gt={},Tf={exports:{}},zf={};/**
18
- * @license React
19
- * scheduler.production.min.js
20
- *
21
- * Copyright (c) Facebook, Inc. and its affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */(function(e){function t(R,V){var b=R.length;R.push(V);e:for(;0<b;){var Y=b-1>>>1,ie=R[Y];if(0<i(ie,V))R[Y]=V,R[b]=ie,b=Y;else break e}}function n(R){return R.length===0?null:R[0]}function r(R){if(R.length===0)return null;var V=R[0],b=R.pop();if(b!==V){R[0]=b;e:for(var Y=0,ie=R.length,S=ie>>>1;Y<S;){var ge=2*(Y+1)-1,Le=R[ge],oe=ge+1,Ce=R[oe];if(0>i(Le,b))oe<ie&&0>i(Ce,Le)?(R[Y]=Ce,R[oe]=b,Y=oe):(R[Y]=Le,R[ge]=b,Y=ge);else if(oe<ie&&0>i(Ce,b))R[Y]=Ce,R[oe]=b,Y=oe;else break e}}return V}function i(R,V){var b=R.sortIndex-V.sortIndex;return b!==0?b:R.id-V.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var u=[],d=[],c=1,f=null,h=3,p=!1,g=!1,x=!1,C=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function v(R){for(var V=n(d);V!==null;){if(V.callback===null)r(d);else if(V.startTime<=R)r(d),V.sortIndex=V.expirationTime,t(u,V);else break;V=n(d)}}function N(R){if(x=!1,v(R),!g)if(n(u)!==null)g=!0,he(P);else{var V=n(d);V!==null&&ne(N,V.startTime-R)}}function P(R,V){g=!1,x&&(x=!1,y(L),L=-1),p=!0;var b=h;try{for(v(V),f=n(u);f!==null&&(!(f.expirationTime>V)||R&&!z());){var Y=f.callback;if(typeof Y=="function"){f.callback=null,h=f.priorityLevel;var ie=Y(f.expirationTime<=V);V=e.unstable_now(),typeof ie=="function"?f.callback=ie:f===n(u)&&r(u),v(V)}else r(u);f=n(u)}if(f!==null)var S=!0;else{var ge=n(d);ge!==null&&ne(N,ge.startTime-V),S=!1}return S}finally{f=null,h=b,p=!1}}var j=!1,I=null,L=-1,T=5,w=-1;function z(){return!(e.unstable_now()-w<T)}function A(){if(I!==null){var R=e.unstable_now();w=R;var V=!0;try{V=I(!0,R)}finally{V?H():(j=!1,I=null)}}else j=!1}var H;if(typeof m=="function")H=function(){m(A)};else if(typeof MessageChannel<"u"){var $=new MessageChannel,Q=$.port2;$.port1.onmessage=A,H=function(){Q.postMessage(null)}}else H=function(){C(A,0)};function he(R){I=R,j||(j=!0,H())}function ne(R,V){L=C(function(){R(e.unstable_now())},V)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(R){R.callback=null},e.unstable_continueExecution=function(){g||p||(g=!0,he(P))},e.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<R?Math.floor(1e3/R):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(R){switch(h){case 1:case 2:case 3:var V=3;break;default:V=h}var b=h;h=V;try{return R()}finally{h=b}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(R,V){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var b=h;h=R;try{return V()}finally{h=b}},e.unstable_scheduleCallback=function(R,V,b){var Y=e.unstable_now();switch(typeof b=="object"&&b!==null?(b=b.delay,b=typeof b=="number"&&0<b?Y+b:Y):b=Y,R){case 1:var ie=-1;break;case 2:ie=250;break;case 5:ie=1073741823;break;case 4:ie=1e4;break;default:ie=5e3}return ie=b+ie,R={id:c++,callback:V,priorityLevel:R,startTime:b,expirationTime:ie,sortIndex:-1},b>Y?(R.sortIndex=b,t(d,R),n(u)===null&&R===n(d)&&(x?(y(L),L=-1):x=!0,ne(N,b-Y))):(R.sortIndex=ie,t(u,R),g||p||(g=!0,he(P))),R},e.unstable_shouldYield=z,e.unstable_wrapCallback=function(R){var V=h;return function(){var b=h;h=V;try{return R.apply(this,arguments)}finally{h=b}}}})(zf);Tf.exports=zf;var yg=Tf.exports;/**
26
- * @license React
27
- * react-dom.production.min.js
28
- *
29
- * Copyright (c) Facebook, Inc. and its affiliates.
30
- *
31
- * This source code is licensed under the MIT license found in the
32
- * LICENSE file in the root directory of this source tree.
33
- */var xg=k,ht=yg;function O(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var If=new Set,ai={};function qn(e,t){vr(e,t),vr(e+"Capture",t)}function vr(e,t){for(ai[e]=t,e=0;e<t.length;e++)If.add(t[e])}var Kt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ko=Object.prototype.hasOwnProperty,vg=/^[: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]*$/,Gu={},Xu={};function kg(e){return ko.call(Xu,e)?!0:ko.call(Gu,e)?!1:vg.test(e)?Xu[e]=!0:(Gu[e]=!0,!1)}function wg(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function bg(e,t,n,r){if(t===null||typeof t>"u"||wg(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Ze(e,t,n,r,i,l,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=l,this.removeEmptyString=s}var Be={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Be[e]=new Ze(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Be[t]=new Ze(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Be[e]=new Ze(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Be[e]=new Ze(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Be[e]=new Ze(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Be[e]=new Ze(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Be[e]=new Ze(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Be[e]=new Ze(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Be[e]=new Ze(e,5,!1,e.toLowerCase(),null,!1,!1)});var Aa=/[\-:]([a-z])/g;function Da(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Aa,Da);Be[t]=new Ze(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Aa,Da);Be[t]=new Ze(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Aa,Da);Be[t]=new Ze(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Be[e]=new Ze(e,1,!1,e.toLowerCase(),null,!1,!1)});Be.xlinkHref=new Ze("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Be[e]=new Ze(e,1,!1,e.toLowerCase(),null,!0,!0)});function Ma(e,t,n,r){var i=Be.hasOwnProperty(t)?Be[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(bg(t,n,i,r)&&(n=null),r||i===null?kg(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Jt=xg.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,$i=Symbol.for("react.element"),Jn=Symbol.for("react.portal"),er=Symbol.for("react.fragment"),Ra=Symbol.for("react.strict_mode"),wo=Symbol.for("react.profiler"),Pf=Symbol.for("react.provider"),Lf=Symbol.for("react.context"),_a=Symbol.for("react.forward_ref"),bo=Symbol.for("react.suspense"),So=Symbol.for("react.suspense_list"),Oa=Symbol.for("react.memo"),ln=Symbol.for("react.lazy"),Af=Symbol.for("react.offscreen"),Zu=Symbol.iterator;function Mr(e){return e===null||typeof e!="object"?null:(e=Zu&&e[Zu]||e["@@iterator"],typeof e=="function"?e:null)}var ze=Object.assign,Ps;function Wr(e){if(Ps===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Ps=t&&t[1]||""}return`
34
- `+Ps+e}var Ls=!1;function As(e,t){if(!e||Ls)return"";Ls=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(d){var r=d}Reflect.construct(e,[],t)}else{try{t.call()}catch(d){r=d}e.call(t.prototype)}else{try{throw Error()}catch(d){r=d}e()}}catch(d){if(d&&r&&typeof d.stack=="string"){for(var i=d.stack.split(`
35
- `),l=r.stack.split(`
36
- `),s=i.length-1,a=l.length-1;1<=s&&0<=a&&i[s]!==l[a];)a--;for(;1<=s&&0<=a;s--,a--)if(i[s]!==l[a]){if(s!==1||a!==1)do if(s--,a--,0>a||i[s]!==l[a]){var u=`
37
- `+i[s].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=s&&0<=a);break}}}finally{Ls=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Wr(e):""}function Sg(e){switch(e.tag){case 5:return Wr(e.type);case 16:return Wr("Lazy");case 13:return Wr("Suspense");case 19:return Wr("SuspenseList");case 0:case 2:case 15:return e=As(e.type,!1),e;case 11:return e=As(e.type.render,!1),e;case 1:return e=As(e.type,!0),e;default:return""}}function jo(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case er:return"Fragment";case Jn:return"Portal";case wo:return"Profiler";case Ra:return"StrictMode";case bo:return"Suspense";case So:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Lf:return(e.displayName||"Context")+".Consumer";case Pf:return(e._context.displayName||"Context")+".Provider";case _a:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Oa:return t=e.displayName||null,t!==null?t:jo(e.type)||"Memo";case ln:t=e._payload,e=e._init;try{return jo(e(t))}catch{}}return null}function jg(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return jo(t);case 8:return t===Ra?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function vn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Df(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Cg(e){var t=Df(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,l=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,l.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Bi(e){e._valueTracker||(e._valueTracker=Cg(e))}function Mf(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Df(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Sl(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}}function Co(e,t){var n=t.checked;return ze({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Ju(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=vn(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Rf(e,t){t=t.checked,t!=null&&Ma(e,"checked",t,!1)}function No(e,t){Rf(e,t);var n=vn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Eo(e,t.type,n):t.hasOwnProperty("defaultValue")&&Eo(e,t.type,vn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function ec(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Eo(e,t,n){(t!=="number"||Sl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var qr=Array.isArray;function fr(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+vn(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function To(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(O(91));return ze({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function tc(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(O(92));if(qr(n)){if(1<n.length)throw Error(O(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:vn(n)}}function _f(e,t){var n=vn(t.value),r=vn(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function nc(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Of(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function zo(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Of(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Ui,Ff=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Ui=Ui||document.createElement("div"),Ui.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Ui.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ui(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Kr={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ng=["Webkit","ms","Moz","O"];Object.keys(Kr).forEach(function(e){Ng.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Kr[t]=Kr[e]})});function $f(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Kr.hasOwnProperty(e)&&Kr[e]?(""+t).trim():t+"px"}function Bf(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=$f(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var Eg=ze({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Io(e,t){if(t){if(Eg[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(O(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(O(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(O(61))}if(t.style!=null&&typeof t.style!="object")throw Error(O(62))}}function Po(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 Lo=null;function Fa(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ao=null,pr=null,hr=null;function rc(e){if(e=Ii(e)){if(typeof Ao!="function")throw Error(O(280));var t=e.stateNode;t&&(t=ss(t),Ao(e.stateNode,e.type,t))}}function Uf(e){pr?hr?hr.push(e):hr=[e]:pr=e}function Hf(){if(pr){var e=pr,t=hr;if(hr=pr=null,rc(e),t)for(e=0;e<t.length;e++)rc(t[e])}}function Vf(e,t){return e(t)}function Wf(){}var Ds=!1;function qf(e,t,n){if(Ds)return e(t,n);Ds=!0;try{return Vf(e,t,n)}finally{Ds=!1,(pr!==null||hr!==null)&&(Wf(),Hf())}}function ci(e,t){var n=e.stateNode;if(n===null)return null;var r=ss(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(O(231,t,typeof n));return n}var Do=!1;if(Kt)try{var Rr={};Object.defineProperty(Rr,"passive",{get:function(){Do=!0}}),window.addEventListener("test",Rr,Rr),window.removeEventListener("test",Rr,Rr)}catch{Do=!1}function Tg(e,t,n,r,i,l,s,a,u){var d=Array.prototype.slice.call(arguments,3);try{t.apply(n,d)}catch(c){this.onError(c)}}var Gr=!1,jl=null,Cl=!1,Mo=null,zg={onError:function(e){Gr=!0,jl=e}};function Ig(e,t,n,r,i,l,s,a,u){Gr=!1,jl=null,Tg.apply(zg,arguments)}function Pg(e,t,n,r,i,l,s,a,u){if(Ig.apply(this,arguments),Gr){if(Gr){var d=jl;Gr=!1,jl=null}else throw Error(O(198));Cl||(Cl=!0,Mo=d)}}function Qn(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Qf(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function ic(e){if(Qn(e)!==e)throw Error(O(188))}function Lg(e){var t=e.alternate;if(!t){if(t=Qn(e),t===null)throw Error(O(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var l=i.alternate;if(l===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===l.child){for(l=i.child;l;){if(l===n)return ic(i),e;if(l===r)return ic(i),t;l=l.sibling}throw Error(O(188))}if(n.return!==r.return)n=i,r=l;else{for(var s=!1,a=i.child;a;){if(a===n){s=!0,n=i,r=l;break}if(a===r){s=!0,r=i,n=l;break}a=a.sibling}if(!s){for(a=l.child;a;){if(a===n){s=!0,n=l,r=i;break}if(a===r){s=!0,r=l,n=i;break}a=a.sibling}if(!s)throw Error(O(189))}}if(n.alternate!==r)throw Error(O(190))}if(n.tag!==3)throw Error(O(188));return n.stateNode.current===n?e:t}function Yf(e){return e=Lg(e),e!==null?Kf(e):null}function Kf(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Kf(e);if(t!==null)return t;e=e.sibling}return null}var Gf=ht.unstable_scheduleCallback,lc=ht.unstable_cancelCallback,Ag=ht.unstable_shouldYield,Dg=ht.unstable_requestPaint,Pe=ht.unstable_now,Mg=ht.unstable_getCurrentPriorityLevel,$a=ht.unstable_ImmediatePriority,Xf=ht.unstable_UserBlockingPriority,Nl=ht.unstable_NormalPriority,Rg=ht.unstable_LowPriority,Zf=ht.unstable_IdlePriority,ns=null,$t=null;function _g(e){if($t&&typeof $t.onCommitFiberRoot=="function")try{$t.onCommitFiberRoot(ns,e,void 0,(e.current.flags&128)===128)}catch{}}var zt=Math.clz32?Math.clz32:$g,Og=Math.log,Fg=Math.LN2;function $g(e){return e>>>=0,e===0?32:31-(Og(e)/Fg|0)|0}var Hi=64,Vi=4194304;function Qr(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function El(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,l=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~i;a!==0?r=Qr(a):(l&=s,l!==0&&(r=Qr(l)))}else s=n&~i,s!==0?r=Qr(s):l!==0&&(r=Qr(l));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,l=t&-t,i>=l||i===16&&(l&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-zt(t),i=1<<n,r|=e[n],t&=~i;return r}function Bg(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ug(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,l=e.pendingLanes;0<l;){var s=31-zt(l),a=1<<s,u=i[s];u===-1?(!(a&n)||a&r)&&(i[s]=Bg(a,t)):u<=t&&(e.expiredLanes|=a),l&=~a}}function Ro(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Jf(){var e=Hi;return Hi<<=1,!(Hi&4194240)&&(Hi=64),e}function Ms(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ti(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-zt(t),e[t]=n}function Hg(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-zt(n),l=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~l}}function Ba(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-zt(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var me=0;function ep(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var tp,Ua,np,rp,ip,_o=!1,Wi=[],dn=null,fn=null,pn=null,di=new Map,fi=new Map,on=[],Vg="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 submit".split(" ");function sc(e,t){switch(e){case"focusin":case"focusout":dn=null;break;case"dragenter":case"dragleave":fn=null;break;case"mouseover":case"mouseout":pn=null;break;case"pointerover":case"pointerout":di.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":fi.delete(t.pointerId)}}function _r(e,t,n,r,i,l){return e===null||e.nativeEvent!==l?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:l,targetContainers:[i]},t!==null&&(t=Ii(t),t!==null&&Ua(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Wg(e,t,n,r,i){switch(t){case"focusin":return dn=_r(dn,e,t,n,r,i),!0;case"dragenter":return fn=_r(fn,e,t,n,r,i),!0;case"mouseover":return pn=_r(pn,e,t,n,r,i),!0;case"pointerover":var l=i.pointerId;return di.set(l,_r(di.get(l)||null,e,t,n,r,i)),!0;case"gotpointercapture":return l=i.pointerId,fi.set(l,_r(fi.get(l)||null,e,t,n,r,i)),!0}return!1}function lp(e){var t=Ln(e.target);if(t!==null){var n=Qn(t);if(n!==null){if(t=n.tag,t===13){if(t=Qf(n),t!==null){e.blockedOn=t,ip(e.priority,function(){np(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ul(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Oo(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Lo=r,n.target.dispatchEvent(r),Lo=null}else return t=Ii(n),t!==null&&Ua(t),e.blockedOn=n,!1;t.shift()}return!0}function oc(e,t,n){ul(e)&&n.delete(t)}function qg(){_o=!1,dn!==null&&ul(dn)&&(dn=null),fn!==null&&ul(fn)&&(fn=null),pn!==null&&ul(pn)&&(pn=null),di.forEach(oc),fi.forEach(oc)}function Or(e,t){e.blockedOn===t&&(e.blockedOn=null,_o||(_o=!0,ht.unstable_scheduleCallback(ht.unstable_NormalPriority,qg)))}function pi(e){function t(i){return Or(i,e)}if(0<Wi.length){Or(Wi[0],e);for(var n=1;n<Wi.length;n++){var r=Wi[n];r.blockedOn===e&&(r.blockedOn=null)}}for(dn!==null&&Or(dn,e),fn!==null&&Or(fn,e),pn!==null&&Or(pn,e),di.forEach(t),fi.forEach(t),n=0;n<on.length;n++)r=on[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<on.length&&(n=on[0],n.blockedOn===null);)lp(n),n.blockedOn===null&&on.shift()}var mr=Jt.ReactCurrentBatchConfig,Tl=!0;function Qg(e,t,n,r){var i=me,l=mr.transition;mr.transition=null;try{me=1,Ha(e,t,n,r)}finally{me=i,mr.transition=l}}function Yg(e,t,n,r){var i=me,l=mr.transition;mr.transition=null;try{me=4,Ha(e,t,n,r)}finally{me=i,mr.transition=l}}function Ha(e,t,n,r){if(Tl){var i=Oo(e,t,n,r);if(i===null)Ws(e,t,r,zl,n),sc(e,r);else if(Wg(i,e,t,n,r))r.stopPropagation();else if(sc(e,r),t&4&&-1<Vg.indexOf(e)){for(;i!==null;){var l=Ii(i);if(l!==null&&tp(l),l=Oo(e,t,n,r),l===null&&Ws(e,t,r,zl,n),l===i)break;i=l}i!==null&&r.stopPropagation()}else Ws(e,t,r,null,n)}}var zl=null;function Oo(e,t,n,r){if(zl=null,e=Fa(r),e=Ln(e),e!==null)if(t=Qn(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Qf(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return zl=e,null}function sp(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Mg()){case $a:return 1;case Xf:return 4;case Nl:case Rg:return 16;case Zf:return 536870912;default:return 16}default:return 16}}var un=null,Va=null,cl=null;function op(){if(cl)return cl;var e,t=Va,n=t.length,r,i="value"in un?un.value:un.textContent,l=i.length;for(e=0;e<n&&t[e]===i[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===i[l-r];r++);return cl=i.slice(e,1<r?1-r:void 0)}function dl(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function qi(){return!0}function ac(){return!1}function yt(e){function t(n,r,i,l,s){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=l,this.target=s,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(l):l[a]);return this.isDefaultPrevented=(l.defaultPrevented!=null?l.defaultPrevented:l.returnValue===!1)?qi:ac,this.isPropagationStopped=ac,this}return ze(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=qi)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=qi)},persist:function(){},isPersistent:qi}),t}var zr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Wa=yt(zr),zi=ze({},zr,{view:0,detail:0}),Kg=yt(zi),Rs,_s,Fr,rs=ze({},zi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:qa,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!==Fr&&(Fr&&e.type==="mousemove"?(Rs=e.screenX-Fr.screenX,_s=e.screenY-Fr.screenY):_s=Rs=0,Fr=e),Rs)},movementY:function(e){return"movementY"in e?e.movementY:_s}}),uc=yt(rs),Gg=ze({},rs,{dataTransfer:0}),Xg=yt(Gg),Zg=ze({},zi,{relatedTarget:0}),Os=yt(Zg),Jg=ze({},zr,{animationName:0,elapsedTime:0,pseudoElement:0}),ey=yt(Jg),ty=ze({},zr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ny=yt(ty),ry=ze({},zr,{data:0}),cc=yt(ry),iy={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ly={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"},sy={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function oy(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=sy[e])?!!t[e]:!1}function qa(){return oy}var ay=ze({},zi,{key:function(e){if(e.key){var t=iy[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=dl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?ly[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:qa,charCode:function(e){return e.type==="keypress"?dl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?dl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),uy=yt(ay),cy=ze({},rs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),dc=yt(cy),dy=ze({},zi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:qa}),fy=yt(dy),py=ze({},zr,{propertyName:0,elapsedTime:0,pseudoElement:0}),hy=yt(py),my=ze({},rs,{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}),gy=yt(my),yy=[9,13,27,32],Qa=Kt&&"CompositionEvent"in window,Xr=null;Kt&&"documentMode"in document&&(Xr=document.documentMode);var xy=Kt&&"TextEvent"in window&&!Xr,ap=Kt&&(!Qa||Xr&&8<Xr&&11>=Xr),fc=" ",pc=!1;function up(e,t){switch(e){case"keyup":return yy.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function cp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var tr=!1;function vy(e,t){switch(e){case"compositionend":return cp(t);case"keypress":return t.which!==32?null:(pc=!0,fc);case"textInput":return e=t.data,e===fc&&pc?null:e;default:return null}}function ky(e,t){if(tr)return e==="compositionend"||!Qa&&up(e,t)?(e=op(),cl=Va=un=null,tr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return ap&&t.locale!=="ko"?null:t.data;default:return null}}var wy={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 hc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!wy[e.type]:t==="textarea"}function dp(e,t,n,r){Uf(r),t=Il(t,"onChange"),0<t.length&&(n=new Wa("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Zr=null,hi=null;function by(e){bp(e,0)}function is(e){var t=ir(e);if(Mf(t))return e}function Sy(e,t){if(e==="change")return t}var fp=!1;if(Kt){var Fs;if(Kt){var $s="oninput"in document;if(!$s){var mc=document.createElement("div");mc.setAttribute("oninput","return;"),$s=typeof mc.oninput=="function"}Fs=$s}else Fs=!1;fp=Fs&&(!document.documentMode||9<document.documentMode)}function gc(){Zr&&(Zr.detachEvent("onpropertychange",pp),hi=Zr=null)}function pp(e){if(e.propertyName==="value"&&is(hi)){var t=[];dp(t,hi,e,Fa(e)),qf(by,t)}}function jy(e,t,n){e==="focusin"?(gc(),Zr=t,hi=n,Zr.attachEvent("onpropertychange",pp)):e==="focusout"&&gc()}function Cy(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return is(hi)}function Ny(e,t){if(e==="click")return is(t)}function Ey(e,t){if(e==="input"||e==="change")return is(t)}function Ty(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Lt=typeof Object.is=="function"?Object.is:Ty;function mi(e,t){if(Lt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!ko.call(t,i)||!Lt(e[i],t[i]))return!1}return!0}function yc(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function xc(e,t){var n=yc(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=yc(n)}}function hp(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?hp(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function mp(){for(var e=window,t=Sl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Sl(e.document)}return t}function Ya(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function zy(e){var t=mp(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&hp(n.ownerDocument.documentElement,n)){if(r!==null&&Ya(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,l=Math.min(r.start,i);r=r.end===void 0?l:Math.min(r.end,i),!e.extend&&l>r&&(i=r,r=l,l=i),i=xc(n,l);var s=xc(n,r);i&&s&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),l>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Iy=Kt&&"documentMode"in document&&11>=document.documentMode,nr=null,Fo=null,Jr=null,$o=!1;function vc(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;$o||nr==null||nr!==Sl(r)||(r=nr,"selectionStart"in r&&Ya(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Jr&&mi(Jr,r)||(Jr=r,r=Il(Fo,"onSelect"),0<r.length&&(t=new Wa("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=nr)))}function Qi(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var rr={animationend:Qi("Animation","AnimationEnd"),animationiteration:Qi("Animation","AnimationIteration"),animationstart:Qi("Animation","AnimationStart"),transitionend:Qi("Transition","TransitionEnd")},Bs={},gp={};Kt&&(gp=document.createElement("div").style,"AnimationEvent"in window||(delete rr.animationend.animation,delete rr.animationiteration.animation,delete rr.animationstart.animation),"TransitionEvent"in window||delete rr.transitionend.transition);function ls(e){if(Bs[e])return Bs[e];if(!rr[e])return e;var t=rr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in gp)return Bs[e]=t[n];return e}var yp=ls("animationend"),xp=ls("animationiteration"),vp=ls("animationstart"),kp=ls("transitionend"),wp=new Map,kc="abort auxClick 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(" ");function wn(e,t){wp.set(e,t),qn(t,[e])}for(var Us=0;Us<kc.length;Us++){var Hs=kc[Us],Py=Hs.toLowerCase(),Ly=Hs[0].toUpperCase()+Hs.slice(1);wn(Py,"on"+Ly)}wn(yp,"onAnimationEnd");wn(xp,"onAnimationIteration");wn(vp,"onAnimationStart");wn("dblclick","onDoubleClick");wn("focusin","onFocus");wn("focusout","onBlur");wn(kp,"onTransitionEnd");vr("onMouseEnter",["mouseout","mouseover"]);vr("onMouseLeave",["mouseout","mouseover"]);vr("onPointerEnter",["pointerout","pointerover"]);vr("onPointerLeave",["pointerout","pointerover"]);qn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));qn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));qn("onBeforeInput",["compositionend","keypress","textInput","paste"]);qn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));qn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));qn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Yr="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(" "),Ay=new Set("cancel close invalid load scroll toggle".split(" ").concat(Yr));function wc(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,Pg(r,t,void 0,e),e.currentTarget=null}function bp(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var l=void 0;if(t)for(var s=r.length-1;0<=s;s--){var a=r[s],u=a.instance,d=a.currentTarget;if(a=a.listener,u!==l&&i.isPropagationStopped())break e;wc(i,a,d),l=u}else for(s=0;s<r.length;s++){if(a=r[s],u=a.instance,d=a.currentTarget,a=a.listener,u!==l&&i.isPropagationStopped())break e;wc(i,a,d),l=u}}}if(Cl)throw e=Mo,Cl=!1,Mo=null,e}function Se(e,t){var n=t[Wo];n===void 0&&(n=t[Wo]=new Set);var r=e+"__bubble";n.has(r)||(Sp(t,e,2,!1),n.add(r))}function Vs(e,t,n){var r=0;t&&(r|=4),Sp(n,e,r,t)}var Yi="_reactListening"+Math.random().toString(36).slice(2);function gi(e){if(!e[Yi]){e[Yi]=!0,If.forEach(function(n){n!=="selectionchange"&&(Ay.has(n)||Vs(n,!1,e),Vs(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Yi]||(t[Yi]=!0,Vs("selectionchange",!1,t))}}function Sp(e,t,n,r){switch(sp(t)){case 1:var i=Qg;break;case 4:i=Yg;break;default:i=Ha}n=i.bind(null,t,n,e),i=void 0,!Do||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function Ws(e,t,n,r,i){var l=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var a=r.stateNode.containerInfo;if(a===i||a.nodeType===8&&a.parentNode===i)break;if(s===4)for(s=r.return;s!==null;){var u=s.tag;if((u===3||u===4)&&(u=s.stateNode.containerInfo,u===i||u.nodeType===8&&u.parentNode===i))return;s=s.return}for(;a!==null;){if(s=Ln(a),s===null)return;if(u=s.tag,u===5||u===6){r=l=s;continue e}a=a.parentNode}}r=r.return}qf(function(){var d=l,c=Fa(n),f=[];e:{var h=wp.get(e);if(h!==void 0){var p=Wa,g=e;switch(e){case"keypress":if(dl(n)===0)break e;case"keydown":case"keyup":p=uy;break;case"focusin":g="focus",p=Os;break;case"focusout":g="blur",p=Os;break;case"beforeblur":case"afterblur":p=Os;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=uc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=Xg;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=fy;break;case yp:case xp:case vp:p=ey;break;case kp:p=hy;break;case"scroll":p=Kg;break;case"wheel":p=gy;break;case"copy":case"cut":case"paste":p=ny;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=dc}var x=(t&4)!==0,C=!x&&e==="scroll",y=x?h!==null?h+"Capture":null:h;x=[];for(var m=d,v;m!==null;){v=m;var N=v.stateNode;if(v.tag===5&&N!==null&&(v=N,y!==null&&(N=ci(m,y),N!=null&&x.push(yi(m,N,v)))),C)break;m=m.return}0<x.length&&(h=new p(h,g,null,n,c),f.push({event:h,listeners:x}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",h&&n!==Lo&&(g=n.relatedTarget||n.fromElement)&&(Ln(g)||g[Gt]))break e;if((p||h)&&(h=c.window===c?c:(h=c.ownerDocument)?h.defaultView||h.parentWindow:window,p?(g=n.relatedTarget||n.toElement,p=d,g=g?Ln(g):null,g!==null&&(C=Qn(g),g!==C||g.tag!==5&&g.tag!==6)&&(g=null)):(p=null,g=d),p!==g)){if(x=uc,N="onMouseLeave",y="onMouseEnter",m="mouse",(e==="pointerout"||e==="pointerover")&&(x=dc,N="onPointerLeave",y="onPointerEnter",m="pointer"),C=p==null?h:ir(p),v=g==null?h:ir(g),h=new x(N,m+"leave",p,n,c),h.target=C,h.relatedTarget=v,N=null,Ln(c)===d&&(x=new x(y,m+"enter",g,n,c),x.target=v,x.relatedTarget=C,N=x),C=N,p&&g)t:{for(x=p,y=g,m=0,v=x;v;v=Xn(v))m++;for(v=0,N=y;N;N=Xn(N))v++;for(;0<m-v;)x=Xn(x),m--;for(;0<v-m;)y=Xn(y),v--;for(;m--;){if(x===y||y!==null&&x===y.alternate)break t;x=Xn(x),y=Xn(y)}x=null}else x=null;p!==null&&bc(f,h,p,x,!1),g!==null&&C!==null&&bc(f,C,g,x,!0)}}e:{if(h=d?ir(d):window,p=h.nodeName&&h.nodeName.toLowerCase(),p==="select"||p==="input"&&h.type==="file")var P=Sy;else if(hc(h))if(fp)P=Ey;else{P=Cy;var j=jy}else(p=h.nodeName)&&p.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(P=Ny);if(P&&(P=P(e,d))){dp(f,P,n,c);break e}j&&j(e,h,d),e==="focusout"&&(j=h._wrapperState)&&j.controlled&&h.type==="number"&&Eo(h,"number",h.value)}switch(j=d?ir(d):window,e){case"focusin":(hc(j)||j.contentEditable==="true")&&(nr=j,Fo=d,Jr=null);break;case"focusout":Jr=Fo=nr=null;break;case"mousedown":$o=!0;break;case"contextmenu":case"mouseup":case"dragend":$o=!1,vc(f,n,c);break;case"selectionchange":if(Iy)break;case"keydown":case"keyup":vc(f,n,c)}var I;if(Qa)e:{switch(e){case"compositionstart":var L="onCompositionStart";break e;case"compositionend":L="onCompositionEnd";break e;case"compositionupdate":L="onCompositionUpdate";break e}L=void 0}else tr?up(e,n)&&(L="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(L="onCompositionStart");L&&(ap&&n.locale!=="ko"&&(tr||L!=="onCompositionStart"?L==="onCompositionEnd"&&tr&&(I=op()):(un=c,Va="value"in un?un.value:un.textContent,tr=!0)),j=Il(d,L),0<j.length&&(L=new cc(L,e,null,n,c),f.push({event:L,listeners:j}),I?L.data=I:(I=cp(n),I!==null&&(L.data=I)))),(I=xy?vy(e,n):ky(e,n))&&(d=Il(d,"onBeforeInput"),0<d.length&&(c=new cc("onBeforeInput","beforeinput",null,n,c),f.push({event:c,listeners:d}),c.data=I))}bp(f,t)})}function yi(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Il(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,l=i.stateNode;i.tag===5&&l!==null&&(i=l,l=ci(e,n),l!=null&&r.unshift(yi(e,l,i)),l=ci(e,t),l!=null&&r.push(yi(e,l,i))),e=e.return}return r}function Xn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function bc(e,t,n,r,i){for(var l=t._reactName,s=[];n!==null&&n!==r;){var a=n,u=a.alternate,d=a.stateNode;if(u!==null&&u===r)break;a.tag===5&&d!==null&&(a=d,i?(u=ci(n,l),u!=null&&s.unshift(yi(n,u,a))):i||(u=ci(n,l),u!=null&&s.push(yi(n,u,a)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var Dy=/\r\n?/g,My=/\u0000|\uFFFD/g;function Sc(e){return(typeof e=="string"?e:""+e).replace(Dy,`
38
- `).replace(My,"")}function Ki(e,t,n){if(t=Sc(t),Sc(e)!==t&&n)throw Error(O(425))}function Pl(){}var Bo=null,Uo=null;function Ho(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Vo=typeof setTimeout=="function"?setTimeout:void 0,Ry=typeof clearTimeout=="function"?clearTimeout:void 0,jc=typeof Promise=="function"?Promise:void 0,_y=typeof queueMicrotask=="function"?queueMicrotask:typeof jc<"u"?function(e){return jc.resolve(null).then(e).catch(Oy)}:Vo;function Oy(e){setTimeout(function(){throw e})}function qs(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),pi(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);pi(t)}function hn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Cc(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Ir=Math.random().toString(36).slice(2),Ft="__reactFiber$"+Ir,xi="__reactProps$"+Ir,Gt="__reactContainer$"+Ir,Wo="__reactEvents$"+Ir,Fy="__reactListeners$"+Ir,$y="__reactHandles$"+Ir;function Ln(e){var t=e[Ft];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Gt]||n[Ft]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Cc(e);e!==null;){if(n=e[Ft])return n;e=Cc(e)}return t}e=n,n=e.parentNode}return null}function Ii(e){return e=e[Ft]||e[Gt],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function ir(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(O(33))}function ss(e){return e[xi]||null}var qo=[],lr=-1;function bn(e){return{current:e}}function je(e){0>lr||(e.current=qo[lr],qo[lr]=null,lr--)}function we(e,t){lr++,qo[lr]=e.current,e.current=t}var kn={},qe=bn(kn),it=bn(!1),Fn=kn;function kr(e,t){var n=e.type.contextTypes;if(!n)return kn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},l;for(l in n)i[l]=t[l];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function lt(e){return e=e.childContextTypes,e!=null}function Ll(){je(it),je(qe)}function Nc(e,t,n){if(qe.current!==kn)throw Error(O(168));we(qe,t),we(it,n)}function jp(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(O(108,jg(e)||"Unknown",i));return ze({},n,r)}function Al(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||kn,Fn=qe.current,we(qe,e),we(it,it.current),!0}function Ec(e,t,n){var r=e.stateNode;if(!r)throw Error(O(169));n?(e=jp(e,t,Fn),r.__reactInternalMemoizedMergedChildContext=e,je(it),je(qe),we(qe,e)):je(it),we(it,n)}var Wt=null,os=!1,Qs=!1;function Cp(e){Wt===null?Wt=[e]:Wt.push(e)}function By(e){os=!0,Cp(e)}function Sn(){if(!Qs&&Wt!==null){Qs=!0;var e=0,t=me;try{var n=Wt;for(me=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Wt=null,os=!1}catch(i){throw Wt!==null&&(Wt=Wt.slice(e+1)),Gf($a,Sn),i}finally{me=t,Qs=!1}}return null}var sr=[],or=0,Dl=null,Ml=0,xt=[],vt=0,$n=null,qt=1,Qt="";function Tn(e,t){sr[or++]=Ml,sr[or++]=Dl,Dl=e,Ml=t}function Np(e,t,n){xt[vt++]=qt,xt[vt++]=Qt,xt[vt++]=$n,$n=e;var r=qt;e=Qt;var i=32-zt(r)-1;r&=~(1<<i),n+=1;var l=32-zt(t)+i;if(30<l){var s=i-i%5;l=(r&(1<<s)-1).toString(32),r>>=s,i-=s,qt=1<<32-zt(t)+i|n<<i|r,Qt=l+e}else qt=1<<l|n<<i|r,Qt=e}function Ka(e){e.return!==null&&(Tn(e,1),Np(e,1,0))}function Ga(e){for(;e===Dl;)Dl=sr[--or],sr[or]=null,Ml=sr[--or],sr[or]=null;for(;e===$n;)$n=xt[--vt],xt[vt]=null,Qt=xt[--vt],xt[vt]=null,qt=xt[--vt],xt[vt]=null}var ft=null,dt=null,Ne=!1,Tt=null;function Ep(e,t){var n=wt(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Tc(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,ft=e,dt=hn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,ft=e,dt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=$n!==null?{id:qt,overflow:Qt}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=wt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,ft=e,dt=null,!0):!1;default:return!1}}function Qo(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Yo(e){if(Ne){var t=dt;if(t){var n=t;if(!Tc(e,t)){if(Qo(e))throw Error(O(418));t=hn(n.nextSibling);var r=ft;t&&Tc(e,t)?Ep(r,n):(e.flags=e.flags&-4097|2,Ne=!1,ft=e)}}else{if(Qo(e))throw Error(O(418));e.flags=e.flags&-4097|2,Ne=!1,ft=e}}}function zc(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;ft=e}function Gi(e){if(e!==ft)return!1;if(!Ne)return zc(e),Ne=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Ho(e.type,e.memoizedProps)),t&&(t=dt)){if(Qo(e))throw Tp(),Error(O(418));for(;t;)Ep(e,t),t=hn(t.nextSibling)}if(zc(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(O(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){dt=hn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}dt=null}}else dt=ft?hn(e.stateNode.nextSibling):null;return!0}function Tp(){for(var e=dt;e;)e=hn(e.nextSibling)}function wr(){dt=ft=null,Ne=!1}function Xa(e){Tt===null?Tt=[e]:Tt.push(e)}var Uy=Jt.ReactCurrentBatchConfig;function $r(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(O(309));var r=n.stateNode}if(!r)throw Error(O(147,e));var i=r,l=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===l?t.ref:(t=function(s){var a=i.refs;s===null?delete a[l]:a[l]=s},t._stringRef=l,t)}if(typeof e!="string")throw Error(O(284));if(!n._owner)throw Error(O(290,e))}return e}function Xi(e,t){throw e=Object.prototype.toString.call(t),Error(O(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Ic(e){var t=e._init;return t(e._payload)}function zp(e){function t(y,m){if(e){var v=y.deletions;v===null?(y.deletions=[m],y.flags|=16):v.push(m)}}function n(y,m){if(!e)return null;for(;m!==null;)t(y,m),m=m.sibling;return null}function r(y,m){for(y=new Map;m!==null;)m.key!==null?y.set(m.key,m):y.set(m.index,m),m=m.sibling;return y}function i(y,m){return y=xn(y,m),y.index=0,y.sibling=null,y}function l(y,m,v){return y.index=v,e?(v=y.alternate,v!==null?(v=v.index,v<m?(y.flags|=2,m):v):(y.flags|=2,m)):(y.flags|=1048576,m)}function s(y){return e&&y.alternate===null&&(y.flags|=2),y}function a(y,m,v,N){return m===null||m.tag!==6?(m=eo(v,y.mode,N),m.return=y,m):(m=i(m,v),m.return=y,m)}function u(y,m,v,N){var P=v.type;return P===er?c(y,m,v.props.children,N,v.key):m!==null&&(m.elementType===P||typeof P=="object"&&P!==null&&P.$$typeof===ln&&Ic(P)===m.type)?(N=i(m,v.props),N.ref=$r(y,m,v),N.return=y,N):(N=xl(v.type,v.key,v.props,null,y.mode,N),N.ref=$r(y,m,v),N.return=y,N)}function d(y,m,v,N){return m===null||m.tag!==4||m.stateNode.containerInfo!==v.containerInfo||m.stateNode.implementation!==v.implementation?(m=to(v,y.mode,N),m.return=y,m):(m=i(m,v.children||[]),m.return=y,m)}function c(y,m,v,N,P){return m===null||m.tag!==7?(m=_n(v,y.mode,N,P),m.return=y,m):(m=i(m,v),m.return=y,m)}function f(y,m,v){if(typeof m=="string"&&m!==""||typeof m=="number")return m=eo(""+m,y.mode,v),m.return=y,m;if(typeof m=="object"&&m!==null){switch(m.$$typeof){case $i:return v=xl(m.type,m.key,m.props,null,y.mode,v),v.ref=$r(y,null,m),v.return=y,v;case Jn:return m=to(m,y.mode,v),m.return=y,m;case ln:var N=m._init;return f(y,N(m._payload),v)}if(qr(m)||Mr(m))return m=_n(m,y.mode,v,null),m.return=y,m;Xi(y,m)}return null}function h(y,m,v,N){var P=m!==null?m.key:null;if(typeof v=="string"&&v!==""||typeof v=="number")return P!==null?null:a(y,m,""+v,N);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case $i:return v.key===P?u(y,m,v,N):null;case Jn:return v.key===P?d(y,m,v,N):null;case ln:return P=v._init,h(y,m,P(v._payload),N)}if(qr(v)||Mr(v))return P!==null?null:c(y,m,v,N,null);Xi(y,v)}return null}function p(y,m,v,N,P){if(typeof N=="string"&&N!==""||typeof N=="number")return y=y.get(v)||null,a(m,y,""+N,P);if(typeof N=="object"&&N!==null){switch(N.$$typeof){case $i:return y=y.get(N.key===null?v:N.key)||null,u(m,y,N,P);case Jn:return y=y.get(N.key===null?v:N.key)||null,d(m,y,N,P);case ln:var j=N._init;return p(y,m,v,j(N._payload),P)}if(qr(N)||Mr(N))return y=y.get(v)||null,c(m,y,N,P,null);Xi(m,N)}return null}function g(y,m,v,N){for(var P=null,j=null,I=m,L=m=0,T=null;I!==null&&L<v.length;L++){I.index>L?(T=I,I=null):T=I.sibling;var w=h(y,I,v[L],N);if(w===null){I===null&&(I=T);break}e&&I&&w.alternate===null&&t(y,I),m=l(w,m,L),j===null?P=w:j.sibling=w,j=w,I=T}if(L===v.length)return n(y,I),Ne&&Tn(y,L),P;if(I===null){for(;L<v.length;L++)I=f(y,v[L],N),I!==null&&(m=l(I,m,L),j===null?P=I:j.sibling=I,j=I);return Ne&&Tn(y,L),P}for(I=r(y,I);L<v.length;L++)T=p(I,y,L,v[L],N),T!==null&&(e&&T.alternate!==null&&I.delete(T.key===null?L:T.key),m=l(T,m,L),j===null?P=T:j.sibling=T,j=T);return e&&I.forEach(function(z){return t(y,z)}),Ne&&Tn(y,L),P}function x(y,m,v,N){var P=Mr(v);if(typeof P!="function")throw Error(O(150));if(v=P.call(v),v==null)throw Error(O(151));for(var j=P=null,I=m,L=m=0,T=null,w=v.next();I!==null&&!w.done;L++,w=v.next()){I.index>L?(T=I,I=null):T=I.sibling;var z=h(y,I,w.value,N);if(z===null){I===null&&(I=T);break}e&&I&&z.alternate===null&&t(y,I),m=l(z,m,L),j===null?P=z:j.sibling=z,j=z,I=T}if(w.done)return n(y,I),Ne&&Tn(y,L),P;if(I===null){for(;!w.done;L++,w=v.next())w=f(y,w.value,N),w!==null&&(m=l(w,m,L),j===null?P=w:j.sibling=w,j=w);return Ne&&Tn(y,L),P}for(I=r(y,I);!w.done;L++,w=v.next())w=p(I,y,L,w.value,N),w!==null&&(e&&w.alternate!==null&&I.delete(w.key===null?L:w.key),m=l(w,m,L),j===null?P=w:j.sibling=w,j=w);return e&&I.forEach(function(A){return t(y,A)}),Ne&&Tn(y,L),P}function C(y,m,v,N){if(typeof v=="object"&&v!==null&&v.type===er&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case $i:e:{for(var P=v.key,j=m;j!==null;){if(j.key===P){if(P=v.type,P===er){if(j.tag===7){n(y,j.sibling),m=i(j,v.props.children),m.return=y,y=m;break e}}else if(j.elementType===P||typeof P=="object"&&P!==null&&P.$$typeof===ln&&Ic(P)===j.type){n(y,j.sibling),m=i(j,v.props),m.ref=$r(y,j,v),m.return=y,y=m;break e}n(y,j);break}else t(y,j);j=j.sibling}v.type===er?(m=_n(v.props.children,y.mode,N,v.key),m.return=y,y=m):(N=xl(v.type,v.key,v.props,null,y.mode,N),N.ref=$r(y,m,v),N.return=y,y=N)}return s(y);case Jn:e:{for(j=v.key;m!==null;){if(m.key===j)if(m.tag===4&&m.stateNode.containerInfo===v.containerInfo&&m.stateNode.implementation===v.implementation){n(y,m.sibling),m=i(m,v.children||[]),m.return=y,y=m;break e}else{n(y,m);break}else t(y,m);m=m.sibling}m=to(v,y.mode,N),m.return=y,y=m}return s(y);case ln:return j=v._init,C(y,m,j(v._payload),N)}if(qr(v))return g(y,m,v,N);if(Mr(v))return x(y,m,v,N);Xi(y,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,m!==null&&m.tag===6?(n(y,m.sibling),m=i(m,v),m.return=y,y=m):(n(y,m),m=eo(v,y.mode,N),m.return=y,y=m),s(y)):n(y,m)}return C}var br=zp(!0),Ip=zp(!1),Rl=bn(null),_l=null,ar=null,Za=null;function Ja(){Za=ar=_l=null}function eu(e){var t=Rl.current;je(Rl),e._currentValue=t}function Ko(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function gr(e,t){_l=e,Za=ar=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(rt=!0),e.firstContext=null)}function St(e){var t=e._currentValue;if(Za!==e)if(e={context:e,memoizedValue:t,next:null},ar===null){if(_l===null)throw Error(O(308));ar=e,_l.dependencies={lanes:0,firstContext:e}}else ar=ar.next=e;return t}var An=null;function tu(e){An===null?An=[e]:An.push(e)}function Pp(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,tu(t)):(n.next=i.next,i.next=n),t.interleaved=n,Xt(e,r)}function Xt(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var sn=!1;function nu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Lp(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Yt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function mn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,pe&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Xt(e,n)}return i=r.interleaved,i===null?(t.next=t,tu(r)):(t.next=i.next,i.next=t),r.interleaved=t,Xt(e,n)}function fl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ba(e,n)}}function Pc(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,l=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};l===null?i=l=s:l=l.next=s,n=n.next}while(n!==null);l===null?i=l=t:l=l.next=t}else i=l=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:l,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Ol(e,t,n,r){var i=e.updateQueue;sn=!1;var l=i.firstBaseUpdate,s=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var u=a,d=u.next;u.next=null,s===null?l=d:s.next=d,s=u;var c=e.alternate;c!==null&&(c=c.updateQueue,a=c.lastBaseUpdate,a!==s&&(a===null?c.firstBaseUpdate=d:a.next=d,c.lastBaseUpdate=u))}if(l!==null){var f=i.baseState;s=0,c=d=u=null,a=l;do{var h=a.lane,p=a.eventTime;if((r&h)===h){c!==null&&(c=c.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var g=e,x=a;switch(h=t,p=n,x.tag){case 1:if(g=x.payload,typeof g=="function"){f=g.call(p,f,h);break e}f=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=x.payload,h=typeof g=="function"?g.call(p,f,h):g,h==null)break e;f=ze({},f,h);break e;case 2:sn=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,h=i.effects,h===null?i.effects=[a]:h.push(a))}else p={eventTime:p,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},c===null?(d=c=p,u=f):c=c.next=p,s|=h;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;h=a,a=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(c===null&&(u=f),i.baseState=u,i.firstBaseUpdate=d,i.lastBaseUpdate=c,t=i.shared.interleaved,t!==null){i=t;do s|=i.lane,i=i.next;while(i!==t)}else l===null&&(i.shared.lanes=0);Un|=s,e.lanes=s,e.memoizedState=f}}function Lc(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(O(191,i));i.call(r)}}}var Pi={},Bt=bn(Pi),vi=bn(Pi),ki=bn(Pi);function Dn(e){if(e===Pi)throw Error(O(174));return e}function ru(e,t){switch(we(ki,t),we(vi,e),we(Bt,Pi),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:zo(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=zo(t,e)}je(Bt),we(Bt,t)}function Sr(){je(Bt),je(vi),je(ki)}function Ap(e){Dn(ki.current);var t=Dn(Bt.current),n=zo(t,e.type);t!==n&&(we(vi,e),we(Bt,n))}function iu(e){vi.current===e&&(je(Bt),je(vi))}var Ee=bn(0);function Fl(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ys=[];function lu(){for(var e=0;e<Ys.length;e++)Ys[e]._workInProgressVersionPrimary=null;Ys.length=0}var pl=Jt.ReactCurrentDispatcher,Ks=Jt.ReactCurrentBatchConfig,Bn=0,Te=null,Me=null,_e=null,$l=!1,ei=!1,wi=0,Hy=0;function Ue(){throw Error(O(321))}function su(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Lt(e[n],t[n]))return!1;return!0}function ou(e,t,n,r,i,l){if(Bn=l,Te=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,pl.current=e===null||e.memoizedState===null?Qy:Yy,e=n(r,i),ei){l=0;do{if(ei=!1,wi=0,25<=l)throw Error(O(301));l+=1,_e=Me=null,t.updateQueue=null,pl.current=Ky,e=n(r,i)}while(ei)}if(pl.current=Bl,t=Me!==null&&Me.next!==null,Bn=0,_e=Me=Te=null,$l=!1,t)throw Error(O(300));return e}function au(){var e=wi!==0;return wi=0,e}function _t(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return _e===null?Te.memoizedState=_e=e:_e=_e.next=e,_e}function jt(){if(Me===null){var e=Te.alternate;e=e!==null?e.memoizedState:null}else e=Me.next;var t=_e===null?Te.memoizedState:_e.next;if(t!==null)_e=t,Me=e;else{if(e===null)throw Error(O(310));Me=e,e={memoizedState:Me.memoizedState,baseState:Me.baseState,baseQueue:Me.baseQueue,queue:Me.queue,next:null},_e===null?Te.memoizedState=_e=e:_e=_e.next=e}return _e}function bi(e,t){return typeof t=="function"?t(e):t}function Gs(e){var t=jt(),n=t.queue;if(n===null)throw Error(O(311));n.lastRenderedReducer=e;var r=Me,i=r.baseQueue,l=n.pending;if(l!==null){if(i!==null){var s=i.next;i.next=l.next,l.next=s}r.baseQueue=i=l,n.pending=null}if(i!==null){l=i.next,r=r.baseState;var a=s=null,u=null,d=l;do{var c=d.lane;if((Bn&c)===c)u!==null&&(u=u.next={lane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),r=d.hasEagerState?d.eagerState:e(r,d.action);else{var f={lane:c,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};u===null?(a=u=f,s=r):u=u.next=f,Te.lanes|=c,Un|=c}d=d.next}while(d!==null&&d!==l);u===null?s=r:u.next=a,Lt(r,t.memoizedState)||(rt=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=u,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do l=i.lane,Te.lanes|=l,Un|=l,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Xs(e){var t=jt(),n=t.queue;if(n===null)throw Error(O(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,l=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do l=e(l,s.action),s=s.next;while(s!==i);Lt(l,t.memoizedState)||(rt=!0),t.memoizedState=l,t.baseQueue===null&&(t.baseState=l),n.lastRenderedState=l}return[l,r]}function Dp(){}function Mp(e,t){var n=Te,r=jt(),i=t(),l=!Lt(r.memoizedState,i);if(l&&(r.memoizedState=i,rt=!0),r=r.queue,uu(Op.bind(null,n,r,e),[e]),r.getSnapshot!==t||l||_e!==null&&_e.memoizedState.tag&1){if(n.flags|=2048,Si(9,_p.bind(null,n,r,i,t),void 0,null),Oe===null)throw Error(O(349));Bn&30||Rp(n,t,i)}return i}function Rp(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Te.updateQueue,t===null?(t={lastEffect:null,stores:null},Te.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function _p(e,t,n,r){t.value=n,t.getSnapshot=r,Fp(t)&&$p(e)}function Op(e,t,n){return n(function(){Fp(t)&&$p(e)})}function Fp(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Lt(e,n)}catch{return!0}}function $p(e){var t=Xt(e,1);t!==null&&It(t,e,1,-1)}function Ac(e){var t=_t();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:bi,lastRenderedState:e},t.queue=e,e=e.dispatch=qy.bind(null,Te,e),[t.memoizedState,e]}function Si(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Te.updateQueue,t===null?(t={lastEffect:null,stores:null},Te.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Bp(){return jt().memoizedState}function hl(e,t,n,r){var i=_t();Te.flags|=e,i.memoizedState=Si(1|t,n,void 0,r===void 0?null:r)}function as(e,t,n,r){var i=jt();r=r===void 0?null:r;var l=void 0;if(Me!==null){var s=Me.memoizedState;if(l=s.destroy,r!==null&&su(r,s.deps)){i.memoizedState=Si(t,n,l,r);return}}Te.flags|=e,i.memoizedState=Si(1|t,n,l,r)}function Dc(e,t){return hl(8390656,8,e,t)}function uu(e,t){return as(2048,8,e,t)}function Up(e,t){return as(4,2,e,t)}function Hp(e,t){return as(4,4,e,t)}function Vp(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Wp(e,t,n){return n=n!=null?n.concat([e]):null,as(4,4,Vp.bind(null,t,e),n)}function cu(){}function qp(e,t){var n=jt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&su(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Qp(e,t){var n=jt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&su(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Yp(e,t,n){return Bn&21?(Lt(n,t)||(n=Jf(),Te.lanes|=n,Un|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,rt=!0),e.memoizedState=n)}function Vy(e,t){var n=me;me=n!==0&&4>n?n:4,e(!0);var r=Ks.transition;Ks.transition={};try{e(!1),t()}finally{me=n,Ks.transition=r}}function Kp(){return jt().memoizedState}function Wy(e,t,n){var r=yn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Gp(e))Xp(t,n);else if(n=Pp(e,t,n,r),n!==null){var i=Ge();It(n,e,r,i),Zp(n,t,r)}}function qy(e,t,n){var r=yn(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Gp(e))Xp(t,i);else{var l=e.alternate;if(e.lanes===0&&(l===null||l.lanes===0)&&(l=t.lastRenderedReducer,l!==null))try{var s=t.lastRenderedState,a=l(s,n);if(i.hasEagerState=!0,i.eagerState=a,Lt(a,s)){var u=t.interleaved;u===null?(i.next=i,tu(t)):(i.next=u.next,u.next=i),t.interleaved=i;return}}catch{}finally{}n=Pp(e,t,i,r),n!==null&&(i=Ge(),It(n,e,r,i),Zp(n,t,r))}}function Gp(e){var t=e.alternate;return e===Te||t!==null&&t===Te}function Xp(e,t){ei=$l=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Zp(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ba(e,n)}}var Bl={readContext:St,useCallback:Ue,useContext:Ue,useEffect:Ue,useImperativeHandle:Ue,useInsertionEffect:Ue,useLayoutEffect:Ue,useMemo:Ue,useReducer:Ue,useRef:Ue,useState:Ue,useDebugValue:Ue,useDeferredValue:Ue,useTransition:Ue,useMutableSource:Ue,useSyncExternalStore:Ue,useId:Ue,unstable_isNewReconciler:!1},Qy={readContext:St,useCallback:function(e,t){return _t().memoizedState=[e,t===void 0?null:t],e},useContext:St,useEffect:Dc,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,hl(4194308,4,Vp.bind(null,t,e),n)},useLayoutEffect:function(e,t){return hl(4194308,4,e,t)},useInsertionEffect:function(e,t){return hl(4,2,e,t)},useMemo:function(e,t){var n=_t();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=_t();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Wy.bind(null,Te,e),[r.memoizedState,e]},useRef:function(e){var t=_t();return e={current:e},t.memoizedState=e},useState:Ac,useDebugValue:cu,useDeferredValue:function(e){return _t().memoizedState=e},useTransition:function(){var e=Ac(!1),t=e[0];return e=Vy.bind(null,e[1]),_t().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Te,i=_t();if(Ne){if(n===void 0)throw Error(O(407));n=n()}else{if(n=t(),Oe===null)throw Error(O(349));Bn&30||Rp(r,t,n)}i.memoizedState=n;var l={value:n,getSnapshot:t};return i.queue=l,Dc(Op.bind(null,r,l,e),[e]),r.flags|=2048,Si(9,_p.bind(null,r,l,n,t),void 0,null),n},useId:function(){var e=_t(),t=Oe.identifierPrefix;if(Ne){var n=Qt,r=qt;n=(r&~(1<<32-zt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=wi++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Hy++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Yy={readContext:St,useCallback:qp,useContext:St,useEffect:uu,useImperativeHandle:Wp,useInsertionEffect:Up,useLayoutEffect:Hp,useMemo:Qp,useReducer:Gs,useRef:Bp,useState:function(){return Gs(bi)},useDebugValue:cu,useDeferredValue:function(e){var t=jt();return Yp(t,Me.memoizedState,e)},useTransition:function(){var e=Gs(bi)[0],t=jt().memoizedState;return[e,t]},useMutableSource:Dp,useSyncExternalStore:Mp,useId:Kp,unstable_isNewReconciler:!1},Ky={readContext:St,useCallback:qp,useContext:St,useEffect:uu,useImperativeHandle:Wp,useInsertionEffect:Up,useLayoutEffect:Hp,useMemo:Qp,useReducer:Xs,useRef:Bp,useState:function(){return Xs(bi)},useDebugValue:cu,useDeferredValue:function(e){var t=jt();return Me===null?t.memoizedState=e:Yp(t,Me.memoizedState,e)},useTransition:function(){var e=Xs(bi)[0],t=jt().memoizedState;return[e,t]},useMutableSource:Dp,useSyncExternalStore:Mp,useId:Kp,unstable_isNewReconciler:!1};function Nt(e,t){if(e&&e.defaultProps){t=ze({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Go(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:ze({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var us={isMounted:function(e){return(e=e._reactInternals)?Qn(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ge(),i=yn(e),l=Yt(r,i);l.payload=t,n!=null&&(l.callback=n),t=mn(e,l,i),t!==null&&(It(t,e,i,r),fl(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ge(),i=yn(e),l=Yt(r,i);l.tag=1,l.payload=t,n!=null&&(l.callback=n),t=mn(e,l,i),t!==null&&(It(t,e,i,r),fl(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ge(),r=yn(e),i=Yt(n,r);i.tag=2,t!=null&&(i.callback=t),t=mn(e,i,r),t!==null&&(It(t,e,r,n),fl(t,e,r))}};function Mc(e,t,n,r,i,l,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,l,s):t.prototype&&t.prototype.isPureReactComponent?!mi(n,r)||!mi(i,l):!0}function Jp(e,t,n){var r=!1,i=kn,l=t.contextType;return typeof l=="object"&&l!==null?l=St(l):(i=lt(t)?Fn:qe.current,r=t.contextTypes,l=(r=r!=null)?kr(e,i):kn),t=new t(n,l),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=us,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=l),t}function Rc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&us.enqueueReplaceState(t,t.state,null)}function Xo(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},nu(e);var l=t.contextType;typeof l=="object"&&l!==null?i.context=St(l):(l=lt(t)?Fn:qe.current,i.context=kr(e,l)),i.state=e.memoizedState,l=t.getDerivedStateFromProps,typeof l=="function"&&(Go(e,t,l,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&us.enqueueReplaceState(i,i.state,null),Ol(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function jr(e,t){try{var n="",r=t;do n+=Sg(r),r=r.return;while(r);var i=n}catch(l){i=`
39
- Error generating stack: `+l.message+`
40
- `+l.stack}return{value:e,source:t,stack:i,digest:null}}function Zs(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Zo(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Gy=typeof WeakMap=="function"?WeakMap:Map;function eh(e,t,n){n=Yt(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Hl||(Hl=!0,aa=r),Zo(e,t)},n}function th(e,t,n){n=Yt(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){Zo(e,t)}}var l=e.stateNode;return l!==null&&typeof l.componentDidCatch=="function"&&(n.callback=function(){Zo(e,t),typeof r!="function"&&(gn===null?gn=new Set([this]):gn.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function _c(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Gy;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=cx.bind(null,e,t,n),t.then(e,e))}function Oc(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Fc(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Yt(-1,1),t.tag=2,mn(n,t,1))),n.lanes|=1),e)}var Xy=Jt.ReactCurrentOwner,rt=!1;function Ye(e,t,n,r){t.child=e===null?Ip(t,null,n,r):br(t,e.child,n,r)}function $c(e,t,n,r,i){n=n.render;var l=t.ref;return gr(t,i),r=ou(e,t,n,r,l,i),n=au(),e!==null&&!rt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Zt(e,t,i)):(Ne&&n&&Ka(t),t.flags|=1,Ye(e,t,r,i),t.child)}function Bc(e,t,n,r,i){if(e===null){var l=n.type;return typeof l=="function"&&!xu(l)&&l.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=l,nh(e,t,l,r,i)):(e=xl(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(l=e.child,!(e.lanes&i)){var s=l.memoizedProps;if(n=n.compare,n=n!==null?n:mi,n(s,r)&&e.ref===t.ref)return Zt(e,t,i)}return t.flags|=1,e=xn(l,r),e.ref=t.ref,e.return=t,t.child=e}function nh(e,t,n,r,i){if(e!==null){var l=e.memoizedProps;if(mi(l,r)&&e.ref===t.ref)if(rt=!1,t.pendingProps=r=l,(e.lanes&i)!==0)e.flags&131072&&(rt=!0);else return t.lanes=e.lanes,Zt(e,t,i)}return Jo(e,t,n,r,i)}function rh(e,t,n){var r=t.pendingProps,i=r.children,l=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},we(cr,ct),ct|=n;else{if(!(n&1073741824))return e=l!==null?l.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,we(cr,ct),ct|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=l!==null?l.baseLanes:n,we(cr,ct),ct|=r}else l!==null?(r=l.baseLanes|n,t.memoizedState=null):r=n,we(cr,ct),ct|=r;return Ye(e,t,i,n),t.child}function ih(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Jo(e,t,n,r,i){var l=lt(n)?Fn:qe.current;return l=kr(t,l),gr(t,i),n=ou(e,t,n,r,l,i),r=au(),e!==null&&!rt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Zt(e,t,i)):(Ne&&r&&Ka(t),t.flags|=1,Ye(e,t,n,i),t.child)}function Uc(e,t,n,r,i){if(lt(n)){var l=!0;Al(t)}else l=!1;if(gr(t,i),t.stateNode===null)ml(e,t),Jp(t,n,r),Xo(t,n,r,i),r=!0;else if(e===null){var s=t.stateNode,a=t.memoizedProps;s.props=a;var u=s.context,d=n.contextType;typeof d=="object"&&d!==null?d=St(d):(d=lt(n)?Fn:qe.current,d=kr(t,d));var c=n.getDerivedStateFromProps,f=typeof c=="function"||typeof s.getSnapshotBeforeUpdate=="function";f||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==r||u!==d)&&Rc(t,s,r,d),sn=!1;var h=t.memoizedState;s.state=h,Ol(t,r,s,i),u=t.memoizedState,a!==r||h!==u||it.current||sn?(typeof c=="function"&&(Go(t,n,c,r),u=t.memoizedState),(a=sn||Mc(t,n,a,r,h,u,d))?(f||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),s.props=r,s.state=u,s.context=d,r=a):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,Lp(e,t),a=t.memoizedProps,d=t.type===t.elementType?a:Nt(t.type,a),s.props=d,f=t.pendingProps,h=s.context,u=n.contextType,typeof u=="object"&&u!==null?u=St(u):(u=lt(n)?Fn:qe.current,u=kr(t,u));var p=n.getDerivedStateFromProps;(c=typeof p=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==f||h!==u)&&Rc(t,s,r,u),sn=!1,h=t.memoizedState,s.state=h,Ol(t,r,s,i);var g=t.memoizedState;a!==f||h!==g||it.current||sn?(typeof p=="function"&&(Go(t,n,p,r),g=t.memoizedState),(d=sn||Mc(t,n,d,r,h,g,u)||!1)?(c||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,g,u),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,g,u)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=g),s.props=r,s.state=g,s.context=u,r=d):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return ea(e,t,n,r,l,i)}function ea(e,t,n,r,i,l){ih(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return i&&Ec(t,n,!1),Zt(e,t,l);r=t.stateNode,Xy.current=t;var a=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=br(t,e.child,null,l),t.child=br(t,null,a,l)):Ye(e,t,a,l),t.memoizedState=r.state,i&&Ec(t,n,!0),t.child}function lh(e){var t=e.stateNode;t.pendingContext?Nc(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Nc(e,t.context,!1),ru(e,t.containerInfo)}function Hc(e,t,n,r,i){return wr(),Xa(i),t.flags|=256,Ye(e,t,n,r),t.child}var ta={dehydrated:null,treeContext:null,retryLane:0};function na(e){return{baseLanes:e,cachePool:null,transitions:null}}function sh(e,t,n){var r=t.pendingProps,i=Ee.current,l=!1,s=(t.flags&128)!==0,a;if((a=s)||(a=e!==null&&e.memoizedState===null?!1:(i&2)!==0),a?(l=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),we(Ee,i&1),e===null)return Yo(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=r.children,e=r.fallback,l?(r=t.mode,l=t.child,s={mode:"hidden",children:s},!(r&1)&&l!==null?(l.childLanes=0,l.pendingProps=s):l=fs(s,r,0,null),e=_n(e,r,n,null),l.return=t,e.return=t,l.sibling=e,t.child=l,t.child.memoizedState=na(n),t.memoizedState=ta,e):du(t,s));if(i=e.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return Zy(e,t,s,r,a,i,n);if(l){l=r.fallback,s=t.mode,i=e.child,a=i.sibling;var u={mode:"hidden",children:r.children};return!(s&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=u,t.deletions=null):(r=xn(i,u),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?l=xn(a,l):(l=_n(l,s,n,null),l.flags|=2),l.return=t,r.return=t,r.sibling=l,t.child=r,r=l,l=t.child,s=e.child.memoizedState,s=s===null?na(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},l.memoizedState=s,l.childLanes=e.childLanes&~n,t.memoizedState=ta,r}return l=e.child,e=l.sibling,r=xn(l,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function du(e,t){return t=fs({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Zi(e,t,n,r){return r!==null&&Xa(r),br(t,e.child,null,n),e=du(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Zy(e,t,n,r,i,l,s){if(n)return t.flags&256?(t.flags&=-257,r=Zs(Error(O(422))),Zi(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(l=r.fallback,i=t.mode,r=fs({mode:"visible",children:r.children},i,0,null),l=_n(l,i,s,null),l.flags|=2,r.return=t,l.return=t,r.sibling=l,t.child=r,t.mode&1&&br(t,e.child,null,s),t.child.memoizedState=na(s),t.memoizedState=ta,l);if(!(t.mode&1))return Zi(e,t,s,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,l=Error(O(419)),r=Zs(l,r,void 0),Zi(e,t,s,r)}if(a=(s&e.childLanes)!==0,rt||a){if(r=Oe,r!==null){switch(s&-s){case 4:i=2;break;case 16:i=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|s)?0:i,i!==0&&i!==l.retryLane&&(l.retryLane=i,Xt(e,i),It(r,e,i,-1))}return yu(),r=Zs(Error(O(421))),Zi(e,t,s,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=dx.bind(null,e),i._reactRetry=t,null):(e=l.treeContext,dt=hn(i.nextSibling),ft=t,Ne=!0,Tt=null,e!==null&&(xt[vt++]=qt,xt[vt++]=Qt,xt[vt++]=$n,qt=e.id,Qt=e.overflow,$n=t),t=du(t,r.children),t.flags|=4096,t)}function Vc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ko(e.return,t,n)}function Js(e,t,n,r,i){var l=e.memoizedState;l===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(l.isBackwards=t,l.rendering=null,l.renderingStartTime=0,l.last=r,l.tail=n,l.tailMode=i)}function oh(e,t,n){var r=t.pendingProps,i=r.revealOrder,l=r.tail;if(Ye(e,t,r.children,n),r=Ee.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Vc(e,n,t);else if(e.tag===19)Vc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(we(Ee,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Fl(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Js(t,!1,i,n,l);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Fl(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Js(t,!0,n,null,l);break;case"together":Js(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ml(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Zt(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Un|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(O(153));if(t.child!==null){for(e=t.child,n=xn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=xn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Jy(e,t,n){switch(t.tag){case 3:lh(t),wr();break;case 5:Ap(t);break;case 1:lt(t.type)&&Al(t);break;case 4:ru(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;we(Rl,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(we(Ee,Ee.current&1),t.flags|=128,null):n&t.child.childLanes?sh(e,t,n):(we(Ee,Ee.current&1),e=Zt(e,t,n),e!==null?e.sibling:null);we(Ee,Ee.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return oh(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),we(Ee,Ee.current),r)break;return null;case 22:case 23:return t.lanes=0,rh(e,t,n)}return Zt(e,t,n)}var ah,ra,uh,ch;ah=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};ra=function(){};uh=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Dn(Bt.current);var l=null;switch(n){case"input":i=Co(e,i),r=Co(e,r),l=[];break;case"select":i=ze({},i,{value:void 0}),r=ze({},r,{value:void 0}),l=[];break;case"textarea":i=To(e,i),r=To(e,r),l=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Pl)}Io(n,r);var s;n=null;for(d in i)if(!r.hasOwnProperty(d)&&i.hasOwnProperty(d)&&i[d]!=null)if(d==="style"){var a=i[d];for(s in a)a.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(ai.hasOwnProperty(d)?l||(l=[]):(l=l||[]).push(d,null));for(d in r){var u=r[d];if(a=i!=null?i[d]:void 0,r.hasOwnProperty(d)&&u!==a&&(u!=null||a!=null))if(d==="style")if(a){for(s in a)!a.hasOwnProperty(s)||u&&u.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in u)u.hasOwnProperty(s)&&a[s]!==u[s]&&(n||(n={}),n[s]=u[s])}else n||(l||(l=[]),l.push(d,n)),n=u;else d==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,a=a?a.__html:void 0,u!=null&&a!==u&&(l=l||[]).push(d,u)):d==="children"?typeof u!="string"&&typeof u!="number"||(l=l||[]).push(d,""+u):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(ai.hasOwnProperty(d)?(u!=null&&d==="onScroll"&&Se("scroll",e),l||a===u||(l=[])):(l=l||[]).push(d,u))}n&&(l=l||[]).push("style",n);var d=l;(t.updateQueue=d)&&(t.flags|=4)}};ch=function(e,t,n,r){n!==r&&(t.flags|=4)};function Br(e,t){if(!Ne)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function He(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function ex(e,t,n){var r=t.pendingProps;switch(Ga(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return He(t),null;case 1:return lt(t.type)&&Ll(),He(t),null;case 3:return r=t.stateNode,Sr(),je(it),je(qe),lu(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Gi(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Tt!==null&&(da(Tt),Tt=null))),ra(e,t),He(t),null;case 5:iu(t);var i=Dn(ki.current);if(n=t.type,e!==null&&t.stateNode!=null)uh(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(O(166));return He(t),null}if(e=Dn(Bt.current),Gi(t)){r=t.stateNode,n=t.type;var l=t.memoizedProps;switch(r[Ft]=t,r[xi]=l,e=(t.mode&1)!==0,n){case"dialog":Se("cancel",r),Se("close",r);break;case"iframe":case"object":case"embed":Se("load",r);break;case"video":case"audio":for(i=0;i<Yr.length;i++)Se(Yr[i],r);break;case"source":Se("error",r);break;case"img":case"image":case"link":Se("error",r),Se("load",r);break;case"details":Se("toggle",r);break;case"input":Ju(r,l),Se("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!l.multiple},Se("invalid",r);break;case"textarea":tc(r,l),Se("invalid",r)}Io(n,l),i=null;for(var s in l)if(l.hasOwnProperty(s)){var a=l[s];s==="children"?typeof a=="string"?r.textContent!==a&&(l.suppressHydrationWarning!==!0&&Ki(r.textContent,a,e),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(l.suppressHydrationWarning!==!0&&Ki(r.textContent,a,e),i=["children",""+a]):ai.hasOwnProperty(s)&&a!=null&&s==="onScroll"&&Se("scroll",r)}switch(n){case"input":Bi(r),ec(r,l,!0);break;case"textarea":Bi(r),nc(r);break;case"select":case"option":break;default:typeof l.onClick=="function"&&(r.onclick=Pl)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Of(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[Ft]=t,e[xi]=r,ah(e,t,!1,!1),t.stateNode=e;e:{switch(s=Po(n,r),n){case"dialog":Se("cancel",e),Se("close",e),i=r;break;case"iframe":case"object":case"embed":Se("load",e),i=r;break;case"video":case"audio":for(i=0;i<Yr.length;i++)Se(Yr[i],e);i=r;break;case"source":Se("error",e),i=r;break;case"img":case"image":case"link":Se("error",e),Se("load",e),i=r;break;case"details":Se("toggle",e),i=r;break;case"input":Ju(e,r),i=Co(e,r),Se("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=ze({},r,{value:void 0}),Se("invalid",e);break;case"textarea":tc(e,r),i=To(e,r),Se("invalid",e);break;default:i=r}Io(n,i),a=i;for(l in a)if(a.hasOwnProperty(l)){var u=a[l];l==="style"?Bf(e,u):l==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&Ff(e,u)):l==="children"?typeof u=="string"?(n!=="textarea"||u!=="")&&ui(e,u):typeof u=="number"&&ui(e,""+u):l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&l!=="autoFocus"&&(ai.hasOwnProperty(l)?u!=null&&l==="onScroll"&&Se("scroll",e):u!=null&&Ma(e,l,u,s))}switch(n){case"input":Bi(e),ec(e,r,!1);break;case"textarea":Bi(e),nc(e);break;case"option":r.value!=null&&e.setAttribute("value",""+vn(r.value));break;case"select":e.multiple=!!r.multiple,l=r.value,l!=null?fr(e,!!r.multiple,l,!1):r.defaultValue!=null&&fr(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=Pl)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return He(t),null;case 6:if(e&&t.stateNode!=null)ch(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(O(166));if(n=Dn(ki.current),Dn(Bt.current),Gi(t)){if(r=t.stateNode,n=t.memoizedProps,r[Ft]=t,(l=r.nodeValue!==n)&&(e=ft,e!==null))switch(e.tag){case 3:Ki(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Ki(r.nodeValue,n,(e.mode&1)!==0)}l&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Ft]=t,t.stateNode=r}return He(t),null;case 13:if(je(Ee),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ne&&dt!==null&&t.mode&1&&!(t.flags&128))Tp(),wr(),t.flags|=98560,l=!1;else if(l=Gi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!l)throw Error(O(318));if(l=t.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(O(317));l[Ft]=t}else wr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;He(t),l=!1}else Tt!==null&&(da(Tt),Tt=null),l=!0;if(!l)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Ee.current&1?Re===0&&(Re=3):yu())),t.updateQueue!==null&&(t.flags|=4),He(t),null);case 4:return Sr(),ra(e,t),e===null&&gi(t.stateNode.containerInfo),He(t),null;case 10:return eu(t.type._context),He(t),null;case 17:return lt(t.type)&&Ll(),He(t),null;case 19:if(je(Ee),l=t.memoizedState,l===null)return He(t),null;if(r=(t.flags&128)!==0,s=l.rendering,s===null)if(r)Br(l,!1);else{if(Re!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=Fl(e),s!==null){for(t.flags|=128,Br(l,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)l=n,e=r,l.flags&=14680066,s=l.alternate,s===null?(l.childLanes=0,l.lanes=e,l.child=null,l.subtreeFlags=0,l.memoizedProps=null,l.memoizedState=null,l.updateQueue=null,l.dependencies=null,l.stateNode=null):(l.childLanes=s.childLanes,l.lanes=s.lanes,l.child=s.child,l.subtreeFlags=0,l.deletions=null,l.memoizedProps=s.memoizedProps,l.memoizedState=s.memoizedState,l.updateQueue=s.updateQueue,l.type=s.type,e=s.dependencies,l.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return we(Ee,Ee.current&1|2),t.child}e=e.sibling}l.tail!==null&&Pe()>Cr&&(t.flags|=128,r=!0,Br(l,!1),t.lanes=4194304)}else{if(!r)if(e=Fl(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Br(l,!0),l.tail===null&&l.tailMode==="hidden"&&!s.alternate&&!Ne)return He(t),null}else 2*Pe()-l.renderingStartTime>Cr&&n!==1073741824&&(t.flags|=128,r=!0,Br(l,!1),t.lanes=4194304);l.isBackwards?(s.sibling=t.child,t.child=s):(n=l.last,n!==null?n.sibling=s:t.child=s,l.last=s)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=Pe(),t.sibling=null,n=Ee.current,we(Ee,r?n&1|2:n&1),t):(He(t),null);case 22:case 23:return gu(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ct&1073741824&&(He(t),t.subtreeFlags&6&&(t.flags|=8192)):He(t),null;case 24:return null;case 25:return null}throw Error(O(156,t.tag))}function tx(e,t){switch(Ga(t),t.tag){case 1:return lt(t.type)&&Ll(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Sr(),je(it),je(qe),lu(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return iu(t),null;case 13:if(je(Ee),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(O(340));wr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return je(Ee),null;case 4:return Sr(),null;case 10:return eu(t.type._context),null;case 22:case 23:return gu(),null;case 24:return null;default:return null}}var Ji=!1,Ve=!1,nx=typeof WeakSet=="function"?WeakSet:Set,W=null;function ur(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ie(e,t,r)}else n.current=null}function ia(e,t,n){try{n()}catch(r){Ie(e,t,r)}}var Wc=!1;function rx(e,t){if(Bo=Tl,e=mp(),Ya(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,l=r.focusNode;r=r.focusOffset;try{n.nodeType,l.nodeType}catch{n=null;break e}var s=0,a=-1,u=-1,d=0,c=0,f=e,h=null;t:for(;;){for(var p;f!==n||i!==0&&f.nodeType!==3||(a=s+i),f!==l||r!==0&&f.nodeType!==3||(u=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(p=f.firstChild)!==null;)h=f,f=p;for(;;){if(f===e)break t;if(h===n&&++d===i&&(a=s),h===l&&++c===r&&(u=s),(p=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=p}n=a===-1||u===-1?null:{start:a,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(Uo={focusedElem:e,selectionRange:n},Tl=!1,W=t;W!==null;)if(t=W,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,W=e;else for(;W!==null;){t=W;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var x=g.memoizedProps,C=g.memoizedState,y=t.stateNode,m=y.getSnapshotBeforeUpdate(t.elementType===t.type?x:Nt(t.type,x),C);y.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var v=t.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(O(163))}}catch(N){Ie(t,t.return,N)}if(e=t.sibling,e!==null){e.return=t.return,W=e;break}W=t.return}return g=Wc,Wc=!1,g}function ti(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var l=i.destroy;i.destroy=void 0,l!==void 0&&ia(t,n,l)}i=i.next}while(i!==r)}}function cs(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function la(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function dh(e){var t=e.alternate;t!==null&&(e.alternate=null,dh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ft],delete t[xi],delete t[Wo],delete t[Fy],delete t[$y])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function fh(e){return e.tag===5||e.tag===3||e.tag===4}function qc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||fh(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.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 sa(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Pl));else if(r!==4&&(e=e.child,e!==null))for(sa(e,t,n),e=e.sibling;e!==null;)sa(e,t,n),e=e.sibling}function oa(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(oa(e,t,n),e=e.sibling;e!==null;)oa(e,t,n),e=e.sibling}var Fe=null,Et=!1;function nn(e,t,n){for(n=n.child;n!==null;)ph(e,t,n),n=n.sibling}function ph(e,t,n){if($t&&typeof $t.onCommitFiberUnmount=="function")try{$t.onCommitFiberUnmount(ns,n)}catch{}switch(n.tag){case 5:Ve||ur(n,t);case 6:var r=Fe,i=Et;Fe=null,nn(e,t,n),Fe=r,Et=i,Fe!==null&&(Et?(e=Fe,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Fe.removeChild(n.stateNode));break;case 18:Fe!==null&&(Et?(e=Fe,n=n.stateNode,e.nodeType===8?qs(e.parentNode,n):e.nodeType===1&&qs(e,n),pi(e)):qs(Fe,n.stateNode));break;case 4:r=Fe,i=Et,Fe=n.stateNode.containerInfo,Et=!0,nn(e,t,n),Fe=r,Et=i;break;case 0:case 11:case 14:case 15:if(!Ve&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var l=i,s=l.destroy;l=l.tag,s!==void 0&&(l&2||l&4)&&ia(n,t,s),i=i.next}while(i!==r)}nn(e,t,n);break;case 1:if(!Ve&&(ur(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Ie(n,t,a)}nn(e,t,n);break;case 21:nn(e,t,n);break;case 22:n.mode&1?(Ve=(r=Ve)||n.memoizedState!==null,nn(e,t,n),Ve=r):nn(e,t,n);break;default:nn(e,t,n)}}function Qc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new nx),t.forEach(function(r){var i=fx.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Ct(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var l=e,s=t,a=s;e:for(;a!==null;){switch(a.tag){case 5:Fe=a.stateNode,Et=!1;break e;case 3:Fe=a.stateNode.containerInfo,Et=!0;break e;case 4:Fe=a.stateNode.containerInfo,Et=!0;break e}a=a.return}if(Fe===null)throw Error(O(160));ph(l,s,i),Fe=null,Et=!1;var u=i.alternate;u!==null&&(u.return=null),i.return=null}catch(d){Ie(i,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)hh(t,e),t=t.sibling}function hh(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Ct(t,e),Rt(e),r&4){try{ti(3,e,e.return),cs(3,e)}catch(x){Ie(e,e.return,x)}try{ti(5,e,e.return)}catch(x){Ie(e,e.return,x)}}break;case 1:Ct(t,e),Rt(e),r&512&&n!==null&&ur(n,n.return);break;case 5:if(Ct(t,e),Rt(e),r&512&&n!==null&&ur(n,n.return),e.flags&32){var i=e.stateNode;try{ui(i,"")}catch(x){Ie(e,e.return,x)}}if(r&4&&(i=e.stateNode,i!=null)){var l=e.memoizedProps,s=n!==null?n.memoizedProps:l,a=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{a==="input"&&l.type==="radio"&&l.name!=null&&Rf(i,l),Po(a,s);var d=Po(a,l);for(s=0;s<u.length;s+=2){var c=u[s],f=u[s+1];c==="style"?Bf(i,f):c==="dangerouslySetInnerHTML"?Ff(i,f):c==="children"?ui(i,f):Ma(i,c,f,d)}switch(a){case"input":No(i,l);break;case"textarea":_f(i,l);break;case"select":var h=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!l.multiple;var p=l.value;p!=null?fr(i,!!l.multiple,p,!1):h!==!!l.multiple&&(l.defaultValue!=null?fr(i,!!l.multiple,l.defaultValue,!0):fr(i,!!l.multiple,l.multiple?[]:"",!1))}i[xi]=l}catch(x){Ie(e,e.return,x)}}break;case 6:if(Ct(t,e),Rt(e),r&4){if(e.stateNode===null)throw Error(O(162));i=e.stateNode,l=e.memoizedProps;try{i.nodeValue=l}catch(x){Ie(e,e.return,x)}}break;case 3:if(Ct(t,e),Rt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{pi(t.containerInfo)}catch(x){Ie(e,e.return,x)}break;case 4:Ct(t,e),Rt(e);break;case 13:Ct(t,e),Rt(e),i=e.child,i.flags&8192&&(l=i.memoizedState!==null,i.stateNode.isHidden=l,!l||i.alternate!==null&&i.alternate.memoizedState!==null||(hu=Pe())),r&4&&Qc(e);break;case 22:if(c=n!==null&&n.memoizedState!==null,e.mode&1?(Ve=(d=Ve)||c,Ct(t,e),Ve=d):Ct(t,e),Rt(e),r&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!c&&e.mode&1)for(W=e,c=e.child;c!==null;){for(f=W=c;W!==null;){switch(h=W,p=h.child,h.tag){case 0:case 11:case 14:case 15:ti(4,h,h.return);break;case 1:ur(h,h.return);var g=h.stateNode;if(typeof g.componentWillUnmount=="function"){r=h,n=h.return;try{t=r,g.props=t.memoizedProps,g.state=t.memoizedState,g.componentWillUnmount()}catch(x){Ie(r,n,x)}}break;case 5:ur(h,h.return);break;case 22:if(h.memoizedState!==null){Kc(f);continue}}p!==null?(p.return=h,W=p):Kc(f)}c=c.sibling}e:for(c=null,f=e;;){if(f.tag===5){if(c===null){c=f;try{i=f.stateNode,d?(l=i.style,typeof l.setProperty=="function"?l.setProperty("display","none","important"):l.display="none"):(a=f.stateNode,u=f.memoizedProps.style,s=u!=null&&u.hasOwnProperty("display")?u.display:null,a.style.display=$f("display",s))}catch(x){Ie(e,e.return,x)}}}else if(f.tag===6){if(c===null)try{f.stateNode.nodeValue=d?"":f.memoizedProps}catch(x){Ie(e,e.return,x)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;c===f&&(c=null),f=f.return}c===f&&(c=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Ct(t,e),Rt(e),r&4&&Qc(e);break;case 21:break;default:Ct(t,e),Rt(e)}}function Rt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(fh(n)){var r=n;break e}n=n.return}throw Error(O(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(ui(i,""),r.flags&=-33);var l=qc(e);oa(e,l,i);break;case 3:case 4:var s=r.stateNode.containerInfo,a=qc(e);sa(e,a,s);break;default:throw Error(O(161))}}catch(u){Ie(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ix(e,t,n){W=e,mh(e)}function mh(e,t,n){for(var r=(e.mode&1)!==0;W!==null;){var i=W,l=i.child;if(i.tag===22&&r){var s=i.memoizedState!==null||Ji;if(!s){var a=i.alternate,u=a!==null&&a.memoizedState!==null||Ve;a=Ji;var d=Ve;if(Ji=s,(Ve=u)&&!d)for(W=i;W!==null;)s=W,u=s.child,s.tag===22&&s.memoizedState!==null?Gc(i):u!==null?(u.return=s,W=u):Gc(i);for(;l!==null;)W=l,mh(l),l=l.sibling;W=i,Ji=a,Ve=d}Yc(e)}else i.subtreeFlags&8772&&l!==null?(l.return=i,W=l):Yc(e)}}function Yc(e){for(;W!==null;){var t=W;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Ve||cs(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Ve)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:Nt(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var l=t.updateQueue;l!==null&&Lc(t,l,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Lc(t,s,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&n.focus();break;case"img":u.src&&(n.src=u.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var d=t.alternate;if(d!==null){var c=d.memoizedState;if(c!==null){var f=c.dehydrated;f!==null&&pi(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(O(163))}Ve||t.flags&512&&la(t)}catch(h){Ie(t,t.return,h)}}if(t===e){W=null;break}if(n=t.sibling,n!==null){n.return=t.return,W=n;break}W=t.return}}function Kc(e){for(;W!==null;){var t=W;if(t===e){W=null;break}var n=t.sibling;if(n!==null){n.return=t.return,W=n;break}W=t.return}}function Gc(e){for(;W!==null;){var t=W;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{cs(4,t)}catch(u){Ie(t,n,u)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(u){Ie(t,i,u)}}var l=t.return;try{la(t)}catch(u){Ie(t,l,u)}break;case 5:var s=t.return;try{la(t)}catch(u){Ie(t,s,u)}}}catch(u){Ie(t,t.return,u)}if(t===e){W=null;break}var a=t.sibling;if(a!==null){a.return=t.return,W=a;break}W=t.return}}var lx=Math.ceil,Ul=Jt.ReactCurrentDispatcher,fu=Jt.ReactCurrentOwner,bt=Jt.ReactCurrentBatchConfig,pe=0,Oe=null,De=null,$e=0,ct=0,cr=bn(0),Re=0,ji=null,Un=0,ds=0,pu=0,ni=null,nt=null,hu=0,Cr=1/0,Vt=null,Hl=!1,aa=null,gn=null,el=!1,cn=null,Vl=0,ri=0,ua=null,gl=-1,yl=0;function Ge(){return pe&6?Pe():gl!==-1?gl:gl=Pe()}function yn(e){return e.mode&1?pe&2&&$e!==0?$e&-$e:Uy.transition!==null?(yl===0&&(yl=Jf()),yl):(e=me,e!==0||(e=window.event,e=e===void 0?16:sp(e.type)),e):1}function It(e,t,n,r){if(50<ri)throw ri=0,ua=null,Error(O(185));Ti(e,n,r),(!(pe&2)||e!==Oe)&&(e===Oe&&(!(pe&2)&&(ds|=n),Re===4&&an(e,$e)),st(e,r),n===1&&pe===0&&!(t.mode&1)&&(Cr=Pe()+500,os&&Sn()))}function st(e,t){var n=e.callbackNode;Ug(e,t);var r=El(e,e===Oe?$e:0);if(r===0)n!==null&&lc(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&lc(n),t===1)e.tag===0?By(Xc.bind(null,e)):Cp(Xc.bind(null,e)),_y(function(){!(pe&6)&&Sn()}),n=null;else{switch(ep(r)){case 1:n=$a;break;case 4:n=Xf;break;case 16:n=Nl;break;case 536870912:n=Zf;break;default:n=Nl}n=Sh(n,gh.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function gh(e,t){if(gl=-1,yl=0,pe&6)throw Error(O(327));var n=e.callbackNode;if(yr()&&e.callbackNode!==n)return null;var r=El(e,e===Oe?$e:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Wl(e,r);else{t=r;var i=pe;pe|=2;var l=xh();(Oe!==e||$e!==t)&&(Vt=null,Cr=Pe()+500,Rn(e,t));do try{ax();break}catch(a){yh(e,a)}while(!0);Ja(),Ul.current=l,pe=i,De!==null?t=0:(Oe=null,$e=0,t=Re)}if(t!==0){if(t===2&&(i=Ro(e),i!==0&&(r=i,t=ca(e,i))),t===1)throw n=ji,Rn(e,0),an(e,r),st(e,Pe()),n;if(t===6)an(e,r);else{if(i=e.current.alternate,!(r&30)&&!sx(i)&&(t=Wl(e,r),t===2&&(l=Ro(e),l!==0&&(r=l,t=ca(e,l))),t===1))throw n=ji,Rn(e,0),an(e,r),st(e,Pe()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(O(345));case 2:zn(e,nt,Vt);break;case 3:if(an(e,r),(r&130023424)===r&&(t=hu+500-Pe(),10<t)){if(El(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){Ge(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Vo(zn.bind(null,e,nt,Vt),t);break}zn(e,nt,Vt);break;case 4:if(an(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var s=31-zt(r);l=1<<s,s=t[s],s>i&&(i=s),r&=~l}if(r=i,r=Pe()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*lx(r/1960))-r,10<r){e.timeoutHandle=Vo(zn.bind(null,e,nt,Vt),r);break}zn(e,nt,Vt);break;case 5:zn(e,nt,Vt);break;default:throw Error(O(329))}}}return st(e,Pe()),e.callbackNode===n?gh.bind(null,e):null}function ca(e,t){var n=ni;return e.current.memoizedState.isDehydrated&&(Rn(e,t).flags|=256),e=Wl(e,t),e!==2&&(t=nt,nt=n,t!==null&&da(t)),e}function da(e){nt===null?nt=e:nt.push.apply(nt,e)}function sx(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],l=i.getSnapshot;i=i.value;try{if(!Lt(l(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function an(e,t){for(t&=~pu,t&=~ds,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-zt(t),r=1<<n;e[n]=-1,t&=~r}}function Xc(e){if(pe&6)throw Error(O(327));yr();var t=El(e,0);if(!(t&1))return st(e,Pe()),null;var n=Wl(e,t);if(e.tag!==0&&n===2){var r=Ro(e);r!==0&&(t=r,n=ca(e,r))}if(n===1)throw n=ji,Rn(e,0),an(e,t),st(e,Pe()),n;if(n===6)throw Error(O(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,zn(e,nt,Vt),st(e,Pe()),null}function mu(e,t){var n=pe;pe|=1;try{return e(t)}finally{pe=n,pe===0&&(Cr=Pe()+500,os&&Sn())}}function Hn(e){cn!==null&&cn.tag===0&&!(pe&6)&&yr();var t=pe;pe|=1;var n=bt.transition,r=me;try{if(bt.transition=null,me=1,e)return e()}finally{me=r,bt.transition=n,pe=t,!(pe&6)&&Sn()}}function gu(){ct=cr.current,je(cr)}function Rn(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Ry(n)),De!==null)for(n=De.return;n!==null;){var r=n;switch(Ga(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Ll();break;case 3:Sr(),je(it),je(qe),lu();break;case 5:iu(r);break;case 4:Sr();break;case 13:je(Ee);break;case 19:je(Ee);break;case 10:eu(r.type._context);break;case 22:case 23:gu()}n=n.return}if(Oe=e,De=e=xn(e.current,null),$e=ct=t,Re=0,ji=null,pu=ds=Un=0,nt=ni=null,An!==null){for(t=0;t<An.length;t++)if(n=An[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,l=n.pending;if(l!==null){var s=l.next;l.next=i,r.next=s}n.pending=r}An=null}return e}function yh(e,t){do{var n=De;try{if(Ja(),pl.current=Bl,$l){for(var r=Te.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}$l=!1}if(Bn=0,_e=Me=Te=null,ei=!1,wi=0,fu.current=null,n===null||n.return===null){Re=1,ji=t,De=null;break}e:{var l=e,s=n.return,a=n,u=t;if(t=$e,a.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var d=u,c=a,f=c.tag;if(!(c.mode&1)&&(f===0||f===11||f===15)){var h=c.alternate;h?(c.updateQueue=h.updateQueue,c.memoizedState=h.memoizedState,c.lanes=h.lanes):(c.updateQueue=null,c.memoizedState=null)}var p=Oc(s);if(p!==null){p.flags&=-257,Fc(p,s,a,l,t),p.mode&1&&_c(l,d,t),t=p,u=d;var g=t.updateQueue;if(g===null){var x=new Set;x.add(u),t.updateQueue=x}else g.add(u);break e}else{if(!(t&1)){_c(l,d,t),yu();break e}u=Error(O(426))}}else if(Ne&&a.mode&1){var C=Oc(s);if(C!==null){!(C.flags&65536)&&(C.flags|=256),Fc(C,s,a,l,t),Xa(jr(u,a));break e}}l=u=jr(u,a),Re!==4&&(Re=2),ni===null?ni=[l]:ni.push(l),l=s;do{switch(l.tag){case 3:l.flags|=65536,t&=-t,l.lanes|=t;var y=eh(l,u,t);Pc(l,y);break e;case 1:a=u;var m=l.type,v=l.stateNode;if(!(l.flags&128)&&(typeof m.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(gn===null||!gn.has(v)))){l.flags|=65536,t&=-t,l.lanes|=t;var N=th(l,a,t);Pc(l,N);break e}}l=l.return}while(l!==null)}kh(n)}catch(P){t=P,De===n&&n!==null&&(De=n=n.return);continue}break}while(!0)}function xh(){var e=Ul.current;return Ul.current=Bl,e===null?Bl:e}function yu(){(Re===0||Re===3||Re===2)&&(Re=4),Oe===null||!(Un&268435455)&&!(ds&268435455)||an(Oe,$e)}function Wl(e,t){var n=pe;pe|=2;var r=xh();(Oe!==e||$e!==t)&&(Vt=null,Rn(e,t));do try{ox();break}catch(i){yh(e,i)}while(!0);if(Ja(),pe=n,Ul.current=r,De!==null)throw Error(O(261));return Oe=null,$e=0,Re}function ox(){for(;De!==null;)vh(De)}function ax(){for(;De!==null&&!Ag();)vh(De)}function vh(e){var t=bh(e.alternate,e,ct);e.memoizedProps=e.pendingProps,t===null?kh(e):De=t,fu.current=null}function kh(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=tx(n,t),n!==null){n.flags&=32767,De=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Re=6,De=null;return}}else if(n=ex(n,t,ct),n!==null){De=n;return}if(t=t.sibling,t!==null){De=t;return}De=t=e}while(t!==null);Re===0&&(Re=5)}function zn(e,t,n){var r=me,i=bt.transition;try{bt.transition=null,me=1,ux(e,t,n,r)}finally{bt.transition=i,me=r}return null}function ux(e,t,n,r){do yr();while(cn!==null);if(pe&6)throw Error(O(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(O(177));e.callbackNode=null,e.callbackPriority=0;var l=n.lanes|n.childLanes;if(Hg(e,l),e===Oe&&(De=Oe=null,$e=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||el||(el=!0,Sh(Nl,function(){return yr(),null})),l=(n.flags&15990)!==0,n.subtreeFlags&15990||l){l=bt.transition,bt.transition=null;var s=me;me=1;var a=pe;pe|=4,fu.current=null,rx(e,n),hh(n,e),zy(Uo),Tl=!!Bo,Uo=Bo=null,e.current=n,ix(n),Dg(),pe=a,me=s,bt.transition=l}else e.current=n;if(el&&(el=!1,cn=e,Vl=i),l=e.pendingLanes,l===0&&(gn=null),_g(n.stateNode),st(e,Pe()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(Hl)throw Hl=!1,e=aa,aa=null,e;return Vl&1&&e.tag!==0&&yr(),l=e.pendingLanes,l&1?e===ua?ri++:(ri=0,ua=e):ri=0,Sn(),null}function yr(){if(cn!==null){var e=ep(Vl),t=bt.transition,n=me;try{if(bt.transition=null,me=16>e?16:e,cn===null)var r=!1;else{if(e=cn,cn=null,Vl=0,pe&6)throw Error(O(331));var i=pe;for(pe|=4,W=e.current;W!==null;){var l=W,s=l.child;if(W.flags&16){var a=l.deletions;if(a!==null){for(var u=0;u<a.length;u++){var d=a[u];for(W=d;W!==null;){var c=W;switch(c.tag){case 0:case 11:case 15:ti(8,c,l)}var f=c.child;if(f!==null)f.return=c,W=f;else for(;W!==null;){c=W;var h=c.sibling,p=c.return;if(dh(c),c===d){W=null;break}if(h!==null){h.return=p,W=h;break}W=p}}}var g=l.alternate;if(g!==null){var x=g.child;if(x!==null){g.child=null;do{var C=x.sibling;x.sibling=null,x=C}while(x!==null)}}W=l}}if(l.subtreeFlags&2064&&s!==null)s.return=l,W=s;else e:for(;W!==null;){if(l=W,l.flags&2048)switch(l.tag){case 0:case 11:case 15:ti(9,l,l.return)}var y=l.sibling;if(y!==null){y.return=l.return,W=y;break e}W=l.return}}var m=e.current;for(W=m;W!==null;){s=W;var v=s.child;if(s.subtreeFlags&2064&&v!==null)v.return=s,W=v;else e:for(s=m;W!==null;){if(a=W,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:cs(9,a)}}catch(P){Ie(a,a.return,P)}if(a===s){W=null;break e}var N=a.sibling;if(N!==null){N.return=a.return,W=N;break e}W=a.return}}if(pe=i,Sn(),$t&&typeof $t.onPostCommitFiberRoot=="function")try{$t.onPostCommitFiberRoot(ns,e)}catch{}r=!0}return r}finally{me=n,bt.transition=t}}return!1}function Zc(e,t,n){t=jr(n,t),t=eh(e,t,1),e=mn(e,t,1),t=Ge(),e!==null&&(Ti(e,1,t),st(e,t))}function Ie(e,t,n){if(e.tag===3)Zc(e,e,n);else for(;t!==null;){if(t.tag===3){Zc(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(gn===null||!gn.has(r))){e=jr(n,e),e=th(t,e,1),t=mn(t,e,1),e=Ge(),t!==null&&(Ti(t,1,e),st(t,e));break}}t=t.return}}function cx(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Ge(),e.pingedLanes|=e.suspendedLanes&n,Oe===e&&($e&n)===n&&(Re===4||Re===3&&($e&130023424)===$e&&500>Pe()-hu?Rn(e,0):pu|=n),st(e,t)}function wh(e,t){t===0&&(e.mode&1?(t=Vi,Vi<<=1,!(Vi&130023424)&&(Vi=4194304)):t=1);var n=Ge();e=Xt(e,t),e!==null&&(Ti(e,t,n),st(e,n))}function dx(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),wh(e,n)}function fx(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(O(314))}r!==null&&r.delete(t),wh(e,n)}var bh;bh=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||it.current)rt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return rt=!1,Jy(e,t,n);rt=!!(e.flags&131072)}else rt=!1,Ne&&t.flags&1048576&&Np(t,Ml,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;ml(e,t),e=t.pendingProps;var i=kr(t,qe.current);gr(t,n),i=ou(null,t,r,e,i,n);var l=au();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,lt(r)?(l=!0,Al(t)):l=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,nu(t),i.updater=us,t.stateNode=i,i._reactInternals=t,Xo(t,r,e,n),t=ea(null,t,r,!0,l,n)):(t.tag=0,Ne&&l&&Ka(t),Ye(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(ml(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=hx(r),e=Nt(r,e),i){case 0:t=Jo(null,t,r,e,n);break e;case 1:t=Uc(null,t,r,e,n);break e;case 11:t=$c(null,t,r,e,n);break e;case 14:t=Bc(null,t,r,Nt(r.type,e),n);break e}throw Error(O(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Nt(r,i),Jo(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Nt(r,i),Uc(e,t,r,i,n);case 3:e:{if(lh(t),e===null)throw Error(O(387));r=t.pendingProps,l=t.memoizedState,i=l.element,Lp(e,t),Ol(t,r,null,n);var s=t.memoizedState;if(r=s.element,l.isDehydrated)if(l={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=l,t.memoizedState=l,t.flags&256){i=jr(Error(O(423)),t),t=Hc(e,t,r,n,i);break e}else if(r!==i){i=jr(Error(O(424)),t),t=Hc(e,t,r,n,i);break e}else for(dt=hn(t.stateNode.containerInfo.firstChild),ft=t,Ne=!0,Tt=null,n=Ip(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(wr(),r===i){t=Zt(e,t,n);break e}Ye(e,t,r,n)}t=t.child}return t;case 5:return Ap(t),e===null&&Yo(t),r=t.type,i=t.pendingProps,l=e!==null?e.memoizedProps:null,s=i.children,Ho(r,i)?s=null:l!==null&&Ho(r,l)&&(t.flags|=32),ih(e,t),Ye(e,t,s,n),t.child;case 6:return e===null&&Yo(t),null;case 13:return sh(e,t,n);case 4:return ru(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=br(t,null,r,n):Ye(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Nt(r,i),$c(e,t,r,i,n);case 7:return Ye(e,t,t.pendingProps,n),t.child;case 8:return Ye(e,t,t.pendingProps.children,n),t.child;case 12:return Ye(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,l=t.memoizedProps,s=i.value,we(Rl,r._currentValue),r._currentValue=s,l!==null)if(Lt(l.value,s)){if(l.children===i.children&&!it.current){t=Zt(e,t,n);break e}}else for(l=t.child,l!==null&&(l.return=t);l!==null;){var a=l.dependencies;if(a!==null){s=l.child;for(var u=a.firstContext;u!==null;){if(u.context===r){if(l.tag===1){u=Yt(-1,n&-n),u.tag=2;var d=l.updateQueue;if(d!==null){d=d.shared;var c=d.pending;c===null?u.next=u:(u.next=c.next,c.next=u),d.pending=u}}l.lanes|=n,u=l.alternate,u!==null&&(u.lanes|=n),Ko(l.return,n,t),a.lanes|=n;break}u=u.next}}else if(l.tag===10)s=l.type===t.type?null:l.child;else if(l.tag===18){if(s=l.return,s===null)throw Error(O(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Ko(s,n,t),s=l.sibling}else s=l.child;if(s!==null)s.return=l;else for(s=l;s!==null;){if(s===t){s=null;break}if(l=s.sibling,l!==null){l.return=s.return,s=l;break}s=s.return}l=s}Ye(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,gr(t,n),i=St(i),r=r(i),t.flags|=1,Ye(e,t,r,n),t.child;case 14:return r=t.type,i=Nt(r,t.pendingProps),i=Nt(r.type,i),Bc(e,t,r,i,n);case 15:return nh(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Nt(r,i),ml(e,t),t.tag=1,lt(r)?(e=!0,Al(t)):e=!1,gr(t,n),Jp(t,r,i),Xo(t,r,i,n),ea(null,t,r,!0,e,n);case 19:return oh(e,t,n);case 22:return rh(e,t,n)}throw Error(O(156,t.tag))};function Sh(e,t){return Gf(e,t)}function px(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function wt(e,t,n,r){return new px(e,t,n,r)}function xu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function hx(e){if(typeof e=="function")return xu(e)?1:0;if(e!=null){if(e=e.$$typeof,e===_a)return 11;if(e===Oa)return 14}return 2}function xn(e,t){var n=e.alternate;return n===null?(n=wt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function xl(e,t,n,r,i,l){var s=2;if(r=e,typeof e=="function")xu(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case er:return _n(n.children,i,l,t);case Ra:s=8,i|=8;break;case wo:return e=wt(12,n,t,i|2),e.elementType=wo,e.lanes=l,e;case bo:return e=wt(13,n,t,i),e.elementType=bo,e.lanes=l,e;case So:return e=wt(19,n,t,i),e.elementType=So,e.lanes=l,e;case Af:return fs(n,i,l,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Pf:s=10;break e;case Lf:s=9;break e;case _a:s=11;break e;case Oa:s=14;break e;case ln:s=16,r=null;break e}throw Error(O(130,e==null?e:typeof e,""))}return t=wt(s,n,t,i),t.elementType=e,t.type=r,t.lanes=l,t}function _n(e,t,n,r){return e=wt(7,e,r,t),e.lanes=n,e}function fs(e,t,n,r){return e=wt(22,e,r,t),e.elementType=Af,e.lanes=n,e.stateNode={isHidden:!1},e}function eo(e,t,n){return e=wt(6,e,null,t),e.lanes=n,e}function to(e,t,n){return t=wt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function mx(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ms(0),this.expirationTimes=Ms(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ms(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function vu(e,t,n,r,i,l,s,a,u){return e=new mx(e,t,n,a,u),t===1?(t=1,l===!0&&(t|=8)):t=0,l=wt(3,null,null,t),e.current=l,l.stateNode=e,l.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},nu(l),e}function gx(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Jn,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function jh(e){if(!e)return kn;e=e._reactInternals;e:{if(Qn(e)!==e||e.tag!==1)throw Error(O(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(lt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(O(171))}if(e.tag===1){var n=e.type;if(lt(n))return jp(e,n,t)}return t}function Ch(e,t,n,r,i,l,s,a,u){return e=vu(n,r,!0,e,i,l,s,a,u),e.context=jh(null),n=e.current,r=Ge(),i=yn(n),l=Yt(r,i),l.callback=t??null,mn(n,l,i),e.current.lanes=i,Ti(e,i,r),st(e,r),e}function ps(e,t,n,r){var i=t.current,l=Ge(),s=yn(i);return n=jh(n),t.context===null?t.context=n:t.pendingContext=n,t=Yt(l,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=mn(i,t,s),e!==null&&(It(e,i,s,l),fl(e,i,s)),s}function ql(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Jc(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ku(e,t){Jc(e,t),(e=e.alternate)&&Jc(e,t)}function yx(){return null}var Nh=typeof reportError=="function"?reportError:function(e){console.error(e)};function wu(e){this._internalRoot=e}hs.prototype.render=wu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(O(409));ps(e,t,null,null)};hs.prototype.unmount=wu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Hn(function(){ps(null,e,null,null)}),t[Gt]=null}};function hs(e){this._internalRoot=e}hs.prototype.unstable_scheduleHydration=function(e){if(e){var t=rp();e={blockedOn:null,target:e,priority:t};for(var n=0;n<on.length&&t!==0&&t<on[n].priority;n++);on.splice(n,0,e),n===0&&lp(e)}};function bu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ms(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function ed(){}function xx(e,t,n,r,i){if(i){if(typeof r=="function"){var l=r;r=function(){var d=ql(s);l.call(d)}}var s=Ch(t,r,e,0,null,!1,!1,"",ed);return e._reactRootContainer=s,e[Gt]=s.current,gi(e.nodeType===8?e.parentNode:e),Hn(),s}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var d=ql(u);a.call(d)}}var u=vu(e,0,!1,null,null,!1,!1,"",ed);return e._reactRootContainer=u,e[Gt]=u.current,gi(e.nodeType===8?e.parentNode:e),Hn(function(){ps(t,u,n,r)}),u}function gs(e,t,n,r,i){var l=n._reactRootContainer;if(l){var s=l;if(typeof i=="function"){var a=i;i=function(){var u=ql(s);a.call(u)}}ps(t,s,e,i)}else s=xx(n,t,e,i,r);return ql(s)}tp=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Qr(t.pendingLanes);n!==0&&(Ba(t,n|1),st(t,Pe()),!(pe&6)&&(Cr=Pe()+500,Sn()))}break;case 13:Hn(function(){var r=Xt(e,1);if(r!==null){var i=Ge();It(r,e,1,i)}}),ku(e,1)}};Ua=function(e){if(e.tag===13){var t=Xt(e,134217728);if(t!==null){var n=Ge();It(t,e,134217728,n)}ku(e,134217728)}};np=function(e){if(e.tag===13){var t=yn(e),n=Xt(e,t);if(n!==null){var r=Ge();It(n,e,t,r)}ku(e,t)}};rp=function(){return me};ip=function(e,t){var n=me;try{return me=e,t()}finally{me=n}};Ao=function(e,t,n){switch(t){case"input":if(No(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=ss(r);if(!i)throw Error(O(90));Mf(r),No(r,i)}}}break;case"textarea":_f(e,n);break;case"select":t=n.value,t!=null&&fr(e,!!n.multiple,t,!1)}};Vf=mu;Wf=Hn;var vx={usingClientEntryPoint:!1,Events:[Ii,ir,ss,Uf,Hf,mu]},Ur={findFiberByHostInstance:Ln,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},kx={bundleType:Ur.bundleType,version:Ur.version,rendererPackageName:Ur.rendererPackageName,rendererConfig:Ur.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Jt.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Yf(e),e===null?null:e.stateNode},findFiberByHostInstance:Ur.findFiberByHostInstance||yx,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var tl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!tl.isDisabled&&tl.supportsFiber)try{ns=tl.inject(kx),$t=tl}catch{}}gt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=vx;gt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!bu(t))throw Error(O(200));return gx(e,t,null,n)};gt.createRoot=function(e,t){if(!bu(e))throw Error(O(299));var n=!1,r="",i=Nh;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=vu(e,1,!1,null,null,n,!1,r,i),e[Gt]=t.current,gi(e.nodeType===8?e.parentNode:e),new wu(t)};gt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(O(188)):(e=Object.keys(e).join(","),Error(O(268,e)));return e=Yf(t),e=e===null?null:e.stateNode,e};gt.flushSync=function(e){return Hn(e)};gt.hydrate=function(e,t,n){if(!ms(t))throw Error(O(200));return gs(null,e,t,!0,n)};gt.hydrateRoot=function(e,t,n){if(!bu(e))throw Error(O(405));var r=n!=null&&n.hydratedSources||null,i=!1,l="",s=Nh;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=Ch(t,null,e,1,n??null,i,!1,l,s),e[Gt]=t.current,gi(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new hs(t)};gt.render=function(e,t,n){if(!ms(t))throw Error(O(200));return gs(null,e,t,!1,n)};gt.unmountComponentAtNode=function(e){if(!ms(e))throw Error(O(40));return e._reactRootContainer?(Hn(function(){gs(null,null,e,!1,function(){e._reactRootContainer=null,e[Gt]=null})}),!0):!1};gt.unstable_batchedUpdates=mu;gt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!ms(n))throw Error(O(200));if(e==null||e._reactInternals===void 0)throw Error(O(38));return gs(e,t,n,!1,r)};gt.version="18.3.1-next-f1338f8080-20240426";function Eh(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Eh)}catch(e){console.error(e)}}Eh(),Ef.exports=gt;var Th=Ef.exports,wx,td=Th;wx=td.createRoot,td.hydrateRoot;/**
41
- * @license lucide-react v0.460.0 - ISC
42
- *
43
- * This source code is licensed under the ISC license.
44
- * See the LICENSE file in the root directory of this source tree.
45
- */const bx=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),zh=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
46
- * @license lucide-react v0.460.0 - ISC
47
- *
48
- * This source code is licensed under the ISC license.
49
- * See the LICENSE file in the root directory of this source tree.
50
- */var Sx={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"};/**
51
- * @license lucide-react v0.460.0 - ISC
52
- *
53
- * This source code is licensed under the ISC license.
54
- * See the LICENSE file in the root directory of this source tree.
55
- */const jx=k.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:l,iconNode:s,...a},u)=>k.createElement("svg",{ref:u,...Sx,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:zh("lucide",i),...a},[...s.map(([d,c])=>k.createElement(d,c)),...Array.isArray(l)?l:[l]]));/**
56
- * @license lucide-react v0.460.0 - ISC
57
- *
58
- * This source code is licensed under the ISC license.
59
- * See the LICENSE file in the root directory of this source tree.
60
- */const J=(e,t)=>{const n=k.forwardRef(({className:r,...i},l)=>k.createElement(jx,{ref:l,iconNode:t,className:zh(`lucide-${bx(e)}`,r),...i}));return n.displayName=`${e}`,n};/**
61
- * @license lucide-react v0.460.0 - ISC
62
- *
63
- * This source code is licensed under the ISC license.
64
- * See the LICENSE file in the root directory of this source tree.
65
- */const fa=J("Activity",[["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"}]]);/**
66
- * @license lucide-react v0.460.0 - ISC
67
- *
68
- * This source code is licensed under the ISC license.
69
- * See the LICENSE file in the root directory of this source tree.
70
- */const Cx=J("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);/**
71
- * @license lucide-react v0.460.0 - ISC
72
- *
73
- * This source code is licensed under the ISC license.
74
- * See the LICENSE file in the root directory of this source tree.
75
- */const nd=J("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/**
76
- * @license lucide-react v0.460.0 - ISC
77
- *
78
- * This source code is licensed under the ISC license.
79
- * See the LICENSE file in the root directory of this source tree.
80
- */const Nx=J("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/**
81
- * @license lucide-react v0.460.0 - ISC
82
- *
83
- * This source code is licensed under the ISC license.
84
- * See the LICENSE file in the root directory of this source tree.
85
- */const Pr=J("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
86
- * @license lucide-react v0.460.0 - ISC
87
- *
88
- * This source code is licensed under the ISC license.
89
- * See the LICENSE file in the root directory of this source tree.
90
- */const Ex=J("CheckCheck",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]);/**
91
- * @license lucide-react v0.460.0 - ISC
92
- *
93
- * This source code is licensed under the ISC license.
94
- * See the LICENSE file in the root directory of this source tree.
95
- */const ys=J("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
96
- * @license lucide-react v0.460.0 - ISC
97
- *
98
- * This source code is licensed under the ISC license.
99
- * See the LICENSE file in the root directory of this source tree.
100
- */const rd=J("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
101
- * @license lucide-react v0.460.0 - ISC
102
- *
103
- * This source code is licensed under the ISC license.
104
- * See the LICENSE file in the root directory of this source tree.
105
- */const Tx=J("CircleAlert",[["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"}]]);/**
106
- * @license lucide-react v0.460.0 - ISC
107
- *
108
- * This source code is licensed under the ISC license.
109
- * See the LICENSE file in the root directory of this source tree.
110
- */const zx=J("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
111
- * @license lucide-react v0.460.0 - ISC
112
- *
113
- * This source code is licensed under the ISC license.
114
- * See the LICENSE file in the root directory of this source tree.
115
- */const Ix=J("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
116
- * @license lucide-react v0.460.0 - ISC
117
- *
118
- * This source code is licensed under the ISC license.
119
- * See the LICENSE file in the root directory of this source tree.
120
- */const pa=J("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
121
- * @license lucide-react v0.460.0 - ISC
122
- *
123
- * This source code is licensed under the ISC license.
124
- * See the LICENSE file in the root directory of this source tree.
125
- */const Px=J("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
126
- * @license lucide-react v0.460.0 - ISC
127
- *
128
- * This source code is licensed under the ISC license.
129
- * See the LICENSE file in the root directory of this source tree.
130
- */const Lx=J("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
131
- * @license lucide-react v0.460.0 - ISC
132
- *
133
- * This source code is licensed under the ISC license.
134
- * See the LICENSE file in the root directory of this source tree.
135
- */const Ax=J("ExternalLink",[["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"}]]);/**
136
- * @license lucide-react v0.460.0 - ISC
137
- *
138
- * This source code is licensed under the ISC license.
139
- * See the LICENSE file in the root directory of this source tree.
140
- */const Vn=J("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
141
- * @license lucide-react v0.460.0 - ISC
142
- *
143
- * This source code is licensed under the ISC license.
144
- * See the LICENSE file in the root directory of this source tree.
145
- */const Su=J("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
146
- * @license lucide-react v0.460.0 - ISC
147
- *
148
- * This source code is licensed under the ISC license.
149
- * See the LICENSE file in the root directory of this source tree.
150
- */const Dx=J("Grid3x3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
151
- * @license lucide-react v0.460.0 - ISC
152
- *
153
- * This source code is licensed under the ISC license.
154
- * See the LICENSE file in the root directory of this source tree.
155
- */const ha=J("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/**
156
- * @license lucide-react v0.460.0 - ISC
157
- *
158
- * This source code is licensed under the ISC license.
159
- * See the LICENSE file in the root directory of this source tree.
160
- */const Mx=J("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
161
- * @license lucide-react v0.460.0 - ISC
162
- *
163
- * This source code is licensed under the ISC license.
164
- * See the LICENSE file in the root directory of this source tree.
165
- */const Rx=J("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
166
- * @license lucide-react v0.460.0 - ISC
167
- *
168
- * This source code is licensed under the ISC license.
169
- * See the LICENSE file in the root directory of this source tree.
170
- */const _x=J("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/**
171
- * @license lucide-react v0.460.0 - ISC
172
- *
173
- * This source code is licensed under the ISC license.
174
- * See the LICENSE file in the root directory of this source tree.
175
- */const Mn=J("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
176
- * @license lucide-react v0.460.0 - ISC
177
- *
178
- * This source code is licensed under the ISC license.
179
- * See the LICENSE file in the root directory of this source tree.
180
- */const Ox=J("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
181
- * @license lucide-react v0.460.0 - ISC
182
- *
183
- * This source code is licensed under the ISC license.
184
- * See the LICENSE file in the root directory of this source tree.
185
- */const Fx=J("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
186
- * @license lucide-react v0.460.0 - ISC
187
- *
188
- * This source code is licensed under the ISC license.
189
- * See the LICENSE file in the root directory of this source tree.
190
- */const id=J("Paperclip",[["path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48",key:"1u3ebp"}]]);/**
191
- * @license lucide-react v0.460.0 - ISC
192
- *
193
- * This source code is licensed under the ISC license.
194
- * See the LICENSE file in the root directory of this source tree.
195
- */const $x=J("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/**
196
- * @license lucide-react v0.460.0 - ISC
197
- *
198
- * This source code is licensed under the ISC license.
199
- * See the LICENSE file in the root directory of this source tree.
200
- */const ju=J("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
201
- * @license lucide-react v0.460.0 - ISC
202
- *
203
- * This source code is licensed under the ISC license.
204
- * See the LICENSE file in the root directory of this source tree.
205
- */const Bx=J("Pin",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]);/**
206
- * @license lucide-react v0.460.0 - ISC
207
- *
208
- * This source code is licensed under the ISC license.
209
- * See the LICENSE file in the root directory of this source tree.
210
- */const Ql=J("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
211
- * @license lucide-react v0.460.0 - ISC
212
- *
213
- * This source code is licensed under the ISC license.
214
- * See the LICENSE file in the root directory of this source tree.
215
- */const mt=J("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
216
- * @license lucide-react v0.460.0 - ISC
217
- *
218
- * This source code is licensed under the ISC license.
219
- * See the LICENSE file in the root directory of this source tree.
220
- */const Ih=J("Power",[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]);/**
221
- * @license lucide-react v0.460.0 - ISC
222
- *
223
- * This source code is licensed under the ISC license.
224
- * See the LICENSE file in the root directory of this source tree.
225
- */const Dt=J("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
226
- * @license lucide-react v0.460.0 - ISC
227
- *
228
- * This source code is licensed under the ISC license.
229
- * See the LICENSE file in the root directory of this source tree.
230
- */const Ux=J("RotateCcw",[["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"}]]);/**
231
- * @license lucide-react v0.460.0 - ISC
232
- *
233
- * This source code is licensed under the ISC license.
234
- * See the LICENSE file in the root directory of this source tree.
235
- */const Hx=J("RotateCw",[["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"}]]);/**
236
- * @license lucide-react v0.460.0 - ISC
237
- *
238
- * This source code is licensed under the ISC license.
239
- * See the LICENSE file in the root directory of this source tree.
240
- */const Ph=J("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
241
- * @license lucide-react v0.460.0 - ISC
242
- *
243
- * This source code is licensed under the ISC license.
244
- * See the LICENSE file in the root directory of this source tree.
245
- */const ld=J("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
246
- * @license lucide-react v0.460.0 - ISC
247
- *
248
- * This source code is licensed under the ISC license.
249
- * See the LICENSE file in the root directory of this source tree.
250
- */const Lh=J("Send",[["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"}]]);/**
251
- * @license lucide-react v0.460.0 - ISC
252
- *
253
- * This source code is licensed under the ISC license.
254
- * See the LICENSE file in the root directory of this source tree.
255
- */const Vx=J("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/**
256
- * @license lucide-react v0.460.0 - ISC
257
- *
258
- * This source code is licensed under the ISC license.
259
- * See the LICENSE file in the root directory of this source tree.
260
- */const Ah=J("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
261
- * @license lucide-react v0.460.0 - ISC
262
- *
263
- * This source code is licensed under the ISC license.
264
- * See the LICENSE file in the root directory of this source tree.
265
- */const Nr=J("SlidersVertical",[["line",{x1:"4",x2:"4",y1:"21",y2:"14",key:"1p332r"}],["line",{x1:"4",x2:"4",y1:"10",y2:"3",key:"gb41h5"}],["line",{x1:"12",x2:"12",y1:"21",y2:"12",key:"hf2csr"}],["line",{x1:"12",x2:"12",y1:"8",y2:"3",key:"1kfi7u"}],["line",{x1:"20",x2:"20",y1:"21",y2:"16",key:"1lhrwl"}],["line",{x1:"20",x2:"20",y1:"12",y2:"3",key:"16vvfq"}],["line",{x1:"2",x2:"6",y1:"14",y2:"14",key:"1uebub"}],["line",{x1:"10",x2:"14",y1:"8",y2:"8",key:"1yglbp"}],["line",{x1:"18",x2:"22",y1:"16",y2:"16",key:"1jxqpz"}]]);/**
266
- * @license lucide-react v0.460.0 - ISC
267
- *
268
- * This source code is licensed under the ISC license.
269
- * See the LICENSE file in the root directory of this source tree.
270
- */const sd=J("Smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);/**
271
- * @license lucide-react v0.460.0 - ISC
272
- *
273
- * This source code is licensed under the ISC license.
274
- * See the LICENSE file in the root directory of this source tree.
275
- */const Yl=J("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
276
- * @license lucide-react v0.460.0 - ISC
277
- *
278
- * This source code is licensed under the ISC license.
279
- * See the LICENSE file in the root directory of this source tree.
280
- */const Kl=J("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
281
- * @license lucide-react v0.460.0 - ISC
282
- *
283
- * This source code is licensed under the ISC license.
284
- * See the LICENSE file in the root directory of this source tree.
285
- */const od=J("StickyNote",[["path",{d:"M16 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8Z",key:"qazsjp"}],["path",{d:"M15 3v4a2 2 0 0 0 2 2h4",key:"40519r"}]]);/**
286
- * @license lucide-react v0.460.0 - ISC
287
- *
288
- * This source code is licensed under the ISC license.
289
- * See the LICENSE file in the root directory of this source tree.
290
- */const Wx=J("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
291
- * @license lucide-react v0.460.0 - ISC
292
- *
293
- * This source code is licensed under the ISC license.
294
- * See the LICENSE file in the root directory of this source tree.
295
- */const qx=J("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
296
- * @license lucide-react v0.460.0 - ISC
297
- *
298
- * This source code is licensed under the ISC license.
299
- * See the LICENSE file in the root directory of this source tree.
300
- */const Lr=J("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
301
- * @license lucide-react v0.460.0 - ISC
302
- *
303
- * This source code is licensed under the ISC license.
304
- * See the LICENSE file in the root directory of this source tree.
305
- */const Qx=J("TriangleAlert",[["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"}]]);/**
306
- * @license lucide-react v0.460.0 - ISC
307
- *
308
- * This source code is licensed under the ISC license.
309
- * See the LICENSE file in the root directory of this source tree.
310
- */const Yn=J("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Cu(...e){return e.filter(Boolean).join(" ")}function xr(e){if(!e&&e!==0)return"";const t=typeof e=="number"?e:new Date(e).getTime();if(Number.isNaN(t))return"";const n=Date.now()-t;return n<0||n<6e4?"just now":n<36e5?`${Math.floor(n/6e4)}m ago`:n<864e5?`${Math.floor(n/36e5)}h ago`:n<7*864e5?`${Math.floor(n/864e5)}d ago`:new Date(t).toLocaleDateString()}function Yx(e){if(!e)return"";const t=typeof e=="number"?new Date(e):new Date(e);return Number.isNaN(t.getTime())?"":t.toLocaleString()}function fC(e,t=160){return e?e.length>t?e.slice(0,t)+"…":e:""}const Kx={low:"var(--text-dim)",normal:"var(--info)",high:"var(--error)"},vl="bizar-auth-token",ad="bizar-loopback-trusted";class ma extends Error{constructor(n,r,i){super(n);et(this,"status");et(this,"data");this.name="ApiError",this.status=r,this.data=i}}class Gx{constructor(){et(this,"base","/api")}getToken(){try{return localStorage.getItem(vl)||""}catch{return""}}setToken(t){try{t?localStorage.setItem(vl,t):localStorage.removeItem(vl)}catch{}}pickupTokenFromUrl(){try{const t=new URLSearchParams(window.location.search),n=t.get("token");if(!n)return!1;this.setToken(n),t.delete("token");const r=t.toString(),i=r?`${window.location.pathname}?${r}`:window.location.pathname;return history.replaceState(null,"",i),!0}catch{return!1}}urlWithToken(t){const n=this.base+t,r=this.getToken();if(!r)return n;const i=n.includes("?")?"&":"?";return`${n}${i}token=${encodeURIComponent(r)}`}async probeAuthStatus(){try{const t=await this.get("/auth/status");try{localStorage.setItem(ad,t.loopback?"1":"0")}catch{}return t}catch{return{required:!1,loopback:!0,peer:""}}}isLoopbackTrusted(){try{return localStorage.getItem(ad)!=="0"}catch{return!0}}async get(t,n){return this.req("GET",t,void 0,n)}async post(t,n,r){return this.req("POST",t,n,r)}async put(t,n,r){return this.req("PUT",t,n,r)}async patch(t,n,r){return this.req("PATCH",t,n,r)}async del(t,n){return this.req("DELETE",t,void 0,n)}async req(t,n,r,i){const l={"Content-Type":"application/json"},s=this.getToken();s&&(l.Authorization=`Bearer ${s}`);const a={method:t,headers:l};r!=null&&(a.body=typeof r=="string"?r:JSON.stringify(r)),i&&(a.signal=i);const u=await fetch(this.base+n,a);if((u.headers.get("content-type")||"").includes("application/json")){const f=await u.json();if(!u.ok){const h=(f&&typeof f=="object"&&"message"in f?f.message:void 0)||`${t} ${n}: ${u.status}`;throw new ma(h,u.status,f)}return f}const c=await u.text();if(!u.ok)throw new ma(`${t} ${n}: ${u.status} — ${c.slice(0,200)}`,u.status,c);try{return JSON.parse(c)}catch{return c}}}const q=new Gx;q.pickupTokenFromUrl();async function Xx(e){return e}const Dh=k.createContext(null),Zx=["button:not([disabled])","[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(", ");function Jx(){const e=k.useContext(Dh);return e||{open:()=>"",close:()=>{},isModalOpen:!1}}function pC({children:e}){const[t,n]=k.useState([]),r=k.useCallback(l=>{n(s=>{if(!l)return s.slice(0,-1);const a=s.findIndex(u=>u.id===l);return a===-1||a!==s.length-1?s:s.slice(0,-1)})},[]),i=k.useCallback(l=>{const s=`m${Math.random().toString(36).slice(2,9)}`;return n(a=>[...a,{...l,id:s}]),s},[]);return k.useEffect(()=>{if(t.length===0)return;const l=s=>{s.key==="Escape"&&(s.stopPropagation(),r())};return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[t.length,r]),o.jsxs(Dh.Provider,{value:{open:i,close:r,isModalOpen:t.length>0},children:[e,typeof document<"u"&&Th.createPortal(o.jsx("div",{className:"modal-stack","aria-hidden":t.length===0,children:t.map((l,s)=>o.jsx(e1,{modal:l,onClose:()=>{var a;(a=l.onClose)==null||a.call(l),r(l.id)},depth:s},l.id))}),document.body)]})}function e1({modal:e,onClose:t,depth:n}){const r=k.useRef(null),i=k.useRef(null),l=k.useId(),s=()=>{const a=r.current;return a?Array.from(a.querySelectorAll(Zx)).filter(u=>!u.hasAttribute("disabled")&&u.tabIndex!==-1):[]};return k.useEffect(()=>{var d;i.current=document.activeElement instanceof HTMLElement?document.activeElement:null,(d=s()[0]??r.current)==null||d.focus();const u=c=>{var x,C,y;if(c.key!=="Tab")return;const f=s();if(f.length===0){c.preventDefault(),(x=r.current)==null||x.focus();return}const h=f[0],p=f[f.length-1],g=document.activeElement instanceof HTMLElement?document.activeElement:null;if(c.shiftKey){(!g||g===h||!((C=r.current)!=null&&C.contains(g)))&&(c.preventDefault(),p.focus());return}(!g||g===p||!((y=r.current)!=null&&y.contains(g)))&&(c.preventDefault(),h.focus())};return document.addEventListener("keydown",u),()=>{document.removeEventListener("keydown",u);const c=i.current;c&&c.isConnected&&c.focus()}},[]),o.jsx("div",{className:"modal-backdrop",onClick:a=>{a.stopPropagation(),a.target===a.currentTarget&&t()},style:n>0?{background:"rgba(0,0,0,0.4)"}:void 0,children:o.jsxs("div",{ref:r,className:"modal",role:"dialog","aria-modal":"true","aria-labelledby":e.title?l:void 0,tabIndex:-1,onClick:a=>a.stopPropagation(),style:e.width?{maxWidth:e.width}:void 0,children:[e.title&&o.jsxs("header",{className:"modal-header",children:[o.jsx("h2",{id:l,className:"modal-title",children:e.title}),o.jsx("button",{type:"button",className:"icon-btn","aria-label":"Close",onClick:t,children:o.jsx(Yn,{size:16})})]}),o.jsx("div",{className:"modal-body",children:e.children}),e.footer&&o.jsx("footer",{className:"modal-footer",children:e.footer})]})})}const dr=k.forwardRef(function({variant:t="secondary",size:n="md",iconOnly:r=!1,loading:i=!1,disabled:l,className:s,children:a,...u},d){return o.jsxs("button",{ref:d,type:u.type??"button",disabled:l||i,className:Cu("btn",`btn-${t}`,`btn-size-${n}`,r&&"btn-icon",i&&"btn-loading",s),...u,children:[i?o.jsx("span",{className:"btn-spinner","aria-hidden":!0}):null,a]})}),Mh=k.createContext(null);function t1(){const e=k.useContext(Mh);return e||{show:()=>{},info:()=>{},success:()=>{},error:()=>{},warning:()=>{},dismiss:()=>{},toasts:[]}}const n1={info:Rx,success:zx,error:Tx,warning:Qx};function hC({children:e}){const[t,n]=k.useState([]),r=k.useRef(1),i=k.useRef(new Map),l=k.useCallback(u=>{n(c=>c.filter(f=>f.id!==u));const d=i.current.get(u);d&&(clearTimeout(d),i.current.delete(u))},[]),s=k.useCallback((u,d="info",c=4e3)=>{const f=r.current++;if(n(h=>[...h,{id:f,kind:d,message:u}]),c>0){const h=setTimeout(()=>l(f),c);i.current.set(f,h)}},[l]);k.useEffect(()=>()=>{for(const u of i.current.values())clearTimeout(u);i.current.clear()},[]);const a=k.useMemo(()=>({show:s,info:(u,d)=>s(u,"info",d),success:(u,d)=>s(u,"success",d),error:(u,d)=>s(u,"error",d),warning:(u,d)=>s(u,"warning",d),dismiss:l,toasts:t}),[s,l,t]);return o.jsxs(Mh.Provider,{value:a,children:[e,o.jsx(r1,{toasts:t,onDismiss:l})]})}function r1({toasts:e,onDismiss:t}){return o.jsx("div",{className:"toast-stack","aria-live":"polite",children:e.map(n=>o.jsx(i1,{toast:n,onDismiss:t},n.id))})}function i1({toast:e,onDismiss:t}){const n=n1[e.kind];return o.jsxs("div",{className:`toast toast-${e.kind}`,role:"alert","aria-live":"assertive","aria-atomic":"true",children:[o.jsx(n,{size:16,className:"toast-icon"}),o.jsx("span",{className:"toast-message",children:e.message}),o.jsx("button",{type:"button",className:"toast-close","aria-label":"Dismiss",onClick:()=>t(e.id),children:o.jsx(Yn,{size:14})})]})}function l1(){if(typeof location>"u")return"ws://localhost/ws";const e=`${location.protocol==="https:"?"wss":"ws"}://${location.host}/ws`;let t="";try{t=localStorage.getItem(vl)||""}catch{}return t?`${e}?token=${encodeURIComponent(t)}`:e}class Rh{constructor(t){et(this,"urlOverride");et(this,"handlers",new Set);et(this,"statusHandlers",new Set);et(this,"ws",null);et(this,"reconnectDelay",1e3);et(this,"maxReconnectDelay",15e3);et(this,"reconnectTimer",null);et(this,"_status","connecting");et(this,"pingTimer",null);et(this,"closed",!1);this.urlOverride=t,this.connect()}on(t){return this.handlers.add(t),()=>{this.handlers.delete(t)}}onStatus(t){return this.statusHandlers.add(t),t(this._status),()=>{this.statusHandlers.delete(t)}}get status(){return this._status}send(t){return this.ws&&this.ws.readyState===WebSocket.OPEN?(this.ws.send(JSON.stringify(t)),!0):!1}close(){var t;this.closed=!0,this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.reconnectTimer=null,this.pingTimer&&clearInterval(this.pingTimer),this.pingTimer=null;try{(t=this.ws)==null||t.close()}catch{}this.ws=null,this.setStatus("disconnected")}connect(){if(this.closed)return;this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.setStatus("connecting");const t=this.urlOverride??l1();let n;try{n=new WebSocket(t),this.ws=n}catch(r){console.warn("[ws] construct failed:",r),this.scheduleReconnect();return}n.addEventListener("open",()=>{this.ws!==n||this.closed||(this.reconnectDelay=1e3,this.setStatus("connected"),this.pingTimer&&clearInterval(this.pingTimer),this.pingTimer=setInterval(()=>{this._status==="connected"&&this.send({type:"ping"})},3e4))}),n.addEventListener("close",()=>{this.ws===n&&(this.ws=null,this.setStatus("disconnected"),this.pingTimer&&(clearInterval(this.pingTimer),this.pingTimer=null),this.closed||this.scheduleReconnect())}),n.addEventListener("error",()=>{this.ws===n&&console.warn("[ws] error")}),n.addEventListener("message",r=>{let i;try{i=JSON.parse(r.data)}catch{console.warn("[ws] bad message");return}for(const l of this.handlers)try{l(i)}catch(s){console.error("[ws] handler error:",s)}})}scheduleReconnect(){this.closed||this.reconnectTimer||(this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},this.reconnectDelay),this.reconnectDelay=Math.min(this.reconnectDelay*1.6,this.maxReconnectDelay))}setStatus(t){this._status=t;for(const n of this.statusHandlers)try{n(t)}catch(r){console.error("[ws] status handler error:",r)}}}const s1=Object.freeze(Object.defineProperty({__proto__:null,Ws:Rh},Symbol.toStringTag,{value:"Module"}));function Gl(e){const t=typeof e=="string"?e:e.mode,n=t==="system"?typeof window<"u"&&window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark":t==="light"?"light":"dark";return typeof document<"u"&&(n==="light"?document.documentElement.setAttribute("data-theme","light"):document.documentElement.removeAttribute("data-theme")),n}function ii(e){if(typeof document>"u")return;const t=document.documentElement;t.style.setProperty("--accent",e.accent),t.style.setProperty("--success",e.success),t.style.setProperty("--warning",e.warning),t.style.setProperty("--error",e.error),t.style.setProperty("--info",e.info),t.style.setProperty("--accent-bg",ud(e.accent,.12)),t.style.setProperty("--accent-border",ud(e.accent,.4)),e.fontFamily&&t.style.setProperty("--font-sans",`'${e.fontFamily}', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif`),e.fontSize&&t.style.setProperty("--base-font-size",`${e.fontSize}px`),t.dataset.compactMode=e.compactMode?"true":"false",t.dataset.animations=e.animations?"true":"false"}function ud(e,t){const n=/^#?([0-9a-f]{6})$/i.exec(e||"");if(!n)return`rgba(139, 92, 246, ${t})`;const r=parseInt(n[1],16),i=r>>16&255,l=r>>8&255,s=r&255;return`rgba(${i}, ${l}, ${s}, ${t})`}function _h({size:e="md",className:t,label:n}){return o.jsx("span",{className:Cu("spinner",`spinner-${e}`,t),role:"status","aria-label":n||"Loading"})}function o1({items:e,renderItem:t,itemHeight:n=80,height:r=400,overscan:i=5,className:l}){const[s,a]=k.useState(0),u=k.useRef(null),d=k.useMemo(()=>{const p=Math.max(0,Math.floor(s/n)-i),g=Math.min(e.length,Math.ceil((s+r)/n)+i);return{start:p,end:g}},[s,n,r,i,e.length]),c=e.length*n,f=d.start*n,h=e.slice(d.start,d.end);return o.jsx("div",{ref:u,onScroll:p=>a(p.currentTarget.scrollTop),style:{height:r,overflowY:"auto"},className:l,children:o.jsx("div",{style:{height:c,position:"relative"},children:o.jsx("div",{style:{transform:`translateY(${f}px)`},children:h.map((p,g)=>o.jsx("div",{style:{height:n},children:t(p,d.start+g)},d.start+g))})})})}function a1({activeProject:e,sessionCount:t,sessionsOpen:n,infoOpen:r,onToggleSessions:i,onToggleInfo:l,onOpenOverview:s}){return o.jsxs("header",{className:"chat-topbar",children:[o.jsxs("button",{type:"button",className:"chat-topbar-project",onClick:s,children:[o.jsx(Su,{size:14}),o.jsx("span",{className:"chat-topbar-project-name",children:(e==null?void 0:e.name)??"No project"}),o.jsx(ys,{size:12})]}),o.jsx("div",{className:"chat-topbar-spacer"}),o.jsxs("button",{type:"button",className:`chat-topbar-btn ${n?"active":""}`,onClick:i,"aria-pressed":n,children:["Sessions (",t,")"]}),o.jsx("button",{type:"button",className:`chat-topbar-btn ${r?"active":""}`,onClick:l,"aria-pressed":r,children:"Info"})]})}function u1({icon:e,title:t,message:n,action:r}){return o.jsxs("div",{className:"chat-empty-state",children:[e&&o.jsx("div",{className:"chat-empty-state-icon",children:e}),o.jsx("h2",{className:"chat-empty-state-title",children:t}),o.jsx("p",{className:"chat-empty-state-message",children:n}),r&&o.jsx("div",{className:"chat-empty-state-action",children:r})]})}function c1({count:e=3}){return o.jsx("div",{className:"chat-loading-skeleton","aria-label":"Loading messages",children:Array.from({length:e}).map((t,n)=>o.jsxs("div",{className:"chat-loading-skeleton-bubble",children:[o.jsx("div",{className:"chat-loading-skeleton-meta"}),o.jsx("div",{className:"chat-loading-skeleton-line"}),o.jsx("div",{className:"chat-loading-skeleton-line short"})]},n))})}function d1({projectName:e,onPickSuggestion:t}){const n=[{icon:o.jsx(Px,{size:16}),title:e?`Explain ${e}`:"Explain this project",preview:"Give me a tour of the codebase, highlight the architecture, and call out any anti-patterns or hotspots.",prompt:e?`Explain the ${e} project. Give me a tour of the codebase, highlight the architecture, and call out any anti-patterns or hotspots.`:"Explain the current project. Give me a tour of the codebase, highlight the architecture, and call out any anti-patterns or hotspots."},{icon:o.jsx(Nx,{size:16}),title:"Summarize recent sessions",preview:"Read my last 5 chat sessions and give me a 3-bullet summary of what I worked on and what got stuck.",prompt:"Read my last 5 chat sessions and give me a 3-bullet summary of what I worked on and what got stuck."},{icon:o.jsx(_x,{size:16}),title:"Suggest a refactor",preview:"Look for the largest, most painful files in this project and propose a concrete refactor for the worst one.",prompt:"Look for the largest, most painful files in this project and propose a concrete refactor for the worst one."},{icon:o.jsx(Mx,{size:16}),title:"Find visual regressions",preview:"Open the dashboard, screenshot the Chat tab, and flag any layout problems or anti-patterns you see.",prompt:"Open the dashboard, screenshot the Chat tab, and flag any layout problems or anti-patterns you see."}];return o.jsx("div",{className:"chat-suggestions",children:n.map((r,i)=>o.jsxs("button",{type:"button",className:"chat-suggestion",onClick:()=>t(r.prompt),children:[o.jsxs("div",{className:"chat-suggestion-title",children:[r.icon,o.jsx("span",{children:r.title})]}),o.jsx("div",{className:"chat-suggestion-preview",children:r.preview})]},i))})}function cd({variant:e,projectName:t,onPickSuggestion:n}){if(e==="no-project")return o.jsxs("div",{className:"chat-welcome",children:[o.jsx("h1",{className:"chat-welcome-h1",children:o.jsx("span",{className:"chat-greeting-hello",children:"No project selected."})}),o.jsx("p",{className:"chat-welcome-subtitle",children:"Pick a project in Overview to scope chat sessions."})]});const r=t||"there";return o.jsxs("div",{className:"chat-welcome",children:[o.jsxs("h1",{className:"chat-welcome-h1",children:[o.jsx("span",{className:"chat-greeting-hello",children:"Hello, "}),o.jsxs("span",{className:"chat-greeting-name",children:[r,"."]})]}),o.jsx("p",{className:"chat-welcome-subtitle",children:"How can I help you today?"}),o.jsx(d1,{projectName:t,onPickSuggestion:n})]})}function f1(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const p1=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,h1=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,m1={};function dd(e,t){return(m1.jsx?h1:p1).test(e)}const g1=/[ \t\n\f\r]/g;function y1(e){return typeof e=="object"?e.type==="text"?fd(e.value):!1:fd(e)}function fd(e){return e.replace(g1,"")===""}class Li{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Li.prototype.normal={};Li.prototype.property={};Li.prototype.space=void 0;function Oh(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Li(n,r,t)}function ga(e){return e.toLowerCase()}class ot{constructor(t,n){this.attribute=n,this.property=t}}ot.prototype.attribute="";ot.prototype.booleanish=!1;ot.prototype.boolean=!1;ot.prototype.commaOrSpaceSeparated=!1;ot.prototype.commaSeparated=!1;ot.prototype.defined=!1;ot.prototype.mustUseProperty=!1;ot.prototype.number=!1;ot.prototype.overloadedBoolean=!1;ot.prototype.property="";ot.prototype.spaceSeparated=!1;ot.prototype.space=void 0;let x1=0;const te=Kn(),Ae=Kn(),ya=Kn(),F=Kn(),xe=Kn(),On=Kn(),ut=Kn();function Kn(){return 2**++x1}const xa=Object.freeze(Object.defineProperty({__proto__:null,boolean:te,booleanish:Ae,commaOrSpaceSeparated:ut,commaSeparated:On,number:F,overloadedBoolean:ya,spaceSeparated:xe},Symbol.toStringTag,{value:"Module"})),no=Object.keys(xa);class Nu extends ot{constructor(t,n,r,i){let l=-1;if(super(t,n),pd(this,"space",i),typeof r=="number")for(;++l<no.length;){const s=no[l];pd(this,no[l],(r&xa[s])===xa[s])}}}Nu.prototype.defined=!0;function pd(e,t,n){n&&(e[t]=n)}function Ar(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const l=new Nu(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),t[r]=l,n[ga(r)]=r,n[ga(l.attribute)]=r}return new Li(t,n,e.space)}const Fh=Ar({properties:{ariaActiveDescendant:null,ariaAtomic:Ae,ariaAutoComplete:null,ariaBusy:Ae,ariaChecked:Ae,ariaColCount:F,ariaColIndex:F,ariaColSpan:F,ariaControls:xe,ariaCurrent:null,ariaDescribedBy:xe,ariaDetails:null,ariaDisabled:Ae,ariaDropEffect:xe,ariaErrorMessage:null,ariaExpanded:Ae,ariaFlowTo:xe,ariaGrabbed:Ae,ariaHasPopup:null,ariaHidden:Ae,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:xe,ariaLevel:F,ariaLive:null,ariaModal:Ae,ariaMultiLine:Ae,ariaMultiSelectable:Ae,ariaOrientation:null,ariaOwns:xe,ariaPlaceholder:null,ariaPosInSet:F,ariaPressed:Ae,ariaReadOnly:Ae,ariaRelevant:null,ariaRequired:Ae,ariaRoleDescription:xe,ariaRowCount:F,ariaRowIndex:F,ariaRowSpan:F,ariaSelected:Ae,ariaSetSize:F,ariaSort:null,ariaValueMax:F,ariaValueMin:F,ariaValueNow:F,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function $h(e,t){return t in e?e[t]:t}function Bh(e,t){return $h(e,t.toLowerCase())}const v1=Ar({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:On,acceptCharset:xe,accessKey:xe,action:null,allow:null,allowFullScreen:te,allowPaymentRequest:te,allowUserMedia:te,alpha:te,alt:null,as:null,async:te,autoCapitalize:null,autoComplete:xe,autoFocus:te,autoPlay:te,blocking:xe,capture:null,charSet:null,checked:te,cite:null,className:xe,closedBy:null,colorSpace:null,cols:F,colSpan:F,command:null,commandFor:null,content:null,contentEditable:Ae,controls:te,controlsList:xe,coords:F|On,crossOrigin:null,data:null,dateTime:null,decoding:null,default:te,defer:te,dir:null,dirName:null,disabled:te,download:ya,draggable:Ae,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:te,formTarget:null,headers:xe,height:F,hidden:ya,high:F,href:null,hrefLang:null,htmlFor:xe,httpEquiv:xe,id:null,imageSizes:null,imageSrcSet:null,inert:te,inputMode:null,integrity:null,is:null,isMap:te,itemId:null,itemProp:xe,itemRef:xe,itemScope:te,itemType:xe,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:te,low:F,manifest:null,max:null,maxLength:F,media:null,method:null,min:null,minLength:F,multiple:te,muted:te,name:null,nonce:null,noModule:te,noValidate:te,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:te,optimum:F,pattern:null,ping:xe,placeholder:null,playsInline:te,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:te,referrerPolicy:null,rel:xe,required:te,reversed:te,rows:F,rowSpan:F,sandbox:xe,scope:null,scoped:te,seamless:te,selected:te,shadowRootClonable:te,shadowRootCustomElementRegistry:te,shadowRootDelegatesFocus:te,shadowRootMode:null,shadowRootSerializable:te,shape:null,size:F,sizes:null,slot:null,span:F,spellCheck:Ae,src:null,srcDoc:null,srcLang:null,srcSet:null,start:F,step:null,style:null,tabIndex:F,target:null,title:null,translate:null,type:null,typeMustMatch:te,useMap:null,value:Ae,width:F,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:xe,axis:null,background:null,bgColor:null,border:F,borderColor:null,bottomMargin:F,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:te,declare:te,event:null,face:null,frame:null,frameBorder:null,hSpace:F,leftMargin:F,link:null,longDesc:null,lowSrc:null,marginHeight:F,marginWidth:F,noResize:te,noHref:te,noShade:te,noWrap:te,object:null,profile:null,prompt:null,rev:null,rightMargin:F,rules:null,scheme:null,scrolling:Ae,standby:null,summary:null,text:null,topMargin:F,valueType:null,version:null,vAlign:null,vLink:null,vSpace:F,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:te,disablePictureInPicture:te,disableRemotePlayback:te,exportParts:On,part:xe,prefix:null,property:null,results:F,security:null,unselectable:null},space:"html",transform:Bh}),k1=Ar({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ut,accentHeight:F,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:F,amplitude:F,arabicForm:null,ascent:F,attributeName:null,attributeType:null,azimuth:F,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:F,by:null,calcMode:null,capHeight:F,className:xe,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:F,diffuseConstant:F,direction:null,display:null,dur:null,divisor:F,dominantBaseline:null,download:te,dx:null,dy:null,edgeMode:null,editable:null,elevation:F,enableBackground:null,end:null,event:null,exponent:F,externalResourcesRequired:null,fill:null,fillOpacity:F,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:On,g2:On,glyphName:On,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:F,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:F,horizOriginX:F,horizOriginY:F,id:null,ideographic:F,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:F,k:F,k1:F,k2:F,k3:F,k4:F,kernelMatrix:ut,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:F,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:F,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:F,overlineThickness:F,paintOrder:null,panose1:null,path:null,pathLength:F,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:xe,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:F,pointsAtY:F,pointsAtZ:F,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ut,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ut,rev:ut,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ut,requiredFeatures:ut,requiredFonts:ut,requiredFormats:ut,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:F,specularExponent:F,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:F,strikethroughThickness:F,string:null,stroke:null,strokeDashArray:ut,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:F,strokeOpacity:F,strokeWidth:null,style:null,surfaceScale:F,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ut,tabIndex:F,tableValues:null,target:null,targetX:F,targetY:F,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ut,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:F,underlineThickness:F,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:F,values:null,vAlphabetic:F,vMathematical:F,vectorEffect:null,vHanging:F,vIdeographic:F,version:null,vertAdvY:F,vertOriginX:F,vertOriginY:F,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:F,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:$h}),Uh=Ar({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Hh=Ar({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Bh}),Vh=Ar({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),w1={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"},b1=/[A-Z]/g,hd=/-[a-z]/g,S1=/^data[-\w.:]+$/i;function j1(e,t){const n=ga(t);let r=t,i=ot;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&S1.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(hd,N1);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!hd.test(l)){let s=l.replace(b1,C1);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=Nu}return new i(r,t)}function C1(e){return"-"+e.toLowerCase()}function N1(e){return e.charAt(1).toUpperCase()}const E1=Oh([Fh,v1,Uh,Hh,Vh],"html"),Eu=Oh([Fh,k1,Uh,Hh,Vh],"svg");function T1(e){return e.join(" ").trim()}var Tu={},md=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,z1=/\n/g,I1=/^\s*/,P1=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,L1=/^:\s*/,A1=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,D1=/^[;\s]*/,M1=/^\s+|\s+$/g,R1=`
311
- `,gd="/",yd="*",Pn="",_1="comment",O1="declaration";function F1(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(g){var x=g.match(z1);x&&(n+=x.length);var C=g.lastIndexOf(R1);r=~C?g.length-C:r+g.length}function l(){var g={line:n,column:r};return function(x){return x.position=new s(g),d(),x}}function s(g){this.start=g,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function a(g){var x=new Error(t.source+":"+n+":"+r+": "+g);if(x.reason=g,x.filename=t.source,x.line=n,x.column=r,x.source=e,!t.silent)throw x}function u(g){var x=g.exec(e);if(x){var C=x[0];return i(C),e=e.slice(C.length),x}}function d(){u(I1)}function c(g){var x;for(g=g||[];x=f();)x!==!1&&g.push(x);return g}function f(){var g=l();if(!(gd!=e.charAt(0)||yd!=e.charAt(1))){for(var x=2;Pn!=e.charAt(x)&&(yd!=e.charAt(x)||gd!=e.charAt(x+1));)++x;if(x+=2,Pn===e.charAt(x-1))return a("End of comment missing");var C=e.slice(2,x-2);return r+=2,i(C),e=e.slice(x),r+=2,g({type:_1,comment:C})}}function h(){var g=l(),x=u(P1);if(x){if(f(),!u(L1))return a("property missing ':'");var C=u(A1),y=g({type:O1,property:xd(x[0].replace(md,Pn)),value:C?xd(C[0].replace(md,Pn)):Pn});return u(D1),y}}function p(){var g=[];c(g);for(var x;x=h();)x!==!1&&(g.push(x),c(g));return g}return d(),p()}function xd(e){return e?e.replace(M1,Pn):Pn}var $1=F1,B1=bl&&bl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Tu,"__esModule",{value:!0});Tu.default=H1;const U1=B1($1);function H1(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,U1.default)(e),i=typeof t=="function";return r.forEach(l=>{if(l.type!=="declaration")return;const{property:s,value:a}=l;i?t(s,a,l):a&&(n=n||{},n[s]=a)}),n}var xs={};Object.defineProperty(xs,"__esModule",{value:!0});xs.camelCase=void 0;var V1=/^--[a-zA-Z0-9_-]+$/,W1=/-([a-z])/g,q1=/^[^-]+$/,Q1=/^-(webkit|moz|ms|o|khtml)-/,Y1=/^-(ms)-/,K1=function(e){return!e||q1.test(e)||V1.test(e)},G1=function(e,t){return t.toUpperCase()},vd=function(e,t){return"".concat(t,"-")},X1=function(e,t){return t===void 0&&(t={}),K1(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(Y1,vd):e=e.replace(Q1,vd),e.replace(W1,G1))};xs.camelCase=X1;var Z1=bl&&bl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},J1=Z1(Tu),ev=xs;function va(e,t){var n={};return!e||typeof e!="string"||(0,J1.default)(e,function(r,i){r&&i&&(n[(0,ev.camelCase)(r,t)]=i)}),n}va.default=va;var tv=va;const nv=Ta(tv),Wh=qh("end"),zu=qh("start");function qh(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function rv(e){const t=zu(e),n=Wh(e);if(t&&n)return{start:t,end:n}}function li(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?kd(e.position):"start"in e||"end"in e?kd(e):"line"in e||"column"in e?ka(e):""}function ka(e){return wd(e&&e.line)+":"+wd(e&&e.column)}function kd(e){return ka(e&&e.start)+"-"+ka(e&&e.end)}function wd(e){return e&&typeof e=="number"?e:1}class Qe extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",l={},s=!1;if(n&&("line"in n&&"column"in n?l={place:n}:"start"in n&&"end"in n?l={place:n}:"type"in n?l={ancestors:[n],place:n.position}:l={...n}),typeof t=="string"?i=t:!l.cause&&t&&(s=!0,i=t.message,l.cause=t),!l.ruleId&&!l.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?l.ruleId=r:(l.source=r.slice(0,u),l.ruleId=r.slice(u+1))}if(!l.place&&l.ancestors&&l.ancestors){const u=l.ancestors[l.ancestors.length-1];u&&(l.place=u.position)}const a=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=li(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=s&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Qe.prototype.file="";Qe.prototype.name="";Qe.prototype.reason="";Qe.prototype.message="";Qe.prototype.stack="";Qe.prototype.column=void 0;Qe.prototype.line=void 0;Qe.prototype.ancestors=void 0;Qe.prototype.cause=void 0;Qe.prototype.fatal=void 0;Qe.prototype.place=void 0;Qe.prototype.ruleId=void 0;Qe.prototype.source=void 0;const Iu={}.hasOwnProperty,iv=new Map,lv=/[A-Z]/g,sv=new Set(["table","tbody","thead","tfoot","tr"]),ov=new Set(["td","th"]),Qh="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function av(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=gv(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=mv(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Eu:E1,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=Yh(i,e,void 0);return l&&typeof l!="string"?l:i.create(e,i.Fragment,{children:l||void 0},void 0)}function Yh(e,t,n){if(t.type==="element")return uv(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return cv(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return fv(e,t,n);if(t.type==="mdxjsEsm")return dv(e,t);if(t.type==="root")return pv(e,t,n);if(t.type==="text")return hv(e,t)}function uv(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Eu,e.schema=i),e.ancestors.push(t);const l=Gh(e,t.tagName,!1),s=yv(e,t);let a=Lu(e,t);return sv.has(t.tagName)&&(a=a.filter(function(u){return typeof u=="string"?!y1(u):!0})),Kh(e,s,l,t),Pu(s,a),e.ancestors.pop(),e.schema=r,e.create(t,l,s,n)}function cv(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Ci(e,t.position)}function dv(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ci(e,t.position)}function fv(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Eu,e.schema=i),e.ancestors.push(t);const l=t.name===null?e.Fragment:Gh(e,t.name,!0),s=xv(e,t),a=Lu(e,t);return Kh(e,s,l,t),Pu(s,a),e.ancestors.pop(),e.schema=r,e.create(t,l,s,n)}function pv(e,t,n){const r={};return Pu(r,Lu(e,t)),e.create(t,e.Fragment,r,n)}function hv(e,t){return t.value}function Kh(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Pu(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function mv(e,t,n){return r;function r(i,l,s,a){const d=Array.isArray(s.children)?n:t;return a?d(l,s,a):d(l,s)}}function gv(e,t){return n;function n(r,i,l,s){const a=Array.isArray(l.children),u=zu(r);return t(i,l,s,a,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function yv(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Iu.call(t.properties,i)){const l=vv(e,i,t.properties[i]);if(l){const[s,a]=l;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&ov.has(t.tagName)?r=a:n[s]=a}}if(r){const l=n.style||(n.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function xv(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const l=r.data.estree.body[0];l.type;const s=l.expression;s.type;const a=s.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Ci(e,t.position);else{const i=r.name;let l;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,l=e.evaluater.evaluateExpression(a.expression)}else Ci(e,t.position);else l=r.value===null?!0:r.value;n[i]=l}return n}function Lu(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:iv;for(;++r<t.children.length;){const l=t.children[r];let s;if(e.passKeys){const u=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(u){const d=i.get(u)||0;s=u+"-"+d,i.set(u,d+1)}}const a=Yh(e,l,s);a!==void 0&&n.push(a)}return n}function vv(e,t,n){const r=j1(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?f1(n):T1(n)),r.property==="style"){let i=typeof n=="object"?n:kv(e,String(n));return e.stylePropertyNameCase==="css"&&(i=wv(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?w1[r.property]||r.property:r.attribute,n]}}function kv(e,t){try{return nv(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Qe("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=Qh+"#cannot-parse-style-attribute",i}}function Gh(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let l=-1,s;for(;++l<i.length;){const a=dd(i[l])?{type:"Identifier",name:i[l]}:{type:"Literal",value:i[l]};s=s?{type:"MemberExpression",object:s,property:a,computed:!!(l&&a.type==="Literal"),optional:!1}:a}r=s}else r=dd(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Iu.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Ci(e)}function Ci(e,t){const n=new Qe("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Qh+"#cannot-handle-mdx-estrees-without-createevaluater",n}function wv(e){const t={};let n;for(n in e)Iu.call(e,n)&&(t[bv(n)]=e[n]);return t}function bv(e){let t=e.replace(lv,Sv);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Sv(e){return"-"+e.toLowerCase()}const ro={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"]},jv={};function Au(e,t){const n=jv,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Xh(e,r,i)}function Xh(e,t,n){if(Cv(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return bd(e.children,t,n)}return Array.isArray(e)?bd(e,t,n):""}function bd(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Xh(e[i],t,n);return r.join("")}function Cv(e){return!!(e&&typeof e=="object")}const Sd=document.createElement("i");function Du(e){const t="&"+e+";";Sd.innerHTML=t;const n=Sd.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function pt(e,t,n,r){const i=e.length;let l=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);l<r.length;)s=r.slice(l,l+1e4),s.unshift(t,0),e.splice(...s),l+=1e4,t+=1e4}function kt(e,t){return e.length>0?(pt(e,e.length,0,t),e):t}const jd={}.hasOwnProperty;function Zh(e){const t={};let n=-1;for(;++n<e.length;)Nv(t,e[n]);return t}function Nv(e,t){let n;for(n in t){const i=(jd.call(e,n)?e[n]:void 0)||(e[n]={}),l=t[n];let s;if(l)for(s in l){jd.call(i,s)||(i[s]=[]);const a=l[s];Ev(i[s],Array.isArray(a)?a:a?[a]:[])}}}function Ev(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);pt(e,0,0,r)}function Jh(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Pt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ke=jn(/[A-Za-z]/),We=jn(/[\dA-Za-z]/),Tv=jn(/[#-'*+\--9=?A-Z^-~]/);function Xl(e){return e!==null&&(e<32||e===127)}const wa=jn(/\d/),zv=jn(/[\dA-Fa-f]/),Iv=jn(/[!-/:-@[-`{-~]/);function K(e){return e!==null&&e<-2}function ve(e){return e!==null&&(e<0||e===32)}function ae(e){return e===-2||e===-1||e===32}const vs=jn(new RegExp("\\p{P}|\\p{S}","u")),Wn=jn(/\s/);function jn(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Dr(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const l=e.charCodeAt(n);let s="";if(l===37&&We(e.charCodeAt(n+1))&&We(e.charCodeAt(n+2)))i=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(s=String.fromCharCode(l));else if(l>55295&&l<57344){const a=e.charCodeAt(n+1);l<56320&&a>56319&&a<57344?(s=String.fromCharCode(l,a),i=1):s="�"}else s=String.fromCharCode(l);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function fe(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let l=0;return s;function s(u){return ae(u)?(e.enter(n),a(u)):t(u)}function a(u){return ae(u)&&l++<i?(e.consume(u),a):(e.exit(n),t(u))}}const Pv={tokenize:Lv};function Lv(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),fe(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),l(a)}function l(a){const u=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return K(a)?(e.consume(a),e.exit("chunkText"),l):(e.consume(a),s)}}const Av={tokenize:Dv},Cd={tokenize:Mv};function Dv(e){const t=this,n=[];let r=0,i,l,s;return a;function a(v){if(r<n.length){const N=n[r];return t.containerState=N[1],e.attempt(N[0].continuation,u,d)(v)}return d(v)}function u(v){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&m();const N=t.events.length;let P=N,j;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){j=t.events[P][1].end;break}y(r);let I=N;for(;I<t.events.length;)t.events[I][1].end={...j},I++;return pt(t.events,P+1,0,t.events.slice(N)),t.events.length=I,d(v)}return a(v)}function d(v){if(r===n.length){if(!i)return h(v);if(i.currentConstruct&&i.currentConstruct.concrete)return g(v);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Cd,c,f)(v)}function c(v){return i&&m(),y(r),h(v)}function f(v){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,g(v)}function h(v){return t.containerState={},e.attempt(Cd,p,g)(v)}function p(v){return r++,n.push([t.currentConstruct,t.containerState]),h(v)}function g(v){if(v===null){i&&m(),y(0),e.consume(v);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:l}),x(v)}function x(v){if(v===null){C(e.exit("chunkFlow"),!0),y(0),e.consume(v);return}return K(v)?(e.consume(v),C(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(v),x)}function C(v,N){const P=t.sliceStream(v);if(N&&P.push(null),v.previous=l,l&&(l.next=v),l=v,i.defineSkip(v.start),i.write(P),t.parser.lazy[v.start.line]){let j=i.events.length;for(;j--;)if(i.events[j][1].start.offset<s&&(!i.events[j][1].end||i.events[j][1].end.offset>s))return;const I=t.events.length;let L=I,T,w;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){if(T){w=t.events[L][1].end;break}T=!0}for(y(r),j=I;j<t.events.length;)t.events[j][1].end={...w},j++;pt(t.events,L+1,0,t.events.slice(I)),t.events.length=j}}function y(v){let N=n.length;for(;N-- >v;){const P=n[N];t.containerState=P[1],P[0].exit.call(t,e)}n.length=v}function m(){i.write([null]),l=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Mv(e,t,n){return fe(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Er(e){if(e===null||ve(e)||Wn(e))return 1;if(vs(e))return 2}function ks(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const l=e[i].resolveAll;l&&!r.includes(l)&&(t=l(t,n),r.push(l))}return t}const ba={name:"attention",resolveAll:Rv,tokenize:_v};function Rv(e,t){let n=-1,r,i,l,s,a,u,d,c;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;u=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[r][1].end},h={...e[n][1].start};Nd(f,-u),Nd(h,u),s={type:u>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},a={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},l={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},e[r][1].end={...s.start},e[n][1].start={...a.end},d=[],e[r][1].end.offset-e[r][1].start.offset&&(d=kt(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=kt(d,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",l,t]]),d=kt(d,ks(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=kt(d,[["exit",l,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(c=2,d=kt(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,pt(e,r-1,n-r+3,d),n=r+d.length-c-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function _v(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Er(r);let l;return s;function s(u){return l=u,e.enter("attentionSequence"),a(u)}function a(u){if(u===l)return e.consume(u),a;const d=e.exit("attentionSequence"),c=Er(u),f=!c||c===2&&i||n.includes(u),h=!i||i===2&&c||n.includes(r);return d._open=!!(l===42?f:f&&(i||!h)),d._close=!!(l===42?h:h&&(c||!f)),t(u)}}function Nd(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Ov={name:"autolink",tokenize:Fv};function Fv(e,t,n){let r=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(p){return Ke(p)?(e.consume(p),s):p===64?n(p):d(p)}function s(p){return p===43||p===45||p===46||We(p)?(r=1,a(p)):d(p)}function a(p){return p===58?(e.consume(p),r=0,u):(p===43||p===45||p===46||We(p))&&r++<32?(e.consume(p),a):(r=0,d(p))}function u(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||Xl(p)?n(p):(e.consume(p),u)}function d(p){return p===64?(e.consume(p),c):Tv(p)?(e.consume(p),d):n(p)}function c(p){return We(p)?f(p):n(p)}function f(p){return p===46?(e.consume(p),r=0,c):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):h(p)}function h(p){if((p===45||We(p))&&r++<63){const g=p===45?h:f;return e.consume(p),g}return n(p)}}const Ai={partial:!0,tokenize:$v};function $v(e,t,n){return r;function r(l){return ae(l)?fe(e,i,"linePrefix")(l):i(l)}function i(l){return l===null||K(l)?t(l):n(l)}}const em={continuation:{tokenize:Uv},exit:Hv,name:"blockQuote",tokenize:Bv};function Bv(e,t,n){const r=this;return i;function i(s){if(s===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),l}return n(s)}function l(s){return ae(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function Uv(e,t,n){const r=this;return i;function i(s){return ae(s)?fe(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):l(s)}function l(s){return e.attempt(em,t,n)(s)}}function Hv(e){e.exit("blockQuote")}const tm={name:"characterEscape",tokenize:Vv};function Vv(e,t,n){return r;function r(l){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(l),e.exit("escapeMarker"),i}function i(l){return Iv(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(l)}}const nm={name:"characterReference",tokenize:Wv};function Wv(e,t,n){const r=this;let i=0,l,s;return a;function a(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),u}function u(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),l=31,s=We,c(f))}function d(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,s=zv,c):(e.enter("characterReferenceValue"),l=7,s=wa,c(f))}function c(f){if(f===59&&i){const h=e.exit("characterReferenceValue");return s===We&&!Du(r.sliceSerialize(h))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(f)&&i++<l?(e.consume(f),c):n(f)}}const Ed={partial:!0,tokenize:Qv},Td={concrete:!0,name:"codeFenced",tokenize:qv};function qv(e,t,n){const r=this,i={partial:!0,tokenize:P};let l=0,s=0,a;return u;function u(j){return d(j)}function d(j){const I=r.events[r.events.length-1];return l=I&&I[1].type==="linePrefix"?I[2].sliceSerialize(I[1],!0).length:0,a=j,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(j)}function c(j){return j===a?(s++,e.consume(j),c):s<3?n(j):(e.exit("codeFencedFenceSequence"),ae(j)?fe(e,f,"whitespace")(j):f(j))}function f(j){return j===null||K(j)?(e.exit("codeFencedFence"),r.interrupt?t(j):e.check(Ed,x,N)(j)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(j))}function h(j){return j===null||K(j)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(j)):ae(j)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),fe(e,p,"whitespace")(j)):j===96&&j===a?n(j):(e.consume(j),h)}function p(j){return j===null||K(j)?f(j):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(j))}function g(j){return j===null||K(j)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(j)):j===96&&j===a?n(j):(e.consume(j),g)}function x(j){return e.attempt(i,N,C)(j)}function C(j){return e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),y}function y(j){return l>0&&ae(j)?fe(e,m,"linePrefix",l+1)(j):m(j)}function m(j){return j===null||K(j)?e.check(Ed,x,N)(j):(e.enter("codeFlowValue"),v(j))}function v(j){return j===null||K(j)?(e.exit("codeFlowValue"),m(j)):(e.consume(j),v)}function N(j){return e.exit("codeFenced"),t(j)}function P(j,I,L){let T=0;return w;function w(Q){return j.enter("lineEnding"),j.consume(Q),j.exit("lineEnding"),z}function z(Q){return j.enter("codeFencedFence"),ae(Q)?fe(j,A,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Q):A(Q)}function A(Q){return Q===a?(j.enter("codeFencedFenceSequence"),H(Q)):L(Q)}function H(Q){return Q===a?(T++,j.consume(Q),H):T>=s?(j.exit("codeFencedFenceSequence"),ae(Q)?fe(j,$,"whitespace")(Q):$(Q)):L(Q)}function $(Q){return Q===null||K(Q)?(j.exit("codeFencedFence"),I(Q)):L(Q)}}}function Qv(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),l)}function l(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const io={name:"codeIndented",tokenize:Kv},Yv={partial:!0,tokenize:Gv};function Kv(e,t,n){const r=this;return i;function i(d){return e.enter("codeIndented"),fe(e,l,"linePrefix",5)(d)}function l(d){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?s(d):n(d)}function s(d){return d===null?u(d):K(d)?e.attempt(Yv,s,u)(d):(e.enter("codeFlowValue"),a(d))}function a(d){return d===null||K(d)?(e.exit("codeFlowValue"),s(d)):(e.consume(d),a)}function u(d){return e.exit("codeIndented"),t(d)}}function Gv(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):K(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):fe(e,l,"linePrefix",5)(s)}function l(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):K(s)?i(s):n(s)}}const Xv={name:"codeText",previous:Jv,resolve:Zv,tokenize:ek};function Zv(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Jv(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function ek(e,t,n){let r=0,i,l;return s;function s(f){return e.enter("codeText"),e.enter("codeTextSequence"),a(f)}function a(f){return f===96?(e.consume(f),r++,a):(e.exit("codeTextSequence"),u(f))}function u(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),u):f===96?(l=e.enter("codeTextSequence"),i=0,c(f)):K(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),u):(e.enter("codeTextData"),d(f))}function d(f){return f===null||f===32||f===96||K(f)?(e.exit("codeTextData"),u(f)):(e.consume(f),d)}function c(f){return f===96?(e.consume(f),i++,c):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(l.type="codeTextData",d(f))}}class tk{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const l=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Hr(this.left,r),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Hr(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Hr(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Hr(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Hr(this.left,n.reverse())}}}function Hr(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function rm(e){const t={};let n=-1,r,i,l,s,a,u,d;const c=new tk(e);for(;++n<c.length;){for(;n in t;)n=t[n];if(r=c.get(n),n&&r[1].type==="chunkFlow"&&c.get(n-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,l=0,l<u.length&&u[l][1].type==="lineEndingBlank"&&(l+=2),l<u.length&&u[l][1].type==="content"))for(;++l<u.length&&u[l][1].type!=="content";)u[l][1].type==="chunkText"&&(u[l][1]._isInFirstContentOfListItem=!0,l++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,nk(c,n)),n=t[n],d=!0);else if(r[1]._container){for(l=n,i=void 0;l--;)if(s=c.get(l),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(c.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=l);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(r[1].end={...c.get(i)[1].start},a=c.slice(i,n),a.unshift(r),c.splice(i,n-i+1,a))}}return pt(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!d}function nk(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const l=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const a=s.events,u=[],d={};let c,f,h=-1,p=n,g=0,x=0;const C=[x];for(;p;){for(;e.get(++i)[1]!==p;);l.push(i),p._tokenizer||(c=r.sliceStream(p),p.next||c.push(null),f&&s.defineSkip(p.start),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(c),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),f=p,p=p.next}for(p=n;++h<a.length;)a[h][0]==="exit"&&a[h-1][0]==="enter"&&a[h][1].type===a[h-1][1].type&&a[h][1].start.line!==a[h][1].end.line&&(x=h+1,C.push(x),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(s.events=[],p?(p._tokenizer=void 0,p.previous=void 0):C.pop(),h=C.length;h--;){const y=a.slice(C[h],C[h+1]),m=l.pop();u.push([m,m+y.length-1]),e.splice(m,2,y)}for(u.reverse(),h=-1;++h<u.length;)d[g+u[h][0]]=g+u[h][1],g+=u[h][1]-u[h][0]-1;return d}const rk={resolve:lk,tokenize:sk},ik={partial:!0,tokenize:ok};function lk(e){return rm(e),e}function sk(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?l(a):K(a)?e.check(ik,s,l)(a):(e.consume(a),i)}function l(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function s(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function ok(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),fe(e,l,"linePrefix")}function l(s){if(s===null||K(s))return n(s);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function im(e,t,n,r,i,l,s,a,u){const d=u||Number.POSITIVE_INFINITY;let c=0;return f;function f(y){return y===60?(e.enter(r),e.enter(i),e.enter(l),e.consume(y),e.exit(l),h):y===null||y===32||y===41||Xl(y)?n(y):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),x(y))}function h(y){return y===62?(e.enter(l),e.consume(y),e.exit(l),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===62?(e.exit("chunkString"),e.exit(a),h(y)):y===null||y===60||K(y)?n(y):(e.consume(y),y===92?g:p)}function g(y){return y===60||y===62||y===92?(e.consume(y),p):p(y)}function x(y){return!c&&(y===null||y===41||ve(y))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(y)):c<d&&y===40?(e.consume(y),c++,x):y===41?(e.consume(y),c--,x):y===null||y===32||y===40||Xl(y)?n(y):(e.consume(y),y===92?C:x)}function C(y){return y===40||y===41||y===92?(e.consume(y),x):x(y)}}function lm(e,t,n,r,i,l){const s=this;let a=0,u;return d;function d(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(l),c}function c(p){return a>999||p===null||p===91||p===93&&!u||p===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(p):p===93?(e.exit(l),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):K(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===null||p===91||p===93||K(p)||a++>999?(e.exit("chunkString"),c(p)):(e.consume(p),u||(u=!ae(p)),p===92?h:f)}function h(p){return p===91||p===92||p===93?(e.consume(p),a++,f):f(p)}}function sm(e,t,n,r,i,l){let s;return a;function a(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),s=h===40?41:h,u):n(h)}function u(h){return h===s?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(l),d(h))}function d(h){return h===s?(e.exit(l),u(s)):h===null?n(h):K(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),fe(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(h))}function c(h){return h===s||h===null||K(h)?(e.exit("chunkString"),d(h)):(e.consume(h),h===92?f:c)}function f(h){return h===s||h===92?(e.consume(h),c):c(h)}}function si(e,t){let n;return r;function r(i){return K(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):ae(i)?fe(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const ak={name:"definition",tokenize:ck},uk={partial:!0,tokenize:dk};function ck(e,t,n){const r=this;let i;return l;function l(p){return e.enter("definition"),s(p)}function s(p){return lm.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return i=Pt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),u):n(p)}function u(p){return ve(p)?si(e,d)(p):d(p)}function d(p){return im(e,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function c(p){return e.attempt(uk,f,f)(p)}function f(p){return ae(p)?fe(e,h,"whitespace")(p):h(p)}function h(p){return p===null||K(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function dk(e,t,n){return r;function r(a){return ve(a)?si(e,i)(a):n(a)}function i(a){return sm(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function l(a){return ae(a)?fe(e,s,"whitespace")(a):s(a)}function s(a){return a===null||K(a)?t(a):n(a)}}const fk={name:"hardBreakEscape",tokenize:pk};function pk(e,t,n){return r;function r(l){return e.enter("hardBreakEscape"),e.consume(l),i}function i(l){return K(l)?(e.exit("hardBreakEscape"),t(l)):n(l)}}const hk={name:"headingAtx",resolve:mk,tokenize:gk};function mk(e,t){let n=e.length-2,r=3,i,l;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},l={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},pt(e,r,n-r+1,[["enter",i,t],["enter",l,t],["exit",l,t],["exit",i,t]])),e}function gk(e,t,n){let r=0;return i;function i(c){return e.enter("atxHeading"),l(c)}function l(c){return e.enter("atxHeadingSequence"),s(c)}function s(c){return c===35&&r++<6?(e.consume(c),s):c===null||ve(c)?(e.exit("atxHeadingSequence"),a(c)):n(c)}function a(c){return c===35?(e.enter("atxHeadingSequence"),u(c)):c===null||K(c)?(e.exit("atxHeading"),t(c)):ae(c)?fe(e,a,"whitespace")(c):(e.enter("atxHeadingText"),d(c))}function u(c){return c===35?(e.consume(c),u):(e.exit("atxHeadingSequence"),a(c))}function d(c){return c===null||c===35||ve(c)?(e.exit("atxHeadingText"),a(c)):(e.consume(c),d)}}const yk=["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"],zd=["pre","script","style","textarea"],xk={concrete:!0,name:"htmlFlow",resolveTo:wk,tokenize:bk},vk={partial:!0,tokenize:jk},kk={partial:!0,tokenize:Sk};function wk(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function bk(e,t,n){const r=this;let i,l,s,a,u;return d;function d(S){return c(S)}function c(S){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(S),f}function f(S){return S===33?(e.consume(S),h):S===47?(e.consume(S),l=!0,x):S===63?(e.consume(S),i=3,r.interrupt?t:b):Ke(S)?(e.consume(S),s=String.fromCharCode(S),C):n(S)}function h(S){return S===45?(e.consume(S),i=2,p):S===91?(e.consume(S),i=5,a=0,g):Ke(S)?(e.consume(S),i=4,r.interrupt?t:b):n(S)}function p(S){return S===45?(e.consume(S),r.interrupt?t:b):n(S)}function g(S){const ge="CDATA[";return S===ge.charCodeAt(a++)?(e.consume(S),a===ge.length?r.interrupt?t:A:g):n(S)}function x(S){return Ke(S)?(e.consume(S),s=String.fromCharCode(S),C):n(S)}function C(S){if(S===null||S===47||S===62||ve(S)){const ge=S===47,Le=s.toLowerCase();return!ge&&!l&&zd.includes(Le)?(i=1,r.interrupt?t(S):A(S)):yk.includes(s.toLowerCase())?(i=6,ge?(e.consume(S),y):r.interrupt?t(S):A(S)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(S):l?m(S):v(S))}return S===45||We(S)?(e.consume(S),s+=String.fromCharCode(S),C):n(S)}function y(S){return S===62?(e.consume(S),r.interrupt?t:A):n(S)}function m(S){return ae(S)?(e.consume(S),m):w(S)}function v(S){return S===47?(e.consume(S),w):S===58||S===95||Ke(S)?(e.consume(S),N):ae(S)?(e.consume(S),v):w(S)}function N(S){return S===45||S===46||S===58||S===95||We(S)?(e.consume(S),N):P(S)}function P(S){return S===61?(e.consume(S),j):ae(S)?(e.consume(S),P):v(S)}function j(S){return S===null||S===60||S===61||S===62||S===96?n(S):S===34||S===39?(e.consume(S),u=S,I):ae(S)?(e.consume(S),j):L(S)}function I(S){return S===u?(e.consume(S),u=null,T):S===null||K(S)?n(S):(e.consume(S),I)}function L(S){return S===null||S===34||S===39||S===47||S===60||S===61||S===62||S===96||ve(S)?P(S):(e.consume(S),L)}function T(S){return S===47||S===62||ae(S)?v(S):n(S)}function w(S){return S===62?(e.consume(S),z):n(S)}function z(S){return S===null||K(S)?A(S):ae(S)?(e.consume(S),z):n(S)}function A(S){return S===45&&i===2?(e.consume(S),he):S===60&&i===1?(e.consume(S),ne):S===62&&i===4?(e.consume(S),Y):S===63&&i===3?(e.consume(S),b):S===93&&i===5?(e.consume(S),V):K(S)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(vk,ie,H)(S)):S===null||K(S)?(e.exit("htmlFlowData"),H(S)):(e.consume(S),A)}function H(S){return e.check(kk,$,ie)(S)}function $(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),Q}function Q(S){return S===null||K(S)?H(S):(e.enter("htmlFlowData"),A(S))}function he(S){return S===45?(e.consume(S),b):A(S)}function ne(S){return S===47?(e.consume(S),s="",R):A(S)}function R(S){if(S===62){const ge=s.toLowerCase();return zd.includes(ge)?(e.consume(S),Y):A(S)}return Ke(S)&&s.length<8?(e.consume(S),s+=String.fromCharCode(S),R):A(S)}function V(S){return S===93?(e.consume(S),b):A(S)}function b(S){return S===62?(e.consume(S),Y):S===45&&i===2?(e.consume(S),b):A(S)}function Y(S){return S===null||K(S)?(e.exit("htmlFlowData"),ie(S)):(e.consume(S),Y)}function ie(S){return e.exit("htmlFlow"),t(S)}}function Sk(e,t,n){const r=this;return i;function i(s){return K(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),l):n(s)}function l(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function jk(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Ai,t,n)}}const Ck={name:"htmlText",tokenize:Nk};function Nk(e,t,n){const r=this;let i,l,s;return a;function a(b){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(b),u}function u(b){return b===33?(e.consume(b),d):b===47?(e.consume(b),P):b===63?(e.consume(b),v):Ke(b)?(e.consume(b),L):n(b)}function d(b){return b===45?(e.consume(b),c):b===91?(e.consume(b),l=0,g):Ke(b)?(e.consume(b),m):n(b)}function c(b){return b===45?(e.consume(b),p):n(b)}function f(b){return b===null?n(b):b===45?(e.consume(b),h):K(b)?(s=f,ne(b)):(e.consume(b),f)}function h(b){return b===45?(e.consume(b),p):f(b)}function p(b){return b===62?he(b):b===45?h(b):f(b)}function g(b){const Y="CDATA[";return b===Y.charCodeAt(l++)?(e.consume(b),l===Y.length?x:g):n(b)}function x(b){return b===null?n(b):b===93?(e.consume(b),C):K(b)?(s=x,ne(b)):(e.consume(b),x)}function C(b){return b===93?(e.consume(b),y):x(b)}function y(b){return b===62?he(b):b===93?(e.consume(b),y):x(b)}function m(b){return b===null||b===62?he(b):K(b)?(s=m,ne(b)):(e.consume(b),m)}function v(b){return b===null?n(b):b===63?(e.consume(b),N):K(b)?(s=v,ne(b)):(e.consume(b),v)}function N(b){return b===62?he(b):v(b)}function P(b){return Ke(b)?(e.consume(b),j):n(b)}function j(b){return b===45||We(b)?(e.consume(b),j):I(b)}function I(b){return K(b)?(s=I,ne(b)):ae(b)?(e.consume(b),I):he(b)}function L(b){return b===45||We(b)?(e.consume(b),L):b===47||b===62||ve(b)?T(b):n(b)}function T(b){return b===47?(e.consume(b),he):b===58||b===95||Ke(b)?(e.consume(b),w):K(b)?(s=T,ne(b)):ae(b)?(e.consume(b),T):he(b)}function w(b){return b===45||b===46||b===58||b===95||We(b)?(e.consume(b),w):z(b)}function z(b){return b===61?(e.consume(b),A):K(b)?(s=z,ne(b)):ae(b)?(e.consume(b),z):T(b)}function A(b){return b===null||b===60||b===61||b===62||b===96?n(b):b===34||b===39?(e.consume(b),i=b,H):K(b)?(s=A,ne(b)):ae(b)?(e.consume(b),A):(e.consume(b),$)}function H(b){return b===i?(e.consume(b),i=void 0,Q):b===null?n(b):K(b)?(s=H,ne(b)):(e.consume(b),H)}function $(b){return b===null||b===34||b===39||b===60||b===61||b===96?n(b):b===47||b===62||ve(b)?T(b):(e.consume(b),$)}function Q(b){return b===47||b===62||ve(b)?T(b):n(b)}function he(b){return b===62?(e.consume(b),e.exit("htmlTextData"),e.exit("htmlText"),t):n(b)}function ne(b){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),R}function R(b){return ae(b)?fe(e,V,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):V(b)}function V(b){return e.enter("htmlTextData"),s(b)}}const Mu={name:"labelEnd",resolveAll:Ik,resolveTo:Pk,tokenize:Lk},Ek={tokenize:Ak},Tk={tokenize:Dk},zk={tokenize:Mk};function Ik(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&pt(e,0,e.length,n),e}function Pk(e,t){let n=e.length,r=0,i,l,s,a;for(;n--;)if(i=e[n][1],l){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(l=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const u={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[l][1].start},end:{...e[s][1].end}},c={type:"labelText",start:{...e[l+r+2][1].end},end:{...e[s-2][1].start}};return a=[["enter",u,t],["enter",d,t]],a=kt(a,e.slice(l+1,l+r+3)),a=kt(a,[["enter",c,t]]),a=kt(a,ks(t.parser.constructs.insideSpan.null,e.slice(l+r+4,s-3),t)),a=kt(a,[["exit",c,t],e[s-2],e[s-1],["exit",d,t]]),a=kt(a,e.slice(s+1)),a=kt(a,[["exit",u,t]]),pt(e,l,e.length,a),e}function Lk(e,t,n){const r=this;let i=r.events.length,l,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){l=r.events[i][1];break}return a;function a(h){return l?l._inactive?f(h):(s=r.parser.defined.includes(Pt(r.sliceSerialize({start:l.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),u):n(h)}function u(h){return h===40?e.attempt(Ek,c,s?c:f)(h):h===91?e.attempt(Tk,c,s?d:f)(h):s?c(h):f(h)}function d(h){return e.attempt(zk,c,f)(h)}function c(h){return t(h)}function f(h){return l._balanced=!0,n(h)}}function Ak(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),i}function i(f){return ve(f)?si(e,l)(f):l(f)}function l(f){return f===41?c(f):im(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function s(f){return ve(f)?si(e,u)(f):c(f)}function a(f){return n(f)}function u(f){return f===34||f===39||f===40?sm(e,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):c(f)}function d(f){return ve(f)?si(e,c)(f):c(f)}function c(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function Dk(e,t,n){const r=this;return i;function i(a){return lm.call(r,e,l,s,"reference","referenceMarker","referenceString")(a)}function l(a){return r.parser.defined.includes(Pt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function Mk(e,t,n){return r;function r(l){return e.enter("reference"),e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),i}function i(l){return l===93?(e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),e.exit("reference"),t):n(l)}}const Rk={name:"labelStartImage",resolveAll:Mu.resolveAll,tokenize:_k};function _k(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),l}function l(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),s):n(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const Ok={name:"labelStartLink",resolveAll:Mu.resolveAll,tokenize:Fk};function Fk(e,t,n){const r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),l}function l(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const lo={name:"lineEnding",tokenize:$k};function $k(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),fe(e,t,"linePrefix")}}const kl={name:"thematicBreak",tokenize:Bk};function Bk(e,t,n){let r=0,i;return l;function l(d){return e.enter("thematicBreak"),s(d)}function s(d){return i=d,a(d)}function a(d){return d===i?(e.enter("thematicBreakSequence"),u(d)):r>=3&&(d===null||K(d))?(e.exit("thematicBreak"),t(d)):n(d)}function u(d){return d===i?(e.consume(d),r++,u):(e.exit("thematicBreakSequence"),ae(d)?fe(e,a,"whitespace")(d):a(d))}}const tt={continuation:{tokenize:Wk},exit:Qk,name:"list",tokenize:Vk},Uk={partial:!0,tokenize:Yk},Hk={partial:!0,tokenize:qk};function Vk(e,t,n){const r=this,i=r.events[r.events.length-1];let l=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(p){const g=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:wa(p)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(kl,n,d)(p):d(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(p)}return n(p)}function u(p){return wa(p)&&++s<10?(e.consume(p),u):(!r.interrupt||s<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),d(p)):n(p)}function d(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(Ai,r.interrupt?n:c,e.attempt(Uk,h,f))}function c(p){return r.containerState.initialBlankLine=!0,l++,h(p)}function f(p){return ae(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return r.containerState.size=l+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function Wk(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Ai,i,l);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,fe(e,t,"listItemIndent",r.containerState.size+1)(a)}function l(a){return r.containerState.furtherBlankLines||!ae(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Hk,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,fe(e,e.attempt(tt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function qk(e,t,n){const r=this;return fe(e,i,"listItemIndent",r.containerState.size+1);function i(l){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(l):n(l)}}function Qk(e){e.exit(this.containerState.type)}function Yk(e,t,n){const r=this;return fe(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(l){const s=r.events[r.events.length-1];return!ae(l)&&s&&s[1].type==="listItemPrefixWhitespace"?t(l):n(l)}}const Id={name:"setextUnderline",resolveTo:Kk,tokenize:Gk};function Kk(e,t){let n=e.length,r,i,l;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!l&&e[n][1].type==="definition"&&(l=n);const s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",l?(e.splice(i,0,["enter",s,t]),e.splice(l+1,0,["exit",e[r][1],t]),e[r][1].end={...e[l][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function Gk(e,t,n){const r=this;let i;return l;function l(d){let c=r.events.length,f;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){f=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=d,s(d)):n(d)}function s(d){return e.enter("setextHeadingLineSequence"),a(d)}function a(d){return d===i?(e.consume(d),a):(e.exit("setextHeadingLineSequence"),ae(d)?fe(e,u,"lineSuffix")(d):u(d))}function u(d){return d===null||K(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const Xk={tokenize:Zk};function Zk(e){const t=this,n=e.attempt(Ai,r,e.attempt(this.parser.constructs.flowInitial,i,fe(e,e.attempt(this.parser.constructs.flow,i,e.attempt(rk,i)),"linePrefix")));return n;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Jk={resolveAll:am()},e0=om("string"),t0=om("text");function om(e){return{resolveAll:am(e==="text"?n0:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],l=n.attempt(i,s,a);return s;function s(c){return d(c)?l(c):a(c)}function a(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),u}function u(c){return d(c)?(n.exit("data"),l(c)):(n.consume(c),u)}function d(c){if(c===null)return!0;const f=i[c];let h=-1;if(f)for(;++h<f.length;){const p=f[h];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function am(e){return t;function t(n,r){let i=-1,l;for(;++i<=n.length;)l===void 0?n[i]&&n[i][1].type==="data"&&(l=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==l+2&&(n[l][1].end=n[i-1][1].end,n.splice(l+2,i-l-2),i=l+2),l=void 0);return e?e(n,r):n}}function n0(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let l=i.length,s=-1,a=0,u;for(;l--;){const d=i[l];if(typeof d=="string"){for(s=d.length;d.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(d===-2)u=!0,a++;else if(d!==-1){l++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const d={type:n===e.length||u||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?s:r.start._bufferIndex+s,_index:r.start._index+l,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...d.start},r.start.offset===r.end.offset?Object.assign(r,d):(e.splice(n,0,["enter",d,t],["exit",d,t]),n+=2)}n++}return e}const r0={42:tt,43:tt,45:tt,48:tt,49:tt,50:tt,51:tt,52:tt,53:tt,54:tt,55:tt,56:tt,57:tt,62:em},i0={91:ak},l0={[-2]:io,[-1]:io,32:io},s0={35:hk,42:kl,45:[Id,kl],60:xk,61:Id,95:kl,96:Td,126:Td},o0={38:nm,92:tm},a0={[-5]:lo,[-4]:lo,[-3]:lo,33:Rk,38:nm,42:ba,60:[Ov,Ck],91:Ok,92:[fk,tm],93:Mu,95:ba,96:Xv},u0={null:[ba,Jk]},c0={null:[42,95]},d0={null:[]},f0=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:c0,contentInitial:i0,disable:d0,document:r0,flow:s0,flowInitial:l0,insideSpan:u0,string:o0,text:a0},Symbol.toStringTag,{value:"Module"}));function p0(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},l=[];let s=[],a=[];const u={attempt:I(P),check:I(j),consume:m,enter:v,exit:N,interrupt:I(j,{interrupt:!0})},d={code:null,containerState:{},defineSkip:x,events:[],now:g,parser:e,previous:null,sliceSerialize:h,sliceStream:p,write:f};let c=t.tokenize.call(d,u);return t.resolveAll&&l.push(t),d;function f(z){return s=kt(s,z),C(),s[s.length-1]!==null?[]:(L(t,0),d.events=ks(l,d.events,d),d.events)}function h(z,A){return m0(p(z),A)}function p(z){return h0(s,z)}function g(){const{_bufferIndex:z,_index:A,line:H,column:$,offset:Q}=r;return{_bufferIndex:z,_index:A,line:H,column:$,offset:Q}}function x(z){i[z.line]=z.column,w()}function C(){let z;for(;r._index<s.length;){const A=s[r._index];if(typeof A=="string")for(z=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===z&&r._bufferIndex<A.length;)y(A.charCodeAt(r._bufferIndex));else y(A)}}function y(z){c=c(z)}function m(z){K(z)?(r.line++,r.column=1,r.offset+=z===-3?2:1,w()):z!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=z}function v(z,A){const H=A||{};return H.type=z,H.start=g(),d.events.push(["enter",H,d]),a.push(H),H}function N(z){const A=a.pop();return A.end=g(),d.events.push(["exit",A,d]),A}function P(z,A){L(z,A.from)}function j(z,A){A.restore()}function I(z,A){return H;function H($,Q,he){let ne,R,V,b;return Array.isArray($)?ie($):"tokenize"in $?ie([$]):Y($);function Y(oe){return Ce;function Ce(U){const ee=U!==null&&oe[U],re=U!==null&&oe.null,be=[...Array.isArray(ee)?ee:ee?[ee]:[],...Array.isArray(re)?re:re?[re]:[]];return ie(be)(U)}}function ie(oe){return ne=oe,R=0,oe.length===0?he:S(oe[R])}function S(oe){return Ce;function Ce(U){return b=T(),V=oe,oe.partial||(d.currentConstruct=oe),oe.name&&d.parser.constructs.disable.null.includes(oe.name)?Le():oe.tokenize.call(A?Object.assign(Object.create(d),A):d,u,ge,Le)(U)}}function ge(oe){return z(V,b),Q}function Le(oe){return b.restore(),++R<ne.length?S(ne[R]):he}}}function L(z,A){z.resolveAll&&!l.includes(z)&&l.push(z),z.resolve&&pt(d.events,A,d.events.length-A,z.resolve(d.events.slice(A),d)),z.resolveTo&&(d.events=z.resolveTo(d.events,d))}function T(){const z=g(),A=d.previous,H=d.currentConstruct,$=d.events.length,Q=Array.from(a);return{from:$,restore:he};function he(){r=z,d.previous=A,d.currentConstruct=H,d.events.length=$,a=Q,w()}}function w(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function h0(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,l=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(r,l)];else{if(s=e.slice(n,i),r>-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}l>0&&s.push(e[i].slice(0,l))}return s}function m0(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const l=e[n];let s;if(typeof l=="string")s=l;else switch(l){case-5:{s="\r";break}case-4:{s=`
312
- `;break}case-3:{s=`\r
313
- `;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(l)}i=l===-2,r.push(s)}return r.join("")}function g0(e){const r={constructs:Zh([f0,...(e||{}).extensions||[]]),content:i(Pv),defined:[],document:i(Av),flow:i(Xk),lazy:{},string:i(e0),text:i(t0)};return r;function i(l){return s;function s(a){return p0(r,l,a)}}}function y0(e){for(;!rm(e););return e}const Pd=/[\0\t\n\r]/g;function x0(){let e=1,t="",n=!0,r;return i;function i(l,s,a){const u=[];let d,c,f,h,p;for(l=t+(typeof l=="string"?l.toString():new TextDecoder(s||void 0).decode(l)),f=0,t="",n&&(l.charCodeAt(0)===65279&&f++,n=void 0);f<l.length;){if(Pd.lastIndex=f,d=Pd.exec(l),h=d&&d.index!==void 0?d.index:l.length,p=l.charCodeAt(h),!d){t=l.slice(f);break}if(p===10&&f===h&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),f<h&&(u.push(l.slice(f,h)),e+=h-f),p){case 0:{u.push(65533),e++;break}case 9:{for(c=Math.ceil(e/4)*4,u.push(-2);e++<c;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}f=h+1}return a&&(r&&u.push(-5),t&&u.push(t),u.push(null)),u}}const v0=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function k0(e){return e.replace(v0,w0)}function w0(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),l=i===120||i===88;return Jh(n.slice(l?2:1),l?16:10)}return Du(n)||e}const um={}.hasOwnProperty;function b0(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),S0(n)(y0(g0(n).document().write(x0()(e,t,!0))))}function S0(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(_i),autolinkProtocol:T,autolinkEmail:T,atxHeading:l(Gn),blockQuote:l(re),characterEscape:T,characterReference:T,codeFenced:l(be),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:l(be,s),codeText:l(Mt,s),codeTextData:T,data:T,codeFlowValue:T,definition:l(tn),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:l(Nn),hardBreakEscape:l(Mi),hardBreakTrailing:l(Mi),htmlFlow:l(Ri,s),htmlFlowData:T,htmlText:l(Ri,s),htmlTextData:T,image:l(js),label:s,link:l(_i),listItem:l(Cs),listItemValue:h,listOrdered:l(Oi,f),listUnordered:l(Oi),paragraph:l(Ns),reference:S,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:l(Gn),strong:l(Es),thematicBreak:l(zs)},exit:{atxHeading:u(),atxHeadingSequence:P,autolink:u(),autolinkEmail:ee,autolinkProtocol:U,blockQuote:u(),characterEscapeValue:w,characterReferenceMarkerHexadecimal:Le,characterReferenceMarkerNumeric:Le,characterReferenceValue:oe,characterReference:Ce,codeFenced:u(C),codeFencedFence:x,codeFencedFenceInfo:p,codeFencedFenceMeta:g,codeFlowValue:w,codeIndented:u(y),codeText:u(Q),codeTextData:w,data:w,definition:u(),definitionDestinationString:N,definitionLabelString:m,definitionTitleString:v,emphasis:u(),hardBreakEscape:u(A),hardBreakTrailing:u(A),htmlFlow:u(H),htmlFlowData:w,htmlText:u($),htmlTextData:w,image:u(ne),label:V,labelText:R,lineEnding:z,link:u(he),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:ge,resourceDestinationString:b,resourceTitleString:Y,resource:ie,setextHeading:u(L),setextHeadingLineSequence:I,setextHeadingText:j,strong:u(),thematicBreak:u()}};cm(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(D){let E={type:"root",children:[]};const M={stack:[E],tokenStack:[],config:t,enter:a,exit:d,buffer:s,resume:c,data:n},_=[];let B=-1;for(;++B<D.length;)if(D[B][1].type==="listOrdered"||D[B][1].type==="listUnordered")if(D[B][0]==="enter")_.push(B);else{const G=_.pop();B=i(D,G,B)}for(B=-1;++B<D.length;){const G=t[D[B][0]];um.call(G,D[B][1].type)&&G[D[B][1].type].call(Object.assign({sliceSerialize:D[B][2].sliceSerialize},M),D[B][1])}if(M.tokenStack.length>0){const G=M.tokenStack[M.tokenStack.length-1];(G[1]||Ld).call(M,void 0,G[0])}for(E.position={start:rn(D.length>0?D[0][1].start:{line:1,column:1,offset:0}),end:rn(D.length>0?D[D.length-2][1].end:{line:1,column:1,offset:0})},B=-1;++B<t.transforms.length;)E=t.transforms[B](E)||E;return E}function i(D,E,M){let _=E-1,B=-1,G=!1,le,ye,ke,X;for(;++_<=M;){const Z=D[_];switch(Z[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Z[0]==="enter"?B++:B--,X=void 0;break}case"lineEndingBlank":{Z[0]==="enter"&&(le&&!X&&!B&&!ke&&(ke=_),X=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:X=void 0}if(!B&&Z[0]==="enter"&&Z[1].type==="listItemPrefix"||B===-1&&Z[0]==="exit"&&(Z[1].type==="listUnordered"||Z[1].type==="listOrdered")){if(le){let ce=_;for(ye=void 0;ce--;){const de=D[ce];if(de[1].type==="lineEnding"||de[1].type==="lineEndingBlank"){if(de[0]==="exit")continue;ye&&(D[ye][1].type="lineEndingBlank",G=!0),de[1].type="lineEnding",ye=ce}else if(!(de[1].type==="linePrefix"||de[1].type==="blockQuotePrefix"||de[1].type==="blockQuotePrefixWhitespace"||de[1].type==="blockQuoteMarker"||de[1].type==="listItemIndent"))break}ke&&(!ye||ke<ye)&&(le._spread=!0),le.end=Object.assign({},ye?D[ye][1].start:Z[1].end),D.splice(ye||_,0,["exit",le,Z[2]]),_++,M++}if(Z[1].type==="listItemPrefix"){const ce={type:"listItem",_spread:!1,start:Object.assign({},Z[1].start),end:void 0};le=ce,D.splice(_,0,["enter",ce,Z[2]]),_++,M++,ke=void 0,X=!0}}}return D[E][1]._spread=G,M}function l(D,E){return M;function M(_){a.call(this,D(_),_),E&&E.call(this,_)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(D,E,M){this.stack[this.stack.length-1].children.push(D),this.stack.push(D),this.tokenStack.push([E,M||void 0]),D.position={start:rn(E.start),end:void 0}}function u(D){return E;function E(M){D&&D.call(this,M),d.call(this,M)}}function d(D,E){const M=this.stack.pop(),_=this.tokenStack.pop();if(_)_[0].type!==D.type&&(E?E.call(this,D,_[0]):(_[1]||Ld).call(this,D,_[0]));else throw new Error("Cannot close `"+D.type+"` ("+li({start:D.start,end:D.end})+"): it’s not open");M.position.end=rn(D.end)}function c(){return Au(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function h(D){if(this.data.expectingFirstListItemValue){const E=this.stack[this.stack.length-2];E.start=Number.parseInt(this.sliceSerialize(D),10),this.data.expectingFirstListItemValue=void 0}}function p(){const D=this.resume(),E=this.stack[this.stack.length-1];E.lang=D}function g(){const D=this.resume(),E=this.stack[this.stack.length-1];E.meta=D}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const D=this.resume(),E=this.stack[this.stack.length-1];E.value=D.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const D=this.resume(),E=this.stack[this.stack.length-1];E.value=D.replace(/(\r?\n|\r)$/g,"")}function m(D){const E=this.resume(),M=this.stack[this.stack.length-1];M.label=E,M.identifier=Pt(this.sliceSerialize(D)).toLowerCase()}function v(){const D=this.resume(),E=this.stack[this.stack.length-1];E.title=D}function N(){const D=this.resume(),E=this.stack[this.stack.length-1];E.url=D}function P(D){const E=this.stack[this.stack.length-1];if(!E.depth){const M=this.sliceSerialize(D).length;E.depth=M}}function j(){this.data.setextHeadingSlurpLineEnding=!0}function I(D){const E=this.stack[this.stack.length-1];E.depth=this.sliceSerialize(D).codePointAt(0)===61?1:2}function L(){this.data.setextHeadingSlurpLineEnding=void 0}function T(D){const M=this.stack[this.stack.length-1].children;let _=M[M.length-1];(!_||_.type!=="text")&&(_=Ts(),_.position={start:rn(D.start),end:void 0},M.push(_)),this.stack.push(_)}function w(D){const E=this.stack.pop();E.value+=this.sliceSerialize(D),E.position.end=rn(D.end)}function z(D){const E=this.stack[this.stack.length-1];if(this.data.atHardBreak){const M=E.children[E.children.length-1];M.position.end=rn(D.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(E.type)&&(T.call(this,D),w.call(this,D))}function A(){this.data.atHardBreak=!0}function H(){const D=this.resume(),E=this.stack[this.stack.length-1];E.value=D}function $(){const D=this.resume(),E=this.stack[this.stack.length-1];E.value=D}function Q(){const D=this.resume(),E=this.stack[this.stack.length-1];E.value=D}function he(){const D=this.stack[this.stack.length-1];if(this.data.inReference){const E=this.data.referenceType||"shortcut";D.type+="Reference",D.referenceType=E,delete D.url,delete D.title}else delete D.identifier,delete D.label;this.data.referenceType=void 0}function ne(){const D=this.stack[this.stack.length-1];if(this.data.inReference){const E=this.data.referenceType||"shortcut";D.type+="Reference",D.referenceType=E,delete D.url,delete D.title}else delete D.identifier,delete D.label;this.data.referenceType=void 0}function R(D){const E=this.sliceSerialize(D),M=this.stack[this.stack.length-2];M.label=k0(E),M.identifier=Pt(E).toLowerCase()}function V(){const D=this.stack[this.stack.length-1],E=this.resume(),M=this.stack[this.stack.length-1];if(this.data.inReference=!0,M.type==="link"){const _=D.children;M.children=_}else M.alt=E}function b(){const D=this.resume(),E=this.stack[this.stack.length-1];E.url=D}function Y(){const D=this.resume(),E=this.stack[this.stack.length-1];E.title=D}function ie(){this.data.inReference=void 0}function S(){this.data.referenceType="collapsed"}function ge(D){const E=this.resume(),M=this.stack[this.stack.length-1];M.label=E,M.identifier=Pt(this.sliceSerialize(D)).toLowerCase(),this.data.referenceType="full"}function Le(D){this.data.characterReferenceType=D.type}function oe(D){const E=this.sliceSerialize(D),M=this.data.characterReferenceType;let _;M?(_=Jh(E,M==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):_=Du(E);const B=this.stack[this.stack.length-1];B.value+=_}function Ce(D){const E=this.stack.pop();E.position.end=rn(D.end)}function U(D){w.call(this,D);const E=this.stack[this.stack.length-1];E.url=this.sliceSerialize(D)}function ee(D){w.call(this,D);const E=this.stack[this.stack.length-1];E.url="mailto:"+this.sliceSerialize(D)}function re(){return{type:"blockquote",children:[]}}function be(){return{type:"code",lang:null,meta:null,value:""}}function Mt(){return{type:"inlineCode",value:""}}function tn(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Nn(){return{type:"emphasis",children:[]}}function Gn(){return{type:"heading",depth:0,children:[]}}function Mi(){return{type:"break"}}function Ri(){return{type:"html",value:""}}function js(){return{type:"image",title:null,url:"",alt:null}}function _i(){return{type:"link",title:null,url:"",children:[]}}function Oi(D){return{type:"list",ordered:D.type==="listOrdered",start:null,spread:D._spread,children:[]}}function Cs(D){return{type:"listItem",spread:D._spread,checked:null,children:[]}}function Ns(){return{type:"paragraph",children:[]}}function Es(){return{type:"strong",children:[]}}function Ts(){return{type:"text",value:""}}function zs(){return{type:"thematicBreak"}}}function rn(e){return{line:e.line,column:e.column,offset:e.offset}}function cm(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?cm(e,r):j0(e,r)}}function j0(e,t){let n;for(n in t)if(um.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Ld(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+li({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+li({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+li({start:t.start,end:t.end})+") is still open")}function C0(e){const t=this;t.parser=n;function n(r){return b0(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function N0(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function E0(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
314
- `}]}function T0(e,t){const n=t.value?t.value+`
315
- `:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let l={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(l.data={meta:t.meta}),e.patch(t,l),l=e.applyData(t,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(t,l),l}function z0(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function I0(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function P0(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Dr(r.toLowerCase()),l=e.footnoteOrder.indexOf(r);let s,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=l+1,a+=1,e.footnoteCounts.set(r,a);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,u);const d={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,d),e.applyData(t,d)}function L0(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function A0(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function dm(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),l=i[0];l&&l.type==="text"?l.value="["+l.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function D0(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return dm(e,t);const i={src:Dr(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,l),e.applyData(t,l)}function M0(e,t){const n={src:Dr(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function R0(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function _0(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return dm(e,t);const i={href:Dr(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)}function O0(e,t){const n={href:Dr(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function F0(e,t,n){const r=e.all(t),i=n?$0(n):fm(t),l={},s=[];if(typeof t.checked=="boolean"){const c=r[0];let f;c&&c.type==="element"&&c.tagName==="p"?f=c:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const c=r[a];(i||a!==0||c.type!=="element"||c.tagName!=="p")&&s.push({type:"text",value:`
316
- `}),c.type==="element"&&c.tagName==="p"&&!i?s.push(...c.children):s.push(c)}const u=r[r.length-1];u&&(i||u.type!=="element"||u.tagName!=="p")&&s.push({type:"text",value:`
317
- `});const d={type:"element",tagName:"li",properties:l,children:s};return e.patch(t,d),e.applyData(t,d)}function $0(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=fm(n[r])}return t}function fm(e){const t=e.spread;return t??e.children.length>1}function B0(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const s=r[i];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const l={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,l),e.applyData(t,l)}function U0(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function H0(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function V0(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function W0(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=zu(t.children[1]),u=Wh(t.children[t.children.length-1]);a&&u&&(s.position={start:a,end:u}),i.push(s)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,l),e.applyData(t,l)}function q0(e,t,n){const r=n?n.children:void 0,l=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,a=s?s.length:t.children.length;let u=-1;const d=[];for(;++u<a;){const f=t.children[u],h={},p=s?s[u]:void 0;p&&(h.align=p);let g={type:"element",tagName:l,properties:h,children:[]};f&&(g.children=e.all(f),e.patch(f,g),g=e.applyData(f,g)),d.push(g)}const c={type:"element",tagName:"tr",properties:{},children:e.wrap(d,!0)};return e.patch(t,c),e.applyData(t,c)}function Q0(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Ad=9,Dd=32;function Y0(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const l=[];for(;r;)l.push(Md(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return l.push(Md(t.slice(i),i>0,!1)),l.join("")}function Md(e,t,n){let r=0,i=e.length;if(t){let l=e.codePointAt(r);for(;l===Ad||l===Dd;)r++,l=e.codePointAt(r)}if(n){let l=e.codePointAt(i-1);for(;l===Ad||l===Dd;)i--,l=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function K0(e,t){const n={type:"text",value:Y0(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function G0(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const X0={blockquote:N0,break:E0,code:T0,delete:z0,emphasis:I0,footnoteReference:P0,heading:L0,html:A0,imageReference:D0,image:M0,inlineCode:R0,linkReference:_0,link:O0,listItem:F0,list:B0,paragraph:U0,root:H0,strong:V0,table:W0,tableCell:Q0,tableRow:q0,text:K0,thematicBreak:G0,toml:nl,yaml:nl,definition:nl,footnoteDefinition:nl};function nl(){}const pm=-1,ws=0,oi=1,Zl=2,Ru=3,_u=4,Ou=5,Fu=6,hm=7,mm=8,Z0=typeof self=="object"?self:globalThis,Rd=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new Z0[e](t)},J0=(e,t)=>{const n=(i,l)=>(e.set(l,i),i),r=i=>{if(e.has(i))return e.get(i);const[l,s]=t[i];switch(l){case ws:case pm:return n(s,i);case oi:{const a=n([],i);for(const u of s)a.push(r(u));return a}case Zl:{const a=n({},i);for(const[u,d]of s)a[r(u)]=r(d);return a}case Ru:return n(new Date(s),i);case _u:{const{source:a,flags:u}=s;return n(new RegExp(a,u),i)}case Ou:{const a=n(new Map,i);for(const[u,d]of s)a.set(r(u),r(d));return a}case Fu:{const a=n(new Set,i);for(const u of s)a.add(r(u));return a}case hm:{const{name:a,message:u}=s;return n(Rd(a,u),i)}case mm:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:a}=new Uint8Array(s);return n(new DataView(a),s)}}return n(Rd(l,s),i)};return r},_d=e=>J0(new Map,e)(0),In="",{toString:ew}={},{keys:tw}=Object,Vr=e=>{const t=typeof e;if(t!=="object"||!e)return[ws,t];const n=ew.call(e).slice(8,-1);switch(n){case"Array":return[oi,In];case"Object":return[Zl,In];case"Date":return[Ru,In];case"RegExp":return[_u,In];case"Map":return[Ou,In];case"Set":return[Fu,In];case"DataView":return[oi,n]}return n.includes("Array")?[oi,n]:n.includes("Error")?[hm,n]:[Zl,n]},rl=([e,t])=>e===ws&&(t==="function"||t==="symbol"),nw=(e,t,n,r)=>{const i=(s,a)=>{const u=r.push(s)-1;return n.set(a,u),u},l=s=>{if(n.has(s))return n.get(s);let[a,u]=Vr(s);switch(a){case ws:{let c=s;switch(u){case"bigint":a=mm,c=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);c=null;break;case"undefined":return i([pm],s)}return i([a,c],s)}case oi:{if(u){let h=s;return u==="DataView"?h=new Uint8Array(s.buffer):u==="ArrayBuffer"&&(h=new Uint8Array(s)),i([u,[...h]],s)}const c=[],f=i([a,c],s);for(const h of s)c.push(l(h));return f}case Zl:{if(u)switch(u){case"BigInt":return i([u,s.toString()],s);case"Boolean":case"Number":case"String":return i([u,s.valueOf()],s)}if(t&&"toJSON"in s)return l(s.toJSON());const c=[],f=i([a,c],s);for(const h of tw(s))(e||!rl(Vr(s[h])))&&c.push([l(h),l(s[h])]);return f}case Ru:return i([a,isNaN(s.getTime())?In:s.toISOString()],s);case _u:{const{source:c,flags:f}=s;return i([a,{source:c,flags:f}],s)}case Ou:{const c=[],f=i([a,c],s);for(const[h,p]of s)(e||!(rl(Vr(h))||rl(Vr(p))))&&c.push([l(h),l(p)]);return f}case Fu:{const c=[],f=i([a,c],s);for(const h of s)(e||!rl(Vr(h)))&&c.push(l(h));return f}}const{message:d}=s;return i([a,{name:u,message:d}],s)};return l},Od=(e,{json:t,lossy:n}={})=>{const r=[];return nw(!(t||n),!!t,new Map,r)(e),r},Jl=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?_d(Od(e,t)):structuredClone(e):(e,t)=>_d(Od(e,t));function rw(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function iw(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function lw(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||rw,r=e.options.footnoteBackLabel||iw,i=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let u=-1;for(;++u<e.footnoteOrder.length;){const d=e.footnoteById.get(e.footnoteOrder[u]);if(!d)continue;const c=e.all(d),f=String(d.identifier).toUpperCase(),h=Dr(f.toLowerCase());let p=0;const g=[],x=e.footnoteCounts.get(f);for(;x!==void 0&&++p<=x;){g.length>0&&g.push({type:"text",value:" "});let m=typeof n=="string"?n:n(u,p);typeof m=="string"&&(m={type:"text",value:m}),g.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,p),className:["data-footnote-backref"]},children:Array.isArray(m)?m:[m]})}const C=c[c.length-1];if(C&&C.type==="element"&&C.tagName==="p"){const m=C.children[C.children.length-1];m&&m.type==="text"?m.value+=" ":C.children.push({type:"text",value:" "}),C.children.push(...g)}else c.push(...g);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(c,!0)};e.patch(d,y),a.push(y)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...Jl(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
318
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
319
- `}]}}const bs=function(e){if(e==null)return uw;if(typeof e=="function")return Ss(e);if(typeof e=="object")return Array.isArray(e)?sw(e):ow(e);if(typeof e=="string")return aw(e);throw new Error("Expected function, string, or object as test")};function sw(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=bs(e[n]);return Ss(r);function r(...i){let l=-1;for(;++l<t.length;)if(t[l].apply(this,i))return!0;return!1}}function ow(e){const t=e;return Ss(n);function n(r){const i=r;let l;for(l in e)if(i[l]!==t[l])return!1;return!0}}function aw(e){return Ss(t);function t(n){return n&&n.type===e}}function Ss(e){return t;function t(n,r,i){return!!(cw(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function uw(){return!0}function cw(e){return e!==null&&typeof e=="object"&&"type"in e}const gm=[],dw=!0,Sa=!1,fw="skip";function ym(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const l=bs(i),s=r?-1:1;a(e,void 0,[])();function a(u,d,c){const f=u&&typeof u=="object"?u:{};if(typeof f.type=="string"){const p=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(u.type+(p?"<"+p+">":""))+")"})}return h;function h(){let p=gm,g,x,C;if((!t||l(u,d,c[c.length-1]||void 0))&&(p=pw(n(u,c)),p[0]===Sa))return p;if("children"in u&&u.children){const y=u;if(y.children&&p[0]!==fw)for(x=(r?y.children.length:-1)+s,C=c.concat(y);x>-1&&x<y.children.length;){const m=y.children[x];if(g=a(m,x,C)(),g[0]===Sa)return g;x=typeof g[1]=="number"?g[1]:x+s}}return p}}}function pw(e){return Array.isArray(e)?e:typeof e=="number"?[dw,e]:e==null?gm:[e]}function $u(e,t,n,r){let i,l,s;typeof t=="function"&&typeof n!="function"?(l=void 0,s=t,i=n):(l=t,s=n,i=r),ym(e,l,a,i);function a(u,d){const c=d[d.length-1],f=c?c.children.indexOf(u):void 0;return s(u,f,c)}}const ja={}.hasOwnProperty,hw={};function mw(e,t){const n=t||hw,r=new Map,i=new Map,l=new Map,s={...X0,...n.handlers},a={all:d,applyData:yw,definitionById:r,footnoteById:i,footnoteCounts:l,footnoteOrder:[],handlers:s,one:u,options:n,patch:gw,wrap:vw};return $u(e,function(c){if(c.type==="definition"||c.type==="footnoteDefinition"){const f=c.type==="definition"?r:i,h=String(c.identifier).toUpperCase();f.has(h)||f.set(h,c)}}),a;function u(c,f){const h=c.type,p=a.handlers[h];if(ja.call(a.handlers,h)&&p)return p(a,c,f);if(a.options.passThrough&&a.options.passThrough.includes(h)){if("children"in c){const{children:x,...C}=c,y=Jl(C);return y.children=a.all(c),y}return Jl(c)}return(a.options.unknownHandler||xw)(a,c,f)}function d(c){const f=[];if("children"in c){const h=c.children;let p=-1;for(;++p<h.length;){const g=a.one(h[p],c);if(g){if(p&&h[p-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=Fd(g.value)),!Array.isArray(g)&&g.type==="element")){const x=g.children[0];x&&x.type==="text"&&(x.value=Fd(x.value))}Array.isArray(g)?f.push(...g):f.push(g)}}}return f}}function gw(e,t){e.position&&(t.position=rv(e))}function yw(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,l=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&l&&Object.assign(n.properties,Jl(l)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function xw(e,t){const n=t.data||{},r="value"in t&&!(ja.call(n,"hProperties")||ja.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function vw(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
320
- `});++r<e.length;)r&&n.push({type:"text",value:`
321
- `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
322
- `}),n}function Fd(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function $d(e,t){const n=mw(e,t),r=n.one(e,void 0),i=lw(n),l=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&l.children.push({type:"text",value:`
323
- `},i),l}function kw(e,t){return e&&"run"in e?async function(n,r){const i=$d(n,{file:r,...t});await e.run(i,r)}:function(n,r){return $d(n,{file:r,...e||t})}}function Bd(e){if(e)throw e}var wl=Object.prototype.hasOwnProperty,xm=Object.prototype.toString,Ud=Object.defineProperty,Hd=Object.getOwnPropertyDescriptor,Vd=function(t){return typeof Array.isArray=="function"?Array.isArray(t):xm.call(t)==="[object Array]"},Wd=function(t){if(!t||xm.call(t)!=="[object Object]")return!1;var n=wl.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&wl.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||wl.call(t,i)},qd=function(t,n){Ud&&n.name==="__proto__"?Ud(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Qd=function(t,n){if(n==="__proto__")if(wl.call(t,n)){if(Hd)return Hd(t,n).value}else return;return t[n]},ww=function e(){var t,n,r,i,l,s,a=arguments[0],u=1,d=arguments.length,c=!1;for(typeof a=="boolean"&&(c=a,a=arguments[1]||{},u=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});u<d;++u)if(t=arguments[u],t!=null)for(n in t)r=Qd(a,n),i=Qd(t,n),a!==i&&(c&&i&&(Wd(i)||(l=Vd(i)))?(l?(l=!1,s=r&&Vd(r)?r:[]):s=r&&Wd(r)?r:{},qd(a,{name:n,newValue:e(c,s,i)})):typeof i<"u"&&qd(a,{name:n,newValue:i}));return a};const so=Ta(ww);function Ca(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function bw(){const e=[],t={run:n,use:r};return t;function n(...i){let l=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...i);function a(u,...d){const c=e[++l];let f=-1;if(u){s(u);return}for(;++f<i.length;)(d[f]===null||d[f]===void 0)&&(d[f]=i[f]);i=d,c?Sw(c,a)(...d):s(null,...d)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function Sw(e,t){let n;return r;function r(...s){const a=e.length>s.length;let u;a&&s.push(i);try{u=e.apply(this,s)}catch(d){const c=d;if(a&&n)throw c;return i(c)}a||(u&&u.then&&typeof u.then=="function"?u.then(l,i):u instanceof Error?i(u):l(u))}function i(s,...a){n||(n=!0,t(s,...a))}function l(s){i(null,s)}}const Ot={basename:jw,dirname:Cw,extname:Nw,join:Ew,sep:"/"};function jw(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Di(e);let n=0,r=-1,i=e.length,l;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(l){n=i+1;break}}else r<0&&(l=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(l){n=i+1;break}}else s<0&&(l=!0,s=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function Cw(e){if(Di(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Nw(e){Di(e);let t=e.length,n=-1,r=0,i=-1,l=0,s;for(;t--;){const a=e.codePointAt(t);if(a===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),a===46?i<0?i=t:l!==1&&(l=1):i>-1&&(l=-1)}return i<0||n<0||l===0||l===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function Ew(...e){let t=-1,n;for(;++t<e.length;)Di(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Tw(n)}function Tw(e){Di(e);const t=e.codePointAt(0)===47;let n=zw(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function zw(e,t){let n="",r=0,i=-1,l=0,s=-1,a,u;for(;++s<=e.length;){if(s<e.length)a=e.codePointAt(s);else{if(a===47)break;a=47}if(a===47){if(!(i===s-1||l===1))if(i!==s-1&&l===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=s,l=0;continue}}else if(n.length>0){n="",r=0,i=s,l=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,l=0}else a===46&&l>-1?l++:l=-1}return n}function Di(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Iw={cwd:Pw};function Pw(){return"/"}function Na(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Lw(e){if(typeof e=="string")e=new URL(e);else if(!Na(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Aw(e)}function Aw(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const oo=["history","path","basename","stem","extname","dirname"];class vm{constructor(t){let n;t?Na(t)?n={path:t}:typeof t=="string"||Dw(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Iw.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<oo.length;){const l=oo[r];l in n&&n[l]!==void 0&&n[l]!==null&&(this[l]=l==="history"?[...n[l]]:n[l])}let i;for(i in n)oo.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Ot.basename(this.path):void 0}set basename(t){uo(t,"basename"),ao(t,"basename"),this.path=Ot.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Ot.dirname(this.path):void 0}set dirname(t){Yd(this.basename,"dirname"),this.path=Ot.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Ot.extname(this.path):void 0}set extname(t){if(ao(t,"extname"),Yd(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ot.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Na(t)&&(t=Lw(t)),uo(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Ot.basename(this.path,this.extname):void 0}set stem(t){uo(t,"stem"),ao(t,"stem"),this.path=Ot.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Qe(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function ao(e,t){if(e&&e.includes(Ot.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Ot.sep+"`")}function uo(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Yd(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Dw(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Mw=function(e){const r=this.constructor.prototype,i=r[e],l=function(){return i.apply(l,arguments)};return Object.setPrototypeOf(l,r),l},Rw={}.hasOwnProperty;class Bu extends Mw{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=bw()}copy(){const t=new Bu;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(so(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(po("data",this.frozen),this.namespace[t]=n,this):Rw.call(this.namespace,t)&&this.namespace[t]||void 0:t?(po("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=il(t),r=this.parser||this.Parser;return co("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),co("process",this.parser||this.Parser),fo("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(l,s){const a=il(t),u=r.parse(a);r.run(u,a,function(c,f,h){if(c||!f||!h)return d(c);const p=f,g=r.stringify(p,h);Fw(g)?h.value=g:h.result=g,d(c,h)});function d(c,f){c||!f?s(c):l?l(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),co("processSync",this.parser||this.Parser),fo("processSync",this.compiler||this.Compiler),this.process(t,i),Gd("processSync","process",n),r;function i(l,s){n=!0,Bd(l),r=s}}run(t,n,r){Kd(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?l(void 0,r):new Promise(l);function l(s,a){const u=il(n);i.run(t,u,d);function d(c,f,h){const p=f||t;c?a(c):s?s(p):r(void 0,p,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,l),Gd("runSync","run",r),i;function l(s,a){Bd(s),i=a,r=!0}}stringify(t,n){this.freeze();const r=il(n),i=this.compiler||this.Compiler;return fo("stringify",i),Kd(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(po("use",this.frozen),t!=null)if(typeof t=="function")u(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function l(d){if(typeof d=="function")u(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[c,...f]=d;u(c,f)}else s(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function s(d){if(!("plugins"in d)&&!("settings"in d))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(d.plugins),d.settings&&(i.settings=so(!0,i.settings,d.settings))}function a(d){let c=-1;if(d!=null)if(Array.isArray(d))for(;++c<d.length;){const f=d[c];l(f)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function u(d,c){let f=-1,h=-1;for(;++f<r.length;)if(r[f][0]===d){h=f;break}if(h===-1)r.push([d,...c]);else if(c.length>0){let[p,...g]=c;const x=r[h][1];Ca(x)&&Ca(p)&&(p=so(!0,x,p)),r[h]=[d,p,...g]}}}}const _w=new Bu().freeze();function co(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function fo(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function po(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Kd(e){if(!Ca(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Gd(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function il(e){return Ow(e)?e:new vm(e)}function Ow(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Fw(e){return typeof e=="string"||$w(e)}function $w(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Bw="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Xd=[],Zd={allowDangerousHtml:!0},Uw=/^(https?|ircs?|mailto|xmpp)$/i,Hw=[{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:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Vw(e){const t=Ww(e),n=qw(e);return Qw(t.runSync(t.parse(n),n),e)}function Ww(e){const t=e.rehypePlugins||Xd,n=e.remarkPlugins||Xd,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Zd}:Zd;return _w().use(C0).use(n).use(kw,r).use(t)}function qw(e){const t=e.children||"",n=new vm;return typeof t=="string"&&(n.value=t),n}function Qw(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,l=t.disallowedElements,s=t.skipHtml,a=t.unwrapDisallowed,u=t.urlTransform||Yw;for(const c of Hw)Object.hasOwn(t,c.from)&&(""+c.from+(c.to?"use `"+c.to+"` instead":"remove it")+Bw+c.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),$u(e,d),av(e,{Fragment:o.Fragment,components:i,ignoreInvalidStyle:!0,jsx:o.jsx,jsxs:o.jsxs,passKeys:!0,passNode:!0});function d(c,f,h){if(c.type==="raw"&&h&&typeof f=="number")return s?h.children.splice(f,1):h.children[f]={type:"text",value:c.value},f;if(c.type==="element"){let p;for(p in ro)if(Object.hasOwn(ro,p)&&Object.hasOwn(c.properties,p)){const g=c.properties[p],x=ro[p];(x===null||x.includes(c.tagName))&&(c.properties[p]=u(String(g||""),p,c))}}if(c.type==="element"){let p=n?!n.includes(c.tagName):l?l.includes(c.tagName):!1;if(!p&&r&&typeof f=="number"&&(p=!r(c,f,h)),p&&h&&typeof f=="number")return a&&c.children?h.children.splice(f,1,...c.children):h.children.splice(f,1),f}}}function Yw(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||Uw.test(e.slice(0,t))?e:""}function Jd(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function Kw(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Gw(e,t,n){const i=bs((n||{}).ignore||[]),l=Xw(t);let s=-1;for(;++s<l.length;)ym(e,"text",a);function a(d,c){let f=-1,h;for(;++f<c.length;){const p=c[f],g=h?h.children:void 0;if(i(p,g?g.indexOf(p):void 0,h))return;h=p}if(h)return u(d,c)}function u(d,c){const f=c[c.length-1],h=l[s][0],p=l[s][1];let g=0;const C=f.children.indexOf(d);let y=!1,m=[];h.lastIndex=0;let v=h.exec(d.value);for(;v;){const N=v.index,P={index:v.index,input:v.input,stack:[...c,d]};let j=p(...v,P);if(typeof j=="string"&&(j=j.length>0?{type:"text",value:j}:void 0),j===!1?h.lastIndex=N+1:(g!==N&&m.push({type:"text",value:d.value.slice(g,N)}),Array.isArray(j)?m.push(...j):j&&m.push(j),g=N+v[0].length,y=!0),!h.global)break;v=h.exec(d.value)}return y?(g<d.value.length&&m.push({type:"text",value:d.value.slice(g)}),f.children.splice(C,1,...m)):m=[d],C+m.length}}function Xw(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([Zw(i[0]),Jw(i[1])])}return t}function Zw(e){return typeof e=="string"?new RegExp(Kw(e),"g"):e}function Jw(e){return typeof e=="function"?e:function(){return e}}const ho="phrasing",mo=["autolink","link","image","label"];function eb(){return{transforms:[ob],enter:{literalAutolink:nb,literalAutolinkEmail:go,literalAutolinkHttp:go,literalAutolinkWww:go},exit:{literalAutolink:sb,literalAutolinkEmail:lb,literalAutolinkHttp:rb,literalAutolinkWww:ib}}}function tb(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:ho,notInConstruct:mo},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:ho,notInConstruct:mo},{character:":",before:"[ps]",after:"\\/",inConstruct:ho,notInConstruct:mo}]}}function nb(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function go(e){this.config.enter.autolinkProtocol.call(this,e)}function rb(e){this.config.exit.autolinkProtocol.call(this,e)}function ib(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function lb(e){this.config.exit.autolinkEmail.call(this,e)}function sb(e){this.exit(e)}function ob(e){Gw(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,ab],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),ub]],{ignore:["link","linkReference"]})}function ab(e,t,n,r,i){let l="";if(!km(i)||(/^w/i.test(t)&&(n=t+n,t="",l="http://"),!cb(n)))return!1;const s=db(n+r);if(!s[0])return!1;const a={type:"link",title:null,url:l+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[a,{type:"text",value:s[1]}]:a}function ub(e,t,n,r){return!km(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function cb(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function db(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=Jd(e,"(");let l=Jd(e,")");for(;r!==-1&&i>l;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),l++;return[e,n]}function km(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Wn(n)||vs(n))&&(!t||n!==47)}wm.peek=kb;function fb(){this.buffer()}function pb(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function hb(){this.buffer()}function mb(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function gb(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Pt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function yb(e){this.exit(e)}function xb(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Pt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function vb(e){this.exit(e)}function kb(){return"["}function wm(e,t,n,r){const i=n.createTracker(r);let l=i.move("[^");const s=n.enter("footnoteReference"),a=n.enter("reference");return l+=i.move(n.safe(n.associationId(e),{after:"]",before:l})),a(),s(),l+=i.move("]"),l}function wb(){return{enter:{gfmFootnoteCallString:fb,gfmFootnoteCall:pb,gfmFootnoteDefinitionLabelString:hb,gfmFootnoteDefinition:mb},exit:{gfmFootnoteCallString:gb,gfmFootnoteCall:yb,gfmFootnoteDefinitionLabelString:xb,gfmFootnoteDefinition:vb}}}function bb(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:wm},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,l,s){const a=l.createTracker(s);let u=a.move("[^");const d=l.enter("footnoteDefinition"),c=l.enter("label");return u+=a.move(l.safe(l.associationId(r),{before:u,after:"]"})),c(),u+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),u+=a.move((t?`
324
- `:" ")+l.indentLines(l.containerFlow(r,a.current()),t?bm:Sb))),d(),u}}function Sb(e,t,n){return t===0?e:bm(e,t,n)}function bm(e,t,n){return(n?"":" ")+e}const jb=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Sm.peek=zb;function Cb(){return{canContainEols:["delete"],enter:{strikethrough:Eb},exit:{strikethrough:Tb}}}function Nb(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:jb}],handlers:{delete:Sm}}}function Eb(e){this.enter({type:"delete",children:[]},e)}function Tb(e){this.exit(e)}function Sm(e,t,n,r){const i=n.createTracker(r),l=n.enter("strikethrough");let s=i.move("~~");return s+=n.containerPhrasing(e,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),l(),s}function zb(){return"~"}function Ib(e){return e.length}function Pb(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Ib,l=[],s=[],a=[],u=[];let d=0,c=-1;for(;++c<e.length;){const x=[],C=[];let y=-1;for(e[c].length>d&&(d=e[c].length);++y<e[c].length;){const m=Lb(e[c][y]);if(n.alignDelimiters!==!1){const v=i(m);C[y]=v,(u[y]===void 0||v>u[y])&&(u[y]=v)}x.push(m)}s[c]=x,a[c]=C}let f=-1;if(typeof r=="object"&&"length"in r)for(;++f<d;)l[f]=ef(r[f]);else{const x=ef(r);for(;++f<d;)l[f]=x}f=-1;const h=[],p=[];for(;++f<d;){const x=l[f];let C="",y="";x===99?(C=":",y=":"):x===108?C=":":x===114&&(y=":");let m=n.alignDelimiters===!1?1:Math.max(1,u[f]-C.length-y.length);const v=C+"-".repeat(m)+y;n.alignDelimiters!==!1&&(m=C.length+m+y.length,m>u[f]&&(u[f]=m),p[f]=m),h[f]=v}s.splice(1,0,h),a.splice(1,0,p),c=-1;const g=[];for(;++c<s.length;){const x=s[c],C=a[c];f=-1;const y=[];for(;++f<d;){const m=x[f]||"";let v="",N="";if(n.alignDelimiters!==!1){const P=u[f]-(C[f]||0),j=l[f];j===114?v=" ".repeat(P):j===99?P%2?(v=" ".repeat(P/2+.5),N=" ".repeat(P/2-.5)):(v=" ".repeat(P/2),N=v):N=" ".repeat(P)}n.delimiterStart!==!1&&!f&&y.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&m==="")&&(n.delimiterStart!==!1||f)&&y.push(" "),n.alignDelimiters!==!1&&y.push(v),y.push(m),n.alignDelimiters!==!1&&y.push(N),n.padding!==!1&&y.push(" "),(n.delimiterEnd!==!1||f!==d-1)&&y.push("|")}g.push(n.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return g.join(`
325
- `)}function Lb(e){return e==null?"":String(e)}function ef(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function Ab(e,t,n,r){const i=n.enter("blockquote"),l=n.createTracker(r);l.move("> "),l.shift(2);const s=n.indentLines(n.containerFlow(e,l.current()),Db);return i(),s}function Db(e,t,n){return">"+(n?"":" ")+e}function Mb(e,t){return tf(e,t.inConstruct,!0)&&!tf(e,t.notInConstruct,!1)}function tf(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function nf(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
326
- `&&Mb(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
327
- `}function Rb(e,t){const n=String(e);let r=n.indexOf(t),i=r,l=0,s=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++l>s&&(s=l):l=1,i=r+t.length,r=n.indexOf(t,i);return s}function _b(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Ob(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Fb(e,t,n,r){const i=Ob(n),l=e.value||"",s=i==="`"?"GraveAccent":"Tilde";if(_b(e,n)){const f=n.enter("codeIndented"),h=n.indentLines(l,$b);return f(),h}const a=n.createTracker(r),u=i.repeat(Math.max(Rb(l,i)+1,3)),d=n.enter("codeFenced");let c=a.move(u);if(e.lang){const f=n.enter(`codeFencedLang${s}`);c+=a.move(n.safe(e.lang,{before:c,after:" ",encode:["`"],...a.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${s}`);c+=a.move(" "),c+=a.move(n.safe(e.meta,{before:c,after:`
328
- `,encode:["`"],...a.current()})),f()}return c+=a.move(`
329
- `),l&&(c+=a.move(l+`
330
- `)),c+=a.move(u),d(),c}function $b(e,t,n){return(n?"":" ")+e}function Uu(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Bb(e,t,n,r){const i=Uu(n),l=i==='"'?"Quote":"Apostrophe",s=n.enter("definition");let a=n.enter("label");const u=n.createTracker(r);let d=u.move("[");return d+=u.move(n.safe(n.associationId(e),{before:d,after:"]",...u.current()})),d+=u.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),d+=u.move("<"),d+=u.move(n.safe(e.url,{before:d,after:">",...u.current()})),d+=u.move(">")):(a=n.enter("destinationRaw"),d+=u.move(n.safe(e.url,{before:d,after:e.title?" ":`
331
- `,...u.current()}))),a(),e.title&&(a=n.enter(`title${l}`),d+=u.move(" "+i),d+=u.move(n.safe(e.title,{before:d,after:i,...u.current()})),d+=u.move(i),a()),s(),d}function Ub(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Ni(e){return"&#x"+e.toString(16).toUpperCase()+";"}function es(e,t,n){const r=Er(e),i=Er(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}jm.peek=Hb;function jm(e,t,n,r){const i=Ub(n),l=n.enter("emphasis"),s=n.createTracker(r),a=s.move(i);let u=s.move(n.containerPhrasing(e,{after:i,before:a,...s.current()}));const d=u.charCodeAt(0),c=es(r.before.charCodeAt(r.before.length-1),d,i);c.inside&&(u=Ni(d)+u.slice(1));const f=u.charCodeAt(u.length-1),h=es(r.after.charCodeAt(0),f,i);h.inside&&(u=u.slice(0,-1)+Ni(f));const p=s.move(i);return l(),n.attentionEncodeSurroundingInfo={after:h.outside,before:c.outside},a+u+p}function Hb(e,t,n){return n.options.emphasis||"*"}function Vb(e,t){let n=!1;return $u(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Sa}),!!((!e.depth||e.depth<3)&&Au(e)&&(t.options.setext||n))}function Wb(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),l=n.createTracker(r);if(Vb(e,n)){const c=n.enter("headingSetext"),f=n.enter("phrasing"),h=n.containerPhrasing(e,{...l.current(),before:`
332
- `,after:`
333
- `});return f(),c(),h+`
334
- `+(i===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
335
- `))+1))}const s="#".repeat(i),a=n.enter("headingAtx"),u=n.enter("phrasing");l.move(s+" ");let d=n.containerPhrasing(e,{before:"# ",after:`
336
- `,...l.current()});return/^[\t ]/.test(d)&&(d=Ni(d.charCodeAt(0))+d.slice(1)),d=d?s+" "+d:s,n.options.closeAtx&&(d+=" "+s),u(),a(),d}Cm.peek=qb;function Cm(e){return e.value||""}function qb(){return"<"}Nm.peek=Qb;function Nm(e,t,n,r){const i=Uu(n),l=i==='"'?"Quote":"Apostrophe",s=n.enter("image");let a=n.enter("label");const u=n.createTracker(r);let d=u.move("![");return d+=u.move(n.safe(e.alt,{before:d,after:"]",...u.current()})),d+=u.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),d+=u.move("<"),d+=u.move(n.safe(e.url,{before:d,after:">",...u.current()})),d+=u.move(">")):(a=n.enter("destinationRaw"),d+=u.move(n.safe(e.url,{before:d,after:e.title?" ":")",...u.current()}))),a(),e.title&&(a=n.enter(`title${l}`),d+=u.move(" "+i),d+=u.move(n.safe(e.title,{before:d,after:i,...u.current()})),d+=u.move(i),a()),d+=u.move(")"),s(),d}function Qb(){return"!"}Em.peek=Yb;function Em(e,t,n,r){const i=e.referenceType,l=n.enter("imageReference");let s=n.enter("label");const a=n.createTracker(r);let u=a.move("![");const d=n.safe(e.alt,{before:u,after:"]",...a.current()});u+=a.move(d+"]["),s();const c=n.stack;n.stack=[],s=n.enter("reference");const f=n.safe(n.associationId(e),{before:u,after:"]",...a.current()});return s(),n.stack=c,l(),i==="full"||!d||d!==f?u+=a.move(f+"]"):i==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function Yb(){return"!"}Tm.peek=Kb;function Tm(e,t,n){let r=e.value||"",i="`",l=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++l<n.unsafe.length;){const s=n.unsafe[l],a=n.compilePattern(s);let u;if(s.atBreak)for(;u=a.exec(r);){let d=u.index;r.charCodeAt(d)===10&&r.charCodeAt(d-1)===13&&d--,r=r.slice(0,d)+" "+r.slice(u.index+1)}}return i+r+i}function Kb(){return"`"}function zm(e,t){const n=Au(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Im.peek=Gb;function Im(e,t,n,r){const i=Uu(n),l=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r);let a,u;if(zm(e,n)){const c=n.stack;n.stack=[],a=n.enter("autolink");let f=s.move("<");return f+=s.move(n.containerPhrasing(e,{before:f,after:">",...s.current()})),f+=s.move(">"),a(),n.stack=c,f}a=n.enter("link"),u=n.enter("label");let d=s.move("[");return d+=s.move(n.containerPhrasing(e,{before:d,after:"](",...s.current()})),d+=s.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),d+=s.move("<"),d+=s.move(n.safe(e.url,{before:d,after:">",...s.current()})),d+=s.move(">")):(u=n.enter("destinationRaw"),d+=s.move(n.safe(e.url,{before:d,after:e.title?" ":")",...s.current()}))),u(),e.title&&(u=n.enter(`title${l}`),d+=s.move(" "+i),d+=s.move(n.safe(e.title,{before:d,after:i,...s.current()})),d+=s.move(i),u()),d+=s.move(")"),a(),d}function Gb(e,t,n){return zm(e,n)?"<":"["}Pm.peek=Xb;function Pm(e,t,n,r){const i=e.referenceType,l=n.enter("linkReference");let s=n.enter("label");const a=n.createTracker(r);let u=a.move("[");const d=n.containerPhrasing(e,{before:u,after:"]",...a.current()});u+=a.move(d+"]["),s();const c=n.stack;n.stack=[],s=n.enter("reference");const f=n.safe(n.associationId(e),{before:u,after:"]",...a.current()});return s(),n.stack=c,l(),i==="full"||!d||d!==f?u+=a.move(f+"]"):i==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function Xb(){return"["}function Hu(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Zb(e){const t=Hu(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Jb(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Lm(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function eS(e,t,n,r){const i=n.enter("list"),l=n.bulletCurrent;let s=e.ordered?Jb(n):Hu(n);const a=e.ordered?s==="."?")":".":Zb(n);let u=t&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!e.ordered){const c=e.children?e.children[0]:void 0;if((s==="*"||s==="-")&&c&&(!c.children||!c.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(u=!0),Lm(n)===s&&c){let f=-1;for(;++f<e.children.length;){const h=e.children[f];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(s=a),n.bulletCurrent=s;const d=n.containerFlow(e,r);return n.bulletLastUsed=s,n.bulletCurrent=l,i(),d}function tS(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function nS(e,t,n,r){const i=tS(n);let l=n.bulletCurrent||Hu(n);t&&t.type==="list"&&t.ordered&&(l=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+l);let s=l.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(s=Math.ceil(s/4)*4);const a=n.createTracker(r);a.move(l+" ".repeat(s-l.length)),a.shift(s);const u=n.enter("listItem"),d=n.indentLines(n.containerFlow(e,a.current()),c);return u(),d;function c(f,h,p){return h?(p?"":" ".repeat(s))+f:(p?l:l+" ".repeat(s-l.length))+f}}function rS(e,t,n,r){const i=n.enter("paragraph"),l=n.enter("phrasing"),s=n.containerPhrasing(e,r);return l(),i(),s}const iS=bs(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function lS(e,t,n,r){return(e.children.some(function(s){return iS(s)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function sS(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Am.peek=oS;function Am(e,t,n,r){const i=sS(n),l=n.enter("strong"),s=n.createTracker(r),a=s.move(i+i);let u=s.move(n.containerPhrasing(e,{after:i,before:a,...s.current()}));const d=u.charCodeAt(0),c=es(r.before.charCodeAt(r.before.length-1),d,i);c.inside&&(u=Ni(d)+u.slice(1));const f=u.charCodeAt(u.length-1),h=es(r.after.charCodeAt(0),f,i);h.inside&&(u=u.slice(0,-1)+Ni(f));const p=s.move(i+i);return l(),n.attentionEncodeSurroundingInfo={after:h.outside,before:c.outside},a+u+p}function oS(e,t,n){return n.options.strong||"*"}function aS(e,t,n,r){return n.safe(e.value,r)}function uS(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function cS(e,t,n){const r=(Lm(n)+(n.options.ruleSpaces?" ":"")).repeat(uS(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Dm={blockquote:Ab,break:nf,code:Fb,definition:Bb,emphasis:jm,hardBreak:nf,heading:Wb,html:Cm,image:Nm,imageReference:Em,inlineCode:Tm,link:Im,linkReference:Pm,list:eS,listItem:nS,paragraph:rS,root:lS,strong:Am,text:aS,thematicBreak:cS};function dS(){return{enter:{table:fS,tableData:rf,tableHeader:rf,tableRow:hS},exit:{codeText:mS,table:pS,tableData:yo,tableHeader:yo,tableRow:yo}}}function fS(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function pS(e){this.exit(e),this.data.inTable=void 0}function hS(e){this.enter({type:"tableRow",children:[]},e)}function yo(e){this.exit(e)}function rf(e){this.enter({type:"tableCell",children:[]},e)}function mS(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,gS));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function gS(e,t){return t==="|"?t:e}function yS(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,l=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
337
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:s,tableCell:u,tableRow:a}};function s(p,g,x,C){return d(c(p,x,C),p.align)}function a(p,g,x,C){const y=f(p,x,C),m=d([y]);return m.slice(0,m.indexOf(`
338
- `))}function u(p,g,x,C){const y=x.enter("tableCell"),m=x.enter("phrasing"),v=x.containerPhrasing(p,{...C,before:l,after:l});return m(),y(),v}function d(p,g){return Pb(p,{align:g,alignDelimiters:r,padding:n,stringLength:i})}function c(p,g,x){const C=p.children;let y=-1;const m=[],v=g.enter("table");for(;++y<C.length;)m[y]=f(C[y],g,x);return v(),m}function f(p,g,x){const C=p.children;let y=-1;const m=[],v=g.enter("tableRow");for(;++y<C.length;)m[y]=u(C[y],p,g,x);return v(),m}function h(p,g,x){let C=Dm.inlineCode(p,g,x);return x.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function xS(){return{exit:{taskListCheckValueChecked:lf,taskListCheckValueUnchecked:lf,paragraph:kS}}}function vS(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:wS}}}function lf(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function kS(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let l=-1,s;for(;++l<i.length;){const a=i[l];if(a.type==="paragraph"){s=a;break}}s===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function wS(e,t,n,r){const i=e.children[0],l=typeof e.checked=="boolean"&&i&&i.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",a=n.createTracker(r);l&&a.move(s);let u=Dm.listItem(e,t,n,{...r,...a.current()});return l&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),u;function d(c){return c+s}}function bS(){return[eb(),wb(),Cb(),dS(),xS()]}function SS(e){return{extensions:[tb(),bb(e),Nb(),yS(e),vS()]}}const jS={tokenize:IS,partial:!0},Mm={tokenize:PS,partial:!0},Rm={tokenize:LS,partial:!0},_m={tokenize:AS,partial:!0},CS={tokenize:DS,partial:!0},Om={name:"wwwAutolink",tokenize:TS,previous:$m},Fm={name:"protocolAutolink",tokenize:zS,previous:Bm},en={name:"emailAutolink",tokenize:ES,previous:Um},Ut={};function NS(){return{text:Ut}}let En=48;for(;En<123;)Ut[En]=en,En++,En===58?En=65:En===91&&(En=97);Ut[43]=en;Ut[45]=en;Ut[46]=en;Ut[95]=en;Ut[72]=[en,Fm];Ut[104]=[en,Fm];Ut[87]=[en,Om];Ut[119]=[en,Om];function ES(e,t,n){const r=this;let i,l;return s;function s(f){return!Ea(f)||!Um.call(r,r.previous)||Vu(r.events)?n(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(f))}function a(f){return Ea(f)?(e.consume(f),a):f===64?(e.consume(f),u):n(f)}function u(f){return f===46?e.check(CS,c,d)(f):f===45||f===95||We(f)?(l=!0,e.consume(f),u):c(f)}function d(f){return e.consume(f),i=!0,u}function c(f){return l&&i&&Ke(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):n(f)}}function TS(e,t,n){const r=this;return i;function i(s){return s!==87&&s!==119||!$m.call(r,r.previous)||Vu(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(jS,e.attempt(Mm,e.attempt(Rm,l),n),n)(s))}function l(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function zS(e,t,n){const r=this;let i="",l=!1;return s;function s(f){return(f===72||f===104)&&Bm.call(r,r.previous)&&!Vu(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(f),e.consume(f),a):n(f)}function a(f){if(Ke(f)&&i.length<5)return i+=String.fromCodePoint(f),e.consume(f),a;if(f===58){const h=i.toLowerCase();if(h==="http"||h==="https")return e.consume(f),u}return n(f)}function u(f){return f===47?(e.consume(f),l?d:(l=!0,u)):n(f)}function d(f){return f===null||Xl(f)||ve(f)||Wn(f)||vs(f)?n(f):e.attempt(Mm,e.attempt(Rm,c),n)(f)}function c(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function IS(e,t,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,e.consume(s),i):s===46&&r===3?(e.consume(s),l):n(s)}function l(s){return s===null?n(s):t(s)}}function PS(e,t,n){let r,i,l;return s;function s(d){return d===46||d===95?e.check(_m,u,a)(d):d===null||ve(d)||Wn(d)||d!==45&&vs(d)?u(d):(l=!0,e.consume(d),s)}function a(d){return d===95?r=!0:(i=r,r=void 0),e.consume(d),s}function u(d){return i||r||!l?n(d):t(d)}}function LS(e,t){let n=0,r=0;return i;function i(s){return s===40?(n++,e.consume(s),i):s===41&&r<n?l(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(_m,t,l)(s):s===null||ve(s)||Wn(s)?t(s):(e.consume(s),i)}function l(s){return s===41&&r++,e.consume(s),i}}function AS(e,t,n){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),l):a===93?(e.consume(a),i):a===60||a===null||ve(a)||Wn(a)?t(a):n(a)}function i(a){return a===null||a===40||a===91||ve(a)||Wn(a)?t(a):r(a)}function l(a){return Ke(a)?s(a):n(a)}function s(a){return a===59?(e.consume(a),r):Ke(a)?(e.consume(a),s):n(a)}}function DS(e,t,n){return r;function r(l){return e.consume(l),i}function i(l){return We(l)?n(l):t(l)}}function $m(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||ve(e)}function Bm(e){return!Ke(e)}function Um(e){return!(e===47||Ea(e))}function Ea(e){return e===43||e===45||e===46||e===95||We(e)}function Vu(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const MS={tokenize:HS,partial:!0};function RS(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:$S,continuation:{tokenize:BS},exit:US}},text:{91:{name:"gfmFootnoteCall",tokenize:FS},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:_S,resolveTo:OS}}}}function _S(e,t,n){const r=this;let i=r.events.length;const l=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){s=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return a;function a(u){if(!s||!s._balanced)return n(u);const d=Pt(r.sliceSerialize({start:s.end,end:r.now()}));return d.codePointAt(0)!==94||!l.includes(d.slice(1))?n(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function OS(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const l={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",l,t],["enter",s,t],["exit",s,t],["exit",l,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function FS(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l=0,s;return a;function a(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),u}function u(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(f){if(l>999||f===93&&!s||f===null||f===91||ve(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(Pt(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return ve(f)||(s=!0),l++,e.consume(f),f===92?c:d}function c(f){return f===91||f===92||f===93?(e.consume(f),l++,d):d(f)}}function $S(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l,s=0,a;return u;function u(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):n(g)}function c(g){if(s>999||g===93&&!a||g===null||g===91||ve(g))return n(g);if(g===93){e.exit("chunkString");const x=e.exit("gfmFootnoteDefinitionLabelString");return l=Pt(r.sliceSerialize(x)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return ve(g)||(a=!0),s++,e.consume(g),g===92?f:c}function f(g){return g===91||g===92||g===93?(e.consume(g),s++,c):c(g)}function h(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),i.includes(l)||i.push(l),fe(e,p,"gfmFootnoteDefinitionWhitespace")):n(g)}function p(g){return t(g)}}function BS(e,t,n){return e.check(Ai,t,e.attempt(MS,t,n))}function US(e){e.exit("gfmFootnoteDefinition")}function HS(e,t,n){const r=this;return fe(e,i,"gfmFootnoteDefinitionIndent",5);function i(l){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(l):n(l)}}function VS(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:l,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,a){let u=-1;for(;++u<s.length;)if(s[u][0]==="enter"&&s[u][1].type==="strikethroughSequenceTemporary"&&s[u][1]._close){let d=u;for(;d--;)if(s[d][0]==="exit"&&s[d][1].type==="strikethroughSequenceTemporary"&&s[d][1]._open&&s[u][1].end.offset-s[u][1].start.offset===s[d][1].end.offset-s[d][1].start.offset){s[u][1].type="strikethroughSequence",s[d][1].type="strikethroughSequence";const c={type:"strikethrough",start:Object.assign({},s[d][1].start),end:Object.assign({},s[u][1].end)},f={type:"strikethroughText",start:Object.assign({},s[d][1].end),end:Object.assign({},s[u][1].start)},h=[["enter",c,a],["enter",s[d][1],a],["exit",s[d][1],a],["enter",f,a]],p=a.parser.constructs.insideSpan.null;p&&pt(h,h.length,0,ks(p,s.slice(d+1,u),a)),pt(h,h.length,0,[["exit",f,a],["enter",s[u][1],a],["exit",s[u][1],a],["exit",c,a]]),pt(s,d-1,u-d+3,h),u=d+h.length-2;break}}for(u=-1;++u<s.length;)s[u][1].type==="strikethroughSequenceTemporary"&&(s[u][1].type="data");return s}function l(s,a,u){const d=this.previous,c=this.events;let f=0;return h;function h(g){return d===126&&c[c.length-1][1].type!=="characterEscape"?u(g):(s.enter("strikethroughSequenceTemporary"),p(g))}function p(g){const x=Er(d);if(g===126)return f>1?u(g):(s.consume(g),f++,p);if(f<2&&!n)return u(g);const C=s.exit("strikethroughSequenceTemporary"),y=Er(g);return C._open=!y||y===2&&!!x,C._close=!x||x===2&&!!y,a(g)}}}class WS{constructor(){this.map=[]}add(t,n,r){qS(this,t,n,r)}consume(t){if(this.map.sort(function(l,s){return l[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const l of i)t.push(l);i=r.pop()}this.map.length=0}}function qS(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function QS(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const l=r.length-1;r[l]=r[l]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function YS(){return{flow:{null:{name:"table",tokenize:KS,resolveAll:GS}}}}function KS(e,t,n){const r=this;let i=0,l=0,s;return a;function a(w){let z=r.events.length-1;for(;z>-1;){const $=r.events[z][1].type;if($==="lineEnding"||$==="linePrefix")z--;else break}const A=z>-1?r.events[z][1].type:null,H=A==="tableHead"||A==="tableRow"?j:u;return H===j&&r.parser.lazy[r.now().line]?n(w):H(w)}function u(w){return e.enter("tableHead"),e.enter("tableRow"),d(w)}function d(w){return w===124||(s=!0,l+=1),c(w)}function c(w){return w===null?n(w):K(w)?l>1?(l=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),p):n(w):ae(w)?fe(e,c,"whitespace")(w):(l+=1,s&&(s=!1,i+=1),w===124?(e.enter("tableCellDivider"),e.consume(w),e.exit("tableCellDivider"),s=!0,c):(e.enter("data"),f(w)))}function f(w){return w===null||w===124||ve(w)?(e.exit("data"),c(w)):(e.consume(w),w===92?h:f)}function h(w){return w===92||w===124?(e.consume(w),f):f(w)}function p(w){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(w):(e.enter("tableDelimiterRow"),s=!1,ae(w)?fe(e,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(w):g(w))}function g(w){return w===45||w===58?C(w):w===124?(s=!0,e.enter("tableCellDivider"),e.consume(w),e.exit("tableCellDivider"),x):P(w)}function x(w){return ae(w)?fe(e,C,"whitespace")(w):C(w)}function C(w){return w===58?(l+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(w),e.exit("tableDelimiterMarker"),y):w===45?(l+=1,y(w)):w===null||K(w)?N(w):P(w)}function y(w){return w===45?(e.enter("tableDelimiterFiller"),m(w)):P(w)}function m(w){return w===45?(e.consume(w),m):w===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(w),e.exit("tableDelimiterMarker"),v):(e.exit("tableDelimiterFiller"),v(w))}function v(w){return ae(w)?fe(e,N,"whitespace")(w):N(w)}function N(w){return w===124?g(w):w===null||K(w)?!s||i!==l?P(w):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(w)):P(w)}function P(w){return n(w)}function j(w){return e.enter("tableRow"),I(w)}function I(w){return w===124?(e.enter("tableCellDivider"),e.consume(w),e.exit("tableCellDivider"),I):w===null||K(w)?(e.exit("tableRow"),t(w)):ae(w)?fe(e,I,"whitespace")(w):(e.enter("data"),L(w))}function L(w){return w===null||w===124||ve(w)?(e.exit("data"),I(w)):(e.consume(w),w===92?T:L)}function T(w){return w===92||w===124?(e.consume(w),L):L(w)}}function GS(e,t){let n=-1,r=!0,i=0,l=[0,0,0,0],s=[0,0,0,0],a=!1,u=0,d,c,f;const h=new WS;for(;++n<e.length;){const p=e[n],g=p[1];p[0]==="enter"?g.type==="tableHead"?(a=!1,u!==0&&(sf(h,t,u,d,c),c=void 0,u=0),d={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},h.add(n,0,[["enter",d,t]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,f=void 0,l=[0,0,0,0],s=[0,n+1,0,0],a&&(a=!1,c={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},h.add(n,0,[["enter",c,t]])),i=g.type==="tableDelimiterRow"?2:c?3:1):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(l[1]!==0&&(s[0]=s[1],f=ll(h,t,l,i,void 0,f),l=[0,0,0,0]),s[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(l[1]!==0&&(s[0]=s[1],f=ll(h,t,l,i,void 0,f)),l=s,s=[l[1],n,0,0])):g.type==="tableHead"?(a=!0,u=n):g.type==="tableRow"||g.type==="tableDelimiterRow"?(u=n,l[1]!==0?(s[0]=s[1],f=ll(h,t,l,i,n,f)):s[1]!==0&&(f=ll(h,t,s,i,n,f)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(s[3]=n)}for(u!==0&&sf(h,t,u,d,c),h.consume(t.events),n=-1;++n<t.events.length;){const p=t.events[n];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=QS(t.events,n))}return e}function ll(e,t,n,r,i,l){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(l.end=Object.assign({},Zn(t.events,n[0])),e.add(n[0],0,[["exit",l,t]]));const u=Zn(t.events,n[1]);if(l={type:s,start:Object.assign({},u),end:Object.assign({},u)},e.add(n[1],0,[["enter",l,t]]),n[2]!==0){const d=Zn(t.events,n[2]),c=Zn(t.events,n[3]),f={type:a,start:Object.assign({},d),end:Object.assign({},c)};if(e.add(n[2],0,[["enter",f,t]]),r!==2){const h=t.events[n[2]],p=t.events[n[3]];if(h[1].end=Object.assign({},p[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const g=n[2]+1,x=n[3]-n[2]-1;e.add(g,x,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return i!==void 0&&(l.end=Object.assign({},Zn(t.events,i)),e.add(i,0,[["exit",l,t]]),l=void 0),l}function sf(e,t,n,r,i){const l=[],s=Zn(t.events,n);i&&(i.end=Object.assign({},s),l.push(["exit",i,t])),r.end=Object.assign({},s),l.push(["exit",r,t]),e.add(n+1,0,l)}function Zn(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const XS={name:"tasklistCheck",tokenize:JS};function ZS(){return{text:{91:XS}}}function JS(e,t,n){const r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),l)}function l(u){return ve(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),s):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),s):n(u)}function s(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(u)}function a(u){return K(u)?t(u):ae(u)?e.check({tokenize:ej},t,n)(u):n(u)}}function ej(e,t,n){return fe(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function tj(e){return Zh([NS(),RS(),VS(e),YS(),ZS()])}const nj={};function rj(e){const t=this,n=e||nj,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),l=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(tj(n)),l.push(bS()),s.push(SS(n))}function ij({message:e,pinned:t,onCopy:n,onDelete:r,onTogglePin:i,onRegenerate:l}){const s=(e.role||"assistant").toLowerCase(),a=e.ts?Yx(e.ts):"",u=e.content||e.message||"",d=s==="user";return o.jsxs("article",{className:`chat-message ${d?"chat-message-user":"chat-message-assistant"} ${t?"chat-message-pinned":""}`,children:[o.jsxs("header",{className:"chat-message-meta",children:[o.jsx("span",{className:"chat-message-role",children:s}),e.agent&&o.jsxs("span",{className:"chat-message-agent",children:["@",e.agent]}),a&&o.jsx("time",{className:"chat-message-time",children:a}),t&&o.jsx("span",{className:"chat-message-pin",children:"pinned"}),o.jsxs("div",{className:"chat-message-actions",children:[o.jsx("button",{type:"button",className:"chat-msg-action-btn",onClick:n,title:"Copy","aria-label":"Copy",children:o.jsx(Lx,{size:12})}),!d&&o.jsx("button",{type:"button",className:"chat-msg-action-btn",onClick:l,title:"Regenerate","aria-label":"Regenerate",children:o.jsx(Dt,{size:12})}),o.jsx("button",{type:"button",className:"chat-msg-action-btn",onClick:i,title:"Pin","aria-label":"Pin",children:o.jsx(Bx,{size:12})}),o.jsx("button",{type:"button",className:"chat-msg-action-btn chat-msg-action-btn-danger",onClick:r,title:"Delete","aria-label":"Delete",children:o.jsx(Lr,{size:12})})]})]}),o.jsx("div",{className:"chat-message-content markdown-body",children:o.jsx(Vw,{remarkPlugins:[rj],children:u})})]})}function lj({messages:e,loading:t,activeProject:n,sessionId:r,pinned:i,activeSource:l,onPickSuggestion:s,onCopy:a,onDelete:u,onTogglePin:d,onRegenerate:c}){const f=k.useRef(null);k.useEffect(()=>{const p=f.current;if(!p)return;let g=p.parentElement,x=!1;for(;g;){if(g.classList.contains("chat-thread-scroll")){x=!0;break}g=g.parentElement}x||(p.scrollTop=p.scrollHeight)},[e]);const h=l==="opencode"?"opencode":"bizar";return t?o.jsx("div",{className:"chat-thread legacy",ref:f,"data-stream":h,children:o.jsx(c1,{count:3})}):n?e.length===0?o.jsx("div",{className:"chat-thread legacy",ref:f,"data-stream":h,children:o.jsx(cd,{variant:"empty",projectName:n.name,onPickSuggestion:s})}):o.jsx("div",{className:"chat-thread legacy",ref:f,children:o.jsx(o1,{items:e,itemHeight:120,height:800,className:"chat-thread-virtual",renderItem:(p,g)=>o.jsx(ij,{message:p,pinned:i.has(g),onCopy:()=>a(p),onDelete:()=>u(g),onTogglePin:()=>d(g),onRegenerate:()=>c(String(p.ts??g))})})}):o.jsx("div",{className:"chat-thread legacy",ref:f,"data-stream":h,children:o.jsx(cd,{variant:"no-project",projectName:"",onPickSuggestion:s})})}function sj({agent:e,setAgent:t,agents:n}){const[r,i]=k.useState(!1),l=k.useRef(null);k.useEffect(()=>{if(!r)return;const u=d=>{l.current&&!l.current.contains(d.target)&&i(!1)};return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[r]);const s=e||"no agent",a=s.startsWith("@")?s.slice(1):s;return o.jsxs("div",{className:"chat-agent-chip",ref:l,children:[o.jsxs("button",{type:"button",className:"chat-agent-chip-btn",onClick:()=>i(u=>!u),"aria-haspopup":"listbox","aria-expanded":r,children:[o.jsx(Pr,{size:14}),o.jsx("span",{children:a}),o.jsx(ys,{size:12,className:r?"rotated":""})]}),r&&o.jsxs("div",{className:"chat-agent-chip-menu",role:"listbox",children:[o.jsx("button",{type:"button",role:"option","aria-selected":!e,onClick:()=>{t(""),i(!1)},children:o.jsx("span",{children:"no agent"})}),n.map(u=>o.jsx("button",{type:"button",role:"option","aria-selected":e===u.name,onClick:()=>{t(u.name),i(!1)},children:o.jsxs("span",{children:["@",u.name]})},u.name))]})]})}function oj(e,t,n=240){k.useLayoutEffect(()=>{const r=e.current;if(!r)return;r.style.height="auto";const i=Math.min(r.scrollHeight,n);r.style.height=`${i}px`,r.style.overflowY=r.scrollHeight>n?"auto":"hidden"},[e,t,n])}function aj({agent:e,setAgent:t,model:n,setModel:r,text:i,setText:l,sending:s,onSend:a,attachments:u,setAttachments:d,suggestions:c,onPickSuggestion:f,agents:h,onAttach:p}){const g=k.useRef(null),x=k.useRef(null);oj(g,i,200);const C=m=>{if(m.key==="Enter"&&(m.metaKey||m.ctrlKey))m.preventDefault(),a();else if(m.key==="Enter"&&!m.shiftKey)m.preventDefault(),a();else if(m.key==="Tab"&&c.length){m.preventDefault();const v=c[0].cmd.split(" ")[0];l(`${v} `)}},y=m=>{const v=m.target.files;if(!v)return;const N=[];for(let P=0;P<v.length;P++)N.push(v[P].name);d(P=>[...P,...N]),m.target.value=""};return o.jsxs("div",{className:"chat-composer",children:[c.length>0&&o.jsx("div",{className:"chat-composer-suggestions",children:c.map(m=>o.jsxs("button",{type:"button",className:"chat-composer-suggestion",onClick:()=>{var N;const v=m.cmd.split(" ")[0];l(`${v} `),(N=g.current)==null||N.focus()},children:[o.jsx("span",{className:"mono",children:m.cmd}),o.jsx("span",{children:m.desc})]},m.cmd))}),u.length>0&&o.jsx("div",{className:"chat-composer-attachments",children:u.map((m,v)=>o.jsxs("span",{className:"chat-composer-attachment-tag",children:[o.jsx(id,{size:10})," ",m,o.jsx("button",{type:"button",className:"chat-composer-attachment-remove",onClick:()=>d(N=>N.filter((P,j)=>j!==v)),"aria-label":`Remove ${m}`,children:o.jsx(Yn,{size:10})})]},v))}),o.jsxs("div",{className:"chat-composer-input",children:[o.jsx(sj,{agent:e,setAgent:t,agents:h}),o.jsx("textarea",{ref:g,className:"chat-composer-textarea",placeholder:s?"Sending…":"Send a message…",rows:1,value:i,onChange:m=>l(m.target.value),onKeyDown:C,disabled:s,"aria-label":"Message"}),o.jsx("input",{ref:x,type:"file",multiple:!0,style:{display:"none"},onChange:y,"aria-label":"Attach files",tabIndex:-1}),o.jsx("button",{type:"button",className:"chat-attach-btn",onClick:p,title:"Attach files","aria-label":"Attach files",children:o.jsx(id,{size:14})}),o.jsx("button",{type:"button",className:"chat-attach-btn",onClick:async()=>{if(!i.trim())return;const m=await Xx(i);m!==i&&l(m)},title:"Enhance prompt with AI","aria-label":"Enhance prompt",children:o.jsx(Yl,{size:14})}),o.jsx("button",{type:"button",className:"chat-send-btn",onClick:a,disabled:s||!i.trim(),title:"Send (Enter)","aria-label":"Send message",children:o.jsx(Lh,{size:16})})]})]})}const uj="modulepreload",cj=function(e){return"/"+e},of={},Hm=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),a=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));i=Promise.allSettled(n.map(u=>{if(u=cj(u),u in of)return;of[u]=!0;const d=u.endsWith(".css"),c=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${c}`))return;const f=document.createElement("link");if(f.rel=d?"stylesheet":uj,d||(f.as="script"),f.crossOrigin="",f.href=u,a&&f.setAttribute("nonce",a),document.head.appendChild(f),d)return new Promise((h,p)=>{f.addEventListener("load",h),f.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${u}`)))})}))}function l(s){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=s,window.dispatchEvent(a),!a.defaultPrevented)throw s}return i.then(s=>{for(const a of s||[])a.status==="rejected"&&l(a.reason);return t().catch(l)})};function dj(e,t,n){const[r,i]=k.useState([]),[l,s]=k.useState([]),[a,u]=k.useState(""),[d,c]=k.useState(!0),[f,h]=k.useState({create:!1,send:!1,rename:!1,delete:!1}),[p,g]=k.useState([]),[x,C]=k.useState([]),[y,m]=k.useState(null),[v,N]=k.useState(null),[P,j]=k.useState(null),[I,L]=k.useState({}),[T,w]=k.useState(!0),[z,A]=k.useState(0),[H,$]=k.useState(new Set),[Q,he]=k.useState(new Set),ne=k.useRef(null),R=k.useRef(null),V=k.useRef(null),b=k.useRef(0),Y=k.useRef(null),ie=k.useRef(null),S=k.useRef(!1),ge=k.useCallback(E=>{E&&C(M=>{if(E.id&&M.some(B=>B.id===E.id))return M;const _=M.findIndex(B=>typeof B.id=="string"&&B.id.startsWith("msg_")&&B.role===E.role&&(B.content||"")===(E.content||""));if(_>=0){const B=M.slice();return B[_]={...E,id:E.id??M[_].id},B}return[...M,E]})},[]),Le=k.useCallback(E=>{E&&$(M=>{if(M.has(E))return M;const _=new Set(M);return _.add(E),_})},[]),oe=k.useCallback((E,M)=>{L(_=>{const B=_[E]??{state:"idle",unread:0,pinned:!1};return{..._,[E]:{...B,...M}}})},[]),Ce=k.useCallback((E,M)=>{oe(E,{state:M?"streaming":"idle"})},[oe]),U=k.useCallback(E=>{R.current=E},[]),ee=k.useCallback(async E=>{var M;try{const _=E?`/chat?session=${encodeURIComponent(E)}`:"/chat?limit=200",B=await q.get(_);i(B.messages||[]),s(B.sessions||[])}catch(_){(M=R.current)==null||M.error(`Chat load failed: ${_.message}`)}finally{c(!1)}},[]),re=k.useCallback(async E=>{var M;c(!0);try{const _=await q.get(`/tasks/${encodeURIComponent(E)}/chat`);i(_.messages||[]),u(_.sessionId||E)}catch(_){(M=R.current)==null||M.error(`Task chat load failed: ${_.message}`)}finally{c(!1)}},[]),be=k.useCallback(async()=>{try{const E=await q.get("/chat/sessions");s(E.sessions||[])}catch{}},[]),Mt=k.useCallback(async()=>{try{const M=((await q.get("/opencode-sessions")).sessions||[]).map(_=>({..._,source:"opencode",title:_.title||_.id}));g(M)}catch{}},[]),tn=k.useCallback(E=>{if(V.current){try{V.current.close()}catch{}V.current=null}Y.current!==null&&(clearTimeout(Y.current),Y.current=null);const M=q.getToken(),_=M?`/api/opencode-sessions/${encodeURIComponent(E)}/stream?token=${encodeURIComponent(M)}`:`/api/opencode-sessions/${encodeURIComponent(E)}/stream`;ie.current=E,S.current=!0,b.current=0,j(null);const B=()=>{if(!S.current||ie.current!==E)return;const G=new EventSource(_);V.current=G;const le=X=>{var de,Je,at,Ht;if(!X||!X.type||X.sessionID&&X.sessionID!==E)return;const Z=new Date().toISOString(),ce=E;if(X.type==="message.user.created"||X.type==="message.user.updated"){const se=X.data;ge({id:(se==null?void 0:se.messageID)??X.messageID,role:"user",content:((de=se==null?void 0:se.data)==null?void 0:de.content)??"",ts:Z}),Le((se==null?void 0:se.messageID)??X.messageID);return}if(X.type==="message.assistant.created"||X.type==="message.assistant.updated"){const se=X.data;ge({id:(se==null?void 0:se.messageID)??X.messageID,role:"assistant",content:((Je=se==null?void 0:se.data)==null?void 0:Je.content)??"",ts:Z}),Le((se==null?void 0:se.messageID)??X.messageID),Ce(ce,!0);return}if(X.type==="message.part.updated"){const se=X.data,qu=((at=se==null?void 0:se.part)==null?void 0:at.text)??"";if(!qu)return;ge({id:(se==null?void 0:se.id)??(se==null?void 0:se.messageID)??X.messageID,role:"assistant",content:qu,ts:Z}),Le((se==null?void 0:se.id)??(se==null?void 0:se.messageID)??X.messageID),Ce(ce,!0);return}if(X.type==="session.idle"||X.type==="message.assistant.completed"||X.type==="session.completed"){Ce(ce,!1);return}if(X.type==="session.awaiting"||X.type==="session.awaiting_input"||X.type==="message.assistant.awaiting"){oe(ce,{state:"awaiting"});return}if(X.type==="session.error"){j(((Ht=X.data)==null?void 0:Ht.message)||"opencode session error");return}},ye=X=>{if(!X)return null;try{const Z=JSON.parse(X);if(typeof Z.type=="string"){const ce=Z.properties,de=Z.data??ce,Je=typeof Z.sessionID=="string"?Z.sessionID:typeof(ce==null?void 0:ce.sessionID)=="string"?ce.sessionID:typeof(de==null?void 0:de.sessionID)=="string"?de.sessionID:void 0,at=typeof Z.messageID=="string"?Z.messageID:typeof(ce==null?void 0:ce.messageID)=="string"?ce.messageID:typeof(de==null?void 0:de.messageID)=="string"?de.messageID:void 0;let Ht=Z.type;const se=/\.\d+$/.exec(Ht);return se&&(Ht=Ht.slice(0,se.index)),{type:Ht,sessionID:Je,messageID:at,data:Z}}if(Z.type==="sync"&&Z.syncEvent&&typeof Z.syncEvent=="object"){const ce=Z.syncEvent;let de=ce.type||"";const Je=/\.\d+$/.exec(de);Je&&(de=de.slice(0,Je.index));const at=ce.data||{};return{type:de,sessionID:typeof at.sessionID=="string"?at.sessionID:void 0,messageID:typeof at.messageID=="string"?at.messageID:void 0,data:ce}}return null}catch{return null}},ke=["message.user.created","message.user.updated","message.assistant.created","message.assistant.updated","message.part.updated","session.idle","message.assistant.completed","session.completed","session.awaiting","session.awaiting_input","message.assistant.awaiting","session.error"];for(const X of ke)G.addEventListener(X,Z=>{le(ye(Z.data))});G.onerror=()=>{if(ie.current!==E)return;if(!S.current){try{G.close()}catch{}V.current=null;return}try{G.close()}catch{}V.current=null;const X=b.current+1;b.current=X;const Z=Math.min(3e4,1e3*2**(X-1));Y.current!==null&&clearTimeout(Y.current),Y.current=window.setTimeout(()=>{Y.current=null,S.current&&ie.current===E&&B()},Z)},G.onopen=()=>{b.current=0,j(null)}};B()},[ge,Le,Ce,oe]),Nn=k.useCallback(()=>{if(S.current=!1,ie.current=null,Y.current!==null&&(clearTimeout(Y.current),Y.current=null),V.current){try{V.current.close()}catch{}V.current=null}C([]),$(new Set),j(null),N(null),m("bizar")},[]),Gn=k.useCallback(async E=>{var M;if(S.current=!1,V.current){try{V.current.close()}catch{}V.current=null}Y.current!==null&&(clearTimeout(Y.current),Y.current=null),j(null),c(!0);try{const _=await q.get(`/opencode-sessions/${encodeURIComponent(E)}/messages`);C(_.messages||[])}catch(_){const B=_.message;(M=R.current)==null||M.error(`Opencode session load failed: ${B}`),C([])}finally{c(!1)}N(E),m("opencode"),Ce(E,!1),tn(E)},[Ce,tn]),Mi=k.useCallback(E=>{Nn(),u(E),m("bizar"),ee(E),oe(E,{unread:0})},[Nn,ee,oe]),Ri=k.useCallback(async()=>{var M,_,B,G,le;if(f.create)return{ok:!1};const E=t.defaultAgent||"odin";h(ye=>({...ye,create:!0}));try{try{const ke=await q.post("/opencode-sessions/new",{agent:E});return await Mt(),await Gn(ke.id),(M=R.current)==null||M.success(`Session ${ke.id} created.`),{ok:!0,source:"opencode",id:ke.id}}catch(ke){if(!(ke instanceof ma)||ke.status!==503)return(_=R.current)==null||_.error(`Create failed: ${ke.message}`),{ok:!1}}if(!e.activeProject)return(B=R.current)==null||B.error("Pick a project in Overview to scope chat sessions."),{ok:!1};const ye=await q.post("/chat/sessions",{});return u(ye.id),i([]),he(new Set),oe(ye.id,{state:"idle",unread:0}),await ee(ye.id),be().catch(()=>{}),(G=R.current)==null||G.success(`Session ${ye.id} created.`),{ok:!0,source:"bizar",id:ye.id}}catch(ye){return(le=R.current)==null||le.error(`Create failed: ${ye.message}`),{ok:!1}}finally{h(ye=>({...ye,create:!1}))}},[f.create,t.defaultAgent,e.activeProject,Mt,Gn,ee,be,oe]),js=k.useCallback(async(E,M,_,B)=>{var ye,ke,X;if(f.send)return{ok:!1};const G=E.trim();if(!G)return{ok:!1};if(y==="opencode"&&v){const Z=v,ce=`msg_${Date.now().toString(36)}${Math.random().toString(36).slice(2,8)}`,de={id:ce,role:"user",content:G,agent:M,ts:new Date().toISOString()};ge(de),Le(ce),h(Je=>({...Je,send:!0}));try{return await q.post(`/opencode-sessions/${encodeURIComponent(Z)}/send`,{message:G,agent:M}),Ce(Z,!0),{ok:!0}}catch(Je){return C(at=>at.filter(Ht=>Ht.id!==ce)),(ye=R.current)==null||ye.error(`Send failed: ${Je.message}`),{ok:!1}}finally{h(Je=>({...Je,send:!1}))}}const le={role:"user",content:G,agent:M,ts:new Date().toISOString()};i(Z=>[...Z,le]),h(Z=>({...Z,send:!0})),Ce(a,!0);try{const Z=await q.post("/chat",{message:G,agent:M,model:_,attachments:B||[]});if(Z!=null&&Z.messages)for(const ce of Z.messages)ce.role==="assistant"&&i(de=>de.some(at=>at.ts===ce.ts)?de:[...de,ce]);else(ke=R.current)==null||ke.info("Still processing… the response will appear shortly.");return{ok:!0}}catch(Z){return i(ce=>ce.filter(de=>de!==le)),(X=R.current)==null||X.error(`Send failed: ${Z.message}`),{ok:!1}}finally{h(Z=>({...Z,send:!1})),Ce(a,!1)}},[y,v,ge,Le,Ce,a,f.send]),_i=k.useCallback(async E=>{var M,_;if(!a){(M=R.current)==null||M.error("No active session to regenerate.");return}try{await q.post("/chat/regenerate",{sessionId:a,messageId:E}),await ee(a)}catch(B){(_=R.current)==null||_.error(`Regenerate failed: ${B.message}`)}},[a,ee]),Oi=k.useCallback(E=>{y==="opencode"?C(M=>M.filter((_,B)=>B!==E)):i(M=>M.filter((_,B)=>B!==E))},[y]),Cs=k.useCallback(E=>{he(M=>{const _=new Set(M);return _.has(E)?_.delete(E):_.add(E),_})},[]),Ns=k.useCallback(E=>{var _,B;const M=E.content||E.message||"";try{(_=navigator.clipboard)==null||_.writeText(M).then(()=>{var G;return(G=R.current)==null?void 0:G.success("Copied.")},()=>{var G;return(G=R.current)==null?void 0:G.error("Copy failed.")})}catch{(B=R.current)==null||B.error("Copy failed.")}},[]),Es=k.useCallback(()=>{const E=ne.current;if(!E)return;const _=E.scrollHeight-E.scrollTop-E.clientHeight<32;w(_),_&&A(0)},[]),Ts=k.useCallback(()=>{const E=ne.current;E&&(E.scrollTop=E.scrollHeight,w(!0),A(0))},[]),zs=k.useCallback(async(E,M)=>{var _,B,G;if(f.rename)return!1;h(le=>({...le,rename:!0}));try{const le=M.trim();return le?(p.some(ke=>ke.id===E)?(await q.patch(`/opencode-sessions/${encodeURIComponent(E)}`,{title:le}),g(ke=>ke.map(X=>X.id===E?{...X,title:le}:X))):(await q.post(`/chat/sessions/${encodeURIComponent(E)}/rename`,{title:le}),s(ke=>ke.map(X=>X.id===E?{...X,title:le}:X))),(B=R.current)==null||B.success("Renamed."),!0):((_=R.current)==null||_.error("Title cannot be empty."),!1)}catch(le){return(G=R.current)==null||G.error(`Rename failed: ${le.message}`),!1}finally{h(le=>({...le,rename:!1}))}},[f.rename,p]),D=k.useCallback(async E=>{var M,_;if(f.delete)return!1;h(B=>({...B,delete:!0}));try{return p.some(G=>G.id===E)?(await q.del(`/opencode-sessions/${encodeURIComponent(E)}`),g(G=>G.filter(le=>le.id!==E)),v===E&&Nn()):(await q.del(`/chat/sessions/${encodeURIComponent(E)}`),s(G=>G.filter(le=>le.id!==E)),a===E&&(u(""),i([]))),L(G=>{const le={...G};return delete le[E],le}),(M=R.current)==null||M.success("Session deleted."),!0}catch(B){return(_=R.current)==null||_.error(`Delete failed: ${B.message}`),!1}finally{h(B=>({...B,delete:!1}))}},[f.delete,p,v,Nn,a]);return k.useEffect(()=>{ne.current&&(T?ne.current.scrollTop=ne.current.scrollHeight:A(E=>E+1))},[r,x]),k.useEffect(()=>()=>{if(S.current=!1,ie.current=null,Y.current!==null&&(clearTimeout(Y.current),Y.current=null),V.current){try{V.current.close()}catch{}V.current=null}},[]),k.useEffect(()=>{n?re(n):ee(),Mt()},[]),k.useEffect(()=>{const E=M=>{var B;const _=(B=M.detail)==null?void 0:B.taskId;_&&re(_)};return window.addEventListener("bizar:setChatTask",E),()=>window.removeEventListener("bizar:setChatTask",E)},[re]),k.useEffect(()=>{let E=!1;return Hm(async()=>{const{Ws:M}=await Promise.resolve().then(()=>s1);return{Ws:M}},void 0).then(({Ws:M})=>{if(E)return;new M().on(B=>{if(B.type!=="chat:message")return;const G=B.message;G&&i(le=>le.some(ke=>ke.ts===G.ts)?le:[...le,G])})}),()=>{E=!0}},[]),{messages:y==="opencode"?x:r,bizarMessages:r,opencodeMessages:x,sessions:l,opencodeSessions:p,sessionId:a,setSessionId:u,loading:d,sending:f.send,pinned:Q,listRef:ne,activeSource:y,activeOpencodeSessionId:v,opencodeError:P,sessionStates:I,busy:f,getSessionDisplay:E=>{var M,_,B,G;return{...E,state:((M=I[E.id])==null?void 0:M.state)??"idle",unread:((_=I[E.id])==null?void 0:_.unread)??0,pinned:((B=I[E.id])==null?void 0:B.pinned)??!1,tree:(G=I[E.id])==null?void 0:G.tree}},stickToBottom:T,newMessageCount:z,handleScroll:Es,jumpToLatest:Ts,setToast:U,loadChat:ee,loadTaskChat:re,refreshSessions:be,refreshOpencodeSessions:Mt,loadOpencodeSession:Gn,closeOpencodeSession:Nn,selectBizarSession:Mi,onCreateSession:Ri,onSend:js,onRegenerate:_i,deleteMessage:Oi,togglePin:Cs,copyMessage:Ns,renameSession:zs,deleteSession:D,seenOpencodeMessages:H}}const fj=[{cmd:"/visual-plan [on|off|status]",desc:"Toggle or view visual plan mode"},{cmd:"/plan new <slug> [template]",desc:"Create a new plan"},{cmd:"/plan list",desc:"List all plans"},{cmd:"/plan open <slug>",desc:"Open a plan in the viewer"},{cmd:"/plan status <slug> <status>",desc:"Set plan status"},{cmd:"/plan get <slug>",desc:"Fetch plan canvas"},{cmd:"/plan add <slug> --title T --type kind",desc:"Add element to a plan"},{cmd:"/plan update <slug> <id>",desc:"Update a plan element"},{cmd:"/plan delete <slug> <id>",desc:"Delete a plan element"},{cmd:'/plan comment <slug> [id] "text"',desc:"Add a comment"},{cmd:"/plan comments <slug> [id]",desc:"Read plan comments"},{cmd:"/bizar",desc:"Launch Bizar dashboard"},{cmd:"/bizar <args>",desc:"Route via Bizar menu"},{cmd:"/audit",desc:"Run security audit"},{cmd:"/explain <q>",desc:"Read-only code Q&A"},{cmd:"/init",desc:"Initialize .bizar/ in this project"},{cmd:"/learn",desc:"Extract patterns from session"},{cmd:"/pr-review",desc:"PR review"},{cmd:"/help | /commands",desc:"Show all Bizar commands"}];function pj(e){const[t,n]=k.useState(""),r=k.useMemo(()=>[...fj,...(e.mods||[]).flatMap(l=>{var s;return(s=l.entry)!=null&&s.command?[{cmd:`/${l.id}`,desc:l.description||l.name,mod:l.id}]:[]})],[e.mods]),i=k.useMemo(()=>{if(!t.startsWith("/")||t.includes(" "))return[];const l=t.toLowerCase();return r.filter(s=>s.cmd.toLowerCase().startsWith(l)).slice(0,6)},[t,r]);return{allCommands:r,suggestions:i,setQuery:n}}function hj({tabs:e,activeTab:t,onChange:n}){return o.jsx("nav",{className:"mobile-bottom-nav",role:"navigation","aria-label":"Mobile navigation",children:e.map(r=>{const i=r.icon;return o.jsxs("button",{type:"button",className:Cu("mobile-nav-btn",t===r.id&&"mobile-nav-btn-active"),onClick:()=>n(r.id),"aria-label":r.label,"aria-current":t===r.id?"page":void 0,children:[o.jsx(i,{size:22}),o.jsx("span",{className:"mobile-nav-label",children:r.label})]},r.id)})})}function At({open:e,onClose:t,title:n,children:r,actions:i,maxHeight:l="85vh"}){const s=k.useRef(null),a=k.useRef(null),u=k.useId(),d=k.useRef(null),c=k.useRef(null),f=k.useRef(0),h=k.useRef(0),p=()=>{var y;return((y=s.current)==null?void 0:y.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'))??[]};if(k.useEffect(()=>{if(!e)return;d.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const y=m=>{var I;if(m.key==="Escape"&&t(),m.key!=="Tab")return;const v=Array.from(p());if(v.length===0){m.preventDefault(),(I=s.current)==null||I.focus();return}const N=v[0],P=v[v.length-1],j=document.activeElement;if(m.shiftKey){(!j||j===N||j===s.current)&&(m.preventDefault(),P==null||P.focus());return}j===P&&(m.preventDefault(),N==null||N.focus())};return window.addEventListener("keydown",y),requestAnimationFrame(()=>{var m,v;((m=a.current)==null?void 0:m.focus())??((v=s.current)==null||v.focus())}),()=>{var m;window.removeEventListener("keydown",y),(m=d.current)==null||m.focus()}},[e,t]),k.useEffect(()=>(e?(h.current=window.scrollY,document.documentElement.style.overflow="hidden",document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.top=`-${h.current}px`,document.body.style.left="0",document.body.style.right="0",document.body.style.width="100%"):(document.documentElement.style.overflow="",document.body.style.overflow="",document.body.style.position="",document.body.style.top="",document.body.style.left="",document.body.style.right="",document.body.style.width=""),()=>{document.documentElement.style.overflow="",document.body.style.overflow="",document.body.style.position="",document.body.style.top="",document.body.style.left="",document.body.style.right="",document.body.style.width="",window.scrollTo(0,h.current)}),[e]),!e)return null;const g=y=>{var m;y.isPrimary&&(c.current=y.clientY,f.current=0,(m=s.current)==null||m.setPointerCapture(y.pointerId))},x=y=>{if(c.current==null||!s.current)return;const m=Math.max(0,y.clientY-c.current);f.current=m,s.current.style.transform=`translateY(${m}px)`},C=y=>{if(!s.current)return;y&&s.current.hasPointerCapture(y.pointerId)&&s.current.releasePointerCapture(y.pointerId);const m=f.current;s.current.style.transform="",c.current=null,f.current=0,m>72&&t()};return o.jsx("div",{className:"mobile-sheet-overlay",onClick:t,children:o.jsxs("div",{ref:s,className:"mobile-sheet",style:{maxHeight:l},onClick:y=>y.stopPropagation(),role:"dialog","aria-modal":!0,"aria-label":n?void 0:"Sheet","aria-labelledby":n?u:void 0,tabIndex:-1,children:[o.jsx("div",{className:"mobile-sheet-handle",onPointerDown:g,onPointerMove:x,onPointerUp:C,onPointerCancel:C,"aria-hidden":"true"}),o.jsxs("div",{className:"mobile-sheet-header",children:[n?o.jsx("h3",{id:u,className:"mobile-sheet-title",children:n}):o.jsx("div",{}),o.jsx("button",{ref:a,type:"button",className:"mobile-icon-btn",onClick:t,"aria-label":"Close",children:o.jsx(Yn,{size:18})})]}),o.jsx("div",{className:"mobile-sheet-content",children:r}),i&&o.jsx("div",{className:"mobile-sheet-actions",children:i})]})})}function mj(e){switch(e){case"success":return"✓";case"error":return"✗";case"warning":return"⚠";default:return"ℹ"}}function gj(e){const t=new Date(e),r=Date.now()-t.getTime();return r<6e4?"just now":r<36e5?`${Math.floor(r/6e4)}m ago`:r<864e5?`${Math.floor(r/36e5)}h ago`:t.toLocaleDateString()}function yj({onSelect:e}){const[t,n]=k.useState(!1),[r,i]=k.useState([]),[l,s]=k.useState(0),a=async()=>{var c;try{const f=await q.get("/notifications");i(f.notifications||[]),s(((c=f.stats)==null?void 0:c.unread)||0)}catch{}};k.useEffect(()=>{a()},[]),k.useEffect(()=>{t&&a()},[t]);const u=async()=>{try{await q.post("/notifications/read-all"),i(c=>c.map(f=>({...f,read:!0}))),s(0)}catch{}},d=async c=>{try{await q.post(`/notifications/${encodeURIComponent(c)}/read`),i(f=>f.map(h=>h.id===c?{...h,read:!0}:h)),s(f=>Math.max(0,f-1))}catch{}};return o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",className:"mobile-icon-btn mobile-notif-btn",onClick:()=>n(!0),"aria-label":`Notifications${l>0?` (${l} unread)`:""}`,children:[o.jsx(nd,{size:20}),l>0&&o.jsx("span",{className:"mobile-notif-badge",children:l>9?"9+":l})]}),o.jsx(At,{open:t,onClose:()=>n(!1),title:"Notifications",actions:l>0?o.jsxs("button",{type:"button",className:"mobile-btn mobile-btn-secondary",style:{width:"100%"},onClick:u,children:[o.jsx(Ex,{size:14})," Mark all read"]}):void 0,children:o.jsxs("div",{className:"mobile-notif-list",children:[r.length===0&&o.jsxs("div",{className:"mobile-empty",children:[o.jsx(nd,{size:32}),o.jsx("p",{children:"No notifications"})]}),r.map(c=>o.jsxs("button",{type:"button",className:`mobile-notif-item ${c.read?"read":"unread"}`,onClick:()=>{c.read||d(c.id),e(c),n(!1)},children:[o.jsx("span",{className:`mobile-notif-icon severity-${c.severity}`,children:mj(c.severity)}),o.jsxs("div",{className:"mobile-notif-body",children:[o.jsx("span",{className:"mobile-notif-title",children:c.title||c.message}),c.message&&c.title&&o.jsx("span",{className:"mobile-notif-text",children:c.message}),o.jsx("span",{className:"mobile-notif-time",children:gj(c.ts)})]}),!c.read&&o.jsx("span",{className:"mobile-notif-dot"})]},c.id))]})})]})}const xj={activity:"Activity",chat:"Chat",tasks:"Tasks",settings:"Settings",more:"More",plans:"Plans",agents:"Agents",skills:"Skills",mods:"Mods",schedules:"Schedules",history:"History",config:"Config","plan-detail":"Plan","agent-detail":"Agent","task-detail":"Task"};function vj({activeTab:e,snapshot:t,onSearch:n,onNavigate:r}){const[i,l]=k.useState(!1),s=async a=>{try{await q.post(`/projects/${encodeURIComponent(a)}/activate`),l(!1),window.location.reload()}catch{}};return o.jsxs("header",{className:"mobile-topbar",children:[o.jsxs("div",{className:"mobile-topbar-left",children:[o.jsx("span",{className:"mobile-logo",children:"ᛒ"}),(t==null?void 0:t.activeProject)&&o.jsxs("button",{type:"button",className:"mobile-project-btn",onClick:()=>l(!0),"aria-label":"Select project",children:[o.jsx("span",{className:"mobile-project-name",children:t.activeProject.name}),o.jsx(ys,{size:14})]}),o.jsx("span",{className:"mobile-title",children:xj[e]||"Bizar"})]}),o.jsxs("div",{className:"mobile-topbar-right",children:[o.jsx("button",{type:"button",className:"mobile-icon-btn",onClick:n,"aria-label":"Search",children:o.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[o.jsx("circle",{cx:"11",cy:"11",r:"8"}),o.jsx("path",{d:"m21 21-4.35-4.35"})]})}),o.jsx(yj,{onSelect:a=>{r("notification",a.link||"",a.meta??null)}}),(t==null?void 0:t.activeProject)&&o.jsx(At,{open:i,onClose:()=>l(!1),title:"Projects",children:o.jsx("div",{className:"mobile-project-list",children:(t.projects||[]).map(a=>{var u,d;return o.jsxs("button",{type:"button",className:`mobile-project-item ${a.id===((u=t.activeProject)==null?void 0:u.id)?"active":""}`,onClick:()=>s(a.id),children:[o.jsx("div",{className:"mobile-project-status","data-status":a.status}),o.jsxs("div",{className:"mobile-project-info",children:[o.jsx("span",{className:"mobile-project-item-name",children:a.name}),o.jsx("span",{className:"mobile-project-item-path",children:a.path})]}),a.id===((d=t.activeProject)==null?void 0:d.id)&&o.jsx("span",{className:"mobile-active-badge",children:"active"})]},a.id)})})})]})]})}const kj=["all","tasks","agents","bg","artifacts","mods"],xo={all:"All",tasks:"Tasks",agents:"Agents",bg:"Background",artifacts:"Plans",mods:"Mods"};function wj({snapshot:e,onRefresh:t}){var L;const[n,r]=k.useState(((L=e.overview)==null?void 0:L.recentActivity)||[]),[i,l]=k.useState(!0),[s,a]=k.useState("all"),[u,d]=k.useState(!1),[c,f]=k.useState(null),[h,p]=k.useState(""),[g,x]=k.useState(!1);k.useEffect(()=>{var T;(T=e.overview)!=null&&T.recentActivity?(r(e.overview.recentActivity),l(!1)):C()},[e.overview]);const C=async()=>{var T;try{const w=await q.get("/snapshot");r(((T=w.overview)==null?void 0:T.recentActivity)||[])}catch{}finally{l(!1)}},y=s==="all"?n:n.filter(T=>{var w,z,A,H,$,Q;return s==="tasks"?(w=T.kind)==null?void 0:w.startsWith("task"):s==="agents"?(z=T.kind)==null?void 0:z.startsWith("agent"):s==="bg"?((A=T.kind)==null?void 0:A.includes("bg"))||((H=T.kind)==null?void 0:H.includes("schedule")):s==="artifacts"?($=T.kind)==null?void 0:$.includes("artifacts"):s==="mods"?(Q=T.kind)==null?void 0:Q.includes("mod"):!0}),m=e.agents||[],v=e.tasks||[],N=v.filter(T=>T.status==="doing"||T.status==="queued"),P=v.filter(T=>T.status==="done"),j=async()=>{if(!(!h.trim()||g)){x(!0);try{await q.post("/chat",{message:h.trim(),agent:"odin"}),p(""),await t().catch(()=>{}),await C()}catch{}finally{x(!1)}}},I=async()=>{await t().catch(()=>{}),await C()};return o.jsxs("div",{className:"mobile-view",children:[o.jsxs("div",{className:"mobile-submit-hero",children:[o.jsx("textarea",{className:"mobile-submit-input",placeholder:"What needs to be done? Describe a task, bug, or refactor for Odin to artifacts…",value:h,onChange:T=>p(T.target.value),rows:2}),o.jsxs("div",{className:"mobile-submit-actions",children:[o.jsx("div",{className:"mobile-submit-chips",children:["Implement feature","Fix bug","Refactor","Investigate","Write tests"].map(T=>o.jsx("button",{type:"button",className:"mobile-submit-chip",onClick:()=>p(w=>w?`${w} ${T}`:T),children:T},T))}),o.jsxs("button",{type:"button",className:"mobile-btn",disabled:!h.trim()||g,onClick:j,children:[o.jsx(Lh,{size:14})," Submit to Odin"]})]})]}),o.jsxs("div",{className:"mobile-stats",children:[o.jsxs("div",{className:"mobile-stat",children:[o.jsx("div",{className:"mobile-stat-value",children:m.length}),o.jsx("div",{className:"mobile-stat-label",children:"Agents"})]}),o.jsxs("div",{className:"mobile-stat",children:[o.jsx("div",{className:"mobile-stat-value",children:N.length}),o.jsx("div",{className:"mobile-stat-label",children:"Active"})]}),o.jsxs("div",{className:"mobile-stat",children:[o.jsx("div",{className:"mobile-stat-value",children:P.length}),o.jsx("div",{className:"mobile-stat-label",children:"Done"})]}),o.jsxs("div",{className:"mobile-stat",children:[o.jsx("div",{className:"mobile-stat-value",children:e.artifacts.length||0}),o.jsx("div",{className:"mobile-stat-label",children:"Plans"})]})]}),i&&n.length===0&&o.jsx("div",{className:"mobile-loading mobile-loading-inline",children:o.jsx("p",{children:"Loading activity…"})}),o.jsxs("div",{className:"mobile-activity-header",children:[o.jsx("h3",{className:"mobile-section-title",style:{margin:0},children:"Recent Activity"}),o.jsxs("div",{style:{display:"flex",gap:4},children:[o.jsx("button",{type:"button",className:"mobile-icon-btn",onClick:()=>d(T=>!T),"aria-label":u?"Resume":"Pause",children:u?o.jsx(Ql,{size:14}):o.jsx($x,{size:14})}),o.jsx("button",{type:"button",className:"mobile-icon-btn",onClick:I,"aria-label":"Refresh",children:o.jsx(Dt,{size:14})})]})]}),o.jsx("div",{className:"mobile-search-scopes",children:kj.map(T=>o.jsx("button",{type:"button",className:`mobile-scope-chip ${s===T?"active":""}`,onClick:()=>a(T),children:xo[T]},T))}),m.length>0&&o.jsxs("section",{className:"mobile-section",children:[o.jsxs("h3",{className:"mobile-section-title",children:[o.jsx(Pr,{size:14})," Agents"]}),o.jsx("div",{className:"mobile-card-list",children:m.slice(0,6).map(T=>o.jsxs("div",{className:"mobile-agent-card",children:[o.jsx("div",{className:"mobile-agent-dot","data-status":T.status||"idle"}),o.jsxs("div",{className:"mobile-agent-info",children:[o.jsx("span",{className:"mobile-agent-name",children:T.name}),o.jsx("span",{className:"mobile-agent-meta",children:T.status||"idle"})]})]},T.name))})]}),!u&&y.length>0&&o.jsx("section",{className:"mobile-section",children:o.jsx("div",{className:"mobile-card-list",children:y.slice(0,30).map((T,w)=>o.jsxs("button",{type:"button",className:"mobile-event-item",onClick:()=>f(T),children:[o.jsx("span",{className:"mobile-event-kind","data-kind":T.kind,children:xo[T.kind]||T.kind}),o.jsx("span",{className:"mobile-event-msg",children:bj(T)}),o.jsx("span",{className:"mobile-event-time",children:xr(T.ts)})]},`${T.ts}-${T.kind}-${w}`))})}),!u&&y.length===0&&n.length>0&&o.jsxs("div",{className:"mobile-empty",children:[o.jsx(fa,{size:40}),o.jsx("p",{children:"No matching activity."}),o.jsx("p",{className:"muted",children:"Try a different filter."})]}),c&&o.jsx(At,{open:!0,onClose:()=>f(null),title:xo[c.kind]||c.kind,children:o.jsxs("div",{className:"mobile-agent-detail-meta",children:[o.jsxs("div",{className:"mobile-task-detail-row",children:[o.jsx("span",{children:"Kind"}),o.jsx("span",{children:c.kind})]}),o.jsxs("div",{className:"mobile-task-detail-row",children:[o.jsx("span",{children:"Time"}),o.jsx("span",{children:new Date(c.ts).toLocaleString()})]}),Object.entries(c).filter(([T])=>!["ts","kind"].includes(T)).map(([T,w])=>o.jsxs("div",{className:"mobile-task-detail-row",children:[o.jsx("span",{children:T}),o.jsx("span",{style:{fontSize:12,maxWidth:200,wordBreak:"break-all"},children:typeof w=="object"?JSON.stringify(w):String(w)})]},T))]})}),m.length===0&&N.length===0&&o.jsxs("div",{className:"mobile-empty",children:[o.jsx(fa,{size:40}),o.jsx("p",{children:"No activity yet."}),o.jsx("p",{className:"muted",children:"Start a task or chat to see things here."})]})]})}function bj(e){const t=e.kind||"";return t.includes("task")?`Task: ${e.title||e.id||"updated"}`:t.includes("agent")?`Agent: ${e.name||"status changed"}`:t.includes("artifacts")?`Plan: ${e.slug||"changed"}`:t.includes("mod")?`Mod: ${e.name||"changed"}`:t.includes("schedule")?`Schedule: ${e.name||"triggered"}`:JSON.stringify(e).slice(0,80)}function Cn({open:e,onClose:t,title:n,children:r,actions:i}){const l=k.useRef(null),s=k.useRef(null),a=k.useRef(null),u=k.useId(),d=k.useRef(0);return k.useEffect(()=>{if(!e)return;a.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const c='button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])',f=h=>{var y,m;if(h.key==="Escape"&&t(),h.key!=="Tab")return;const p=Array.from(((y=l.current)==null?void 0:y.querySelectorAll(c))??[]);if(p.length===0){h.preventDefault(),(m=l.current)==null||m.focus();return}const g=p[0],x=p[p.length-1],C=document.activeElement;if(h.shiftKey){(!C||C===g||C===l.current)&&(h.preventDefault(),x==null||x.focus());return}C===x&&(h.preventDefault(),g==null||g.focus())};return window.addEventListener("keydown",f),d.current=window.scrollY,document.documentElement.style.overflow="hidden",document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.top=`-${d.current}px`,document.body.style.left="0",document.body.style.right="0",document.body.style.width="100%",requestAnimationFrame(()=>{var h,p;((h=s.current)==null?void 0:h.focus())??((p=l.current)==null||p.focus())}),()=>{var h;window.removeEventListener("keydown",f),document.documentElement.style.overflow="",document.body.style.overflow="",document.body.style.position="",document.body.style.top="",document.body.style.left="",document.body.style.right="",document.body.style.width="",window.scrollTo(0,d.current),(h=a.current)==null||h.focus()}},[e,t]),e?o.jsx("div",{className:"mobile-modal-overlay",onClick:c=>{c.target===c.currentTarget&&t()},children:o.jsxs("div",{ref:l,className:"mobile-modal",onClick:c=>c.stopPropagation(),role:"dialog","aria-modal":!0,"aria-label":n?void 0:"Modal","aria-labelledby":n?u:void 0,tabIndex:-1,children:[o.jsxs("div",{className:"mobile-modal-header",children:[n?o.jsx("h2",{id:u,className:"mobile-modal-title",children:n}):o.jsx("div",{}),o.jsx("button",{ref:s,type:"button",className:"mobile-icon-btn",onClick:t,"aria-label":"Close",children:o.jsx(Yn,{size:20})})]}),o.jsx("div",{className:"mobile-modal-content",children:r}),i&&o.jsx("div",{className:"mobile-modal-actions",children:i})]})}):null}const Vm=["reasoning","code","design","planning","gitops","analysis"],af={reasoning:"var(--accent)",code:"var(--info)",design:"var(--success)",planning:"var(--warning)",gitops:"var(--error)",analysis:"var(--text-dim)"};function uf({snapshot:e,onBack:t,onOpenAgent:n,selectedAgent:r,onRefresh:i}){const[l,s]=k.useState(e.agents||[]),[a,u]=k.useState(!e.agents),[d,c]=k.useState(""),[f,h]=k.useState(""),[p,g]=k.useState(null),[x,C]=k.useState(!1),[y,m]=k.useState(""),[v,N]=k.useState(!1);k.useEffect(()=>{if(r){const z=l.find(A=>A.name===r);z&&g(z)}},[r,l]);const P=async()=>{try{const z=await q.get("/agents");s(z.agents||[])}catch{}finally{u(!1)}},j=l.filter(z=>{if(d&&z.category!==d)return!1;if(f){const A=f.toLowerCase();if(!z.name.toLowerCase().includes(A)&&!(z.description||"").toLowerCase().includes(A))return!1}return!0}),I=async(z,A)=>{try{await q.post(`/agents/${encodeURIComponent(z)}/invoke`,{prompt:A}),N(!1),m("")}catch{}},L=async z=>{try{await q.post(`/agents/${encodeURIComponent(z)}/restart`),await P()}catch{}},T=async z=>{if(confirm(`Delete agent "${z}"?`))try{await q.del(`/agents/${encodeURIComponent(z)}`),s(A=>A.filter(H=>H.name!==z)),g(null),i==null||i()}catch{}},w=async z=>{try{const A=await q.post("/agents",z);s(H=>[...H,A]),C(!1),i==null||i()}catch{}};return o.jsxs("div",{className:"mobile-view",children:[o.jsxs("div",{className:"mobile-tasks-toolbar",children:[o.jsx("input",{className:"mobile-search-input",type:"text",placeholder:"Search agents…",value:f,onChange:z=>h(z.target.value),style:{flex:1}}),o.jsx("button",{type:"button",className:"mobile-icon-btn",onClick:()=>P(),"aria-label":"Refresh",children:o.jsx(Dt,{size:16})}),o.jsx("button",{type:"button",className:"mobile-icon-btn",onClick:()=>C(!0),"aria-label":"New agent",children:o.jsx(mt,{size:16})})]}),o.jsxs("div",{className:"mobile-search-scopes",children:[o.jsx("button",{type:"button",className:`mobile-scope-chip ${d?"":"active"}`,onClick:()=>c(""),children:"All"}),Vm.map(z=>o.jsx("button",{type:"button",className:`mobile-scope-chip ${d===z?"active":""}`,onClick:()=>c(z),children:z},z))]}),a?o.jsx("div",{className:"mobile-loading",children:o.jsx("p",{children:"Loading…"})}):j.length===0?o.jsxs("div",{className:"mobile-empty",children:[o.jsx(Pr,{size:40}),o.jsx("p",{children:"No agents found."})]}):o.jsx("div",{className:"mobile-card-list",children:j.map(z=>o.jsxs("button",{type:"button",className:"mobile-list-item mobile-list-item-interactive",onClick:()=>{g(z),n(z.name)},children:[o.jsx("div",{className:"mobile-agent-dot","data-status":z.status||"idle"}),o.jsxs("div",{className:"mobile-list-content",children:[o.jsx("span",{className:"mobile-list-title",children:z.name}),o.jsx("span",{className:"mobile-list-meta",children:z.model||z.mode||"—"})]}),z.category&&o.jsx("span",{className:"mobile-list-badge",style:{color:af[z.category]||"var(--text-dim)"},children:z.category}),o.jsx("span",{className:"mobile-list-badge","data-status":z.status||"idle",children:z.status||"idle"})]},z.name))}),p&&o.jsx(At,{open:!0,onClose:()=>g(null),title:p.name,actions:o.jsxs("div",{className:"mobile-task-detail-actions",children:[o.jsxs("button",{type:"button",className:"mobile-btn",onClick:()=>{m(""),N(!0)},children:[o.jsx(Ql,{size:14})," Invoke"]}),(p.isStuck||p.status==="error"||p.status==="working")&&o.jsxs("button",{type:"button",className:"mobile-btn mobile-btn-secondary",onClick:()=>L(p.name),children:[o.jsx(Hx,{size:14})," Restart"]}),o.jsx("button",{type:"button",className:"mobile-btn mobile-btn-danger",onClick:()=>T(p.name),children:o.jsx(Lr,{size:14})})]}),children:o.jsxs("div",{className:"mobile-agent-detail",children:[o.jsxs("div",{className:"mobile-agent-detail-status",children:[o.jsx("span",{className:"mobile-agent-dot","data-status":p.status||"idle"}),o.jsx("span",{className:"mobile-agent-detail-status-text",children:p.status||"idle"}),p.category&&o.jsx("span",{className:"mobile-list-badge",style:{color:af[p.category]},children:p.category})]}),o.jsx("p",{className:"mobile-agent-detail-desc",children:p.description||"No description."}),o.jsxs("div",{className:"mobile-agent-detail-meta",children:[o.jsxs("div",{className:"mobile-task-detail-row",children:[o.jsx("span",{children:"Model"}),o.jsx("span",{className:"mono",children:p.model||"—"})]}),o.jsxs("div",{className:"mobile-task-detail-row",children:[o.jsx("span",{children:"Mode"}),o.jsx("span",{children:p.mode||"subagent"})]}),o.jsxs("div",{className:"mobile-task-detail-row",children:[o.jsx("span",{children:"Path"}),o.jsx("span",{className:"mono",style:{fontSize:11},children:p.path})]}),p.lastError&&o.jsxs("div",{className:"mobile-task-detail-row",style:{color:"var(--error)"},children:[o.jsx("span",{children:"Last error"}),o.jsx("span",{children:p.lastError.message})]}),p.tasksTotal!=null&&p.tasksTotal>0&&o.jsxs("div",{className:"mobile-task-detail-row",children:[o.jsx("span",{children:"Success rate"}),o.jsxs("span",{children:[Math.round((p.successRate||0)*100),"%"]})]}),o.jsxs("div",{className:"mobile-task-detail-row",children:[o.jsx("span",{children:"Last modified"}),o.jsx("span",{children:xr(p.mtime)})]})]})]})}),o.jsxs(Cn,{open:v,onClose:()=>N(!1),title:`Invoke ${p==null?void 0:p.name}`,actions:o.jsxs("button",{type:"button",className:"mobile-btn",style:{width:"100%"},disabled:!y.trim(),onClick:()=>{p&&I(p.name,y.trim())},children:[o.jsx(Ql,{size:14})," Invoke"]}),children:[o.jsxs("p",{className:"muted",style:{marginBottom:12},children:["Model: ",o.jsx("span",{className:"mono",children:(p==null?void 0:p.model)||"—"})]}),o.jsx("textarea",{className:"mobile-input",rows:5,placeholder:"What should this agent do?",value:y,onChange:z=>m(z.target.value),autoFocus:!0})]}),o.jsx(Sj,{open:x,onClose:()=>C(!1),onCreate:w})]})}function Sj({open:e,onClose:t,onCreate:n}){const[r,i]=k.useState(""),[l,s]=k.useState(""),[a,u]=k.useState(""),[d,c]=k.useState("subagent"),[f,h]=k.useState("#8b5cf6"),[p,g]=k.useState(""),[x,C]=k.useState(""),[y,m]=k.useState(""),v=N=>{N.preventDefault(),r.trim()&&(n({name:r.trim(),description:l.trim(),model:a,mode:d,color:f,tools:[],tags:x.split(",").map(P=>P.trim()).filter(Boolean),category:p,prompt:y}),i(""),s(""),u(""),c("subagent"),h("#8b5cf6"),g(""),C(""),m(""))};return o.jsx(Cn,{open:e,onClose:t,title:"New Agent",actions:o.jsxs("button",{type:"submit",form:"new-agent-form",className:"mobile-btn",style:{width:"100%"},children:[o.jsx(mt,{size:14})," Create"]}),children:o.jsxs("form",{id:"new-agent-form",onSubmit:v,className:"mobile-task-form",children:[o.jsx("label",{className:"mobile-field-label",children:"Name *"}),o.jsx("input",{className:"mobile-input",type:"text",placeholder:"my-agent",pattern:"[a-z0-9][a-z0-9-]{0,63}",value:r,onChange:N=>i(N.target.value),autoFocus:!0,required:!0}),o.jsx("label",{className:"mobile-field-label",children:"Description"}),o.jsx("input",{className:"mobile-input",type:"text",placeholder:"What does this agent do?",value:l,onChange:N=>s(N.target.value)}),o.jsx("label",{className:"mobile-field-label",children:"Model"}),o.jsx("input",{className:"mobile-input",type:"text",placeholder:"(provider default)",value:a,onChange:N=>u(N.target.value)}),o.jsx("label",{className:"mobile-field-label",children:"Category"}),o.jsxs("select",{className:"mobile-input",value:p,onChange:N=>g(N.target.value),children:[o.jsx("option",{value:"",children:"None"}),Vm.map(N=>o.jsx("option",{value:N,children:N},N))]}),o.jsx("label",{className:"mobile-field-label",children:"Tags (comma-separated)"}),o.jsx("input",{className:"mobile-input",type:"text",placeholder:"tag1, tag2",value:x,onChange:N=>C(N.target.value)})]})})}function jj({sessions:e,opencodeSessions:t,activeSessionId:n,activeOpencodeSessionId:r,activeProject:i,creating:l,onCreateSession:s,onSelectSession:a,onSelectOpencodeSession:u}){const[d,c]=k.useState("all"),[f,h]=k.useState(!1),p=30,g=d==="all"?[...e,...t].sort((m,v)=>Number(v.mtime)-Number(m.mtime)):e,x=f?g:g.slice(0,p),C=t.length,y=m=>{if(m.source==="opencode"){u(m);return}a(m.id)};return o.jsxs("div",{className:"chat-sessions",children:[o.jsxs("div",{className:"chat-sessions-header",children:[o.jsx("span",{className:"chat-sessions-header-title",children:"Sessions"}),o.jsx("span",{className:"chat-sessions-count",children:x.length})]}),C>0&&o.jsxs("div",{className:"chat-sessions-toggle",children:[o.jsx("button",{type:"button",className:`chat-sessions-toggle-btn ${d==="bizar"?"active":""}`,onClick:()=>c("bizar"),children:"Bizar"}),o.jsxs("button",{type:"button",className:`chat-sessions-toggle-btn ${d==="all"?"active":""}`,onClick:()=>c("all"),children:["All (",C," opencode)"]})]}),o.jsxs("button",{type:"button",className:"chat-sessions-new",onClick:s,disabled:l||!i,title:i?"Create new session":"Pick a project first","aria-label":"Create new session",children:[l?o.jsx(_h,{size:"sm"}):o.jsx(mt,{size:14}),o.jsx("span",{children:l?"Creating…":"New session"})]}),e.length===0?o.jsx("div",{className:"chat-sessions-empty",children:o.jsx(u1,{icon:o.jsx(Yl,{size:20}),title:i?"No sessions yet":"No project",message:i?"Create your first session to start chatting.":"Pick a project in Overview to scope chat sessions.",action:i?o.jsxs(dr,{variant:"primary",size:"sm",onClick:s,loading:l,children:[o.jsx(mt,{size:12})," New session"]}):o.jsxs(dr,{variant:"secondary",size:"sm",onClick:()=>{window.location.hash="#overview"},children:[o.jsx(Su,{size:12})," Open Overview"]})})}):o.jsx("ul",{className:"chat-sessions-list",children:x.map(m=>{const v=m.source==="opencode",N=v?r===m.id:n===m.id;return o.jsxs("li",{className:`chat-sessions-item ${N?"active":""} ${v?"chat-sessions-item-opencode":""}`,onClick:()=>y(m),title:v?`Open in dashboard: ${m.title||m.id}`:m.id,children:[v&&o.jsx(Ax,{size:10,className:"chat-sessions-item-icon"}),o.jsx("span",{className:"chat-sessions-item-id",children:m.title||m.id}),o.jsx("span",{className:"chat-sessions-item-meta",children:new Date(Number(m.mtime)).toLocaleDateString()})]},v?`oc-${m.id}`:m.id)})}),g.length>p&&o.jsx("button",{type:"button",className:"chat-sessions-show-more",onClick:()=>h(m=>!m),children:f?`Show less (${g.length-p} hidden)`:`Show all ${g.length} sessions`})]})}function Cj(e){const{activeSource:t}=e;return o.jsx("div",{className:`chat-composer-wrap chat-composer-source-${t??"none"} legacy`,children:o.jsx("div",{className:"chat-composer-pill",children:o.jsx(aj,{...e})})})}function Nj({sessionId:e,messages:t,pinned:n,agent:r,model:i,agents:l,mcps:s,allCommands:a,activeSource:u="bizar",onRename:d,onDelete:c}){const[f,h]=k.useState(!1),[p,g]=k.useState(!1),x=f?l:l.slice(0,4),C=p?a:a.slice(0,4),y=i.includes("/")?i.split("/")[0]:"";return o.jsxs("div",{className:"chat-info",children:[o.jsxs("div",{className:"chat-info-card",children:[o.jsxs("div",{className:"chat-info-card-title",children:[o.jsx(Mn,{size:14})," Session",o.jsx("span",{className:`chat-source-badge chat-source-${u??"none"}`,style:{marginLeft:"auto"},children:u==="opencode"?"opencode":"bizar chat"})]}),o.jsxs("dl",{className:"env-table",children:[o.jsx("dt",{children:"id"}),o.jsx("dd",{className:"mono",children:e||"Live"}),o.jsx("dt",{children:"Messages"}),o.jsx("dd",{className:"mono",children:t.length}),o.jsx("dt",{children:"Pinned"}),o.jsx("dd",{className:"mono",children:n.size}),o.jsx("dt",{children:"Agent"}),o.jsx("dd",{className:"mono",children:r||"—"}),o.jsx("dt",{children:"Model"}),o.jsx("dd",{className:"mono ellipsis",title:i,children:i||"—"}),y&&o.jsxs(o.Fragment,{children:[o.jsx("dt",{children:"Provider"}),o.jsx("dd",{className:"mono",children:y})]})]}),(d||c)&&o.jsxs("div",{className:"chat-info-actions",children:[d&&o.jsxs("button",{type:"button",className:"btn btn-ghost btn-sm",onClick:d,children:[o.jsx(ju,{size:12,"aria-hidden":!0})," Rename"]}),c&&o.jsxs("button",{type:"button",className:"btn btn-ghost btn-danger btn-sm",onClick:c,children:[o.jsx(Lr,{size:12,"aria-hidden":!0})," Delete"]})]})]}),o.jsxs("div",{className:"chat-info-card",children:[o.jsxs("div",{className:"chat-info-card-title",children:[o.jsx(Pr,{size:14})," Agents",o.jsx("span",{className:"chat-info-card-count",children:l.length})]}),o.jsx("ul",{className:"mod-mini-list",children:x.map(m=>o.jsxs("li",{className:"mod-mini",children:[o.jsxs("span",{className:"mod-mini-name",children:["@",m.name]}),o.jsx("span",{className:"mod-mini-meta",children:m.model||m.mode||""})]},m.name))}),l.length>4&&o.jsx("button",{type:"button",className:"chat-info-card-toggle",onClick:()=>h(m=>!m),children:f?"− Show fewer":`+ ${l.length-4} more`})]}),o.jsxs("div",{className:"chat-info-card",children:[o.jsxs("div",{className:"chat-info-card-title",children:[o.jsx(Vx,{size:14})," MCPs",o.jsx("span",{className:"chat-info-card-count",children:s.length})]}),o.jsxs("ul",{className:"mod-mini-list",children:[s.length===0?o.jsx("li",{className:"muted",children:"No MCPs configured."}):null,s.map(m=>o.jsxs("li",{className:"mod-mini",children:[o.jsx("span",{className:"mod-mini-name",children:m.id}),o.jsx("span",{className:`mod-mini-pill ${m.enabled?"on":"off"}`,children:m.enabled?"on":"off"})]},m.id))]})]}),o.jsxs("div",{className:"chat-info-card",children:[o.jsxs("button",{type:"button",className:"chat-info-card-title chat-info-card-title-button",onClick:()=>g(m=>!m),"aria-expanded":p,children:[o.jsx(qx,{size:14})," Slash commands",o.jsx("span",{className:"chat-info-card-count",children:a.length}),o.jsx(ys,{size:12,className:`chat-info-card-chevron ${p?"open":""}`})]}),p&&o.jsx("ul",{className:"mod-mini-list",children:C.map(m=>o.jsxs("li",{children:[o.jsx("code",{children:m.cmd}),o.jsx("span",{className:"muted",children:m.desc})]},m.cmd))})]})]})}function Ej({snapshot:e,settings:t,setActiveTab:n,initialTaskId:r,onClearTaskId:i}){const l=t1(),s=Jx(),a=dj(e,t,r??"");k.useEffect(()=>{a.setToast({error:$=>l.error($),success:$=>l.success($),info:$=>l.info($),warning:$=>l.warning($)})},[a,l]);const[u,d]=k.useState(""),[c,f]=k.useState(t.defaultAgent||"odin"),[h,p]=k.useState(t.defaultModel||""),[g,x]=k.useState([]),[C,y]=k.useState(!1),[m,v]=k.useState(!1),N=k.useRef(null),{allCommands:P,suggestions:j,setQuery:I}=pj(e);k.useEffect(()=>{I(u)},[u,I]);const L=()=>{var $;return($=N.current)==null?void 0:$.click()},T=$=>{const Q=$.target.files;if(!Q)return;const he=[];for(let ne=0;ne<Q.length;ne++)he.push(Q[ne].name);x(ne=>{const R=he.filter(V=>!ne.includes(V));return[...ne,...R]}),N.current&&(N.current.value="")},w=async()=>{const $=u.trim();if(!$)return;d(""),I(""),(await a.onSend($,c,h,g)).ok&&a.jumpToLatest()},z=async()=>{a.busy.create||(await a.onCreateSession(),y(!1))},A=$=>{s.open({title:"Delete message?",children:o.jsx("p",{style:{margin:0},children:"This action cannot be undone."}),footer:o.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end"},children:[o.jsx(dr,{variant:"secondary",size:"sm",onClick:()=>s.close(),children:"Cancel"}),o.jsx(dr,{variant:"danger",size:"sm",onClick:()=>{s.close(),a.deleteMessage($)},children:"Delete"})]})})},H=($,Q)=>{s.open({title:"Delete session?",children:o.jsxs("p",{style:{margin:0},children:["Delete ",o.jsx("strong",{children:Q}),"? This cannot be undone."]}),footer:o.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end"},children:[o.jsx(dr,{variant:"secondary",size:"sm",onClick:()=>s.close(),children:"Cancel"}),o.jsx(dr,{variant:"danger",size:"sm",onClick:async()=>{s.close(),await a.deleteSession($)},children:"Delete"})]})})};return o.jsxs("div",{className:"chat-shell",children:[o.jsx(a1,{activeProject:e.activeProject,sessionCount:a.sessions.length,sessionsOpen:C,infoOpen:m,onToggleSessions:()=>y($=>!$),onToggleInfo:()=>v($=>!$),onOpenOverview:()=>n==null?void 0:n("overview")}),o.jsxs("div",{className:"chat-body",children:[o.jsx("aside",{className:`chat-sessions ${C?"":"chat-sessions-hidden"}`,children:o.jsx(jj,{sessions:a.sessions,opencodeSessions:a.opencodeSessions,activeSessionId:a.sessionId,activeOpencodeSessionId:a.activeOpencodeSessionId,activeProject:e.activeProject,onCreateSession:z,onSelectSession:a.selectBizarSession,onSelectOpencodeSession:$=>a.loadOpencodeSession($.id),creating:a.busy.create})}),o.jsxs("main",{className:"chat-main",children:[o.jsx(lj,{messages:a.activeSource==="opencode"?a.opencodeMessages:a.bizarMessages,loading:a.loading,activeProject:e.activeProject,sessionId:a.activeSource==="opencode"?a.activeOpencodeSessionId??a.sessionId:a.sessionId,pinned:a.pinned,activeSource:a.activeSource,onPickSuggestion:$=>d($),onCopy:$=>a.copyMessage($),onDelete:A,onTogglePin:a.togglePin,onRegenerate:a.onRegenerate}),o.jsx(Cj,{agent:c,setAgent:f,model:h,setModel:p,text:u,setText:d,sending:a.sending,activeSource:a.activeSource,onSend:w,attachments:g,setAttachments:x,suggestions:j,onPickSuggestion:$=>d(`${$.split(" ")[0]} `),agents:e.agents||[],onAttach:L,sessionsOpen:C,infoOpen:m}),o.jsx("input",{ref:N,type:"file",multiple:!0,style:{display:"none"},onChange:T})]}),o.jsx("aside",{className:`chat-info ${m?"":"chat-info-hidden"}`,children:o.jsx(Nj,{sessionId:a.activeSource==="opencode"?a.activeOpencodeSessionId??a.sessionId:a.sessionId,messages:a.activeSource==="opencode"?a.opencodeMessages:a.bizarMessages,pinned:a.pinned,agent:c,model:h,agents:e.agents||[],mcps:e.mcps||[],allCommands:P,activeSource:a.activeSource,onDelete:()=>{const $=a.activeSource==="opencode"?a.activeOpencodeSessionId:a.sessionId;$&&H($,$)}})})]})]})}function Tj({onBack:e}){const[t,n]=k.useState([]),[r,i]=k.useState(!0),[l,s]=k.useState({}),[a,u]=k.useState(!1),d=async()=>{try{const x=await q.get("/config"),C=Object.entries(x).map(([y,m])=>({key:y,value:m,type:c(m)}));n(C),s(Object.fromEntries(Object.entries(x).map(([y,m])=>[y,m])))}catch{}finally{i(!1)}};k.useEffect(()=>{d()},[]);const c=x=>typeof x=="boolean"?"boolean":typeof x=="number"?"number":typeof x=="string"?"string":Array.isArray(x)?"array":x&&typeof x=="object"?"object":"unknown",f=(x,C)=>{s(y=>({...y,[x]:C}))},h=async()=>{u(!0);try{await q.patch("/config",l),await d()}catch{}finally{u(!1)}},p=(x,C)=>{s(y=>({...y,[x]:C}))},g=x=>{const C=l[x.key];switch(x.type){case"boolean":return o.jsxs("label",{className:"mobile-toggle",children:[o.jsx("input",{type:"checkbox",checked:!!C,onChange:y=>f(x.key,y.target.checked)}),o.jsx("span",{className:"mobile-toggle-slider"})]});case"number":return o.jsx("input",{className:"mobile-input mobile-input-sm",type:"number",inputMode:"numeric",value:String(C??""),onChange:y=>f(x.key,Number(y.target.value))});case"string":return o.jsx("input",{className:"mobile-input mobile-input-sm",type:"text",value:String(C??""),onChange:y=>f(x.key,y.target.value)});case"object":case"array":return o.jsx("textarea",{className:"mobile-input mobile-input-sm",rows:2,value:JSON.stringify(C??null,null,2),onChange:y=>{try{f(x.key,JSON.parse(y.target.value))}catch{}}});default:return o.jsx("span",{className:"mobile-setting-value mono",children:String(C??"null")})}};return o.jsxs("div",{className:"mobile-view",children:[o.jsxs("div",{className:"mobile-tasks-toolbar",children:[o.jsxs("span",{style:{fontSize:14,color:"var(--text-muted)",flex:1},children:[t.length," config entries"]}),o.jsx("button",{type:"button",className:"mobile-icon-btn",onClick:()=>d(),"aria-label":"Refresh",children:o.jsx(Dt,{size:16})}),o.jsxs("button",{type:"button",className:"mobile-btn",disabled:a,onClick:()=>h(),children:[o.jsx(Ph,{size:14})," ",a?"Saving…":"Save all"]})]}),r?o.jsx("div",{className:"mobile-loading",children:o.jsx("p",{children:"Loading…"})}):t.length===0?o.jsxs("div",{className:"mobile-empty",children:[o.jsx(Nr,{size:40}),o.jsx("p",{children:"No config entries."})]}):o.jsx("div",{className:"mobile-config-list",children:t.map(x=>o.jsxs("div",{className:"mobile-config-row",children:[o.jsxs("div",{className:"mobile-config-key",children:[o.jsx("span",{className:"mono",children:x.key}),o.jsx("span",{className:"mobile-config-type",children:x.type})]}),o.jsx("div",{className:"mobile-config-value",children:g(x)}),o.jsx("button",{type:"button",className:"mobile-icon-btn",onClick:()=>p(x.key,x.defaultValue),"aria-label":"Reset to default",title:"Reset",children:o.jsx(Ux,{size:14})})]},x.key))})]})}function zj({onBack:e}){const[t,n]=k.useState([]),[r,i]=k.useState(!0),[l,s]=k.useState(null),[a,u]=k.useState(""),d=async()=>{try{const p=await q.get("/history");if(Array.isArray(p.history)){n(p.history);return}if(Array.isArray(p.projects)){const g=new Map;for(const x of p.events||[]){const C=x.projectId;if(!C)continue;const y=g.get(C);(!y||new Date(x.ts).getTime()>new Date(y.ts).getTime())&&g.set(C,x)}n(p.projects.map(x=>{const C=g.get(x.id);return{id:x.id,ts:x.lastAccessed||(C==null?void 0:C.ts)||new Date(0).toISOString(),agent:x.name,taskCount:x.tasks.total,summary:`${x.path} · ${x.tasks.done}/${x.tasks.total} done · ${x.plans} plan${x.plans===1?"":"s"}`,output:C?`${C.kind}${C.text?` — ${C.text}`:""}`:"No recent events."}}));return}n([])}catch{}finally{i(!1)}};k.useEffect(()=>{d()},[]);const c=p=>{if(!p)return"—";const g=Math.floor(p/1e3);if(g<60)return`${g}s`;const x=Math.floor(g/60),C=g%60;return`${x}m ${C}s`},f=p=>new Date(p).toLocaleString(),h=a.trim()?t.filter(p=>{const g=a.toLowerCase();return(p.agent||"session").toLowerCase().includes(g)||(p.summary||"").toLowerCase().includes(g)||(p.output||"").toLowerCase().includes(g)}):t;return o.jsxs("div",{className:"mobile-view",children:[o.jsxs("div",{className:"mobile-tasks-toolbar",children:[o.jsx("input",{className:"mobile-search-input",type:"text",placeholder:"Search history…",value:a,onChange:p=>u(p.target.value),style:{flex:1}}),o.jsx("button",{type:"button",className:"mobile-icon-btn",onClick:()=>d(),"aria-label":"Refresh",children:o.jsx(Dt,{size:16})})]}),r?o.jsx("div",{className:"mobile-loading",children:o.jsx("p",{children:"Loading…"})}):h.length===0?o.jsxs("div",{className:"mobile-empty",children:[o.jsx(ha,{size:40}),o.jsx("p",{children:t.length===0?"No history yet.":"No matching sessions."})]}):o.jsx("div",{className:"mobile-card-list",children:h.map(p=>o.jsxs("button",{type:"button",className:"mobile-list-item mobile-list-item-interactive",onClick:()=>s(p),children:[o.jsx("div",{className:"mobile-list-icon",children:o.jsx(ha,{size:16})}),o.jsxs("div",{className:"mobile-list-content",children:[o.jsx("span",{className:"mobile-list-title",children:p.agent||"Session"}),o.jsxs("span",{className:"mobile-list-meta",children:[f(p.ts),p.duration?` · ${c(p.duration)}`:"",p.taskCount?` · ${p.taskCount} tasks`:""]})]})]},p.id))}),l&&o.jsxs(At,{open:!0,onClose:()=>s(null),title:"Session Detail",children:[o.jsxs("div",{className:"mobile-agent-detail-meta",children:[o.jsxs("div",{className:"mobile-task-detail-row",children:[o.jsx("span",{children:"Agent"}),o.jsx("span",{children:l.agent||"—"})]}),o.jsxs("div",{className:"mobile-task-detail-row",children:[o.jsx("span",{children:"Started"}),o.jsx("span",{children:f(l.ts)})]}),o.jsxs("div",{className:"mobile-task-detail-row",children:[o.jsx("span",{children:"Duration"}),o.jsx("span",{children:c(l.duration)})]}),o.jsxs("div",{className:"mobile-task-detail-row",children:[o.jsx("span",{children:"Tasks"}),o.jsx("span",{children:l.taskCount||0})]})]}),l.summary&&o.jsxs("div",{style:{marginTop:12},children:[o.jsx("h4",{style:{fontSize:12,color:"var(--text-muted)",marginBottom:4},children:"Summary"}),o.jsx("p",{style:{fontSize:13},children:l.summary})]}),l.output&&o.jsxs("div",{style:{marginTop:12},children:[o.jsx("h4",{style:{fontSize:12,color:"var(--text-muted)",marginBottom:4},children:"Output"}),o.jsxs("pre",{className:"mono",style:{fontSize:11,whiteSpace:"pre-wrap",wordBreak:"break-all",background:"var(--bg-elev-2)",padding:8,borderRadius:6},children:[l.output.slice(0,1e3),l.output.length>1e3?"…":""]})]})]})]})}function Ij({snapshot:e,onBack:t}){const[n,r]=k.useState(e.mods||[]),[i,l]=k.useState(!e.mods),[s,a]=k.useState(""),[u,d]=k.useState("all"),[c,f]=k.useState(null),h=async()=>{try{const x=await q.get("/mods");r(x.mods||[])}catch{}finally{l(!1)}};k.useEffect(()=>{e.mods?(r(e.mods),l(!1)):h()},[e.mods]);const p=async(x,C)=>{try{await q.patch(`/mods/${encodeURIComponent(x)}`,{enabled:C}),r(y=>y.map(m=>m.id===x?{...m,enabled:C}:m)),(c==null?void 0:c.id)===x&&f(y=>y&&{...y,enabled:C})}catch{}},g=n.filter(x=>{if(u==="enabled"&&!x.enabled||u==="disabled"&&x.enabled)return!1;if(s){const C=s.toLowerCase();return x.name.toLowerCase().includes(C)||x.description.toLowerCase().includes(C)}return!0});return o.jsxs("div",{className:"mobile-view",children:[o.jsxs("div",{className:"mobile-tasks-toolbar",children:[o.jsx("input",{className:"mobile-search-input",type:"text",placeholder:"Search mods…",value:s,onChange:x=>a(x.target.value),style:{flex:1}}),o.jsx("button",{type:"button",className:"mobile-icon-btn",onClick:()=>h(),"aria-label":"Refresh",children:o.jsx(Dt,{size:16})})]}),o.jsx("div",{className:"mobile-search-scopes",children:["all","enabled","disabled"].map(x=>o.jsx("button",{type:"button",className:`mobile-scope-chip ${u===x?"active":""}`,onClick:()=>d(x),children:x.charAt(0).toUpperCase()+x.slice(1)},x))}),i?o.jsx("div",{className:"mobile-loading",children:o.jsx("p",{children:"Loading…"})}):g.length===0?o.jsxs("div",{className:"mobile-empty",children:[o.jsx(Nr,{size:40}),o.jsx("p",{children:"No mods found."})]}):o.jsx("div",{className:"mobile-card-list",children:g.map(x=>o.jsxs("button",{type:"button",className:"mobile-list-item mobile-list-item-interactive",onClick:()=>f(x),children:[o.jsx("div",{className:"mobile-list-icon",children:o.jsx(Nr,{size:16})}),o.jsxs("div",{className:"mobile-list-content",children:[o.jsx("span",{className:"mobile-list-title",children:x.name}),o.jsxs("span",{className:"mobile-list-meta",children:["v",x.version," · ",x.author]})]}),o.jsx("span",{className:`mobile-list-badge ${x.enabled?"badge-on":"badge-off"}`,children:x.enabled?"on":"off"})]},x.id))}),c&&o.jsx(At,{open:!0,onClose:()=>f(null),title:c.name,actions:o.jsx("div",{className:"mobile-task-detail-actions",children:o.jsxs("button",{type:"button",className:"mobile-btn",style:{flex:1},onClick:()=>{c&&p(c.id,!c.enabled)},children:[o.jsx(Ih,{size:14})," ",c.enabled?"Disable":"Enable"]})}),children:o.jsxs("div",{className:"mobile-agent-detail",children:[o.jsx("p",{className:"mobile-agent-detail-desc",children:c.description||"No description."}),o.jsxs("div",{className:"mobile-agent-detail-meta",children:[o.jsxs("div",{className:"mobile-task-detail-row",children:[o.jsx("span",{children:"Version"}),o.jsx("span",{className:"mono",children:c.version})]}),o.jsxs("div",{className:"mobile-task-detail-row",children:[o.jsx("span",{children:"Author"}),o.jsx("span",{children:c.author})]}),o.jsxs("div",{className:"mobile-task-detail-row",children:[o.jsx("span",{children:"Bizar"}),o.jsx("span",{className:"mono",children:c.bizar})]}),o.jsxs("div",{className:"mobile-task-detail-row",children:[o.jsx("span",{children:"Type"}),o.jsx("span",{children:c.type})]}),o.jsxs("div",{className:"mobile-task-detail-row",children:[o.jsx("span",{children:"Permissions"}),o.jsx("span",{children:c.permissions.length})]}),c.installedAt&&o.jsxs("div",{className:"mobile-task-detail-row",children:[o.jsx("span",{children:"Installed"}),o.jsx("span",{children:new Date(c.installedAt).toLocaleDateString()})]})]})]})})]})}function Pj({snapshot:e,onNavigate:t}){var s,a,u;const[n,r]=k.useState(""),i=[{id:"artifacts",icon:Vn,label:"Plans",count:e.artifacts.length||0,desc:"Visual artifacts with elements & comments"},{id:"agents",icon:Pr,label:"Agents",count:((s=e.agents)==null?void 0:s.length)||0,desc:"The Norse pantheon"},{id:"skills",icon:Nr,label:"Skills",count:null,desc:"Agent capabilities & tools"},{id:"mods",icon:Nr,label:"Mods",count:((a=e.mods)==null?void 0:a.length)||0,desc:"Installed modifications"},{id:"schedules",icon:pa,label:"Schedules",count:((u=e.schedules)==null?void 0:u.length)||0,desc:"Cron jobs & automated tasks"},{id:"history",icon:ha,label:"History",count:null,desc:"Past sessions & outputs"},{id:"config",icon:Ah,label:"Config",count:null,desc:"Key-value configuration editor"}],l=n.trim()?i.filter(d=>d.label.toLowerCase().includes(n.toLowerCase())||d.desc.toLowerCase().includes(n.toLowerCase())):i;return o.jsxs("div",{className:"mobile-view",children:[o.jsx("div",{className:"mobile-tasks-toolbar",children:o.jsx("input",{className:"mobile-search-input",type:"text",placeholder:"Search…",value:n,onChange:d=>r(d.target.value),style:{flex:1}})}),o.jsx("div",{className:"mobile-card-list",children:l.map(d=>{const c=d.icon;return o.jsxs("button",{type:"button",className:"mobile-more-nav-item",onClick:()=>t(d.id),children:[o.jsx("div",{className:"mobile-more-nav-icon",children:o.jsx(c,{size:20})}),o.jsxs("div",{className:"mobile-more-nav-content",children:[o.jsxs("span",{className:"mobile-more-nav-label",children:[d.label,d.count!=null&&o.jsx("span",{className:"mobile-more-nav-count",children:d.count})]}),o.jsx("span",{className:"mobile-more-nav-desc",children:d.desc})]}),o.jsx(rd,{size:16,className:"mobile-more-nav-arrow"})]},d.id)})}),o.jsx("div",{className:"mobile-more-footer",children:o.jsxs("a",{href:"/?desktop=1",className:"mobile-more-link",children:["Switch to Desktop ",o.jsx(rd,{size:14})]})})]})}const Wu=[{id:"task",label:"Task",color:"var(--info)"},{id:"note",label:"Note",color:"var(--text-dim)"},{id:"decision",label:"Decision",color:"var(--accent)"},{id:"question",label:"Question",color:"var(--warning)"}];function vo(e){var t;return((t=Wu.find(n=>n.id===e))==null?void 0:t.color)||"var(--text-dim)"}function Lj({type:e,size:t=12}){switch(e){case"task":return o.jsx(Kl,{size:t,style:{color:"var(--info)"}});case"note":return o.jsx(od,{size:t,style:{color:"var(--text-dim)"}});case"decision":return o.jsx(Kl,{size:t,style:{color:"var(--accent)"}});case"question":return o.jsx(Ix,{size:t,style:{color:"var(--warning)"}});default:return o.jsx(od,{size:t})}}function Aj({slug:e,onBack:t}){const[n,r]=k.useState(null),[i,l]=k.useState(null),[s,a]=k.useState(!0),[u,d]=k.useState(!1),[c,f]=k.useState(null),[h,p]=k.useState(!1),[g,x]=k.useState(!1),[C,y]=k.useState(!1),[m,v]=k.useState(""),N=async()=>{a(!0);try{const T=await q.get(`/plans/${encodeURIComponent(e)}`);r(T.canvas),l(T.meta)}catch{}finally{a(!1)}};k.useEffect(()=>{N()},[e]);const P=async(T,w,z)=>{try{const A=((n==null?void 0:n.elements)||[]).reduce(($,Q)=>Math.max($,Q.x||0),40),H=((n==null?void 0:n.elements)||[]).reduce(($,Q)=>Math.max($,Q.y||0),40);await q.post(`/plans/${encodeURIComponent(e)}/elements`,{type:T,title:w,content:z,x:20+A,y:20+H,width:240,height:120}),await N(),x(!1)}catch{}},j=async(T,w)=>{try{await q.put(`/plans/${encodeURIComponent(e)}/elements/${encodeURIComponent(T)}`,w),await N(),f(null)}catch{}},I=async T=>{if(confirm("Delete this element?"))try{await q.del(`/plans/${encodeURIComponent(e)}/elements/${encodeURIComponent(T)}`),f(null),await N()}catch{}},L=async(T,w)=>{try{const z=w?`/plans/${encodeURIComponent(e)}/elements/${encodeURIComponent(w)}/comments`:`/plans/${encodeURIComponent(e)}/comments`;await q.post(z,{text:T,elementId:w}),await N(),v(""),y(!1)}catch{}};return s||!n||!i?o.jsx("div",{className:"mobile-view",children:o.jsx("div",{className:"mobile-loading",children:o.jsx("p",{children:"Loading canvas…"})})}):o.jsxs("div",{className:"mobile-view mobile-view-canvas",children:[o.jsxs("div",{className:"mobile-canvas-bar",children:[o.jsxs("div",{className:"mobile-canvas-meta",children:[o.jsx("span",{className:"mobile-canvas-title",children:i.title||e}),o.jsx("span",{className:"mobile-canvas-status","data-status":i.status,children:i.status})]}),o.jsxs("div",{className:"mobile-canvas-actions",children:[o.jsx("button",{type:"button",className:`mobile-icon-btn ${u?"active":""}`,onClick:()=>d(T=>!T),"aria-label":u?"Done editing":"Edit",children:o.jsx(ju,{size:16})}),o.jsxs("button",{type:"button",className:"mobile-icon-btn",onClick:()=>p(T=>!T),"aria-label":"Comments",children:[o.jsx(Mn,{size:16}),n.comments.length>0&&o.jsx("span",{className:"mobile-canvas-comment-count",children:n.comments.length})]}),u&&o.jsx("button",{type:"button",className:"mobile-icon-btn",onClick:()=>x(!0),"aria-label":"Add element",children:o.jsx(mt,{size:16})})]})]}),o.jsxs("div",{className:"mobile-canvas-elements",children:[n.elements.length===0&&o.jsxs("div",{className:"mobile-empty",children:[o.jsx("p",{children:"No elements yet."}),u&&o.jsxs("button",{type:"button",className:"mobile-btn",onClick:()=>x(!0),children:[o.jsx(mt,{size:14})," Add Element"]})]}),n.elements.map(T=>o.jsxs("button",{type:"button",className:`mobile-canvas-element ${(c==null?void 0:c.id)===T.id?"selected":""}`,style:{borderColor:vo(T.type)},onClick:()=>{u&&f(T)},"aria-pressed":(c==null?void 0:c.id)===T.id,children:[o.jsxs("div",{className:"mobile-canvas-el-header",style:{background:`${vo(T.type)}18`},children:[o.jsx(Lj,{type:T.type,size:12}),o.jsx("span",{className:"mobile-canvas-el-type",style:{color:vo(T.type)},children:T.type}),T.status&&T.status!=="open"&&o.jsx("span",{className:"mobile-canvas-el-status",children:T.status})]}),o.jsx("div",{className:"mobile-canvas-el-title",children:T.title||"Untitled"}),T.content&&o.jsxs("div",{className:"mobile-canvas-el-content",children:[T.content.slice(0,120),T.content.length>120?"…":""]}),o.jsxs("div",{className:"mobile-canvas-el-comments",children:[o.jsx(Mn,{size:10}),n.comments.filter(w=>w.elementId===T.id).length]})]},T.id))]}),h&&o.jsxs("div",{className:"mobile-canvas-comments",children:[o.jsxs("div",{className:"mobile-canvas-comments-header",children:[o.jsxs("h4",{children:["Comments (",n.comments.length,")"]}),o.jsx("button",{type:"button",className:"mobile-icon-btn",onClick:()=>p(!1),children:o.jsx(Yn,{size:16})})]}),o.jsxs("div",{className:"mobile-canvas-comment-list",children:[n.comments.length===0&&o.jsx("p",{className:"mobile-empty-inline",children:"No comments yet."}),n.comments.map(T=>o.jsxs("div",{className:"mobile-canvas-comment",children:[o.jsxs("div",{className:"mobile-canvas-comment-head",children:[o.jsx("span",{className:"mono",children:T.author}),o.jsx("span",{className:"muted",children:xr(T.created)})]}),o.jsx("div",{className:"mobile-canvas-comment-text",children:T.text})]},T.id))]}),o.jsxs("div",{className:"mobile-canvas-comment-input",children:[o.jsx("textarea",{className:"mobile-input",rows:2,placeholder:"Add a comment…",value:m,onChange:T=>v(T.target.value)}),o.jsx("button",{type:"button",className:"mobile-btn",disabled:!m.trim(),onClick:()=>{L(m.trim(),null)},children:"Post"})]})]}),c&&o.jsx(At,{open:!0,onClose:()=>f(null),title:`Edit ${c.title||c.type}`,actions:o.jsxs("div",{className:"mobile-task-detail-actions",children:[o.jsxs("button",{type:"button",className:"mobile-btn mobile-btn-danger",onClick:()=>I(c.id),children:[o.jsx(Lr,{size:14})," Delete"]}),o.jsxs("button",{type:"button",className:"mobile-btn",onClick:()=>y(!0),children:[o.jsx(Mn,{size:14})," Comment"]})]}),children:o.jsx(Dj,{element:c,onSave:T=>j(c.id,T),onClose:()=>f(null)})}),o.jsx(Mj,{open:g,onClose:()=>x(!1),onAdd:P}),o.jsx(Cn,{open:C,onClose:()=>y(!1),title:"Add Comment",actions:o.jsxs("button",{type:"button",className:"mobile-btn",style:{width:"100%"},disabled:!m.trim(),onClick:()=>{L(m.trim(),(c==null?void 0:c.id)||null),y(!1)},children:[o.jsx(Mn,{size:14})," Post"]}),children:o.jsx("textarea",{className:"mobile-input",rows:3,placeholder:"Your comment…",value:m,onChange:T=>v(T.target.value),autoFocus:!0})})]})}function Dj({element:e,onSave:t,onClose:n}){const[r,i]=k.useState(e.type),[l,s]=k.useState(e.title||""),[a,u]=k.useState(e.content||""),[d,c]=k.useState(e.status||"open");return o.jsxs("form",{className:"mobile-task-form",onSubmit:f=>{f.preventDefault(),t({type:r,title:l,content:a,status:d}),n()},children:[o.jsx("label",{className:"mobile-field-label",children:"Type"}),o.jsx("select",{className:"mobile-input",value:r,onChange:f=>i(f.target.value),children:Wu.map(f=>o.jsx("option",{value:f.id,children:f.label},f.id))}),o.jsx("label",{className:"mobile-field-label",children:"Title"}),o.jsx("input",{className:"mobile-input",type:"text",value:l,onChange:f=>s(f.target.value)}),o.jsx("label",{className:"mobile-field-label",children:"Status"}),o.jsx("input",{className:"mobile-input",type:"text",value:d,onChange:f=>c(f.target.value),placeholder:"open / done / blocked"}),o.jsx("label",{className:"mobile-field-label",children:"Content (markdown)"}),o.jsx("textarea",{className:"mobile-input",rows:4,value:a,onChange:f=>u(f.target.value)}),o.jsx("button",{type:"submit",className:"mobile-btn",style:{width:"100%",marginTop:8},children:"Save"})]})}function Mj({open:e,onClose:t,onAdd:n}){const[r,i]=k.useState("task"),[l,s]=k.useState(""),[a,u]=k.useState(""),d=c=>{c.preventDefault(),l.trim()&&(n(r,l.trim(),a.trim()),s(""),u(""))};return o.jsx(Cn,{open:e,onClose:t,title:"Add Element",actions:o.jsxs("button",{type:"submit",form:"add-el-form",className:"mobile-btn",style:{width:"100%"},children:[o.jsx(mt,{size:14})," Add"]}),children:o.jsxs("form",{id:"add-el-form",onSubmit:d,className:"mobile-task-form",children:[o.jsx("label",{className:"mobile-field-label",children:"Type"}),o.jsx("select",{className:"mobile-input",value:r,onChange:c=>i(c.target.value),children:Wu.map(c=>o.jsx("option",{value:c.id,children:c.label},c.id))}),o.jsx("label",{className:"mobile-field-label",children:"Title *"}),o.jsx("input",{className:"mobile-input",type:"text",placeholder:"Element title",value:l,onChange:c=>s(c.target.value),autoFocus:!0,required:!0}),o.jsx("label",{className:"mobile-field-label",children:"Content (markdown)"}),o.jsx("textarea",{className:"mobile-input",rows:3,placeholder:"Description…",value:a,onChange:c=>u(c.target.value)})]})})}function Rj({snapshot:e,onBack:t,onOpenArtifact:n}){const[r,i]=k.useState(e.artifacts||[]),[l,s]=k.useState(!e.artifacts),[a,u]=k.useState(""),[d,c]=k.useState(!1),[f,h]=k.useState(""),[p,g]=k.useState(""),x=async()=>{try{const m=await q.get("/artifacts");i(m.artifacts||[])}catch{}finally{s(!1)}},C=async()=>{if(f.trim())try{const m=await q.post("/artifacts",{slug:f.trim(),title:p.trim()||void 0});c(!1),h(""),g(""),n(m.slug)}catch{}},y=a.trim()?r.filter(m=>(m.title||m.slug||"").toLowerCase().includes(a.toLowerCase())):r;return o.jsxs("div",{className:"mobile-view",children:[o.jsxs("div",{className:"mobile-tasks-toolbar",children:[o.jsx("input",{className:"mobile-search-input",type:"text",placeholder:"Search artifacts…",value:a,onChange:m=>u(m.target.value),style:{flex:1}}),o.jsx("button",{type:"button",className:"mobile-icon-btn",onClick:()=>x(),"aria-label":"Refresh",children:o.jsx(Dt,{size:16})})]}),o.jsx("div",{style:{marginBottom:12},children:o.jsxs("button",{type:"button",className:"mobile-btn",style:{width:"100%"},onClick:()=>c(!0),children:[o.jsx(mt,{size:14})," New Artifact"]})}),l?o.jsx("div",{className:"mobile-loading",children:o.jsx("p",{children:"Loading…"})}):y.length===0?o.jsxs("div",{className:"mobile-empty",children:[o.jsx(Vn,{size:40}),o.jsx("p",{children:"No artifacts yet."})]}):o.jsx("div",{className:"mobile-card-list",children:y.map(m=>o.jsxs("button",{type:"button",className:"mobile-list-item mobile-list-item-interactive",onClick:()=>n(m.slug),children:[o.jsx("div",{className:"mobile-list-icon",children:o.jsx(Vn,{size:16})}),o.jsxs("div",{className:"mobile-list-content",children:[o.jsx("span",{className:"mobile-list-title",children:m.title||m.slug}),o.jsxs("span",{className:"mobile-list-meta",children:[m.status," · ",m.source,m.elementCount!=null?` · ${m.elementCount} elements`:"",m.commentCount!=null?` · ${m.commentCount} comments`:""]})]}),o.jsx("span",{className:"mobile-list-badge","data-status":m.status,children:m.status})]},m.slug))}),o.jsx(Cn,{open:d,onClose:()=>c(!1),title:"New Artifact",actions:o.jsxs("button",{type:"submit",form:"new-plan-form",className:"mobile-btn",style:{width:"100%"},children:[o.jsx(mt,{size:14})," Create"]}),children:o.jsxs("form",{id:"new-plan-form",onSubmit:m=>{m.preventDefault(),C()},className:"mobile-task-form",children:[o.jsx("label",{className:"mobile-field-label",children:"Slug *"}),o.jsx("input",{className:"mobile-input",type:"text",placeholder:"my-plan",pattern:"[a-z0-9][a-z0-9-]{0,63}",value:f,onChange:m=>h(m.target.value),autoFocus:!0,required:!0}),o.jsx("label",{className:"mobile-field-label",children:"Title (optional)"}),o.jsx("input",{className:"mobile-input",type:"text",placeholder:"My Artifact",value:p,onChange:m=>g(m.target.value)})]})})]})}const _j=["cron","interval","once"],Oj=["command","agent","webhook"],cf=["UTC","America/New_York","America/Los_Angeles","Europe/London","Europe/Berlin","Asia/Tokyo"],Wm=Array.from({length:24},(e,t)=>({value:t,label:t===0?"12 AM":t<12?`${t} AM`:t===12?"12 PM":`${t-12} PM`})),Fj=Array.from({length:12},(e,t)=>t*5),qm=[{value:"*",label:"Every day"},{value:"0",label:"Sun"},{value:"1",label:"Mon"},{value:"2",label:"Tue"},{value:"3",label:"Wed"},{value:"4",label:"Thu"},{value:"5",label:"Fri"},{value:"6",label:"Sat"}],$j=[{value:"s",label:"sec"},{value:"m",label:"min"},{value:"h",label:"hr"},{value:"d",label:"day"}];function Bj({snapshot:e}){var C;const[t,n]=k.useState(e.schedules||[]),[r,i]=k.useState(!e.schedules),[l,s]=k.useState(""),[a,u]=k.useState(null),[d,c]=k.useState({open:!1}),f=async()=>{try{const y=await q.get("/schedules");n(y.schedules||[])}catch{}finally{i(!1)}};k.useEffect(()=>{e.schedules?(n(e.schedules),i(!1)):f()},[e.schedules]);const h=async(y,m)=>{try{await q.patch(`/schedules/${encodeURIComponent(y)}`,{enabled:m}),n(v=>v.map(N=>N.id===y?{...N,enabled:m}:N)),(a==null?void 0:a.id)===y&&u(v=>v&&{...v,enabled:m})}catch{}},p=async y=>{if(confirm("Delete this schedule?"))try{await q.del(`/schedules/${encodeURIComponent(y)}`),n(m=>m.filter(v=>v.id!==y)),(a==null?void 0:a.id)===y&&u(null)}catch{}},g=async y=>{try{await q.post(`/schedules/${encodeURIComponent(y)}/trigger`)}catch{}},x=l.trim()?t.filter(y=>y.name.toLowerCase().includes(l.toLowerCase())):t;return o.jsxs("div",{className:"mobile-view",children:[o.jsxs("div",{className:"mobile-tasks-toolbar",children:[o.jsx("input",{className:"mobile-search-input",type:"text",placeholder:"Search schedules…",value:l,onChange:y=>s(y.target.value),style:{flex:1}}),o.jsx("button",{type:"button",className:"mobile-icon-btn",onClick:()=>f(),"aria-label":"Refresh",children:o.jsx(Dt,{size:16})}),o.jsx("button",{type:"button",className:"mobile-icon-btn",onClick:()=>c({open:!0}),"aria-label":"New schedule",children:o.jsx(mt,{size:16})})]}),r?o.jsx("div",{className:"mobile-loading",children:o.jsx("p",{children:"Loading…"})}):x.length===0?o.jsxs("div",{className:"mobile-empty",children:[o.jsx(pa,{size:40}),o.jsx("p",{children:"No schedules found."})]}):o.jsx("div",{className:"mobile-card-list",children:x.map(y=>o.jsxs("button",{type:"button",className:"mobile-list-item mobile-list-item-interactive",onClick:()=>u(y),children:[o.jsx("div",{className:"mobile-list-icon",children:o.jsx(pa,{size:16})}),o.jsxs("div",{className:"mobile-list-content",children:[o.jsx("span",{className:"mobile-list-title",children:y.name}),o.jsxs("span",{className:"mobile-list-meta",children:[pf(y)," ·"," ",y.nextRun?`next ${ff(y.nextRun,y.timezone)}`:"no next run"]})]}),o.jsx("span",{className:`mobile-list-badge ${y.enabled?"badge-on":"badge-off"}`,children:y.enabled?"on":"off"})]},y.id))}),a&&o.jsx(At,{open:!0,onClose:()=>u(null),title:a.name,actions:o.jsxs("div",{className:"mobile-task-detail-actions",children:[o.jsxs("button",{type:"button",className:"mobile-btn",onClick:()=>{a&&g(a.id)},children:[o.jsx(Ql,{size:14})," Trigger now"]}),o.jsx("button",{type:"button",className:`mobile-btn ${a.enabled?"mobile-btn-secondary":""}`,onClick:()=>{a&&h(a.id,!a.enabled)},children:a.enabled?"Disable":"Enable"}),o.jsxs("button",{type:"button",className:"mobile-btn",onClick:()=>{a&&(c({open:!0,initial:a}),u(null))},children:[o.jsx(ju,{size:14})," Edit"]}),o.jsx("button",{type:"button",className:"mobile-btn mobile-btn-danger",onClick:()=>{a&&p(a.id)},children:o.jsx(Lr,{size:14})})]}),children:o.jsx("div",{className:"mobile-agent-detail",children:o.jsxs("div",{className:"mobile-agent-detail-meta",children:[o.jsxs("div",{className:"mobile-task-detail-row",children:[o.jsx("span",{children:"Type"}),o.jsx("span",{children:a.type})]}),o.jsxs("div",{className:"mobile-task-detail-row",children:[o.jsx("span",{children:"Schedule"}),o.jsx("span",{className:"mono",children:pf(a)||a.schedule})]}),a.timezone&&o.jsxs("div",{className:"mobile-task-detail-row",children:[o.jsx("span",{children:"Timezone"}),o.jsx("span",{className:"mono",children:a.timezone})]}),o.jsxs("div",{className:"mobile-task-detail-row",children:[o.jsx("span",{children:"Action"}),o.jsxs("span",{children:[a.action.type,": ",a.action.target]})]}),a.action.type==="agent"&&a.action.prompt&&o.jsxs("div",{className:"mobile-task-detail-row",children:[o.jsx("span",{children:"Prompt"}),o.jsx("span",{style:{fontSize:12},children:a.action.prompt})]}),((C=a.budgetCheck)==null?void 0:C.skipIfBudgetLow)&&o.jsxs("div",{className:"mobile-task-detail-row",children:[o.jsx("span",{children:"Budget gate"}),o.jsxs("span",{children:["skip if ≥ ",a.budgetCheck.maxConcurrent??6," concurrent"]})]}),o.jsxs("div",{className:"mobile-task-detail-row",children:[o.jsx("span",{children:"Next run"}),o.jsx("span",{children:a.nextRun?ff(a.nextRun,a.timezone):"—"})]}),o.jsxs("div",{className:"mobile-task-detail-row",children:[o.jsx("span",{children:"Last run"}),o.jsx("span",{children:a.lastRun?Vj(a.lastRun):"—"})]}),a.lastResult&&o.jsxs("div",{className:"mobile-task-detail-row",children:[o.jsx("span",{children:"Last result"}),o.jsx("span",{style:{fontSize:12},children:a.lastResult})]}),a.lastError&&o.jsxs("div",{className:"mobile-task-detail-row",children:[o.jsx("span",{children:"Last error"}),o.jsx("span",{style:{fontSize:12},children:a.lastError})]})]})})}),o.jsx(Hj,{open:d.open,initial:d.initial,onClose:()=>c({open:!1}),onSaved:()=>{c({open:!1}),f()}})]})}function df(e){var r,i;if(!e)return{name:"",type:"cron",cronMinute:0,cronHour:13,cronDow:"0",intervalN:30,intervalUnit:"m",onceAt:"",timezone:"UTC",actionType:"agent",actionTarget:"",actionPrompt:"",skipIfBudgetLow:!1,maxConcurrent:6,enabled:!0};const t=e.type==="cron"?Qm(e.schedule):null,n=e.type==="interval"?Wj(e.schedule):null;return{name:e.name||"",type:e.type,cronMinute:(t==null?void 0:t.minute)??0,cronHour:(t==null?void 0:t.hour)??9,cronDow:(t==null?void 0:t.dow)??"*",intervalN:(n==null?void 0:n.n)??30,intervalUnit:(n==null?void 0:n.unit)??"m",onceAt:e.type==="once"?qj(e.schedule):"",timezone:e.timezone||"UTC",actionType:e.action.type,actionTarget:e.action.target||"",actionPrompt:e.action.prompt||"",skipIfBudgetLow:!!((r=e.budgetCheck)!=null&&r.skipIfBudgetLow),maxConcurrent:Number.isFinite((i=e.budgetCheck)==null?void 0:i.maxConcurrent)?e.budgetCheck.maxConcurrent:6,enabled:e.enabled!==!1}}function Uj(e){if(e.type==="cron")return`${e.cronMinute} ${e.cronHour} * * ${e.cronDow}`;if(e.type==="interval")return`${e.intervalN}${e.intervalUnit}`;if(!e.onceAt)return"";try{return new Date(e.onceAt).toISOString()}catch{return e.onceAt}}function Hj({open:e,initial:t,onClose:n,onSaved:r}){const[i,l]=k.useState(()=>df(t)),[s,a]=k.useState(!1);k.useEffect(()=>{e&&l(df(t))},[e,t]);const u=(c,f)=>{l(h=>({...h,[c]:f}))},d=async c=>{if(c.preventDefault(),!i.name.trim())return;const f=Uj(i);if(f){a(!0);try{const h={name:i.name.trim(),type:i.type,schedule:f,timezone:i.timezone,action:{type:i.actionType,target:i.actionTarget.trim(),...i.actionType==="agent"&&i.actionPrompt.trim()?{prompt:i.actionPrompt.trim()}:{}},budgetCheck:{maxConcurrent:i.maxConcurrent,skipIfBudgetLow:i.skipIfBudgetLow},enabled:i.enabled};t?await q.put(`/schedules/${encodeURIComponent(t.id)}`,h):await q.post("/schedules",h),r()}catch{}finally{a(!1)}}};return o.jsx(Cn,{open:e,onClose:n,title:t?`Edit ${t.name}`:"New schedule",actions:o.jsxs("button",{type:"submit",form:"mobile-schedule-form",className:"mobile-btn",style:{width:"100%"},disabled:s,children:[o.jsx(mt,{size:14})," ",t?"Save":"Create"]}),children:o.jsxs("form",{id:"mobile-schedule-form",onSubmit:d,className:"mobile-task-form",children:[o.jsx("label",{className:"mobile-field-label",children:"Name *"}),o.jsx("input",{className:"mobile-input",type:"text",placeholder:"Weekly review",value:i.name,onChange:c=>u("name",c.target.value),autoFocus:!0,required:!0}),o.jsx("label",{className:"mobile-field-label",children:"Type"}),o.jsx("select",{className:"mobile-input",value:i.type,onChange:c=>u("type",c.target.value),children:_j.map(c=>o.jsx("option",{value:c,children:c},c))}),i.type==="cron"&&o.jsxs(o.Fragment,{children:[o.jsx("label",{className:"mobile-field-label",children:"Day of week"}),o.jsx("select",{className:"mobile-input",value:i.cronDow,onChange:c=>u("cronDow",c.target.value),children:qm.map(c=>o.jsx("option",{value:c.value,children:c.label},c.value))}),o.jsxs("div",{className:"mobile-form-row",children:[o.jsxs("div",{style:{flex:1},children:[o.jsx("label",{className:"mobile-field-label",children:"Hour"}),o.jsx("select",{className:"mobile-input",value:String(i.cronHour),onChange:c=>u("cronHour",parseInt(c.target.value,10)),children:Wm.map(c=>o.jsx("option",{value:String(c.value),children:c.label},c.value))})]}),o.jsxs("div",{style:{flex:1},children:[o.jsx("label",{className:"mobile-field-label",children:"Minute"}),o.jsx("select",{className:"mobile-input",value:String(i.cronMinute),onChange:c=>u("cronMinute",parseInt(c.target.value,10)),children:Fj.map(c=>o.jsx("option",{value:String(c),children:String(c).padStart(2,"0")},c))})]})]})]}),i.type==="interval"&&o.jsxs("div",{className:"mobile-form-row",children:[o.jsxs("div",{style:{flex:1},children:[o.jsx("label",{className:"mobile-field-label",children:"Every"}),o.jsx("input",{className:"mobile-input",type:"number",min:1,value:i.intervalN,onChange:c=>u("intervalN",parseInt(c.target.value,10)||1)})]}),o.jsxs("div",{style:{flex:1},children:[o.jsx("label",{className:"mobile-field-label",children:"Unit"}),o.jsx("select",{className:"mobile-input",value:i.intervalUnit,onChange:c=>u("intervalUnit",c.target.value),children:$j.map(c=>o.jsx("option",{value:c.value,children:c.label},c.value))})]})]}),i.type==="once"&&o.jsxs(o.Fragment,{children:[o.jsx("label",{className:"mobile-field-label",children:"Run at"}),o.jsx("input",{className:"mobile-input",type:"datetime-local",value:i.onceAt,onChange:c=>u("onceAt",c.target.value)})]}),o.jsx("label",{className:"mobile-field-label",children:"Timezone"}),o.jsx("select",{className:"mobile-input",value:cf.includes(i.timezone)?i.timezone:"UTC",onChange:c=>u("timezone",c.target.value),children:cf.map(c=>o.jsx("option",{value:c,children:c},c))}),o.jsx("label",{className:"mobile-field-label",children:"Action type"}),o.jsx("select",{className:"mobile-input",value:i.actionType,onChange:c=>u("actionType",c.target.value),children:Oj.map(c=>o.jsx("option",{value:c,children:c},c))}),o.jsx("label",{className:"mobile-field-label",children:"Target"}),o.jsx("input",{className:"mobile-input",type:"text",placeholder:i.actionType==="webhook"?"https://...":i.actionType==="agent"?"agent or task ref":"echo hello",value:i.actionTarget,onChange:c=>u("actionTarget",c.target.value)}),i.actionType==="agent"&&o.jsxs(o.Fragment,{children:[o.jsx("label",{className:"mobile-field-label",children:"Prompt"}),o.jsx("textarea",{className:"mobile-input",rows:3,placeholder:"What should the agent do?",value:i.actionPrompt,onChange:c=>u("actionPrompt",c.target.value)})]}),o.jsxs("fieldset",{className:"mobile-budget-card",children:[o.jsx("legend",{children:"Budget pre-flight"}),o.jsxs("label",{className:"mobile-checkbox-row",children:[o.jsx("input",{type:"checkbox",checked:i.skipIfBudgetLow,onChange:c=>u("skipIfBudgetLow",c.target.checked)}),o.jsx("span",{children:"Skip if too many bg tasks are running"})]}),o.jsx("label",{className:"mobile-field-label",children:"Cap"}),o.jsx("input",{className:"mobile-input",type:"number",min:1,max:64,value:i.maxConcurrent,onChange:c=>u("maxConcurrent",parseInt(c.target.value,10)||6),disabled:!i.skipIfBudgetLow})]}),o.jsxs("label",{className:"mobile-checkbox-row",children:[o.jsx("input",{type:"checkbox",checked:i.enabled,onChange:c=>u("enabled",c.target.checked)}),o.jsx("span",{children:"Enabled"})]})]})})}function Vj(e){const t=Date.now()-new Date(e).getTime();return t<6e4?"just now":t<36e5?`${Math.floor(t/6e4)}m ago`:t<864e5?`${Math.floor(t/36e5)}h ago`:new Date(e).toLocaleDateString()}function ff(e,t){try{return new Date(e).toLocaleString(void 0,{timeZone:t||void 0,weekday:"short",hour:"numeric",minute:"2-digit",month:"short",day:"numeric"})}catch{return new Date(e).toLocaleString()}}function Qm(e){if(typeof e!="string")return null;const t=e.trim().split(/\s+/);if(t.length!==5)return null;const[n,r,,,i]=t,l=parseInt(n,10),s=parseInt(r,10);return!Number.isFinite(l)||!Number.isFinite(s)||n!==String(l)||r!==String(s)?null:{minute:l,hour:s,dow:i==="*"?"*":Number.isFinite(parseInt(i,10))?i:"*"}}function Wj(e){if(typeof e!="string")return null;const t=/^(\d+)([smhd])$/i.exec(e.trim());return t?{n:parseInt(t[1],10),unit:t[2].toLowerCase()}:null}function qj(e){if(!e)return"";try{const t=new Date(e);if(Number.isNaN(t.getTime()))return"";const n=r=>String(r).padStart(2,"0");return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}T${n(t.getHours())}:${n(t.getMinutes())}`}catch{return""}}function pf(e){var l,s;if(e.type!=="cron")return e.schedule;const t=Qm(e.schedule);if(!t)return e.schedule;const n=((l=qm.find(a=>a.value===t.dow))==null?void 0:l.label)||t.dow,r=((s=Wm.find(a=>a.value===t.hour))==null?void 0:s.label)||`${t.hour}`,i=String(t.minute).padStart(2,"0");return n==="Every day"?`Every day ${r} :${i}`:`Every ${n} ${r} :${i}`}const Qj=["all","tasks","agents","artifacts","projects","settings"],Yj={tasks:Kl,agents:Pr,plans:Vn,projects:Su,settings:Nr};function Kj({open:e,onClose:t,onNavigate:n}){const[r,i]=k.useState(""),[l,s]=k.useState("all"),[a,u]=k.useState([]),[d,c]=k.useState(!1),f=k.useRef(null);k.useEffect(()=>{e&&(i(""),u([]),requestAnimationFrame(()=>{var g;return(g=f.current)==null?void 0:g.focus()}))},[e]),k.useEffect(()=>{if(!r.trim()){u([]);return}const g=setTimeout(async()=>{c(!0);try{const x=await q.get(`/search?q=${encodeURIComponent(r)}&scope=${l}`);u(x.results||[])}catch{u([])}finally{c(!1)}},250);return()=>clearTimeout(g)},[r,l]);const h=g=>{const x=g.item,C=x.id||x.slug||x.name||"";n(g.type,C),t()},p=a.reduce((g,x)=>(g[x.type]||(g[x.type]=[]),g[x.type].push(x),g),{});return o.jsx(Cn,{open:e,onClose:t,title:"Search",children:o.jsxs("div",{className:"mobile-search-container",children:[o.jsxs("div",{className:"mobile-search-input-row",children:[o.jsx(ld,{size:16,style:{color:"var(--text-muted)",flexShrink:0}}),o.jsx("input",{ref:f,className:"mobile-search-field",type:"text",placeholder:"Search…",value:r,onChange:g=>i(g.target.value),enterKeyHint:"search",onKeyDown:g=>{g.key==="Escape"&&t(),g.key==="Enter"&&a.length>0&&h(a[0])}}),r&&o.jsx("button",{type:"button",className:"mobile-icon-btn",onClick:()=>i(""),"aria-label":"Clear",children:o.jsx(Yn,{size:16})})]}),o.jsx("div",{className:"mobile-search-scopes",children:Qj.map(g=>o.jsx("button",{type:"button",className:`mobile-scope-chip ${l===g?"active":""}`,onClick:()=>s(g),children:g==="all"?"All":g.charAt(0).toUpperCase()+g.slice(1)},g))}),o.jsxs("div",{className:"mobile-search-results",children:[d&&o.jsx("div",{className:"mobile-search-loading",children:"Searching…"}),!d&&r&&a.length===0&&o.jsxs("div",{className:"mobile-empty",children:[o.jsx(ld,{size:32}),o.jsx("p",{children:"No results found"})]}),!d&&!r&&o.jsx("div",{className:"mobile-empty",children:o.jsx("p",{children:"Type to search across tasks, agents, plans, and more."})}),Object.entries(p).map(([g,x])=>{const C=Yj[g]||Vn;return o.jsxs("div",{className:"mobile-search-group",children:[o.jsxs("h4",{className:"mobile-search-group-title",children:[o.jsx(C,{size:12})," ",g.charAt(0).toUpperCase()+g.slice(1)," (",x.length,")"]}),x.map((y,m)=>{const v=y.item;return o.jsxs("button",{type:"button",className:"mobile-search-result-item",onClick:()=>h(y),children:[o.jsx("span",{className:"mobile-search-result-title",children:v.title||v.name||v.slug||"(unnamed)"}),v.description&&o.jsx("span",{className:"mobile-search-result-meta",children:v.description.slice(0,80)})]},m)})]},g)})]})]})})}function Gj(e){if(e<=0)return"expired";const t=Math.floor(e/1e3),n=Math.floor(t/60),r=t%60;return`${n}:${String(r).padStart(2,"0")}`}function Xj({pair:e,onStart:t}){const[n,r]=k.useState(null),[i,l]=k.useState(()=>e.expiresAt-Date.now()),s=i<=0;return k.useEffect(()=>{Hm(()=>import("./index-DU61awG3.js"),[]).then(a=>{r(a.QRCodeSVG)})},[]),k.useEffect(()=>{if(!e)return;const a=setInterval(()=>{l(e.expiresAt-Date.now())},1e3);return()=>clearInterval(a)},[e]),n?o.jsxs("div",{style:{textAlign:"center"},children:[o.jsx("div",{style:{background:"#fff",padding:12,borderRadius:12,display:"inline-block"},children:o.jsx(n,{value:e.qrPayload,size:180,level:"M"})}),o.jsxs("div",{style:{marginTop:8,fontSize:12},children:["Expires in ",o.jsx("strong",{children:Gj(i)})]}),o.jsx("div",{className:"mono",style:{fontSize:10,wordBreak:"break-all",marginTop:4},children:e.publicUrl}),s&&o.jsxs("button",{type:"button",className:"mobile-btn",onClick:t,style:{marginTop:12,width:"100%"},children:[o.jsx(Dt,{size:14})," Generate new QR"]})]}):o.jsx("div",{style:{textAlign:"center",padding:"16px"},children:o.jsx("span",{style:{color:"var(--text-dim)",fontSize:13},children:"Loading QR library…"})})}const Zj=[{id:"dark",label:"Dark",Icon:Fx},{id:"light",label:"Light",Icon:Wx},{id:"system",label:"System",Icon:Ox}],Jj=[{name:"Purple",accent:"#8b5cf6"},{name:"Blue",accent:"#3b82f6"},{name:"Green",accent:"#10b981"},{name:"Orange",accent:"#f97316"},{name:"Red",accent:"#ef4444"},{name:"Pink",accent:"#ec4899"},{name:"Cyan",accent:"#06b6d4"},{name:"Mono",accent:"#6b7280"}];function eC({settings:e,snapshot:t,onRefresh:n}){var y,m,v,N,P,j;const[r,i]=k.useState(e),[l,s]=k.useState(!1),[a,u]=k.useState(!1),[d,c]=k.useState(null),[f,h]=k.useState(!1);k.useEffect(()=>{i(e),s(!1),e.theme&&ii(e.theme)},[e]);const p=I=>{i(L=>{const T={...L,theme:{...L.theme,...I}};return Gl(T.theme),ii(T.theme),T}),s(!0)},g=(I,L)=>{i(T=>({...T,[I]:L})),s(!0)},x=async()=>{u(!0);try{const I=await q.put("/settings",r);i(I.data),s(!1),Gl(I.data.theme),ii(I.data.theme),n()}catch{}finally{u(!1)}},C=async()=>{h(!0);try{const I=await q.post("/pair/start");c(I)}catch{}finally{h(!1)}};return o.jsxs("div",{className:"mobile-view",children:[l&&o.jsxs("div",{className:"mobile-settings-save-bar",children:[o.jsx("span",{children:"Unsaved changes"}),o.jsxs("button",{type:"button",className:"mobile-btn",disabled:a,onClick:x,children:[o.jsx(Ph,{size:14})," ",a?"Saving…":"Save"]})]}),o.jsxs("section",{className:"mobile-section",children:[o.jsx("h3",{className:"mobile-section-title",children:"Appearance"}),o.jsxs("div",{className:"mobile-card",children:[o.jsxs("div",{className:"mobile-setting-row",children:[o.jsx("span",{className:"mobile-setting-label",children:"Theme"}),o.jsx("div",{className:"mobile-theme-btns",children:Zj.map(({id:I,label:L,Icon:T})=>o.jsxs("button",{type:"button",className:`mobile-theme-btn ${r.theme.mode===I?"active":""}`,onClick:()=>p({mode:I}),children:[o.jsx(T,{size:14})," ",L]},I))})]}),o.jsxs("div",{className:"mobile-setting-row",style:{flexDirection:"column",alignItems:"flex-start",gap:8},children:[o.jsx("span",{className:"mobile-setting-label",children:"Accent color"}),o.jsx("div",{className:"mobile-accent-swatches",children:Jj.map(I=>o.jsx("button",{type:"button",className:`mobile-accent-swatch ${r.theme.accent===I.accent?"active":""}`,style:{background:I.accent},onClick:()=>p({accent:I.accent}),title:I.name},I.name))})]}),o.jsxs("div",{className:"mobile-setting-row",style:{flexDirection:"column",alignItems:"flex-start",gap:8},children:[o.jsxs("span",{className:"mobile-setting-label",children:["Font size: ",r.theme.fontSize,"px"]}),o.jsx("input",{type:"range",min:12,max:20,value:r.theme.fontSize,onChange:I=>p({fontSize:Number(I.target.value)}),style:{width:"100%"}})]}),o.jsxs("div",{className:"mobile-setting-row",children:[o.jsx("span",{className:"mobile-setting-label",children:"Compact mode"}),o.jsxs("label",{className:"mobile-toggle",children:[o.jsx("input",{type:"checkbox",checked:r.theme.compactMode,onChange:I=>p({compactMode:I.target.checked})}),o.jsx("span",{className:"mobile-toggle-slider"})]})]}),o.jsxs("div",{className:"mobile-setting-row",children:[o.jsx("span",{className:"mobile-setting-label",children:"Animations"}),o.jsxs("label",{className:"mobile-toggle",children:[o.jsx("input",{type:"checkbox",checked:r.theme.animations,onChange:I=>p({animations:I.target.checked})}),o.jsx("span",{className:"mobile-toggle-slider"})]})]})]})]}),o.jsxs("section",{className:"mobile-section",children:[o.jsx("h3",{className:"mobile-section-title",children:"Chat Defaults"}),o.jsxs("div",{className:"mobile-card",children:[o.jsx("label",{className:"mobile-field-label",children:"Default Agent"}),o.jsx("select",{className:"mobile-input",value:r.defaultAgent||"odin",onChange:I=>g("defaultAgent",I.target.value),children:((t==null?void 0:t.agents)||[]).map(I=>o.jsxs("option",{value:I.name,children:["@",I.name]},I.name))}),o.jsx("label",{className:"mobile-field-label",style:{marginTop:8},children:"Default Model"}),o.jsx("input",{className:"mobile-input",type:"text",placeholder:"(auto)",value:r.defaultModel||"",onChange:I=>g("defaultModel",I.target.value)})]})]}),o.jsxs("section",{className:"mobile-section",children:[o.jsx("h3",{className:"mobile-section-title",children:"Notifications"}),o.jsxs("div",{className:"mobile-card",children:[o.jsxs("div",{className:"mobile-setting-row",children:[o.jsx("span",{className:"mobile-setting-label",children:"Agent completion"}),o.jsxs("label",{className:"mobile-toggle",children:[o.jsx("input",{type:"checkbox",checked:!!r.notifications.onAgentComplete,onChange:I=>{i(L=>({...L,notifications:{...L.notifications,onAgentComplete:I.target.checked}})),s(!0)}}),o.jsx("span",{className:"mobile-toggle-slider"})]})]}),o.jsxs("div",{className:"mobile-setting-row",children:[o.jsx("span",{className:"mobile-setting-label",children:"Plan approval"}),o.jsxs("label",{className:"mobile-toggle",children:[o.jsx("input",{type:"checkbox",checked:!!r.notifications.onPlanApproval,onChange:I=>{i(L=>({...L,notifications:{...L.notifications,onPlanApproval:I.target.checked}})),s(!0)}}),o.jsx("span",{className:"mobile-toggle-slider"})]})]})]})]}),o.jsxs("section",{className:"mobile-section",children:[o.jsx("h3",{className:"mobile-section-title",children:"Agent Behavior"}),o.jsxs("div",{className:"mobile-card",children:[o.jsx("label",{className:"mobile-field-label",children:"Max parallel agents"}),o.jsx("input",{className:"mobile-input",type:"number",inputMode:"numeric",min:1,max:20,value:((y=r.agents)==null?void 0:y.maxParallel)??6,onChange:I=>{i(L=>({...L,agents:{...L.agents,maxParallel:Math.max(1,Math.min(20,parseInt(I.target.value,10)||6))}})),s(!0)}}),o.jsx("label",{className:"mobile-field-label",style:{marginTop:8},children:"Stuck threshold (ms)"}),o.jsx("input",{className:"mobile-input",type:"number",inputMode:"numeric",min:6e4,max:36e5,step:6e4,value:((m=r.agents)==null?void 0:m.stuckThresholdMs)??6e5,onChange:I=>{i(L=>({...L,agents:{...L.agents,stuckThresholdMs:Math.max(6e4,parseInt(I.target.value,10)||6e5)}})),s(!0)}}),o.jsxs("div",{className:"mobile-setting-row",style:{marginTop:8},children:[o.jsx("span",{className:"mobile-setting-label",children:"Auto-restart stuck agents"}),o.jsxs("label",{className:"mobile-toggle",children:[o.jsx("input",{type:"checkbox",checked:!!((v=r.agents)!=null&&v.autoRestart),onChange:I=>{i(L=>({...L,agents:{...L.agents,autoRestart:I.target.checked}})),s(!0)}}),o.jsx("span",{className:"mobile-toggle-slider"})]})]})]})]}),o.jsxs("section",{className:"mobile-section",children:[o.jsx("h3",{className:"mobile-section-title",children:"Tailscale Serve"}),o.jsx("div",{className:"mobile-card",children:o.jsxs("p",{className:"muted",style:{fontSize:13},children:["Use ",o.jsx("code",{children:"bizar service"})," commands in the terminal to configure Tailscale serve."]})})]}),o.jsxs("section",{className:"mobile-section",children:[o.jsxs("h3",{className:"mobile-section-title",children:[o.jsx(sd,{size:14})," Companion App"]}),o.jsxs("div",{className:"mobile-card",children:[!d&&o.jsxs("button",{type:"button",className:"mobile-btn",onClick:C,disabled:f,style:{width:"100%"},children:[o.jsx(sd,{size:14})," ",f?"Generating…":"Generate QR Code"]}),d&&o.jsx(Xj,{pair:d,onStart:C})]})]}),o.jsxs("section",{className:"mobile-section",children:[o.jsx("h3",{className:"mobile-section-title",children:"About"}),o.jsxs("div",{className:"mobile-card",children:[o.jsxs("div",{className:"mobile-setting-row",children:[o.jsx("span",{className:"mobile-setting-label",children:"Version"}),o.jsx("span",{className:"mobile-setting-value mono",children:((N=r.about)==null?void 0:N.version)||"—"})]}),o.jsxs("div",{className:"mobile-setting-row",children:[o.jsx("span",{className:"mobile-setting-label",children:"Agents"}),o.jsx("span",{className:"mobile-setting-value",children:((P=t==null?void 0:t.agents)==null?void 0:P.length)||0})]}),o.jsxs("div",{className:"mobile-setting-row",children:[o.jsx("span",{className:"mobile-setting-label",children:"Tasks"}),o.jsx("span",{className:"mobile-setting-value",children:((j=t==null?void 0:t.tasks)==null?void 0:j.length)||0})]}),o.jsxs("div",{className:"mobile-setting-row",children:[o.jsx("span",{className:"mobile-setting-label",children:"Plans"}),o.jsx("span",{className:"mobile-setting-value",children:(t==null?void 0:t.artifacts.length)||0})]})]})]}),o.jsx("div",{className:"mobile-view-footer",children:o.jsx("a",{href:"/?desktop=1",className:"mobile-btn mobile-btn-secondary",children:"Switch to Desktop"})})]})}const tC=["languages","framework","design","testing","devops","data","security","integration"];function nC({snapshot:e,onBack:t}){const[n,r]=k.useState([]),[i,l]=k.useState(!0),[s,a]=k.useState(""),[u,d]=k.useState(""),[c,f]=k.useState(null),h=async()=>{try{const x=await q.get("/skills");r(x.skills||[])}catch{}finally{l(!1)}};k.useEffect(()=>{h()},[]);const p=async(x,C)=>{try{await q.patch(`/skills/${encodeURIComponent(x)}`,{enabled:C}),r(y=>y.map(m=>m.id===x?{...m,enabled:C}:m)),(c==null?void 0:c.id)===x&&f(y=>y&&{...y,enabled:C})}catch{}},g=n.filter(x=>{if(u&&x.category!==u)return!1;if(s){const C=s.toLowerCase();return x.name.toLowerCase().includes(C)||x.description.toLowerCase().includes(C)}return!0});return o.jsxs("div",{className:"mobile-view",children:[o.jsxs("div",{className:"mobile-tasks-toolbar",children:[o.jsx("input",{className:"mobile-search-input",type:"text",placeholder:"Search skills…",value:s,onChange:x=>a(x.target.value),style:{flex:1}}),o.jsx("button",{type:"button",className:"mobile-icon-btn",onClick:()=>h(),"aria-label":"Refresh",children:o.jsx(Dt,{size:16})})]}),o.jsxs("div",{className:"mobile-search-scopes",children:[o.jsx("button",{type:"button",className:`mobile-scope-chip ${u?"":"active"}`,onClick:()=>d(""),children:"All"}),tC.map(x=>o.jsx("button",{type:"button",className:`mobile-scope-chip ${u===x?"active":""}`,onClick:()=>d(x),children:x},x))]}),i?o.jsx("div",{className:"mobile-loading",children:o.jsx("p",{children:"Loading…"})}):g.length===0?o.jsxs("div",{className:"mobile-empty",children:[o.jsx(Yl,{size:40}),o.jsx("p",{children:"No skills found."})]}):o.jsx("div",{className:"mobile-card-list",children:g.map(x=>o.jsxs("button",{type:"button",className:"mobile-list-item mobile-list-item-interactive",onClick:()=>f(x),children:[o.jsx("div",{className:"mobile-list-icon",children:o.jsx(Yl,{size:16})}),o.jsxs("div",{className:"mobile-list-content",children:[o.jsx("span",{className:"mobile-list-title",children:x.name}),o.jsxs("span",{className:"mobile-list-meta",children:[x.category," · v",x.version]})]}),o.jsx("span",{className:`mobile-list-badge ${x.enabled?"badge-on":"badge-off"}`,children:x.enabled?"on":"off"})]},x.id))}),c&&o.jsx(At,{open:!0,onClose:()=>f(null),title:c.name,actions:o.jsxs("button",{type:"button",className:`mobile-btn ${c.enabled?"mobile-btn-secondary":""}`,style:{width:"100%"},onClick:()=>{c&&p(c.id,!c.enabled)},children:[o.jsx(Ih,{size:14})," ",c.enabled?"Disable":"Enable"]}),children:o.jsxs("div",{className:"mobile-agent-detail",children:[o.jsx("p",{className:"mobile-agent-detail-desc",children:c.description||"No description."}),o.jsxs("div",{className:"mobile-agent-detail-meta",children:[o.jsxs("div",{className:"mobile-task-detail-row",children:[o.jsx("span",{children:"Category"}),o.jsx("span",{children:c.category})]}),o.jsxs("div",{className:"mobile-task-detail-row",children:[o.jsx("span",{children:"Version"}),o.jsx("span",{className:"mono",children:c.version})]}),o.jsxs("div",{className:"mobile-task-detail-row",children:[o.jsx("span",{children:"Source"}),o.jsx("span",{children:c.source})]}),c.tags.length>0&&o.jsxs("div",{className:"mobile-task-detail-row",children:[o.jsx("span",{children:"Tags"}),o.jsx("span",{children:c.tags.join(", ")})]})]})]})})]})}const rC=["queued","doing","blocked","done"],sl={queued:"Queued",doing:"Doing",blocked:"Blocked",done:"Done"},hf={queued:"doing",doing:"done",blocked:"queued",done:"queued"};function iC(e){const t=e.metadata??{};return!!(t.sessionId||t.bgInstanceId)}function lC(e){var n;const t=e.metadata??{};return!!((n=t.artifactIds)!=null&&n.length||t.artifactId)}function mf({snapshot:e,onRefresh:t,selectedTaskId:n,onCloseDetail:r,onOpenChat:i,onOpenArtifact:l}){var oe,Ce;const[s,a]=k.useState(e.tasks||[]),[u,d]=k.useState(!e.tasks),[c,f]=k.useState(""),[h,p]=k.useState("queued"),[g,x]=k.useState(null),[C,y]=k.useState(!1),[m,v]=k.useState(null),[N,P]=k.useState([]),[j,I]=k.useState(""),[L,T]=k.useState(null),[w,z]=k.useState(!1),[A,H]=k.useState(""),[$,Q]=k.useState("updated");k.useEffect(()=>{var U;if(e.tasks&&(a(e.tasks),d(!1)),n){const ee=(U=e.tasks)==null?void 0:U.find(re=>re.id===n);ee&&x(ee)}},[e.tasks,n]),k.useEffect(()=>{if(n){const U=s.find(ee=>ee.id===n);U&&x(U)}},[n,s]);const he=async()=>{try{const U=await q.get("/tasks");a(Array.isArray(U)?U:[])}catch{}finally{d(!1)}},ne=async(U,ee)=>{a(re=>re.map(be=>be.id===U?{...be,status:ee}:be)),(g==null?void 0:g.id)===U&&x(re=>re&&{...re,status:ee});try{await q.patch(`/tasks/${encodeURIComponent(U)}/status`,{status:ee})}catch{await he()}},R=async U=>{if(confirm("Delete this task?"))try{await q.del(`/tasks/${encodeURIComponent(U)}`),a(ee=>ee.filter(re=>re.id!==U)),(g==null?void 0:g.id)===U&&x(null)}catch{await he()}},V=async U=>{try{await q.post(`/tasks/${encodeURIComponent(U)}/archive`),a(ee=>ee.filter(re=>re.id!==U)),(g==null?void 0:g.id)===U&&x(null)}catch{}},Y=[...s.filter(U=>{var ee,re;if(c.trim()){const be=c.toLowerCase();if(!(U.title||"").toLowerCase().includes(be)&&!(U.description||"").toLowerCase().includes(be))return!1}if(A.trim()){const be=A==="mine"?((re=(ee=e.settings)==null?void 0:ee.data)==null?void 0:re.defaultAgent)||sC(e):A.replace(/^@/,"");if((U.assignee||"").toLowerCase()!==be.toLowerCase())return!1}return!0})].sort((U,ee)=>{switch($){case"priority":{const re={high:0,normal:1,low:2};return(re[U.priority]??1)-(re[ee.priority]??1)}case"created":return new Date(ee.createdAt).getTime()-new Date(U.createdAt).getTime();case"updated":default:return new Date(ee.updatedAt).getTime()-new Date(U.updatedAt).getTime()}}),ie=Y.filter(U=>U.status===h),S=e.agents||[],ge=async(U,ee,re,be)=>{try{const Mt=await q.post("/tasks",{title:U,description:ee,assignee:re||null,priority:be});a(tn=>[Mt,...tn]),y(!1)}catch{}},Le=async U=>{z(!0),I(""),T(null),v(U);try{const re=((await q.get(`/tasks/${encodeURIComponent(U)}/artifacts`)).artifacts||[]).map(be=>be.id);if(P(re),re.length>0){const[be,Mt]=await Promise.all([q.get(`/artifacts/${encodeURIComponent(re[0])}`),fetch(q.urlWithToken(`/artifacts/${encodeURIComponent(re[0])}/content`)).then(tn=>tn.text())]);T(be),I(Mt)}}catch{}finally{z(!1)}};return u?o.jsx("div",{className:"mobile-loading",children:o.jsx("p",{children:"Loading…"})}):o.jsxs("div",{className:"mobile-view mobile-view-tasks",children:[o.jsxs("div",{className:"mobile-tasks-toolbar",children:[o.jsx("input",{className:"mobile-search-input",type:"text",placeholder:"Search tasks…",value:c,onChange:U=>f(U.target.value),style:{flex:1}}),o.jsx("button",{type:"button",className:"mobile-icon-btn",onClick:()=>he(),"aria-label":"Refresh",children:o.jsx(Dt,{size:16})})]}),o.jsxs("div",{className:"mobile-tasks-filters",children:[o.jsxs("select",{className:"mobile-filter-select",value:A,onChange:U=>H(U.target.value),children:[o.jsx("option",{value:"",children:"All"}),o.jsx("option",{value:"mine",children:"Mine"}),S.map(U=>o.jsxs("option",{value:`@${U.name}`,children:["@",U.name]},U.name))]}),o.jsxs("select",{className:"mobile-filter-select",value:$,onChange:U=>Q(U.target.value),children:[o.jsx("option",{value:"updated",children:"Updated"}),o.jsx("option",{value:"created",children:"Created"}),o.jsx("option",{value:"priority",children:"Priority"})]})]}),o.jsx("div",{className:"mobile-kanban-tabs",children:rC.map(U=>{const ee=Y.filter(re=>re.status===U).length;return o.jsxs("button",{type:"button",className:`mobile-kanban-tab ${h===U?"active":""}`,onClick:()=>p(U),children:[sl[U]," (",ee,")"]},U)})}),o.jsxs("div",{className:"mobile-card-list",children:[ie.length===0&&o.jsxs("div",{className:"mobile-empty mobile-empty-compact",children:[o.jsxs("p",{children:["No ",sl[h].toLowerCase()," tasks."]}),o.jsx("p",{className:"muted",children:"Create one or switch columns."})]}),ie.map(U=>{var ee;return o.jsxs("button",{type:"button",className:"mobile-task-card",onClick:()=>x(U),children:[o.jsx("div",{className:"priority-dot",style:{background:Kx[U.priority]||"var(--info)"}}),o.jsxs("div",{className:"task-content",children:[o.jsx("div",{className:"task-title",children:U.title}),o.jsxs("div",{className:"task-meta",children:[U.assignee?`@${U.assignee}`:"unassigned"," · ",xr(U.updatedAt||U.createdAt),(ee=U.dependencies)!=null&&ee.length?` · ${U.dependencies.length} deps`:""]})]})]},U.id)})]}),o.jsx("button",{type:"button",className:"mobile-fab",onClick:()=>y(!0),"aria-label":"Add task",children:o.jsx(mt,{size:24})}),o.jsx(At,{open:!!g,onClose:()=>{x(null),r==null||r()},title:"Task Detail",actions:g&&o.jsxs("div",{className:"mobile-task-detail-actions",children:[g.status!=="done"&&o.jsxs("button",{type:"button",className:"mobile-btn",style:{flex:1},onClick:()=>{g&&ne(g.id,hf[g.status])},children:["Move to ",sl[hf[g.status]||"queued"]]}),o.jsxs("button",{type:"button",className:"mobile-btn mobile-btn-secondary",onClick:()=>{g&&V(g.id)},children:[o.jsx(Cx,{size:14})," Archive"]}),iC(g)&&o.jsxs("button",{type:"button",className:"mobile-btn mobile-btn-secondary",onClick:()=>{i==null||i(g.id)},children:[o.jsx(Mn,{size:14})," Chat"]}),lC(g)&&o.jsxs("button",{type:"button",className:"mobile-btn mobile-btn-secondary",onClick:()=>{Le(g.id)},children:[o.jsx(Vn,{size:14})," Artifact"]}),o.jsx("button",{type:"button",className:"mobile-btn mobile-btn-danger",onClick:()=>{g&&R(g.id)},children:o.jsx(Lr,{size:14})})]}),children:g&&o.jsxs("div",{className:"mobile-task-detail",children:[o.jsxs("div",{className:"mobile-task-detail-header",children:[o.jsx("span",{className:`mobile-task-status-badge status-${g.status}`,children:sl[g.status]||g.status}),o.jsx("span",{className:`mobile-task-priority priority-${g.priority}`,children:g.priority})]}),o.jsx("h3",{className:"mobile-task-detail-title",children:g.title}),g.description&&o.jsx("p",{className:"mobile-task-detail-desc",children:g.description}),o.jsxs("div",{className:"mobile-task-detail-meta",children:[g.assignee&&o.jsxs("div",{className:"mobile-task-detail-row",children:[o.jsx("span",{children:"Assignee"}),o.jsxs("span",{children:["@",g.assignee]})]}),g.dueDate&&o.jsxs("div",{className:"mobile-task-detail-row",children:[o.jsx("span",{children:"Due"}),o.jsx("span",{children:new Date(g.dueDate).toLocaleDateString()})]}),g.timeSpent!=null&&o.jsxs("div",{className:"mobile-task-detail-row",children:[o.jsx("span",{children:"Time spent"}),o.jsxs("span",{children:[Math.round(g.timeSpent/6e4),"min"]})]}),(oe=g.dependencies)!=null&&oe.length?o.jsxs("div",{className:"mobile-task-detail-row",children:[o.jsx("span",{children:"Dependencies"}),o.jsx("span",{children:g.dependencies.length})]}):null,(Ce=g.comments)!=null&&Ce.length?o.jsxs("div",{className:"mobile-task-detail-row",children:[o.jsx("span",{children:"Comments"}),o.jsx("span",{children:g.comments.length})]}):null,o.jsxs("div",{className:"mobile-task-detail-row",children:[o.jsx("span",{children:"Created"}),o.jsx("span",{children:xr(g.createdAt)})]}),o.jsxs("div",{className:"mobile-task-detail-row",children:[o.jsx("span",{children:"Updated"}),o.jsx("span",{children:xr(g.updatedAt)})]})]})]})}),o.jsx(oC,{open:C,onClose:()=>y(!1),onCreate:ge,agents:S}),o.jsx(At,{open:!!m,onClose:()=>{v(null),I(""),T(null)},title:(L==null?void 0:L.name)||"Artifact",actions:N.length>1?o.jsx("div",{className:"mobile-task-detail-actions",children:N.map((U,ee)=>o.jsxs("button",{type:"button",className:"mobile-btn mobile-btn-secondary",style:{flex:1},onClick:()=>{z(!0),Promise.all([q.get(`/artifacts/${encodeURIComponent(U)}`),fetch(q.urlWithToken(`/artifacts/${encodeURIComponent(U)}/content`)).then(re=>re.text())]).then(([re,be])=>{T(re),I(be),z(!1)}).catch(()=>z(!1))},children:["Artifact ",ee+1]},U))}):null,children:o.jsx("div",{className:"mobile-artifact-viewer",children:w?o.jsx("div",{className:"mobile-loading",children:o.jsx("p",{children:"Loading artifact…"})}):j?o.jsx("iframe",{srcDoc:j,className:"mobile-artifact-iframe",sandbox:"allow-scripts allow-forms allow-popups allow-same-origin",title:(L==null?void 0:L.name)||"Artifact",loading:"lazy"}):o.jsxs("div",{className:"mobile-empty",children:[o.jsx(Vn,{size:32}),o.jsx("p",{className:"muted",children:"No artifact content available."})]})})})]})}function sC(e){var t,n;return((n=(t=e.settings)==null?void 0:t.data)==null?void 0:n.defaultAgent)||"odin"}function oC({open:e,onClose:t,onCreate:n,agents:r}){const[i,l]=k.useState(""),[s,a]=k.useState(""),[u,d]=k.useState(""),[c,f]=k.useState("normal"),h=p=>{p.preventDefault(),i.trim()&&(n(i.trim(),s.trim(),u,c),l(""),a(""),d(""),f("normal"))};return o.jsx(Cn,{open:e,onClose:t,title:"New Task",actions:o.jsxs("button",{type:"submit",form:"new-task-form",className:"mobile-btn",style:{width:"100%"},children:[o.jsx(mt,{size:14})," Create Task"]}),children:o.jsxs("form",{id:"new-task-form",onSubmit:h,className:"mobile-task-form",children:[o.jsx("label",{className:"mobile-field-label",children:"Title *"}),o.jsx("input",{className:"mobile-input",type:"text",placeholder:"Task title",value:i,onChange:p=>l(p.target.value),autoFocus:!0,required:!0}),o.jsx("label",{className:"mobile-field-label",children:"Description"}),o.jsx("textarea",{className:"mobile-input",rows:3,placeholder:"Optional description",value:s,onChange:p=>a(p.target.value)}),o.jsx("label",{className:"mobile-field-label",children:"Assignee"}),o.jsxs("select",{className:"mobile-input",value:u,onChange:p=>d(p.target.value),children:[o.jsx("option",{value:"",children:"Unassigned"}),r.map(p=>o.jsxs("option",{value:p.name,children:["@",p.name]},p.name))]}),o.jsx("label",{className:"mobile-field-label",children:"Priority"}),o.jsxs("select",{className:"mobile-input",value:c,onChange:p=>f(p.target.value),children:[o.jsx("option",{value:"low",children:"Low"}),o.jsx("option",{value:"normal",children:"Normal"}),o.jsx("option",{value:"high",children:"High"})]})]})})}const aC=[{id:"activity",label:"Activity",icon:fa},{id:"chat",label:"Chat",icon:Mn},{id:"tasks",label:"Tasks",icon:Kl},{id:"settings",label:"Settings",icon:Ah},{id:"more",label:"More",icon:Dx}];function uC(e){const t=e.meta??{},n=typeof t.taskId=="string"?t.taskId:null,r=typeof t.slug=="string"?t.slug:null,i=typeof t.agent=="string"?t.agent:null;if(n)return{id:"task-detail",taskId:n};if(r)return{id:"artifacts?-detail",slug:r};if(i)return{id:"agent-detail",name:i};const l=e.link??"";return l.startsWith("/artifacts?/")?{id:"artifacts?-detail",slug:decodeURIComponent(l.slice(12))}:l.startsWith("/tasks/")?{id:"task-detail",taskId:decodeURIComponent(l.slice(7))}:l.startsWith("/agents/")?{id:"agent-detail",name:decodeURIComponent(l.slice(8))}:null}function mC(){const[e,t]=k.useState("activity"),[n,r]=k.useState([]),[i,l]=k.useState(!1),[s,a]=k.useState(null),[u,d]=k.useState(null),[c,f]=k.useState(null),[h,p]=k.useState(null),[g,x]=k.useState(!0),[C,y]=k.useState(0),m=k.useMemo(()=>n[n.length-1]??{id:e},[e,n]),v=k.useCallback(w=>{r(z=>[...z,w])},[]),N=k.useCallback(()=>{r(w=>w.slice(0,-1))},[]),P=k.useCallback(w=>{r([]),t(w)},[]),j=k.useCallback(async()=>{var w;try{const z=await q.get("/snapshot");d(z),(w=z.settings)!=null&&w.data&&f(z.settings.data),p(null)}catch(z){throw p(z.message||"Dashboard server unreachable."),z}},[]);k.useEffect(()=>{let w=!1;return Promise.all([q.get("/snapshot").catch(()=>null),q.get("/settings").catch(()=>null),q.probeAuthStatus().catch(()=>null)]).then(([z,A])=>{var $;if(w)return;const H=(A==null?void 0:A.data)??(($=z==null?void 0:z.settings)==null?void 0:$.data)??null;z&&d(z),H&&f(H),p(!z&&!H?"Dashboard server unreachable.":null)}).catch(z=>{w||p(z.message||"Dashboard server unreachable.")}).finally(()=>{w||x(!1)}),()=>{w=!0}},[]),k.useEffect(()=>{c!=null&&c.theme&&(Gl(c.theme),ii(c.theme))},[c==null?void 0:c.theme]),k.useEffect(()=>{var A;if(((A=c==null?void 0:c.theme)==null?void 0:A.mode)!=="system")return;const w=window.matchMedia("(prefers-color-scheme: light)"),z=()=>{c!=null&&c.theme&&(Gl(c.theme),ii(c.theme))};return w.addEventListener("change",z),()=>w.removeEventListener("change",z)},[c==null?void 0:c.theme]),k.useEffect(()=>{const w=()=>{y(A=>A+1),j().catch(()=>{})},z=()=>{document.visibilityState==="visible"&&w()};return window.addEventListener("online",w),window.addEventListener("pageshow",w),document.addEventListener("visibilitychange",z),()=>{window.removeEventListener("online",w),window.removeEventListener("pageshow",w),document.removeEventListener("visibilitychange",z)}},[j]),k.useEffect(()=>{const w=new Rh,z=w.on(A=>{if(A.type==="snapshot"&&"data"in A&&A.data)d(H=>({...H??{},...A.data}));else if(A.type==="change")j().catch(()=>{});else if(A.type==="tasks:change"){const H=A.task;d($=>{if(!$)return $;const Q=($.tasks||[]).map(ne=>ne.id===H.id?H:ne),he=Q.some(ne=>ne.id===H.id);return{...$,tasks:he?Q:[H,...Q]}})}else A.type==="tasks:delete"?d(H=>H&&{...H,tasks:(H.tasks||[]).filter($=>$.id!==A.id)}):A.type==="settings:change"?A.settings&&f(A.settings):A.type==="project:change"||A.type==="agents:change"||A.type==="schedules:change"||A.type==="artifact:change"?j().catch(()=>{}):(A.type==="agent:status"||A.type==="agent:restarted")&&d(H=>{if(!H)return H;const $=(H.agents||[]).map(Q=>Q.name===A.agent.name?A.agent:Q);return{...H,agents:$}})});return()=>{z(),w.close()}},[j,C]);const I=k.useCallback(w=>{(w==="activity"||w==="chat"||w==="tasks"||w==="settings"||w==="more")&&P(w)},[P]),L=k.useCallback((w,z,A)=>{if(w==="notification"){const H=uC({link:z||null,meta:A??null});H&&v(H);return}if(w==="task"&&z){v({id:"task-detail",taskId:z});return}if(w==="artifacts?"&&z){v({id:"artifacts?-detail",slug:z});return}if(w==="agent"&&z){v({id:"agent-detail",name:z});return}if(w==="project"){P("activity");return}w==="setting"&&P("settings")},[P,v]),T=()=>{if(!u||!c)return null;if(n.length>0){const w=n[n.length-1];switch(w.id){case"artifacts?":return o.jsx(Rj,{snapshot:u,onBack:N,onOpenArtifact:z=>v({id:"artifacts?-detail",slug:z})});case"agents":return o.jsx(uf,{snapshot:u,onBack:N,onOpenAgent:z=>v({id:"agent-detail",name:z}),onRefresh:j});case"skills":return o.jsx(nC,{snapshot:u,onBack:N});case"mods":return o.jsx(Ij,{snapshot:u,onBack:N});case"schedules":return o.jsx(Bj,{snapshot:u,onBack:N});case"history":return o.jsx(zj,{onBack:N});case"config":return o.jsx(Tj,{onBack:N});case"artifacts?-detail":return o.jsx(Aj,{slug:w.slug,onBack:N});case"agent-detail":return o.jsx(uf,{snapshot:u,onBack:N,onOpenAgent:()=>{},onRefresh:j,selectedAgent:w.name});case"task-detail":return o.jsx(mf,{snapshot:u,onRefresh:j,selectedTaskId:w.taskId,onCloseDetail:N,onOpenChat:z=>{a(z),P("chat")}});default:return null}}switch(e){case"activity":return o.jsx(wj,{snapshot:u,onRefresh:j});case"chat":return o.jsx(Ej,{snapshot:u,settings:c,initialTaskId:s,onClearTaskId:()=>a(null)});case"tasks":return o.jsx(mf,{snapshot:u,onRefresh:j,onOpenChat:w=>{a(w),P("chat")}});case"settings":return o.jsx(eC,{settings:c,snapshot:u,onRefresh:j});case"more":return o.jsx(Pj,{snapshot:u,onNavigate:w=>{(w==="artifacts?"||w==="agents"||w==="skills"||w==="mods"||w==="schedules"||w==="history"||w==="config")&&v({id:w})}});default:return null}};return g?o.jsxs("div",{className:"mobile-loading",children:[o.jsx(_h,{size:"lg"}),o.jsx("p",{children:"Loading Bizar…"})]}):h||!u||!c?o.jsxs("div",{className:"mobile-loading",children:[o.jsx("h2",{children:"Dashboard unavailable"}),o.jsx("p",{children:h||"Dashboard server unreachable."}),o.jsx("p",{className:"muted",children:"Make sure the Bizar dashboard server is running."})]}):o.jsxs("div",{className:"mobile-app",children:[o.jsx(vj,{activeTab:m.id,snapshot:u,onSearch:()=>l(!0),onNavigate:L}),o.jsx("main",{className:"mobile-content",children:T()}),n.length===0&&o.jsx(hj,{tabs:aC,activeTab:e,onChange:I}),n.length>0&&o.jsx("button",{type:"button",className:"mobile-back-btn",onClick:N,"aria-label":"Go back",children:"← Back"}),o.jsx(Kj,{open:i,onClose:()=>l(!1),onNavigate:L})]})}export{Vw as $,fa as A,Pr as B,Tx as C,aj as D,Ax as E,Su as F,Vx as G,ha as H,Rx as I,qx as J,ju as K,dj as L,Mn as M,pj as N,a1 as O,mt as P,lj as Q,Dt as R,Kl as S,Qx as T,Ph as U,o1 as V,fC as W,Yn as X,Ql as Y,Hx as Z,od as _,q as a,rj as a0,Cx as a1,Xx as a2,Kx as a3,$x as a4,Fx as a5,Wx as a6,Ox as a7,Rh as a8,Lx as a9,Ux as aa,Hm as ab,ii as ac,Gl as ad,Nx as ae,Ah as af,hC as ag,pC as ah,ma as ai,wx as aj,mC as ak,ys as b,J as c,rd as d,Yl as e,pa as f,Nr as g,ld as h,Cu as i,o as j,dr as k,t1 as l,nd as m,zx as n,xr as o,Vn as p,Yx as q,k as r,dC as s,_h as t,Jx as u,Lh as v,Lr as w,Ih as x,Th as y,u1 as z};