cognitune 0.3.0 → 0.3.1

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 (78) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +183 -42
  3. package/dist/cli.js +8 -7
  4. package/dist/web/assets/Map-xBJDQ_Xn.js +1 -0
  5. package/dist/web/assets/{Practice-DJ_GeEEw.js → Practice-DNf-tMjl.js} +3 -3
  6. package/dist/web/assets/{_baseUniq-Cgcxu-ug.js → _baseUniq-7KLmbwxc.js} +1 -1
  7. package/dist/web/assets/{architectureDiagram-UYN6MBPD-F11egvO5.js → architectureDiagram-UYN6MBPD-DFK-K3Yp.js} +1 -1
  8. package/dist/web/assets/{blockDiagram-ZHA2E4KO-DcLwUr6e.js → blockDiagram-ZHA2E4KO-D9jSBc-F.js} +1 -1
  9. package/dist/web/assets/{c4Diagram-6F5ED5ID-DoK6LsEW.js → c4Diagram-6F5ED5ID-KAOALvx3.js} +1 -1
  10. package/dist/web/assets/channel-BW4MllLS.js +1 -0
  11. package/dist/web/assets/{chunk-5HRBRIJM-BZZC4mrX.js → chunk-5HRBRIJM-Btr12S8H.js} +1 -1
  12. package/dist/web/assets/{chunk-7U56Z5CX-CRQL1BaD.js → chunk-7U56Z5CX-NWMyaEQ0.js} +1 -1
  13. package/dist/web/assets/{chunk-ASOPGD6M-MyeXPUAo.js → chunk-ASOPGD6M-DdvxpUSZ.js} +1 -1
  14. package/dist/web/assets/{chunk-KFBOBJHC-ivtJnQTl.js → chunk-KFBOBJHC-CLK5Qods.js} +1 -1
  15. package/dist/web/assets/{chunk-T2TOU4HS-DfaWwXAy.js → chunk-T2TOU4HS-B-nrzheR.js} +1 -1
  16. package/dist/web/assets/{chunk-TMUBEWPD-1vGEp44G.js → chunk-TMUBEWPD-DCsdC8PC.js} +1 -1
  17. package/dist/web/assets/classDiagram-LNE6IOMH-D4kEJsvG.js +1 -0
  18. package/dist/web/assets/classDiagram-v2-MQ7JQ4JX-D4kEJsvG.js +1 -0
  19. package/dist/web/assets/clone-C8mTbP7R.js +1 -0
  20. package/dist/web/assets/{dagre-4EVJKHTY-BzJqGMK1.js → dagre-4EVJKHTY-D_09gC0H.js} +1 -1
  21. package/dist/web/assets/{diagram-QW4FP2JN-DserUmhH.js → diagram-QW4FP2JN-quH5WQny.js} +1 -1
  22. package/dist/web/assets/{erDiagram-6RL3IURR-BeMwcZZW.js → erDiagram-6RL3IURR-BmJHLDew.js} +1 -1
  23. package/dist/web/assets/{flowDiagram-7ASYPVHJ-C2Qt1H4b.js → flowDiagram-7ASYPVHJ-DNzT7Cua.js} +1 -1
  24. package/dist/web/assets/{ganttDiagram-NTVNEXSI-DjG6T96W.js → ganttDiagram-NTVNEXSI-6reJ1AIG.js} +1 -1
  25. package/dist/web/assets/{gitGraph-YCYPL57B-C92c8R4j.js → gitGraph-YCYPL57B-BfipSUJ3.js} +1 -1
  26. package/dist/web/assets/{gitGraphDiagram-NRZ2UAAF-C0OK2-pl.js → gitGraphDiagram-NRZ2UAAF-BRb9bqzI.js} +1 -1
  27. package/dist/web/assets/{graph-jcgmh1Ot.js → graph-BHXuL-RR.js} +1 -1
  28. package/dist/web/assets/{index-BTAmHv-d.js → index-7JDqNzz1.js} +1 -1
  29. package/dist/web/assets/{index-DgVZUoYY.js → index-B49g1XNF.js} +1 -1
  30. package/dist/web/assets/{index-BD8q1ij7.js → index-B5Tomqy6.js} +1 -1
  31. package/dist/web/assets/{index-D8PR6AHG.js → index-BCM7jSxq.js} +1 -1
  32. package/dist/web/assets/{index-DB9Tltht.js → index-BM9KwSU5.js} +1 -1
  33. package/dist/web/assets/{index-BPFm8xBn.js → index-BiiiKqbq.js} +1 -1
  34. package/dist/web/assets/{index-D5AcpGl_.js → index-Bli4383n.js} +1 -1
  35. package/dist/web/assets/{index-DJ7YtDlC.js → index-BsH1Ca5H.js} +1 -1
  36. package/dist/web/assets/{index-H4qir-5V.js → index-Bsf4UF_h.js} +1 -1
  37. package/dist/web/assets/{index-DgTHE4KH.js → index-C5JoMvch.js} +1 -1
  38. package/dist/web/assets/{index-CW1WHdXq.js → index-C67RtHfG.js} +1 -1
  39. package/dist/web/assets/{index-CfFkiEw9.js → index-CNViI9C2.js} +1 -1
  40. package/dist/web/assets/{index-TRTMCU2f.js → index-CQjof-kk.js} +1 -1
  41. package/dist/web/assets/{index-DM-V8yrZ.js → index-CyHGDhfc.js} +1 -1
  42. package/dist/web/assets/index-CyhIx47s.css +1 -0
  43. package/dist/web/assets/{index-DIV7qBvA.js → index-D-DY42g9.js} +1 -1
  44. package/dist/web/assets/{index-B05Rh3LW.js → index-DRri1mnd.js} +1 -1
  45. package/dist/web/assets/{index-D3Zk0Btz.js → index-DXji-ikE.js} +1 -1
  46. package/dist/web/assets/{index-D-9XGv5u.js → index-D_DIS1os.js} +1 -1
  47. package/dist/web/assets/{index-BtCLkneo.js → index-Dl6tJxzv.js} +1 -1
  48. package/dist/web/assets/{index-HBtEhFV8.js → index-TI1LWXRL.js} +1 -1
  49. package/dist/web/assets/index-dA5Y-R2D.js +514 -0
  50. package/dist/web/assets/{index-a7yJqPRD.js → index-wnqHtEcu.js} +1 -1
  51. package/dist/web/assets/{index-BJepU7_w.js → index-ysHMZpcw.js} +1 -1
  52. package/dist/web/assets/{infoDiagram-A4XQUW5V-DqkPyvzP.js → infoDiagram-A4XQUW5V-CE9eDiRA.js} +1 -1
  53. package/dist/web/assets/{journeyDiagram-G5WM74LC-CPoGO9lU.js → journeyDiagram-G5WM74LC-D_iPCzBK.js} +1 -1
  54. package/dist/web/assets/{kanban-definition-QRCXZQQD-DhYcbXpZ.js → kanban-definition-QRCXZQQD-Bxj-EOmZ.js} +1 -1
  55. package/dist/web/assets/{layout-D3h_RNbG.js → layout-CQ6J22ew.js} +1 -1
  56. package/dist/web/assets/layout.worker-Bzrmqu8H.js +1 -0
  57. package/dist/web/assets/{mermaid.core-QonkHgY_.js → mermaid.core-27sLJoRM.js} +4 -4
  58. package/dist/web/assets/{min-u5yV8FH_.js → min-h0zR_W4w.js} +1 -1
  59. package/dist/web/assets/{mindmap-definition-GWI6TPTV-7qne4US6.js → mindmap-definition-GWI6TPTV-DiBTVWc8.js} +28 -28
  60. package/dist/web/assets/{pieDiagram-YF2LJOPJ-CYjuzLxS.js → pieDiagram-YF2LJOPJ-BE2VMHC3.js} +1 -1
  61. package/dist/web/assets/{quadrantDiagram-OS5C2QUG-iNs3hmmI.js → quadrantDiagram-OS5C2QUG-DkN-8Avj.js} +1 -1
  62. package/dist/web/assets/{requirementDiagram-MIRIMTAZ-tDYOd2xQ.js → requirementDiagram-MIRIMTAZ-0OCRbKti.js} +1 -1
  63. package/dist/web/assets/{sankeyDiagram-Y46BX6SQ-Ce34Wa1G.js → sankeyDiagram-Y46BX6SQ-6v9qBJFv.js} +1 -1
  64. package/dist/web/assets/{sequenceDiagram-G6AWOVSC-i7VCqMq3.js → sequenceDiagram-G6AWOVSC-CjH7axp-.js} +1 -1
  65. package/dist/web/assets/{stateDiagram-MAYHULR4-BSREATU6.js → stateDiagram-MAYHULR4-Bbbno_Ix.js} +1 -1
  66. package/dist/web/assets/stateDiagram-v2-4JROLMXI-CvrRdVH2.js +1 -0
  67. package/dist/web/assets/{timeline-definition-U7ZMHBDA-DgAweJ73.js → timeline-definition-U7ZMHBDA-BSIsFSlr.js} +1 -1
  68. package/dist/web/assets/{xychartDiagram-6QU3TZC5-DxWMJtPc.js → xychartDiagram-6QU3TZC5-B12dxFiy.js} +1 -1
  69. package/dist/web/index.html +2 -2
  70. package/package.json +1 -1
  71. package/dist/web/assets/Map-pFoOaroM.js +0 -1
  72. package/dist/web/assets/channel-cS78OL1L.js +0 -1
  73. package/dist/web/assets/classDiagram-LNE6IOMH-BV-X_A98.js +0 -1
  74. package/dist/web/assets/classDiagram-v2-MQ7JQ4JX-BV-X_A98.js +0 -1
  75. package/dist/web/assets/clone-CX7XQP1C.js +0 -1
  76. package/dist/web/assets/index-Bs71achu.js +0 -509
  77. package/dist/web/assets/index-DajatLhQ.css +0 -1
  78. package/dist/web/assets/stateDiagram-v2-4JROLMXI-CtOZAypx.js +0 -1
@@ -0,0 +1,514 @@
1
+ var $p=e=>{throw TypeError(e)};var fc=(e,t,n)=>t.has(e)||$p("Cannot "+n);var T=(e,t,n)=>(fc(e,t,"read from private field"),n?n.call(e):t.get(e)),oe=(e,t,n)=>t.has(e)?$p("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Y=(e,t,n,r)=>(fc(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),de=(e,t,n)=>(fc(e,t,"access private method"),n);var eo=(e,t,n,r)=>({set _(i){Y(e,t,i,n)},get _(){return T(e,t,r)}});function Qx(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();const qw="modulepreload",Bw=function(e){return"/"+e},qp={},ml=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),o=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));i=Promise.allSettled(n.map(u=>{if(u=Bw(u),u in qp)return;qp[u]=!0;const c=u.endsWith(".css"),d=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${d}`))return;const h=document.createElement("link");if(h.rel=c?"stylesheet":qw,c||(h.as="script"),h.crossOrigin="",h.href=u,o&&h.setAttribute("nonce",o),document.head.appendChild(h),c)return new Promise((p,f)=>{h.addEventListener("load",p),h.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${u}`)))})}))}function s(l){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=l,window.dispatchEvent(o),!o.defaultPrevented)throw l}return i.then(l=>{for(const o of l||[])o.status==="rejected"&&s(o.reason);return t().catch(s)})};var TL=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Gh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Kx={exports:{}},Pu={},Gx={exports:{}},Ee={};/**
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 Aa=Symbol.for("react.element"),Uw=Symbol.for("react.portal"),Hw=Symbol.for("react.fragment"),Ww=Symbol.for("react.strict_mode"),Vw=Symbol.for("react.profiler"),Qw=Symbol.for("react.provider"),Kw=Symbol.for("react.context"),Gw=Symbol.for("react.forward_ref"),Yw=Symbol.for("react.suspense"),Xw=Symbol.for("react.memo"),Jw=Symbol.for("react.lazy"),Bp=Symbol.iterator;function Zw(e){return e===null||typeof e!="object"?null:(e=Bp&&e[Bp]||e["@@iterator"],typeof e=="function"?e:null)}var Yx={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Xx=Object.assign,Jx={};function gl(e,t,n){this.props=e,this.context=t,this.refs=Jx,this.updater=n||Yx}gl.prototype.isReactComponent={};gl.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")};gl.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Zx(){}Zx.prototype=gl.prototype;function Yh(e,t,n){this.props=e,this.context=t,this.refs=Jx,this.updater=n||Yx}var Xh=Yh.prototype=new Zx;Xh.constructor=Yh;Xx(Xh,gl.prototype);Xh.isPureReactComponent=!0;var Up=Array.isArray,ey=Object.prototype.hasOwnProperty,Jh={current:null},ty={key:!0,ref:!0,__self:!0,__source:!0};function ny(e,t,n){var r,i={},s=null,l=null;if(t!=null)for(r in t.ref!==void 0&&(l=t.ref),t.key!==void 0&&(s=""+t.key),t)ey.call(t,r)&&!ty.hasOwnProperty(r)&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var u=Array(o),c=0;c<o;c++)u[c]=arguments[c+2];i.children=u}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return{$$typeof:Aa,type:e,key:s,ref:l,props:i,_owner:Jh.current}}function ek(e,t){return{$$typeof:Aa,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Zh(e){return typeof e=="object"&&e!==null&&e.$$typeof===Aa}function tk(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Hp=/\/+/g;function pc(e,t){return typeof e=="object"&&e!==null&&e.key!=null?tk(""+e.key):t.toString(36)}function Co(e,t,n,r,i){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var l=!1;if(e===null)l=!0;else switch(s){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case Aa:case Uw:l=!0}}if(l)return l=e,i=i(l),e=r===""?"."+pc(l,0):r,Up(i)?(n="",e!=null&&(n=e.replace(Hp,"$&/")+"/"),Co(i,t,n,"",function(c){return c})):i!=null&&(Zh(i)&&(i=ek(i,n+(!i.key||l&&l.key===i.key?"":(""+i.key).replace(Hp,"$&/")+"/")+e)),t.push(i)),1;if(l=0,r=r===""?".":r+":",Up(e))for(var o=0;o<e.length;o++){s=e[o];var u=r+pc(s,o);l+=Co(s,t,n,u,i)}else if(u=Zw(e),typeof u=="function")for(e=u.call(e),o=0;!(s=e.next()).done;)s=s.value,u=r+pc(s,o++),l+=Co(s,t,n,u,i);else if(s==="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 l}function to(e,t,n){if(e==null)return e;var r=[],i=0;return Co(e,r,"","",function(s){return t.call(n,s,i++)}),r}function nk(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 Ht={current:null},Eo={transition:null},rk={ReactCurrentDispatcher:Ht,ReactCurrentBatchConfig:Eo,ReactCurrentOwner:Jh};function ry(){throw Error("act(...) is not supported in production builds of React.")}Ee.Children={map:to,forEach:function(e,t,n){to(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return to(e,function(){t++}),t},toArray:function(e){return to(e,function(t){return t})||[]},only:function(e){if(!Zh(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Ee.Component=gl;Ee.Fragment=Hw;Ee.Profiler=Vw;Ee.PureComponent=Yh;Ee.StrictMode=Ww;Ee.Suspense=Yw;Ee.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=rk;Ee.act=ry;Ee.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=Xx({},e.props),i=e.key,s=e.ref,l=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,l=Jh.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var o=e.type.defaultProps;for(u in t)ey.call(t,u)&&!ty.hasOwnProperty(u)&&(r[u]=t[u]===void 0&&o!==void 0?o[u]:t[u])}var u=arguments.length-2;if(u===1)r.children=n;else if(1<u){o=Array(u);for(var c=0;c<u;c++)o[c]=arguments[c+2];r.children=o}return{$$typeof:Aa,type:e.type,key:i,ref:s,props:r,_owner:l}};Ee.createContext=function(e){return e={$$typeof:Kw,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Qw,_context:e},e.Consumer=e};Ee.createElement=ny;Ee.createFactory=function(e){var t=ny.bind(null,e);return t.type=e,t};Ee.createRef=function(){return{current:null}};Ee.forwardRef=function(e){return{$$typeof:Gw,render:e}};Ee.isValidElement=Zh;Ee.lazy=function(e){return{$$typeof:Jw,_payload:{_status:-1,_result:e},_init:nk}};Ee.memo=function(e,t){return{$$typeof:Xw,type:e,compare:t===void 0?null:t}};Ee.startTransition=function(e){var t=Eo.transition;Eo.transition={};try{e()}finally{Eo.transition=t}};Ee.unstable_act=ry;Ee.useCallback=function(e,t){return Ht.current.useCallback(e,t)};Ee.useContext=function(e){return Ht.current.useContext(e)};Ee.useDebugValue=function(){};Ee.useDeferredValue=function(e){return Ht.current.useDeferredValue(e)};Ee.useEffect=function(e,t){return Ht.current.useEffect(e,t)};Ee.useId=function(){return Ht.current.useId()};Ee.useImperativeHandle=function(e,t,n){return Ht.current.useImperativeHandle(e,t,n)};Ee.useInsertionEffect=function(e,t){return Ht.current.useInsertionEffect(e,t)};Ee.useLayoutEffect=function(e,t){return Ht.current.useLayoutEffect(e,t)};Ee.useMemo=function(e,t){return Ht.current.useMemo(e,t)};Ee.useReducer=function(e,t,n){return Ht.current.useReducer(e,t,n)};Ee.useRef=function(e){return Ht.current.useRef(e)};Ee.useState=function(e){return Ht.current.useState(e)};Ee.useSyncExternalStore=function(e,t,n){return Ht.current.useSyncExternalStore(e,t,n)};Ee.useTransition=function(){return Ht.current.useTransition()};Ee.version="18.3.1";Gx.exports=Ee;var b=Gx.exports;const ik=Gh(b),sk=Qx({__proto__:null,default:ik},[b]);/**
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 lk=b,ak=Symbol.for("react.element"),ok=Symbol.for("react.fragment"),uk=Object.prototype.hasOwnProperty,ck=lk.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,dk={key:!0,ref:!0,__self:!0,__source:!0};function iy(e,t,n){var r,i={},s=null,l=null;n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(l=t.ref);for(r in t)uk.call(t,r)&&!dk.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:ak,type:e,key:s,ref:l,props:i,_owner:ck.current}}Pu.Fragment=ok;Pu.jsx=iy;Pu.jsxs=iy;Kx.exports=Pu;var a=Kx.exports;const sy=()=>window.matchMedia("(prefers-color-scheme: dark)");function Wp(e){const t=e==="dark"||e==="system"&&sy().matches;document.documentElement.classList.toggle("dark",t),window.dispatchEvent(new CustomEvent("gl-theme",{detail:t}))}function ly(){const[e,t]=b.useState(()=>{try{return localStorage.getItem("cognitune.theme")||"system"}catch{return"system"}});return b.useEffect(()=>{try{localStorage.setItem("cognitune.theme",e)}catch{}if(Wp(e),e!=="system")return;const n=sy(),r=()=>Wp("system");return n.addEventListener("change",r),()=>n.removeEventListener("change",r)},[e]),{pref:e,setPref:t}}function hk(){const[e,t]=b.useState(()=>document.documentElement.classList.contains("dark"));return b.useEffect(()=>{const n=r=>t(r.detail);return window.addEventListener("gl-theme",n),()=>window.removeEventListener("gl-theme",n)},[]),e}function ay(){try{return localStorage.getItem("cognitune.readingFont2")==="sans"?"sans":"serif"}catch{return"serif"}}function oy(e=ay()){document.documentElement.dataset.read=e}function fk(){const[e,t]=b.useState(ay);return b.useEffect(()=>{try{localStorage.setItem("cognitune.readingFont2",e)}catch{}oy(e)},[e]),{font:e,setFont:t}}var uy={exports:{}},xn={},cy={exports:{}},dy={};/**
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(z,W){var S=z.length;z.push(W);e:for(;0<S;){var D=S-1>>>1,te=z[D];if(0<i(te,W))z[D]=W,z[S]=te,S=D;else break e}}function n(z){return z.length===0?null:z[0]}function r(z){if(z.length===0)return null;var W=z[0],S=z.pop();if(S!==W){z[0]=S;e:for(var D=0,te=z.length,P=te>>>1;D<P;){var ve=2*(D+1)-1,Le=z[ve],we=ve+1,Se=z[we];if(0>i(Le,S))we<te&&0>i(Se,Le)?(z[D]=Se,z[we]=S,D=we):(z[D]=Le,z[ve]=S,D=ve);else if(we<te&&0>i(Se,S))z[D]=Se,z[we]=S,D=we;else break e}}return W}function i(z,W){var S=z.sortIndex-W.sortIndex;return S!==0?S:z.id-W.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var l=Date,o=l.now();e.unstable_now=function(){return l.now()-o}}var u=[],c=[],d=1,h=null,p=3,f=!1,m=!1,g=!1,k=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,x=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(z){for(var W=n(c);W!==null;){if(W.callback===null)r(c);else if(W.startTime<=z)r(c),W.sortIndex=W.expirationTime,t(u,W);else break;W=n(c)}}function j(z){if(g=!1,v(z),!m)if(n(u)!==null)m=!0,G(E);else{var W=n(c);W!==null&&X(j,W.startTime-z)}}function E(z,W){m=!1,g&&(g=!1,y(M),M=-1),f=!0;var S=p;try{for(v(W),h=n(u);h!==null&&(!(h.expirationTime>W)||z&&!O());){var D=h.callback;if(typeof D=="function"){h.callback=null,p=h.priorityLevel;var te=D(h.expirationTime<=W);W=e.unstable_now(),typeof te=="function"?h.callback=te:h===n(u)&&r(u),v(W)}else r(u);h=n(u)}if(h!==null)var P=!0;else{var ve=n(c);ve!==null&&X(j,ve.startTime-W),P=!1}return P}finally{h=null,p=S,f=!1}}var w=!1,N=null,M=-1,F=5,C=-1;function O(){return!(e.unstable_now()-C<F)}function A(){if(N!==null){var z=e.unstable_now();C=z;var W=!0;try{W=N(!0,z)}finally{W?V():(w=!1,N=null)}}else w=!1}var V;if(typeof x=="function")V=function(){x(A)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,q=U.port2;U.port1.onmessage=A,V=function(){q.postMessage(null)}}else V=function(){k(A,0)};function G(z){N=z,w||(w=!0,V())}function X(z,W){M=k(function(){z(e.unstable_now())},W)}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(z){z.callback=null},e.unstable_continueExecution=function(){m||f||(m=!0,G(E))},e.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<z?Math.floor(1e3/z):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(z){switch(p){case 1:case 2:case 3:var W=3;break;default:W=p}var S=p;p=W;try{return z()}finally{p=S}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(z,W){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var S=p;p=z;try{return W()}finally{p=S}},e.unstable_scheduleCallback=function(z,W,S){var D=e.unstable_now();switch(typeof S=="object"&&S!==null?(S=S.delay,S=typeof S=="number"&&0<S?D+S:D):S=D,z){case 1:var te=-1;break;case 2:te=250;break;case 5:te=1073741823;break;case 4:te=1e4;break;default:te=5e3}return te=S+te,z={id:d++,callback:W,priorityLevel:z,startTime:S,expirationTime:te,sortIndex:-1},S>D?(z.sortIndex=S,t(c,z),n(u)===null&&z===n(c)&&(g?(y(M),M=-1):g=!0,X(j,S-D))):(z.sortIndex=te,t(u,z),m||f||(m=!0,G(E))),z},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(z){var W=p;return function(){var S=p;p=W;try{return z.apply(this,arguments)}finally{p=S}}}})(dy);cy.exports=dy;var pk=cy.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 mk=b,gn=pk;function Q(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 hy=new Set,aa={};function hs(e,t){ll(e,t),ll(e+"Capture",t)}function ll(e,t){for(aa[e]=t,e=0;e<t.length;e++)hy.add(t[e])}var Rr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),dd=Object.prototype.hasOwnProperty,gk=/^[: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]*$/,Vp={},Qp={};function xk(e){return dd.call(Qp,e)?!0:dd.call(Vp,e)?!1:gk.test(e)?Qp[e]=!0:(Vp[e]=!0,!1)}function yk(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 vk(e,t,n,r){if(t===null||typeof t>"u"||yk(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 Wt(e,t,n,r,i,s,l){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=s,this.removeEmptyString=l}var Pt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Pt[e]=new Wt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Pt[t]=new Wt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Pt[e]=new Wt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Pt[e]=new Wt(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){Pt[e]=new Wt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Pt[e]=new Wt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Pt[e]=new Wt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Pt[e]=new Wt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Pt[e]=new Wt(e,5,!1,e.toLowerCase(),null,!1,!1)});var ef=/[\-:]([a-z])/g;function tf(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(ef,tf);Pt[t]=new Wt(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(ef,tf);Pt[t]=new Wt(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(ef,tf);Pt[t]=new Wt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Pt[e]=new Wt(e,1,!1,e.toLowerCase(),null,!1,!1)});Pt.xlinkHref=new Wt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Pt[e]=new Wt(e,1,!1,e.toLowerCase(),null,!0,!0)});function nf(e,t,n,r){var i=Pt.hasOwnProperty(t)?Pt[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(vk(t,n,i,r)&&(n=null),r||i===null?xk(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 Or=mk.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,no=Symbol.for("react.element"),Ss=Symbol.for("react.portal"),Cs=Symbol.for("react.fragment"),rf=Symbol.for("react.strict_mode"),hd=Symbol.for("react.profiler"),fy=Symbol.for("react.provider"),py=Symbol.for("react.context"),sf=Symbol.for("react.forward_ref"),fd=Symbol.for("react.suspense"),pd=Symbol.for("react.suspense_list"),lf=Symbol.for("react.memo"),Vr=Symbol.for("react.lazy"),my=Symbol.for("react.offscreen"),Kp=Symbol.iterator;function El(e){return e===null||typeof e!="object"?null:(e=Kp&&e[Kp]||e["@@iterator"],typeof e=="function"?e:null)}var Xe=Object.assign,mc;function ql(e){if(mc===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);mc=t&&t[1]||""}return`
34
+ `+mc+e}var gc=!1;function xc(e,t){if(!e||gc)return"";gc=!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(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var i=c.stack.split(`
35
+ `),s=r.stack.split(`
36
+ `),l=i.length-1,o=s.length-1;1<=l&&0<=o&&i[l]!==s[o];)o--;for(;1<=l&&0<=o;l--,o--)if(i[l]!==s[o]){if(l!==1||o!==1)do if(l--,o--,0>o||i[l]!==s[o]){var u=`
37
+ `+i[l].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=l&&0<=o);break}}}finally{gc=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?ql(e):""}function wk(e){switch(e.tag){case 5:return ql(e.type);case 16:return ql("Lazy");case 13:return ql("Suspense");case 19:return ql("SuspenseList");case 0:case 2:case 15:return e=xc(e.type,!1),e;case 11:return e=xc(e.type.render,!1),e;case 1:return e=xc(e.type,!0),e;default:return""}}function md(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 Cs:return"Fragment";case Ss:return"Portal";case hd:return"Profiler";case rf:return"StrictMode";case fd:return"Suspense";case pd:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case py:return(e.displayName||"Context")+".Consumer";case fy:return(e._context.displayName||"Context")+".Provider";case sf:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case lf:return t=e.displayName||null,t!==null?t:md(e.type)||"Memo";case Vr:t=e._payload,e=e._init;try{return md(e(t))}catch{}}return null}function kk(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 md(t);case 8:return t===rf?"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 xi(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function gy(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function bk(e){var t=gy(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,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(l){r=""+l,s.call(this,l)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ro(e){e._valueTracker||(e._valueTracker=bk(e))}function xy(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=gy(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Uo(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 gd(e,t){var n=t.checked;return Xe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Gp(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=xi(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 yy(e,t){t=t.checked,t!=null&&nf(e,"checked",t,!1)}function xd(e,t){yy(e,t);var n=xi(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")?yd(e,t.type,n):t.hasOwnProperty("defaultValue")&&yd(e,t.type,xi(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Yp(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 yd(e,t,n){(t!=="number"||Uo(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Bl=Array.isArray;function Ds(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=""+xi(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 vd(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(Q(91));return Xe({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Xp(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(Q(92));if(Bl(n)){if(1<n.length)throw Error(Q(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:xi(n)}}function vy(e,t){var n=xi(t.value),r=xi(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 Jp(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function wy(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 wd(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?wy(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var io,ky=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(io=io||document.createElement("div"),io.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=io.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function oa(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ql={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},jk=["Webkit","ms","Moz","O"];Object.keys(Ql).forEach(function(e){jk.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ql[t]=Ql[e]})});function by(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ql.hasOwnProperty(e)&&Ql[e]?(""+t).trim():t+"px"}function jy(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=by(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var Nk=Xe({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 kd(e,t){if(t){if(Nk[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Q(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Q(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Q(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Q(62))}}function bd(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 jd=null;function af(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Nd=null,Os=null,_s=null;function Zp(e){if(e=Da(e)){if(typeof Nd!="function")throw Error(Q(280));var t=e.stateNode;t&&(t=zu(t),Nd(e.stateNode,e.type,t))}}function Ny(e){Os?_s?_s.push(e):_s=[e]:Os=e}function Sy(){if(Os){var e=Os,t=_s;if(_s=Os=null,Zp(e),t)for(e=0;e<t.length;e++)Zp(t[e])}}function Cy(e,t){return e(t)}function Ey(){}var yc=!1;function Py(e,t,n){if(yc)return e(t,n);yc=!0;try{return Cy(e,t,n)}finally{yc=!1,(Os!==null||_s!==null)&&(Ey(),Sy())}}function ua(e,t){var n=e.stateNode;if(n===null)return null;var r=zu(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(Q(231,t,typeof n));return n}var Sd=!1;if(Rr)try{var Pl={};Object.defineProperty(Pl,"passive",{get:function(){Sd=!0}}),window.addEventListener("test",Pl,Pl),window.removeEventListener("test",Pl,Pl)}catch{Sd=!1}function Sk(e,t,n,r,i,s,l,o,u){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(d){this.onError(d)}}var Kl=!1,Ho=null,Wo=!1,Cd=null,Ck={onError:function(e){Kl=!0,Ho=e}};function Ek(e,t,n,r,i,s,l,o,u){Kl=!1,Ho=null,Sk.apply(Ck,arguments)}function Pk(e,t,n,r,i,s,l,o,u){if(Ek.apply(this,arguments),Kl){if(Kl){var c=Ho;Kl=!1,Ho=null}else throw Error(Q(198));Wo||(Wo=!0,Cd=c)}}function fs(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 Ty(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 em(e){if(fs(e)!==e)throw Error(Q(188))}function Tk(e){var t=e.alternate;if(!t){if(t=fs(e),t===null)throw Error(Q(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return em(i),e;if(s===r)return em(i),t;s=s.sibling}throw Error(Q(188))}if(n.return!==r.return)n=i,r=s;else{for(var l=!1,o=i.child;o;){if(o===n){l=!0,n=i,r=s;break}if(o===r){l=!0,r=i,n=s;break}o=o.sibling}if(!l){for(o=s.child;o;){if(o===n){l=!0,n=s,r=i;break}if(o===r){l=!0,r=s,n=i;break}o=o.sibling}if(!l)throw Error(Q(189))}}if(n.alternate!==r)throw Error(Q(190))}if(n.tag!==3)throw Error(Q(188));return n.stateNode.current===n?e:t}function Ly(e){return e=Tk(e),e!==null?My(e):null}function My(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=My(e);if(t!==null)return t;e=e.sibling}return null}var Ry=gn.unstable_scheduleCallback,tm=gn.unstable_cancelCallback,Lk=gn.unstable_shouldYield,Mk=gn.unstable_requestPaint,st=gn.unstable_now,Rk=gn.unstable_getCurrentPriorityLevel,of=gn.unstable_ImmediatePriority,zy=gn.unstable_UserBlockingPriority,Vo=gn.unstable_NormalPriority,zk=gn.unstable_LowPriority,Ay=gn.unstable_IdlePriority,Tu=null,dr=null;function Ak(e){if(dr&&typeof dr.onCommitFiberRoot=="function")try{dr.onCommitFiberRoot(Tu,e,void 0,(e.current.flags&128)===128)}catch{}}var Un=Math.clz32?Math.clz32:Dk,Ik=Math.log,Fk=Math.LN2;function Dk(e){return e>>>=0,e===0?32:31-(Ik(e)/Fk|0)|0}var so=64,lo=4194304;function Ul(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 Qo(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,s=e.pingedLanes,l=n&268435455;if(l!==0){var o=l&~i;o!==0?r=Ul(o):(s&=l,s!==0&&(r=Ul(s)))}else l=n&~i,l!==0?r=Ul(l):s!==0&&(r=Ul(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,s=t&-t,i>=s||i===16&&(s&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-Un(t),i=1<<n,r|=e[n],t&=~i;return r}function Ok(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 _k(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes;0<s;){var l=31-Un(s),o=1<<l,u=i[l];u===-1?(!(o&n)||o&r)&&(i[l]=Ok(o,t)):u<=t&&(e.expiredLanes|=o),s&=~o}}function Ed(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Iy(){var e=so;return so<<=1,!(so&4194240)&&(so=64),e}function vc(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ia(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Un(t),e[t]=n}function $k(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-Un(n),s=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~s}}function uf(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Un(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var De=0;function Fy(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Dy,cf,Oy,_y,$y,Pd=!1,ao=[],ui=null,ci=null,di=null,ca=new Map,da=new Map,Kr=[],qk="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 nm(e,t){switch(e){case"focusin":case"focusout":ui=null;break;case"dragenter":case"dragleave":ci=null;break;case"mouseover":case"mouseout":di=null;break;case"pointerover":case"pointerout":ca.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":da.delete(t.pointerId)}}function Tl(e,t,n,r,i,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},t!==null&&(t=Da(t),t!==null&&cf(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Bk(e,t,n,r,i){switch(t){case"focusin":return ui=Tl(ui,e,t,n,r,i),!0;case"dragenter":return ci=Tl(ci,e,t,n,r,i),!0;case"mouseover":return di=Tl(di,e,t,n,r,i),!0;case"pointerover":var s=i.pointerId;return ca.set(s,Tl(ca.get(s)||null,e,t,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,da.set(s,Tl(da.get(s)||null,e,t,n,r,i)),!0}return!1}function qy(e){var t=Di(e.target);if(t!==null){var n=fs(t);if(n!==null){if(t=n.tag,t===13){if(t=Ty(n),t!==null){e.blockedOn=t,$y(e.priority,function(){Oy(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 Po(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Td(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);jd=r,n.target.dispatchEvent(r),jd=null}else return t=Da(n),t!==null&&cf(t),e.blockedOn=n,!1;t.shift()}return!0}function rm(e,t,n){Po(e)&&n.delete(t)}function Uk(){Pd=!1,ui!==null&&Po(ui)&&(ui=null),ci!==null&&Po(ci)&&(ci=null),di!==null&&Po(di)&&(di=null),ca.forEach(rm),da.forEach(rm)}function Ll(e,t){e.blockedOn===t&&(e.blockedOn=null,Pd||(Pd=!0,gn.unstable_scheduleCallback(gn.unstable_NormalPriority,Uk)))}function ha(e){function t(i){return Ll(i,e)}if(0<ao.length){Ll(ao[0],e);for(var n=1;n<ao.length;n++){var r=ao[n];r.blockedOn===e&&(r.blockedOn=null)}}for(ui!==null&&Ll(ui,e),ci!==null&&Ll(ci,e),di!==null&&Ll(di,e),ca.forEach(t),da.forEach(t),n=0;n<Kr.length;n++)r=Kr[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Kr.length&&(n=Kr[0],n.blockedOn===null);)qy(n),n.blockedOn===null&&Kr.shift()}var $s=Or.ReactCurrentBatchConfig,Ko=!0;function Hk(e,t,n,r){var i=De,s=$s.transition;$s.transition=null;try{De=1,df(e,t,n,r)}finally{De=i,$s.transition=s}}function Wk(e,t,n,r){var i=De,s=$s.transition;$s.transition=null;try{De=4,df(e,t,n,r)}finally{De=i,$s.transition=s}}function df(e,t,n,r){if(Ko){var i=Td(e,t,n,r);if(i===null)Tc(e,t,r,Go,n),nm(e,r);else if(Bk(i,e,t,n,r))r.stopPropagation();else if(nm(e,r),t&4&&-1<qk.indexOf(e)){for(;i!==null;){var s=Da(i);if(s!==null&&Dy(s),s=Td(e,t,n,r),s===null&&Tc(e,t,r,Go,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else Tc(e,t,r,null,n)}}var Go=null;function Td(e,t,n,r){if(Go=null,e=af(r),e=Di(e),e!==null)if(t=fs(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Ty(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 Go=e,null}function By(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(Rk()){case of:return 1;case zy:return 4;case Vo:case zk:return 16;case Ay:return 536870912;default:return 16}default:return 16}}var li=null,hf=null,To=null;function Uy(){if(To)return To;var e,t=hf,n=t.length,r,i="value"in li?li.value:li.textContent,s=i.length;for(e=0;e<n&&t[e]===i[e];e++);var l=n-e;for(r=1;r<=l&&t[n-r]===i[s-r];r++);return To=i.slice(e,1<r?1-r:void 0)}function Lo(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 oo(){return!0}function im(){return!1}function yn(e){function t(n,r,i,s,l){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=l,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(n=e[o],this[o]=n?n(s):s[o]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?oo:im,this.isPropagationStopped=im,this}return Xe(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=oo)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=oo)},persist:function(){},isPersistent:oo}),t}var xl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ff=yn(xl),Fa=Xe({},xl,{view:0,detail:0}),Vk=yn(Fa),wc,kc,Ml,Lu=Xe({},Fa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:pf,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!==Ml&&(Ml&&e.type==="mousemove"?(wc=e.screenX-Ml.screenX,kc=e.screenY-Ml.screenY):kc=wc=0,Ml=e),wc)},movementY:function(e){return"movementY"in e?e.movementY:kc}}),sm=yn(Lu),Qk=Xe({},Lu,{dataTransfer:0}),Kk=yn(Qk),Gk=Xe({},Fa,{relatedTarget:0}),bc=yn(Gk),Yk=Xe({},xl,{animationName:0,elapsedTime:0,pseudoElement:0}),Xk=yn(Yk),Jk=Xe({},xl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Zk=yn(Jk),eb=Xe({},xl,{data:0}),lm=yn(eb),tb={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},nb={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"},rb={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ib(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=rb[e])?!!t[e]:!1}function pf(){return ib}var sb=Xe({},Fa,{key:function(e){if(e.key){var t=tb[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Lo(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?nb[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:pf,charCode:function(e){return e.type==="keypress"?Lo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Lo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),lb=yn(sb),ab=Xe({},Lu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),am=yn(ab),ob=Xe({},Fa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:pf}),ub=yn(ob),cb=Xe({},xl,{propertyName:0,elapsedTime:0,pseudoElement:0}),db=yn(cb),hb=Xe({},Lu,{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}),fb=yn(hb),pb=[9,13,27,32],mf=Rr&&"CompositionEvent"in window,Gl=null;Rr&&"documentMode"in document&&(Gl=document.documentMode);var mb=Rr&&"TextEvent"in window&&!Gl,Hy=Rr&&(!mf||Gl&&8<Gl&&11>=Gl),om=" ",um=!1;function Wy(e,t){switch(e){case"keyup":return pb.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Vy(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Es=!1;function gb(e,t){switch(e){case"compositionend":return Vy(t);case"keypress":return t.which!==32?null:(um=!0,om);case"textInput":return e=t.data,e===om&&um?null:e;default:return null}}function xb(e,t){if(Es)return e==="compositionend"||!mf&&Wy(e,t)?(e=Uy(),To=hf=li=null,Es=!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 Hy&&t.locale!=="ko"?null:t.data;default:return null}}var yb={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 cm(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!yb[e.type]:t==="textarea"}function Qy(e,t,n,r){Ny(r),t=Yo(t,"onChange"),0<t.length&&(n=new ff("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Yl=null,fa=null;function vb(e){iv(e,0)}function Mu(e){var t=Ls(e);if(xy(t))return e}function wb(e,t){if(e==="change")return t}var Ky=!1;if(Rr){var jc;if(Rr){var Nc="oninput"in document;if(!Nc){var dm=document.createElement("div");dm.setAttribute("oninput","return;"),Nc=typeof dm.oninput=="function"}jc=Nc}else jc=!1;Ky=jc&&(!document.documentMode||9<document.documentMode)}function hm(){Yl&&(Yl.detachEvent("onpropertychange",Gy),fa=Yl=null)}function Gy(e){if(e.propertyName==="value"&&Mu(fa)){var t=[];Qy(t,fa,e,af(e)),Py(vb,t)}}function kb(e,t,n){e==="focusin"?(hm(),Yl=t,fa=n,Yl.attachEvent("onpropertychange",Gy)):e==="focusout"&&hm()}function bb(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Mu(fa)}function jb(e,t){if(e==="click")return Mu(t)}function Nb(e,t){if(e==="input"||e==="change")return Mu(t)}function Sb(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Qn=typeof Object.is=="function"?Object.is:Sb;function pa(e,t){if(Qn(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(!dd.call(t,i)||!Qn(e[i],t[i]))return!1}return!0}function fm(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function pm(e,t){var n=fm(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=fm(n)}}function Yy(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Yy(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Xy(){for(var e=window,t=Uo();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Uo(e.document)}return t}function gf(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 Cb(e){var t=Xy(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Yy(n.ownerDocument.documentElement,n)){if(r!==null&&gf(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,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!e.extend&&s>r&&(i=r,r=s,s=i),i=pm(n,s);var l=pm(n,r);i&&l&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.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 Eb=Rr&&"documentMode"in document&&11>=document.documentMode,Ps=null,Ld=null,Xl=null,Md=!1;function mm(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Md||Ps==null||Ps!==Uo(r)||(r=Ps,"selectionStart"in r&&gf(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}),Xl&&pa(Xl,r)||(Xl=r,r=Yo(Ld,"onSelect"),0<r.length&&(t=new ff("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Ps)))}function uo(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ts={animationend:uo("Animation","AnimationEnd"),animationiteration:uo("Animation","AnimationIteration"),animationstart:uo("Animation","AnimationStart"),transitionend:uo("Transition","TransitionEnd")},Sc={},Jy={};Rr&&(Jy=document.createElement("div").style,"AnimationEvent"in window||(delete Ts.animationend.animation,delete Ts.animationiteration.animation,delete Ts.animationstart.animation),"TransitionEvent"in window||delete Ts.transitionend.transition);function Ru(e){if(Sc[e])return Sc[e];if(!Ts[e])return e;var t=Ts[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Jy)return Sc[e]=t[n];return e}var Zy=Ru("animationend"),ev=Ru("animationiteration"),tv=Ru("animationstart"),nv=Ru("transitionend"),rv=new Map,gm="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 ki(e,t){rv.set(e,t),hs(t,[e])}for(var Cc=0;Cc<gm.length;Cc++){var Ec=gm[Cc],Pb=Ec.toLowerCase(),Tb=Ec[0].toUpperCase()+Ec.slice(1);ki(Pb,"on"+Tb)}ki(Zy,"onAnimationEnd");ki(ev,"onAnimationIteration");ki(tv,"onAnimationStart");ki("dblclick","onDoubleClick");ki("focusin","onFocus");ki("focusout","onBlur");ki(nv,"onTransitionEnd");ll("onMouseEnter",["mouseout","mouseover"]);ll("onMouseLeave",["mouseout","mouseover"]);ll("onPointerEnter",["pointerout","pointerover"]);ll("onPointerLeave",["pointerout","pointerover"]);hs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));hs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));hs("onBeforeInput",["compositionend","keypress","textInput","paste"]);hs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));hs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));hs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Hl="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(" "),Lb=new Set("cancel close invalid load scroll toggle".split(" ").concat(Hl));function xm(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,Pk(r,t,void 0,e),e.currentTarget=null}function iv(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 s=void 0;if(t)for(var l=r.length-1;0<=l;l--){var o=r[l],u=o.instance,c=o.currentTarget;if(o=o.listener,u!==s&&i.isPropagationStopped())break e;xm(i,o,c),s=u}else for(l=0;l<r.length;l++){if(o=r[l],u=o.instance,c=o.currentTarget,o=o.listener,u!==s&&i.isPropagationStopped())break e;xm(i,o,c),s=u}}}if(Wo)throw e=Cd,Wo=!1,Cd=null,e}function He(e,t){var n=t[Fd];n===void 0&&(n=t[Fd]=new Set);var r=e+"__bubble";n.has(r)||(sv(t,e,2,!1),n.add(r))}function Pc(e,t,n){var r=0;t&&(r|=4),sv(n,e,r,t)}var co="_reactListening"+Math.random().toString(36).slice(2);function ma(e){if(!e[co]){e[co]=!0,hy.forEach(function(n){n!=="selectionchange"&&(Lb.has(n)||Pc(n,!1,e),Pc(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[co]||(t[co]=!0,Pc("selectionchange",!1,t))}}function sv(e,t,n,r){switch(By(t)){case 1:var i=Hk;break;case 4:i=Wk;break;default:i=df}n=i.bind(null,t,n,e),i=void 0,!Sd||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 Tc(e,t,n,r,i){var s=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var l=r.tag;if(l===3||l===4){var o=r.stateNode.containerInfo;if(o===i||o.nodeType===8&&o.parentNode===i)break;if(l===4)for(l=r.return;l!==null;){var u=l.tag;if((u===3||u===4)&&(u=l.stateNode.containerInfo,u===i||u.nodeType===8&&u.parentNode===i))return;l=l.return}for(;o!==null;){if(l=Di(o),l===null)return;if(u=l.tag,u===5||u===6){r=s=l;continue e}o=o.parentNode}}r=r.return}Py(function(){var c=s,d=af(n),h=[];e:{var p=rv.get(e);if(p!==void 0){var f=ff,m=e;switch(e){case"keypress":if(Lo(n)===0)break e;case"keydown":case"keyup":f=lb;break;case"focusin":m="focus",f=bc;break;case"focusout":m="blur",f=bc;break;case"beforeblur":case"afterblur":f=bc;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":f=sm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":f=Kk;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":f=ub;break;case Zy:case ev:case tv:f=Xk;break;case nv:f=db;break;case"scroll":f=Vk;break;case"wheel":f=fb;break;case"copy":case"cut":case"paste":f=Zk;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":f=am}var g=(t&4)!==0,k=!g&&e==="scroll",y=g?p!==null?p+"Capture":null:p;g=[];for(var x=c,v;x!==null;){v=x;var j=v.stateNode;if(v.tag===5&&j!==null&&(v=j,y!==null&&(j=ua(x,y),j!=null&&g.push(ga(x,j,v)))),k)break;x=x.return}0<g.length&&(p=new f(p,m,null,n,d),h.push({event:p,listeners:g}))}}if(!(t&7)){e:{if(p=e==="mouseover"||e==="pointerover",f=e==="mouseout"||e==="pointerout",p&&n!==jd&&(m=n.relatedTarget||n.fromElement)&&(Di(m)||m[zr]))break e;if((f||p)&&(p=d.window===d?d:(p=d.ownerDocument)?p.defaultView||p.parentWindow:window,f?(m=n.relatedTarget||n.toElement,f=c,m=m?Di(m):null,m!==null&&(k=fs(m),m!==k||m.tag!==5&&m.tag!==6)&&(m=null)):(f=null,m=c),f!==m)){if(g=sm,j="onMouseLeave",y="onMouseEnter",x="mouse",(e==="pointerout"||e==="pointerover")&&(g=am,j="onPointerLeave",y="onPointerEnter",x="pointer"),k=f==null?p:Ls(f),v=m==null?p:Ls(m),p=new g(j,x+"leave",f,n,d),p.target=k,p.relatedTarget=v,j=null,Di(d)===c&&(g=new g(y,x+"enter",m,n,d),g.target=v,g.relatedTarget=k,j=g),k=j,f&&m)t:{for(g=f,y=m,x=0,v=g;v;v=ks(v))x++;for(v=0,j=y;j;j=ks(j))v++;for(;0<x-v;)g=ks(g),x--;for(;0<v-x;)y=ks(y),v--;for(;x--;){if(g===y||y!==null&&g===y.alternate)break t;g=ks(g),y=ks(y)}g=null}else g=null;f!==null&&ym(h,p,f,g,!1),m!==null&&k!==null&&ym(h,k,m,g,!0)}}e:{if(p=c?Ls(c):window,f=p.nodeName&&p.nodeName.toLowerCase(),f==="select"||f==="input"&&p.type==="file")var E=wb;else if(cm(p))if(Ky)E=Nb;else{E=bb;var w=kb}else(f=p.nodeName)&&f.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(E=jb);if(E&&(E=E(e,c))){Qy(h,E,n,d);break e}w&&w(e,p,c),e==="focusout"&&(w=p._wrapperState)&&w.controlled&&p.type==="number"&&yd(p,"number",p.value)}switch(w=c?Ls(c):window,e){case"focusin":(cm(w)||w.contentEditable==="true")&&(Ps=w,Ld=c,Xl=null);break;case"focusout":Xl=Ld=Ps=null;break;case"mousedown":Md=!0;break;case"contextmenu":case"mouseup":case"dragend":Md=!1,mm(h,n,d);break;case"selectionchange":if(Eb)break;case"keydown":case"keyup":mm(h,n,d)}var N;if(mf)e:{switch(e){case"compositionstart":var M="onCompositionStart";break e;case"compositionend":M="onCompositionEnd";break e;case"compositionupdate":M="onCompositionUpdate";break e}M=void 0}else Es?Wy(e,n)&&(M="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(M="onCompositionStart");M&&(Hy&&n.locale!=="ko"&&(Es||M!=="onCompositionStart"?M==="onCompositionEnd"&&Es&&(N=Uy()):(li=d,hf="value"in li?li.value:li.textContent,Es=!0)),w=Yo(c,M),0<w.length&&(M=new lm(M,e,null,n,d),h.push({event:M,listeners:w}),N?M.data=N:(N=Vy(n),N!==null&&(M.data=N)))),(N=mb?gb(e,n):xb(e,n))&&(c=Yo(c,"onBeforeInput"),0<c.length&&(d=new lm("onBeforeInput","beforeinput",null,n,d),h.push({event:d,listeners:c}),d.data=N))}iv(h,t)})}function ga(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Yo(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=ua(e,n),s!=null&&r.unshift(ga(e,s,i)),s=ua(e,t),s!=null&&r.push(ga(e,s,i))),e=e.return}return r}function ks(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function ym(e,t,n,r,i){for(var s=t._reactName,l=[];n!==null&&n!==r;){var o=n,u=o.alternate,c=o.stateNode;if(u!==null&&u===r)break;o.tag===5&&c!==null&&(o=c,i?(u=ua(n,s),u!=null&&l.unshift(ga(n,u,o))):i||(u=ua(n,s),u!=null&&l.push(ga(n,u,o)))),n=n.return}l.length!==0&&e.push({event:t,listeners:l})}var Mb=/\r\n?/g,Rb=/\u0000|\uFFFD/g;function vm(e){return(typeof e=="string"?e:""+e).replace(Mb,`
38
+ `).replace(Rb,"")}function ho(e,t,n){if(t=vm(t),vm(e)!==t&&n)throw Error(Q(425))}function Xo(){}var Rd=null,zd=null;function Ad(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 Id=typeof setTimeout=="function"?setTimeout:void 0,zb=typeof clearTimeout=="function"?clearTimeout:void 0,wm=typeof Promise=="function"?Promise:void 0,Ab=typeof queueMicrotask=="function"?queueMicrotask:typeof wm<"u"?function(e){return wm.resolve(null).then(e).catch(Ib)}:Id;function Ib(e){setTimeout(function(){throw e})}function Lc(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),ha(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);ha(t)}function hi(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 km(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 yl=Math.random().toString(36).slice(2),ur="__reactFiber$"+yl,xa="__reactProps$"+yl,zr="__reactContainer$"+yl,Fd="__reactEvents$"+yl,Fb="__reactListeners$"+yl,Db="__reactHandles$"+yl;function Di(e){var t=e[ur];if(t)return t;for(var n=e.parentNode;n;){if(t=n[zr]||n[ur]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=km(e);e!==null;){if(n=e[ur])return n;e=km(e)}return t}e=n,n=e.parentNode}return null}function Da(e){return e=e[ur]||e[zr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ls(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(Q(33))}function zu(e){return e[xa]||null}var Dd=[],Ms=-1;function bi(e){return{current:e}}function We(e){0>Ms||(e.current=Dd[Ms],Dd[Ms]=null,Ms--)}function Ue(e,t){Ms++,Dd[Ms]=e.current,e.current=t}var yi={},It=bi(yi),tn=bi(!1),ts=yi;function al(e,t){var n=e.type.contextTypes;if(!n)return yi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function nn(e){return e=e.childContextTypes,e!=null}function Jo(){We(tn),We(It)}function bm(e,t,n){if(It.current!==yi)throw Error(Q(168));Ue(It,t),Ue(tn,n)}function lv(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(Q(108,kk(e)||"Unknown",i));return Xe({},n,r)}function Zo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||yi,ts=It.current,Ue(It,e),Ue(tn,tn.current),!0}function jm(e,t,n){var r=e.stateNode;if(!r)throw Error(Q(169));n?(e=lv(e,t,ts),r.__reactInternalMemoizedMergedChildContext=e,We(tn),We(It),Ue(It,e)):We(tn),Ue(tn,n)}var jr=null,Au=!1,Mc=!1;function av(e){jr===null?jr=[e]:jr.push(e)}function Ob(e){Au=!0,av(e)}function ji(){if(!Mc&&jr!==null){Mc=!0;var e=0,t=De;try{var n=jr;for(De=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}jr=null,Au=!1}catch(i){throw jr!==null&&(jr=jr.slice(e+1)),Ry(of,ji),i}finally{De=t,Mc=!1}}return null}var Rs=[],zs=0,eu=null,tu=0,Sn=[],Cn=0,ns=null,Cr=1,Er="";function Ri(e,t){Rs[zs++]=tu,Rs[zs++]=eu,eu=e,tu=t}function ov(e,t,n){Sn[Cn++]=Cr,Sn[Cn++]=Er,Sn[Cn++]=ns,ns=e;var r=Cr;e=Er;var i=32-Un(r)-1;r&=~(1<<i),n+=1;var s=32-Un(t)+i;if(30<s){var l=i-i%5;s=(r&(1<<l)-1).toString(32),r>>=l,i-=l,Cr=1<<32-Un(t)+i|n<<i|r,Er=s+e}else Cr=1<<s|n<<i|r,Er=e}function xf(e){e.return!==null&&(Ri(e,1),ov(e,1,0))}function yf(e){for(;e===eu;)eu=Rs[--zs],Rs[zs]=null,tu=Rs[--zs],Rs[zs]=null;for(;e===ns;)ns=Sn[--Cn],Sn[Cn]=null,Er=Sn[--Cn],Sn[Cn]=null,Cr=Sn[--Cn],Sn[Cn]=null}var pn=null,fn=null,Qe=!1,qn=null;function uv(e,t){var n=Pn(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 Nm(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,pn=e,fn=hi(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,pn=e,fn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=ns!==null?{id:Cr,overflow:Er}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Pn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,pn=e,fn=null,!0):!1;default:return!1}}function Od(e){return(e.mode&1)!==0&&(e.flags&128)===0}function _d(e){if(Qe){var t=fn;if(t){var n=t;if(!Nm(e,t)){if(Od(e))throw Error(Q(418));t=hi(n.nextSibling);var r=pn;t&&Nm(e,t)?uv(r,n):(e.flags=e.flags&-4097|2,Qe=!1,pn=e)}}else{if(Od(e))throw Error(Q(418));e.flags=e.flags&-4097|2,Qe=!1,pn=e}}}function Sm(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;pn=e}function fo(e){if(e!==pn)return!1;if(!Qe)return Sm(e),Qe=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Ad(e.type,e.memoizedProps)),t&&(t=fn)){if(Od(e))throw cv(),Error(Q(418));for(;t;)uv(e,t),t=hi(t.nextSibling)}if(Sm(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Q(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){fn=hi(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}fn=null}}else fn=pn?hi(e.stateNode.nextSibling):null;return!0}function cv(){for(var e=fn;e;)e=hi(e.nextSibling)}function ol(){fn=pn=null,Qe=!1}function vf(e){qn===null?qn=[e]:qn.push(e)}var _b=Or.ReactCurrentBatchConfig;function Rl(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(Q(309));var r=n.stateNode}if(!r)throw Error(Q(147,e));var i=r,s=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===s?t.ref:(t=function(l){var o=i.refs;l===null?delete o[s]:o[s]=l},t._stringRef=s,t)}if(typeof e!="string")throw Error(Q(284));if(!n._owner)throw Error(Q(290,e))}return e}function po(e,t){throw e=Object.prototype.toString.call(t),Error(Q(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Cm(e){var t=e._init;return t(e._payload)}function dv(e){function t(y,x){if(e){var v=y.deletions;v===null?(y.deletions=[x],y.flags|=16):v.push(x)}}function n(y,x){if(!e)return null;for(;x!==null;)t(y,x),x=x.sibling;return null}function r(y,x){for(y=new Map;x!==null;)x.key!==null?y.set(x.key,x):y.set(x.index,x),x=x.sibling;return y}function i(y,x){return y=gi(y,x),y.index=0,y.sibling=null,y}function s(y,x,v){return y.index=v,e?(v=y.alternate,v!==null?(v=v.index,v<x?(y.flags|=2,x):v):(y.flags|=2,x)):(y.flags|=1048576,x)}function l(y){return e&&y.alternate===null&&(y.flags|=2),y}function o(y,x,v,j){return x===null||x.tag!==6?(x=Oc(v,y.mode,j),x.return=y,x):(x=i(x,v),x.return=y,x)}function u(y,x,v,j){var E=v.type;return E===Cs?d(y,x,v.props.children,j,v.key):x!==null&&(x.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Vr&&Cm(E)===x.type)?(j=i(x,v.props),j.ref=Rl(y,x,v),j.return=y,j):(j=Do(v.type,v.key,v.props,null,y.mode,j),j.ref=Rl(y,x,v),j.return=y,j)}function c(y,x,v,j){return x===null||x.tag!==4||x.stateNode.containerInfo!==v.containerInfo||x.stateNode.implementation!==v.implementation?(x=_c(v,y.mode,j),x.return=y,x):(x=i(x,v.children||[]),x.return=y,x)}function d(y,x,v,j,E){return x===null||x.tag!==7?(x=Xi(v,y.mode,j,E),x.return=y,x):(x=i(x,v),x.return=y,x)}function h(y,x,v){if(typeof x=="string"&&x!==""||typeof x=="number")return x=Oc(""+x,y.mode,v),x.return=y,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case no:return v=Do(x.type,x.key,x.props,null,y.mode,v),v.ref=Rl(y,null,x),v.return=y,v;case Ss:return x=_c(x,y.mode,v),x.return=y,x;case Vr:var j=x._init;return h(y,j(x._payload),v)}if(Bl(x)||El(x))return x=Xi(x,y.mode,v,null),x.return=y,x;po(y,x)}return null}function p(y,x,v,j){var E=x!==null?x.key:null;if(typeof v=="string"&&v!==""||typeof v=="number")return E!==null?null:o(y,x,""+v,j);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case no:return v.key===E?u(y,x,v,j):null;case Ss:return v.key===E?c(y,x,v,j):null;case Vr:return E=v._init,p(y,x,E(v._payload),j)}if(Bl(v)||El(v))return E!==null?null:d(y,x,v,j,null);po(y,v)}return null}function f(y,x,v,j,E){if(typeof j=="string"&&j!==""||typeof j=="number")return y=y.get(v)||null,o(x,y,""+j,E);if(typeof j=="object"&&j!==null){switch(j.$$typeof){case no:return y=y.get(j.key===null?v:j.key)||null,u(x,y,j,E);case Ss:return y=y.get(j.key===null?v:j.key)||null,c(x,y,j,E);case Vr:var w=j._init;return f(y,x,v,w(j._payload),E)}if(Bl(j)||El(j))return y=y.get(v)||null,d(x,y,j,E,null);po(x,j)}return null}function m(y,x,v,j){for(var E=null,w=null,N=x,M=x=0,F=null;N!==null&&M<v.length;M++){N.index>M?(F=N,N=null):F=N.sibling;var C=p(y,N,v[M],j);if(C===null){N===null&&(N=F);break}e&&N&&C.alternate===null&&t(y,N),x=s(C,x,M),w===null?E=C:w.sibling=C,w=C,N=F}if(M===v.length)return n(y,N),Qe&&Ri(y,M),E;if(N===null){for(;M<v.length;M++)N=h(y,v[M],j),N!==null&&(x=s(N,x,M),w===null?E=N:w.sibling=N,w=N);return Qe&&Ri(y,M),E}for(N=r(y,N);M<v.length;M++)F=f(N,y,M,v[M],j),F!==null&&(e&&F.alternate!==null&&N.delete(F.key===null?M:F.key),x=s(F,x,M),w===null?E=F:w.sibling=F,w=F);return e&&N.forEach(function(O){return t(y,O)}),Qe&&Ri(y,M),E}function g(y,x,v,j){var E=El(v);if(typeof E!="function")throw Error(Q(150));if(v=E.call(v),v==null)throw Error(Q(151));for(var w=E=null,N=x,M=x=0,F=null,C=v.next();N!==null&&!C.done;M++,C=v.next()){N.index>M?(F=N,N=null):F=N.sibling;var O=p(y,N,C.value,j);if(O===null){N===null&&(N=F);break}e&&N&&O.alternate===null&&t(y,N),x=s(O,x,M),w===null?E=O:w.sibling=O,w=O,N=F}if(C.done)return n(y,N),Qe&&Ri(y,M),E;if(N===null){for(;!C.done;M++,C=v.next())C=h(y,C.value,j),C!==null&&(x=s(C,x,M),w===null?E=C:w.sibling=C,w=C);return Qe&&Ri(y,M),E}for(N=r(y,N);!C.done;M++,C=v.next())C=f(N,y,M,C.value,j),C!==null&&(e&&C.alternate!==null&&N.delete(C.key===null?M:C.key),x=s(C,x,M),w===null?E=C:w.sibling=C,w=C);return e&&N.forEach(function(A){return t(y,A)}),Qe&&Ri(y,M),E}function k(y,x,v,j){if(typeof v=="object"&&v!==null&&v.type===Cs&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case no:e:{for(var E=v.key,w=x;w!==null;){if(w.key===E){if(E=v.type,E===Cs){if(w.tag===7){n(y,w.sibling),x=i(w,v.props.children),x.return=y,y=x;break e}}else if(w.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Vr&&Cm(E)===w.type){n(y,w.sibling),x=i(w,v.props),x.ref=Rl(y,w,v),x.return=y,y=x;break e}n(y,w);break}else t(y,w);w=w.sibling}v.type===Cs?(x=Xi(v.props.children,y.mode,j,v.key),x.return=y,y=x):(j=Do(v.type,v.key,v.props,null,y.mode,j),j.ref=Rl(y,x,v),j.return=y,y=j)}return l(y);case Ss:e:{for(w=v.key;x!==null;){if(x.key===w)if(x.tag===4&&x.stateNode.containerInfo===v.containerInfo&&x.stateNode.implementation===v.implementation){n(y,x.sibling),x=i(x,v.children||[]),x.return=y,y=x;break e}else{n(y,x);break}else t(y,x);x=x.sibling}x=_c(v,y.mode,j),x.return=y,y=x}return l(y);case Vr:return w=v._init,k(y,x,w(v._payload),j)}if(Bl(v))return m(y,x,v,j);if(El(v))return g(y,x,v,j);po(y,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,x!==null&&x.tag===6?(n(y,x.sibling),x=i(x,v),x.return=y,y=x):(n(y,x),x=Oc(v,y.mode,j),x.return=y,y=x),l(y)):n(y,x)}return k}var ul=dv(!0),hv=dv(!1),nu=bi(null),ru=null,As=null,wf=null;function kf(){wf=As=ru=null}function bf(e){var t=nu.current;We(nu),e._currentValue=t}function $d(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 qs(e,t){ru=e,wf=As=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(en=!0),e.firstContext=null)}function Ln(e){var t=e._currentValue;if(wf!==e)if(e={context:e,memoizedValue:t,next:null},As===null){if(ru===null)throw Error(Q(308));As=e,ru.dependencies={lanes:0,firstContext:e}}else As=As.next=e;return t}var Oi=null;function jf(e){Oi===null?Oi=[e]:Oi.push(e)}function fv(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,jf(t)):(n.next=i.next,i.next=n),t.interleaved=n,Ar(e,r)}function Ar(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 Qr=!1;function Nf(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function pv(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 Pr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function fi(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Re&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Ar(e,n)}return i=r.interleaved,i===null?(t.next=t,jf(r)):(t.next=i.next,i.next=t),r.interleaved=t,Ar(e,n)}function Mo(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,uf(e,n)}}function Em(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var l={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=l:s=s.next=l,n=n.next}while(n!==null);s===null?i=s=t:s=s.next=t}else i=s=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,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 iu(e,t,n,r){var i=e.updateQueue;Qr=!1;var s=i.firstBaseUpdate,l=i.lastBaseUpdate,o=i.shared.pending;if(o!==null){i.shared.pending=null;var u=o,c=u.next;u.next=null,l===null?s=c:l.next=c,l=u;var d=e.alternate;d!==null&&(d=d.updateQueue,o=d.lastBaseUpdate,o!==l&&(o===null?d.firstBaseUpdate=c:o.next=c,d.lastBaseUpdate=u))}if(s!==null){var h=i.baseState;l=0,d=c=u=null,o=s;do{var p=o.lane,f=o.eventTime;if((r&p)===p){d!==null&&(d=d.next={eventTime:f,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var m=e,g=o;switch(p=t,f=n,g.tag){case 1:if(m=g.payload,typeof m=="function"){h=m.call(f,h,p);break e}h=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,p=typeof m=="function"?m.call(f,h,p):m,p==null)break e;h=Xe({},h,p);break e;case 2:Qr=!0}}o.callback!==null&&o.lane!==0&&(e.flags|=64,p=i.effects,p===null?i.effects=[o]:p.push(o))}else f={eventTime:f,lane:p,tag:o.tag,payload:o.payload,callback:o.callback,next:null},d===null?(c=d=f,u=h):d=d.next=f,l|=p;if(o=o.next,o===null){if(o=i.shared.pending,o===null)break;p=o,o=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(!0);if(d===null&&(u=h),i.baseState=u,i.firstBaseUpdate=c,i.lastBaseUpdate=d,t=i.shared.interleaved,t!==null){i=t;do l|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);is|=l,e.lanes=l,e.memoizedState=h}}function Pm(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(Q(191,i));i.call(r)}}}var Oa={},hr=bi(Oa),ya=bi(Oa),va=bi(Oa);function _i(e){if(e===Oa)throw Error(Q(174));return e}function Sf(e,t){switch(Ue(va,t),Ue(ya,e),Ue(hr,Oa),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:wd(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=wd(t,e)}We(hr),Ue(hr,t)}function cl(){We(hr),We(ya),We(va)}function mv(e){_i(va.current);var t=_i(hr.current),n=wd(t,e.type);t!==n&&(Ue(ya,e),Ue(hr,n))}function Cf(e){ya.current===e&&(We(hr),We(ya))}var Ge=bi(0);function su(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 Rc=[];function Ef(){for(var e=0;e<Rc.length;e++)Rc[e]._workInProgressVersionPrimary=null;Rc.length=0}var Ro=Or.ReactCurrentDispatcher,zc=Or.ReactCurrentBatchConfig,rs=0,Ye=null,pt=null,yt=null,lu=!1,Jl=!1,wa=0,$b=0;function Mt(){throw Error(Q(321))}function Pf(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Qn(e[n],t[n]))return!1;return!0}function Tf(e,t,n,r,i,s){if(rs=s,Ye=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ro.current=e===null||e.memoizedState===null?Hb:Wb,e=n(r,i),Jl){s=0;do{if(Jl=!1,wa=0,25<=s)throw Error(Q(301));s+=1,yt=pt=null,t.updateQueue=null,Ro.current=Vb,e=n(r,i)}while(Jl)}if(Ro.current=au,t=pt!==null&&pt.next!==null,rs=0,yt=pt=Ye=null,lu=!1,t)throw Error(Q(300));return e}function Lf(){var e=wa!==0;return wa=0,e}function rr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return yt===null?Ye.memoizedState=yt=e:yt=yt.next=e,yt}function Mn(){if(pt===null){var e=Ye.alternate;e=e!==null?e.memoizedState:null}else e=pt.next;var t=yt===null?Ye.memoizedState:yt.next;if(t!==null)yt=t,pt=e;else{if(e===null)throw Error(Q(310));pt=e,e={memoizedState:pt.memoizedState,baseState:pt.baseState,baseQueue:pt.baseQueue,queue:pt.queue,next:null},yt===null?Ye.memoizedState=yt=e:yt=yt.next=e}return yt}function ka(e,t){return typeof t=="function"?t(e):t}function Ac(e){var t=Mn(),n=t.queue;if(n===null)throw Error(Q(311));n.lastRenderedReducer=e;var r=pt,i=r.baseQueue,s=n.pending;if(s!==null){if(i!==null){var l=i.next;i.next=s.next,s.next=l}r.baseQueue=i=s,n.pending=null}if(i!==null){s=i.next,r=r.baseState;var o=l=null,u=null,c=s;do{var d=c.lane;if((rs&d)===d)u!==null&&(u=u.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var h={lane:d,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};u===null?(o=u=h,l=r):u=u.next=h,Ye.lanes|=d,is|=d}c=c.next}while(c!==null&&c!==s);u===null?l=r:u.next=o,Qn(r,t.memoizedState)||(en=!0),t.memoizedState=r,t.baseState=l,t.baseQueue=u,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do s=i.lane,Ye.lanes|=s,is|=s,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Ic(e){var t=Mn(),n=t.queue;if(n===null)throw Error(Q(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,s=t.memoizedState;if(i!==null){n.pending=null;var l=i=i.next;do s=e(s,l.action),l=l.next;while(l!==i);Qn(s,t.memoizedState)||(en=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function gv(){}function xv(e,t){var n=Ye,r=Mn(),i=t(),s=!Qn(r.memoizedState,i);if(s&&(r.memoizedState=i,en=!0),r=r.queue,Mf(wv.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||yt!==null&&yt.memoizedState.tag&1){if(n.flags|=2048,ba(9,vv.bind(null,n,r,i,t),void 0,null),vt===null)throw Error(Q(349));rs&30||yv(n,t,i)}return i}function yv(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ye.updateQueue,t===null?(t={lastEffect:null,stores:null},Ye.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function vv(e,t,n,r){t.value=n,t.getSnapshot=r,kv(t)&&bv(e)}function wv(e,t,n){return n(function(){kv(t)&&bv(e)})}function kv(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Qn(e,n)}catch{return!0}}function bv(e){var t=Ar(e,1);t!==null&&Hn(t,e,1,-1)}function Tm(e){var t=rr();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ka,lastRenderedState:e},t.queue=e,e=e.dispatch=Ub.bind(null,Ye,e),[t.memoizedState,e]}function ba(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Ye.updateQueue,t===null?(t={lastEffect:null,stores:null},Ye.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 jv(){return Mn().memoizedState}function zo(e,t,n,r){var i=rr();Ye.flags|=e,i.memoizedState=ba(1|t,n,void 0,r===void 0?null:r)}function Iu(e,t,n,r){var i=Mn();r=r===void 0?null:r;var s=void 0;if(pt!==null){var l=pt.memoizedState;if(s=l.destroy,r!==null&&Pf(r,l.deps)){i.memoizedState=ba(t,n,s,r);return}}Ye.flags|=e,i.memoizedState=ba(1|t,n,s,r)}function Lm(e,t){return zo(8390656,8,e,t)}function Mf(e,t){return Iu(2048,8,e,t)}function Nv(e,t){return Iu(4,2,e,t)}function Sv(e,t){return Iu(4,4,e,t)}function Cv(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 Ev(e,t,n){return n=n!=null?n.concat([e]):null,Iu(4,4,Cv.bind(null,t,e),n)}function Rf(){}function Pv(e,t){var n=Mn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Pf(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Tv(e,t){var n=Mn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Pf(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Lv(e,t,n){return rs&21?(Qn(n,t)||(n=Iy(),Ye.lanes|=n,is|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,en=!0),e.memoizedState=n)}function qb(e,t){var n=De;De=n!==0&&4>n?n:4,e(!0);var r=zc.transition;zc.transition={};try{e(!1),t()}finally{De=n,zc.transition=r}}function Mv(){return Mn().memoizedState}function Bb(e,t,n){var r=mi(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Rv(e))zv(t,n);else if(n=fv(e,t,n,r),n!==null){var i=Ut();Hn(n,e,r,i),Av(n,t,r)}}function Ub(e,t,n){var r=mi(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Rv(e))zv(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var l=t.lastRenderedState,o=s(l,n);if(i.hasEagerState=!0,i.eagerState=o,Qn(o,l)){var u=t.interleaved;u===null?(i.next=i,jf(t)):(i.next=u.next,u.next=i),t.interleaved=i;return}}catch{}finally{}n=fv(e,t,i,r),n!==null&&(i=Ut(),Hn(n,e,r,i),Av(n,t,r))}}function Rv(e){var t=e.alternate;return e===Ye||t!==null&&t===Ye}function zv(e,t){Jl=lu=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Av(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,uf(e,n)}}var au={readContext:Ln,useCallback:Mt,useContext:Mt,useEffect:Mt,useImperativeHandle:Mt,useInsertionEffect:Mt,useLayoutEffect:Mt,useMemo:Mt,useReducer:Mt,useRef:Mt,useState:Mt,useDebugValue:Mt,useDeferredValue:Mt,useTransition:Mt,useMutableSource:Mt,useSyncExternalStore:Mt,useId:Mt,unstable_isNewReconciler:!1},Hb={readContext:Ln,useCallback:function(e,t){return rr().memoizedState=[e,t===void 0?null:t],e},useContext:Ln,useEffect:Lm,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,zo(4194308,4,Cv.bind(null,t,e),n)},useLayoutEffect:function(e,t){return zo(4194308,4,e,t)},useInsertionEffect:function(e,t){return zo(4,2,e,t)},useMemo:function(e,t){var n=rr();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=rr();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=Bb.bind(null,Ye,e),[r.memoizedState,e]},useRef:function(e){var t=rr();return e={current:e},t.memoizedState=e},useState:Tm,useDebugValue:Rf,useDeferredValue:function(e){return rr().memoizedState=e},useTransition:function(){var e=Tm(!1),t=e[0];return e=qb.bind(null,e[1]),rr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ye,i=rr();if(Qe){if(n===void 0)throw Error(Q(407));n=n()}else{if(n=t(),vt===null)throw Error(Q(349));rs&30||yv(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,Lm(wv.bind(null,r,s,e),[e]),r.flags|=2048,ba(9,vv.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=rr(),t=vt.identifierPrefix;if(Qe){var n=Er,r=Cr;n=(r&~(1<<32-Un(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=wa++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=$b++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Wb={readContext:Ln,useCallback:Pv,useContext:Ln,useEffect:Mf,useImperativeHandle:Ev,useInsertionEffect:Nv,useLayoutEffect:Sv,useMemo:Tv,useReducer:Ac,useRef:jv,useState:function(){return Ac(ka)},useDebugValue:Rf,useDeferredValue:function(e){var t=Mn();return Lv(t,pt.memoizedState,e)},useTransition:function(){var e=Ac(ka)[0],t=Mn().memoizedState;return[e,t]},useMutableSource:gv,useSyncExternalStore:xv,useId:Mv,unstable_isNewReconciler:!1},Vb={readContext:Ln,useCallback:Pv,useContext:Ln,useEffect:Mf,useImperativeHandle:Ev,useInsertionEffect:Nv,useLayoutEffect:Sv,useMemo:Tv,useReducer:Ic,useRef:jv,useState:function(){return Ic(ka)},useDebugValue:Rf,useDeferredValue:function(e){var t=Mn();return pt===null?t.memoizedState=e:Lv(t,pt.memoizedState,e)},useTransition:function(){var e=Ic(ka)[0],t=Mn().memoizedState;return[e,t]},useMutableSource:gv,useSyncExternalStore:xv,useId:Mv,unstable_isNewReconciler:!1};function Dn(e,t){if(e&&e.defaultProps){t=Xe({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function qd(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Xe({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Fu={isMounted:function(e){return(e=e._reactInternals)?fs(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ut(),i=mi(e),s=Pr(r,i);s.payload=t,n!=null&&(s.callback=n),t=fi(e,s,i),t!==null&&(Hn(t,e,i,r),Mo(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ut(),i=mi(e),s=Pr(r,i);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=fi(e,s,i),t!==null&&(Hn(t,e,i,r),Mo(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ut(),r=mi(e),i=Pr(n,r);i.tag=2,t!=null&&(i.callback=t),t=fi(e,i,r),t!==null&&(Hn(t,e,r,n),Mo(t,e,r))}};function Mm(e,t,n,r,i,s,l){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,s,l):t.prototype&&t.prototype.isPureReactComponent?!pa(n,r)||!pa(i,s):!0}function Iv(e,t,n){var r=!1,i=yi,s=t.contextType;return typeof s=="object"&&s!==null?s=Ln(s):(i=nn(t)?ts:It.current,r=t.contextTypes,s=(r=r!=null)?al(e,i):yi),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Fu,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=s),t}function Rm(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&&Fu.enqueueReplaceState(t,t.state,null)}function Bd(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},Nf(e);var s=t.contextType;typeof s=="object"&&s!==null?i.context=Ln(s):(s=nn(t)?ts:It.current,i.context=al(e,s)),i.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(qd(e,t,s,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&&Fu.enqueueReplaceState(i,i.state,null),iu(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function dl(e,t){try{var n="",r=t;do n+=wk(r),r=r.return;while(r);var i=n}catch(s){i=`
39
+ Error generating stack: `+s.message+`
40
+ `+s.stack}return{value:e,source:t,stack:i,digest:null}}function Fc(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Ud(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Qb=typeof WeakMap=="function"?WeakMap:Map;function Fv(e,t,n){n=Pr(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){uu||(uu=!0,Zd=r),Ud(e,t)},n}function Dv(e,t,n){n=Pr(-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(){Ud(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){Ud(e,t),typeof r!="function"&&(pi===null?pi=new Set([this]):pi.add(this));var l=t.stack;this.componentDidCatch(t.value,{componentStack:l!==null?l:""})}),n}function zm(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Qb;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=aj.bind(null,e,t,n),t.then(e,e))}function Am(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 Im(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=Pr(-1,1),t.tag=2,fi(n,t,1))),n.lanes|=1),e)}var Kb=Or.ReactCurrentOwner,en=!1;function Bt(e,t,n,r){t.child=e===null?hv(t,null,n,r):ul(t,e.child,n,r)}function Fm(e,t,n,r,i){n=n.render;var s=t.ref;return qs(t,i),r=Tf(e,t,n,r,s,i),n=Lf(),e!==null&&!en?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Ir(e,t,i)):(Qe&&n&&xf(t),t.flags|=1,Bt(e,t,r,i),t.child)}function Dm(e,t,n,r,i){if(e===null){var s=n.type;return typeof s=="function"&&!$f(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,Ov(e,t,s,r,i)):(e=Do(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&i)){var l=s.memoizedProps;if(n=n.compare,n=n!==null?n:pa,n(l,r)&&e.ref===t.ref)return Ir(e,t,i)}return t.flags|=1,e=gi(s,r),e.ref=t.ref,e.return=t,t.child=e}function Ov(e,t,n,r,i){if(e!==null){var s=e.memoizedProps;if(pa(s,r)&&e.ref===t.ref)if(en=!1,t.pendingProps=r=s,(e.lanes&i)!==0)e.flags&131072&&(en=!0);else return t.lanes=e.lanes,Ir(e,t,i)}return Hd(e,t,n,r,i)}function _v(e,t,n){var r=t.pendingProps,i=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ue(Fs,dn),dn|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ue(Fs,dn),dn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,Ue(Fs,dn),dn|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,Ue(Fs,dn),dn|=r;return Bt(e,t,i,n),t.child}function $v(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Hd(e,t,n,r,i){var s=nn(n)?ts:It.current;return s=al(t,s),qs(t,i),n=Tf(e,t,n,r,s,i),r=Lf(),e!==null&&!en?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Ir(e,t,i)):(Qe&&r&&xf(t),t.flags|=1,Bt(e,t,n,i),t.child)}function Om(e,t,n,r,i){if(nn(n)){var s=!0;Zo(t)}else s=!1;if(qs(t,i),t.stateNode===null)Ao(e,t),Iv(t,n,r),Bd(t,n,r,i),r=!0;else if(e===null){var l=t.stateNode,o=t.memoizedProps;l.props=o;var u=l.context,c=n.contextType;typeof c=="object"&&c!==null?c=Ln(c):(c=nn(n)?ts:It.current,c=al(t,c));var d=n.getDerivedStateFromProps,h=typeof d=="function"||typeof l.getSnapshotBeforeUpdate=="function";h||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(o!==r||u!==c)&&Rm(t,l,r,c),Qr=!1;var p=t.memoizedState;l.state=p,iu(t,r,l,i),u=t.memoizedState,o!==r||p!==u||tn.current||Qr?(typeof d=="function"&&(qd(t,n,d,r),u=t.memoizedState),(o=Qr||Mm(t,n,o,r,p,u,c))?(h||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount()),typeof l.componentDidMount=="function"&&(t.flags|=4194308)):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),l.props=r,l.state=u,l.context=c,r=o):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{l=t.stateNode,pv(e,t),o=t.memoizedProps,c=t.type===t.elementType?o:Dn(t.type,o),l.props=c,h=t.pendingProps,p=l.context,u=n.contextType,typeof u=="object"&&u!==null?u=Ln(u):(u=nn(n)?ts:It.current,u=al(t,u));var f=n.getDerivedStateFromProps;(d=typeof f=="function"||typeof l.getSnapshotBeforeUpdate=="function")||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(o!==h||p!==u)&&Rm(t,l,r,u),Qr=!1,p=t.memoizedState,l.state=p,iu(t,r,l,i);var m=t.memoizedState;o!==h||p!==m||tn.current||Qr?(typeof f=="function"&&(qd(t,n,f,r),m=t.memoizedState),(c=Qr||Mm(t,n,c,r,p,m,u)||!1)?(d||typeof l.UNSAFE_componentWillUpdate!="function"&&typeof l.componentWillUpdate!="function"||(typeof l.componentWillUpdate=="function"&&l.componentWillUpdate(r,m,u),typeof l.UNSAFE_componentWillUpdate=="function"&&l.UNSAFE_componentWillUpdate(r,m,u)),typeof l.componentDidUpdate=="function"&&(t.flags|=4),typeof l.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof l.componentDidUpdate!="function"||o===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),l.props=r,l.state=m,l.context=u,r=c):(typeof l.componentDidUpdate!="function"||o===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return Wd(e,t,n,r,s,i)}function Wd(e,t,n,r,i,s){$v(e,t);var l=(t.flags&128)!==0;if(!r&&!l)return i&&jm(t,n,!1),Ir(e,t,s);r=t.stateNode,Kb.current=t;var o=l&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&l?(t.child=ul(t,e.child,null,s),t.child=ul(t,null,o,s)):Bt(e,t,o,s),t.memoizedState=r.state,i&&jm(t,n,!0),t.child}function qv(e){var t=e.stateNode;t.pendingContext?bm(e,t.pendingContext,t.pendingContext!==t.context):t.context&&bm(e,t.context,!1),Sf(e,t.containerInfo)}function _m(e,t,n,r,i){return ol(),vf(i),t.flags|=256,Bt(e,t,n,r),t.child}var Vd={dehydrated:null,treeContext:null,retryLane:0};function Qd(e){return{baseLanes:e,cachePool:null,transitions:null}}function Bv(e,t,n){var r=t.pendingProps,i=Ge.current,s=!1,l=(t.flags&128)!==0,o;if((o=l)||(o=e!==null&&e.memoizedState===null?!1:(i&2)!==0),o?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Ue(Ge,i&1),e===null)return _d(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):(l=r.children,e=r.fallback,s?(r=t.mode,s=t.child,l={mode:"hidden",children:l},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=l):s=_u(l,r,0,null),e=Xi(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Qd(n),t.memoizedState=Vd,e):zf(t,l));if(i=e.memoizedState,i!==null&&(o=i.dehydrated,o!==null))return Gb(e,t,l,r,o,i,n);if(s){s=r.fallback,l=t.mode,i=e.child,o=i.sibling;var u={mode:"hidden",children:r.children};return!(l&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=u,t.deletions=null):(r=gi(i,u),r.subtreeFlags=i.subtreeFlags&14680064),o!==null?s=gi(o,s):(s=Xi(s,l,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,l=e.child.memoizedState,l=l===null?Qd(n):{baseLanes:l.baseLanes|n,cachePool:null,transitions:l.transitions},s.memoizedState=l,s.childLanes=e.childLanes&~n,t.memoizedState=Vd,r}return s=e.child,e=s.sibling,r=gi(s,{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 zf(e,t){return t=_u({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function mo(e,t,n,r){return r!==null&&vf(r),ul(t,e.child,null,n),e=zf(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Gb(e,t,n,r,i,s,l){if(n)return t.flags&256?(t.flags&=-257,r=Fc(Error(Q(422))),mo(e,t,l,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,i=t.mode,r=_u({mode:"visible",children:r.children},i,0,null),s=Xi(s,i,l,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&ul(t,e.child,null,l),t.child.memoizedState=Qd(l),t.memoizedState=Vd,s);if(!(t.mode&1))return mo(e,t,l,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var o=r.dgst;return r=o,s=Error(Q(419)),r=Fc(s,r,void 0),mo(e,t,l,r)}if(o=(l&e.childLanes)!==0,en||o){if(r=vt,r!==null){switch(l&-l){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|l)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,Ar(e,i),Hn(r,e,i,-1))}return _f(),r=Fc(Error(Q(421))),mo(e,t,l,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=oj.bind(null,e),i._reactRetry=t,null):(e=s.treeContext,fn=hi(i.nextSibling),pn=t,Qe=!0,qn=null,e!==null&&(Sn[Cn++]=Cr,Sn[Cn++]=Er,Sn[Cn++]=ns,Cr=e.id,Er=e.overflow,ns=t),t=zf(t,r.children),t.flags|=4096,t)}function $m(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),$d(e.return,t,n)}function Dc(e,t,n,r,i){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i)}function Uv(e,t,n){var r=t.pendingProps,i=r.revealOrder,s=r.tail;if(Bt(e,t,r.children,n),r=Ge.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&&$m(e,n,t);else if(e.tag===19)$m(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(Ue(Ge,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&&su(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Dc(t,!1,i,n,s);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&su(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Dc(t,!0,n,null,s);break;case"together":Dc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ao(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Ir(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),is|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(Q(153));if(t.child!==null){for(e=t.child,n=gi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=gi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Yb(e,t,n){switch(t.tag){case 3:qv(t),ol();break;case 5:mv(t);break;case 1:nn(t.type)&&Zo(t);break;case 4:Sf(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Ue(nu,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Ue(Ge,Ge.current&1),t.flags|=128,null):n&t.child.childLanes?Bv(e,t,n):(Ue(Ge,Ge.current&1),e=Ir(e,t,n),e!==null?e.sibling:null);Ue(Ge,Ge.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Uv(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ue(Ge,Ge.current),r)break;return null;case 22:case 23:return t.lanes=0,_v(e,t,n)}return Ir(e,t,n)}var Hv,Kd,Wv,Vv;Hv=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}};Kd=function(){};Wv=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,_i(hr.current);var s=null;switch(n){case"input":i=gd(e,i),r=gd(e,r),s=[];break;case"select":i=Xe({},i,{value:void 0}),r=Xe({},r,{value:void 0}),s=[];break;case"textarea":i=vd(e,i),r=vd(e,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Xo)}kd(n,r);var l;n=null;for(c in i)if(!r.hasOwnProperty(c)&&i.hasOwnProperty(c)&&i[c]!=null)if(c==="style"){var o=i[c];for(l in o)o.hasOwnProperty(l)&&(n||(n={}),n[l]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(aa.hasOwnProperty(c)?s||(s=[]):(s=s||[]).push(c,null));for(c in r){var u=r[c];if(o=i!=null?i[c]:void 0,r.hasOwnProperty(c)&&u!==o&&(u!=null||o!=null))if(c==="style")if(o){for(l in o)!o.hasOwnProperty(l)||u&&u.hasOwnProperty(l)||(n||(n={}),n[l]="");for(l in u)u.hasOwnProperty(l)&&o[l]!==u[l]&&(n||(n={}),n[l]=u[l])}else n||(s||(s=[]),s.push(c,n)),n=u;else c==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,o=o?o.__html:void 0,u!=null&&o!==u&&(s=s||[]).push(c,u)):c==="children"?typeof u!="string"&&typeof u!="number"||(s=s||[]).push(c,""+u):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(aa.hasOwnProperty(c)?(u!=null&&c==="onScroll"&&He("scroll",e),s||o===u||(s=[])):(s=s||[]).push(c,u))}n&&(s=s||[]).push("style",n);var c=s;(t.updateQueue=c)&&(t.flags|=4)}};Vv=function(e,t,n,r){n!==r&&(t.flags|=4)};function zl(e,t){if(!Qe)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 Rt(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 Xb(e,t,n){var r=t.pendingProps;switch(yf(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Rt(t),null;case 1:return nn(t.type)&&Jo(),Rt(t),null;case 3:return r=t.stateNode,cl(),We(tn),We(It),Ef(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(fo(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,qn!==null&&(nh(qn),qn=null))),Kd(e,t),Rt(t),null;case 5:Cf(t);var i=_i(va.current);if(n=t.type,e!==null&&t.stateNode!=null)Wv(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(Q(166));return Rt(t),null}if(e=_i(hr.current),fo(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[ur]=t,r[xa]=s,e=(t.mode&1)!==0,n){case"dialog":He("cancel",r),He("close",r);break;case"iframe":case"object":case"embed":He("load",r);break;case"video":case"audio":for(i=0;i<Hl.length;i++)He(Hl[i],r);break;case"source":He("error",r);break;case"img":case"image":case"link":He("error",r),He("load",r);break;case"details":He("toggle",r);break;case"input":Gp(r,s),He("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},He("invalid",r);break;case"textarea":Xp(r,s),He("invalid",r)}kd(n,s),i=null;for(var l in s)if(s.hasOwnProperty(l)){var o=s[l];l==="children"?typeof o=="string"?r.textContent!==o&&(s.suppressHydrationWarning!==!0&&ho(r.textContent,o,e),i=["children",o]):typeof o=="number"&&r.textContent!==""+o&&(s.suppressHydrationWarning!==!0&&ho(r.textContent,o,e),i=["children",""+o]):aa.hasOwnProperty(l)&&o!=null&&l==="onScroll"&&He("scroll",r)}switch(n){case"input":ro(r),Yp(r,s,!0);break;case"textarea":ro(r),Jp(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=Xo)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{l=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=wy(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=l.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=l.createElement(n,{is:r.is}):(e=l.createElement(n),n==="select"&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,n),e[ur]=t,e[xa]=r,Hv(e,t,!1,!1),t.stateNode=e;e:{switch(l=bd(n,r),n){case"dialog":He("cancel",e),He("close",e),i=r;break;case"iframe":case"object":case"embed":He("load",e),i=r;break;case"video":case"audio":for(i=0;i<Hl.length;i++)He(Hl[i],e);i=r;break;case"source":He("error",e),i=r;break;case"img":case"image":case"link":He("error",e),He("load",e),i=r;break;case"details":He("toggle",e),i=r;break;case"input":Gp(e,r),i=gd(e,r),He("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=Xe({},r,{value:void 0}),He("invalid",e);break;case"textarea":Xp(e,r),i=vd(e,r),He("invalid",e);break;default:i=r}kd(n,i),o=i;for(s in o)if(o.hasOwnProperty(s)){var u=o[s];s==="style"?jy(e,u):s==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&ky(e,u)):s==="children"?typeof u=="string"?(n!=="textarea"||u!=="")&&oa(e,u):typeof u=="number"&&oa(e,""+u):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(aa.hasOwnProperty(s)?u!=null&&s==="onScroll"&&He("scroll",e):u!=null&&nf(e,s,u,l))}switch(n){case"input":ro(e),Yp(e,r,!1);break;case"textarea":ro(e),Jp(e);break;case"option":r.value!=null&&e.setAttribute("value",""+xi(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?Ds(e,!!r.multiple,s,!1):r.defaultValue!=null&&Ds(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=Xo)}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 Rt(t),null;case 6:if(e&&t.stateNode!=null)Vv(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(Q(166));if(n=_i(va.current),_i(hr.current),fo(t)){if(r=t.stateNode,n=t.memoizedProps,r[ur]=t,(s=r.nodeValue!==n)&&(e=pn,e!==null))switch(e.tag){case 3:ho(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&ho(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[ur]=t,t.stateNode=r}return Rt(t),null;case 13:if(We(Ge),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Qe&&fn!==null&&t.mode&1&&!(t.flags&128))cv(),ol(),t.flags|=98560,s=!1;else if(s=fo(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(Q(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(Q(317));s[ur]=t}else ol(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Rt(t),s=!1}else qn!==null&&(nh(qn),qn=null),s=!0;if(!s)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||Ge.current&1?mt===0&&(mt=3):_f())),t.updateQueue!==null&&(t.flags|=4),Rt(t),null);case 4:return cl(),Kd(e,t),e===null&&ma(t.stateNode.containerInfo),Rt(t),null;case 10:return bf(t.type._context),Rt(t),null;case 17:return nn(t.type)&&Jo(),Rt(t),null;case 19:if(We(Ge),s=t.memoizedState,s===null)return Rt(t),null;if(r=(t.flags&128)!==0,l=s.rendering,l===null)if(r)zl(s,!1);else{if(mt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(l=su(e),l!==null){for(t.flags|=128,zl(s,!1),r=l.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)s=n,e=r,s.flags&=14680066,l=s.alternate,l===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=l.childLanes,s.lanes=l.lanes,s.child=l.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=l.memoizedProps,s.memoizedState=l.memoizedState,s.updateQueue=l.updateQueue,s.type=l.type,e=l.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Ue(Ge,Ge.current&1|2),t.child}e=e.sibling}s.tail!==null&&st()>hl&&(t.flags|=128,r=!0,zl(s,!1),t.lanes=4194304)}else{if(!r)if(e=su(l),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),zl(s,!0),s.tail===null&&s.tailMode==="hidden"&&!l.alternate&&!Qe)return Rt(t),null}else 2*st()-s.renderingStartTime>hl&&n!==1073741824&&(t.flags|=128,r=!0,zl(s,!1),t.lanes=4194304);s.isBackwards?(l.sibling=t.child,t.child=l):(n=s.last,n!==null?n.sibling=l:t.child=l,s.last=l)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=st(),t.sibling=null,n=Ge.current,Ue(Ge,r?n&1|2:n&1),t):(Rt(t),null);case 22:case 23:return Of(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?dn&1073741824&&(Rt(t),t.subtreeFlags&6&&(t.flags|=8192)):Rt(t),null;case 24:return null;case 25:return null}throw Error(Q(156,t.tag))}function Jb(e,t){switch(yf(t),t.tag){case 1:return nn(t.type)&&Jo(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return cl(),We(tn),We(It),Ef(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Cf(t),null;case 13:if(We(Ge),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Q(340));ol()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return We(Ge),null;case 4:return cl(),null;case 10:return bf(t.type._context),null;case 22:case 23:return Of(),null;case 24:return null;default:return null}}var go=!1,At=!1,Zb=typeof WeakSet=="function"?WeakSet:Set,ne=null;function Is(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){nt(e,t,r)}else n.current=null}function Gd(e,t,n){try{n()}catch(r){nt(e,t,r)}}var qm=!1;function ej(e,t){if(Rd=Ko,e=Xy(),gf(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,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var l=0,o=-1,u=-1,c=0,d=0,h=e,p=null;t:for(;;){for(var f;h!==n||i!==0&&h.nodeType!==3||(o=l+i),h!==s||r!==0&&h.nodeType!==3||(u=l+r),h.nodeType===3&&(l+=h.nodeValue.length),(f=h.firstChild)!==null;)p=h,h=f;for(;;){if(h===e)break t;if(p===n&&++c===i&&(o=l),p===s&&++d===r&&(u=l),(f=h.nextSibling)!==null)break;h=p,p=h.parentNode}h=f}n=o===-1||u===-1?null:{start:o,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(zd={focusedElem:e,selectionRange:n},Ko=!1,ne=t;ne!==null;)if(t=ne,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ne=e;else for(;ne!==null;){t=ne;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var g=m.memoizedProps,k=m.memoizedState,y=t.stateNode,x=y.getSnapshotBeforeUpdate(t.elementType===t.type?g:Dn(t.type,g),k);y.__reactInternalSnapshotBeforeUpdate=x}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(Q(163))}}catch(j){nt(t,t.return,j)}if(e=t.sibling,e!==null){e.return=t.return,ne=e;break}ne=t.return}return m=qm,qm=!1,m}function Zl(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 s=i.destroy;i.destroy=void 0,s!==void 0&&Gd(t,n,s)}i=i.next}while(i!==r)}}function Du(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 Yd(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 Qv(e){var t=e.alternate;t!==null&&(e.alternate=null,Qv(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ur],delete t[xa],delete t[Fd],delete t[Fb],delete t[Db])),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 Kv(e){return e.tag===5||e.tag===3||e.tag===4}function Bm(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Kv(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 Xd(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=Xo));else if(r!==4&&(e=e.child,e!==null))for(Xd(e,t,n),e=e.sibling;e!==null;)Xd(e,t,n),e=e.sibling}function Jd(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(Jd(e,t,n),e=e.sibling;e!==null;)Jd(e,t,n),e=e.sibling}var Nt=null,_n=!1;function Br(e,t,n){for(n=n.child;n!==null;)Gv(e,t,n),n=n.sibling}function Gv(e,t,n){if(dr&&typeof dr.onCommitFiberUnmount=="function")try{dr.onCommitFiberUnmount(Tu,n)}catch{}switch(n.tag){case 5:At||Is(n,t);case 6:var r=Nt,i=_n;Nt=null,Br(e,t,n),Nt=r,_n=i,Nt!==null&&(_n?(e=Nt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Nt.removeChild(n.stateNode));break;case 18:Nt!==null&&(_n?(e=Nt,n=n.stateNode,e.nodeType===8?Lc(e.parentNode,n):e.nodeType===1&&Lc(e,n),ha(e)):Lc(Nt,n.stateNode));break;case 4:r=Nt,i=_n,Nt=n.stateNode.containerInfo,_n=!0,Br(e,t,n),Nt=r,_n=i;break;case 0:case 11:case 14:case 15:if(!At&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,l=s.destroy;s=s.tag,l!==void 0&&(s&2||s&4)&&Gd(n,t,l),i=i.next}while(i!==r)}Br(e,t,n);break;case 1:if(!At&&(Is(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){nt(n,t,o)}Br(e,t,n);break;case 21:Br(e,t,n);break;case 22:n.mode&1?(At=(r=At)||n.memoizedState!==null,Br(e,t,n),At=r):Br(e,t,n);break;default:Br(e,t,n)}}function Um(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Zb),t.forEach(function(r){var i=uj.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Fn(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var s=e,l=t,o=l;e:for(;o!==null;){switch(o.tag){case 5:Nt=o.stateNode,_n=!1;break e;case 3:Nt=o.stateNode.containerInfo,_n=!0;break e;case 4:Nt=o.stateNode.containerInfo,_n=!0;break e}o=o.return}if(Nt===null)throw Error(Q(160));Gv(s,l,i),Nt=null,_n=!1;var u=i.alternate;u!==null&&(u.return=null),i.return=null}catch(c){nt(i,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Yv(t,e),t=t.sibling}function Yv(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Fn(t,e),nr(e),r&4){try{Zl(3,e,e.return),Du(3,e)}catch(g){nt(e,e.return,g)}try{Zl(5,e,e.return)}catch(g){nt(e,e.return,g)}}break;case 1:Fn(t,e),nr(e),r&512&&n!==null&&Is(n,n.return);break;case 5:if(Fn(t,e),nr(e),r&512&&n!==null&&Is(n,n.return),e.flags&32){var i=e.stateNode;try{oa(i,"")}catch(g){nt(e,e.return,g)}}if(r&4&&(i=e.stateNode,i!=null)){var s=e.memoizedProps,l=n!==null?n.memoizedProps:s,o=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{o==="input"&&s.type==="radio"&&s.name!=null&&yy(i,s),bd(o,l);var c=bd(o,s);for(l=0;l<u.length;l+=2){var d=u[l],h=u[l+1];d==="style"?jy(i,h):d==="dangerouslySetInnerHTML"?ky(i,h):d==="children"?oa(i,h):nf(i,d,h,c)}switch(o){case"input":xd(i,s);break;case"textarea":vy(i,s);break;case"select":var p=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var f=s.value;f!=null?Ds(i,!!s.multiple,f,!1):p!==!!s.multiple&&(s.defaultValue!=null?Ds(i,!!s.multiple,s.defaultValue,!0):Ds(i,!!s.multiple,s.multiple?[]:"",!1))}i[xa]=s}catch(g){nt(e,e.return,g)}}break;case 6:if(Fn(t,e),nr(e),r&4){if(e.stateNode===null)throw Error(Q(162));i=e.stateNode,s=e.memoizedProps;try{i.nodeValue=s}catch(g){nt(e,e.return,g)}}break;case 3:if(Fn(t,e),nr(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{ha(t.containerInfo)}catch(g){nt(e,e.return,g)}break;case 4:Fn(t,e),nr(e);break;case 13:Fn(t,e),nr(e),i=e.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(Ff=st())),r&4&&Um(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(At=(c=At)||d,Fn(t,e),At=c):Fn(t,e),nr(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!d&&e.mode&1)for(ne=e,d=e.child;d!==null;){for(h=ne=d;ne!==null;){switch(p=ne,f=p.child,p.tag){case 0:case 11:case 14:case 15:Zl(4,p,p.return);break;case 1:Is(p,p.return);var m=p.stateNode;if(typeof m.componentWillUnmount=="function"){r=p,n=p.return;try{t=r,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(g){nt(r,n,g)}}break;case 5:Is(p,p.return);break;case 22:if(p.memoizedState!==null){Wm(h);continue}}f!==null?(f.return=p,ne=f):Wm(h)}d=d.sibling}e:for(d=null,h=e;;){if(h.tag===5){if(d===null){d=h;try{i=h.stateNode,c?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(o=h.stateNode,u=h.memoizedProps.style,l=u!=null&&u.hasOwnProperty("display")?u.display:null,o.style.display=by("display",l))}catch(g){nt(e,e.return,g)}}}else if(h.tag===6){if(d===null)try{h.stateNode.nodeValue=c?"":h.memoizedProps}catch(g){nt(e,e.return,g)}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===e)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===e)break e;for(;h.sibling===null;){if(h.return===null||h.return===e)break e;d===h&&(d=null),h=h.return}d===h&&(d=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:Fn(t,e),nr(e),r&4&&Um(e);break;case 21:break;default:Fn(t,e),nr(e)}}function nr(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Kv(n)){var r=n;break e}n=n.return}throw Error(Q(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(oa(i,""),r.flags&=-33);var s=Bm(e);Jd(e,s,i);break;case 3:case 4:var l=r.stateNode.containerInfo,o=Bm(e);Xd(e,o,l);break;default:throw Error(Q(161))}}catch(u){nt(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function tj(e,t,n){ne=e,Xv(e)}function Xv(e,t,n){for(var r=(e.mode&1)!==0;ne!==null;){var i=ne,s=i.child;if(i.tag===22&&r){var l=i.memoizedState!==null||go;if(!l){var o=i.alternate,u=o!==null&&o.memoizedState!==null||At;o=go;var c=At;if(go=l,(At=u)&&!c)for(ne=i;ne!==null;)l=ne,u=l.child,l.tag===22&&l.memoizedState!==null?Vm(i):u!==null?(u.return=l,ne=u):Vm(i);for(;s!==null;)ne=s,Xv(s),s=s.sibling;ne=i,go=o,At=c}Hm(e)}else i.subtreeFlags&8772&&s!==null?(s.return=i,ne=s):Hm(e)}}function Hm(e){for(;ne!==null;){var t=ne;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:At||Du(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!At)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:Dn(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&Pm(t,s,r);break;case 3:var l=t.updateQueue;if(l!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Pm(t,l,n)}break;case 5:var o=t.stateNode;if(n===null&&t.flags&4){n=o;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 c=t.alternate;if(c!==null){var d=c.memoizedState;if(d!==null){var h=d.dehydrated;h!==null&&ha(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Q(163))}At||t.flags&512&&Yd(t)}catch(p){nt(t,t.return,p)}}if(t===e){ne=null;break}if(n=t.sibling,n!==null){n.return=t.return,ne=n;break}ne=t.return}}function Wm(e){for(;ne!==null;){var t=ne;if(t===e){ne=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ne=n;break}ne=t.return}}function Vm(e){for(;ne!==null;){var t=ne;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Du(4,t)}catch(u){nt(t,n,u)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(u){nt(t,i,u)}}var s=t.return;try{Yd(t)}catch(u){nt(t,s,u)}break;case 5:var l=t.return;try{Yd(t)}catch(u){nt(t,l,u)}}}catch(u){nt(t,t.return,u)}if(t===e){ne=null;break}var o=t.sibling;if(o!==null){o.return=t.return,ne=o;break}ne=t.return}}var nj=Math.ceil,ou=Or.ReactCurrentDispatcher,Af=Or.ReactCurrentOwner,Tn=Or.ReactCurrentBatchConfig,Re=0,vt=null,dt=null,Et=0,dn=0,Fs=bi(0),mt=0,ja=null,is=0,Ou=0,If=0,ea=null,Jt=null,Ff=0,hl=1/0,br=null,uu=!1,Zd=null,pi=null,xo=!1,ai=null,cu=0,ta=0,eh=null,Io=-1,Fo=0;function Ut(){return Re&6?st():Io!==-1?Io:Io=st()}function mi(e){return e.mode&1?Re&2&&Et!==0?Et&-Et:_b.transition!==null?(Fo===0&&(Fo=Iy()),Fo):(e=De,e!==0||(e=window.event,e=e===void 0?16:By(e.type)),e):1}function Hn(e,t,n,r){if(50<ta)throw ta=0,eh=null,Error(Q(185));Ia(e,n,r),(!(Re&2)||e!==vt)&&(e===vt&&(!(Re&2)&&(Ou|=n),mt===4&&Gr(e,Et)),rn(e,r),n===1&&Re===0&&!(t.mode&1)&&(hl=st()+500,Au&&ji()))}function rn(e,t){var n=e.callbackNode;_k(e,t);var r=Qo(e,e===vt?Et:0);if(r===0)n!==null&&tm(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&tm(n),t===1)e.tag===0?Ob(Qm.bind(null,e)):av(Qm.bind(null,e)),Ab(function(){!(Re&6)&&ji()}),n=null;else{switch(Fy(r)){case 1:n=of;break;case 4:n=zy;break;case 16:n=Vo;break;case 536870912:n=Ay;break;default:n=Vo}n=s1(n,Jv.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Jv(e,t){if(Io=-1,Fo=0,Re&6)throw Error(Q(327));var n=e.callbackNode;if(Bs()&&e.callbackNode!==n)return null;var r=Qo(e,e===vt?Et:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=du(e,r);else{t=r;var i=Re;Re|=2;var s=e1();(vt!==e||Et!==t)&&(br=null,hl=st()+500,Yi(e,t));do try{sj();break}catch(o){Zv(e,o)}while(!0);kf(),ou.current=s,Re=i,dt!==null?t=0:(vt=null,Et=0,t=mt)}if(t!==0){if(t===2&&(i=Ed(e),i!==0&&(r=i,t=th(e,i))),t===1)throw n=ja,Yi(e,0),Gr(e,r),rn(e,st()),n;if(t===6)Gr(e,r);else{if(i=e.current.alternate,!(r&30)&&!rj(i)&&(t=du(e,r),t===2&&(s=Ed(e),s!==0&&(r=s,t=th(e,s))),t===1))throw n=ja,Yi(e,0),Gr(e,r),rn(e,st()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(Q(345));case 2:zi(e,Jt,br);break;case 3:if(Gr(e,r),(r&130023424)===r&&(t=Ff+500-st(),10<t)){if(Qo(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){Ut(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Id(zi.bind(null,e,Jt,br),t);break}zi(e,Jt,br);break;case 4:if(Gr(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var l=31-Un(r);s=1<<l,l=t[l],l>i&&(i=l),r&=~s}if(r=i,r=st()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*nj(r/1960))-r,10<r){e.timeoutHandle=Id(zi.bind(null,e,Jt,br),r);break}zi(e,Jt,br);break;case 5:zi(e,Jt,br);break;default:throw Error(Q(329))}}}return rn(e,st()),e.callbackNode===n?Jv.bind(null,e):null}function th(e,t){var n=ea;return e.current.memoizedState.isDehydrated&&(Yi(e,t).flags|=256),e=du(e,t),e!==2&&(t=Jt,Jt=n,t!==null&&nh(t)),e}function nh(e){Jt===null?Jt=e:Jt.push.apply(Jt,e)}function rj(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],s=i.getSnapshot;i=i.value;try{if(!Qn(s(),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 Gr(e,t){for(t&=~If,t&=~Ou,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Un(t),r=1<<n;e[n]=-1,t&=~r}}function Qm(e){if(Re&6)throw Error(Q(327));Bs();var t=Qo(e,0);if(!(t&1))return rn(e,st()),null;var n=du(e,t);if(e.tag!==0&&n===2){var r=Ed(e);r!==0&&(t=r,n=th(e,r))}if(n===1)throw n=ja,Yi(e,0),Gr(e,t),rn(e,st()),n;if(n===6)throw Error(Q(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,zi(e,Jt,br),rn(e,st()),null}function Df(e,t){var n=Re;Re|=1;try{return e(t)}finally{Re=n,Re===0&&(hl=st()+500,Au&&ji())}}function ss(e){ai!==null&&ai.tag===0&&!(Re&6)&&Bs();var t=Re;Re|=1;var n=Tn.transition,r=De;try{if(Tn.transition=null,De=1,e)return e()}finally{De=r,Tn.transition=n,Re=t,!(Re&6)&&ji()}}function Of(){dn=Fs.current,We(Fs)}function Yi(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,zb(n)),dt!==null)for(n=dt.return;n!==null;){var r=n;switch(yf(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Jo();break;case 3:cl(),We(tn),We(It),Ef();break;case 5:Cf(r);break;case 4:cl();break;case 13:We(Ge);break;case 19:We(Ge);break;case 10:bf(r.type._context);break;case 22:case 23:Of()}n=n.return}if(vt=e,dt=e=gi(e.current,null),Et=dn=t,mt=0,ja=null,If=Ou=is=0,Jt=ea=null,Oi!==null){for(t=0;t<Oi.length;t++)if(n=Oi[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,s=n.pending;if(s!==null){var l=s.next;s.next=i,r.next=l}n.pending=r}Oi=null}return e}function Zv(e,t){do{var n=dt;try{if(kf(),Ro.current=au,lu){for(var r=Ye.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}lu=!1}if(rs=0,yt=pt=Ye=null,Jl=!1,wa=0,Af.current=null,n===null||n.return===null){mt=1,ja=t,dt=null;break}e:{var s=e,l=n.return,o=n,u=t;if(t=Et,o.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var c=u,d=o,h=d.tag;if(!(d.mode&1)&&(h===0||h===11||h===15)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var f=Am(l);if(f!==null){f.flags&=-257,Im(f,l,o,s,t),f.mode&1&&zm(s,c,t),t=f,u=c;var m=t.updateQueue;if(m===null){var g=new Set;g.add(u),t.updateQueue=g}else m.add(u);break e}else{if(!(t&1)){zm(s,c,t),_f();break e}u=Error(Q(426))}}else if(Qe&&o.mode&1){var k=Am(l);if(k!==null){!(k.flags&65536)&&(k.flags|=256),Im(k,l,o,s,t),vf(dl(u,o));break e}}s=u=dl(u,o),mt!==4&&(mt=2),ea===null?ea=[s]:ea.push(s),s=l;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var y=Fv(s,u,t);Em(s,y);break e;case 1:o=u;var x=s.type,v=s.stateNode;if(!(s.flags&128)&&(typeof x.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(pi===null||!pi.has(v)))){s.flags|=65536,t&=-t,s.lanes|=t;var j=Dv(s,o,t);Em(s,j);break e}}s=s.return}while(s!==null)}n1(n)}catch(E){t=E,dt===n&&n!==null&&(dt=n=n.return);continue}break}while(!0)}function e1(){var e=ou.current;return ou.current=au,e===null?au:e}function _f(){(mt===0||mt===3||mt===2)&&(mt=4),vt===null||!(is&268435455)&&!(Ou&268435455)||Gr(vt,Et)}function du(e,t){var n=Re;Re|=2;var r=e1();(vt!==e||Et!==t)&&(br=null,Yi(e,t));do try{ij();break}catch(i){Zv(e,i)}while(!0);if(kf(),Re=n,ou.current=r,dt!==null)throw Error(Q(261));return vt=null,Et=0,mt}function ij(){for(;dt!==null;)t1(dt)}function sj(){for(;dt!==null&&!Lk();)t1(dt)}function t1(e){var t=i1(e.alternate,e,dn);e.memoizedProps=e.pendingProps,t===null?n1(e):dt=t,Af.current=null}function n1(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Jb(n,t),n!==null){n.flags&=32767,dt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{mt=6,dt=null;return}}else if(n=Xb(n,t,dn),n!==null){dt=n;return}if(t=t.sibling,t!==null){dt=t;return}dt=t=e}while(t!==null);mt===0&&(mt=5)}function zi(e,t,n){var r=De,i=Tn.transition;try{Tn.transition=null,De=1,lj(e,t,n,r)}finally{Tn.transition=i,De=r}return null}function lj(e,t,n,r){do Bs();while(ai!==null);if(Re&6)throw Error(Q(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(Q(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if($k(e,s),e===vt&&(dt=vt=null,Et=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||xo||(xo=!0,s1(Vo,function(){return Bs(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=Tn.transition,Tn.transition=null;var l=De;De=1;var o=Re;Re|=4,Af.current=null,ej(e,n),Yv(n,e),Cb(zd),Ko=!!Rd,zd=Rd=null,e.current=n,tj(n),Mk(),Re=o,De=l,Tn.transition=s}else e.current=n;if(xo&&(xo=!1,ai=e,cu=i),s=e.pendingLanes,s===0&&(pi=null),Ak(n.stateNode),rn(e,st()),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(uu)throw uu=!1,e=Zd,Zd=null,e;return cu&1&&e.tag!==0&&Bs(),s=e.pendingLanes,s&1?e===eh?ta++:(ta=0,eh=e):ta=0,ji(),null}function Bs(){if(ai!==null){var e=Fy(cu),t=Tn.transition,n=De;try{if(Tn.transition=null,De=16>e?16:e,ai===null)var r=!1;else{if(e=ai,ai=null,cu=0,Re&6)throw Error(Q(331));var i=Re;for(Re|=4,ne=e.current;ne!==null;){var s=ne,l=s.child;if(ne.flags&16){var o=s.deletions;if(o!==null){for(var u=0;u<o.length;u++){var c=o[u];for(ne=c;ne!==null;){var d=ne;switch(d.tag){case 0:case 11:case 15:Zl(8,d,s)}var h=d.child;if(h!==null)h.return=d,ne=h;else for(;ne!==null;){d=ne;var p=d.sibling,f=d.return;if(Qv(d),d===c){ne=null;break}if(p!==null){p.return=f,ne=p;break}ne=f}}}var m=s.alternate;if(m!==null){var g=m.child;if(g!==null){m.child=null;do{var k=g.sibling;g.sibling=null,g=k}while(g!==null)}}ne=s}}if(s.subtreeFlags&2064&&l!==null)l.return=s,ne=l;else e:for(;ne!==null;){if(s=ne,s.flags&2048)switch(s.tag){case 0:case 11:case 15:Zl(9,s,s.return)}var y=s.sibling;if(y!==null){y.return=s.return,ne=y;break e}ne=s.return}}var x=e.current;for(ne=x;ne!==null;){l=ne;var v=l.child;if(l.subtreeFlags&2064&&v!==null)v.return=l,ne=v;else e:for(l=x;ne!==null;){if(o=ne,o.flags&2048)try{switch(o.tag){case 0:case 11:case 15:Du(9,o)}}catch(E){nt(o,o.return,E)}if(o===l){ne=null;break e}var j=o.sibling;if(j!==null){j.return=o.return,ne=j;break e}ne=o.return}}if(Re=i,ji(),dr&&typeof dr.onPostCommitFiberRoot=="function")try{dr.onPostCommitFiberRoot(Tu,e)}catch{}r=!0}return r}finally{De=n,Tn.transition=t}}return!1}function Km(e,t,n){t=dl(n,t),t=Fv(e,t,1),e=fi(e,t,1),t=Ut(),e!==null&&(Ia(e,1,t),rn(e,t))}function nt(e,t,n){if(e.tag===3)Km(e,e,n);else for(;t!==null;){if(t.tag===3){Km(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(pi===null||!pi.has(r))){e=dl(n,e),e=Dv(t,e,1),t=fi(t,e,1),e=Ut(),t!==null&&(Ia(t,1,e),rn(t,e));break}}t=t.return}}function aj(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Ut(),e.pingedLanes|=e.suspendedLanes&n,vt===e&&(Et&n)===n&&(mt===4||mt===3&&(Et&130023424)===Et&&500>st()-Ff?Yi(e,0):If|=n),rn(e,t)}function r1(e,t){t===0&&(e.mode&1?(t=lo,lo<<=1,!(lo&130023424)&&(lo=4194304)):t=1);var n=Ut();e=Ar(e,t),e!==null&&(Ia(e,t,n),rn(e,n))}function oj(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),r1(e,n)}function uj(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(Q(314))}r!==null&&r.delete(t),r1(e,n)}var i1;i1=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||tn.current)en=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return en=!1,Yb(e,t,n);en=!!(e.flags&131072)}else en=!1,Qe&&t.flags&1048576&&ov(t,tu,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ao(e,t),e=t.pendingProps;var i=al(t,It.current);qs(t,n),i=Tf(null,t,r,e,i,n);var s=Lf();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,nn(r)?(s=!0,Zo(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Nf(t),i.updater=Fu,t.stateNode=i,i._reactInternals=t,Bd(t,r,e,n),t=Wd(null,t,r,!0,s,n)):(t.tag=0,Qe&&s&&xf(t),Bt(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ao(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=dj(r),e=Dn(r,e),i){case 0:t=Hd(null,t,r,e,n);break e;case 1:t=Om(null,t,r,e,n);break e;case 11:t=Fm(null,t,r,e,n);break e;case 14:t=Dm(null,t,r,Dn(r.type,e),n);break e}throw Error(Q(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Dn(r,i),Hd(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Dn(r,i),Om(e,t,r,i,n);case 3:e:{if(qv(t),e===null)throw Error(Q(387));r=t.pendingProps,s=t.memoizedState,i=s.element,pv(e,t),iu(t,r,null,n);var l=t.memoizedState;if(r=l.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=dl(Error(Q(423)),t),t=_m(e,t,r,n,i);break e}else if(r!==i){i=dl(Error(Q(424)),t),t=_m(e,t,r,n,i);break e}else for(fn=hi(t.stateNode.containerInfo.firstChild),pn=t,Qe=!0,qn=null,n=hv(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ol(),r===i){t=Ir(e,t,n);break e}Bt(e,t,r,n)}t=t.child}return t;case 5:return mv(t),e===null&&_d(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,l=i.children,Ad(r,i)?l=null:s!==null&&Ad(r,s)&&(t.flags|=32),$v(e,t),Bt(e,t,l,n),t.child;case 6:return e===null&&_d(t),null;case 13:return Bv(e,t,n);case 4:return Sf(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ul(t,null,r,n):Bt(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Dn(r,i),Fm(e,t,r,i,n);case 7:return Bt(e,t,t.pendingProps,n),t.child;case 8:return Bt(e,t,t.pendingProps.children,n),t.child;case 12:return Bt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,s=t.memoizedProps,l=i.value,Ue(nu,r._currentValue),r._currentValue=l,s!==null)if(Qn(s.value,l)){if(s.children===i.children&&!tn.current){t=Ir(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var o=s.dependencies;if(o!==null){l=s.child;for(var u=o.firstContext;u!==null;){if(u.context===r){if(s.tag===1){u=Pr(-1,n&-n),u.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?u.next=u:(u.next=d.next,d.next=u),c.pending=u}}s.lanes|=n,u=s.alternate,u!==null&&(u.lanes|=n),$d(s.return,n,t),o.lanes|=n;break}u=u.next}}else if(s.tag===10)l=s.type===t.type?null:s.child;else if(s.tag===18){if(l=s.return,l===null)throw Error(Q(341));l.lanes|=n,o=l.alternate,o!==null&&(o.lanes|=n),$d(l,n,t),l=s.sibling}else l=s.child;if(l!==null)l.return=s;else for(l=s;l!==null;){if(l===t){l=null;break}if(s=l.sibling,s!==null){s.return=l.return,l=s;break}l=l.return}s=l}Bt(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,qs(t,n),i=Ln(i),r=r(i),t.flags|=1,Bt(e,t,r,n),t.child;case 14:return r=t.type,i=Dn(r,t.pendingProps),i=Dn(r.type,i),Dm(e,t,r,i,n);case 15:return Ov(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Dn(r,i),Ao(e,t),t.tag=1,nn(r)?(e=!0,Zo(t)):e=!1,qs(t,n),Iv(t,r,i),Bd(t,r,i,n),Wd(null,t,r,!0,e,n);case 19:return Uv(e,t,n);case 22:return _v(e,t,n)}throw Error(Q(156,t.tag))};function s1(e,t){return Ry(e,t)}function cj(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 Pn(e,t,n,r){return new cj(e,t,n,r)}function $f(e){return e=e.prototype,!(!e||!e.isReactComponent)}function dj(e){if(typeof e=="function")return $f(e)?1:0;if(e!=null){if(e=e.$$typeof,e===sf)return 11;if(e===lf)return 14}return 2}function gi(e,t){var n=e.alternate;return n===null?(n=Pn(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 Do(e,t,n,r,i,s){var l=2;if(r=e,typeof e=="function")$f(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case Cs:return Xi(n.children,i,s,t);case rf:l=8,i|=8;break;case hd:return e=Pn(12,n,t,i|2),e.elementType=hd,e.lanes=s,e;case fd:return e=Pn(13,n,t,i),e.elementType=fd,e.lanes=s,e;case pd:return e=Pn(19,n,t,i),e.elementType=pd,e.lanes=s,e;case my:return _u(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case fy:l=10;break e;case py:l=9;break e;case sf:l=11;break e;case lf:l=14;break e;case Vr:l=16,r=null;break e}throw Error(Q(130,e==null?e:typeof e,""))}return t=Pn(l,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function Xi(e,t,n,r){return e=Pn(7,e,r,t),e.lanes=n,e}function _u(e,t,n,r){return e=Pn(22,e,r,t),e.elementType=my,e.lanes=n,e.stateNode={isHidden:!1},e}function Oc(e,t,n){return e=Pn(6,e,null,t),e.lanes=n,e}function _c(e,t,n){return t=Pn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function hj(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=vc(0),this.expirationTimes=vc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vc(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function qf(e,t,n,r,i,s,l,o,u){return e=new hj(e,t,n,o,u),t===1?(t=1,s===!0&&(t|=8)):t=0,s=Pn(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Nf(s),e}function fj(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ss,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function l1(e){if(!e)return yi;e=e._reactInternals;e:{if(fs(e)!==e||e.tag!==1)throw Error(Q(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(nn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(Q(171))}if(e.tag===1){var n=e.type;if(nn(n))return lv(e,n,t)}return t}function a1(e,t,n,r,i,s,l,o,u){return e=qf(n,r,!0,e,i,s,l,o,u),e.context=l1(null),n=e.current,r=Ut(),i=mi(n),s=Pr(r,i),s.callback=t??null,fi(n,s,i),e.current.lanes=i,Ia(e,i,r),rn(e,r),e}function $u(e,t,n,r){var i=t.current,s=Ut(),l=mi(i);return n=l1(n),t.context===null?t.context=n:t.pendingContext=n,t=Pr(s,l),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=fi(i,t,l),e!==null&&(Hn(e,i,l,s),Mo(e,i,l)),l}function hu(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 Gm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Bf(e,t){Gm(e,t),(e=e.alternate)&&Gm(e,t)}function pj(){return null}var o1=typeof reportError=="function"?reportError:function(e){console.error(e)};function Uf(e){this._internalRoot=e}qu.prototype.render=Uf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Q(409));$u(e,t,null,null)};qu.prototype.unmount=Uf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ss(function(){$u(null,e,null,null)}),t[zr]=null}};function qu(e){this._internalRoot=e}qu.prototype.unstable_scheduleHydration=function(e){if(e){var t=_y();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Kr.length&&t!==0&&t<Kr[n].priority;n++);Kr.splice(n,0,e),n===0&&qy(e)}};function Hf(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Bu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Ym(){}function mj(e,t,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var c=hu(l);s.call(c)}}var l=a1(t,r,e,0,null,!1,!1,"",Ym);return e._reactRootContainer=l,e[zr]=l.current,ma(e.nodeType===8?e.parentNode:e),ss(),l}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var o=r;r=function(){var c=hu(u);o.call(c)}}var u=qf(e,0,!1,null,null,!1,!1,"",Ym);return e._reactRootContainer=u,e[zr]=u.current,ma(e.nodeType===8?e.parentNode:e),ss(function(){$u(t,u,n,r)}),u}function Uu(e,t,n,r,i){var s=n._reactRootContainer;if(s){var l=s;if(typeof i=="function"){var o=i;i=function(){var u=hu(l);o.call(u)}}$u(t,l,e,i)}else l=mj(n,t,e,i,r);return hu(l)}Dy=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Ul(t.pendingLanes);n!==0&&(uf(t,n|1),rn(t,st()),!(Re&6)&&(hl=st()+500,ji()))}break;case 13:ss(function(){var r=Ar(e,1);if(r!==null){var i=Ut();Hn(r,e,1,i)}}),Bf(e,1)}};cf=function(e){if(e.tag===13){var t=Ar(e,134217728);if(t!==null){var n=Ut();Hn(t,e,134217728,n)}Bf(e,134217728)}};Oy=function(e){if(e.tag===13){var t=mi(e),n=Ar(e,t);if(n!==null){var r=Ut();Hn(n,e,t,r)}Bf(e,t)}};_y=function(){return De};$y=function(e,t){var n=De;try{return De=e,t()}finally{De=n}};Nd=function(e,t,n){switch(t){case"input":if(xd(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=zu(r);if(!i)throw Error(Q(90));xy(r),xd(r,i)}}}break;case"textarea":vy(e,n);break;case"select":t=n.value,t!=null&&Ds(e,!!n.multiple,t,!1)}};Cy=Df;Ey=ss;var gj={usingClientEntryPoint:!1,Events:[Da,Ls,zu,Ny,Sy,Df]},Al={findFiberByHostInstance:Di,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},xj={bundleType:Al.bundleType,version:Al.version,rendererPackageName:Al.rendererPackageName,rendererConfig:Al.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Or.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Ly(e),e===null?null:e.stateNode},findFiberByHostInstance:Al.findFiberByHostInstance||pj,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 yo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!yo.isDisabled&&yo.supportsFiber)try{Tu=yo.inject(xj),dr=yo}catch{}}xn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=gj;xn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Hf(t))throw Error(Q(200));return fj(e,t,null,n)};xn.createRoot=function(e,t){if(!Hf(e))throw Error(Q(299));var n=!1,r="",i=o1;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=qf(e,1,!1,null,null,n,!1,r,i),e[zr]=t.current,ma(e.nodeType===8?e.parentNode:e),new Uf(t)};xn.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(Q(188)):(e=Object.keys(e).join(","),Error(Q(268,e)));return e=Ly(t),e=e===null?null:e.stateNode,e};xn.flushSync=function(e){return ss(e)};xn.hydrate=function(e,t,n){if(!Bu(t))throw Error(Q(200));return Uu(null,e,t,!0,n)};xn.hydrateRoot=function(e,t,n){if(!Hf(e))throw Error(Q(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",l=o1;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(l=n.onRecoverableError)),t=a1(t,null,e,1,n??null,i,!1,s,l),e[zr]=t.current,ma(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 qu(t)};xn.render=function(e,t,n){if(!Bu(t))throw Error(Q(200));return Uu(null,e,t,!1,n)};xn.unmountComponentAtNode=function(e){if(!Bu(e))throw Error(Q(40));return e._reactRootContainer?(ss(function(){Uu(null,null,e,!1,function(){e._reactRootContainer=null,e[zr]=null})}),!0):!1};xn.unstable_batchedUpdates=Df;xn.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Bu(n))throw Error(Q(200));if(e==null||e._reactInternals===void 0)throw Error(Q(38));return Uu(e,t,n,!1,r)};xn.version="18.3.1-next-f1338f8080-20240426";function u1(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(u1)}catch(e){console.error(e)}}u1(),uy.exports=xn;var Wf=uy.exports;const yj=Gh(Wf),vj=Qx({__proto__:null,default:yj},[Wf]);var c1,Xm=Wf;c1=Xm.createRoot,Xm.hydrateRoot;var ps=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ls=typeof window>"u"||"Deno"in globalThis;function Nn(){}function wj(e,t){return typeof e=="function"?e(t):e}function rh(e){return typeof e=="number"&&e>=0&&e!==1/0}function d1(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Us(e,t){return typeof e=="function"?e(t):e}function Bn(e,t){return typeof e=="function"?e(t):e}function Jm(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:l,stale:o}=e;if(l){if(r){if(t.queryHash!==Vf(l,t.options))return!1}else if(!Na(t.queryKey,l))return!1}if(n!=="all"){const u=t.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof o=="boolean"&&t.isStale()!==o||i&&i!==t.state.fetchStatus||s&&!s(t))}function Zm(e,t){const{exact:n,status:r,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(as(t.options.mutationKey)!==as(s))return!1}else if(!Na(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Vf(e,t){return((t==null?void 0:t.queryKeyHashFn)||as)(e)}function as(e){return JSON.stringify(e,(t,n)=>ih(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Na(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Na(e[n],t[n])):!1}function Qf(e,t){if(e===t)return e;const n=eg(e)&&eg(t);if(n||ih(e)&&ih(t)){const r=n?e:Object.keys(e),i=r.length,s=n?t:Object.keys(t),l=s.length,o=n?[]:{};let u=0;for(let c=0;c<l;c++){const d=n?c:s[c];(!n&&r.includes(d)||n)&&e[d]===void 0&&t[d]===void 0?(o[d]=void 0,u++):(o[d]=Qf(e[d],t[d]),o[d]===e[d]&&e[d]!==void 0&&u++)}return i===l&&u===i?e:o}return t}function fu(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function eg(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ih(e){if(!tg(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!tg(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function tg(e){return Object.prototype.toString.call(e)==="[object Object]"}function kj(e){return new Promise(t=>{setTimeout(t,e)})}function sh(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Qf(e,t):t}function bj(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function jj(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Kf=Symbol();function h1(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Kf?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Bi,Yr,Ws,Fx,Nj=(Fx=class extends ps{constructor(){super();oe(this,Bi);oe(this,Yr);oe(this,Ws);Y(this,Ws,t=>{if(!ls&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){T(this,Yr)||this.setEventListener(T(this,Ws))}onUnsubscribe(){var t;this.hasListeners()||((t=T(this,Yr))==null||t.call(this),Y(this,Yr,void 0))}setEventListener(t){var n;Y(this,Ws,t),(n=T(this,Yr))==null||n.call(this),Y(this,Yr,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){T(this,Bi)!==t&&(Y(this,Bi,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof T(this,Bi)=="boolean"?T(this,Bi):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Bi=new WeakMap,Yr=new WeakMap,Ws=new WeakMap,Fx),Gf=new Nj,Vs,Xr,Qs,Dx,Sj=(Dx=class extends ps{constructor(){super();oe(this,Vs,!0);oe(this,Xr);oe(this,Qs);Y(this,Qs,t=>{if(!ls&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){T(this,Xr)||this.setEventListener(T(this,Qs))}onUnsubscribe(){var t;this.hasListeners()||((t=T(this,Xr))==null||t.call(this),Y(this,Xr,void 0))}setEventListener(t){var n;Y(this,Qs,t),(n=T(this,Xr))==null||n.call(this),Y(this,Xr,t(this.setOnline.bind(this)))}setOnline(t){T(this,Vs)!==t&&(Y(this,Vs,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return T(this,Vs)}},Vs=new WeakMap,Xr=new WeakMap,Qs=new WeakMap,Dx),pu=new Sj;function lh(){let e,t;const n=new Promise((i,s)=>{e=i,t=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}function Cj(e){return Math.min(1e3*2**e,3e4)}function f1(e){return(e??"online")==="online"?pu.isOnline():!0}var p1=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function $c(e){return e instanceof p1}function m1(e){let t=!1,n=0,r=!1,i;const s=lh(),l=g=>{var k;r||(p(new p1(g)),(k=e.abort)==null||k.call(e))},o=()=>{t=!0},u=()=>{t=!1},c=()=>Gf.isFocused()&&(e.networkMode==="always"||pu.isOnline())&&e.canRun(),d=()=>f1(e.networkMode)&&e.canRun(),h=g=>{var k;r||(r=!0,(k=e.onSuccess)==null||k.call(e,g),i==null||i(),s.resolve(g))},p=g=>{var k;r||(r=!0,(k=e.onError)==null||k.call(e,g),i==null||i(),s.reject(g))},f=()=>new Promise(g=>{var k;i=y=>{(r||c())&&g(y)},(k=e.onPause)==null||k.call(e)}).then(()=>{var g;i=void 0,r||(g=e.onContinue)==null||g.call(e)}),m=()=>{if(r)return;let g;const k=n===0?e.initialPromise:void 0;try{g=k??e.fn()}catch(y){g=Promise.reject(y)}Promise.resolve(g).then(h).catch(y=>{var w;if(r)return;const x=e.retry??(ls?0:3),v=e.retryDelay??Cj,j=typeof v=="function"?v(n,y):v,E=x===!0||typeof x=="number"&&n<x||typeof x=="function"&&x(n,y);if(t||!E){p(y);return}n++,(w=e.onFail)==null||w.call(e,n,y),kj(j).then(()=>c()?void 0:f()).then(()=>{t?p(y):m()})})};return{promise:s,cancel:l,continue:()=>(i==null||i(),s),cancelRetry:o,continueRetry:u,canStart:d,start:()=>(d()?m():f().then(m),s)}}function Ej(){let e=[],t=0,n=o=>{o()},r=o=>{o()},i=o=>setTimeout(o,0);const s=o=>{t?e.push(o):i(()=>{n(o)})},l=()=>{const o=e;e=[],o.length&&i(()=>{r(()=>{o.forEach(u=>{n(u)})})})};return{batch:o=>{let u;t++;try{u=o()}finally{t--,t||l()}return u},batchCalls:o=>(...u)=>{s(()=>{o(...u)})},schedule:s,setNotifyFunction:o=>{n=o},setBatchNotifyFunction:o=>{r=o},setScheduler:o=>{i=o}}}var rt=Ej(),Ui,Ox,g1=(Ox=class{constructor(){oe(this,Ui)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),rh(this.gcTime)&&Y(this,Ui,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ls?1/0:5*60*1e3))}clearGcTimeout(){T(this,Ui)&&(clearTimeout(T(this,Ui)),Y(this,Ui,void 0))}},Ui=new WeakMap,Ox),Ks,Gs,kn,zt,Pa,Hi,On,kr,_x,Pj=(_x=class extends g1{constructor(t){super();oe(this,On);oe(this,Ks);oe(this,Gs);oe(this,kn);oe(this,zt);oe(this,Pa);oe(this,Hi);Y(this,Hi,!1),Y(this,Pa,t.defaultOptions),this.setOptions(t.options),this.observers=[],Y(this,kn,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Y(this,Ks,Tj(this.options)),this.state=t.state??T(this,Ks),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=T(this,zt))==null?void 0:t.promise}setOptions(t){this.options={...T(this,Pa),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&T(this,kn).remove(this)}setData(t,n){const r=sh(this.state.data,t,this.options);return de(this,On,kr).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){de(this,On,kr).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=T(this,zt))==null?void 0:r.promise;return(i=T(this,zt))==null||i.cancel(t),n?n.then(Nn).catch(Nn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(T(this,Ks))}isActive(){return this.observers.some(t=>Bn(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Kf||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!d1(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=T(this,zt))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=T(this,zt))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),T(this,kn).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(T(this,zt)&&(T(this,Hi)?T(this,zt).cancel({revert:!0}):T(this,zt).cancelRetry()),this.scheduleGc()),T(this,kn).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||de(this,On,kr).call(this,{type:"invalidate"})}fetch(t,n){var u,c,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(T(this,zt))return T(this,zt).continueRetry(),T(this,zt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const h=this.observers.find(p=>p.options.queryFn);h&&this.setOptions(h.options)}const r=new AbortController,i=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(Y(this,Hi,!0),r.signal)})},s=()=>{const h=h1(this.options,n),p={queryKey:this.queryKey,meta:this.meta};return i(p),Y(this,Hi,!1),this.options.persister?this.options.persister(h,p,this):h(p)},l={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};i(l),(u=this.options.behavior)==null||u.onFetch(l,this),Y(this,Gs,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=l.fetchOptions)==null?void 0:c.meta))&&de(this,On,kr).call(this,{type:"fetch",meta:(d=l.fetchOptions)==null?void 0:d.meta});const o=h=>{var p,f,m,g;$c(h)&&h.silent||de(this,On,kr).call(this,{type:"error",error:h}),$c(h)||((f=(p=T(this,kn).config).onError)==null||f.call(p,h,this),(g=(m=T(this,kn).config).onSettled)==null||g.call(m,this.state.data,h,this)),this.scheduleGc()};return Y(this,zt,m1({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,abort:r.abort.bind(r),onSuccess:h=>{var p,f,m,g;if(h===void 0){o(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(h)}catch(k){o(k);return}(f=(p=T(this,kn).config).onSuccess)==null||f.call(p,h,this),(g=(m=T(this,kn).config).onSettled)==null||g.call(m,h,this.state.error,this),this.scheduleGc()},onError:o,onFail:(h,p)=>{de(this,On,kr).call(this,{type:"failed",failureCount:h,error:p})},onPause:()=>{de(this,On,kr).call(this,{type:"pause"})},onContinue:()=>{de(this,On,kr).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0})),T(this,zt).start()}},Ks=new WeakMap,Gs=new WeakMap,kn=new WeakMap,zt=new WeakMap,Pa=new WeakMap,Hi=new WeakMap,On=new WeakSet,kr=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...x1(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return $c(i)&&i.revert&&T(this,Gs)?{...T(this,Gs),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),rt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),T(this,kn).notify({query:this,type:"updated",action:t})})},_x);function x1(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:f1(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Tj(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var sr,$x,Lj=($x=class extends ps{constructor(t={}){super();oe(this,sr);this.config=t,Y(this,sr,new Map)}build(t,n,r){const i=n.queryKey,s=n.queryHash??Vf(i,n);let l=this.get(s);return l||(l=new Pj({cache:this,queryKey:i,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(l)),l}add(t){T(this,sr).has(t.queryHash)||(T(this,sr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=T(this,sr).get(t.queryHash);n&&(t.destroy(),n===t&&T(this,sr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){rt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return T(this,sr).get(t)}getAll(){return[...T(this,sr).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Jm(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Jm(t,r)):n}notify(t){rt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){rt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){rt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},sr=new WeakMap,$x),lr,$t,Wi,ar,Hr,qx,Mj=(qx=class extends g1{constructor(t){super();oe(this,ar);oe(this,lr);oe(this,$t);oe(this,Wi);this.mutationId=t.mutationId,Y(this,$t,t.mutationCache),Y(this,lr,[]),this.state=t.state||y1(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){T(this,lr).includes(t)||(T(this,lr).push(t),this.clearGcTimeout(),T(this,$t).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Y(this,lr,T(this,lr).filter(n=>n!==t)),this.scheduleGc(),T(this,$t).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){T(this,lr).length||(this.state.status==="pending"?this.scheduleGc():T(this,$t).remove(this))}continue(){var t;return((t=T(this,Wi))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,s,l,o,u,c,d,h,p,f,m,g,k,y,x,v,j,E,w,N;Y(this,Wi,m1({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(M,F)=>{de(this,ar,Hr).call(this,{type:"failed",failureCount:M,error:F})},onPause:()=>{de(this,ar,Hr).call(this,{type:"pause"})},onContinue:()=>{de(this,ar,Hr).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>T(this,$t).canRun(this)}));const n=this.state.status==="pending",r=!T(this,Wi).canStart();try{if(!n){de(this,ar,Hr).call(this,{type:"pending",variables:t,isPaused:r}),await((s=(i=T(this,$t).config).onMutate)==null?void 0:s.call(i,t,this));const F=await((o=(l=this.options).onMutate)==null?void 0:o.call(l,t));F!==this.state.context&&de(this,ar,Hr).call(this,{type:"pending",context:F,variables:t,isPaused:r})}const M=await T(this,Wi).start();return await((c=(u=T(this,$t).config).onSuccess)==null?void 0:c.call(u,M,t,this.state.context,this)),await((h=(d=this.options).onSuccess)==null?void 0:h.call(d,M,t,this.state.context)),await((f=(p=T(this,$t).config).onSettled)==null?void 0:f.call(p,M,null,this.state.variables,this.state.context,this)),await((g=(m=this.options).onSettled)==null?void 0:g.call(m,M,null,t,this.state.context)),de(this,ar,Hr).call(this,{type:"success",data:M}),M}catch(M){try{throw await((y=(k=T(this,$t).config).onError)==null?void 0:y.call(k,M,t,this.state.context,this)),await((v=(x=this.options).onError)==null?void 0:v.call(x,M,t,this.state.context)),await((E=(j=T(this,$t).config).onSettled)==null?void 0:E.call(j,void 0,M,this.state.variables,this.state.context,this)),await((N=(w=this.options).onSettled)==null?void 0:N.call(w,void 0,M,t,this.state.context)),M}finally{de(this,ar,Hr).call(this,{type:"error",error:M})}}finally{T(this,$t).runNext(this)}}},lr=new WeakMap,$t=new WeakMap,Wi=new WeakMap,ar=new WeakSet,Hr=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),rt.batch(()=>{T(this,lr).forEach(r=>{r.onMutationUpdate(t)}),T(this,$t).notify({mutation:this,type:"updated",action:t})})},qx);function y1(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var cn,Ta,Bx,Rj=(Bx=class extends ps{constructor(t={}){super();oe(this,cn);oe(this,Ta);this.config=t,Y(this,cn,new Map),Y(this,Ta,Date.now())}build(t,n,r){const i=new Mj({mutationCache:this,mutationId:++eo(this,Ta)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){const n=vo(t),r=T(this,cn).get(n)??[];r.push(t),T(this,cn).set(n,r),this.notify({type:"added",mutation:t})}remove(t){var r;const n=vo(t);if(T(this,cn).has(n)){const i=(r=T(this,cn).get(n))==null?void 0:r.filter(s=>s!==t);i&&(i.length===0?T(this,cn).delete(n):T(this,cn).set(n,i))}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=(r=T(this,cn).get(vo(t)))==null?void 0:r.find(i=>i.state.status==="pending");return!n||n===t}runNext(t){var r;const n=(r=T(this,cn).get(vo(t)))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}clear(){rt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}getAll(){return[...T(this,cn).values()].flat()}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Zm(n,r))}findAll(t={}){return this.getAll().filter(n=>Zm(t,n))}notify(t){rt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return rt.batch(()=>Promise.all(t.map(n=>n.continue().catch(Nn))))}},cn=new WeakMap,Ta=new WeakMap,Bx);function vo(e){var t;return((t=e.options.scope)==null?void 0:t.id)??String(e.mutationId)}function ng(e){return{onFetch:(t,n)=>{var d,h,p,f,m;const r=t.options,i=(p=(h=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:h.fetchMore)==null?void 0:p.direction,s=((f=t.state.data)==null?void 0:f.pages)||[],l=((m=t.state.data)==null?void 0:m.pageParams)||[];let o={pages:[],pageParams:[]},u=0;const c=async()=>{let g=!1;const k=v=>{Object.defineProperty(v,"signal",{enumerable:!0,get:()=>(t.signal.aborted?g=!0:t.signal.addEventListener("abort",()=>{g=!0}),t.signal)})},y=h1(t.options,t.fetchOptions),x=async(v,j,E)=>{if(g)return Promise.reject();if(j==null&&v.pages.length)return Promise.resolve(v);const w={queryKey:t.queryKey,pageParam:j,direction:E?"backward":"forward",meta:t.options.meta};k(w);const N=await y(w),{maxPages:M}=t.options,F=E?jj:bj;return{pages:F(v.pages,N,M),pageParams:F(v.pageParams,j,M)}};if(i&&s.length){const v=i==="backward",j=v?zj:rg,E={pages:s,pageParams:l},w=j(r,E);o=await x(E,w,v)}else{const v=e??s.length;do{const j=u===0?l[0]??r.initialPageParam:rg(r,o);if(u>0&&j==null)break;o=await x(o,j),u++}while(u<v)}return o};t.options.persister?t.fetchFn=()=>{var g,k;return(k=(g=t.options).persister)==null?void 0:k.call(g,c,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function rg(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function zj(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var tt,Jr,Zr,Ys,Xs,ei,Js,Zs,Ux,Aj=(Ux=class{constructor(e={}){oe(this,tt);oe(this,Jr);oe(this,Zr);oe(this,Ys);oe(this,Xs);oe(this,ei);oe(this,Js);oe(this,Zs);Y(this,tt,e.queryCache||new Lj),Y(this,Jr,e.mutationCache||new Rj),Y(this,Zr,e.defaultOptions||{}),Y(this,Ys,new Map),Y(this,Xs,new Map),Y(this,ei,0)}mount(){eo(this,ei)._++,T(this,ei)===1&&(Y(this,Js,Gf.subscribe(async e=>{e&&(await this.resumePausedMutations(),T(this,tt).onFocus())})),Y(this,Zs,pu.subscribe(async e=>{e&&(await this.resumePausedMutations(),T(this,tt).onOnline())})))}unmount(){var e,t;eo(this,ei)._--,T(this,ei)===0&&((e=T(this,Js))==null||e.call(this),Y(this,Js,void 0),(t=T(this,Zs))==null||t.call(this),Y(this,Zs,void 0))}isFetching(e){return T(this,tt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return T(this,Jr).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=T(this,tt).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=T(this,tt).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Us(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return T(this,tt).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=T(this,tt).get(r.queryHash),s=i==null?void 0:i.state.data,l=wj(t,s);if(l!==void 0)return T(this,tt).build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return rt.batch(()=>T(this,tt).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=T(this,tt).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=T(this,tt);rt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=T(this,tt),r={type:"active",...e};return rt.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(r,t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=rt.batch(()=>T(this,tt).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Nn).catch(Nn)}invalidateQueries(e,t={}){return rt.batch(()=>{if(T(this,tt).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none")return Promise.resolve();const n={...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"};return this.refetchQueries(n,t)})}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=rt.batch(()=>T(this,tt).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(Nn)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Nn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=T(this,tt).build(this,t);return n.isStaleByTime(Us(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Nn).catch(Nn)}fetchInfiniteQuery(e){return e.behavior=ng(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Nn).catch(Nn)}ensureInfiniteQueryData(e){return e.behavior=ng(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return pu.isOnline()?T(this,Jr).resumePausedMutations():Promise.resolve()}getQueryCache(){return T(this,tt)}getMutationCache(){return T(this,Jr)}getDefaultOptions(){return T(this,Zr)}setDefaultOptions(e){Y(this,Zr,e)}setQueryDefaults(e,t){T(this,Ys).set(as(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...T(this,Ys).values()],n={};return t.forEach(r=>{Na(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){T(this,Xs).set(as(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...T(this,Xs).values()];let n={};return t.forEach(r=>{Na(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...T(this,Zr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Vf(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Kf&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...T(this,Zr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){T(this,tt).clear(),T(this,Jr).clear()}},tt=new WeakMap,Jr=new WeakMap,Zr=new WeakMap,Ys=new WeakMap,Xs=new WeakMap,ei=new WeakMap,Js=new WeakMap,Zs=new WeakMap,Ux),Gt,Te,La,qt,Vi,el,ti,or,Ma,tl,nl,Qi,Ki,ni,rl,Fe,Wl,ah,oh,uh,ch,dh,hh,fh,v1,Hx,Yf=(Hx=class extends ps{constructor(t,n){super();oe(this,Fe);oe(this,Gt);oe(this,Te);oe(this,La);oe(this,qt);oe(this,Vi);oe(this,el);oe(this,ti);oe(this,or);oe(this,Ma);oe(this,tl);oe(this,nl);oe(this,Qi);oe(this,Ki);oe(this,ni);oe(this,rl,new Set);this.options=n,Y(this,Gt,t),Y(this,or,null),Y(this,ti,lh()),this.options.experimental_prefetchInRender||T(this,ti).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(T(this,Te).addObserver(this),ig(T(this,Te),this.options)?de(this,Fe,Wl).call(this):this.updateResult(),de(this,Fe,ch).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ph(T(this,Te),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ph(T(this,Te),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,de(this,Fe,dh).call(this),de(this,Fe,hh).call(this),T(this,Te).removeObserver(this)}setOptions(t,n){const r=this.options,i=T(this,Te);if(this.options=T(this,Gt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Bn(this.options.enabled,T(this,Te))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");de(this,Fe,fh).call(this),T(this,Te).setOptions(this.options),r._defaulted&&!fu(this.options,r)&&T(this,Gt).getQueryCache().notify({type:"observerOptionsUpdated",query:T(this,Te),observer:this});const s=this.hasListeners();s&&sg(T(this,Te),i,this.options,r)&&de(this,Fe,Wl).call(this),this.updateResult(n),s&&(T(this,Te)!==i||Bn(this.options.enabled,T(this,Te))!==Bn(r.enabled,T(this,Te))||Us(this.options.staleTime,T(this,Te))!==Us(r.staleTime,T(this,Te)))&&de(this,Fe,ah).call(this);const l=de(this,Fe,oh).call(this);s&&(T(this,Te)!==i||Bn(this.options.enabled,T(this,Te))!==Bn(r.enabled,T(this,Te))||l!==T(this,ni))&&de(this,Fe,uh).call(this,l)}getOptimisticResult(t){const n=T(this,Gt).getQueryCache().build(T(this,Gt),t),r=this.createResult(n,t);return Fj(this,r)&&(Y(this,qt,r),Y(this,el,this.options),Y(this,Vi,T(this,Te).state)),r}getCurrentResult(){return T(this,qt)}trackResult(t,n){const r={};return Object.keys(t).forEach(i=>{Object.defineProperty(r,i,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(i),n==null||n(i),t[i])})}),r}trackProp(t){T(this,rl).add(t)}getCurrentQuery(){return T(this,Te)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=T(this,Gt).defaultQueryOptions(t),r=T(this,Gt).getQueryCache().build(T(this,Gt),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return de(this,Fe,Wl).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),T(this,qt)))}createResult(t,n){var M;const r=T(this,Te),i=this.options,s=T(this,qt),l=T(this,Vi),o=T(this,el),c=t!==r?t.state:T(this,La),{state:d}=t;let h={...d},p=!1,f;if(n._optimisticResults){const F=this.hasListeners(),C=!F&&ig(t,n),O=F&&sg(t,r,n,i);(C||O)&&(h={...h,...x1(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:m,errorUpdatedAt:g,status:k}=h;if(n.select&&h.data!==void 0)if(s&&h.data===(l==null?void 0:l.data)&&n.select===T(this,Ma))f=T(this,tl);else try{Y(this,Ma,n.select),f=n.select(h.data),f=sh(s==null?void 0:s.data,f,n),Y(this,tl,f),Y(this,or,null)}catch(F){Y(this,or,F)}else f=h.data;if(n.placeholderData!==void 0&&f===void 0&&k==="pending"){let F;if(s!=null&&s.isPlaceholderData&&n.placeholderData===(o==null?void 0:o.placeholderData))F=s.data;else if(F=typeof n.placeholderData=="function"?n.placeholderData((M=T(this,nl))==null?void 0:M.state.data,T(this,nl)):n.placeholderData,n.select&&F!==void 0)try{F=n.select(F),Y(this,or,null)}catch(C){Y(this,or,C)}F!==void 0&&(k="success",f=sh(s==null?void 0:s.data,F,n),p=!0)}T(this,or)&&(m=T(this,or),f=T(this,tl),g=Date.now(),k="error");const y=h.fetchStatus==="fetching",x=k==="pending",v=k==="error",j=x&&y,E=f!==void 0,N={status:k,fetchStatus:h.fetchStatus,isPending:x,isSuccess:k==="success",isError:v,isInitialLoading:j,isLoading:j,data:f,dataUpdatedAt:h.dataUpdatedAt,error:m,errorUpdatedAt:g,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>c.dataUpdateCount||h.errorUpdateCount>c.errorUpdateCount,isFetching:y,isRefetching:y&&!x,isLoadingError:v&&!E,isPaused:h.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:v&&E,isStale:Xf(t,n),refetch:this.refetch,promise:T(this,ti)};if(this.options.experimental_prefetchInRender){const F=A=>{N.status==="error"?A.reject(N.error):N.data!==void 0&&A.resolve(N.data)},C=()=>{const A=Y(this,ti,N.promise=lh());F(A)},O=T(this,ti);switch(O.status){case"pending":t.queryHash===r.queryHash&&F(O);break;case"fulfilled":(N.status==="error"||N.data!==O.value)&&C();break;case"rejected":(N.status!=="error"||N.error!==O.reason)&&C();break}}return N}updateResult(t){const n=T(this,qt),r=this.createResult(T(this,Te),this.options);if(Y(this,Vi,T(this,Te).state),Y(this,el,this.options),T(this,Vi).data!==void 0&&Y(this,nl,T(this,Te)),fu(r,n))return;Y(this,qt,r);const i={},s=()=>{if(!n)return!0;const{notifyOnChangeProps:l}=this.options,o=typeof l=="function"?l():l;if(o==="all"||!o&&!T(this,rl).size)return!0;const u=new Set(o??T(this,rl));return this.options.throwOnError&&u.add("error"),Object.keys(T(this,qt)).some(c=>{const d=c;return T(this,qt)[d]!==n[d]&&u.has(d)})};(t==null?void 0:t.listeners)!==!1&&s()&&(i.listeners=!0),de(this,Fe,v1).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&de(this,Fe,ch).call(this)}},Gt=new WeakMap,Te=new WeakMap,La=new WeakMap,qt=new WeakMap,Vi=new WeakMap,el=new WeakMap,ti=new WeakMap,or=new WeakMap,Ma=new WeakMap,tl=new WeakMap,nl=new WeakMap,Qi=new WeakMap,Ki=new WeakMap,ni=new WeakMap,rl=new WeakMap,Fe=new WeakSet,Wl=function(t){de(this,Fe,fh).call(this);let n=T(this,Te).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Nn)),n},ah=function(){de(this,Fe,dh).call(this);const t=Us(this.options.staleTime,T(this,Te));if(ls||T(this,qt).isStale||!rh(t))return;const r=d1(T(this,qt).dataUpdatedAt,t)+1;Y(this,Qi,setTimeout(()=>{T(this,qt).isStale||this.updateResult()},r))},oh=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(T(this,Te)):this.options.refetchInterval)??!1},uh=function(t){de(this,Fe,hh).call(this),Y(this,ni,t),!(ls||Bn(this.options.enabled,T(this,Te))===!1||!rh(T(this,ni))||T(this,ni)===0)&&Y(this,Ki,setInterval(()=>{(this.options.refetchIntervalInBackground||Gf.isFocused())&&de(this,Fe,Wl).call(this)},T(this,ni)))},ch=function(){de(this,Fe,ah).call(this),de(this,Fe,uh).call(this,de(this,Fe,oh).call(this))},dh=function(){T(this,Qi)&&(clearTimeout(T(this,Qi)),Y(this,Qi,void 0))},hh=function(){T(this,Ki)&&(clearInterval(T(this,Ki)),Y(this,Ki,void 0))},fh=function(){const t=T(this,Gt).getQueryCache().build(T(this,Gt),this.options);if(t===T(this,Te))return;const n=T(this,Te);Y(this,Te,t),Y(this,La,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},v1=function(t){rt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(T(this,qt))}),T(this,Gt).getQueryCache().notify({query:T(this,Te),type:"observerResultsUpdated"})})},Hx);function Ij(e,t){return Bn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function ig(e,t){return Ij(e,t)||e.state.data!==void 0&&ph(e,t,t.refetchOnMount)}function ph(e,t,n){if(Bn(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Xf(e,t)}return!1}function sg(e,t,n,r){return(e!==t||Bn(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Xf(e,n)}function Xf(e,t){return Bn(t.enabled,e)!==!1&&e.isStaleByTime(Us(t.staleTime,e))}function Fj(e,t){return!fu(e.getCurrentResult(),t)}function lg(e,t){return e.filter(n=>!t.includes(n))}function Dj(e,t,n){const r=e.slice(0);return r[t]=n,r}var il,bn,Gi,sl,jn,ri,Ra,za,wt,mh,gh,Oo,xh,yh,Wx,Oj=(Wx=class extends ps{constructor(t,n,r){super();oe(this,wt);oe(this,il);oe(this,bn);oe(this,Gi);oe(this,sl);oe(this,jn);oe(this,ri);oe(this,Ra);oe(this,za);Y(this,il,t),Y(this,sl,r),Y(this,Gi,[]),Y(this,jn,[]),Y(this,bn,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&T(this,jn).forEach(t=>{t.subscribe(n=>{de(this,wt,xh).call(this,t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,T(this,jn).forEach(t=>{t.destroy()})}setQueries(t,n,r){Y(this,Gi,t),Y(this,sl,n),rt.batch(()=>{const i=T(this,jn),s=de(this,wt,Oo).call(this,T(this,Gi));s.forEach(c=>c.observer.setOptions(c.defaultedQueryOptions,r));const l=s.map(c=>c.observer),o=l.map(c=>c.getCurrentResult()),u=l.some((c,d)=>c!==i[d]);i.length===l.length&&!u||(Y(this,jn,l),Y(this,bn,o),this.hasListeners()&&(lg(i,l).forEach(c=>{c.destroy()}),lg(l,i).forEach(c=>{c.subscribe(d=>{de(this,wt,xh).call(this,c,d)})}),de(this,wt,yh).call(this)))})}getCurrentResult(){return T(this,bn)}getQueries(){return T(this,jn).map(t=>t.getCurrentQuery())}getObservers(){return T(this,jn)}getOptimisticResult(t,n){const i=de(this,wt,Oo).call(this,t).map(s=>s.observer.getOptimisticResult(s.defaultedQueryOptions));return[i,s=>de(this,wt,gh).call(this,s??i,n),()=>de(this,wt,mh).call(this,i,t)]}},il=new WeakMap,bn=new WeakMap,Gi=new WeakMap,sl=new WeakMap,jn=new WeakMap,ri=new WeakMap,Ra=new WeakMap,za=new WeakMap,wt=new WeakSet,mh=function(t,n){const r=de(this,wt,Oo).call(this,n);return r.map((i,s)=>{const l=t[s];return i.defaultedQueryOptions.notifyOnChangeProps?l:i.observer.trackResult(l,o=>{r.forEach(u=>{u.observer.trackProp(o)})})})},gh=function(t,n){return n?((!T(this,ri)||T(this,bn)!==T(this,za)||n!==T(this,Ra))&&(Y(this,Ra,n),Y(this,za,T(this,bn)),Y(this,ri,Qf(T(this,ri),n(t)))),T(this,ri)):t},Oo=function(t){const n=new Map(T(this,jn).map(i=>[i.options.queryHash,i])),r=[];return t.forEach(i=>{const s=T(this,il).defaultQueryOptions(i),l=n.get(s.queryHash);l?r.push({defaultedQueryOptions:s,observer:l}):r.push({defaultedQueryOptions:s,observer:new Yf(T(this,il),s)})}),r},xh=function(t,n){const r=T(this,jn).indexOf(t);r!==-1&&(Y(this,bn,Dj(T(this,bn),r,n)),de(this,wt,yh).call(this))},yh=function(){var t;if(this.hasListeners()){const n=T(this,ri),r=de(this,wt,gh).call(this,de(this,wt,mh).call(this,T(this,bn),T(this,Gi)),(t=T(this,sl))==null?void 0:t.combine);n!==r&&rt.batch(()=>{this.listeners.forEach(i=>{i(T(this,bn))})})}},Wx),ii,si,Yt,Nr,Mr,_o,vh,Vx,_j=(Vx=class extends ps{constructor(n,r){super();oe(this,Mr);oe(this,ii);oe(this,si);oe(this,Yt);oe(this,Nr);Y(this,ii,n),this.setOptions(r),this.bindMethods(),de(this,Mr,_o).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var i;const r=this.options;this.options=T(this,ii).defaultMutationOptions(n),fu(this.options,r)||T(this,ii).getMutationCache().notify({type:"observerOptionsUpdated",mutation:T(this,Yt),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&as(r.mutationKey)!==as(this.options.mutationKey)?this.reset():((i=T(this,Yt))==null?void 0:i.state.status)==="pending"&&T(this,Yt).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=T(this,Yt))==null||n.removeObserver(this)}onMutationUpdate(n){de(this,Mr,_o).call(this),de(this,Mr,vh).call(this,n)}getCurrentResult(){return T(this,si)}reset(){var n;(n=T(this,Yt))==null||n.removeObserver(this),Y(this,Yt,void 0),de(this,Mr,_o).call(this),de(this,Mr,vh).call(this)}mutate(n,r){var i;return Y(this,Nr,r),(i=T(this,Yt))==null||i.removeObserver(this),Y(this,Yt,T(this,ii).getMutationCache().build(T(this,ii),this.options)),T(this,Yt).addObserver(this),T(this,Yt).execute(n)}},ii=new WeakMap,si=new WeakMap,Yt=new WeakMap,Nr=new WeakMap,Mr=new WeakSet,_o=function(){var r;const n=((r=T(this,Yt))==null?void 0:r.state)??y1();Y(this,si,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},vh=function(n){rt.batch(()=>{var r,i,s,l,o,u,c,d;if(T(this,Nr)&&this.hasListeners()){const h=T(this,si).variables,p=T(this,si).context;(n==null?void 0:n.type)==="success"?((i=(r=T(this,Nr)).onSuccess)==null||i.call(r,n.data,h,p),(l=(s=T(this,Nr)).onSettled)==null||l.call(s,n.data,null,h,p)):(n==null?void 0:n.type)==="error"&&((u=(o=T(this,Nr)).onError)==null||u.call(o,n.error,h,p),(d=(c=T(this,Nr)).onSettled)==null||d.call(c,void 0,n.error,h,p))}this.listeners.forEach(h=>{h(T(this,si))})})},Vx),w1=b.createContext(void 0),Dt=e=>{const t=b.useContext(w1);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},$j=({client:e,children:t})=>(b.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),a.jsx(w1.Provider,{value:e,children:t})),k1=b.createContext(!1),b1=()=>b.useContext(k1);k1.Provider;function qj(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Bj=b.createContext(qj()),j1=()=>b.useContext(Bj);function N1(e,t){return typeof e=="function"?e(...t):!!e}function mu(){}var S1=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},C1=e=>{b.useEffect(()=>{e.clearReset()},[e])},E1=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&N1(n,[e.error,r]),P1=e=>{e.suspense&&(e.staleTime===void 0&&(e.staleTime=1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},T1=(e,t)=>e.isLoading&&e.isFetching&&!t,wh=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,gu=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Uj({queries:e,...t},n){const r=Dt(),i=b1(),s=j1(),l=b.useMemo(()=>e.map(m=>{const g=r.defaultQueryOptions(m);return g._optimisticResults=i?"isRestoring":"optimistic",g}),[e,r,i]);l.forEach(m=>{P1(m),S1(m,s)}),C1(s);const[o]=b.useState(()=>new Oj(r,l,t)),[u,c,d]=o.getOptimisticResult(l,t.combine);b.useSyncExternalStore(b.useCallback(m=>i?mu:o.subscribe(rt.batchCalls(m)),[o,i]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),b.useEffect(()=>{o.setQueries(l,t,{listeners:!1})},[l,t,o]);const p=u.some((m,g)=>wh(l[g],m))?u.flatMap((m,g)=>{const k=l[g];if(k){const y=new Yf(r,k);if(wh(k,m))return gu(k,y,s);T1(m,i)&&gu(k,y,s)}return[]}):[];if(p.length>0)throw Promise.all(p);const f=u.find((m,g)=>{const k=l[g];return k&&E1({result:m,errorResetBoundary:s,throwOnError:k.throwOnError,query:r.getQueryCache().get(k.queryHash)})});if(f!=null&&f.error)throw f.error;return c(d())}function Hj(e,t,n){var d,h,p,f,m;const r=Dt(),i=b1(),s=j1(),l=r.defaultQueryOptions(e);(h=(d=r.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||h.call(d,l),l._optimisticResults=i?"isRestoring":"optimistic",P1(l),S1(l,s),C1(s);const o=!r.getQueryCache().get(l.queryHash),[u]=b.useState(()=>new t(r,l)),c=u.getOptimisticResult(l);if(b.useSyncExternalStore(b.useCallback(g=>{const k=i?mu:u.subscribe(rt.batchCalls(g));return u.updateResult(),k},[u,i]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),b.useEffect(()=>{u.setOptions(l,{listeners:!1})},[l,u]),wh(l,c))throw gu(l,u,s);if(E1({result:c,errorResetBoundary:s,throwOnError:l.throwOnError,query:r.getQueryCache().get(l.queryHash)}))throw c.error;if((f=(p=r.getDefaultOptions().queries)==null?void 0:p._experimental_afterQuery)==null||f.call(p,l,c),l.experimental_prefetchInRender&&!ls&&T1(c,i)){const g=o?gu(l,u,s):(m=r.getQueryCache().get(l.queryHash))==null?void 0:m.promise;g==null||g.catch(mu).finally(()=>{u.updateResult()})}return l.notifyOnChangeProps?c:u.trackResult(c)}function ye(e,t){return Hj(e,Yf)}function vi(e,t){const n=Dt(),[r]=b.useState(()=>new _j(n,e));b.useEffect(()=>{r.setOptions(e)},[r,e]);const i=b.useSyncExternalStore(b.useCallback(l=>r.subscribe(rt.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=b.useCallback((l,o)=>{r.mutate(l,o).catch(mu)},[r]);if(i.error&&N1(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}function L1(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=L1(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function le(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=L1(e))&&(r&&(r+=" "),r+=t);return r}/**
41
+ * @license lucide-react v0.468.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 Wj=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),M1=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
46
+ * @license lucide-react v0.468.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 Vj={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.468.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 Qj=b.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:l,...o},u)=>b.createElement("svg",{ref:u,...Vj,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:M1("lucide",i),...o},[...l.map(([c,d])=>b.createElement(c,d)),...Array.isArray(s)?s:[s]]));/**
56
+ * @license lucide-react v0.468.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=b.forwardRef(({className:r,...i},s)=>b.createElement(Qj,{ref:s,iconNode:t,className:M1(`lucide-${Wj(e)}`,r),...i}));return n.displayName=`${e}`,n};/**
61
+ * @license lucide-react v0.468.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 Kj=J("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
66
+ * @license lucide-react v0.468.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 Jf=J("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
71
+ * @license lucide-react v0.468.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 Hu=J("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
76
+ * @license lucide-react v0.468.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 R1=J("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
81
+ * @license lucide-react v0.468.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 Gj=J("BookA",[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}],["path",{d:"m8 13 4-7 4 7",key:"4rari8"}],["path",{d:"M9.1 11h5.7",key:"1gkovt"}]]);/**
86
+ * @license lucide-react v0.468.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 Zf=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"}]]);/**
91
+ * @license lucide-react v0.468.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 Wu=J("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]);/**
96
+ * @license lucide-react v0.468.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 z1=J("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
101
+ * @license lucide-react v0.468.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 ep=J("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
106
+ * @license lucide-react v0.468.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 Yj=J("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
111
+ * @license lucide-react v0.468.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 xu=J("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
116
+ * @license lucide-react v0.468.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 Tr=J("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
121
+ * @license lucide-react v0.468.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 Xj=J("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/**
126
+ * @license lucide-react v0.468.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 A1=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"}]]);/**
131
+ * @license lucide-react v0.468.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 vl=J("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
136
+ * @license lucide-react v0.468.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 I1=J("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]]);/**
141
+ * @license lucide-react v0.468.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 F1=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"}]]);/**
146
+ * @license lucide-react v0.468.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 D1=J("CirclePause",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]]);/**
151
+ * @license lucide-react v0.468.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 Jj=J("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/**
156
+ * @license lucide-react v0.468.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 Zj=J("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
161
+ * @license lucide-react v0.468.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 e2=J("Command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);/**
166
+ * @license lucide-react v0.468.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 _a=J("Compass",[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
171
+ * @license lucide-react v0.468.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 t2=J("CornerDownLeft",[["polyline",{points:"9 10 4 15 9 20",key:"r3jprv"}],["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}]]);/**
176
+ * @license lucide-react v0.468.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 n2=J("CornerDownRight",[["polyline",{points:"15 10 20 15 15 20",key:"1q7qjw"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]]);/**
181
+ * @license lucide-react v0.468.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 r2=J("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
186
+ * @license lucide-react v0.468.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 tp=J("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
191
+ * @license lucide-react v0.468.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 i2=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"}]]);/**
196
+ * @license lucide-react v0.468.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 O1=J("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
201
+ * @license lucide-react v0.468.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 os=J("FileCode2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m5 12-3 3 3 3",key:"oke12k"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]]);/**
206
+ * @license lucide-react v0.468.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 s2=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"}]]);/**
211
+ * @license lucide-react v0.468.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 _1=J("File",[["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"}]]);/**
216
+ * @license lucide-react v0.468.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 l2=J("Flame",[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]]);/**
221
+ * @license lucide-react v0.468.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 $1=J("FolderGit2",[["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["path",{d:"M18 19c-2.8 0-5-2.2-5-5v8",key:"pkpw2h"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]]);/**
226
+ * @license lucide-react v0.468.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 q1=J("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
231
+ * @license lucide-react v0.468.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 B1=J("FolderPlus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["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"}]]);/**
236
+ * @license lucide-react v0.468.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 np=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"}]]);/**
241
+ * @license lucide-react v0.468.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 Vu=J("Footprints",[["path",{d:"M4 16v-2.38C4 11.5 2.97 10.5 3 8c.03-2.72 1.49-6 4.5-6C9.37 2 10 3.8 10 5.5c0 3.11-2 5.66-2 8.68V16a2 2 0 1 1-4 0Z",key:"1dudjm"}],["path",{d:"M20 20v-2.38c0-2.12 1.03-3.12 1-5.62-.03-2.72-1.49-6-4.5-6C14.63 6 14 7.8 14 9.5c0 3.11 2 5.66 2 8.68V20a2 2 0 1 0 4 0Z",key:"l2t8xc"}],["path",{d:"M16 17h4",key:"1dejxt"}],["path",{d:"M4 13h4",key:"1bwh8b"}]]);/**
246
+ * @license lucide-react v0.468.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 rp=J("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
251
+ * @license lucide-react v0.468.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 a2=J("GitCompareArrows",[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"M12 18H7a2 2 0 0 1-2-2V9",key:"16sdep"}],["path",{d:"m9 15 3 3-3 3",key:"1m3kbl"}]]);/**
256
+ * @license lucide-react v0.468.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 U1=J("GitCompare",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]]);/**
261
+ * @license lucide-react v0.468.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 Qu=J("GraduationCap",[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]]);/**
266
+ * @license lucide-react v0.468.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 Ku=J("Hammer",[["path",{d:"m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9",key:"eefl8a"}],["path",{d:"m18 15 4-4",key:"16gjal"}],["path",{d:"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172V7l-2.26-2.26a6 6 0 0 0-4.202-1.756L9 2.96l.92.82A6.18 6.18 0 0 1 12 8.4V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5",key:"b7pghm"}]]);/**
271
+ * @license lucide-react v0.468.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 o2=J("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);/**
276
+ * @license lucide-react v0.468.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 u2=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"}]]);/**
281
+ * @license lucide-react v0.468.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 c2=J("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/**
286
+ * @license lucide-react v0.468.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 Fr=J("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);/**
291
+ * @license lucide-react v0.468.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 ip=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"}]]);/**
296
+ * @license lucide-react v0.468.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 $a=J("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
301
+ * @license lucide-react v0.468.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 H1=J("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
306
+ * @license lucide-react v0.468.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 W1=J("Map",[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]]);/**
311
+ * @license lucide-react v0.468.0 - ISC
312
+ *
313
+ * This source code is licensed under the ISC license.
314
+ * See the LICENSE file in the root directory of this source tree.
315
+ */const d2=J("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
316
+ * @license lucide-react v0.468.0 - ISC
317
+ *
318
+ * This source code is licensed under the ISC license.
319
+ * See the LICENSE file in the root directory of this source tree.
320
+ */const Gu=J("MessageCircleQuestion",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}],["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"}]]);/**
321
+ * @license lucide-react v0.468.0 - ISC
322
+ *
323
+ * This source code is licensed under the ISC license.
324
+ * See the LICENSE file in the root directory of this source tree.
325
+ */const ag=J("MessageSquarePlus",[["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"}],["path",{d:"M12 7v6",key:"lw1j43"}],["path",{d:"M9 10h6",key:"9gxzsh"}]]);/**
326
+ * @license lucide-react v0.468.0 - ISC
327
+ *
328
+ * This source code is licensed under the ISC license.
329
+ * See the LICENSE file in the root directory of this source tree.
330
+ */const h2=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"}]]);/**
331
+ * @license lucide-react v0.468.0 - ISC
332
+ *
333
+ * This source code is licensed under the ISC license.
334
+ * See the LICENSE file in the root directory of this source tree.
335
+ */const f2=J("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
336
+ * @license lucide-react v0.468.0 - ISC
337
+ *
338
+ * This source code is licensed under the ISC license.
339
+ * See the LICENSE file in the root directory of this source tree.
340
+ */const V1=J("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);/**
341
+ * @license lucide-react v0.468.0 - ISC
342
+ *
343
+ * This source code is licensed under the ISC license.
344
+ * See the LICENSE file in the root directory of this source tree.
345
+ */const p2=J("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
346
+ * @license lucide-react v0.468.0 - ISC
347
+ *
348
+ * This source code is licensed under the ISC license.
349
+ * See the LICENSE file in the root directory of this source tree.
350
+ */const Q1=J("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
351
+ * @license lucide-react v0.468.0 - ISC
352
+ *
353
+ * This source code is licensed under the ISC license.
354
+ * See the LICENSE file in the root directory of this source tree.
355
+ */const m2=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"}]]);/**
356
+ * @license lucide-react v0.468.0 - ISC
357
+ *
358
+ * This source code is licensed under the ISC license.
359
+ * See the LICENSE file in the root directory of this source tree.
360
+ */const sp=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"}]]);/**
361
+ * @license lucide-react v0.468.0 - ISC
362
+ *
363
+ * This source code is licensed under the ISC license.
364
+ * See the LICENSE file in the root directory of this source tree.
365
+ */const lp=J("Route",[["circle",{cx:"6",cy:"19",r:"3",key:"1kj8tv"}],["path",{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15",key:"1d8sl"}],["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}]]);/**
366
+ * @license lucide-react v0.468.0 - ISC
367
+ *
368
+ * This source code is licensed under the ISC license.
369
+ * See the LICENSE file in the root directory of this source tree.
370
+ */const ms=J("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
371
+ * @license lucide-react v0.468.0 - ISC
372
+ *
373
+ * This source code is licensed under the ISC license.
374
+ * See the LICENSE file in the root directory of this source tree.
375
+ */const K1=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"}]]);/**
376
+ * @license lucide-react v0.468.0 - ISC
377
+ *
378
+ * This source code is licensed under the ISC license.
379
+ * See the LICENSE file in the root directory of this source tree.
380
+ */const g2=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"}]]);/**
381
+ * @license lucide-react v0.468.0 - ISC
382
+ *
383
+ * This source code is licensed under the ISC license.
384
+ * See the LICENSE file in the root directory of this source tree.
385
+ */const ap=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"}]]);/**
386
+ * @license lucide-react v0.468.0 - ISC
387
+ *
388
+ * This source code is licensed under the ISC license.
389
+ * See the LICENSE file in the root directory of this source tree.
390
+ */const x2=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"}]]);/**
391
+ * @license lucide-react v0.468.0 - ISC
392
+ *
393
+ * This source code is licensed under the ISC license.
394
+ * See the LICENSE file in the root directory of this source tree.
395
+ */const y2=J("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
396
+ * @license lucide-react v0.468.0 - ISC
397
+ *
398
+ * This source code is licensed under the ISC license.
399
+ * See the LICENSE file in the root directory of this source tree.
400
+ */const G1=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"}]]);/**
401
+ * @license lucide-react v0.468.0 - ISC
402
+ *
403
+ * This source code is licensed under the ISC license.
404
+ * See the LICENSE file in the root directory of this source tree.
405
+ */const v2=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"}]]);/**
406
+ * @license lucide-react v0.468.0 - ISC
407
+ *
408
+ * This source code is licensed under the ISC license.
409
+ * See the LICENSE file in the root directory of this source tree.
410
+ */const w2=J("Sunrise",[["path",{d:"M12 2v8",key:"1q4o3n"}],["path",{d:"m4.93 10.93 1.41 1.41",key:"2a7f42"}],["path",{d:"M2 18h2",key:"j10viu"}],["path",{d:"M20 18h2",key:"wocana"}],["path",{d:"m19.07 10.93-1.41 1.41",key:"15zs5n"}],["path",{d:"M22 22H2",key:"19qnx5"}],["path",{d:"m8 6 4-4 4 4",key:"ybng9g"}],["path",{d:"M16 18a4 4 0 0 0-8 0",key:"1lzouq"}]]);/**
411
+ * @license lucide-react v0.468.0 - ISC
412
+ *
413
+ * This source code is licensed under the ISC license.
414
+ * See the LICENSE file in the root directory of this source tree.
415
+ */const Ji=J("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/**
416
+ * @license lucide-react v0.468.0 - ISC
417
+ *
418
+ * This source code is licensed under the ISC license.
419
+ * See the LICENSE file in the root directory of this source tree.
420
+ */const k2=J("TimerReset",[["path",{d:"M10 2h4",key:"n1abiw"}],["path",{d:"M12 14v-4",key:"1evpnu"}],["path",{d:"M4 13a8 8 0 0 1 8-7 8 8 0 1 1-5.3 14L4 17.6",key:"1ts96g"}],["path",{d:"M9 17H4v5",key:"8t5av"}]]);/**
421
+ * @license lucide-react v0.468.0 - ISC
422
+ *
423
+ * This source code is licensed under the ISC license.
424
+ * See the LICENSE file in the root directory of this source tree.
425
+ */const pr=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"}]]);/**
426
+ * @license lucide-react v0.468.0 - ISC
427
+ *
428
+ * This source code is licensed under the ISC license.
429
+ * See the LICENSE file in the root directory of this source tree.
430
+ */const op=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"}]]);/**
431
+ * @license lucide-react v0.468.0 - ISC
432
+ *
433
+ * This source code is licensed under the ISC license.
434
+ * See the LICENSE file in the root directory of this source tree.
435
+ */const Rn=J("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
436
+ * @license lucide-react v0.468.0 - ISC
437
+ *
438
+ * This source code is licensed under the ISC license.
439
+ * See the LICENSE file in the root directory of this source tree.
440
+ */const og=J("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);/**
441
+ * @remix-run/router v1.21.0
442
+ *
443
+ * Copyright (c) Remix Software Inc.
444
+ *
445
+ * This source code is licensed under the MIT license found in the
446
+ * LICENSE.md file in the root directory of this source tree.
447
+ *
448
+ * @license MIT
449
+ */function Ve(){return Ve=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ve.apply(this,arguments)}var ct;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(ct||(ct={}));const ug="popstate";function b2(e){e===void 0&&(e={});function t(r,i){let{pathname:s,search:l,hash:o}=r.location;return Sa("",{pathname:s,search:l,hash:o},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:us(i)}return N2(t,n,null,e)}function je(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function fl(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function j2(){return Math.random().toString(36).substr(2,8)}function cg(e,t){return{usr:e.state,key:e.key,idx:t}}function Sa(e,t,n,r){return n===void 0&&(n=null),Ve({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Ni(t):t,{state:n,key:t&&t.key||r||j2()})}function us(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Ni(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function N2(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:s=!1}=r,l=i.history,o=ct.Pop,u=null,c=d();c==null&&(c=0,l.replaceState(Ve({},l.state,{idx:c}),""));function d(){return(l.state||{idx:null}).idx}function h(){o=ct.Pop;let k=d(),y=k==null?null:k-c;c=k,u&&u({action:o,location:g.location,delta:y})}function p(k,y){o=ct.Push;let x=Sa(g.location,k,y);c=d()+1;let v=cg(x,c),j=g.createHref(x);try{l.pushState(v,"",j)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;i.location.assign(j)}s&&u&&u({action:o,location:g.location,delta:1})}function f(k,y){o=ct.Replace;let x=Sa(g.location,k,y);c=d();let v=cg(x,c),j=g.createHref(x);l.replaceState(v,"",j),s&&u&&u({action:o,location:g.location,delta:0})}function m(k){let y=i.location.origin!=="null"?i.location.origin:i.location.href,x=typeof k=="string"?k:us(k);return x=x.replace(/ $/,"%20"),je(y,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,y)}let g={get action(){return o},get location(){return e(i,l)},listen(k){if(u)throw new Error("A history only accepts one active listener");return i.addEventListener(ug,h),u=k,()=>{i.removeEventListener(ug,h),u=null}},createHref(k){return t(i,k)},createURL:m,encodeLocation(k){let y=m(k);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:p,replace:f,go(k){return l.go(k)}};return g}var Oe;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Oe||(Oe={}));const S2=new Set(["lazy","caseSensitive","path","id","index","children"]);function C2(e){return e.index===!0}function yu(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((i,s)=>{let l=[...n,String(s)],o=typeof i.id=="string"?i.id:l.join("-");if(je(i.index!==!0||!i.children,"Cannot specify children on an index route"),je(!r[o],'Found a route id collision on id "'+o+`". Route id's must be globally unique within Data Router usages`),C2(i)){let u=Ve({},i,t(i),{id:o});return r[o]=u,u}else{let u=Ve({},i,t(i),{id:o,children:void 0});return r[o]=u,i.children&&(u.children=yu(i.children,t,l,r)),u}})}function Ii(e,t,n){return n===void 0&&(n="/"),$o(e,t,n,!1)}function $o(e,t,n,r){let i=typeof t=="string"?Ni(t):t,s=Dr(i.pathname||"/",n);if(s==null)return null;let l=Y1(e);P2(l);let o=null;for(let u=0;o==null&&u<l.length;++u){let c=_2(s);o=D2(l[u],c,r)}return o}function E2(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],handle:n.handle}}function Y1(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let i=(s,l,o)=>{let u={relativePath:o===void 0?s.path||"":o,caseSensitive:s.caseSensitive===!0,childrenIndex:l,route:s};u.relativePath.startsWith("/")&&(je(u.relativePath.startsWith(r),'Absolute route path "'+u.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),u.relativePath=u.relativePath.slice(r.length));let c=Lr([r,u.relativePath]),d=n.concat(u);s.children&&s.children.length>0&&(je(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),Y1(s.children,t,d,c)),!(s.path==null&&!s.index)&&t.push({path:c,score:I2(c,s.index),routesMeta:d})};return e.forEach((s,l)=>{var o;if(s.path===""||!((o=s.path)!=null&&o.includes("?")))i(s,l);else for(let u of X1(s.path))i(s,l,u)}),t}function X1(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let l=X1(r.join("/")),o=[];return o.push(...l.map(u=>u===""?s:[s,u].join("/"))),i&&o.push(...l),o.map(u=>e.startsWith("/")&&u===""?"/":u)}function P2(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:F2(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const T2=/^:[\w-]+$/,L2=3,M2=2,R2=1,z2=10,A2=-2,dg=e=>e==="*";function I2(e,t){let n=e.split("/"),r=n.length;return n.some(dg)&&(r+=A2),t&&(r+=M2),n.filter(i=>!dg(i)).reduce((i,s)=>i+(T2.test(s)?L2:s===""?R2:z2),r)}function F2(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function D2(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,i={},s="/",l=[];for(let o=0;o<r.length;++o){let u=r[o],c=o===r.length-1,d=s==="/"?t:t.slice(s.length)||"/",h=vu({path:u.relativePath,caseSensitive:u.caseSensitive,end:c},d),p=u.route;if(!h&&c&&n&&!r[r.length-1].route.index&&(h=vu({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},d)),!h)return null;Object.assign(i,h.params),l.push({params:i,pathname:Lr([s,h.pathname]),pathnameBase:B2(Lr([s,h.pathnameBase])),route:p}),h.pathnameBase!=="/"&&(s=Lr([s,h.pathnameBase]))}return l}function vu(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=O2(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let s=i[0],l=s.replace(/(.)\/+$/,"$1"),o=i.slice(1);return{params:r.reduce((c,d,h)=>{let{paramName:p,isOptional:f}=d;if(p==="*"){let g=o[h]||"";l=s.slice(0,s.length-g.length).replace(/(.)\/+$/,"$1")}const m=o[h];return f&&!m?c[p]=void 0:c[p]=(m||"").replace(/%2F/g,"/"),c},{}),pathname:s,pathnameBase:l,pattern:e}}function O2(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),fl(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,o,u)=>(r.push({paramName:o,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function _2(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return fl(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Dr(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function $2(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Ni(e):e;return{pathname:n?n.startsWith("/")?n:q2(n,t):t,search:U2(r),hash:H2(i)}}function q2(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function qc(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function J1(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Yu(e,t){let n=J1(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Xu(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=Ni(e):(i=Ve({},e),je(!i.pathname||!i.pathname.includes("?"),qc("?","pathname","search",i)),je(!i.pathname||!i.pathname.includes("#"),qc("#","pathname","hash",i)),je(!i.search||!i.search.includes("#"),qc("#","search","hash",i)));let s=e===""||i.pathname==="",l=s?"/":i.pathname,o;if(l==null)o=n;else{let h=t.length-1;if(!r&&l.startsWith("..")){let p=l.split("/");for(;p[0]==="..";)p.shift(),h-=1;i.pathname=p.join("/")}o=h>=0?t[h]:"/"}let u=$2(i,o),c=l&&l!=="/"&&l.endsWith("/"),d=(s||l===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(c||d)&&(u.pathname+="/"),u}const Lr=e=>e.join("/").replace(/\/\/+/g,"/"),B2=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),U2=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,H2=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class wu{constructor(t,n,r,i){i===void 0&&(i=!1),this.status=t,this.statusText=n||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function Ju(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Z1=["post","put","patch","delete"],W2=new Set(Z1),V2=["get",...Z1],Q2=new Set(V2),K2=new Set([301,302,303,307,308]),G2=new Set([307,308]),Bc={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Y2={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Il={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},up=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,X2=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),e0="remix-router-transitions";function J2(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;je(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let i;if(e.mapRouteProperties)i=e.mapRouteProperties;else if(e.detectErrorBoundary){let L=e.detectErrorBoundary;i=I=>({hasErrorBoundary:L(I)})}else i=X2;let s={},l=yu(e.routes,i,void 0,s),o,u=e.basename||"/",c=e.dataStrategy||nN,d=e.patchRoutesOnNavigation,h=Ve({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),p=null,f=new Set,m=null,g=null,k=null,y=e.hydrationData!=null,x=Ii(l,e.history.location,u),v=null;if(x==null&&!d){let L=Xt(404,{pathname:e.history.location.pathname}),{matches:I,route:$}=bg(l);x=I,v={[$.id]:L}}x&&!e.hydrationData&&Ya(x,l,e.history.location.pathname).active&&(x=null);let j;if(x)if(x.some(L=>L.route.lazy))j=!1;else if(!x.some(L=>L.route.loader))j=!0;else if(h.v7_partialHydration){let L=e.hydrationData?e.hydrationData.loaderData:null,I=e.hydrationData?e.hydrationData.errors:null;if(I){let $=x.findIndex(B=>I[B.route.id]!==void 0);j=x.slice(0,$+1).every(B=>!bh(B.route,L,I))}else j=x.every($=>!bh($.route,L,I))}else j=e.hydrationData!=null;else if(j=!1,x=[],h.v7_partialHydration){let L=Ya(null,l,e.history.location.pathname);L.active&&L.matches&&(x=L.matches)}let E,w={historyAction:e.history.action,location:e.history.location,matches:x,initialized:j,navigation:Bc,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||v,fetchers:new Map,blockers:new Map},N=ct.Pop,M=!1,F,C=!1,O=new Map,A=null,V=!1,U=!1,q=[],G=new Set,X=new Map,z=0,W=-1,S=new Map,D=new Set,te=new Map,P=new Map,ve=new Set,Le=new Map,we=new Map,Se;function _t(){if(p=e.history.listen(L=>{let{action:I,location:$,delta:B}=L;if(Se){Se(),Se=void 0;return}fl(we.size===0||B!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let re=xs({currentLocation:w.location,nextLocation:$,historyAction:I});if(re&&B!=null){let ue=new Promise(xe=>{Se=xe});e.history.go(B*-1),Pi(re,{state:"blocked",location:$,proceed(){Pi(re,{state:"proceeding",proceed:void 0,reset:void 0,location:$}),ue.then(()=>e.history.go(B))},reset(){let xe=new Map(w.blockers);xe.set(re,Il),qe({blockers:xe})}});return}return Vt(I,$)}),n){gN(t,O);let L=()=>xN(t,O);t.addEventListener("pagehide",L),A=()=>t.removeEventListener("pagehide",L)}return w.initialized||Vt(ct.Pop,w.location,{initialHydration:!0}),E}function an(){p&&p(),A&&A(),f.clear(),F&&F.abort(),w.fetchers.forEach((L,I)=>pe(I)),w.blockers.forEach((L,I)=>vn(I))}function Lt(L){return f.add(L),()=>f.delete(L)}function qe(L,I){I===void 0&&(I={}),w=Ve({},w,L);let $=[],B=[];h.v7_fetcherPersist&&w.fetchers.forEach((re,ue)=>{re.state==="idle"&&(ve.has(ue)?B.push(ue):$.push(ue))}),[...f].forEach(re=>re(w,{deletedFetchers:B,viewTransitionOpts:I.viewTransitionOpts,flushSync:I.flushSync===!0})),h.v7_fetcherPersist&&($.forEach(re=>w.fetchers.delete(re)),B.forEach(re=>pe(re)))}function lt(L,I,$){var B,re;let{flushSync:ue}=$===void 0?{}:$,xe=w.actionData!=null&&w.navigation.formMethod!=null&&$n(w.navigation.formMethod)&&w.navigation.state==="loading"&&((B=L.state)==null?void 0:B._isRedirect)!==!0,se;I.actionData?Object.keys(I.actionData).length>0?se=I.actionData:se=null:xe?se=w.actionData:se=null;let ae=I.loaderData?wg(w.loaderData,I.loaderData,I.matches||[],I.errors):w.loaderData,ie=w.blockers;ie.size>0&&(ie=new Map(ie),ie.forEach((Me,jt)=>ie.set(jt,Il)));let ce=M===!0||w.navigation.formMethod!=null&&$n(w.navigation.formMethod)&&((re=L.state)==null?void 0:re._isRedirect)!==!0;o&&(l=o,o=void 0),V||N===ct.Pop||(N===ct.Push?e.history.push(L,L.state):N===ct.Replace&&e.history.replace(L,L.state));let Pe;if(N===ct.Pop){let Me=O.get(w.location.pathname);Me&&Me.has(L.pathname)?Pe={currentLocation:w.location,nextLocation:L}:O.has(L.pathname)&&(Pe={currentLocation:L,nextLocation:w.location})}else if(C){let Me=O.get(w.location.pathname);Me?Me.add(L.pathname):(Me=new Set([L.pathname]),O.set(w.location.pathname,Me)),Pe={currentLocation:w.location,nextLocation:L}}qe(Ve({},I,{actionData:se,loaderData:ae,historyAction:N,location:L,initialized:!0,navigation:Bc,revalidation:"idle",restoreScrollPosition:Op(L,I.matches||w.matches),preventScrollReset:ce,blockers:ie}),{viewTransitionOpts:Pe,flushSync:ue===!0}),N=ct.Pop,M=!1,C=!1,V=!1,U=!1,q=[]}async function zn(L,I){if(typeof L=="number"){e.history.go(L);return}let $=kh(w.location,w.matches,u,h.v7_prependBasename,L,h.v7_relativeSplatPath,I==null?void 0:I.fromRouteId,I==null?void 0:I.relative),{path:B,submission:re,error:ue}=hg(h.v7_normalizeFormMethod,!1,$,I),xe=w.location,se=Sa(w.location,B,I&&I.state);se=Ve({},se,e.history.encodeLocation(se));let ae=I&&I.replace!=null?I.replace:void 0,ie=ct.Push;ae===!0?ie=ct.Replace:ae===!1||re!=null&&$n(re.formMethod)&&re.formAction===w.location.pathname+w.location.search&&(ie=ct.Replace);let ce=I&&"preventScrollReset"in I?I.preventScrollReset===!0:void 0,Pe=(I&&I.flushSync)===!0,Me=xs({currentLocation:xe,nextLocation:se,historyAction:ie});if(Me){Pi(Me,{state:"blocked",location:se,proceed(){Pi(Me,{state:"proceeding",proceed:void 0,reset:void 0,location:se}),zn(L,I)},reset(){let jt=new Map(w.blockers);jt.set(Me,Il),qe({blockers:jt})}});return}return await Vt(ie,se,{submission:re,pendingError:ue,preventScrollReset:ce,replace:I&&I.replace,enableViewTransition:I&&I.viewTransition,flushSync:Pe})}function An(){if(Zn(),qe({revalidation:"loading"}),w.navigation.state!=="submitting"){if(w.navigation.state==="idle"){Vt(w.historyAction,w.location,{startUninterruptedRevalidation:!0});return}Vt(N||w.historyAction,w.navigation.location,{overrideNavigation:w.navigation,enableViewTransition:C===!0})}}async function Vt(L,I,$){F&&F.abort(),F=null,N=L,V=($&&$.startUninterruptedRevalidation)===!0,Dw(w.location,w.matches),M=($&&$.preventScrollReset)===!0,C=($&&$.enableViewTransition)===!0;let B=o||l,re=$&&$.overrideNavigation,ue=Ii(B,I,u),xe=($&&$.flushSync)===!0,se=Ya(ue,B,I.pathname);if(se.active&&se.matches&&(ue=se.matches),!ue){let{error:Be,notFoundMatches:Ie,route:Ze}=bt(I.pathname);lt(I,{matches:Ie,loaderData:{},errors:{[Ze.id]:Be}},{flushSync:xe});return}if(w.initialized&&!U&&oN(w.location,I)&&!($&&$.submission&&$n($.submission.formMethod))){lt(I,{matches:ue},{flushSync:xe});return}F=new AbortController;let ae=bs(e.history,I,F.signal,$&&$.submission),ie;if($&&$.pendingError)ie=[Fi(ue).route.id,{type:Oe.error,error:$.pendingError}];else if($&&$.submission&&$n($.submission.formMethod)){let Be=await Gn(ae,I,$.submission,ue,se.active,{replace:$.replace,flushSync:xe});if(Be.shortCircuited)return;if(Be.pendingActionResult){let[Ie,Ze]=Be.pendingActionResult;if(hn(Ze)&&Ju(Ze.error)&&Ze.error.status===404){F=null,lt(I,{matches:Be.matches,loaderData:{},errors:{[Ie]:Ze.error}});return}}ue=Be.matches||ue,ie=Be.pendingActionResult,re=Uc(I,$.submission),xe=!1,se.active=!1,ae=bs(e.history,ae.url,ae.signal)}let{shortCircuited:ce,matches:Pe,loaderData:Me,errors:jt}=await on(ae,I,ue,se.active,re,$&&$.submission,$&&$.fetcherSubmission,$&&$.replace,$&&$.initialHydration===!0,xe,ie);ce||(F=null,lt(I,Ve({matches:Pe||ue},kg(ie),{loaderData:Me,errors:jt})))}async function Gn(L,I,$,B,re,ue){ue===void 0&&(ue={}),Zn();let xe=pN(I,$);if(qe({navigation:xe},{flushSync:ue.flushSync===!0}),re){let ie=await Xa(B,I.pathname,L.signal);if(ie.type==="aborted")return{shortCircuited:!0};if(ie.type==="error"){let ce=Fi(ie.partialMatches).route.id;return{matches:ie.partialMatches,pendingActionResult:[ce,{type:Oe.error,error:ie.error}]}}else if(ie.matches)B=ie.matches;else{let{notFoundMatches:ce,error:Pe,route:Me}=bt(I.pathname);return{matches:ce,pendingActionResult:[Me.id,{type:Oe.error,error:Pe}]}}}let se,ae=Vl(B,I);if(!ae.route.action&&!ae.route.lazy)se={type:Oe.error,error:Xt(405,{method:L.method,pathname:I.pathname,routeId:ae.route.id})};else if(se=(await Qt("action",w,L,[ae],B,null))[ae.route.id],L.signal.aborted)return{shortCircuited:!0};if($i(se)){let ie;return ue&&ue.replace!=null?ie=ue.replace:ie=xg(se.response.headers.get("Location"),new URL(L.url),u)===w.location.pathname+w.location.search,await Z(L,se,!0,{submission:$,replace:ie}),{shortCircuited:!0}}if(oi(se))throw Xt(400,{type:"defer-action"});if(hn(se)){let ie=Fi(B,ae.route.id);return(ue&&ue.replace)!==!0&&(N=ct.Push),{matches:B,pendingActionResult:[ie.route.id,se]}}return{matches:B,pendingActionResult:[ae.route.id,se]}}async function on(L,I,$,B,re,ue,xe,se,ae,ie,ce){let Pe=re||Uc(I,ue),Me=ue||xe||Ng(Pe),jt=!V&&(!h.v7_partialHydration||!ae);if(B){if(jt){let et=Yn(ce);qe(Ve({navigation:Pe},et!==void 0?{actionData:et}:{}),{flushSync:ie})}let ze=await Xa($,I.pathname,L.signal);if(ze.type==="aborted")return{shortCircuited:!0};if(ze.type==="error"){let et=Fi(ze.partialMatches).route.id;return{matches:ze.partialMatches,loaderData:{},errors:{[et]:ze.error}}}else if(ze.matches)$=ze.matches;else{let{error:et,notFoundMatches:vs,route:Cl}=bt(I.pathname);return{matches:vs,loaderData:{},errors:{[Cl.id]:et}}}}let Be=o||l,[Ie,Ze]=pg(e.history,w,$,Me,I,h.v7_partialHydration&&ae===!0,h.v7_skipActionErrorRevalidation,U,q,G,ve,te,D,Be,u,ce);if(er(ze=>!($&&$.some(et=>et.route.id===ze))||Ie&&Ie.some(et=>et.route.id===ze)),W=++z,Ie.length===0&&Ze.length===0){let ze=R();return lt(I,Ve({matches:$,loaderData:{},errors:ce&&hn(ce[1])?{[ce[0]]:ce[1].error}:null},kg(ce),ze?{fetchers:new Map(w.fetchers)}:{}),{flushSync:ie}),{shortCircuited:!0}}if(jt){let ze={};if(!B){ze.navigation=Pe;let et=Yn(ce);et!==void 0&&(ze.actionData=et)}Ze.length>0&&(ze.fetchers=xr(Ze)),qe(ze,{flushSync:ie})}Ze.forEach(ze=>{Ce(ze.key),ze.controller&&X.set(ze.key,ze.controller)});let ys=()=>Ze.forEach(ze=>Ce(ze.key));F&&F.signal.addEventListener("abort",ys);let{loaderResults:Nl,fetcherResults:wr}=await vr(w,$,Ie,Ze,L);if(L.signal.aborted)return{shortCircuited:!0};F&&F.signal.removeEventListener("abort",ys),Ze.forEach(ze=>X.delete(ze.key));let tr=wo(Nl);if(tr)return await Z(L,tr.result,!0,{replace:se}),{shortCircuited:!0};if(tr=wo(wr),tr)return D.add(tr.key),await Z(L,tr.result,!0,{replace:se}),{shortCircuited:!0};let{loaderData:hc,errors:Sl}=vg(w,$,Nl,ce,Ze,wr,Le);Le.forEach((ze,et)=>{ze.subscribe(vs=>{(vs||ze.done)&&Le.delete(et)})}),h.v7_partialHydration&&ae&&w.errors&&(Sl=Ve({},w.errors,Sl));let Ti=R(),Ja=ke(W),Za=Ti||Ja||Ze.length>0;return Ve({matches:$,loaderData:hc,errors:Sl},Za?{fetchers:new Map(w.fetchers)}:{})}function Yn(L){if(L&&!hn(L[1]))return{[L[0]]:L[1].data};if(w.actionData)return Object.keys(w.actionData).length===0?null:w.actionData}function xr(L){return L.forEach(I=>{let $=w.fetchers.get(I.key),B=Fl(void 0,$?$.data:void 0);w.fetchers.set(I.key,B)}),new Map(w.fetchers)}function Xn(L,I,$,B){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");Ce(L);let re=(B&&B.flushSync)===!0,ue=o||l,xe=kh(w.location,w.matches,u,h.v7_prependBasename,$,h.v7_relativeSplatPath,I,B==null?void 0:B.relative),se=Ii(ue,xe,u),ae=Ya(se,ue,xe);if(ae.active&&ae.matches&&(se=ae.matches),!se){H(L,I,Xt(404,{pathname:xe}),{flushSync:re});return}let{path:ie,submission:ce,error:Pe}=hg(h.v7_normalizeFormMethod,!0,xe,B);if(Pe){H(L,I,Pe,{flushSync:re});return}let Me=Vl(se,ie),jt=(B&&B.preventScrollReset)===!0;if(ce&&$n(ce.formMethod)){Jn(L,I,ie,Me,se,ae.active,re,jt,ce);return}te.set(L,{routeId:I,path:ie}),yr(L,I,ie,Me,se,ae.active,re,jt,ce)}async function Jn(L,I,$,B,re,ue,xe,se,ae){Zn(),te.delete(L);function ie(ot){if(!ot.route.action&&!ot.route.lazy){let ws=Xt(405,{method:ae.formMethod,pathname:$,routeId:I});return H(L,I,ws,{flushSync:xe}),!0}return!1}if(!ue&&ie(B))return;let ce=w.fetchers.get(L);_(L,mN(ae,ce),{flushSync:xe});let Pe=new AbortController,Me=bs(e.history,$,Pe.signal,ae);if(ue){let ot=await Xa(re,$,Me.signal);if(ot.type==="aborted")return;if(ot.type==="error"){H(L,I,ot.error,{flushSync:xe});return}else if(ot.matches){if(re=ot.matches,B=Vl(re,$),ie(B))return}else{H(L,I,Xt(404,{pathname:$}),{flushSync:xe});return}}X.set(L,Pe);let jt=z,Ie=(await Qt("action",w,Me,[B],re,L))[B.route.id];if(Me.signal.aborted){X.get(L)===Pe&&X.delete(L);return}if(h.v7_fetcherPersist&&ve.has(L)){if($i(Ie)||hn(Ie)){_(L,Wr(void 0));return}}else{if($i(Ie))if(X.delete(L),W>jt){_(L,Wr(void 0));return}else return D.add(L),_(L,Fl(ae)),Z(Me,Ie,!1,{fetcherSubmission:ae,preventScrollReset:se});if(hn(Ie)){H(L,I,Ie.error);return}}if(oi(Ie))throw Xt(400,{type:"defer-action"});let Ze=w.navigation.location||w.location,ys=bs(e.history,Ze,Pe.signal),Nl=o||l,wr=w.navigation.state!=="idle"?Ii(Nl,w.navigation.location,u):w.matches;je(wr,"Didn't find any matches after fetcher action");let tr=++z;S.set(L,tr);let hc=Fl(ae,Ie.data);w.fetchers.set(L,hc);let[Sl,Ti]=pg(e.history,w,wr,ae,Ze,!1,h.v7_skipActionErrorRevalidation,U,q,G,ve,te,D,Nl,u,[B.route.id,Ie]);Ti.filter(ot=>ot.key!==L).forEach(ot=>{let ws=ot.key,_p=w.fetchers.get(ws),$w=Fl(void 0,_p?_p.data:void 0);w.fetchers.set(ws,$w),Ce(ws),ot.controller&&X.set(ws,ot.controller)}),qe({fetchers:new Map(w.fetchers)});let Ja=()=>Ti.forEach(ot=>Ce(ot.key));Pe.signal.addEventListener("abort",Ja);let{loaderResults:Za,fetcherResults:ze}=await vr(w,wr,Sl,Ti,ys);if(Pe.signal.aborted)return;Pe.signal.removeEventListener("abort",Ja),S.delete(L),X.delete(L),Ti.forEach(ot=>X.delete(ot.key));let et=wo(Za);if(et)return Z(ys,et.result,!1,{preventScrollReset:se});if(et=wo(ze),et)return D.add(et.key),Z(ys,et.result,!1,{preventScrollReset:se});let{loaderData:vs,errors:Cl}=vg(w,wr,Za,void 0,Ti,ze,Le);if(w.fetchers.has(L)){let ot=Wr(Ie.data);w.fetchers.set(L,ot)}ke(tr),w.navigation.state==="loading"&&tr>W?(je(N,"Expected pending action"),F&&F.abort(),lt(w.navigation.location,{matches:wr,loaderData:vs,errors:Cl,fetchers:new Map(w.fetchers)})):(qe({errors:Cl,loaderData:wg(w.loaderData,vs,wr,Cl),fetchers:new Map(w.fetchers)}),U=!1)}async function yr(L,I,$,B,re,ue,xe,se,ae){let ie=w.fetchers.get(L);_(L,Fl(ae,ie?ie.data:void 0),{flushSync:xe});let ce=new AbortController,Pe=bs(e.history,$,ce.signal);if(ue){let Ie=await Xa(re,$,Pe.signal);if(Ie.type==="aborted")return;if(Ie.type==="error"){H(L,I,Ie.error,{flushSync:xe});return}else if(Ie.matches)re=Ie.matches,B=Vl(re,$);else{H(L,I,Xt(404,{pathname:$}),{flushSync:xe});return}}X.set(L,ce);let Me=z,Be=(await Qt("loader",w,Pe,[B],re,L))[B.route.id];if(oi(Be)&&(Be=await cp(Be,Pe.signal,!0)||Be),X.get(L)===ce&&X.delete(L),!Pe.signal.aborted){if(ve.has(L)){_(L,Wr(void 0));return}if($i(Be))if(W>Me){_(L,Wr(void 0));return}else{D.add(L),await Z(Pe,Be,!1,{preventScrollReset:se});return}if(hn(Be)){H(L,I,Be.error);return}je(!oi(Be),"Unhandled fetcher deferred data"),_(L,Wr(Be.data))}}async function Z(L,I,$,B){let{submission:re,fetcherSubmission:ue,preventScrollReset:xe,replace:se}=B===void 0?{}:B;I.response.headers.has("X-Remix-Revalidate")&&(U=!0);let ae=I.response.headers.get("Location");je(ae,"Expected a Location header on the redirect Response"),ae=xg(ae,new URL(L.url),u);let ie=Sa(w.location,ae,{_isRedirect:!0});if(n){let Ie=!1;if(I.response.headers.has("X-Remix-Reload-Document"))Ie=!0;else if(up.test(ae)){const Ze=e.history.createURL(ae);Ie=Ze.origin!==t.location.origin||Dr(Ze.pathname,u)==null}if(Ie){se?t.location.replace(ae):t.location.assign(ae);return}}F=null;let ce=se===!0||I.response.headers.has("X-Remix-Replace")?ct.Replace:ct.Push,{formMethod:Pe,formAction:Me,formEncType:jt}=w.navigation;!re&&!ue&&Pe&&Me&&jt&&(re=Ng(w.navigation));let Be=re||ue;if(G2.has(I.response.status)&&Be&&$n(Be.formMethod))await Vt(ce,ie,{submission:Ve({},Be,{formAction:ae}),preventScrollReset:xe||M,enableViewTransition:$?C:void 0});else{let Ie=Uc(ie,re);await Vt(ce,ie,{overrideNavigation:Ie,fetcherSubmission:ue,preventScrollReset:xe||M,enableViewTransition:$?C:void 0})}}async function Qt(L,I,$,B,re,ue){let xe,se={};try{xe=await rN(c,L,I,$,B,re,ue,s,i)}catch(ae){return B.forEach(ie=>{se[ie.route.id]={type:Oe.error,error:ae}}),se}for(let[ae,ie]of Object.entries(xe))if(uN(ie)){let ce=ie.result;se[ae]={type:Oe.redirect,response:lN(ce,$,ae,re,u,h.v7_relativeSplatPath)}}else se[ae]=await sN(ie);return se}async function vr(L,I,$,B,re){let ue=L.matches,xe=Qt("loader",L,re,$,I,null),se=Promise.all(B.map(async ce=>{if(ce.matches&&ce.match&&ce.controller){let Me=(await Qt("loader",L,bs(e.history,ce.path,ce.controller.signal),[ce.match],ce.matches,ce.key))[ce.match.route.id];return{[ce.key]:Me}}else return Promise.resolve({[ce.key]:{type:Oe.error,error:Xt(404,{pathname:ce.path})}})})),ae=await xe,ie=(await se).reduce((ce,Pe)=>Object.assign(ce,Pe),{});return await Promise.all([hN(I,ae,re.signal,ue,L.loaderData),fN(I,ie,B)]),{loaderResults:ae,fetcherResults:ie}}function Zn(){U=!0,q.push(...er()),te.forEach((L,I)=>{X.has(I)&&G.add(I),Ce(I)})}function _(L,I,$){$===void 0&&($={}),w.fetchers.set(L,I),qe({fetchers:new Map(w.fetchers)},{flushSync:($&&$.flushSync)===!0})}function H(L,I,$,B){B===void 0&&(B={});let re=Fi(w.matches,I);pe(L),qe({errors:{[re.route.id]:$},fetchers:new Map(w.fetchers)},{flushSync:(B&&B.flushSync)===!0})}function fe(L){return h.v7_fetcherPersist&&(P.set(L,(P.get(L)||0)+1),ve.has(L)&&ve.delete(L)),w.fetchers.get(L)||Y2}function pe(L){let I=w.fetchers.get(L);X.has(L)&&!(I&&I.state==="loading"&&S.has(L))&&Ce(L),te.delete(L),S.delete(L),D.delete(L),ve.delete(L),G.delete(L),w.fetchers.delete(L)}function ht(L){if(h.v7_fetcherPersist){let I=(P.get(L)||0)-1;I<=0?(P.delete(L),ve.add(L)):P.set(L,I)}else pe(L);qe({fetchers:new Map(w.fetchers)})}function Ce(L){let I=X.get(L);I&&(I.abort(),X.delete(L))}function at(L){for(let I of L){let $=fe(I),B=Wr($.data);w.fetchers.set(I,B)}}function R(){let L=[],I=!1;for(let $ of D){let B=w.fetchers.get($);je(B,"Expected fetcher: "+$),B.state==="loading"&&(D.delete($),L.push($),I=!0)}return at(L),I}function ke(L){let I=[];for(let[$,B]of S)if(B<L){let re=w.fetchers.get($);je(re,"Expected fetcher: "+$),re.state==="loading"&&(Ce($),S.delete($),I.push($))}return at(I),I.length>0}function Je(L,I){let $=w.blockers.get(L)||Il;return we.get(L)!==I&&we.set(L,I),$}function vn(L){w.blockers.delete(L),we.delete(L)}function Pi(L,I){let $=w.blockers.get(L)||Il;je($.state==="unblocked"&&I.state==="blocked"||$.state==="blocked"&&I.state==="blocked"||$.state==="blocked"&&I.state==="proceeding"||$.state==="blocked"&&I.state==="unblocked"||$.state==="proceeding"&&I.state==="unblocked","Invalid blocker state transition: "+$.state+" -> "+I.state);let B=new Map(w.blockers);B.set(L,I),qe({blockers:B})}function xs(L){let{currentLocation:I,nextLocation:$,historyAction:B}=L;if(we.size===0)return;we.size>1&&fl(!1,"A router only supports one blocker at a time");let re=Array.from(we.entries()),[ue,xe]=re[re.length-1],se=w.blockers.get(ue);if(!(se&&se.state==="proceeding")&&xe({currentLocation:I,nextLocation:$,historyAction:B}))return ue}function bt(L){let I=Xt(404,{pathname:L}),$=o||l,{matches:B,route:re}=bg($);return er(),{notFoundMatches:B,route:re,error:I}}function er(L){let I=[];return Le.forEach(($,B)=>{(!L||L(B))&&($.cancel(),I.push(B),Le.delete(B))}),I}function In(L,I,$){if(m=L,k=I,g=$||null,!y&&w.navigation===Bc){y=!0;let B=Op(w.location,w.matches);B!=null&&qe({restoreScrollPosition:B})}return()=>{m=null,k=null,g=null}}function Dp(L,I){return g&&g(L,I.map(B=>E2(B,w.loaderData)))||L.key}function Dw(L,I){if(m&&k){let $=Dp(L,I);m[$]=k()}}function Op(L,I){if(m){let $=Dp(L,I),B=m[$];if(typeof B=="number")return B}return null}function Ya(L,I,$){if(d)if(L){if(Object.keys(L[0].params).length>0)return{active:!0,matches:$o(I,$,u,!0)}}else return{active:!0,matches:$o(I,$,u,!0)||[]};return{active:!1,matches:null}}async function Xa(L,I,$){if(!d)return{type:"success",matches:L};let B=L;for(;;){let re=o==null,ue=o||l,xe=s;try{await d({path:I,matches:B,patch:(ie,ce)=>{$.aborted||gg(ie,ce,ue,xe,i)}})}catch(ie){return{type:"error",error:ie,partialMatches:B}}finally{re&&!$.aborted&&(l=[...l])}if($.aborted)return{type:"aborted"};let se=Ii(ue,I,u);if(se)return{type:"success",matches:se};let ae=$o(ue,I,u,!0);if(!ae||B.length===ae.length&&B.every((ie,ce)=>ie.route.id===ae[ce].route.id))return{type:"success",matches:null};B=ae}}function Ow(L){s={},o=yu(L,i,void 0,s)}function _w(L,I){let $=o==null;gg(L,I,o||l,s,i),$&&(l=[...l],qe({}))}return E={get basename(){return u},get future(){return h},get state(){return w},get routes(){return l},get window(){return t},initialize:_t,subscribe:Lt,enableScrollRestoration:In,navigate:zn,fetch:Xn,revalidate:An,createHref:L=>e.history.createHref(L),encodeLocation:L=>e.history.encodeLocation(L),getFetcher:fe,deleteFetcher:ht,dispose:an,getBlocker:Je,deleteBlocker:vn,patchRoutes:_w,_internalFetchControllers:X,_internalActiveDeferreds:Le,_internalSetRoutes:Ow},E}function Z2(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function kh(e,t,n,r,i,s,l,o){let u,c;if(l){u=[];for(let h of t)if(u.push(h),h.route.id===l){c=h;break}}else u=t,c=t[t.length-1];let d=Xu(i||".",Yu(u,s),Dr(e.pathname,n)||e.pathname,o==="path");if(i==null&&(d.search=e.search,d.hash=e.hash),(i==null||i===""||i===".")&&c){let h=dp(d.search);if(c.route.index&&!h)d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index";else if(!c.route.index&&h){let p=new URLSearchParams(d.search),f=p.getAll("index");p.delete("index"),f.filter(g=>g).forEach(g=>p.append("index",g));let m=p.toString();d.search=m?"?"+m:""}}return r&&n!=="/"&&(d.pathname=d.pathname==="/"?n:Lr([n,d.pathname])),us(d)}function hg(e,t,n,r){if(!r||!Z2(r))return{path:n};if(r.formMethod&&!dN(r.formMethod))return{path:n,error:Xt(405,{method:r.formMethod})};let i=()=>({path:n,error:Xt(400,{type:"invalid-body"})}),s=r.formMethod||"get",l=e?s.toUpperCase():s.toLowerCase(),o=r0(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!$n(l))return i();let p=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((f,m)=>{let[g,k]=m;return""+f+g+"="+k+`
450
+ `},""):String(r.body);return{path:n,submission:{formMethod:l,formAction:o,formEncType:r.formEncType,formData:void 0,json:void 0,text:p}}}else if(r.formEncType==="application/json"){if(!$n(l))return i();try{let p=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:l,formAction:o,formEncType:r.formEncType,formData:void 0,json:p,text:void 0}}}catch{return i()}}}je(typeof FormData=="function","FormData is not available in this environment");let u,c;if(r.formData)u=jh(r.formData),c=r.formData;else if(r.body instanceof FormData)u=jh(r.body),c=r.body;else if(r.body instanceof URLSearchParams)u=r.body,c=yg(u);else if(r.body==null)u=new URLSearchParams,c=new FormData;else try{u=new URLSearchParams(r.body),c=yg(u)}catch{return i()}let d={formMethod:l,formAction:o,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:c,json:void 0,text:void 0};if($n(d.formMethod))return{path:n,submission:d};let h=Ni(n);return t&&h.search&&dp(h.search)&&u.append("index",""),h.search="?"+u,{path:us(h),submission:d}}function fg(e,t,n){n===void 0&&(n=!1);let r=e.findIndex(i=>i.route.id===t);return r>=0?e.slice(0,n?r+1:r):e}function pg(e,t,n,r,i,s,l,o,u,c,d,h,p,f,m,g){let k=g?hn(g[1])?g[1].error:g[1].data:void 0,y=e.createURL(t.location),x=e.createURL(i),v=n;s&&t.errors?v=fg(n,Object.keys(t.errors)[0],!0):g&&hn(g[1])&&(v=fg(n,g[0]));let j=g?g[1].statusCode:void 0,E=l&&j&&j>=400,w=v.filter((M,F)=>{let{route:C}=M;if(C.lazy)return!0;if(C.loader==null)return!1;if(s)return bh(C,t.loaderData,t.errors);if(eN(t.loaderData,t.matches[F],M)||u.some(V=>V===M.route.id))return!0;let O=t.matches[F],A=M;return mg(M,Ve({currentUrl:y,currentParams:O.params,nextUrl:x,nextParams:A.params},r,{actionResult:k,actionStatus:j,defaultShouldRevalidate:E?!1:o||y.pathname+y.search===x.pathname+x.search||y.search!==x.search||t0(O,A)}))}),N=[];return h.forEach((M,F)=>{if(s||!n.some(U=>U.route.id===M.routeId)||d.has(F))return;let C=Ii(f,M.path,m);if(!C){N.push({key:F,routeId:M.routeId,path:M.path,matches:null,match:null,controller:null});return}let O=t.fetchers.get(F),A=Vl(C,M.path),V=!1;p.has(F)?V=!1:c.has(F)?(c.delete(F),V=!0):O&&O.state!=="idle"&&O.data===void 0?V=o:V=mg(A,Ve({currentUrl:y,currentParams:t.matches[t.matches.length-1].params,nextUrl:x,nextParams:n[n.length-1].params},r,{actionResult:k,actionStatus:j,defaultShouldRevalidate:E?!1:o})),V&&N.push({key:F,routeId:M.routeId,path:M.path,matches:C,match:A,controller:new AbortController})}),[w,N]}function bh(e,t,n){if(e.lazy)return!0;if(!e.loader)return!1;let r=t!=null&&t[e.id]!==void 0,i=n!=null&&n[e.id]!==void 0;return!r&&i?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!i}function eN(e,t,n){let r=!t||n.route.id!==t.route.id,i=e[n.route.id]===void 0;return r||i}function t0(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function mg(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function gg(e,t,n,r,i){var s;let l;if(e){let c=r[e];je(c,"No route found to patch children into: routeId = "+e),c.children||(c.children=[]),l=c.children}else l=n;let o=t.filter(c=>!l.some(d=>n0(c,d))),u=yu(o,i,[e||"_","patch",String(((s=l)==null?void 0:s.length)||"0")],r);l.push(...u)}function n0(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>{var i;return(i=t.children)==null?void 0:i.some(s=>n0(n,s))}):!1}async function tN(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let i=n[e.id];je(i,"No route found in manifest");let s={};for(let l in r){let u=i[l]!==void 0&&l!=="hasErrorBoundary";fl(!u,'Route "'+i.id+'" has a static property "'+l+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+l+'" will be ignored.')),!u&&!S2.has(l)&&(s[l]=r[l])}Object.assign(i,s),Object.assign(i,Ve({},t(i),{lazy:void 0}))}async function nN(e){let{matches:t}=e,n=t.filter(i=>i.shouldLoad);return(await Promise.all(n.map(i=>i.resolve()))).reduce((i,s,l)=>Object.assign(i,{[n[l].route.id]:s}),{})}async function rN(e,t,n,r,i,s,l,o,u,c){let d=s.map(f=>f.route.lazy?tN(f.route,u,o):void 0),h=s.map((f,m)=>{let g=d[m],k=i.some(x=>x.route.id===f.route.id);return Ve({},f,{shouldLoad:k,resolve:async x=>(x&&r.method==="GET"&&(f.route.lazy||f.route.loader)&&(k=!0),k?iN(t,r,f,g,x,c):Promise.resolve({type:Oe.data,result:void 0}))})}),p=await e({matches:h,request:r,params:s[0].params,fetcherKey:l,context:c});try{await Promise.all(d)}catch{}return p}async function iN(e,t,n,r,i,s){let l,o,u=c=>{let d,h=new Promise((m,g)=>d=g);o=()=>d(),t.signal.addEventListener("abort",o);let p=m=>typeof c!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+n.route.id+"]"))):c({request:t,params:n.params,context:s},...m!==void 0?[m]:[]),f=(async()=>{try{return{type:"data",result:await(i?i(g=>p(g)):p())}}catch(m){return{type:"error",result:m}}})();return Promise.race([f,h])};try{let c=n.route[e];if(r)if(c){let d,[h]=await Promise.all([u(c).catch(p=>{d=p}),r]);if(d!==void 0)throw d;l=h}else if(await r,c=n.route[e],c)l=await u(c);else if(e==="action"){let d=new URL(t.url),h=d.pathname+d.search;throw Xt(405,{method:t.method,pathname:h,routeId:n.route.id})}else return{type:Oe.data,result:void 0};else if(c)l=await u(c);else{let d=new URL(t.url),h=d.pathname+d.search;throw Xt(404,{pathname:h})}je(l.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(c){return{type:Oe.error,result:c}}finally{o&&t.signal.removeEventListener("abort",o)}return l}async function sN(e){let{result:t,type:n}=e;if(i0(t)){let c;try{let d=t.headers.get("Content-Type");d&&/\bapplication\/json\b/.test(d)?t.body==null?c=null:c=await t.json():c=await t.text()}catch(d){return{type:Oe.error,error:d}}return n===Oe.error?{type:Oe.error,error:new wu(t.status,t.statusText,c),statusCode:t.status,headers:t.headers}:{type:Oe.data,data:c,statusCode:t.status,headers:t.headers}}if(n===Oe.error){if(jg(t)){var r;if(t.data instanceof Error){var i;return{type:Oe.error,error:t.data,statusCode:(i=t.init)==null?void 0:i.status}}t=new wu(((r=t.init)==null?void 0:r.status)||500,void 0,t.data)}return{type:Oe.error,error:t,statusCode:Ju(t)?t.status:void 0}}if(cN(t)){var s,l;return{type:Oe.deferred,deferredData:t,statusCode:(s=t.init)==null?void 0:s.status,headers:((l=t.init)==null?void 0:l.headers)&&new Headers(t.init.headers)}}if(jg(t)){var o,u;return{type:Oe.data,data:t.data,statusCode:(o=t.init)==null?void 0:o.status,headers:(u=t.init)!=null&&u.headers?new Headers(t.init.headers):void 0}}return{type:Oe.data,data:t}}function lN(e,t,n,r,i,s){let l=e.headers.get("Location");if(je(l,"Redirects returned/thrown from loaders/actions must have a Location header"),!up.test(l)){let o=r.slice(0,r.findIndex(u=>u.route.id===n)+1);l=kh(new URL(t.url),o,i,!0,l,s),e.headers.set("Location",l)}return e}function xg(e,t,n){if(up.test(e)){let r=e,i=r.startsWith("//")?new URL(t.protocol+r):new URL(r),s=Dr(i.pathname,n)!=null;if(i.origin===t.origin&&s)return i.pathname+i.search+i.hash}return e}function bs(e,t,n,r){let i=e.createURL(r0(t)).toString(),s={signal:n};if(r&&$n(r.formMethod)){let{formMethod:l,formEncType:o}=r;s.method=l.toUpperCase(),o==="application/json"?(s.headers=new Headers({"Content-Type":o}),s.body=JSON.stringify(r.json)):o==="text/plain"?s.body=r.text:o==="application/x-www-form-urlencoded"&&r.formData?s.body=jh(r.formData):s.body=r.formData}return new Request(i,s)}function jh(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function yg(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function aN(e,t,n,r,i){let s={},l=null,o,u=!1,c={},d=n&&hn(n[1])?n[1].error:void 0;return e.forEach(h=>{if(!(h.route.id in t))return;let p=h.route.id,f=t[p];if(je(!$i(f),"Cannot handle redirect results in processLoaderData"),hn(f)){let m=f.error;d!==void 0&&(m=d,d=void 0),l=l||{};{let g=Fi(e,p);l[g.route.id]==null&&(l[g.route.id]=m)}s[p]=void 0,u||(u=!0,o=Ju(f.error)?f.error.status:500),f.headers&&(c[p]=f.headers)}else oi(f)?(r.set(p,f.deferredData),s[p]=f.deferredData.data,f.statusCode!=null&&f.statusCode!==200&&!u&&(o=f.statusCode),f.headers&&(c[p]=f.headers)):(s[p]=f.data,f.statusCode&&f.statusCode!==200&&!u&&(o=f.statusCode),f.headers&&(c[p]=f.headers))}),d!==void 0&&n&&(l={[n[0]]:d},s[n[0]]=void 0),{loaderData:s,errors:l,statusCode:o||200,loaderHeaders:c}}function vg(e,t,n,r,i,s,l){let{loaderData:o,errors:u}=aN(t,n,r,l);return i.forEach(c=>{let{key:d,match:h,controller:p}=c,f=s[d];if(je(f,"Did not find corresponding fetcher result"),!(p&&p.signal.aborted))if(hn(f)){let m=Fi(e.matches,h==null?void 0:h.route.id);u&&u[m.route.id]||(u=Ve({},u,{[m.route.id]:f.error})),e.fetchers.delete(d)}else if($i(f))je(!1,"Unhandled fetcher revalidation redirect");else if(oi(f))je(!1,"Unhandled fetcher deferred data");else{let m=Wr(f.data);e.fetchers.set(d,m)}}),{loaderData:o,errors:u}}function wg(e,t,n,r){let i=Ve({},t);for(let s of n){let l=s.route.id;if(t.hasOwnProperty(l)?t[l]!==void 0&&(i[l]=t[l]):e[l]!==void 0&&s.route.loader&&(i[l]=e[l]),r&&r.hasOwnProperty(l))break}return i}function kg(e){return e?hn(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Fi(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function bg(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Xt(e,t){let{pathname:n,routeId:r,method:i,type:s,message:l}=t===void 0?{}:t,o="Unknown Server Error",u="Unknown @remix-run/router error";return e===400?(o="Bad Request",i&&n&&r?u="You made a "+i+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":s==="defer-action"?u="defer() is not supported in actions":s==="invalid-body"&&(u="Unable to encode submission body")):e===403?(o="Forbidden",u='Route "'+r+'" does not match URL "'+n+'"'):e===404?(o="Not Found",u='No route matches URL "'+n+'"'):e===405&&(o="Method Not Allowed",i&&n&&r?u="You made a "+i.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":i&&(u='Invalid request method "'+i.toUpperCase()+'"')),new wu(e||500,o,new Error(u),!0)}function wo(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,i]=t[n];if($i(i))return{key:r,result:i}}}function r0(e){let t=typeof e=="string"?Ni(e):e;return us(Ve({},t,{hash:""}))}function oN(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function uN(e){return i0(e.result)&&K2.has(e.result.status)}function oi(e){return e.type===Oe.deferred}function hn(e){return e.type===Oe.error}function $i(e){return(e&&e.type)===Oe.redirect}function jg(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function cN(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function i0(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function dN(e){return Q2.has(e.toLowerCase())}function $n(e){return W2.has(e.toLowerCase())}async function hN(e,t,n,r,i){let s=Object.entries(t);for(let l=0;l<s.length;l++){let[o,u]=s[l],c=e.find(p=>(p==null?void 0:p.route.id)===o);if(!c)continue;let d=r.find(p=>p.route.id===c.route.id),h=d!=null&&!t0(d,c)&&(i&&i[c.route.id])!==void 0;oi(u)&&h&&await cp(u,n,!1).then(p=>{p&&(t[o]=p)})}}async function fN(e,t,n){for(let r=0;r<n.length;r++){let{key:i,routeId:s,controller:l}=n[r],o=t[i];e.find(c=>(c==null?void 0:c.route.id)===s)&&oi(o)&&(je(l,"Expected an AbortController for revalidating fetcher deferred result"),await cp(o,l.signal,!0).then(c=>{c&&(t[i]=c)}))}}async function cp(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:Oe.data,data:e.deferredData.unwrappedData}}catch(i){return{type:Oe.error,error:i}}return{type:Oe.data,data:e.deferredData.data}}}function dp(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Vl(e,t){let n=typeof t=="string"?Ni(t).search:t.search;if(e[e.length-1].route.index&&dp(n||""))return e[e.length-1];let r=J1(e);return r[r.length-1]}function Ng(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:s,json:l}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(s!=null)return{formMethod:t,formAction:n,formEncType:r,formData:s,json:void 0,text:void 0};if(l!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:l,text:void 0}}}function Uc(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function pN(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Fl(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function mN(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Wr(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function gN(e,t){try{let n=e.sessionStorage.getItem(e0);if(n){let r=JSON.parse(n);for(let[i,s]of Object.entries(r||{}))s&&Array.isArray(s)&&t.set(i,new Set(s||[]))}}catch{}}function xN(e,t){if(t.size>0){let n={};for(let[r,i]of t)n[r]=[...i];try{e.sessionStorage.setItem(e0,JSON.stringify(n))}catch(r){fl(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/**
451
+ * React Router v6.28.0
452
+ *
453
+ * Copyright (c) Remix Software Inc.
454
+ *
455
+ * This source code is licensed under the MIT license found in the
456
+ * LICENSE.md file in the root directory of this source tree.
457
+ *
458
+ * @license MIT
459
+ */function ku(){return ku=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ku.apply(this,arguments)}const qa=b.createContext(null),hp=b.createContext(null),_r=b.createContext(null),fp=b.createContext(null),mr=b.createContext({outlet:null,matches:[],isDataRoute:!1}),s0=b.createContext(null);function yN(e,t){let{relative:n}=t===void 0?{}:t;wl()||je(!1);let{basename:r,navigator:i}=b.useContext(_r),{hash:s,pathname:l,search:o}=Zu(e,{relative:n}),u=l;return r!=="/"&&(u=l==="/"?r:Lr([r,l])),i.createHref({pathname:u,search:o,hash:s})}function wl(){return b.useContext(fp)!=null}function Si(){return wl()||je(!1),b.useContext(fp).location}function l0(e){b.useContext(_r).static||b.useLayoutEffect(e)}function gt(){let{isDataRoute:e}=b.useContext(mr);return e?RN():vN()}function vN(){wl()||je(!1);let e=b.useContext(qa),{basename:t,future:n,navigator:r}=b.useContext(_r),{matches:i}=b.useContext(mr),{pathname:s}=Si(),l=JSON.stringify(Yu(i,n.v7_relativeSplatPath)),o=b.useRef(!1);return l0(()=>{o.current=!0}),b.useCallback(function(c,d){if(d===void 0&&(d={}),!o.current)return;if(typeof c=="number"){r.go(c);return}let h=Xu(c,JSON.parse(l),s,d.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:Lr([t,h.pathname])),(d.replace?r.replace:r.push)(h,d.state,d)},[t,r,l,s,e])}const wN=b.createContext(null);function kN(e){let t=b.useContext(mr).outlet;return t&&b.createElement(wN.Provider,{value:e},t)}function $r(){let{matches:e}=b.useContext(mr),t=e[e.length-1];return t?t.params:{}}function Zu(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=b.useContext(_r),{matches:i}=b.useContext(mr),{pathname:s}=Si(),l=JSON.stringify(Yu(i,r.v7_relativeSplatPath));return b.useMemo(()=>Xu(e,JSON.parse(l),s,n==="path"),[e,l,s,n])}function bN(e,t,n,r){wl()||je(!1);let{navigator:i}=b.useContext(_r),{matches:s}=b.useContext(mr),l=s[s.length-1],o=l?l.params:{};l&&l.pathname;let u=l?l.pathnameBase:"/";l&&l.route;let c=Si(),d;d=c;let h=d.pathname||"/",p=h;if(u!=="/"){let g=u.replace(/^\//,"").split("/");p="/"+h.replace(/^\//,"").split("/").slice(g.length).join("/")}let f=Ii(e,{pathname:p});return EN(f&&f.map(g=>Object.assign({},g,{params:Object.assign({},o,g.params),pathname:Lr([u,i.encodeLocation?i.encodeLocation(g.pathname).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?u:Lr([u,i.encodeLocation?i.encodeLocation(g.pathnameBase).pathname:g.pathnameBase])})),s,n,r)}function jN(){let e=MN(),t=Ju(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},t),n?b.createElement("pre",{style:i},n):null,null)}const NN=b.createElement(jN,null);class SN extends b.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?b.createElement(mr.Provider,{value:this.props.routeContext},b.createElement(s0.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function CN(e){let{routeContext:t,match:n,children:r}=e,i=b.useContext(qa);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),b.createElement(mr.Provider,{value:t},r)}function EN(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var s;if(!n)return null;if(n.errors)e=n.matches;else if((s=r)!=null&&s.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let l=e,o=(i=n)==null?void 0:i.errors;if(o!=null){let d=l.findIndex(h=>h.route.id&&(o==null?void 0:o[h.route.id])!==void 0);d>=0||je(!1),l=l.slice(0,Math.min(l.length,d+1))}let u=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d<l.length;d++){let h=l[d];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(c=d),h.route.id){let{loaderData:p,errors:f}=n,m=h.route.loader&&p[h.route.id]===void 0&&(!f||f[h.route.id]===void 0);if(h.route.lazy||m){u=!0,c>=0?l=l.slice(0,c+1):l=[l[0]];break}}}return l.reduceRight((d,h,p)=>{let f,m=!1,g=null,k=null;n&&(f=o&&h.route.id?o[h.route.id]:void 0,g=h.route.errorElement||NN,u&&(c<0&&p===0?(zN("route-fallback"),m=!0,k=null):c===p&&(m=!0,k=h.route.hydrateFallbackElement||null)));let y=t.concat(l.slice(0,p+1)),x=()=>{let v;return f?v=g:m?v=k:h.route.Component?v=b.createElement(h.route.Component,null):h.route.element?v=h.route.element:v=d,b.createElement(CN,{match:h,routeContext:{outlet:d,matches:y,isDataRoute:n!=null},children:v})};return n&&(h.route.ErrorBoundary||h.route.errorElement||p===0)?b.createElement(SN,{location:n.location,revalidation:n.revalidation,component:g,error:f,children:x(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):x()},null)}var a0=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(a0||{}),o0=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(o0||{});function PN(e){let t=b.useContext(qa);return t||je(!1),t}function TN(e){let t=b.useContext(hp);return t||je(!1),t}function LN(e){let t=b.useContext(mr);return t||je(!1),t}function u0(e){let t=LN(),n=t.matches[t.matches.length-1];return n.route.id||je(!1),n.route.id}function MN(){var e;let t=b.useContext(s0),n=TN(),r=u0();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function RN(){let{router:e}=PN(a0.UseNavigateStable),t=u0(o0.UseNavigateStable),n=b.useRef(!1);return l0(()=>{n.current=!0}),b.useCallback(function(i,s){s===void 0&&(s={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,ku({fromRouteId:t},s)))},[e,t])}const Sg={};function zN(e,t,n){Sg[e]||(Sg[e]=!0)}const Cg={};function AN(e,t){Cg[t]||(Cg[t]=!0,console.warn(t))}const js=(e,t,n)=>AN(e,"⚠️ React Router Future Flag Warning: "+t+". "+("You can use the `"+e+"` future flag to opt-in early. ")+("For more information, see "+n+"."));function IN(e,t){e!=null&&e.v7_startTransition||js("v7_startTransition","React Router will begin wrapping state updates in `React.startTransition` in v7","https://reactrouter.com/v6/upgrading/future#v7_starttransition"),!(e!=null&&e.v7_relativeSplatPath)&&(!t||!t.v7_relativeSplatPath)&&js("v7_relativeSplatPath","Relative route resolution within Splat routes is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath"),t&&(t.v7_fetcherPersist||js("v7_fetcherPersist","The persistence behavior of fetchers is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_fetcherpersist"),t.v7_normalizeFormMethod||js("v7_normalizeFormMethod","Casing of `formMethod` fields is being normalized to uppercase in v7","https://reactrouter.com/v6/upgrading/future#v7_normalizeformmethod"),t.v7_partialHydration||js("v7_partialHydration","`RouterProvider` hydration behavior is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_partialhydration"),t.v7_skipActionErrorRevalidation||js("v7_skipActionErrorRevalidation","The revalidation behavior after 4xx/5xx `action` responses is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_skipactionerrorrevalidation"))}function FN(e){let{to:t,replace:n,state:r,relative:i}=e;wl()||je(!1);let{future:s,static:l}=b.useContext(_r),{matches:o}=b.useContext(mr),{pathname:u}=Si(),c=gt(),d=Xu(t,Yu(o,s.v7_relativeSplatPath),u,i==="path"),h=JSON.stringify(d);return b.useEffect(()=>c(JSON.parse(h),{replace:n,state:r,relative:i}),[c,h,i,n,r]),null}function c0(e){return kN(e.context)}function DN(e){let{basename:t="/",children:n=null,location:r,navigationType:i=ct.Pop,navigator:s,static:l=!1,future:o}=e;wl()&&je(!1);let u=t.replace(/^\/*/,"/"),c=b.useMemo(()=>({basename:u,navigator:s,static:l,future:ku({v7_relativeSplatPath:!1},o)}),[u,o,s,l]);typeof r=="string"&&(r=Ni(r));let{pathname:d="/",search:h="",hash:p="",state:f=null,key:m="default"}=r,g=b.useMemo(()=>{let k=Dr(d,u);return k==null?null:{location:{pathname:k,search:h,hash:p,state:f,key:m},navigationType:i}},[u,d,h,p,f,m,i]);return g==null?null:b.createElement(_r.Provider,{value:c},b.createElement(fp.Provider,{children:n,value:g}))}new Promise(()=>{});function ON(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:b.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:b.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:b.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/**
460
+ * React Router DOM v6.28.0
461
+ *
462
+ * Copyright (c) Remix Software Inc.
463
+ *
464
+ * This source code is licensed under the MIT license found in the
465
+ * LICENSE.md file in the root directory of this source tree.
466
+ *
467
+ * @license MIT
468
+ */function pl(){return pl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pl.apply(this,arguments)}function d0(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,s;for(s=0;s<r.length;s++)i=r[s],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function _N(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function $N(e,t){return e.button===0&&(!t||t==="_self")&&!_N(e)}function Nh(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function qN(e,t){let n=Nh(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(s=>{n.append(i,s)})}),n}const BN=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],UN=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],HN="6";try{window.__reactRouterVersion=HN}catch{}function WN(e,t){return J2({basename:void 0,future:pl({},void 0,{v7_prependBasename:!0}),history:b2({window:void 0}),hydrationData:VN(),routes:e,mapRouteProperties:ON,dataStrategy:void 0,patchRoutesOnNavigation:void 0,window:void 0}).initialize()}function VN(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=pl({},t,{errors:QN(t.errors)})),t}function QN(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,i]of t)if(i&&i.__type==="RouteErrorResponse")n[r]=new wu(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){if(i.__subType){let s=window[i.__subType];if(typeof s=="function")try{let l=new s(i.message);l.stack="",n[r]=l}catch{}}if(n[r]==null){let s=new Error(i.message);s.stack="",n[r]=s}}else n[r]=i;return n}const h0=b.createContext({isTransitioning:!1}),KN=b.createContext(new Map),GN="startTransition",Eg=sk[GN],YN="flushSync",Pg=vj[YN];function XN(e){Eg?Eg(e):e()}function Dl(e){Pg?Pg(e):e()}class JN{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function ZN(e){let{fallbackElement:t,router:n,future:r}=e,[i,s]=b.useState(n.state),[l,o]=b.useState(),[u,c]=b.useState({isTransitioning:!1}),[d,h]=b.useState(),[p,f]=b.useState(),[m,g]=b.useState(),k=b.useRef(new Map),{v7_startTransition:y}=r||{},x=b.useCallback(M=>{y?XN(M):M()},[y]),v=b.useCallback((M,F)=>{let{deletedFetchers:C,flushSync:O,viewTransitionOpts:A}=F;C.forEach(U=>k.current.delete(U)),M.fetchers.forEach((U,q)=>{U.data!==void 0&&k.current.set(q,U.data)});let V=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!A||V){O?Dl(()=>s(M)):x(()=>s(M));return}if(O){Dl(()=>{p&&(d&&d.resolve(),p.skipTransition()),c({isTransitioning:!0,flushSync:!0,currentLocation:A.currentLocation,nextLocation:A.nextLocation})});let U=n.window.document.startViewTransition(()=>{Dl(()=>s(M))});U.finished.finally(()=>{Dl(()=>{h(void 0),f(void 0),o(void 0),c({isTransitioning:!1})})}),Dl(()=>f(U));return}p?(d&&d.resolve(),p.skipTransition(),g({state:M,currentLocation:A.currentLocation,nextLocation:A.nextLocation})):(o(M),c({isTransitioning:!0,flushSync:!1,currentLocation:A.currentLocation,nextLocation:A.nextLocation}))},[n.window,p,d,k,x]);b.useLayoutEffect(()=>n.subscribe(v),[n,v]),b.useEffect(()=>{u.isTransitioning&&!u.flushSync&&h(new JN)},[u]),b.useEffect(()=>{if(d&&l&&n.window){let M=l,F=d.promise,C=n.window.document.startViewTransition(async()=>{x(()=>s(M)),await F});C.finished.finally(()=>{h(void 0),f(void 0),o(void 0),c({isTransitioning:!1})}),f(C)}},[x,l,d,n.window]),b.useEffect(()=>{d&&l&&i.location.key===l.location.key&&d.resolve()},[d,p,i.location,l]),b.useEffect(()=>{!u.isTransitioning&&m&&(o(m.state),c({isTransitioning:!0,flushSync:!1,currentLocation:m.currentLocation,nextLocation:m.nextLocation}),g(void 0))},[u.isTransitioning,m]),b.useEffect(()=>{},[]);let j=b.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:M=>n.navigate(M),push:(M,F,C)=>n.navigate(M,{state:F,preventScrollReset:C==null?void 0:C.preventScrollReset}),replace:(M,F,C)=>n.navigate(M,{replace:!0,state:F,preventScrollReset:C==null?void 0:C.preventScrollReset})}),[n]),E=n.basename||"/",w=b.useMemo(()=>({router:n,navigator:j,static:!1,basename:E}),[n,j,E]),N=b.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return b.useEffect(()=>IN(r,n.future),[r,n.future]),b.createElement(b.Fragment,null,b.createElement(qa.Provider,{value:w},b.createElement(hp.Provider,{value:i},b.createElement(KN.Provider,{value:k.current},b.createElement(h0.Provider,{value:u},b.createElement(DN,{basename:E,location:i.location,navigationType:i.historyAction,navigator:j,future:N},i.initialized||n.future.v7_partialHydration?b.createElement(eS,{routes:n.routes,future:n.future,state:i}):t))))),null)}const eS=b.memo(tS);function tS(e){let{routes:t,future:n,state:r}=e;return bN(t,void 0,r,n)}const nS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",rS=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ft=b.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:s,replace:l,state:o,target:u,to:c,preventScrollReset:d,viewTransition:h}=t,p=d0(t,BN),{basename:f}=b.useContext(_r),m,g=!1;if(typeof c=="string"&&rS.test(c)&&(m=c,nS))try{let v=new URL(window.location.href),j=c.startsWith("//")?new URL(v.protocol+c):new URL(c),E=Dr(j.pathname,f);j.origin===v.origin&&E!=null?c=E+j.search+j.hash:g=!0}catch{}let k=yN(c,{relative:i}),y=sS(c,{replace:l,state:o,target:u,preventScrollReset:d,relative:i,viewTransition:h});function x(v){r&&r(v),v.defaultPrevented||y(v)}return b.createElement("a",pl({},p,{href:m||k,onClick:g||s?r:x,ref:n,target:u}))}),Sh=b.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:i=!1,className:s="",end:l=!1,style:o,to:u,viewTransition:c,children:d}=t,h=d0(t,UN),p=Zu(u,{relative:h.relative}),f=Si(),m=b.useContext(hp),{navigator:g,basename:k}=b.useContext(_r),y=m!=null&&lS(p)&&c===!0,x=g.encodeLocation?g.encodeLocation(p).pathname:p.pathname,v=f.pathname,j=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;i||(v=v.toLowerCase(),j=j?j.toLowerCase():null,x=x.toLowerCase()),j&&k&&(j=Dr(j,k)||j);const E=x!=="/"&&x.endsWith("/")?x.length-1:x.length;let w=v===x||!l&&v.startsWith(x)&&v.charAt(E)==="/",N=j!=null&&(j===x||!l&&j.startsWith(x)&&j.charAt(x.length)==="/"),M={isActive:w,isPending:N,isTransitioning:y},F=w?r:void 0,C;typeof s=="function"?C=s(M):C=[s,w?"active":null,N?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let O=typeof o=="function"?o(M):o;return b.createElement(ft,pl({},h,{"aria-current":F,className:C,ref:n,style:O,to:u,viewTransition:c}),typeof d=="function"?d(M):d)});var Ch;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Ch||(Ch={}));var Tg;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Tg||(Tg={}));function iS(e){let t=b.useContext(qa);return t||je(!1),t}function sS(e,t){let{target:n,replace:r,state:i,preventScrollReset:s,relative:l,viewTransition:o}=t===void 0?{}:t,u=gt(),c=Si(),d=Zu(e,{relative:l});return b.useCallback(h=>{if($N(h,n)){h.preventDefault();let p=r!==void 0?r:us(c)===us(d);u(e,{replace:p,state:i,preventScrollReset:s,relative:l,viewTransition:o})}},[c,u,d,r,i,n,e,s,l,o])}function ec(e){let t=b.useRef(Nh(e)),n=b.useRef(!1),r=Si(),i=b.useMemo(()=>qN(r.search,n.current?null:t.current),[r.search]),s=gt(),l=b.useCallback((o,u)=>{const c=Nh(typeof o=="function"?o(i):o);n.current=!0,s("?"+c,u)},[s,i]);return[i,l]}function lS(e,t){t===void 0&&(t={});let n=b.useContext(h0);n==null&&je(!1);let{basename:r}=iS(Ch.useViewTransitionState),i=Zu(e,{relative:t.relative});if(!n.isTransitioning)return!1;let s=Dr(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=Dr(n.nextLocation.pathname,r)||n.nextLocation.pathname;return vu(i.pathname,l)!=null||vu(i.pathname,s)!=null}const Lg=[{title:"Start here",sections:[{id:"start",title:"The idea in one minute",what:"cognitune helps you understand code, not just read it. It asks a model to explain, then makes you answer, explain back and find bugs, and it brings things back when you are about to forget them.",steps:["Open a folder (Projects page). cognitune only reads it. It never changes your files.","Go to Explore. Tick the files you want to understand.","Pick an activity on the right: Lens to read, Quiz or Teach to test yourself.","Wrong answers become Weak spots and review cards. Today shows what to do next."],examples:["First visit: Projects > Open a folder > Explore > tick src/queue.ts > Lens > Explain > Make lens.","Then: Quiz on the same file. Miss a question, and it shows up on Today under Weak spots."],notes:["Each model call takes about 20 to 90 seconds. A bar shows progress; you can keep browsing.","The model reads only the files you tick, plus the notes and context you add. Nothing else leaves your machine."]},{id:"projects",title:"Projects",what:"A project is one folder on your disk. Everything you make (lenses, quizzes, cards) is stored under that project.",steps:["Open a folder with Open folder. Type a path or browse.","Click a project card to enter it. The rail on the left changes to the project pages.","Remove (the button on the project card) takes it off the list. Its data moves to an archive and is deleted after the keep time (Settings > Storage). Opening the same folder again restores it."],examples:["Try the built-in sample: run cognitune with --demo. It opens a tiny queue project with a fake model."]},{id:"keys",title:"Keyboard shortcuts",what:"The short list. Press ? anywhere (outside a text box) to see it in a window.",examples:["Ctrl/Cmd + K : go to a page, file or project, or start an activity on the open file","Ctrl/Cmd + H : this help, opened at the section for the page you are on","? : shortcut list","[ and ] : fold or show the left and right panes","Space : Review, show the answer","1 2 3 4 : Review, rate again / hard / good / easy","Ctrl + Enter : Tutor, send the message","← → : Trace, step back and forward"]},{id:"palette",title:"Quick jump (Ctrl K)",what:"One box to go anywhere or start anything without the mouse.",steps:["Press Ctrl K (Cmd K on Mac).","Type a few letters. Pages, files in this project, other projects and activities are matched.","Press Enter to go. Esc closes."],examples:["Type: rev → Review","Type: queue → files with queue in the path","Type: quiz → start a quiz on the open file"]}]},{title:"Learn a codebase",sections:[{id:"today",title:"Today",what:"What to do now. The page picks the most useful next step so you do not have to decide.",steps:["Read the Suggested next card at the top. Start runs it.","Review cards: how many are due. Start review opens the flashcards.","Weak spots: things you got wrong. Quiz my weak spots builds a quiz from them.","Needs a refresh: files you passed a while ago, or that changed since. Click a file to quiz yourself on it.","Learning path: the next stop of a path you made."],notes:["The flame badge counts days in a row with any practice. Missing a day resets it; one review is enough to keep it."]},{id:"explore",title:"Explore: choose files and an activity",what:"The main workspace. File tree on the left, code in the middle, activities on the right.",steps:["Click a file name to open it and read it.","Tick the box beside a file or a folder to add it to the Context. The model reads only what is in Context.","Use the filter box above the tree to find a file by name.","Pick an activity (Lens, Quiz, Teach, Tutor, Walk, Practice, Bug hunt, Notes) in the right pane."],examples:["Understand one module: tick only src/queue.ts, Lens > Explain.","Understand how two files connect: tick both, Lens > Data flow.","A folder is ticked in one click; keep the selection small (1 to 5 files) for sharper answers."],notes:["Context · 3 means three files are selected. Add lets you pick files from the project or from a context folder (docs, notes, a session folder).","[ and ] fold the side panes to give the code more room."]},{id:"lens",title:"Lens: read an explanation through one question",what:"A lens is a written explanation of your selected files, built around one question. It is like a short blog post about the code, with a walkthrough, pitfalls and a check for each step.",steps:["Tick files in Explore. Open the Lens tab.","Pick a kind of lens (see the list below).","Choose depth: Overview (about 1.5 screens, 3 to 4 steps), Standard (at least 3 screens, enough to change the code safely), Deep (5 to 6 screens, like a long blog post: every branch and failure path). Deep takes several minutes because it is planned first, then written in parts.","Optional: type your own question for the lens to answer.","Click Make lens. A planner model first outlines the lesson, then a writer model writes it in parts. When it is ready, you land on the lens page."],examples:['Explain: "The tour: purpose, main pieces, how they connect." Best first lens for any file.',"Data flow: follow one value from where it enters to where it leaves. Try on a request handler.","State over time: what is stored, who changes it, in which order. Try on a class with fields.","Failure modes: bad input, timeouts, partial writes, retries. Try before changing error handling.","Contracts: inputs, outputs and invariants between parts. Try on an API or a module boundary.","Concepts: the vocabulary first, with the line where each term shows up. Try when the code uses words you do not know.","The change: pick it in Changes with a diff; gives intent, risk and what to check.","Trace a run: step by step through one example input, with the state at each line. Use the arrows to step.","History: what changed over time and why, from the commits."],notes:["On the lens page: Words you need first (click a term to see where it shows up), the walkthrough (each step has a code card, a pitfall and a check question), then gotchas and next steps.","Click open file on a step to jump the code pane to that range. The same file pane stays on the right.","Refresh rebuilds a lens when the code changed. A banner tells you when it did."]},{id:"quiz",title:"Quiz: answer in your own words",what:"Questions about your selected files. You type answers; the model grades each one and says what was missing.",steps:["Tick files. Open the Quiz tab. Choose how many questions (Default, 3, 5 or 8).","Click Make quiz. Answer every question in the box beneath it. Short answers are fine; the core idea is what counts.","Click Grade. Each answer gets a verdict, an explanation and the line it came from.","A wrong answer is saved as a Weak spot and turns into a review card."],examples:['Question: "What happens when pop() is called on an empty queue?" Answer: "It raises IndexError, the caller must catch it."',"Retake: open the quiz from Library > Quizzes. Your best score is kept; at most 20 attempts are stored."],notes:["Empty answers are not counted as misconceptions. They are just unanswered."]},{id:"teach",title:"Teach: explain it back",what:"You write an explanation as if teaching a colleague. The model grades it for what is right, what is missing and what is wrong.",steps:["Tick files. Open Teach.","Write your explanation in your own words. Do not look at the code more than you need.","Submit. You get strengths, gaps and corrections tied to lines.","Gaps become Weak spots, so they come back later."],examples:['"A queue stores items in order. push adds at the tail; pop removes the head. When it is empty, pop raises." Short and specific beats long and vague.']},{id:"tutor",title:"Tutor: get hints, not answers",what:"A chat that helps you reach the answer yourself. Hints come in steps. Ask for the answer when you are stuck.",steps:["Tick files. Open Tutor and type a question.","The tutor replies with a question or a small hint (level 1). Ask again for more help: level 2 is a stronger hint, level 3 nearly gives it away.","At level 4 it tells you directly. Use that when you are really stuck.","Ctrl + Enter sends the message."],examples:['You: "Why does flush() hold the lock while it writes?" Tutor: "What could happen to the buffer if another thread called push() in the middle?"'],notes:["Only the last 200 messages of a chat are kept."]},{id:"walk",title:"Walk: one block at a time",what:"A guided tour of one file in small blocks. After each block you answer a short check before moving on.",steps:["Open a file, tick it, open Walk, click Make walk.","Read the block. Answer the check below it. Press Check.","A right answer unlocks the next block. A wrong one explains and keeps you on the block."],examples:["Use it for a file you must understand fully before changing it, such as a parser or a state machine."]},{id:"practice",title:"Practice: write the key lines back",what:"The code with some lines removed. You type them from memory and get feedback.",steps:["Choose a level: 1 one short hole, 2 a condition and a computation, 3 core logic, 4 whole function bodies.","Click Make practice. Fill the gaps in the editor.","Submit. You see your version next to the real one, with differences explained.","The eye button hides or shows the original. Reset restores the gaps."],examples:["Start at level 1 on a function you read today. Move to level 3 a week later."]},{id:"hunt",title:"Bug hunt: find the planted bugs",what:"cognitune plants bugs in a copy of the code (your files are not touched). You mark the lines you think are wrong.",steps:["Choose difficulty: Easy (one visible bug), Medium (two, one needs the logic), Hard (two or three subtle ones).","Click Make hunt. Read the copy and click lines you think are buggy.","Press Grade. The real bugs show up, with what was wrong and how you did."],notes:["The bugs are hidden until you grade. Reloading the page does not reveal them."]},{id:"notes",title:"Notes",what:"Your own notes on a file or a line. They can be included in prompts so answers match what you already know.",steps:["Open a file. Click a line number, add a note, save.","A mark appears in the margin. Click it to read or edit.","Turn on Settings > Notes in prompts to let the model see your notes."],examples:['"I keep mixing up head and tail here. Head is where pop reads."']},{id:"changes",title:"Changes: learn from a diff",what:"Understand a commit, a branch or uncommitted work before you review or merge it.",steps:["Choose a repo, then what to compare (for example a branch against main, or a single commit).","Tick the changed files you care about.","Use the activity panel: Lens > The change gives intent, risk and what to check."],examples:["Before reviewing a colleague's branch: Changes > main..feature/x > tick the three biggest files > Lens > The change."]}]},{title:"Remember it",sections:[{id:"review",title:"Review: flashcards that come back on time",what:"Cards are spaced: easy ones return later, hard ones sooner (FSRS). Ten minutes a day beats an hour once.",steps:["Open Review (the badge shows how many are due).","Read the question. Say or type your answer in your head. Press Space to show the answer.","Rate yourself: 1 Again (forgot), 2 Hard, 3 Good, 4 Easy. The buttons show when each will return."],examples:["Forgot it completely → 1. It returns in minutes.","Got it but had to think → 2 or 3.","Got it instantly → 4. It goes weeks out."],notes:["Cards come from wrong quiz answers, teach-back gaps and weak spots (Settings > Cards from misses). You can also add a card from the file view with the card button.","Only the last 50 reviews of each card are kept."]},{id:"library",title:"Library: everything you made",what:"One place for every lens, quiz, practice, teach-back, walk, hunt, tutor chat, card, glossary term and note in this project.",steps:["Pick a tab. Use Search this tab to filter.","Click an item to open it. Items you delete go to an archive and are removed after the keep time.","Glossary is the list of terms the lenses defined, across all lenses."],examples:["Looking for the lens you made last week on the scheduler: Library > Lenses > search: scheduler."]},{id:"progress",title:"Progress",what:"What you can show you understand, rolled up from files to folders and git repos.",steps:["At a folder of many repos, each repo is one row with a coverage bar; click a row to go into its folders, then files. The bar at the top goes back up, and its repo picker jumps to a repo.","The cards, the table and the heatmap all follow that scope. Search filters the touched files in it. The scope is in the address, so you can bookmark it.","Levels: new, seen, understood, fading, stale. A file turns fading after a few weeks without practice, and stale when the code changed since you studied it (Settings > fade days).","Click a file to open it in Explore."]}]},{title:"See the shape",sections:[{id:"map",title:"Map: how files connect",what:"Which parts of the code import which. At a folder of many repos each repo is one node; inside a repo, folders; then files.",steps:["Open Map. Square nodes are folders (the number is how many code files they hold), circles are files. A thicker arrow carries more imports.","Click a folder to go into it; the bar at the top goes back up, and its repo picker jumps straight to a repo. Click a file to open it in Explore.","A folder of 8 code files or fewer shows its files directly, so you never drill in for two files.","Colours show your level: grey not yet, blue seen, green understood, amber fading or stale.","The map is read once and kept. Press Refresh after imports change."],examples:["At the top level, a thick arrow from one repo to another shows a real dependency between them. Click the target to see which of its folders are used."],notes:["Import links are found by reading import lines (TypeScript, JavaScript and Python). Aliases from tsconfig paths are followed."]},{id:"paths",title:"Paths: an ordered tour",what:"A learning path is an ordered list of stops: where to start, what next, and how to check each stop.",steps:["Open Paths. Describe your goal, or leave it blank for a general tour.","Click Make a path. Each stop has files, why it matters and an activity.",`A stop's Start button ("Start the lens", "Start the quiz"...) opens Explore with the files ticked and the activity ready.`,"Tick a stop off when done. Today shows the next stop."],examples:['Goal: "I need to add retries to the job runner." The path walks queue, worker, then error handling.']}]},{title:"Settings and storage",sections:[{id:"settings",title:"Settings",what:"Which model runs, how text looks, and what cognitune keeps.",steps:["Planning model (default claude-opus-5-5) plans lenses, quizzes, walks, practice, bug hunts and paths; the model above (default claude-sonnet-5-5) writes them. Plan first can be turned off for one-shot answers.","Model: choose the agent (Auto, Claude Code CLI, Codex CLI, GitHub Copilot CLI, an Anthropic API key, or Demo). Auto uses the first one installed.","Reading font: sans (default) or serif for lens pages.","Cards, progress and notes: switches for turning wrong answers into cards, how fast files fade, and whether notes go to the model.","Recent model calls: the last calls with how long they took and any error."]},{id:"storage",title:"Storage: keeping it small",what:"Everything is plain JSON files in your cognitune folder (shown in Settings). It stays bounded on its own and you can also remove things by hand.",steps:["Automatic: archived items and forgotten projects are removed after the keep time (30 days by default). The reply cache keeps to its size (50 MB). Quiz attempts, card history, tutor chats and the job log are capped.","Clean up now applies those limits at once.","Choose what to remove: open the list, filter by kind, tick the items, press Remove selected, then confirm. Select all shown ticks every row in the current filter."],examples:["Free space fast: Choose what to remove > kind: reply cache > Select all shown > Remove selected. Nothing you made is lost; answers are just asked again later.","Remove one old lens: kind: lenses > tick it > Remove selected."],notes:["Removing is permanent (no archive step). Your project folders are never touched."]}]}];function aS(e){const t=e.match(/^\/p\/[^/]+\/([^/]+)/),n=t==null?void 0:t[1];return e==="/settings"?"settings":e==="/"?"projects":n?{today:"today",explore:"explore",review:"review",map:"map",paths:"paths",path:"paths",library:"library",progress:"progress",changes:"changes",lens:"lens",quiz:"quiz",teach:"teach",tutor:"tutor",walk:"walk",practice:"practice",hunt:"hunt"}[n]??null:null}function oS(){const[e]=ec(),t=Si(),[n,r]=b.useState(""),i=e.get("s"),[s,l]=b.useState(i??"start"),o=b.useMemo(()=>{const c=n.trim().toLowerCase();return c?Lg.map(d=>({...d,sections:d.sections.filter(h=>[h.title,h.what,...h.steps??[],...h.examples??[],...h.notes??[]].join(" ").toLowerCase().includes(c))})).filter(d=>d.sections.length):Lg},[n]);b.useEffect(()=>{i&&(l(i),requestAnimationFrame(()=>{var c;return(c=document.getElementById(`help-${i}`))==null?void 0:c.scrollIntoView({block:"start"})}))},[i,t.key]);const u=c=>{var d;l(c),(d=document.getElementById(`help-${c}`))==null||d.scrollIntoView({behavior:"smooth",block:"start"})};return a.jsx("div",{className:"h-full overflow-auto",children:a.jsxs("div",{className:"mx-auto flex max-w-6xl gap-10 px-8 py-10",children:[a.jsxs("nav",{className:"sticky top-0 hidden h-fit w-56 shrink-0 lg:block",children:[a.jsxs("div",{className:"relative",children:[a.jsx(ms,{className:"pointer-events-none absolute left-2.5 top-2.5 h-4 w-4 text-muted"}),a.jsx("input",{className:"input h-9 pl-8 text-[14px]",placeholder:"Search help",value:n,onChange:c=>r(c.target.value)})]}),a.jsx("div",{className:"mt-4 space-y-4",children:o.map(c=>a.jsxs("div",{children:[a.jsx("div",{className:"px-2 text-[11px] font-semibold uppercase tracking-wide text-muted",children:c.title}),a.jsx("ul",{className:"mt-1",children:c.sections.map(d=>a.jsx("li",{children:a.jsx("button",{onClick:()=>u(d.id),className:le("w-full rounded-md px-2 py-1.5 text-left text-[14px] hover:bg-raised",s===d.id?"bg-accent/10 font-medium text-accent":"text-ink"),children:d.title.split(":")[0]})},d.id))})]},c.title))})]}),a.jsxs("main",{className:"min-w-0 flex-1",children:[a.jsx("h1",{className:"text-3xl font-semibold tracking-tight",children:"Help"}),a.jsxs("p",{className:"mt-2 max-w-2xl text-[16px] leading-relaxed text-muted",children:["What every part does, how to use it, and something to try. Press ",a.jsx("span",{className:"kbd",children:"Ctrl H"})," on any page to open this at the matching part."]}),a.jsx("div",{className:"mt-4 lg:hidden",children:a.jsx("input",{className:"input",placeholder:"Search help",value:n,onChange:c=>r(c.target.value)})}),o.map(c=>a.jsxs("div",{children:[a.jsx("h2",{className:"mt-12 border-b border-line pb-2 text-sm font-semibold uppercase tracking-wide text-muted",children:c.title}),c.sections.map(d=>a.jsxs("section",{id:`help-${d.id}`,className:"scroll-mt-6 pt-8",children:[a.jsx("h3",{className:"text-2xl font-semibold tracking-tight",children:d.title}),a.jsx("p",{className:"mt-2 max-w-3xl text-[17px] leading-[1.65]",children:d.what}),d.steps&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"mt-5 text-xs font-semibold uppercase tracking-wide text-accent",children:"How to use it"}),a.jsx("ol",{className:"mt-2 max-w-3xl list-decimal space-y-2 pl-6 text-[16px] leading-[1.6] marker:text-muted",children:d.steps.map(h=>a.jsx("li",{children:h},h))})]}),d.examples&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"mt-5 text-xs font-semibold uppercase tracking-wide text-accent",children:"Try this"}),a.jsx("div",{className:"mt-2 max-w-3xl space-y-2",children:d.examples.map(h=>a.jsx("div",{className:"rounded-lg border border-line bg-raised px-4 py-2.5 text-[15px] leading-[1.55]",children:h},h))})]}),d.notes&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"mt-5 text-xs font-semibold uppercase tracking-wide text-muted",children:"Good to know"}),a.jsx("ul",{className:"mt-2 max-w-3xl list-disc space-y-1.5 pl-6 text-[15px] leading-[1.6] text-muted marker:text-line",children:d.notes.map(h=>a.jsx("li",{children:h},h))})]})]},d.id))]},c.title)),!o.length&&a.jsxs("p",{className:"mt-10 text-muted",children:['Nothing matches "',n,'".']}),a.jsx("div",{className:"h-24"})]})]})})}async function Ba(e,t){const{json:n,...r}=t??{},i=await fetch(`/api${e}`,{...r,headers:{"content-type":"application/json",...r.headers??{}},body:n===void 0?r.body:JSON.stringify(n)}),s=await i.json().catch(()=>({}));if(!i.ok)throw new Error(s.error||`${i.status} ${i.statusText}`);return s}const me=e=>Ba(e),Ci=(e,t={})=>Ba(e,{method:"POST",json:t}),Eh=(e,t)=>Ba(e,{method:"PUT",json:t}),Ua=(e,t)=>Ba(e,{method:"PATCH",json:t}),cs=e=>Ba(e,{method:"DELETE"}),uS=e=>new Promise(t=>setTimeout(t,e)),Ph=new Set;function mn(){const e=Dt(),[t,n]=b.useState(null),[r,i]=b.useState(null),[s,l]=b.useState(0),o=b.useRef(!0);return b.useEffect(()=>()=>void(o.current=!1),[]),b.useEffect(()=>{if((t==null?void 0:t.status)!=="running")return;const c=Date.parse(t.startedAt),d=setInterval(()=>l(Math.round((Date.now()-c)/1e3)),500);return()=>clearInterval(d)},[t==null?void 0:t.status,t==null?void 0:t.startedAt]),{run:b.useCallback(async(c,d,h)=>{i(null),l(0);let p;try{let f=await Ci(c,d);for(p=f.id,Ph.add(p),n(f),e.invalidateQueries({queryKey:["project-jobs"]});f.status==="running";){if(await uS(1e3),!o.current)return;f=await me(`/jobs/${f.id}`),n(f)}f.status==="failed"?i(f.error??"the job failed"):(await e.invalidateQueries(),h==null||h(f))}catch(f){i(f instanceof Error?f.message:String(f)),n(null)}finally{p&&Ph.delete(p)}},[e]),job:t,busy:(t==null?void 0:t.status)==="running",error:r,elapsed:s,clearError:()=>i(null)}}function Tt(e){const t=Math.round((Date.now()-Date.parse(e))/1e3);return t<60?"just now":t<3600?`${Math.round(t/60)} min ago`:t<86400?`${Math.round(t/3600)} h ago`:`${Math.round(t/86400)} d ago`}function ee({variant:e="secondary",size:t="md",icon:n,className:r,children:i,loading:s,...l}){return a.jsxs("button",{...l,disabled:l.disabled||s,className:le("inline-flex select-none items-center justify-center gap-2 rounded-sm font-medium transition","disabled:cursor-not-allowed disabled:opacity-50","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent",t==="sm"&&"h-[22px] px-2 text-xs",t==="md"&&"h-[26px] px-3 text-[13px]",t==="lg"&&"h-8 px-4 text-sm",e==="primary"&&"bg-accent text-accent-ink hover:brightness-110",e==="secondary"&&"border border-muted/40 bg-raised text-ink hover:border-muted/70 hover:brightness-95",e==="ghost"&&"text-muted hover:bg-raised hover:text-ink",e==="danger"&&"border border-bad/30 bg-bad/10 text-bad hover:bg-bad/15",r),children:[s?a.jsx(H1,{className:"h-4 w-4 animate-spin"}):n,i]})}function be({tone:e="muted",children:t,className:n}){return a.jsx("span",{className:le("inline-flex items-center gap-1 rounded-sm px-1.5 py-0.5 text-[11px] font-medium",e==="muted"&&"bg-raised text-muted",e==="accent"&&"bg-accent/12 text-accent",e==="good"&&"bg-good/12 text-good",e==="warn"&&"bg-warn/15 text-warn",e==="bad"&&"bg-bad/12 text-bad",n),children:t})}function f0({v:e}){return a.jsx(be,{tone:e==="right"?"good":e==="partial"?"warn":"bad",children:e})}function kt({className:e}){return a.jsx(H1,{className:le("h-4 w-4 animate-spin text-muted",e)})}function Ft({icon:e,title:t,children:n,action:r}){return a.jsxs("div",{className:"flex flex-col items-center justify-center px-6 py-16 text-center",children:[e&&a.jsx("div",{className:"mb-4 grid h-12 w-12 place-items-center rounded-2xl bg-accent/10 text-accent",children:e}),a.jsx("h3",{className:"text-base font-semibold",children:t}),n&&a.jsx("div",{className:"mt-1.5 max-w-md text-sm text-muted",children:n}),r&&a.jsx("div",{className:"mt-5",children:r})]})}function Ke({error:e,onClose:t}){return a.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-bad/30 bg-bad/8 px-3 py-2 text-sm text-bad",children:[a.jsx(op,{className:"mt-0.5 h-4 w-4 shrink-0"}),a.jsx("div",{className:"min-w-0 flex-1 whitespace-pre-wrap break-words",children:e}),t&&a.jsx("button",{onClick:t,className:"opacity-60 hover:opacity-100","aria-label":"Close",children:a.jsx(Rn,{className:"h-4 w-4"})})]})}const cS={lens:["Reading the files","Finding the core idea","Writing the lesson"],quiz:["Reading the files","Choosing what matters","Writing questions"],grade:["Reading your answers","Checking against the code","Writing feedback"],practice:["Reading the file","Choosing the key logic","Cutting the holes"],review:["Reading your code","Comparing with the original","Writing feedback"],teachback:["Reading your explanation","Checking it against the code","Writing feedback"],tutor:["Reading the conversation","Thinking of a good question","Writing"],walk:["Reading the file","Finding the reading order","Writing check questions"],walkcheck:["Reading your answer","Checking the block"],hunt:["Reading the file","Choosing where to break it","Planting the bugs"],huntgrade:["Matching your marks","Checking your reasons","Writing feedback"],path:["Reading the repo layout","Ordering the stops","Writing the path"]};function sn({kind:e,elapsed:t}){const n=cS[e]??["Working"],r=Math.min(n.length-1,Math.floor(t/12));return a.jsxs("div",{className:"shimmer card p-4",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(kt,{className:"text-accent"}),a.jsxs("div",{className:"text-sm font-medium",children:[n[r],"..."]}),a.jsxs("div",{className:"ml-auto font-mono text-xs text-muted",children:[t,"s"]})]}),a.jsx("div",{className:"mt-3 flex gap-1.5",children:n.map((i,s)=>a.jsx("div",{className:le("h-1 flex-1 rounded-full transition-colors",s<=r?"bg-accent":"bg-line")},i))}),a.jsx("p",{className:"mt-2 text-xs text-muted",children:"Model calls take 20 seconds to 2 minutes. You can leave this page: it keeps running, and the status bar says when it is ready."})]})}function Zt({value:e,onChange:t,options:n}){return a.jsx("div",{className:"inline-flex rounded-sm border border-line bg-raised p-0.5",children:n.map(r=>a.jsx("button",{title:r.title,onClick:()=>t(r.value),className:le("rounded-sm px-2.5 py-0.5 text-xs font-medium transition",r.value===e?"bg-panel text-ink":"text-muted hover:text-ink"),children:r.label},String(r.value)))})}function dS({value:e,onChange:t,tabs:n,className:r,wrap:i=!1}){return a.jsx("div",{className:le("flex border-b border-line bg-side",i?"flex-wrap":"overflow-x-auto",r),children:n.map(s=>a.jsxs("button",{onClick:()=>t(s.value),className:le("relative flex h-[35px] shrink-0 items-center gap-1.5 whitespace-nowrap border-r border-line px-3 text-[13px] transition",i&&"grow justify-center last:border-r-0",s.value===e?"bg-bg text-ink":"text-muted hover:text-ink"),children:[s.icon,s.label,s.count!==void 0&&s.count>0&&a.jsx("span",{className:"rounded-full bg-raised px-1.5 text-[11.5px] text-muted",children:s.count}),s.value===e&&a.jsx("span",{className:"absolute inset-x-0 top-0 h-px bg-accent"})]},s.value))})}function Ca({score:e,size:t="md"}){const n=Math.round(e*100),r=e>=.67?"text-good":e>=.4?"text-warn":"text-bad";return a.jsxs("span",{className:le("font-semibold tabular-nums",r,t==="sm"?"text-xs":"text-sm"),children:[n,"%"]})}function tc({title:e,onClose:t,children:n,footer:r,wide:i}){return a.jsx("div",{className:"fixed inset-0 z-50 grid place-items-center bg-black/40 p-4",onClick:t,onKeyDown:s=>s.key==="Escape"&&t(),children:a.jsxs("div",{className:le("card flex max-h-[85vh] w-full flex-col overflow-hidden",i?"max-w-2xl":"max-w-lg"),onClick:s=>s.stopPropagation(),children:[a.jsxs("div",{className:"flex items-center border-b border-line px-4 py-2",children:[a.jsx("h2",{className:"text-sm font-semibold",children:e}),a.jsx("button",{className:"ml-auto text-muted hover:text-ink",onClick:t,"aria-label":"Close",children:a.jsx(Rn,{className:"h-4 w-4"})})]}),a.jsx("div",{className:"min-h-0 flex-1 overflow-auto px-5 py-4",children:n}),r&&a.jsx("div",{className:"flex items-center justify-end gap-2 border-t border-line px-5 py-3",children:r})]})})}function nc({back:e,badges:t,title:n,sub:r,actions:i}){return a.jsxs("div",{children:[e,t&&a.jsx("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:t}),a.jsxs("div",{className:"mt-2 flex items-start gap-3",children:[a.jsx("h1",{className:"min-w-0 flex-1 text-[20px] font-semibold leading-tight tracking-tight",children:n}),i&&a.jsx("div",{className:"flex shrink-0 gap-2",children:i})]}),r&&a.jsx("div",{className:"mt-1 text-sm text-muted",children:r})]})}function Th(e){const t=Math.max(0,Math.round((Date.parse(e)-Date.now())/1e3));return t<90?"now":t<3600?`${Math.round(t/60)} min`:t<86400?`${Math.round(t/3600)} h`:t<86400*60?`${Math.round(t/86400)} d`:`${Math.round(t/(86400*30))} mo`}const hS={"Go to":og,Do:og,Files:_1,Projects:$1};function p0(e,t){return e.flatMap(n=>n.kind==="file"?[{path:n.path,rel:n.path.startsWith(t+"/")?n.path.slice(t.length+1):n.path}]:p0(n.children??[],t))}function fS({pid:e,root:t,onClose:n,openFile:r}){const i=gt(),[s,l]=b.useState(""),[o,u]=b.useState(0),c=b.useRef(null),d=ye({queryKey:["tree-flat",e],queryFn:()=>me(`/projects/${e}/tree`),enabled:!!e,staleTime:6e4}),h=ye({queryKey:["projects"],queryFn:()=>me("/projects")}),p=b.useMemo(()=>{const g=y=>()=>i(y),k=[];if(e){const y=`/p/${e}`;for(const[x,v]of[["Today","today"],["Explore","explore"],["Changes","changes"],["Review cards","review"],["Map","map"],["Learning paths","paths"],["Library","library"],["Progress","progress"]])k.push({id:`go-${v}`,label:x,group:"Go to",run:g(`${y}/${v}`)});for(const[x,v]of[["Lens on the open file","lens"],["Quiz me on the open file","quiz"],["Teach it back","teach"],["Ask the tutor","tutor"],["Walk through the open file","walk"],["Practice on the open file","practice"],["Bug hunt in the open file","hunt"],["Notes on the open file","notes"]])k.push({id:`do-${v}`,label:x,group:"Do",run:g(`${y}/explore?do=${v}`)});if(d.data&&t)for(const x of p0(d.data,t))k.push({id:`f-${x.path}`,label:x.rel,group:"Files",run:()=>r==null?void 0:r(x.path)})}k.push({id:"go-help",label:"Help (Ctrl H)",group:"Go to",run:g("/help")}),k.push({id:"go-settings",label:"Settings",group:"Go to",run:g("/settings")});for(const y of h.data??[])k.push({id:`p-${y.id}`,label:y.name,hint:y.root,group:"Projects",run:g(`/p/${y.id}/today`)});return k},[e,t,d.data,h.data,i,r]),f=b.useMemo(()=>{const g=s.toLowerCase().split(/\s+/).filter(Boolean);return(g.length?p.filter(y=>g.every(x=>`${y.label} ${y.hint??""} ${y.group}`.toLowerCase().includes(x))):p.filter(y=>y.group!=="Files")).slice(0,60)},[p,s]);b.useEffect(()=>{u(0)},[s]),b.useEffect(()=>{var g,k;(k=(g=c.current)==null?void 0:g.querySelector(`[data-i="${o}"]`))==null||k.scrollIntoView({block:"nearest"})},[o]);const m=g=>{g&&(n(),g.run())};return a.jsxs(tc,{title:"Go to or do",onClose:n,wide:!0,children:[a.jsxs("div",{className:"relative",children:[a.jsx(ms,{className:"pointer-events-none absolute left-3 top-2.5 h-4 w-4 text-muted"}),a.jsx("input",{autoFocus:!0,className:"input pl-9",placeholder:"Type a page, an activity, a file or a project",value:s,onChange:g=>l(g.target.value),onKeyDown:g=>{g.key==="ArrowDown"&&(g.preventDefault(),u(k=>Math.min(f.length-1,k+1))),g.key==="ArrowUp"&&(g.preventDefault(),u(k=>Math.max(0,k-1))),g.key==="Enter"&&m(f[o]),g.key==="Escape"&&n()}})]}),a.jsxs("div",{ref:c,className:"mt-3 max-h-[50vh] overflow-auto",children:[f.map((g,k)=>{const y=hS[g.group],x=k===0||f[k-1].group!==g.group;return a.jsxs("div",{children:[x&&a.jsx("div",{className:"px-2 pb-1 pt-2 text-[11.5px] font-semibold uppercase tracking-wide text-muted",children:g.group}),a.jsxs("button",{"data-i":k,onMouseMove:()=>u(k),onClick:()=>m(g),className:le("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-[14px]",k===o?"bg-accent/12 text-ink":"text-ink/85"),children:[a.jsx(y,{className:"h-3.5 w-3.5 shrink-0 text-muted"}),a.jsx("span",{className:le("min-w-0 flex-1 truncate",g.group==="Files"&&"font-mono text-[13px]"),children:g.label}),g.hint&&a.jsx("span",{className:"truncate text-[12px] text-muted",children:g.hint}),k===o&&a.jsx(t2,{className:"h-3.5 w-3.5 text-muted"})]})]},g.id)}),!f.length&&a.jsx("div",{className:"px-2 py-6 text-center text-sm text-muted",children:"Nothing matches."})]})]})}const pS=[["Ctrl/Cmd + K","Go to a page, file or project; start an activity"],["Ctrl/Cmd + H","Help, opened at the part for this page"],["?","This list"],["[ and ]","Fold or show the left and right panes"],["Space","Review: reveal the answer"],["1 2 3 4","Review: again, hard, good, easy"],["Ctrl + Enter","Tutor: send"],["← →","Trace: step back and forward"]];function mS({onClose:e}){return a.jsx(tc,{title:"Keyboard shortcuts",onClose:e,children:a.jsx("table",{className:"w-full text-sm",children:a.jsx("tbody",{children:pS.map(([t,n])=>a.jsxs("tr",{className:"border-b border-line/60 last:border-0",children:[a.jsx("td",{className:"py-2 pr-4",children:a.jsx("span",{className:"kbd",children:t})}),a.jsx("td",{className:"py-2 text-muted",children:n})]},t))})})})}function m0({className:e}){return a.jsxs("svg",{viewBox:"0 0 32 32",className:e,"aria-hidden":!0,children:[a.jsx("rect",{width:"32",height:"32",rx:"6",fill:"rgb(var(--accent))"}),a.jsx("circle",{cx:"14",cy:"14",r:"6.5",fill:"none",stroke:"white",strokeWidth:"2.8"}),a.jsx("path",{d:"M19 19l6 6",stroke:"white",strokeWidth:"2.8",strokeLinecap:"round"})]})}function wn({to:e,icon:t,label:n,end:r,badge:i}){return a.jsxs(Sh,{to:e,end:r,title:n,"aria-label":n,className:({isActive:s})=>le("relative grid h-12 w-12 shrink-0 place-items-center transition-colors",s?"text-ink before:absolute before:inset-y-0 before:left-0 before:w-0.5 before:bg-accent":"text-muted hover:text-ink"),children:[t,!!i&&a.jsx("span",{className:"absolute bottom-2 right-1.5 min-w-[16px] rounded-full bg-accent px-1 text-center text-[10px] font-semibold leading-4 text-accent-ink",children:i>99?"99+":i})]})}const gS={system:"light",light:"dark",dark:"system"},Hc={lens:"lens",quiz:"quiz",grade:"grading",practice:"practice",review:"review",teachback:"teach-back",tutor:"tutor reply",walk:"walkthrough",walkcheck:"check",hunt:"bug hunt",huntgrade:"grading",path:"path"},Mg={lens:"lens",quiz:"quiz",practice:"practice",teachback:"teach",tutor:"tutor",walk:"walk",hunt:"hunt",path:"paths"};function xS({pid:e}){const t=gt(),n=ye({queryKey:["project-jobs",e],queryFn:async()=>(await me(`/projects/${e}`)).running,refetchInterval:u=>{var c;return(c=u.state.data)!=null&&c.length?2e3:!1}}),r=n.data??[],i=b.useRef(new Set),[s,l]=b.useState([]);b.useEffect(()=>{const u=new Set(r.map(d=>d.id)),c=[...i.current].filter(d=>!u.has(d)&&!Ph.has(d));i.current=u;for(const d of c)me(`/jobs/${d}`).then(h=>{h.status==="done"&&h.resultId&&Mg[h.kind]&&l(p=>[...p.filter(f=>f.id!==h.id),h])}).catch(()=>{})},[n.dataUpdatedAt]);const o=s[s.length-1];if(r.length){const u=r[0],c=Math.max(0,Math.round((Date.now()-Date.parse(u.startedAt))/1e3));return a.jsxs("span",{className:"flex items-center gap-1.5 px-1.5",title:r.map(d=>Hc[d.kind]).join(", "),children:[a.jsx("span",{className:"[&>svg]:h-3 [&>svg]:w-3",children:a.jsx(kt,{className:"text-accent"})}),r.length===1?`${Hc[u.kind]} running · ${c}s`:`${r.length} jobs running`]})}return o?a.jsxs("span",{className:"flex items-center",children:[a.jsxs("button",{className:"flex items-center gap-1.5 px-1.5 text-good hover:bg-raised",onClick:()=>{l(u=>u.filter(c=>c.id!==o.id)),t(`/p/${e}/${Mg[o.kind]}/${o.resultId}`)},children:[a.jsx(vl,{className:"h-3 w-3"})," ",Hc[o.kind]," ready · open",s.length>1?` (+${s.length-1})`:""]}),a.jsx("button",{className:"px-1 hover:bg-raised hover:text-ink",title:"Dismiss",onClick:()=>l(u=>u.filter(c=>c.id!==o.id)),children:a.jsx(Rn,{className:"h-3 w-3"})})]}):null}function yS(){var g,k,y,x,v;const{pid:e}=$r(),{pref:t,setPref:n}=ly(),r=ye({queryKey:["health"],queryFn:()=>me("/health"),staleTime:6e4}),i=(g=r.data)==null?void 0:g.agent.ready,s=t==="dark"?f2:t==="light"?v2:h2,l=gt(),[o,u]=b.useState(!1),[c,d]=b.useState(!1),h=ye({queryKey:["cards-due",e],queryFn:()=>me(`/projects/${e}/cards/due`),enabled:!!e,staleTime:6e4}),f=(y=(k=ye({queryKey:["projects"],queryFn:()=>me("/projects"),enabled:!!e,staleTime:6e4}).data)==null?void 0:k.find(j=>j.id===e))==null?void 0:y.root;b.useEffect(()=>{const j=E=>{if((E.ctrlKey||E.metaKey)&&E.key.toLowerCase()==="k"){E.preventDefault(),u(N=>!N);return}if((E.ctrlKey||E.metaKey)&&!E.shiftKey&&!E.altKey&&E.key.toLowerCase()==="h"){E.preventDefault();const N=aS(window.location.pathname);l(N?`/help?s=${N}`:"/help");return}!E.target.closest("input, textarea, [contenteditable], .cm-editor")&&E.key==="?"&&d(!0)};return window.addEventListener("keydown",j),()=>window.removeEventListener("keydown",j)},[]);const m=i===void 0?"checking model":i?"model ready":"model off";return a.jsxs("div",{className:"flex h-full flex-col",children:[a.jsxs("div",{className:"flex min-h-0 flex-1",children:[a.jsxs("aside",{className:"flex w-12 shrink-0 flex-col items-stretch overflow-y-auto bg-rail",children:[a.jsx(Sh,{to:"/",className:"grid h-12 place-items-center",title:"cognitune: projects","aria-label":"cognitune: projects",children:a.jsx(m0,{className:"h-6 w-6"})}),e?a.jsxs(a.Fragment,{children:[a.jsx(wn,{to:`/p/${e}/today`,icon:a.jsx(w2,{className:"h-6 w-6",strokeWidth:1.5}),label:"Today"}),a.jsx(wn,{to:`/p/${e}/explore`,icon:a.jsx(_a,{className:"h-6 w-6",strokeWidth:1.5}),label:"Explore"}),a.jsx(wn,{to:`/p/${e}/changes`,icon:a.jsx(U1,{className:"h-6 w-6",strokeWidth:1.5}),label:"Changes"}),a.jsx(wn,{to:`/p/${e}/review`,icon:a.jsx(Fr,{className:"h-6 w-6",strokeWidth:1.5}),label:"Review",badge:(x=h.data)==null?void 0:x.length}),a.jsx(wn,{to:`/p/${e}/map`,icon:a.jsx(W1,{className:"h-6 w-6",strokeWidth:1.5}),label:"Map"}),a.jsx(wn,{to:`/p/${e}/paths`,icon:a.jsx(lp,{className:"h-6 w-6",strokeWidth:1.5}),label:"Paths"}),a.jsx(wn,{to:`/p/${e}/library`,icon:a.jsx(Zf,{className:"h-6 w-6",strokeWidth:1.5}),label:"Library"}),a.jsx(wn,{to:`/p/${e}/progress`,icon:a.jsx(z1,{className:"h-6 w-6",strokeWidth:1.5}),label:"Progress"})]}):a.jsx(wn,{to:"/",end:!0,icon:a.jsx(c2,{className:"h-6 w-6",strokeWidth:1.5}),label:"Projects"}),a.jsx("div",{className:"flex-1"}),e&&a.jsx(wn,{to:"/",end:!0,icon:a.jsx($1,{className:"h-6 w-6",strokeWidth:1.5}),label:"Projects"}),a.jsx(wn,{to:"/help",icon:a.jsx(F1,{className:"h-6 w-6",strokeWidth:1.5}),label:"Help"}),a.jsx(wn,{to:"/settings",icon:a.jsx(g2,{className:"h-6 w-6",strokeWidth:1.5}),label:"Settings"})]}),a.jsx("main",{className:"min-w-0 flex-1",children:a.jsx(c0,{})})]}),a.jsxs("footer",{className:"flex h-[22px] shrink-0 items-center gap-1 border-t border-line bg-status px-2 text-[12px] text-muted",children:[f&&a.jsx("span",{className:"px-1.5",title:f,children:f.split("/").filter(Boolean).pop()}),a.jsxs(Sh,{to:"/settings",title:((v=r.data)==null?void 0:v.agent.detail)??"checking the model",className:"flex items-center gap-1.5 px-1.5 hover:bg-raised",children:[a.jsx("span",{className:le("h-2 w-2 rounded-full",i===void 0?"bg-line":i?"bg-good":"bg-bad")}),m]}),e&&a.jsx(xS,{pid:e}),a.jsx("div",{className:"flex-1"}),a.jsxs("button",{onClick:()=>u(!0),title:"Go to or do (Ctrl/Cmd+K). Press ? for all shortcuts.",className:"flex items-center gap-1 px-1.5 hover:bg-raised",children:[a.jsx(e2,{className:"h-3 w-3"})," Ctrl K"]}),a.jsxs("button",{onClick:()=>n(gS[t]),title:`Theme: ${t} (click to change)`,className:"flex items-center gap-1 px-1.5 hover:bg-raised",children:[a.jsx(s,{className:"h-3 w-3"})," ",a.jsx("span",{className:"capitalize",children:t})]})]}),o&&a.jsx(fS,{pid:e,root:f,onClose:()=>u(!1),openFile:j=>{try{sessionStorage.setItem(`gl.open.${e}`,JSON.stringify(j))}catch{}l(`/p/${e}/explore`),window.dispatchEvent(new CustomEvent("cognitune:open",{detail:j}))}}),c&&a.jsx(mS,{onClose:()=>d(!1)})]})}const g0=b.createContext(null);function Rg(e,t){try{const n=sessionStorage.getItem(e);return n?JSON.parse(n):t}catch{return t}}function zg(e,t){try{sessionStorage.setItem(e,JSON.stringify(t))}catch{}}function vS({pid:e,children:t,fallback:n}){const r=ye({queryKey:["project",e],queryFn:()=>me(`/projects/${e}`)}),[i,s]=b.useState(()=>Rg(`gl.sel.${e}`,[])),[l,o]=b.useState(()=>Rg(`gl.open.${e}`,null)),[u,c]=b.useState(null);b.useEffect(()=>zg(`gl.sel.${e}`,i),[e,i]),b.useEffect(()=>{const m=g=>{o(g.detail),c(null)};return window.addEventListener("cognitune:open",m),()=>window.removeEventListener("cognitune:open",m)},[]),b.useEffect(()=>zg(`gl.open.${e}`,l),[e,l]);const d=b.useCallback(m=>s([...new Set(m)]),[]),h=b.useCallback((m,g)=>{s(k=>{const y=k.includes(m);return g??!y?y?k:[...k,m]:k.filter(v=>v!==m)})},[]),p=b.useCallback((m,g)=>{o(m),c(g??null)},[]),f=b.useMemo(()=>{const m=r.data;return m?{project:m,selected:i,toggle:h,setSelected:d,openFile:l,setOpenFile:p,focusLine:u,rel:k=>{if(k.startsWith(m.root+"/"))return k.slice(m.root.length+1);for(const y of m.contexts)if(k.startsWith(y+"/"))return`${y.split("/").pop()}/${k.slice(y.length+1)}`;return k}}:null},[r.data,i,h,d,l,p,u]);return r.error?a.jsx(a.Fragment,{children:n}):f?a.jsx(g0.Provider,{value:f,children:t}):null}function it(){const e=b.useContext(g0);if(!e)throw new Error("useProject outside ProjectProvider");return e}function pp({title:e,start:t,onPick:n,onClose:r,cta:i="Open this folder"}){var h,p;const[s,l]=b.useState(t??""),[o,u]=b.useState(t??""),c=ye({queryKey:["browse",s],queryFn:()=>me(`/browse?path=${encodeURIComponent(s)}`)}),d=((h=c.data)==null?void 0:h.path)??s;return a.jsx("div",{className:"fixed inset-0 z-50 grid place-items-center bg-black/40 p-4 backdrop-blur-sm",onClick:r,children:a.jsxs("div",{className:"card flex max-h-[80vh] w-full max-w-xl flex-col overflow-hidden",onClick:f=>f.stopPropagation(),children:[a.jsxs("div",{className:"flex items-center gap-2 border-b border-line px-4 py-3",children:[a.jsx("h2",{className:"text-sm font-semibold",children:e}),a.jsx("button",{className:"ml-auto text-muted hover:text-ink",onClick:r,"aria-label":"Close",children:a.jsx(Rn,{className:"h-4 w-4"})})]}),a.jsxs("form",{className:"flex gap-2 border-b border-line p-3",onSubmit:f=>{f.preventDefault(),l(o)},children:[a.jsx("input",{className:"input font-mono text-xs",value:o,onChange:f=>u(f.target.value),placeholder:"/path/to/folder"}),a.jsx(ee,{type:"submit",children:"Go"})]}),a.jsxs("div",{className:"min-h-[240px] flex-1 overflow-auto p-2",children:[c.isLoading&&a.jsx("div",{className:"p-4",children:a.jsx(kt,{})}),c.error&&a.jsx("div",{className:"p-2",children:a.jsx(Ke,{error:c.error.message})}),c.data&&a.jsxs(a.Fragment,{children:[c.data.parent&&a.jsxs("button",{className:"flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-sm text-muted hover:bg-raised",onClick:()=>{l(c.data.parent),u(c.data.parent)},children:[a.jsx(R1,{className:"h-4 w-4"})," .."]}),c.data.dirs.map(f=>{const m=`${c.data.path.replace(/\/$/,"")}/${f}`;return a.jsxs("button",{className:"flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-left text-sm hover:bg-raised",onDoubleClick:()=>n(m),onClick:()=>{l(m),u(m)},children:[a.jsx(np,{className:"h-4 w-4 text-accent/80"})," ",f]},f)}),!c.data.dirs.length&&a.jsx("div",{className:"px-3 py-6 text-center text-sm text-muted",children:"No sub-folders."})]})]}),a.jsxs("div",{className:"flex items-center gap-2 border-t border-line px-4 py-3",children:[a.jsxs("div",{className:"min-w-0 flex-1 truncate font-mono text-xs text-muted",title:d,children:[((p=c.data)==null?void 0:p.isGit)&&a.jsx(rp,{className:"mr-1 inline h-3.5 w-3.5 text-good"}),d]}),a.jsx(ee,{variant:"ghost",onClick:r,children:"Cancel"}),a.jsx(ee,{variant:"primary",disabled:!c.data,onClick:()=>n(d),children:i})]})]})})}const wS=[{icon:_a,title:"Lenses",text:"See code through one question: data flow, state, failure modes, contracts."},{icon:$a,title:"Quizzes",text:"Questions about behaviour, not names. Graded with feedback that names the line."},{icon:Ku,title:"Practice",text:"Key logic cut out of your own code. Write it back, with hints when stuck."},{icon:Zf,title:"Progress",text:"What you understand, per file. A pass goes stale when the code changes."}];function kS(){var u;const e=gt(),t=Dt(),[n,r]=b.useState(!1),i=ye({queryKey:["projects"],queryFn:()=>me("/projects")}),s=vi({mutationFn:c=>Ci("/projects",{root:c}),onSuccess:c=>{t.invalidateQueries({queryKey:["projects"]}),e(`/p/${c.id}/today`)}}),l=vi({mutationFn:c=>cs(`/projects/${c}`),onSuccess:()=>t.invalidateQueries({queryKey:["projects"]})}),o=i.data??[];return a.jsxs("div",{className:"h-full overflow-auto",children:[a.jsxs("div",{className:"mx-auto max-w-5xl px-6 py-12",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(m0,{className:"h-11 w-11"}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:"cognitune"}),a.jsx("p",{className:"text-sm text-muted",children:"Understand any codebase. Prove it to yourself."})]})]}),a.jsx("div",{className:"mt-10 grid gap-3 sm:grid-cols-2 lg:grid-cols-4",children:wS.map(({icon:c,title:d,text:h})=>a.jsxs("div",{className:"card p-4",children:[a.jsx("div",{className:"mb-3 grid h-9 w-9 place-items-center rounded-lg bg-accent/10 text-accent",children:a.jsx(c,{className:"h-[18px] w-[18px]"})}),a.jsx("div",{className:"text-sm font-semibold",children:d}),a.jsx("p",{className:"mt-1 text-[14px] leading-snug text-muted",children:h})]},d))}),a.jsxs("div",{className:"mt-12 flex items-end justify-between gap-4",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-lg font-semibold tracking-tight",children:"Projects"}),a.jsx("p",{className:"text-sm text-muted",children:"A project is a folder of code. Nothing in it is written."})]}),a.jsx(ee,{variant:"primary",size:"lg",icon:a.jsx(q1,{className:"h-4 w-4"}),onClick:()=>r(!0),children:"Open a folder"})]}),s.error&&a.jsx("div",{className:"mt-4",children:a.jsx(Ke,{error:s.error.message})}),a.jsxs("div",{className:"mt-5 grid gap-3 md:grid-cols-2",children:[o.map(c=>a.jsxs("div",{role:"button",tabIndex:0,onClick:()=>s.mutate(c.root),onKeyDown:d=>d.key==="Enter"&&s.mutate(c.root),className:"card group flex cursor-pointer items-center gap-4 p-4 transition hover:-translate-y-0.5 hover:border-accent/40",children:[a.jsx("div",{className:"grid h-10 w-10 shrink-0 place-items-center rounded-md bg-gradient-to-br from-accent/20 to-fuchsia-500/20 text-sm font-bold uppercase text-accent",children:c.name.slice(0,2)}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("div",{className:"truncate font-medium",children:c.name}),a.jsx("div",{className:"truncate font-mono text-xs text-muted",title:c.root,children:c.root}),a.jsxs("div",{className:"mt-1 text-[12px] text-muted",children:["opened ",Tt(c.openedAt),c.contexts.length>0&&` · ${c.contexts.length} context folder${c.contexts.length>1?"s":""}`]})]}),a.jsx("button",{className:"rounded-md p-1.5 text-muted opacity-0 transition hover:bg-raised hover:text-bad group-hover:opacity-100",title:"Remove from the list (your lenses and quizzes stay on disk)",onClick:d=>{d.stopPropagation(),l.mutate(c.id)},children:a.jsx(pr,{className:"h-4 w-4"})}),a.jsx(Hu,{className:"h-4 w-4 text-muted transition group-hover:translate-x-0.5 group-hover:text-accent"})]},c.id)),!i.isLoading&&!o.length&&a.jsxs("div",{className:"card col-span-full border-dashed p-10 text-center text-sm text-muted",children:["No projects yet. Open a folder, or start from a terminal: ",a.jsx("span",{className:"kbd",children:"npx cognitune ./my-repo"})]})]})]}),n&&a.jsx(pp,{title:"Open a folder",start:((u=o[0])==null?void 0:u.root.split("/").slice(0,-1).join("/"))||void 0,onClose:()=>r(!1),onPick:c=>{r(!1),s.mutate(c)}})]})}function fr(e,t=36){if(e.length<=t)return e;const n=e.split("/"),r=n.pop()??"";return[...n.map(s=>s===""?"":s.startsWith(".")?s.slice(0,2):s[0]),r].join("/")}const bS={ts:"typescript",tsx:"tsx",js:"javascript",jsx:"jsx",mjs:"javascript",cjs:"javascript",py:"python",go:"go",rs:"rust",java:"java",kt:"kotlin",rb:"ruby",php:"php",cs:"csharp",c:"c",h:"c",cpp:"cpp",hpp:"cpp",swift:"swift",scala:"scala",sh:"bash",zsh:"bash",bash:"bash",sql:"sql",json:"json",yaml:"yaml",yml:"yaml",toml:"toml",md:"markdown",html:"html",css:"css",scss:"scss",vue:"vue",svelte:"svelte",tf:"hcl",hcl:"hcl",xml:"xml",ini:"ini",lua:"lua",r:"r",dart:"dart",ex:"elixir",exs:"elixir"};function x0(e){const t=(e.split("/").pop()??"").toLowerCase();if(t==="dockerfile")return"docker";if(t==="makefile")return"make";const n=t.includes(".")?t.slice(t.lastIndexOf(".")+1):"";return bS[n]??"text"}const jS=/\.(ts|tsx|js|jsx|mjs|py|go|rs|java|kt|rb|php|cs|c|h|cpp|swift|scala|sh|sql|vue|svelte|lua|dart|ex)$/i,NS=/\.(md|txt|rst|json|ya?ml|toml|ini|cfg)$/i;function y0(e){return e.kind==="file"?[e.path]:(e.children??[]).flatMap(y0)}function v0(e,t){if(!t)return e;const n=t.toLowerCase(),r=[];for(const i of e)if(i.kind==="file")i.path.toLowerCase().includes(n)&&r.push(i);else{const s=v0(i.children??[],t);s.length&&r.push({...i,children:s})}return r}const SS={new:"",seen:"bg-muted/50",understood:"bg-good",fading:"bg-warn/50",stale:"bg-warn"};function mp({roots:e,selected:t,onToggle:n,openFile:r,onOpen:i,levels:s,meta:l,openAll:o=!1}){const[u,c]=b.useState(""),[d,h]=b.useState(()=>o?new Set:new Set(e.map(g=>g.path))),p=b.useMemo(()=>new Set(t),[t]),f=b.useMemo(()=>v0(e,u.trim()),[e,u]),m=(g,k)=>{var M;const y=u?!0:o?!d.has(g.path):d.has(g.path),x=g.kind==="dir"?y0(g):[g.path],v=x.filter(F=>p.has(F)).length,j=v>0&&v===x.length,E=v>0&&!j,w=s==null?void 0:s.get(g.path),N=g.kind==="dir"?y?q1:np:jS.test(g.name)?os:NS.test(g.name)?s2:_1;return a.jsxs("div",{children:[a.jsxs("div",{className:le("group flex h-[22px] cursor-pointer items-center gap-1 pr-2 text-[13px]",r===g.path?"bg-sel text-ink dark:text-white":"hover:bg-raised"),style:{paddingLeft:k*12+8},onClick:()=>{g.kind==="dir"?h(F=>{const C=new Set(F);return C.has(g.path)?C.delete(g.path):C.add(g.path),C}):i(g.path)},children:[a.jsx(Tr,{className:le("h-3.5 w-3.5 shrink-0 text-muted transition",g.kind==="file"&&"invisible",y&&"rotate-90")}),a.jsx("input",{type:"checkbox",className:"h-3.5 w-3.5 shrink-0 cursor-pointer accent-[rgb(var(--accent))]",checked:j,ref:F=>{F&&(F.indeterminate=E)},onClick:F=>F.stopPropagation(),onChange:()=>n(x,!j),title:g.kind==="dir"?`Tick all ${x.length} files`:"Use as context"}),a.jsx(N,{className:le("h-4 w-4 shrink-0","text-muted")}),a.jsx("span",{className:"truncate",children:g.name}),w&&w!=="new"&&a.jsx("span",{title:w,className:le("ml-auto h-1.5 w-1.5 shrink-0 rounded-full",SS[w])}),l&&g.kind==="file"&&a.jsx("span",{className:"ml-auto flex shrink-0 items-center gap-1.5",children:l(g.path)})]}),g.kind==="dir"&&y&&((M=g.children)==null?void 0:M.map(F=>m(F,k+1)))]},g.path)};return a.jsxs("div",{className:"flex h-full flex-col",children:[a.jsx("div",{className:"px-2 py-1.5",children:a.jsxs("div",{className:"relative",children:[a.jsx(ms,{className:"pointer-events-none absolute left-2 top-[6px] h-3.5 w-3.5 text-muted"}),a.jsx("input",{className:"input h-[26px] pl-7 text-[13px]",placeholder:"Filter files",value:u,onChange:g=>c(g.target.value)})]})}),a.jsx("div",{className:"min-h-0 flex-1 overflow-auto pb-4",children:f.map(g=>m(g,0))})]})}function CS({current:e,onApply:t,onClose:n}){const{project:r}=it(),i=Dt(),[s,l]=b.useState(e),[o,u]=b.useState(null),[c,d]=b.useState(!1),h=ye({queryKey:["tree",r.id,r.contexts],queryFn:()=>me(`/projects/${r.id}/tree`)}),p=vi({mutationFn:f=>Ua(`/projects/${r.id}`,{contexts:[...r.contexts,f]}),onSuccess:()=>i.invalidateQueries()});return a.jsxs("div",{className:"fixed inset-0 z-50 grid place-items-center bg-black/40 p-4 backdrop-blur-sm",onClick:n,children:[a.jsxs("div",{className:"card flex h-[80vh] w-full max-w-xl flex-col overflow-hidden",onClick:f=>f.stopPropagation(),children:[a.jsxs("div",{className:"flex items-center gap-2 border-b border-line px-4 py-3",children:[a.jsx("h2",{className:"text-sm font-semibold",children:"Add context"}),a.jsxs("span",{className:"text-xs text-muted",children:[s.length," ticked"]}),a.jsx("button",{className:"ml-auto text-muted hover:text-ink",onClick:n,"aria-label":"Close",children:a.jsx(Rn,{className:"h-4 w-4"})})]}),a.jsxs("div",{className:"flex items-center gap-2 border-b border-line px-4 py-2 text-xs text-muted",children:[a.jsx("span",{className:"flex-1",children:"Tick files from the project or its context folders. The model reads them next to the change."}),a.jsx(ee,{size:"sm",icon:a.jsx(B1,{className:"h-3.5 w-3.5"}),onClick:()=>d(!0),children:"Add a folder"})]}),p.error&&a.jsx("div",{className:"p-2",children:a.jsx(Ke,{error:p.error.message})}),a.jsxs("div",{className:"min-h-0 flex-1",children:[h.isLoading&&a.jsx("div",{className:"p-4",children:a.jsx(kt,{})}),h.data&&a.jsx(mp,{roots:h.data,selected:s,onToggle:(f,m)=>l(m?[...new Set([...s,...f])]:s.filter(g=>!f.includes(g))),openFile:o,onOpen:f=>{u(f),l(s.includes(f)?s.filter(m=>m!==f):[...s,f])}})]}),a.jsxs("div",{className:"flex justify-end gap-2 border-t border-line px-4 py-3",children:[a.jsx(ee,{variant:"ghost",onClick:n,children:"Cancel"}),a.jsxs(ee,{variant:"primary",onClick:()=>{t(s),n()},children:["Use ",s.length," file",s.length===1?"":"s"]})]})]}),c&&a.jsx("div",{onClick:f=>f.stopPropagation(),children:a.jsx(pp,{title:"Add a context folder",cta:"Add as context",start:r.root.split("/").slice(0,-1).join("/"),onClose:()=>d(!1),onPick:f=>{d(!1),p.mutate(f)}})})]})}const Wc=5,Vc=[{id:"lens",label:"Lens",icon:_a,hint:"Read an explanation through one question"},{id:"quiz",label:"Quiz",icon:$a,hint:"Answer questions in your own words"},{id:"teach",label:"Teach",icon:Qu,hint:"Explain it yourself; get graded"},{id:"tutor",label:"Tutor",icon:Gu,hint:"Ask; get questions and hints back"},{id:"walk",label:"Walk",icon:Vu,hint:"One block at a time, with a check each"},{id:"practice",label:"Practice",icon:Ku,hint:"Write the key lines back"},{id:"hunt",label:"Bug hunt",icon:Wu,hint:"Find the bugs planted in a copy"},{id:"notes",label:"Notes",icon:G1,hint:"Your notes on this file"}],ES=["walk","hunt","notes"],Ag=[{value:1,label:"1",title:"One short hole"},{value:2,label:"2",title:"A condition and a computation"},{value:3,label:"3",title:"Core logic"},{value:4,label:"4",title:"Whole function bodies"}],Ig=[{value:1,label:"Easy",title:"One bug, fairly visible"},{value:2,label:"Medium",title:"Two bugs, one needs the logic"},{value:3,label:"Hard",title:"Two or three subtle bugs"}];function w0({files:e,diff:t,practiceFile:n,onRemove:r,onSetFiles:i}){var Xn,Jn,yr;const{project:s,rel:l,toggle:o,setSelected:u,focusLine:c}=it(),d=r??(Z=>o(Z,!1)),h=i??u,[p,f]=ec(),[m,g]=b.useState(!1),[k,y]=b.useState(!1),x=gt(),[v,j]=b.useState(()=>Vc.some(Z=>Z.id===p.get("do"))?p.get("do"):"lens"),[E,w]=b.useState(t?"change":"explain"),[N,M]=b.useState(""),[F,C]=b.useState(!1),[O,A]=b.useState(""),[V,U]=b.useState(""),[q,G]=b.useState("standard"),[X,z]=b.useState(null),[W,S]=b.useState(2),[D,te]=b.useState(""),[P,ve]=b.useState(1),[Le,we]=b.useState(""),Se=mn(),_t=ye({queryKey:["lens-kinds"],queryFn:()=>me("/lens-kinds"),staleTime:1/0}),an=ye({queryKey:["misconceptions",s.id],queryFn:()=>me(`/projects/${s.id}/misconceptions`)});b.useEffect(()=>{if(!p.get("do"))return;const Z=new URLSearchParams(p);Z.delete("do"),f(Z,{replace:!0})},[]);const Lt=`/projects/${s.id}`,qe=`/p/${s.id}`,lt=e.length===0,zn=ES.includes(v),An=ye({queryKey:["estimate",s.id,e],queryFn:()=>Ci(`${Lt}/estimate`,{files:e}),enabled:!lt&&!zn,staleTime:3e4}),Vt=()=>Se.run(`${Lt}/lenses`,{files:e,kind:N.trim()?"custom":E,question:N.trim()||void 0,diff:t,sketch:F&&O.trim()||void 0,traceInput:E==="trace"?V:void 0,depth:q},Z=>x(`${qe}/lens/${Z.resultId}`)),Gn=(Z=!1)=>Se.run(`${Lt}/quizzes`,Z?{files:[],weak:!0}:{files:e,diff:t,count:X??void 0},Qt=>x(`${qe}/quiz/${Qt.resultId}`)),on=(Z,Qt,vr)=>Se.run(`${Lt}/${Z}`,Qt,Zn=>x(`${qe}/${vr}/${Zn.resultId}`)),Yn=Vc.find(Z=>Z.id===v),xr=((Xn=an.data)==null?void 0:Xn.length)??0;return a.jsxs("div",{className:"flex h-full flex-col bg-panel",children:[a.jsx("div",{className:"grid grid-cols-4 gap-1 border-b border-line p-2",children:Vc.map(Z=>a.jsxs("button",{onClick:()=>j(Z.id),title:Z.hint,className:le("flex flex-col items-center gap-0.5 rounded-lg px-1 py-1.5 text-[12px] font-medium transition",v===Z.id?"bg-accent/12 text-accent":"text-muted hover:bg-raised hover:text-ink"),children:[a.jsx(Z.icon,{className:"h-4 w-4"}),Z.label]},Z.id))}),a.jsxs("div",{className:"min-h-0 flex-1 space-y-4 overflow-auto p-4",children:[a.jsxs("p",{className:"-mb-1 text-xs text-muted",children:[Yn.hint,"."]}),!zn&&a.jsxs("section",{children:[a.jsxs("div",{className:"label flex items-center gap-1",children:[a.jsxs("span",{children:["Context · ",e.length]}),t&&a.jsxs("span",{className:"truncate normal-case tracking-normal",children:["· change ",t.base,"..",t.head||"working tree"]}),a.jsxs("button",{className:"ml-auto inline-flex items-center gap-0.5 rounded px-1.5 py-0.5 normal-case tracking-normal text-accent hover:bg-accent/10",onClick:()=>g(!0),title:"Add files from the project or a context folder (docs, notes, a session)",children:[a.jsx(Q1,{className:"h-3 w-3"})," Add"]})]}),lt?a.jsx("p",{className:"rounded-lg border border-dashed border-line p-3 text-[14px] text-muted",children:"Tick files in the tree, open one, or use Add. The model reads only what you pick."}):a.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[(k?e:e.slice(0,Wc)).map(Z=>a.jsxs("span",{className:"group inline-flex max-w-full items-center gap-1 rounded-md bg-raised px-2 py-1 font-mono text-[12px]",title:Z,children:[a.jsx("span",{className:"truncate",children:fr(l(Z))}),a.jsx("button",{className:"text-muted hover:text-bad",onClick:()=>d(Z),"aria-label":"Remove",children:a.jsx(Rn,{className:"h-3 w-3"})})]},Z)),e.length>Wc&&a.jsx("button",{className:"rounded-md px-2 py-1 text-[12px] font-medium text-accent hover:bg-accent/10",onClick:()=>y(Z=>!Z),children:k?"show less":`+${e.length-Wc} more`})]}),An.data&&a.jsxs("div",{className:le("mt-1.5 text-[12px]",An.data.cut?"text-warn":"text-muted"),children:["~",An.data.tokens.toLocaleString()," tokens",An.data.cut&&" · some files do not fit and will be left out"]})]}),zn&&a.jsxs("section",{children:[a.jsx("div",{className:"label",children:"File"}),n?a.jsx("div",{className:"truncate rounded-md bg-raised px-2 py-1.5 font-mono text-xs",title:n,children:l(n)}):a.jsx("p",{className:"rounded-lg border border-dashed border-line p-3 text-[14px] text-muted",children:"Open a file first."})]}),v==="lens"&&a.jsxs(a.Fragment,{children:[a.jsxs("section",{children:[a.jsx("div",{className:"label",children:"Pick a lens"}),a.jsx("div",{className:"grid grid-cols-1 gap-1.5",children:(_t.data??[]).map(Z=>a.jsxs("button",{onClick:()=>{w(Z.id),M("")},className:le("rounded-lg border px-3 py-2 text-left transition",E===Z.id&&!N.trim()?"border-accent/60 bg-accent/8 ring-1 ring-accent/30":"border-line hover:border-accent/30 hover:bg-raised"),children:[a.jsx("div",{className:"text-[14px] font-medium",children:Z.label}),a.jsx("div",{className:"text-xs text-muted",children:Z.blurb})]},Z.id))})]}),E==="trace"&&!N.trim()&&a.jsxs("section",{children:[a.jsx("div",{className:"label",children:"Input to trace"}),a.jsx("input",{className:"input",placeholder:"e.g. add(3) (empty = the model picks one)",value:V,onChange:Z=>U(Z.target.value)})]}),a.jsxs("section",{children:[a.jsx("div",{className:"label",children:"Depth"}),a.jsx(Zt,{value:q,onChange:G,options:[{value:"overview",label:"Overview",title:"About 1.5 screens: the big picture, 3-4 steps"},{value:"standard",label:"Standard",title:"At least 3 screens: enough to change it safely, 6-9 steps"},{value:"deep",label:"Deep",title:"5-6 screens, a long blog post: every branch and failure path, 11-15 steps"}]})]}),a.jsxs("section",{children:[a.jsx("div",{className:"label",children:"Or ask your own question"}),a.jsx("textarea",{className:"input min-h-[64px] resize-y",placeholder:"e.g. Why is the retry here and not in the caller?",value:N,onChange:Z=>M(Z.target.value)})]}),a.jsxs("section",{className:"rounded-lg border border-line p-3",children:[a.jsxs("label",{className:"flex cursor-pointer items-center gap-2 text-[14px] font-medium",children:[a.jsx("input",{type:"checkbox",className:"accent-[rgb(var(--accent))]",checked:F,onChange:Z=>C(Z.target.checked)}),a.jsx(V1,{className:"h-3.5 w-3.5 text-accent"}),t?"Predict first":"My take first"]}),F&&a.jsxs(a.Fragment,{children:[a.jsx("textarea",{className:"input mt-2 min-h-[72px] resize-y",placeholder:t?"What behaviour changes, and what test or caller would break?":"In 2-3 lines: what does it do, and how? Where is the risk?",value:O,onChange:Z=>A(Z.target.value)}),a.jsx("p",{className:"mt-1 text-[12px] text-muted",children:"The lens opens with where your take differs. That gap is where the learning is."})]})]}),a.jsx(ee,{variant:"primary",className:"w-full",icon:a.jsx(ap,{className:"h-4 w-4"}),disabled:lt||Se.busy||F&&!O.trim(),onClick:Vt,children:"Make the lens"})]}),v==="quiz"&&a.jsxs(a.Fragment,{children:[a.jsxs("section",{children:[a.jsx("div",{className:"label",children:"Questions"}),a.jsx(Zt,{value:X??0,onChange:Z=>z(Z===0?null:Z),options:[{value:0,label:"Default"},{value:3,label:"3"},{value:5,label:"5"},{value:8,label:"8"}]}),a.jsx("p",{className:"mt-2 text-xs text-muted",children:"Free-text answers. Questions ask about behaviour and reasons, not names. Mark each answer sure or guess."})]}),a.jsxs(ee,{variant:"primary",className:"w-full",icon:a.jsx($a,{className:"h-4 w-4"}),disabled:lt||Se.busy,onClick:()=>Gn(),children:["Quiz me on ",e.length||""," file",e.length===1?"":"s"]}),a.jsxs("div",{className:"rounded-lg border border-line p-3",children:[a.jsxs("div",{className:"flex items-center gap-2 text-[14px] font-medium",children:[a.jsx(Ji,{className:"h-3.5 w-3.5 text-bad"})," Weak spots · ",xr]}),a.jsx("p",{className:"mt-1 text-xs text-muted",children:"New questions aimed at what you got wrong before, from any file. A right answer clears the weak spot."}),a.jsx(ee,{className:"mt-2 w-full",size:"sm",disabled:!xr||Se.busy,onClick:()=>Gn(!0),children:"Quiz my weak spots"})]})]}),v==="teach"&&a.jsxs(a.Fragment,{children:[a.jsxs("section",{children:[a.jsx("div",{className:"label",children:"Explain it to a new teammate"}),a.jsx("textarea",{className:"input min-h-[180px] resize-y",placeholder:"What does this code do, how, and why this way? What would surprise someone? Write it before you look anything up.",value:Le,onChange:Z=>we(Z.target.value)}),a.jsx("p",{className:"mt-1 text-xs text-muted",children:"Graded 1-5 against the code: what you got right, what you missed, what is wrong. 4+ counts as understood."})]}),a.jsx(ee,{variant:"primary",className:"w-full",icon:a.jsx(Qu,{className:"h-4 w-4"}),disabled:lt||Se.busy||Le.trim().length<20,onClick:()=>on("teachbacks",{files:e,text:Le,diff:t},"teach"),children:"Grade my explanation"})]}),v==="tutor"&&a.jsxs(a.Fragment,{children:[a.jsxs("section",{children:[a.jsx("div",{className:"label",children:"Your question"}),a.jsx("textarea",{className:"input min-h-[100px] resize-y",placeholder:"e.g. Why does this return early here?",value:Le,onChange:Z=>we(Z.target.value)}),a.jsx("p",{className:"mt-1 text-xs text-muted",children:"The tutor answers with a question or a hint first, and gives more each turn. Ask it to just tell you any time."})]}),a.jsx(ee,{variant:"primary",className:"w-full",icon:a.jsx(Gu,{className:"h-4 w-4"}),disabled:lt||Se.busy||!Le.trim(),onClick:()=>on("threads",{files:e,text:Le,diff:t},"tutor"),children:"Ask the tutor"})]}),v==="walk"&&a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"text-xs text-muted",children:"The file in reading order, one block at a time. Answer a short check on each block before the next."}),a.jsx(ee,{variant:"primary",className:"w-full",icon:a.jsx(Vu,{className:"h-4 w-4"}),disabled:!n||Se.busy,onClick:()=>on("walks",{file:n},"walk"),children:"Walk me through it"})]}),v==="practice"&&a.jsxs(a.Fragment,{children:[a.jsxs("section",{children:[a.jsxs("div",{className:"label",children:["Concept to practise ",a.jsx("span",{className:"normal-case tracking-normal",children:"(optional)"})]}),a.jsx("input",{className:"input",placeholder:"e.g. retry with backoff, how a run resumes",value:D,onChange:Z=>te(Z.target.value)}),a.jsx("p",{className:"mt-1.5 text-xs text-muted",children:"Leave it empty and the model picks the main idea of the files above. Holes can land in any of them."})]}),a.jsxs("section",{children:[a.jsx("div",{className:"label",children:"Difficulty"}),a.jsx(Zt,{value:W,onChange:S,options:Ag.map(Z=>({...Z}))}),a.jsxs("p",{className:"mt-2 text-xs text-muted",children:[(Jn=Ag.find(Z=>Z.value===W))==null?void 0:Jn.title,". The key lines are cut out of a copy; you write them back here, with hints if you need them. Your folder is not touched."]})]}),a.jsx(ee,{variant:"primary",className:"w-full",icon:a.jsx(Ku,{className:"h-4 w-4"}),disabled:lt||Se.busy,onClick:()=>on("practice",{files:e,level:W,concept:D.trim()||void 0},"practice"),children:"Make the practice"})]}),v==="hunt"&&a.jsxs(a.Fragment,{children:[a.jsxs("section",{children:[a.jsx("div",{className:"label",children:"Difficulty"}),a.jsx(Zt,{value:P,onChange:ve,options:Ig.map(Z=>({...Z}))}),a.jsxs("p",{className:"mt-2 text-xs text-muted",children:[(yr=Ig.find(Z=>Z.value===P))==null?void 0:yr.title,". Bugs go into a copy of the file. Click the lines you think are wrong and say why."]})]}),a.jsx(ee,{variant:"primary",className:"w-full",icon:a.jsx(Wu,{className:"h-4 w-4"}),disabled:!n||Se.busy,onClick:()=>on("hunts",{file:n,level:P},"hunt"),children:"Start the hunt"})]}),v==="notes"&&n&&a.jsx(PS,{file:n,line:c}),Se.busy&&Se.job&&a.jsx(sn,{kind:Se.job.kind,elapsed:Se.elapsed}),Se.error&&a.jsx(Ke,{error:Se.error,onClose:Se.clearError})]}),m&&a.jsx(CS,{current:e,onApply:h,onClose:()=>g(!1)})]})}function PS({file:e,line:t}){const{project:n,setOpenFile:r}=it(),i=Dt(),[s,l]=b.useState(""),o=ye({queryKey:["notes",n.id,e],queryFn:()=>me(`/projects/${n.id}/notes?file=${encodeURIComponent(e)}`)}),u=async()=>{await Ci(`/projects/${n.id}/notes`,{file:e,line:t??void 0,text:s}),l(""),i.invalidateQueries({queryKey:["notes",n.id]})},c=[...o.data??[]].sort((d,h)=>(d.line??0)-(h.line??0));return a.jsxs(a.Fragment,{children:[a.jsxs("section",{children:[a.jsxs("div",{className:"label",children:["New note ",t?`on line ${t}`:"on the file"]}),a.jsx("textarea",{className:"input min-h-[72px] resize-y",placeholder:"Click a line in the code to pin the note there.",value:s,onChange:d=>l(d.target.value)}),a.jsx(ee,{className:"mt-2 w-full",size:"sm",disabled:!s.trim(),onClick:u,children:"Add note"})]}),a.jsxs("section",{className:"space-y-2",children:[c.map(d=>a.jsxs("div",{className:"group rounded-lg border border-line p-2.5 text-[14px]",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[d.line?a.jsxs("button",{className:"font-mono text-[12px] text-accent hover:underline",onClick:()=>r(e,d.line),children:["line ",d.line]}):a.jsx("span",{className:"text-[12px] text-muted",children:"file"}),a.jsx("button",{className:"ml-auto text-muted opacity-0 transition hover:text-bad group-hover:opacity-100",onClick:async()=>{await cs(`/projects/${n.id}/notes/${d.id}`),i.invalidateQueries({queryKey:["notes",n.id]})},"aria-label":"Delete note",children:a.jsx(pr,{className:"h-3.5 w-3.5"})})]}),a.jsx("div",{className:"mt-1 whitespace-pre-wrap",children:d.text})]},d.id)),!c.length&&a.jsx("p",{className:"text-xs text-muted",children:"No notes on this file yet."})]})]})}function Ha({initial:e,onClose:t}){const{project:n,rel:r}=it(),i=Dt(),[s,l]=b.useState(e.front??""),[o,u]=b.useState(e.back??""),[c,d]=b.useState(null),[h,p]=b.useState(!1),f=async()=>{p(!0);try{await Ci(`/projects/${n.id}/cards`,{...e,front:s,back:o}),await i.invalidateQueries(),t()}catch(m){d(m.message),p(!1)}};return a.jsxs(tc,{title:a.jsxs("span",{className:"flex items-center gap-2",children:[a.jsx(Fr,{className:"h-4 w-4 text-accent"})," New review card"]}),onClose:t,footer:a.jsxs(a.Fragment,{children:[a.jsx(ee,{variant:"ghost",onClick:t,children:"Cancel"}),a.jsx(ee,{variant:"primary",loading:h,disabled:!s.trim()||!o.trim(),onClick:f,children:"Save card"})]}),children:[e.file&&a.jsxs("div",{className:"mb-3 font-mono text-[12px] text-muted",children:[r(e.file),e.line?`:${e.line}`:""]}),a.jsx("label",{className:"label",children:"Question (front)"}),a.jsx("textarea",{className:"input min-h-[72px]",value:s,onChange:m=>l(m.target.value),placeholder:"What should you be able to recall?",autoFocus:!0}),a.jsx("label",{className:"label mt-3",children:"Answer (back)"}),a.jsx("textarea",{className:"input min-h-[96px]",value:o,onChange:m=>u(m.target.value),placeholder:"The answer, in your own words"}),a.jsx("p",{className:"mt-2 text-xs text-muted",children:"The card comes back on the Review page: soon at first, then less often as you remember it."}),c&&a.jsx("div",{className:"mt-3",children:a.jsx(Ke,{error:c})})]})}const TS=4e3;let LS=null;const MS=()=>LS??(LS=ml(()=>import("./index-CyHGDhfc.js"),[])),RS={docker:"dockerfile",make:"makefile",text:"text"};function zS(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Qc(e,t){return`<pre><code>${e.split(`
469
+ `).map((n,r)=>`<span class="line ${t(r+1)}" data-line="${r+1}">${zS(n)}</span>`).join(`
470
+ `)}</code></pre>`}function Wa({text:e,lang:t,focusLine:n,marks:r,className:i,onLineClick:s,firstLine:l=1}){const[o,u]=b.useState(""),c=b.useRef(null),d=b.useRef(null);return b.useEffect(()=>{let h=!0;const p=m=>{const g=m+l-1,k=(r??[]).filter(y=>g>=y.from&&g<=y.to).map(y=>y.cls);return le(k,g===n&&"hl")};if(e.split(`
471
+ `).length>TS||t==="text"){u(Qc(e,p));return}return u(m=>m||Qc(e,p)),MS().then(async m=>{const g=RS[t]??t,k=await m.codeToHtml(e,{lang:g in m.bundledLanguages?g:"text",themes:{light:"solarized-light",dark:"dark-plus"},defaultColor:!1,transformers:[{line(y,x){y.properties["data-line"]=x;const v=p(x);v&&this.addClassToHast(y,v)}}]});h&&u(k)}).catch(()=>h&&u(Qc(e,p))),()=>{h=!1}},[e,t,n,r,l]),b.useEffect(()=>{if(!n||!c.current||d.current===n)return;const h=c.current.querySelector(`[data-line="${n-l+1}"]`);h==null||h.scrollIntoView({block:"center",behavior:"smooth"})},[o,n]),a.jsx("div",{ref:c,className:le("code-view font-mono",s&&"clickable",i),style:l>1?{"--line-start":l-1}:void 0,onClick:h=>{var f,m;if((f=window.getSelection())!=null&&f.toString())return;const p=(m=h.target.closest("[data-line]"))==null?void 0:m.dataset.line;if(p&&s){const g=Number(p)+l-1;d.current=g,s(g)}},dangerouslySetInnerHTML:{__html:o}})}function Fg(e,t,n){try{const r=localStorage.getItem(e);return r===null?t:n(r)}catch{return t}}function Dg(e,t){try{localStorage.setItem(e,t)}catch{}}function Kn({id:e,left:t,right:n,initial:r=280,min:i=180,max:s=640,side:l="left",className:o,collapsible:u=!1,startCollapsed:c=!1,openSignal:d}){const h=`cognitune.split.${e}`,[p,f]=b.useState(()=>Fg(h,r,Number)||r),[m,g]=b.useState(()=>u&&Fg(`${h}.collapsed`,c,U=>U==="1")),k=b.useRef(!0);b.useEffect(()=>{if(k.current){k.current=!1;return}d!=null&&g(!1)},[d]);const[y,x]=b.useState(!1),v=b.useRef(null),j=b.useRef();b.useEffect(()=>Dg(h,String(p)),[h,p]),b.useEffect(()=>Dg(`${h}.collapsed`,m?"1":"0"),[h,m]),b.useEffect(()=>{const U=G=>{if(!v.current)return;const X=G.clientX-v.current.x;f(Math.min(s,Math.max(i,v.current.size+(l==="left"?X:-X))))},q=()=>{v.current=null,document.body.style.cursor="",document.body.style.userSelect=""};return window.addEventListener("pointermove",U),window.addEventListener("pointerup",q),()=>{window.removeEventListener("pointermove",U),window.removeEventListener("pointerup",q)}},[i,s,l]);const E=()=>{clearTimeout(j.current),x(!0)},w=()=>{clearTimeout(j.current),j.current=setTimeout(()=>x(!1),250)};b.useEffect(()=>()=>clearTimeout(j.current),[]);const N=l==="left";b.useEffect(()=>{if(!u)return;const U=N?"[":"]",q=G=>{const X=G.target;G.key!==U||G.ctrlKey||G.metaKey||G.altKey||X.closest("input, textarea, select, [contenteditable=true], .cm-editor")||(g(z=>!z),x(!1))};return window.addEventListener("keydown",q),()=>window.removeEventListener("keydown",q)},[u,N]);const M=N?xu:Tr,F=N?Tr:xu,C=a.jsxs("div",{className:"group relative w-px shrink-0 cursor-col-resize bg-line",onPointerDown:U=>{U.target.closest("button")||(v.current={x:U.clientX,size:p},document.body.style.cursor="col-resize",document.body.style.userSelect="none")},onDoubleClick:()=>f(r),title:"Drag to resize, double-click to reset",children:[a.jsx("div",{className:"absolute inset-y-0 -left-1.5 -right-1.5 transition group-hover:bg-accent/30"}),u&&a.jsx("button",{onClick:()=>{g(!0),x(!1)},title:`Fold this pane away (key ${N?"[":"]"}); hover the edge to see it again`,className:"absolute top-1/2 z-20 -mt-5 grid h-10 w-5 -translate-x-1/2 place-items-center rounded-full border border-line bg-panel text-muted shadow-sm transition hover:border-accent/50 hover:text-accent",children:a.jsx(M,{className:"h-3 w-3"})})]}),O=a.jsx("div",{onMouseEnter:E,onMouseLeave:w,className:le("group flex w-3 shrink-0 cursor-pointer flex-col items-center justify-center bg-panel transition hover:bg-accent/10",N?"border-r border-line":"border-l border-line"),onClick:()=>{g(!1),x(!1)},title:`Hover to peek, click to pin open (key ${N?"[":"]"})`,children:a.jsx(F,{className:"h-3 w-3 text-muted group-hover:text-accent"})}),A=a.jsx("div",{style:{width:p},onMouseEnter:m?E:void 0,onMouseLeave:m?w:void 0,className:le("min-h-0 shrink-0 overflow-hidden",m&&!y&&"hidden",m&&y&&le("absolute inset-y-0 z-30 shadow-2xl ring-1 ring-line",N?"left-3":"right-3")),children:N?t:n}),V=a.jsx("div",{className:"min-h-0 min-w-0 flex-1 overflow-hidden",children:N?n:t});return a.jsx("div",{className:le("relative flex h-full min-h-0 min-w-0",o),children:N?a.jsxs(a.Fragment,{children:[m&&O,A,!m&&C,V]}):a.jsxs(a.Fragment,{children:[V,!m&&C,A,m&&O]})})}function AS(){var M;const{project:e,selected:t,setSelected:n,toggle:r,openFile:i,setOpenFile:s,focusLine:l,rel:o}=it(),u=Dt(),[c,d]=b.useState(!1),[h,p]=b.useState(!1),f=ye({queryKey:["notes",e.id,i],queryFn:()=>me(`/projects/${e.id}/notes?file=${encodeURIComponent(i)}`),enabled:!!i}),m=b.useMemo(()=>(f.data??[]).filter(F=>F.line).map(F=>({from:F.line,to:F.line,cls:"note"})),[f.data]),g=ye({queryKey:["tree",e.id,e.contexts],queryFn:()=>me(`/projects/${e.id}/tree`)}),k=ye({queryKey:["progress",e.id],queryFn:()=>me(`/projects/${e.id}/progress`)}),y=ye({queryKey:["file",e.id,i],queryFn:()=>me(`/projects/${e.id}/file?path=${encodeURIComponent(i)}`),enabled:!!i}),x=vi({mutationFn:F=>Ua(`/projects/${e.id}`,{contexts:F}),onSuccess:()=>u.invalidateQueries()}),v=b.useMemo(()=>new Map((k.data??[]).map(F=>[F.path,F.level])),[k.data]),j=t.length?t:i?[i]:[],E=i?t.includes(i):!1,w=a.jsxs("div",{className:"flex h-full flex-col bg-side",children:[a.jsxs("div",{className:"flex items-center gap-2 border-b border-line px-3 py-2.5",children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("div",{className:"truncate text-sm font-semibold",children:e.name}),a.jsx("div",{className:"truncate font-mono text-[12px] text-muted",title:e.root,children:fr(e.root,30)})]}),a.jsx(ee,{size:"sm",variant:"ghost",icon:a.jsx(B1,{className:"h-4 w-4"}),title:"Add a context folder (docs, notes, a session folder)",onClick:()=>d(!0)})]}),e.contexts.length>0&&a.jsx("div",{className:"flex flex-wrap gap-1 border-b border-line px-3 py-2",children:e.contexts.map(F=>a.jsxs(be,{tone:"accent",className:"max-w-full",children:[a.jsxs("span",{className:"truncate",title:F,children:["+ ",F.split("/").pop()]}),a.jsx("button",{onClick:()=>x.mutate(e.contexts.filter(C=>C!==F)),"aria-label":"Remove context folder",children:a.jsx(Rn,{className:"h-3 w-3"})})]},F))}),t.length>0&&a.jsxs("div",{className:"flex items-center gap-2 border-b border-line bg-accent/5 px-3 py-1.5 text-xs",children:[a.jsxs("span",{className:"font-medium text-accent",children:[t.length," ticked"]}),a.jsx("button",{className:"ml-auto text-muted hover:text-ink",onClick:()=>n([]),children:"clear"})]}),a.jsxs("div",{className:"min-h-0 flex-1",children:[g.isLoading&&a.jsx("div",{className:"p-4",children:a.jsx(kt,{})}),g.error&&a.jsx("div",{className:"p-3",children:a.jsx(Ke,{error:g.error.message})}),g.data&&a.jsx(mp,{roots:g.data,selected:t,onToggle:(F,C)=>n(C?[...t,...F]:t.filter(O=>!F.includes(O))),openFile:i,onOpen:F=>s(F),levels:v})]})]}),N=a.jsx("div",{className:"flex h-full flex-col",children:i?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center gap-2 border-b border-line bg-panel px-4 py-2",children:[a.jsx("div",{className:"min-w-0 flex-1 truncate font-mono text-[14px]",children:o(i)}),y.data&&a.jsx(be,{children:y.data.lang}),v.get(i)&&v.get(i)!=="new"&&a.jsx(be,{tone:v.get(i)==="understood"?"good":v.get(i)==="stale"?"warn":"muted",children:v.get(i)}),a.jsx(ee,{size:"sm",variant:"ghost",icon:a.jsx(Fr,{className:"h-3.5 w-3.5"}),title:"Make a review card about this file (click a line first to pin it)",onClick:()=>p(!0),children:"Card"}),a.jsx(ee,{size:"sm",variant:E?"primary":"secondary",icon:E?a.jsx(x2,{className:"h-3.5 w-3.5"}):a.jsx(y2,{className:"h-3.5 w-3.5"}),onClick:()=>r(i),children:E?"In context":"Add to context"})]}),a.jsxs("div",{className:"min-h-0 flex-1 overflow-auto bg-panel",children:[y.isLoading&&a.jsx("div",{className:"p-6",children:a.jsx(kt,{})}),y.error&&a.jsx("div",{className:"p-4",children:a.jsx(Ke,{error:y.error.message})}),y.data&&a.jsx(Wa,{text:y.data.text,lang:y.data.lang,focusLine:l,marks:m,onLineClick:F=>s(i,F)}),((M=y.data)==null?void 0:M.truncated)&&a.jsx("div",{className:"p-3 text-xs text-warn",children:"File cut at 400 KB."})]})]}):a.jsx(Ft,{icon:a.jsx(_a,{className:"h-6 w-6"}),title:"Pick a file to read",children:"Open a file on the left, or tick several to give the model more context. Then choose a lens, a quiz or a practice on the right."})});return a.jsxs(a.Fragment,{children:[a.jsx(Kn,{id:"explore-tree",collapsible:!0,className:"h-full",initial:290,left:w,right:a.jsx(Kn,{id:"explore-panel",collapsible:!0,side:"right",initial:360,min:300,max:560,left:N,right:a.jsx(w0,{files:j,practiceFile:i,onSetFiles:n})})}),h&&i&&a.jsx(Ha,{initial:{kind:"own",file:i,line:l??void 0},onClose:()=>p(!1)}),c&&a.jsx(pp,{title:"Add a context folder",cta:"Add as context",start:e.root.split("/").slice(0,-1).join("/"),onClose:()=>d(!1),onPick:F=>{d(!1),x.mutate([...e.contexts,F])}})]})}function Kc({value:e,options:t,onChange:n,placeholder:r="Pick one",className:i}){const[s,l]=b.useState(!1),[o,u]=b.useState(""),[c,d]=b.useState(0),h=b.useRef(null),p=b.useRef(null),f=t.find(k=>k.value===e),m=b.useMemo(()=>{const k=o.toLowerCase().split(/\s+/).filter(Boolean);return k.length?t.filter(y=>{const x=`${y.label} ${y.hint??""} ${y.group??""}`.toLowerCase();return k.every(v=>x.includes(v))}):t},[t,o]);b.useEffect(()=>{if(!s)return;const k=y=>{var x;return!((x=h.current)!=null&&x.contains(y.target))&&l(!1)};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[s]),b.useEffect(()=>d(0),[o,s]),b.useEffect(()=>{var k,y;(y=(k=p.current)==null?void 0:k.querySelector(`[data-i="${c}"]`))==null||y.scrollIntoView({block:"nearest"})},[c]);const g=k=>{n(k),l(!1),u("")};return a.jsxs("div",{ref:h,className:le("relative",i),children:[a.jsxs("button",{type:"button",onClick:()=>l(k=>!k),className:le("input flex h-8 items-center gap-2 py-0 text-left text-xs",s&&"border-accent ring-2 ring-accent/20"),title:f?`${f.label}${f.hint?` · ${f.hint}`:""}`:void 0,children:[a.jsx("span",{className:"min-w-0 flex-1 truncate",children:f?f.label:a.jsx("span",{className:"text-muted",children:r})}),(f==null?void 0:f.hint)&&a.jsx("span",{className:"max-w-[40%] shrink-0 truncate text-[12px] text-muted",children:f.hint}),a.jsx(Xj,{className:"h-3.5 w-3.5 shrink-0 text-muted"})]}),s&&a.jsxs("div",{className:"absolute left-0 right-0 top-full z-40 mt-1 overflow-hidden rounded-lg border border-line bg-panel shadow-xl",children:[a.jsxs("div",{className:"relative border-b border-line",children:[a.jsx(ms,{className:"pointer-events-none absolute left-2.5 top-2.5 h-3.5 w-3.5 text-muted"}),a.jsx("input",{autoFocus:!0,value:o,onChange:k=>u(k.target.value),placeholder:"Type to filter",className:"w-full bg-transparent py-2 pl-8 pr-3 text-xs text-ink outline-none placeholder:text-muted/70",onKeyDown:k=>{k.key==="ArrowDown"?(k.preventDefault(),d(y=>Math.min(m.length-1,y+1))):k.key==="ArrowUp"?(k.preventDefault(),d(y=>Math.max(0,y-1))):k.key==="Enter"&&m[c]?(k.preventDefault(),g(m[c].value)):k.key==="Escape"&&l(!1)}})]}),a.jsxs("div",{ref:p,className:"max-h-72 overflow-auto py-1",children:[m.map((k,y)=>{var x;return a.jsxs("div",{children:[k.group&&k.group!==((x=m[y-1])==null?void 0:x.group)&&a.jsx("div",{className:"px-3 pb-1 pt-2 text-[11.5px] font-medium uppercase tracking-wide text-muted",children:k.group}),a.jsxs("button",{type:"button","data-i":y,onMouseEnter:()=>d(y),onClick:()=>g(k.value),className:le("flex w-full items-center gap-2 px-3 py-1.5 text-left text-xs",y===c?"bg-accent/10 text-ink":"text-ink/90"),children:[a.jsx(ep,{className:le("h-3.5 w-3.5 shrink-0 text-accent",k.value!==e&&"invisible")}),a.jsx("span",{className:"min-w-0 flex-1 truncate",children:k.label}),k.hint&&a.jsx("span",{className:"max-w-[45%] shrink-0 truncate text-[12px] text-muted",children:k.hint})]})]},k.value)}),!m.length&&a.jsx("div",{className:"px-3 py-4 text-center text-xs text-muted",children:"No match"})]})]})]})}let IS=null;const FS=()=>IS??(IS=ml(()=>import("./index-CyHGDhfc.js"),[])),DS=4e3;function OS(e){const t=[];let n=0,r=0,i=!1;for(const s of e.split(`
472
+ `)){const l=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@(.*)$/.exec(s);if(l){n=Number(l[1]),r=Number(l[2]),i=!0,t.push({kind:"hunk",text:s});continue}if(i)if(s.startsWith("+"))t.push({kind:"add",right:r++,text:s.slice(1)});else if(s.startsWith("-"))t.push({kind:"del",left:n++,text:s.slice(1)});else{if(s.startsWith("\\"))continue;(s.startsWith(" ")||s==="")&&t.push({kind:"ctx",left:n++,right:r++,text:s.slice(1)})}}return t.length&&t[t.length-1].kind==="ctx"&&t[t.length-1].text===""&&t.pop(),t}function _S(e){const t=[];for(let n=0;n<e.length;){const r=e[n];if(r.kind==="hunk")t.push({hunk:r.text}),n++;else if(r.kind==="ctx")t.push({left:r,right:r}),n++;else{const i=[],s=[];for(;n<e.length&&e[n].kind==="del";)i.push(e[n++]);for(;n<e.length&&e[n].kind==="add";)s.push(e[n++]);for(let l=0;l<Math.max(i.length,s.length);l++)t.push({left:i[l],right:s[l]})}}return t}const Lh="w-12 shrink-0 select-none pr-3 text-right text-muted/60",k0="min-w-0 flex-1 whitespace-pre-wrap break-all pr-4";function $S(e,t){const[n,r]=b.useState(new Map);return b.useEffect(()=>{const i=e.filter(l=>l.kind!=="hunk");if(!i.length||t==="text"||i.length>DS){r(new Map);return}let s=!0;return FS().then(async l=>{if(!(t in l.bundledLanguages))return;const o=await l.codeToHtml(i.map(d=>d.text).join(`
473
+ `),{lang:t,themes:{light:"solarized-light",dark:"dark-plus"},defaultColor:!1}),u=new DOMParser().parseFromString(o,"text/html").querySelectorAll(".line"),c=new Map;i.forEach((d,h)=>u[h]&&c.set(d,u[h].innerHTML)),s&&r(c)}).catch(()=>{}),()=>{s=!1}},[e,t]),n}function qS({patch:e,mode:t,lang:n="text"}){const r=b.useMemo(()=>OS(e),[e]),i=$S(r,n),s=o=>i.has(o)?a.jsx("span",{className:"shiki",dangerouslySetInnerHTML:{__html:i.get(o)}}):o.text,l=!r.some(o=>o.kind==="ctx")&&(!r.some(o=>o.kind==="add")||!r.some(o=>o.kind==="del"));return r.length?t==="unified"||l?a.jsx("div",{className:"min-h-full py-1 font-mono text-[13.5px] leading-6",children:r.map((o,u)=>o.kind==="hunk"?a.jsx("div",{className:"diff-hunk px-4",children:o.text},u):a.jsxs("div",{className:le("flex",o.kind==="add"&&"diff-add",o.kind==="del"&&"diff-del"),children:[a.jsx("span",{className:Lh,children:o.left??""}),a.jsx("span",{className:Lh,children:o.right??""}),a.jsx("span",{className:"w-4 shrink-0 select-none text-muted",children:o.kind==="add"?"+":o.kind==="del"?"-":""}),a.jsx("span",{className:k0,children:s(o)})]},u))}):a.jsx(BS,{rows:_S(r),hl:i}):a.jsx("div",{className:"p-6 text-sm text-muted",children:"No text changes (binary file or mode change)."})}function BS({rows:e,hl:t}){const n=b.useRef(null),[r,i]=b.useState(()=>{try{return Number(localStorage.getItem("cognitune.diff.split"))||50}catch{return 50}});b.useEffect(()=>{try{localStorage.setItem("cognitune.diff.split",String(r))}catch{}},[r]);const s=o=>{var h;const u=(h=n.current)==null?void 0:h.getBoundingClientRect();if(!u)return;o.preventDefault();const c=p=>i(Math.min(85,Math.max(15,(p.clientX-u.left)/u.width*100))),d=()=>{window.removeEventListener("pointermove",c),window.removeEventListener("pointerup",d),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",c),window.addEventListener("pointerup",d)},l=(o,u,c)=>a.jsxs("div",{className:le("flex min-w-0",(o==null?void 0:o.kind)==="del"&&"diff-del",(o==null?void 0:o.kind)==="add"&&"diff-add",!o&&"bg-raised/60"),children:[a.jsx("span",{className:Lh,children:o?u===0?o.left:o.right:""}),a.jsx("span",{className:k0,children:o?t.has(o)?a.jsx("span",{className:"shiki",dangerouslySetInnerHTML:{__html:t.get(o)}}):o.text:""})]},c);return a.jsxs("div",{ref:n,className:"relative min-h-full font-mono text-[13.5px] leading-6",children:[a.jsx("div",{className:"grid py-1",style:{gridTemplateColumns:`${r}% ${100-r}%`},children:e.map((o,u)=>o.hunk?a.jsx("div",{className:"diff-hunk col-span-2 whitespace-pre-wrap break-all px-4",children:o.hunk},u):[l(o.left,0,`${u}l`),l(o.right,1,`${u}r`)])}),a.jsx("div",{className:"group absolute inset-y-0 z-10 w-px cursor-col-resize bg-line",style:{left:`${r}%`},onPointerDown:s,onDoubleClick:()=>i(50),title:"Drag to move, double-click to centre",children:a.jsx("div",{className:"absolute inset-y-0 -left-1.5 -right-1.5 transition group-hover:bg-accent/30"})})]})}function US(e,t){const n={name:"",path:e,kind:"dir",children:[]};for(const i of t){if(!i.startsWith(e+"/"))continue;const s=i.slice(e.length+1).split("/");let l=n;s.forEach((o,u)=>{const c=u===s.length-1;l.children??(l.children=[]);let d=l.children.find(h=>h.name===o&&h.kind===(c?"file":"dir"));d||(d={name:o,path:`${l.path}/${o}`,kind:c?"file":"dir",...c?{}:{children:[]}},l.children.push(d)),l=d})}const r=i=>{var o;if(i.kind==="file")return i;let s=i;for(;((o=s.children)==null?void 0:o.length)===1&&s.children[0].kind==="dir";){const u=s.children[0];s={...u,name:`${s.name}/${u.name}`}}const l=(s.children??[]).map(r);return l.sort((u,c)=>u.kind===c.kind?u.name.localeCompare(c.name):u.kind==="dir"?-1:1),{...s,children:l}};return(r(n).children??[]).map(i=>i.name.startsWith("/")?{...i,name:i.name.slice(1)}:i)}const HS={added:"text-good",deleted:"text-bad",modified:"text-warn",renamed:"text-accent"};function WS(){var A,V,U;const{project:e,rel:t}=it(),n=ye({queryKey:["repos",e.id,e.contexts],queryFn:()=>me(`/projects/${e.id}/repos`)}),r=`cognitune.repo.${e.id}`,[i,s]=b.useState(()=>{let q;try{q=sessionStorage.getItem(r)||void 0}catch{}return{repo:q,base:"HEAD",head:""}}),[l,o]=b.useState(null),[u,c]=b.useState(new Set),[d,h]=b.useState([]),[p,f]=b.useState("split"),m=n.data??[],g=m.find(q=>q.path===i.repo)??m[0];b.useEffect(()=>{g&&g.path!==i.repo&&s(q=>({...q,repo:g.path}))},[g,i.repo]);const k=q=>{try{sessionStorage.setItem(r,q)}catch{}s({repo:q,base:"HEAD",head:""})},y=!!g&&i.repo===g.path,x=q=>`/projects/${e.id}/${q}${q.includes("?")?"&":"?"}repo=${encodeURIComponent(i.repo??"")}`,v=ye({queryKey:["refs",e.id,i.repo],queryFn:()=>me(x("refs")),enabled:y}),j=ye({queryKey:["diff",e.id,i],queryFn:()=>me(x(`diff?base=${encodeURIComponent(i.base)}&head=${encodeURIComponent(i.head)}`)),enabled:y}),E=j.data??[];b.useEffect(()=>{c(new Set(E.map(q=>q.path))),o(q=>{var G;return q&&E.some(X=>X.path===q)?q:((G=E[0])==null?void 0:G.path)??null})},[j.data]);const w=b.useMemo(()=>E.find(q=>q.path===l),[E,l]),N=b.useMemo(()=>new Map(E.map(q=>[q.path,q])),[E]),M=b.useMemo(()=>i.repo?US(i.repo,E.map(q=>q.path)):[],[i.repo,E]);if(n.isLoading)return a.jsx("div",{className:"p-8",children:a.jsx(kt,{})});if(!m.length)return a.jsx(Ft,{icon:a.jsx(U1,{className:"h-6 w-6"}),title:"No git repositories found",children:"Changes needs git history. No repo was found in this folder or its sub-folders (4 levels down). Explore, lenses and quizzes work without it."});const F=[{value:"HEAD",label:"HEAD",hint:(A=v.data)==null?void 0:A.current,group:"Current"},...(((V=v.data)==null?void 0:V.branches)??[]).map(q=>({value:q,label:q,group:"Branches"})),...(((U=v.data)==null?void 0:U.commits)??[]).map(q=>({value:q.sha,label:`${q.sha} ${q.subject}`,hint:q.when,group:"Recent commits"}))],C=a.jsxs("div",{className:"flex h-full flex-col bg-side",children:[a.jsxs("div",{className:"space-y-2 border-b border-line p-3",children:[m.length>1&&a.jsxs("div",{children:[a.jsxs("div",{className:"label",children:["Repository (",m.length,")"]}),a.jsx(Kc,{value:(g==null?void 0:g.path)??"",onChange:k,options:m.map(q=>({value:q.path,label:q.name,hint:q.branch}))})]}),a.jsxs("div",{children:[a.jsx("div",{className:"label",children:"From"}),a.jsx(Kc,{value:i.base,onChange:q=>s({...i,base:q}),options:F})]}),a.jsxs("div",{children:[a.jsx("div",{className:"label",children:"To"}),a.jsx(Kc,{value:i.head,onChange:q=>s({...i,head:q}),options:[{value:"",label:"Working tree (uncommitted)",group:"Current"},...F]})]})]}),a.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 text-xs text-muted",children:[a.jsxs("span",{children:[E.length," files"]}),a.jsxs("span",{className:"text-good",children:["+",E.reduce((q,G)=>q+G.additions,0)]}),a.jsxs("span",{className:"text-bad",children:["-",E.reduce((q,G)=>q+G.deletions,0)]}),a.jsx("button",{className:"ml-auto hover:text-ink",onClick:()=>c(u.size===E.length?new Set:new Set(E.map(q=>q.path))),children:u.size===E.length?"none":"all"})]}),a.jsxs("div",{className:"min-h-0 flex-1",children:[j.isLoading&&a.jsx("div",{className:"p-3",children:a.jsx(kt,{})}),j.error&&a.jsx("div",{className:"p-2",children:a.jsx(Ke,{error:j.error.message})}),E.length>0&&a.jsx(mp,{roots:M,openAll:!0,selected:[...u],onToggle:(q,G)=>{const X=new Set(u);for(const z of q)G?X.add(z):X.delete(z);c(X)},openFile:l,onOpen:o,meta:q=>{const G=N.get(q);return G?a.jsxs(a.Fragment,{children:[a.jsxs("span",{className:"font-mono text-[11.5px] text-good",children:["+",G.additions]}),a.jsxs("span",{className:"font-mono text-[11.5px] text-bad",children:["-",G.deletions]}),a.jsx("span",{className:le("w-3 text-center font-mono text-[12px] font-bold uppercase",HS[G.status]),title:G.status,children:G.status[0]})]}):null}},`${i.repo}|${i.base}|${i.head}`),!j.isLoading&&!E.length&&a.jsx("div",{className:"px-3 py-8 text-center text-sm text-muted",children:"No changes between these two."})]})]}),O=a.jsxs("div",{className:"flex h-full flex-col",children:[a.jsxs("div",{className:"flex items-center gap-2 border-b border-line bg-panel px-4 py-2",children:[a.jsx("div",{className:"min-w-0 flex-1 truncate font-mono text-[14px]",children:w?t(w.path):""}),a.jsx(Zt,{value:p,onChange:f,options:[{value:"split",label:"Split"},{value:"unified",label:"Unified"}]})]}),a.jsx("div",{className:"min-h-0 flex-1 overflow-auto bg-panel",children:w?a.jsx(qS,{patch:w.patch,mode:p,lang:x0(w.path)}):a.jsx(Ft,{title:"Pick a file"})})]});return a.jsx(Kn,{id:"changes-list",collapsible:!0,initial:300,className:"h-full",left:C,right:a.jsx(Kn,{id:"changes-panel",collapsible:!0,side:"right",initial:360,min:300,max:560,left:O,right:a.jsx(w0,{files:[...u,...d],diff:i,onRemove:q=>{c(new Set([...u].filter(G=>G!==q))),h(d.filter(G=>G!==q))},onSetFiles:q=>{const G=new Set(E.map(X=>X.path));c(new Set(q.filter(X=>G.has(X)))),h(q.filter(X=>!G.has(X)))},practiceFile:(w==null?void 0:w.status)!=="deleted"?w==null?void 0:w.path:null})})})}const VS=["lenses","quizzes","practice","teachbacks","walks","hunts","threads","cards","weak","glossary","notes"],QS={quiz:"quiz miss",teachback:"teach-back",walk:"walk check",hunt:"bug hunt"};function KS(){var D,te,P,ve,Le,we,Se,_t,an,Lt,qe,lt,zn,An,Vt,Gn,on,Yn,xr,Xn,Jn,yr,Z,Qt,vr,Zn,_,H,fe,pe,ht,Ce,at;const{project:e,rel:t,setOpenFile:n}=it(),r=Dt(),[i,s]=ec(),l=VS.includes(i.get("tab"))?i.get("tab"):"lenses",o=R=>s({tab:R},{replace:!0}),[u,c]=b.useState(""),[d,h]=b.useState(null),p=`/projects/${e.id}`,f=`/p/${e.id}`,m=R=>ye({queryKey:[R,e.id],queryFn:()=>me(`${p}/${R}`)}),g=m("lenses"),k=m("quizzes"),y=m("practice"),x=m("teachbacks"),v=m("walks"),j=m("hunts"),E=m("threads"),w=m("cards"),N=m("notes"),M=m("misconceptions"),F=gt(),C=mn(),[O,A]=b.useState(null),V=(R,ke)=>{A(ke),C.run(`${p}/quizzes`,{files:[],weak:!0,weakIds:R},Je=>F(`${f}/quiz/${Je.resultId}`))},U=async R=>{await cs(`${p}/misconceptions/${R}`),r.invalidateQueries({queryKey:["misconceptions",e.id]}),r.invalidateQueries({queryKey:["today",e.id]})},q=ye({queryKey:["glossary",e.id],queryFn:()=>me(`${p}/glossary`),enabled:l==="glossary"}),G=b.useMemo(()=>{const R=u.toLowerCase().split(/\s+/).filter(Boolean);return(...ke)=>{const Je=ke.join(" ").toLowerCase();return R.every(vn=>Je.includes(vn))}},[u]),X=R=>a.jsxs("div",{className:"mt-2 truncate font-mono text-[12px] text-muted",children:[R.slice(0,3).map(ke=>fr(t(ke),28)).join(" · "),R.length>3&&` +${R.length-3}`]}),z="card block p-4 transition hover:-translate-y-0.5 hover:border-accent/40",W=R=>a.jsx("span",{className:"ml-auto text-[12px] text-muted",children:Tt(R)}),S=(R,ke,Je)=>a.jsx(Ft,{icon:R,title:ke,children:Je});return a.jsxs("div",{className:"flex h-full flex-col",children:[a.jsx("div",{className:"border-b border-line bg-panel px-8 pt-6",children:a.jsxs("div",{className:"mx-auto max-w-[72rem]",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Library"}),a.jsxs("p",{className:"text-sm text-muted",children:["Everything made in ",e.name,"."]})]}),a.jsxs("div",{className:"relative w-64",children:[a.jsx(ms,{className:"pointer-events-none absolute left-2.5 top-2.5 h-3.5 w-3.5 text-muted"}),a.jsx("input",{className:"input h-8 pl-8 text-[14px]",placeholder:"Search this tab",value:u,onChange:R=>c(R.target.value)})]}),a.jsxs("a",{href:`/api${p}/export`,className:"inline-flex items-center gap-1 rounded-md px-2 py-1.5 text-xs text-muted hover:bg-raised hover:text-ink",title:"Everything for this project as one JSON file",children:[a.jsx(tp,{className:"h-3.5 w-3.5"})," Export all"]})]}),a.jsx(dS,{className:"-mx-2 mt-3 border-b-0",wrap:!0,value:l,onChange:o,tabs:[{value:"lenses",label:"Lenses",count:(D=g.data)==null?void 0:D.length},{value:"quizzes",label:"Quizzes",count:(te=k.data)==null?void 0:te.length},{value:"teachbacks",label:"Teach-backs",count:(P=x.data)==null?void 0:P.length},{value:"walks",label:"Walks",count:(ve=v.data)==null?void 0:ve.length},{value:"practice",label:"Practice",count:(Le=y.data)==null?void 0:Le.length},{value:"hunts",label:"Bug hunts",count:(we=j.data)==null?void 0:we.length},{value:"threads",label:"Tutor",count:(Se=E.data)==null?void 0:Se.length},{value:"cards",label:"Cards",count:(_t=w.data)==null?void 0:_t.length},{value:"weak",label:"Weak spots",count:(an=M.data)==null?void 0:an.length},{value:"glossary",label:"Glossary"},{value:"notes",label:"Notes",count:(Lt=N.data)==null?void 0:Lt.length}]})]})}),a.jsx("div",{className:"min-h-0 flex-1 overflow-auto p-8",children:a.jsxs("div",{className:"mx-auto max-w-[72rem]",children:[l==="weak"&&!!((qe=M.data)!=null&&qe.length)&&a.jsxs("div",{className:"mb-4",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("p",{className:"flex-1 text-[14px] text-muted",children:"Wrong beliefs picked up from your answers. Answer a question on one correctly and it goes away; dismiss one the grader got wrong."}),a.jsxs(ee,{size:"sm",variant:"primary",icon:a.jsx(Ji,{className:"h-3.5 w-3.5"}),disabled:C.busy,onClick:()=>V(M.data.slice(0,6).map(R=>R.id),"all"),children:["Quiz me on ",M.data.length>6?"the top 6":"all of them"]})]}),C.busy&&C.job&&O==="all"&&a.jsx("div",{className:"mt-3",children:a.jsx(sn,{kind:"quiz",elapsed:C.elapsed})}),C.error&&a.jsx("div",{className:"mt-3",children:a.jsx(Ke,{error:C.error,onClose:C.clearError})})]}),a.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[l==="lenses"&&((lt=g.data)==null?void 0:lt.filter(R=>G(R.title,R.summary,R.kind,...R.files)).map(R=>a.jsxs(ft,{to:`${f}/lens/${R.id}`,className:z,children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(be,{tone:"accent",children:R.kind}),R.diff&&a.jsx(be,{tone:"warn",children:"change"}),R.sketch&&a.jsx(be,{children:"your take first"}),W(R.createdAt)]}),a.jsx("div",{className:"mt-2 font-medium leading-snug",children:R.title}),a.jsx("p",{className:"mt-1 line-clamp-2 text-[14px] text-muted",children:R.summary}),X(R.files)]},R.id))),l==="quizzes"&&((zn=k.data)==null?void 0:zn.filter(R=>G(R.title,...R.files)).map(R=>{const ke=R.attempts.length?Math.max(...R.attempts.map(Je=>Je.score)):null;return a.jsxs(ft,{to:`${f}/quiz/${R.id}`,className:z,children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(be,{children:[R.questions.length," questions"]}),ke===null?a.jsx(be,{tone:"warn",children:"not taken"}):a.jsxs("span",{className:"text-xs text-muted",children:["best ",a.jsx(Ca,{score:ke,size:"sm"})," · ",R.attempts.length," tries"]}),W(R.createdAt)]}),a.jsx("div",{className:"mt-2 font-medium leading-snug",children:R.title}),X(R.files)]},R.id)})),l==="teachbacks"&&((An=x.data)==null?void 0:An.filter(R=>G(R.text,...R.files)).map(R=>a.jsxs(ft,{to:`${f}/teach/${R.id}`,className:z,children:[a.jsxs("div",{className:"flex items-center gap-2",children:[R.grade&&a.jsxs(be,{tone:R.grade.score>=4?"good":R.grade.score>=3?"warn":"bad",children:[R.grade.score,"/5"]}),W(R.createdAt)]}),a.jsx("p",{className:"mt-2 line-clamp-3 text-[14px]",children:R.text}),X(R.files)]},R.id))),l==="walks"&&((Vt=v.data)==null?void 0:Vt.filter(R=>G(R.file,...R.blocks.map(ke=>ke.title))).map(R=>{const ke=R.blocks.filter(Je=>Je.verdict).length;return a.jsxs(ft,{to:`${f}/walk/${R.id}`,className:z,children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(be,{tone:ke===R.blocks.length?"good":"warn",children:[ke,"/",R.blocks.length," checked"]}),W(R.createdAt)]}),a.jsx("div",{className:"mt-2 truncate font-mono text-sm",children:t(R.file)})]},R.id)})),l==="practice"&&((Gn=y.data)==null?void 0:Gn.filter(R=>G(R.file)).map(R=>{var Je;const ke=(Je=R.review)==null?void 0:Je.holes.filter(vn=>vn.verdict==="right").length;return a.jsxs(ft,{to:`${f}/practice/${R.id}`,className:z,children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(be,{tone:"accent",children:["level ",R.level]}),a.jsxs(be,{children:[R.holes.length," holes"]}),R.review?a.jsxs(be,{tone:ke===R.holes.length?"good":"warn",children:[ke,"/",R.holes.length," right"]}):a.jsx(be,{tone:"warn",children:"open"}),W(R.createdAt)]}),a.jsx("div",{className:"mt-2 truncate font-mono text-sm",children:t(R.file)})]},R.id)})),l==="hunts"&&((on=j.data)==null?void 0:on.filter(R=>G(R.file)).map(R=>a.jsxs(ft,{to:`${f}/hunt/${R.id}`,className:z,children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(be,{tone:"bad",children:["","easy","medium","hard"][R.level]}),R.grade?a.jsx("span",{className:"text-xs text-muted",children:a.jsx(Ca,{score:R.grade.score,size:"sm"})}):a.jsx(be,{tone:"warn",children:"open"}),W(R.createdAt)]}),a.jsx("div",{className:"mt-2 truncate font-mono text-sm",children:t(R.file)})]},R.id))),l==="threads"&&((Yn=E.data)==null?void 0:Yn.filter(R=>G(R.title,...R.messages.map(ke=>ke.text))).map(R=>a.jsxs(ft,{to:`${f}/tutor/${R.id}`,className:z,children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(be,{children:[R.messages.length," messages"]}),W(R.createdAt)]}),a.jsx("div",{className:"mt-2 line-clamp-2 font-medium leading-snug",children:R.title}),X(R.files)]},R.id))),l==="cards"&&((xr=w.data)==null?void 0:xr.filter(R=>G(R.front,R.back,R.file)).map(R=>a.jsxs("div",{className:"card group p-4",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(be,{tone:R.kind==="miss"?"bad":R.kind==="concept"?"accent":"muted",children:R.kind}),R.suspended?a.jsx(be,{children:"paused"}):a.jsxs("span",{className:"text-[12px] text-muted",children:["due in ",Th(R.fsrs.due)]}),a.jsxs("span",{className:"ml-auto flex gap-1 opacity-0 transition group-hover:opacity-100",children:[a.jsx("button",{className:"text-muted hover:text-ink",title:R.suspended?"Resume":"Pause",onClick:async()=>{await Ua(`${p}/cards/${R.id}`,{suspended:!R.suspended}),r.invalidateQueries({queryKey:["cards",e.id]})},children:R.suspended?a.jsx(Jj,{className:"h-3.5 w-3.5"}):a.jsx(D1,{className:"h-3.5 w-3.5"})}),a.jsx("button",{className:"text-muted hover:text-bad",title:"Archive",onClick:async()=>{await cs(`${p}/cards/${R.id}`),r.invalidateQueries({queryKey:["cards",e.id]})},children:a.jsx(pr,{className:"h-3.5 w-3.5"})})]})]}),a.jsx("div",{className:"mt-2 text-[14.5px] font-medium leading-snug",children:R.front}),a.jsx("p",{className:"mt-1 line-clamp-2 text-[14px] text-muted",children:R.back}),R.file&&a.jsxs("div",{className:"mt-2 truncate font-mono text-[12px] text-muted",children:[t(R.file),R.line?`:${R.line}`:""]})]},R.id))),l==="weak"&&((Xn=M.data)==null?void 0:Xn.filter(R=>G(R.text,R.file)).map(R=>a.jsxs("div",{className:"card flex flex-col p-4",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(be,{tone:"bad",children:QS[R.from]??R.from}),R.seen>1&&a.jsxs(be,{tone:"warn",children:["seen ",R.seen,"×"]}),W(R.createdAt)]}),a.jsx("p",{className:"mt-2 text-[14.5px] leading-snug",children:R.text}),R.file&&a.jsxs(ft,{to:`${f}/explore`,onClick:()=>n(R.file,R.line),className:"mt-2 truncate font-mono text-[12px] text-muted hover:text-accent",children:[t(R.file),R.line?`:${R.line}`:""]}),a.jsxs("div",{className:"mt-3 flex items-center gap-2 pt-1",children:[a.jsx(ee,{size:"sm",icon:a.jsx(Ji,{className:"h-3.5 w-3.5"}),disabled:C.busy,onClick:()=>V([R.id],R.id),children:"Quiz me on this"}),a.jsx(ee,{size:"sm",variant:"ghost",icon:a.jsx(Rn,{className:"h-3.5 w-3.5"}),onClick:()=>U(R.id),title:"The grader got this wrong, or it no longer applies",children:"Dismiss"})]}),C.busy&&C.job&&O===R.id&&a.jsx("div",{className:"mt-3",children:a.jsx(sn,{kind:"quiz",elapsed:C.elapsed})})]},R.id))),l==="notes"&&((Jn=N.data)==null?void 0:Jn.filter(R=>G(R.text,R.file)).map(R=>a.jsxs(ft,{to:`${f}/explore`,onClick:()=>R.file&&n(R.file,R.line),className:z,children:[a.jsxs("div",{className:"flex items-center gap-2",children:[R.file&&a.jsxs("span",{className:"truncate font-mono text-[12px] text-accent",children:[t(R.file),R.line?`:${R.line}`:""]}),W(R.createdAt)]}),a.jsx("p",{className:"mt-2 whitespace-pre-wrap text-[14.5px]",children:R.text})]},R.id)))]}),l==="glossary"&&a.jsxs("div",{className:"divide-y divide-line",children:[(yr=q.data)==null?void 0:yr.filter(R=>G(R.term,...R.explains.map(ke=>ke.text))).map(R=>a.jsxs("div",{className:"group py-3",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"text-[16px] font-semibold",children:R.term}),a.jsx("span",{className:"text-[12px] text-muted",children:R.files.slice(0,3).map(ke=>fr(t(ke),24)).join(" · ")}),a.jsx("button",{className:"ml-auto text-muted opacity-0 transition hover:text-accent group-hover:opacity-100",title:"Make a review card",onClick:()=>{var ke;return h({kind:"concept",front:`What is "${R.term}" here, and why does it matter?`,back:((ke=R.explains[0])==null?void 0:ke.text)??"",file:R.files[0]})},children:a.jsx(Fr,{className:"h-3.5 w-3.5"})})]}),R.explains.map((ke,Je)=>a.jsxs("p",{className:"mt-1 text-[14.5px] text-ink/85",children:[ke.text," ",a.jsxs(ft,{to:`${f}/lens/${ke.lensId}`,className:"text-[12px] text-muted hover:text-accent",children:["(",ke.lensTitle,")"]})]},Je))]},R.term)),((Z=q.data)==null?void 0:Z.length)===0&&S(a.jsx(Gj,{className:"h-6 w-6"}),"No terms yet","Every lens adds the concepts it explains here.")]}),l==="lenses"&&((Qt=g.data)==null?void 0:Qt.length)===0&&S(a.jsx(_a,{className:"h-6 w-6"}),"No lenses yet","Open Explore, pick files, choose a lens."),l==="quizzes"&&((vr=k.data)==null?void 0:vr.length)===0&&S(a.jsx($a,{className:"h-6 w-6"}),"No quizzes yet","Quiz yourself from Explore, Changes, or the end of a lens."),l==="teachbacks"&&((Zn=x.data)==null?void 0:Zn.length)===0&&S(a.jsx(Qu,{className:"h-6 w-6"}),"No teach-backs yet","In Explore, pick Teach and explain the code in your own words."),l==="walks"&&((_=v.data)==null?void 0:_.length)===0&&S(a.jsx(Vu,{className:"h-6 w-6"}),"No walkthroughs yet","Open a file in Explore and pick Walk."),l==="practice"&&((H=y.data)==null?void 0:H.length)===0&&S(a.jsx(Ku,{className:"h-6 w-6"}),"No practice yet","Open a file in Explore and pick Practice."),l==="hunts"&&((fe=j.data)==null?void 0:fe.length)===0&&S(a.jsx(Wu,{className:"h-6 w-6"}),"No bug hunts yet","Open a file in Explore and pick Bug hunt."),l==="threads"&&((pe=E.data)==null?void 0:pe.length)===0&&S(a.jsx(Gu,{className:"h-6 w-6"}),"No tutor chats yet","Ask the tutor from Explore or from a missed quiz question."),l==="cards"&&((ht=w.data)==null?void 0:ht.length)===0&&S(a.jsx(Fr,{className:"h-6 w-6"}),"No cards yet","Quiz misses become cards on their own. You can also make one from a lens concept or a code line."),l==="weak"&&((Ce=M.data)==null?void 0:Ce.length)===0&&S(a.jsx(Ji,{className:"h-6 w-6"}),"No weak spots","Wrong answers in quizzes, teach-backs and walks show up here as the belief behind them."),l==="notes"&&((at=N.data)==null?void 0:at.length)===0&&S(a.jsx(G1,{className:"h-6 w-6"}),"No notes yet","In Explore, click a line and add a note from the Notes tab.")]})}),d&&a.jsx(Ha,{initial:d,onClose:()=>h(null)})]})}function kl({file:e,text:t,lang:n,line:r,marks:i,onLineClick:s,title:l,empty:o="Code shows here",onClose:u}){var f,m;const{project:c,rel:d}=it(),h=ye({queryKey:["file",c.id,e],queryFn:()=>me(`/projects/${c.id}/file?path=${encodeURIComponent(e)}`),enabled:!!e&&t===void 0}),p=t??((f=h.data)==null?void 0:f.text);return a.jsx("div",{className:"flex h-full flex-col bg-panel",children:e?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center gap-2 border-b border-line px-4 py-2 font-mono text-[13px] text-muted",children:[a.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[l??d(e),r?`:${r}`:""]}),u&&a.jsx("button",{className:"text-xs hover:text-ink",onClick:u,children:"close"})]}),a.jsxs("div",{className:"min-h-0 flex-1 overflow-auto",children:[h.isLoading&&a.jsx("div",{className:"p-4",children:a.jsx(kt,{})}),h.error&&a.jsx("div",{className:"p-3",children:a.jsx(Ke,{error:h.error.message})}),p!==void 0&&a.jsx(Wa,{text:p,lang:n??((m=h.data)==null?void 0:m.lang)??x0(e),focusLine:r,marks:i,onLineClick:s})]})]}):a.jsx(Ft,{title:o})})}function GS(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const YS=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,XS=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,JS={};function Og(e,t){return(JS.jsx?XS:YS).test(e)}const ZS=/[ \t\n\f\r]/g;function eC(e){return typeof e=="object"?e.type==="text"?_g(e.value):!1:_g(e)}function _g(e){return e.replace(ZS,"")===""}class Va{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Va.prototype.normal={};Va.prototype.property={};Va.prototype.space=void 0;function b0(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Va(n,r,t)}function Mh(e){return e.toLowerCase()}class ln{constructor(t,n){this.attribute=n,this.property=t}}ln.prototype.attribute="";ln.prototype.booleanish=!1;ln.prototype.boolean=!1;ln.prototype.commaOrSpaceSeparated=!1;ln.prototype.commaSeparated=!1;ln.prototype.defined=!1;ln.prototype.mustUseProperty=!1;ln.prototype.number=!1;ln.prototype.overloadedBoolean=!1;ln.prototype.property="";ln.prototype.spaceSeparated=!1;ln.prototype.space=void 0;let tC=0;const ge=gs(),ut=gs(),Rh=gs(),K=gs(),_e=gs(),Zi=gs(),un=gs();function gs(){return 2**++tC}const zh=Object.freeze(Object.defineProperty({__proto__:null,boolean:ge,booleanish:ut,commaOrSpaceSeparated:un,commaSeparated:Zi,number:K,overloadedBoolean:Rh,spaceSeparated:_e},Symbol.toStringTag,{value:"Module"})),Gc=Object.keys(zh);class gp extends ln{constructor(t,n,r,i){let s=-1;if(super(t,n),$g(this,"space",i),typeof r=="number")for(;++s<Gc.length;){const l=Gc[s];$g(this,Gc[s],(r&zh[l])===zh[l])}}}gp.prototype.defined=!0;function $g(e,t,n){n&&(e[t]=n)}function bl(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const s=new gp(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[Mh(r)]=r,n[Mh(s.attribute)]=r}return new Va(t,n,e.space)}const j0=bl({properties:{ariaActiveDescendant:null,ariaAtomic:ut,ariaAutoComplete:null,ariaBusy:ut,ariaChecked:ut,ariaColCount:K,ariaColIndex:K,ariaColSpan:K,ariaControls:_e,ariaCurrent:null,ariaDescribedBy:_e,ariaDetails:null,ariaDisabled:ut,ariaDropEffect:_e,ariaErrorMessage:null,ariaExpanded:ut,ariaFlowTo:_e,ariaGrabbed:ut,ariaHasPopup:null,ariaHidden:ut,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:_e,ariaLevel:K,ariaLive:null,ariaModal:ut,ariaMultiLine:ut,ariaMultiSelectable:ut,ariaOrientation:null,ariaOwns:_e,ariaPlaceholder:null,ariaPosInSet:K,ariaPressed:ut,ariaReadOnly:ut,ariaRelevant:null,ariaRequired:ut,ariaRoleDescription:_e,ariaRowCount:K,ariaRowIndex:K,ariaRowSpan:K,ariaSelected:ut,ariaSetSize:K,ariaSort:null,ariaValueMax:K,ariaValueMin:K,ariaValueNow:K,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function N0(e,t){return t in e?e[t]:t}function S0(e,t){return N0(e,t.toLowerCase())}const nC=bl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Zi,acceptCharset:_e,accessKey:_e,action:null,allow:null,allowFullScreen:ge,allowPaymentRequest:ge,allowUserMedia:ge,alpha:ge,alt:null,as:null,async:ge,autoCapitalize:null,autoComplete:_e,autoFocus:ge,autoPlay:ge,blocking:_e,capture:null,charSet:null,checked:ge,cite:null,className:_e,closedBy:null,colorSpace:null,cols:K,colSpan:K,command:null,commandFor:null,content:null,contentEditable:ut,controls:ge,controlsList:_e,coords:K|Zi,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ge,defer:ge,dir:null,dirName:null,disabled:ge,download:Rh,draggable:ut,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ge,formTarget:null,headers:_e,height:K,hidden:Rh,high:K,href:null,hrefLang:null,htmlFor:_e,httpEquiv:_e,id:null,imageSizes:null,imageSrcSet:null,inert:ge,inputMode:null,integrity:null,is:null,isMap:ge,itemId:null,itemProp:_e,itemRef:_e,itemScope:ge,itemType:_e,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ge,low:K,manifest:null,max:null,maxLength:K,media:null,method:null,min:null,minLength:K,multiple:ge,muted:ge,name:null,nonce:null,noModule:ge,noValidate:ge,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:ge,optimum:K,pattern:null,ping:_e,placeholder:null,playsInline:ge,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ge,referrerPolicy:null,rel:_e,required:ge,reversed:ge,rows:K,rowSpan:K,sandbox:_e,scope:null,scoped:ge,seamless:ge,selected:ge,shadowRootClonable:ge,shadowRootCustomElementRegistry:ge,shadowRootDelegatesFocus:ge,shadowRootMode:null,shadowRootSerializable:ge,shape:null,size:K,sizes:null,slot:null,span:K,spellCheck:ut,src:null,srcDoc:null,srcLang:null,srcSet:null,start:K,step:null,style:null,tabIndex:K,target:null,title:null,translate:null,type:null,typeMustMatch:ge,useMap:null,value:ut,width:K,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:_e,axis:null,background:null,bgColor:null,border:K,borderColor:null,bottomMargin:K,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ge,declare:ge,event:null,face:null,frame:null,frameBorder:null,hSpace:K,leftMargin:K,link:null,longDesc:null,lowSrc:null,marginHeight:K,marginWidth:K,noResize:ge,noHref:ge,noShade:ge,noWrap:ge,object:null,profile:null,prompt:null,rev:null,rightMargin:K,rules:null,scheme:null,scrolling:ut,standby:null,summary:null,text:null,topMargin:K,valueType:null,version:null,vAlign:null,vLink:null,vSpace:K,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:ge,disablePictureInPicture:ge,disableRemotePlayback:ge,exportParts:Zi,part:_e,prefix:null,property:null,results:K,security:null,unselectable:null},space:"html",transform:S0}),rC=bl({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:un,accentHeight:K,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:K,amplitude:K,arabicForm:null,ascent:K,attributeName:null,attributeType:null,azimuth:K,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:K,by:null,calcMode:null,capHeight:K,className:_e,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:K,diffuseConstant:K,direction:null,display:null,dur:null,divisor:K,dominantBaseline:null,download:ge,dx:null,dy:null,edgeMode:null,editable:null,elevation:K,enableBackground:null,end:null,event:null,exponent:K,externalResourcesRequired:null,fill:null,fillOpacity:K,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:Zi,g2:Zi,glyphName:Zi,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:K,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:K,horizOriginX:K,horizOriginY:K,id:null,ideographic:K,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:K,k:K,k1:K,k2:K,k3:K,k4:K,kernelMatrix:un,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:K,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:K,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:K,overlineThickness:K,paintOrder:null,panose1:null,path:null,pathLength:K,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:_e,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:K,pointsAtY:K,pointsAtZ:K,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:un,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:un,rev:un,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:un,requiredFeatures:un,requiredFonts:un,requiredFormats:un,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:K,specularExponent:K,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:K,strikethroughThickness:K,string:null,stroke:null,strokeDashArray:un,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:K,strokeOpacity:K,strokeWidth:null,style:null,surfaceScale:K,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:un,tabIndex:K,tableValues:null,target:null,targetX:K,targetY:K,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:un,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:K,underlineThickness:K,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:K,values:null,vAlphabetic:K,vMathematical:K,vectorEffect:null,vHanging:K,vIdeographic:K,version:null,vertAdvY:K,vertOriginX:K,vertOriginY:K,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:K,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:N0}),C0=bl({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()}}),E0=bl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:S0}),P0=bl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),iC={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"},sC=/[A-Z]/g,qg=/-[a-z]/g,lC=/^data[-\w.:]+$/i;function aC(e,t){const n=Mh(t);let r=t,i=ln;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&lC.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(qg,uC);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!qg.test(s)){let l=s.replace(sC,oC);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=gp}return new i(r,t)}function oC(e){return"-"+e.toLowerCase()}function uC(e){return e.charAt(1).toUpperCase()}const cC=b0([j0,nC,C0,E0,P0],"html"),xp=b0([j0,rC,C0,E0,P0],"svg");function dC(e){return e.join(" ").trim()}var Bg=/\/\*(?:[^*]|\*(?!\/))*\*\//g,hC=/\n/g,fC=/^\s*/,pC=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,mC=/^:\s*/,gC=/^((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|url\((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|[^)]*)\)|[^};])+)/,xC=/^[;\s]*/,yC=`
474
+ `,Ug="/",Hg="*",Ol="",vC="comment",wC="declaration";function kC(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(m){var g=m.match(hC);g&&(n+=g.length);var k=m.lastIndexOf(yC);r=~k?m.length-k:r+m.length}function s(){var m={line:n,column:r};return function(g){return g.position=new l(m),c(),g}}function l(m){this.start=m,this.end={line:n,column:r},this.source=t.source}l.prototype.content=e;function o(m){var g=new Error(t.source+":"+n+":"+r+": "+m);if(g.reason=m,g.filename=t.source,g.line=n,g.column=r,g.source=e,!t.silent)throw g}function u(m){var g=m.exec(e);if(g){var k=g[0];return i(k),e=e.slice(k.length),g}}function c(){u(fC)}function d(m){for(var g;g=h();)m.push(g);return m}function h(){var m=s();if(!(Ug!=e.charAt(0)||Hg!=e.charAt(1))){for(var g=2;Ol!=e.charAt(g)&&(Hg!=e.charAt(g)||Ug!=e.charAt(g+1));)++g;if(g+=2,Ol===e.charAt(g-1))return o("End of comment missing");var k=e.slice(2,g-2);return r+=2,i(k),e=e.slice(g),r+=2,m({type:vC,comment:k})}}function p(){var m=s(),g=u(pC);if(g){if(h(),!u(mC))return o("property missing ':'");var k=u(gC),y=m({type:wC,property:g[0].replace(Bg,Ol).trim(),value:k?k[0].replace(Bg,Ol).trim():Ol});return u(xC),y}}function f(){var m=[];d(m);for(var g;g=p();)m.push(g),d(m);return m}return c(),f()}function bC(e,t){let n=null;if(!e||typeof e!="string")return n;const r=kC(e),i=typeof t=="function";return r.forEach(s=>{if(s.type!=="declaration")return;const{property:l,value:o}=s;i?t(l,o,s):o&&(n=n??{},n[l]=o)}),n}const T0=L0("end"),yp=L0("start");function L0(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 jC(e){const t=yp(e),n=T0(e);if(t&&n)return{start:t,end:n}}function na(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Wg(e.position):"start"in e||"end"in e?Wg(e):"line"in e||"column"in e?Ah(e):""}function Ah(e){return Vg(e&&e.line)+":"+Vg(e&&e.column)}function Wg(e){return Ah(e&&e.start)+"-"+Ah(e&&e.end)}function Vg(e){return e&&typeof e=="number"?e:1}class Ot extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},l=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?i=t:!s.cause&&t&&(l=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?s.ruleId=r:(s.source=r.slice(0,u),s.ruleId=r.slice(u+1))}if(!s.place&&s.ancestors&&s.ancestors){const u=s.ancestors[s.ancestors.length-1];u&&(s.place=u.position)}const o=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=o?o.line:void 0,this.name=na(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=l&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Ot.prototype.file="";Ot.prototype.name="";Ot.prototype.reason="";Ot.prototype.message="";Ot.prototype.stack="";Ot.prototype.column=void 0;Ot.prototype.line=void 0;Ot.prototype.ancestors=void 0;Ot.prototype.cause=void 0;Ot.prototype.fatal=void 0;Ot.prototype.place=void 0;Ot.prototype.ruleId=void 0;Ot.prototype.source=void 0;const vp={}.hasOwnProperty,NC=new Map,SC=/[A-Z]/g,CC=/-([a-z])/g,EC=new Set(["table","tbody","thead","tfoot","tr"]),PC=new Set(["td","th"]),M0="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function TC(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=DC(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=FC(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"?xp:cC,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=R0(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function R0(e,t,n){if(t.type==="element")return LC(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return MC(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return zC(e,t,n);if(t.type==="mdxjsEsm")return RC(e,t);if(t.type==="root")return AC(e,t,n);if(t.type==="text")return IC(e,t)}function LC(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=xp,e.schema=i),e.ancestors.push(t);const s=A0(e,t.tagName,!1),l=OC(e,t);let o=kp(e,t);return EC.has(t.tagName)&&(o=o.filter(function(u){return typeof u=="string"?!eC(u):!0})),z0(e,l,s,t),wp(l,o),e.ancestors.pop(),e.schema=r,e.create(t,s,l,n)}function MC(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)}Ea(e,t.position)}function RC(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ea(e,t.position)}function zC(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=xp,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:A0(e,t.name,!0),l=_C(e,t),o=kp(e,t);return z0(e,l,s,t),wp(l,o),e.ancestors.pop(),e.schema=r,e.create(t,s,l,n)}function AC(e,t,n){const r={};return wp(r,kp(e,t)),e.create(t,e.Fragment,r,n)}function IC(e,t){return t.value}function z0(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function wp(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function FC(e,t,n){return r;function r(i,s,l,o){const c=Array.isArray(l.children)?n:t;return o?c(s,l,o):c(s,l)}}function DC(e,t){return n;function n(r,i,s,l){const o=Array.isArray(s.children),u=yp(r);return t(i,s,l,o,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function OC(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&vp.call(t.properties,i)){const s=$C(e,i,t.properties[i]);if(s){const[l,o]=s;e.tableCellAlignToStyle&&l==="align"&&typeof o=="string"&&PC.has(t.tagName)?r=o:n[l]=o}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function _C(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const l=s.expression;l.type;const o=l.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else Ea(e,t.position);else{const{name:i}=r;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,s=e.evaluater.evaluateExpression(o.expression)}else Ea(e,t.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function kp(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:NC;for(;++r<t.children.length;){const s=t.children[r];let l;if(e.passKeys){const u=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(u){const c=i.get(u)||0;l=u+"-"+c,i.set(u,c+1)}}const o=R0(e,s,l);o!==void 0&&n.push(o)}return n}function $C(e,t,n){if(n==null||typeof n=="number"&&Number.isNaN(n))return;const r=aC(e.schema,t);return Array.isArray(n)&&(n=r.commaSeparated?GS(n):dC(n)),r.property==="style"?["style",typeof n=="object"?e.stylePropertyNameCase==="dom"?n:BC(n):qC(e,String(n))]:[e.elementAttributeNameCase==="react"&&r.space?iC[r.property]||r.property:r.attribute,n]}function qC(e,t){const n={};try{bC(t,function(r,i){if(r&&i){let s=r;s.slice(0,2)!=="--"&&(s=s.toLowerCase(),e.stylePropertyNameCase==="dom"&&(s.slice(0,4)==="-ms-"&&(s=s.slice(1)),s=s.replace(CC,WC))),n[s]=i}})}catch(r){if(e.ignoreInvalidStyle)return{};const i=r,s=new Ot("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=M0+"#cannot-parse-style-attribute",s}return n}function A0(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let s=-1,l;for(;++s<i.length;){const o=Og(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};l=l?{type:"MemberExpression",object:l,property:o,computed:!!(s&&o.type==="Literal"),optional:!1}:o}r=l}else r=Og(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return vp.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Ea(e)}function Ea(e,t){const n=new Ot("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=M0+"#cannot-handle-mdx-estrees-without-createevaluater",n}function BC(e){const t={};let n;for(n in e)vp.call(e,n)&&(t[UC(n)]=e[n]);return t}function UC(e){if(e.slice(0,2)==="--")return e;let t=e.replace(SC,HC);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function HC(e){return"-"+e.toLowerCase()}function WC(e,t){return t.toUpperCase()}const Yc={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"]},VC={};function rc(e,t){const n=VC,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return I0(e,r,i)}function I0(e,t,n){if(QC(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 Qg(e.children,t,n)}return Array.isArray(e)?Qg(e,t,n):""}function Qg(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=I0(e[i],t,n);return r.join("")}function QC(e){return!!(e&&typeof e=="object")}const Kg=document.createElement("i");function bp(e){const t="&"+e+";";Kg.innerHTML=t;const n=Kg.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Wn(e,t,n,r){const i=e.length;let s=0,l;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);s<r.length;)l=r.slice(s,s+1e4),l.unshift(t,0),e.splice(...l),s+=1e4,t+=1e4}function En(e,t){return e.length>0?(Wn(e,e.length,0,t),e):t}const Gg={}.hasOwnProperty;function F0(e){const t={};let n=-1;for(;++n<e.length;)KC(t,e[n]);return t}function KC(e,t){let n;for(n in t){const i=(Gg.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let l;if(s)for(l in s){Gg.call(i,l)||(i[l]=[]);const o=s[l];GC(i[l],Array.isArray(o)?o:o?[o]:[])}}}function GC(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Wn(e,0,0,r)}function D0(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 Vn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const St=Ei(/[A-Za-z]/),Ct=Ei(/[\dA-Za-z]/),YC=Ei(/[#-'*+\--9=?A-Z^-~]/);function bu(e){return e!==null&&(e<32||e===127)}const Ih=Ei(/\d/),XC=Ei(/[\dA-Fa-f]/),O0=Ei(/[!-/:-@[-`{-~]/);function he(e){return e!==null&&e<-2}function $e(e){return e!==null&&(e<0||e===32)}function Ne(e){return e===-2||e===-1||e===32}const ic=Ei(new RegExp("\\p{P}|\\p{S}","u")),ds=Ei(/\s/);function Ei(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function jl(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const s=e.charCodeAt(n);let l="";if(s===37&&Ct(e.charCodeAt(n+1))&&Ct(e.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(l=String.fromCharCode(s));else if(s>55295&&s<57344){const o=e.charCodeAt(n+1);s<56320&&o>56319&&o<57344?(l=String.fromCharCode(s,o),i=1):l="�"}else l=String.fromCharCode(s);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+i+1,l=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Ae(e,t,n,r){const i=r?r-1:1/0;let s=0;return l;function l(u){return Ne(u)?(e.enter(n),o(u)):t(u)}function o(u){return Ne(u)&&s++<i?(e.consume(u),o):(e.exit(n),t(u))}}function _0(e,t,n,r,i,s){let l=0;return o;function o(d){return Ne(d)?(e.enter(r),u(d)):c(d)}function u(d){return Ne(d)&&l<s?(e.consume(d),l++,u):(e.exit(r),c(d))}function c(d){return l>=i?t(d):n(d)}}const JC={tokenize:ZC};function ZC(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Ae(e,t,"linePrefix")}function i(o){return e.enter("paragraph"),s(o)}function s(o){const u=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,l(o)}function l(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return he(o)?(e.consume(o),e.exit("chunkText"),s):(e.consume(o),l)}}let ju=class{constructor(){this.index=new Map,this.map=[]}add(t,n,r){Yg(this,t,n,r,!1)}addBefore(t,n,r){Yg(this,t,n,r,!0)}consume(t){if(this.map.sort(function(s,l){return s[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const s of i)t.push(s);i=r.pop()}this.map.length=0,this.index.clear()}};function Yg(e,t,n,r,i){if(n===0&&r.length===0)return;const s=e.index.get(t);if(s){s[1]+=n,i?(r.push(...s[2]),s[2]=r):s[2].push(...r);return}const l=[t,n,r];e.map.push(l),e.index.set(t,l)}const e3={tokenize:t3},Xg={tokenize:n3};function t3(e){const t=this,n=[];let r=0,i,s,l;return o;function o(v){if(r<n.length){const j=n[r];return t.containerState=j[1],e.attempt(j[0].continuation,u,c)(v)}return c(v)}function u(v){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&x();const j=t.events.length;let E=j,w;for(;E--;)if(t.events[E][0]==="exit"&&t.events[E][1].type==="chunkFlow"){w=t.events[E][1].end;break}y(r);let N=j;for(;N<t.events.length;)t.events[N][1].end={...w},N++;const M=new ju;return M.add(E+1,0,t.events.slice(j)),M.add(j,N-j,[]),M.consume(t.events),c(v)}return o(v)}function c(v){if(r===n.length){if(!i)return p(v);if(i.currentConstruct&&i.currentConstruct.concrete)return m(v);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Xg,d,h)(v)}function d(v){return i&&x(),y(r),p(v)}function h(v){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,m(v)}function p(v){return t.containerState={},e.attempt(Xg,f,m)(v)}function f(v){return r++,n.push([t.currentConstruct,t.containerState]),p(v)}function m(v){if(v===null){i&&x(),y(0),e.consume(v);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),g(v)}function g(v){if(v===null){k(e.exit("chunkFlow"),!0),y(0),e.consume(v);return}return he(v)?(e.consume(v),k(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(v),g)}function k(v,j){const E=t.sliceStream(v);if(j&&E.push(null),v.previous=s,s&&(s.next=v),s=v,i.defineSkip(v.start),i.write(E),t.parser.lazy[v.start.line]){let w=i.events.length;for(;w--;)if(i.events[w][1].start.offset<l&&(!i.events[w][1].end||i.events[w][1].end.offset>l))return;const N=t.events.length;let M=N,F,C;for(;M--;)if(t.events[M][0]==="exit"&&t.events[M][1].type==="chunkFlow"){if(F){C=t.events[M][1].end;break}F=!0}for(y(r),w=N;w<t.events.length;)t.events[w][1].end={...C},w++;const O=new ju;O.add(M+1,0,t.events.slice(N)),O.add(N,w-N,[]),O.consume(t.events)}}function y(v){let j=n.length;for(;j-- >v;){const E=n[j];t.containerState=E[1],E[0].exit.call(t,e)}n.length=v}function x(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function n3(e,t,n){return Ae(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function wi(e){if(e===null||$e(e)||ds(e))return 1;if(ic(e))return 2}function sc(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const s=e[i].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const Fh={name:"attention",resolveAll:r3,tokenize:i3};function r3(e,t){let n=-1,r;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){let i=n;for(;i--;)if(e[i][0]==="exit"&&e[i][1].type==="attentionSequence"&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;const s=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,l={...e[i][1].end},o={...e[n][1].start};Jg(l,-s),Jg(o,s);const u={type:s>1?"strongSequence":"emphasisSequence",start:l,end:{...e[i][1].end}},c={type:s>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:o},d={type:s>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},h={type:s>1?"strong":"emphasis",start:{...u.start},end:{...c.end}};e[i][1].end={...u.start},e[n][1].start={...c.end},r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=En(r,[["enter",e[i][1],t],["exit",e[i][1],t]])),r=En(r,[["enter",h,t],["enter",u,t],["exit",u,t],["enter",d,t]]),r=En(r,sc(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=En(r,[["exit",d,t],["enter",c,t],["exit",c,t],["exit",h,t]]);let p=0;e[n][1].end.offset-e[n][1].start.offset&&(p=2,r=En(r,[["enter",e[n][1],t],["exit",e[n][1],t]])),Wn(e,i-1,n-i+3,r),n=i+r.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function i3(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=wi(r);let s;return l;function l(u){return s=u,e.enter("attentionSequence"),o(u)}function o(u){if(u===s)return e.consume(u),o;const c=e.exit("attentionSequence"),d=wi(u),h=!d||d===2&&i||n.includes(u)&&u!==42&&u!==95,p=!i||i===2&&d||n.includes(r)&&r!==42&&r!==95;return c._open=!!(s===42?h:h&&(i||!p)),c._close=!!(s===42?p:p&&(d||!h)),t(u)}}function Jg(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const s3={name:"autolink",tokenize:l3};function l3(e,t,n){let r=0;return i;function i(f){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(f){return St(f)?(e.consume(f),l):f===64?n(f):c(f)}function l(f){return f===43||f===45||f===46||Ct(f)?(r=1,o(f)):c(f)}function o(f){return f===58?(e.consume(f),r=0,u):(f===43||f===45||f===46||Ct(f))&&r++<32?(e.consume(f),o):(r=0,c(f))}function u(f){return f===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):f===null||f===32||f===60||bu(f)?n(f):(e.consume(f),u)}function c(f){return f===64?(e.consume(f),d):YC(f)?(e.consume(f),c):n(f)}function d(f){return Ct(f)?h(f):n(f)}function h(f){return f===46?(e.consume(f),r=0,d):f===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):p(f)}function p(f){if((f===45||Ct(f))&&r++<63){const m=f===45?p:h;return e.consume(f),m}return n(f)}}const Qa={partial:!0,tokenize:a3};function a3(e,t,n){return r;function r(s){return Ne(s)?Ae(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||he(s)?t(s):n(s)}}const $0={continuation:{tokenize:u3},exit:c3,name:"blockQuote",tokenize:o3};function o3(e,t,n){const r=this;return i;function i(l){if(l===62){const o=r.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),s}return n(l)}function s(l){return Ne(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function u3(e,t,n){const r=this;return i;function i(l){return Ne(l)?Ae(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):s(l)}function s(l){return e.attempt($0,t,n)(l)}}function c3(e){e.exit("blockQuote")}const q0={name:"characterEscape",tokenize:d3};function d3(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),i}function i(s){return O0(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const B0={name:"characterReference",tokenize:h3};function h3(e,t,n){const r=this;let i=0,s,l;return o;function o(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),u}function u(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),s=31,l=Ct,d(h))}function c(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,l=XC,d):(e.enter("characterReferenceValue"),s=7,l=Ih,d(h))}function d(h){if(h===59&&i){const p=e.exit("characterReferenceValue");return l===Ct&&!bp(r.sliceSerialize(p))?n(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(h)&&i++<s?(e.consume(h),d):n(h)}}const Dh={partial:!0,tokenize:f3};function f3(e,t,n){const r=this;return i;function i(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),s)}function s(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const Zg={concrete:!0,name:"codeFenced",tokenize:p3};function p3(e,t,n){const r=this,i={partial:!0,tokenize:E};let s=0,l=0,o;return u;function u(w){return c(w)}function c(w){const N=r.events[r.events.length-1];return s=N&&N[1].type==="linePrefix"?N[2].sliceSerialize(N[1],!0).length:0,o=w,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(w)}function d(w){return w===o?(l++,e.consume(w),d):l<3?n(w):(e.exit("codeFencedFenceSequence"),Ne(w)?Ae(e,h,"whitespace")(w):h(w))}function h(w){return w===null||he(w)?(e.exit("codeFencedFence"),r.interrupt?t(w):e.check(Dh,g,j)(w)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(w))}function p(w){return w===null||he(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(w)):Ne(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ae(e,f,"whitespace")(w)):w===96&&w===o?n(w):(e.consume(w),p)}function f(w){return w===null||he(w)?h(w):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(w))}function m(w){return w===null||he(w)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(w)):w===96&&w===o?n(w):(e.consume(w),m)}function g(w){return e.attempt(i,j,k)(w)}function k(w){return e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),y}function y(w){return s>0&&Ne(w)?Ae(e,x,"linePrefix",s+1)(w):x(w)}function x(w){return w===null||he(w)?e.check(Dh,g,j)(w):(e.enter("codeFlowValue"),v(w))}function v(w){return w===null||he(w)?(e.exit("codeFlowValue"),x(w)):(e.consume(w),v)}function j(w){return e.exit("codeFenced"),t(w)}function E(w,N,M){let F=0;return C;function C(q){return w.enter("lineEnding"),w.consume(q),w.exit("lineEnding"),O}function O(q){return w.enter("codeFencedFence"),Ne(q)?Ae(w,A,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(q):A(q)}function A(q){return q===o?(w.enter("codeFencedFenceSequence"),V(q)):M(q)}function V(q){return q===o?(F++,w.consume(q),V):F>=l?(w.exit("codeFencedFenceSequence"),Ne(q)?Ae(w,U,"whitespace")(q):U(q)):M(q)}function U(q){return q===null||he(q)?(w.exit("codeFencedFence"),N(q)):M(q)}}}const Xc={name:"codeIndented",tokenize:g3},m3={partial:!0,tokenize:x3};function g3(e,t,n){return r;function r(o){return e.enter("codeIndented"),_0(e,i,n,"linePrefix",4,4)(o)}function i(o){return o===null?l(o):he(o)?e.attempt(m3,i,l)(o):(e.enter("codeFlowValue"),s(o))}function s(o){return o===null||he(o)?(e.exit("codeFlowValue"),i(o)):(e.consume(o),s)}function l(o){return e.exit("codeIndented"),t(o)}}function x3(e,t,n){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?n(l):he(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):_0(e,t,s,"linePrefix",4,4)(l)}function s(l){return he(l)?i(l):n(l)}}const y3={name:"codeText",previous:w3,resolve:v3,tokenize:k3};function v3(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 w3(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function k3(e,t,n){let r=0,i,s;return l;function l(h){return e.enter("codeText"),e.enter("codeTextSequence"),o(h)}function o(h){return h===96?(e.consume(h),r++,o):(e.exit("codeTextSequence"),u(h))}function u(h){return h===null?n(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),u):h===96?(s=e.enter("codeTextSequence"),i=0,d(h)):he(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),u):(e.enter("codeTextData"),c(h))}function c(h){return h===null||h===32||h===96||he(h)?(e.exit("codeTextData"),u(h)):(e.consume(h),c)}function d(h){return h===96?(e.consume(h),i++,d):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(s.type="codeTextData",c(h))}}class b3{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 s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&_l(this.left,r),s.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),_l(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),_l(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);_l(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);_l(this.left,n.reverse())}}}function _l(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 U0(e){const t={};let n=-1,r,i,s,l,o,u,c;const d=new b3(e);for(;++n<d.length;){for(;n in t;)n=t[n];if(r=d.get(n),n&&r[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,s=0,s<u.length&&u[s][1].type==="lineEndingBlank"&&(s+=2),s<u.length&&u[s][1].type==="content"))for(;++s<u.length&&u[s][1].type!=="content";)u[s][1].type==="chunkText"&&(u[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,j3(d,n)),n=t[n],c=!0);else if(r[1]._container){for(s=n,i=void 0;s--;)if(l=d.get(s),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(i&&(d.get(i)[1].type="lineEndingBlank"),l[1].type="lineEnding",i=s);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;i&&(r[1].end={...d.get(i)[1].start},o=d.slice(i,n),o.unshift(r),d.splice(i,n-i+1,o))}}return Wn(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!c}function j3(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const s=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const o=l.events,u=[],c={};let d,h,p=-1,f=n,m=0,g=0;const k=[g];for(;f;){for(;e.get(++i)[1]!==f;);s.push(i),f._tokenizer||(d=r.sliceStream(f),f.next||d.push(null),h&&l.defineSkip(f.start),f._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(d),f._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),h=f,f=f.next}for(f=n;++p<o.length;)o[p][0]==="exit"&&o[p-1][0]==="enter"&&o[p][1].type===o[p-1][1].type&&o[p][1].start.line!==o[p][1].end.line&&(g=p+1,k.push(g),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(l.events=[],f?(f._tokenizer=void 0,f.previous=void 0):k.pop(),p=k.length;p--;){const y=o.slice(k[p],k[p+1]),x=s.pop();u.push([x,x+y.length-1]),e.splice(x,2,y)}for(u.reverse(),p=-1;++p<u.length;)c[m+u[p][0]]=m+u[p][1],m+=u[p][1]-u[p][0]-1;return c}const N3={resolve:C3,tokenize:E3},S3={partial:!0,tokenize:P3};function C3(e){return U0(e),e}function E3(e,t){let n;return r;function r(o){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(o)}function i(o){return o===null?s(o):he(o)?e.check(S3,l,s)(o):(e.consume(o),i)}function s(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function l(o){return e.consume(o),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function P3(e,t,n){const r=this;return i;function i(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Ae(e,s,"linePrefix")}function s(l){if(l===null||he(l))return n(l);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function H0(e,t,n,r,i,s,l,o,u){const c=u||Number.POSITIVE_INFINITY;let d=0;return h;function h(y){return y===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(y),e.exit(s),p):y===null||y===32||y===41||bu(y)?n(y):(e.enter(r),e.enter(l),e.enter(o),e.enter("chunkString",{contentType:"string"}),g(y))}function p(y){return y===62?(e.enter(s),e.consume(y),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),f(y))}function f(y){return y===62?(e.exit("chunkString"),e.exit(o),p(y)):y===null||y===60||he(y)?n(y):(e.consume(y),y===92?m:f)}function m(y){return y===60||y===62||y===92?(e.consume(y),f):f(y)}function g(y){return!d&&(y===null||y===41||$e(y))?(e.exit("chunkString"),e.exit(o),e.exit(l),e.exit(r),t(y)):d<c&&y===40?(e.consume(y),d++,g):y===41?(e.consume(y),d--,g):y===null||y===32||y===40||bu(y)?n(y):(e.consume(y),y===92?k:g)}function k(y){return y===40||y===41||y===92?(e.consume(y),g):g(y)}}function W0(e,t,n,r,i,s){const l=this;let o=0,u;return c;function c(f){return e.enter(r),e.enter(i),e.consume(f),e.exit(i),e.enter(s),d}function d(f){return o>999||f===null||f===91||f===93&&!u||f===94&&!o&&"_hiddenFootnoteSupport"in l.parser.constructs?n(f):f===93?(e.exit(s),e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):he(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),h(f))}function h(f){return f===null||f===91||f===93||he(f)||o++>999?(e.exit("chunkString"),d(f)):(e.consume(f),u||(u=!Ne(f)),f===92?p:h)}function p(f){return f===91||f===92||f===93?(e.consume(f),o++,h):h(f)}}function V0(e,t,n,r,i,s){let l;return o;function o(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),l=p===40?41:p,u):n(p)}function u(p){return p===l?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):(e.enter(s),c(p))}function c(p){return p===l?(e.exit(s),u(l)):p===null?n(p):he(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),Ae(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===l||p===null||he(p)?(e.exit("chunkString"),c(p)):(e.consume(p),p===92?h:d)}function h(p){return p===l||p===92?(e.consume(p),d):d(p)}}function ra(e,t){let n;return r;function r(i){return he(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Ne(i)?Ae(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const T3={name:"definition",tokenize:M3},L3={partial:!0,tokenize:R3};function M3(e,t,n){const r=this;let i;return s;function s(f){return e.enter("definition"),l(f)}function l(f){return W0.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function o(f){return i=Vn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),u):n(f)}function u(f){return $e(f)?ra(e,c)(f):c(f)}function c(f){return H0(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function d(f){return e.attempt(L3,h,h)(f)}function h(f){return Ne(f)?Ae(e,p,"whitespace")(f):p(f)}function p(f){return f===null||he(f)?(e.exit("definition"),r.parser.defined.push(i),t(f)):n(f)}}function R3(e,t,n){return r;function r(o){return $e(o)?ra(e,i)(o):n(o)}function i(o){return V0(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function s(o){return Ne(o)?Ae(e,l,"whitespace")(o):l(o)}function l(o){return o===null||he(o)?t(o):n(o)}}const z3={name:"hardBreakEscape",tokenize:A3};function A3(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return he(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const I3={name:"headingAtx",resolve:F3,tokenize:D3};function F3(e,t){let n=e.length-2,r=3;if(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){const i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"};Wn(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])}return e}function D3(e,t,n){let r=0;return i;function i(d){return e.enter("atxHeading"),s(d)}function s(d){return e.enter("atxHeadingSequence"),l(d)}function l(d){return d===35&&r++<6?(e.consume(d),l):d===null||$e(d)?(e.exit("atxHeadingSequence"),o(d)):n(d)}function o(d){return d===35?(e.enter("atxHeadingSequence"),u(d)):d===null||he(d)?(e.exit("atxHeading"),t(d)):Ne(d)?Ae(e,o,"whitespace")(d):(e.enter("atxHeadingText"),c(d))}function u(d){return d===35?(e.consume(d),u):(e.exit("atxHeadingSequence"),o(d))}function c(d){return d===null||d===35||$e(d)?(e.exit("atxHeadingText"),o(d)):(e.consume(d),c)}}const Q0=["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"],Oh=["pre","script","style","textarea"],O3={concrete:!0,name:"htmlFlow",resolveTo:$3,tokenize:q3},_3={partial:!0,tokenize:B3};function $3(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 q3(e,t,n){const r=this;let i,s,l,o,u;return c;function c(P){return d(P)}function d(P){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(P),h}function h(P){return P===33?(e.consume(P),p):P===47?(e.consume(P),s=!0,g):P===63?(e.consume(P),i=3,r.interrupt?t:S):St(P)?(e.consume(P),l=String.fromCharCode(P),k):n(P)}function p(P){return P===45?(e.consume(P),i=2,f):P===91?(e.consume(P),i=5,o=0,m):St(P)?(e.consume(P),i=4,r.interrupt?t:S):n(P)}function f(P){return P===45?(e.consume(P),r.interrupt?t:S):n(P)}function m(P){const ve="CDATA[";return P===ve.charCodeAt(o++)?(e.consume(P),o===ve.length?r.interrupt?t:A:m):n(P)}function g(P){return St(P)?(e.consume(P),l=String.fromCharCode(P),k):n(P)}function k(P){if(P===null||P===47||P===62||$e(P)){const ve=P===47,Le=l.toLowerCase();return!ve&&!s&&Oh.includes(Le)?(i=1,r.interrupt?t(P):A(P)):Q0.includes(l.toLowerCase())?(i=6,ve?(e.consume(P),y):r.interrupt?t(P):A(P)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(P):s?x(P):v(P))}return P===45||Ct(P)?(e.consume(P),l+=String.fromCharCode(P),k):n(P)}function y(P){return P===62?(e.consume(P),r.interrupt?t:A):n(P)}function x(P){return Ne(P)?(e.consume(P),x):C(P)}function v(P){return P===47?(e.consume(P),C):P===58||P===95||St(P)?(e.consume(P),j):Ne(P)?(e.consume(P),v):C(P)}function j(P){return P===45||P===46||P===58||P===95||Ct(P)?(e.consume(P),j):E(P)}function E(P){return P===61?(e.consume(P),w):Ne(P)?(e.consume(P),E):v(P)}function w(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(e.consume(P),u=P,N):Ne(P)?(e.consume(P),w):M(P)}function N(P){return P===u?(e.consume(P),u=null,F):P===null||he(P)?n(P):(e.consume(P),N)}function M(P){return P===null||P===34||P===39||P===47||P===60||P===61||P===62||P===96||$e(P)?E(P):(e.consume(P),M)}function F(P){return P===47||P===62||Ne(P)?v(P):n(P)}function C(P){return P===62?(e.consume(P),O):n(P)}function O(P){return P===null||he(P)?A(P):Ne(P)?(e.consume(P),O):n(P)}function A(P){return P===45&&i===2?(e.consume(P),G):P===60&&i===1?(e.consume(P),X):P===62&&i===4?(e.consume(P),D):P===63&&i===3?(e.consume(P),S):P===93&&i===5?(e.consume(P),W):he(P)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(_3,te,V)(P)):P===null||he(P)?(e.exit("htmlFlowData"),V(P)):(e.consume(P),A)}function V(P){return e.check(Dh,U,te)(P)}function U(P){return e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),q}function q(P){return P===null||he(P)?V(P):(e.enter("htmlFlowData"),A(P))}function G(P){return P===45?(e.consume(P),S):A(P)}function X(P){return P===47?(e.consume(P),l="",z):A(P)}function z(P){if(P===62){const ve=l.toLowerCase();return Oh.includes(ve)?(e.consume(P),D):A(P)}return St(P)&&l.length<8?(e.consume(P),l+=String.fromCharCode(P),z):A(P)}function W(P){return P===93?(e.consume(P),S):A(P)}function S(P){return P===62?(e.consume(P),D):P===45&&i===2?(e.consume(P),S):A(P)}function D(P){return P===null||he(P)?(e.exit("htmlFlowData"),te(P)):(e.consume(P),D)}function te(P){return e.exit("htmlFlow"),t(P)}}function B3(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Qa,t,n)}}const U3={name:"htmlText",tokenize:H3};function H3(e,t,n){const r=this;let i,s,l;return o;function o(S){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(S),u}function u(S){return S===33?(e.consume(S),c):S===47?(e.consume(S),E):S===63?(e.consume(S),v):St(S)?(e.consume(S),M):n(S)}function c(S){return S===45?(e.consume(S),d):S===91?(e.consume(S),s=0,m):St(S)?(e.consume(S),x):n(S)}function d(S){return S===45?(e.consume(S),f):n(S)}function h(S){return S===null?n(S):S===45?(e.consume(S),p):he(S)?(l=h,X(S)):(e.consume(S),h)}function p(S){return S===45?(e.consume(S),f):h(S)}function f(S){return S===62?G(S):S===45?p(S):h(S)}function m(S){const D="CDATA[";return S===D.charCodeAt(s++)?(e.consume(S),s===D.length?g:m):n(S)}function g(S){return S===null?n(S):S===93?(e.consume(S),k):he(S)?(l=g,X(S)):(e.consume(S),g)}function k(S){return S===93?(e.consume(S),y):g(S)}function y(S){return S===62?G(S):S===93?(e.consume(S),y):g(S)}function x(S){return S===null||S===62?G(S):he(S)?(l=x,X(S)):(e.consume(S),x)}function v(S){return S===null?n(S):S===63?(e.consume(S),j):he(S)?(l=v,X(S)):(e.consume(S),v)}function j(S){return S===62?G(S):v(S)}function E(S){return St(S)?(e.consume(S),w):n(S)}function w(S){return S===45||Ct(S)?(e.consume(S),w):N(S)}function N(S){return he(S)?(l=N,X(S)):Ne(S)?(e.consume(S),N):G(S)}function M(S){return S===45||Ct(S)?(e.consume(S),M):S===47||S===62||$e(S)?F(S):n(S)}function F(S){return S===47?(e.consume(S),G):S===58||S===95||St(S)?(e.consume(S),C):he(S)?(l=F,X(S)):Ne(S)?(e.consume(S),F):G(S)}function C(S){return S===45||S===46||S===58||S===95||Ct(S)?(e.consume(S),C):O(S)}function O(S){return S===61?(e.consume(S),A):he(S)?(l=O,X(S)):Ne(S)?(e.consume(S),O):F(S)}function A(S){return S===null||S===60||S===61||S===62||S===96?n(S):S===34||S===39?(e.consume(S),i=S,V):he(S)?(l=A,X(S)):Ne(S)?(e.consume(S),A):(e.consume(S),U)}function V(S){return S===i?(e.consume(S),i=void 0,q):S===null?n(S):he(S)?(l=V,X(S)):(e.consume(S),V)}function U(S){return S===null||S===34||S===39||S===60||S===61||S===96?n(S):S===47||S===62||$e(S)?F(S):(e.consume(S),U)}function q(S){return S===47||S===62||$e(S)?F(S):n(S)}function G(S){return S===62?(e.consume(S),e.exit("htmlTextData"),e.exit("htmlText"),t):n(S)}function X(S){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),z}function z(S){return Ne(S)?Ae(e,W,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(S):W(S)}function W(S){return e.enter("htmlTextData"),l(S)}}const jp={name:"labelEnd",resolveAll:K3,resolveTo:G3,tokenize:Y3},W3={tokenize:X3},V3={tokenize:J3},Q3={tokenize:Z3};function K3(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&&Wn(e,0,e.length,n),e}function G3(e,t){let n=e.length,r=0,i,s,l;for(;n--;){const d=e[n][1];if(i){if(d.type==="link"||d.type==="labelLink"&&d._inactive)break;e[n][0]==="enter"&&d.type==="labelLink"&&(d._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(d.type==="labelImage"||d.type==="labelLink")&&!d._balanced&&(i=n,d.type!=="labelLink")){r=2;break}}else d.type==="labelEnd"&&(s=n)}const o={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[i][1].start},end:{...e[s][1].end}},c={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[s-2][1].start}};return l=[["enter",o,t],["enter",u,t]],l=En(l,e.slice(i+1,i+r+3)),l=En(l,[["enter",c,t]]),l=En(l,sc(t.parser.constructs.insideSpan.null,e.slice(i+r+4,s-3),t)),l=En(l,[["exit",c,t],e[s-2],e[s-1],["exit",u,t]]),l=En(l,e.slice(s+1)),l=En(l,[["exit",o,t]]),Wn(e,i,e.length,l),e}function Y3(e,t,n){const r=this,i=r._labelStarts;let s,l;if(i){for(;i.length>0&&i[i.length-1]._balanced;)i.pop();s=i[i.length-1]}return o;function o(p){return s?s._inactive?h(p):(l=r.parser.defined.includes(Vn(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),u):n(p)}function u(p){return p===40?e.attempt(W3,d,l?d:h)(p):p===91?e.attempt(V3,d,l?c:h)(p):l?d(p):h(p)}function c(p){return e.attempt(Q3,d,h)(p)}function d(p){return i.pop(),t(p)}function h(p){return s._balanced=!0,n(p)}}function X3(e,t,n){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),i}function i(h){return $e(h)?ra(e,s)(h):s(h)}function s(h){return h===41?d(h):H0(e,l,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function l(h){return $e(h)?ra(e,u)(h):d(h)}function o(h){return n(h)}function u(h){return h===34||h===39||h===40?V0(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):d(h)}function c(h){return $e(h)?ra(e,d)(h):d(h)}function d(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function J3(e,t,n){const r=this;return i;function i(o){return W0.call(r,e,s,l,"reference","referenceMarker","referenceString")(o)}function s(o){return r.parser.defined.includes(Vn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function l(o){return n(o)}}function Z3(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),i}function i(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const eE={name:"labelStartImage",resolveAll:jp.resolveAll,tokenize:tE};function tE(e,t,n){const r=this;let i;return s;function s(u){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(u),e.exit("labelImageMarker"),l}function l(u){return u===91?(e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),i=e.exit("labelImage"),o):n(u)}function o(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(u))}}const nE={name:"labelStartLink",resolveAll:jp.resolveAll,tokenize:rE};function rE(e,t,n){const r=this;let i;return s;function s(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),i=e.exit("labelLink"),l}function l(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(o))}}const Jc={name:"lineEnding",tokenize:iE};function iE(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Ae(e,t,"linePrefix")}}const qo={name:"thematicBreak",tokenize:sE};function sE(e,t,n){let r=0,i;return s;function s(c){return e.enter("thematicBreak"),l(c)}function l(c){return i=c,o(c)}function o(c){return c===i?(e.enter("thematicBreakSequence"),u(c)):r>=3&&(c===null||he(c))?(e.exit("thematicBreak"),t(c)):n(c)}function u(c){return c===i?(e.consume(c),r++,u):(e.exit("thematicBreakSequence"),Ne(c)?Ae(e,o,"whitespace")(c):o(c))}}const Kt={continuation:{tokenize:uE},exit:dE,name:"list",tokenize:oE},lE={partial:!0,tokenize:hE},aE={partial:!0,tokenize:cE};function oE(e,t,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return o;function o(f){const m=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:Ih(f)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(qo,n,c)(f):c(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(f)}return n(f)}function u(f){return Ih(f)&&++l<10?(e.consume(f),u):(!r.interrupt||l<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),c(f)):n(f)}function c(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(Qa,r.interrupt?n:d,e.attempt(lE,p,h))}function d(f){return r.containerState.initialBlankLine=!0,s++,p(f)}function h(f){return Ne(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),p):n(f)}function p(f){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function uE(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Qa,i,s);function i(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ae(e,t,"listItemIndent",r.containerState.size+1)(o)}function s(o){return r.containerState.furtherBlankLines||!Ne(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(aE,t,l)(o))}function l(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ae(e,e.attempt(Kt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function cE(e,t,n){const r=this;return Ae(e,i,"listItemIndent",r.containerState.size+1);function i(s){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(s):n(s)}}function dE(e){e.exit(this.containerState.type)}function hE(e,t,n){const r=this;return Ae(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const l=r.events[r.events.length-1];return!Ne(s)&&l&&l[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const ex={name:"setextUnderline",resolveTo:fE,tokenize:pE};function fE(e,t){const n=new ju;let r=e.length,i,s,l;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){i=r;break}e[r][1].type==="paragraph"&&(s=r)}else e[r][1].type==="content"&&n.add(r,1,[]),!l&&e[r][1].type==="definition"&&(l=r);const o={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",l?(n.add(s,0,[["enter",o,t]]),n.add(l+1,0,[["exit",e[i][1],t]]),e[i][1].end={...e[l][1].end}):e[i][1]=o,n.add(e.length,0,[["exit",o,t]]),n.consume(e),e}function pE(e,t,n){const r=this;let i;return s;function s(c){let d=r.events.length,h;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){h=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),i=c,l(c)):n(c)}function l(c){return e.enter("setextHeadingLineSequence"),o(c)}function o(c){return c===i?(e.consume(c),o):(e.exit("setextHeadingLineSequence"),Ne(c)?Ae(e,u,"lineSuffix")(c):u(c))}function u(c){return c===null||he(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const mE={tokenize:gE};function gE(e){const t=this,n=e.attempt(Qa,r,e.attempt(this.parser.constructs.flowInitial,i,Ae(e,e.attempt(this.parser.constructs.flow,i,e.attempt(N3,i)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const xE={resolveAll:G0()},yE=K0("string"),vE=K0("text");function K0(e){return{resolveAll:G0(e==="text"?wE:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,l,o);return l;function l(d){return c(d)?s(d):o(d)}function o(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),u}function u(d){return c(d)?(n.exit("data"),s(d)):(n.consume(d),u)}function c(d){if(d===null)return!0;const h=i[d];let p=-1;if(h)for(;++p<h.length;){const f=h[p];if(!f.previous||f.previous.call(r,r.previous))return!0}return!1}}}function G0(e){return t;function t(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return e?e(n,r):n}}function wE(e,t){const n=new ju;let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){const i=e[r-1][1],s=t.sliceStream(i);let l=s.length,o=-1,u=0,c;for(;l--;){const d=s[l];if(typeof d=="string"){for(o=d.length;d.charCodeAt(o-1)===32;)u++,o--;if(o)break;o=-1}else if(d===-2)c=!0,u++;else if(d!==-1){l++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(u=0),u){const d={type:r===e.length||c||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?o:i.start._bufferIndex+o,_index:i.start._index+l,line:i.end.line,column:i.end.column-u,offset:i.end.offset-u},end:{...i.end}};i.end={...d.start},i.start.offset===i.end.offset?Object.assign(i,d):n.add(r,0,[["enter",d,t],["exit",d,t]])}r++}return n.consume(e),e}const kE={42:Kt,43:Kt,45:Kt,48:Kt,49:Kt,50:Kt,51:Kt,52:Kt,53:Kt,54:Kt,55:Kt,56:Kt,57:Kt,62:$0},bE={91:T3},jE={[-2]:Xc,[-1]:Xc,32:Xc},NE={35:I3,42:qo,45:[ex,qo],60:O3,61:ex,95:qo,96:Zg,126:Zg},SE={38:B0,92:q0},CE={[-5]:Jc,[-4]:Jc,[-3]:Jc,33:eE,38:B0,42:Fh,60:[s3,U3],91:nE,92:[z3,q0],93:jp,95:Fh,96:y3},EE={null:[Fh,xE]},PE={null:[42,95]},TE={null:[]},LE=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:PE,contentInitial:bE,disable:TE,document:kE,flow:NE,flowInitial:jE,insideSpan:EE,string:SE,text:CE},Symbol.toStringTag,{value:"Module"}));function ME(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={},s=[];let l=[],o=[];const u={attempt:N(E),check:N(w),consume:x,enter:v,exit:j,interrupt:N(w,{interrupt:!0})},c={code:null,containerState:{},defineSkip:g,events:[],now:m,parser:e,previous:null,sliceSerialize:p,sliceStream:f,write:h};let d=t.tokenize.call(c,u);return t.resolveAll&&s.push(t),c;function h(O){return l=En(l,O),k(),l[l.length-1]!==null?[]:(M(t,0),c.events=sc(s,c.events,c),c.events)}function p(O,A){return zE(f(O),A)}function f(O){return RE(l,O)}function m(){const{_bufferIndex:O,_index:A,line:V,column:U,offset:q}=r;return{_bufferIndex:O,_index:A,line:V,column:U,offset:q}}function g(O){i[O.line]=O.column,C()}function k(){for(;r._index<l.length;){const O=l[r._index];if(typeof O=="string"){const A=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===A&&r._bufferIndex<O.length;)y(O.charCodeAt(r._bufferIndex))}else y(O)}}function y(O){d=d(O)}function x(O){he(O)?(r.line++,r.column=1,r.offset+=O===-3?2:1,C()):O!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=O}function v(O,A){const V=A||{};return V.type=O,V.start=m(),c.events.push(["enter",V,c]),o.push(V),V}function j(O){const A=o.pop();return A.end=m(),c.events.push(["exit",A,c]),A}function E(O,A){M(O,A.from)}function w(O,A){A.restore()}function N(O,A){return V;function V(U,q,G){let X,z,W,S;return Array.isArray(U)?te(U):"tokenize"in U?te([U]):D(U);function D(we){return Se;function Se(_t){const an=_t!==null&&we[_t],Lt=_t!==null&&we.null,qe=[...Array.isArray(an)?an:an?[an]:[],...Array.isArray(Lt)?Lt:Lt?[Lt]:[]];return te(qe)(_t)}}function te(we){return X=we,z=0,we.length===0?G:P(we[z])}function P(we){return Se;function Se(_t){return S=F(),W=we,we.partial||(c.currentConstruct=we),we.name&&c.parser.constructs.disable.null.includes(we.name)?Le():we.tokenize.call(A?Object.assign(Object.create(c),A):c,u,ve,Le)(_t)}}function ve(we){return O(W,S),q}function Le(we){return S.restore(),++z<X.length?P(X[z]):G}}}function M(O,A){O.resolveAll&&!s.includes(O)&&s.push(O),O.resolve&&Wn(c.events,A,c.events.length-A,O.resolve(c.events.slice(A),c)),O.resolveTo&&(c.events=O.resolveTo(c.events,c))}function F(){const O=m(),A=c.previous,V=c.currentConstruct,U=c.events.length,q=Array.from(o);return{from:U,restore:G};function G(){r=O,c.previous=A,c.currentConstruct=V,c.events.length=U,o=q,C()}}function C(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function RE(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,s=t.end._bufferIndex;let l;if(n===i)l=[e[n].slice(r,s)];else{if(l=e.slice(n,i),r>-1){const o=l[0];typeof o=="string"?l[0]=o.slice(r):l.shift()}s>0&&l.push(e[i].slice(0,s))}return l}function zE(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const s=e[n];let l;if(typeof s=="string")l=s;else switch(s){case-5:{l="\r";break}case-4:{l=`
475
+ `;break}case-3:{l=`\r
476
+ `;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&i)continue;l=" ";break}default:l=String.fromCharCode(s)}i=s===-2,r.push(l)}return r.join("")}function AE(e){const r={constructs:F0([LE,...(e||{}).extensions||[]]),content:i(JC),defined:[],document:i(e3),flow:i(mE),lazy:{},string:i(yE),text:i(vE)};return r;function i(s){return l;function l(o){return ME(r,s,o)}}}function IE(e){for(;!U0(e););return e}const tx=/[\0\t\n\r]/g;function FE(){let e=1,t="",n=!0,r;return i;function i(s,l,o){s=t+(typeof s=="string"?s.toString():new TextDecoder(l||void 0).decode(s));const u=[];let c=0;for(t="",n&&(s.charCodeAt(0)===65279&&c++,n=void 0);c<s.length;){tx.lastIndex=c;const d=tx.exec(s),h=d&&d.index!==void 0?d.index:s.length,p=s.charCodeAt(h);if(!d){t=s.slice(c);break}if(p===10&&c===h&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),c<h&&(u.push(s.slice(c,h)),e+=h-c),p){case 0:{u.push(65533),e++;break}case 9:{const f=Math.ceil(e/4)*4;for(u.push(-2);e++<f;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}c=h+1}return o&&(r&&u.push(-5),t&&u.push(t),u.push(null)),u}}const DE=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function OE(e){return e.replace(DE,_E)}function _E(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return D0(n.slice(s?2:1),s?16:10)}return bp(n)||e}const Y0={}.hasOwnProperty;function $E(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),qE(n)(IE(AE(n).document().write(FE()(e,t,!0))))}function qE(e){const t={afterExit:[],beforeEnter:[],transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(Xn),autolinkProtocol:C,autolinkEmail:C,atxHeading:l(Gn),blockQuote:l(qe),characterEscape:C,characterReference:C,codeFenced:l(lt),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:l(lt,o),codeText:l(zn,o),codeTextData:C,data:C,codeFlowValue:C,definition:l(An),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:l(Vt),hardBreakEscape:l(on),hardBreakTrailing:l(on),htmlFlow:l(Yn,o),htmlFlowData:C,htmlText:l(Yn,o),htmlTextData:C,image:l(xr),label:o,link:l(Xn),listItem:l(yr),listItemValue:f,listOrdered:l(Jn,p),listUnordered:l(Jn),paragraph:l(Z),reference:ve,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:l(Gn),strong:l(Qt),thematicBreak:l(Zn)},exit:{atxHeading:c(),atxHeadingSequence:w,autolink:c(),autolinkEmail:Lt,autolinkProtocol:an,blockQuote:c(),characterEscapeValue:O,characterReferenceMarkerHexadecimal:we,characterReferenceMarkerNumeric:we,characterReferenceValue:Se,characterReference:_t,codeFenced:c(y),codeFencedFence:k,codeFencedFenceInfo:m,codeFencedFenceMeta:g,codeFlowValue:O,codeIndented:c(x),codeText:c(G),codeTextData:O,data:O,definition:c(),definitionDestinationString:E,definitionLabelString:v,definitionTitleString:j,emphasis:c(),hardBreakEscape:c(V),hardBreakTrailing:c(V),htmlFlow:c(U),htmlFlowData:O,htmlText:c(q),htmlTextData:O,image:c(z),label:S,labelText:W,lineEnding:A,link:c(X),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:Le,resourceDestinationString:D,resourceTitleString:te,resource:P,setextHeading:c(F),setextHeadingLineSequence:M,setextHeadingText:N,strong:c(),thematicBreak:c()}};X0(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(_){let H={type:"root",children:[],position:void 0};const fe={stack:[H],tokenStack:[],config:t,enter:u,exit:d,buffer:o,resume:h,data:n},pe=[],ht=[];let Ce=-1;for(;++Ce<_.length;)if(ht.push(_[Ce]),_[Ce][1].type==="listOrdered"||_[Ce][1].type==="listUnordered")if(_[Ce][0]==="enter")pe.push(ht.length-1);else{const at=pe.pop();s(ht,at)}for(_=ht,Ce=-1;++Ce<_.length;){const at=t[_[Ce][0]];_[Ce][0]==="enter"&&t.beforeEnter.length>0&&i(t.beforeEnter,{...fe,sliceSerialize:_[Ce][2].sliceSerialize},_[Ce][1]),Y0.call(at,_[Ce][1].type)&&at[_[Ce][1].type].call({...fe,sliceSerialize:_[Ce][2].sliceSerialize},_[Ce][1]),_[Ce][0]==="exit"&&t.afterExit.length>0&&i(t.afterExit,{...fe,sliceSerialize:_[Ce][2].sliceSerialize},_[Ce][1])}if(fe.tokenStack.length>0){const at=fe.tokenStack[fe.tokenStack.length-1];(at[1]||nx).call(fe,void 0,at[0])}for(H.position={start:Ur(_.length>0?_[0][1].start:{line:1,column:1,offset:0}),end:Ur(_.length>0?_[_.length-2][1].end:{line:1,column:1,offset:0})},Ce=-1;++Ce<t.transforms.length;)H=t.transforms[Ce](H)||H;return H}function i(_,H,fe){let pe=-1;for(;++pe<_.length;)_[pe].call(H,fe)}function s(_,H){const fe=_.length-1;let pe=H-1,ht=-1,Ce=!1,at,R,ke,Je;const vn=[];for(;++pe<=fe;){const bt=_[pe];switch(bt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{bt[0]==="enter"?ht++:ht--,Je=void 0;break}case"lineEndingBlank":{bt[0]==="enter"&&(at&&!Je&&!ht&&!ke&&(ke=pe),Je=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Je=void 0}if(!ht&&bt[0]==="enter"&&bt[1].type==="listItemPrefix"||ht===-1&&bt[0]==="exit"&&(bt[1].type==="listUnordered"||bt[1].type==="listOrdered")){if(at){let er=pe;for(R=void 0;er--;){const In=_[er];if(In[1].type==="lineEnding"||In[1].type==="lineEndingBlank"){if(In[0]==="exit")continue;R&&(_[R][1].type="lineEndingBlank",Ce=!0),In[1].type="lineEnding",R=er}else if(!(In[1].type==="linePrefix"||In[1].type==="blockQuotePrefix"||In[1].type==="blockQuotePrefixWhitespace"||In[1].type==="blockQuoteMarker"||In[1].type==="listItemIndent"))break}ke&&(!R||ke<R)&&(at._spread=!0),at.end=Object.assign({},R?_[R][1].start:bt[1].end),vn.push({at:R||pe,event:["exit",at,bt[2]]})}if(bt[1].type==="listItemPrefix"){const er={type:"listItem",_spread:!1,start:Object.assign({},bt[1].start),end:void 0};at=er,vn.push({at:pe,event:["enter",er,bt[2]]}),ke=void 0,Je=!0}}}const Pi=_.splice(H);let xs=0;for(pe=-1;++pe<Pi.length;){for(;xs<vn.length&&vn[xs].at===H+pe;)_.push(vn[xs++].event);_.push(Pi[pe])}_[H][1]._spread=Ce}function l(_,H){return fe;function fe(pe){u.call(this,_(pe),pe),H&&H.call(this,pe)}}function o(){this.stack.push({type:"fragment",children:[]})}function u(_,H,fe){this.stack[this.stack.length-1].children.push(_),this.stack.push(_),this.tokenStack.push([H,fe||void 0]),_.position={start:Ur(H.start),end:void 0}}function c(_){return H;function H(fe){_&&_.call(this,fe),d.call(this,fe)}}function d(_,H){const fe=this.stack.pop(),pe=this.tokenStack.pop();if(!pe)throw new Error("Cannot close `"+_.type+"` ("+na({start:_.start,end:_.end})+"): it’s not open");pe[0].type!==_.type&&(H?H.call(this,_,pe[0]):(pe[1]||nx).call(this,_,pe[0])),fe.position.end=Ur(_.end)}function h(){return rc(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function f(_){if(this.data.expectingFirstListItemValue){const H=this.stack[this.stack.length-2];H.start=Number.parseInt(this.sliceSerialize(_),10),this.data.expectingFirstListItemValue=void 0}}function m(){const _=this.resume(),H=this.stack[this.stack.length-1];H.lang=_}function g(){const _=this.resume(),H=this.stack[this.stack.length-1];H.meta=_}function k(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const _=this.resume(),H=this.stack[this.stack.length-1];H.value=_.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function x(){const _=this.resume(),H=this.stack[this.stack.length-1];H.value=_.replace(/(\r?\n|\r)$/g,"")}function v(_){const H=this.resume(),fe=this.stack[this.stack.length-1];fe.label=H,fe.identifier=Vn(this.sliceSerialize(_)).toLowerCase()}function j(){const _=this.resume(),H=this.stack[this.stack.length-1];H.title=_}function E(){const _=this.resume(),H=this.stack[this.stack.length-1];H.url=_}function w(_){const H=this.stack[this.stack.length-1];if(!H.depth){const fe=this.sliceSerialize(_).length;H.depth=fe}}function N(){this.data.setextHeadingSlurpLineEnding=!0}function M(_){const H=this.stack[this.stack.length-1];H.depth=this.sliceSerialize(_).codePointAt(0)===61?1:2}function F(){this.data.setextHeadingSlurpLineEnding=void 0}function C(_){const fe=this.stack[this.stack.length-1].children;let pe=fe[fe.length-1];(!pe||pe.type!=="text")&&(pe=vr(),pe.position={start:Ur(_.start),end:void 0},fe.push(pe)),this.stack.push(pe)}function O(_){const H=this.stack.pop();H.value+=this.sliceSerialize(_),H.position.end=Ur(_.end)}function A(_){const H=this.stack[this.stack.length-1];if(this.data.atHardBreak){const fe=H.children[H.children.length-1];fe.position.end=Ur(_.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(H.type)&&(C.call(this,_),O.call(this,_))}function V(){this.data.atHardBreak=!0}function U(){const _=this.resume(),H=this.stack[this.stack.length-1];H.value=_}function q(){const _=this.resume(),H=this.stack[this.stack.length-1];H.value=_}function G(){const _=this.resume(),H=this.stack[this.stack.length-1];H.value=_}function X(){const _=this.stack[this.stack.length-1];if(this.data.inReference){const H=this.data.referenceType||"shortcut";_.type+="Reference",_.referenceType=H,delete _.url,delete _.title}else delete _.identifier,delete _.label;this.data.referenceType=void 0}function z(){const _=this.stack[this.stack.length-1];if(this.data.inReference){const H=this.data.referenceType||"shortcut";_.type+="Reference",_.referenceType=H,delete _.url,delete _.title}else delete _.identifier,delete _.label;this.data.referenceType=void 0}function W(_){const H=this.sliceSerialize(_),fe=this.stack[this.stack.length-2];fe.label=OE(H),fe.identifier=Vn(H).toLowerCase()}function S(){const _=this.stack[this.stack.length-1],H=this.resume(),fe=this.stack[this.stack.length-1];if(this.data.inReference=!0,fe.type==="link"){const pe=_.children;fe.children=pe}else fe.alt=H}function D(){const _=this.resume(),H=this.stack[this.stack.length-1];H.url=_}function te(){const _=this.resume(),H=this.stack[this.stack.length-1];H.title=_}function P(){this.data.inReference=void 0}function ve(){this.data.referenceType="collapsed"}function Le(_){const H=this.resume(),fe=this.stack[this.stack.length-1];fe.label=H,fe.identifier=Vn(this.sliceSerialize(_)).toLowerCase(),this.data.referenceType="full"}function we(_){this.data.characterReferenceType=_.type}function Se(_){const H=this.sliceSerialize(_),fe=this.data.characterReferenceType;let pe;fe?(pe=D0(H,fe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):pe=bp(H);const ht=this.stack[this.stack.length-1];ht.value+=pe}function _t(_){const H=this.stack.pop();H.position.end=Ur(_.end)}function an(_){O.call(this,_);const H=this.stack[this.stack.length-1];H.url=this.sliceSerialize(_)}function Lt(_){O.call(this,_);const H=this.stack[this.stack.length-1];H.url="mailto:"+this.sliceSerialize(_)}function qe(){return{type:"blockquote",children:[],position:void 0}}function lt(){return{type:"code",lang:null,meta:null,value:"",position:void 0}}function zn(){return{type:"inlineCode",value:"",position:void 0}}function An(){return{type:"definition",identifier:"",label:null,title:null,url:"",position:void 0}}function Vt(){return{type:"emphasis",children:[],position:void 0}}function Gn(){return{type:"heading",depth:0,children:[],position:void 0}}function on(){return{type:"break",position:void 0}}function Yn(){return{type:"html",value:"",position:void 0}}function xr(){return{type:"image",title:null,url:"",alt:null,position:void 0}}function Xn(){return{type:"link",title:null,url:"",children:[],position:void 0}}function Jn(_){return{type:"list",ordered:_.type==="listOrdered",start:null,spread:_._spread,children:[],position:void 0}}function yr(_){return{type:"listItem",spread:_._spread,checked:null,children:[],position:void 0}}function Z(){return{type:"paragraph",children:[],position:void 0}}function Qt(){return{type:"strong",children:[],position:void 0}}function vr(){return{type:"text",value:"",position:void 0}}function Zn(){return{type:"thematicBreak",position:void 0}}}function Ur(e){return{line:e.line,column:e.column,offset:e.offset}}function X0(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?X0(e,r):BE(e,r)}}function BE(e,t){let n;for(n in t)if(Y0.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"afterExit":case"beforeEnter":{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 nx(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+na({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+na({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+na({start:t.start,end:t.end})+") is still open")}function UE(e){const t=this;t.parser=n;function n(r){return $E(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function HE(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 WE(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
477
+ `}]}function VE(e,t){const n=t.value?t.value+`
478
+ `:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function QE(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function KE(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function GE(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=jl(r.toLowerCase()),s=e.footnoteOrder.indexOf(r);let l,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=s+1,o+=1,e.footnoteCounts.set(r,o);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,u);const c={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,c),e.applyData(t,c)}function YE(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 XE(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function J0(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),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const l=i[i.length-1];return l&&l.type==="text"?l.value+=r:i.push({type:"text",value:r}),i}function JE(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return J0(e,t);const i={src:jl(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,s),e.applyData(t,s)}function ZE(e,t){const n={src:jl(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 e4(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 t4(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return J0(e,t);const i={href:jl(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function n4(e,t){const n={href:jl(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 r4(e,t,n){const r=e.all(t),i=n?i4(n):Z0(t),s={},l=[];if(typeof t.checked=="boolean"){const d=r[0];let h;d&&d.type==="element"&&d.tagName==="p"?h=d:(h={type:"element",tagName:"p",properties:{},children:[]},r.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let o=-1;for(;++o<r.length;){const d=r[o];(i||o!==0||d.type!=="element"||d.tagName!=="p")&&l.push({type:"text",value:`
479
+ `}),d.type==="element"&&d.tagName==="p"&&!i?l.push(...d.children):l.push(d)}const u=r[r.length-1];u&&(i||u.type!=="element"||u.tagName!=="p")&&l.push({type:"text",value:`
480
+ `});const c={type:"element",tagName:"li",properties:s,children:l};return e.patch(t,c),e.applyData(t,c)}function i4(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=Z0(n[r])}return t}function Z0(e){const t=e.spread;return t??e.children.length>1}function s4(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 l=r[i];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function l4(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function a4(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function o4(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function u4(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],l),i.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=yp(t.children[1]),u=T0(t.children[t.children.length-1]);o&&u&&(l.position={start:o,end:u}),i.push(l)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)}function c4(e,t,n){const r=n?n.children:void 0,s=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,o=l?l.length:t.children.length;let u=-1;const c=[];for(;++u<o;){const h=t.children[u],p={},f=l?l[u]:void 0;f&&(p.align=f);let m={type:"element",tagName:s,properties:p,children:[]};h&&(m.children=e.all(h),e.patch(h,m),m=e.applyData(h,m)),c.push(m)}const d={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,d),e.applyData(t,d)}function d4(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const rx=9,ix=32;function h4(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const s=[];for(;r;)s.push(sx(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return s.push(sx(t.slice(i),i>0,!1)),s.join("")}function sx(e,t,n){let r=0,i=e.length;if(t){let s=e.codePointAt(r);for(;s===rx||s===ix;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(i-1);for(;s===rx||s===ix;)i--,s=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function f4(e,t){const n={type:"text",value:h4(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function p4(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const m4={blockquote:HE,break:WE,code:VE,delete:QE,emphasis:KE,footnoteReference:GE,heading:YE,html:XE,imageReference:JE,image:ZE,inlineCode:e4,linkReference:t4,link:n4,listItem:r4,list:s4,paragraph:l4,root:a4,strong:o4,table:u4,tableCell:d4,tableRow:c4,text:f4,thematicBreak:p4,toml:ko,yaml:ko,definition:ko,footnoteDefinition:ko};function ko(){}const ew=-1,lc=0,ia=1,Nu=2,Np=3,Sp=4,Cp=5,Ep=6,tw=7,nw=8,{defineProperty:g4}=Object,rw=typeof self=="object"?self:globalThis,lx=(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 rw[e](t)},x4=(e,t)=>{const n=(i,s)=>(e.set(s,i),i),r=i=>{if(e.has(i))return e.get(i);const[s,l]=t[i];switch(s){case lc:case ew:return n(l,i);case ia:{const o=n([],i);for(const u of l)o.push(r(u));return o}case Nu:{const o=n({},i);for(const[u,c]of l){const d=r(u),h=r(c);d==="__proto__"?g4(o,d,{value:h,configurable:!0,enumerable:!0,writable:!0}):o[d]=h}return o}case Np:return n(new Date(l),i);case Sp:{const{source:o,flags:u}=l;return n(new RegExp(o,u),i)}case Cp:{const o=n(new Map,i);for(const[u,c]of l)o.set(r(u),r(c));return o}case Ep:{const o=n(new Set,i);for(const u of l)o.add(r(u));return o}case tw:{const{name:o,message:u}=l;return n(typeof rw[o]=="function"?lx(o,u):new Error(u),i)}case nw:return n(BigInt(l),i);case"BigInt":return n(Object(BigInt(l)),i);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:o}=new Uint8Array(l);return n(new DataView(o),l)}case"-0":return-0}return n(lx(s,l),i)};return r},ax=e=>x4(new Map,e)(0),Ai="",{toString:y4}={},{keys:v4,is:w4}=Object,$l=e=>{const t=typeof e;if(t!=="object"||!e)return[lc,t];const n=y4.call(e).slice(8,-1);switch(n){case"Array":return[ia,Ai];case"Object":return[Nu,Ai];case"Date":return[Np,Ai];case"RegExp":return[Sp,Ai];case"Map":return[Cp,Ai];case"Set":return[Ep,Ai];case"DataView":return[ia,n]}return n.includes("Array")?[ia,n]:e instanceof Error?[tw,e.name||"Error"]:[Nu,n]},bo=([e,t])=>e===lc&&(t==="function"||t==="symbol"),k4=(e,t,n,r)=>{const i=(l,o)=>{const u=r.push(l)-1;return n.set(o,u),u},s=l=>{if(n.has(l))return n.get(l);let[o,u]=$l(l);switch(o){case lc:{let d=l;switch(u){case"bigint":o=nw,d=l.toString();break;case"number":if(!l&&w4(l,-0))return r.push(["-0"])-1;break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);d=null;break;case"undefined":return i([ew],l)}return i([o,d],l)}case ia:{if(u){let p=l;return u==="DataView"?p=new Uint8Array(l.buffer):u==="ArrayBuffer"&&(p=new Uint8Array(l)),i([u,[...p]],l)}const d=[],h=i([o,d],l);for(const p of l)d.push(s(p));return h}case Nu:{if(u)switch(u){case"BigInt":return i([u,l.toString()],l);case"Boolean":case"Number":case"String":return i([u,l.valueOf()],l)}if(t&&"toJSON"in l)return s(l.toJSON());const d=[],h=i([o,d],l);for(const p of v4(l))(e||!bo($l(l[p])))&&d.push([s(p),s(l[p])]);return h}case Np:return i([o,isNaN(l.getTime())?Ai:l.toISOString()],l);case Sp:{const{source:d,flags:h}=l;return i([o,{source:d,flags:h}],l)}case Cp:{const d=[],h=i([o,d],l);for(const[p,f]of l)(e||!(bo($l(p))||bo($l(f))))&&d.push([s(p),s(f)]);return h}case Ep:{const d=[],h=i([o,d],l);for(const p of l)(e||!bo($l(p)))&&d.push(s(p));return h}}const{message:c}=l;return i([o,{name:u,message:c}],l)};return s},ox=(e,{json:t,lossy:n}={})=>{const r=[];return k4(!(t||n),!!t,new Map,r)(e),r},Su=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?ax(ox(e,t)):structuredClone(e):(e,t)=>ax(ox(e,t));function b4(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 j4(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function N4(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||b4,r=e.options.footnoteBackLabel||j4,i=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let u=-1;for(;++u<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[u]);if(!c)continue;const d=e.all(c),h=String(c.identifier).toUpperCase(),p=jl(h.toLowerCase());let f=0;const m=[],g=e.footnoteCounts.get(h);for(;g!==void 0&&++f<=g;){m.length>0&&m.push({type:"text",value:" "});let x=typeof n=="string"?n:n(u,f);typeof x=="string"&&(x={type:"text",value:x}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(f>1?"-"+f:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,f),className:["data-footnote-backref"]},children:Array.isArray(x)?x:[x]})}const k=d[d.length-1];if(k&&k.type==="element"&&k.tagName==="p"){const x=k.children[k.children.length-1];x&&x.type==="text"?x.value+=" ":k.children.push({type:"text",value:" "}),k.children.push(...m)}else d.push(...m);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(d,!0)};e.patch(c,y),o.push(y)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...Su(l),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
481
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:`
482
+ `}]}}const ac=function(e){if(e==null)return P4;if(typeof e=="function")return oc(e);if(typeof e=="object")return Array.isArray(e)?S4(e):C4(e);if(typeof e=="string")return E4(e);throw new Error("Expected function, string, or object as test")};function S4(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=ac(e[n]);return oc(r);function r(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function C4(e){const t=e;return oc(n);function n(r){const i=r;let s;for(s in e)if(i[s]!==t[s])return!1;return!0}}function E4(e){return oc(t);function t(n){return n&&n.type===e}}function oc(e){return t;function t(n,r,i){return!!(T4(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function P4(){return!0}function T4(e){return e!==null&&typeof e=="object"&&"type"in e}const iw=[],L4=!0,sa=!1,_h="skip";function $h(e,t,n,r){if(!e||typeof e!="object")throw new Error("Unexpected value `"+e+"` for `tree`, expected node");let i=!0,s,l,o,u;if(typeof n=="function"||n&&typeof n=="object"?(s=t,l=n,r&&(i=!1)):(l=t,n&&(i=!1)),typeof l=="function")o=l;else if(l&&typeof l=="object"){if(!(l.enter===null||l.enter===void 0))if(typeof l.enter=="function")o=l.enter;else throw new Error("Unexpected value `"+l.enter+"` for `visitors.enter`, expected optional visitor");if(typeof l.exit=="function")u=l.exit;else throw new Error("Unexpected value `"+l.exit+"` for `visitors.exit`, expected visitor (pass a visitor directly if you only want an enter visitor)")}else throw new Error("Unexpected value `"+l+"` for `enter` or `visitors`, expected visitor or object with visitors");const c=ac(s),d=i?1:-1;h(e,void 0,[])();function h(p,f,m){const g=p&&typeof p=="object"?p:{};if(typeof g.type=="string"){const y=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(k,"name",{value:"node ("+(p.type+(y?"<"+y+">":""))+")"})}return k;function k(){const y=!s||c(p,f,m[m.length-1]||void 0);let x=iw;if(o&&y&&(x=ux(o(p,m,f)),x[0]===sa))return x;if("children"in p&&p.children){const v=p;if(v.children&&x[0]!==_h){let j=(i?-1:v.children.length)+d;const E=[...m,v];for(;j>-1&&j<v.children.length;){const w=v.children[j],N=h(w,j,E)();if(N[0]===sa)return N;j=typeof N[1]=="number"?N[1]:j+d}}}if(u&&y){const v=ux(u(p,m,f));if(v[0]===_h)throw new Error("Unexpected value `"+v[0]+"` from `exit`, expected `CONTINUE`, `EXIT`, index, or nothing");if(v[0]===sa||typeof v[1]=="number")return v}return x}}}function ux(e){return Array.isArray(e)?e:typeof e=="number"?[L4,e]:e==null?iw:[e]}function uc(e,t,n,r){let i,s,l;s=t,l=n,typeof s=="function"?$h(e,i,qh(s),l):$h(e,i,M4(s),l)}function M4(e){return!e||typeof e!="object"?e:{enter:typeof e.enter=="function"?qh(e.enter):e.enter,exit:typeof e.exit=="function"?qh(e.exit):e.exit}}function qh(e){return t;function t(n,r,i){return e(n,i,r[r.length-1])}}const Bh={}.hasOwnProperty,R4={};function z4(e,t){const n=t||R4,r=new Map,i=new Map,s=new Map,l={...m4,...n.handlers},o={all:c,applyData:I4,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:l,one:u,options:n,patch:A4,wrap:D4};return uc(e,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const h=d.type==="definition"?r:i,p=String(d.identifier).toUpperCase();h.has(p)||h.set(p,d)}}),o;function u(d,h){const p=d.type,f=o.handlers[p];if(Bh.call(o.handlers,p)&&f)return f(o,d,h);if(o.options.passThrough&&o.options.passThrough.includes(p)){if("children"in d){const{children:g,...k}=d,y=Su(k);return y.children=o.all(d),y}return Su(d)}return(o.options.unknownHandler||F4)(o,d,h)}function c(d){const h=[];if("children"in d){const p=d.children;let f=-1;for(;++f<p.length;){const m=o.one(p[f],d);if(m){if(f&&p[f-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=cx(m.value)),!Array.isArray(m)&&m.type==="element")){const g=m.children[0];g&&g.type==="text"&&(g.value=cx(g.value))}Array.isArray(m)?h.push(...m):h.push(m)}}}return h}}function A4(e,t){e.position&&(t.position=jC(e))}function I4(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,s=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const l="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:l}}n.type==="element"&&s&&Object.assign(n.properties,Su(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function F4(e,t){const n=t.data||{},r="value"in t&&!(Bh.call(n,"hProperties")||Bh.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 D4(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
483
+ `});++r<e.length;)r&&n.push({type:"text",value:`
484
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
485
+ `}),n}function cx(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function dx(e,t){const n=z4(e,t),r=n.one(e,void 0),i=N4(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
486
+ `},i),s}function O4(e,t){return e&&"run"in e?async function(n,r){const i=dx(n,{file:r,...t});await e.run(i,r)}:function(n,r){return dx(n,{file:r,...e||t})}}function hx(e){if(e)throw e}var Bo=Object.prototype.hasOwnProperty,sw=Object.prototype.toString,fx=Object.defineProperty,px=Object.getOwnPropertyDescriptor,mx=function(t){return typeof Array.isArray=="function"?Array.isArray(t):sw.call(t)==="[object Array]"},gx=function(t){if(!t||sw.call(t)!=="[object Object]")return!1;var n=Bo.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Bo.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Bo.call(t,i)},xx=function(t,n){fx&&n.name==="__proto__"?fx(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},yx=function(t,n){if(n==="__proto__")if(Bo.call(t,n)){if(px)return px(t,n).value}else return;return t[n]},_4=function e(){var t,n,r,i,s,l,o=arguments[0],u=1,c=arguments.length,d=!1;for(typeof o=="boolean"&&(d=o,o=arguments[1]||{},u=2),(o==null||typeof o!="object"&&typeof o!="function")&&(o={});u<c;++u)if(t=arguments[u],t!=null)for(n in t)r=yx(o,n),i=yx(t,n),o!==i&&(d&&i&&(gx(i)||(s=mx(i)))?(s?(s=!1,l=r&&mx(r)?r:[]):l=r&&gx(r)?r:{},xx(o,{name:n,newValue:e(d,l,i)})):typeof i<"u"&&xx(o,{name:n,newValue:i}));return o};const Zc=Gh(_4);function Uh(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 $4(){const e=[],t={run:n,use:r};return t;function n(...i){let s=-1;const l=i.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);o(null,...i);function o(u,...c){const d=e[++s];let h=-1;if(u){l(u);return}for(;++h<i.length;)(c[h]===null||c[h]===void 0)&&(c[h]=i[h]);i=c,d?q4(d,o)(...c):l(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function q4(e,t){let n;return r;function r(...l){const o=e.length>l.length;let u;o&&l.push(i);try{u=e.apply(this,l)}catch(c){const d=c;if(o&&n)throw d;return i(d)}o||(u&&u.then&&typeof u.then=="function"?u.then(s,i):u instanceof Error?i(u):s(u))}function i(l,...o){n||(n=!0,t(l,...o))}function s(l){i(null,l)}}const ir={basename:B4,dirname:U4,extname:H4,join:W4,sep:"/"};function B4(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Ka(e);let n=0,r=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,o=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else l<0&&(s=!0,l=i+1),o>-1&&(e.codePointAt(i)===t.codePointAt(o--)?o<0&&(r=i):(o=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function U4(e){if(Ka(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 H4(e){Ka(e);let t=e.length,n=-1,r=0,i=-1,s=0,l;for(;t--;){const o=e.codePointAt(t);if(o===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),o===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function W4(...e){let t=-1,n;for(;++t<e.length;)Ka(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":V4(n)}function V4(e){Ka(e);const t=e.codePointAt(0)===47;let n=Q4(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Q4(e,t){let n="",r=0,i=-1,s=0,l=-1,o,u;for(;++l<=e.length;){if(l<e.length)o=e.codePointAt(l);else{if(o===47)break;o=47}if(o===47){if(!(i===l-1||s===1))if(i!==l-1&&s===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=l,s=0;continue}}else if(n.length>0){n="",r=0,i=l,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,l):n=e.slice(i+1,l),r=l-i-1;i=l,s=0}else o===46&&s>-1?s++:s=-1}return n}function Ka(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const K4={cwd:G4};function G4(){return"/"}function Hh(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Y4(e){if(typeof e=="string")e=new URL(e);else if(!Hh(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 X4(e)}function X4(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 ed=["history","path","basename","stem","extname","dirname"];class lw{constructor(t){let n;t?Hh(t)?n={path:t}:typeof t=="string"||J4(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":K4.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<ed.length;){const s=ed[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)ed.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?ir.basename(this.path):void 0}set basename(t){nd(t,"basename"),td(t,"basename"),this.path=ir.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?ir.dirname(this.path):void 0}set dirname(t){vx(this.basename,"dirname"),this.path=ir.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?ir.extname(this.path):void 0}set extname(t){if(td(t,"extname"),vx(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=ir.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Hh(t)&&(t=Y4(t)),nd(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?ir.basename(this.path,this.extname):void 0}set stem(t){nd(t,"stem"),td(t,"stem"),this.path=ir.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 Ot(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 td(e,t){if(e&&e.includes(ir.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+ir.sep+"`")}function nd(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function vx(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function J4(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Z4=function(e){const r=this.constructor.prototype,i=r[e],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s},e5={}.hasOwnProperty;class Pp extends Z4{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=$4()}copy(){const t=new Pp;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Zc(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(sd("data",this.frozen),this.namespace[t]=n,this):e5.call(this.namespace,t)&&this.namespace[t]||void 0:t?(sd("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=jo(t),r=this.parser||this.Parser;return rd("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),rd("process",this.parser||this.Parser),id("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,l){const o=jo(t),u=r.parse(o);r.run(u,o,function(d,h,p){if(d||!h||!p)return c(d);const f=h,m=r.stringify(f,p);r5(m)?p.value=m:p.result=m,c(d,p)});function c(d,h){d||!h?l(d):s?s(h):n(void 0,h)}}}processSync(t){let n=!1,r;return this.freeze(),rd("processSync",this.parser||this.Parser),id("processSync",this.compiler||this.Compiler),this.process(t,i),kx("processSync","process",n),r;function i(s,l){n=!0,hx(s),r=l}}run(t,n,r){wx(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(l,o){const u=jo(n);i.run(t,u,c);function c(d,h,p){const f=h||t;d?o(d):l?l(f):r(void 0,f,p)}}}runSync(t,n){let r=!1,i;return this.run(t,n,s),kx("runSync","run",r),i;function s(l,o){hx(l),i=o,r=!0}}stringify(t,n){this.freeze();const r=jo(n),i=this.compiler||this.Compiler;return id("stringify",i),wx(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(sd("use",this.frozen),t!=null)if(typeof t=="function")u(t,n);else if(typeof t=="object")Array.isArray(t)?o(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(c){if(typeof c=="function")u(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[d,...h]=c;u(d,h)}else l(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function l(c){if(!("plugins"in c)&&!("settings"in c))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");o(c.plugins),c.settings&&(i.settings=Zc(!0,i.settings,c.settings))}function o(c){let d=-1;if(c!=null)if(Array.isArray(c))for(;++d<c.length;){const h=c[d];s(h)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function u(c,d){let h=-1,p=-1;for(;++h<r.length;)if(r[h][0]===c){p=h;break}if(p===-1)r.push([c,...d]);else if(d.length>0){let[f,...m]=d;const g=r[p][1];Uh(g)&&Uh(f)&&(f=Zc(!0,g,f)),r[p]=[c,f,...m]}}}}const t5=new Pp().freeze();function rd(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function id(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function sd(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 wx(e){if(!Uh(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function kx(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function jo(e){return n5(e)?e:new lw(e)}function n5(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function r5(e){return typeof e=="string"||i5(e)}function i5(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const s5="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",bx=[],jx={allowDangerousHtml:!0},l5=/^(https?|ircs?|mailto|xmpp)$/i,a5=[{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 aw(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,s=e.components,l=e.disallowedElements,o=e.rehypePlugins||bx,u=e.remarkPlugins||bx,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...jx}:jx,d=e.skipHtml,h=e.unwrapDisallowed,p=e.urlTransform||o5,f=t5().use(UE).use(u).use(O4,c).use(o),m=new lw;typeof r=="string"&&(m.value=r);for(const x of a5)Object.hasOwn(e,x.from)&&(""+x.from+(x.to?"use `"+x.to+"` instead":"remove it")+s5+x.id,void 0);const g=f.parse(m);let k=f.runSync(g,m);return i&&(k={type:"element",tagName:"div",properties:{className:i},children:k.type==="root"?k.children:[k]}),uc(k,y),TC(k,{Fragment:a.Fragment,components:s,ignoreInvalidStyle:!0,jsx:a.jsx,jsxs:a.jsxs,passKeys:!0,passNode:!0});function y(x,v,j){if(x.type==="raw"&&j&&typeof v=="number")return d?j.children.splice(v,1):j.children[v]={type:"text",value:x.value},v;if(x.type==="element"){let E;for(E in Yc)if(Object.hasOwn(Yc,E)&&Object.hasOwn(x.properties,E)){const w=x.properties[E],N=Yc[E];(N===null||N.includes(x.tagName))&&(x.properties[E]=p(String(w||""),E,x))}}if(x.type==="element"){let E=t?!t.includes(x.tagName):l?l.includes(x.tagName):!1;if(!E&&n&&typeof v=="number"&&(E=!n(x,v,j)),E&&j&&typeof v=="number")return h&&x.children?j.children.splice(v,1,...x.children):j.children.splice(v,1),v}}}function o5(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t<0||i>-1&&t>i||n>-1&&t>n||r>-1&&t>r||l5.test(e.slice(0,t))?e:""}function Nx(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 u5(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function c5(e,t,n){const i=ac((n||{}).ignore||[]),s=d5(t);let l=-1;for(;++l<s.length;)$h(e,o);function o(c,d,h){if(c.type==="text"&&typeof h=="number")return u(c,d,h);if(i(c,h,d[d.length-1]))return _h}function u(c,d,h){const p=d[d.length-1],f=s[l][0],m=s[l][1];let g=0,k=!1,y=[];f.lastIndex=0;let x=f.exec(c.value);for(;x;){const j=x.index,E={index:x.index,input:x.input,stack:[...d,c]};let w=m(...x,E);if(typeof w=="string"&&(w=w.length>0?{type:"text",value:w}:void 0),w===!1)f.lastIndex=j+1;else{if(g!==j&&v({type:"text",value:c.value.slice(g,j)}),Array.isArray(w))for(const N of w)v(N);else w&&v(w);g=j+x[0].length,k=!0}if(!f.global)break;x=f.exec(c.value)}return k?(g<c.value.length&&v({type:"text",value:c.value.slice(g)}),p.children.splice(h,1,...y)):y=[c],h+y.length;function v(j){const E=y[y.length-1];E&&E.type==="text"&&j.type==="text"?E.value+=j.value:y.push(j)}}}function d5(e){if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const t=[],n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([h5(i[0]),f5(i[1])])}return t}function h5(e){return typeof e=="string"?new RegExp(u5(e),"g"):e}function f5(e){return typeof e=="function"?e:function(){return e}}const ld="phrasing",ad=["autolink","link","image","label"];function p5(){return{transforms:[k5],enter:{literalAutolink:g5,literalAutolinkEmail:od,literalAutolinkHttp:od,literalAutolinkWww:od},exit:{literalAutolink:w5,literalAutolinkEmail:v5,literalAutolinkHttp:x5,literalAutolinkWww:y5}}}function m5(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:ld,notInConstruct:ad},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:ld,notInConstruct:ad},{character:":",before:"[ps]",after:"\\/",inConstruct:ld,notInConstruct:ad}]}}function g5(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function od(e){this.config.enter.autolinkProtocol.call(this,e)}function x5(e){this.config.exit.autolinkProtocol.call(this,e)}function y5(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 v5(e){this.config.exit.autolinkEmail.call(this,e)}function w5(e){this.exit(e)}function k5(e){c5(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,b5],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),j5]],{ignore:["link","linkReference"]})}function b5(e,t,n,r,i){let s="";if(!ow(i)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!N5(n)))return!1;const l=S5(n+r);if(!l[0])return!1;const o={type:"link",title:null,url:s+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[o,{type:"text",value:l[1]}]:o}function j5(e,t,n,r){return!ow(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function N5(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 S5(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=Nx(e,"(");let s=Nx(e,")");for(;r!==-1&&i>s;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[e,n]}function ow(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||ds(n)||ic(n))&&(!t||n!==47)}uw.peek=A5;function C5(){this.buffer()}function E5(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function P5(){this.buffer()}function T5(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function L5(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Vn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function M5(e){this.exit(e)}function R5(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Vn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function z5(e){this.exit(e)}function A5(){return"["}function uw(e,t,n,r){const i=n.createTracker(r);let s=i.move("[^");const l=n.enter("footnoteReference"),o=n.enter("reference");return s+=i.move(n.safe(n.associationId(e),{after:"]",before:s})),o(),l(),s+=i.move("]"),s}function I5(){return{enter:{gfmFootnoteCallString:C5,gfmFootnoteCall:E5,gfmFootnoteDefinitionLabelString:P5,gfmFootnoteDefinition:T5},exit:{gfmFootnoteCallString:L5,gfmFootnoteCall:M5,gfmFootnoteDefinitionLabelString:R5,gfmFootnoteDefinition:z5}}}function F5(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:uw},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,s,l){const o=s.createTracker(l);let u=o.move("[^");const c=s.enter("footnoteDefinition"),d=s.enter("label");return u+=o.move(s.safe(s.associationId(r),{before:u,after:"]"})),d(),u+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),u+=o.move((t?`
487
+ `:" ")+s.indentLines(s.containerFlow(r,o.current()),t?cw:D5))),c(),u}}function D5(e,t,n){return t===0?e:cw(e,t,n)}function cw(e,t,n){return(n?"":" ")+e}const O5=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Tp.attention=U5;Tp.peek=H5;function _5(){return{canContainEols:["delete"],enter:{strikethrough:q5},exit:{strikethrough:B5}}}function $5(){return{handlers:{delete:Tp},unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:O5}]}}function q5(e){this.enter({type:"delete",children:[],position:void 0},e)}function B5(e){this.exit(e)}function Tp(e,t,n,r){const i=n.createTracker(r),s=n.stack.includes("strikethrough")?"~":"~~",l=n.enter("strikethrough");let o=i.move(s);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move(s),l(),o}function U5(){return{construct:"strikethrough",markers:["~"],sizes:[2,1]}}function H5(){return"~"}function W5(e){return e.length}function V5(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||W5,s=[],l=[],o=[],u=[];let c=0,d=-1;for(;++d<e.length;){const g=[],k=[];let y=-1;for(e[d].length>c&&(c=e[d].length);++y<e[d].length;){const x=Q5(e[d][y]);if(n.alignDelimiters!==!1){const v=i(x);k[y]=v,(u[y]===void 0||v>u[y])&&(u[y]=v)}g.push(x)}l[d]=g,o[d]=k}let h=-1;if(typeof r=="object"&&"length"in r)for(;++h<c;)s[h]=Sx(r[h]);else{const g=Sx(r);for(;++h<c;)s[h]=g}h=-1;const p=[],f=[];for(;++h<c;){const g=s[h];let k="",y="";g===99?(k=":",y=":"):g===108?k=":":g===114&&(y=":");let x=n.alignDelimiters===!1?1:Math.max(1,u[h]-k.length-y.length);const v=k+"-".repeat(x)+y;n.alignDelimiters!==!1&&(x=k.length+x+y.length,x>u[h]&&(u[h]=x),f[h]=x),p[h]=v}l.splice(1,0,p),o.splice(1,0,f),d=-1;const m=[];for(;++d<l.length;){const g=l[d],k=o[d],y=n.fillRows===!1?Math.max(1,l[d===1?0:d].length):c;h=-1;const x=[];for(;++h<y;){const v=g[h]||"";let j="",E="";if(n.alignDelimiters!==!1){const w=u[h]-(k[h]||0),N=s[h];if(N===114)j=" ".repeat(w);else if(N===99){const M=w/2;w%2?(j=" ".repeat(M+.5),E=" ".repeat(M-.5)):(j=" ".repeat(M),E=j)}else E=" ".repeat(w)}n.delimiterStart!==!1&&!h&&x.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&v==="")&&(n.delimiterStart!==!1||h)&&x.push(" "),n.alignDelimiters!==!1&&x.push(j),x.push(v),n.alignDelimiters!==!1&&x.push(E),n.padding!==!1&&x.push(" "),(n.delimiterEnd!==!1||h!==y-1)&&x.push("|")}m.push(n.delimiterEnd===!1?x.join("").replace(/ +$/,""):x.join(""))}return m.join(`
488
+ `)}function Q5(e){return e==null?"":String(e)}function Sx(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}const K5=ac(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function G5(e,t,n,r){const i=n.enter("blockquote"),s=n.createTracker(r);s.move("> "),s.shift(2);const l=n.indentLines(n.containerFlow(e,s.current()),Y5);return i(),l}function Y5(e,t,n){return">"+(n?"":" ")+e}function X5(e,t){return Cx(e,t.inConstruct,!0)&&!Cx(e,t.notInConstruct,!1)}function Cx(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 Ex(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;){const s=n.unsafe[i];if(s.character===`
489
+ `&&!s.before&&!s.after&&X5(n.stack,s))return/[\t ]/.test(r.before)?"":" "}return`\\
490
+ `}function J5(e,t){const n=String(e);let r=n.indexOf(t),i=r,s=0,l=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++s>l&&(l=s):s=1,i=r+t.length,r=n.indexOf(t,i);return l}function Z5(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^\n\r ]/.test(e.value)&&!/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(e.value))}function eP(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 tP(e,t,n,r){const i=eP(n),s=e.value||"";if(Z5(e,n)){const h=n.enter("codeIndented"),p=n.indentLines(s,nP);return h(),p}const l=n.createTracker(r),o=i.repeat(Math.max(J5(s,i)+1,3)),u=n.enter("codeFenced"),c=i==="`"?"GraveAccent":"Tilde";let d=l.move(o);if(e.lang){const h=n.enter(`codeFencedLang${c}`);d+=l.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...l.current()})),h()}if(e.lang&&e.meta){const h=n.enter(`codeFencedMeta${c}`);d+=l.move(" "),d+=l.move(n.safe(e.meta,{before:d,after:`
491
+ `,encode:["`"],...l.current()})),h()}return d+=l.move(`
492
+ `),s&&(d+=l.move(s+`
493
+ `)),d+=l.move(o),u(),d}function nP(e,t,n){return(n?"":" ")+e}function Lp(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 rP(e,t,n,r){const i=Lp(n),s=i==='"'?"Quote":"Apostrophe",l=n.enter("definition");let o=n.enter("label");const u=n.createTracker(r);let c=u.move("[");return c+=u.move(n.safe(n.associationId(e),{before:c,after:"]",...u.current()})),c+=u.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),c+=u.move("<"),c+=u.move(n.safe(e.url,{before:c,after:">",...u.current()})),c+=u.move(">")):(o=n.enter("destinationRaw"),c+=u.move(n.safe(e.url,{before:c,after:e.title?" ":`
494
+ `,...u.current()}))),o(),e.title&&(o=n.enter(`title${s}`),c+=u.move(" "+i),c+=u.move(n.safe(e.title,{before:c,after:i,...u.current()})),c+=u.move(i),o()),l(),c}function iP(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 Cu(e){const t=e.codePointAt(0);return t===void 0?"":String.fromCodePoint(t)}function Hs(e){const t=e.codePointAt(e.length-2);return t!==void 0&&t>65535?e.slice(-2):e.slice(-1)}function dw(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Px(e,t,n){const r=wi(e),i=wi(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}}function sP(e){if(e.charCodeAt(0)!==60)return;const t=e.charCodeAt(1);if(t===33){const o=e.charCodeAt(2);return o===45?2:o===91?5:St(o)?4:void 0}if(t===63)return 3;const n=t===47,r=n?2:1;let i=r,s=e.charCodeAt(i);if(!St(s))return;for(;s===45||Ct(s);)s=e.charCodeAt(++i);const l=e.slice(r,i).toLowerCase();return!n&&s!==47&&Oh.includes(l)?1:Q0.includes(l)?6:7}const lP=new Map([["*",!1],["_",!0]]);function aP(e,t,n){const r=new Set;for(const s of e){const l=n.get(s);if(l&&s.attention&&t.some(o=>o.attention===s.attention))for(const o of l.tokens)r.add(o.attention)}const i=[];for(const s of e)s.attention&&r.delete(s.attention)&&i.push(s.attention);return i.reverse(),i}function hw(e,t,n){const r=[],i=new Map,s=new Map;let l=0;for(;l<e.length;){if(!e[l].attention){l++;continue}const o=e[l].value.charAt(0),u=lP.get(o);let c=l+1;for(;c<e.length&&e[c].attention&&e[c].value.charAt(0)===o;)c++;const d=l?e[l-1].value:t,h=wi(d.charCodeAt(d.length-1)),p=wi((c<e.length?e[c].value:n).charCodeAt(0)),f=!p||p===2&&!!h,m=!h||h===2&&!!p,g={tokens:e.slice(l,c),markers:[],start:0,end:0,open:u?f&&(!!h||!m):f,close:u?m&&(!!p||!f):m,split:u!==void 0};for(const k of g.tokens){i.set(k,[...g.tokens]),s.set(k,g);let y=k.value.length;for(;y--;)g.markers.push(k)}g.end=g.markers.length,r.push(g),l=c}for(uP(r,i),l=-1;++l<e.length;){const o=i.get(e[l]);if(o)return{attention:aP(e,o,s),index:l}}}function No(e,t){const n=e[t?0:e.length-1];if(!n||n.attention)return;const r=t?Cu(n.value):Hs(n.value),i=dw(r.codePointAt(0));if(t)n.value=i+n.value.slice(r.length);else{let s=n.value.slice(0,n.value.length-r.length),l=0;for(;s.charCodeAt(s.length-1-l)===92;)l++;l%2&&(s+="\\"),n.value=s+i}}function oP(e,t,n,r,i){for(const s of n.attention){const l=t.get(s)||s.sequences[0];for(const o of s.sequences){if(o===l)continue;const u=new Map(t);u.set(s,o);const c=Rp(e,u,r,i),d=hw(c,r,i);if(!d||d.index>n.index)return{chosen:u,mistake:d,tokens:c}}}}function uP(e,t){const n=new Map;for(const r of e){const i=r.tokens[0].value.charAt(0);let s=n.get(i);s||(s=[],n.set(i,s));let l=r.close?s.length:0;for(;l--&&r.start<r.end;){const o=s[l],u=o.end-o.start,c=r.end-r.start;if(r.split?(o.close||r.open)&&c%3&&!((u+c)%3):u!==o.markers.length||u!==c)continue;const d=r.split?u>1&&c>1?2:1:c,h=o.markers.slice(o.end-d,o.end),p=r.markers.slice(r.start,r.start+d),f=h[0],m=p[0];if(f===h[d-1]&&f.value.length===d&&m===p[d-1]&&m.value.length===d&&f.attention===m.attention)t.delete(f),t.delete(m);else{const g=[...new Set([...h,...p])];for(const k of g){const y=t.get(k);y&&y.push(...g)}}o.end-=d,r.start+=d,o.start===o.end&&s.splice(l,1),l=s.length}r.open&&r.start<r.end&&s.push(r)}}function cP(e,t,n){if(t.length===0)throw new Error("Cannot serialize `"+e+"` as attention without markers, expected one or more markers");if(n.length===0)throw new Error("Cannot serialize `"+e+"` as attention without sizes, expected one or more sizes");for(const i of n)if(!Number.isSafeInteger(i)||i<1)throw new Error("Cannot serialize `"+e+"` as attention with `"+i+"` as size, expected positive integer");const r=[];for(const i of t){if(i.length!==1)throw new Error("Cannot serialize `"+e+"` as attention with `"+i+"` as marker, expected a single ascii character");if(!O0(i.charCodeAt(0)))throw new Error("Cannot serialize `"+e+"` as attention with `"+i+"` as marker, expected ascii punctuation");for(const s of n)r.push(i.repeat(s))}return r}function dP(e,t,n){const r=t.indexStack,i=e.children||[],s=[];let l=-1,o=n.before;r.push(-1);let u=t.createTracker(n);for(;++l<i.length;){const c=i[l];let d;if(r[r.length-1]=l,l+1<i.length){let f=t.handle.handlers[i[l+1].type];f&&f.peek&&(f=f.peek),d=f?Cu(f(i[l+1],e,t,{before:"",after:"",...u.current()})):""}else d=n.after;const h=s[s.length-1];typeof h=="string"&&(o==="\r"||o===`
495
+ `)&&c.type==="html"&&sP(c.value)!==7&&(s[s.length-1]=h.replace(/(\r?\n|\r)$/," "),o=" ",u=t.createTracker(n),u.move(cc(s,n.before,n.after)));const p=t.handle.handlers[c.type];if(p&&p.attention){const f=Mp(c,p.attention,t,u);s.push(f),o=Hs(f.sequences[0])}else{const f=t.handle(c,e,t,{...u.current(),after:d,before:o});if(!f)continue;u.move(f),s.push(f),o=Hs(f)}}return r.pop(),s}function Mp(e,t,n,r){const{construct:i,markers:s,sizes:l}=t(e,n),o=cP(e.type,s,l),u=o[0],c=n.enter(i);r.move(u);const d=dP(e,n,{...r.current(),before:u,after:u});return r.move(cc(d,u,u)),r.move(u),c(),{children:d,sequences:o}}function Rp(e,t,n,r){const i=[];let s,l=Hs(n),o=-1;for(;++o<e.length;){const u=e[o];if(typeof u=="string"){const v={value:u,attention:void 0};s&&s===Cu(u)&&No([v],!0),s=void 0,i.push(v),v.value&&(l=Hs(v.value));continue}const c=t.get(u)||u.sequences[0],d=c.charAt(0),h=e[o+1],p=l,f=Cu(h===void 0?r:typeof h=="string"?h:t.get(h)||h.sequences[0]),m=Rp(u.children,t,c,c),g=m.length>0?m[0].value:"",k=Px(p.charCodeAt(p.length-1),g.charCodeAt(0),d);k.inside&&No(m,!0);const y=m.length>0?Hs(m[m.length-1].value):"",x=Px(f.charCodeAt(0),y.charCodeAt(y.length-1),d);x.inside&&No(m,!1),k.outside&&p!==`
496
+ `&&p!=="\r"&&No(i,!1),x.outside&&(s=f),i.push({value:c,attention:u},...m,{value:c,attention:u}),l=c.charAt(c.length-1)}return i}function cc(e,t,n){let r=new Map;const i=Rp(e,r,t,n);let s=i,l=hw(s,t,n);for(;l;){const u=oP(e,r,l,t,n);if(!u){s=i;break}r=u.chosen,s=u.tokens,l=u.mistake}let o="";for(const u of s)o+=u.value;return o}zp.attention=fw;zp.peek=hP;function zp(e,t,n,r){const i=n.enter("phrasing"),s=Mp(e,fw,n,n.createTracker(r)),l=cc([s],r.before,r.after);return i(),l}function fw(e,t){return{construct:"emphasis",markers:iP(t)==="*"?["*","_"]:["_","*"],sizes:[1]}}function hP(e,t,n){return n.options.emphasis||"*"}function fP(e,t){let n=!1;return uc(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)&&rc(e)&&(t.options.setext||n))}function pP(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(r);if(fP(e,n)){const h=n.enter("headingSetext"),p=n.enter("phrasing"),f=n.containerPhrasing(e,{...s.current(),before:`
497
+ `,after:`
498
+ `});return p(),h(),f+`
499
+ `+(i===1?"=":"-").repeat(f.length-(Math.max(f.lastIndexOf("\r"),f.lastIndexOf(`
500
+ `))+1))}const l="#".repeat(i),o=n.enter("headingAtx"),u=n.enter("phrasing");s.move(l+" ");let c=n.containerPhrasing(e,{before:"# ",after:`
501
+ `,...s.current()});const d=c.charCodeAt(0);return(d===9||d===32)&&(c=dw(d)+c.slice(1)),c=c?l+" "+c:l,n.options.closeAtx&&(c+=" "+l),u(),o(),c}pw.peek=mP;function pw(e){return e.value||""}function mP(){return"<"}mw.peek=gP;function mw(e,t,n,r){const i=Lp(n),s=i==='"'?"Quote":"Apostrophe",l=n.enter("image");let o=n.enter("label");const u=n.createTracker(r);let c=u.move("![");return c+=u.move(n.safe(e.alt,{before:c,after:"]",...u.current()})),c+=u.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),c+=u.move("<"),c+=u.move(n.safe(e.url,{before:c,after:">",...u.current()})),c+=u.move(">")):(o=n.enter("destinationRaw"),c+=u.move(n.safe(e.url,{before:c,after:e.title?" ":")",...u.current()}))),o(),e.title&&(o=n.enter(`title${s}`),c+=u.move(" "+i),c+=u.move(n.safe(e.title,{before:c,after:i,...u.current()})),c+=u.move(i),o()),c+=u.move(")"),l(),c}function gP(){return"!"}gw.peek=xP;function gw(e,t,n,r){const i=e.referenceType,s=n.enter("imageReference");let l=n.enter("label");const o=n.createTracker(r);let u=o.move("![");const c=n.safe(e.alt,{before:u,after:"]",...o.current()});u+=o.move(c+"]["),l();const d=n.stack;n.stack=d.filter(function(p){return p!=="phrasing"}),l=n.enter("reference");const h=n.safe(n.associationId(e),{before:u,after:"]",...o.current()});return l(),n.stack=d,s(),i==="full"||!c||c!==h?u+=o.move(h+"]"):i==="shortcut"?u=u.slice(0,-1):u+=o.move("]"),u}function xP(){return"!"}xw.peek=yP;function xw(e,t,n){let r=e.value||"",i="`",s=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^\n\r ]/.test(r)&&(/^[\n\r ]/.test(r)&&/[\n\r ]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s<n.unsafe.length;){const l=n.unsafe[s],o=n.compilePattern(l);if(!l.atBreak)continue;let u;for(;u=o.exec(r);){let c=u.index;r.charCodeAt(c)===10&&r.charCodeAt(c-1)===13&&c--,r=r.slice(0,c)+" "+r.slice(u.index+1)}}return i+r+i}function yP(){return"`"}function yw(e,t){const n=rc(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))}vw.peek=vP;function vw(e,t,n,r){const i=Lp(n),s=i==='"'?"Quote":"Apostrophe",l=n.createTracker(r);if(yw(e,n)){const m=n.stack;n.stack=m.filter(function(y){return y!=="phrasing"});const g=n.enter("autolink");let k=l.move("<");return k+=l.move(n.containerPhrasing(e,{before:k,after:">",...l.current()})),k+=l.move(">"),g(),n.stack=m,k}const o=n.enter("link");let u=n.enter("label"),c=l.move("[");const d=n.containerPhrasing(e,{before:c,after:"](",...l.current()});c+=l.move(d),u(),c+=l.move("](");const h=/[\0- \u007F]/.test(e.url),p=r.before.charAt(r.before.length-1);let f=e.title||void 0;if(!f&&!h&&(p===`
502
+ `||p==="\r")){let m=0;for(;m<d.length&&d.charCodeAt(m)!==93;)m+=d.charCodeAt(m)===92?2:1;d.charCodeAt(m+1)===58&&(f="")}return!e.url&&typeof f=="string"||h?(u=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(u=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:typeof f=="string"?" ":")",...l.current()}))),u(),typeof f=="string"&&(u=n.enter(`title${s}`),c+=l.move(" "+i),c+=l.move(n.safe(f,{before:c,after:i,...l.current()})),c+=l.move(i),u()),c+=l.move(")"),o(),c}function vP(e,t,n){return yw(e,n)?"<":"["}ww.peek=wP;function ww(e,t,n,r){const i=e.referenceType,s=n.enter("linkReference");let l=n.enter("label");const o=n.createTracker(r);let u=o.move("[");const c=n.containerPhrasing(e,{before:u,after:"]",...o.current()});u+=o.move(c+"]["),l();const d=n.stack;n.stack=d.filter(function(p){return p!=="phrasing"}),l=n.enter("reference");const h=n.safe(n.associationId(e),{before:u,after:"]",...o.current()});return l(),n.stack=d,s(),i==="full"||!c||c!==h?u+=o.move(h+"]"):i==="shortcut"?u=u.slice(0,-1):u+=o.move("]"),u}function wP(){return"["}function Ap(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 kP(e){const t=Ap(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 bP(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 kw(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 jP(e,t,n,r){const i=n.enter("list"),s=n.bulletCurrent;let l=e.ordered?bP(n):Ap(n);const o=e.ordered?l==="."?")":".":kP(n);let u=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&d&&(!d.children||!d.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),kw(n)===l&&d){let h=-1;for(;++h<e.children.length;){const p=e.children[h];if(p&&p.type==="listItem"&&p.children&&p.children[0]&&p.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(l=o),n.bulletCurrent=l;const c=n.containerFlow(e,r);return n.bulletLastUsed=l,n.bulletCurrent=s,i(),c}function NP(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 SP(e,t,n,r){const i=NP(n);let s=n.bulletCurrent||Ap(n);t&&t.type==="list"&&t.ordered&&(s=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let l=s.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);const o=n.createTracker(r);o.move(s+" ".repeat(l-s.length)),o.shift(l);const u=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,o.current()),d);return u(),c;function d(h,p,f){return p?(f?"":" ".repeat(l))+h:(f?s:s+" ".repeat(l-s.length))+h}}function CP(e,t,n,r){const i=n.enter("paragraph"),s=n.enter("phrasing"),l=n.containerPhrasing(e,r);return s(),i(),l}function EP(e,t,n,r){if(!e.children.some(function(o){return K5(o)}))return n.containerFlow(e,r);const s=n.enter("phrasing"),l=n.containerPhrasing(e,r);return s(),l}function PP(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Ip.attention=bw;Ip.peek=TP;function Ip(e,t,n,r){const i=n.enter("phrasing"),s=Mp(e,bw,n,n.createTracker(r)),l=cc([s],r.before,r.after);return i(),l}function bw(e,t){return{construct:"strong",markers:PP(t)==="*"?["*","_"]:["_","*"],sizes:[2]}}function TP(e,t,n){return n.options.strong||"*"}function LP(e,t,n,r){const i=t?t.children:[],s=n.indexStack[n.indexStack.length-1];return n.safe(e.value,{...r,afterNode:i[s+1],beforeNode:i[s-1]})}function MP(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 RP(e,t,n){const r=(kw(n)+(n.options.ruleSpaces?" ":"")).repeat(MP(n));return n.options.ruleSpaces?r.slice(0,-1):r}const jw={blockquote:G5,break:Ex,code:tP,definition:rP,emphasis:zp,hardBreak:Ex,heading:pP,html:pw,image:mw,imageReference:gw,inlineCode:xw,link:vw,linkReference:ww,list:jP,listItem:SP,paragraph:CP,root:EP,strong:Ip,text:LP,thematicBreak:RP};function zP(){return{enter:{table:AP,tableData:Tx,tableHeader:Tx,tableRow:FP},exit:{codeText:DP,table:IP,tableData:ud,tableHeader:ud,tableRow:ud}}}function AP(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[],position:void 0},e),this.data.inTable=!0}function IP(e){this.exit(e),this.data.inTable=void 0}function FP(e){this.enter({type:"tableRow",children:[],position:void 0},e)}function ud(e){this.exit(e)}function Tx(e){this.enter({type:"tableCell",children:[],position:void 0},e)}function DP(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,OP));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function OP(e,t){return t==="|"?t:e}function _P(e){const t=e||{},{tableCellPadding:n,tablePipeAlign:r,stringLength:i}=t,s=n?" ":"|";return{handlers:{inlineCode:p,table:l,tableCell:u,tableRow:o},join:[$P],unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
503
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}]};function l(f,m,g,k){const y=d(f,g,k),x=y[0];if(x){let v=f.align?f.align.length:0,j=-1;if(!v)for(;++j<y.length;)y[j].length>v&&(v=y[j].length);for(;x.length<v;)x.push("")}return c(y,f.align)}function o(f,m,g,k){const y=h(f,g,k),x=c([y]);return x.slice(0,x.indexOf(`
504
+ `))}function u(f,m,g,k){const y=g.enter("tableCell"),x=g.enter("phrasing"),v=g.containerPhrasing(f,{...k,before:s,after:s});return x(),y(),v}function c(f,m){return V5(f,{align:m,alignDelimiters:r,fillRows:!1,padding:n,stringLength:i})}function d(f,m,g){const{children:k}=f;let y=-1;const x=[],v=m.enter("table");for(;++y<k.length;)x[y]=h(k[y],m,g);return v(),x}function h(f,m,g){const{children:k}=f;let y=-1;const x=[],v=m.enter("tableRow");for(;++y<k.length;)x[y]=u(k[y],f,m,g);return v(),x}function p(f,m,g){const k=jw.inlineCode(f,m,g);if(!g.stack.includes("tableCell"))return k;const y=[];let x=0,v=k.indexOf("|");for(;v!==-1;){let j=v;for(;j>x&&k.charCodeAt(j-1)===92;)j--;y.push(k.slice(x,v)),(v-j)%2===0&&y.push("\\"),x=v,v=k.indexOf("|",v+1)}return y.push(k.slice(x)),y.join("")}}function $P(e,t,n,r){if(e.type==="table"&&n.type==="listItem"&&n.spread===!1&&(t.type==="definition"||t.type==="heading"&&qP(t,r)||t.type==="paragraph"||t.type==="table"))return 1}function qP(e,t){let n=!1;return uc(e,function(r){if(r.type==="break"||"value"in r&&/\r?\n|\r/.test(r.value))return n=!0,sa}),!!((!e.depth||e.depth<3)&&rc(e)&&(t.options.setext||n))}function BP(){return{exit:{taskListCheckValueChecked:Lx,taskListCheckValueUnchecked:Lx,paragraph:HP}}}function UP(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:WP}}}function Lx(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function HP(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 s=-1,l;for(;++s<i.length;){const o=i[s];if(o.type==="paragraph"){l=o;break}}l===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function WP(e,t,n,r){const i=e.children[0],s=typeof e.checked=="boolean"&&i&&i.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",o=n.createTracker(r);s&&o.move(l);let u=jw.listItem(e,t,n,{...r,...o.current()});return s&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),u;function c(d){return d+l}}function VP(){return[p5(),I5(),_5(),zP(),BP()]}function QP(e){return{extensions:[m5(),F5(e),$5(),_P(e),UP()]}}const KP={tokenize:eT,partial:!0},Nw={tokenize:tT,partial:!0},Sw={tokenize:nT,partial:!0},Cw={tokenize:rT,partial:!0},GP={tokenize:iT,partial:!0},Ew={name:"wwwAutolink",tokenize:JP,previous:Tw},Pw={name:"protocolAutolink",tokenize:ZP,previous:Lw},qr={name:"emailAutolink",tokenize:XP,previous:Mw},gr={};function YP(){return{text:gr}}let Li=48;for(;Li<123;)gr[Li]=qr,Li++,Li===58?Li=65:Li===91&&(Li=97);gr[43]=qr;gr[45]=qr;gr[46]=qr;gr[95]=qr;gr[72]=[qr,Pw];gr[104]=[qr,Pw];gr[87]=[qr,Ew];gr[119]=[qr,Ew];function XP(e,t,n){const r=this;let i,s;return l;function l(h){return!Wh(h)||!Mw.call(r,r.previous)||Fp(r.events)?n(h):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(h))}function o(h){return Wh(h)?(e.consume(h),o):h===64?(e.consume(h),u):n(h)}function u(h){return h===46?e.check(GP,d,c)(h):h===45||h===95||Ct(h)?(s=!0,e.consume(h),u):d(h)}function c(h){return e.consume(h),i=!0,u}function d(h){return s&&i&&St(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(h)):n(h)}}function JP(e,t,n){const r=this;return i;function i(l){return l!==87&&l!==119||!Tw.call(r,r.previous)||Fp(r.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(KP,e.attempt(Nw,e.attempt(Sw,s),n),n)(l))}function s(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function ZP(e,t,n){const r=this;let i="",s=!1;return l;function l(h){return(h===72||h===104)&&Lw.call(r,r.previous)&&!Fp(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(h),e.consume(h),o):n(h)}function o(h){if(St(h)&&i.length<5)return i+=String.fromCodePoint(h),e.consume(h),o;if(h===58){const p=i.toLowerCase();if(p==="http"||p==="https")return e.consume(h),u}return n(h)}function u(h){return h===47?(e.consume(h),s?c:(s=!0,u)):n(h)}function c(h){return h===null||bu(h)||$e(h)||ds(h)||ic(h)?n(h):e.attempt(Nw,e.attempt(Sw,d),n)(h)}function d(h){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(h)}}function eT(e,t,n){let r=0;return i;function i(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),i):l===46&&r===3?(e.consume(l),s):n(l)}function s(l){return l===null?n(l):t(l)}}function tT(e,t,n){let r,i,s;return l;function l(c){return c===46||c===95?e.check(Cw,u,o)(c):c===null||$e(c)||ds(c)||c!==45&&ic(c)?u(c):(s=!0,e.consume(c),l)}function o(c){return c===95?r=!0:(i=r,r=void 0),e.consume(c),l}function u(c){return i||r||!s?n(c):t(c)}}function nT(e,t){let n=0,r=0;return i;function i(l){return l===40?(n++,e.consume(l),i):l===41&&r<n?s(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(Cw,t,s)(l):l===null||$e(l)||ds(l)?t(l):(e.consume(l),i)}function s(l){return l===41&&r++,e.consume(l),i}}function rT(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),s):o===93?(e.consume(o),i):o===60||o===null||$e(o)||ds(o)?t(o):n(o)}function i(o){return o===null||o===40||o===91||$e(o)||ds(o)?t(o):r(o)}function s(o){return St(o)?l(o):n(o)}function l(o){return o===59?(e.consume(o),r):St(o)?(e.consume(o),l):n(o)}}function iT(e,t,n){return r;function r(s){return e.consume(s),i}function i(s){return Ct(s)?n(s):t(s)}}function Tw(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||$e(e)}function Lw(e){return!St(e)}function Mw(e){return!(e===47||Wh(e))}function Wh(e){return e===43||e===45||e===46||e===95||Ct(e)}function Fp(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 sT={tokenize:fT,partial:!0};function lT(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:cT,continuation:{tokenize:dT},exit:hT}},text:{91:{name:"gfmFootnoteCall",tokenize:uT},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:aT,resolveTo:oT}}}}function aT(e,t,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){l=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return o;function o(u){if(!l||!l._balanced)return n(u);const c=Vn(r.sliceSerialize({start:l.end,end:r.now()}));return c.codePointAt(0)!==94||!s.includes(c.slice(1))?n(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function oT(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 s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",s,t],["enter",l,t],["exit",l,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function uT(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,l;return o;function o(h){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),u}function u(h){return h!==94?n(h):(e.enter("gfmFootnoteCallMarker"),e.consume(h),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(h){if(s>999||h===93&&!l||h===null||h===91||$e(h))return n(h);if(h===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return i.includes(Vn(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(h)}return $e(h)||(l=!0),s++,e.consume(h),h===92?d:c}function d(h){return h===91||h===92||h===93?(e.consume(h),s++,c):c(h)}}function cT(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,l=0,o;return u;function u(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(m)}function d(m){if(l>999||m===93&&!o||m===null||m===91||$e(m))return n(m);if(m===93){e.exit("chunkString");const g=e.exit("gfmFootnoteDefinitionLabelString");return s=Vn(r.sliceSerialize(g)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return $e(m)||(o=!0),l++,e.consume(m),m===92?h:d}function h(m){return m===91||m===92||m===93?(e.consume(m),l++,d):d(m)}function p(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),i.includes(s)||i.push(s),Ae(e,f,"gfmFootnoteDefinitionWhitespace")):n(m)}function f(m){return t(m)}}function dT(e,t,n){return e.check(Qa,t,e.attempt(sT,t,n))}function hT(e){e.exit("gfmFootnoteDefinition")}function fT(e,t,n){const r=this;return Ae(e,i,"gfmFootnoteDefinitionIndent",5);function i(s){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(s):n(s)}}function pT(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(l,o){let u=-1;for(;++u<l.length;)if(l[u][0]==="enter"&&l[u][1].type==="strikethroughSequenceTemporary"&&l[u][1]._close){let c=u;for(;c--;)if(l[c][0]==="exit"&&l[c][1].type==="strikethroughSequenceTemporary"&&l[c][1]._open&&l[u][1].end.offset-l[u][1].start.offset===l[c][1].end.offset-l[c][1].start.offset){l[u][1].type="strikethroughSequence",l[c][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},l[c][1].start),end:Object.assign({},l[u][1].end)},h={type:"strikethroughText",start:Object.assign({},l[c][1].end),end:Object.assign({},l[u][1].start)},p=[["enter",d,o],["enter",l[c][1],o],["exit",l[c][1],o],["enter",h,o]],f=o.parser.constructs.insideSpan.null;f&&Wn(p,p.length,0,sc(f,l.slice(c+1,u),o)),Wn(p,p.length,0,[["exit",h,o],["enter",l[u][1],o],["exit",l[u][1],o],["exit",d,o]]),Wn(l,c-1,u-c+3,p),u=c+p.length-2;break}}for(u=-1;++u<l.length;)l[u][1].type==="strikethroughSequenceTemporary"&&(l[u][1].type="data");return l}function s(l,o,u){const c=this.previous,d=this.events;let h=0;return p;function p(m){return c===126&&d[d.length-1][1].type!=="characterEscape"?u(m):(l.enter("strikethroughSequenceTemporary"),f(m))}function f(m){const g=wi(c);if(m===126)return h>1?u(m):(l.consume(m),h++,f);if(h<2&&!n)return u(m);const k=l.exit("strikethroughSequenceTemporary"),y=wi(m);return k._open=!y||y===2&&!!g,k._close=!g||g===2&&!!y,o(m)}}}class mT{constructor(){this.map=[],this.index=new Map}add(t,n,r){gT(this,t,n,r)}consume(t){if(this.map.sort(function(s,l){return s[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const s of i)t.push(s);i=r.pop()}this.map.length=0,this.index.clear()}}function gT(e,t,n,r){if(n===0&&r.length===0)return;const i=e.index.get(t);if(i){i[1]+=n,i[2].push(...r);return}const s=[t,n,r];e.map.push(s),e.index.set(t,s)}function xT(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 s=r.length-1;r[s]=r[s]==="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 yT(){return{flow:{null:{name:"table",tokenize:vT,resolveAll:wT}}}}function vT(e,t,n){const r=this;let i=0,s=0,l;return o;function o(C){let O=r.events.length-1;for(;O>-1;){const{type:U}=r.events[O][1];if(U==="lineEnding"||U==="linePrefix")O--;else break}const A=O>-1?r.events[O][1].type:null,V=A==="tableHead"||A==="tableRow"?w:u;return V===w&&r.parser.lazy[r.now().line]?n(C):V(C)}function u(C){return e.enter("tableHead"),e.enter("tableRow"),c(C)}function c(C){return C===124||(l=!0,s+=1),d(C)}function d(C){return C===null?n(C):he(C)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),f):n(C):Ne(C)?Ae(e,d,"whitespace")(C):(s+=1,l&&(l=!1,i+=1),C===124?(e.enter("tableCellDivider"),e.consume(C),e.exit("tableCellDivider"),l=!0,d):(e.enter("data"),h(C)))}function h(C){return C===null||C===124||$e(C)?(e.exit("data"),d(C)):(e.consume(C),C===92?p:h)}function p(C){return C===92||C===124?(e.consume(C),h):h(C)}function f(C){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(C):(e.enter("tableDelimiterRow"),l=!1,Ne(C)?Ae(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):m(C))}function m(C){return C===45||C===58?k(C):C===124?(l=!0,e.enter("tableCellDivider"),e.consume(C),e.exit("tableCellDivider"),g):E(C)}function g(C){return Ne(C)?Ae(e,k,"whitespace")(C):k(C)}function k(C){return C===58?(s+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(C),e.exit("tableDelimiterMarker"),y):C===45?(s+=1,y(C)):C===null||he(C)?j(C):E(C)}function y(C){return C===45?(e.enter("tableDelimiterFiller"),x(C)):E(C)}function x(C){return C===45?(e.consume(C),x):C===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(C),e.exit("tableDelimiterMarker"),v):(e.exit("tableDelimiterFiller"),v(C))}function v(C){return Ne(C)?Ae(e,j,"whitespace")(C):j(C)}function j(C){return C===124?m(C):C===null||he(C)?!l||i!==s?E(C):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(C)):E(C)}function E(C){return n(C)}function w(C){return e.enter("tableRow"),N(C)}function N(C){return C===124?(e.enter("tableCellDivider"),e.consume(C),e.exit("tableCellDivider"),N):C===null||he(C)?(e.exit("tableRow"),t(C)):Ne(C)?Ae(e,N,"whitespace")(C):(e.enter("data"),M(C))}function M(C){return C===null||C===124||$e(C)?(e.exit("data"),N(C)):(e.consume(C),C===92?F:M)}function F(C){return C===92||C===124?(e.consume(C),M):M(C)}}function wT(e,t){let n=-1,r=!0,i=0,s=[0,0,0,0],l=[0,0,0,0],o=!1,u=0,c,d,h;const p=new mT;for(;++n<e.length;){const f=e[n],m=f[1];f[0]==="enter"?m.type==="tableHead"?(o=!1,u!==0&&(Mx(p,t,u,c,d),d=void 0,u=0),c={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},p.add(n,0,[["enter",c,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(r=!0,h=void 0,s=[0,0,0,0],l=[0,n+1,0,0],o&&(o=!1,d={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},p.add(n,0,[["enter",d,t]])),i=m.type==="tableDelimiterRow"?2:d?3:1):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(s[1]!==0&&(l[0]=l[1],h=So(p,t,s,i,void 0,h),s=[0,0,0,0]),l[2]=n)):m.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(l[0]=l[1],h=So(p,t,s,i,void 0,h)),s=l,l=[s[1],n,0,0])):m.type==="tableHead"?(o=!0,u=n):m.type==="tableRow"||m.type==="tableDelimiterRow"?(u=n,s[1]!==0?(l[0]=l[1],h=So(p,t,s,i,n,h)):l[1]!==0&&(h=So(p,t,l,i,n,h)),i=0):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(l[3]=n)}for(u!==0&&Mx(p,t,u,c,d),p.consume(t.events),n=-1;++n<t.events.length;){const f=t.events[n];f[0]==="enter"&&f[1].type==="table"&&(f[1]._align=xT(t.events,n))}return e}function So(e,t,n,r,i,s){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(s.end=Object.assign({},Ns(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const u=Ns(t.events,n[1]);if(s={type:l,start:Object.assign({},u),end:Object.assign({},u)},e.add(n[1],0,[["enter",s,t]]),n[2]!==0){const c=Ns(t.events,n[2]),d=Ns(t.events,n[3]),h={type:o,start:Object.assign({},c),end:Object.assign({},d)};if(e.add(n[2],0,[["enter",h,t]]),r!==2){const p=t.events[n[2]],f=t.events[n[3]];if(p[1].end=Object.assign({},f[1].end),p[1].type="chunkText",p[1].contentType="text",n[3]>n[2]+1){const m=n[2]+1,g=n[3]-n[2]-1;e.add(m,g,[])}}e.add(n[3]+1,0,[["exit",h,t]])}return i!==void 0&&(s.end=Object.assign({},Ns(t.events,i)),e.add(i,0,[["exit",s,t]]),s=void 0),s}function Mx(e,t,n,r,i){const s=[],l=Ns(t.events,n);i&&(i.end=Object.assign({},l),s.push(["exit",i,t])),r.end=Object.assign({},l),s.push(["exit",r,t]),e.add(n+1,0,s)}function Ns(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const kT={name:"tasklistCheck",tokenize:jT};function bT(){return{text:{91:kT}}}function jT(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"),s)}function s(u){return $e(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),l):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),l):n(u)}function l(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(u)}function o(u){return he(u)?t(u):Ne(u)?e.check({tokenize:NT},t,n)(u):n(u)}}function NT(e,t,n){return Ae(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function ST(e){return F0([YP(),lT(),pT(e),yT(),bT()])}const CT={};function ET(e){const t=this,n=e||CT,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(ST(n)),s.push(VP()),l.push(QP(n))}let PT=null;const TT=()=>PT??(PT=ml(()=>import("./index-CyHGDhfc.js"),[])),LT={sh:"bash",yml:"yaml",ts:"typescript",js:"javascript",py:"python"};function MT(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function RT({lang:e,code:t}){const[n,r]=b.useState(`<pre><code>${MT(t)}</code></pre>`);return b.useEffect(()=>{let i=!0;const s=LT[e]??e;return TT().then(async l=>{const o=await l.codeToHtml(t,{lang:s in l.bundledLanguages?s:"text",themes:{light:"solarized-light",dark:"dark-plus"},defaultColor:!1});i&&r(o)}).catch(()=>{}),()=>{i=!1}},[e,t]),a.jsx("div",{dangerouslySetInnerHTML:{__html:n}})}const zT={background:"#fdf6e3",mainBkg:"#eee8d5",primaryColor:"#eee8d5",primaryTextColor:"#586e75",primaryBorderColor:"#268bd2",nodeBorder:"#268bd2",lineColor:"#839496",secondaryColor:"#eee8d5",tertiaryColor:"#eee8d5",textColor:"#586e75",edgeLabelBackground:"#fdf6e3",clusterBkg:"#eee8d5",clusterBorder:"#ddd6c1",fontSize:"14px"},AT={background:"#1f1f1f",mainBkg:"#2a2d2e",primaryColor:"#2a2d2e",primaryTextColor:"#cccccc",primaryBorderColor:"#3794ff",nodeBorder:"#3794ff",lineColor:"#9d9d9d",secondaryColor:"#2a2d2e",tertiaryColor:"#2a2d2e",textColor:"#cccccc",edgeLabelBackground:"#1f1f1f",clusterBkg:"#2a2d2e",clusterBorder:"#2b2b2b",fontSize:"14px"};let IT=null;const FT=()=>IT??(IT=ml(()=>import("./mermaid.core-27sLJoRM.js").then(e=>e.b6),[]).then(e=>e.default));function DT({code:e}){const t=b.useId().replace(/[^a-zA-Z0-9]/g,""),n=hk(),[r,i]=b.useState(""),[s,l]=b.useState(!1);b.useEffect(()=>{let c=!0;return FT().then(async d=>{d.initialize({startOnLoad:!1,theme:"base",securityLevel:"strict",fontFamily:"system-ui, -apple-system, Segoe UI, Ubuntu, sans-serif",themeVariables:n?AT:zT,flowchart:{useMaxWidth:!0,curve:"basis",nodeSpacing:30,rankSpacing:40,padding:8,htmlLabels:!0}});try{const h=await d.render(`m${t}${n?"d":"l"}`,e);c&&(i(h.svg),l(!1))}catch{c&&l(!0)}}),()=>{c=!1}},[e,n,t]);const[o,u]=b.useState(!1);return b.useEffect(()=>{if(!o)return;const c=d=>{d.key==="Escape"&&u(!1)};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[o]),s?a.jsx("pre",{children:e}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"relative my-6",children:[a.jsx("div",{className:"md-figure flex cursor-zoom-in justify-center rounded-md border border-line bg-panel p-4",title:"Click to enlarge",onClick:()=>u(!0),dangerouslySetInnerHTML:{__html:r}}),a.jsx("span",{className:"pointer-events-none absolute right-3 top-2 text-[11px] text-muted",children:"click to enlarge"})]}),o&&a.jsx("div",{className:"fixed inset-0 z-50 grid cursor-zoom-out place-items-center bg-ink/40 p-6 backdrop-blur-sm",onClick:()=>u(!1),children:a.jsx("div",{className:"md-figure-big max-h-full max-w-full overflow-auto rounded-md border border-line bg-panel p-6",onClick:c=>c.stopPropagation(),dangerouslySetInnerHTML:{__html:r}})})]})}function Rw(e){return e.split(/(```[\s\S]*?```|`[^`\n]*`)/g).map((t,n)=>n%2?t:t.replace(/ -> /g," → ")).join("")}const zw=[ET],Aw=b.createContext(void 0),OT={code({className:e,children:t,...n}){var i;const r=(i=/language-(\w+)/.exec(e??""))==null?void 0:i[1];return r==="mermaid"?a.jsx(DT,{code:String(t).trim()}):r?a.jsx(RT,{lang:r,code:String(t).replace(/\n$/,"")}):a.jsx("code",{className:e,...n,children:t})},pre({children:e}){var r;const t=Array.isArray(e)?e[0]:e;return(((r=t==null?void 0:t.props)==null?void 0:r.className)??"").includes("language-")?a.jsx(a.Fragment,{children:e}):a.jsx("pre",{children:e})},a:function({href:t,children:n}){const r=b.useContext(Aw),i=r&&/^codeline:(\d+)-(\d+)$/.exec(t??"");return i?a.jsx("button",{type:"button",className:"codeline",onClick:()=>r(Number(i[1]),Number(i[2])),children:n}):a.jsx("a",{href:t,target:"_blank",rel:"noreferrer",children:n})}},_T=e=>e,es=b.memo(function({children:t,className:n,onLineClick:r}){const i=b.useMemo(()=>Rw(t),[t]);return a.jsx("div",{className:n?`prose-g ${n}`:"prose-g",children:a.jsx(Aw.Provider,{value:r,children:a.jsx(aw,{remarkPlugins:zw,urlTransform:r?_T:void 0,components:OT,children:i})})})}),$T={p:({children:e})=>a.jsxs(a.Fragment,{children:[e," "]}),a:({href:e,children:t})=>a.jsx("a",{href:e,target:"_blank",rel:"noreferrer",children:t})},cr=b.memo(function({children:t,className:n}){const r=b.useMemo(()=>Rw(t),[t]);return a.jsx("span",{className:n?`md-inline ${n}`:"md-inline",children:a.jsx(aw,{remarkPlugins:zw,components:$T,children:r})})});function qT({trace:e,onStep:t}){const{rel:n}=it(),[r,i]=b.useState(0),s=e.steps[r],l=r>0?e.steps[r-1].state:{};b.useEffect(()=>{t(s.file,s.line)},[r]);const o=[...new Set([...Object.keys(l),...Object.keys(s.state)])];return a.jsxs("div",{className:"card overflow-hidden",tabIndex:0,onKeyDown:u=>{u.key==="ArrowRight"&&i(c=>Math.min(e.steps.length-1,c+1)),u.key==="ArrowLeft"&&i(c=>Math.max(0,c-1))},children:[a.jsxs("div",{className:"flex items-center gap-2 border-b border-line bg-raised/60 px-4 py-2 text-xs",children:[a.jsx(p2,{className:"h-3.5 w-3.5 text-accent"}),a.jsx("span",{className:"text-muted",children:"Input"}),a.jsx("code",{className:"font-mono",children:e.input})]}),a.jsxs("div",{className:"flex items-center gap-2 px-4 py-3",children:[a.jsx("button",{className:"rounded-md border border-line p-1 hover:bg-raised disabled:opacity-40",disabled:r===0,onClick:()=>i(r-1),"aria-label":"Previous step",children:a.jsx(xu,{className:"h-4 w-4"})}),a.jsx("input",{type:"range",min:0,max:e.steps.length-1,value:r,onChange:u=>i(Number(u.target.value)),className:"flex-1 accent-[rgb(var(--accent))]"}),a.jsx("button",{className:"rounded-md border border-line p-1 hover:bg-raised disabled:opacity-40",disabled:r===e.steps.length-1,onClick:()=>i(r+1),"aria-label":"Next step",children:a.jsx(Tr,{className:"h-4 w-4"})}),a.jsxs("span",{className:"w-16 text-right font-mono text-xs text-muted",children:[r+1,"/",e.steps.length]})]}),a.jsxs("div",{className:"px-4 pb-1 text-[14.5px]",children:[s.file&&a.jsxs("span",{className:"mr-2 font-mono text-[12px] text-accent",children:[n(s.file),s.line?`:${s.line}`:""]}),s.note]}),a.jsx("table",{className:"m-4 mt-2 w-[calc(100%-2rem)] text-[13.5px]",children:a.jsx("tbody",{children:o.map(u=>{const c=l[u],d=s.state[u],h=c!==d;return a.jsxs("tr",{className:"border-b border-line/60 last:border-0",children:[a.jsx("td",{className:"py-1 pr-3 font-mono text-muted",children:u}),a.jsxs("td",{className:le("py-1 font-mono",h&&r>0&&"text-accent"),children:[d??a.jsx("span",{className:"text-muted line-through",children:c}),h&&r>0&&c!==void 0&&d!==void 0&&a.jsxs("span",{className:"ml-2 text-[12px] text-muted",children:["was ",c]})]})]},u)})})}),a.jsx("div",{className:"border-t border-line px-4 py-1.5 text-[12px] text-muted",children:"Arrow keys step when this box has focus. Changed values are coloured."})]})}function BT(e){return e.startLine&&e.endLine?[e.startLine,e.endLine]:e.line?[Math.max(1,e.line-3),e.line+6]:null}function Mi({icon:e,children:t,aside:n}){return a.jsxs("div",{className:"mb-5 mt-16 flex items-center gap-3",children:[a.jsxs("h2",{className:"flex items-center gap-2 text-[22px] font-semibold tracking-[-0.015em]",children:[e&&a.jsx("span",{className:"text-muted [&>svg]:h-[18px] [&>svg]:w-[18px]",children:e}),t]}),n&&a.jsx("div",{className:"ml-auto",children:n})]})}function UT(){const{id:e=""}=$r(),{project:t,rel:n,selected:r,setOpenFile:i,setSelected:s}=it(),l=gt(),o=mn(),u=mn(),c=mn(),[d,h]=b.useState(""),[p,f]=b.useState(!0),[m,g]=b.useState(null),[k,y]=b.useState(null),[x,v]=b.useState("all"),[j,E]=b.useState(0),w=ye({queryKey:["lens",t.id,e],queryFn:()=>me(`/projects/${t.id}/lenses/${e}`)}),N=w.data,M=b.useMemo(()=>[...new Set([...(N==null?void 0:N.deepDives)??[],...((N==null?void 0:N.followUps)??[]).flatMap(z=>z.deepDives)].map(z=>z.file).filter(z=>!!z))],[N]),F=Uj({queries:M.map(z=>({queryKey:["file",t.id,z],queryFn:()=>me(`/projects/${t.id}/file?path=${encodeURIComponent(z)}`),staleTime:6e4}))}),C=b.useMemo(()=>new Map(M.map((z,W)=>{var S;return[z,(S=F[W])==null?void 0:S.data]})),[M,F]);if(w.isLoading)return a.jsx("div",{className:"p-8",children:a.jsx(kt,{})});if(!N)return a.jsx(Ft,{title:"Lens not found"});const O=(z,W)=>{z&&g({file:z,line:W})},A=z=>{s([z]),i(z),l(`/p/${t.id}/explore`)},V=r.filter(z=>!N.files.includes(z)),U=()=>c.run(`/projects/${t.id}/lenses/${N.id}/more`,{question:d,files:p?V:[]},()=>{h(""),w.refetch()}),q=N.deepDives,G=x==="all"?q.map((z,W)=>[z,W]):q[j]?[[q[j],j]]:[],X=a.jsx("div",{className:"h-full overflow-auto",children:a.jsxs("article",{className:"lens py-10",children:[a.jsxs(ft,{to:`/p/${t.id}/library`,className:"inline-flex items-center gap-1 text-[13px] text-muted hover:text-ink",children:[a.jsx(Jf,{className:"h-3.5 w-3.5"})," Library"]}),a.jsxs("div",{className:"mt-6 flex flex-wrap items-center gap-2",children:[a.jsxs(be,{tone:"accent",children:[N.kind," lens"]}),N.depth&&N.depth!=="standard"&&a.jsx(be,{children:N.depth}),N.diff&&a.jsxs(be,{tone:"warn",children:["change ",N.diff.base,"..",N.diff.head||"working tree"]}),a.jsx("span",{className:"text-[13px] text-muted",children:Tt(N.createdAt)}),a.jsxs("a",{href:`/api/projects/${t.id}/lenses/${N.id}/export`,className:"ml-auto inline-flex items-center gap-1 rounded-md px-2 py-1 text-[13px] text-muted hover:bg-raised hover:text-ink",title:"Download as markdown",children:[a.jsx(tp,{className:"h-3.5 w-3.5"})," .md"]})]}),a.jsx("h1",{className:"mt-4 text-[36px] font-bold leading-[1.1] tracking-[-0.02em]",children:N.title}),a.jsx("p",{className:"mt-3 text-[16.5px] leading-relaxed text-muted",children:N.question}),a.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[N.files.slice(0,6).map(z=>a.jsxs("button",{onClick:()=>O(z),title:n(z),className:"inline-flex max-w-full items-center gap-1 rounded-md bg-ink/5 px-2 py-1 font-mono text-[12px] text-muted hover:text-accent",children:[a.jsx(os,{className:"h-3 w-3 shrink-0"})," ",a.jsx("span",{className:"truncate",children:fr(n(z),64)})]},z)),N.files.length>6&&a.jsxs("span",{className:"px-1 py-1 text-[12px] text-muted",children:["+",N.files.length-6," more"]})]}),N.changed.length>0&&a.jsxs("div",{className:"mt-6 flex items-center gap-3 rounded-md border border-warn/40 bg-warn/8 px-4 py-3 text-[14px]",children:[a.jsx(a2,{className:"h-4 w-4 shrink-0 text-warn"}),a.jsxs("div",{className:"min-w-0 flex-1",children:["The code changed since this lens was made (",N.changed.map(z=>n(z)).join(", "),"). It may be out of date."]}),a.jsx(ee,{size:"sm",icon:a.jsx(m2,{className:"h-3.5 w-3.5"}),disabled:u.busy,onClick:()=>u.run(`/projects/${t.id}/lenses/${N.id}/refresh`,{},z=>l(`/p/${t.id}/lens/${z.resultId}`,{replace:!0})),children:"Refresh"})]}),u.busy&&u.job&&a.jsx("div",{className:"mt-3",children:a.jsx(sn,{kind:"lens",elapsed:u.elapsed})}),u.error&&a.jsx("div",{className:"mt-3",children:a.jsx(Ke,{error:u.error,onClose:u.clearError})}),a.jsxs("div",{className:"mt-10 border-l-[3px] border-accent py-1 pl-5",children:[a.jsx("div",{className:"text-[11.5px] font-semibold uppercase tracking-[0.08em] text-accent",children:"The idea in one sentence"}),a.jsx("p",{className:"read-lead mt-2",children:a.jsx(cr,{children:N.tldr||N.summary})})]}),N.whyItMatters&&a.jsxs("p",{className:"read mt-6",children:[a.jsx("strong",{children:"Why it matters."})," ",a.jsx(cr,{children:N.whyItMatters})]}),N.tldr&&N.summary&&a.jsx("div",{className:"mt-5",children:a.jsx(es,{children:N.summary})}),N.sketch&&a.jsxs("div",{className:"mt-8 rounded-md bg-raised/70 p-6",children:[a.jsxs("div",{className:"flex items-center gap-2 text-[15px] font-semibold",children:[a.jsx(V1,{className:"h-4 w-4 text-accent"})," ",N.diff?"Your prediction":"Your take",", and where it differs"]}),a.jsxs("p",{className:"read mt-3 italic text-muted",children:["“",N.sketch,"”"]}),N.differences&&N.differences.length>0&&a.jsx("ul",{className:"read mt-4 space-y-2",children:N.differences.map((z,W)=>a.jsxs("li",{className:"flex gap-2.5",children:[a.jsx("span",{className:"mt-0.5 text-accent",children:"→"}),a.jsx("span",{children:a.jsx(cr,{children:z})})]},W))})]}),N.concepts.length>0&&a.jsxs(a.Fragment,{children:[a.jsx(Mi,{icon:a.jsx(Zf,{className:"h-5 w-5"}),children:"Words you need first"}),a.jsx("div",{className:"wide lens-concepts grid gap-5",children:N.concepts.map(z=>a.jsx(HT,{c:z,onShow:()=>O(z.file,z.line),onCard:()=>y({kind:"concept",front:`What is "${z.term}" in this code, and why does it matter?`,back:z.explain,file:z.file??N.files[0],source:{lensId:N.id}})},z.term))})]}),N.trace&&a.jsxs(a.Fragment,{children:[a.jsx(Mi,{children:"Trace a run"}),a.jsx("div",{className:"wide",children:a.jsx(qT,{trace:N.trace,onStep:(z,W)=>O(z??N.files[0],W)})})]}),N.intuition&&a.jsxs(a.Fragment,{children:[a.jsx(Mi,{icon:a.jsx(ip,{className:"h-5 w-5"}),children:"The intuition"}),a.jsx(es,{children:N.intuition})]}),q.length>0&&a.jsxs(a.Fragment,{children:[a.jsxs(Mi,{aside:a.jsx(Zt,{value:x,onChange:z=>{v(z),E(0)},options:[{value:"all",label:"All steps"},{value:"step",label:"One at a time"}]}),children:["Walkthrough ",a.jsxs("span",{className:"text-[15px] font-normal text-muted",children:["· ",q.length," steps"]})]}),x==="step"&&a.jsx("div",{className:"mb-6 flex items-center gap-1.5",children:q.map((z,W)=>a.jsx("button",{title:z.title,onClick:()=>E(W),className:le("h-1.5 flex-1 rounded-full transition",W<j?"bg-accent/50":W===j?"bg-accent":"bg-line")},W))}),a.jsx("ol",{className:"space-y-12 [&>li+li]:border-t [&>li+li]:border-line [&>li+li]:pt-10",children:G.map(([z,W])=>a.jsx(Rx,{d:z,n:W+1,text:z.file?C.get(z.file):void 0,rel:n,onShow:O},W))}),x==="step"&&a.jsxs("div",{className:"mt-6 flex items-center justify-between",children:[a.jsx(ee,{size:"sm",variant:"ghost",icon:a.jsx(xu,{className:"h-4 w-4"}),disabled:j===0,onClick:()=>E(j-1),children:"Back"}),a.jsxs("span",{className:"text-[13px] text-muted",children:["Step ",j+1," of ",q.length]}),a.jsxs(ee,{size:"sm",variant:j<q.length-1?"primary":"secondary",disabled:j===q.length-1,onClick:()=>E(j+1),children:["Next ",a.jsx(Tr,{className:"h-4 w-4"})]})]})]}),N.gotchas&&N.gotchas.length>0&&a.jsxs(a.Fragment,{children:[a.jsx(Mi,{icon:a.jsx(op,{className:"h-5 w-5"}),children:"Gotchas"}),a.jsx("ul",{className:"read space-y-3",children:N.gotchas.map((z,W)=>a.jsxs("li",{className:"flex gap-3",children:[a.jsx("span",{className:"mt-[0.55em] h-1.5 w-1.5 shrink-0 rounded-full bg-warn"}),a.jsx("span",{children:a.jsx(cr,{children:z})})]},W))})]}),N.nextSteps&&N.nextSteps.length>0&&a.jsxs(a.Fragment,{children:[a.jsx(Mi,{icon:a.jsx(Hu,{className:"h-5 w-5"}),children:"Read next"}),a.jsx("div",{className:"space-y-2",children:N.nextSteps.map(z=>a.jsxs("button",{onClick:()=>A(z.file),className:"card flex w-full items-start gap-3 px-4 py-3 text-left transition hover:border-accent/40",children:[a.jsx(os,{className:"mt-1 h-4 w-4 shrink-0 text-accent"}),a.jsxs("span",{className:"min-w-0",children:[a.jsx("span",{className:"block font-mono text-[13px]",children:n(z.file)}),a.jsx("span",{className:"read block text-muted",children:a.jsx(cr,{children:z.why})})]})]},z.file))})]}),(N.followUps??[]).length>0&&a.jsxs(a.Fragment,{children:[a.jsx(Mi,{icon:a.jsx(n2,{className:"h-5 w-5"}),children:"Follow-ups"}),a.jsx("div",{className:"space-y-14",children:N.followUps.map((z,W)=>a.jsxs("div",{children:[a.jsxs("div",{className:"border-l-[3px] border-accent/60 py-1 pl-5",children:[a.jsxs("div",{className:"text-[11.5px] font-semibold uppercase tracking-[0.08em] text-accent",children:["You asked · ",Tt(z.at)]}),a.jsx("p",{className:"read mt-1 font-medium",children:z.question}),z.files.length>0&&a.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:z.files.map(S=>a.jsxs("button",{onClick:()=>O(S),title:n(S),className:"inline-flex max-w-full items-center gap-1 rounded-md bg-ink/5 px-2 py-0.5 font-mono text-[11.5px] text-muted hover:text-accent",children:["+ ",a.jsx("span",{className:"truncate",children:fr(n(S),64)})]},S))})]}),a.jsx("div",{className:"mt-5",children:a.jsx(es,{children:z.answer})}),z.deepDives.length>0&&a.jsx("ol",{className:"mt-10 space-y-12 [&>li+li]:border-t [&>li+li]:border-line [&>li+li]:pt-10",children:z.deepDives.map((S,D)=>a.jsx(Rx,{d:S,n:D+1,text:S.file?C.get(S.file):void 0,rel:n,onShow:O},D))})]},W))})]}),a.jsxs("section",{className:"mt-16 rounded-md border border-line p-6",children:[a.jsxs("div",{className:"flex items-center gap-2 text-[17px] font-semibold",children:[a.jsx(ag,{className:"h-4 w-4 text-accent"})," Ask more about this"]}),a.jsx("p",{className:"read mt-1 text-muted",children:"The answer is added to this lens, not a new one. New terms and gotchas join the lists above."}),a.jsx("textarea",{className:"input mt-4 min-h-[84px] resize-y text-[14px]",placeholder:"e.g. How would this change if the caller were an IAM user instead of a role? Ctrl+Enter to send.",value:d,onChange:z=>h(z.target.value),onKeyDown:z=>{z.key==="Enter"&&(z.ctrlKey||z.metaKey)&&d.trim()&&!c.busy&&U()}}),V.length>0&&a.jsxs("label",{className:"mt-2 flex cursor-pointer items-center gap-2 text-[13px] text-muted",children:[a.jsx("input",{type:"checkbox",checked:p,onChange:z=>f(z.target.checked)}),"Also use ",V.length===1?fr(n(V[0]),48):`the ${V.length} ticked files`," as context"]}),a.jsxs("div",{className:"mt-3 flex items-center gap-3",children:[a.jsx(ee,{variant:"primary",icon:a.jsx(ag,{className:"h-4 w-4"}),disabled:c.busy||!d.trim(),onClick:U,children:"Add to lens"}),V.length===0&&a.jsx("span",{className:"text-[12.5px] text-muted",children:"Tick files in Explore to add them as extra context."})]}),c.busy&&c.job&&a.jsx("div",{className:"mt-3",children:a.jsx(sn,{kind:"lens",elapsed:c.elapsed})}),c.error&&a.jsx("div",{className:"mt-3",children:a.jsx(Ke,{error:c.error,onClose:c.clearError})})]}),a.jsxs("section",{className:"mt-16 rounded-md border border-line bg-raised/40 p-6",children:[a.jsx("div",{className:"text-[17px] font-semibold",children:"Did it land?"}),a.jsx("p",{className:"read mt-1 text-muted",children:"Reading feels like understanding. A quiz on the same files tells you if it is."}),a.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[a.jsx(ee,{variant:"primary",icon:a.jsx($a,{className:"h-4 w-4"}),disabled:o.busy,onClick:()=>o.run(`/projects/${t.id}/quizzes`,{lensId:N.id,files:N.files,diff:N.diff},z=>l(`/p/${t.id}/quiz/${z.resultId}`)),children:"Quiz me on this"}),a.jsx(ee,{variant:"ghost",icon:a.jsx(pr,{className:"h-4 w-4"}),onClick:async()=>{await cs(`/projects/${t.id}/lenses/${N.id}`),l(`/p/${t.id}/library`)},children:"Archive"})]}),o.busy&&o.job&&a.jsx("div",{className:"mt-3",children:a.jsx(sn,{kind:"quiz",elapsed:o.elapsed})}),o.error&&a.jsx("div",{className:"mt-3",children:a.jsx(Ke,{error:o.error,onClose:o.clearError})}),k&&a.jsx(Ha,{initial:k,onClose:()=>y(null)})]})]})});return a.jsx(Kn,{id:"lens-file",collapsible:!0,startCollapsed:!0,openSignal:m,side:"right",initial:520,min:320,max:900,className:"h-full",left:X,right:a.jsx(kl,{file:m==null?void 0:m.file,line:m==null?void 0:m.line,empty:"Click a file, a step or a line link to see the whole file here."})})}function HT({c:e,onShow:t,onCard:n}){var o;const[r,i]=b.useState(!1),s=e.explain.length+(((o=e.example)==null?void 0:o.length)??0)>340,l=u=>a.jsxs(a.Fragment,{children:[a.jsx("p",{className:le("read-sm mt-2",u&&"line-clamp-5"),children:a.jsx(cr,{children:e.explain})}),e.example&&a.jsxs("div",{className:le("read-sm mt-3 rounded-lg bg-raised/70 px-3.5 py-2.5 text-muted",u&&"max-h-[9.5rem] overflow-hidden"),children:[a.jsx("div",{className:"mb-1 text-[11.5px] font-semibold uppercase tracking-[0.08em] text-ink/70",children:"Example"}),a.jsx(WT,{text:e.example})]})]});return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"card group flex flex-col p-5 transition duration-150 hover:-translate-y-0.5 hover:border-accent/40 hover:shadow-soft",children:[a.jsxs("div",{className:"flex items-baseline gap-2",children:[a.jsx("div",{className:"flex-1 text-[16px] font-semibold tracking-tight",children:e.term}),e.file&&a.jsx("button",{className:"rounded bg-raised px-1.5 py-0.5 font-mono text-[11.5px] text-muted hover:text-accent",onClick:t,title:"Show in the code",children:e.line?`line ${e.line}`:"code"}),a.jsx("button",{className:"self-center text-muted opacity-0 transition hover:text-accent group-hover:opacity-100",title:"Make a review card",onClick:n,children:a.jsx(Fr,{className:"h-4 w-4"})}),a.jsx("button",{className:le("self-center text-muted transition hover:text-accent",s?"opacity-100":"opacity-0 group-hover:opacity-100"),title:"Open to read","aria-label":"Open to read",onClick:()=>i(!0),children:a.jsx(d2,{className:"h-4 w-4"})})]}),l(s),s&&a.jsx("button",{className:"mt-2 self-start text-[12.5px] text-accent hover:underline",onClick:()=>i(!0),children:"Read all"})]}),r&&a.jsx(tc,{wide:!0,title:e.term,onClose:()=>i(!1),footer:a.jsxs(a.Fragment,{children:[e.file&&a.jsx(ee,{size:"sm",variant:"ghost",onClick:()=>{i(!1),t()},children:"Show in the code"}),a.jsx(ee,{size:"sm",onClick:()=>{i(!1),n()},children:"Make a review card"})]}),children:a.jsx("div",{className:"[&_.read-sm]:!text-[16px] [&_.read-sm]:!leading-[1.65]",children:l(!1)})})]})}function WT({text:e}){const t=e.split(/(`[^`]{36,}`)/g).filter(n=>n.replace(/[\s.,;:]+/g,""));return a.jsx(a.Fragment,{children:t.map((n,r)=>/^`[^`]{36,}`$/.test(n)?a.jsx("pre",{className:"my-2 whitespace-pre-wrap break-words rounded-md border border-line/70 bg-panel px-3 py-2 font-mono text-[12.5px] leading-[1.6] text-ink",children:n.slice(1,-1)},r):a.jsx("p",{children:a.jsx(cr,{children:n})},r))})}function VT(e){return e.split("/").slice(-2).join("/")}function QT(e,t,n){const r=s=>{var l;return((l=/^\s*/.exec(s))==null?void 0:l[0].length)??0},i=r(e[n-1]??"");for(let s=t;s>=Math.max(1,t-25);s--){const l=e[s-1]??"";if(!l.trim())continue;if(/^\s*(def |async def |class |@|function |export |const |func |fn |pub |public |private )/.test(l)&&r(l)<=i||r(l)===0)return s}return t}function Rx({d:e,n:t,text:n,rel:r,onShow:i}){const[s,l]=b.useState(!1),o=BT(e),u=b.useMemo(()=>{if(!n||!o)return null;const d=n.text.split(`
505
+ `),h=Math.min(o[1],d.length),p=QT(d,Math.min(o[0],d.length),e.line??o[0]),f=d.slice(p-1,h),m=Math.min(...f.filter(k=>k.trim()).map(k=>{var y;return((y=/^\s*/.exec(k))==null?void 0:y[0].length)??0})),g=f.map(k=>k.slice(Number.isFinite(m)?m:0)).join(`
506
+ `);return{first:p,last:h,body:g}},[n,o==null?void 0:o[0],o==null?void 0:o[1],e.line]),c=b.useMemo(()=>e.line?[{from:e.line,to:e.line,cls:"hl"}]:[],[e.line]);return a.jsxs("li",{className:"lens-step",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex items-baseline gap-3",children:[a.jsx("span",{className:"font-mono text-[13px] font-semibold tabular-nums text-accent/80",children:String(t).padStart(2,"0")}),a.jsx("h3",{className:"text-[18px] font-semibold leading-[1.3] tracking-tight",children:e.title})]}),a.jsx("div",{className:"mt-3",children:a.jsx(es,{children:e.body})})]}),u&&e.file&&a.jsxs("div",{className:"min-w-0 overflow-hidden rounded-md border border-line bg-panel",children:[a.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-line bg-raised/60 px-3 py-1.5 font-mono text-[12px] text-muted",children:[a.jsxs("span",{className:"truncate",title:r(e.file),children:[VT(r(e.file)),":",u.first,"–",u.last]}),a.jsx("button",{className:"shrink-0 font-sans hover:text-accent",onClick:()=>i(e.file,e.line),children:"open file"})]}),a.jsx("div",{className:"lens-step-code",children:a.jsx(Wa,{text:u.body,lang:n.lang,firstLine:u.first,marks:c,onLineClick:d=>i(e.file,d)})})]}),e.pitfall&&a.jsxs("p",{className:"read-sm flex gap-2.5 rounded-r-lg border-l-[3px] border-warn bg-warn/5 px-4 py-3",children:[a.jsx(op,{className:"mt-[0.25em] h-4 w-4 shrink-0 text-warn"}),a.jsxs("span",{children:[a.jsx("strong",{children:"Pitfall."})," ",a.jsx(cr,{children:e.pitfall})]})]}),e.check&&a.jsxs("div",{className:"read-sm rounded-r-lg border-l-[3px] border-accent bg-accent/5 px-4 py-3",children:[a.jsxs("p",{children:[a.jsx("strong",{className:"text-accent",children:"Check yourself."})," ",a.jsx(cr,{children:e.check.q})]}),s?a.jsx("p",{className:"mt-3 border-t border-line/70 pt-3 text-ink/85",children:a.jsx(cr,{children:e.check.a})}):a.jsxs("button",{className:"mt-2 inline-flex items-center gap-1.5 font-sans text-[13px] text-muted hover:text-ink",onClick:()=>l(!0),children:[a.jsx(O1,{className:"h-3.5 w-3.5"})," Think first, then show the answer"]})]})]})}function KT(){const{id:e=""}=$r(),{project:t,rel:n}=it(),r=gt(),i=mn(),s=ye({queryKey:["quiz",t.id,e],queryFn:()=>me(`/projects/${t.id}/quizzes/${e}`)}),[l,o]=b.useState({}),[u,c]=b.useState(!1),[d,h]=b.useState(null),[p,f]=b.useState(null),[m,g]=b.useState(null),k=mn(),y=ye({queryKey:["file",t.id,p==null?void 0:p.file],queryFn:()=>me(`/projects/${t.id}/file?path=${encodeURIComponent(p.file)}`),enabled:!!p}),x=s.data,v=(x==null?void 0:x.attempts)??[],j=v[v.length-1],E=u?void 0:d!==null?v[d]:j,w=`cognitune.quiz.${e}`;b.useEffect(()=>{try{const A=sessionStorage.getItem(w);A&&o(JSON.parse(A))}catch{}},[w]),b.useEffect(()=>{try{sessionStorage.setItem(w,JSON.stringify(l))}catch{}},[w,l]);const N=b.useMemo(()=>Object.values(l).filter(A=>A.answer.trim()).length,[l]);if(s.isLoading)return a.jsx("div",{className:"p-8",children:a.jsx(kt,{})});if(!x)return a.jsx(Ft,{title:"Quiz not found"});const M=(A,V)=>o(U=>({...U,[A]:{...U[A]??{qid:A,answer:"",sure:!1},...V}})),F=()=>i.run(`/projects/${t.id}/quizzes/${x.id}/attempts`,{answers:Object.values(l)},()=>{c(!1),h(null),o({});try{sessionStorage.removeItem(w)}catch{}}),C=E?E.grades.filter(A=>{var V;return A.verdict==="wrong"&&((V=E.answers.find(U=>U.qid===A.qid))==null?void 0:V.sure)}).length:0,O=a.jsx("div",{className:"h-full overflow-auto",children:a.jsxs("div",{className:"page",children:[a.jsxs(ft,{to:`/p/${t.id}/library`,className:"inline-flex items-center gap-1 text-xs text-muted hover:text-ink",children:[a.jsx(Jf,{className:"h-3.5 w-3.5"})," Library"]}),a.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[a.jsx(be,{tone:"accent",children:"quiz"}),x.diff&&a.jsx(be,{tone:"warn",children:"change"}),x.questions.some(A=>A.misconceptionId)&&a.jsxs(be,{tone:"bad",children:[a.jsx(Ji,{className:"h-3 w-3"})," weak spots"]}),a.jsxs("a",{href:`/api/projects/${t.id}/quizzes/${x.id}/export`,className:"ml-auto inline-flex items-center gap-1 rounded-md px-2 py-0.5 text-xs text-muted hover:bg-raised hover:text-ink",title:"Download as markdown",children:[a.jsx(tp,{className:"h-3.5 w-3.5"})," .md"]}),a.jsxs("span",{className:"text-xs text-muted",children:[x.questions.length," questions · ",Tt(x.createdAt)]})]}),a.jsx("h1",{className:"mt-2 text-[20px] font-semibold leading-tight tracking-tight",children:x.title}),a.jsxs("div",{className:"mt-3 flex flex-wrap gap-1.5",children:[x.files.slice(0,6).map(A=>a.jsxs("button",{onClick:()=>f({file:A}),title:n(A),className:"inline-flex max-w-full items-center gap-1 rounded-md bg-raised px-2 py-1 font-mono text-[12px] hover:text-accent",children:[a.jsx(os,{className:"h-3 w-3 shrink-0"})," ",a.jsx("span",{className:"truncate",children:fr(n(A),64)})]},A)),x.files.length>6&&a.jsxs("span",{className:"px-1 py-1 text-[12px] text-muted",children:["+",x.files.length-6," more"]})]}),E&&a.jsxs("div",{className:"card mt-6 flex flex-wrap items-center gap-4 p-4",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-xs uppercase tracking-wide text-muted",children:"Score"}),a.jsx("div",{className:"text-3xl",children:a.jsx(Ca,{score:E.score})})]}),a.jsxs("div",{className:"text-sm text-muted",children:[E.grades.filter(A=>A.verdict==="right").length," right · ",E.grades.filter(A=>A.verdict==="partial").length," partial ·"," ",E.grades.filter(A=>A.verdict==="wrong").length," wrong",C>0&&a.jsxs("div",{className:"text-bad",children:[C," wrong while sure: the best ones to look at."]})]}),v.length>1&&a.jsx("div",{className:"ml-auto",children:a.jsx(Zt,{value:d??v.length-1,onChange:A=>h(A),options:v.map((A,V)=>({value:V,label:`#${V+1}`,title:`${Math.round(A.score*100)}% · ${Tt(A.at)}`}))})})]}),a.jsx("ol",{className:"mt-6 space-y-4",children:x.questions.map((A,V)=>{const U=E==null?void 0:E.grades.find(X=>X.qid===A.id),q=E==null?void 0:E.answers.find(X=>X.qid===A.id),G=l[A.id];return a.jsxs("li",{className:le("card p-5",U&&(U.verdict==="right"?"border-good/30":U.verdict==="partial"?"border-warn/30":"border-bad/30")),children:[a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx("span",{className:"grid h-7 w-7 shrink-0 place-items-center rounded-full bg-accent/10 text-sm font-semibold text-accent",children:V+1}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("div",{className:"text-[16px] font-medium leading-snug",children:A.prompt}),A.file&&a.jsxs("button",{className:"mt-1 font-mono text-[12px] text-muted hover:text-accent",onClick:()=>f({file:A.file,line:A.line}),children:[n(A.file),A.line?`:${A.line}`:""]})]}),U&&a.jsx(f0,{v:U.verdict})]}),E?a.jsxs("div",{className:"mt-4 space-y-3 pl-10",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"label flex items-center gap-2",children:["Your answer ",q!=null&&q.sure?a.jsx(be,{tone:"accent",children:"sure"}):a.jsx(be,{children:"guess"})]}),a.jsx("div",{className:"whitespace-pre-wrap rounded-lg bg-raised px-3 py-2 text-sm",children:(q==null?void 0:q.answer)||a.jsx("span",{className:"text-muted",children:"(no answer)"})})]}),(U==null?void 0:U.feedback)&&a.jsx("p",{className:"reading",children:U.feedback}),(U==null?void 0:U.modelAnswer)&&a.jsxs("div",{className:"reading rounded-lg border border-line px-4 py-3",children:[a.jsx("span",{className:"font-sans text-sm font-medium text-muted",children:"A good answer: "}),U.modelAnswer]}),(U==null?void 0:U.misconception)&&a.jsxs("div",{className:"flex gap-2 rounded-lg border border-bad/25 bg-bad/5 px-3 py-2 text-[14px]",children:[a.jsx(Ji,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-bad"}),a.jsxs("span",{children:[a.jsx("span",{className:"font-medium",children:"Saved as a weak spot: "}),U.misconception]})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[A.focus&&a.jsxs("span",{className:"text-xs text-muted",children:["Tests: ",A.focus]}),U&&U.verdict!=="right"&&a.jsxs("span",{className:"ml-auto flex gap-1",children:[a.jsx(ee,{size:"sm",variant:"ghost",icon:a.jsx(Gu,{className:"h-3.5 w-3.5"}),disabled:k.busy,onClick:()=>k.run(`/projects/${t.id}/threads`,{files:x.files,text:`I got this quiz question ${U.verdict}:
507
+
508
+ "${A.prompt}"
509
+
510
+ My answer was: ${(q==null?void 0:q.answer)||"(none)"}
511
+
512
+ Help me see what I missed, without just telling me.`},X=>r(`/p/${t.id}/tutor/${X.resultId}`)),children:"Ask the tutor"}),a.jsx(ee,{size:"sm",variant:"ghost",icon:a.jsx(Fr,{className:"h-3.5 w-3.5"}),onClick:()=>g({kind:"miss",front:A.prompt,back:U.modelAnswer,file:A.file,line:A.line,source:{quizId:x.id,qid:A.id}}),children:"Card"})]})]})]}):a.jsxs("div",{className:"mt-4 pl-10",children:[a.jsx("textarea",{className:"input min-h-[88px] resize-y",placeholder:"Your answer, in your own words",value:(G==null?void 0:G.answer)??"",onChange:X=>M(A.id,{answer:X.target.value})}),a.jsx("div",{className:"mt-2 flex items-center gap-2",children:a.jsx(Zt,{value:G!=null&&G.sure?"sure":"guess",onChange:X=>M(A.id,{sure:X==="sure"}),options:[{value:"guess",label:a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(F1,{className:"h-3.5 w-3.5"}),"Guess"]})},{value:"sure",label:a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(vl,{className:"h-3.5 w-3.5"}),"Sure"]})}]})})]})]},A.id)})}),a.jsxs("div",{className:"mt-6 flex flex-wrap items-center gap-2",children:[E?a.jsx(ee,{variant:"primary",icon:a.jsx(sp,{className:"h-4 w-4"}),onClick:()=>c(!0),children:"Try again"}):a.jsxs(a.Fragment,{children:[a.jsxs(ee,{variant:"primary",icon:a.jsx(K1,{className:"h-4 w-4"}),loading:i.busy,disabled:N===0,onClick:F,children:["Grade my answers (",N,"/",x.questions.length,")"]}),u&&a.jsx(ee,{variant:"ghost",onClick:()=>c(!1),children:"Cancel"})]}),a.jsx(ee,{variant:"ghost",className:"ml-auto",icon:a.jsx(pr,{className:"h-4 w-4"}),onClick:async()=>{await cs(`/projects/${t.id}/quizzes/${x.id}`),r(`/p/${t.id}/library`)},children:"Archive"})]}),i.busy&&i.job&&a.jsx("div",{className:"mt-3",children:a.jsx(sn,{kind:"grade",elapsed:i.elapsed})}),k.busy&&k.job&&a.jsx("div",{className:"mt-3",children:a.jsx(sn,{kind:"tutor",elapsed:k.elapsed})}),k.error&&a.jsx("div",{className:"mt-3",children:a.jsx(Ke,{error:k.error,onClose:k.clearError})}),m&&a.jsx(Ha,{initial:m,onClose:()=>g(null)}),i.error&&a.jsx("div",{className:"mt-3",children:a.jsx(Ke,{error:i.error,onClose:i.clearError})})]})});return p?a.jsx(Kn,{id:"quiz-code",side:"right",initial:480,min:300,max:900,className:"h-full",left:O,right:a.jsxs("div",{className:"flex h-full flex-col bg-panel",children:[a.jsxs("div",{className:"flex items-center border-b border-line px-4 py-2 font-mono text-[13px] text-muted",children:[a.jsxs("span",{className:"flex-1 truncate",children:[n(p.file),p.line?`:${p.line}`:""]}),a.jsx("button",{className:"text-xs hover:text-ink",onClick:()=>f(null),children:"close"})]}),a.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:y.data&&a.jsx(Wa,{text:y.data.text,lang:y.data.lang,focusLine:p.line})})]})}):O}const GT=()=>({new:0,seen:0,understood:0,fading:0,stale:0}),qi=e=>e.total-e.counts.new,Sr=(e,t)=>t.startsWith(e.endsWith("/")?e:`${e}/`);function Vh(e,t,n,r){const i=t.filter(u=>Sr(e,u)),s=r.filter(u=>Sr(e,u.path)),l=new Map;for(const u of i){const c=s.find(g=>Sr(g.path,u)),d=u.slice(e.length+1),h=d.indexOf("/"),p=c?c.path:h<0?u:`${e}/${d.slice(0,h)}`;let f=l.get(p);f||(f={path:p,label:p.slice(e.length+1),kind:c?"repo":p===u?"file":"dir",total:0,counts:GT(),lastRetrieval:null},l.set(p,f));const m=n.get(u);f.total++,f.counts[(m==null?void 0:m.level)??"new"]++,m!=null&&m.lastRetrieval&&(!f.lastRetrieval||m.lastRetrieval>f.lastRetrieval)&&(f.lastRetrieval=m.lastRetrieval),f.kind==="file"&&(f.file=m)}const o=[...l.values()];for(const u of o)if(u.kind==="dir")for(;;){const c=Vh(u.path,i,n,[]);if(c.length!==1||c[0].kind!=="dir")break;u.path=c[0].path,u.label=u.path.slice(e.length+1)}return o.sort((u,c)=>(u.kind==="file"?1:0)-(c.kind==="file"?1:0)||qi(c)-qi(u)||u.label.localeCompare(c.label))}const Qh={new:"bg-line/70",seen:"bg-accent/35",understood:"bg-good",fading:"bg-warn/60",stale:"bg-warn"},Eu=["understood","fading","stale","seen","new"];function Kh({counts:e,total:t,className:n}){return a.jsx("div",{className:le("flex h-1.5 overflow-hidden rounded-full bg-line/50",n),children:Eu.map(r=>e[r]>0&&a.jsx("div",{className:Qh[r],style:{width:`${e[r]/Math.max(t,1)*100}%`,minWidth:r==="new"?0:4}},r))})}function YT({repos:e,current:t,onPick:n}){var d;const[r,i]=b.useState(!1),[s,l]=b.useState(""),o=b.useRef(null);b.useEffect(()=>{if(!r)return;const h=p=>{var f;return!((f=o.current)!=null&&f.contains(p.target))&&i(!1)};return window.addEventListener("mousedown",h),()=>window.removeEventListener("mousedown",h)},[r]);const u=e.filter(h=>h.label.toLowerCase().includes(s.toLowerCase())),c=(d=e.find(h=>h.path===t))==null?void 0:d.label;return a.jsxs("div",{ref:o,className:"relative",children:[a.jsxs("button",{onClick:()=>i(h=>!h),className:le("flex items-center gap-1.5 rounded-md px-2 py-1 font-mono text-[13px] transition hover:bg-raised",c?"text-ink":"text-muted"),children:[a.jsx(rp,{className:"h-3.5 w-3.5 text-accent"})," ",c??`all ${e.length} repos`," ",a.jsx(Yj,{className:"h-3.5 w-3.5 text-muted"})]}),r&&a.jsxs("div",{className:"absolute left-0 top-full z-20 mt-1 w-[34rem] rounded-md border border-line bg-panel p-2 shadow-soft",children:[a.jsx("input",{className:"input mb-2",placeholder:"Filter repos",value:s,onChange:h=>l(h.target.value),autoFocus:!0}),a.jsxs("div",{className:"max-h-80 overflow-auto",children:[t&&a.jsx("button",{className:"w-full rounded px-2 py-1.5 text-left text-[13px] text-muted hover:bg-raised",onClick:()=>{n(null),i(!1)},children:"All repos"}),u.map(h=>a.jsxs("button",{onClick:()=>{n(h.path),i(!1)},className:le("grid w-full grid-cols-[1fr_5rem_4.5rem] items-center gap-3 rounded px-2 py-1.5 text-left hover:bg-raised",h.path===t&&"bg-raised"),children:[a.jsx("span",{className:"truncate font-mono text-[12.5px]",children:h.label}),a.jsx(Kh,{counts:h.counts,total:h.total}),a.jsxs("span",{className:"text-right text-[11.5px] tabular-nums text-muted",children:[qi(h)," / ",h.total]})]},h.path))]})]})]})}function XT({root:e,rootLabel:t,scope:n,repos:r,repoRows:i,onScope:s,children:l,className:o}){const u=r.find(p=>p.path===n||Sr(p.path,n))??null,c=u&&u.path!==e?u.path:e,d=(n===c?[]:n.slice(c.length+1).split("/")).map((p,f,m)=>({label:p,path:`${c}/${m.slice(0,f+1).join("/")}`})),h=i.length>0&&!u;return a.jsxs("div",{className:le("flex flex-wrap items-center gap-1 rounded-md border border-line bg-panel px-2 py-1.5",o),children:[a.jsx("button",{onClick:()=>s(null),className:le("rounded-md px-2 py-1 text-[13px] font-medium hover:bg-raised",n===e?"text-ink":"text-muted"),children:t}),i.length>0&&a.jsxs(a.Fragment,{children:[a.jsx(Tr,{className:"h-3.5 w-3.5 text-muted"}),a.jsx(YT,{repos:i,current:(u==null?void 0:u.path)??null,onPick:s})]}),(h?[]:d).map(p=>a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(Tr,{className:"h-3.5 w-3.5 text-muted"}),a.jsx("button",{onClick:()=>s(p.path),className:le("rounded-md px-1.5 py-1 font-mono text-[13px] hover:bg-raised",p.path===n?"text-ink":"text-muted"),children:p.label})]},p.path)),h&&n!==e&&a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(Tr,{className:"h-3.5 w-3.5 text-muted"}),a.jsx("span",{className:"px-1.5 py-1 font-mono text-[13px]",children:n.slice(e.length+1)})]}),l&&a.jsx("div",{className:"ml-auto flex items-center gap-2",children:l})]})}const zx=[{level:"understood",label:"Understood",tone:"good",text:"A check passed (quiz, teach-back 4+, walk, hunt, practice) on the code as it is now."},{level:"fading",label:"Fading",tone:"warn",text:"Understood, but nothing recalled for a while. A quick quiz or card keeps it."},{level:"stale",label:"Stale",tone:"warn",text:"You passed once, then the code changed. Check it again."},{level:"seen",label:"Seen",tone:"muted",text:"Touched by a lens or an activity, no pass yet."}];function Iw(e){return e.flatMap(t=>t.kind==="file"?[t.path]:Iw(t.children??[]))}const JT=e=>e==="understood"?"good":e==="stale"||e==="fading"?"warn":"muted";function ZT({groups:e,levels:t,onOpen:n,label:r}){return a.jsxs("div",{className:"card mt-4 p-4",children:[a.jsx("div",{className:"mb-3 flex flex-wrap gap-3 text-[12px] text-muted",children:Eu.map(i=>a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx("span",{className:le("h-2.5 w-2.5 rounded-sm",Qh[i])}),i==="new"?"not yet":i]},i))}),a.jsx("div",{className:"space-y-2",children:e.map(([i,s])=>a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx("div",{className:"w-56 shrink-0 truncate pt-0.5 text-right font-mono text-[12px] text-muted",title:i,children:i}),a.jsx("div",{className:"flex flex-wrap gap-1",children:s.map(l=>a.jsx("button",{title:`${r(l)} · ${t.get(l)??"not yet"}`,onClick:()=>n(l),className:le("h-3.5 w-3.5 rounded-sm transition hover:scale-125 hover:ring-2 hover:ring-accent/50",Qh[t.get(l)??"new"])},l))})]},i))})]})}function eL(){const{project:e,setOpenFile:t,setSelected:n}=it(),r=gt(),[i,s]=ec(),l=e.root.replace(/\/$/,""),o=(i.get("in")??"").replace(/^\/+|\/+$/g,""),u=o?`${l}/${o}`:l,c=i.get("q")??"",d=i.get("level")??null,h=i.get("view")==="map"?"map":"table",[p,f]=b.useState(!1),m=(D,te=!1)=>{const P=new URLSearchParams(i);for(const[ve,Le]of Object.entries(D))Le?P.set(ve,Le):P.delete(ve);s(P,{replace:te})},g=D=>{f(!1),m({in:D&&D!==l?D.slice(l.length+1):null,q:null})},k=ye({queryKey:["progress",e.id],queryFn:()=>me(`/projects/${e.id}/progress`)}),y=ye({queryKey:["tree",e.id,e.contexts],queryFn:()=>me(`/projects/${e.id}/tree`)}),x=ye({queryKey:["repos",e.id,e.contexts],queryFn:()=>me(`/projects/${e.id}/repos`)}),v=b.useMemo(()=>x.data??[],[x.data]),j=b.useMemo(()=>new Map((k.data??[]).map(D=>[D.path,D])),[k.data]),E=b.useMemo(()=>new Map((k.data??[]).map(D=>[D.path,D.level])),[k.data]),w=b.useMemo(()=>[...new Set([...Iw(y.data??[]),...j.keys()])].filter(D=>Sr(l,D)),[y.data,j,l]),N=b.useMemo(()=>Vh(u,w,j,v),[u,w,j,v]),M=b.useMemo(()=>v.length>1?Vh(l,w,j,v).filter(D=>D.kind==="repo"):[],[v,l,w,j]),F=b.useMemo(()=>(k.data??[]).filter(D=>Sr(u,D.path)||D.path===u),[k.data,u]),C=b.useMemo(()=>Object.fromEntries(zx.map(D=>[D.level,F.filter(te=>te.level===D.level).length])),[F]),O=D=>Sr(u,D)?D.slice(u.length+1):D,A=D=>{t(D),n([D]),r(`/p/${e.id}/explore`)},V=c.toLowerCase().split(/\s+/).filter(Boolean),U=V.length?F.filter(D=>V.every(te=>O(D.path).toLowerCase().includes(te))&&(!d||D.level===d)):[],q=N.filter(D=>d?D.counts[d]>0:qi(D)>0),G=d?[]:N.filter(D=>qi(D)===0),X=b.useMemo(()=>{const D=new Map;for(const te of w){if(!Sr(u,te))continue;const P=N.find(Le=>Le.path===te||Sr(Le.path,te)),ve=P&&P.kind!=="file"?P.label:".";D.set(ve,[...D.get(ve)??[],te])}return[...D].sort((te,P)=>te[0]==="."?-1:P[0]==="."?1:te[0].localeCompare(P[0]))},[w,N,u]),z=N.reduce((D,te)=>D+te.total,0),W=N.reduce((D,te)=>D+qi(te),0),S=({r:D})=>D.kind==="file"?a.jsxs("tr",{className:"cursor-pointer border-b border-line/60 last:border-0 hover:bg-raised",onClick:()=>A(D.path),children:[a.jsx("td",{className:"max-w-0 px-4 py-2",children:a.jsxs("div",{className:"flex items-center gap-2 truncate font-mono text-[13px]",title:D.label,children:[a.jsx(os,{className:"h-3.5 w-3.5 shrink-0 text-muted"})," ",a.jsx("span",{className:"truncate",children:D.label})]})}),a.jsx("td",{className:"px-4 py-2",children:D.file?a.jsx(be,{tone:JT(D.file.level),children:D.file.level}):a.jsx("span",{className:"text-[12px] text-muted",children:"not yet"})}),a.jsx("td",{className:"px-4 py-2 text-right text-[12.5px] text-muted",children:D.file&&a.jsxs("span",{title:"best quiz · lenses · quizzes · other activities",children:[D.file.bestScore!==null&&a.jsxs(a.Fragment,{children:[a.jsx(Ca,{score:D.file.bestScore,size:"sm"})," · "]}),D.file.lenses," lens",D.file.lenses===1?"":"es"," · ",D.file.quizzes," quiz",D.file.quizzes===1?"":"zes",D.file.practices+D.file.other>0&&` · ${D.file.practices+D.file.other} other`]})}),a.jsx("td",{className:"px-4 py-2 text-right text-xs text-muted",children:D.lastRetrieval?Tt(D.lastRetrieval):"-"})]}):a.jsxs("tr",{className:"cursor-pointer border-b border-line/60 last:border-0 hover:bg-raised",onClick:()=>g(D.path),children:[a.jsx("td",{className:"max-w-0 px-4 py-2",children:a.jsxs("div",{className:"flex items-center gap-2 font-mono text-[13px]",title:D.label,children:[D.kind==="repo"?a.jsx(rp,{className:"h-3.5 w-3.5 shrink-0 text-accent"}):a.jsx(np,{className:"h-3.5 w-3.5 shrink-0 text-muted"}),a.jsx("span",{className:"truncate",children:D.label}),a.jsx(Tr,{className:"ml-auto h-3.5 w-3.5 shrink-0 text-muted"})]})}),a.jsx("td",{className:"px-4 py-2",children:a.jsx(Kh,{counts:D.counts,total:D.total,className:"w-32"})}),a.jsxs("td",{className:"whitespace-nowrap px-4 py-2 text-right text-[12.5px] tabular-nums text-muted",children:[Eu.slice(0,3).map(te=>D.counts[te]>0&&a.jsxs("span",{className:le("mr-2",te==="understood"?"text-good":"text-warn"),children:[D.counts[te]," ",te]},te)),a.jsxs("span",{children:[qi(D)," / ",D.total," files"]})]}),a.jsx("td",{className:"px-4 py-2 text-right text-xs text-muted",children:D.lastRetrieval?Tt(D.lastRetrieval):"-"})]});return a.jsx("div",{className:"h-full overflow-auto",children:a.jsxs("div",{className:"mx-auto max-w-5xl px-8 py-8",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Progress"}),a.jsx("p",{className:"text-sm text-muted",children:"Reading feels like understanding. Only a passed check counts here."})]}),a.jsx(Zt,{value:h,onChange:D=>m({view:D==="map"?"map":null}),options:[{value:"table",label:"Table"},{value:"map",label:"Heatmap"}]})]}),a.jsx(XT,{className:"mt-5",root:l,rootLabel:e.name,scope:u,repos:v,repoRows:M,onScope:g,children:a.jsxs("div",{className:"relative w-60",children:[a.jsx(ms,{className:"pointer-events-none absolute left-2.5 top-2 h-3.5 w-3.5 text-muted"}),a.jsx("input",{className:"input h-8 pl-8 pr-7 text-[13px]",placeholder:u===l?"Search touched files":"Search in here",value:c,onChange:D=>m({q:D.target.value||null},!0)}),c&&a.jsx("button",{className:"absolute right-2 top-2 text-muted hover:text-ink",onClick:()=>m({q:null},!0),"aria-label":"Clear search",children:a.jsx(Rn,{className:"h-3.5 w-3.5"})})]})}),a.jsx("div",{className:"mt-4 grid gap-3 sm:grid-cols-4",children:zx.map(D=>a.jsxs("button",{onClick:()=>m({level:d===D.level?null:D.level}),className:le("card p-4 text-left transition hover:border-accent/40",d===D.level&&"ring-2 ring-accent/30"),children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-sm font-medium",children:D.label}),a.jsx(be,{tone:D.tone,children:D.level})]}),a.jsx("div",{className:"mt-2 text-3xl font-semibold tabular-nums",children:C[D.level]??0}),a.jsx("div",{className:"mt-1 text-xs text-muted",children:D.text})]},D.level))}),h==="map"?y.data?a.jsx(ZT,{groups:X,levels:E,onOpen:A,label:O}):null:(k.data??[]).length===0&&!k.isLoading?a.jsx(Ft,{icon:a.jsx(z1,{className:"h-6 w-6"}),title:"Nothing yet",children:"Make a lens or take a quiz in Explore. Files show up here as you go."}):a.jsxs("div",{className:"card mt-4 overflow-hidden",children:[a.jsxs("div",{className:"flex items-center gap-3 border-b border-line px-4 py-2.5 text-sm",children:[V.length?a.jsxs("span",{className:"font-medium",children:[U.length," touched file",U.length===1?"":"s"," match “",c,"”"]}):a.jsxs(a.Fragment,{children:[a.jsxs("span",{className:"font-medium",children:[W," of ",z," files touched"]}),a.jsx(Kh,{counts:N.reduce((D,te)=>(Eu.forEach(P=>D[P]+=te.counts[P]),D),{new:0,seen:0,understood:0,fading:0,stale:0}),total:z,className:"w-40"})]}),d&&a.jsxs("button",{className:"ml-auto flex items-center gap-1 text-xs text-muted hover:text-ink",onClick:()=>m({level:null}),children:["only ",d," ",a.jsx(Rn,{className:"h-3 w-3"})]})]}),a.jsxs("table",{className:"w-full table-fixed text-sm",children:[a.jsxs("colgroup",{children:[a.jsx("col",{}),a.jsx("col",{className:"w-36"}),a.jsx("col",{className:"w-[22rem]"}),a.jsx("col",{className:"w-24"})]}),a.jsxs("tbody",{children:[V.length?U.map(D=>a.jsx(S,{r:{path:D.path,label:O(D.path),kind:"file",total:1,counts:{new:0,seen:0,understood:0,fading:0,stale:0,[D.level]:1},lastRetrieval:D.lastRetrieval,file:D}},D.path)):q.map(D=>a.jsx(S,{r:D},D.path)),!V.length&&q.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:4,className:"px-4 py-6 text-center text-sm text-muted",children:d?`Nothing ${d} in here.`:"Nothing touched in here yet."})}),!V.length&&p&&G.map(D=>a.jsx(S,{r:D},D.path))]})]}),!V.length&&G.length>0&&a.jsxs("button",{className:"w-full border-t border-line px-4 py-2 text-left text-[12.5px] text-muted hover:bg-raised hover:text-ink",onClick:()=>f(D=>!D),children:[p?"Hide":"Show"," ",G.length," untouched ",G.every(D=>D.kind==="file")?"files":"items"]})]})]})})}const tL=[{id:"auto",label:"Auto",text:"Claude Code, then Codex, then Copilot, then API key."},{id:"claude",label:"Claude Code CLI",text:"claude -p with read-only tools. Default."},{id:"codex",label:"Codex CLI",text:"codex exec in the read-only sandbox."},{id:"copilot",label:"GitHub Copilot CLI",text:"copilot -p with only the read tool."},{id:"sdk",label:"Anthropic API key",text:"ANTHROPIC_API_KEY from the environment."},{id:"fake",label:"Demo",text:"Canned answers, no model."}],la=e=>e<1024*1024?`${Math.max(1,Math.round(e/1024))} KB`:`${(e/1024/1024).toFixed(1)} MB`;function nL(){const e=Dt(),t=ye({queryKey:["storage"],queryFn:()=>me("/storage")}),n=vi({mutationFn:()=>Ci("/storage/prune"),onSuccess:i=>e.setQueryData(["storage"],i.usage)});if(!t.data)return null;const r=Math.max(1,...t.data.parts.map(i=>i.bytes));return a.jsxs("div",{className:"card mt-6 p-5",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(o2,{className:"h-4 w-4 text-accent"}),a.jsx("div",{className:"text-sm font-semibold",children:"Storage"}),a.jsx("span",{className:"text-sm text-muted",children:la(t.data.totalBytes)}),a.jsx(ee,{size:"sm",className:"ml-auto shrink-0 whitespace-nowrap",loading:n.isPending,onClick:()=>n.mutate(),children:"Clean up now"})]}),a.jsx("div",{className:"mt-0.5 break-all font-mono text-[12px] text-muted",children:t.data.home}),a.jsx("p",{className:"mt-1 text-xs text-muted",children:"Plain JSON files, one per item. Archived items and forgotten projects are removed after the keep time below, the reply cache keeps to its size, and long lists (quiz attempts, card history, tutor chats, jobs) are capped. Cleanup runs at start and every 6 hours."}),a.jsx("div",{className:"mt-3 space-y-1.5",children:t.data.parts.map(i=>a.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[a.jsx("span",{className:"w-32 shrink-0 capitalize text-muted",children:i.name}),a.jsx("div",{className:"h-1.5 flex-1 overflow-hidden rounded-full bg-raised",children:a.jsx("div",{className:"h-full bg-accent/60",style:{width:`${i.bytes/r*100}%`}})}),a.jsxs("span",{className:"w-28 shrink-0 text-right tabular-nums text-muted",children:[la(i.bytes)," · ",i.files," file",i.files===1?"":"s"]})]},i.name))}),a.jsx("div",{className:"mt-3 text-[12px] text-muted",children:n.data?`Removed ${n.data.removed} item${n.data.removed===1?"":"s"}, freed ${la(n.data.freedBytes)}.`:t.data.lastPrune?`Last cleanup ${Tt(t.data.lastPrune.at)}: removed ${t.data.lastPrune.removed}.`:""}),a.jsx(rL,{})]})}function rL(){const e=Dt(),t=ye({queryKey:["storage-items"],queryFn:()=>me("/storage/items")}),[n,r]=b.useState(!1),[i,s]=b.useState(new Set),[l,o]=b.useState("all"),[u,c]=b.useState(!1),d=vi({mutationFn:()=>Ci("/storage/remove",{ids:[...i]}),onSuccess:x=>{e.setQueryData(["storage"],x.usage),e.invalidateQueries({queryKey:["storage-items"]}),e.invalidateQueries(),s(new Set),c(!1)}}),h=t.data??[],p=[...new Set(h.map(x=>x.group))].sort(),f=l==="all"?h:h.filter(x=>x.group===l),m=h.filter(x=>i.has(x.id)).reduce((x,v)=>x+v.bytes,0),g=f.length>0&&f.every(x=>i.has(x.id)),k=x=>s(v=>{const j=new Set(v);return j.has(x)?j.delete(x):j.add(x),j}),y=()=>s(x=>{const v=new Set(x);for(const j of f)g?v.delete(j.id):v.add(j.id);return v});return a.jsxs("div",{className:"mt-4 border-t border-line pt-4",children:[a.jsx("button",{className:"text-sm font-medium text-accent hover:underline",onClick:()=>r(!n),children:n?"Hide the list":`Choose what to remove (${h.length} items)`}),n&&a.jsxs("div",{className:"mt-3",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsxs("select",{className:"input h-8 w-auto py-0 text-xs",value:l,onChange:x=>o(x.target.value),children:[a.jsx("option",{value:"all",children:"All kinds"}),p.map(x=>a.jsx("option",{value:x,children:x},x))]}),a.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-muted",children:[a.jsx("input",{type:"checkbox",checked:g,onChange:y})," Select all shown"]}),a.jsxs("span",{className:"ml-auto text-xs text-muted",children:[i.size," selected · ",la(m)]}),u?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"text-xs text-bad",children:"This cannot be undone."}),a.jsx(ee,{size:"sm",onClick:()=>c(!1),children:"Cancel"}),a.jsxs(ee,{size:"sm",variant:"danger",loading:d.isPending,onClick:()=>d.mutate(),children:["Remove ",i.size]})]}):a.jsx(ee,{size:"sm",variant:"danger",disabled:!i.size,onClick:()=>c(!0),children:"Remove selected"})]}),a.jsxs("ul",{className:"mt-3 max-h-[26rem] divide-y divide-line/60 overflow-auto rounded-lg border border-line",children:[f.map(x=>a.jsx("li",{children:a.jsxs("label",{className:"flex cursor-pointer items-start gap-3 px-3 py-2 text-sm hover:bg-raised",children:[a.jsx("input",{type:"checkbox",className:"mt-1",checked:i.has(x.id),onChange:()=>k(x.id)}),a.jsxs("span",{className:"min-w-0 flex-1",children:[a.jsx("span",{className:"block truncate",children:x.label}),a.jsxs("span",{className:"block text-[12px] text-muted",children:[x.group,x.project?` · ${x.project}`:""," · ",Tt(x.at)]})]}),a.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted",children:la(x.bytes)})]})},x.id)),!f.length&&a.jsx("li",{className:"px-3 py-6 text-center text-sm text-muted",children:"Nothing here."})]}),d.error&&a.jsx(Ke,{error:d.error.message})]})]})}function iL(){const t=(ye({queryKey:["jobs"],queryFn:()=>me("/jobs")}).data??[]).slice(0,12);if(!t.length)return null;const n=r=>r.endedAt?Math.round((Date.parse(r.endedAt)-Date.parse(r.startedAt))/1e3):null;return a.jsxs("div",{className:"card mt-6 p-5",children:[a.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold",children:[a.jsx(u2,{className:"h-4 w-4 text-accent"})," Recent model calls"]}),a.jsx("table",{className:"mt-3 w-full text-xs",children:a.jsx("tbody",{children:t.map(r=>a.jsxs("tr",{className:"border-b border-line/60 last:border-0",children:[a.jsx("td",{className:"py-1.5 pr-3 font-medium",children:r.kind}),a.jsx("td",{className:le("py-1.5 pr-3",r.status==="failed"?"text-bad":r.status==="running"?"text-accent":"text-good"),children:r.status}),a.jsx("td",{className:"py-1.5 pr-3 tabular-nums text-muted",children:n(r)!==null?`${n(r)} s`:""}),a.jsx("td",{className:"max-w-[320px] truncate py-1.5 pr-3 text-muted",title:r.error,children:r.error??""}),a.jsx("td",{className:"py-1.5 text-right text-muted",children:Tt(r.startedAt)})]},r.id))})})]})}function xt({label:e,hint:t,children:n}){return a.jsxs("div",{className:"grid gap-1.5 py-4 sm:grid-cols-[220px_1fr] sm:gap-6",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-sm font-medium",children:e}),t&&a.jsx("div",{className:"mt-0.5 text-xs text-muted",children:t})]}),a.jsx("div",{children:n})]})}function sL(){var p;const e=Dt(),t=ye({queryKey:["settings"],queryFn:()=>me("/settings")}),[n,r]=b.useState(null),{pref:i,setPref:s}=ly(),{font:l,setFont:o}=fk();b.useEffect(()=>{t.data&&!n&&r(t.data.settings)},[t.data,n]);const u=vi({mutationFn:f=>Eh("/settings",f),onSuccess:f=>{e.setQueryData(["settings"],f),e.invalidateQueries({queryKey:["health"]}),r(f.settings)}});if(!t.data||!n)return null;const c=(f,m)=>r({...n,[f]:m}),d=JSON.stringify(n)!==JSON.stringify(t.data.settings),h=((p=u.data)==null?void 0:p.agent)??t.data.agent;return a.jsx("div",{className:"h-full overflow-auto",children:a.jsxs("div",{className:"mx-auto max-w-5xl px-8 py-10",children:[a.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:"Settings"}),a.jsxs("p",{className:"mt-1 text-sm text-muted",children:["Saved in ",a.jsxs("span",{className:"font-mono",children:[t.data.home,"/settings.json"]})]}),a.jsxs("div",{className:le("card mt-6 flex items-start gap-3 p-4",h.ready?"border-good/30":"border-bad/30"),children:[a.jsx("div",{className:le("grid h-9 w-9 shrink-0 place-items-center rounded-lg",h.ready?"bg-good/12 text-good":"bg-bad/12 text-bad"),children:a.jsx(r2,{className:"h-[18px] w-[18px]"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-sm font-semibold",children:h.ready?`Model ready: ${h.name}`:"No model available"}),a.jsx("div",{className:"text-sm text-muted",children:h.detail})]})]}),a.jsxs("div",{className:"card mt-6 divide-y divide-line px-5",children:[a.jsx(xt,{label:"Theme",children:a.jsx(Zt,{value:i,onChange:s,options:[{value:"system",label:"System"},{value:"light",label:"Light"},{value:"dark",label:"Dark"}]})}),a.jsx(xt,{label:"Reading font",hint:"For lessons, feedback and tutor replies. Buttons and labels stay in the system UI font.",children:a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx(Zt,{value:l,onChange:o,options:[{value:"sans",label:"Sans"},{value:"serif",label:"Serif"}]}),a.jsx("span",{className:"reading text-muted",children:"Read the code, then explain it."})]})}),a.jsx(xt,{label:"Model access",hint:"CLIs use their own saved login, so cognitune never needs or stores a key. Auto picks the first one found.",children:a.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:tL.map(f=>{var k;const m=(k=h.available)==null?void 0:k[f.id],g=n["agent.mode"]===f.id;return a.jsxs("button",{onClick:()=>c("agent.mode",f.id),className:le("rounded-lg border px-3 py-2 text-left transition",g?"border-accent/60 bg-accent/8 ring-1 ring-accent/30":"border-line hover:bg-raised"),children:[a.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[f.label,f.id!=="auto"&&f.id!=="fake"&&a.jsx("span",{className:le("ml-auto shrink-0 whitespace-nowrap rounded-full px-1.5 text-[11.5px]",m?"bg-good/12 text-good":"bg-raised text-muted"),children:m?"found":"not found"})]}),a.jsx("div",{className:"text-xs text-muted",children:f.text})]},f.id)})})}),a.jsx(xt,{label:"Claude",hint:"Command and model for the Claude Code CLI (model also used by the API key mode).",children:a.jsxs("div",{className:"flex gap-2",children:[a.jsx("input",{className:"input w-36 font-mono",value:n["agent.claudeCommand"],onChange:f=>c("agent.claudeCommand",f.target.value)}),a.jsx("input",{className:"input font-mono",placeholder:"CLI default",value:n["agent.model"],onChange:f=>c("agent.model",f.target.value)})]})}),a.jsx(xt,{label:"Planning model",hint:"Plans every lens, quiz, walk, practice, bug hunt and path first (outline, steps, what each must cover). The model above then writes from that plan, in parts. Works with the Claude CLI and the API key; empty = the writer plans too.",children:a.jsx("input",{className:"input font-mono",placeholder:"same as the writer",value:n["agent.planModel"],onChange:f=>c("agent.planModel",f.target.value)})}),a.jsx(xt,{label:"Plan first",hint:"On: plan, then write in parts (slower, much better). Off: one model call per item.",children:a.jsx(Zt,{value:n["generate.plan"]?"on":"off",onChange:f=>c("generate.plan",f==="on"),options:[{value:"on",label:"On"},{value:"off",label:"Off"}]})}),a.jsx(xt,{label:"Codex",hint:"Command and model for the OpenAI Codex CLI. Empty model = its default.",children:a.jsxs("div",{className:"flex gap-2",children:[a.jsx("input",{className:"input w-36 font-mono",value:n["agent.codexCommand"],onChange:f=>c("agent.codexCommand",f.target.value)}),a.jsx("input",{className:"input font-mono",placeholder:"CLI default",value:n["agent.codexModel"],onChange:f=>c("agent.codexModel",f.target.value)})]})}),a.jsx(xt,{label:"Copilot",hint:"Command and model for the GitHub Copilot CLI. Empty model = its default.",children:a.jsxs("div",{className:"flex gap-2",children:[a.jsx("input",{className:"input w-36 font-mono",value:n["agent.copilotCommand"],onChange:f=>c("agent.copilotCommand",f.target.value)}),a.jsx("input",{className:"input font-mono",placeholder:"CLI default",value:n["agent.copilotModel"],onChange:f=>c("agent.copilotModel",f.target.value)})]})}),a.jsx(xt,{label:"Timeout",hint:"Seconds per model call.",children:a.jsx("input",{type:"number",min:30,className:"input w-32",value:n["agent.timeoutSec"],onChange:f=>c("agent.timeoutSec",Number(f.target.value))})}),a.jsx(xt,{label:"Questions per quiz",children:a.jsx("input",{type:"number",min:1,max:10,className:"input w-32",value:n["quiz.questions"],onChange:f=>c("quiz.questions",Number(f.target.value))})}),a.jsx(xt,{label:"Pass mark",hint:"Share of points to count a file as understood (partial = half).",children:a.jsx("input",{type:"number",min:.1,max:1,step:.01,className:"input w-32",value:n["quiz.passMark"],onChange:f=>c("quiz.passMark",Number(f.target.value))})}),a.jsx(xt,{label:"Context size",hint:"Most bytes of code sent in one prompt.",children:a.jsx("input",{type:"number",min:1e4,step:1e4,className:"input w-40",value:n["context.maxBytes"],onChange:f=>c("context.maxBytes",Number(f.target.value))})}),a.jsx(xt,{label:"Cards from misses",hint:"Each wrong or partial quiz answer becomes a review card.",children:a.jsx(Zt,{value:n["cards.fromMisses"]?"on":"off",onChange:f=>c("cards.fromMisses",f==="on"),options:[{value:"on",label:"On"},{value:"off",label:"Off"}]})}),a.jsx(xt,{label:"Fade after",hint:"Days without recall before an understood file shows as fading. 0 = never.",children:a.jsx("input",{type:"number",min:0,className:"input w-32",value:n["progress.fadeDays"],onChange:f=>c("progress.fadeDays",Number(f.target.value))})}),a.jsx(xt,{label:"Notes in prompts",hint:"Send your margin notes on a file with its code, so lenses and the tutor can use them.",children:a.jsx(Zt,{value:n["notes.inPrompts"]?"on":"off",onChange:f=>c("notes.inPrompts",f==="on"),options:[{value:"on",label:"On"},{value:"off",label:"Off"}]})}),a.jsx(xt,{label:"Keep archive",hint:"Days an archived item or forgotten project is kept before it is removed for good. 0 = forever.",children:a.jsx("input",{type:"number",min:0,className:"input w-32",value:n["storage.archiveDays"],onChange:f=>c("storage.archiveDays",Number(f.target.value))})}),a.jsx(xt,{label:"Reply cache",hint:"Most MB of saved model replies (the same lens twice is free). Oldest go first.",children:a.jsx("input",{type:"number",min:0,className:"input w-32",value:n["storage.cacheMB"],onChange:f=>c("storage.cacheMB",Number(f.target.value))})}),a.jsx(xt,{label:"Attempts per quiz",hint:"Older graded attempts are dropped; the best one is always kept.",children:a.jsx("input",{type:"number",min:1,className:"input w-32",value:n["storage.maxAttempts"],onChange:f=>c("storage.maxAttempts",Number(f.target.value))})})]}),u.error&&a.jsx("div",{className:"mt-4",children:a.jsx(Ke,{error:u.error.message})}),a.jsxs("div",{className:"mt-5 flex items-center justify-end gap-2",children:[u.isSuccess&&!d&&a.jsxs("span",{className:"flex items-center gap-1 text-sm text-good",children:[a.jsx(ep,{className:"h-4 w-4"})," Saved"]}),a.jsx(ee,{variant:"ghost",disabled:!d,onClick:()=>r(t.data.settings),children:"Reset"}),a.jsx(ee,{variant:"primary",disabled:!d,loading:u.isPending,onClick:()=>u.mutate(n),children:"Save"})]}),a.jsx(nL,{}),a.jsx(iL,{})]})})}function Ga({to:e="library",label:t="Library"}){const{project:n}=it();return a.jsxs(ft,{to:`/p/${n.id}/${e}`,className:"inline-flex items-center gap-1 text-xs text-muted hover:text-ink",children:[a.jsx(Jf,{className:"h-3.5 w-3.5"})," ",t]})}function dc(e){const{project:t}=it();return async n=>{await fetch(`/api/projects/${t.id}/${e}`,{method:"DELETE"}),n(`/p/${t.id}/library`)}}const lL={lens:"Read a lens",walk:"Walk through",quiz:"Quiz",teachback:"Teach back"},Fw={lens:"Start the lens",walk:"Start the walk",quiz:"Start the quiz",teachback:"Start the teach-back"};function aL(){var l;const{project:e}=it(),t=gt(),n=mn(),[r,i]=b.useState(""),s=ye({queryKey:["paths",e.id],queryFn:()=>me(`/projects/${e.id}/paths`)});return a.jsx("div",{className:"h-full overflow-auto",children:a.jsxs("div",{className:"page",children:[a.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Learning paths"}),a.jsx("p",{className:"text-sm text-muted",children:"An ordered tour of the repo: where to start, what next, and how to check each stop. Stops tick off as you do them."}),a.jsxs("div",{className:"card mt-6 p-5",children:[a.jsx("div",{className:"label",children:"What do you want to be able to do? (optional)"}),a.jsx("input",{className:"input",placeholder:"e.g. change how retries work, or review PRs to the scheduler",value:r,onChange:o=>i(o.target.value)}),a.jsx(ee,{variant:"primary",className:"mt-3",icon:a.jsx(ap,{className:"h-4 w-4"}),disabled:n.busy,onClick:()=>n.run(`/projects/${e.id}/paths`,{goal:r},o=>t(`/p/${e.id}/paths/${o.resultId}`)),children:"Make a path"}),n.busy&&n.job&&a.jsx("div",{className:"mt-3",children:a.jsx(sn,{kind:"path",elapsed:n.elapsed})}),n.error&&a.jsx("div",{className:"mt-3",children:a.jsx(Ke,{error:n.error,onClose:n.clearError})})]}),a.jsx("div",{className:"mt-6 space-y-2",children:(l=s.data)==null?void 0:l.map(o=>{const u=o.done.filter(Boolean).length;return a.jsxs(ft,{to:`/p/${e.id}/paths/${o.id}`,className:"card flex items-center gap-3 p-4 transition hover:border-accent/40",children:[a.jsx(lp,{className:"h-5 w-5 text-good"}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("div",{className:"font-medium",children:o.title}),a.jsxs("div",{className:"text-xs text-muted",children:[o.stops.length," stops · ",Tt(o.createdAt)]})]}),a.jsx("div",{className:"h-1.5 w-28 overflow-hidden rounded-full bg-line",children:a.jsx("div",{className:"h-full bg-good",style:{width:`${u/o.stops.length*100}%`}})}),a.jsxs("span",{className:"w-10 text-right text-xs tabular-nums text-muted",children:[u,"/",o.stops.length]})]},o.id)})})]})})}function oL(){const{id:e=""}=$r(),{project:t,rel:n,setSelected:r,setOpenFile:i}=it(),s=gt(),l=Dt(),o=ye({queryKey:["path",t.id,e],queryFn:()=>me(`/projects/${t.id}/paths/${e}`)}),u=vi({mutationFn:f=>Ua(`/projects/${t.id}/paths/${e}`,{stops:f}),onSuccess:f=>l.setQueryData(["path",t.id,e],f)});if(o.isLoading)return a.jsx("div",{className:"p-8",children:a.jsx(kt,{})});if(!o.data)return a.jsx(Ft,{title:"Path not found"});const c=o.data,d=c.done.findIndex(f=>!f),h=(f,m)=>{const g=[...c.stops],[k]=g.splice(f,1);g.splice(f+m,0,k),u.mutate(g)},p=f=>{r(f.files),i(f.files[0]),s(`/p/${t.id}/explore?do=${f.activity==="teachback"?"teach":f.activity}`)};return a.jsx("div",{className:"h-full overflow-auto",children:a.jsxs("div",{className:"page",children:[a.jsx(nc,{back:a.jsx(Ga,{to:"paths",label:"Paths"}),badges:a.jsxs(a.Fragment,{children:[a.jsx(be,{tone:"good",children:"path"}),a.jsxs("span",{className:"text-xs text-muted",children:[c.done.filter(Boolean).length,"/",c.stops.length," done · ",Tt(c.createdAt)]})]}),title:c.title,actions:a.jsx(ee,{variant:"ghost",size:"sm",icon:a.jsx(pr,{className:"h-3.5 w-3.5"}),onClick:async()=>{await cs(`/projects/${t.id}/paths/${c.id}`),s(`/p/${t.id}/paths`)},children:"Archive"})}),a.jsx("ol",{className:"relative mt-8 space-y-3 border-l-2 border-line pl-6",children:c.stops.map((f,m)=>a.jsxs("li",{className:"relative",children:[a.jsx("span",{className:le("absolute -left-[35px] top-4 grid h-5 w-5 place-items-center rounded-full bg-bg",c.done[m]?"text-good":m===d?"text-accent":"text-muted"),children:c.done[m]?a.jsx(vl,{className:"h-5 w-5"}):a.jsx(Zj,{className:"h-5 w-5"})}),a.jsxs("div",{className:le("card group p-4",m===d&&"ring-1 ring-accent/40"),children:[a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{className:"text-xs text-muted",children:["Stop ",m+1," · ",lL[f.activity]??f.activity]}),a.jsx("div",{className:"font-medium",children:f.title})]}),a.jsxs("div",{className:"flex gap-0.5 opacity-0 transition group-hover:opacity-100",children:[a.jsx("button",{className:"rounded p-1 text-muted hover:bg-raised hover:text-ink disabled:opacity-30",disabled:m===0,onClick:()=>h(m,-1),"aria-label":"Move up",children:a.jsx(R1,{className:"h-3.5 w-3.5"})}),a.jsx("button",{className:"rounded p-1 text-muted hover:bg-raised hover:text-ink disabled:opacity-30",disabled:m===c.stops.length-1,onClick:()=>h(m,1),"aria-label":"Move down",children:a.jsx(Kj,{className:"h-3.5 w-3.5"})}),a.jsx("button",{className:"rounded p-1 text-muted hover:bg-raised hover:text-bad",onClick:()=>u.mutate(c.stops.filter((g,k)=>k!==m)),"aria-label":"Remove stop",children:a.jsx(Rn,{className:"h-3.5 w-3.5"})})]})]}),a.jsx("p",{className:"mt-1 text-[14.5px] text-muted",children:f.why}),a.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5",children:[f.files.map(g=>a.jsx("span",{className:"rounded bg-raised px-1.5 py-0.5 font-mono text-[12px]",children:n(g)},g)),a.jsx(ee,{size:"sm",variant:m===d?"primary":"secondary",className:"ml-auto",onClick:()=>p(f),children:c.done[m]?"Do it again":Fw[f.activity]??"Start"})]})]})]},`${m}-${f.title}`))})]})})}function uL(){const{project:e,rel:t,setSelected:n,setOpenFile:r}=it(),i=gt(),s=mn(),l=ye({queryKey:["today",e.id],queryFn:()=>me(`/projects/${e.id}/today`)}),o=`/p/${e.id}`;if(l.isLoading)return a.jsx("div",{className:"p-8",children:a.jsx(kt,{})});if(!l.data)return l.error?a.jsx("div",{className:"p-8",children:a.jsx(Ke,{error:l.error.message})}):null;const u=l.data,c=(d,h)=>{if(h==="review")return i(`${o}/review`);if(h==="weak")return s.run(`/projects/${e.id}/quizzes`,{files:[],weak:!0},f=>i(`${o}/quiz/${f.resultId}`));n(d),d[0]&&r(d[0]),i(`${o}/explore?do=${h==="teachback"?"teach":h}`)};return a.jsx("div",{className:"h-full overflow-auto",children:a.jsxs("div",{className:"mx-auto max-w-4xl px-8 py-8",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:"Today"}),a.jsx("span",{className:"text-sm text-muted",children:e.name}),u.streak>0&&a.jsxs(be,{tone:"warn",className:"ml-auto",children:[a.jsx(l2,{className:"h-3.5 w-3.5"})," ",u.streak," day",u.streak===1?"":"s"," in a row"]})]}),u.suggestion&&a.jsxs("div",{className:"card mt-6 flex items-center gap-4 border-accent/30 bg-accent/5 p-5",children:[a.jsx("div",{className:"grid h-10 w-10 shrink-0 place-items-center rounded-md bg-accent/15 text-accent",children:a.jsx(ap,{className:"h-5 w-5"})}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("div",{className:"text-xs font-medium uppercase tracking-wide text-accent",children:"Suggested next, about 10 minutes"}),a.jsx("div",{className:"mt-0.5 text-[16px]",children:u.suggestion.text})]}),a.jsx(ee,{variant:"primary",icon:a.jsx(Hu,{className:"h-4 w-4"}),disabled:s.busy,onClick:()=>c(u.suggestion.files,u.suggestion.activity),children:"Start"})]}),s.busy&&s.job&&a.jsx("div",{className:"mt-3",children:a.jsx(sn,{kind:s.job.kind,elapsed:s.elapsed})}),s.error&&a.jsx("div",{className:"mt-3",children:a.jsx(Ke,{error:s.error,onClose:s.clearError})}),a.jsxs("div",{className:"mt-6 grid gap-4 md:grid-cols-2",children:[a.jsxs("section",{className:"card p-5",children:[a.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold",children:[a.jsx(Fr,{className:"h-4 w-4 text-accent"})," Review cards"]}),a.jsxs("div",{className:"mt-3 flex items-end gap-3",children:[a.jsx("div",{className:"text-4xl font-semibold tabular-nums",children:u.due}),a.jsxs("div",{className:"pb-1 text-sm text-muted",children:["due now",u.newCards?` · ${u.newCards} never seen`:""]})]}),a.jsx(ee,{className:"mt-4",size:"sm",disabled:!u.due,onClick:()=>i(`${o}/review`),children:"Start review"})]}),a.jsxs("section",{className:"card p-5",children:[a.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold",children:[a.jsx(Ji,{className:"h-4 w-4 text-bad"})," Weak spots"]}),u.weak.length?a.jsx("ul",{className:"mt-3 space-y-2",children:u.weak.map(d=>a.jsxs("li",{className:"text-[14px] leading-snug",children:[d.text,a.jsxs("span",{className:"ml-1 text-[12px] text-muted",children:[d.file&&`· ${t(d.file)}`,d.seen>1&&` · seen ${d.seen}×`]})]},d.id))}):a.jsx("p",{className:"mt-3 text-sm text-muted",children:"None open. Wrong answers in quizzes, teach-backs and walkthroughs show up here."}),a.jsxs("div",{className:"mt-4 flex items-center gap-3",children:[a.jsx(ee,{size:"sm",disabled:!u.weak.length||s.busy,onClick:()=>c([],"weak"),children:"Quiz my weak spots"}),u.weak.length>0&&a.jsx(ft,{to:`${o}/library?tab=weak`,className:"text-xs text-muted hover:text-ink",children:"manage"})]})]}),a.jsxs("section",{className:"card p-5",children:[a.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold",children:[a.jsx(k2,{className:"h-4 w-4 text-warn"})," Needs a refresh"]}),u.attention.length?a.jsx("ul",{className:"mt-3 space-y-1.5",children:u.attention.map(d=>a.jsxs("li",{className:"flex items-center gap-2 text-[14px]",children:[a.jsx("button",{className:"min-w-0 flex-1 truncate text-left font-mono text-[13px] hover:text-accent",onClick:()=>c([d.path],"quiz"),children:t(d.path)}),a.jsx(be,{tone:"warn",children:d.level}),d.lastRetrieval&&a.jsx("span",{className:"text-[12px] text-muted",children:Tt(d.lastRetrieval)})]},d.path))}):a.jsx("p",{className:"mt-3 text-sm text-muted",children:"Nothing stale or fading. Files you passed come back here when the code changes or a few weeks go by."})]}),a.jsxs("section",{className:"card p-5",children:[a.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold",children:[a.jsx(lp,{className:"h-4 w-4 text-good"})," Learning path"]}),u.nextStop?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mt-3 text-xs text-muted",children:[u.nextStop.title," · stop ",u.nextStop.index+1]}),a.jsx("div",{className:"mt-0.5 text-[16px] font-medium",children:u.nextStop.stop.title}),a.jsx("p",{className:"mt-1 text-[14px] text-muted",children:u.nextStop.stop.why}),a.jsxs("div",{className:"mt-4 flex gap-2",children:[a.jsx(ee,{size:"sm",variant:"primary",onClick:()=>c(u.nextStop.stop.files,u.nextStop.stop.activity),children:Fw[u.nextStop.stop.activity]??"Start"}),a.jsx(ft,{to:`${o}/paths/${u.nextStop.pathId}`,className:"inline-flex items-center text-xs text-muted hover:text-ink",children:"see the path"})]})]}):a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"mt-3 text-sm text-muted",children:"A path is an ordered tour of the repo: where to start, what next, and how to check each stop."}),a.jsxs("div",{className:"mt-4 flex gap-2",children:[a.jsx(ee,{size:"sm",onClick:()=>i(`${o}/paths`),children:"Make a path"}),a.jsx(ee,{size:"sm",variant:"ghost",icon:a.jsx(W1,{className:"h-3.5 w-3.5"}),onClick:()=>i(`${o}/map`),children:"See the map"})]})]})]})]})]})})}const Ax=[{r:"again",label:"Again",key:"1",cls:"border-bad/40 text-bad hover:bg-bad/10"},{r:"hard",label:"Hard",key:"2",cls:"border-warn/40 text-warn hover:bg-warn/10"},{r:"good",label:"Good",key:"3",cls:"border-good/40 text-good hover:bg-good/10"},{r:"easy",label:"Easy",key:"4",cls:"border-accent/40 text-accent hover:bg-accent/10"}],cL={miss:"from a quiz miss",concept:"concept",own:"your card"};function dL(){var E,w,N,M,F,C,O;const{project:e,rel:t}=it(),n=Dt(),r=ye({queryKey:["cards-due",e.id],queryFn:()=>me(`/projects/${e.id}/cards/due`)}),i=ye({queryKey:["cards",e.id],queryFn:()=>me(`/projects/${e.id}/cards`)}),[s,l]=b.useState(!1),[o,u]=b.useState(""),[c,d]=b.useState(0),[h,p]=b.useState(!1),[f,m]=b.useState(!1),g=(E=r.data)==null?void 0:E[0];b.useEffect(()=>{l(!1),u(""),m(!1)},[g==null?void 0:g.id]);const k=async A=>{g&&(await Ci(`/projects/${e.id}/cards/${g.id}/review`,{rating:A}),d(V=>V+1),await n.invalidateQueries({queryKey:["cards-due",e.id]}),n.invalidateQueries({queryKey:["today",e.id]}),n.invalidateQueries({queryKey:["cards",e.id]}))};if(b.useEffect(()=>{const A=V=>{if(V.target.closest("textarea, input"))return;V.key===" "&&!s&&(V.preventDefault(),l(!0));const U=Ax.find(q=>q.key===V.key);U&&s&&k(U.r)};return window.addEventListener("keydown",A),()=>window.removeEventListener("keydown",A)}),r.isLoading)return a.jsx("div",{className:"p-8",children:a.jsx(kt,{})});const y=((w=i.data)==null?void 0:w.length)??0,x=((N=i.data)==null?void 0:N.filter(A=>A.suspended).length)??0,v=(M=i.data)==null?void 0:M.filter(A=>!A.suspended).map(A=>A.fsrs.due).sort()[0],j=a.jsxs("div",{className:"h-full overflow-auto",children:[a.jsxs("div",{className:"page",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Review"}),a.jsxs(be,{tone:"accent",children:[((F=r.data)==null?void 0:F.length)??0," due"]}),c>0&&a.jsxs(be,{tone:"good",children:[c," done"]}),a.jsx(ee,{size:"sm",variant:"ghost",className:"ml-auto",icon:a.jsx(Q1,{className:"h-3.5 w-3.5"}),onClick:()=>p(!0),children:"New card"})]}),a.jsx("p",{className:"text-sm text-muted",children:"Recall before you reveal. Cards you know come back less often; cards you miss come back soon."}),g?a.jsxs("div",{className:"card mt-6 p-6",children:[a.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted",children:[a.jsx(Fr,{className:"h-3.5 w-3.5"})," ",cL[g.kind],g.file&&a.jsxs("button",{className:"ml-1 font-mono hover:text-accent",onClick:()=>m(A=>!A),children:[t(g.file),g.line?`:${g.line}`:""]}),a.jsx("span",{className:"ml-auto",children:g.fsrs.reps?`${g.fsrs.reps} reviews · ${g.fsrs.lapses} lapses`:"new"})]}),a.jsx("div",{className:"mt-3 text-[17px] font-medium leading-snug",children:g.front}),s?a.jsxs(a.Fragment,{children:[o.trim()&&a.jsxs("div",{className:"mt-4",children:[a.jsx("div",{className:"label",children:"You wrote"}),a.jsx("div",{className:"whitespace-pre-wrap rounded-lg bg-raised px-3 py-2 text-sm",children:o})]}),a.jsxs("div",{className:"mt-4",children:[a.jsx("div",{className:"label",children:"Answer"}),a.jsx("div",{className:"reading whitespace-pre-wrap rounded-lg border border-good/30 bg-good/5 px-4 py-3",children:g.back})]}),a.jsx("div",{className:"mt-5 grid grid-cols-4 gap-2",children:Ax.map(A=>a.jsxs("button",{onClick:()=>k(A.r),className:le("rounded-lg border px-2 py-2 text-center transition",A.cls),children:[a.jsxs("div",{className:"text-sm font-semibold",children:[A.label," ",a.jsx("span",{className:"kbd ml-0.5",children:A.key})]}),a.jsx("div",{className:"text-[12px] opacity-80",children:Th(g.next[A.r])})]},A.r))}),a.jsxs("div",{className:"mt-3 flex items-center justify-end gap-4",children:[(((C=g.source)==null?void 0:C.lensId)||((O=g.source)==null?void 0:O.quizId))&&a.jsxs(ft,{className:"mr-auto inline-flex items-center gap-1 text-xs text-muted hover:text-accent",to:g.source.lensId?`/p/${e.id}/lens/${g.source.lensId}`:`/p/${e.id}/quiz/${g.source.quizId}`,title:"Open what this card was made from",children:[a.jsx(i2,{className:"h-3.5 w-3.5"})," From ",g.source.lensId?"a lens":"a quiz"]}),a.jsxs("button",{className:"inline-flex items-center gap-1 text-xs text-muted hover:text-ink",title:"Stop showing this card",onClick:async()=>{await Ua(`/projects/${e.id}/cards/${g.id}`,{suspended:!0}),n.invalidateQueries()},children:[a.jsx(D1,{className:"h-3.5 w-3.5"})," Pause this card"]})]})]}):a.jsxs(a.Fragment,{children:[a.jsx("textarea",{className:"input mt-4 min-h-[88px]",placeholder:"Type your answer (optional), then reveal",value:o,onChange:A=>u(A.target.value)}),a.jsxs(ee,{variant:"primary",className:"mt-3",icon:a.jsx(O1,{className:"h-4 w-4"}),onClick:()=>l(!0),children:["Reveal ",a.jsx("span",{className:"kbd ml-1",children:"space"})]})]})]}):a.jsx(Ft,{icon:a.jsx(vl,{className:"h-6 w-6"}),title:c?"All done for now":"Nothing due",children:y?a.jsxs(a.Fragment,{children:["You have ",y," card",y===1?"":"s",x?` (${x} paused)`:"",".",v&&` The next one is due in ${Th(v)}.`]}):a.jsx(a.Fragment,{children:"Cards come from quiz misses (on their own), lens concepts and your own. Take a quiz or make a card to start."})}),a.jsxs("p",{className:"mt-6 text-center text-xs text-muted",children:["All cards are in the ",a.jsx(ft,{className:"text-accent hover:underline",to:`/p/${e.id}/library?tab=cards`,children:"Library"}),"."]})]}),h&&a.jsx(Ha,{initial:{kind:"own"},onClose:()=>p(!1)})]});return!f||!(g!=null&&g.file)?j:a.jsx(Kn,{id:"review-code",side:"right",initial:480,min:300,max:900,className:"h-full",left:j,right:a.jsx(kl,{file:g.file,line:g.line,onClose:()=>m(!1)})})}const hL=["","Mostly wrong or empty","Some right, big gaps","Right but shallow","Right, covers what matters","Right, with the why and the edges"];function fL(){const{id:e=""}=$r(),{project:t,rel:n}=it(),r=gt(),i=mn(),s=dc(`teachbacks/${e}`),[l,o]=b.useState(null),[u,c]=b.useState(null),d=ye({queryKey:["teachback",t.id,e],queryFn:()=>me(`/projects/${t.id}/teachbacks/${e}`)});if(d.isLoading)return a.jsx("div",{className:"p-8",children:a.jsx(kt,{})});if(!d.data)return a.jsx(Ft,{title:"Teach-back not found"});const h=d.data,p=h.grade,f=(g,k,y,x)=>k.length>0&&a.jsxs("section",{className:"mt-6",children:[a.jsxs("h2",{className:`mb-2 flex items-center gap-1.5 text-sm font-semibold ${x}`,children:[y," ",g]}),a.jsx("ul",{className:"space-y-1.5",children:k.map((v,j)=>a.jsx("li",{className:"card reading px-4 py-2.5",children:v},j))})]}),m=a.jsx("div",{className:"h-full overflow-auto",children:a.jsxs("div",{className:"page",children:[a.jsx(nc,{back:a.jsx(Ga,{}),badges:a.jsxs(a.Fragment,{children:[a.jsx(be,{tone:"accent",children:"teach-back"}),a.jsx("span",{className:"text-xs text-muted",children:Tt(h.createdAt)})]}),title:"Your explanation",actions:a.jsx(ee,{variant:"ghost",size:"sm",icon:a.jsx(pr,{className:"h-3.5 w-3.5"}),onClick:()=>s(r),children:"Archive"})}),a.jsxs("div",{className:"mt-3 flex flex-wrap gap-1.5",children:[h.files.slice(0,6).map(g=>a.jsxs("button",{onClick:()=>o(g),title:n(g),className:"inline-flex max-w-full items-center gap-1 rounded-md bg-raised px-2 py-1 font-mono text-[12px] hover:text-accent",children:[a.jsx(os,{className:"h-3 w-3 shrink-0"})," ",a.jsx("span",{className:"truncate",children:fr(n(g),64)})]},g)),h.files.length>6&&a.jsxs("span",{className:"px-1 py-1 text-[12px] text-muted",children:["+",h.files.length-6," more"]})]}),p&&a.jsxs("div",{className:"card mt-6 flex items-center gap-5 p-5",children:[a.jsx("div",{className:"text-center",children:a.jsxs("div",{className:`text-4xl font-semibold ${p.score>=4?"text-good":p.score>=3?"text-warn":"text-bad"}`,children:[p.score,a.jsx("span",{className:"text-lg text-muted",children:"/5"})]})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-sm font-medium",children:hL[p.score]}),a.jsx("div",{className:"text-sm text-muted",children:p.summary}),p.score>=4&&a.jsx("div",{className:"mt-1 text-xs text-good",children:"Counts as understood for these files."})]})]}),a.jsxs("section",{className:"mt-6",children:[a.jsx("div",{className:"label",children:"What you wrote"}),a.jsx("div",{className:"reading whitespace-pre-wrap rounded-lg bg-raised px-4 py-3",children:h.text})]}),p&&f("Wrong",p.wrong,a.jsx(A1,{className:"h-4 w-4"}),"text-bad"),p&&f("Missing",p.missing,a.jsx(I1,{className:"h-4 w-4"}),"text-warn"),p&&f("Right",p.right,a.jsx(vl,{className:"h-4 w-4"}),"text-good"),a.jsxs("section",{className:"mt-10 rounded-md border border-line bg-raised/50 p-5",children:[a.jsx("div",{className:"text-sm font-semibold",children:"Explain it again"}),a.jsx("p",{className:"mt-0.5 text-sm text-muted",children:"Close this page in your head: write it fresh, without copying the feedback."}),u===null?a.jsx(ee,{className:"mt-3",icon:a.jsx(sp,{className:"h-4 w-4"}),onClick:()=>c(""),children:"Try again"}):a.jsxs(a.Fragment,{children:[a.jsx("textarea",{className:"input mt-3 min-h-[160px]",value:u,onChange:g=>c(g.target.value),autoFocus:!0}),a.jsx(ee,{variant:"primary",className:"mt-2",icon:a.jsx(Qu,{className:"h-4 w-4"}),disabled:i.busy||u.trim().length<20,onClick:()=>i.run(`/projects/${t.id}/teachbacks`,{files:h.files,text:u,diff:h.diff},g=>{c(null),r(`/p/${t.id}/teach/${g.resultId}`)}),children:"Grade this one"})]}),i.busy&&i.job&&a.jsx("div",{className:"mt-3",children:a.jsx(sn,{kind:"teachback",elapsed:i.elapsed})}),i.error&&a.jsx("div",{className:"mt-3",children:a.jsx(Ke,{error:i.error,onClose:i.clearError})})]})]})});return l?a.jsx(Kn,{id:"teach-code",side:"right",initial:480,min:300,max:900,className:"h-full",left:m,right:a.jsx(kl,{file:l,onClose:()=>o(null)})}):m}const pL=/\blines?\s+(\d+(?:\s*(?:[-–]|to|,|and)\s*\d+)*)/gi,mL=/(\d+)|([-–]|to|,|and)/gi;function cd(e){return/^[a-z]+$/i.test(e)?` ${e} `:e===","?", ":e}function gL(e){return e.split(/(```[\s\S]*?```|`[^`\n]*`)/g).map((t,n)=>n%2?t:t.replace(pL,(r,i)=>{var u;const s=r.slice(0,r.length-i.length),l=[...i.matchAll(mL)];let o="";for(let c=0;c<l.length;c++){const d=l[c][1];if(!d)continue;const h=l[c+1];if(h&&!h[1]&&/^(-|–|to)$/i.test(h[2]??"")&&((u=l[c+2])!=null&&u[1])){const f=l[c+2][1];o+=`[${d}${cd(h[2])}${f}](codeline:${d}-${f})`,c+=2;const m=l[c+1];m&&!m[1]&&(o+=cd(m[2]))}else o+=`[${d}](codeline:${d}-${d})`,h&&(o+=cd(h[2]))}return s+o})).join("")}const xL=["","nudge","hint","walk-through","answer"];function yL(){const{id:e=""}=$r(),{project:t,rel:n}=it(),r=gt(),i=mn(),s=dc(`threads/${e}`),[l,o]=b.useState(""),[u,c]=b.useState(null),d=b.useRef(null),h=ye({queryKey:["thread",t.id,e],queryFn:()=>me(`/projects/${t.id}/threads/${e}`)}),p=h.data;if(b.useEffect(()=>{var y;(y=d.current)==null||y.scrollIntoView({behavior:"smooth"})},[p==null?void 0:p.messages.length,i.busy]),b.useEffect(()=>{p&&!u&&c({file:p.files[0]})},[p,u]),h.isLoading)return a.jsx("div",{className:"p-8",children:a.jsx(kt,{})});if(!p)return a.jsx(Ft,{title:"Conversation not found"});const f=(y=!1)=>i.run(`/projects/${t.id}/threads/${p.id}/messages`,{text:l,tell:y},()=>o("")),m=(y,x)=>c(v=>({file:(v==null?void 0:v.file)??p.files[0],line:y,to:x})),g=a.jsxs("div",{className:"flex h-full flex-col",children:[a.jsxs("div",{className:"border-b border-line bg-panel px-4 py-1.5",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ga,{}),a.jsx(ee,{variant:"ghost",size:"sm",className:"ml-auto",icon:a.jsx(pr,{className:"h-3.5 w-3.5"}),onClick:()=>s(r),children:"Archive"})]}),a.jsx("div",{className:"mt-0.5 truncate text-[13px] font-semibold",children:p.title}),a.jsxs("div",{className:"mt-1 flex flex-wrap gap-1",children:[p.files.slice(0,6).map(y=>a.jsxs("button",{onClick:()=>c({file:y}),title:n(y),className:"inline-flex max-w-full items-center gap-1 rounded-md bg-raised px-1.5 py-0.5 font-mono text-[11.5px] hover:text-accent",children:[a.jsx(os,{className:"h-3 w-3 shrink-0"})," ",a.jsx("span",{className:"truncate",children:fr(n(y),64)})]},y)),p.files.length>6&&a.jsxs("span",{className:"px-1 py-0.5 text-[11.5px] text-muted",children:["+",p.files.length-6," more"]})]})]}),a.jsxs("div",{className:"chat-area min-h-0 flex-1 overflow-auto px-[6%] py-3 [scrollbar-gutter:stable]",children:[p.messages.map((y,x)=>{const v=y.role==="user",j=x===0||p.messages[x-1].role!==y.role;return a.jsx("div",{className:le("flex",v?"justify-end":"justify-start",x>0&&(j?"mt-3":"mt-0.5")),children:a.jsxs("div",{className:le("chat-bubble",v?"chat-me":"chat-them",j&&"chat-first"),children:[!v&&y.hintLevel&&a.jsxs("div",{className:le("chat-label",y.hintLevel>=4?"text-warn":"text-accent"),children:[a.jsx(ip,{className:"h-3 w-3"})," Tutor · ",xL[y.hintLevel]]}),v?a.jsxs("div",{className:"whitespace-pre-wrap",children:[y.text,a.jsx("span",{className:"chat-spacer"})]}):a.jsx(es,{className:"chat-msg",onLineClick:m,children:gL(y.text)}),a.jsx("span",{className:"chat-time",children:new Date(y.at).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})},x)}),i.busy&&i.job&&a.jsx("div",{className:"mt-3",children:a.jsx(sn,{kind:"tutor",elapsed:i.elapsed})}),i.error&&a.jsx("div",{className:"mt-3",children:a.jsx(Ke,{error:i.error,onClose:i.clearError})}),a.jsx("div",{ref:d})]}),a.jsxs("div",{className:"flex items-end gap-2 border-t border-line bg-panel px-3 py-2",children:[a.jsx("textarea",{rows:1,className:"max-h-40 min-h-[36px] flex-1 resize-none rounded-lg bg-raised px-3 py-2 text-[14px] leading-[1.4] text-ink outline-none [field-sizing:content] placeholder:text-muted/70 focus:ring-1 focus:ring-accent/50",placeholder:"Your answer or next question — try first, each reply gives a bit more. Ctrl+Enter to send.",value:l,onChange:y=>o(y.target.value),onKeyDown:y=>{y.key==="Enter"&&(y.ctrlKey||y.metaKey)&&l.trim()&&!i.busy&&f()}}),a.jsx(ee,{variant:"ghost",size:"md",className:"mb-[5px]",disabled:i.busy,onClick:()=>f(!0),children:"Just tell me"}),a.jsx("button",{className:"mb-[2px] grid h-8 w-8 shrink-0 place-items-center rounded-full bg-accent text-accent-ink transition hover:brightness-110 disabled:opacity-40",disabled:i.busy||!l.trim(),onClick:()=>f(),title:"Send (Ctrl+Enter)",children:a.jsx(K1,{className:"h-4 w-4"})})]})]}),k=u!=null&&u.to&&u.to!==u.line?[{from:u.line,to:u.to,cls:"hl"}]:void 0;return a.jsx(Kn,{id:"tutor-code",collapsible:!0,side:"right",initial:520,min:300,max:900,className:"h-full",left:g,right:a.jsx(kl,{file:u==null?void 0:u.file,line:u==null?void 0:u.line,marks:k})})}function vL(){const{id:e=""}=$r(),{project:t,rel:n}=it(),r=gt(),i=mn(),s=dc(`walks/${e}`),l=ye({queryKey:["walk",t.id,e],queryFn:()=>me(`/projects/${t.id}/walks/${e}`)}),o=l.data,u=ye({queryKey:["file",t.id,o==null?void 0:o.file],enabled:!!o,queryFn:()=>me(`/projects/${t.id}/file?path=${encodeURIComponent(o.file)}`)}),c=o?Math.max(0,o.blocks.findIndex(N=>!N.verdict)):0,[d,h]=b.useState(null),p=d??c,[f,m]=b.useState(""),[g,k]=b.useState(!1);b.useEffect(()=>{m(""),k(!1)},[p]);const y=b.useMemo(()=>{const N=o==null?void 0:o.blocks[p];if(!N||!u.data)return null;const M=u.data.text.split(`
513
+ `),F=M.slice(N.startLine-1,Math.min(N.endLine,M.length)),C=Math.min(...F.filter(O=>O.trim()).map(O=>{var A;return((A=/^\s*/.exec(O))==null?void 0:A[0].length)??0}));return F.map(O=>O.slice(Number.isFinite(C)?C:0)).join(`
514
+ `)},[o,p,u.data]),x=b.useMemo(()=>o?[{from:o.blocks[p].startLine,to:o.blocks[p].endLine,cls:"block"}]:[],[o,p]);if(l.isLoading)return a.jsx("div",{className:"p-8",children:a.jsx(kt,{})});if(!o)return a.jsx(Ft,{title:"Walkthrough not found"});const v=o.blocks[p],j=o.blocks.filter(N=>N.verdict).length,E=o.blocks.reduce((N,M)=>N+(M.verdict==="right"?1:M.verdict==="partial"?.5:0),0),w=a.jsx("div",{className:"h-full overflow-auto",children:a.jsxs("div",{className:"page",children:[a.jsx(nc,{back:a.jsx(Ga,{}),badges:a.jsxs(a.Fragment,{children:[a.jsx(be,{tone:"accent",children:"walkthrough"}),a.jsxs("span",{className:"text-xs text-muted",children:[j,"/",o.blocks.length," checked · ",Tt(o.createdAt)]})]}),title:a.jsx("span",{className:"font-mono text-[20px]",children:n(o.file)}),actions:a.jsx(ee,{variant:"ghost",size:"sm",icon:a.jsx(pr,{className:"h-3.5 w-3.5"}),onClick:()=>s(r),children:"Archive"})}),a.jsx("div",{className:"mt-5 flex gap-1",children:o.blocks.map((N,M)=>a.jsx("button",{title:N.title,onClick:()=>h(M),className:le("h-2 flex-1 rounded-full transition",N.verdict==="right"?"bg-good":N.verdict==="partial"?"bg-warn":N.verdict==="wrong"?"bg-bad":"bg-line",M===p&&"ring-2 ring-accent/40 ring-offset-2 ring-offset-bg")},M))}),a.jsxs("div",{className:"card mt-6 p-6",children:[a.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted",children:["Block ",p+1," of ",o.blocks.length," · lines ",v.startLine,"-",v.endLine,v.verdict&&a.jsx("span",{className:"ml-auto",children:a.jsx(f0,{v:v.verdict})})]}),a.jsx("h2",{className:"mt-1 text-lg font-semibold",children:v.title||`Block ${p+1}`}),a.jsx("p",{className:"reading mt-1 text-muted",children:v.why}),y!==null&&a.jsxs("div",{className:"mt-5 min-w-0 overflow-hidden rounded-md border border-line bg-panel",children:[a.jsxs("div",{className:"border-b border-line bg-raised/60 px-3 py-1.5 font-mono text-[12px] text-muted",children:[n(o.file).split("/").slice(-2).join("/"),":",v.startLine,"–",v.endLine]}),a.jsx("div",{className:"lens-step-code",children:a.jsx(Wa,{text:y,lang:u.data.lang,firstLine:v.startLine})})]}),v.explain&&a.jsx("div",{className:"mt-5",children:a.jsx(es,{children:v.explain})}),v.example&&a.jsxs("div",{className:"mt-5 rounded-r-lg border-l-[3px] border-good bg-good/5 px-4 py-3",children:[a.jsxs("div",{className:"mb-1 flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wide text-good",children:[a.jsx(ip,{className:"h-3.5 w-3.5"})," Try it with real values"]}),a.jsx(es,{children:v.example})]}),a.jsx("div",{className:"mt-5 rounded-lg border border-accent/25 bg-accent/5 p-3 text-[15.5px] font-medium",children:v.question}),v.verdict&&a.jsxs("div",{className:le("mt-4 space-y-2",g&&"opacity-70"),children:[g&&a.jsx("div",{className:"text-xs font-semibold uppercase tracking-wide text-muted",children:"Your last answer"}),a.jsx("div",{className:"whitespace-pre-wrap rounded-lg bg-raised px-3 py-2 text-sm",children:v.answer||a.jsx("span",{className:"text-muted",children:"(no answer)"})}),v.feedback&&a.jsx("p",{className:"reading",children:v.feedback}),v.verdict!=="right"&&!g&&!i.busy&&a.jsx(ee,{size:"sm",icon:a.jsx(sp,{className:"h-3.5 w-3.5"}),onClick:()=>k(!0),children:"Try again"})]}),(!v.verdict||g)&&a.jsxs(a.Fragment,{children:[a.jsx("textarea",{className:"input mt-4 min-h-[88px]",placeholder:g?"Answer again, in your own words (don't copy the feedback)":"Your answer, from the block on the right",value:f,onChange:N=>m(N.target.value),autoFocus:g}),a.jsx(ee,{variant:"primary",className:"mt-3",icon:a.jsx(ep,{className:"h-4 w-4"}),disabled:i.busy||!f.trim(),onClick:()=>{h(p),i.run(`/projects/${t.id}/walks/${o.id}/blocks/${p}`,{answer:f},()=>{k(!1),m("")})},children:"Check"})]}),i.busy&&i.job&&a.jsx("div",{className:"mt-3",children:a.jsx(sn,{kind:"walkcheck",elapsed:i.elapsed})}),i.error&&a.jsx("div",{className:"mt-3",children:a.jsx(Ke,{error:i.error,onClose:i.clearError})}),a.jsx("div",{className:"mt-5 flex justify-end",children:p<o.blocks.length-1&&a.jsx(ee,{size:"sm",icon:a.jsx(Hu,{className:"h-3.5 w-3.5"}),onClick:()=>h(p+1),children:"Next block"})})]}),j===o.blocks.length&&a.jsxs("div",{className:"card mt-6 flex items-center gap-3 border-good/30 p-4",children:[a.jsx(Vu,{className:"h-5 w-5 text-good"}),a.jsxs("div",{className:"text-sm",children:["Walk done: ",Math.round(E/o.blocks.length*100),"% of the checks right. Next, try explaining the file in your own words (Teach) or hunt a bug in it."]})]})]})});return a.jsx(Kn,{id:"walk-code",collapsible:!0,side:"right",initial:560,min:320,max:960,className:"h-full",left:w,right:a.jsx(kl,{file:o.file,line:v.startLine,marks:x})})}const wL=["","easy","medium","hard"];function kL(){const{id:e=""}=$r(),{project:t,rel:n}=it(),r=gt(),i=Dt(),s=mn(),l=dc(`hunts/${e}`),o=ye({queryKey:["hunt",t.id,e],queryFn:()=>me(`/projects/${t.id}/hunts/${e}`)}),u=o.data,[c,d]=b.useState(null),[h,p]=b.useState(null),f=b.useRef();b.useEffect(()=>{u&&c===null&&d(u.marks)},[u,c]);const m=c??[],g=!!(u!=null&&u.grade),k=w=>{d(w),clearTimeout(f.current),f.current=setTimeout(()=>Eh(`/projects/${t.id}/hunts/${e}/marks`,{marks:w}).catch(()=>{}),400)},y=w=>{if(g)return p(w);p(w),m.some(N=>N.line===w)||k([...m,{line:w,why:""}].sort((N,M)=>N.line-M.line))},x=b.useMemo(()=>{if(!u)return[];const w=m.map(N=>({from:N.line,to:N.line,cls:"marked"}));if(u.grade)for(const N of u.planted)N&&w.push({from:N.line,to:N.line,cls:"bug"});return w},[u,m]);if(o.isLoading)return a.jsx("div",{className:"p-8",children:a.jsx(kt,{})});if(!u)return a.jsx(Ft,{title:"Bug hunt not found"});const v=u.grade,j=u.planted.length,E=a.jsx("div",{className:"h-full overflow-auto",children:a.jsxs("div",{className:"page",children:[a.jsx(nc,{back:a.jsx(Ga,{}),badges:a.jsxs(a.Fragment,{children:[a.jsxs(be,{tone:"bad",children:[a.jsx(Wu,{className:"h-3 w-3"})," bug hunt · ",wL[u.level]]}),a.jsxs("span",{className:"text-xs text-muted",children:[j," bug",j===1?"":"s"," planted · ",Tt(u.createdAt)]})]}),title:a.jsx("span",{className:"font-mono text-[20px]",children:n(u.file)}),actions:a.jsx(ee,{variant:"ghost",size:"sm",icon:a.jsx(pr,{className:"h-3.5 w-3.5"}),onClick:()=>l(r),children:"Archive"})}),!v&&a.jsxs("p",{className:"mt-3 text-sm text-muted",children:["The code on the right is a copy with ",j," planted bug",j===1?"":"s",". Click a line you think is wrong, then say what it breaks. Your folder is not touched."]}),v&&a.jsxs("div",{className:"card mt-6 flex flex-wrap items-center gap-4 p-4",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-xs uppercase tracking-wide text-muted",children:"Score"}),a.jsx("div",{className:"text-3xl",children:a.jsx(Ca,{score:v.score})})]}),a.jsxs("div",{className:"text-sm text-muted",children:[v.found.length," found · ",v.missed.length," missed · ",v.falseAlarms.length," false alarm",v.falseAlarms.length===1?"":"s"]})]}),!v&&a.jsxs("section",{className:"mt-6 space-y-2",children:[a.jsxs("div",{className:"label",children:["Your marks · ",m.length]}),m.map((w,N)=>a.jsxs("div",{className:"card p-3",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("button",{className:"font-mono text-xs text-accent hover:underline",onClick:()=>p(w.line),children:["line ",w.line]}),a.jsx("button",{className:"ml-auto text-muted hover:text-bad","aria-label":"Remove mark",onClick:()=>k(m.filter(M=>M.line!==w.line)),children:a.jsx(Rn,{className:"h-3.5 w-3.5"})})]}),a.jsx("input",{className:"input mt-2",placeholder:"What is wrong, and what does it break?",value:w.why,onChange:M=>k(m.map((F,C)=>C===N?{...F,why:M.target.value}:F))})]},w.line)),!m.length&&a.jsx("p",{className:"rounded-lg border border-dashed border-line p-3 text-[14px] text-muted",children:"No marks yet. Click a line in the code."}),a.jsx(ee,{variant:"primary",className:"mt-2",icon:a.jsx(ms,{className:"h-4 w-4"}),disabled:s.busy||!m.length,onClick:async()=>{clearTimeout(f.current),await Eh(`/projects/${t.id}/hunts/${e}/marks`,{marks:m}),s.run(`/projects/${t.id}/hunts/${e}/grade`,{},()=>i.invalidateQueries({queryKey:["hunt",t.id,e]}))},children:"Check my hunt"})]}),v&&a.jsxs(a.Fragment,{children:[v.found.length>0&&a.jsxs("section",{className:"mt-6",children:[a.jsxs("h2",{className:"mb-2 flex items-center gap-1.5 text-sm font-semibold text-good",children:[a.jsx(vl,{className:"h-4 w-4"})," Found"]}),v.found.map(w=>a.jsx(Ix,{h:u,line:w.line,what:w.what,feedback:w.feedback,onShow:p},w.line))]}),v.missed.length>0&&a.jsxs("section",{className:"mt-6",children:[a.jsxs("h2",{className:"mb-2 flex items-center gap-1.5 text-sm font-semibold text-bad",children:[a.jsx(I1,{className:"h-4 w-4"})," Missed"]}),v.missed.map(w=>a.jsx(Ix,{h:u,line:w.line,what:w.what,onShow:p},w.line))]}),v.falseAlarms.length>0&&a.jsxs("section",{className:"mt-6",children:[a.jsxs("h2",{className:"mb-2 flex items-center gap-1.5 text-sm font-semibold text-warn",children:[a.jsx(A1,{className:"h-4 w-4"})," False alarms"]}),v.falseAlarms.map(w=>a.jsxs("div",{className:"card mb-2 p-3 text-[14.5px]",children:[a.jsxs("button",{className:"font-mono text-xs text-accent hover:underline",onClick:()=>p(w.line),children:["line ",w.line]}),a.jsx("div",{className:"mt-1",children:w.feedback||"This line is fine."})]},w.line))]})]}),s.busy&&s.job&&a.jsx("div",{className:"mt-3",children:a.jsx(sn,{kind:"huntgrade",elapsed:s.elapsed})}),s.error&&a.jsx("div",{className:"mt-3",children:a.jsx(Ke,{error:s.error,onClose:s.clearError})})]})});return a.jsx(Kn,{id:"hunt-code",collapsible:!0,side:"right",initial:600,min:320,max:1e3,className:"h-full",left:E,right:a.jsx(kl,{file:u.file,text:u.text,title:`${n(u.file)} (copy with bugs)`,line:h,marks:x,onLineClick:y})})}function Ix({h:e,line:t,what:n,feedback:r,onShow:i}){const s=e.planted.find(l=>(l==null?void 0:l.line)===t);return a.jsxs("div",{className:"card mb-2 p-3 text-[14.5px]",children:[a.jsxs("button",{className:"font-mono text-xs text-accent hover:underline",onClick:()=>i(t),children:["line ",t]}),s&&a.jsxs("div",{className:"mt-2 overflow-x-auto rounded-md bg-raised font-mono text-[13px]",children:[a.jsxs("div",{className:"whitespace-pre px-2 py-1 text-bad",children:["bug ",s.buggy.trim()]}),a.jsxs("div",{className:"whitespace-pre px-2 py-1 text-good",children:["real ",s.original.trim()]})]}),a.jsx("div",{className:"mt-2",children:n}),r&&a.jsx("div",{className:"mt-1 text-muted",children:r})]})}const bL=b.lazy(()=>ml(()=>import("./Map-xBJDQ_Xn.js"),[]).then(e=>({default:e.MapPage}))),jL=b.lazy(()=>ml(()=>import("./Practice-DNf-tMjl.js").then(e=>e.K),[]).then(e=>({default:e.PracticePage})));oy();const NL=new Aj({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1}}});function SL(){return a.jsx(Ft,{title:"Project not found",action:a.jsx(ee,{onClick:()=>location.href="/",children:"Back to projects"}),children:"It may have been removed from the list. Open its folder again."})}function CL(){const{pid:e=""}=$r();return a.jsx(vS,{pid:e,fallback:a.jsx(SL,{}),children:a.jsx(c0,{})},e)}const EL=WN([{element:a.jsx(yS,{}),children:[{path:"/",element:a.jsx(kS,{})},{path:"/settings",element:a.jsx(sL,{})},{path:"/help",element:a.jsx(oS,{})},{path:"/p/:pid",element:a.jsx(CL,{}),children:[{index:!0,element:a.jsx(FN,{to:"today",replace:!0})},{path:"today",element:a.jsx(uL,{})},{path:"explore",element:a.jsx(AS,{})},{path:"review",element:a.jsx(dL,{})},{path:"map",element:a.jsx(b.Suspense,{fallback:null,children:a.jsx(bL,{})})},{path:"paths",element:a.jsx(aL,{})},{path:"paths/:id",element:a.jsx(oL,{})},{path:"teach/:id",element:a.jsx(fL,{})},{path:"tutor/:id",element:a.jsx(yL,{})},{path:"walk/:id",element:a.jsx(vL,{})},{path:"hunt/:id",element:a.jsx(kL,{})},{path:"changes",element:a.jsx(WS,{})},{path:"library",element:a.jsx(KS,{})},{path:"progress",element:a.jsx(eL,{})},{path:"lens/:id",element:a.jsx(UT,{})},{path:"quiz/:id",element:a.jsx(KT,{})},{path:"practice/:id",element:a.jsx(b.Suspense,{fallback:null,children:a.jsx(jL,{})})}]},{path:"*",element:a.jsx(Ft,{title:"Page not found"})}]}]);c1(document.getElementById("root")).render(a.jsx(b.StrictMode,{children:a.jsx($j,{client:NL,children:a.jsx(ZN,{router:EL})})}));export{Jf as A,ee as B,ep as C,sp as D,Ft as E,np as F,rp as G,cs as H,Kn as I,sn as J,Eh as K,ft as L,W1 as M,eC as N,xp as O,cC as P,aC as Q,m2 as R,XT as S,pr as T,GS as U,f0 as V,dC as W,Nx as X,ml as _,it as a,gt as b,Dt as c,ec as d,ye as e,Vh as f,Tt as g,os as h,be as i,a as j,me as k,TL as l,Gh as m,J as n,$r as o,hk as p,mn as q,b as r,kt as s,Wa as t,Sr as u,ip as v,le as w,Ke as x,K1 as y,O1 as z};