@dendelion/paper-camp 0.19.0 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/dist/app/assets/index-3pzg7Iyw.js +2 -0
  2. package/dist/app/assets/index-3pzg7Iyw.js.map +1 -0
  3. package/dist/app/assets/{index-B6251tL6.js → index-BHmWkgBW.js} +2 -2
  4. package/dist/app/assets/{index-B6251tL6.js.map → index-BHmWkgBW.js.map} +1 -1
  5. package/dist/app/assets/{index-DLkUANCR.js → index-BuzzfADD.js} +2 -2
  6. package/dist/app/assets/{index-DLkUANCR.js.map → index-BuzzfADD.js.map} +1 -1
  7. package/dist/app/assets/{index-D5j1njQR.js → index-CkLeljbk.js} +2 -2
  8. package/dist/app/assets/{index-D5j1njQR.js.map → index-CkLeljbk.js.map} +1 -1
  9. package/dist/app/assets/{index-nuVVSVma.js → index-DMDqfoCe.js} +2 -2
  10. package/dist/app/assets/index-DMDqfoCe.js.map +1 -0
  11. package/dist/app/assets/index-D_Lo8ptS.js +6 -0
  12. package/dist/app/assets/index-D_Lo8ptS.js.map +1 -0
  13. package/dist/app/assets/{index-BNoowtMI.js → index-DfekHwwU.js} +3 -3
  14. package/dist/app/assets/{index-BNoowtMI.js.map → index-DfekHwwU.js.map} +1 -1
  15. package/dist/app/assets/{index-D2iIIpI1.js → index-Gi97Lmex.js} +3 -3
  16. package/dist/app/assets/{index-D2iIIpI1.js.map → index-Gi97Lmex.js.map} +1 -1
  17. package/dist/app/assets/main-Bm0W4ucz.css +1 -0
  18. package/dist/app/assets/main-DP_okYxh.js +215 -0
  19. package/dist/app/assets/main-DP_okYxh.js.map +1 -0
  20. package/dist/app/assets/sidebar-section-B-A20bg9.js +2 -0
  21. package/dist/app/assets/sidebar-section-B-A20bg9.js.map +1 -0
  22. package/dist/app/index.html +2 -2
  23. package/dist/app/toolbar.js +1071 -1049
  24. package/dist/app/toolbar.js.map +1 -1
  25. package/dist/chunks/{phase-progress.CwSKAAZ-.js → phase-progress.DPAZ01Gg.js} +1720 -1594
  26. package/dist/chunks/phase-progress.DPAZ01Gg.js.map +1 -0
  27. package/dist/cli/index.js +6633 -6345
  28. package/dist/cli/index.js.map +1 -1
  29. package/dist/core/corpus-format.d.ts +11 -0
  30. package/dist/core/corpus-format.d.ts.map +1 -0
  31. package/dist/core/corpus-format.test.d.ts +2 -0
  32. package/dist/core/corpus-format.test.d.ts.map +1 -0
  33. package/dist/core/doctor/checks/metadata.d.ts.map +1 -1
  34. package/dist/core/doctor/rules.d.ts +6 -1
  35. package/dist/core/doctor/rules.d.ts.map +1 -1
  36. package/dist/core/git-pr/pr-lookup.d.ts +6 -1
  37. package/dist/core/git-pr/pr-lookup.d.ts.map +1 -1
  38. package/dist/core/git-pr/pr.d.ts +10 -0
  39. package/dist/core/git-pr/pr.d.ts.map +1 -1
  40. package/dist/core/index.js +54 -53
  41. package/dist/core/issues.d.ts +51 -0
  42. package/dist/core/issues.d.ts.map +1 -0
  43. package/dist/core/issues.test.d.ts +2 -0
  44. package/dist/core/issues.test.d.ts.map +1 -0
  45. package/dist/core/parse/parser.d.ts.map +1 -1
  46. package/dist/core/parse/schemas.d.ts +8 -4
  47. package/dist/core/parse/schemas.d.ts.map +1 -1
  48. package/dist/core/readers.d.ts +7 -2
  49. package/dist/core/readers.d.ts.map +1 -1
  50. package/dist/core/run-order.d.ts +1 -1
  51. package/dist/core/run-order.d.ts.map +1 -1
  52. package/dist/core/scaffold/scaffold.d.ts +0 -1
  53. package/dist/core/scaffold/scaffold.d.ts.map +1 -1
  54. package/dist/core/scaffold/templates.d.ts +1 -1
  55. package/dist/core/scaffold/templates.d.ts.map +1 -1
  56. package/dist/core/sections.d.ts.map +1 -1
  57. package/dist/core/serialize/serializer.d.ts +4 -2
  58. package/dist/core/serialize/serializer.d.ts.map +1 -1
  59. package/dist/core/status/status.d.ts +8 -4
  60. package/dist/core/status/status.d.ts.map +1 -1
  61. package/dist/types/index.d.ts +65 -5
  62. package/dist/types/index.d.ts.map +1 -1
  63. package/dist/types/index.js.map +1 -1
  64. package/package.json +2 -2
  65. package/dist/app/assets/index-nuVVSVma.js.map +0 -1
  66. package/dist/app/assets/index-s6CVH54G.js +0 -6
  67. package/dist/app/assets/index-s6CVH54G.js.map +0 -1
  68. package/dist/app/assets/main--EStESJz.js +0 -217
  69. package/dist/app/assets/main--EStESJz.js.map +0 -1
  70. package/dist/app/assets/main-CAJuC1Pz.css +0 -1
  71. package/dist/app/assets/sidebar-section-DTU8Naqm.js +0 -2
  72. package/dist/app/assets/sidebar-section-DTU8Naqm.js.map +0 -1
  73. package/dist/chunks/phase-progress.CwSKAAZ-.js.map +0 -1
@@ -1,217 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-BNoowtMI.js","./sidebar-section-DTU8Naqm.js","./index-D5j1njQR.js"])))=>i.map(i=>d[i]);
2
- (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();var dc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ou(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var hw={exports:{}},au={},pw={exports:{}},ie={};/**
3
- * @license React
4
- * react.production.min.js
5
- *
6
- * Copyright (c) Facebook, Inc. and its affiliates.
7
- *
8
- * This source code is licensed under the MIT license found in the
9
- * LICENSE file in the root directory of this source tree.
10
- */var Ca=Symbol.for("react.element"),YC=Symbol.for("react.portal"),qC=Symbol.for("react.fragment"),QC=Symbol.for("react.strict_mode"),XC=Symbol.for("react.profiler"),JC=Symbol.for("react.provider"),ZC=Symbol.for("react.context"),ej=Symbol.for("react.forward_ref"),tj=Symbol.for("react.suspense"),nj=Symbol.for("react.memo"),rj=Symbol.for("react.lazy"),Eg=Symbol.iterator;function sj(e){return e===null||typeof e!="object"?null:(e=Eg&&e[Eg]||e["@@iterator"],typeof e=="function"?e:null)}var mw={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},gw=Object.assign,yw={};function Bi(e,t,n){this.props=e,this.context=t,this.refs=yw,this.updater=n||mw}Bi.prototype.isReactComponent={};Bi.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")};Bi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function xw(){}xw.prototype=Bi.prototype;function gp(e,t,n){this.props=e,this.context=t,this.refs=yw,this.updater=n||mw}var yp=gp.prototype=new xw;yp.constructor=gp;gw(yp,Bi.prototype);yp.isPureReactComponent=!0;var Tg=Array.isArray,vw=Object.prototype.hasOwnProperty,xp={current:null},ww={key:!0,ref:!0,__self:!0,__source:!0};function bw(e,t,n){var r,s={},i=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)vw.call(t,r)&&!ww.hasOwnProperty(r)&&(s[r]=t[r]);var a=arguments.length-2;if(a===1)s.children=n;else if(1<a){for(var l=Array(a),c=0;c<a;c++)l[c]=arguments[c+2];s.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)s[r]===void 0&&(s[r]=a[r]);return{$$typeof:Ca,type:e,key:i,ref:o,props:s,_owner:xp.current}}function ij(e,t){return{$$typeof:Ca,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function vp(e){return typeof e=="object"&&e!==null&&e.$$typeof===Ca}function oj(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Ng=/\/+/g;function qu(e,t){return typeof e=="object"&&e!==null&&e.key!=null?oj(""+e.key):t.toString(36)}function Dl(e,t,n,r,s){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Ca:case YC:o=!0}}if(o)return o=e,s=s(o),e=r===""?"."+qu(o,0):r,Tg(s)?(n="",e!=null&&(n=e.replace(Ng,"$&/")+"/"),Dl(s,t,n,"",function(c){return c})):s!=null&&(vp(s)&&(s=ij(s,n+(!s.key||o&&o.key===s.key?"":(""+s.key).replace(Ng,"$&/")+"/")+e)),t.push(s)),1;if(o=0,r=r===""?".":r+":",Tg(e))for(var a=0;a<e.length;a++){i=e[a];var l=r+qu(i,a);o+=Dl(i,t,n,l,s)}else if(l=sj(e),typeof l=="function")for(e=l.call(e),a=0;!(i=e.next()).done;)i=i.value,l=r+qu(i,a++),o+=Dl(i,t,n,l,s);else if(i==="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 o}function Ya(e,t,n){if(e==null)return e;var r=[],s=0;return Dl(e,r,"","",function(i){return t.call(n,i,s++)}),r}function aj(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},Fl={transition:null},lj={ReactCurrentDispatcher:ht,ReactCurrentBatchConfig:Fl,ReactCurrentOwner:xp};function kw(){throw Error("act(...) is not supported in production builds of React.")}ie.Children={map:Ya,forEach:function(e,t,n){Ya(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Ya(e,function(){t++}),t},toArray:function(e){return Ya(e,function(t){return t})||[]},only:function(e){if(!vp(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ie.Component=Bi;ie.Fragment=qC;ie.Profiler=XC;ie.PureComponent=gp;ie.StrictMode=QC;ie.Suspense=tj;ie.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=lj;ie.act=kw;ie.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=gw({},e.props),s=e.key,i=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,o=xp.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)vw.call(t,l)&&!ww.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var c=0;c<l;c++)a[c]=arguments[c+2];r.children=a}return{$$typeof:Ca,type:e.type,key:s,ref:i,props:r,_owner:o}};ie.createContext=function(e){return e={$$typeof:ZC,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:JC,_context:e},e.Consumer=e};ie.createElement=bw;ie.createFactory=function(e){var t=bw.bind(null,e);return t.type=e,t};ie.createRef=function(){return{current:null}};ie.forwardRef=function(e){return{$$typeof:ej,render:e}};ie.isValidElement=vp;ie.lazy=function(e){return{$$typeof:rj,_payload:{_status:-1,_result:e},_init:aj}};ie.memo=function(e,t){return{$$typeof:nj,type:e,compare:t===void 0?null:t}};ie.startTransition=function(e){var t=Fl.transition;Fl.transition={};try{e()}finally{Fl.transition=t}};ie.unstable_act=kw;ie.useCallback=function(e,t){return ht.current.useCallback(e,t)};ie.useContext=function(e){return ht.current.useContext(e)};ie.useDebugValue=function(){};ie.useDeferredValue=function(e){return ht.current.useDeferredValue(e)};ie.useEffect=function(e,t){return ht.current.useEffect(e,t)};ie.useId=function(){return ht.current.useId()};ie.useImperativeHandle=function(e,t,n){return ht.current.useImperativeHandle(e,t,n)};ie.useInsertionEffect=function(e,t){return ht.current.useInsertionEffect(e,t)};ie.useLayoutEffect=function(e,t){return ht.current.useLayoutEffect(e,t)};ie.useMemo=function(e,t){return ht.current.useMemo(e,t)};ie.useReducer=function(e,t,n){return ht.current.useReducer(e,t,n)};ie.useRef=function(e){return ht.current.useRef(e)};ie.useState=function(e){return ht.current.useState(e)};ie.useSyncExternalStore=function(e,t,n){return ht.current.useSyncExternalStore(e,t,n)};ie.useTransition=function(){return ht.current.useTransition()};ie.version="18.3.1";pw.exports=ie;var b=pw.exports;const Pi=ou(b);/**
11
- * @license React
12
- * react-jsx-runtime.production.min.js
13
- *
14
- * Copyright (c) Facebook, Inc. and its affiliates.
15
- *
16
- * This source code is licensed under the MIT license found in the
17
- * LICENSE file in the root directory of this source tree.
18
- */var cj=b,uj=Symbol.for("react.element"),dj=Symbol.for("react.fragment"),fj=Object.prototype.hasOwnProperty,hj=cj.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,pj={key:!0,ref:!0,__self:!0,__source:!0};function _w(e,t,n){var r,s={},i=null,o=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)fj.call(t,r)&&!pj.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)s[r]===void 0&&(s[r]=t[r]);return{$$typeof:uj,type:e,key:i,ref:o,props:s,_owner:hj.current}}au.Fragment=dj;au.jsx=_w;au.jsxs=_w;hw.exports=au;var d=hw.exports,Sw={exports:{}},Bt={},Cw={exports:{}},jw={};/**
19
- * @license React
20
- * scheduler.production.min.js
21
- *
22
- * Copyright (c) Facebook, Inc. and its affiliates.
23
- *
24
- * This source code is licensed under the MIT license found in the
25
- * LICENSE file in the root directory of this source tree.
26
- */(function(e){function t(L,V){var _=L.length;L.push(V);e:for(;0<_;){var B=_-1>>>1,q=L[B];if(0<s(q,V))L[B]=V,L[_]=q,_=B;else break e}}function n(L){return L.length===0?null:L[0]}function r(L){if(L.length===0)return null;var V=L[0],_=L.pop();if(_!==V){L[0]=_;e:for(var B=0,q=L.length,N=q>>>1;B<N;){var ae=2*(B+1)-1,pe=L[ae],fe=ae+1,Tt=L[fe];if(0>s(pe,_))fe<q&&0>s(Tt,pe)?(L[B]=Tt,L[fe]=_,B=fe):(L[B]=pe,L[ae]=_,B=ae);else if(fe<q&&0>s(Tt,_))L[B]=Tt,L[fe]=_,B=fe;else break e}}return V}function s(L,V){var _=L.sortIndex-V.sortIndex;return _!==0?_:L.id-V.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var l=[],c=[],u=1,f=null,h=3,p=!1,m=!1,g=!1,w=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(L){for(var V=n(c);V!==null;){if(V.callback===null)r(c);else if(V.startTime<=L)r(c),V.sortIndex=V.expirationTime,t(l,V);else break;V=n(c)}}function k(L){if(g=!1,v(L),!m)if(n(l)!==null)m=!0,z(C);else{var V=n(c);V!==null&&O(k,V.startTime-L)}}function C(L,V){m=!1,g&&(g=!1,y(T),T=-1),p=!0;var _=h;try{for(v(V),f=n(l);f!==null&&(!(f.expirationTime>V)||L&&!R());){var B=f.callback;if(typeof B=="function"){f.callback=null,h=f.priorityLevel;var q=B(f.expirationTime<=V);V=e.unstable_now(),typeof q=="function"?f.callback=q:f===n(l)&&r(l),v(V)}else r(l);f=n(l)}if(f!==null)var N=!0;else{var ae=n(c);ae!==null&&O(k,ae.startTime-V),N=!1}return N}finally{f=null,h=_,p=!1}}var S=!1,P=null,T=-1,E=5,j=-1;function R(){return!(e.unstable_now()-j<E)}function I(){if(P!==null){var L=e.unstable_now();j=L;var V=!0;try{V=P(!0,L)}finally{V?D():(S=!1,P=null)}}else S=!1}var D;if(typeof x=="function")D=function(){x(I)};else if(typeof MessageChannel<"u"){var $=new MessageChannel,A=$.port2;$.port1.onmessage=I,D=function(){A.postMessage(null)}}else D=function(){w(I,0)};function z(L){P=L,S||(S=!0,D())}function O(L,V){T=w(function(){L(e.unstable_now())},V)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(L){L.callback=null},e.unstable_continueExecution=function(){m||p||(m=!0,z(C))},e.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<L?Math.floor(1e3/L):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(L){switch(h){case 1:case 2:case 3:var V=3;break;default:V=h}var _=h;h=V;try{return L()}finally{h=_}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(L,V){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var _=h;h=L;try{return V()}finally{h=_}},e.unstable_scheduleCallback=function(L,V,_){var B=e.unstable_now();switch(typeof _=="object"&&_!==null?(_=_.delay,_=typeof _=="number"&&0<_?B+_:B):_=B,L){case 1:var q=-1;break;case 2:q=250;break;case 5:q=1073741823;break;case 4:q=1e4;break;default:q=5e3}return q=_+q,L={id:u++,callback:V,priorityLevel:L,startTime:_,expirationTime:q,sortIndex:-1},_>B?(L.sortIndex=_,t(c,L),n(l)===null&&L===n(c)&&(g?(y(T),T=-1):g=!0,O(k,_-B))):(L.sortIndex=q,t(l,L),m||p||(m=!0,z(C))),L},e.unstable_shouldYield=R,e.unstable_wrapCallback=function(L){var V=h;return function(){var _=h;h=V;try{return L.apply(this,arguments)}finally{h=_}}}})(jw);Cw.exports=jw;var mj=Cw.exports;/**
27
- * @license React
28
- * react-dom.production.min.js
29
- *
30
- * Copyright (c) Facebook, Inc. and its affiliates.
31
- *
32
- * This source code is licensed under the MIT license found in the
33
- * LICENSE file in the root directory of this source tree.
34
- */var gj=b,zt=mj;function U(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 Pw=new Set,Zo={};function Ds(e,t){Ei(e,t),Ei(e+"Capture",t)}function Ei(e,t){for(Zo[e]=t,e=0;e<t.length;e++)Pw.add(t[e])}var rr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ef=Object.prototype.hasOwnProperty,yj=/^[: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]*$/,Rg={},Ag={};function xj(e){return Ef.call(Ag,e)?!0:Ef.call(Rg,e)?!1:yj.test(e)?Ag[e]=!0:(Rg[e]=!0,!1)}function vj(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 wj(e,t,n,r){if(t===null||typeof t>"u"||vj(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 pt(e,t,n,r,s,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var Ze={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ze[e]=new pt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ze[t]=new pt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ze[e]=new pt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ze[e]=new pt(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){Ze[e]=new pt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ze[e]=new pt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ze[e]=new pt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ze[e]=new pt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ze[e]=new pt(e,5,!1,e.toLowerCase(),null,!1,!1)});var wp=/[\-:]([a-z])/g;function bp(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(wp,bp);Ze[t]=new pt(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(wp,bp);Ze[t]=new pt(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(wp,bp);Ze[t]=new pt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ze[e]=new pt(e,1,!1,e.toLowerCase(),null,!1,!1)});Ze.xlinkHref=new pt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ze[e]=new pt(e,1,!1,e.toLowerCase(),null,!0,!0)});function kp(e,t,n,r){var s=Ze.hasOwnProperty(t)?Ze[t]:null;(s!==null?s.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(wj(t,n,s,r)&&(n=null),r||s===null?xj(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):s.mustUseProperty?e[s.propertyName]=n===null?s.type===3?!1:"":n:(t=s.attributeName,r=s.attributeNamespace,n===null?e.removeAttribute(t):(s=s.type,n=s===3||s===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var cr=gj.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,qa=Symbol.for("react.element"),ti=Symbol.for("react.portal"),ni=Symbol.for("react.fragment"),_p=Symbol.for("react.strict_mode"),Tf=Symbol.for("react.profiler"),Ew=Symbol.for("react.provider"),Tw=Symbol.for("react.context"),Sp=Symbol.for("react.forward_ref"),Nf=Symbol.for("react.suspense"),Rf=Symbol.for("react.suspense_list"),Cp=Symbol.for("react.memo"),_r=Symbol.for("react.lazy"),Nw=Symbol.for("react.offscreen"),Ig=Symbol.iterator;function so(e){return e===null||typeof e!="object"?null:(e=Ig&&e[Ig]||e["@@iterator"],typeof e=="function"?e:null)}var Re=Object.assign,Qu;function Po(e){if(Qu===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Qu=t&&t[1]||""}return`
35
- `+Qu+e}var Xu=!1;function Ju(e,t){if(!e||Xu)return"";Xu=!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 s=c.stack.split(`
36
- `),i=r.stack.split(`
37
- `),o=s.length-1,a=i.length-1;1<=o&&0<=a&&s[o]!==i[a];)a--;for(;1<=o&&0<=a;o--,a--)if(s[o]!==i[a]){if(o!==1||a!==1)do if(o--,a--,0>a||s[o]!==i[a]){var l=`
38
- `+s[o].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=o&&0<=a);break}}}finally{Xu=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Po(e):""}function bj(e){switch(e.tag){case 5:return Po(e.type);case 16:return Po("Lazy");case 13:return Po("Suspense");case 19:return Po("SuspenseList");case 0:case 2:case 15:return e=Ju(e.type,!1),e;case 11:return e=Ju(e.type.render,!1),e;case 1:return e=Ju(e.type,!0),e;default:return""}}function Af(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 ni:return"Fragment";case ti:return"Portal";case Tf:return"Profiler";case _p:return"StrictMode";case Nf:return"Suspense";case Rf:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Tw:return(e.displayName||"Context")+".Consumer";case Ew:return(e._context.displayName||"Context")+".Provider";case Sp:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Cp:return t=e.displayName||null,t!==null?t:Af(e.type)||"Memo";case _r:t=e._payload,e=e._init;try{return Af(e(t))}catch{}}return null}function kj(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 Af(t);case 8:return t===_p?"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 Kr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Rw(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function _j(e){var t=Rw(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 s=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Qa(e){e._valueTracker||(e._valueTracker=_j(e))}function Aw(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Rw(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function fc(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 If(e,t){var n=t.checked;return Re({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Mg(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Kr(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 Iw(e,t){t=t.checked,t!=null&&kp(e,"checked",t,!1)}function Mf(e,t){Iw(e,t);var n=Kr(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")?Lf(e,t.type,n):t.hasOwnProperty("defaultValue")&&Lf(e,t.type,Kr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Lg(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 Lf(e,t,n){(t!=="number"||fc(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Eo=Array.isArray;function yi(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Kr(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,r&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function Df(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(U(91));return Re({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Dg(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(U(92));if(Eo(n)){if(1<n.length)throw Error(U(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Kr(n)}}function Mw(e,t){var n=Kr(t.value),r=Kr(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 Fg(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Lw(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 Ff(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Lw(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Xa,Dw=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,s){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Xa=Xa||document.createElement("div"),Xa.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Xa.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ea(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Mo={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},Sj=["Webkit","ms","Moz","O"];Object.keys(Mo).forEach(function(e){Sj.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Mo[t]=Mo[e]})});function Fw(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Mo.hasOwnProperty(e)&&Mo[e]?(""+t).trim():t+"px"}function Ow(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=Fw(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var Cj=Re({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 Of(e,t){if(t){if(Cj[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(U(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(U(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(U(61))}if(t.style!=null&&typeof t.style!="object")throw Error(U(62))}}function $f(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 zf=null;function jp(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Bf=null,xi=null,vi=null;function Og(e){if(e=Ea(e)){if(typeof Bf!="function")throw Error(U(280));var t=e.stateNode;t&&(t=fu(t),Bf(e.stateNode,e.type,t))}}function $w(e){xi?vi?vi.push(e):vi=[e]:xi=e}function zw(){if(xi){var e=xi,t=vi;if(vi=xi=null,Og(e),t)for(e=0;e<t.length;e++)Og(t[e])}}function Bw(e,t){return e(t)}function Vw(){}var Zu=!1;function Uw(e,t,n){if(Zu)return e(t,n);Zu=!0;try{return Bw(e,t,n)}finally{Zu=!1,(xi!==null||vi!==null)&&(Vw(),zw())}}function ta(e,t){var n=e.stateNode;if(n===null)return null;var r=fu(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(U(231,t,typeof n));return n}var Vf=!1;if(rr)try{var io={};Object.defineProperty(io,"passive",{get:function(){Vf=!0}}),window.addEventListener("test",io,io),window.removeEventListener("test",io,io)}catch{Vf=!1}function jj(e,t,n,r,s,i,o,a,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(u){this.onError(u)}}var Lo=!1,hc=null,pc=!1,Uf=null,Pj={onError:function(e){Lo=!0,hc=e}};function Ej(e,t,n,r,s,i,o,a,l){Lo=!1,hc=null,jj.apply(Pj,arguments)}function Tj(e,t,n,r,s,i,o,a,l){if(Ej.apply(this,arguments),Lo){if(Lo){var c=hc;Lo=!1,hc=null}else throw Error(U(198));pc||(pc=!0,Uf=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 Ww(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 $g(e){if(Fs(e)!==e)throw Error(U(188))}function Nj(e){var t=e.alternate;if(!t){if(t=Fs(e),t===null)throw Error(U(188));return t!==e?null:e}for(var n=e,r=t;;){var s=n.return;if(s===null)break;var i=s.alternate;if(i===null){if(r=s.return,r!==null){n=r;continue}break}if(s.child===i.child){for(i=s.child;i;){if(i===n)return $g(s),e;if(i===r)return $g(s),t;i=i.sibling}throw Error(U(188))}if(n.return!==r.return)n=s,r=i;else{for(var o=!1,a=s.child;a;){if(a===n){o=!0,n=s,r=i;break}if(a===r){o=!0,r=s,n=i;break}a=a.sibling}if(!o){for(a=i.child;a;){if(a===n){o=!0,n=i,r=s;break}if(a===r){o=!0,r=i,n=s;break}a=a.sibling}if(!o)throw Error(U(189))}}if(n.alternate!==r)throw Error(U(190))}if(n.tag!==3)throw Error(U(188));return n.stateNode.current===n?e:t}function Hw(e){return e=Nj(e),e!==null?Gw(e):null}function Gw(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Gw(e);if(t!==null)return t;e=e.sibling}return null}var Kw=zt.unstable_scheduleCallback,zg=zt.unstable_cancelCallback,Rj=zt.unstable_shouldYield,Aj=zt.unstable_requestPaint,De=zt.unstable_now,Ij=zt.unstable_getCurrentPriorityLevel,Pp=zt.unstable_ImmediatePriority,Yw=zt.unstable_UserBlockingPriority,mc=zt.unstable_NormalPriority,Mj=zt.unstable_LowPriority,qw=zt.unstable_IdlePriority,lu=null,$n=null;function Lj(e){if($n&&typeof $n.onCommitFiberRoot=="function")try{$n.onCommitFiberRoot(lu,e,void 0,(e.current.flags&128)===128)}catch{}}var yn=Math.clz32?Math.clz32:Oj,Dj=Math.log,Fj=Math.LN2;function Oj(e){return e>>>=0,e===0?32:31-(Dj(e)/Fj|0)|0}var Ja=64,Za=4194304;function To(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 gc(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,i=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~s;a!==0?r=To(a):(i&=o,i!==0&&(r=To(i)))}else o=n&~s,o!==0?r=To(o):i!==0&&(r=To(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,i=t&-t,s>=i||s===16&&(i&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-yn(t),s=1<<n,r|=e[n],t&=~s;return r}function $j(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 zj(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,i=e.pendingLanes;0<i;){var o=31-yn(i),a=1<<o,l=s[o];l===-1?(!(a&n)||a&r)&&(s[o]=$j(a,t)):l<=t&&(e.expiredLanes|=a),i&=~a}}function Wf(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Qw(){var e=Ja;return Ja<<=1,!(Ja&4194240)&&(Ja=64),e}function ed(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ja(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-yn(t),e[t]=n}function Bj(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 s=31-yn(n),i=1<<s;t[s]=0,r[s]=-1,e[s]=-1,n&=~i}}function Ep(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-yn(n),s=1<<r;s&t|e[r]&t&&(e[r]|=t),n&=~s}}var ue=0;function Xw(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Jw,Tp,Zw,e1,t1,Hf=!1,el=[],Fr=null,Or=null,$r=null,na=new Map,ra=new Map,Er=[],Vj="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 Bg(e,t){switch(e){case"focusin":case"focusout":Fr=null;break;case"dragenter":case"dragleave":Or=null;break;case"mouseover":case"mouseout":$r=null;break;case"pointerover":case"pointerout":na.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ra.delete(t.pointerId)}}function oo(e,t,n,r,s,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[s]},t!==null&&(t=Ea(t),t!==null&&Tp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function Uj(e,t,n,r,s){switch(t){case"focusin":return Fr=oo(Fr,e,t,n,r,s),!0;case"dragenter":return Or=oo(Or,e,t,n,r,s),!0;case"mouseover":return $r=oo($r,e,t,n,r,s),!0;case"pointerover":var i=s.pointerId;return na.set(i,oo(na.get(i)||null,e,t,n,r,s)),!0;case"gotpointercapture":return i=s.pointerId,ra.set(i,oo(ra.get(i)||null,e,t,n,r,s)),!0}return!1}function n1(e){var t=gs(e.target);if(t!==null){var n=Fs(t);if(n!==null){if(t=n.tag,t===13){if(t=Ww(n),t!==null){e.blockedOn=t,t1(e.priority,function(){Zw(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 Ol(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Gf(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);zf=r,n.target.dispatchEvent(r),zf=null}else return t=Ea(n),t!==null&&Tp(t),e.blockedOn=n,!1;t.shift()}return!0}function Vg(e,t,n){Ol(e)&&n.delete(t)}function Wj(){Hf=!1,Fr!==null&&Ol(Fr)&&(Fr=null),Or!==null&&Ol(Or)&&(Or=null),$r!==null&&Ol($r)&&($r=null),na.forEach(Vg),ra.forEach(Vg)}function ao(e,t){e.blockedOn===t&&(e.blockedOn=null,Hf||(Hf=!0,zt.unstable_scheduleCallback(zt.unstable_NormalPriority,Wj)))}function sa(e){function t(s){return ao(s,e)}if(0<el.length){ao(el[0],e);for(var n=1;n<el.length;n++){var r=el[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Fr!==null&&ao(Fr,e),Or!==null&&ao(Or,e),$r!==null&&ao($r,e),na.forEach(t),ra.forEach(t),n=0;n<Er.length;n++)r=Er[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Er.length&&(n=Er[0],n.blockedOn===null);)n1(n),n.blockedOn===null&&Er.shift()}var wi=cr.ReactCurrentBatchConfig,yc=!0;function Hj(e,t,n,r){var s=ue,i=wi.transition;wi.transition=null;try{ue=1,Np(e,t,n,r)}finally{ue=s,wi.transition=i}}function Gj(e,t,n,r){var s=ue,i=wi.transition;wi.transition=null;try{ue=4,Np(e,t,n,r)}finally{ue=s,wi.transition=i}}function Np(e,t,n,r){if(yc){var s=Gf(e,t,n,r);if(s===null)ud(e,t,r,xc,n),Bg(e,r);else if(Uj(s,e,t,n,r))r.stopPropagation();else if(Bg(e,r),t&4&&-1<Vj.indexOf(e)){for(;s!==null;){var i=Ea(s);if(i!==null&&Jw(i),i=Gf(e,t,n,r),i===null&&ud(e,t,r,xc,n),i===s)break;s=i}s!==null&&r.stopPropagation()}else ud(e,t,r,null,n)}}var xc=null;function Gf(e,t,n,r){if(xc=null,e=jp(r),e=gs(e),e!==null)if(t=Fs(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Ww(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 xc=e,null}function r1(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(Ij()){case Pp:return 1;case Yw:return 4;case mc:case Mj:return 16;case qw:return 536870912;default:return 16}default:return 16}}var Nr=null,Rp=null,$l=null;function s1(){if($l)return $l;var e,t=Rp,n=t.length,r,s="value"in Nr?Nr.value:Nr.textContent,i=s.length;for(e=0;e<n&&t[e]===s[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===s[i-r];r++);return $l=s.slice(e,1<r?1-r:void 0)}function zl(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 tl(){return!0}function Ug(){return!1}function Vt(e){function t(n,r,s,i,o){this._reactName=n,this._targetInst=s,this.type=r,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?tl:Ug,this.isPropagationStopped=Ug,this}return Re(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=tl)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=tl)},persist:function(){},isPersistent:tl}),t}var Vi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ap=Vt(Vi),Pa=Re({},Vi,{view:0,detail:0}),Kj=Vt(Pa),td,nd,lo,cu=Re({},Pa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ip,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!==lo&&(lo&&e.type==="mousemove"?(td=e.screenX-lo.screenX,nd=e.screenY-lo.screenY):nd=td=0,lo=e),td)},movementY:function(e){return"movementY"in e?e.movementY:nd}}),Wg=Vt(cu),Yj=Re({},cu,{dataTransfer:0}),qj=Vt(Yj),Qj=Re({},Pa,{relatedTarget:0}),rd=Vt(Qj),Xj=Re({},Vi,{animationName:0,elapsedTime:0,pseudoElement:0}),Jj=Vt(Xj),Zj=Re({},Vi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),eP=Vt(Zj),tP=Re({},Vi,{data:0}),Hg=Vt(tP),nP={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},rP={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"},sP={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function iP(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=sP[e])?!!t[e]:!1}function Ip(){return iP}var oP=Re({},Pa,{key:function(e){if(e.key){var t=nP[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=zl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?rP[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ip,charCode:function(e){return e.type==="keypress"?zl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?zl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),aP=Vt(oP),lP=Re({},cu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Gg=Vt(lP),cP=Re({},Pa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ip}),uP=Vt(cP),dP=Re({},Vi,{propertyName:0,elapsedTime:0,pseudoElement:0}),fP=Vt(dP),hP=Re({},cu,{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}),pP=Vt(hP),mP=[9,13,27,32],Mp=rr&&"CompositionEvent"in window,Do=null;rr&&"documentMode"in document&&(Do=document.documentMode);var gP=rr&&"TextEvent"in window&&!Do,i1=rr&&(!Mp||Do&&8<Do&&11>=Do),Kg=" ",Yg=!1;function o1(e,t){switch(e){case"keyup":return mP.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function a1(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ri=!1;function yP(e,t){switch(e){case"compositionend":return a1(t);case"keypress":return t.which!==32?null:(Yg=!0,Kg);case"textInput":return e=t.data,e===Kg&&Yg?null:e;default:return null}}function xP(e,t){if(ri)return e==="compositionend"||!Mp&&o1(e,t)?(e=s1(),$l=Rp=Nr=null,ri=!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 i1&&t.locale!=="ko"?null:t.data;default:return null}}var vP={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 qg(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!vP[e.type]:t==="textarea"}function l1(e,t,n,r){$w(r),t=vc(t,"onChange"),0<t.length&&(n=new Ap("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Fo=null,ia=null;function wP(e){v1(e,0)}function uu(e){var t=oi(e);if(Aw(t))return e}function bP(e,t){if(e==="change")return t}var c1=!1;if(rr){var sd;if(rr){var id="oninput"in document;if(!id){var Qg=document.createElement("div");Qg.setAttribute("oninput","return;"),id=typeof Qg.oninput=="function"}sd=id}else sd=!1;c1=sd&&(!document.documentMode||9<document.documentMode)}function Xg(){Fo&&(Fo.detachEvent("onpropertychange",u1),ia=Fo=null)}function u1(e){if(e.propertyName==="value"&&uu(ia)){var t=[];l1(t,ia,e,jp(e)),Uw(wP,t)}}function kP(e,t,n){e==="focusin"?(Xg(),Fo=t,ia=n,Fo.attachEvent("onpropertychange",u1)):e==="focusout"&&Xg()}function _P(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return uu(ia)}function SP(e,t){if(e==="click")return uu(t)}function CP(e,t){if(e==="input"||e==="change")return uu(t)}function jP(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var wn=typeof Object.is=="function"?Object.is:jP;function oa(e,t){if(wn(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 s=n[r];if(!Ef.call(t,s)||!wn(e[s],t[s]))return!1}return!0}function Jg(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Zg(e,t){var n=Jg(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=Jg(n)}}function d1(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?d1(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function f1(){for(var e=window,t=fc();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=fc(e.document)}return t}function Lp(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 PP(e){var t=f1(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&d1(n.ownerDocument.documentElement,n)){if(r!==null&&Lp(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 s=n.textContent.length,i=Math.min(r.start,s);r=r.end===void 0?i:Math.min(r.end,s),!e.extend&&i>r&&(s=r,r=i,i=s),s=Zg(n,i);var o=Zg(n,r);s&&o&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.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 EP=rr&&"documentMode"in document&&11>=document.documentMode,si=null,Kf=null,Oo=null,Yf=!1;function ey(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Yf||si==null||si!==fc(r)||(r=si,"selectionStart"in r&&Lp(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}),Oo&&oa(Oo,r)||(Oo=r,r=vc(Kf,"onSelect"),0<r.length&&(t=new Ap("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=si)))}function nl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ii={animationend:nl("Animation","AnimationEnd"),animationiteration:nl("Animation","AnimationIteration"),animationstart:nl("Animation","AnimationStart"),transitionend:nl("Transition","TransitionEnd")},od={},h1={};rr&&(h1=document.createElement("div").style,"AnimationEvent"in window||(delete ii.animationend.animation,delete ii.animationiteration.animation,delete ii.animationstart.animation),"TransitionEvent"in window||delete ii.transitionend.transition);function du(e){if(od[e])return od[e];if(!ii[e])return e;var t=ii[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in h1)return od[e]=t[n];return e}var p1=du("animationend"),m1=du("animationiteration"),g1=du("animationstart"),y1=du("transitionend"),x1=new Map,ty="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 Jr(e,t){x1.set(e,t),Ds(t,[e])}for(var ad=0;ad<ty.length;ad++){var ld=ty[ad],TP=ld.toLowerCase(),NP=ld[0].toUpperCase()+ld.slice(1);Jr(TP,"on"+NP)}Jr(p1,"onAnimationEnd");Jr(m1,"onAnimationIteration");Jr(g1,"onAnimationStart");Jr("dblclick","onDoubleClick");Jr("focusin","onFocus");Jr("focusout","onBlur");Jr(y1,"onTransitionEnd");Ei("onMouseEnter",["mouseout","mouseover"]);Ei("onMouseLeave",["mouseout","mouseover"]);Ei("onPointerEnter",["pointerout","pointerover"]);Ei("onPointerLeave",["pointerout","pointerover"]);Ds("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Ds("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Ds("onBeforeInput",["compositionend","keypress","textInput","paste"]);Ds("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Ds("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Ds("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var No="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(" "),RP=new Set("cancel close invalid load scroll toggle".split(" ").concat(No));function ny(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,Tj(r,t,void 0,e),e.currentTarget=null}function v1(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],s=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var o=r.length-1;0<=o;o--){var a=r[o],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==i&&s.isPropagationStopped())break e;ny(s,a,c),i=l}else for(o=0;o<r.length;o++){if(a=r[o],l=a.instance,c=a.currentTarget,a=a.listener,l!==i&&s.isPropagationStopped())break e;ny(s,a,c),i=l}}}if(pc)throw e=Uf,pc=!1,Uf=null,e}function Ce(e,t){var n=t[Zf];n===void 0&&(n=t[Zf]=new Set);var r=e+"__bubble";n.has(r)||(w1(t,e,2,!1),n.add(r))}function cd(e,t,n){var r=0;t&&(r|=4),w1(n,e,r,t)}var rl="_reactListening"+Math.random().toString(36).slice(2);function aa(e){if(!e[rl]){e[rl]=!0,Pw.forEach(function(n){n!=="selectionchange"&&(RP.has(n)||cd(n,!1,e),cd(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[rl]||(t[rl]=!0,cd("selectionchange",!1,t))}}function w1(e,t,n,r){switch(r1(t)){case 1:var s=Hj;break;case 4:s=Gj;break;default:s=Np}n=s.bind(null,t,n,e),s=void 0,!Vf||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),r?s!==void 0?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):s!==void 0?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}function ud(e,t,n,r,s){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var a=r.stateNode.containerInfo;if(a===s||a.nodeType===8&&a.parentNode===s)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===s||l.nodeType===8&&l.parentNode===s))return;o=o.return}for(;a!==null;){if(o=gs(a),o===null)return;if(l=o.tag,l===5||l===6){r=i=o;continue e}a=a.parentNode}}r=r.return}Uw(function(){var c=i,u=jp(n),f=[];e:{var h=x1.get(e);if(h!==void 0){var p=Ap,m=e;switch(e){case"keypress":if(zl(n)===0)break e;case"keydown":case"keyup":p=aP;break;case"focusin":m="focus",p=rd;break;case"focusout":m="blur",p=rd;break;case"beforeblur":case"afterblur":p=rd;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=Wg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=qj;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=uP;break;case p1:case m1:case g1:p=Jj;break;case y1:p=fP;break;case"scroll":p=Kj;break;case"wheel":p=pP;break;case"copy":case"cut":case"paste":p=eP;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=Gg}var g=(t&4)!==0,w=!g&&e==="scroll",y=g?h!==null?h+"Capture":null:h;g=[];for(var x=c,v;x!==null;){v=x;var k=v.stateNode;if(v.tag===5&&k!==null&&(v=k,y!==null&&(k=ta(x,y),k!=null&&g.push(la(x,k,v)))),w)break;x=x.return}0<g.length&&(h=new p(h,m,null,n,u),f.push({event:h,listeners:g}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",h&&n!==zf&&(m=n.relatedTarget||n.fromElement)&&(gs(m)||m[sr]))break e;if((p||h)&&(h=u.window===u?u:(h=u.ownerDocument)?h.defaultView||h.parentWindow:window,p?(m=n.relatedTarget||n.toElement,p=c,m=m?gs(m):null,m!==null&&(w=Fs(m),m!==w||m.tag!==5&&m.tag!==6)&&(m=null)):(p=null,m=c),p!==m)){if(g=Wg,k="onMouseLeave",y="onMouseEnter",x="mouse",(e==="pointerout"||e==="pointerover")&&(g=Gg,k="onPointerLeave",y="onPointerEnter",x="pointer"),w=p==null?h:oi(p),v=m==null?h:oi(m),h=new g(k,x+"leave",p,n,u),h.target=w,h.relatedTarget=v,k=null,gs(u)===c&&(g=new g(y,x+"enter",m,n,u),g.target=v,g.relatedTarget=w,k=g),w=k,p&&m)t:{for(g=p,y=m,x=0,v=g;v;v=Hs(v))x++;for(v=0,k=y;k;k=Hs(k))v++;for(;0<x-v;)g=Hs(g),x--;for(;0<v-x;)y=Hs(y),v--;for(;x--;){if(g===y||y!==null&&g===y.alternate)break t;g=Hs(g),y=Hs(y)}g=null}else g=null;p!==null&&ry(f,h,p,g,!1),m!==null&&w!==null&&ry(f,w,m,g,!0)}}e:{if(h=c?oi(c):window,p=h.nodeName&&h.nodeName.toLowerCase(),p==="select"||p==="input"&&h.type==="file")var C=bP;else if(qg(h))if(c1)C=CP;else{C=_P;var S=kP}else(p=h.nodeName)&&p.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(C=SP);if(C&&(C=C(e,c))){l1(f,C,n,u);break e}S&&S(e,h,c),e==="focusout"&&(S=h._wrapperState)&&S.controlled&&h.type==="number"&&Lf(h,"number",h.value)}switch(S=c?oi(c):window,e){case"focusin":(qg(S)||S.contentEditable==="true")&&(si=S,Kf=c,Oo=null);break;case"focusout":Oo=Kf=si=null;break;case"mousedown":Yf=!0;break;case"contextmenu":case"mouseup":case"dragend":Yf=!1,ey(f,n,u);break;case"selectionchange":if(EP)break;case"keydown":case"keyup":ey(f,n,u)}var P;if(Mp)e:{switch(e){case"compositionstart":var T="onCompositionStart";break e;case"compositionend":T="onCompositionEnd";break e;case"compositionupdate":T="onCompositionUpdate";break e}T=void 0}else ri?o1(e,n)&&(T="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(T="onCompositionStart");T&&(i1&&n.locale!=="ko"&&(ri||T!=="onCompositionStart"?T==="onCompositionEnd"&&ri&&(P=s1()):(Nr=u,Rp="value"in Nr?Nr.value:Nr.textContent,ri=!0)),S=vc(c,T),0<S.length&&(T=new Hg(T,e,null,n,u),f.push({event:T,listeners:S}),P?T.data=P:(P=a1(n),P!==null&&(T.data=P)))),(P=gP?yP(e,n):xP(e,n))&&(c=vc(c,"onBeforeInput"),0<c.length&&(u=new Hg("onBeforeInput","beforeinput",null,n,u),f.push({event:u,listeners:c}),u.data=P))}v1(f,t)})}function la(e,t,n){return{instance:e,listener:t,currentTarget:n}}function vc(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,i=s.stateNode;s.tag===5&&i!==null&&(s=i,i=ta(e,n),i!=null&&r.unshift(la(e,i,s)),i=ta(e,t),i!=null&&r.push(la(e,i,s))),e=e.return}return r}function Hs(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function ry(e,t,n,r,s){for(var i=t._reactName,o=[];n!==null&&n!==r;){var a=n,l=a.alternate,c=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&c!==null&&(a=c,s?(l=ta(n,i),l!=null&&o.unshift(la(n,l,a))):s||(l=ta(n,i),l!=null&&o.push(la(n,l,a)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var AP=/\r\n?/g,IP=/\u0000|\uFFFD/g;function sy(e){return(typeof e=="string"?e:""+e).replace(AP,`
39
- `).replace(IP,"")}function sl(e,t,n){if(t=sy(t),sy(e)!==t&&n)throw Error(U(425))}function wc(){}var qf=null,Qf=null;function Xf(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 Jf=typeof setTimeout=="function"?setTimeout:void 0,MP=typeof clearTimeout=="function"?clearTimeout:void 0,iy=typeof Promise=="function"?Promise:void 0,LP=typeof queueMicrotask=="function"?queueMicrotask:typeof iy<"u"?function(e){return iy.resolve(null).then(e).catch(DP)}:Jf;function DP(e){setTimeout(function(){throw e})}function dd(e,t){var n=t,r=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(r===0){e.removeChild(s),sa(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);sa(t)}function zr(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 oy(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 Ui=Math.random().toString(36).slice(2),Fn="__reactFiber$"+Ui,ca="__reactProps$"+Ui,sr="__reactContainer$"+Ui,Zf="__reactEvents$"+Ui,FP="__reactListeners$"+Ui,OP="__reactHandles$"+Ui;function gs(e){var t=e[Fn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[sr]||n[Fn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=oy(e);e!==null;){if(n=e[Fn])return n;e=oy(e)}return t}e=n,n=e.parentNode}return null}function Ea(e){return e=e[Fn]||e[sr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function oi(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(U(33))}function fu(e){return e[ca]||null}var eh=[],ai=-1;function Zr(e){return{current:e}}function je(e){0>ai||(e.current=eh[ai],eh[ai]=null,ai--)}function we(e,t){ai++,eh[ai]=e.current,e.current=t}var Yr={},it=Zr(Yr),bt=Zr(!1),Rs=Yr;function Ti(e,t){var n=e.type.contextTypes;if(!n)return Yr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in n)s[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function kt(e){return e=e.childContextTypes,e!=null}function bc(){je(bt),je(it)}function ay(e,t,n){if(it.current!==Yr)throw Error(U(168));we(it,t),we(bt,n)}function b1(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(U(108,kj(e)||"Unknown",s));return Re({},n,r)}function kc(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Yr,Rs=it.current,we(it,e),we(bt,bt.current),!0}function ly(e,t,n){var r=e.stateNode;if(!r)throw Error(U(169));n?(e=b1(e,t,Rs),r.__reactInternalMemoizedMergedChildContext=e,je(bt),je(it),we(it,e)):je(bt),we(bt,n)}var Jn=null,hu=!1,fd=!1;function k1(e){Jn===null?Jn=[e]:Jn.push(e)}function $P(e){hu=!0,k1(e)}function es(){if(!fd&&Jn!==null){fd=!0;var e=0,t=ue;try{var n=Jn;for(ue=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Jn=null,hu=!1}catch(s){throw Jn!==null&&(Jn=Jn.slice(e+1)),Kw(Pp,es),s}finally{ue=t,fd=!1}}return null}var li=[],ci=0,_c=null,Sc=0,qt=[],Qt=0,As=null,Zn=1,er="";function ds(e,t){li[ci++]=Sc,li[ci++]=_c,_c=e,Sc=t}function _1(e,t,n){qt[Qt++]=Zn,qt[Qt++]=er,qt[Qt++]=As,As=e;var r=Zn;e=er;var s=32-yn(r)-1;r&=~(1<<s),n+=1;var i=32-yn(t)+s;if(30<i){var o=s-s%5;i=(r&(1<<o)-1).toString(32),r>>=o,s-=o,Zn=1<<32-yn(t)+s|n<<s|r,er=i+e}else Zn=1<<i|n<<s|r,er=e}function Dp(e){e.return!==null&&(ds(e,1),_1(e,1,0))}function Fp(e){for(;e===_c;)_c=li[--ci],li[ci]=null,Sc=li[--ci],li[ci]=null;for(;e===As;)As=qt[--Qt],qt[Qt]=null,er=qt[--Qt],qt[Qt]=null,Zn=qt[--Qt],qt[Qt]=null}var Ot=null,Dt=null,Ee=!1,gn=null;function S1(e,t){var n=Jt(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 cy(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,Ot=e,Dt=zr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Ot=e,Dt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=As!==null?{id:Zn,overflow:er}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Jt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Ot=e,Dt=null,!0):!1;default:return!1}}function th(e){return(e.mode&1)!==0&&(e.flags&128)===0}function nh(e){if(Ee){var t=Dt;if(t){var n=t;if(!cy(e,t)){if(th(e))throw Error(U(418));t=zr(n.nextSibling);var r=Ot;t&&cy(e,t)?S1(r,n):(e.flags=e.flags&-4097|2,Ee=!1,Ot=e)}}else{if(th(e))throw Error(U(418));e.flags=e.flags&-4097|2,Ee=!1,Ot=e}}}function uy(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Ot=e}function il(e){if(e!==Ot)return!1;if(!Ee)return uy(e),Ee=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Xf(e.type,e.memoizedProps)),t&&(t=Dt)){if(th(e))throw C1(),Error(U(418));for(;t;)S1(e,t),t=zr(t.nextSibling)}if(uy(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(U(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Dt=zr(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Dt=null}}else Dt=Ot?zr(e.stateNode.nextSibling):null;return!0}function C1(){for(var e=Dt;e;)e=zr(e.nextSibling)}function Ni(){Dt=Ot=null,Ee=!1}function Op(e){gn===null?gn=[e]:gn.push(e)}var zP=cr.ReactCurrentBatchConfig;function co(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(U(309));var r=n.stateNode}if(!r)throw Error(U(147,e));var s=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(o){var a=s.refs;o===null?delete a[i]:a[i]=o},t._stringRef=i,t)}if(typeof e!="string")throw Error(U(284));if(!n._owner)throw Error(U(290,e))}return e}function ol(e,t){throw e=Object.prototype.toString.call(t),Error(U(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function dy(e){var t=e._init;return t(e._payload)}function j1(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 s(y,x){return y=Wr(y,x),y.index=0,y.sibling=null,y}function i(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 o(y){return e&&y.alternate===null&&(y.flags|=2),y}function a(y,x,v,k){return x===null||x.tag!==6?(x=vd(v,y.mode,k),x.return=y,x):(x=s(x,v),x.return=y,x)}function l(y,x,v,k){var C=v.type;return C===ni?u(y,x,v.props.children,k,v.key):x!==null&&(x.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===_r&&dy(C)===x.type)?(k=s(x,v.props),k.ref=co(y,x,v),k.return=y,k):(k=Kl(v.type,v.key,v.props,null,y.mode,k),k.ref=co(y,x,v),k.return=y,k)}function c(y,x,v,k){return x===null||x.tag!==4||x.stateNode.containerInfo!==v.containerInfo||x.stateNode.implementation!==v.implementation?(x=wd(v,y.mode,k),x.return=y,x):(x=s(x,v.children||[]),x.return=y,x)}function u(y,x,v,k,C){return x===null||x.tag!==7?(x=_s(v,y.mode,k,C),x.return=y,x):(x=s(x,v),x.return=y,x)}function f(y,x,v){if(typeof x=="string"&&x!==""||typeof x=="number")return x=vd(""+x,y.mode,v),x.return=y,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case qa:return v=Kl(x.type,x.key,x.props,null,y.mode,v),v.ref=co(y,null,x),v.return=y,v;case ti:return x=wd(x,y.mode,v),x.return=y,x;case _r:var k=x._init;return f(y,k(x._payload),v)}if(Eo(x)||so(x))return x=_s(x,y.mode,v,null),x.return=y,x;ol(y,x)}return null}function h(y,x,v,k){var C=x!==null?x.key:null;if(typeof v=="string"&&v!==""||typeof v=="number")return C!==null?null:a(y,x,""+v,k);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case qa:return v.key===C?l(y,x,v,k):null;case ti:return v.key===C?c(y,x,v,k):null;case _r:return C=v._init,h(y,x,C(v._payload),k)}if(Eo(v)||so(v))return C!==null?null:u(y,x,v,k,null);ol(y,v)}return null}function p(y,x,v,k,C){if(typeof k=="string"&&k!==""||typeof k=="number")return y=y.get(v)||null,a(x,y,""+k,C);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case qa:return y=y.get(k.key===null?v:k.key)||null,l(x,y,k,C);case ti:return y=y.get(k.key===null?v:k.key)||null,c(x,y,k,C);case _r:var S=k._init;return p(y,x,v,S(k._payload),C)}if(Eo(k)||so(k))return y=y.get(v)||null,u(x,y,k,C,null);ol(x,k)}return null}function m(y,x,v,k){for(var C=null,S=null,P=x,T=x=0,E=null;P!==null&&T<v.length;T++){P.index>T?(E=P,P=null):E=P.sibling;var j=h(y,P,v[T],k);if(j===null){P===null&&(P=E);break}e&&P&&j.alternate===null&&t(y,P),x=i(j,x,T),S===null?C=j:S.sibling=j,S=j,P=E}if(T===v.length)return n(y,P),Ee&&ds(y,T),C;if(P===null){for(;T<v.length;T++)P=f(y,v[T],k),P!==null&&(x=i(P,x,T),S===null?C=P:S.sibling=P,S=P);return Ee&&ds(y,T),C}for(P=r(y,P);T<v.length;T++)E=p(P,y,T,v[T],k),E!==null&&(e&&E.alternate!==null&&P.delete(E.key===null?T:E.key),x=i(E,x,T),S===null?C=E:S.sibling=E,S=E);return e&&P.forEach(function(R){return t(y,R)}),Ee&&ds(y,T),C}function g(y,x,v,k){var C=so(v);if(typeof C!="function")throw Error(U(150));if(v=C.call(v),v==null)throw Error(U(151));for(var S=C=null,P=x,T=x=0,E=null,j=v.next();P!==null&&!j.done;T++,j=v.next()){P.index>T?(E=P,P=null):E=P.sibling;var R=h(y,P,j.value,k);if(R===null){P===null&&(P=E);break}e&&P&&R.alternate===null&&t(y,P),x=i(R,x,T),S===null?C=R:S.sibling=R,S=R,P=E}if(j.done)return n(y,P),Ee&&ds(y,T),C;if(P===null){for(;!j.done;T++,j=v.next())j=f(y,j.value,k),j!==null&&(x=i(j,x,T),S===null?C=j:S.sibling=j,S=j);return Ee&&ds(y,T),C}for(P=r(y,P);!j.done;T++,j=v.next())j=p(P,y,T,j.value,k),j!==null&&(e&&j.alternate!==null&&P.delete(j.key===null?T:j.key),x=i(j,x,T),S===null?C=j:S.sibling=j,S=j);return e&&P.forEach(function(I){return t(y,I)}),Ee&&ds(y,T),C}function w(y,x,v,k){if(typeof v=="object"&&v!==null&&v.type===ni&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case qa:e:{for(var C=v.key,S=x;S!==null;){if(S.key===C){if(C=v.type,C===ni){if(S.tag===7){n(y,S.sibling),x=s(S,v.props.children),x.return=y,y=x;break e}}else if(S.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===_r&&dy(C)===S.type){n(y,S.sibling),x=s(S,v.props),x.ref=co(y,S,v),x.return=y,y=x;break e}n(y,S);break}else t(y,S);S=S.sibling}v.type===ni?(x=_s(v.props.children,y.mode,k,v.key),x.return=y,y=x):(k=Kl(v.type,v.key,v.props,null,y.mode,k),k.ref=co(y,x,v),k.return=y,y=k)}return o(y);case ti:e:{for(S=v.key;x!==null;){if(x.key===S)if(x.tag===4&&x.stateNode.containerInfo===v.containerInfo&&x.stateNode.implementation===v.implementation){n(y,x.sibling),x=s(x,v.children||[]),x.return=y,y=x;break e}else{n(y,x);break}else t(y,x);x=x.sibling}x=wd(v,y.mode,k),x.return=y,y=x}return o(y);case _r:return S=v._init,w(y,x,S(v._payload),k)}if(Eo(v))return m(y,x,v,k);if(so(v))return g(y,x,v,k);ol(y,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,x!==null&&x.tag===6?(n(y,x.sibling),x=s(x,v),x.return=y,y=x):(n(y,x),x=vd(v,y.mode,k),x.return=y,y=x),o(y)):n(y,x)}return w}var Ri=j1(!0),P1=j1(!1),Cc=Zr(null),jc=null,ui=null,$p=null;function zp(){$p=ui=jc=null}function Bp(e){var t=Cc.current;je(Cc),e._currentValue=t}function rh(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 bi(e,t){jc=e,$p=ui=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(vt=!0),e.firstContext=null)}function rn(e){var t=e._currentValue;if($p!==e)if(e={context:e,memoizedValue:t,next:null},ui===null){if(jc===null)throw Error(U(308));ui=e,jc.dependencies={lanes:0,firstContext:e}}else ui=ui.next=e;return t}var ys=null;function Vp(e){ys===null?ys=[e]:ys.push(e)}function E1(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,Vp(t)):(n.next=s.next,s.next=n),t.interleaved=n,ir(e,r)}function ir(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 Sr=!1;function Up(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function T1(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 tr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Br(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,le&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,ir(e,n)}return s=r.interleaved,s===null?(t.next=t,Vp(r)):(t.next=s.next,s.next=t),r.interleaved=t,ir(e,n)}function Bl(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,Ep(e,n)}}function fy(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?s=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?s=i=t:i=i.next=t}else s=i=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:i,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 Pc(e,t,n,r){var s=e.updateQueue;Sr=!1;var i=s.firstBaseUpdate,o=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var l=a,c=l.next;l.next=null,o===null?i=c:o.next=c,o=l;var u=e.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==o&&(a===null?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(i!==null){var f=s.baseState;o=0,u=c=l=null,a=i;do{var h=a.lane,p=a.eventTime;if((r&h)===h){u!==null&&(u=u.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var m=e,g=a;switch(h=t,p=n,g.tag){case 1:if(m=g.payload,typeof m=="function"){f=m.call(p,f,h);break e}f=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,h=typeof m=="function"?m.call(p,f,h):m,h==null)break e;f=Re({},f,h);break e;case 2:Sr=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,h=s.effects,h===null?s.effects=[a]:h.push(a))}else p={eventTime:p,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(c=u=p,l=f):u=u.next=p,o|=h;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;h=a,a=h.next,h.next=null,s.lastBaseUpdate=h,s.shared.pending=null}}while(!0);if(u===null&&(l=f),s.baseState=l,s.firstBaseUpdate=c,s.lastBaseUpdate=u,t=s.shared.interleaved,t!==null){s=t;do o|=s.lane,s=s.next;while(s!==t)}else i===null&&(s.shared.lanes=0);Ms|=o,e.lanes=o,e.memoizedState=f}}function hy(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],s=r.callback;if(s!==null){if(r.callback=null,r=n,typeof s!="function")throw Error(U(191,s));s.call(r)}}}var Ta={},zn=Zr(Ta),ua=Zr(Ta),da=Zr(Ta);function xs(e){if(e===Ta)throw Error(U(174));return e}function Wp(e,t){switch(we(da,t),we(ua,e),we(zn,Ta),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ff(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Ff(t,e)}je(zn),we(zn,t)}function Ai(){je(zn),je(ua),je(da)}function N1(e){xs(da.current);var t=xs(zn.current),n=Ff(t,e.type);t!==n&&(we(ua,e),we(zn,n))}function Hp(e){ua.current===e&&(je(zn),je(ua))}var Te=Zr(0);function Ec(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 hd=[];function Gp(){for(var e=0;e<hd.length;e++)hd[e]._workInProgressVersionPrimary=null;hd.length=0}var Vl=cr.ReactCurrentDispatcher,pd=cr.ReactCurrentBatchConfig,Is=0,Ne=null,Ve=null,Ke=null,Tc=!1,$o=!1,fa=0,BP=0;function et(){throw Error(U(321))}function Kp(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!wn(e[n],t[n]))return!1;return!0}function Yp(e,t,n,r,s,i){if(Is=i,Ne=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Vl.current=e===null||e.memoizedState===null?HP:GP,e=n(r,s),$o){i=0;do{if($o=!1,fa=0,25<=i)throw Error(U(301));i+=1,Ke=Ve=null,t.updateQueue=null,Vl.current=KP,e=n(r,s)}while($o)}if(Vl.current=Nc,t=Ve!==null&&Ve.next!==null,Is=0,Ke=Ve=Ne=null,Tc=!1,t)throw Error(U(300));return e}function qp(){var e=fa!==0;return fa=0,e}function Rn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ke===null?Ne.memoizedState=Ke=e:Ke=Ke.next=e,Ke}function sn(){if(Ve===null){var e=Ne.alternate;e=e!==null?e.memoizedState:null}else e=Ve.next;var t=Ke===null?Ne.memoizedState:Ke.next;if(t!==null)Ke=t,Ve=e;else{if(e===null)throw Error(U(310));Ve=e,e={memoizedState:Ve.memoizedState,baseState:Ve.baseState,baseQueue:Ve.baseQueue,queue:Ve.queue,next:null},Ke===null?Ne.memoizedState=Ke=e:Ke=Ke.next=e}return Ke}function ha(e,t){return typeof t=="function"?t(e):t}function md(e){var t=sn(),n=t.queue;if(n===null)throw Error(U(311));n.lastRenderedReducer=e;var r=Ve,s=r.baseQueue,i=n.pending;if(i!==null){if(s!==null){var o=s.next;s.next=i.next,i.next=o}r.baseQueue=s=i,n.pending=null}if(s!==null){i=s.next,r=r.baseState;var a=o=null,l=null,c=i;do{var u=c.lane;if((Is&u)===u)l!==null&&(l=l.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 f={lane:u,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=f,o=r):l=l.next=f,Ne.lanes|=u,Ms|=u}c=c.next}while(c!==null&&c!==i);l===null?o=r:l.next=a,wn(r,t.memoizedState)||(vt=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){s=e;do i=s.lane,Ne.lanes|=i,Ms|=i,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function gd(e){var t=sn(),n=t.queue;if(n===null)throw Error(U(311));n.lastRenderedReducer=e;var r=n.dispatch,s=n.pending,i=t.memoizedState;if(s!==null){n.pending=null;var o=s=s.next;do i=e(i,o.action),o=o.next;while(o!==s);wn(i,t.memoizedState)||(vt=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function R1(){}function A1(e,t){var n=Ne,r=sn(),s=t(),i=!wn(r.memoizedState,s);if(i&&(r.memoizedState=s,vt=!0),r=r.queue,Qp(L1.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||Ke!==null&&Ke.memoizedState.tag&1){if(n.flags|=2048,pa(9,M1.bind(null,n,r,s,t),void 0,null),Ye===null)throw Error(U(349));Is&30||I1(n,t,s)}return s}function I1(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ne.updateQueue,t===null?(t={lastEffect:null,stores:null},Ne.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function M1(e,t,n,r){t.value=n,t.getSnapshot=r,D1(t)&&F1(e)}function L1(e,t,n){return n(function(){D1(t)&&F1(e)})}function D1(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!wn(e,n)}catch{return!0}}function F1(e){var t=ir(e,1);t!==null&&xn(t,e,1,-1)}function py(e){var t=Rn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ha,lastRenderedState:e},t.queue=e,e=e.dispatch=WP.bind(null,Ne,e),[t.memoizedState,e]}function pa(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Ne.updateQueue,t===null?(t={lastEffect:null,stores:null},Ne.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 O1(){return sn().memoizedState}function Ul(e,t,n,r){var s=Rn();Ne.flags|=e,s.memoizedState=pa(1|t,n,void 0,r===void 0?null:r)}function pu(e,t,n,r){var s=sn();r=r===void 0?null:r;var i=void 0;if(Ve!==null){var o=Ve.memoizedState;if(i=o.destroy,r!==null&&Kp(r,o.deps)){s.memoizedState=pa(t,n,i,r);return}}Ne.flags|=e,s.memoizedState=pa(1|t,n,i,r)}function my(e,t){return Ul(8390656,8,e,t)}function Qp(e,t){return pu(2048,8,e,t)}function $1(e,t){return pu(4,2,e,t)}function z1(e,t){return pu(4,4,e,t)}function B1(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 V1(e,t,n){return n=n!=null?n.concat([e]):null,pu(4,4,B1.bind(null,t,e),n)}function Xp(){}function U1(e,t){var n=sn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Kp(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function W1(e,t){var n=sn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Kp(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function H1(e,t,n){return Is&21?(wn(n,t)||(n=Qw(),Ne.lanes|=n,Ms|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,vt=!0),e.memoizedState=n)}function VP(e,t){var n=ue;ue=n!==0&&4>n?n:4,e(!0);var r=pd.transition;pd.transition={};try{e(!1),t()}finally{ue=n,pd.transition=r}}function G1(){return sn().memoizedState}function UP(e,t,n){var r=Ur(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},K1(e))Y1(t,n);else if(n=E1(e,t,n,r),n!==null){var s=ft();xn(n,e,r,s),q1(n,t,r)}}function WP(e,t,n){var r=Ur(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(K1(e))Y1(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,a=i(o,n);if(s.hasEagerState=!0,s.eagerState=a,wn(a,o)){var l=t.interleaved;l===null?(s.next=s,Vp(t)):(s.next=l.next,l.next=s),t.interleaved=s;return}}catch{}finally{}n=E1(e,t,s,r),n!==null&&(s=ft(),xn(n,e,r,s),q1(n,t,r))}}function K1(e){var t=e.alternate;return e===Ne||t!==null&&t===Ne}function Y1(e,t){$o=Tc=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function q1(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ep(e,n)}}var Nc={readContext:rn,useCallback:et,useContext:et,useEffect:et,useImperativeHandle:et,useInsertionEffect:et,useLayoutEffect:et,useMemo:et,useReducer:et,useRef:et,useState:et,useDebugValue:et,useDeferredValue:et,useTransition:et,useMutableSource:et,useSyncExternalStore:et,useId:et,unstable_isNewReconciler:!1},HP={readContext:rn,useCallback:function(e,t){return Rn().memoizedState=[e,t===void 0?null:t],e},useContext:rn,useEffect:my,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Ul(4194308,4,B1.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ul(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ul(4,2,e,t)},useMemo:function(e,t){var n=Rn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Rn();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=UP.bind(null,Ne,e),[r.memoizedState,e]},useRef:function(e){var t=Rn();return e={current:e},t.memoizedState=e},useState:py,useDebugValue:Xp,useDeferredValue:function(e){return Rn().memoizedState=e},useTransition:function(){var e=py(!1),t=e[0];return e=VP.bind(null,e[1]),Rn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ne,s=Rn();if(Ee){if(n===void 0)throw Error(U(407));n=n()}else{if(n=t(),Ye===null)throw Error(U(349));Is&30||I1(r,t,n)}s.memoizedState=n;var i={value:n,getSnapshot:t};return s.queue=i,my(L1.bind(null,r,i,e),[e]),r.flags|=2048,pa(9,M1.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Rn(),t=Ye.identifierPrefix;if(Ee){var n=er,r=Zn;n=(r&~(1<<32-yn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=fa++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=BP++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},GP={readContext:rn,useCallback:U1,useContext:rn,useEffect:Qp,useImperativeHandle:V1,useInsertionEffect:$1,useLayoutEffect:z1,useMemo:W1,useReducer:md,useRef:O1,useState:function(){return md(ha)},useDebugValue:Xp,useDeferredValue:function(e){var t=sn();return H1(t,Ve.memoizedState,e)},useTransition:function(){var e=md(ha)[0],t=sn().memoizedState;return[e,t]},useMutableSource:R1,useSyncExternalStore:A1,useId:G1,unstable_isNewReconciler:!1},KP={readContext:rn,useCallback:U1,useContext:rn,useEffect:Qp,useImperativeHandle:V1,useInsertionEffect:$1,useLayoutEffect:z1,useMemo:W1,useReducer:gd,useRef:O1,useState:function(){return gd(ha)},useDebugValue:Xp,useDeferredValue:function(e){var t=sn();return Ve===null?t.memoizedState=e:H1(t,Ve.memoizedState,e)},useTransition:function(){var e=gd(ha)[0],t=sn().memoizedState;return[e,t]},useMutableSource:R1,useSyncExternalStore:A1,useId:G1,unstable_isNewReconciler:!1};function pn(e,t){if(e&&e.defaultProps){t=Re({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function sh(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Re({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var mu={isMounted:function(e){return(e=e._reactInternals)?Fs(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=ft(),s=Ur(e),i=tr(r,s);i.payload=t,n!=null&&(i.callback=n),t=Br(e,i,s),t!==null&&(xn(t,e,s,r),Bl(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=ft(),s=Ur(e),i=tr(r,s);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Br(e,i,s),t!==null&&(xn(t,e,s,r),Bl(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=ft(),r=Ur(e),s=tr(n,r);s.tag=2,t!=null&&(s.callback=t),t=Br(e,s,r),t!==null&&(xn(t,e,r,n),Bl(t,e,r))}};function gy(e,t,n,r,s,i,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,o):t.prototype&&t.prototype.isPureReactComponent?!oa(n,r)||!oa(s,i):!0}function Q1(e,t,n){var r=!1,s=Yr,i=t.contextType;return typeof i=="object"&&i!==null?i=rn(i):(s=kt(t)?Rs:it.current,r=t.contextTypes,i=(r=r!=null)?Ti(e,s):Yr),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=mu,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=i),t}function yy(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&&mu.enqueueReplaceState(t,t.state,null)}function ih(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},Up(e);var i=t.contextType;typeof i=="object"&&i!==null?s.context=rn(i):(i=kt(t)?Rs:it.current,s.context=Ti(e,i)),s.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(sh(e,t,i,n),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&mu.enqueueReplaceState(s,s.state,null),Pc(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function Ii(e,t){try{var n="",r=t;do n+=bj(r),r=r.return;while(r);var s=n}catch(i){s=`
40
- Error generating stack: `+i.message+`
41
- `+i.stack}return{value:e,source:t,stack:s,digest:null}}function yd(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function oh(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var YP=typeof WeakMap=="function"?WeakMap:Map;function X1(e,t,n){n=tr(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Ac||(Ac=!0,gh=r),oh(e,t)},n}function J1(e,t,n){n=tr(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var s=t.value;n.payload=function(){return r(s)},n.callback=function(){oh(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){oh(e,t),typeof r!="function"&&(Vr===null?Vr=new Set([this]):Vr.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function xy(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new YP;var s=new Set;r.set(t,s)}else s=r.get(t),s===void 0&&(s=new Set,r.set(t,s));s.has(n)||(s.add(n),e=lE.bind(null,e,t,n),t.then(e,e))}function vy(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 wy(e,t,n,r,s){return e.mode&1?(e.flags|=65536,e.lanes=s,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=tr(-1,1),t.tag=2,Br(n,t,1))),n.lanes|=1),e)}var qP=cr.ReactCurrentOwner,vt=!1;function lt(e,t,n,r){t.child=e===null?P1(t,null,n,r):Ri(t,e.child,n,r)}function by(e,t,n,r,s){n=n.render;var i=t.ref;return bi(t,s),r=Yp(e,t,n,r,i,s),n=qp(),e!==null&&!vt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,or(e,t,s)):(Ee&&n&&Dp(t),t.flags|=1,lt(e,t,r,s),t.child)}function ky(e,t,n,r,s){if(e===null){var i=n.type;return typeof i=="function"&&!im(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,Z1(e,t,i,r,s)):(e=Kl(n.type,null,r,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&s)){var o=i.memoizedProps;if(n=n.compare,n=n!==null?n:oa,n(o,r)&&e.ref===t.ref)return or(e,t,s)}return t.flags|=1,e=Wr(i,r),e.ref=t.ref,e.return=t,t.child=e}function Z1(e,t,n,r,s){if(e!==null){var i=e.memoizedProps;if(oa(i,r)&&e.ref===t.ref)if(vt=!1,t.pendingProps=r=i,(e.lanes&s)!==0)e.flags&131072&&(vt=!0);else return t.lanes=e.lanes,or(e,t,s)}return ah(e,t,n,r,s)}function eb(e,t,n){var r=t.pendingProps,s=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},we(fi,Lt),Lt|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,we(fi,Lt),Lt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,we(fi,Lt),Lt|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,we(fi,Lt),Lt|=r;return lt(e,t,s,n),t.child}function tb(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function ah(e,t,n,r,s){var i=kt(n)?Rs:it.current;return i=Ti(t,i),bi(t,s),n=Yp(e,t,n,r,i,s),r=qp(),e!==null&&!vt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,or(e,t,s)):(Ee&&r&&Dp(t),t.flags|=1,lt(e,t,n,s),t.child)}function _y(e,t,n,r,s){if(kt(n)){var i=!0;kc(t)}else i=!1;if(bi(t,s),t.stateNode===null)Wl(e,t),Q1(t,n,r),ih(t,n,r,s),r=!0;else if(e===null){var o=t.stateNode,a=t.memoizedProps;o.props=a;var l=o.context,c=n.contextType;typeof c=="object"&&c!==null?c=rn(c):(c=kt(n)?Rs:it.current,c=Ti(t,c));var u=n.getDerivedStateFromProps,f=typeof u=="function"||typeof o.getSnapshotBeforeUpdate=="function";f||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||l!==c)&&yy(t,o,r,c),Sr=!1;var h=t.memoizedState;o.state=h,Pc(t,r,o,s),l=t.memoizedState,a!==r||h!==l||bt.current||Sr?(typeof u=="function"&&(sh(t,n,u,r),l=t.memoizedState),(a=Sr||gy(t,n,a,r,h,l,c))?(f||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),o.props=r,o.state=l,o.context=c,r=a):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,T1(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:pn(t.type,a),o.props=c,f=t.pendingProps,h=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=rn(l):(l=kt(n)?Rs:it.current,l=Ti(t,l));var p=n.getDerivedStateFromProps;(u=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==f||h!==l)&&yy(t,o,r,l),Sr=!1,h=t.memoizedState,o.state=h,Pc(t,r,o,s);var m=t.memoizedState;a!==f||h!==m||bt.current||Sr?(typeof p=="function"&&(sh(t,n,p,r),m=t.memoizedState),(c=Sr||gy(t,n,c,r,h,m,l)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,m,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,m,l)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),o.props=r,o.state=m,o.context=l,r=c):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return lh(e,t,n,r,i,s)}function lh(e,t,n,r,s,i){tb(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return s&&ly(t,n,!1),or(e,t,i);r=t.stateNode,qP.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Ri(t,e.child,null,i),t.child=Ri(t,null,a,i)):lt(e,t,a,i),t.memoizedState=r.state,s&&ly(t,n,!0),t.child}function nb(e){var t=e.stateNode;t.pendingContext?ay(e,t.pendingContext,t.pendingContext!==t.context):t.context&&ay(e,t.context,!1),Wp(e,t.containerInfo)}function Sy(e,t,n,r,s){return Ni(),Op(s),t.flags|=256,lt(e,t,n,r),t.child}var ch={dehydrated:null,treeContext:null,retryLane:0};function uh(e){return{baseLanes:e,cachePool:null,transitions:null}}function rb(e,t,n){var r=t.pendingProps,s=Te.current,i=!1,o=(t.flags&128)!==0,a;if((a=o)||(a=e!==null&&e.memoizedState===null?!1:(s&2)!==0),a?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),we(Te,s&1),e===null)return nh(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):(o=r.children,e=r.fallback,i?(r=t.mode,i=t.child,o={mode:"hidden",children:o},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=xu(o,r,0,null),e=_s(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=uh(n),t.memoizedState=ch,e):Jp(t,o));if(s=e.memoizedState,s!==null&&(a=s.dehydrated,a!==null))return QP(e,t,o,r,a,s,n);if(i){i=r.fallback,o=t.mode,s=e.child,a=s.sibling;var l={mode:"hidden",children:r.children};return!(o&1)&&t.child!==s?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=Wr(s,l),r.subtreeFlags=s.subtreeFlags&14680064),a!==null?i=Wr(a,i):(i=_s(i,o,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,o=e.child.memoizedState,o=o===null?uh(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=e.childLanes&~n,t.memoizedState=ch,r}return i=e.child,e=i.sibling,r=Wr(i,{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 Jp(e,t){return t=xu({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function al(e,t,n,r){return r!==null&&Op(r),Ri(t,e.child,null,n),e=Jp(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function QP(e,t,n,r,s,i,o){if(n)return t.flags&256?(t.flags&=-257,r=yd(Error(U(422))),al(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,s=t.mode,r=xu({mode:"visible",children:r.children},s,0,null),i=_s(i,s,o,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&Ri(t,e.child,null,o),t.child.memoizedState=uh(o),t.memoizedState=ch,i);if(!(t.mode&1))return al(e,t,o,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(U(419)),r=yd(i,r,void 0),al(e,t,o,r)}if(a=(o&e.childLanes)!==0,vt||a){if(r=Ye,r!==null){switch(o&-o){case 4:s=2;break;case 16:s=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:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(r.suspendedLanes|o)?0:s,s!==0&&s!==i.retryLane&&(i.retryLane=s,ir(e,s),xn(r,e,s,-1))}return sm(),r=yd(Error(U(421))),al(e,t,o,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=cE.bind(null,e),s._reactRetry=t,null):(e=i.treeContext,Dt=zr(s.nextSibling),Ot=t,Ee=!0,gn=null,e!==null&&(qt[Qt++]=Zn,qt[Qt++]=er,qt[Qt++]=As,Zn=e.id,er=e.overflow,As=t),t=Jp(t,r.children),t.flags|=4096,t)}function Cy(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),rh(e.return,t,n)}function xd(e,t,n,r,s){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=s)}function sb(e,t,n){var r=t.pendingProps,s=r.revealOrder,i=r.tail;if(lt(e,t,r.children,n),r=Te.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&&Cy(e,n,t);else if(e.tag===19)Cy(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(we(Te,r),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&Ec(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),xd(t,!1,s,n,i);break;case"backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&Ec(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}xd(t,!0,n,null,i);break;case"together":xd(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Wl(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function or(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ms|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(U(153));if(t.child!==null){for(e=t.child,n=Wr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Wr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function XP(e,t,n){switch(t.tag){case 3:nb(t),Ni();break;case 5:N1(t);break;case 1:kt(t.type)&&kc(t);break;case 4:Wp(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;we(Cc,r._currentValue),r._currentValue=s;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(we(Te,Te.current&1),t.flags|=128,null):n&t.child.childLanes?rb(e,t,n):(we(Te,Te.current&1),e=or(e,t,n),e!==null?e.sibling:null);we(Te,Te.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return sb(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),we(Te,Te.current),r)break;return null;case 22:case 23:return t.lanes=0,eb(e,t,n)}return or(e,t,n)}var ib,dh,ob,ab;ib=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}};dh=function(){};ob=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,xs(zn.current);var i=null;switch(n){case"input":s=If(e,s),r=If(e,r),i=[];break;case"select":s=Re({},s,{value:void 0}),r=Re({},r,{value:void 0}),i=[];break;case"textarea":s=Df(e,s),r=Df(e,r),i=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=wc)}Of(n,r);var o;n=null;for(c in s)if(!r.hasOwnProperty(c)&&s.hasOwnProperty(c)&&s[c]!=null)if(c==="style"){var a=s[c];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Zo.hasOwnProperty(c)?i||(i=[]):(i=i||[]).push(c,null));for(c in r){var l=r[c];if(a=s!=null?s[c]:void 0,r.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(n||(n={}),n[o]=l[o])}else n||(i||(i=[]),i.push(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(i=i||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Zo.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&Ce("scroll",e),i||a===l||(i=[])):(i=i||[]).push(c,l))}n&&(i=i||[]).push("style",n);var c=i;(t.updateQueue=c)&&(t.flags|=4)}};ab=function(e,t,n,r){n!==r&&(t.flags|=4)};function uo(e,t){if(!Ee)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 tt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&14680064,r|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function JP(e,t,n){var r=t.pendingProps;switch(Fp(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return tt(t),null;case 1:return kt(t.type)&&bc(),tt(t),null;case 3:return r=t.stateNode,Ai(),je(bt),je(it),Gp(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(il(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,gn!==null&&(vh(gn),gn=null))),dh(e,t),tt(t),null;case 5:Hp(t);var s=xs(da.current);if(n=t.type,e!==null&&t.stateNode!=null)ob(e,t,n,r,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(U(166));return tt(t),null}if(e=xs(zn.current),il(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Fn]=t,r[ca]=i,e=(t.mode&1)!==0,n){case"dialog":Ce("cancel",r),Ce("close",r);break;case"iframe":case"object":case"embed":Ce("load",r);break;case"video":case"audio":for(s=0;s<No.length;s++)Ce(No[s],r);break;case"source":Ce("error",r);break;case"img":case"image":case"link":Ce("error",r),Ce("load",r);break;case"details":Ce("toggle",r);break;case"input":Mg(r,i),Ce("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},Ce("invalid",r);break;case"textarea":Dg(r,i),Ce("invalid",r)}Of(n,i),s=null;for(var o in i)if(i.hasOwnProperty(o)){var a=i[o];o==="children"?typeof a=="string"?r.textContent!==a&&(i.suppressHydrationWarning!==!0&&sl(r.textContent,a,e),s=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&sl(r.textContent,a,e),s=["children",""+a]):Zo.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&Ce("scroll",r)}switch(n){case"input":Qa(r),Lg(r,i,!0);break;case"textarea":Qa(r),Fg(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=wc)}r=s,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Lw(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[Fn]=t,e[ca]=r,ib(e,t,!1,!1),t.stateNode=e;e:{switch(o=$f(n,r),n){case"dialog":Ce("cancel",e),Ce("close",e),s=r;break;case"iframe":case"object":case"embed":Ce("load",e),s=r;break;case"video":case"audio":for(s=0;s<No.length;s++)Ce(No[s],e);s=r;break;case"source":Ce("error",e),s=r;break;case"img":case"image":case"link":Ce("error",e),Ce("load",e),s=r;break;case"details":Ce("toggle",e),s=r;break;case"input":Mg(e,r),s=If(e,r),Ce("invalid",e);break;case"option":s=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=Re({},r,{value:void 0}),Ce("invalid",e);break;case"textarea":Dg(e,r),s=Df(e,r),Ce("invalid",e);break;default:s=r}Of(n,s),a=s;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?Ow(e,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&Dw(e,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&ea(e,l):typeof l=="number"&&ea(e,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Zo.hasOwnProperty(i)?l!=null&&i==="onScroll"&&Ce("scroll",e):l!=null&&kp(e,i,l,o))}switch(n){case"input":Qa(e),Lg(e,r,!1);break;case"textarea":Qa(e),Fg(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Kr(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?yi(e,!!r.multiple,i,!1):r.defaultValue!=null&&yi(e,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=wc)}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 tt(t),null;case 6:if(e&&t.stateNode!=null)ab(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(U(166));if(n=xs(da.current),xs(zn.current),il(t)){if(r=t.stateNode,n=t.memoizedProps,r[Fn]=t,(i=r.nodeValue!==n)&&(e=Ot,e!==null))switch(e.tag){case 3:sl(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&sl(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Fn]=t,t.stateNode=r}return tt(t),null;case 13:if(je(Te),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ee&&Dt!==null&&t.mode&1&&!(t.flags&128))C1(),Ni(),t.flags|=98560,i=!1;else if(i=il(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(U(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(U(317));i[Fn]=t}else Ni(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;tt(t),i=!1}else gn!==null&&(vh(gn),gn=null),i=!0;if(!i)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||Te.current&1?Ue===0&&(Ue=3):sm())),t.updateQueue!==null&&(t.flags|=4),tt(t),null);case 4:return Ai(),dh(e,t),e===null&&aa(t.stateNode.containerInfo),tt(t),null;case 10:return Bp(t.type._context),tt(t),null;case 17:return kt(t.type)&&bc(),tt(t),null;case 19:if(je(Te),i=t.memoizedState,i===null)return tt(t),null;if(r=(t.flags&128)!==0,o=i.rendering,o===null)if(r)uo(i,!1);else{if(Ue!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Ec(e),o!==null){for(t.flags|=128,uo(i,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,o=i.alternate,o===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,e=o.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return we(Te,Te.current&1|2),t.child}e=e.sibling}i.tail!==null&&De()>Mi&&(t.flags|=128,r=!0,uo(i,!1),t.lanes=4194304)}else{if(!r)if(e=Ec(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),uo(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!Ee)return tt(t),null}else 2*De()-i.renderingStartTime>Mi&&n!==1073741824&&(t.flags|=128,r=!0,uo(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(n=i.last,n!==null?n.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=De(),t.sibling=null,n=Te.current,we(Te,r?n&1|2:n&1),t):(tt(t),null);case 22:case 23:return rm(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Lt&1073741824&&(tt(t),t.subtreeFlags&6&&(t.flags|=8192)):tt(t),null;case 24:return null;case 25:return null}throw Error(U(156,t.tag))}function ZP(e,t){switch(Fp(t),t.tag){case 1:return kt(t.type)&&bc(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ai(),je(bt),je(it),Gp(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Hp(t),null;case 13:if(je(Te),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(U(340));Ni()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return je(Te),null;case 4:return Ai(),null;case 10:return Bp(t.type._context),null;case 22:case 23:return rm(),null;case 24:return null;default:return null}}var ll=!1,rt=!1,eE=typeof WeakSet=="function"?WeakSet:Set,K=null;function di(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Me(e,t,r)}else n.current=null}function fh(e,t,n){try{n()}catch(r){Me(e,t,r)}}var jy=!1;function tE(e,t){if(qf=yc,e=f1(),Lp(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 s=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,a=-1,l=-1,c=0,u=0,f=e,h=null;t:for(;;){for(var p;f!==n||s!==0&&f.nodeType!==3||(a=o+s),f!==i||r!==0&&f.nodeType!==3||(l=o+r),f.nodeType===3&&(o+=f.nodeValue.length),(p=f.firstChild)!==null;)h=f,f=p;for(;;){if(f===e)break t;if(h===n&&++c===s&&(a=o),h===i&&++u===r&&(l=o),(p=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=p}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Qf={focusedElem:e,selectionRange:n},yc=!1,K=t;K!==null;)if(t=K,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,K=e;else for(;K!==null;){t=K;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,w=m.memoizedState,y=t.stateNode,x=y.getSnapshotBeforeUpdate(t.elementType===t.type?g:pn(t.type,g),w);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(U(163))}}catch(k){Me(t,t.return,k)}if(e=t.sibling,e!==null){e.return=t.return,K=e;break}K=t.return}return m=jy,jy=!1,m}function zo(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var i=s.destroy;s.destroy=void 0,i!==void 0&&fh(t,n,i)}s=s.next}while(s!==r)}}function gu(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 hh(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 lb(e){var t=e.alternate;t!==null&&(e.alternate=null,lb(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Fn],delete t[ca],delete t[Zf],delete t[FP],delete t[OP])),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 cb(e){return e.tag===5||e.tag===3||e.tag===4}function Py(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||cb(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 ph(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=wc));else if(r!==4&&(e=e.child,e!==null))for(ph(e,t,n),e=e.sibling;e!==null;)ph(e,t,n),e=e.sibling}function mh(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(mh(e,t,n),e=e.sibling;e!==null;)mh(e,t,n),e=e.sibling}var qe=null,mn=!1;function fr(e,t,n){for(n=n.child;n!==null;)ub(e,t,n),n=n.sibling}function ub(e,t,n){if($n&&typeof $n.onCommitFiberUnmount=="function")try{$n.onCommitFiberUnmount(lu,n)}catch{}switch(n.tag){case 5:rt||di(n,t);case 6:var r=qe,s=mn;qe=null,fr(e,t,n),qe=r,mn=s,qe!==null&&(mn?(e=qe,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):qe.removeChild(n.stateNode));break;case 18:qe!==null&&(mn?(e=qe,n=n.stateNode,e.nodeType===8?dd(e.parentNode,n):e.nodeType===1&&dd(e,n),sa(e)):dd(qe,n.stateNode));break;case 4:r=qe,s=mn,qe=n.stateNode.containerInfo,mn=!0,fr(e,t,n),qe=r,mn=s;break;case 0:case 11:case 14:case 15:if(!rt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var i=s,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&fh(n,t,o),s=s.next}while(s!==r)}fr(e,t,n);break;case 1:if(!rt&&(di(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Me(n,t,a)}fr(e,t,n);break;case 21:fr(e,t,n);break;case 22:n.mode&1?(rt=(r=rt)||n.memoizedState!==null,fr(e,t,n),rt=r):fr(e,t,n);break;default:fr(e,t,n)}}function Ey(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new eE),t.forEach(function(r){var s=uE.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function cn(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];try{var i=e,o=t,a=o;e:for(;a!==null;){switch(a.tag){case 5:qe=a.stateNode,mn=!1;break e;case 3:qe=a.stateNode.containerInfo,mn=!0;break e;case 4:qe=a.stateNode.containerInfo,mn=!0;break e}a=a.return}if(qe===null)throw Error(U(160));ub(i,o,s),qe=null,mn=!1;var l=s.alternate;l!==null&&(l.return=null),s.return=null}catch(c){Me(s,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)db(t,e),t=t.sibling}function db(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(cn(t,e),jn(e),r&4){try{zo(3,e,e.return),gu(3,e)}catch(g){Me(e,e.return,g)}try{zo(5,e,e.return)}catch(g){Me(e,e.return,g)}}break;case 1:cn(t,e),jn(e),r&512&&n!==null&&di(n,n.return);break;case 5:if(cn(t,e),jn(e),r&512&&n!==null&&di(n,n.return),e.flags&32){var s=e.stateNode;try{ea(s,"")}catch(g){Me(e,e.return,g)}}if(r&4&&(s=e.stateNode,s!=null)){var i=e.memoizedProps,o=n!==null?n.memoizedProps:i,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&Iw(s,i),$f(a,o);var c=$f(a,i);for(o=0;o<l.length;o+=2){var u=l[o],f=l[o+1];u==="style"?Ow(s,f):u==="dangerouslySetInnerHTML"?Dw(s,f):u==="children"?ea(s,f):kp(s,u,f,c)}switch(a){case"input":Mf(s,i);break;case"textarea":Mw(s,i);break;case"select":var h=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!i.multiple;var p=i.value;p!=null?yi(s,!!i.multiple,p,!1):h!==!!i.multiple&&(i.defaultValue!=null?yi(s,!!i.multiple,i.defaultValue,!0):yi(s,!!i.multiple,i.multiple?[]:"",!1))}s[ca]=i}catch(g){Me(e,e.return,g)}}break;case 6:if(cn(t,e),jn(e),r&4){if(e.stateNode===null)throw Error(U(162));s=e.stateNode,i=e.memoizedProps;try{s.nodeValue=i}catch(g){Me(e,e.return,g)}}break;case 3:if(cn(t,e),jn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{sa(t.containerInfo)}catch(g){Me(e,e.return,g)}break;case 4:cn(t,e),jn(e);break;case 13:cn(t,e),jn(e),s=e.child,s.flags&8192&&(i=s.memoizedState!==null,s.stateNode.isHidden=i,!i||s.alternate!==null&&s.alternate.memoizedState!==null||(tm=De())),r&4&&Ey(e);break;case 22:if(u=n!==null&&n.memoizedState!==null,e.mode&1?(rt=(c=rt)||u,cn(t,e),rt=c):cn(t,e),jn(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!u&&e.mode&1)for(K=e,u=e.child;u!==null;){for(f=K=u;K!==null;){switch(h=K,p=h.child,h.tag){case 0:case 11:case 14:case 15:zo(4,h,h.return);break;case 1:di(h,h.return);var m=h.stateNode;if(typeof m.componentWillUnmount=="function"){r=h,n=h.return;try{t=r,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(g){Me(r,n,g)}}break;case 5:di(h,h.return);break;case 22:if(h.memoizedState!==null){Ny(f);continue}}p!==null?(p.return=h,K=p):Ny(f)}u=u.sibling}e:for(u=null,f=e;;){if(f.tag===5){if(u===null){u=f;try{s=f.stateNode,c?(i=s.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=f.stateNode,l=f.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=Fw("display",o))}catch(g){Me(e,e.return,g)}}}else if(f.tag===6){if(u===null)try{f.stateNode.nodeValue=c?"":f.memoizedProps}catch(g){Me(e,e.return,g)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;u===f&&(u=null),f=f.return}u===f&&(u=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:cn(t,e),jn(e),r&4&&Ey(e);break;case 21:break;default:cn(t,e),jn(e)}}function jn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(cb(n)){var r=n;break e}n=n.return}throw Error(U(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&(ea(s,""),r.flags&=-33);var i=Py(e);mh(e,i,s);break;case 3:case 4:var o=r.stateNode.containerInfo,a=Py(e);ph(e,a,o);break;default:throw Error(U(161))}}catch(l){Me(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function nE(e,t,n){K=e,fb(e)}function fb(e,t,n){for(var r=(e.mode&1)!==0;K!==null;){var s=K,i=s.child;if(s.tag===22&&r){var o=s.memoizedState!==null||ll;if(!o){var a=s.alternate,l=a!==null&&a.memoizedState!==null||rt;a=ll;var c=rt;if(ll=o,(rt=l)&&!c)for(K=s;K!==null;)o=K,l=o.child,o.tag===22&&o.memoizedState!==null?Ry(s):l!==null?(l.return=o,K=l):Ry(s);for(;i!==null;)K=i,fb(i),i=i.sibling;K=s,ll=a,rt=c}Ty(e)}else s.subtreeFlags&8772&&i!==null?(i.return=s,K=i):Ty(e)}}function Ty(e){for(;K!==null;){var t=K;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:rt||gu(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!rt)if(n===null)r.componentDidMount();else{var s=t.elementType===t.type?n.memoizedProps:pn(t.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&hy(t,i,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}hy(t,o,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.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 u=c.memoizedState;if(u!==null){var f=u.dehydrated;f!==null&&sa(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(U(163))}rt||t.flags&512&&hh(t)}catch(h){Me(t,t.return,h)}}if(t===e){K=null;break}if(n=t.sibling,n!==null){n.return=t.return,K=n;break}K=t.return}}function Ny(e){for(;K!==null;){var t=K;if(t===e){K=null;break}var n=t.sibling;if(n!==null){n.return=t.return,K=n;break}K=t.return}}function Ry(e){for(;K!==null;){var t=K;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{gu(4,t)}catch(l){Me(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var s=t.return;try{r.componentDidMount()}catch(l){Me(t,s,l)}}var i=t.return;try{hh(t)}catch(l){Me(t,i,l)}break;case 5:var o=t.return;try{hh(t)}catch(l){Me(t,o,l)}}}catch(l){Me(t,t.return,l)}if(t===e){K=null;break}var a=t.sibling;if(a!==null){a.return=t.return,K=a;break}K=t.return}}var rE=Math.ceil,Rc=cr.ReactCurrentDispatcher,Zp=cr.ReactCurrentOwner,tn=cr.ReactCurrentBatchConfig,le=0,Ye=null,ze=null,Je=0,Lt=0,fi=Zr(0),Ue=0,ma=null,Ms=0,yu=0,em=0,Bo=null,xt=null,tm=0,Mi=1/0,Xn=null,Ac=!1,gh=null,Vr=null,cl=!1,Rr=null,Ic=0,Vo=0,yh=null,Hl=-1,Gl=0;function ft(){return le&6?De():Hl!==-1?Hl:Hl=De()}function Ur(e){return e.mode&1?le&2&&Je!==0?Je&-Je:zP.transition!==null?(Gl===0&&(Gl=Qw()),Gl):(e=ue,e!==0||(e=window.event,e=e===void 0?16:r1(e.type)),e):1}function xn(e,t,n,r){if(50<Vo)throw Vo=0,yh=null,Error(U(185));ja(e,n,r),(!(le&2)||e!==Ye)&&(e===Ye&&(!(le&2)&&(yu|=n),Ue===4&&Tr(e,Je)),_t(e,r),n===1&&le===0&&!(t.mode&1)&&(Mi=De()+500,hu&&es()))}function _t(e,t){var n=e.callbackNode;zj(e,t);var r=gc(e,e===Ye?Je:0);if(r===0)n!==null&&zg(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&zg(n),t===1)e.tag===0?$P(Ay.bind(null,e)):k1(Ay.bind(null,e)),LP(function(){!(le&6)&&es()}),n=null;else{switch(Xw(r)){case 1:n=Pp;break;case 4:n=Yw;break;case 16:n=mc;break;case 536870912:n=qw;break;default:n=mc}n=wb(n,hb.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function hb(e,t){if(Hl=-1,Gl=0,le&6)throw Error(U(327));var n=e.callbackNode;if(ki()&&e.callbackNode!==n)return null;var r=gc(e,e===Ye?Je:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Mc(e,r);else{t=r;var s=le;le|=2;var i=mb();(Ye!==e||Je!==t)&&(Xn=null,Mi=De()+500,ks(e,t));do try{oE();break}catch(a){pb(e,a)}while(!0);zp(),Rc.current=i,le=s,ze!==null?t=0:(Ye=null,Je=0,t=Ue)}if(t!==0){if(t===2&&(s=Wf(e),s!==0&&(r=s,t=xh(e,s))),t===1)throw n=ma,ks(e,0),Tr(e,r),_t(e,De()),n;if(t===6)Tr(e,r);else{if(s=e.current.alternate,!(r&30)&&!sE(s)&&(t=Mc(e,r),t===2&&(i=Wf(e),i!==0&&(r=i,t=xh(e,i))),t===1))throw n=ma,ks(e,0),Tr(e,r),_t(e,De()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(U(345));case 2:fs(e,xt,Xn);break;case 3:if(Tr(e,r),(r&130023424)===r&&(t=tm+500-De(),10<t)){if(gc(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){ft(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=Jf(fs.bind(null,e,xt,Xn),t);break}fs(e,xt,Xn);break;case 4:if(Tr(e,r),(r&4194240)===r)break;for(t=e.eventTimes,s=-1;0<r;){var o=31-yn(r);i=1<<o,o=t[o],o>s&&(s=o),r&=~i}if(r=s,r=De()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*rE(r/1960))-r,10<r){e.timeoutHandle=Jf(fs.bind(null,e,xt,Xn),r);break}fs(e,xt,Xn);break;case 5:fs(e,xt,Xn);break;default:throw Error(U(329))}}}return _t(e,De()),e.callbackNode===n?hb.bind(null,e):null}function xh(e,t){var n=Bo;return e.current.memoizedState.isDehydrated&&(ks(e,t).flags|=256),e=Mc(e,t),e!==2&&(t=xt,xt=n,t!==null&&vh(t)),e}function vh(e){xt===null?xt=e:xt.push.apply(xt,e)}function sE(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 s=n[r],i=s.getSnapshot;s=s.value;try{if(!wn(i(),s))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 Tr(e,t){for(t&=~em,t&=~yu,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-yn(t),r=1<<n;e[n]=-1,t&=~r}}function Ay(e){if(le&6)throw Error(U(327));ki();var t=gc(e,0);if(!(t&1))return _t(e,De()),null;var n=Mc(e,t);if(e.tag!==0&&n===2){var r=Wf(e);r!==0&&(t=r,n=xh(e,r))}if(n===1)throw n=ma,ks(e,0),Tr(e,t),_t(e,De()),n;if(n===6)throw Error(U(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,fs(e,xt,Xn),_t(e,De()),null}function nm(e,t){var n=le;le|=1;try{return e(t)}finally{le=n,le===0&&(Mi=De()+500,hu&&es())}}function Ls(e){Rr!==null&&Rr.tag===0&&!(le&6)&&ki();var t=le;le|=1;var n=tn.transition,r=ue;try{if(tn.transition=null,ue=1,e)return e()}finally{ue=r,tn.transition=n,le=t,!(le&6)&&es()}}function rm(){Lt=fi.current,je(fi)}function ks(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,MP(n)),ze!==null)for(n=ze.return;n!==null;){var r=n;switch(Fp(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&bc();break;case 3:Ai(),je(bt),je(it),Gp();break;case 5:Hp(r);break;case 4:Ai();break;case 13:je(Te);break;case 19:je(Te);break;case 10:Bp(r.type._context);break;case 22:case 23:rm()}n=n.return}if(Ye=e,ze=e=Wr(e.current,null),Je=Lt=t,Ue=0,ma=null,em=yu=Ms=0,xt=Bo=null,ys!==null){for(t=0;t<ys.length;t++)if(n=ys[t],r=n.interleaved,r!==null){n.interleaved=null;var s=r.next,i=n.pending;if(i!==null){var o=i.next;i.next=s,r.next=o}n.pending=r}ys=null}return e}function pb(e,t){do{var n=ze;try{if(zp(),Vl.current=Nc,Tc){for(var r=Ne.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}Tc=!1}if(Is=0,Ke=Ve=Ne=null,$o=!1,fa=0,Zp.current=null,n===null||n.return===null){Ue=1,ma=t,ze=null;break}e:{var i=e,o=n.return,a=n,l=t;if(t=Je,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,u=a,f=u.tag;if(!(u.mode&1)&&(f===0||f===11||f===15)){var h=u.alternate;h?(u.updateQueue=h.updateQueue,u.memoizedState=h.memoizedState,u.lanes=h.lanes):(u.updateQueue=null,u.memoizedState=null)}var p=vy(o);if(p!==null){p.flags&=-257,wy(p,o,a,i,t),p.mode&1&&xy(i,c,t),t=p,l=c;var m=t.updateQueue;if(m===null){var g=new Set;g.add(l),t.updateQueue=g}else m.add(l);break e}else{if(!(t&1)){xy(i,c,t),sm();break e}l=Error(U(426))}}else if(Ee&&a.mode&1){var w=vy(o);if(w!==null){!(w.flags&65536)&&(w.flags|=256),wy(w,o,a,i,t),Op(Ii(l,a));break e}}i=l=Ii(l,a),Ue!==4&&(Ue=2),Bo===null?Bo=[i]:Bo.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var y=X1(i,l,t);fy(i,y);break e;case 1:a=l;var x=i.type,v=i.stateNode;if(!(i.flags&128)&&(typeof x.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(Vr===null||!Vr.has(v)))){i.flags|=65536,t&=-t,i.lanes|=t;var k=J1(i,a,t);fy(i,k);break e}}i=i.return}while(i!==null)}yb(n)}catch(C){t=C,ze===n&&n!==null&&(ze=n=n.return);continue}break}while(!0)}function mb(){var e=Rc.current;return Rc.current=Nc,e===null?Nc:e}function sm(){(Ue===0||Ue===3||Ue===2)&&(Ue=4),Ye===null||!(Ms&268435455)&&!(yu&268435455)||Tr(Ye,Je)}function Mc(e,t){var n=le;le|=2;var r=mb();(Ye!==e||Je!==t)&&(Xn=null,ks(e,t));do try{iE();break}catch(s){pb(e,s)}while(!0);if(zp(),le=n,Rc.current=r,ze!==null)throw Error(U(261));return Ye=null,Je=0,Ue}function iE(){for(;ze!==null;)gb(ze)}function oE(){for(;ze!==null&&!Rj();)gb(ze)}function gb(e){var t=vb(e.alternate,e,Lt);e.memoizedProps=e.pendingProps,t===null?yb(e):ze=t,Zp.current=null}function yb(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=ZP(n,t),n!==null){n.flags&=32767,ze=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ue=6,ze=null;return}}else if(n=JP(n,t,Lt),n!==null){ze=n;return}if(t=t.sibling,t!==null){ze=t;return}ze=t=e}while(t!==null);Ue===0&&(Ue=5)}function fs(e,t,n){var r=ue,s=tn.transition;try{tn.transition=null,ue=1,aE(e,t,n,r)}finally{tn.transition=s,ue=r}return null}function aE(e,t,n,r){do ki();while(Rr!==null);if(le&6)throw Error(U(327));n=e.finishedWork;var s=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(U(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(Bj(e,i),e===Ye&&(ze=Ye=null,Je=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||cl||(cl=!0,wb(mc,function(){return ki(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=tn.transition,tn.transition=null;var o=ue;ue=1;var a=le;le|=4,Zp.current=null,tE(e,n),db(n,e),PP(Qf),yc=!!qf,Qf=qf=null,e.current=n,nE(n),Aj(),le=a,ue=o,tn.transition=i}else e.current=n;if(cl&&(cl=!1,Rr=e,Ic=s),i=e.pendingLanes,i===0&&(Vr=null),Lj(n.stateNode),_t(e,De()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)s=t[n],r(s.value,{componentStack:s.stack,digest:s.digest});if(Ac)throw Ac=!1,e=gh,gh=null,e;return Ic&1&&e.tag!==0&&ki(),i=e.pendingLanes,i&1?e===yh?Vo++:(Vo=0,yh=e):Vo=0,es(),null}function ki(){if(Rr!==null){var e=Xw(Ic),t=tn.transition,n=ue;try{if(tn.transition=null,ue=16>e?16:e,Rr===null)var r=!1;else{if(e=Rr,Rr=null,Ic=0,le&6)throw Error(U(331));var s=le;for(le|=4,K=e.current;K!==null;){var i=K,o=i.child;if(K.flags&16){var a=i.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(K=c;K!==null;){var u=K;switch(u.tag){case 0:case 11:case 15:zo(8,u,i)}var f=u.child;if(f!==null)f.return=u,K=f;else for(;K!==null;){u=K;var h=u.sibling,p=u.return;if(lb(u),u===c){K=null;break}if(h!==null){h.return=p,K=h;break}K=p}}}var m=i.alternate;if(m!==null){var g=m.child;if(g!==null){m.child=null;do{var w=g.sibling;g.sibling=null,g=w}while(g!==null)}}K=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,K=o;else e:for(;K!==null;){if(i=K,i.flags&2048)switch(i.tag){case 0:case 11:case 15:zo(9,i,i.return)}var y=i.sibling;if(y!==null){y.return=i.return,K=y;break e}K=i.return}}var x=e.current;for(K=x;K!==null;){o=K;var v=o.child;if(o.subtreeFlags&2064&&v!==null)v.return=o,K=v;else e:for(o=x;K!==null;){if(a=K,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:gu(9,a)}}catch(C){Me(a,a.return,C)}if(a===o){K=null;break e}var k=a.sibling;if(k!==null){k.return=a.return,K=k;break e}K=a.return}}if(le=s,es(),$n&&typeof $n.onPostCommitFiberRoot=="function")try{$n.onPostCommitFiberRoot(lu,e)}catch{}r=!0}return r}finally{ue=n,tn.transition=t}}return!1}function Iy(e,t,n){t=Ii(n,t),t=X1(e,t,1),e=Br(e,t,1),t=ft(),e!==null&&(ja(e,1,t),_t(e,t))}function Me(e,t,n){if(e.tag===3)Iy(e,e,n);else for(;t!==null;){if(t.tag===3){Iy(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Vr===null||!Vr.has(r))){e=Ii(n,e),e=J1(t,e,1),t=Br(t,e,1),e=ft(),t!==null&&(ja(t,1,e),_t(t,e));break}}t=t.return}}function lE(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=ft(),e.pingedLanes|=e.suspendedLanes&n,Ye===e&&(Je&n)===n&&(Ue===4||Ue===3&&(Je&130023424)===Je&&500>De()-tm?ks(e,0):em|=n),_t(e,t)}function xb(e,t){t===0&&(e.mode&1?(t=Za,Za<<=1,!(Za&130023424)&&(Za=4194304)):t=1);var n=ft();e=ir(e,t),e!==null&&(ja(e,t,n),_t(e,n))}function cE(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),xb(e,n)}function uE(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(U(314))}r!==null&&r.delete(t),xb(e,n)}var vb;vb=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||bt.current)vt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return vt=!1,XP(e,t,n);vt=!!(e.flags&131072)}else vt=!1,Ee&&t.flags&1048576&&_1(t,Sc,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Wl(e,t),e=t.pendingProps;var s=Ti(t,it.current);bi(t,n),s=Yp(null,t,r,e,s,n);var i=qp();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,kt(r)?(i=!0,kc(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Up(t),s.updater=mu,t.stateNode=s,s._reactInternals=t,ih(t,r,e,n),t=lh(null,t,r,!0,i,n)):(t.tag=0,Ee&&i&&Dp(t),lt(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Wl(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=fE(r),e=pn(r,e),s){case 0:t=ah(null,t,r,e,n);break e;case 1:t=_y(null,t,r,e,n);break e;case 11:t=by(null,t,r,e,n);break e;case 14:t=ky(null,t,r,pn(r.type,e),n);break e}throw Error(U(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:pn(r,s),ah(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:pn(r,s),_y(e,t,r,s,n);case 3:e:{if(nb(t),e===null)throw Error(U(387));r=t.pendingProps,i=t.memoizedState,s=i.element,T1(e,t),Pc(t,r,null,n);var o=t.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){s=Ii(Error(U(423)),t),t=Sy(e,t,r,n,s);break e}else if(r!==s){s=Ii(Error(U(424)),t),t=Sy(e,t,r,n,s);break e}else for(Dt=zr(t.stateNode.containerInfo.firstChild),Ot=t,Ee=!0,gn=null,n=P1(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ni(),r===s){t=or(e,t,n);break e}lt(e,t,r,n)}t=t.child}return t;case 5:return N1(t),e===null&&nh(t),r=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,o=s.children,Xf(r,s)?o=null:i!==null&&Xf(r,i)&&(t.flags|=32),tb(e,t),lt(e,t,o,n),t.child;case 6:return e===null&&nh(t),null;case 13:return rb(e,t,n);case 4:return Wp(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ri(t,null,r,n):lt(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:pn(r,s),by(e,t,r,s,n);case 7:return lt(e,t,t.pendingProps,n),t.child;case 8:return lt(e,t,t.pendingProps.children,n),t.child;case 12:return lt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,i=t.memoizedProps,o=s.value,we(Cc,r._currentValue),r._currentValue=o,i!==null)if(wn(i.value,o)){if(i.children===s.children&&!bt.current){t=or(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){o=i.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=tr(-1,n&-n),l.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),rh(i.return,n,t),a.lanes|=n;break}l=l.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(U(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),rh(o,n,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}lt(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,bi(t,n),s=rn(s),r=r(s),t.flags|=1,lt(e,t,r,n),t.child;case 14:return r=t.type,s=pn(r,t.pendingProps),s=pn(r.type,s),ky(e,t,r,s,n);case 15:return Z1(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:pn(r,s),Wl(e,t),t.tag=1,kt(r)?(e=!0,kc(t)):e=!1,bi(t,n),Q1(t,r,s),ih(t,r,s,n),lh(null,t,r,!0,e,n);case 19:return sb(e,t,n);case 22:return eb(e,t,n)}throw Error(U(156,t.tag))};function wb(e,t){return Kw(e,t)}function dE(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 Jt(e,t,n,r){return new dE(e,t,n,r)}function im(e){return e=e.prototype,!(!e||!e.isReactComponent)}function fE(e){if(typeof e=="function")return im(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Sp)return 11;if(e===Cp)return 14}return 2}function Wr(e,t){var n=e.alternate;return n===null?(n=Jt(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 Kl(e,t,n,r,s,i){var o=2;if(r=e,typeof e=="function")im(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case ni:return _s(n.children,s,i,t);case _p:o=8,s|=8;break;case Tf:return e=Jt(12,n,t,s|2),e.elementType=Tf,e.lanes=i,e;case Nf:return e=Jt(13,n,t,s),e.elementType=Nf,e.lanes=i,e;case Rf:return e=Jt(19,n,t,s),e.elementType=Rf,e.lanes=i,e;case Nw:return xu(n,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Ew:o=10;break e;case Tw:o=9;break e;case Sp:o=11;break e;case Cp:o=14;break e;case _r:o=16,r=null;break e}throw Error(U(130,e==null?e:typeof e,""))}return t=Jt(o,n,t,s),t.elementType=e,t.type=r,t.lanes=i,t}function _s(e,t,n,r){return e=Jt(7,e,r,t),e.lanes=n,e}function xu(e,t,n,r){return e=Jt(22,e,r,t),e.elementType=Nw,e.lanes=n,e.stateNode={isHidden:!1},e}function vd(e,t,n){return e=Jt(6,e,null,t),e.lanes=n,e}function wd(e,t,n){return t=Jt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function hE(e,t,n,r,s){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=ed(0),this.expirationTimes=ed(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ed(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function om(e,t,n,r,s,i,o,a,l){return e=new hE(e,t,n,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Jt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Up(i),e}function pE(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ti,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function bb(e){if(!e)return Yr;e=e._reactInternals;e:{if(Fs(e)!==e||e.tag!==1)throw Error(U(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(kt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(U(171))}if(e.tag===1){var n=e.type;if(kt(n))return b1(e,n,t)}return t}function kb(e,t,n,r,s,i,o,a,l){return e=om(n,r,!0,e,s,i,o,a,l),e.context=bb(null),n=e.current,r=ft(),s=Ur(n),i=tr(r,s),i.callback=t??null,Br(n,i,s),e.current.lanes=s,ja(e,s,r),_t(e,r),e}function vu(e,t,n,r){var s=t.current,i=ft(),o=Ur(s);return n=bb(n),t.context===null?t.context=n:t.pendingContext=n,t=tr(i,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Br(s,t,o),e!==null&&(xn(e,s,o,i),Bl(e,s,o)),o}function Lc(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 My(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function am(e,t){My(e,t),(e=e.alternate)&&My(e,t)}function mE(){return null}var _b=typeof reportError=="function"?reportError:function(e){console.error(e)};function lm(e){this._internalRoot=e}wu.prototype.render=lm.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(U(409));vu(e,t,null,null)};wu.prototype.unmount=lm.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ls(function(){vu(null,e,null,null)}),t[sr]=null}};function wu(e){this._internalRoot=e}wu.prototype.unstable_scheduleHydration=function(e){if(e){var t=e1();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Er.length&&t!==0&&t<Er[n].priority;n++);Er.splice(n,0,e),n===0&&n1(e)}};function cm(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 Ly(){}function gE(e,t,n,r,s){if(s){if(typeof r=="function"){var i=r;r=function(){var c=Lc(o);i.call(c)}}var o=kb(t,r,e,0,null,!1,!1,"",Ly);return e._reactRootContainer=o,e[sr]=o.current,aa(e.nodeType===8?e.parentNode:e),Ls(),o}for(;s=e.lastChild;)e.removeChild(s);if(typeof r=="function"){var a=r;r=function(){var c=Lc(l);a.call(c)}}var l=om(e,0,!1,null,null,!1,!1,"",Ly);return e._reactRootContainer=l,e[sr]=l.current,aa(e.nodeType===8?e.parentNode:e),Ls(function(){vu(t,l,n,r)}),l}function ku(e,t,n,r,s){var i=n._reactRootContainer;if(i){var o=i;if(typeof s=="function"){var a=s;s=function(){var l=Lc(o);a.call(l)}}vu(t,o,e,s)}else o=gE(n,t,e,s,r);return Lc(o)}Jw=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=To(t.pendingLanes);n!==0&&(Ep(t,n|1),_t(t,De()),!(le&6)&&(Mi=De()+500,es()))}break;case 13:Ls(function(){var r=ir(e,1);if(r!==null){var s=ft();xn(r,e,1,s)}}),am(e,1)}};Tp=function(e){if(e.tag===13){var t=ir(e,134217728);if(t!==null){var n=ft();xn(t,e,134217728,n)}am(e,134217728)}};Zw=function(e){if(e.tag===13){var t=Ur(e),n=ir(e,t);if(n!==null){var r=ft();xn(n,e,t,r)}am(e,t)}};e1=function(){return ue};t1=function(e,t){var n=ue;try{return ue=e,t()}finally{ue=n}};Bf=function(e,t,n){switch(t){case"input":if(Mf(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 s=fu(r);if(!s)throw Error(U(90));Aw(r),Mf(r,s)}}}break;case"textarea":Mw(e,n);break;case"select":t=n.value,t!=null&&yi(e,!!n.multiple,t,!1)}};Bw=nm;Vw=Ls;var yE={usingClientEntryPoint:!1,Events:[Ea,oi,fu,$w,zw,nm]},fo={findFiberByHostInstance:gs,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},xE={bundleType:fo.bundleType,version:fo.version,rendererPackageName:fo.rendererPackageName,rendererConfig:fo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:cr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Hw(e),e===null?null:e.stateNode},findFiberByHostInstance:fo.findFiberByHostInstance||mE,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 ul=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ul.isDisabled&&ul.supportsFiber)try{lu=ul.inject(xE),$n=ul}catch{}}Bt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=yE;Bt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!cm(t))throw Error(U(200));return pE(e,t,null,n)};Bt.createRoot=function(e,t){if(!cm(e))throw Error(U(299));var n=!1,r="",s=_b;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=om(e,1,!1,null,null,n,!1,r,s),e[sr]=t.current,aa(e.nodeType===8?e.parentNode:e),new lm(t)};Bt.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(U(188)):(e=Object.keys(e).join(","),Error(U(268,e)));return e=Hw(t),e=e===null?null:e.stateNode,e};Bt.flushSync=function(e){return Ls(e)};Bt.hydrate=function(e,t,n){if(!bu(t))throw Error(U(200));return ku(null,e,t,!0,n)};Bt.hydrateRoot=function(e,t,n){if(!cm(e))throw Error(U(405));var r=n!=null&&n.hydratedSources||null,s=!1,i="",o=_b;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=kb(t,null,e,1,n??null,s,!1,i,o),e[sr]=t.current,aa(e),r)for(e=0;e<r.length;e++)n=r[e],s=n._getVersion,s=s(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,s]:t.mutableSourceEagerHydrationData.push(n,s);return new wu(t)};Bt.render=function(e,t,n){if(!bu(t))throw Error(U(200));return ku(null,e,t,!1,n)};Bt.unmountComponentAtNode=function(e){if(!bu(e))throw Error(U(40));return e._reactRootContainer?(Ls(function(){ku(null,null,e,!1,function(){e._reactRootContainer=null,e[sr]=null})}),!0):!1};Bt.unstable_batchedUpdates=nm;Bt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!bu(n))throw Error(U(200));if(e==null||e._reactInternals===void 0)throw Error(U(38));return ku(e,t,n,!1,r)};Bt.version="18.3.1-next-f1338f8080-20240426";function Sb(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Sb)}catch(e){console.error(e)}}Sb(),Sw.exports=Bt;var Os=Sw.exports,Cb,Dy=Os;Cb=Dy.createRoot,Dy.hydrateRoot;var Ro=typeof window<"u"?b.useLayoutEffect:b.useEffect;function bd(e){const t=b.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function vE(e,t,n={},r={}){b.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const s=new IntersectionObserver(([i])=>{t(i)},n);return s.observe(e.current),()=>{s.disconnect()}},[t,n,r.disabled,e])}function wE(e){const t=b.useRef(null);return b.useImperativeHandle(e,()=>t.current,[]),t}const jb=!1;function ga(e){return e[e.length-1]}function bE(e){return typeof e=="function"}function Ar(e,t){return bE(e)?e(t):e}const kE=Object.prototype.hasOwnProperty,Fy=Object.prototype.propertyIsEnumerable,_E=()=>Object.create(null),is=(e,t)=>Ir(e,t,_E);function Ir(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;const s=t,i=zy(e)&&zy(s);if(!i&&!(Li(e)&&Li(s)))return s;const o=i?e:Oy(e);if(!o)return s;const a=i?s:Oy(s);if(!a)return s;const l=o.length,c=a.length,u=i?new Array(c):n();let f=0;for(let h=0;h<c;h++){const p=i?h:a[h],m=e[p],g=s[p];if(m===g){u[p]=m,(i?h<l:kE.call(e,p))&&f++;continue}if(m===null||g===null||typeof m!="object"||typeof g!="object"){u[p]=g;continue}const w=Ir(m,g,n,r+1);u[p]=w,w===m&&f++}return l===c&&f===l?e:u}function Oy(e){const t=Object.getOwnPropertyNames(e);for(const s of t)if(!Fy.call(e,s))return!1;const n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;const r=t;for(const s of n){if(!Fy.call(e,s))return!1;r.push(s)}return r}function Li(e){if(!$y(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!$y(n)||!n.hasOwnProperty("isPrototypeOf"))}function $y(e){return Object.prototype.toString.call(e)==="[object Object]"}function zy(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ss(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,s=e.length;r<s;r++)if(!Ss(e[r],t[r],n))return!1;return!0}if(Li(e)&&Li(t)){const r=(n==null?void 0:n.ignoreUndefined)??!0;if(n!=null&&n.partial){for(const o in t)if((!r||t[o]!==void 0)&&!Ss(e[o],t[o],n))return!1;return!0}let s=0;if(!r)s=Object.keys(e).length;else for(const o in e)e[o]!==void 0&&s++;let i=0;for(const o in t)if((!r||t[o]!==void 0)&&(i++,i>s||!Ss(e[o],t[o],n)))return!1;return s===i}return!1}function Di(e){let t,n;const r=new Promise((s,i)=>{t=s,n=i});return r.status="pending",r.resolve=s=>{r.status="resolved",r.value=s,t(s),e==null||e(s)},r.reject=s=>{r.status="rejected",n(s)},r}function ya(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function SE(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function By(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return SE(t)}const CE=["http:","https:","mailto:","tel:"];function Dc(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function ho(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const t=/%25|%5C/gi;let n=0,r="",s;for(;(s=t.exec(e))!==null;)r+=By(e.slice(n,s.index))+s[0],n=t.lastIndex;r=r+By(n?e.slice(n):e);let i=!1;return r.startsWith("//")&&(i=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:i}}function jE(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function PE(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function nr(){throw new Error("Invariant failed")}function xa(e){const t=new Map;let n,r;const s=i=>{i.next&&(i.prev?(i.prev.next=i.next,i.next.prev=i.prev,i.next=void 0,r&&(r.next=i,i.prev=r)):(i.next.prev=void 0,n=i.next,i.next=void 0,r&&(i.prev=r,r.next=i)),r=i)};return{get(i){const o=t.get(i);if(o)return s(o),o.value},set(i,o){if(t.size>=e&&n){const l=n;t.delete(l.key),l.next&&(n=l.next,l.next.prev=void 0),l===r&&(r=void 0)}const a=t.get(i);if(a)a.value=o,s(a);else{const l={key:i,value:o,prev:r};r&&(r.next=l),r=l,n||(n=l),t.set(i,l)}},clear(){t.clear(),n=void 0,r=void 0}}}const Mr=4,Pb=5;function EE(e){const t=e.indexOf("{");if(t===-1)return null;const n=e.indexOf("}",t);return n===-1||t+1>=e.length?null:[t,n]}function um(e,t,n=new Uint16Array(6)){const r=e.indexOf("/",t),s=r===-1?e.length:r,i=e.substring(t,s);if(!i||!i.includes("$"))return n[0]=0,n[1]=t,n[2]=t,n[3]=s,n[4]=s,n[5]=s,n;if(i==="$"){const a=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=a,n[4]=a,n[5]=a,n}if(i.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=s,n[4]=s,n[5]=s,n;const o=EE(i);if(o){const[a,l]=o,c=i.charCodeAt(a+1);if(c===45){if(a+2<i.length&&i.charCodeAt(a+2)===36){const u=a+3,f=l;if(u<f)return n[0]=3,n[1]=t+a,n[2]=t+u,n[3]=t+f,n[4]=t+l+1,n[5]=s,n}}else if(c===36){const u=a+1,f=a+2;return f===l?(n[0]=2,n[1]=t+a,n[2]=t+u,n[3]=t+f,n[4]=t+l+1,n[5]=e.length,n):(n[0]=1,n[1]=t+a,n[2]=t+f,n[3]=t+l,n[4]=t+l+1,n[5]=s,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=s,n[4]=s,n[5]=s,n}function _u(e,t,n,r,s,i,o){var l,c,u,f,h,p,m,g,w,y,x,v,k;o==null||o(n);let a=r;{const C=n.fullPath??n.from,S=C.length,P=((l=n.options)==null?void 0:l.caseSensitive)??e,T=!!((u=(c=n.options)==null?void 0:c.params)!=null&&u.parse&&((h=(f=n.options)==null?void 0:f.skipRouteOnParseError)!=null&&h.params));for(;a<S;){const j=um(C,a,t);let R;const I=a,D=j[5];switch(a=D+1,i++,j[0]){case 0:{const $=C.substring(j[2],j[3]);if(P){const A=(p=s.static)==null?void 0:p.get($);if(A)R=A;else{s.static??(s.static=new Map);const z=vs(n.fullPath??n.from);z.parent=s,z.depth=i,R=z,s.static.set($,z)}}else{const A=$.toLowerCase(),z=(m=s.staticInsensitive)==null?void 0:m.get(A);if(z)R=z;else{s.staticInsensitive??(s.staticInsensitive=new Map);const O=vs(n.fullPath??n.from);O.parent=s,O.depth=i,R=O,s.staticInsensitive.set(A,O)}}break}case 1:{const $=C.substring(I,j[1]),A=C.substring(j[4],D),z=P&&!!($||A),O=$?z?$:$.toLowerCase():void 0,L=A?z?A:A.toLowerCase():void 0,V=!T&&((g=s.dynamic)==null?void 0:g.find(_=>!_.skipOnParamError&&_.caseSensitive===z&&_.prefix===O&&_.suffix===L));if(V)R=V;else{const _=_d(1,n.fullPath??n.from,z,O,L);R=_,_.depth=i,_.parent=s,s.dynamic??(s.dynamic=[]),s.dynamic.push(_)}break}case 3:{const $=C.substring(I,j[1]),A=C.substring(j[4],D),z=P&&!!($||A),O=$?z?$:$.toLowerCase():void 0,L=A?z?A:A.toLowerCase():void 0,V=!T&&((w=s.optional)==null?void 0:w.find(_=>!_.skipOnParamError&&_.caseSensitive===z&&_.prefix===O&&_.suffix===L));if(V)R=V;else{const _=_d(3,n.fullPath??n.from,z,O,L);R=_,_.parent=s,_.depth=i,s.optional??(s.optional=[]),s.optional.push(_)}break}case 2:{const $=C.substring(I,j[1]),A=C.substring(j[4],D),z=P&&!!($||A),O=$?z?$:$.toLowerCase():void 0,L=A?z?A:A.toLowerCase():void 0,V=_d(2,n.fullPath??n.from,z,O,L);R=V,V.parent=s,V.depth=i,s.wildcard??(s.wildcard=[]),s.wildcard.push(V)}}s=R}if(T&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const j=vs(n.fullPath??n.from);j.kind=Pb,j.parent=s,i++,j.depth=i,s.pathless??(s.pathless=[]),s.pathless.push(j),s=j}const E=(n.path||!n.children)&&!n.isRoot;if(E&&C.endsWith("/")){const j=vs(n.fullPath??n.from);j.kind=Mr,j.parent=s,i++,j.depth=i,s.index=j,s=j}s.parse=((x=(y=n.options)==null?void 0:y.params)==null?void 0:x.parse)??null,s.skipOnParamError=T,s.parsingPriority=((k=(v=n.options)==null?void 0:v.skipRouteOnParseError)==null?void 0:k.priority)??0,E&&!s.route&&(s.route=n,s.fullPath=n.fullPath??n.from)}if(n.children)for(const C of n.children)_u(e,t,C,a,s,i,o)}function kd(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function Cr(e){var t,n,r;if(e.pathless)for(const s of e.pathless)Cr(s);if(e.static)for(const s of e.static.values())Cr(s);if(e.staticInsensitive)for(const s of e.staticInsensitive.values())Cr(s);if((t=e.dynamic)!=null&&t.length){e.dynamic.sort(kd);for(const s of e.dynamic)Cr(s)}if((n=e.optional)!=null&&n.length){e.optional.sort(kd);for(const s of e.optional)Cr(s)}if((r=e.wildcard)!=null&&r.length){e.wildcard.sort(kd);for(const s of e.wildcard)Cr(s)}}function vs(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function _d(e,t,n,r,s){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:n,prefix:r,suffix:s}}function TE(e,t){const n=vs("/"),r=new Uint16Array(6);for(const s of e)_u(!1,r,s,1,n,0);Cr(n),t.masksTree=n,t.flatCache=xa(1e3)}function NE(e,t){e||(e="/");const n=t.flatCache.get(e);if(n)return n;const r=dm(e,t.masksTree);return t.flatCache.set(e,r),r}function RE(e,t,n,r,s){e||(e="/"),r||(r="/");const i=t?`case\0${e}`:e;let o=s.singleCache.get(i);return o||(o=vs("/"),_u(t,new Uint16Array(6),{from:e},1,o,0),s.singleCache.set(i,o)),dm(r,o,n)}function AE(e,t,n=!1){const r=n?e:`nofuzz\0${e}`,s=t.matchCache.get(r);if(s!==void 0)return s;e||(e="/");let i;try{i=dm(e,t.segmentTree,n)}catch(o){if(o instanceof URIError)i=null;else throw o}return i&&(i.branch=LE(i.route)),t.matchCache.set(r,i),i}function IE(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function ME(e,t=!1,n){const r=vs(e.fullPath),s=new Uint16Array(6),i={},o={};let a=0;return _u(t,s,e,1,r,0,l=>{if(n==null||n(l,a),l.id in i&&nr(),i[l.id]=l,a!==0&&l.path){const c=IE(l.fullPath);(!o[c]||l.fullPath.endsWith("/"))&&(o[c]=l)}a++}),Cr(r),{processedTree:{segmentTree:r,singleCache:xa(1e3),matchCache:xa(1e3),flatCache:null,masksTree:null},routesById:i,routesByPath:o}}function dm(e,t,n=!1){const r=e.split("/"),s=FE(e,r,t,n);if(!s)return null;const[i]=Eb(e,r,s);return{route:s.node.route,rawParams:i,parsedParams:s.parsedParams}}function Eb(e,t,n){var u,f,h,p,m,g,w,y,x,v;const r=DE(n.node);let s=null;const i=Object.create(null);let o=((u=n.extract)==null?void 0:u.part)??0,a=((f=n.extract)==null?void 0:f.node)??0,l=((h=n.extract)==null?void 0:h.path)??0,c=((p=n.extract)==null?void 0:p.segment)??0;for(;a<r.length;o++,a++,l++,c++){const k=r[a];if(k.kind===Mr)break;if(k.kind===Pb){c--,o--,l--;continue}const C=t[o],S=l;if(C&&(l+=C.length),k.kind===1){s??(s=n.node.fullPath.split("/"));const P=s[c],T=((m=k.prefix)==null?void 0:m.length)??0;if(P.charCodeAt(T)===123){const E=((g=k.suffix)==null?void 0:g.length)??0,j=P.substring(T+2,P.length-E-1),R=C.substring(T,C.length-E);i[j]=decodeURIComponent(R)}else{const E=P.substring(1);i[E]=decodeURIComponent(C)}}else if(k.kind===3){if(n.skipped&1<<a){o--,l=S-1;continue}s??(s=n.node.fullPath.split("/"));const P=s[c],T=((w=k.prefix)==null?void 0:w.length)??0,E=((y=k.suffix)==null?void 0:y.length)??0,j=P.substring(T+3,P.length-E-1),R=k.suffix||k.prefix?C.substring(T,C.length-E):C;R&&(i[j]=decodeURIComponent(R))}else if(k.kind===2){const P=k,T=e.substring(S+(((x=P.prefix)==null?void 0:x.length)??0),e.length-(((v=P.suffix)==null?void 0:v.length)??0)),E=decodeURIComponent(T);i["*"]=E,i._splat=E;break}}return n.rawParams&&Object.assign(i,n.rawParams),[i,{part:o,node:a,path:l,segment:c}]}function LE(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function DE(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function FE(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const s=!ga(t),i=s&&e!=="/",o=t.length-(s?1:0),a=[{node:n,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}];let l=null,c=null;for(;a.length;){const u=a.pop(),{node:f,index:h,skipped:p,depth:m,statics:g,dynamics:w,optionals:y}=u;let{extract:x,rawParams:v,parsedParams:k}=u;if(f.kind===2&&f.route&&!fl(c,u))continue;if(f.skipOnParamError){if(!Vy(e,t,u))continue;v=u.rawParams,x=u.extract,k=u.parsedParams}r&&f.route&&f.kind!==Mr&&fl(l,u)&&(l=u);const C=h===o;if(C&&(f.route&&(!i||f.kind===Mr||f.kind===2)&&fl(c,u)&&(c=u),!f.optional&&!f.wildcard&&!f.index&&!f.pathless))continue;const S=C?void 0:t[h];let P;if(C&&f.index){const T={node:f.index,index:h,skipped:p,depth:m+1,statics:g,dynamics:w,optionals:y,extract:x,rawParams:v,parsedParams:k};let E=!0;if(f.index.skipOnParamError&&(Vy(e,t,T)||(E=!1)),E){if(!w&&!y&&!p&&OE(g,o))return T;fl(c,T)&&(c=T)}}if(f.wildcard)for(let T=f.wildcard.length-1;T>=0;T--){const E=f.wildcard[T],{prefix:j,suffix:R}=E;if(!(j&&(C||!(E.caseSensitive?S:P??(P=S.toLowerCase())).startsWith(j)))){if(R){if(C)continue;const I=t.slice(h).join("/").slice(-R.length);if((E.caseSensitive?I:I.toLowerCase())!==R)continue}a.push({node:E,index:o,skipped:p,depth:m+1,statics:g,dynamics:w,optionals:y,extract:x,rawParams:v,parsedParams:k})}}if(f.optional){const T=p|1<<m,E=m+1;for(let j=f.optional.length-1;j>=0;j--){const R=f.optional[j];a.push({node:R,index:h,skipped:T,depth:E,statics:g,dynamics:w,optionals:y,extract:x,rawParams:v,parsedParams:k})}if(!C)for(let j=f.optional.length-1;j>=0;j--){const R=f.optional[j],{prefix:I,suffix:D}=R;if(I||D){const $=R.caseSensitive?S:P??(P=S.toLowerCase());if(I&&!$.startsWith(I)||D&&!$.endsWith(D))continue}a.push({node:R,index:h+1,skipped:p,depth:E,statics:g,dynamics:w,optionals:y+dl(o,h),extract:x,rawParams:v,parsedParams:k})}}if(!C&&f.dynamic&&S)for(let T=f.dynamic.length-1;T>=0;T--){const E=f.dynamic[T],{prefix:j,suffix:R}=E;if(j||R){const I=E.caseSensitive?S:P??(P=S.toLowerCase());if(j&&!I.startsWith(j)||R&&!I.endsWith(R))continue}a.push({node:E,index:h+1,skipped:p,depth:m+1,statics:g,dynamics:w+dl(o,h),optionals:y,extract:x,rawParams:v,parsedParams:k})}if(!C&&f.staticInsensitive){const T=f.staticInsensitive.get(P??(P=S.toLowerCase()));T&&a.push({node:T,index:h+1,skipped:p,depth:m+1,statics:g+dl(o,h),dynamics:w,optionals:y,extract:x,rawParams:v,parsedParams:k})}if(!C&&f.static){const T=f.static.get(S);T&&a.push({node:T,index:h+1,skipped:p,depth:m+1,statics:g+dl(o,h),dynamics:w,optionals:y,extract:x,rawParams:v,parsedParams:k})}if(f.pathless){const T=m+1;for(let E=f.pathless.length-1;E>=0;E--){const j=f.pathless[E];a.push({node:j,index:h,skipped:p,depth:T,statics:g,dynamics:w,optionals:y,extract:x,rawParams:v,parsedParams:k})}}}if(c)return c;if(r&&l){let u=l.index;for(let h=0;h<l.index;h++)u+=t[h].length;const f=u===e.length?"/":e.slice(u);return l.rawParams??(l.rawParams=Object.create(null)),l.rawParams["**"]=decodeURIComponent(f),l}return null}function dl(e,t){return 2**(e-t-1)}function OE(e,t){return e===2**(t-1)-1}function Vy(e,t,n){try{const[r,s]=Eb(e,t,n);n.rawParams=r,n.extract=s;const i=n.node.parse(r);return n.parsedParams=Object.assign(Object.create(null),n.parsedParams,i),!0}catch{return null}}function fl(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===Mr)>(e.node.kind===Mr)||t.node.kind===Mr==(e.node.kind===Mr)&&t.depth>e.depth))):!0}function Yl(e){return fm(e.filter(t=>t!==void 0).join("/"))}function fm(e){return e.replace(/\/{2,}/g,"/")}function Tb(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Hr(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function Nb(e){return Hr(Tb(e))}function Fc(e,t){return e!=null&&e.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function $E(e,t,n){return Fc(e,n)===Fc(t,n)}function zE({base:e,to:t,trailingSlash:n="never",cache:r}){const s=t.startsWith("/"),i=!s&&t===".";let o;if(r){o=s?t:i?e:e+"\0"+t;const f=r.get(o);if(f)return f}let a;if(i)a=e.split("/");else if(s)a=t.split("/");else{for(a=e.split("/");a.length>1&&ga(a)==="";)a.pop();const f=t.split("/");for(let h=0,p=f.length;h<p;h++){const m=f[h];m===""?h?h===p-1&&a.push(m):a=[m]:m===".."?a.pop():m==="."||a.push(m)}}a.length>1&&(ga(a)===""?n==="never"&&a.pop():n==="always"&&a.push(""));let l,c="";for(let f=0;f<a.length;f++){f>0&&(c+="/");const h=a[f];if(!h)continue;l=um(h,0,l);const p=l[0];if(p===0){c+=h;continue}const m=l[5],g=h.substring(0,l[1]),w=h.substring(l[4],m),y=h.substring(l[2],l[3]);p===1?c+=g||w?`${g}{$${y}}${w}`:`$${y}`:p===2?c+=g||w?`${g}{$}${w}`:"$":c+=`${g}{-$${y}}${w}`}c=fm(c);const u=c||"/";return o&&r&&r.set(o,u),u}function BE(e){const t=new Map(e.map(s=>[encodeURIComponent(s),s])),n=Array.from(t.keys()).map(s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(n,"g");return s=>s.replace(r,i=>t.get(i)??i)}function Sd(e,t,n){const r=t[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(s=>Wy(s,n)).join("/"):Wy(r,n)}function Uy({path:e,params:t,decoder:n,...r}){let s=!1;const i=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:i,isMissingParams:s};if(!e.includes("$"))return{interpolatedPath:e,usedParams:i,isMissingParams:s};const o=e.length;let a=0,l,c="";for(;a<o;){const u=a;l=um(e,u,l);const f=l[5];if(a=f+1,u===f)continue;const h=l[0];if(h===0){c+="/"+e.substring(u,f);continue}if(h===2){const p=t._splat;i._splat=p,i["*"]=p;const m=e.substring(u,l[1]),g=e.substring(l[4],f);if(!p){s=!0,(m||g)&&(c+="/"+m+g);continue}const w=Sd("_splat",t,n);c+="/"+m+w+g;continue}if(h===1){const p=e.substring(l[2],l[3]);!s&&!(p in t)&&(s=!0),i[p]=t[p];const m=e.substring(u,l[1]),g=e.substring(l[4],f),w=Sd(p,t,n)??"undefined";c+="/"+m+w+g;continue}if(h===3){const p=e.substring(l[2],l[3]),m=t[p];if(m==null)continue;i[p]=m;const g=e.substring(u,l[1]),w=e.substring(l[4],f),y=Sd(p,t,n)??"";c+="/"+g+y+w;continue}}return e.endsWith("/")&&(c+="/"),{usedParams:i,interpolatedPath:c||"/",isMissingParams:s}}function Wy(e,t){const n=encodeURIComponent(e);return(t==null?void 0:t(n))??n}function st(e){return(e==null?void 0:e.isNotFound)===!0}function VE(){try{return typeof window<"u"&&typeof window.sessionStorage=="object"?window.sessionStorage:void 0}catch{return}}const UE="tsr-scroll-restoration-v1_3";function WE(){const e=VE();if(!e)return null;let t={};try{const r=JSON.parse(e.getItem("tsr-scroll-restoration-v1_3")||"{}");Li(r)&&(t=r)}catch{}return{get state(){return t},set:r=>{t=Ar(r,t)||t},persist:()=>{try{e.setItem(UE,JSON.stringify(t))}catch{}}}}const Hy=WE(),HE=e=>e.state.__TSR_key||e.href;function GE(e){const t=[];let n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(" > ")}`.toLowerCase()}let hl=!1;const po="window",Gy="data-scroll-restoration-id";function KE(e,t){if(!Hy)return;const n=Hy;if((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!n)return;e.isScrollRestorationSetup=!0,hl=!1;const r=e.options.getScrollRestorationKey||HE,s=new Map;window.history.scrollRestoration="manual";const i=a=>{if(!(hl||!e.isScrollRestoring))if(a.target===document||a.target===window)s.set(po,{scrollX:window.scrollX||0,scrollY:window.scrollY||0});else{const l=a.target;s.set(l,{scrollX:l.scrollLeft||0,scrollY:l.scrollTop||0})}},o=a=>{var c;if(!e.isScrollRestoring||!a||s.size===0||!n)return;const l=(c=n.state)[a]||(c[a]={});for(const[u,f]of s){let h;if(u===po)h=po;else if(u.isConnected){const p=u.getAttribute(Gy);h=p?`[${Gy}="${p}"]`:GE(u)}h&&(l[h]=f)}};document.addEventListener("scroll",i,!0),e.subscribe("onBeforeLoad",a=>{o(a.fromLocation?r(a.fromLocation):void 0),s.clear()}),window.addEventListener("pagehide",()=>{o(r(e.stores.resolvedLocation.get()??e.stores.location.get())),n.persist()}),e.subscribe("onRendered",a=>{var f;const l=r(a.toLocation),c=e.options.scrollRestorationBehavior,u=e.options.scrollToTopSelectors;if(s.clear(),!e.resetNextScroll){e.resetNextScroll=!0;return}if(!(typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))){hl=!0;try{const h=e.isScrollRestoring?n.state[l]:void 0;let p=!1;if(h)for(const m in h){const g=h[m];if(!Li(g))continue;const{scrollX:w,scrollY:y}=g;if(!(!Number.isFinite(w)||!Number.isFinite(y))){if(m===po)window.scrollTo({top:y,left:w,behavior:c}),p=!0;else if(m){let x;try{x=document.querySelector(m)}catch{continue}x&&(x.scrollLeft=w,x.scrollTop=y,p=!0)}}}if(!p){const m=e.history.location.hash.slice(1);if(m){const g=((f=window.history.state)==null?void 0:f.__hashScrollIntoViewOptions)??!0;if(g){const w=document.getElementById(m);w&&w.scrollIntoView(g)}}else{const g={top:0,left:0,behavior:c};if(window.scrollTo(g),u)for(const w of u){if(w===po)continue;const y=typeof w=="function"?w():document.querySelector(w);y&&y.scrollTo(g)}}}}finally{hl=!1}e.isScrollRestoring&&n.set(h=>(h[l]||(h[l]={}),h))}})}function YE(e,t=String){const n=new URLSearchParams;for(const r in e){const s=e[r];s!==void 0&&n.set(r,t(s))}return n.toString()}function Cd(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function qE(e){const t=new URLSearchParams(e),n=Object.create(null);for(const[r,s]of t.entries()){const i=n[r];i==null?n[r]=Cd(s):Array.isArray(i)?i.push(Cd(s)):n[r]=[i,Cd(s)]}return n}const QE=JE(JSON.parse),XE=ZE(JSON.stringify,JSON.parse);function JE(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=qE(t);for(const r in n){const s=n[r];if(typeof s=="string")try{n[r]=e(s)}catch{}}return n}}function ZE(e,t){const n=typeof t=="function";function r(s){if(typeof s=="object"&&s!==null)try{return e(s)}catch{}else if(n&&typeof s=="string")try{return t(s),e(s)}catch{}return s}return s=>{const i=YE(s,r);return i?`?${i}`:""}}const Cs="__root__";function eT(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function wt(e){return e instanceof Response&&!!e.options}function tT(e){return{input:({url:t})=>{for(const n of e)t=wh(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=Rb(e[n],t);return t}}}function nT(e){const t=Nb(e.basepath),n=`/${t}`,r=`${n}/`,s=e.caseSensitive?n:n.toLowerCase(),i=e.caseSensitive?r:r.toLowerCase();return{input:({url:o})=>{const a=e.caseSensitive?o.pathname:o.pathname.toLowerCase();return a===s?o.pathname="/":a.startsWith(i)&&(o.pathname=o.pathname.slice(n.length)),o},output:({url:o})=>(o.pathname=Yl(["/",t,o.pathname]),o)}}function wh(e,t){var r;const n=(r=e==null?void 0:e.input)==null?void 0:r.call(e,{url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function Rb(e,t){var r;const n=(r=e==null?void 0:e.output)==null?void 0:r.call(e,{url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function rT(e,t){const{createMutableStore:n,createReadonlyStore:r,batch:s,init:i}=t,o=new Map,a=new Map,l=new Map,c=n(e.status),u=n(e.loadedAt),f=n(e.isLoading),h=n(e.isTransitioning),p=n(e.location),m=n(e.resolvedLocation),g=n(e.statusCode),w=n(e.redirect),y=n([]),x=n([]),v=n([]),k=r(()=>jd(o,y.get())),C=r(()=>jd(a,x.get())),S=r(()=>jd(l,v.get())),P=r(()=>y.get()[0]),T=r(()=>y.get().some(O=>{var L;return((L=o.get(O))==null?void 0:L.get().status)==="pending"})),E=r(()=>{var O;return{locationHref:p.get().href,resolvedLocationHref:(O=m.get())==null?void 0:O.href,status:c.get()}}),j=r(()=>({status:c.get(),loadedAt:u.get(),isLoading:f.get(),isTransitioning:h.get(),matches:k.get(),location:p.get(),resolvedLocation:m.get(),statusCode:g.get(),redirect:w.get()})),R=xa(64);function I(O){let L=R.get(O);return L||(L=r(()=>{const V=y.get();for(const _ of V){const B=o.get(_);if(B&&B.routeId===O)return B.get()}}),R.set(O,L)),L}const D={status:c,loadedAt:u,isLoading:f,isTransitioning:h,location:p,resolvedLocation:m,statusCode:g,redirect:w,matchesId:y,pendingIds:x,cachedIds:v,matches:k,pendingMatches:C,cachedMatches:S,firstId:P,hasPending:T,matchRouteDeps:E,matchStores:o,pendingMatchStores:a,cachedMatchStores:l,__store:j,getRouteMatchStore:I,setMatches:$,setPending:A,setCached:z};$(e.matches),i==null||i(D);function $(O){Pd(O,o,y,n,s)}function A(O){Pd(O,a,x,n,s)}function z(O){Pd(O,l,v,n,s)}return D}function jd(e,t){const n=[];for(const r of t){const s=e.get(r);s&&n.push(s.get())}return n}function Pd(e,t,n,r,s){const i=e.map(a=>a.id),o=new Set(i);s(()=>{for(const a of t.keys())o.has(a)||t.delete(a);for(const a of e){const l=t.get(a.id);if(!l){const c=r(a);c.routeId=a.routeId,t.set(a.id,c);continue}l.routeId=a.routeId,l.get()!==a&&l.set(a)}PE(n.get(),i)||n.set(i)})}const bh=e=>{var t;if(!e.rendered)return e.rendered=!0,(t=e.onReady)==null?void 0:t.call(e)},sT=e=>e.stores.matchesId.get().some(t=>{var n;return(n=e.stores.matchStores.get(t))==null?void 0:n.get()._forcePending}),Su=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),js=(e,t,n=!0)=>{const r={...e.router.options.context??{}},s=n?t:t-1;for(let i=0;i<=s;i++){const o=e.matches[i];if(!o)continue;const a=e.router.getMatch(o.id);a&&Object.assign(r,a.__routeContext,a.__beforeLoadContext)}return r},Ky=(e,t)=>{if(!e.matches.length)return;const n=t.routeId,r=e.matches.findIndex(o=>o.routeId===e.router.routeTree.id),s=r>=0?r:0;let i=n?e.matches.findIndex(o=>o.routeId===n):e.firstBadMatchIndex??e.matches.length-1;i<0&&(i=s);for(let o=i;o>=0;o--){const a=e.matches[o];if(e.router.looseRoutesById[a.routeId].options.notFoundComponent)return o}return n?i:s},Lr=(e,t,n)=>{var r,s,i;if(!(!wt(n)&&!st(n)))throw wt(n)&&n.redirectHandled&&!n.options.reloadDocument||(t&&((r=t._nonReactive.beforeLoadPromise)==null||r.resolve(),(s=t._nonReactive.loaderPromise)==null||s.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,o=>({...o,status:wt(n)?"redirected":st(n)?"notFound":o.status==="pending"?"success":o.status,context:js(e,t.index),isFetching:!1,error:n})),st(n)&&!n.routeId&&(n.routeId=t.routeId),(i=t._nonReactive.loadPromise)==null||i.resolve()),wt(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},Ab=(e,t)=>{const n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},Yy=(e,t,n)=>{const r=js(e,n);e.updateMatch(t,s=>({...s,context:r}))},mo=(e,t,n,r)=>{var a,l;const{id:s,routeId:i}=e.matches[t],o=e.router.looseRoutesById[i];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??(e.firstBadMatchIndex=t),Lr(e,e.router.getMatch(s),n);try{(l=(a=o.options).onError)==null||l.call(a,n)}catch(c){n=c,Lr(e,e.router.getMatch(s),n)}e.updateMatch(s,c=>{var u,f;return(u=c._nonReactive.beforeLoadPromise)==null||u.resolve(),c._nonReactive.beforeLoadPromise=void 0,(f=c._nonReactive.loadPromise)==null||f.resolve(),{...c,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}}),!e.preload&&!wt(n)&&!st(n)&&(e.serialError??(e.serialError=n))},Ib=(e,t,n,r)=>{var i;if(r._nonReactive.pendingTimeout!==void 0)return;const s=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Su(e,t)&&(n.options.loader||n.options.beforeLoad||Lb(n))&&typeof s=="number"&&s!==1/0&&(n.options.pendingComponent??((i=e.router.options)==null?void 0:i.defaultPendingComponent))){const o=setTimeout(()=>{bh(e)},s);r._nonReactive.pendingTimeout=o}},iT=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;Ib(e,t,n,r);const s=()=>{const i=e.router.getMatch(t);i.preload&&(i.status==="redirected"||i.status==="notFound")&&Lr(e,i,i.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(s):s()},oT=(e,t,n,r)=>{const s=e.router.getMatch(t);let i=s._nonReactive.loadPromise;s._nonReactive.loadPromise=Di(()=>{i==null||i.resolve(),i=void 0});const{paramsError:o,searchError:a}=s;o&&mo(e,n,o,"PARSE_PARAMS"),a&&mo(e,n,a,"VALIDATE_SEARCH"),Ib(e,t,r,s);const l=new AbortController;let c=!1;const u=()=>{c||(c=!0,e.updateMatch(t,k=>({...k,isFetching:"beforeLoad",fetchCount:k.fetchCount+1,abortController:l})))},f=()=>{var k;(k=s._nonReactive.beforeLoadPromise)==null||k.resolve(),s._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,C=>({...C,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{u(),f()});return}s._nonReactive.beforeLoadPromise=Di();const h={...js(e,n,!1),...s.__routeContext},{search:p,params:m,cause:g}=s,w=Su(e,t),y={search:p,abortController:l,params:m,preload:w,context:h,location:e.location,navigate:k=>e.router.navigate({...k,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:w?"preload":g,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},x=k=>{if(k===void 0){e.router.batch(()=>{u(),f()});return}(wt(k)||st(k))&&(u(),mo(e,n,k,"BEFORE_LOAD")),e.router.batch(()=>{u(),e.updateMatch(t,C=>({...C,__beforeLoadContext:k})),f()})};let v;try{if(v=r.options.beforeLoad(y),ya(v))return u(),v.catch(k=>{mo(e,n,k,"BEFORE_LOAD")}).then(x)}catch(k){u(),mo(e,n,k,"BEFORE_LOAD")}x(v)},aT=(e,t)=>{const{id:n,routeId:r}=e.matches[t],s=e.router.looseRoutesById[r],i=()=>a(),o=()=>oT(e,n,t,s),a=()=>{if(Ab(e,n))return;const l=iT(e,n,s);return ya(l)?l.then(o):o()};return i()},lT=(e,t,n)=>{var i,o,a,l,c,u;const r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const s={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([(o=(i=n.options).head)==null?void 0:o.call(i,s),(l=(a=n.options).scripts)==null?void 0:l.call(a,s),(u=(c=n.options).headers)==null?void 0:u.call(c,s)]).then(([f,h,p])=>({meta:f==null?void 0:f.meta,links:f==null?void 0:f.links,headScripts:f==null?void 0:f.scripts,headers:p,scripts:h,styles:f==null?void 0:f.styles}))},Mb=(e,t,n,r,s)=>{const i=t[r-1],{params:o,loaderDeps:a,abortController:l,cause:c}=e.router.getMatch(n),u=js(e,r),f=Su(e,n);return{params:o,deps:a,preload:!!f,parentMatchPromise:i,abortController:l,context:u,location:e.location,navigate:h=>e.router.navigate({...h,_fromLocation:e.location}),cause:f?"preload":c,route:s,...e.router.options.additionalContext}},qy=async(e,t,n,r,s)=>{var i,o,a,l,c;try{const u=e.router.getMatch(n);try{(!(jb??e.router.isServer)||u.ssr===!0)&&va(s);const f=s.options.loader,h=typeof f=="function"?f:f==null?void 0:f.handler,p=h==null?void 0:h(Mb(e,t,n,r,s)),m=!!h&&ya(p);if((m||s._lazyPromise||s._componentsPromise||s.options.head||s.options.scripts||s.options.headers||u._nonReactive.minPendingPromise)&&e.updateMatch(n,w=>({...w,isFetching:"loader"})),h){const w=m?await p:p;Lr(e,e.router.getMatch(n),w),w!==void 0&&e.updateMatch(n,y=>({...y,loaderData:w}))}s._lazyPromise&&await s._lazyPromise;const g=u._nonReactive.minPendingPromise;g&&await g,s._componentsPromise&&await s._componentsPromise,e.updateMatch(n,w=>({...w,error:void 0,context:js(e,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(f){let h=f;if((h==null?void 0:h.name)==="AbortError"){if(u.abortController.signal.aborted){(i=u._nonReactive.loaderPromise)==null||i.resolve(),u._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,m=>({...m,status:m.status==="pending"?"success":m.status,isFetching:!1,context:js(e,r)}));return}const p=u._nonReactive.minPendingPromise;p&&await p,st(f)&&await((a=(o=s.options.notFoundComponent)==null?void 0:o.preload)==null?void 0:a.call(o)),Lr(e,e.router.getMatch(n),f);try{(c=(l=s.options).onError)==null||c.call(l,f)}catch(m){h=m,Lr(e,e.router.getMatch(n),m)}!wt(h)&&!st(h)&&await va(s,["errorComponent"]),e.updateMatch(n,m=>({...m,error:h,context:js(e,r),status:"error",isFetching:!1}))}}catch(u){const f=e.router.getMatch(n);f&&(f._nonReactive.loaderPromise=void 0),Lr(e,f,u)}},cT=async(e,t,n)=>{var p,m,g,w;async function r(y,x,v,k,C){const S=Date.now()-x.updatedAt,P=y?C.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:C.options.staleTime??e.router.options.defaultStaleTime??0,T=C.options.shouldReload,E=typeof T=="function"?T(Mb(e,t,s,n,C)):T,{status:j,invalid:R}=k,I=S>=P&&(!!e.forceStaleReload||k.cause==="enter"||v!==void 0&&v!==k.id);o=j==="success"&&(R||(E??I)),y&&C.options.preload===!1||(o&&!e.sync&&u?(a=!0,(async()=>{var D,$;try{await qy(e,t,s,n,C);const A=e.router.getMatch(s);(D=A._nonReactive.loaderPromise)==null||D.resolve(),($=A._nonReactive.loadPromise)==null||$.resolve(),A._nonReactive.loaderPromise=void 0,A._nonReactive.loadPromise=void 0}catch(A){wt(A)&&await e.router.navigate(A.options)}})()):j!=="success"||o?await qy(e,t,s,n,C):Yy(e,s,n))}const{id:s,routeId:i}=e.matches[n];let o=!1,a=!1;const l=e.router.looseRoutesById[i],c=l.options.loader,u=((typeof c=="function"||c==null?void 0:c.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(Ab(e,s)){if(!e.router.getMatch(s))return e.matches[n];Yy(e,s,n)}else{const y=e.router.getMatch(s),x=e.router.stores.matchesId.get()[n],v=((p=x&&e.router.stores.matchStores.get(x)||null)==null?void 0:p.routeId)===i?x:(m=e.router.stores.matches.get().find(C=>C.routeId===i))==null?void 0:m.id,k=Su(e,s);if(y._nonReactive.loaderPromise){if(y.status==="success"&&!e.sync&&!y.preload&&u)return y;await y._nonReactive.loaderPromise;const C=e.router.getMatch(s),S=C._nonReactive.error||C.error;S&&Lr(e,C,S),C.status==="pending"&&await r(k,y,v,C,l)}else{const C=k&&!e.router.stores.matchStores.has(s),S=e.router.getMatch(s);S._nonReactive.loaderPromise=Di(),C!==S.preload&&e.updateMatch(s,P=>({...P,preload:C})),await r(k,y,v,S,l)}}const f=e.router.getMatch(s);a||((g=f._nonReactive.loaderPromise)==null||g.resolve(),(w=f._nonReactive.loadPromise)==null||w.resolve(),f._nonReactive.loadPromise=void 0),clearTimeout(f._nonReactive.pendingTimeout),f._nonReactive.pendingTimeout=void 0,a||(f._nonReactive.loaderPromise=void 0),f._nonReactive.dehydrated=void 0;const h=a?f.isFetching:!1;return h!==f.isFetching||f.invalid!==!1?(e.updateMatch(s,y=>({...y,isFetching:h,invalid:!1})),e.router.getMatch(s)):f};async function Qy(e){var h,p;const t=e,n=[];sT(t.router)&&bh(t);let r;for(let m=0;m<t.matches.length;m++){try{const g=aT(t,m);ya(g)&&await g}catch(g){if(wt(g))throw g;if(st(g))r=g;else if(!t.preload)throw g;break}if(t.serialError||t.firstBadMatchIndex!=null)break}const s=t.firstBadMatchIndex??t.matches.length,i=r&&!t.preload?Ky(t,r):void 0,o=r&&t.preload?0:i!==void 0?Math.min(i+1,s):s;let a,l;for(let m=0;m<o;m++)n.push(cT(t,n,m));try{await Promise.all(n)}catch{const m=await Promise.allSettled(n);for(const g of m){if(g.status!=="rejected")continue;const w=g.reason;if(wt(w))throw w;st(w)?a??(a=w):l??(l=w)}if(l!==void 0)throw l}const c=a??(r&&!t.preload?r:void 0);let u=t.firstBadMatchIndex!==void 0?t.firstBadMatchIndex:t.matches.length-1;if(!c&&r&&t.preload)return t.matches;if(c){const m=Ky(t,c);m===void 0&&nr();const g=t.matches[m],w=t.router.looseRoutesById[g.routeId],y=(h=t.router.options)==null?void 0:h.defaultNotFoundComponent;!w.options.notFoundComponent&&y&&(w.options.notFoundComponent=y),c.routeId=g.routeId;const x=g.routeId===t.router.routeTree.id;t.updateMatch(g.id,v=>({...v,...x?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:c},isFetching:!1})),u=m,await va(w,["notFoundComponent"])}else if(!t.preload){const m=t.matches[0];m.globalNotFound||(p=t.router.getMatch(m.id))!=null&&p.globalNotFound&&t.updateMatch(m.id,g=>({...g,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const m=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await va(m,["errorComponent"])}for(let m=0;m<=u;m++){const{id:g,routeId:w}=t.matches[m],y=t.router.looseRoutesById[w];try{const x=lT(t,g,y);if(x){const v=await x;t.updateMatch(g,k=>({...k,...v}))}}catch(x){console.error(`Error executing head for route ${w}:`,x)}}const f=bh(t);if(ya(f)&&await f,c)throw c;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function Xy(e,t){const n=t.map(r=>{var s,i;return(i=(s=e.options[r])==null?void 0:s.preload)==null?void 0:i.call(s)}).filter(Boolean);if(n.length!==0)return Promise.all(n)}function va(e,t=ql){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(r=>{const{id:s,...i}=r.options;Object.assign(e.options,i),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);const n=()=>e._componentsLoaded?void 0:t===ql?(()=>{if(e._componentsPromise===void 0){const r=Xy(e,ql);r?e._componentsPromise=r.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():Xy(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function Lb(e){var t;for(const n of ql)if((t=e.options[n])!=null&&t.preload)return!0;return!1}const ql=["component","errorComponent","pendingComponent","notFoundComponent"];var Gr="__TSR_index",Jy="popstate",Zy="beforeunload";function uT(e){let t=e.getLocation();const n=new Set,r=o=>{t=e.getLocation(),n.forEach(a=>a({location:t,action:o}))},s=o=>{e.notifyOnIndexChange??!0?r(o):t=e.getLocation()},i=async({task:o,navigateOpts:a,...l})=>{var f,h;if((a==null?void 0:a.ignoreBlocker)??!1){o();return}const c=((f=e.getBlockers)==null?void 0:f.call(e))??[],u=l.type==="PUSH"||l.type==="REPLACE";if(typeof document<"u"&&c.length&&u)for(const p of c){const m=Oc(l.path,l.state);if(await p.blockerFn({currentLocation:t,nextLocation:m,action:l.type})){(h=e.onBlocked)==null||h.call(e);return}}o()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:o=>(n.add(o),()=>{n.delete(o)}),push:(o,a,l)=>{const c=t.state[Gr];a=ex(c+1,a),i({task:()=>{e.pushState(o,a),r({type:"PUSH"})},navigateOpts:l,type:"PUSH",path:o,state:a})},replace:(o,a,l)=>{const c=t.state[Gr];a=ex(c,a),i({task:()=>{e.replaceState(o,a),r({type:"REPLACE"})},navigateOpts:l,type:"REPLACE",path:o,state:a})},go:(o,a)=>{i({task:()=>{e.go(o),s({type:"GO",index:o})},navigateOpts:a,type:"GO"})},back:o=>{i({task:()=>{e.back((o==null?void 0:o.ignoreBlocker)??!1),s({type:"BACK"})},navigateOpts:o,type:"BACK"})},forward:o=>{i({task:()=>{e.forward((o==null?void 0:o.ignoreBlocker)??!1),s({type:"FORWARD"})},navigateOpts:o,type:"FORWARD"})},canGoBack:()=>t.state[Gr]!==0,createHref:o=>e.createHref(o),block:o=>{var l;if(!e.setBlockers)return()=>{};const a=((l=e.getBlockers)==null?void 0:l.call(e))??[];return e.setBlockers([...a,o]),()=>{var u,f;const c=((u=e.getBlockers)==null?void 0:u.call(e))??[];(f=e.setBlockers)==null||f.call(e,c.filter(h=>h!==o))}},flush:()=>{var o;return(o=e.flush)==null?void 0:o.call(e)},destroy:()=>{var o;return(o=e.destroy)==null?void 0:o.call(e)},notify:r}}function ex(e,t){t||(t={});const n=hm();return{...t,key:n,__TSR_key:n,[Gr]:e}}function dT(e){var T,E;const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let s=[];const i=()=>s,o=j=>s=j,a=j=>j,l=()=>Oc(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state);if(!((T=t.history.state)!=null&&T.__TSR_key)&&!((E=t.history.state)!=null&&E.key)){const j=hm();t.history.replaceState({[Gr]:0,key:j,__TSR_key:j},"")}let c=l(),u,f=!1,h=!1,p=!1,m=!1;const g=()=>c;let w,y;const x=()=>{w&&(P._ignoreSubscribers=!0,(w.isPush?t.history.pushState:t.history.replaceState)(w.state,"",w.href),P._ignoreSubscribers=!1,w=void 0,y=void 0,u=void 0)},v=(j,R,I)=>{const D=a(R);y||(u=c),c=Oc(R,I),w={href:D,state:I,isPush:(w==null?void 0:w.isPush)||j==="push"},y||(y=Promise.resolve().then(()=>x()))},k=j=>{c=l(),P.notify({type:j})},C=async()=>{if(h){h=!1;return}const j=l(),R=j.state[Gr]-c.state[Gr],I=R===1,D=R===-1,$=!I&&!D||f;f=!1;const A=$?"GO":D?"BACK":"FORWARD",z=$?{type:"GO",index:R}:{type:D?"BACK":"FORWARD"};if(p)p=!1;else{const O=i();if(typeof document<"u"&&O.length){for(const L of O)if(await L.blockerFn({currentLocation:c,nextLocation:j,action:A})){h=!0,t.history.go(1),P.notify(z);return}}}c=l(),P.notify(z)},S=j=>{if(m){m=!1;return}let R=!1;const I=i();if(typeof document<"u"&&I.length)for(const D of I){const $=D.enableBeforeUnload??!0;if($===!0){R=!0;break}if(typeof $=="function"&&$()===!0){R=!0;break}}if(R)return j.preventDefault(),j.returnValue=""},P=uT({getLocation:g,getLength:()=>t.history.length,pushState:(j,R)=>v("push",j,R),replaceState:(j,R)=>v("replace",j,R),back:j=>(j&&(p=!0),m=!0,t.history.back()),forward:j=>{j&&(p=!0),m=!0,t.history.forward()},go:j=>{f=!0,t.history.go(j)},createHref:j=>a(j),flush:x,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(Zy,S,{capture:!0}),t.removeEventListener(Jy,C)},onBlocked:()=>{u&&c!==u&&(c=u)},getBlockers:i,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(Zy,S,{capture:!0}),t.addEventListener(Jy,C),t.history.pushState=function(...j){const R=n.apply(t.history,j);return P._ignoreSubscribers||k("PUSH"),R},t.history.replaceState=function(...j){const R=r.apply(t.history,j);return P._ignoreSubscribers||k("REPLACE"),R},P}function fT(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Oc(e,t){const n=fT(e),r=n.indexOf("#"),s=n.indexOf("?"),i=hm();return{href:n,pathname:n.substring(0,r>0?s>0?Math.min(r,s):r:s>0?s:n.length),hash:r>-1?n.substring(r):"",search:s>-1?n.slice(s,r===-1?void 0:r):"",state:t||{[Gr]:0,key:i,__TSR_key:i}}}function hm(){return(Math.random()+1).toString(36).substring(7)}function _i(e,t){const n=t,r=e;return{fromLocation:n,toLocation:r,pathChanged:(n==null?void 0:n.pathname)!==r.pathname,hrefChanged:(n==null?void 0:n.href)!==r.href,hashChanged:(n==null?void 0:n.hash)!==r.hash}}var hT=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=n=>n(),this.update=n=>{var u;const r=this.options,s=this.basepath??(r==null?void 0:r.basepath)??"/",i=this.basepath===void 0,o=r==null?void 0:r.rewrite;if(this.options={...r,...n},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=BE(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=dT()),this.origin=this.options.origin,this.origin||(window!=null&&window.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let f;this.resolvePathCache=xa(1e3),f=this.buildRouteTree(),this.setRoutes(f)}if(!this.stores&&this.latestLocation){const f=this.getStoreConfig(this);this.batch=f.batch,this.stores=rT(mT(this.latestLocation),f),KE(this)}let a=!1;const l=this.options.basepath??"/",c=this.options.rewrite;if(i||s!==l||o!==c){this.basepath=l;const f=[],h=Nb(l);h&&h!=="/"&&f.push(nT({basepath:l})),c&&f.push(c),this.rewrite=f.length===0?void 0:f.length===1?f[0]:tT(f),this.history&&this.updateLatestLocation(),a=!0}a&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<"u"&&"CSS"in window&&typeof((u=window.CSS)==null?void 0:u.supports)=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const n=ME(this.routeTree,this.options.caseSensitive,(r,s)=>{r.init({originalIndex:s})});return this.options.routeMasks&&TE(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,r)=>{const s={eventType:n,fn:r};return this.subscribers.add(s),()=>{this.subscribers.delete(s)}},this.emit=n=>{this.subscribers.forEach(r=>{r.eventType===n.type&&r.fn(n)})},this.parseLocation=(n,r)=>{const s=({pathname:l,search:c,hash:u,href:f,state:h})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(l)){const y=this.options.parseSearch(c),x=this.options.stringifySearch(y);return{href:l+x+u,publicHref:l+x+u,pathname:ho(l).path,external:!1,searchStr:x,search:is(r==null?void 0:r.search,y),hash:ho(u.slice(1)).path,state:Ir(r==null?void 0:r.state,h)}}const p=new URL(f,this.origin),m=wh(this.rewrite,p),g=this.options.parseSearch(m.search),w=this.options.stringifySearch(g);return m.search=w,{href:m.href.replace(m.origin,""),publicHref:f,pathname:ho(m.pathname).path,external:!!this.rewrite&&m.origin!==this.origin,searchStr:w,search:is(r==null?void 0:r.search,g),hash:ho(m.hash.slice(1)).path,state:Ir(r==null?void 0:r.state,h)}},i=s(n),{__tempLocation:o,__tempKey:a}=i.state;if(o&&(!a||a===this.tempLocationKey)){const l=s(o);return l.state.key=i.state.key,l.state.__TSR_key=i.state.__TSR_key,delete l.state.__tempLocation,{...l,maskedLocation:i}}return i},this.resolvePathWithBase=(n,r)=>zE({base:n,to:fm(r),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,r,s)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:r},s):this.matchRoutesInternal(n,r),this.getMatchedRoutes=n=>gT({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const r=this.getMatch(n);r&&(r.abortController.abort(),clearTimeout(r._nonReactive.pendingTimeout),r._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(n=>{this.cancelMatch(n)}),this.stores.matchesId.get().forEach(n=>{var s;if(this.stores.pendingMatchStores.has(n))return;const r=(s=this.stores.matchStores.get(n))==null?void 0:s.get();r&&(r.status==="pending"||r.isFetching==="loader")&&this.cancelMatch(n)})},this.buildLocation=n=>{const r=(i={})=>{var j,R;const o=i._fromLocation||this.pendingBuiltLocation||this.latestLocation,a=this.matchRoutesLightweight(o);i.from;const l=i.unsafeRelative==="path"?o.pathname:i.from??a.fullPath,c=this.resolvePathWithBase(l,"."),u=a.search,f=Object.assign(Object.create(null),a.params),h=i.to?this.resolvePathWithBase(c,`${i.to}`):this.resolvePathWithBase(c,"."),p=i.params===!1||i.params===null?Object.create(null):(i.params??!0)===!0?f:Object.assign(f,Ar(i.params,f)),m=this.getMatchedRoutes(h);let g=m.matchedRoutes;if((!m.foundRoute||m.foundRoute.path!=="/"&&m.routeParams["**"])&&this.options.notFoundRoute&&(g=[...g,this.options.notFoundRoute]),Object.keys(p).length>0)for(const I of g){const D=((j=I.options.params)==null?void 0:j.stringify)??I.options.stringifyParams;if(D)try{Object.assign(p,D(p))}catch{}}const w=n.leaveParams?h:ho(Uy({path:h,params:p,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let y=u;if(n._includeValidateSearch&&((R=this.options.search)!=null&&R.strict)){const I={};g.forEach(D=>{if(D.options.validateSearch)try{Object.assign(I,Ql(D.options.validateSearch,{...I,...y}))}catch{}}),y=I}y=yT({search:y,dest:i,destRoutes:g,_includeValidateSearch:n._includeValidateSearch}),y=is(u,y);const x=this.options.stringifySearch(y),v=i.hash===!0?o.hash:i.hash?Ar(i.hash,o.hash):void 0,k=v?`#${v}`:"";let C=i.state===!0?o.state:i.state?Ar(i.state,o.state):{};C=Ir(o.state,C);const S=`${w}${x}${k}`;let P,T,E=!1;if(this.rewrite){const I=new URL(S,this.origin),D=Rb(this.rewrite,I);P=I.href.replace(I.origin,""),D.origin!==this.origin?(T=D.href,E=!0):T=D.pathname+D.search+D.hash}else P=jE(S),T=P;return{publicHref:T,href:P,pathname:w,search:y,searchStr:x,state:C,hash:v??"",external:E,unmaskOnReload:i.unmaskOnReload}},s=(i={},o)=>{const a=r(i);let l=o?r(o):void 0;if(!l){const c=Object.create(null);if(this.options.routeMasks){const u=NE(a.pathname,this.processedTree);if(u){Object.assign(c,u.rawParams);const{from:f,params:h,...p}=u.route,m=h===!1||h===null?Object.create(null):(h??!0)===!0?c:Object.assign(c,Ar(h,c));o={from:n.from,...p,params:m},l=r(o)}}}return l&&(a.maskedLocation=l),a};return n.mask?s(n,{from:n.from,...n.mask}):s(n)},this.commitLocation=async({viewTransition:n,ignoreBlocker:r,...s})=>{const i=()=>{const l=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];l.forEach(u=>{s.state[u]=this.latestLocation.state[u]});const c=Ss(s.state,this.latestLocation.state);return l.forEach(u=>{delete s.state[u]}),c},o=Hr(this.latestLocation.href)===Hr(s.href);let a=this.commitLocationPromise;if(this.commitLocationPromise=Di(()=>{a==null||a.resolve(),a=void 0}),o&&i())this.load();else{let{maskedLocation:l,hashScrollIntoView:c,...u}=s;l&&(u={...l,state:{...l.state,__tempKey:void 0,__tempLocation:{...u,search:u.searchStr,state:{...u.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(u.unmaskOnReload??this.options.unmaskOnReload??!1)&&(u.state.__tempKey=this.tempLocationKey)),u.state.__hashScrollIntoViewOptions=c??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[s.replace?"replace":"push"](u.publicHref,u.state,{ignoreBlocker:r})}return this.resetNextScroll=s.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:r,hashScrollIntoView:s,viewTransition:i,ignoreBlocker:o,href:a,...l}={})=>{if(a){const f=this.history.location.state.__TSR_index,h=Oc(a,{__TSR_index:n?f:f+1}),p=new URL(h.pathname,this.origin);l.to=wh(this.rewrite,p).pathname,l.search=this.options.parseSearch(h.search),l.hash=h.hash.slice(1)}const c=this.buildLocation({...l,_includeValidateSearch:!0});this.pendingBuiltLocation=c;const u=this.commitLocation({...c,viewTransition:i,replace:n,resetScroll:r,hashScrollIntoView:s,ignoreBlocker:o});return Promise.resolve().then(()=>{this.pendingBuiltLocation===c&&(this.pendingBuiltLocation=void 0)}),u},this.navigate=async({to:n,reloadDocument:r,href:s,publicHref:i,...o})=>{var l,c;let a=!1;if(s)try{new URL(`${s}`),a=!0}catch{}if(a&&!r&&(r=!0),r){if(n!==void 0||!s){const f=this.buildLocation({to:n,...o});s=s??f.publicHref,i=i??f.publicHref}const u=!a&&i?i:s;if(Dc(u,this.protocolAllowlist))return Promise.resolve();if(!o.ignoreBlocker){const f=((c=(l=this.history).getBlockers)==null?void 0:c.call(l))??[];for(const h of f)if(h!=null&&h.blockerFn&&await h.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return o.replace?window.location.replace(u):window.location.href=u,Promise.resolve()}return this.buildAndCommitLocation({...o,href:s,to:n,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const n=this.matchRoutes(this.latestLocation),r=this.stores.cachedMatches.get().filter(s=>!n.some(i=>i.id===s.id));this.batch(()=>{this.stores.status.set("pending"),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(n),this.stores.setCached(r)})},this.load=async n=>{let r,s,i;const o=this.stores.resolvedLocation.get()??this.stores.location.get();for(i=new Promise(l=>{this.startTransition(async()=>{var c;try{this.beforeLoad();const u=this.latestLocation,f=_i(u,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:"onBeforeNavigate",...f}),this.emit({type:"onBeforeLoad",...f}),await Qy({router:this,sync:n==null?void 0:n.sync,forceStaleReload:o.href===u.href,matches:this.stores.pendingMatches.get(),location:u,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{var w,y;let h=null,p=null,m=null,g=null;this.batch(()=>{const x=this.stores.pendingMatches.get(),v=x.length,k=this.stores.matches.get();h=v?k.filter(P=>!this.stores.pendingMatchStores.has(P.id)):null;const C=new Set;for(const P of this.stores.pendingMatchStores.values())P.routeId&&C.add(P.routeId);const S=new Set;for(const P of this.stores.matchStores.values())P.routeId&&S.add(P.routeId);p=v?k.filter(P=>!C.has(P.routeId)):null,m=v?x.filter(P=>!S.has(P.routeId)):null,g=v?x.filter(P=>S.has(P.routeId)):k,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),v&&(this.stores.setMatches(x),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...h.filter(P=>P.status!=="error"&&P.status!=="notFound"&&P.status!=="redirected")]),this.clearExpiredCache())});for(const[x,v]of[[p,"onLeave"],[m,"onEnter"],[g,"onStay"]])if(x)for(const k of x)(y=(w=this.looseRoutesById[k.routeId].options)[v])==null||y.call(w,k)})})}})}catch(u){wt(u)?(r=u,this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):st(u)&&(s=u);const f=r?r.status:s?404:this.stores.matches.get().some(h=>h.status==="error")?500:200;this.batch(()=>{this.stores.statusCode.set(f),this.stores.redirect.set(r)})}this.latestLoadPromise===i&&((c=this.commitLocationPromise)==null||c.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),l()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise;let a;this.hasNotFoundMatch()?a=404:this.stores.matches.get().some(l=>l.status==="error")&&(a=500),a!==void 0&&this.stores.statusCode.set(a)},this.startViewTransition=n=>{const r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let s;if(typeof r=="object"&&this.isViewTransitionTypesSupported){const i=this.latestLocation,o=this.stores.resolvedLocation.get(),a=typeof r.types=="function"?r.types(_i(i,o)):r.types;if(a===!1){n();return}s={update:n,types:a}}else s=n;document.startViewTransition(s)}else n()},this.updateMatch=(n,r)=>{this.startTransition(()=>{const s=this.stores.pendingMatchStores.get(n);if(s){s.set(r);return}const i=this.stores.matchStores.get(n);if(i){i.set(r);return}const o=this.stores.cachedMatchStores.get(n);if(o){const a=r(o.get());a.status==="redirected"?this.stores.cachedMatchStores.delete(n)&&this.stores.cachedIds.set(l=>l.filter(c=>c!==n)):o.set(a)}})},this.getMatch=n=>{var r,s,i;return((r=this.stores.cachedMatchStores.get(n))==null?void 0:r.get())??((s=this.stores.pendingMatchStores.get(n))==null?void 0:s.get())??((i=this.stores.matchStores.get(n))==null?void 0:i.get())},this.invalidate=n=>{const r=s=>{var i;return((i=n==null?void 0:n.filter)==null?void 0:i.call(n,s))??!0?{...s,invalid:!0,...n!=null&&n.forcePending||s.status==="error"||s.status==="notFound"?{status:"pending",error:void 0}:void 0}:s};return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(r)),this.stores.setCached(this.stores.cachedMatches.get().map(r)),this.stores.setPending(this.stores.pendingMatches.get().map(r))}),this.shouldViewTransition=!1,this.load({sync:n==null?void 0:n.sync})},this.getParsedLocationHref=n=>n.publicHref||"/",this.resolveRedirect=n=>{const r=n.headers.get("Location");if(!n.options.href||n.options._builtLocation){const s=n.options._builtLocation??this.buildLocation(n.options),i=this.getParsedLocationHref(s);n.options.href=i,n.headers.set("Location",i)}else if(r)try{const s=new URL(r);if(this.origin&&s.origin===this.origin){const i=s.pathname+s.search+s.hash;n.options.href=i,n.headers.set("Location",i)}}catch{}if(n.options.href&&!n.options._builtLocation&&Dc(n.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const r=n==null?void 0:n.filter;r!==void 0?this.stores.setCached(this.stores.cachedMatches.get().filter(s=>!r(s))):this.stores.setCached([])},this.clearExpiredCache=()=>{const n=Date.now(),r=s=>{const i=this.looseRoutesById[s.routeId];if(!i.options.loader)return!0;const o=(s.preload?i.options.preloadGcTime??this.options.defaultPreloadGcTime:i.options.gcTime??this.options.defaultGcTime)??300*1e3;return s.status==="error"?!0:n-s.updatedAt>=o};this.clearCache({filter:r})},this.loadRouteChunk=va,this.preloadRoute=async n=>{const r=n._builtLocation??this.buildLocation(n);let s=this.matchRoutes(r,{throwOnError:!0,preload:!0,dest:n});const i=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),o=new Set([...i,...this.stores.cachedIds.get()]),a=s.filter(l=>!o.has(l.id));if(a.length){const l=this.stores.cachedMatches.get();this.stores.setCached([...l,...a])}try{return s=await Qy({router:this,matches:s,location:r,preload:!0,updateMatch:(l,c)=>{i.has(l)?s=s.map(u=>u.id===l?c(u):u):this.updateMatch(l,c)}}),s}catch(l){if(wt(l))return l.options.reloadDocument?void 0:await this.preloadRoute({...l.options,_fromLocation:r});st(l)||console.error(l);return}},this.matchRoute=(n,r)=>{const s={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},i=this.buildLocation(s);if(r!=null&&r.pending&&this.stores.status.get()!=="pending")return!1;const o=((r==null?void 0:r.pending)===void 0?!this.stores.isLoading.get():r.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),a=RE(i.pathname,(r==null?void 0:r.caseSensitive)??!1,(r==null?void 0:r.fuzzy)??!1,o.pathname,this.processedTree);return!a||n.params&&!Ss(a.rawParams,n.params,{partial:!0})?!1:(r==null?void 0:r.includeSearch)??!0?Ss(o.search,i.search,{partial:!0})?a.rawParams:!1:a.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(n=>n.status==="notFound"||n.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??XE,parseSearch:e.parseSearch??QE,protocolAllowlist:e.protocolAllowlist??CE}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}get looseRoutesById(){return this.routesById}getParentContext(e){return e!=null&&e.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){var f,h;const n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:s,parsedParams:i}=n;let{matchedRoutes:o}=n,a=!1;(r?r.path!=="/"&&s["**"]:Hr(e.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:a=!0);const l=a?vT(this.options.notFoundMode,o):void 0,c=new Array(o.length),u=new Map;for(const p of this.stores.matchStores.values())p.routeId&&u.set(p.routeId,p.get());for(let p=0;p<o.length;p++){const m=o[p],g=c[p-1];let w,y,x;{const A=(g==null?void 0:g.search)??e.search,z=(g==null?void 0:g._strictSearch)??void 0;try{const O=Ql(m.options.validateSearch,{...A})??void 0;w={...A,...O},y={...z,...O},x=void 0}catch(O){let L=O;if(O instanceof $c||(L=new $c(O.message,{cause:O})),t!=null&&t.throwOnError)throw L;w=A,y={},x=L}}const v=((h=(f=m.options).loaderDeps)==null?void 0:h.call(f,{search:w}))??"",k=v?JSON.stringify(v):"",{interpolatedPath:C,usedParams:S}=Uy({path:m.fullPath,params:s,decoder:this.pathParamsDecoder,server:this.isServer}),P=m.id+C+k,T=this.getMatch(P),E=u.get(m.id),j=(T==null?void 0:T._strictParams)??S;let R;if(!T)try{tx(m,S,i,j)}catch(A){if(st(A)||wt(A)?R=A:R=new pT(A.message,{cause:A}),t!=null&&t.throwOnError)throw R}Object.assign(s,j);const I=E?"stay":"enter";let D;if(T)D={...T,cause:I,params:(E==null?void 0:E.params)??s,_strictParams:j,search:is(E?E.search:T.search,w),_strictSearch:y};else{const A=m.options.loader||m.options.beforeLoad||m.lazyFn||Lb(m)?"pending":"success";D={id:P,ssr:m.options.ssr,index:p,routeId:m.id,params:(E==null?void 0:E.params)??s,_strictParams:j,pathname:C,updatedAt:Date.now(),search:E?is(E.search,w):w,_strictSearch:y,searchError:void 0,status:A,isFetching:!1,error:void 0,paramsError:R,__routeContext:void 0,_nonReactive:{loadPromise:Di()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:I,loaderDeps:E?Ir(E.loaderDeps,v):v,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:m.options.staticData||{},fullPath:m.fullPath}}t!=null&&t.preload||(D.globalNotFound=l===m.id),D.searchError=x;const $=this.getParentContext(g);D.context={...$,...D.__routeContext,...D.__beforeLoadContext},c[p]=D}for(let p=0;p<c.length;p++){const m=c[p],g=this.looseRoutesById[m.routeId],w=this.getMatch(m.id),y=u.get(m.routeId);if(m.params=y?is(y.params,s):s,!w){const x=c[p-1],v=this.getParentContext(x);if(g.options.context){const k={deps:m.loaderDeps,params:m.params,context:v??{},location:e,navigate:C=>this.navigate({...C,_fromLocation:e}),buildLocation:this.buildLocation,cause:m.cause,abortController:m.abortController,preload:!!m.preload,matches:c,routeId:g.id};m.__routeContext=g.options.context(k)??void 0}m.context={...v,...m.__routeContext,...m.__beforeLoadContext}}}return c}matchRoutesLightweight(e){var u;const{matchedRoutes:t,routeParams:n,parsedParams:r}=this.getMatchedRoutes(e.pathname),s=ga(t),i={...e.search};for(const f of t)try{Object.assign(i,Ql(f.options.validateSearch,i))}catch{}const o=ga(this.stores.matchesId.get()),a=o&&((u=this.stores.matchStores.get(o))==null?void 0:u.get()),l=a&&a.routeId===s.id&&a.pathname===e.pathname;let c;if(l)c=a.params;else{const f=Object.assign(Object.create(null),n);for(const h of t)try{tx(h,n,r??{},f)}catch{}c=f}return{matchedRoutes:t,fullPath:s.fullPath,search:i,params:c}}},$c=class extends Error{},pT=class extends Error{};function mT(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function Ql(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new $c("Async validation not supported");if(n.issues)throw new $c(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function gT({pathname:e,routesById:t,processedTree:n}){const r=Object.create(null),s=Hr(e);let i,o;const a=AE(s,n,!0);return a&&(i=a.route,Object.assign(r,a.rawParams),o=Object.assign(Object.create(null),a.parsedParams)),{matchedRoutes:(a==null?void 0:a.branch)||[t.__root__],routeParams:r,foundRoute:i,parsedParams:o}}function yT({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return xT(n)(e,t,r??!1)}function xT(e){var s;const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const i of e){if("search"in i.options)(s=i.options.search)!=null&&s.middlewares&&t.middlewares.push(...i.options.search.middlewares);else if(i.options.preSearchFilters||i.options.postSearchFilters){const o=({search:a,next:l})=>{let c=a;"preSearchFilters"in i.options&&i.options.preSearchFilters&&(c=i.options.preSearchFilters.reduce((f,h)=>h(f),a));const u=l(c);return"postSearchFilters"in i.options&&i.options.postSearchFilters?i.options.postSearchFilters.reduce((f,h)=>h(f),u):u};t.middlewares.push(o)}if(i.options.validateSearch){const o=({search:a,next:l})=>{const c=l(a);if(!t._includeValidateSearch)return c;try{return{...c,...Ql(i.options.validateSearch,c)??void 0}}catch{return c}};t.middlewares.push(o)}}const n=({search:i})=>{const o=t.dest;return o.search?o.search===!0?i:Ar(o.search,i):{}};t.middlewares.push(n);const r=(i,o,a)=>{if(i>=a.length)return o;const l=a[i];return l({search:o,next:u=>r(i+1,u,a)})};return function(o,a,l){return t.dest=a,t._includeValidateSearch=l,r(0,o,t.middlewares)}}function vT(e,t){if(e!=="root")for(let n=t.length-1;n>=0;n--){const r=t[n];if(r.children)return r.id}return Cs}function tx(e,t,n,r){var i;const s=((i=e.options.params)==null?void 0:i.parse)??e.options.parseParams;if(s)if(e.options.skipRouteOnParseError)for(const o in t)o in n&&(r[o]=n[o]);else{const o=s(r);Object.assign(r,o)}}const wT="Error preloading route! ☝️";var Db=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=t=>{var l,c;this.originalIndex=t.originalIndex;const n=this.options,r=!(n!=null&&n.path)&&!(n!=null&&n.id);this.parentRoute=(c=(l=this.options).getParentRoute)==null?void 0:c.call(l),r?this._path=Cs:this.parentRoute||nr();let s=r?Cs:n==null?void 0:n.path;s&&s!=="/"&&(s=Tb(s));const i=(n==null?void 0:n.id)||s;let o=r?Cs:Yl([this.parentRoute.id==="__root__"?"":this.parentRoute.id,i]);s==="__root__"&&(s="/"),o!=="__root__"&&(o=Yl(["/",o]));const a=o==="__root__"?"/":Yl([this.parentRoute.fullPath,s]);this._path=s,this._id=o,this._fullPath=a,this._to=Hr(a)},this.addChildren=t=>this._addFileChildren(t),this._addFileChildren=t=>(Array.isArray(t)&&(this.children=t),typeof t=="object"&&t!==null&&(this.children=Object.values(t)),this),this._addFileTypes=()=>this,this.updateLoader=t=>(Object.assign(this.options,t),this),this.update=t=>(Object.assign(this.options,t),this),this.lazy=t=>(this.lazyFn=t,this),this.redirect=t=>eT({from:this.fullPath,...t}),this.options=e||{},this.isRoot=!(e!=null&&e.getParentRoute),e!=null&&e.id&&(e!=null&&e.path))throw new Error("Route cannot have both an 'id' and a 'path' option.")}},bT=class extends Db{constructor(e){super(e)}};function kT(e){if(typeof document<"u"&&document.querySelector){const t=e.stores.location.get(),n=t.state.__hashScrollIntoViewOptions??!0;if(n&&t.hash!==""){const r=document.getElementById(t.hash);r&&r.scrollIntoView(n)}}}function pm(e){const t=e.errorComponent??mm;return d.jsx(_T,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?b.createElement(t,{error:n,reset:r}):e.children})}var _T=class extends b.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,t){const n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function mm({error:e}){const[t,n]=b.useState(!1);return d.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[d.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),d.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(r=>!r),children:t?"Hide Error":"Show Error"})]}),d.jsx("div",{style:{height:".25rem"}}),t?d.jsx("div",{children:d.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?d.jsx("code",{children:e.message}):null})}):null]})}function ST({children:e,fallback:t=null}){return Fb()?d.jsx(Pi.Fragment,{children:e}):d.jsx(Pi.Fragment,{children:t})}function Fb(){return Pi.useSyncExternalStore(CT,()=>!0,()=>!1)}function CT(){return()=>{}}var Ob=b.createContext(null);function Ut(e){return b.useContext(Ob)}var Cu=b.createContext(void 0),jT=b.createContext(void 0),Pe=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(Pe||{});function PT({update:e,notify:t,unwatched:n}){return{link:r,unlink:s,propagate:i,checkDirty:o,shallowPropagate:a};function r(c,u,f){const h=u.depsTail;if(h!==void 0&&h.dep===c)return;const p=h!==void 0?h.nextDep:u.deps;if(p!==void 0&&p.dep===c){p.version=f,u.depsTail=p;return}const m=c.subsTail;if(m!==void 0&&m.version===f&&m.sub===u)return;const g=u.depsTail=c.subsTail={version:f,dep:c,sub:u,prevDep:h,nextDep:p,prevSub:m,nextSub:void 0};p!==void 0&&(p.prevDep=g),h!==void 0?h.nextDep=g:u.deps=g,m!==void 0?m.nextSub=g:c.subs=g}function s(c,u=c.sub){const f=c.dep,h=c.prevDep,p=c.nextDep,m=c.nextSub,g=c.prevSub;return p!==void 0?p.prevDep=h:u.depsTail=h,h!==void 0?h.nextDep=p:u.deps=p,m!==void 0?m.prevSub=g:f.subsTail=g,g!==void 0?g.nextSub=m:(f.subs=m)===void 0&&n(f),p}function i(c){let u=c.nextSub,f;e:do{const h=c.sub;let p=h.flags;if(p&60?p&12?p&4?!(p&48)&&l(c,h)?(h.flags=p|40,p&=1):p=0:h.flags=p&-9|32:p=0:h.flags=p|32,p&2&&t(h),p&1){const m=h.subs;if(m!==void 0){const g=(c=m).nextSub;g!==void 0&&(f={value:u,prev:f},u=g);continue}}if((c=u)!==void 0){u=c.nextSub;continue}for(;f!==void 0;)if(c=f.value,f=f.prev,c!==void 0){u=c.nextSub;continue e}break}while(!0)}function o(c,u){let f,h=0,p=!1;e:do{const m=c.dep,g=m.flags;if(u.flags&16)p=!0;else if((g&17)===17){if(e(m)){const w=m.subs;w.nextSub!==void 0&&a(w),p=!0}}else if((g&33)===33){(c.nextSub!==void 0||c.prevSub!==void 0)&&(f={value:c,prev:f}),c=m.deps,u=m,++h;continue}if(!p){const w=c.nextDep;if(w!==void 0){c=w;continue}}for(;h--;){const w=u.subs,y=w.nextSub!==void 0;if(y?(c=f.value,f=f.prev):c=w,p){if(e(u)){y&&a(w),u=c.sub;continue}p=!1}else u.flags&=-33;u=c.sub;const x=c.nextDep;if(x!==void 0){c=x;continue e}}return p}while(!0)}function a(c){do{const u=c.sub,f=u.flags;(f&48)===32&&(u.flags=f|16,(f&6)===2&&t(u))}while((c=c.nextSub)!==void 0)}function l(c,u){let f=u.depsTail;for(;f!==void 0;){if(f===c)return!0;f=f.prevDep}return!1}}function ET(e,t,n){var i,o,a;const r=typeof e=="object",s=r?e:void 0;return{next:(i=r?e.next:e)==null?void 0:i.bind(s),error:(o=r?e.error:t)==null?void 0:o.bind(s),complete:(a=r?e.complete:n)==null?void 0:a.bind(s)}}const kh=[];let Xl=0;const{link:nx,unlink:TT,propagate:NT,checkDirty:$b,shallowPropagate:rx}=PT({update(e){return e._update()},notify(e){kh[_h++]=e,e.flags&=~Pe.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=Pe.Mutable|Pe.Dirty,zc(e))}});let pl=0,_h=0,Mn,Sh=0;function zb(e){try{++Sh,e()}finally{--Sh||Bb()}}function zc(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=TT(n,e)}function Bb(){if(!(Sh>0)){for(;pl<_h;){const e=kh[pl];kh[pl++]=void 0,e.notify()}pl=0,_h=0}}function sx(e,t){const n=typeof e=="function",r=e,s={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?Pe.None:Pe.Mutable,get(){return Mn!==void 0&&nx(s,Mn,Xl),s._snapshot},subscribe(i){const o=ET(i),a={current:!1},l=RT(()=>{var c;s.get(),a.current?(c=o.next)==null||c.call(o,s._snapshot):a.current=!0});return{unsubscribe:()=>{l.stop()}}},_update(i){const o=Mn,a=(t==null?void 0:t.compare)??Object.is;if(n)Mn=s,++Xl,s.depsTail=void 0;else if(i===void 0)return!1;n&&(s.flags=Pe.Mutable|Pe.RecursedCheck);try{const l=s._snapshot,c=typeof i=="function"?i(l):i===void 0&&n?r(l):i;return l===void 0||!a(l,c)?(s._snapshot=c,!0):!1}finally{Mn=o,n&&(s.flags&=~Pe.RecursedCheck),zc(s)}}};return n?(s.flags=Pe.Mutable|Pe.Dirty,s.get=function(){const i=s.flags;if(i&Pe.Dirty||i&Pe.Pending&&$b(s.deps,s)){if(s._update()){const o=s.subs;o!==void 0&&rx(o)}}else i&Pe.Pending&&(s.flags=i&~Pe.Pending);return Mn!==void 0&&nx(s,Mn,Xl),s._snapshot}):s.set=function(i){if(s._update(i)){const o=s.subs;o!==void 0&&(NT(o),rx(o),Bb())}},s}function RT(e){const t=()=>{const r=Mn;Mn=n,++Xl,n.depsTail=void 0,n.flags=Pe.Watching|Pe.RecursedCheck;try{return e()}finally{Mn=r,n.flags&=~Pe.RecursedCheck,zc(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Pe.Watching|Pe.RecursedCheck,notify(){const r=this.flags;r&Pe.Dirty||r&Pe.Pending&&$b(this.deps,this)?t():this.flags=Pe.Watching},stop(){this.flags=Pe.None,this.depsTail=void 0,zc(this)}};return t(),n}var Vb={exports:{}},Ub={},Wb={exports:{}},Hb={};/**
42
- * @license React
43
- * use-sync-external-store-shim.production.js
44
- *
45
- * Copyright (c) Meta Platforms, Inc. and affiliates.
46
- *
47
- * This source code is licensed under the MIT license found in the
48
- * LICENSE file in the root directory of this source tree.
49
- */var Fi=b;function AT(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var IT=typeof Object.is=="function"?Object.is:AT,MT=Fi.useState,LT=Fi.useEffect,DT=Fi.useLayoutEffect,FT=Fi.useDebugValue;function OT(e,t){var n=t(),r=MT({inst:{value:n,getSnapshot:t}}),s=r[0].inst,i=r[1];return DT(function(){s.value=n,s.getSnapshot=t,Ed(s)&&i({inst:s})},[e,n,t]),LT(function(){return Ed(s)&&i({inst:s}),e(function(){Ed(s)&&i({inst:s})})},[e]),FT(n),n}function Ed(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!IT(e,n)}catch{return!0}}function $T(e,t){return t()}var zT=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?$T:OT;Hb.useSyncExternalStore=Fi.useSyncExternalStore!==void 0?Fi.useSyncExternalStore:zT;Wb.exports=Hb;var BT=Wb.exports;/**
50
- * @license React
51
- * use-sync-external-store-shim/with-selector.production.js
52
- *
53
- * Copyright (c) Meta Platforms, Inc. and affiliates.
54
- *
55
- * This source code is licensed under the MIT license found in the
56
- * LICENSE file in the root directory of this source tree.
57
- */var ju=b,VT=BT;function UT(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var WT=typeof Object.is=="function"?Object.is:UT,HT=VT.useSyncExternalStore,GT=ju.useRef,KT=ju.useEffect,YT=ju.useMemo,qT=ju.useDebugValue;Ub.useSyncExternalStoreWithSelector=function(e,t,n,r,s){var i=GT(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=YT(function(){function l(p){if(!c){if(c=!0,u=p,p=r(p),s!==void 0&&o.hasValue){var m=o.value;if(s(m,p))return f=m}return f=p}if(m=f,WT(u,p))return m;var g=r(p);return s!==void 0&&s(m,g)?(u=p,m):(u=p,f=g)}var c=!1,u,f,h=n===void 0?null:n;return[function(){return l(t())},h===null?void 0:function(){return l(h())}]},[t,n,r,s]);var a=HT(e,i[0],i[1]);return KT(function(){o.hasValue=!0,o.value=a},[a]),qT(a),a};Vb.exports=Ub;var Gb=Vb.exports;const QT=ou(Gb);function XT(e,t){return e===t}function Ct(e,t,n=XT){const r=b.useCallback(o=>{if(!e)return()=>{};const{unsubscribe:a}=e.subscribe(o);return a},[e]),s=b.useCallback(()=>e==null?void 0:e.get(),[e]);return Gb.useSyncExternalStoreWithSelector(r,s,s,t,n)}var JT={get:()=>{},subscribe:()=>({unsubscribe:()=>{}})};function $s(e){const t=Ut(),n=b.useContext(e.from?jT:Cu),r=e.from??n,s=r?e.from?t.stores.getRouteMatchStore(r):t.stores.matchStores.get(r):void 0,i=b.useRef(void 0);return Ct(s??JT,o=>{if((e.shouldThrow??!0)&&!o&&nr(),o===void 0)return;const a=e.select?e.select(o):o;if(e.structuralSharing??t.options.defaultStructuralSharing){const l=Ir(i.current,a);return i.current=l,l}return a})}function Kb(e){return $s({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Yb(e){const{select:t,...n}=e;return $s({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function zs(e){return $s({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function gm(e){return $s({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function mt(e){const t=Ut();return b.useCallback(n=>t.navigate({...n,from:n.from??(e==null?void 0:e.from)}),[e==null?void 0:e.from,t])}function qb(e){return $s({...e,select:t=>e.select?e.select(t.context):t.context})}function ZT(e,t){const n=Ut(),r=wE(t),{activeProps:s,inactiveProps:i,activeOptions:o,to:a,preload:l,preloadDelay:c,preloadIntentProximity:u,hashScrollIntoView:f,replace:h,startTransition:p,resetScroll:m,viewTransition:g,children:w,target:y,disabled:x,style:v,className:k,onClick:C,onBlur:S,onFocus:P,onMouseEnter:T,onMouseLeave:E,onTouchStart:j,ignoreBlocker:R,params:I,search:D,hash:$,state:A,mask:z,reloadDocument:O,unsafeRelative:L,from:V,_fromLocation:_,...B}=e,q=Fb(),N=b.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ae=Ct(n.stores.location,he=>he,(he,F)=>he.href===F.href),pe=b.useMemo(()=>{const he={_fromLocation:ae,...N};return n.buildLocation(he)},[n,ae,N]),fe=pe.maskedLocation?pe.maskedLocation.publicHref:pe.publicHref,Tt=pe.maskedLocation?pe.maskedLocation.external:pe.external,Ge=b.useMemo(()=>i2(fe,Tt,n.history,x),[x,Tt,fe,n.history]),Ht=b.useMemo(()=>{if(Ge!=null&&Ge.external)return Dc(Ge.href,n.protocolAllowlist)?void 0:Ge.href;if(!o2(a)&&!(typeof a!="string"||a.indexOf(":")===-1))try{return new URL(a),Dc(a,n.protocolAllowlist)?void 0:a}catch{}},[a,Ge,n.protocolAllowlist]),Sn=b.useMemo(()=>{if(Ht)return!1;if(o!=null&&o.exact){if(!$E(ae.pathname,pe.pathname,n.basepath))return!1}else{const he=Fc(ae.pathname,n.basepath),F=Fc(pe.pathname,n.basepath);if(!(he.startsWith(F)&&(he.length===F.length||he[F.length]==="/")))return!1}return((o==null?void 0:o.includeSearch)??!0)&&!Ss(ae.search,pe.search,{partial:!(o!=null&&o.exact),ignoreUndefined:!(o!=null&&o.explicitUndefined)})?!1:o!=null&&o.includeHash?q&&ae.hash===pe.hash:!0},[o==null?void 0:o.exact,o==null?void 0:o.explicitUndefined,o==null?void 0:o.includeHash,o==null?void 0:o.includeSearch,ae,Ht,q,pe.hash,pe.pathname,pe.search,n.basepath]),Wn=Sn?Ar(s,{})??e2:Td,Vs=Sn?Td:Ar(i,{})??Td,Ua=[k,Wn.className,Vs.className].filter(Boolean).join(" "),Wa=(v||Wn.style||Vs.style)&&{...v,...Wn.style,...Vs.style},[Ha,eo]=b.useState(!1),to=b.useRef(!1),dr=e.reloadDocument||Ht?!1:l??n.options.defaultPreload,Us=c??n.options.defaultPreloadDelay??0,Cn=b.useCallback(()=>{n.preloadRoute({...N,_builtLocation:pe}).catch(he=>{console.warn(he),console.warn(wT)})},[n,N,pe]);vE(r,b.useCallback(he=>{he!=null&&he.isIntersecting&&Cn()},[Cn]),s2,{disabled:!!x||dr!=="viewport"}),b.useEffect(()=>{to.current||!x&&dr==="render"&&(Cn(),to.current=!0)},[x,Cn,dr]);const Ku=he=>{const F=he.currentTarget.getAttribute("target"),H=y!==void 0?y:F;if(!x&&!a2(he)&&!he.defaultPrevented&&(!H||H==="_self")&&he.button===0){he.preventDefault(),Os.flushSync(()=>{eo(!0)});const ee=n.subscribe("onResolved",()=>{ee(),eo(!1)});n.navigate({...N,replace:h,resetScroll:m,hashScrollIntoView:f,startTransition:p,viewTransition:g,ignoreBlocker:R})}};if(Ht)return{...B,ref:r,href:Ht,...w&&{children:w},...y&&{target:y},...x&&{disabled:x},...v&&{style:v},...k&&{className:k},...C&&{onClick:C},...S&&{onBlur:S},...P&&{onFocus:P},...T&&{onMouseEnter:T},...E&&{onMouseLeave:E},...j&&{onTouchStart:j}};const Ga=he=>{if(x||dr!=="intent")return;if(!Us){Cn();return}const F=he.currentTarget;if(go.has(F))return;const H=setTimeout(()=>{go.delete(F),Cn()},Us);go.set(F,H)},Yu=he=>{x||dr!=="intent"||Cn()},Ka=he=>{if(x||!dr||!Us)return;const F=he.currentTarget,H=go.get(F);H&&(clearTimeout(H),go.delete(F))};return{...B,...Wn,...Vs,href:Ge==null?void 0:Ge.href,ref:r,onClick:Gs([C,Ku]),onBlur:Gs([S,Ka]),onFocus:Gs([P,Ga]),onMouseEnter:Gs([T,Ga]),onMouseLeave:Gs([E,Ka]),onTouchStart:Gs([j,Yu]),disabled:!!x,target:y,...Wa&&{style:Wa},...Ua&&{className:Ua},...x&&t2,...Sn&&n2,...q&&Ha&&r2}}var Td={},e2={className:"active"},t2={role:"link","aria-disabled":!0},n2={"data-status":"active","aria-current":"page"},r2={"data-transitioning":"transitioning"},go=new WeakMap,s2={rootMargin:"100px"},Gs=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function i2(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function o2(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Qb=b.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:s,...i}=ZT(r,t),o=typeof r.children=="function"?r.children({isActive:i["data-status"]==="active"}):r.children;if(!n){const{disabled:a,...l}=i;return b.createElement("a",l,o)}return b.createElement(n,i,o)});function a2(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var l2=class extends Db{constructor(e){super(e),this.useMatch=t=>$s({select:t==null?void 0:t.select,from:this.id,structuralSharing:t==null?void 0:t.structuralSharing}),this.useRouteContext=t=>qb({...t,from:this.id}),this.useSearch=t=>gm({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useParams=t=>zs({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useLoaderDeps=t=>Yb({...t,from:this.id}),this.useLoaderData=t=>Kb({...t,from:this.id}),this.useNavigate=()=>mt({from:this.fullPath}),this.Link=Pi.forwardRef((t,n)=>d.jsx(Qb,{ref:n,from:this.fullPath,...t}))}};function on(e){return new l2(e)}var c2=class extends bT{constructor(e){super(e),this.useMatch=t=>$s({select:t==null?void 0:t.select,from:this.id,structuralSharing:t==null?void 0:t.structuralSharing}),this.useRouteContext=t=>qb({...t,from:this.id}),this.useSearch=t=>gm({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useParams=t=>zs({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useLoaderDeps=t=>Yb({...t,from:this.id}),this.useLoaderData=t=>Kb({...t,from:this.id}),this.useNavigate=()=>mt({from:this.fullPath}),this.Link=Pi.forwardRef((t,n)=>d.jsx(Qb,{ref:n,from:this.fullPath,...t}))}};function u2(e){return new c2(e)}function d2(e){const t=Ut(),n=`not-found-${Ct(t.stores.location,r=>r.pathname)}-${Ct(t.stores.status,r=>r)}`;return d.jsx(pm,{getResetKey:()=>n,onCatch:(r,s)=>{var i;if(st(r))(i=e.onCatch)==null||i.call(e,r,s);else throw r},errorComponent:({error:r})=>{var s;if(st(r))return(s=e.fallback)==null?void 0:s.call(e,r);throw r},children:e.children})}function f2(){return d.jsx("p",{children:"Not Found"})}function Js(e){return d.jsx(d.Fragment,{children:e.children})}function Xb(e,t,n){return t.options.notFoundComponent?d.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?d.jsx(e.options.defaultNotFoundComponent,{...n}):d.jsx(f2,{})}function h2(e){return null}function p2(){return h2(Ut()),null}var Jb=b.memo(function({matchId:t}){const n=Ut(),r=n.stores.matchStores.get(t);r||nr();const s=Ct(n.stores.loadedAt,o=>o),i=Ct(r,o=>o);return d.jsx(m2,{router:n,matchId:t,resetKey:s,matchState:b.useMemo(()=>{var l;const o=i.routeId,a=(l=n.routesById[o].parentRoute)==null?void 0:l.id;return{routeId:o,ssr:i.ssr,_displayPending:i._displayPending,parentRouteId:a}},[i._displayPending,i.routeId,i.ssr,n.routesById])})});function m2({router:e,matchId:t,resetKey:n,matchState:r}){var m,g;const s=e.routesById[r.routeId],i=s.options.pendingComponent??e.options.defaultPendingComponent,o=i?d.jsx(i,{}):null,a=s.options.errorComponent??e.options.defaultErrorComponent,l=s.options.onCatch??e.options.defaultOnCatch,c=s.isRoot?s.options.notFoundComponent??((m=e.options.notFoundRoute)==null?void 0:m.options.component):s.options.notFoundComponent,u=r.ssr===!1||r.ssr==="data-only",f=(!s.isRoot||s.options.wrapInSuspense||u)&&(s.options.wrapInSuspense??i??(((g=s.options.errorComponent)==null?void 0:g.preload)||u))?b.Suspense:Js,h=a?pm:Js,p=c?d2:Js;return d.jsxs(s.isRoot?s.options.shellComponent??Js:Js,{children:[d.jsx(Cu.Provider,{value:t,children:d.jsx(f,{fallback:o,children:d.jsx(h,{getResetKey:()=>n,errorComponent:a||mm,onCatch:(w,y)=>{if(st(w))throw w.routeId??(w.routeId=r.routeId),w;l==null||l(w,y)},children:d.jsx(p,{fallback:w=>{if(w.routeId??(w.routeId=r.routeId),!c||w.routeId&&w.routeId!==r.routeId||!w.routeId&&!s.isRoot)throw w;return b.createElement(c,w)},children:u||r._displayPending?d.jsx(ST,{fallback:o,children:d.jsx(ix,{matchId:t})}):d.jsx(ix,{matchId:t})})})})}),r.parentRouteId===Cs?d.jsxs(d.Fragment,{children:[d.jsx(g2,{resetKey:n}),e.options.scrollRestoration&&jb?d.jsx(p2,{}):null]}):null]})}function g2({resetKey:e}){const t=Ut(),n=b.useRef(void 0);return Ro(()=>{const r=t.latestLocation.href;(n.current===void 0||n.current!==r)&&(t.emit({type:"onRendered",..._i(t.stores.location.get(),t.stores.resolvedLocation.get())}),n.current=r)},[t.latestLocation.state.__TSR_key,e,t]),null}var ix=b.memo(function({matchId:t}){const n=Ut(),r=(u,f)=>{var h;return((h=n.getMatch(u.id))==null?void 0:h._nonReactive[f])??u._nonReactive[f]},s=n.stores.matchStores.get(t);s||nr();const i=Ct(s,u=>u),o=i.routeId,a=n.routesById[o],l=b.useMemo(()=>{var f;const u=(f=n.routesById[o].options.remountDeps??n.options.defaultRemountDeps)==null?void 0:f({routeId:o,loaderDeps:i.loaderDeps,params:i._strictParams,search:i._strictSearch});return u?JSON.stringify(u):void 0},[o,i.loaderDeps,i._strictParams,i._strictSearch,n.options.defaultRemountDeps,n.routesById]),c=b.useMemo(()=>{const u=a.options.component??n.options.defaultComponent;return u?d.jsx(u,{},l):d.jsx(Zb,{})},[l,a.options.component,n.options.defaultComponent]);if(i._displayPending)throw r(i,"displayPendingPromise");if(i._forcePending)throw r(i,"minPendingPromise");if(i.status==="pending"){const u=a.options.pendingMinMs??n.options.defaultPendingMinMs;if(u){const f=n.getMatch(i.id);if(f&&!f._nonReactive.minPendingPromise){const h=Di();f._nonReactive.minPendingPromise=h,setTimeout(()=>{h.resolve(),f._nonReactive.minPendingPromise=void 0},u)}}throw r(i,"loadPromise")}if(i.status==="notFound")return st(i.error)||nr(),Xb(n,a,i.error);if(i.status==="redirected")throw wt(i.error)||nr(),r(i,"loadPromise");if(i.status==="error")throw i.error;return c}),Zb=b.memo(function(){const t=Ut(),n=b.useContext(Cu);let r,s=!1,i;{const c=n?t.stores.matchStores.get(n):void 0;[r,s]=Ct(c,u=>[u==null?void 0:u.routeId,(u==null?void 0:u.globalNotFound)??!1]),i=Ct(t.stores.matchesId,u=>u[u.findIndex(f=>f===n)+1])}const o=r?t.routesById[r]:void 0,a=t.options.defaultPendingComponent?d.jsx(t.options.defaultPendingComponent,{}):null;if(s)return o||nr(),Xb(t,o,void 0);if(!i)return null;const l=d.jsx(Jb,{matchId:i});return r===Cs?d.jsx(b.Suspense,{fallback:a,children:l}):l});function y2(){const e=Ut(),t=b.useRef({router:e,mounted:!1}),[n,r]=b.useState(!1),s=Ct(e.stores.isLoading,f=>f),i=Ct(e.stores.hasPending,f=>f),o=bd(s),a=s||n||i,l=bd(a),c=s||i,u=bd(c);return e.startTransition=f=>{r(!0),b.startTransition(()=>{f(),r(!1)})},b.useEffect(()=>{const f=e.history.subscribe(e.load),h=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Hr(e.latestLocation.publicHref)!==Hr(h.publicHref)&&e.commitLocation({...h,replace:!0}),()=>{f()}},[e,e.history]),Ro(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(h){console.error(h)}})()},[e]),Ro(()=>{o&&!s&&e.emit({type:"onLoad",..._i(e.stores.location.get(),e.stores.resolvedLocation.get())})},[o,e,s]),Ro(()=>{u&&!c&&e.emit({type:"onBeforeRouteMount",..._i(e.stores.location.get(),e.stores.resolvedLocation.get())})},[c,u,e]),Ro(()=>{if(l&&!a){const f=_i(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:"onResolved",...f}),zb(()=>{e.stores.status.set("idle"),e.stores.resolvedLocation.set(e.stores.location.get())}),f.hrefChanged&&kT(e)}},[a,l,e]),null}function x2(){const e=Ut(),t=e.routesById[Cs].options.pendingComponent??e.options.defaultPendingComponent,n=t?d.jsx(t,{}):null,r=d.jsxs(typeof document<"u"&&e.ssr?Js:b.Suspense,{fallback:n,children:[d.jsx(y2,{}),d.jsx(v2,{})]});return e.options.InnerWrap?d.jsx(e.options.InnerWrap,{children:r}):r}function v2(){const e=Ut(),t=Ct(e.stores.firstId,s=>s),n=Ct(e.stores.loadedAt,s=>s),r=t?d.jsx(Jb,{matchId:t}):null;return d.jsx(Cu.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:d.jsx(pm,{getResetKey:()=>n,errorComponent:mm,onCatch:void 0,children:r})})}var w2=e=>({createMutableStore:sx,createReadonlyStore:sx,batch:zb}),b2=e=>new k2(e),k2=class extends hT{constructor(e){super(e,w2)}};function _2({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=d.jsx(Ob.Provider,{value:e,children:t});return e.options.Wrap?d.jsx(e.options.Wrap,{children:r}):r}function S2({router:e,...t}){return d.jsx(_2,{router:e,...t,children:d.jsx(x2,{})})}function C2(e){const t=Ut({warn:(e==null?void 0:e.router)===void 0}),n=(e==null?void 0:e.router)||t,r=b.useRef(void 0);return Ct(n.stores.__store,s=>{if(e!=null&&e.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const i=Ir(r.current,e.select(s));return r.current=i,i}return e.select(s)}return s})}const j2="modulepreload",P2=function(e,t){return new URL(e,t).href},ox={},bn=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){const o=document.getElementsByTagName("link"),a=document.querySelector("meta[property=csp-nonce]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));s=Promise.allSettled(n.map(c=>{if(c=P2(c,r),c in ox)return;ox[c]=!0;const u=c.endsWith(".css"),f=u?'[rel="stylesheet"]':"";if(!!r)for(let m=o.length-1;m>=0;m--){const g=o[m];if(g.href===c&&(!u||g.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${c}"]${f}`))return;const p=document.createElement("link");if(p.rel=u?"stylesheet":j2,u||(p.as="script"),p.crossOrigin="",p.href=c,l&&p.setAttribute("nonce",l),document.head.appendChild(p),u)return new Promise((m,g)=>{p.addEventListener("load",m),p.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return s.then(o=>{for(const a of o||[])a.status==="rejected"&&i(a.reason);return t().catch(i)})};function ek(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=ek(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function E2(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=ek(e))&&(r&&(r+=" "),r+=t);return r}const ym="-",T2=e=>{const t=R2(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const a=o.split(ym);return a[0]===""&&a.length!==1&&a.shift(),tk(a,t)||N2(o)},getConflictingClassGroupIds:(o,a)=>{const l=n[o]||[];return a&&r[o]?[...l,...r[o]]:l}}},tk=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?tk(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const i=e.join(ym);return(o=t.validators.find(({validator:a})=>a(i)))==null?void 0:o.classGroupId},ax=/^\[(.+)\]$/,N2=e=>{if(ax.test(e)){const t=ax.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},R2=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return I2(Object.entries(e.classGroups),n).forEach(([i,o])=>{Ch(o,r,i,t)}),r},Ch=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const i=s===""?t:lx(t,s);i.classGroupId=n;return}if(typeof s=="function"){if(A2(s)){Ch(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([i,o])=>{Ch(o,lx(t,i),n,r)})})},lx=(e,t)=>{let n=e;return t.split(ym).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},A2=e=>e.isThemeGetter,I2=(e,t)=>t?e.map(([n,r])=>{const s=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,a])=>[t+o,a])):i);return[n,s]}):e,M2=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(i,o)=>{n.set(i,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let o=n.get(i);if(o!==void 0)return o;if((o=r.get(i))!==void 0)return s(i,o),o},set(i,o){n.has(i)?n.set(i,o):s(i,o)}}},nk="!",L2=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,s=t[0],i=t.length,o=a=>{const l=[];let c=0,u=0,f;for(let w=0;w<a.length;w++){let y=a[w];if(c===0){if(y===s&&(r||a.slice(w,w+i)===t)){l.push(a.slice(u,w)),u=w+i;continue}if(y==="/"){f=w;continue}}y==="["?c++:y==="]"&&c--}const h=l.length===0?a:a.substring(u),p=h.startsWith(nk),m=p?h.substring(1):h,g=f&&f>u?f-u:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:g}};return n?a=>n({className:a,parseClassName:o}):o},D2=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},F2=e=>({cache:M2(e.cacheSize),parseClassName:L2(e),...T2(e)}),O2=/\s+/,$2=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,i=[],o=e.trim().split(O2);let a="";for(let l=o.length-1;l>=0;l-=1){const c=o[l],{modifiers:u,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:p}=n(c);let m=!!p,g=r(m?h.substring(0,p):h);if(!g){if(!m){a=c+(a.length>0?" "+a:a);continue}if(g=r(h),!g){a=c+(a.length>0?" "+a:a);continue}m=!1}const w=D2(u).join(":"),y=f?w+nk:w,x=y+g;if(i.includes(x))continue;i.push(x);const v=s(g,m);for(let k=0;k<v.length;++k){const C=v[k];i.push(y+C)}a=c+(a.length>0?" "+a:a)}return a};function z2(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=rk(t))&&(r&&(r+=" "),r+=n);return r}const rk=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=rk(e[r]))&&(n&&(n+=" "),n+=t);return n};function B2(e,...t){let n,r,s,i=o;function o(l){const c=t.reduce((u,f)=>f(u),e());return n=F2(c),r=n.cache.get,s=n.cache.set,i=a,a(l)}function a(l){const c=r(l);if(c)return c;const u=$2(l,n);return s(l,u),u}return function(){return i(z2.apply(null,arguments))}}const Se=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},sk=/^\[(?:([a-z-]+):)?(.+)\]$/i,V2=/^\d+\/\d+$/,U2=new Set(["px","full","screen"]),W2=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,H2=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,G2=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,K2=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Y2=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Kn=e=>Si(e)||U2.has(e)||V2.test(e),hr=e=>Wi(e,"length",nN),Si=e=>!!e&&!Number.isNaN(Number(e)),Nd=e=>Wi(e,"number",Si),yo=e=>!!e&&Number.isInteger(Number(e)),q2=e=>e.endsWith("%")&&Si(e.slice(0,-1)),ne=e=>sk.test(e),pr=e=>W2.test(e),Q2=new Set(["length","size","percentage"]),X2=e=>Wi(e,Q2,ik),J2=e=>Wi(e,"position",ik),Z2=new Set(["image","url"]),eN=e=>Wi(e,Z2,sN),tN=e=>Wi(e,"",rN),xo=()=>!0,Wi=(e,t,n)=>{const r=sk.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},nN=e=>H2.test(e)&&!G2.test(e),ik=()=>!1,rN=e=>K2.test(e),sN=e=>Y2.test(e),iN=()=>{const e=Se("colors"),t=Se("spacing"),n=Se("blur"),r=Se("brightness"),s=Se("borderColor"),i=Se("borderRadius"),o=Se("borderSpacing"),a=Se("borderWidth"),l=Se("contrast"),c=Se("grayscale"),u=Se("hueRotate"),f=Se("invert"),h=Se("gap"),p=Se("gradientColorStops"),m=Se("gradientColorStopPositions"),g=Se("inset"),w=Se("margin"),y=Se("opacity"),x=Se("padding"),v=Se("saturate"),k=Se("scale"),C=Se("sepia"),S=Se("skew"),P=Se("space"),T=Se("translate"),E=()=>["auto","contain","none"],j=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto",ne,t],I=()=>[ne,t],D=()=>["",Kn,hr],$=()=>["auto",Si,ne],A=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],z=()=>["solid","dashed","dotted","double","none"],O=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],L=()=>["start","end","center","between","around","evenly","stretch"],V=()=>["","0",ne],_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],B=()=>[Si,ne];return{cacheSize:500,separator:":",theme:{colors:[xo],spacing:[Kn,hr],blur:["none","",pr,ne],brightness:B(),borderColor:[e],borderRadius:["none","","full",pr,ne],borderSpacing:I(),borderWidth:D(),contrast:B(),grayscale:V(),hueRotate:B(),invert:V(),gap:I(),gradientColorStops:[e],gradientColorStopPositions:[q2,hr],inset:R(),margin:R(),opacity:B(),padding:I(),saturate:B(),scale:B(),sepia:V(),skew:B(),space:I(),translate:I()},classGroups:{aspect:[{aspect:["auto","square","video",ne]}],container:["container"],columns:[{columns:[pr]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...A(),ne]}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:E()}],"overscroll-x":[{"overscroll-x":E()}],"overscroll-y":[{"overscroll-y":E()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",yo,ne]}],basis:[{basis:R()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ne]}],grow:[{grow:V()}],shrink:[{shrink:V()}],order:[{order:["first","last","none",yo,ne]}],"grid-cols":[{"grid-cols":[xo]}],"col-start-end":[{col:["auto",{span:["full",yo,ne]},ne]}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":[xo]}],"row-start-end":[{row:["auto",{span:[yo,ne]},ne]}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ne]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ne]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...L()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...L(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...L(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[w]}],mx:[{mx:[w]}],my:[{my:[w]}],ms:[{ms:[w]}],me:[{me:[w]}],mt:[{mt:[w]}],mr:[{mr:[w]}],mb:[{mb:[w]}],ml:[{ml:[w]}],"space-x":[{"space-x":[P]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[P]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ne,t]}],"min-w":[{"min-w":[ne,t,"min","max","fit"]}],"max-w":[{"max-w":[ne,t,"none","full","min","max","fit","prose",{screen:[pr]},pr]}],h:[{h:[ne,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ne,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ne,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ne,t,"auto","min","max","fit"]}],"font-size":[{text:["base",pr,hr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Nd]}],"font-family":[{font:[xo]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ne]}],"line-clamp":[{"line-clamp":["none",Si,Nd]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Kn,ne]}],"list-image":[{"list-image":["none",ne]}],"list-style-type":[{list:["none","disc","decimal",ne]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...z(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Kn,hr]}],"underline-offset":[{"underline-offset":["auto",Kn,ne]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ne]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ne]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...A(),J2]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",X2]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},eN]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...z(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:z()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...z()]}],"outline-offset":[{"outline-offset":[Kn,ne]}],"outline-w":[{outline:[Kn,hr]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:D()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[Kn,hr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",pr,tN]}],"shadow-color":[{shadow:[xo]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...O(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":O()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",pr,ne]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[f]}],saturate:[{saturate:[v]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[v]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ne]}],duration:[{duration:B()}],ease:[{ease:["linear","in","out","in-out",ne]}],delay:[{delay:B()}],animate:[{animate:["none","spin","ping","pulse","bounce",ne]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[k]}],"scale-x":[{"scale-x":[k]}],"scale-y":[{"scale-y":[k]}],rotate:[{rotate:[yo,ne]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ne]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ne]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ne]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Kn,hr,Nd]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},oN=B2(iN);function Rd(e,t,n){if(e&&e.length){const[r,s]=t,i=Math.PI/180*n,o=Math.cos(i),a=Math.sin(i);for(const l of e){const[c,u]=l;l[0]=(c-r)*o-(u-s)*a+r,l[1]=(c-r)*a+(u-s)*o+s}}}function aN(e,t){return e[0]===t[0]&&e[1]===t[1]}function lN(e,t,n,r=1){const s=n,i=Math.max(t,.1),o=e[0]&&e[0][0]&&typeof e[0][0]=="number"?[e]:e,a=[0,0];if(s)for(const c of o)Rd(c,a,s);const l=function(c,u,f){const h=[];for(const x of c){const v=[...x];aN(v[0],v[v.length-1])||v.push([v[0][0],v[0][1]]),v.length>2&&h.push(v)}const p=[];u=Math.max(u,.1);const m=[];for(const x of h)for(let v=0;v<x.length-1;v++){const k=x[v],C=x[v+1];if(k[1]!==C[1]){const S=Math.min(k[1],C[1]);m.push({ymin:S,ymax:Math.max(k[1],C[1]),x:S===k[1]?k[0]:C[0],islope:(C[0]-k[0])/(C[1]-k[1])})}}if(m.sort((x,v)=>x.ymin<v.ymin?-1:x.ymin>v.ymin?1:x.x<v.x?-1:x.x>v.x?1:x.ymax===v.ymax?0:(x.ymax-v.ymax)/Math.abs(x.ymax-v.ymax)),!m.length)return p;let g=[],w=m[0].ymin,y=0;for(;g.length||m.length;){if(m.length){let x=-1;for(let v=0;v<m.length&&!(m[v].ymin>w);v++)x=v;m.splice(0,x+1).forEach(v=>{g.push({s:w,edge:v})})}if(g=g.filter(x=>!(x.edge.ymax<=w)),g.sort((x,v)=>x.edge.x===v.edge.x?0:(x.edge.x-v.edge.x)/Math.abs(x.edge.x-v.edge.x)),(f!==1||y%u==0)&&g.length>1)for(let x=0;x<g.length;x+=2){const v=x+1;if(v>=g.length)break;const k=g[x].edge,C=g[v].edge;p.push([[Math.round(k.x),w],[Math.round(C.x),w]])}w+=f,g.forEach(x=>{x.edge.x=x.edge.x+f*x.edge.islope}),y++}return p}(o,i,r);if(s){for(const c of o)Rd(c,a,-s);(function(c,u,f){const h=[];c.forEach(p=>h.push(...p)),Rd(h,u,f)})(l,a,-s)}return l}function Na(e,t){var n;const r=t.hachureAngle+90;let s=t.hachureGap;s<0&&(s=4*t.strokeWidth),s=Math.round(Math.max(s,.1));let i=1;return t.roughness>=1&&(((n=t.randomizer)===null||n===void 0?void 0:n.next())||Math.random())>.7&&(i=s),lN(e,s,r,i||1)}class xm{constructor(t){this.helper=t}fillPolygons(t,n){return this._fillPolygons(t,n)}_fillPolygons(t,n){const r=Na(t,n);return{type:"fillSketch",ops:this.renderLines(r,n)}}renderLines(t,n){const r=[];for(const s of t)r.push(...this.helper.doubleLineOps(s[0][0],s[0][1],s[1][0],s[1][1],n));return r}}function Pu(e){const t=e[0],n=e[1];return Math.sqrt(Math.pow(t[0]-n[0],2)+Math.pow(t[1]-n[1],2))}class cN extends xm{fillPolygons(t,n){let r=n.hachureGap;r<0&&(r=4*n.strokeWidth),r=Math.max(r,.1);const s=Na(t,Object.assign({},n,{hachureGap:r})),i=Math.PI/180*n.hachureAngle,o=[],a=.5*r*Math.cos(i),l=.5*r*Math.sin(i);for(const[c,u]of s)Pu([c,u])&&o.push([[c[0]-a,c[1]+l],[...u]],[[c[0]+a,c[1]-l],[...u]]);return{type:"fillSketch",ops:this.renderLines(o,n)}}}class uN extends xm{fillPolygons(t,n){const r=this._fillPolygons(t,n),s=Object.assign({},n,{hachureAngle:n.hachureAngle+90}),i=this._fillPolygons(t,s);return r.ops=r.ops.concat(i.ops),r}}class dN{constructor(t){this.helper=t}fillPolygons(t,n){const r=Na(t,n=Object.assign({},n,{hachureAngle:0}));return this.dotsOnLines(r,n)}dotsOnLines(t,n){const r=[];let s=n.hachureGap;s<0&&(s=4*n.strokeWidth),s=Math.max(s,.1);let i=n.fillWeight;i<0&&(i=n.strokeWidth/2);const o=s/4;for(const a of t){const l=Pu(a),c=l/s,u=Math.ceil(c)-1,f=l-u*s,h=(a[0][0]+a[1][0])/2-s/4,p=Math.min(a[0][1],a[1][1]);for(let m=0;m<u;m++){const g=p+f+m*s,w=h-o+2*Math.random()*o,y=g-o+2*Math.random()*o,x=this.helper.ellipse(w,y,i,i,n);r.push(...x.ops)}}return{type:"fillSketch",ops:r}}}class fN{constructor(t){this.helper=t}fillPolygons(t,n){const r=Na(t,n);return{type:"fillSketch",ops:this.dashedLine(r,n)}}dashedLine(t,n){const r=n.dashOffset<0?n.hachureGap<0?4*n.strokeWidth:n.hachureGap:n.dashOffset,s=n.dashGap<0?n.hachureGap<0?4*n.strokeWidth:n.hachureGap:n.dashGap,i=[];return t.forEach(o=>{const a=Pu(o),l=Math.floor(a/(r+s)),c=(a+s-l*(r+s))/2;let u=o[0],f=o[1];u[0]>f[0]&&(u=o[1],f=o[0]);const h=Math.atan((f[1]-u[1])/(f[0]-u[0]));for(let p=0;p<l;p++){const m=p*(r+s),g=m+r,w=[u[0]+m*Math.cos(h)+c*Math.cos(h),u[1]+m*Math.sin(h)+c*Math.sin(h)],y=[u[0]+g*Math.cos(h)+c*Math.cos(h),u[1]+g*Math.sin(h)+c*Math.sin(h)];i.push(...this.helper.doubleLineOps(w[0],w[1],y[0],y[1],n))}}),i}}class hN{constructor(t){this.helper=t}fillPolygons(t,n){const r=n.hachureGap<0?4*n.strokeWidth:n.hachureGap,s=n.zigzagOffset<0?r:n.zigzagOffset,i=Na(t,n=Object.assign({},n,{hachureGap:r+s}));return{type:"fillSketch",ops:this.zigzagLines(i,s,n)}}zigzagLines(t,n,r){const s=[];return t.forEach(i=>{const o=Pu(i),a=Math.round(o/(2*n));let l=i[0],c=i[1];l[0]>c[0]&&(l=i[1],c=i[0]);const u=Math.atan((c[1]-l[1])/(c[0]-l[0]));for(let f=0;f<a;f++){const h=2*f*n,p=2*(f+1)*n,m=Math.sqrt(2*Math.pow(n,2)),g=[l[0]+h*Math.cos(u),l[1]+h*Math.sin(u)],w=[l[0]+p*Math.cos(u),l[1]+p*Math.sin(u)],y=[g[0]+m*Math.cos(u+Math.PI/4),g[1]+m*Math.sin(u+Math.PI/4)];s.push(...this.helper.doubleLineOps(g[0],g[1],y[0],y[1],r),...this.helper.doubleLineOps(y[0],y[1],w[0],w[1],r))}}),s}}const gt={};class pN{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const mN=0,Ad=1,cx=2,ml={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function Id(e,t){return e.type===t}function vm(e){const t=[],n=function(o){const a=new Array;for(;o!=="";)if(o.match(/^([ \t\r\n,]+)/))o=o.substr(RegExp.$1.length);else if(o.match(/^([aAcChHlLmMqQsStTvVzZ])/))a[a.length]={type:mN,text:RegExp.$1},o=o.substr(RegExp.$1.length);else{if(!o.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];a[a.length]={type:Ad,text:`${parseFloat(RegExp.$1)}`},o=o.substr(RegExp.$1.length)}return a[a.length]={type:cx,text:""},a}(e);let r="BOD",s=0,i=n[s];for(;!Id(i,cx);){let o=0;const a=[];if(r==="BOD"){if(i.text!=="M"&&i.text!=="m")return vm("M0,0"+e);s++,o=ml[i.text],r=i.text}else Id(i,Ad)?o=ml[r]:(s++,o=ml[i.text],r=i.text);if(!(s+o<n.length))throw new Error("Path data ended short");for(let l=s;l<s+o;l++){const c=n[l];if(!Id(c,Ad))throw new Error("Param not a number: "+r+","+c.text);a[a.length]=+c.text}if(typeof ml[r]!="number")throw new Error("Bad segment: "+r);{const l={key:r,data:a};t.push(l),s+=o,i=n[s],r==="M"&&(r="L"),r==="m"&&(r="l")}}return t}function ok(e){let t=0,n=0,r=0,s=0;const i=[];for(const{key:o,data:a}of e)switch(o){case"M":i.push({key:"M",data:[...a]}),[t,n]=a,[r,s]=a;break;case"m":t+=a[0],n+=a[1],i.push({key:"M",data:[t,n]}),r=t,s=n;break;case"L":i.push({key:"L",data:[...a]}),[t,n]=a;break;case"l":t+=a[0],n+=a[1],i.push({key:"L",data:[t,n]});break;case"C":i.push({key:"C",data:[...a]}),t=a[4],n=a[5];break;case"c":{const l=a.map((c,u)=>u%2?c+n:c+t);i.push({key:"C",data:l}),t=l[4],n=l[5];break}case"Q":i.push({key:"Q",data:[...a]}),t=a[2],n=a[3];break;case"q":{const l=a.map((c,u)=>u%2?c+n:c+t);i.push({key:"Q",data:l}),t=l[2],n=l[3];break}case"A":i.push({key:"A",data:[...a]}),t=a[5],n=a[6];break;case"a":t+=a[5],n+=a[6],i.push({key:"A",data:[a[0],a[1],a[2],a[3],a[4],t,n]});break;case"H":i.push({key:"H",data:[...a]}),t=a[0];break;case"h":t+=a[0],i.push({key:"H",data:[t]});break;case"V":i.push({key:"V",data:[...a]}),n=a[0];break;case"v":n+=a[0],i.push({key:"V",data:[n]});break;case"S":i.push({key:"S",data:[...a]}),t=a[2],n=a[3];break;case"s":{const l=a.map((c,u)=>u%2?c+n:c+t);i.push({key:"S",data:l}),t=l[2],n=l[3];break}case"T":i.push({key:"T",data:[...a]}),t=a[0],n=a[1];break;case"t":t+=a[0],n+=a[1],i.push({key:"T",data:[t,n]});break;case"Z":case"z":i.push({key:"Z",data:[]}),t=r,n=s}return i}function ak(e){const t=[];let n="",r=0,s=0,i=0,o=0,a=0,l=0;for(const{key:c,data:u}of e){switch(c){case"M":t.push({key:"M",data:[...u]}),[r,s]=u,[i,o]=u;break;case"C":t.push({key:"C",data:[...u]}),r=u[4],s=u[5],a=u[2],l=u[3];break;case"L":t.push({key:"L",data:[...u]}),[r,s]=u;break;case"H":r=u[0],t.push({key:"L",data:[r,s]});break;case"V":s=u[0],t.push({key:"L",data:[r,s]});break;case"S":{let f=0,h=0;n==="C"||n==="S"?(f=r+(r-a),h=s+(s-l)):(f=r,h=s),t.push({key:"C",data:[f,h,...u]}),a=u[0],l=u[1],r=u[2],s=u[3];break}case"T":{const[f,h]=u;let p=0,m=0;n==="Q"||n==="T"?(p=r+(r-a),m=s+(s-l)):(p=r,m=s);const g=r+2*(p-r)/3,w=s+2*(m-s)/3,y=f+2*(p-f)/3,x=h+2*(m-h)/3;t.push({key:"C",data:[g,w,y,x,f,h]}),a=p,l=m,r=f,s=h;break}case"Q":{const[f,h,p,m]=u,g=r+2*(f-r)/3,w=s+2*(h-s)/3,y=p+2*(f-p)/3,x=m+2*(h-m)/3;t.push({key:"C",data:[g,w,y,x,p,m]}),a=f,l=h,r=p,s=m;break}case"A":{const f=Math.abs(u[0]),h=Math.abs(u[1]),p=u[2],m=u[3],g=u[4],w=u[5],y=u[6];f===0||h===0?(t.push({key:"C",data:[r,s,w,y,w,y]}),r=w,s=y):(r!==w||s!==y)&&(lk(r,s,w,y,f,h,p,m,g).forEach(function(x){t.push({key:"C",data:x})}),r=w,s=y);break}case"Z":t.push({key:"Z",data:[]}),r=i,s=o}n=c}return t}function vo(e,t,n){return[e*Math.cos(n)-t*Math.sin(n),e*Math.sin(n)+t*Math.cos(n)]}function lk(e,t,n,r,s,i,o,a,l,c){const u=(f=o,Math.PI*f/180);var f;let h=[],p=0,m=0,g=0,w=0;if(c)[p,m,g,w]=c;else{[e,t]=vo(e,t,-u),[n,r]=vo(n,r,-u);const D=(e-n)/2,$=(t-r)/2;let A=D*D/(s*s)+$*$/(i*i);A>1&&(A=Math.sqrt(A),s*=A,i*=A);const z=s*s,O=i*i,L=z*O-z*$*$-O*D*D,V=z*$*$+O*D*D,_=(a===l?-1:1)*Math.sqrt(Math.abs(L/V));g=_*s*$/i+(e+n)/2,w=_*-i*D/s+(t+r)/2,p=Math.asin(parseFloat(((t-w)/i).toFixed(9))),m=Math.asin(parseFloat(((r-w)/i).toFixed(9))),e<g&&(p=Math.PI-p),n<g&&(m=Math.PI-m),p<0&&(p=2*Math.PI+p),m<0&&(m=2*Math.PI+m),l&&p>m&&(p-=2*Math.PI),!l&&m>p&&(m-=2*Math.PI)}let y=m-p;if(Math.abs(y)>120*Math.PI/180){const D=m,$=n,A=r;m=l&&m>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,h=lk(n=g+s*Math.cos(m),r=w+i*Math.sin(m),$,A,s,i,o,0,l,[m,D,g,w])}y=m-p;const x=Math.cos(p),v=Math.sin(p),k=Math.cos(m),C=Math.sin(m),S=Math.tan(y/4),P=4/3*s*S,T=4/3*i*S,E=[e,t],j=[e+P*v,t-T*x],R=[n+P*C,r-T*k],I=[n,r];if(j[0]=2*E[0]-j[0],j[1]=2*E[1]-j[1],c)return[j,R,I].concat(h);{h=[j,R,I].concat(h);const D=[];for(let $=0;$<h.length;$+=3){const A=vo(h[$][0],h[$][1],u),z=vo(h[$+1][0],h[$+1][1],u),O=vo(h[$+2][0],h[$+2][1],u);D.push([A[0],A[1],z[0],z[1],O[0],O[1]])}return D}}const gN={randOffset:function(e,t){return X(e,t)},randOffsetWithRange:function(e,t,n){return Bc(e,t,n)},ellipse:function(e,t,n,r,s){const i=uk(n,r,s);return jh(e,t,s,i).opset},doubleLineOps:function(e,t,n,r,s){return qr(e,t,n,r,s,!0)}};function ck(e,t,n,r,s){return{type:"path",ops:qr(e,t,n,r,s)}}function Jl(e,t,n){const r=(e||[]).length;if(r>2){const s=[];for(let i=0;i<r-1;i++)s.push(...qr(e[i][0],e[i][1],e[i+1][0],e[i+1][1],n));return t&&s.push(...qr(e[r-1][0],e[r-1][1],e[0][0],e[0][1],n)),{type:"path",ops:s}}return r===2?ck(e[0][0],e[0][1],e[1][0],e[1][1],n):{type:"path",ops:[]}}function yN(e,t,n,r,s){return function(i,o){return Jl(i,!0,o)}([[e,t],[e+n,t],[e+n,t+r],[e,t+r]],s)}function ux(e,t){if(e.length){const n=typeof e[0][0]=="number"?[e]:e,r=gl(n[0],1*(1+.2*t.roughness),t),s=t.disableMultiStroke?[]:gl(n[0],1.5*(1+.22*t.roughness),hx(t));for(let i=1;i<n.length;i++){const o=n[i];if(o.length){const a=gl(o,1*(1+.2*t.roughness),t),l=t.disableMultiStroke?[]:gl(o,1.5*(1+.22*t.roughness),hx(t));for(const c of a)c.op!=="move"&&r.push(c);for(const c of l)c.op!=="move"&&s.push(c)}}return{type:"path",ops:r.concat(s)}}return{type:"path",ops:[]}}function uk(e,t,n){const r=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(e/2,2)+Math.pow(t/2,2))/2)),s=Math.ceil(Math.max(n.curveStepCount,n.curveStepCount/Math.sqrt(200)*r)),i=2*Math.PI/s;let o=Math.abs(e/2),a=Math.abs(t/2);const l=1-n.curveFitting;return o+=X(o*l,n),a+=X(a*l,n),{increment:i,rx:o,ry:a}}function jh(e,t,n,r){const[s,i]=px(r.increment,e,t,r.rx,r.ry,1,r.increment*Bc(.1,Bc(.4,1,n),n),n);let o=Vc(s,null,n);if(!n.disableMultiStroke&&n.roughness!==0){const[a]=px(r.increment,e,t,r.rx,r.ry,1.5,0,n),l=Vc(a,null,n);o=o.concat(l)}return{estimatedPoints:i,opset:{type:"path",ops:o}}}function dx(e,t,n,r,s,i,o,a,l){const c=e,u=t;let f=Math.abs(n/2),h=Math.abs(r/2);f+=X(.01*f,l),h+=X(.01*h,l);let p=s,m=i;for(;p<0;)p+=2*Math.PI,m+=2*Math.PI;m-p>2*Math.PI&&(p=0,m=2*Math.PI);const g=2*Math.PI/l.curveStepCount,w=Math.min(g/2,(m-p)/2),y=mx(w,c,u,f,h,p,m,1,l);if(!l.disableMultiStroke){const x=mx(w,c,u,f,h,p,m,1.5,l);y.push(...x)}return o&&(a?y.push(...qr(c,u,c+f*Math.cos(p),u+h*Math.sin(p),l),...qr(c,u,c+f*Math.cos(m),u+h*Math.sin(m),l)):y.push({op:"lineTo",data:[c,u]},{op:"lineTo",data:[c+f*Math.cos(p),u+h*Math.sin(p)]})),{type:"path",ops:y}}function fx(e,t){const n=ak(ok(vm(e))),r=[];let s=[0,0],i=[0,0];for(const{key:o,data:a}of n)switch(o){case"M":i=[a[0],a[1]],s=[a[0],a[1]];break;case"L":r.push(...qr(i[0],i[1],a[0],a[1],t)),i=[a[0],a[1]];break;case"C":{const[l,c,u,f,h,p]=a;r.push(...xN(l,c,u,f,h,p,i,t)),i=[h,p];break}case"Z":r.push(...qr(i[0],i[1],s[0],s[1],t)),i=[s[0],s[1]]}return{type:"path",ops:r}}function Md(e,t){const n=[];for(const r of e)if(r.length){const s=t.maxRandomnessOffset||0,i=r.length;if(i>2){n.push({op:"move",data:[r[0][0]+X(s,t),r[0][1]+X(s,t)]});for(let o=1;o<i;o++)n.push({op:"lineTo",data:[r[o][0]+X(s,t),r[o][1]+X(s,t)]})}}return{type:"fillPath",ops:n}}function Ks(e,t){return function(n,r){let s=n.fillStyle||"hachure";if(!gt[s])switch(s){case"zigzag":gt[s]||(gt[s]=new cN(r));break;case"cross-hatch":gt[s]||(gt[s]=new uN(r));break;case"dots":gt[s]||(gt[s]=new dN(r));break;case"dashed":gt[s]||(gt[s]=new fN(r));break;case"zigzag-line":gt[s]||(gt[s]=new hN(r));break;default:s="hachure",gt[s]||(gt[s]=new xm(r))}return gt[s]}(t,gN).fillPolygons(e,t)}function hx(e){const t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function dk(e){return e.randomizer||(e.randomizer=new pN(e.seed||0)),e.randomizer.next()}function Bc(e,t,n,r=1){return n.roughness*r*(dk(n)*(t-e)+e)}function X(e,t,n=1){return Bc(-e,e,t,n)}function qr(e,t,n,r,s,i=!1){const o=i?s.disableMultiStrokeFill:s.disableMultiStroke,a=Ph(e,t,n,r,s,!0,!1);if(o)return a;const l=Ph(e,t,n,r,s,!0,!0);return a.concat(l)}function Ph(e,t,n,r,s,i,o){const a=Math.pow(e-n,2)+Math.pow(t-r,2),l=Math.sqrt(a);let c=1;c=l<200?1:l>500?.4:-.0016668*l+1.233334;let u=s.maxRandomnessOffset||0;u*u*100>a&&(u=l/10);const f=u/2,h=.2+.2*dk(s);let p=s.bowing*s.maxRandomnessOffset*(r-t)/200,m=s.bowing*s.maxRandomnessOffset*(e-n)/200;p=X(p,s,c),m=X(m,s,c);const g=[],w=()=>X(f,s,c),y=()=>X(u,s,c),x=s.preserveVertices;return o?g.push({op:"move",data:[e+(x?0:w()),t+(x?0:w())]}):g.push({op:"move",data:[e+(x?0:X(u,s,c)),t+(x?0:X(u,s,c))]}),o?g.push({op:"bcurveTo",data:[p+e+(n-e)*h+w(),m+t+(r-t)*h+w(),p+e+2*(n-e)*h+w(),m+t+2*(r-t)*h+w(),n+(x?0:w()),r+(x?0:w())]}):g.push({op:"bcurveTo",data:[p+e+(n-e)*h+y(),m+t+(r-t)*h+y(),p+e+2*(n-e)*h+y(),m+t+2*(r-t)*h+y(),n+(x?0:y()),r+(x?0:y())]}),g}function gl(e,t,n){if(!e.length)return[];const r=[];r.push([e[0][0]+X(t,n),e[0][1]+X(t,n)]),r.push([e[0][0]+X(t,n),e[0][1]+X(t,n)]);for(let s=1;s<e.length;s++)r.push([e[s][0]+X(t,n),e[s][1]+X(t,n)]),s===e.length-1&&r.push([e[s][0]+X(t,n),e[s][1]+X(t,n)]);return Vc(r,null,n)}function Vc(e,t,n){const r=e.length,s=[];if(r>3){const i=[],o=1-n.curveTightness;s.push({op:"move",data:[e[1][0],e[1][1]]});for(let a=1;a+2<r;a++){const l=e[a];i[0]=[l[0],l[1]],i[1]=[l[0]+(o*e[a+1][0]-o*e[a-1][0])/6,l[1]+(o*e[a+1][1]-o*e[a-1][1])/6],i[2]=[e[a+1][0]+(o*e[a][0]-o*e[a+2][0])/6,e[a+1][1]+(o*e[a][1]-o*e[a+2][1])/6],i[3]=[e[a+1][0],e[a+1][1]],s.push({op:"bcurveTo",data:[i[1][0],i[1][1],i[2][0],i[2][1],i[3][0],i[3][1]]})}}else r===3?(s.push({op:"move",data:[e[1][0],e[1][1]]}),s.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):r===2&&s.push(...Ph(e[0][0],e[0][1],e[1][0],e[1][1],n,!0,!0));return s}function px(e,t,n,r,s,i,o,a){const l=[],c=[];if(a.roughness===0){e/=4,c.push([t+r*Math.cos(-e),n+s*Math.sin(-e)]);for(let u=0;u<=2*Math.PI;u+=e){const f=[t+r*Math.cos(u),n+s*Math.sin(u)];l.push(f),c.push(f)}c.push([t+r*Math.cos(0),n+s*Math.sin(0)]),c.push([t+r*Math.cos(e),n+s*Math.sin(e)])}else{const u=X(.5,a)-Math.PI/2;c.push([X(i,a)+t+.9*r*Math.cos(u-e),X(i,a)+n+.9*s*Math.sin(u-e)]);const f=2*Math.PI+u-.01;for(let h=u;h<f;h+=e){const p=[X(i,a)+t+r*Math.cos(h),X(i,a)+n+s*Math.sin(h)];l.push(p),c.push(p)}c.push([X(i,a)+t+r*Math.cos(u+2*Math.PI+.5*o),X(i,a)+n+s*Math.sin(u+2*Math.PI+.5*o)]),c.push([X(i,a)+t+.98*r*Math.cos(u+o),X(i,a)+n+.98*s*Math.sin(u+o)]),c.push([X(i,a)+t+.9*r*Math.cos(u+.5*o),X(i,a)+n+.9*s*Math.sin(u+.5*o)])}return[c,l]}function mx(e,t,n,r,s,i,o,a,l){const c=i+X(.1,l),u=[];u.push([X(a,l)+t+.9*r*Math.cos(c-e),X(a,l)+n+.9*s*Math.sin(c-e)]);for(let f=c;f<=o;f+=e)u.push([X(a,l)+t+r*Math.cos(f),X(a,l)+n+s*Math.sin(f)]);return u.push([t+r*Math.cos(o),n+s*Math.sin(o)]),u.push([t+r*Math.cos(o),n+s*Math.sin(o)]),Vc(u,null,l)}function xN(e,t,n,r,s,i,o,a){const l=[],c=[a.maxRandomnessOffset||1,(a.maxRandomnessOffset||1)+.3];let u=[0,0];const f=a.disableMultiStroke?1:2,h=a.preserveVertices;for(let p=0;p<f;p++)p===0?l.push({op:"move",data:[o[0],o[1]]}):l.push({op:"move",data:[o[0]+(h?0:X(c[0],a)),o[1]+(h?0:X(c[0],a))]}),u=h?[s,i]:[s+X(c[p],a),i+X(c[p],a)],l.push({op:"bcurveTo",data:[e+X(c[p],a),t+X(c[p],a),n+X(c[p],a),r+X(c[p],a),u[0],u[1]]});return l}function wo(e){return[...e]}function gx(e,t=0){const n=e.length;if(n<3)throw new Error("A curve must have at least three points.");const r=[];if(n===3)r.push(wo(e[0]),wo(e[1]),wo(e[2]),wo(e[2]));else{const s=[];s.push(e[0],e[0]);for(let a=1;a<e.length;a++)s.push(e[a]),a===e.length-1&&s.push(e[a]);const i=[],o=1-t;r.push(wo(s[0]));for(let a=1;a+2<s.length;a++){const l=s[a];i[0]=[l[0],l[1]],i[1]=[l[0]+(o*s[a+1][0]-o*s[a-1][0])/6,l[1]+(o*s[a+1][1]-o*s[a-1][1])/6],i[2]=[s[a+1][0]+(o*s[a][0]-o*s[a+2][0])/6,s[a+1][1]+(o*s[a][1]-o*s[a+2][1])/6],i[3]=[s[a+1][0],s[a+1][1]],r.push(i[1],i[2],i[3])}}return r}function Zl(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function vN(e,t,n){const r=Zl(t,n);if(r===0)return Zl(e,t);let s=((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/r;return s=Math.max(0,Math.min(1,s)),Zl(e,hs(t,n,s))}function hs(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function Eh(e,t,n,r){const s=r||[];if(function(a,l){const c=a[l+0],u=a[l+1],f=a[l+2],h=a[l+3];let p=3*u[0]-2*c[0]-h[0];p*=p;let m=3*u[1]-2*c[1]-h[1];m*=m;let g=3*f[0]-2*h[0]-c[0];g*=g;let w=3*f[1]-2*h[1]-c[1];return w*=w,p<g&&(p=g),m<w&&(m=w),p+m}(e,t)<n){const a=e[t+0];s.length?(i=s[s.length-1],o=a,Math.sqrt(Zl(i,o))>1&&s.push(a)):s.push(a),s.push(e[t+3])}else{const l=e[t+0],c=e[t+1],u=e[t+2],f=e[t+3],h=hs(l,c,.5),p=hs(c,u,.5),m=hs(u,f,.5),g=hs(h,p,.5),w=hs(p,m,.5),y=hs(g,w,.5);Eh([l,h,g,y],0,n,s),Eh([y,w,m,f],0,n,s)}var i,o;return s}function wN(e,t){return Uc(e,0,e.length,t)}function Uc(e,t,n,r,s){const i=s||[],o=e[t],a=e[n-1];let l=0,c=1;for(let u=t+1;u<n-1;++u){const f=vN(e[u],o,a);f>l&&(l=f,c=u)}return Math.sqrt(l)>r?(Uc(e,t,c+1,r,i),Uc(e,c,n,r,i)):(i.length||i.push(o),i.push(a)),i}function Ld(e,t=.15,n){const r=[],s=(e.length-1)/3;for(let i=0;i<s;i++)Eh(e,3*i,t,r);return n&&n>0?Uc(r,0,r.length,n):r}const Rt="none";let Wc=class{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,n,r){return{shape:t,sets:n||[],options:r||this.defaultOptions}}line(t,n,r,s,i){const o=this._o(i);return this._d("line",[ck(t,n,r,s,o)],o)}rectangle(t,n,r,s,i){const o=this._o(i),a=[],l=yN(t,n,r,s,o);if(o.fill){const c=[[t,n],[t+r,n],[t+r,n+s],[t,n+s]];o.fillStyle==="solid"?a.push(Md([c],o)):a.push(Ks([c],o))}return o.stroke!==Rt&&a.push(l),this._d("rectangle",a,o)}ellipse(t,n,r,s,i){const o=this._o(i),a=[],l=uk(r,s,o),c=jh(t,n,o,l);if(o.fill)if(o.fillStyle==="solid"){const u=jh(t,n,o,l).opset;u.type="fillPath",a.push(u)}else a.push(Ks([c.estimatedPoints],o));return o.stroke!==Rt&&a.push(c.opset),this._d("ellipse",a,o)}circle(t,n,r,s){const i=this.ellipse(t,n,r,r,s);return i.shape="circle",i}linearPath(t,n){const r=this._o(n);return this._d("linearPath",[Jl(t,!1,r)],r)}arc(t,n,r,s,i,o,a=!1,l){const c=this._o(l),u=[],f=dx(t,n,r,s,i,o,a,!0,c);if(a&&c.fill)if(c.fillStyle==="solid"){const h=Object.assign({},c);h.disableMultiStroke=!0;const p=dx(t,n,r,s,i,o,!0,!1,h);p.type="fillPath",u.push(p)}else u.push(function(h,p,m,g,w,y,x){const v=h,k=p;let C=Math.abs(m/2),S=Math.abs(g/2);C+=X(.01*C,x),S+=X(.01*S,x);let P=w,T=y;for(;P<0;)P+=2*Math.PI,T+=2*Math.PI;T-P>2*Math.PI&&(P=0,T=2*Math.PI);const E=(T-P)/x.curveStepCount,j=[];for(let R=P;R<=T;R+=E)j.push([v+C*Math.cos(R),k+S*Math.sin(R)]);return j.push([v+C*Math.cos(T),k+S*Math.sin(T)]),j.push([v,k]),Ks([j],x)}(t,n,r,s,i,o,c));return c.stroke!==Rt&&u.push(f),this._d("arc",u,c)}curve(t,n){const r=this._o(n),s=[],i=ux(t,r);if(r.fill&&r.fill!==Rt)if(r.fillStyle==="solid"){const o=ux(t,Object.assign(Object.assign({},r),{disableMultiStroke:!0,roughness:r.roughness?r.roughness+r.fillShapeRoughnessGain:0}));s.push({type:"fillPath",ops:this._mergedShape(o.ops)})}else{const o=[],a=t;if(a.length){const l=typeof a[0][0]=="number"?[a]:a;for(const c of l)c.length<3?o.push(...c):c.length===3?o.push(...Ld(gx([c[0],c[0],c[1],c[2]]),10,(1+r.roughness)/2)):o.push(...Ld(gx(c),10,(1+r.roughness)/2))}o.length&&s.push(Ks([o],r))}return r.stroke!==Rt&&s.push(i),this._d("curve",s,r)}polygon(t,n){const r=this._o(n),s=[],i=Jl(t,!0,r);return r.fill&&(r.fillStyle==="solid"?s.push(Md([t],r)):s.push(Ks([t],r))),r.stroke!==Rt&&s.push(i),this._d("polygon",s,r)}path(t,n){const r=this._o(n),s=[];if(!t)return this._d("path",s,r);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const i=r.fill&&r.fill!=="transparent"&&r.fill!==Rt,o=r.stroke!==Rt,a=!!(r.simplification&&r.simplification<1),l=function(u,f,h){const p=ak(ok(vm(u))),m=[];let g=[],w=[0,0],y=[];const x=()=>{y.length>=4&&g.push(...Ld(y,f)),y=[]},v=()=>{x(),g.length&&(m.push(g),g=[])};for(const{key:C,data:S}of p)switch(C){case"M":v(),w=[S[0],S[1]],g.push(w);break;case"L":x(),g.push([S[0],S[1]]);break;case"C":if(!y.length){const P=g.length?g[g.length-1]:w;y.push([P[0],P[1]])}y.push([S[0],S[1]]),y.push([S[2],S[3]]),y.push([S[4],S[5]]);break;case"Z":x(),g.push([w[0],w[1]])}if(v(),!h)return m;const k=[];for(const C of m){const S=wN(C,h);S.length&&k.push(S)}return k}(t,1,a?4-4*(r.simplification||1):(1+r.roughness)/2),c=fx(t,r);if(i)if(r.fillStyle==="solid")if(l.length===1){const u=fx(t,Object.assign(Object.assign({},r),{disableMultiStroke:!0,roughness:r.roughness?r.roughness+r.fillShapeRoughnessGain:0}));s.push({type:"fillPath",ops:this._mergedShape(u.ops)})}else s.push(Md(l,r));else s.push(Ks(l,r));return o&&(a?l.forEach(u=>{s.push(Jl(u,!1,r))}):s.push(c)),this._d("path",s,r)}opsToPath(t,n){let r="";for(const s of t.ops){const i=typeof n=="number"&&n>=0?s.data.map(o=>+o.toFixed(n)):s.data;switch(s.op){case"move":r+=`M${i[0]} ${i[1]} `;break;case"bcurveTo":r+=`C${i[0]} ${i[1]}, ${i[2]} ${i[3]}, ${i[4]} ${i[5]} `;break;case"lineTo":r+=`L${i[0]} ${i[1]} `}}return r.trim()}toPaths(t){const n=t.sets||[],r=t.options||this.defaultOptions,s=[];for(const i of n){let o=null;switch(i.type){case"path":o={d:this.opsToPath(i),stroke:r.stroke,strokeWidth:r.strokeWidth,fill:Rt};break;case"fillPath":o={d:this.opsToPath(i),stroke:Rt,strokeWidth:0,fill:r.fill||Rt};break;case"fillSketch":o=this.fillSketch(i,r)}o&&s.push(o)}return s}fillSketch(t,n){let r=n.fillWeight;return r<0&&(r=n.strokeWidth/2),{d:this.opsToPath(t),stroke:n.fill||Rt,strokeWidth:r,fill:Rt}}_mergedShape(t){return t.filter((n,r)=>r===0||n.op!=="move")}},bN=class{constructor(t,n){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new Wc(n)}draw(t){const n=t.sets||[],r=t.options||this.getDefaultOptions(),s=this.ctx,i=t.options.fixedDecimalPlaceDigits;for(const o of n)switch(o.type){case"path":s.save(),s.strokeStyle=r.stroke==="none"?"transparent":r.stroke,s.lineWidth=r.strokeWidth,r.strokeLineDash&&s.setLineDash(r.strokeLineDash),r.strokeLineDashOffset&&(s.lineDashOffset=r.strokeLineDashOffset),this._drawToContext(s,o,i),s.restore();break;case"fillPath":{s.save(),s.fillStyle=r.fill||"";const a=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(s,o,i,a),s.restore();break}case"fillSketch":this.fillSketch(s,o,r)}}fillSketch(t,n,r){let s=r.fillWeight;s<0&&(s=r.strokeWidth/2),t.save(),r.fillLineDash&&t.setLineDash(r.fillLineDash),r.fillLineDashOffset&&(t.lineDashOffset=r.fillLineDashOffset),t.strokeStyle=r.fill||"",t.lineWidth=s,this._drawToContext(t,n,r.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,n,r,s="nonzero"){t.beginPath();for(const i of n.ops){const o=typeof r=="number"&&r>=0?i.data.map(a=>+a.toFixed(r)):i.data;switch(i.op){case"move":t.moveTo(o[0],o[1]);break;case"bcurveTo":t.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5]);break;case"lineTo":t.lineTo(o[0],o[1])}}n.type==="fillPath"?t.fill(s):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,n,r,s,i){const o=this.gen.line(t,n,r,s,i);return this.draw(o),o}rectangle(t,n,r,s,i){const o=this.gen.rectangle(t,n,r,s,i);return this.draw(o),o}ellipse(t,n,r,s,i){const o=this.gen.ellipse(t,n,r,s,i);return this.draw(o),o}circle(t,n,r,s){const i=this.gen.circle(t,n,r,s);return this.draw(i),i}linearPath(t,n){const r=this.gen.linearPath(t,n);return this.draw(r),r}polygon(t,n){const r=this.gen.polygon(t,n);return this.draw(r),r}arc(t,n,r,s,i,o,a=!1,l){const c=this.gen.arc(t,n,r,s,i,o,a,l);return this.draw(c),c}curve(t,n){const r=this.gen.curve(t,n);return this.draw(r),r}path(t,n){const r=this.gen.path(t,n);return this.draw(r),r}};const yl="http://www.w3.org/2000/svg";class kN{constructor(t,n){this.svg=t,this.gen=new Wc(n)}draw(t){const n=t.sets||[],r=t.options||this.getDefaultOptions(),s=this.svg.ownerDocument||window.document,i=s.createElementNS(yl,"g"),o=t.options.fixedDecimalPlaceDigits;for(const a of n){let l=null;switch(a.type){case"path":l=s.createElementNS(yl,"path"),l.setAttribute("d",this.opsToPath(a,o)),l.setAttribute("stroke",r.stroke),l.setAttribute("stroke-width",r.strokeWidth+""),l.setAttribute("fill","none"),r.strokeLineDash&&l.setAttribute("stroke-dasharray",r.strokeLineDash.join(" ").trim()),r.strokeLineDashOffset&&l.setAttribute("stroke-dashoffset",`${r.strokeLineDashOffset}`);break;case"fillPath":l=s.createElementNS(yl,"path"),l.setAttribute("d",this.opsToPath(a,o)),l.setAttribute("stroke","none"),l.setAttribute("stroke-width","0"),l.setAttribute("fill",r.fill||""),t.shape!=="curve"&&t.shape!=="polygon"||l.setAttribute("fill-rule","evenodd");break;case"fillSketch":l=this.fillSketch(s,a,r)}l&&i.appendChild(l)}return i}fillSketch(t,n,r){let s=r.fillWeight;s<0&&(s=r.strokeWidth/2);const i=t.createElementNS(yl,"path");return i.setAttribute("d",this.opsToPath(n,r.fixedDecimalPlaceDigits)),i.setAttribute("stroke",r.fill||""),i.setAttribute("stroke-width",s+""),i.setAttribute("fill","none"),r.fillLineDash&&i.setAttribute("stroke-dasharray",r.fillLineDash.join(" ").trim()),r.fillLineDashOffset&&i.setAttribute("stroke-dashoffset",`${r.fillLineDashOffset}`),i}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,n){return this.gen.opsToPath(t,n)}line(t,n,r,s,i){const o=this.gen.line(t,n,r,s,i);return this.draw(o)}rectangle(t,n,r,s,i){const o=this.gen.rectangle(t,n,r,s,i);return this.draw(o)}ellipse(t,n,r,s,i){const o=this.gen.ellipse(t,n,r,s,i);return this.draw(o)}circle(t,n,r,s){const i=this.gen.circle(t,n,r,s);return this.draw(i)}linearPath(t,n){const r=this.gen.linearPath(t,n);return this.draw(r)}polygon(t,n){const r=this.gen.polygon(t,n);return this.draw(r)}arc(t,n,r,s,i,o,a=!1,l){const c=this.gen.arc(t,n,r,s,i,o,a,l);return this.draw(c)}curve(t,n){const r=this.gen.curve(t,n);return this.draw(r)}path(t,n){const r=this.gen.path(t,n);return this.draw(r)}}var _N={canvas:(e,t)=>new bN(e,t),svg:(e,t)=>new kN(e,t),generator:e=>new Wc(e),newSeed:()=>Wc.newSeed()};const wm=b.createContext({});function bm(e){const t=b.useRef(null);return t.current===null&&(t.current=e()),t.current}const SN=typeof window<"u",fk=SN?b.useLayoutEffect:b.useEffect,Eu=b.createContext(null);function km(e,t){e.indexOf(t)===-1&&e.push(t)}function Hc(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Vn=(e,t,n)=>n>t?t:n<e?e:n;let _m=()=>{};const Qr={},hk=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),pk=e=>typeof e=="object"&&e!==null,mk=e=>/^0[^.\s]+$/u.test(e);function gk(e){let t;return()=>(t===void 0&&(t=e()),t)}const nn=e=>e,Ra=(...e)=>e.reduce((t,n)=>r=>n(t(r))),wa=(e,t,n)=>{const r=t-e;return r?(n-e)/r:1};class Sm{constructor(){this.subscriptions=[]}add(t){return km(this.subscriptions,t),()=>Hc(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let i=0;i<s;i++){const o=this.subscriptions[i];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const $t=e=>e*1e3,Zt=e=>e/1e3,yk=(e,t)=>t?e*(1e3/t):0,xk=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,CN=1e-7,jN=12;function PN(e,t,n,r,s){let i,o,a=0;do o=t+(n-t)/2,i=xk(o,r,s)-e,i>0?n=o:t=o;while(Math.abs(i)>CN&&++a<jN);return o}function Aa(e,t,n,r){if(e===t&&n===r)return nn;const s=i=>PN(i,0,1,e,n);return i=>i===0||i===1?i:xk(s(i),t,r)}const vk=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,wk=e=>t=>1-e(1-t),bk=Aa(.33,1.53,.69,.99),Cm=wk(bk),kk=vk(Cm),_k=e=>e>=1?1:(e*=2)<1?.5*Cm(e):.5*(2-Math.pow(2,-10*(e-1))),jm=e=>1-Math.sin(Math.acos(e)),Sk=wk(jm),Ck=vk(jm),EN=Aa(.42,0,1,1),TN=Aa(0,0,.58,1),jk=Aa(.42,0,.58,1),NN=e=>Array.isArray(e)&&typeof e[0]!="number",Pk=e=>Array.isArray(e)&&typeof e[0]=="number",RN={linear:nn,easeIn:EN,easeInOut:jk,easeOut:TN,circIn:jm,circInOut:Ck,circOut:Sk,backIn:Cm,backInOut:kk,backOut:bk,anticipate:_k},AN=e=>typeof e=="string",yx=e=>{if(Pk(e)){_m(e.length===4);const[t,n,r,s]=e;return Aa(t,n,r,s)}else if(AN(e))return RN[e];return e},xl=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function IN(e,t){let n=new Set,r=new Set,s=!1,i=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(u){o.has(u)&&(c.schedule(u),e()),u(a)}const c={schedule:(u,f=!1,h=!1)=>{const m=h&&s?n:r;return f&&o.add(u),m.add(u),u},cancel:u=>{r.delete(u),o.delete(u)},process:u=>{if(a=u,s){i=!0;return}s=!0;const f=n;n=r,r=f,n.forEach(l),n.clear(),s=!1,i&&(i=!1,c.process(u))}};return c}const MN=40;function Ek(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=xl.reduce((v,k)=>(v[k]=IN(i),v),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:u,update:f,preRender:h,render:p,postRender:m}=o,g=()=>{const v=Qr.useManualTiming,k=v?s.timestamp:performance.now();n=!1,v||(s.delta=r?1e3/60:Math.max(Math.min(k-s.timestamp,MN),1)),s.timestamp=k,s.isProcessing=!0,a.process(s),l.process(s),c.process(s),u.process(s),f.process(s),h.process(s),p.process(s),m.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(g))},w=()=>{n=!0,r=!0,s.isProcessing||e(g)};return{schedule:xl.reduce((v,k)=>{const C=o[k];return v[k]=(S,P=!1,T=!1)=>(n||w(),C.schedule(S,P,T)),v},{}),cancel:v=>{for(let k=0;k<xl.length;k++)o[xl[k]].cancel(v)},state:s,steps:o}}const{schedule:xe,cancel:Xr,state:Qe,steps:Dd}=Ek(typeof requestAnimationFrame<"u"?requestAnimationFrame:nn,!0);let ec;function LN(){ec=void 0}const ct={now:()=>(ec===void 0&&ct.set(Qe.isProcessing||Qr.useManualTiming?Qe.timestamp:performance.now()),ec),set:e=>{ec=e,queueMicrotask(LN)}},Tk=e=>t=>typeof t=="string"&&t.startsWith(e),Nk=Tk("--"),DN=Tk("var(--"),Pm=e=>DN(e)?FN.test(e.split("/*")[0].trim()):!1,FN=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function xx(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Hi={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},ba={...Hi,transform:e=>Vn(0,1,e)},vl={...Hi,default:1},Uo=e=>Math.round(e*1e5)/1e5,Em=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function ON(e){return e==null}const $N=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Tm=(e,t)=>n=>!!(typeof n=="string"&&$N.test(n)&&n.startsWith(e)||t&&!ON(n)&&Object.prototype.hasOwnProperty.call(n,t)),Rk=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,a]=r.match(Em);return{[e]:parseFloat(s),[t]:parseFloat(i),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},zN=e=>Vn(0,255,e),Fd={...Hi,transform:e=>Math.round(zN(e))},ws={test:Tm("rgb","red"),parse:Rk("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Fd.transform(e)+", "+Fd.transform(t)+", "+Fd.transform(n)+", "+Uo(ba.transform(r))+")"};function BN(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const Th={test:Tm("#"),parse:BN,transform:ws.transform},Ia=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Qn=Ia("deg"),Bn=Ia("%"),Y=Ia("px"),VN=Ia("vh"),UN=Ia("vw"),vx={...Bn,parse:e=>Bn.parse(e)/100,transform:e=>Bn.transform(e*100)},hi={test:Tm("hsl","hue"),parse:Rk("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Bn.transform(Uo(t))+", "+Bn.transform(Uo(n))+", "+Uo(ba.transform(r))+")"},$e={test:e=>ws.test(e)||Th.test(e)||hi.test(e),parse:e=>ws.test(e)?ws.parse(e):hi.test(e)?hi.parse(e):Th.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?ws.transform(e):hi.transform(e),getAnimatableNone:e=>{const t=$e.parse(e);return t.alpha=0,$e.transform(t)}},WN=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function HN(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Em))==null?void 0:t.length)||0)+(((n=e.match(WN))==null?void 0:n.length)||0)>0}const Ak="number",Ik="color",GN="var",KN="var(",wx="${}",YN=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Oi(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const a=t.replace(YN,l=>($e.test(l)?(r.color.push(i),s.push(Ik),n.push($e.parse(l))):l.startsWith(KN)?(r.var.push(i),s.push(GN),n.push(l)):(r.number.push(i),s.push(Ak),n.push(parseFloat(l))),++i,wx)).split(wx);return{values:n,split:a,indexes:r,types:s}}function qN(e){return Oi(e).values}function Mk({split:e,types:t}){const n=e.length;return r=>{let s="";for(let i=0;i<n;i++)if(s+=e[i],r[i]!==void 0){const o=t[i];o===Ak?s+=Uo(r[i]):o===Ik?s+=$e.transform(r[i]):s+=r[i]}return s}}function QN(e){return Mk(Oi(e))}const XN=e=>typeof e=="number"?0:$e.test(e)?$e.getAnimatableNone(e):e,JN=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:XN(e);function ZN(e){const t=Oi(e);return Mk(t)(t.values.map((r,s)=>JN(r,t.split[s])))}const vn={test:HN,parse:qN,createTransformer:QN,getAnimatableNone:ZN};function Od(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function eR({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,i=0,o=0;if(!t)s=i=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;s=Od(l,a,e+1/3),i=Od(l,a,e),o=Od(l,a,e-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function Gc(e,t){return n=>n>0?t:e}const ye=(e,t,n)=>e+(t-e)*n,$d=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},tR=[Th,ws,hi],nR=e=>tR.find(t=>t.test(e));function bx(e){const t=nR(e);if(!t)return!1;let n=t.parse(e);return t===hi&&(n=eR(n)),n}const kx=(e,t)=>{const n=bx(e),r=bx(t);if(!n||!r)return Gc(e,t);const s={...n};return i=>(s.red=$d(n.red,r.red,i),s.green=$d(n.green,r.green,i),s.blue=$d(n.blue,r.blue,i),s.alpha=ye(n.alpha,r.alpha,i),ws.transform(s))},Nh=new Set(["none","hidden"]);function rR(e,t){return Nh.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function sR(e,t){return n=>ye(e,t,n)}function Nm(e){return typeof e=="number"?sR:typeof e=="string"?Pm(e)?Gc:$e.test(e)?kx:aR:Array.isArray(e)?Lk:typeof e=="object"?$e.test(e)?kx:iR:Gc}function Lk(e,t){const n=[...e],r=n.length,s=e.map((i,o)=>Nm(i)(i,t[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function iR(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=Nm(e[s])(e[s],t[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function oR(e,t){const n=[],r={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const i=t.types[s],o=e.indexes[i][r[i]],a=e.values[o]??0;n[s]=a,r[i]++}return n}const aR=(e,t)=>{const n=vn.createTransformer(t),r=Oi(e),s=Oi(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?Nh.has(e)&&!s.values.length||Nh.has(t)&&!r.values.length?rR(e,t):Ra(Lk(oR(r,s),s.values),n):Gc(e,t)};function Dk(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?ye(e,t,n):Nm(e)(e,t)}const lR=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>xe.update(t,n),stop:()=>Xr(t),now:()=>Qe.isProcessing?Qe.timestamp:ct.now()}},Fk=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let i=0;i<s;i++)r+=Math.round(e(i/(s-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Kc=2e4;function Rm(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Kc;)t+=n,r=e.next(t);return t>=Kc?1/0:t}function cR(e,t=100,n){const r=n({...e,keyframes:[0,t]}),s=Math.min(Rm(r),Kc);return{type:"keyframes",ease:i=>r.next(s*i).value/t,duration:Zt(s)}}const Ie={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Rh(e,t){return e*Math.sqrt(1-t*t)}const uR=12;function dR(e,t,n){let r=n;for(let s=1;s<uR;s++)r=r-e(r)/t(r);return r}const zd=.001;function fR({duration:e=Ie.duration,bounce:t=Ie.bounce,velocity:n=Ie.velocity,mass:r=Ie.mass}){let s,i,o=1-t;o=Vn(Ie.minDamping,Ie.maxDamping,o),e=Vn(Ie.minDuration,Ie.maxDuration,Zt(e)),o<1?(s=c=>{const u=c*o,f=u*e,h=u-n,p=Rh(c,o),m=Math.exp(-f);return zd-h/p*m},i=c=>{const f=c*o*e,h=f*n+n,p=Math.pow(o,2)*Math.pow(c,2)*e,m=Math.exp(-f),g=Rh(Math.pow(c,2),o);return(-s(c)+zd>0?-1:1)*((h-p)*m)/g}):(s=c=>{const u=Math.exp(-c*e),f=(c-n)*e+1;return-zd+u*f},i=c=>{const u=Math.exp(-c*e),f=(n-c)*(e*e);return u*f});const a=5/e,l=dR(s,i,a);if(e=$t(e),isNaN(l))return{stiffness:Ie.stiffness,damping:Ie.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:o*2*Math.sqrt(r*c),duration:e}}}const hR=["duration","bounce"],pR=["stiffness","damping","mass"];function _x(e,t){return t.some(n=>e[n]!==void 0)}function mR(e){let t={velocity:Ie.velocity,stiffness:Ie.stiffness,damping:Ie.damping,mass:Ie.mass,isResolvedFromDuration:!1,...e};if(!_x(e,pR)&&_x(e,hR))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*Vn(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:Ie.mass,stiffness:s,damping:i}}else{const n=fR({...e,velocity:0});t={...t,...n,mass:Ie.mass},t.isResolvedFromDuration=!0}return t}function Yc(e=Ie.visualDuration,t=Ie.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:i},{stiffness:l,damping:c,mass:u,duration:f,velocity:h,isResolvedFromDuration:p}=mR({...n,velocity:-Zt(n.velocity||0)}),m=h||0,g=c/(2*Math.sqrt(l*u)),w=o-i,y=Zt(Math.sqrt(l/u)),x=Math.abs(w)<5;r||(r=x?Ie.restSpeed.granular:Ie.restSpeed.default),s||(s=x?Ie.restDelta.granular:Ie.restDelta.default);let v,k,C,S,P,T;if(g<1)C=Rh(y,g),S=(m+g*y*w)/C,v=j=>{const R=Math.exp(-g*y*j);return o-R*(S*Math.sin(C*j)+w*Math.cos(C*j))},P=g*y*S+w*C,T=g*y*w-S*C,k=j=>Math.exp(-g*y*j)*(P*Math.sin(C*j)+T*Math.cos(C*j));else if(g===1){v=R=>o-Math.exp(-y*R)*(w+(m+y*w)*R);const j=m+y*w;k=R=>Math.exp(-y*R)*(y*j*R-m)}else{const j=y*Math.sqrt(g*g-1);v=$=>{const A=Math.exp(-g*y*$),z=Math.min(j*$,300);return o-A*((m+g*y*w)*Math.sinh(z)+j*w*Math.cosh(z))/j};const R=(m+g*y*w)/j,I=g*y*R-w*j,D=g*y*w-R*j;k=$=>{const A=Math.exp(-g*y*$),z=Math.min(j*$,300);return A*(I*Math.sinh(z)+D*Math.cosh(z))}}const E={calculatedDuration:p&&f||null,velocity:j=>$t(k(j)),next:j=>{if(!p&&g<1){const I=Math.exp(-g*y*j),D=Math.sin(C*j),$=Math.cos(C*j),A=o-I*(S*D+w*$),z=$t(I*(P*D+T*$));return a.done=Math.abs(z)<=r&&Math.abs(o-A)<=s,a.value=a.done?o:A,a}const R=v(j);if(p)a.done=j>=f;else{const I=$t(k(j));a.done=Math.abs(I)<=r&&Math.abs(o-R)<=s}return a.value=a.done?o:R,a},toString:()=>{const j=Math.min(Rm(E),Kc),R=Fk(I=>E.next(j*I).value,j,30);return j+"ms "+R},toTransition:()=>{}};return E}Yc.applyToOptions=e=>{const t=cR(e,100,Yc);return e.ease=t.ease,e.duration=$t(t.duration),e.type="keyframes",e};const gR=5;function Ok(e,t,n){const r=Math.max(t-gR,0);return yk(n-e(r),t-r)}function Ah({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:u}){const f=e[0],h={done:!1,value:f},p=T=>a!==void 0&&T<a||l!==void 0&&T>l,m=T=>a===void 0?l:l===void 0||Math.abs(a-T)<Math.abs(l-T)?a:l;let g=n*t;const w=f+g,y=o===void 0?w:o(w);y!==w&&(g=y-f);const x=T=>-g*Math.exp(-T/r),v=T=>y+x(T),k=T=>{const E=x(T),j=v(T);h.done=Math.abs(E)<=c,h.value=h.done?y:j};let C,S;const P=T=>{p(h.value)&&(C=T,S=Yc({keyframes:[h.value,m(h.value)],velocity:Ok(v,T,h.value),damping:s,stiffness:i,restDelta:c,restSpeed:u}))};return P(0),{calculatedDuration:null,next:T=>{let E=!1;return!S&&C===void 0&&(E=!0,k(T),P(T)),C!==void 0&&T>=C?S.next(T-C):(!E&&k(T),h)}}}function yR(e,t,n){const r=[],s=n||Qr.mix||Dk,i=e.length-1;for(let o=0;o<i;o++){let a=s(e[o],e[o+1]);if(t){const l=Array.isArray(t)?t[o]||nn:t;a=Ra(l,a)}r.push(a)}return r}function xR(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const i=e.length;if(_m(i===t.length),i===1)return()=>t[0];if(i===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=yR(t,r,s),l=a.length,c=u=>{if(o&&u<e[0])return t[0];let f=0;if(l>1)for(;f<e.length-2&&!(u<e[f+1]);f++);const h=wa(e[f],e[f+1],u);return a[f](h)};return n?u=>c(Vn(e[0],e[i-1],u)):c}function vR(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=wa(0,t,r);e.push(ye(n,1,s))}}function wR(e){const t=[0];return vR(t,e.length-1),t}function bR(e,t){return e.map(n=>n*t)}function kR(e,t){return e.map(()=>t||jk).splice(0,e.length-1)}function Wo({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=NN(r)?r.map(yx):yx(r),i={done:!1,value:t[0]},o=bR(n&&n.length===t.length?n:wR(t),e),a=xR(o,t,{ease:Array.isArray(s)?s:kR(t,s)});return{calculatedDuration:e,next:l=>(i.value=a(l),i.done=l>=e,i)}}const _R=e=>e!==null;function Tu(e,{repeat:t,repeatType:n="loop"},r,s=1){const i=e.filter(_R),a=s<0||t&&n!=="loop"&&t%2===1?0:i.length-1;return!a||r===void 0?i[a]:r}const SR={decay:Ah,inertia:Ah,tween:Wo,keyframes:Wo,spring:Yc};function $k(e){typeof e.type=="string"&&(e.type=SR[e.type])}class Am{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const CR=e=>e/100;class qc extends Am{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var r,s;const{motionValue:n}=this.options;n&&n.updatedAt!==ct.now()&&this.tick(ct.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(r=this.options).onStop)==null||s.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;$k(t);const{type:n=Wo,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:o=0}=t;let{keyframes:a}=t;const l=n||Wo;l!==Wo&&typeof a[0]!="number"&&(this.mixKeyframes=Ra(CR,Dk(a[0],a[1])),a=[0,100]);const c=l({...t,keyframes:a});i==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...a].reverse(),velocity:-o})),c.calculatedDuration===null&&(c.calculatedDuration=Rm(c));const{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=c}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:s,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return r.next(0);const{delay:c=0,keyframes:u,repeat:f,repeatType:h,repeatDelay:p,type:m,onUpdate:g,finalKeyframe:w}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const y=this.currentTime-c*(this.playbackSpeed>=0?1:-1),x=this.playbackSpeed>=0?y<0:y>s;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let v=this.currentTime,k=r;if(f){const T=Math.min(this.currentTime,s)/a;let E=Math.floor(T),j=T%1;!j&&T>=1&&(j=1),j===1&&E--,E=Math.min(E,f+1),!!(E%2)&&(h==="reverse"?(j=1-j,p&&(j-=p/a)):h==="mirror"&&(k=o)),v=Vn(0,1,j)*a}let C;x?(this.delayState.value=u[0],C=this.delayState):C=k.next(v),i&&!x&&(C.value=i(C.value));let{done:S}=C;!x&&l!==null&&(S=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const P=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&S);return P&&m!==Ah&&(C.value=Tu(u,this.options,w,this.speed)),g&&g(C.value),P&&this.finish(),C}then(t,n){return this.finished.then(t,n)}get duration(){return Zt(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Zt(t)}get time(){return Zt(this.currentTime)}set time(t){t=$t(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const n=this.generator.next(t).value;return Ok(r=>this.generator.next(r).value,t,n)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(ct.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=Zt(this.currentTime))}play(){var s,i;if(this.isStopped)return;const{driver:t=lR,startTime:n}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),(i=(s=this.options).onPlay)==null||i.call(s);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(ct.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function jR(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const bs=e=>e*180/Math.PI,Ih=e=>{const t=bs(Math.atan2(e[1],e[0]));return Mh(t)},PR={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Ih,rotateZ:Ih,skewX:e=>bs(Math.atan(e[1])),skewY:e=>bs(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Mh=e=>(e=e%360,e<0&&(e+=360),e),Sx=Ih,Cx=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),jx=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),ER={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Cx,scaleY:jx,scale:e=>(Cx(e)+jx(e))/2,rotateX:e=>Mh(bs(Math.atan2(e[6],e[5]))),rotateY:e=>Mh(bs(Math.atan2(-e[2],e[0]))),rotateZ:Sx,rotate:Sx,skewX:e=>bs(Math.atan(e[4])),skewY:e=>bs(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Lh(e){return e.includes("scale")?1:0}function Dh(e,t){if(!e||e==="none")return Lh(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=ER,s=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=PR,s=a}if(!s)return Lh(t);const i=r[t],o=s[1].split(",").map(NR);return typeof i=="function"?i(o):o[i]}const TR=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Dh(n,t)};function NR(e){return parseFloat(e.trim())}const Gi=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ki=new Set([...Gi,"pathRotation"]),Px=e=>e===Hi||e===Y,RR=new Set(["x","y","z"]),AR=Gi.filter(e=>!RR.has(e));function IR(e){const t=[];return AR.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Dr={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:r})=>{const s=e.max-e.min;return r==="border-box"?s:s-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:r})=>{const s=e.max-e.min;return r==="border-box"?s:s-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Dh(t,"x"),y:(e,{transform:t})=>Dh(t,"y")};Dr.translateX=Dr.x;Dr.translateY=Dr.y;const Ps=new Set;let Fh=!1,Oh=!1,$h=!1;function zk(){if(Oh){const e=Array.from(Ps).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=IR(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([i,o])=>{var a;(a=r.getValue(i))==null||a.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Oh=!1,Fh=!1,Ps.forEach(e=>e.complete($h)),Ps.clear()}function Bk(){Ps.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Oh=!0)})}function MR(){$h=!0,Bk(),zk(),$h=!1}class Im{constructor(t,n,r,s,i,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=i,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(Ps.add(this),Fh||(Fh=!0,xe.read(Bk),xe.resolveKeyframes(zk))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;if(t[0]===null){const i=s==null?void 0:s.get(),o=t[t.length-1];if(i!==void 0)t[0]=i;else if(r&&n){const a=r.readValue(n,o);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=o),s&&i===void 0&&s.set(t[0])}jR(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Ps.delete(this)}cancel(){this.state==="scheduled"&&(Ps.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const LR=e=>e.startsWith("--");function Vk(e,t,n){LR(t)?e.style.setProperty(t,n):e.style[t]=n}const DR={};function Uk(e,t){const n=gk(e);return()=>DR[t]??n()}const FR=Uk(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Wk=Uk(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Ao=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Ex={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ao([0,.65,.55,1]),circOut:Ao([.55,0,1,.45]),backIn:Ao([.31,.01,.66,-.59]),backOut:Ao([.33,1.53,.69,.99])};function Hk(e,t){if(e)return typeof e=="function"?Wk()?Fk(e,t):"ease-out":Pk(e)?Ao(e):Array.isArray(e)?e.map(n=>Hk(n,t)||Ex.easeOut):Ex[e]}function OR(e,t,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:o="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[t]:n};l&&(u.offset=l);const f=Hk(a,s);Array.isArray(f)&&(u.easing=f);const h={delay:r,duration:s,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"};return c&&(h.pseudoElement=c),e.animate(u,h)}function Gk(e){return typeof e=="function"&&"applyToOptions"in e}function $R({type:e,...t}){return Gk(e)&&Wk()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class Kk extends Am{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:r,keyframes:s,pseudoElement:i,allowFlatten:o=!1,finalKeyframe:a,onComplete:l}=t;this.isPseudoElement=!!i,this.allowFlatten=o,this.options=t,_m(typeof t.type!="string");const c=$R(t);this.animation=OR(n,r,s,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const u=Tu(s,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(u),Vk(n,r,u),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,r,s;const t=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((s=(r=this.animation).commitStyles)==null||s.call(r))}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return Zt(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Zt(t)}get time(){return Zt(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=$t(t),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:r,observe:s}){var i;return this.allowFlatten&&((i=this.animation.effect)==null||i.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&FR()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),nn):s(this)}}const Yk={anticipate:_k,backInOut:kk,circInOut:Ck};function zR(e){return e in Yk}function BR(e){typeof e.ease=="string"&&zR(e.ease)&&(e.ease=Yk[e.ease])}const Bd=10;class VR extends Kk{constructor(t){BR(t),$k(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:s,element:i,...o}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new qc({...o,autoplay:!1}),l=Math.max(Bd,ct.now()-this.startTime),c=Vn(0,Bd,l-Bd),u=a.sample(l).value,{name:f}=this.options;i&&f&&Vk(i,f,u),n.setWithVelocity(a.sample(Math.max(0,l-c)).value,u,c),a.stop()}}const Tx=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(vn.test(e)||e==="0")&&!e.startsWith("url("));function UR(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function WR(e,t,n,r){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],o=Tx(s,t),a=Tx(i,t);return!o||!a?!1:UR(e)||(n==="spring"||Gk(n))&&r}function zh(e){e.duration=0,e.type="keyframes"}const qk=new Set(["opacity","clipPath","filter","transform"]),HR=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function GR(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&HR.test(e[t]))return!0;return!1}const KR=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),YR=gk(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function qR(e){var f;const{motionValue:t,name:n,repeatDelay:r,repeatType:s,damping:i,type:o,keyframes:a}=e;if(!(((f=t==null?void 0:t.owner)==null?void 0:f.current)instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=t.owner.getProps();return YR()&&n&&(qk.has(n)||KR.has(n)&&GR(a))&&(n!=="transform"||!u)&&!c&&!r&&s!=="mirror"&&i!==0&&o!=="inertia"}const QR=40;class XR extends Am{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o="loop",keyframes:a,name:l,motionValue:c,element:u,...f}){var m;super(),this.stop=()=>{var g,w;this._animation&&(this._animation.stop(),(g=this.stopTimeline)==null||g.call(this)),(w=this.keyframeResolver)==null||w.cancel()},this.createdAt=ct.now();const h={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:o,name:l,motionValue:c,element:u,...f},p=(u==null?void 0:u.KeyframeResolver)||Im;this.keyframeResolver=new p(a,(g,w,y)=>this.onKeyframesResolved(g,w,h,!y),l,c,u),(m=this.keyframeResolver)==null||m.scheduleResolve()}onKeyframesResolved(t,n,r,s){var y,x;this.keyframeResolver=void 0;const{name:i,type:o,velocity:a,delay:l,isHandoff:c,onUpdate:u}=r;this.resolvedAt=ct.now();let f=!0;WR(t,i,o,a)||(f=!1,(Qr.instantAnimations||!l)&&(u==null||u(Tu(t,r,n))),t[0]=t[t.length-1],zh(r),r.repeat=0);const p={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>QR?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},m=f&&!c&&qR(p),g=(x=(y=p.motionValue)==null?void 0:y.owner)==null?void 0:x.current;let w;if(m)try{w=new VR({...p,element:g})}catch{w=new qc(p)}else w=new qc(p);w.finished.then(()=>{this.notifyFinished()}).catch(nn),this.pendingTimeline&&(this.stopTimeline=w.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=w}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),MR()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}function Qk(e,t,n,r=0,s=1){const i=Array.from(e).sort((c,u)=>c.sortNodePosition(u)).indexOf(t),o=e.size,a=(o-1)*r;return typeof n=="function"?n(i,o):s===1?i*r:a-i*r}const Nx=30,JR=e=>!isNaN(parseFloat(e));class ZR{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const s=ct.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((i=this.events.change)==null||i.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=ct.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=JR(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Sm);const r=this.events[t].add(n);return t==="change"?()=>{r(),xe.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=ct.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Nx)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Nx);return yk(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function $i(e,t){return new ZR(e,t)}function Xk(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function Mm(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?Xk(n,e):n}const eA={type:"spring",stiffness:500,damping:25,restSpeed:10},tA=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),nA={type:"keyframes",duration:.8},rA={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},sA=(e,{keyframes:t})=>t.length>2?nA:Ki.has(e)?e.startsWith("scale")?tA(t[1]):eA:rA,iA=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function oA(e){for(const t in e)if(!iA.has(t))return!0;return!1}const Lm=(e,t,n,r={},s,i)=>o=>{const a=Mm(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-$t(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:h=>{t.set(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:i?void 0:s};oA(a)||Object.assign(u,sA(e,u)),u.duration&&(u.duration=$t(u.duration)),u.repeatDelay&&(u.repeatDelay=$t(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let f=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(zh(u),u.delay===0&&(f=!0)),(Qr.instantAnimations||Qr.skipAnimations||s!=null&&s.shouldSkipAnimations||a.skipAnimations)&&(f=!0,zh(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,f&&!i&&t.get()!==void 0){const h=Tu(u.keyframes,a);if(h!==void 0){xe.update(()=>{u.onUpdate(h),u.onComplete()});return}}return a.isSync?new qc(u):new XR(u)},aA=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function lA(e){const t=aA.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function Jk(e,t,n=1){const[r,s]=lA(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const o=i.trim();return hk(o)?parseFloat(o):o}return Pm(s)?Jk(s,t,n+1):s}function Rx(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Dm(e,t,n,r){if(typeof t=="function"){const[s,i]=Rx(r);t=t(n!==void 0?n:e.custom,s,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,i]=Rx(r);t=t(n!==void 0?n:e.custom,s,i)}return t}function Es(e,t,n){const r=e.getProps();return Dm(r,t,n!==void 0?n:r.custom,e)}const Zk=new Set(["width","height","top","left","right","bottom",...Gi]),Bh=e=>Array.isArray(e);function cA(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,$i(n))}function uA(e){return Bh(e)?e[e.length-1]||0:e}function dA(e,t){const n=Es(e,t);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const a=uA(i[o]);cA(e,o,a)}}const Xe=e=>!!(e&&e.getVelocity);function fA(e){return!!(Xe(e)&&e.add)}function Vh(e,t){const n=e.getValue("willChange");if(fA(n))return n.add(t);if(!n&&Qr.WillChange){const r=new Qr.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Fm(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const hA="framerAppearId",e_="data-"+Fm(hA);function t_(e){return e.props[e_]}function pA({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function n_(e,t,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i,transitionEnd:o,...a}=t;const l=e.getDefaultTransition();i=i?Xk(i,l):l;const c=i==null?void 0:i.reduceMotion,u=i==null?void 0:i.skipAnimations;r&&(i=r);const f=[],h=s&&e.animationState&&e.animationState.getState()[s],p=i==null?void 0:i.path;p&&p.animateVisualElement(e,a,i,n,f);for(const m in a){const g=e.getValue(m,e.latestValues[m]??null),w=a[m];if(w===void 0||h&&pA(h,m))continue;const y={delay:n,...Mm(i||{},m)};u&&(y.skipAnimations=!0);const x=g.get();if(x!==void 0&&!g.isAnimating()&&!Array.isArray(w)&&w===x&&!y.velocity){xe.update(()=>g.set(w));continue}let v=!1;if(window.MotionHandoffAnimation){const S=t_(e);if(S){const P=window.MotionHandoffAnimation(S,m,xe);P!==null&&(y.startTime=P,v=!0)}}Vh(e,m);const k=c??e.shouldReduceMotion;g.start(Lm(m,g,w,k&&Zk.has(m)?{type:!1}:y,e,v));const C=g.animation;C&&f.push(C)}if(o){const m=()=>xe.update(()=>{o&&dA(e,o)});f.length?Promise.all(f).then(m):m()}return f}function Uh(e,t,n={}){var l;const r=Es(e,t,n.type==="exit"?(l=e.presenceContext)==null?void 0:l.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const i=r?()=>Promise.all(n_(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:f,staggerDirection:h}=s;return mA(e,t,c,u,f,h,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[c,u]=a==="beforeChildren"?[i,o]:[o,i];return c().then(()=>u())}else return Promise.all([i(),o(n.delay)])}function mA(e,t,n=0,r=0,s=0,i=1,o){const a=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),a.push(Uh(l,t,{...o,delay:n+(typeof r=="function"?0:r)+Qk(e.variantChildren,l,r,s,i)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(a)}function gA(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(i=>Uh(e,i,n));r=Promise.all(s)}else if(typeof t=="string")r=Uh(e,t,n);else{const s=typeof t=="function"?Es(e,t,n.custom):t;r=Promise.all(n_(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const yA={test:e=>e==="auto",parse:e=>e},r_=e=>t=>t.test(e),s_=[Hi,Y,Bn,Qn,UN,VN,yA],Ax=e=>s_.find(r_(e));function xA(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||mk(e):!0}const vA=new Set(["brightness","contrast","saturate","opacity"]);function wA(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Em)||[];if(!r)return e;const s=n.replace(r,"");let i=vA.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+s+")"}const bA=/\b([a-z-]*)\(.*?\)/gu,Wh={...vn,getAnimatableNone:e=>{const t=e.match(bA);return t?t.map(wA).join(" "):e}},Hh={...vn,getAnimatableNone:e=>{const t=vn.parse(e);return vn.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},Ix={...Hi,transform:Math.round},kA={rotate:Qn,pathRotation:Qn,rotateX:Qn,rotateY:Qn,rotateZ:Qn,scale:vl,scaleX:vl,scaleY:vl,scaleZ:vl,skew:Qn,skewX:Qn,skewY:Qn,distance:Y,translateX:Y,translateY:Y,translateZ:Y,x:Y,y:Y,z:Y,perspective:Y,transformPerspective:Y,opacity:ba,originX:vx,originY:vx,originZ:Y},Qc={borderWidth:Y,borderTopWidth:Y,borderRightWidth:Y,borderBottomWidth:Y,borderLeftWidth:Y,borderRadius:Y,borderTopLeftRadius:Y,borderTopRightRadius:Y,borderBottomRightRadius:Y,borderBottomLeftRadius:Y,width:Y,maxWidth:Y,height:Y,maxHeight:Y,top:Y,right:Y,bottom:Y,left:Y,inset:Y,insetBlock:Y,insetBlockStart:Y,insetBlockEnd:Y,insetInline:Y,insetInlineStart:Y,insetInlineEnd:Y,padding:Y,paddingTop:Y,paddingRight:Y,paddingBottom:Y,paddingLeft:Y,paddingBlock:Y,paddingBlockStart:Y,paddingBlockEnd:Y,paddingInline:Y,paddingInlineStart:Y,paddingInlineEnd:Y,margin:Y,marginTop:Y,marginRight:Y,marginBottom:Y,marginLeft:Y,marginBlock:Y,marginBlockStart:Y,marginBlockEnd:Y,marginInline:Y,marginInlineStart:Y,marginInlineEnd:Y,fontSize:Y,backgroundPositionX:Y,backgroundPositionY:Y,...kA,zIndex:Ix,fillOpacity:ba,strokeOpacity:ba,numOctaves:Ix},_A={...Qc,color:$e,backgroundColor:$e,outlineColor:$e,fill:$e,stroke:$e,borderColor:$e,borderTopColor:$e,borderRightColor:$e,borderBottomColor:$e,borderLeftColor:$e,filter:Wh,WebkitFilter:Wh,mask:Hh,WebkitMask:Hh},i_=e=>_A[e],SA=new Set([Wh,Hh]);function o_(e,t){let n=i_(e);return SA.has(n)||(n=vn),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const CA=new Set(["auto","none","0"]);function jA(e,t,n){let r=0,s;for(;r<e.length&&!s;){const i=e[r];typeof i=="string"&&!CA.has(i)&&Oi(i).values.length&&(s=e[r]),r++}if(s&&n)for(const i of t)e[i]=o_(n,s)}class PA extends Im{constructor(t,n,r,s,i){super(t,n,r,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let u=0;u<t.length;u++){let f=t[u];if(typeof f=="string"&&(f=f.trim(),Pm(f))){const h=Jk(f,n.current);h!==void 0&&(t[u]=h),u===t.length-1&&(this.finalKeyframe=f)}}if(this.resolveNoneKeyframes(),!Zk.has(r)||t.length!==2)return;const[s,i]=t,o=Ax(s),a=Ax(i),l=xx(s),c=xx(i);if(l!==c&&Dr[r]){this.needsMeasurement=!0;return}if(o!==a)if(Px(o)&&Px(a))for(let u=0;u<t.length;u++){const f=t[u];typeof f=="string"&&(t[u]=parseFloat(f))}else Dr[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)(t[s]===null||xA(t[s]))&&r.push(s);r.length&&jA(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Dr[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(r,s).jump(s,!1)}measureEndState(){var a;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const s=t.getValue(n);s&&s.jump(this.measuredOrigin,!1);const i=r.length-1,o=r[i];r[i]=Dr[n](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([l,c])=>{t.getValue(l).set(c)}),this.resolveNoneKeyframes()}}function a_(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const s=(n==null?void 0:n[e])??r.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e).filter(r=>r!=null)}const Gh=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function tc(e){return pk(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:Om}=Ek(queueMicrotask,!1),hn={x:!1,y:!1};function l_(){return hn.x||hn.y}function EA(e){return e==="x"||e==="y"?hn[e]?null:(hn[e]=!0,()=>{hn[e]=!1}):hn.x||hn.y?null:(hn.x=hn.y=!0,()=>{hn.x=hn.y=!1})}function c_(e,t){const n=a_(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function TA(e){return!(e.pointerType==="touch"||l_())}function NA(e,t,n={}){const[r,s,i]=c_(e,n);return r.forEach(o=>{let a=!1,l=!1,c;const u=()=>{o.removeEventListener("pointerleave",m)},f=w=>{c&&(c(w),c=void 0),u()},h=w=>{a=!1,window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h),l&&(l=!1,f(w))},p=()=>{a=!0,window.addEventListener("pointerup",h,s),window.addEventListener("pointercancel",h,s)},m=w=>{if(w.pointerType!=="touch"){if(a){l=!0;return}f(w)}},g=w=>{if(!TA(w))return;l=!1;const y=t(o,w);typeof y=="function"&&(c=y,o.addEventListener("pointerleave",m,s))};o.addEventListener("pointerenter",g,s),o.addEventListener("pointerdown",p,s)}),i}const u_=(e,t)=>t?e===t?!0:u_(e,t.parentElement):!1,$m=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,RA=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function AA(e){return RA.has(e.tagName)||e.isContentEditable===!0}const IA=new Set(["INPUT","SELECT","TEXTAREA"]);function MA(e){return IA.has(e.tagName)||e.isContentEditable===!0}const nc=new WeakSet;function Mx(e){return t=>{t.key==="Enter"&&e(t)}}function Vd(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const LA=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Mx(()=>{if(nc.has(n))return;Vd(n,"down");const s=Mx(()=>{Vd(n,"up")}),i=()=>Vd(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function Lx(e){return $m(e)&&!l_()}const Dx=new WeakSet;function DA(e,t,n={}){const[r,s,i]=c_(e,n),o=a=>{const l=a.currentTarget;if(!Lx(a)||Dx.has(a))return;nc.add(l),n.stopPropagation&&Dx.add(a);const c=t(l,a),u=(p,m)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),nc.has(l)&&nc.delete(l),Lx(p)&&typeof c=="function"&&c(p,{success:m})},f=p=>{u(p,l===window||l===document||n.useGlobalTarget||u_(l,p.target))},h=p=>{u(p,!1)};window.addEventListener("pointerup",f,s),window.addEventListener("pointercancel",h,s)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,s),tc(a)&&(a.addEventListener("focus",c=>LA(c,s)),!AA(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),i}function zm(e){return pk(e)&&"ownerSVGElement"in e}const rc=new WeakMap;let br;const d_=(e,t,n)=>(r,s)=>s&&s[0]?s[0][e+"Size"]:zm(r)&&"getBBox"in r?r.getBBox()[t]:r[n],FA=d_("inline","width","offsetWidth"),OA=d_("block","height","offsetHeight");function $A({target:e,borderBoxSize:t}){var n;(n=rc.get(e))==null||n.forEach(r=>{r(e,{get width(){return FA(e,t)},get height(){return OA(e,t)}})})}function zA(e){e.forEach($A)}function BA(){typeof ResizeObserver>"u"||(br=new ResizeObserver(zA))}function VA(e,t){br||BA();const n=a_(e);return n.forEach(r=>{let s=rc.get(r);s||(s=new Set,rc.set(r,s)),s.add(t),br==null||br.observe(r)}),()=>{n.forEach(r=>{const s=rc.get(r);s==null||s.delete(t),s!=null&&s.size||br==null||br.unobserve(r)})}}const sc=new Set;let pi;function UA(){pi=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};sc.forEach(t=>t(e))},window.addEventListener("resize",pi)}function WA(e){return sc.add(e),pi||UA(),()=>{sc.delete(e),!sc.size&&typeof pi=="function"&&(window.removeEventListener("resize",pi),pi=void 0)}}function Fx(e,t){return typeof e=="function"?WA(e):VA(e,t)}function HA(e){return zm(e)&&e.tagName==="svg"}const GA=[...s_,$e,vn],KA=e=>GA.find(r_(e)),Ox=()=>({translate:0,scale:1,origin:0,originPoint:0}),mi=()=>({x:Ox(),y:Ox()}),$x=()=>({min:0,max:0}),Be=()=>({x:$x(),y:$x()}),YA=new WeakMap;function Nu(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function ka(e){return typeof e=="string"||Array.isArray(e)}const Bm=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Vm=["initial",...Bm];function Ru(e){return Nu(e.animate)||Vm.some(t=>ka(e[t]))}function f_(e){return!!(Ru(e)||e.variants)}function qA(e,t,n){for(const r in t){const s=t[r],i=n[r];if(Xe(s))e.addValue(r,s);else if(Xe(i))e.addValue(r,$i(s,{owner:e}));else if(i!==s)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=e.getStaticValue(r);e.addValue(r,$i(o!==void 0?o:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Xc={current:null},Um={current:!1},QA=typeof window<"u";function h_(){if(Um.current=!0,!!QA)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Xc.current=e.matches;e.addEventListener("change",t),t()}else Xc.current=!1}const zx=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Jc={};function p_(e){Jc=e}function XA(){return Jc}class JA{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,skipAnimations:i,blockInitialAnimation:o,visualState:a},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Im,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=ct.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,xe.render(this.render,!1,!0))};const{latestValues:c,renderState:u}=a;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=u,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=i,this.options=l,this.blockInitialAnimation=!!o,this.isControllingVariants=Ru(n),this.isVariantNode=f_(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:f,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in h){const m=h[p];c[p]!==void 0&&Xe(m)&&m.set(c[p])}}mount(t){var n,r;if(this.hasBeenMounted)for(const s in this.initialValues)(n=this.values.get(s))==null||n.jump(this.initialValues[s]),this.latestValues[s]=this.initialValues[s];this.current=t,YA.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((s,i)=>this.bindToMotionValue(i,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Um.current||h_(),this.shouldReduceMotion=Xc.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),Xr(this.notifyUpdate),Xr(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&qk.has(t)&&this.current instanceof HTMLElement){const{factory:o,keyframes:a,times:l,ease:c,duration:u}=n.accelerate,f=new Kk({element:this.current,name:t,keyframes:a,times:l,ease:c,duration:$t(u)}),h=o(f);this.valueSubscriptions.set(t,()=>{h(),f.cancel()});return}const r=Ki.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&xe.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;typeof window<"u"&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),i&&i()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Jc){const n=Jc[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Be()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<zx.length;r++){const s=zx[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const i="on"+s,o=t[i];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=qA(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=$i(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(hk(r)||mk(r))?r=parseFloat(r):!KA(r)&&vn.test(n)&&(r=o_(t,n)),this.setBaseTarget(t,Xe(r)?r.get():r)),Xe(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var i;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=Dm(this.props,n,(i=this.presenceContext)==null?void 0:i.custom);o&&(r=o[t])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!Xe(s)?s:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Sm),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Om.render(this.render)}}class m_ extends JA{constructor(){super(...arguments),this.KeyframeResolver=PA}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const r=t.style;return r?r[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Xe(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class ts{constructor(t){this.isMounted=!1,this.node=t}update(){}}function g_({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function ZA({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function eI(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Ud(e){return e===void 0||e===1}function Kh({scale:e,scaleX:t,scaleY:n}){return!Ud(e)||!Ud(t)||!Ud(n)}function ps(e){return Kh(e)||y_(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function y_(e){return Bx(e.x)||Bx(e.y)}function Bx(e){return e&&e!=="0%"}function Zc(e,t,n){const r=e-n,s=t*r;return n+s}function Vx(e,t,n,r,s){return s!==void 0&&(e=Zc(e,s,r)),Zc(e,n,r)+t}function Yh(e,t=0,n=1,r,s){e.min=Vx(e.min,t,n,r,s),e.max=Vx(e.max,t,n,r,s)}function x_(e,{x:t,y:n}){Yh(e.x,t.translate,t.scale,t.originPoint),Yh(e.y,n.translate,n.scale,n.originPoint)}const Ux=.999999999999,Wx=1.0000000000001;function tI(e,t,n,r=!1){var a;const s=n.length;if(!s)return;t.x=t.y=1;let i,o;for(let l=0;l<s;l++){i=n[l],o=i.projectionDelta;const{visualElement:c}=i.options;c&&c.props.style&&c.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&(Ln(e.x,-i.scroll.offset.x),Ln(e.y,-i.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,x_(e,o)),r&&ps(i.latestValues)&&ic(e,i.latestValues,(a=i.layout)==null?void 0:a.layoutBox))}t.x<Wx&&t.x>Ux&&(t.x=1),t.y<Wx&&t.y>Ux&&(t.y=1)}function Ln(e,t){e.min+=t,e.max+=t}function Hx(e,t,n,r,s=.5){const i=ye(e.min,e.max,s);Yh(e,t,n,i,r)}function Gx(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function ic(e,t,n){const r=n??e;Hx(e.x,Gx(t.x,r.x),t.scaleX,t.scale,t.originX),Hx(e.y,Gx(t.y,r.y),t.scaleY,t.scale,t.originY)}function v_(e,t){return g_(eI(e.getBoundingClientRect(),t))}function nI(e,t,n){const r=v_(e,n),{scroll:s}=t;return s&&(Ln(r.x,s.offset.x),Ln(r.y,s.offset.y)),r}const rI={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},sI=Gi.length;function iI(e,t,n){let r="",s=!0;for(let o=0;o<sI;o++){const a=Gi[o],l=e[a];if(l===void 0)continue;let c=!0;if(typeof l=="number")c=l===(a.startsWith("scale")?1:0);else{const u=parseFloat(l);c=a.startsWith("scale")?u===1:u===0}if(!c||n){const u=Gh(l,Qc[a]);if(!c){s=!1;const f=rI[a]||a;r+=`${f}(${u}) `}n&&(t[a]=u)}}const i=e.pathRotation;return i&&(s=!1,r+=`rotate(${Gh(i,Qc.pathRotation)}) `),r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function Wm(e,t,n){const{style:r,vars:s,transformOrigin:i}=e;let o=!1,a=!1;for(const l in t){const c=t[l];if(Ki.has(l)){o=!0;continue}else if(Nk(l)){s[l]=c;continue}else{const u=Gh(c,Qc[l]);l.startsWith("origin")?(a=!0,i[l]=u):r[l]=u}}if(t.transform||(o||n?r.transform=iI(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=i;r.transformOrigin=`${l} ${c} ${u}`}}function w_(e,{style:t,vars:n},r,s){const i=e.style;let o;for(o in t)i[o]=t[o];s==null||s.applyProjectionStyles(i,r);for(o in n)i.setProperty(o,n[o])}function Kx(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const bo={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Y.test(e))e=parseFloat(e);else return e;const n=Kx(e,t.target.x),r=Kx(e,t.target.y);return`${n}% ${r}%`}},oI={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=vn.parse(e);if(s.length>5)return r;const i=vn.createTransformer(e),o=typeof s[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;s[0+o]/=a,s[1+o]/=l;const c=ye(a,l,.5);return typeof s[2+o]=="number"&&(s[2+o]/=c),typeof s[3+o]=="number"&&(s[3+o]/=c),i(s)}},qh={borderRadius:{...bo,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:bo,borderTopRightRadius:bo,borderBottomLeftRadius:bo,borderBottomRightRadius:bo,boxShadow:oI};function b_(e,{layout:t,layoutId:n}){return Ki.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!qh[e]||e==="opacity")}function Hm(e,t,n){var o;const r=e.style,s=t==null?void 0:t.style,i={};if(!r)return i;for(const a in r)(Xe(r[a])||s&&Xe(s[a])||b_(a,e)||((o=n==null?void 0:n.getValue(a))==null?void 0:o.liveStyle)!==void 0)&&(i[a]=r[a]);return i}function aI(e){return window.getComputedStyle(e)}class lI extends m_{constructor(){super(...arguments),this.type="html",this.renderInstance=w_}readValueFromInstance(t,n){var r;if(Ki.has(n))return(r=this.projection)!=null&&r.isProjecting?Lh(n):TR(t,n);{const s=aI(t),i=(Nk(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return v_(t,n)}build(t,n,r){Wm(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Hm(t,n,r)}}const cI={offset:"stroke-dashoffset",array:"stroke-dasharray"},uI={offset:"strokeDashoffset",array:"strokeDasharray"};function dI(e,t,n=1,r=0,s=!0){e.pathLength=1;const i=s?cI:uI;e[i.offset]=`${-r}`,e[i.array]=`${t} ${n}`}const fI=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function k_(e,{attrX:t,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:o=0,...a},l,c,u){if(Wm(e,a,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:h}=e;f.transform&&(h.transform=f.transform,delete f.transform),(h.transform||f.transformOrigin)&&(h.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),h.transform&&(h.transformBox=(u==null?void 0:u.transformBox)??"fill-box",delete f.transformBox);for(const p of fI)f[p]!==void 0&&(h[p]=f[p],delete f[p]);t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),s!==void 0&&dI(f,s,i,o,!1)}const __=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),S_=e=>typeof e=="string"&&e.toLowerCase()==="svg";function hI(e,t,n,r){w_(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(__.has(s)?s:Fm(s),t.attrs[s])}function C_(e,t,n){const r=Hm(e,t,n);for(const s in e)if(Xe(e[s])||Xe(t[s])){const i=Gi.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=e[s]}return r}class pI extends m_{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Be}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Ki.has(n)){const r=i_(n);return r&&r.default||0}return n=__.has(n)?n:Fm(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return C_(t,n,r)}build(t,n,r){k_(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,s){hI(t,n,r,s)}mount(t){this.isSVGTag=S_(t.tagName),super.mount(t)}}const mI=Vm.length;function j_(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?j_(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<mI;n++){const r=Vm[n],s=e.props[r];(ka(s)||s===!1)&&(t[r]=s)}return t}function P_(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const gI=[...Bm].reverse(),yI=Bm.length;function xI(e){return t=>Promise.all(t.map(({animation:n,options:r})=>gA(e,n,r)))}function vI(e){let t=xI(e),n=Yx(),r=!0,s=!1;const i=c=>(u,f)=>{var p;const h=Es(e,f,c==="exit"?(p=e.presenceContext)==null?void 0:p.custom:void 0);if(h){const{transition:m,transitionEnd:g,...w}=h;u={...u,...w,...g}}return u};function o(c){t=c(e)}function a(c){const{props:u}=e,f=j_(e.parent)||{},h=[],p=new Set;let m={},g=1/0;for(let y=0;y<yI;y++){const x=gI[y],v=n[x],k=u[x]!==void 0?u[x]:f[x],C=ka(k),S=x===c?v.isActive:null;S===!1&&(g=y);let P=k===f[x]&&k!==u[x]&&C;if(P&&(r||s)&&e.manuallyAnimateOnMount&&(P=!1),v.protectedKeys={...m},!v.isActive&&S===null||!k&&!v.prevProp||Nu(k)||typeof k=="boolean")continue;if(x==="exit"&&v.isActive&&S!==!0){v.prevResolvedValues&&(m={...m,...v.prevResolvedValues});continue}const T=wI(v.prevProp,k);let E=T||x===c&&v.isActive&&!P&&C||y>g&&C,j=!1;const R=Array.isArray(k)?k:[k];let I=R.reduce(i(x),{});S===!1&&(I={});const{prevResolvedValues:D={}}=v,$={...D,...I},A=L=>{E=!0,p.has(L)&&(j=!0,p.delete(L)),v.needsAnimating[L]=!0;const V=e.getValue(L);V&&(V.liveStyle=!1)};for(const L in $){const V=I[L],_=D[L];if(m.hasOwnProperty(L))continue;let B=!1;Bh(V)&&Bh(_)?B=!P_(V,_)||T:B=V!==_,B?V!=null?A(L):p.add(L):V!==void 0&&p.has(L)?A(L):v.protectedKeys[L]=!0}v.prevProp=k,v.prevResolvedValues=I,v.isActive&&(m={...m,...I}),(r||s)&&e.blockInitialAnimation&&(E=!1);const z=P&&T;E&&(!z||j)&&h.push(...R.map(L=>{const V={type:x};if(typeof L=="string"&&(r||s)&&!z&&e.manuallyAnimateOnMount&&e.parent){const{parent:_}=e,B=Es(_,L);if(_.enteringChildren&&B){const{delayChildren:q}=B.transition||{};V.delay=Qk(_.enteringChildren,e,q)}}return{animation:L,options:V}}))}if(p.size){const y={};if(typeof u.initial!="boolean"){const x=Es(e,Array.isArray(u.initial)?u.initial[0]:u.initial);x&&x.transition&&(y.transition=x.transition)}p.forEach(x=>{const v=e.getBaseTarget(x),k=e.getValue(x);k&&(k.liveStyle=!0),y[x]=v??null}),h.push({animation:y})}let w=!!h.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(w=!1),r=!1,s=!1,w?t(h):Promise.resolve()}function l(c,u){var h;if(n[c].isActive===u)return Promise.resolve();(h=e.variantChildren)==null||h.forEach(p=>{var m;return(m=p.animationState)==null?void 0:m.setActive(c,u)}),n[c].isActive=u;const f=a(c);for(const p in n)n[p].protectedKeys={};return f}return{animateChanges:a,setActive:l,setAnimateFunction:o,getState:()=>n,reset:()=>{n=Yx(),s=!0}}}function wI(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!P_(t,e):!1}function os(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Yx(){return{animate:os(!0),whileInView:os(),whileHover:os(),whileTap:os(),whileDrag:os(),whileFocus:os(),exit:os()}}function Qh(e,t){e.min=t.min,e.max=t.max}function un(e,t){Qh(e.x,t.x),Qh(e.y,t.y)}function qx(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const E_=1e-4,bI=1-E_,kI=1+E_,T_=.01,_I=0-T_,SI=0+T_;function ut(e){return e.max-e.min}function CI(e,t,n){return Math.abs(e-t)<=n}function Qx(e,t,n,r=.5){e.origin=r,e.originPoint=ye(t.min,t.max,e.origin),e.scale=ut(n)/ut(t),e.translate=ye(n.min,n.max,e.origin)-e.originPoint,(e.scale>=bI&&e.scale<=kI||isNaN(e.scale))&&(e.scale=1),(e.translate>=_I&&e.translate<=SI||isNaN(e.translate))&&(e.translate=0)}function Ho(e,t,n,r){Qx(e.x,t.x,n.x,r?r.originX:void 0),Qx(e.y,t.y,n.y,r?r.originY:void 0)}function Xx(e,t,n,r=0){const s=r?ye(n.min,n.max,r):n.min;e.min=s+t.min,e.max=e.min+ut(t)}function jI(e,t,n,r){Xx(e.x,t.x,n.x,r==null?void 0:r.x),Xx(e.y,t.y,n.y,r==null?void 0:r.y)}function Jx(e,t,n,r=0){const s=r?ye(n.min,n.max,r):n.min;e.min=t.min-s,e.max=e.min+ut(t)}function eu(e,t,n,r){Jx(e.x,t.x,n.x,r==null?void 0:r.x),Jx(e.y,t.y,n.y,r==null?void 0:r.y)}function Zx(e,t,n,r,s){return e-=t,e=Zc(e,1/n,r),s!==void 0&&(e=Zc(e,1/s,r)),e}function PI(e,t=0,n=1,r=.5,s,i=e,o=e){if(Bn.test(t)&&(t=parseFloat(t),t=ye(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=ye(i.min,i.max,r);e===i&&(a-=t),e.min=Zx(e.min,t,n,a,s),e.max=Zx(e.max,t,n,a,s)}function ev(e,t,[n,r,s],i,o){PI(e,t[n],t[r],t[s],t.scale,i,o)}const EI=["x","scaleX","originX"],TI=["y","scaleY","originY"];function tv(e,t,n,r){ev(e.x,t,EI,n?n.x:void 0,r?r.x:void 0),ev(e.y,t,TI,n?n.y:void 0,r?r.y:void 0)}function nv(e){return e.translate===0&&e.scale===1}function N_(e){return nv(e.x)&&nv(e.y)}function rv(e,t){return e.min===t.min&&e.max===t.max}function NI(e,t){return rv(e.x,t.x)&&rv(e.y,t.y)}function sv(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function R_(e,t){return sv(e.x,t.x)&&sv(e.y,t.y)}function iv(e){return ut(e.x)/ut(e.y)}function ov(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function An(e){return[e("x"),e("y")]}function RI(e,t,n){let r="";const s=e.x.translate/t.x,i=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((s||i||o)&&(r=`translate3d(${s}px, ${i}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:u,pathRotation:f,rotateX:h,rotateY:p,skewX:m,skewY:g}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),f&&(r+=`rotate(${f}deg) `),h&&(r+=`rotateX(${h}deg) `),p&&(r+=`rotateY(${p}deg) `),m&&(r+=`skewX(${m}deg) `),g&&(r+=`skewY(${g}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const A_=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],AI=A_.length,av=e=>typeof e=="string"?parseFloat(e):e,lv=e=>typeof e=="number"||Y.test(e);function II(e,t,n,r,s,i){s?(e.opacity=ye(0,n.opacity??1,MI(r)),e.opacityExit=ye(t.opacity??1,0,LI(r))):i&&(e.opacity=ye(t.opacity??1,n.opacity??1,r));for(let o=0;o<AI;o++){const a=A_[o];let l=cv(t,a),c=cv(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||lv(l)===lv(c)?(e[a]=Math.max(ye(av(l),av(c),r),0),(Bn.test(c)||Bn.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=ye(t.rotate||0,n.rotate||0,r))}function cv(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const MI=I_(0,.5,Sk),LI=I_(.5,.95,nn);function I_(e,t,n){return r=>r<e?0:r>t?1:n(wa(e,t,r))}function DI(e,t,n){const r=Xe(e)?e:$i(e);return r.start(Lm("",r,t,n)),r.animation}function _a(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const FI=(e,t)=>e.depth-t.depth;class OI{constructor(){this.children=[],this.isDirty=!1}add(t){km(this.children,t),this.isDirty=!0}remove(t){Hc(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(FI),this.isDirty=!1,this.children.forEach(t)}}function $I(e,t){const n=ct.now(),r=({timestamp:s})=>{const i=s-n;i>=t&&(Xr(r),e(i-t))};return xe.setup(r,!0),()=>Xr(r)}function oc(e){return Xe(e)?e.get():e}class zI{constructor(){this.members=[]}add(t){km(this.members,t);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===t||r===this.lead||r===this.prevLead)continue;const s=r.instance;(!s||s.isConnected===!1)&&!r.snapshot&&(Hc(this.members,r),r.unmount())}t.scheduleRender()}remove(t){if(Hc(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){var n;for(let r=this.members.indexOf(t)-1;r>=0;r--){const s=this.members[r];if(s.isPresent!==!1&&((n=s.instance)==null?void 0:n.isConnected)!==!1)return this.promote(s),!0}return!1}promote(t,n){var s;const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.updateSnapshot(),t.scheduleRender();const{layoutDependency:i}=r.options,{layoutDependency:o}=t.options;(i===void 0||i!==o)&&(t.resumeFrom=r,n&&(r.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),(s=t.root)!=null&&s.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var n,r,s,i,o;(r=(n=t.options).onExitComplete)==null||r.call(n),(o=(s=t.resumingFrom)==null?void 0:(i=s.options).onExitComplete)==null||o.call(i)})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){var t;(t=this.lead)!=null&&t.snapshot&&(this.lead.snapshot=void 0)}}const ac={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Wd=["","X","Y","Z"],BI=1e3;let VI=0;function Hd(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function M_(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=t_(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",xe,!(s||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&M_(r)}function L_({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},a=t==null?void 0:t()){this.id=VI++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(HI),this.nodes.forEach(XI),this.nodes.forEach(JI),this.nodes.forEach(GI)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new OI)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Sm),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=zm(o)&&!HA(o),this.instance=o;const{layoutId:a,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),e){let u,f=0;const h=()=>this.root.updateBlockedByResize=!1;xe.read(()=>{f=window.innerWidth}),e(o,()=>{const p=window.innerWidth;p!==f&&(f=p,this.root.updateBlockedByResize=!0,u&&u(),u=$I(h,250),ac.hasAnimatedSinceResize&&(ac.hasAnimatedSinceResize=!1,this.nodes.forEach(fv)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:f,hasRelativeLayoutChanged:h,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||c.getDefaultTransition()||rM,{onLayoutAnimationStart:g,onLayoutAnimationComplete:w}=c.getProps(),y=!this.targetLayout||!R_(this.targetLayout,p),x=!f&&h;if(this.options.layoutRoot||this.resumeFrom||x||f&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const v={...Mm(m,"layout"),onPlay:g,onComplete:w};(c.shouldReduceMotion||this.options.layoutRoot)&&(v.delay=0,v.type=!1),this.startAnimation(v),this.setAnimationOrigin(u,x,v.path)}else f||fv(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Xr(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(ZI),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&M_(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const f=this.path[u];f.shouldResetTransform=!0,(typeof f.latestValues.x=="string"||typeof f.latestValues.y=="string")&&(f.isLayoutDirty=!0),f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const l=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),l&&this.nodes.forEach(YI),this.nodes.forEach(uv);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(dv);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(qI),this.nodes.forEach(QI),this.nodes.forEach(UI),this.nodes.forEach(WI)):this.nodes.forEach(dv),this.clearAllSnapshots();const a=ct.now();Qe.delta=Vn(0,1e3/60,a-Qe.timestamp),Qe.timestamp=a,Qe.isProcessing=!0,Dd.update.process(Qe),Dd.preRender.process(Qe),Dd.render.process(Qe),Qe.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Om.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(KI),this.sharedNodes.forEach(eM)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,xe.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){xe.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ut(this.snapshot.measuredBox.x)&&!ut(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=Be()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a&&this.instance){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!N_(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;o&&this.instance&&(a||ps(this.latestValues)||u)&&(s(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),sM(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var c;const{visualElement:o}=this.options;if(!o)return Be();const a=o.measureViewportBox();if(!(((c=this.scroll)==null?void 0:c.wasRoot)||this.path.some(iM))){const{scroll:u}=this.root;u&&(Ln(a.x,u.offset.x),Ln(a.y,u.offset.y))}return a}removeElementScroll(o){var l;const a=Be();if(un(a,o),(l=this.scroll)!=null&&l.wasRoot)return a;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:f,options:h}=u;u!==this.root&&f&&h.layoutScroll&&(f.wasRoot&&un(a,o),Ln(a.x,f.offset.x),Ln(a.y,f.offset.y))}return a}applyTransform(o,a=!1,l){var u,f;const c=l||Be();un(c,o);for(let h=0;h<this.path.length;h++){const p=this.path[h];!a&&p.options.layoutScroll&&p.scroll&&p!==p.root&&(Ln(c.x,-p.scroll.offset.x),Ln(c.y,-p.scroll.offset.y)),ps(p.latestValues)&&ic(c,p.latestValues,(u=p.layout)==null?void 0:u.layoutBox)}return ps(this.latestValues)&&ic(c,this.latestValues,(f=this.layout)==null?void 0:f.layoutBox),c}removeTransform(o){var l;const a=Be();un(a,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!ps(u.latestValues))continue;let f;u.instance&&(Kh(u.latestValues)&&u.updateSnapshot(),f=Be(),un(f,u.measurePageBox())),tv(a,u.latestValues,(l=u.snapshot)==null?void 0:l.layoutBox,f)}return ps(this.latestValues)&&tv(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Qe.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var p;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(o||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(p=this.parent)!=null&&p.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:f}=this.options;if(!this.layout||!(u||f))return;this.resolvedRelativeTargetAt=Qe.timestamp;const h=this.getClosestProjectingParent();h&&this.linkedParentVersion!==h.layoutVersion&&!h.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&h&&h.layout?this.createRelativeTarget(h,this.layout.layoutBox,h.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Be(),this.targetWithTransforms=Be()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),jI(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):un(this.target,this.layout.layoutBox),x_(this.target,this.targetDelta)):un(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&h&&!!h.resumingFrom==!!this.resumingFrom&&!h.options.layoutScroll&&h.target&&this.animationProgress!==1?this.createRelativeTarget(h,this.target,h.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Kh(this.parent.latestValues)||y_(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,a,l){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Be(),this.relativeTargetOrigin=Be(),eu(this.relativeTargetOrigin,a,l,this.options.layoutAnchor||void 0),un(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var m;const o=this.getLead(),a=!!this.resumingFrom||this!==o;let l=!0;if((this.isProjectionDirty||(m=this.parent)!=null&&m.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===Qe.timestamp&&(l=!1),l)return;const{layout:c,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||u))return;un(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,h=this.treeScale.y;tI(this.layoutCorrected,this.treeScale,this.path,a),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=Be());const{target:p}=o;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(qx(this.prevProjectionDelta.x,this.projectionDelta.x),qx(this.prevProjectionDelta.y,this.projectionDelta.y)),Ho(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==h||!ov(this.projectionDelta.x,this.prevProjectionDelta.x)||!ov(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=mi(),this.projectionDelta=mi(),this.projectionDeltaWithTransform=mi()}setAnimationOrigin(o,a=!1,l){const c=this.snapshot,u=c?c.latestValues:{},f={...this.latestValues},h=mi();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const p=Be(),m=c?c.source:void 0,g=this.layout?this.layout.source:void 0,w=m!==g,y=this.getStack(),x=!y||y.members.length<=1,v=!!(w&&!x&&this.options.crossfade===!0&&!this.path.some(nM));this.animationProgress=0;let k;const C=l==null?void 0:l.interpolateProjection(o);this.mixTargetDelta=S=>{const P=S/1e3,T=C==null?void 0:C(P);T?(h.x.translate=T.x,h.x.scale=ye(o.x.scale,1,P),h.x.origin=o.x.origin,h.x.originPoint=o.x.originPoint,h.y.translate=T.y,h.y.scale=ye(o.y.scale,1,P),h.y.origin=o.y.origin,h.y.originPoint=o.y.originPoint):(hv(h.x,o.x,P),hv(h.y,o.y,P)),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(eu(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),tM(this.relativeTarget,this.relativeTargetOrigin,p,P),k&&NI(this.relativeTarget,k)&&(this.isProjectionDirty=!1),k||(k=Be()),un(k,this.relativeTarget)),w&&(this.animationValues=f,II(f,u,this.latestValues,P,v,x)),T&&T.rotate!==void 0&&(this.animationValues||(this.animationValues=f),this.animationValues.pathRotation=T.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=P},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var a,l,c;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(c=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||c.stop(),this.pendingAnimation&&(Xr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=xe.update(()=>{ac.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=$i(0)),this.motionValue.jump(0,!1),this.currentAnimation=DI(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:u=>{this.mixTargetDelta(u),o.onUpdate&&o.onUpdate(u)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(BI),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&D_(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||Be();const f=ut(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+f;const h=ut(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+h}un(a,l),ic(a,u),Ho(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new zI),this.sharedNodes.get(o).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var a;const{layoutId:o}=this.options;return o?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:o}=this.options;return o?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&Hd("z",o,c,this.animationValues);for(let u=0;u<Wd.length;u++)Hd(`rotate${Wd[u]}`,o,c,this.animationValues),Hd(`skew${Wd[u]}`,o,c,this.animationValues);o.render();for(const u in c)o.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);o.scheduleRender()}applyProjectionStyles(o,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=oc(a==null?void 0:a.pointerEvents)||"",o.transform=l?l(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=oc(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!ps(this.latestValues)&&(o.transform=l?l({},""):"none",this.hasProjected=!1);return}o.visibility="";const u=c.animationValues||c.latestValues;this.applyTransformsToTarget();let f=RI(this.projectionDeltaWithTransform,this.treeScale,u);l&&(f=l(u,f)),o.transform=f;const{x:h,y:p}=this.projectionDelta;o.transformOrigin=`${h.origin*100}% ${p.origin*100}% 0`,c.animationValues?o.opacity=c===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:o.opacity=c===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const m in qh){if(u[m]===void 0)continue;const{correct:g,applyTo:w,isCSSVariable:y}=qh[m],x=f==="none"?u[m]:g(u[m],c);if(w){const v=w.length;for(let k=0;k<v;k++)o[w[k]]=x}else y?this.options.visualElement.renderState.vars[m]=x:o[m]=x}this.options.layoutId&&(o.pointerEvents=c===this?oc(a==null?void 0:a.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(uv),this.root.sharedNodes.clear()}}}function UI(e){e.updateLayout()}function WI(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=e.layout,{animationType:i}=e.options,o=t.source!==e.layout.source;if(i==="size")An(f=>{const h=o?t.measuredBox[f]:t.layoutBox[f],p=ut(h);h.min=r[f].min,h.max=h.min+p});else if(i==="x"||i==="y"){const f=i==="x"?"y":"x";Qh(o?t.measuredBox[f]:t.layoutBox[f],r[f])}else D_(i,t.layoutBox,r)&&An(f=>{const h=o?t.measuredBox[f]:t.layoutBox[f],p=ut(r[f]);h.max=h.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+p)});const a=mi();Ho(a,r,t.layoutBox);const l=mi();o?Ho(l,e.applyTransform(s,!0),t.measuredBox):Ho(l,r,t.layoutBox);const c=!N_(a);let u=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:p}=f;if(h&&p){const m=e.options.layoutAnchor||void 0,g=Be();eu(g,t.layoutBox,h.layoutBox,m);const w=Be();eu(w,r,p.layoutBox,m),R_(g,w)||(u=!0),f.options.layoutRoot&&(e.relativeTarget=w,e.relativeTargetOrigin=g,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function HI(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function GI(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function KI(e){e.clearSnapshot()}function uv(e){e.clearMeasurements()}function YI(e){e.isLayoutDirty=!0,e.updateLayout()}function dv(e){e.isLayoutDirty=!1}function qI(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function QI(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function fv(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function XI(e){e.resolveTargetDelta()}function JI(e){e.calcProjection()}function ZI(e){e.resetSkewAndRotation()}function eM(e){e.removeLeadSnapshot()}function hv(e,t,n){e.translate=ye(t.translate,0,n),e.scale=ye(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function pv(e,t,n,r){e.min=ye(t.min,n.min,r),e.max=ye(t.max,n.max,r)}function tM(e,t,n,r){pv(e.x,t.x,n.x,r),pv(e.y,t.y,n.y,r)}function nM(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const rM={duration:.45,ease:[.4,0,.1,1]},mv=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),gv=mv("applewebkit/")&&!mv("chrome/")?Math.round:nn;function yv(e){e.min=gv(e.min),e.max=gv(e.max)}function sM(e){yv(e.x),yv(e.y)}function D_(e,t,n){return e==="position"||e==="preserve-aspect"&&!CI(iv(t),iv(n),.2)}function iM(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const oM=L_({attachResizeListener:(e,t)=>_a(e,"resize",t),measureScroll:()=>{var e,t;return{x:document.documentElement.scrollLeft||((e=document.body)==null?void 0:e.scrollLeft)||0,y:document.documentElement.scrollTop||((t=document.body)==null?void 0:t.scrollTop)||0}},checkIsScrollRoot:()=>!0}),Gd={current:void 0},F_=L_({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Gd.current){const e=new oM({});e.mount(window),e.setOptions({layoutScroll:!0}),Gd.current=e}return Gd.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Gm=b.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function xv(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function aM(...e){return t=>{let n=!1;const r=e.map(s=>{const i=xv(s,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():xv(e[s],null)}}}}function lM(...e){return b.useCallback(aM(...e),e)}class cM extends b.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(tc(n)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,s=tc(r)&&r.offsetWidth||0,i=tc(r)&&r.offsetHeight||0,o=getComputedStyle(n),a=this.props.sizeRef.current;a.height=parseFloat(o.height),a.width=parseFloat(o.width),a.top=n.offsetTop,a.left=n.offsetLeft,a.right=s-a.width-a.left,a.bottom=i-a.height-a.top,a.direction=o.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function uM({children:e,isPresent:t,anchorX:n,anchorY:r,root:s,pop:i}){var h;const o=b.useId(),a=b.useRef(null),l=b.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:c}=b.useContext(Gm),u=((h=e.props)==null?void 0:h.ref)??(e==null?void 0:e.ref),f=lM(a,u);return b.useInsertionEffect(()=>{const{width:p,height:m,top:g,left:w,right:y,bottom:x,direction:v}=l.current;if(t||i===!1||!a.current||!p||!m)return;const k=v==="rtl",C=n==="left"?k?`right: ${y}`:`left: ${w}`:k?`left: ${w}`:`right: ${y}`,S=r==="bottom"?`bottom: ${x}`:`top: ${g}`;a.current.dataset.motionPopId=o;const P=document.createElement("style");c&&(P.nonce=c);const T=s??document.head;return T.appendChild(P),P.sheet&&P.sheet.insertRule(`
58
- [data-motion-pop-id="${o}"] {
59
- position: absolute !important;
60
- width: ${p}px !important;
61
- height: ${m}px !important;
62
- ${C}px !important;
63
- ${S}px !important;
64
- }
65
- `),()=>{var E;(E=a.current)==null||E.removeAttribute("data-motion-pop-id"),T.contains(P)&&T.removeChild(P)}},[t]),d.jsx(cM,{isPresent:t,childRef:a,sizeRef:l,pop:i,children:i===!1?e:b.cloneElement(e,{ref:f})})}const dM=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:o,anchorX:a,anchorY:l,root:c})=>{const u=bm(fM),f=b.useId();let h=!0,p=b.useMemo(()=>(h=!1,{id:f,initial:t,isPresent:n,custom:s,onExitComplete:m=>{u.set(m,!0);for(const g of u.values())if(!g)return;r&&r()},register:m=>(u.set(m,!1),()=>u.delete(m))}),[n,u,r]);return i&&h&&(p={...p}),b.useMemo(()=>{u.forEach((m,g)=>u.set(g,!1))},[n]),b.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=d.jsx(uM,{pop:o==="popLayout",isPresent:n,anchorX:a,anchorY:l,root:c,children:e}),d.jsx(Eu.Provider,{value:p,children:e})};function fM(){return new Map}function O_(e=!0){const t=b.useContext(Eu);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,i=b.useId();b.useEffect(()=>{if(e)return s(i)},[e]);const o=b.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,o]:[!0]}const wl=e=>e.key||"";function vv(e){const t=[];return b.Children.forEach(e,n=>{b.isValidElement(n)&&t.push(n)}),t}const hM=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:o=!1,anchorX:a="left",anchorY:l="top",root:c})=>{const[u,f]=O_(o),h=b.useMemo(()=>vv(e),[e]),p=o&&!u?[]:h.map(wl),m=b.useRef(!0),g=b.useRef(h),w=bm(()=>new Map),y=b.useRef(new Set),[x,v]=b.useState(h),[k,C]=b.useState(h);fk(()=>{m.current=!1,g.current=h;for(let T=0;T<k.length;T++){const E=wl(k[T]);p.includes(E)?(w.delete(E),y.current.delete(E)):w.get(E)!==!0&&w.set(E,!1)}},[k,p.length,p.join("-")]);const S=[];if(h!==x){let T=[...h];for(let E=0;E<k.length;E++){const j=k[E],R=wl(j);p.includes(R)||(T.splice(E,0,j),S.push(j))}return i==="wait"&&S.length&&(T=S),C(vv(T)),v(h),null}const{forceRender:P}=b.useContext(wm);return d.jsx(d.Fragment,{children:k.map(T=>{const E=wl(T),j=o&&!u?!1:h===k||p.includes(E),R=()=>{if(y.current.has(E))return;if(w.has(E))y.current.add(E),w.set(E,!0);else return;let I=!0;w.forEach(D=>{D||(I=!1)}),I&&(P==null||P(),C(g.current),o&&(f==null||f()),r&&r())};return d.jsx(dM,{isPresent:j,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:i,root:c,onExitComplete:j?void 0:R,anchorX:a,anchorY:l,children:T},E)})})},$_=b.createContext({strict:!1}),wv={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let bv=!1;function pM(){if(bv)return;const e={};for(const t in wv)e[t]={isEnabled:n=>wv[t].some(r=>!!n[r])};p_(e),bv=!0}function z_(){return pM(),XA()}function mM(e){const t=z_();for(const n in e)t[n]={...t[n],...e[n]};p_(t)}const gM=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function tu(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||gM.has(e)}let B_=e=>!tu(e);function yM(e){typeof e=="function"&&(B_=t=>t.startsWith("on")?!tu(t):e(t))}try{yM(require("@emotion/is-prop-valid").default)}catch{}function xM(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||Xe(e[s])||(B_(s)||n===!0&&tu(s)||!t&&!tu(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const Au=b.createContext({});function vM(e,t){if(Ru(e)){const{initial:n,animate:r}=e;return{initial:n===!1||ka(n)?n:void 0,animate:ka(r)?r:void 0}}return e.inherit!==!1?t:{}}function wM(e){const{initial:t,animate:n}=vM(e,b.useContext(Au));return b.useMemo(()=>({initial:t,animate:n}),[kv(t),kv(n)])}function kv(e){return Array.isArray(e)?e.join(" "):e}const Km=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function V_(e,t,n){for(const r in t)!Xe(t[r])&&!b_(r,n)&&(e[r]=t[r])}function bM({transformTemplate:e},t){return b.useMemo(()=>{const n=Km();return Wm(n,t,e),Object.assign({},n.vars,n.style)},[t])}function kM(e,t){const n=e.style||{},r={};return V_(r,n,e),Object.assign(r,bM(e,t)),r}function _M(e,t){const n={},r=kM(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const U_=()=>({...Km(),attrs:{}});function SM(e,t,n,r){const s=b.useMemo(()=>{const i=U_();return k_(i,t,S_(r),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};V_(i,e.style,e),s.style={...i,...s.style}}return s}const CM=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Ym(e){return typeof e!="string"||e.includes("-")?!1:!!(CM.indexOf(e)>-1||/[A-Z]/u.test(e))}function jM(e,t,n,{latestValues:r},s,i=!1,o){const l=(o??Ym(e)?SM:_M)(t,r,s,e),c=xM(t,typeof e=="string",i),u=e!==b.Fragment?{...c,...l,ref:n}:{},{children:f}=t,h=b.useMemo(()=>Xe(f)?f.get():f,[f]);return b.createElement(e,{...u,children:h})}function PM({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:EM(n,r,s,e),renderState:t()}}function EM(e,t,n,r){const s={},i=r(e,{});for(const h in i)s[h]=oc(i[h]);let{initial:o,animate:a}=e;const l=Ru(e),c=f_(e);t&&c&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||o===!1;const f=u?a:o;if(f&&typeof f!="boolean"&&!Nu(f)){const h=Array.isArray(f)?f:[f];for(let p=0;p<h.length;p++){const m=Dm(e,h[p]);if(m){const{transitionEnd:g,transition:w,...y}=m;for(const x in y){let v=y[x];if(Array.isArray(v)){const k=u?v.length-1:0;v=v[k]}v!==null&&(s[x]=v)}for(const x in g)s[x]=g[x]}}}return s}const W_=e=>(t,n)=>{const r=b.useContext(Au),s=b.useContext(Eu),i=()=>PM(e,t,r,s);return n?i():bm(i)},TM=W_({scrapeMotionValuesFromProps:Hm,createRenderState:Km}),NM=W_({scrapeMotionValuesFromProps:C_,createRenderState:U_}),RM=Symbol.for("motionComponentSymbol");function AM(e,t,n){const r=b.useRef(n);b.useInsertionEffect(()=>{r.current=n});const s=b.useRef(null);return b.useCallback(i=>{var a;i&&((a=e.onMount)==null||a.call(e,i)),t&&(i?t.mount(i):t.unmount());const o=r.current;if(typeof o=="function")if(i){const l=o(i);typeof l=="function"&&(s.current=l)}else s.current?(s.current(),s.current=null):o(i);else o&&(o.current=i)},[t])}const H_=b.createContext({});function Zs(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function IM(e,t,n,r,s,i){var v,k;const{visualElement:o}=b.useContext(Au),a=b.useContext($_),l=b.useContext(Eu),c=b.useContext(Gm),u=c.reducedMotion,f=c.skipAnimations,h=b.useRef(null),p=b.useRef(!1);r=r||a.renderer,!h.current&&r&&(h.current=r(e,{visualState:t,parent:o,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:u,skipAnimations:f,isSVG:i}),p.current&&h.current&&(h.current.manuallyAnimateOnMount=!0));const m=h.current,g=b.useContext(H_);m&&!m.projection&&s&&(m.type==="html"||m.type==="svg")&&MM(h.current,n,s,g);const w=b.useRef(!1);b.useInsertionEffect(()=>{m&&w.current&&m.update(n,l)});const y=n[e_],x=b.useRef(!!y&&typeof window<"u"&&!((v=window.MotionHandoffIsComplete)!=null&&v.call(window,y))&&((k=window.MotionHasOptimisedAnimation)==null?void 0:k.call(window,y)));return fk(()=>{p.current=!0,m&&(w.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),x.current&&m.animationState&&m.animationState.animateChanges())}),b.useEffect(()=>{m&&(!x.current&&m.animationState&&m.animationState.animateChanges(),x.current&&(queueMicrotask(()=>{var C;(C=window.MotionHandoffMarkAsComplete)==null||C.call(window,y)}),x.current=!1),m.enteringChildren=void 0)}),m}function MM(e,t,n,r){const{layoutId:s,layout:i,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutAnchor:u,layoutCrossfade:f}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:G_(e.parent)),e.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!o||a&&Zs(a),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:f,layoutScroll:l,layoutRoot:c,layoutAnchor:u})}function G_(e){if(e)return e.options.allowProjection!==!1?e.projection:G_(e.parent)}function Kd(e,{forwardMotionProps:t=!1,type:n}={},r,s){r&&mM(r);const i=n?n==="svg":Ym(e),o=i?NM:TM;function a(c,u){let f;const h={...b.useContext(Gm),...c,layoutId:LM(c)},{isStatic:p}=h,m=wM(c),g=o(c,p);if(!p&&typeof window<"u"){DM();const w=FM(h);f=w.MeasureLayout,m.visualElement=IM(e,g,h,s,w.ProjectionNode,i)}return d.jsxs(Au.Provider,{value:m,children:[f&&m.visualElement?d.jsx(f,{visualElement:m.visualElement,...h}):null,jM(e,c,AM(g,m.visualElement,u),g,p,t,i)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const l=b.forwardRef(a);return l[RM]=e,l}function LM({layoutId:e}){const t=b.useContext(wm).id;return t&&e!==void 0?t+"-"+e:e}function DM(e,t){b.useContext($_).strict}function FM(e){const t=z_(),{drag:n,layout:r}=t;if(!n&&!r)return{};const s={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(e)||r!=null&&r.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function OM(e,t){if(typeof Proxy>"u")return Kd;const n=new Map,r=(i,o)=>Kd(i,o,e,t),s=(i,o)=>r(i,o);return new Proxy(s,{get:(i,o)=>o==="create"?r:(n.has(o)||n.set(o,Kd(o,void 0,e,t)),n.get(o))})}const $M=(e,t)=>t.isSVG??Ym(e)?new pI(t):new lI(t,{allowProjection:e!==b.Fragment});class zM extends ts{constructor(t){super(t),t.animationState||(t.animationState=vI(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Nu(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let BM=0;class VM extends ts{constructor(){super(...arguments),this.id=BM++,this.isExitComplete=!1}update(){var i;if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;if(t&&r===!1){if(this.isExitComplete){const{initial:o,custom:a}=this.node.getProps();if(typeof o=="string"||typeof o=="object"&&o!==null&&!Array.isArray(o)){const l=Es(this.node,o,a);if(l){const{transition:c,transitionEnd:u,...f}=l;for(const h in f)(i=this.node.getValue(h))==null||i.jump(f[h])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const UM={animation:{Feature:zM},exit:{Feature:VM}};function Ma(e){return{point:{x:e.pageX,y:e.pageY}}}const WM=e=>t=>$m(t)&&e(t,Ma(t));function Go(e,t,n,r){return _a(e,t,WM(n),r)}const K_=({current:e})=>e?e.ownerDocument.defaultView:null,_v=(e,t)=>Math.abs(e-t);function HM(e,t){const n=_v(e.x,t.x),r=_v(e.y,t.y);return Math.sqrt(n**2+r**2)}const Sv=new Set(["auto","scroll"]);class Y_{constructor(t,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:i=!1,distanceThreshold:o=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=p=>{this.handleScroll(p.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=bl(this.lastRawMoveEventInfo,this.transformPagePoint));const p=Yd(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,g=HM(p.offset,{x:0,y:0})>=this.distanceThreshold;if(!m&&!g)return;const{point:w}=p,{timestamp:y}=Qe;this.history.push({...w,timestamp:y});const{onStart:x,onMove:v}=this.handlers;m||(x&&x(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,p)},this.handlePointerMove=(p,m)=>{this.lastMoveEvent=p,this.lastRawMoveEventInfo=m,this.lastMoveEventInfo=bl(m,this.transformPagePoint),xe.update(this.updatePoint,!0)},this.handlePointerUp=(p,m)=>{this.end();const{onEnd:g,onSessionEnd:w,resumeAnimation:y}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=Yd(p.type==="pointercancel"?this.lastMoveEventInfo:bl(m,this.transformPagePoint),this.history);this.startEvent&&g&&g(p,x),w&&w(p,x)},!$m(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=s||window;const l=Ma(t),c=bl(l,this.transformPagePoint),{point:u}=c,{timestamp:f}=Qe;this.history=[{...u,timestamp:f}];const{onSessionStart:h}=n;h&&h(t,Yd(c,this.history)),this.removeListeners=Ra(Go(this.contextWindow,"pointermove",this.handlePointerMove),Go(this.contextWindow,"pointerup",this.handlePointerUp),Go(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(Sv.has(r.overflowX)||Sv.has(r.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const r=t===window,s=r?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},i={x:s.x-n.x,y:s.y-n.y};i.x===0&&i.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(t,s),xe.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Xr(this.updatePoint)}}function bl(e,t){return t?{point:t(e.point)}:e}function Cv(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Yd({point:e},t){return{point:e,delta:Cv(e,q_(t)),offset:Cv(e,GM(t)),velocity:KM(t,.1)}}function GM(e){return e[0]}function q_(e){return e[e.length-1]}function KM(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=q_(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>$t(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&s.timestamp-r.timestamp>$t(t)*2&&(r=e[1]);const i=Zt(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const o={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function YM(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?ye(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?ye(n,e,r.max):Math.min(e,n)),e}function jv(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function qM(e,{top:t,left:n,bottom:r,right:s}){return{x:jv(e.x,n,s),y:jv(e.y,t,r)}}function Pv(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function QM(e,t){return{x:Pv(e.x,t.x),y:Pv(e.y,t.y)}}function XM(e,t){let n=.5;const r=ut(e),s=ut(t);return s>r?n=wa(t.min,t.max-r,e.min):r>s&&(n=wa(e.min,e.max-s,t.min)),Vn(0,1,n)}function JM(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Xh=.35;function ZM(e=Xh){return e===!1?e=0:e===!0&&(e=Xh),{x:Ev(e,"left","right"),y:Ev(e,"top","bottom")}}function Ev(e,t,n){return{min:Tv(e,t),max:Tv(e,n)}}function Tv(e,t){return typeof e=="number"?e:e[t]||0}const eL=new WeakMap;class tL{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Be(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=f=>{n&&this.snapToCursor(Ma(f).point),this.stopAnimation()},o=(f,h)=>{const{drag:p,dragPropagation:m,onDragStart:g}=this.getProps();if(p&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=EA(p),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=h,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),An(y=>{let x=this.getAxisMotionValue(y).get()||0;if(Bn.test(x)){const{projection:v}=this.visualElement;if(v&&v.layout){const k=v.layout.layoutBox[y];k&&(x=ut(k)*(parseFloat(x)/100))}}this.originPoint[y]=x}),g&&xe.update(()=>g(f,h),!1,!0),Vh(this.visualElement,"transform");const{animationState:w}=this.visualElement;w&&w.setActive("whileDrag",!0)},a=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h;const{dragPropagation:p,dragDirectionLock:m,onDirectionLock:g,onDrag:w}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:y}=h;if(m&&this.currentDirection===null){this.currentDirection=rL(y),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",h.point,y),this.updateAxis("y",h.point,y),this.visualElement.render(),w&&xe.update(()=>w(f,h),!1,!0)},l=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h,this.stop(f,h),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{const{dragSnapToOrigin:f}=this.getProps();(f||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:u}=this.getProps();this.panSession=new Y_(t,{onSessionStart:i,onStart:o,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:r,contextWindow:K_(this.visualElement),element:this.visualElement.current})}stop(t,n){const r=t||this.latestPointerEvent,s=n||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!s||!r)return;const{velocity:o}=s;this.startAnimation(o);const{onDragEnd:a}=this.getProps();a&&xe.postRender(()=>a(r,s))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,r){const{drag:s}=this.getProps();if(!r||!kl(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=YM(o,this.constraints[t],this.elastic[t])),i.set(o)}resolveConstraints(){var i;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(i=this.visualElement.projection)==null?void 0:i.layout,s=this.constraints;t&&Zs(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=qM(r.layoutBox,t):this.constraints=!1,this.elastic=ZM(n),s!==this.constraints&&!Zs(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&An(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=JM(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Zs(t))return!1;const r=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;s.root&&(s.root.scroll=void 0,s.root.updateScroll());const i=nI(r,s.root,this.visualElement.getTransformPagePoint());let o=QM(s.layout.layoutBox,i);if(n){const a=n(ZA(o));this.hasMutatedConstraints=!!a,a&&(o=g_(a))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=An(u=>{if(!kl(u,n,this.currentDirection))return;let f=l&&l[u]||{};(o===!0||o===u)&&(f={min:0,max:0});const h=s?200:1e6,p=s?40:1e7,m={type:"inertia",velocity:r?t[u]:0,bounceStiffness:h,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(u,m)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Vh(this.visualElement,t),r.start(Lm(t,r,0,n,this.visualElement,!1))}stopAnimation(){An(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,s=this.visualElement.getProps()[n];return s||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor(t){An(n=>{const{drag:r}=this.getProps();if(!kl(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:a}=s.layout.layoutBox[n],l=i.get()||0;i.set(t[n]-ye(o,a,.5)+l)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Zs(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};An(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();s[o]=XM({min:l,max:l},this.constraints[o])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),An(o=>{if(!kl(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(ye(l,c,s[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;eL.set(this.visualElement,this);const t=this.visualElement.current,n=Go(t,"pointerdown",c=>{const{drag:u,dragListener:f=!0}=this.getProps(),h=c.target,p=h!==t&&MA(h);u&&f&&!p&&this.start(c)});let r;const s=()=>{const{dragConstraints:c}=this.getProps();Zs(c)&&c.current&&(this.constraints=this.resolveRefConstraints(),r||(r=nL(t,c.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,o=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),xe.read(s);const a=_a(window,"resize",()=>this.scalePositionWithinConstraints()),l=i.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(An(f=>{const h=this.getAxisMotionValue(f);h&&(this.originPoint[f]+=c[f].translate,h.set(h.get()+c[f].translate))}),this.visualElement.render())});return()=>{a(),n(),o(),l&&l(),r&&r()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=Xh,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:a}}}function Nv(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function nL(e,t,n){const r=Fx(e,Nv(n)),s=Fx(t,Nv(n));return()=>{r(),s()}}function kl(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function rL(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class sL extends ts{constructor(t){super(t),this.removeGroupControls=nn,this.removeListeners=nn,this.controls=new tL(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||nn}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const qd=e=>(t,n)=>{e&&xe.update(()=>e(t,n),!1,!0)};class iL extends ts{constructor(){super(...arguments),this.removePointerDownListener=nn}onPointerDown(t){this.session=new Y_(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:K_(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:qd(t),onStart:qd(n),onMove:qd(r),onEnd:(i,o)=>{delete this.session,s&&xe.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=Go(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Qd=!1;class oL extends b.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=t;i&&(n.group&&n.group.add(i),r&&r.register&&s&&r.register(i),Qd&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),ac.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,{projection:o}=r;return o&&(o.isPresent=i,t.layoutDependency!==n&&o.setOptions({...o.options,layoutDependency:n}),Qd=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==i?o.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?o.promote():o.relegate()||xe.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:n}=this.props,{projection:r}=t;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),Om.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;Qd=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Q_(e){const[t,n]=O_(),r=b.useContext(wm);return d.jsx(oL,{...e,layoutGroup:r,switchLayoutGroup:b.useContext(H_),isPresent:t,safeToRemove:n})}const aL={pan:{Feature:iL},drag:{Feature:sL,ProjectionNode:F_,MeasureLayout:Q_}};function Rv(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,i=r[s];i&&xe.postRender(()=>i(t,Ma(t)))}class lL extends ts{mount(){const{current:t}=this.node;t&&(this.unmount=NA(t,(n,r)=>(Rv(this.node,r,"Start"),s=>Rv(this.node,s,"End"))))}unmount(){}}class cL extends ts{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Ra(_a(this.node.current,"focus",()=>this.onFocus()),_a(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Av(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),i=r[s];i&&xe.postRender(()=>i(t,Ma(t)))}class uL extends ts{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=DA(t,(s,i)=>(Av(this.node,i,"Start"),(o,{success:a})=>Av(this.node,o,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const Jh=new WeakMap,Xd=new WeakMap,dL=e=>{const t=Jh.get(e.target);t&&t(e)},fL=e=>{e.forEach(dL)};function hL({root:e,...t}){const n=e||document;Xd.has(n)||Xd.set(n,{});const r=Xd.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(fL,{root:e,...t})),r[s]}function pL(e,t,n){const r=hL(t);return Jh.set(e,n),r.observe(e),()=>{Jh.delete(e),r.unobserve(e)}}const mL={some:0,all:1};class gL extends ts{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var l;(l=this.stopObserver)==null||l.call(this);const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:mL[s]},a=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,i&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:f,onViewportLeave:h}=this.node.getProps(),p=u?f:h;p&&p(c)};this.stopObserver=pL(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(yL(t,n))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function yL({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const xL={inView:{Feature:gL},tap:{Feature:uL},focus:{Feature:cL},hover:{Feature:lL}},vL={layout:{ProjectionNode:F_,MeasureLayout:Q_}},wL={...UM,...xL,...aL,...vL},Iv=OM(wL,$M);function bL(){!Um.current&&h_();const[e]=b.useState(Xc.current);return e}function Iu(e,t){const n=b.useRef(t);n.current=t,b.useEffect(()=>{if(!e)return;const r=s=>{s.key==="Escape"&&n.current()};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e])}const Jd={stackPanelWidth:480,navIslandBottom:"1.5rem",navIslandHeight:"4.5rem"},J={bgBase:"#FDFCF8",bgSurface:"#FAF8F0",bgElevated:"#F5F1E6",textPrimary:"#1A1917",textSecondary:"#68635C",accentBlue:"#7C9CC0",accentBlueDark:"#51719B",accentGreen:"#8FB996",accentGreenDark:"#5E8A66",accentAmber:"#D4A373",accentAmberDark:"#A67B4F",accentRose:"#C98B8B",accentRoseDark:"#9E5E5E",accentSlate:"#8A9BA8",accentSlateDark:"#5E7080",canvasBase:"#F0EAD8",canvas300:"#E5DBC4",canvasDark:"#D6C9A8",washBlue:"#DEE4E5",washGreen:"#E3EADC",washAmber:"#F2E5D5",washRose:"#EFE0DA",washSlate:"#E1E4E0",chalkboardBg:"#142e22",chalkboardChalk:"#d4e8cb",chalkboardBorderBase:"#C8D2C3"};function nt(e,t){const n=e.replace("#",""),r=Number.parseInt(n.slice(0,2),16),s=Number.parseInt(n.slice(2,4),16),i=Number.parseInt(n.slice(4,6),16);return`rgba(${r}, ${s}, ${i}, ${t})`}const kL={4:"1rem"};function Q(...e){return oN(E2(e))}const _L={height:32,lineHeight:"32px",padding:"0 16px"},SL={white:`url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='w'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.5' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.97 0 0 0 0 0.96 0 0 0 0 0.95 0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23w)' opacity='1'/%3E%3C/svg%3E")`,paper:`url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.04'/%3E%3C/svg%3E")`,speckle:`url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='speckle'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.4' numOctaves='1' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23speckle)' opacity='0.14'/%3E%3C/svg%3E")`,parchment:`url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='par'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='5' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.55 0 0 0 0 0.48 0 0 0 0 0.35 0 0 0 0.45 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23par)' opacity='1'/%3E%3C/svg%3E")`,canvas:`url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='cv'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.62 0 0 0 0 0.60 0 0 0 0 0.52 0 0 0 0.42 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23cv)' opacity='1'/%3E%3C/svg%3E")`,kraft:`url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='k'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.50 0 0 0 0 0.35 0 0 0 0 0.20 0 0 0 0.55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23k)' opacity='1'/%3E%3C/svg%3E")`,chalkboard:`url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='c'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.15 0 0 0 0 0.28 0 0 0 0 0.20 0 0 0 0.08 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23c)' opacity='1'/%3E%3C/svg%3E")`},CL={white:J.bgBase,paper:J.bgSurface,speckle:J.bgSurface,parchment:J.bgElevated,canvas:J.canvasBase,kraft:J.canvas300,chalkboard:J.chalkboardBg},Mv={white:J.bgElevated,paper:J.bgElevated,speckle:J.bgElevated,parchment:J.canvasBase,canvas:J.canvas300,kraft:J.canvasDark,chalkboard:J.chalkboardBg},jL={base:J.bgBase,surface:J.bgSurface,elevated:J.bgElevated,canvas:J.canvasBase,canvasDark:J.canvasDark,blue:J.washBlue,green:J.washGreen,amber:J.washAmber,rose:J.washRose,slate:J.washSlate},PL={blue:"rgba(168, 200, 216, 0.35)",brown:"rgba(164, 144, 120, 0.35)",black:"rgba(61, 53, 43, 0.15)"};function X_(e){const t=typeof e=="string"?{texture:e}:e,n=t.texture??"paper",r=t.ruledType??"none",s=t.ruledColor??"blue",i=SL[n],o=t.fill?jL[t.fill]:t.shade?Mv[n]:CL[n],a=PL[s],l={"--pui-texture-shade":Mv[n],"--pui-texture-image":i};return r==="none"?{...l,backgroundColor:o,backgroundImage:i,backgroundRepeat:"repeat",backgroundSize:"200px 200px"}:r==="lines"?{...l,backgroundColor:o,backgroundImage:`${i}, repeating-linear-gradient(180deg, transparent, transparent 31px, ${a} 31px, ${a} 32px)`,backgroundRepeat:"repeat, repeat",backgroundSize:"200px 200px, 100% 32px"}:{...l,backgroundColor:o,backgroundImage:`${i}, repeating-linear-gradient(180deg, transparent, transparent 31px, ${a} 31px, ${a} 32px), repeating-linear-gradient(90deg, transparent, transparent 31px, ${a} 31px, ${a} 32px)`,backgroundRepeat:"repeat, repeat, repeat",backgroundSize:"200px 200px, 100% 32px, 32px 32px"}}function zi(e){return X_(e)}function Yi(e,t="paper"){if(e!==!1)return zi(e===!0?t:e)}function EL(e){const t=Lu((e==null?void 0:e.seed)??Math.random()),n=Math.max(0,Math.min(1,(e==null?void 0:e.wobble)??.5)),r=8+Math.round(n*6),s=50,i=50,o=46,a=2+n*14,l=[];for(let c=0;c<r;c++){const u=c/r*Math.PI*2+(t()-.5)*.15*n,f=o+(t()-.5)*a*2;l.push({x:s+Math.cos(u)*f,y:i+Math.sin(u)*f})}return Mu(l)}function TL(e,t){const n=Lu(`${e}-ring`),r=Math.max(0,Math.min(1,t??.5)),s=8+Math.round(r*6),i=50,o=50,a=49,l=2+r*14,c=[];for(let u=0;u<s;u++){const f=u/s*Math.PI*2+(n()-.5)*.15*r,h=a+(n()-.5)*l*2;c.push({x:i+Math.cos(f)*h,y:o+Math.sin(f)*h})}return Mu(c)}function NL(e){const t=Lu((e==null?void 0:e.seed)??Math.random()),n=Math.max(0,Math.min(1,(e==null?void 0:e.wobble)??.5)),r=3+Math.round(n*3),s=2,i=3+n*10,o=[],a=[{ax:s,ay:s,bx:100-s,by:s},{ax:100-s,ay:s,bx:100-s,by:100-s},{ax:100-s,ay:100-s,bx:s,by:100-s},{ax:s,ay:100-s,bx:s,by:s}];for(const l of a)for(let c=0;c<r;c++){const u=(c+.5)/r,f=l.ax+(l.bx-l.ax)*u,h=l.ay+(l.by-l.ay)*u,p=l.bx-l.ax,m=l.by-l.ay,g=Math.sqrt(p*p+m*m)||1,w=-m/g,y=p/g,x=(t()-.5)*i*2;o.push({x:f+w*x,y:h+y*x})}return Mu(o)}function RL(e,t){const n=Lu(`${e}-ring`),r=Math.max(0,Math.min(1,t??.5)),s=3+Math.round(r*3),i=0,o=3+r*10,a=[],l=[{ax:i,ay:i,bx:100-i,by:i},{ax:100-i,ay:i,bx:100-i,by:100-i},{ax:100-i,ay:100-i,bx:i,by:100-i},{ax:i,ay:100-i,bx:i,by:i}];for(const c of l)for(let u=0;u<s;u++){const f=(u+.5)/s,h=c.ax+(c.bx-c.ax)*f,p=c.ay+(c.by-c.ay)*f,m=c.bx-c.ax,g=c.by-c.ay,w=Math.sqrt(m*m+g*g)||1,y=-g/w,x=m/w,v=(n()-.5)*o*2;a.push({x:h+y*v,y:p+x*v})}return Mu(a)}function Mu(e){const t=e.length;if(t<3)return"";let n=`M ${mr(e[0].x)} ${mr(e[0].y)}`;for(let r=0;r<t;r++){const s=e[(r-1+t)%t],i=e[r],o=e[(r+1)%t],a=e[(r+2)%t],l=i.x+(o.x-s.x)/6,c=i.y+(o.y-s.y)/6,u=o.x-(a.x-i.x)/6,f=o.y-(a.y-i.y)/6;n+=` C ${mr(l)} ${mr(c)}, ${mr(u)} ${mr(f)}, ${mr(o.x)} ${mr(o.y)}`}return n+=" Z",n}function mr(e){return e.toFixed(2)}function Lu(e){let t=typeof e=="string"?AL(e):e;return()=>(t=t*16807%2147483647,(t-1)/2147483646)}function AL(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return Math.abs(t)||1}function Du(){const e=b.useId();return b.useMemo(()=>{let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)>>>0;return(t+1)/4294967296},[e])}function qi(e){const t=Du();return b.useMemo(()=>({blob:EL({seed:t,wobble:e}),ring:TL(t,e)}),[t,e])}const IL="button-module__button___Z331g",ML="button-module__blobBg___QQFzf",LL="button-module__blobFill___XwLjV",DL="button-module__blobRing___567UW",FL="button-module__isActive___FXNSJ",OL="button-module__primary___ppbyq",$L="button-module__secondary___esy5L",zL="button-module__ghost___NisA0",BL="button-module__danger___Wnvuq",VL="button-module__chalkboard___d3Nqb",UL="button-module__tiny___8ZZ7A",WL="button-module__small___u7y8a",HL="button-module__medium___HBIAj",GL="button-module__large___RPzNy",KL="button-module__fullWidth___H0P0F",YL="button-module__iconLeft___s60SZ",qL="button-module__iconRight___75eFu",QL="button-module__label___pXAyM",Gt={button:IL,blobBg:ML,blobFill:LL,blobRing:DL,isActive:FL,primary:OL,secondary:$L,ghost:zL,danger:BL,chalkboard:VL,tiny:UL,small:WL,medium:HL,large:GL,fullWidth:KL,iconLeft:YL,iconRight:qL,label:QL},se=b.forwardRef(function({variant:e="primary",surface:t="paper",size:n="medium",icon:r,iconRight:s,fullWidth:i=!1,wobble:o=.5,isActive:a=!1,children:l,className:c,...u},f){const h=qi(o);return d.jsxs("button",{ref:f,type:"button",className:Q(Gt.button,Gt[e],Gt[n],t==="chalkboard"&&Gt.chalkboard,a&&Gt.isActive,i&&Gt.fullWidth,c),...u,children:[d.jsxs("svg",{className:Gt.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[d.jsx("path",{d:h.blob,className:Gt.blobFill}),d.jsx("path",{d:h.ring,className:Gt.blobRing})]}),r&&d.jsx("span",{className:Gt.iconLeft,children:r}),d.jsx("span",{className:Gt.label,children:l}),s&&d.jsx("span",{className:Gt.iconRight,children:s})]})});function qm(e){return{blue:e.accentBlue,green:e.accentGreen,amber:e.accentAmber,rose:e.accentRose,slate:e.accentSlate}}const Oe=_N.generator(),XL="sketch-border-module__svg___whV4x",JL="sketch-border-module__behind___lgdYV",ZL="sketch-border-module__stroke___vAm-v",eD="sketch-border-module__fill___zlpd6",_l={svg:XL,behind:JL,stroke:ZL,fill:eD},tD=1.2,nD=.7;function jt({shape:e="rect",radius:t=9,roughness:n=1.2,bowing:r=1,strokeWidth:s=1,inset:i=2,fill:o=!1,clip:a=!1,smooth:l=!1,straight:c=!0,strokeInset:u=!0,className:f}){const[h]=b.useState(Math.random),p=b.useRef(null),[m,g]=b.useState(null);b.useEffect(()=>{var x;const v=(x=p.current)==null?void 0:x.parentElement;if(!v)return;const k=new ResizeObserver(()=>{const C=v.offsetWidth,S=v.offsetHeight;g(P=>P&&P.width===C&&P.height===S?P:{width:C,height:S})});return k.observe(v),()=>k.disconnect()},[]);const{parts:w,clipPath:y}=b.useMemo(()=>{if(!m||m.width<8||m.height<8)return{parts:null,clipPath:null};const x=Math.max(1,Math.round(h*1e6)),v=x,k=x*2654435761%2147483647,C=E=>Oe.toPaths(Oe.path(E,{seed:v,roughness:n,bowing:r,preserveVertices:!0,strokeWidth:s})).filter(j=>!j.fill||j.fill==="none").map(j=>({d:j.d,filled:!1}));if(l){const E={seed:v,roughness:n,bowing:r,strokeWidth:s,disableMultiStroke:!0},j=I=>Oe.toPaths(I).filter(D=>!D.fill||D.fill==="none").map(D=>({d:D.d,filled:!1}));if(a){const I=Sl(e,m,i,t,as(k),n*1.1),D=u?Lv(s,n):0,$=D?Sl(e,m,i+D,t,as(k),n*1.1):I;return{parts:j(Oe.path($,{...E,preserveVertices:!0})),clipPath:I}}const R=e==="circle"?Oe.ellipse(m.width/2,m.height/2,m.width-i*2,m.height-i*2,E):Oe.path(Zd(m,i,t,as(v)),{...E,preserveVertices:!0});return{parts:j(R),clipPath:null}}if(a){if(c){const I=Zd(m,i,t,as(k)),D=Oe.toPaths(Oe.path(I,{seed:v,roughness:tD,bowing:nD,preserveVertices:!0,strokeWidth:s})).filter($=>!$.fill||$.fill==="none").map($=>({d:$.d,filled:!1}));return{parts:D.length?D:[{d:I,filled:!1}],clipPath:I}}const E=Sl(e,m,i,t,as(k),n*1.1),j=u?Lv(s,n):0,R=j?Sl(e,m,i+j,t,as(k),n*1.1):E;return{parts:C(R),clipPath:E}}const S=(E,j)=>{const R=j?{fill:"#000",fillStyle:"solid"}:{},I=e==="circle"?Oe.ellipse(m.width/2,m.height/2,m.width-i*2,m.height-i*2,{seed:E,roughness:n,bowing:r,strokeWidth:s,...R}):Oe.path(Zd(m,i,t,as(E)),{seed:E,roughness:n,bowing:r,preserveVertices:!0,strokeWidth:s,...R});return Oe.toPaths(I)},P=o?S(k,!0).filter(E=>!!E.fill&&E.fill!=="none").map(E=>({d:E.d,filled:!0})):[],T=S(v,!1).filter(E=>!E.fill||E.fill==="none").map(E=>({d:E.d,filled:!1}));return{parts:[...P,...T],clipPath:null}},[m,h,a,l,c,e,t,n,r,s,i,o,u]);return b.useEffect(()=>{var x;const v=(x=p.current)==null?void 0:x.parentElement;if(v)return y?v.style.setProperty("--sketch-clip",`path("${y}")`):v.style.removeProperty("--sketch-clip"),()=>{v.style.removeProperty("--sketch-clip")}},[y]),d.jsx("svg",{ref:p,className:Q(_l.svg,o&&_l.behind,f),viewBox:m?`0 0 ${m.width} ${m.height}`:void 0,"aria-hidden":"true",children:w==null?void 0:w.map((x,v)=>x.filled?d.jsx("path",{className:_l.fill,d:x.d},`f-${v}`):d.jsx("path",{className:_l.stroke,d:x.d,strokeWidth:s},`s-${v}`))})}function Lv(e,t){return e/2+t*1.5}function as(e){let t=e;return()=>(t=t*16807%2147483647,(t-1)/2147483646)}function Sl(e,t,n,r,s,i){const o=t.width-n*2,a=t.height-n*2,l=t.width/2,c=t.height/2,u=()=>(s()-.5)*i*2,f=[];if(e==="circle")for(let h=0;h<16;h++){const p=h/16*Math.PI*2;f.push({x:l+Math.cos(p)*o/2+u(),y:c+Math.sin(p)*a/2+u()})}else{const h=Math.max(2,Math.min(r,o/2,a/2)),p=n,m=n,g=(x,v,k)=>{for(const C of[0,45,90]){const S=(k+C)*Math.PI/180;f.push({x:x+Math.cos(S)*h+u(),y:v+Math.sin(S)*h+u()})}},w=(x,v,k,C)=>{const S=Math.hypot(k-x,C-v),P=Math.min(12,Math.max(1,Math.round(S/160)));for(let T=1;T<=P;T++){const E=T/(P+1);f.push({x:x+(k-x)*E+u(),y:v+(C-v)*E+u()})}};g(p+h,m+h,180),w(p+h,m,p+o-h,m),g(p+o-h,m+h,270),w(p+o,m+h,p+o,m+a-h),g(p+o-h,m+a-h,0),w(p+o-h,m+a,p+h,m+a),g(p+h,m+a-h,90),w(p,m+a-h,p,m+h);const y=3;return Dv([...f.slice(y),...f.slice(0,y)])}return Dv(f)}function Dv(e){const t=e.length;if(t<3)return"";const n=(s,i)=>Math.max(.001,Math.hypot(i.x-s.x,i.y-s.y)**.5);let r=`M ${e[0].x.toFixed(2)} ${e[0].y.toFixed(2)}`;for(let s=0;s<t;s++){const i=e[(s-1+t)%t],o=e[s],a=e[(s+1)%t],l=e[(s+2)%t],c=n(i,o),u=n(o,a),f=n(a,l),h=a.x-o.x+u*((o.x-i.x)/c-(a.x-i.x)/(c+u)),p=a.y-o.y+u*((o.y-i.y)/c-(a.y-i.y)/(c+u)),m=a.x-o.x+u*((l.x-a.x)/f-(l.x-o.x)/(u+f)),g=a.y-o.y+u*((l.y-a.y)/f-(l.y-o.y)/(u+f)),w=o.x+h/3,y=o.y+p/3,x=a.x-m/3,v=a.y-g/3;r+=` C ${w.toFixed(2)} ${y.toFixed(2)}, ${x.toFixed(2)} ${v.toFixed(2)}, ${a.x.toFixed(2)} ${a.y.toFixed(2)}`}return`${r} Z`}function Zd(e,t,n,r){const s=[0,0,0,0].map(()=>Math.max(2,n+(r()-.5)*3));return rD(t,t,e.width-t*2,e.height-t*2,s)}function rD(e,t,n,r,s){const i=u=>Math.min(u,n/2,r/2),[o,a,l,c]=s.map(i);return[`M ${ve(e+o)} ${ve(t)}`,`L ${ve(e+n-a)} ${ve(t)}`,`Q ${ve(e+n)} ${ve(t)} ${ve(e+n)} ${ve(t+a)}`,`L ${ve(e+n)} ${ve(t+r-l)}`,`Q ${ve(e+n)} ${ve(t+r)} ${ve(e+n-l)} ${ve(t+r)}`,`L ${ve(e+c)} ${ve(t+r)}`,`Q ${ve(e)} ${ve(t+r)} ${ve(e)} ${ve(t+r-c)}`,`L ${ve(e)} ${ve(t+o)}`,`Q ${ve(e)} ${ve(t)} ${ve(e+o)} ${ve(t)}`,"Z"].join(" ")}function ve(e){return e.toFixed(2)}const Pt={surface:{radius:12,inset:2.5,roughness:.2,bowing:0,strokeWidth:1.3},field:{radius:8,inset:2,roughness:1.1,strokeWidth:1.3},control:{radius:6,inset:2,roughness:.5,bowing:.6,strokeWidth:1.4},pill:{radius:999,inset:2,roughness:.7,strokeWidth:1}},sD="page-module__page___-uHnG",iD="page-module__outlined___Wwtyg",oD="page-module__surface___sWfI6",aD="page-module__flat___HlOaY",lD="page-module__withAccent___lsv-m",cD="page-module__accentBlue___XxbMV",uD="page-module__accentGreen___Ne6Q8",dD="page-module__accentAmber___kLAwa",fD="page-module__accentRose___O9ZbZ",hD="page-module__accentSlate___xCB66",ei={page:sD,outlined:iD,surface:oD,flat:aD,withAccent:lD,accentBlue:cD,accentGreen:uD,accentAmber:dD,accentRose:fD,accentSlate:hD},pD=qm(ei),mD={all:14,top:14,none:2};function J_({children:e,className:t,style:n,texture:r=!0,withAccent:s=!1,accentColor:i="blue",rounded:o="all",outline:a=!1,sketch:l=!1}){const c=Yi(r,{texture:"white",ruledType:"lines",ruledColor:"blue"})??{backgroundColor:"var(--pui-bg-base)"};return d.jsxs("div",{className:Q(ei.page,a&&ei.outlined,s&&ei.withAccent,s&&pD[i],!l&&ei.flat,t),style:n,children:[d.jsx(jt,{clip:!0,...Pt.surface,radius:mD[o],straight:!l}),d.jsx("div",{className:ei.surface,style:c,children:e})]})}const gD="layout-module__layout___O1aWi",yD="layout-module__header___I-kxe",xD="layout-module__headerLeft___JChJQ",vD="layout-module__headerTitles___aqSUG",wD="layout-module__headerTitle___wvr39",bD="layout-module__headerSubtitle___6f5BD",kD="layout-module__headerActions___adC12",_D="layout-module__mobileToggle___4WpVG",SD="layout-module__body___tywNf",CD="layout-module__mobileOverlay___tzbBC",jD="layout-module__sidebar___8VKGq",PD="layout-module__sidebarOpen___47rtr",ED="layout-module__sidebarInner___tq2X6",TD="layout-module__logoArea___RLnC0",ND="layout-module__logoText___pAmfV",RD="layout-module__nav___FxcrZ",AD="layout-module__main___9z7bu",ID="layout-module__navIslandFixed___H4TwP",MD="layout-module__content___jL-VB",LD="layout-module__contentWithPage___vVdfN",DD="layout-module__footer___LyakU",FD="layout-module__footerText___8BYxc",Ae={layout:gD,header:yD,headerLeft:xD,headerTitles:vD,headerTitle:wD,headerSubtitle:bD,headerActions:kD,mobileToggle:_D,body:SD,mobileOverlay:CD,sidebar:jD,sidebarOpen:PD,sidebarInner:ED,logoArea:TD,logoText:ND,nav:RD,main:AD,navIslandFixed:ID,content:MD,contentWithPage:LD,footer:DD,footerText:FD};function OD(e){return!e||e==="plain"?{backgroundColor:"var(--pui-bg-base)"}:typeof e=="object"&&"image"in e?{backgroundImage:`url(${e.image})`,backgroundRepeat:"repeat",backgroundSize:"200px 200px"}:zi(e)}function $D({children:e,showHeader:t=!0,showFooter:n=!1,showSidebar:r=!0,showPage:s=!0,background:i="paper",title:o,subtitle:a,headerActions:l,headerHeight:c,headerTexture:u,navigationItems:f=[],activeItemId:h,onNavigate:p,logo:m,footerContent:g,navigationIsland:w,style:y,bleedBottom:x=!0,routeKey:v,stackOpen:k}){const[C,S]=b.useState(!1),P=bL();Iu(C,()=>S(!1));const T=OD(i),E=r&&f.length>0,j=c!==void 0||u!==void 0?{...u!==void 0?zi(u):{},...c!==void 0?{height:typeof c=="number"?`${c}px`:c}:{}}:void 0;return d.jsxs("div",{className:Ae.layout,style:{...T,...y},children:[t&&d.jsxs("header",{className:Ae.header,style:j,children:[d.jsxs("div",{className:Ae.headerLeft,children:[E&&d.jsx("button",{type:"button",className:Ae.mobileToggle,onClick:()=>S(!0),"aria-label":"Open navigation",children:d.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",children:d.jsx("path",{d:"M3 5h14M3 10h14M3 15h14",strokeLinecap:"round"})})}),d.jsxs("div",{className:Ae.headerTitles,children:[o&&d.jsx("h1",{className:Ae.headerTitle,children:o}),a&&d.jsx("span",{className:Ae.headerSubtitle,children:a})]})]}),l&&d.jsx("div",{className:Ae.headerActions,children:l})]}),d.jsxs("div",{className:Ae.body,children:[C&&d.jsx("button",{type:"button",className:Ae.mobileOverlay,onClick:()=>S(!1),"aria-label":"Close navigation",tabIndex:-1}),E&&d.jsx("aside",{className:Q(Ae.sidebar,C&&Ae.sidebarOpen),children:d.jsxs("div",{className:Ae.sidebarInner,children:[d.jsx("div",{className:Ae.logoArea,children:m||d.jsx("span",{className:Ae.logoText,children:"Paper UI"})}),d.jsx("nav",{className:Ae.nav,"aria-label":"Main navigation",children:f.map(R=>{const I=R.id===h;return d.jsx(se,{variant:"ghost",size:"small",isActive:I,onClick:()=>{p==null||p(R),S(!1)},"aria-current":I?"page":void 0,icon:R.icon,style:_L,children:R.label},R.id)})})]})}),d.jsx("div",{className:Ae.main,children:d.jsx("main",{className:s?Ae.contentWithPage:Ae.content,style:x?{paddingBottom:0}:void 0,children:(()=>{const R=v!==void 0?d.jsx(hM,{mode:"wait",children:d.jsx(Iv.div,{initial:P?void 0:{opacity:0,y:8},animate:{opacity:1,y:0},exit:P?void 0:{opacity:0,y:-8},transition:{duration:.2,ease:"easeOut"},style:{height:"100%"},children:e},v)}):e;return s?d.jsx(J_,{rounded:x?"top":"all",style:x&&w?{paddingBottom:`calc(${Jd.navIslandBottom} + ${Jd.navIslandHeight} + ${kL[4]})`}:void 0,children:R}):R})()})})]}),w&&d.jsx("div",{className:Ae.navIslandFixed,children:k!==void 0?d.jsx(Iv.div,{animate:{x:k?`-${Jd.stackPanelWidth/2}px`:0},transition:{duration:P?0:.3,ease:[.4,0,.2,1]},children:w}):w}),n&&d.jsx("footer",{className:Ae.footer,children:g||d.jsx("p",{className:Ae.footerText,children:"Paper UI — Natural Materials Component Library"})})]})}const zD="checkbox-module__wrapper___uLYMI",BD="checkbox-module__blobFill___mPJSR",VD="checkbox-module__input___Ptgt7",UD="checkbox-module__blobBg___bw3sn",WD="checkbox-module__labelLeft___-vAmH",HD="checkbox-module__box___yAh-r",GD="checkbox-module__checkmark___tTyBz",KD="checkbox-module__indeterminateLine___IosI-",YD="checkbox-module__boxWrapper___byjoS",qD="checkbox-module__icon___RO-yn",QD="checkbox-module__labelText___bAnLr",XD="checkbox-module__chalkboard___sv6SL",At={wrapper:zD,blobFill:BD,input:VD,blobBg:UD,labelLeft:WD,box:HD,checkmark:GD,indeterminateLine:KD,boxWrapper:YD,icon:qD,labelText:QD,chalkboard:XD},Z_=b.forwardRef(function({label:e,labelPosition:t="right",indeterminate:n=!1,wobble:r=.4,surface:s="paper",className:i,checked:o,onChange:a,id:l,...c},u){const f=b.useId(),h=l??f,p=qi(r),m=b.useRef(null);return b.useEffect(()=>{m.current&&(m.current.indeterminate=n)},[n]),d.jsxs("label",{className:Q(At.wrapper,t==="left"&&At.labelLeft,s==="chalkboard"&&At.chalkboard,i),htmlFor:h,children:[d.jsxs("span",{className:At.boxWrapper,children:[d.jsx("input",{ref:g=>{m.current=g,typeof u=="function"?u(g):u&&(u.current=g)},id:h,type:"checkbox",className:At.input,checked:o,onChange:a,...c}),d.jsx("svg",{className:At.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:d.jsx("path",{d:p.blob,className:At.blobFill})}),d.jsxs("span",{className:At.box,"aria-hidden":"true",children:[d.jsx(jt,{smooth:!0,...Pt.control}),n?d.jsx("svg",{viewBox:"0 0 20 20",fill:"none",className:At.icon,children:d.jsx("line",{x1:"4",y1:"10",x2:"16",y2:"10",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",className:At.indeterminateLine})}):d.jsx("svg",{viewBox:"0 0 20 20",fill:"none",className:At.icon,children:d.jsx("path",{d:"M4 10 L8 14 L16 6",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:At.checkmark})})]})]}),e&&d.jsx("span",{className:At.labelText,children:e})]})}),JD="icon-button-module__iconButton___avg6i",ZD="icon-button-module__blobBg___466Vy",e3="icon-button-module__blobFill___FTN1g",t3="icon-button-module__blobRing___hRdQb",n3="icon-button-module__isActive___XlvtM",r3="icon-button-module__icon___h204x",s3="icon-button-module__ghost___Wbxog",i3="icon-button-module__danger___p0Xz5",o3="icon-button-module__tiny___4WYvA",a3="icon-button-module__small___bPnCU",l3="icon-button-module__medium___nOxPf",c3="icon-button-module__large___UBU5z",u3="icon-button-module__chalkboard___mi0sQ",Yn={iconButton:JD,blobBg:ZD,blobFill:e3,blobRing:t3,isActive:n3,icon:r3,default:"icon-button-module__default___9frNR",ghost:s3,danger:i3,tiny:o3,small:a3,medium:l3,large:c3,chalkboard:u3},ot=b.forwardRef(function({icon:e,variant:t="default",surface:n="paper",size:r="medium",label:s,wobble:i=.5,isActive:o=!1,className:a,...l},c){const u=qi(i);return d.jsxs("button",{ref:c,type:"button",className:Q(Yn.iconButton,Yn[t],n==="chalkboard"&&Yn.chalkboard,Yn[r],o&&Yn.isActive,a),"aria-label":s,title:s,...l,children:[d.jsxs("svg",{className:Yn.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[d.jsx("path",{d:u.blob,className:Yn.blobFill}),d.jsx("path",{d:u.ring,className:Yn.blobRing})]}),d.jsx("span",{className:Yn.icon,children:e})]})}),d3="stamp-module__stamp___5qaNY",f3="stamp-module__small___BBlBg",h3="stamp-module__medium___HG2YD",p3="stamp-module__large___aUT0I",m3="stamp-module__blobBg___Mdrdd",g3="stamp-module__blobFill___QyCeB",y3="stamp-module__blobRing___EUDx7",x3="stamp-module__dot___qZyCR",v3="stamp-module__label___T89iH",w3="stamp-module__chalkboard___syI4T",gr={stamp:d3,small:f3,medium:h3,large:p3,blobBg:m3,blobFill:g3,blobRing:y3,dot:x3,label:v3,chalkboard:w3},ef={neutral:{fill:nt(J.accentSlate,.14),text:J.accentSlateDark,ring:nt(J.accentSlateDark,.35)},info:{fill:nt(J.accentBlue,.14),text:J.accentBlueDark,ring:nt(J.accentBlueDark,.35)},success:{fill:nt(J.accentGreen,.16),text:J.accentGreenDark,ring:nt(J.accentGreenDark,.35)},warning:{fill:nt(J.accentAmber,.16),text:J.accentAmberDark,ring:nt(J.accentAmberDark,.4)},error:{fill:nt(J.accentRose,.16),text:J.accentRoseDark,ring:nt(J.accentRoseDark,.35)}},Fv={fill:nt(J.chalkboardBorderBase,.1),ring:nt(J.chalkboardBorderBase,.35)};function _e({children:e,size:t="medium",variant:n,dot:r=!1,fillColor:s,textColor:i,wobble:o=.3,surface:a="paper",className:l}){const c=qi(o),u=a==="chalkboard",f=n?u?Fv.ring:ef[n].ring:void 0,h=s??(n?u?Fv.fill:ef[n].fill:"transparent"),p=i??(n&&!u?ef[n].text:void 0);return d.jsxs("span",{className:Q(gr.stamp,gr[t],u&&gr.chalkboard,l),style:p?{color:p}:void 0,children:[d.jsxs("svg",{className:gr.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[d.jsx("path",{d:c.blob,className:gr.blobFill,style:{fill:h}}),f&&d.jsx("path",{d:c.ring,className:gr.blobRing,style:{stroke:f}})]}),r&&d.jsx("span",{className:gr.dot,"aria-hidden":"true"}),d.jsx("span",{className:gr.label,children:e})]})}const b3="copy-button-module__copyButton___-hTo4",k3="copy-button-module__dark___O45N-",_3="copy-button-module__chalkboard___hW4aw",S3="copy-button-module__copied___XlHFr",Cl={copyButton:b3,dark:k3,chalkboard:_3,copied:S3};function Zh({text:e,variant:t="light",surface:n="paper",className:r,...s}){const[i,o]=b.useState(!1),a=b.useCallback(async()=>{try{await navigator.clipboard.writeText(e),o(!0),setTimeout(()=>o(!1),1500)}catch(l){console.error("Failed to copy:",l)}},[e]);return d.jsx("button",{type:"button",onClick:a,className:Q(Cl.copyButton,t==="dark"&&Cl.dark,n==="chalkboard"&&Cl.chalkboard,i&&Cl.copied,r),...s,children:i?"Copied!":"Copy"})}const C3="code-block-module__codeBlock___dq28o",j3="code-block-module__header___42Fek",P3="code-block-module__relative___oO-zy",E3="code-block-module__copyOverlay___PjAuq",T3="code-block-module__pre___zXzLZ",N3="code-block-module__chalkboard___bdo9J",R3="code-block-module__chalkboardHeader___3RiVd",A3="code-block-module__chalkboardPre___iRBFR",yr={codeBlock:C3,header:j3,relative:P3,copyOverlay:E3,pre:T3,chalkboard:N3,chalkboardHeader:R3,chalkboardPre:A3};function hG({code:e,filename:t,surface:n="paper"}){return d.jsxs("div",{className:Q(yr.codeBlock,n==="chalkboard"&&yr.chalkboard),children:[t&&d.jsxs("div",{className:Q(yr.header,n==="chalkboard"&&yr.chalkboardHeader),children:[d.jsx("span",{children:t}),d.jsx(Zh,{text:e,variant:"light",surface:n})]}),!t&&d.jsx("div",{className:yr.relative,children:d.jsx("div",{className:yr.copyOverlay,children:d.jsx(Zh,{text:e,variant:"dark",surface:n})})}),d.jsx("pre",{className:Q(yr.pre,n==="chalkboard"&&yr.chalkboardPre),children:d.jsx("code",{children:e})})]})}function Fu({size:e=16}){return d.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),d.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function eS({size:e=16}){return d.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("path",{d:"M9 18h6"}),d.jsx("path",{d:"M10 22h4"}),d.jsx("path",{d:"M15.09 14c.18-.98.65-1.74 1.41-2.5A4.65 4.65 0 0 0 18 8 6 6 0 0 0 6 8c0 1 .23 2.23 1.5 3.5A4.61 4.61 0 0 1 8.91 14"})]})}function tS({size:e=16}){return d.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:d.jsx("polyline",{points:"20 6 9 17 4 12"})})}function I3({size:e=16}){return d.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:d.jsx("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})})}function M3({size:e=16}){return d.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),d.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}function nS({size:e=16}){return d.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:d.jsx("polyline",{points:"9 18 15 12 9 6"})})}const L3="table-module__tableFrame___KP-90",D3="table-module__tableWrapper___gc3Y3",F3="table-module__toolbar___zhCel",O3="table-module__toolbarTitle___D8oH-",$3="table-module__panelFooter___lCCKo",z3="table-module__compact___mG-2Y",B3="table-module__toolbarActions___EX6qS",V3="table-module__search___zIBk2",U3="table-module__searchIcon___ayhK8",W3="table-module__searchInput___PqsEG",H3="table-module__tableScroll___1gvc4",G3="table-module__table___tdU5g",K3="table-module__th___GQbKk",Y3="table-module__td___WktB5",q3="table-module__footerCell___bM-jv",Q3="table-module__tr___xeZno",X3="table-module__expandTh___uxkR4",J3="table-module__expandTd___VoBRC",Z3="table-module__expandIcon___8V45X",eF="table-module__expandable___R7o2l",tF="table-module__footerRow___ik1DH",nF="table-module__expandedRow___1TbTQ",rF="table-module__expandedCell___sKAaD",sF="table-module__boardScroll___Y1yqm",iF="table-module__board___kFAI-",oF="table-module__boardColumn___-W9bP",aF="table-module__boardColumnHeader___kY3Fj",lF="table-module__accentBlue___PEJ1V",cF="table-module__accentGreen___wJ53r",uF="table-module__accentAmber___Iezjv",dF="table-module__accentRose___W8zxc",fF="table-module__accentSlate___oUZCX",hF="table-module__boardColumnLabel___JBEed",pF="table-module__boardColumnCount___Pkpiq",mF="table-module__boardColumnBody___uAgRF",gF="table-module__boardRow___C1P60",yF="table-module__boardEmpty___IKv2W",xF="table-module__chalkboardFrame___xB3N5",vF="table-module__chalkboardWrapper___KjY5r",wF="table-module__chalkboard___v0m3A",re={tableFrame:L3,tableWrapper:D3,toolbar:F3,toolbarTitle:O3,panelFooter:$3,compact:z3,toolbarActions:B3,search:V3,searchIcon:U3,searchInput:W3,tableScroll:H3,table:G3,th:K3,td:Y3,footerCell:q3,tr:Q3,expandTh:X3,expandTd:J3,expandIcon:Z3,expandable:eF,footerRow:tF,expandedRow:nF,expandedCell:rF,boardScroll:sF,board:iF,boardColumn:oF,boardColumnHeader:aF,accentBlue:lF,accentGreen:cF,accentAmber:uF,accentRose:dF,accentSlate:fF,boardColumnLabel:hF,boardColumnCount:pF,boardColumnBody:mF,boardRow:gF,boardEmpty:yF,chalkboardFrame:xF,chalkboardWrapper:vF,chalkboard:wF},bF=qm(re);function kF({data:e=[],columns:t=[],board:n,surface:r="paper",texture:s=!0,toolbar:i,expandable:o,showExpandColumn:a=!0,rowKey:l,rowClassName:c,rowTexture:u,rowFooter:f,hideHeader:h=!1,density:p="comfortable",panelFooter:m,className:g}){const w=Yi(s,r==="chalkboard"?"chalkboard":"paper"),y=!!i,[x,v]=b.useState(new Set),k=P=>{v(T=>{const E=new Set(T);return E.has(P)?E.delete(P):E.add(P),E})},C=!!(o&&a),S=C?t.length+1:t.length;return d.jsxs("div",{className:Q(re.tableFrame,r==="chalkboard"&&re.chalkboardFrame,g),children:[d.jsx(jt,{clip:!0,...Pt.surface}),d.jsxs("div",{className:Q(re.tableWrapper,r==="chalkboard"&&re.chalkboardWrapper,p==="compact"&&re.compact),style:w,children:[y&&d.jsxs("div",{className:re.toolbar,children:[i.title&&d.jsx("div",{className:re.toolbarTitle,children:i.title}),i.search&&d.jsxs("div",{className:re.search,children:[d.jsx(_F,{className:re.searchIcon}),d.jsx("input",{type:"text",className:re.searchInput,placeholder:i.search.placeholder??"Search...","aria-label":i.search.placeholder??"Search",value:i.search.value,onChange:P=>{var T,E;return(E=(T=i.search)==null?void 0:T.onChange)==null?void 0:E.call(T,P.target.value)}}),d.jsx(jt,{fill:!0,...Pt.field})]}),i.actions&&d.jsx("div",{className:re.toolbarActions,children:typeof i.actions=="function"?i.actions(r):i.actions})]}),n?d.jsx("div",{className:re.boardScroll,children:d.jsx("div",{className:re.board,children:n.map(P=>d.jsxs("div",{className:re.boardColumn,children:[d.jsxs("div",{className:Q(re.boardColumnHeader,r==="chalkboard"&&re.chalkboard,P.accent&&bF[P.accent]),children:[d.jsx("span",{className:re.boardColumnLabel,children:P.label}),d.jsx("span",{className:re.boardColumnCount,children:P.items.length})]}),d.jsx("div",{className:re.boardColumnBody,children:P.items.length===0?d.jsx("div",{className:re.boardEmpty,children:P.emptyLabel??"empty"}):P.items.map((T,E)=>d.jsx("div",{className:Q(re.boardRow,r==="chalkboard"&&re.chalkboard),children:P.renderItem(T,E,r)},P.getKey?P.getKey(T,E):E))})]},P.key))})}):d.jsx("div",{className:re.tableScroll,children:d.jsxs("table",{className:Q(re.table,r==="chalkboard"&&re.chalkboard,p==="compact"&&re.compact),children:[d.jsxs("colgroup",{children:[C&&d.jsx("col",{style:{width:"48px"}}),t.map(P=>d.jsx("col",{style:P.width?{width:`${P.width*32}px`}:void 0},P.key))]}),!h&&d.jsx("thead",{children:d.jsxs("tr",{children:[C&&d.jsx("th",{className:Q(re.th,re.expandTh),"aria-label":"Expand"}),t.map(P=>d.jsx("th",{className:re.th,style:P.align?{textAlign:P.align}:void 0,children:P.header},P.key))]})}),d.jsx("tbody",{children:e.map((P,T)=>{const E=l?l(P,T):T,j=o==null?void 0:o.render(P,T,r),R=f==null?void 0:f(P,T,r),I=!!j,D=I&&x.has(E),$=u==null?void 0:u(P,T);return d.jsxs(b.Fragment,{children:[d.jsxs("tr",{className:Q(re.tr,I&&re.expandable,c==null?void 0:c(P,T)),style:$?zi($):void 0,onClick:()=>I&&k(E),children:[C&&d.jsx("td",{className:Q(re.td,re.expandTd),children:I&&d.jsx("button",{type:"button",className:re.expandIcon,"aria-expanded":D,"aria-label":D?"Collapse row":"Expand row",onClick:A=>{A.stopPropagation(),k(E)},children:d.jsx(nS,{size:14})})}),t.map(A=>d.jsx("td",{className:re.td,style:A.align?{textAlign:A.align}:void 0,children:A.cell(P,T,r)},A.key))]}),R&&d.jsx("tr",{className:re.footerRow,style:$?zi($):void 0,children:d.jsx("td",{colSpan:S,className:re.footerCell,children:R})}),D&&d.jsx("tr",{className:re.expandedRow,children:d.jsx("td",{colSpan:S,className:re.expandedCell,children:j})})]},E)})})]})}),m&&d.jsx("div",{className:re.panelFooter,children:m})]})]})}function _F({className:e}){return d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e,"aria-hidden":"true",children:[d.jsx("circle",{cx:"11",cy:"11",r:"8"}),d.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]})}const SF="card-module__borderLayer___WSpJq",CF="card-module__elevated___uhWj9",jF="card-module__textureLayer___Kcofz",PF="card-module__flat___KnG5z",EF="card-module__small___HXUTr",TF="card-module__withAccent___2t7bV",NF="card-module__accentBlue___a1KIq",RF="card-module__accentGreen___RNWoA",AF="card-module__accentAmber___uMhom",IF="card-module__accentRose___VPI3t",MF="card-module__accentSlate___-l4jE",LF="card-module__chalkboard___bQ48O",kr={borderLayer:SF,default:"card-module__default___glPy-",elevated:CF,textureLayer:jF,flat:PF,small:EF,withAccent:TF,accentBlue:NF,accentGreen:RF,accentAmber:AF,accentRose:IF,accentSlate:MF,chalkboard:LF},DF=qm(kr);function de({children:e,variant:t="default",surface:n="paper",size:r="medium",texture:s="parchment",fill:i,shade:o=!1,accent:a=!1,accentColor:l="blue",sketch:c=!1,className:u}){const f=n==="chalkboard"||s===!1?void 0:X_({...s===!0||typeof s=="string"?{texture:s===!0?"parchment":s}:s,...i?{fill:i}:{},...o?{shade:o}:{}});return d.jsxs("div",{className:Q(kr.borderLayer,kr[t],n==="chalkboard"&&kr.chalkboard,kr[r],a&&kr.withAccent,a&&DF[l],!c&&kr.flat,u),children:[d.jsx(jt,{clip:!0,...Pt.surface,straight:!c}),d.jsx("div",{className:kr.textureLayer,style:f,children:e})]})}const FF="input-module__wrapper___xaEw6",OF="input-module__label___lu7R1",$F="input-module__field___khFpX",zF="input-module__input___h7K-F",BF="input-module__small___SkByh",VF="input-module__medium___0QPuV",UF="input-module__large___zGwRu",WF="input-module__error___QDqga",HF="input-module__disabled___K-5hi",GF="input-module__helperText___njeLH",KF="input-module__helperError___qDBpD",YF="input-module__chalkboard___Xh-5s",Pn={wrapper:FF,label:OF,field:$F,input:zF,small:BF,medium:VF,large:UF,error:WF,disabled:HF,helperText:GF,helperError:KF,chalkboard:YF},La=b.forwardRef(function({label:e,helperText:t,error:n=!1,size:r="medium",surface:s="paper",className:i,id:o,...a},l){const c=b.useId(),u=o??c;return d.jsxs("div",{className:Q(Pn.wrapper,s==="chalkboard"&&Pn.chalkboard,i),children:[e&&d.jsx("label",{htmlFor:u,className:Pn.label,children:e}),d.jsxs("span",{className:Q(Pn.field,Pn[r],n&&Pn.error,a.disabled&&Pn.disabled),children:[d.jsx("input",{ref:l,id:u,className:Pn.input,...a}),d.jsx(jt,{fill:!0,...Pt.field})]}),t&&d.jsx("span",{className:Q(Pn.helperText,n&&Pn.helperError),children:t})]})}),qF="select-module__wrapper___Hc5F3",QF="select-module__label___ay-3s",XF="select-module__nativeSelect___UA2d-",JF="select-module__trigger___xMYHi",ZF="select-module__open___w3mbZ",eO="select-module__triggerLabel___ihpER",tO="select-module__placeholder___0VOFP",nO="select-module__small___iU9W9",rO="select-module__chevron___0dCTg",sO="select-module__medium___B-XBN",iO="select-module__large___iII2c",oO="select-module__chevronOpen___cFOYe",aO="select-module__error___P5RBk",lO="select-module__dropdown___Q-uK3",cO="select-module__slideDown___sT374",uO="select-module__options___HmrQ0",dO="select-module__option___vNnue",fO="select-module__optionDisabled___ex2zq",hO="select-module__optionSelected___tAFjn",pO="select-module__optionHighlighted___zYQLq",mO="select-module__helperText___r5gyn",gO="select-module__helperError___ydSPT",yO="select-module__chalkboard___sXBw8",Le={wrapper:qF,label:QF,nativeSelect:XF,trigger:JF,open:ZF,triggerLabel:eO,placeholder:tO,small:nO,chevron:rO,medium:sO,large:iO,chevronOpen:oO,error:aO,dropdown:lO,slideDown:cO,options:uO,option:dO,optionDisabled:fO,optionSelected:hO,optionHighlighted:pO,helperText:mO,helperError:gO,chalkboard:yO};function rS({label:e,helperText:t,error:n=!1,size:r="medium",surface:s="paper",options:i,placeholder:o,value:a,defaultValue:l,onChange:c,name:u,disabled:f=!1,width:h,texture:p=!1,className:m}){const g=b.useId(),[w,y]=b.useState(!1),[x,v]=b.useState(-1),[k,C]=b.useState(l??""),[S,P]=b.useState(null),T=b.useRef(null),E=b.useRef(null),j=a!==void 0,R=j?a:k,I=i.find(_=>_.value===R),D=(I==null?void 0:I.label)??o??"Select...",$=b.useCallback(()=>{if(f)return;y(!0);const _=i.findIndex(B=>B.value===R);v(_>=0?_:0)},[f,i,R]),A=b.useCallback(()=>{y(!1),v(-1)},[]),z=b.useCallback(_=>{var B;_.disabled||(j||C(_.value),c==null||c(_.value),A(),(B=T.current)==null||B.focus())},[j,c,A]),O=b.useCallback(_=>{if(!f)switch(_.key){case"Enter":case" ":_.preventDefault(),w&&x>=0?z(i[x]):$();break;case"Escape":_.preventDefault(),w&&A();break;case"ArrowDown":_.preventDefault(),w?v(B=>{let q=B+1;for(;q<i.length&&i[q].disabled;)q++;return q<i.length?q:B}):$();break;case"ArrowUp":_.preventDefault(),w?v(B=>{let q=B-1;for(;q>=0&&i[q].disabled;)q--;return q>=0?q:B}):$();break;case"Home":if(_.preventDefault(),w){let B=0;for(;B<i.length&&i[B].disabled;)B++;B<i.length&&v(B)}break;case"End":if(_.preventDefault(),w){let B=i.length-1;for(;B>=0&&i[B].disabled;)B--;B>=0&&v(B)}break;case"Tab":w&&A();break}},[f,w,x,i,$,A,z]);b.useEffect(()=>{if(!w)return;const _=B=>{var q,N;const ae=B.target;(q=T.current)!=null&&q.contains(ae)||(N=E.current)!=null&&N.contains(ae)||A()};return document.addEventListener("mousedown",_),()=>document.removeEventListener("mousedown",_)},[w,A]),b.useEffect(()=>{if(!w||x<0||!E.current)return;const _=E.current.querySelector(`[data-option-index="${x}"]`);_==null||_.scrollIntoView({block:"nearest"})},[w,x]),b.useEffect(()=>{if(!w){P(null);return}const _=()=>{if(!T.current)return;const B=T.current.getBoundingClientRect();if(B.bottom<0||B.top>window.innerHeight){A();return}P(B)};return _(),document.addEventListener("scroll",_,{capture:!0,passive:!0}),window.addEventListener("resize",_,{passive:!0}),()=>{document.removeEventListener("scroll",_,{capture:!0}),window.removeEventListener("resize",_)}},[w,A]);const L=Yi(p),V=L?{"--sketch-fill":L.backgroundColor}:void 0;return d.jsxs("div",{className:Q(Le.wrapper,s==="chalkboard"&&Le.chalkboard,m),style:h?{width:typeof h=="number"?`${h}px`:h}:void 0,children:[e&&d.jsx("label",{htmlFor:g,className:Le.label,children:e}),d.jsxs("select",{id:g,name:u,className:Le.nativeSelect,value:R,onChange:_=>c==null?void 0:c(_.target.value),disabled:f,"aria-hidden":"true",tabIndex:-1,children:[o&&d.jsx("option",{value:"",children:o}),i.map(_=>d.jsx("option",{value:_.value,disabled:_.disabled,children:_.label},_.value))]}),d.jsxs("button",{ref:T,type:"button",role:"combobox","aria-expanded":w,"aria-haspopup":"listbox","aria-controls":w?`${g}-listbox`:void 0,"aria-activedescendant":w&&x>=0?`${g}-option-${x}`:void 0,className:Q(Le.trigger,Le[r],n&&Le.error,w&&Le.open,f&&Le.disabled),onClick:()=>w?A():$(),onKeyDown:O,disabled:f,children:[d.jsx("span",{className:Q(Le.triggerLabel,!I&&Le.placeholder),children:D}),d.jsx(xO,{className:Q(Le.chevron,w&&Le.chevronOpen)}),d.jsx(jt,{fill:!0,...Pt.field})]}),w&&S&&Os.createPortal(d.jsxs("div",{ref:E,id:`${g}-listbox`,role:"listbox",tabIndex:-1,className:Le.dropdown,style:{...V,position:"fixed",top:S.bottom+6,left:S.left,width:S.width},onKeyDown:_=>{var B;_.key==="Escape"&&(_.preventDefault(),A(),(B=T.current)==null||B.focus())},children:[d.jsx(jt,{fill:!0,...Pt.surface}),d.jsx("div",{className:Le.options,children:i.map((_,B)=>d.jsx("div",{id:`${g}-option-${B}`,role:"option","aria-selected":_.value===R,tabIndex:-1,"data-option-index":B,className:Q(Le.option,_.value===R&&Le.optionSelected,B===x&&Le.optionHighlighted,_.disabled&&Le.optionDisabled),onClick:q=>{q.stopPropagation(),z(_)},onMouseEnter:()=>v(B),children:_.label},_.value))})]}),document.body),t&&d.jsx("span",{className:Q(Le.helperText,n&&Le.helperError),children:t})]})}function xO({className:e}){return d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e,"aria-hidden":"true",children:d.jsx("polyline",{points:"6 9 12 15 18 9"})})}function sS({variant:e}){switch(e){case"info":return d.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("circle",{cx:"12",cy:"12",r:"10"}),d.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),d.jsx("circle",{cx:"12",cy:"8",r:"0.5",fill:"currentColor"})]});case"success":return d.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),d.jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]});case"warning":return d.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"}),d.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),d.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]});case"error":return d.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("circle",{cx:"12",cy:"12",r:"10"}),d.jsx("line",{x1:"15",y1:"9",x2:"9",y2:"15"}),d.jsx("line",{x1:"9",y1:"9",x2:"15",y2:"15"})]})}}const vO="alert-module__alert___j7ZRS",wO="alert-module__surface___IaVgU",bO="alert-module__iconWrapper___kLoxT",kO="alert-module__message___klR2U",_O="alert-module__dismiss___f2uoG",SO="alert-module__info___PBo1l",CO="alert-module__success___AVBKS",jO="alert-module__warning___zkMaJ",PO="alert-module__error___cxg96",EO="alert-module__chalkboard___7pgWk",ls={alert:vO,surface:wO,iconWrapper:bO,message:kO,dismiss:_O,info:SO,success:CO,warning:jO,error:PO,chalkboard:EO};function iS({children:e,variant:t="info",surface:n="paper",texture:r="kraft",dismissible:s=!1,onDismiss:i,className:o}){const a=n==="chalkboard";return d.jsxs("div",{className:Q(ls.alert,ls[t],a&&ls.chalkboard,o),role:t==="warning"||t==="error"?"alert":"status",children:[d.jsx(jt,{clip:!0,...Pt.surface}),d.jsx("div",{className:ls.surface,style:a?void 0:Yi(r)}),d.jsx("span",{className:ls.iconWrapper,children:d.jsx(sS,{variant:t})}),d.jsx("div",{className:ls.message,children:e}),s&&d.jsx("button",{type:"button",className:ls.dismiss,onClick:i,"aria-label":"Dismiss alert",children:d.jsx(Fu,{size:16})})]})}const TO="modal-module__overlay___a52Ni",NO="modal-module__fadeIn___5OWd5",RO="modal-module__backdrop___RS4yj",AO="modal-module__modal___ZioOV",IO="modal-module__slideUp___vfFrm",MO="modal-module__small___hcxwF",LO="modal-module__medium___mjbM5",DO="modal-module__large___1dzyf",FO="modal-module__header___iP09B",OO="modal-module__title___nj06m",$O="modal-module__close___gQou9",zO="modal-module__body___Y-EdA",BO="modal-module__chalkboard___qY8qo",qn={overlay:TO,fadeIn:NO,backdrop:RO,modal:AO,slideUp:IO,small:MO,medium:LO,large:DO,header:FO,title:OO,close:$O,body:zO,chalkboard:BO},VO='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';function Qi({open:e,onClose:t,title:n,children:r,size:s="medium",surface:i="paper",texture:o=!1,className:a}){const l=b.useId(),c=b.useRef(null),u=b.useRef(null);if(Iu(e,t),b.useEffect(()=>{var h;if(!e)return;u.current=document.activeElement,(h=c.current)==null||h.focus();const p=g=>{var w;if(g.key!=="Tab")return;const y=(w=c.current)==null?void 0:w.querySelectorAll(VO);if(!y||y.length===0){g.preventDefault();return}const x=y[0],v=y[y.length-1];g.shiftKey&&document.activeElement===x?(g.preventDefault(),v.focus()):!g.shiftKey&&document.activeElement===v&&(g.preventDefault(),x.focus())};document.addEventListener("keydown",p);const m=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{var g,w;document.removeEventListener("keydown",p),document.body.style.overflow=m,(w=(g=u.current)==null?void 0:g.focus)==null||w.call(g)}},[e]),!e||typeof document>"u")return null;const f=Yi(o);return Os.createPortal(d.jsxs("div",{className:qn.overlay,children:[d.jsx("button",{type:"button",className:qn.backdrop,"aria-label":"Close modal",onClick:t}),d.jsxs("div",{ref:c,className:Q(qn.modal,qn[s],i==="chalkboard"&&qn.chalkboard,a),style:f,role:"dialog","aria-modal":"true","aria-labelledby":n?l:void 0,tabIndex:-1,children:[d.jsxs("div",{className:qn.header,children:[n&&d.jsx("h2",{id:l,className:qn.title,children:n}),d.jsx("button",{type:"button",className:qn.close,onClick:t,"aria-label":"Close modal",children:d.jsx(Fu,{size:18})})]}),d.jsx("div",{className:qn.body,children:r})]})]}),document.body)}const UO="textarea-module__wrapper___NbiNO",WO="textarea-module__label___ejhyZ",HO="textarea-module__field___KluQf",GO="textarea-module__textarea___0y-7v",KO="textarea-module__resizeGrip___lONlE",YO="textarea-module__small___yPyr8",qO="textarea-module__medium___ezQxA",QO="textarea-module__large___xfeKi",XO="textarea-module__error___EkXKJ",JO="textarea-module__disabled___9CKbb",ZO="textarea-module__helperText___l1sPh",e$="textarea-module__helperError___VfTLy",t$="textarea-module__chalkboard___zZ0X0",dn={wrapper:UO,label:WO,field:HO,textarea:GO,resizeGrip:KO,small:YO,medium:qO,large:QO,error:XO,disabled:JO,helperText:ZO,helperError:e$,chalkboard:t$},n$=48,Da=b.forwardRef(function({label:e,helperText:t,error:n=!1,size:r="medium",surface:s="paper",className:i,id:o,...a},l){const c=b.useId(),u=o??c,f=b.useRef(null),h=b.useCallback(m=>{f.current=m,typeof l=="function"?l(m):l&&(l.current=m)},[l]),p=b.useCallback(m=>{const g=f.current;if(!g)return;m.preventDefault();const w=m.clientY,y=g.offsetHeight,x=k=>{g.style.height=`${Math.max(n$,y+k.clientY-w)}px`},v=()=>{window.removeEventListener("pointermove",x),window.removeEventListener("pointerup",v)};window.addEventListener("pointermove",x),window.addEventListener("pointerup",v)},[]);return d.jsxs("div",{className:Q(dn.wrapper,s==="chalkboard"&&dn.chalkboard,i),children:[e&&d.jsx("label",{htmlFor:u,className:dn.label,children:e}),d.jsxs("span",{className:Q(dn.field,dn[r],n&&dn.error,a.disabled&&dn.disabled),children:[d.jsx("textarea",{ref:h,id:u,className:dn.textarea,...a}),d.jsx(jt,{fill:!0,...Pt.field}),!a.disabled&&d.jsx("span",{className:dn.resizeGrip,onPointerDown:p,"aria-hidden":"true",title:"Drag to resize",children:d.jsxs("svg",{viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:[d.jsx("path",{d:"M11 4.5 L4.5 11"}),d.jsx("path",{d:"M11 8.5 L8.5 11"})]})})]}),t&&d.jsx("span",{className:Q(dn.helperText,n&&dn.helperError),children:t})]})}),r$="progress-module__track___a5BMO",s$="progress-module__svg___3U0-E",Ov={track:r$,svg:s$},tf=300,xr=1;function i$({value:e,max:t=100,color:n,height:r=6,surface:s="paper",className:i}){const o=t>0?Math.max(0,Math.min(100,Math.round(e/t*100))):0,a=s==="chalkboard",l=Math.max(1,Math.round(Du()*1e6)),c=a?nt(J.chalkboardBorderBase,.16):nt(J.textPrimary,.12),u=n??(a?J.chalkboardChalk:J.textSecondary),f=b.useMemo(()=>Oe.toPaths(Oe.rectangle(xr,xr,tf-xr*2,r-xr*2,{seed:l,roughness:2.2,fill:c,fillStyle:"solid",stroke:c,strokeWidth:1.5})),[l,c,r]),h=Math.max(o/100*(tf-xr*2),0),p=b.useMemo(()=>h>0?Oe.toPaths(Oe.rectangle(xr,xr,h,r-xr*2,{seed:l+1,roughness:2,fill:u,fillStyle:"solid",stroke:u,strokeWidth:1})):[],[l,u,h,r]);return d.jsx("div",{className:Q(Ov.track,i),style:{height:r,borderRadius:r/2},children:d.jsxs("svg",{className:Ov.svg,viewBox:`0 0 ${tf} ${r}`,preserveAspectRatio:"none","aria-hidden":"true",children:[f.map((m,g)=>d.jsx("path",{d:m.d,stroke:m.stroke,strokeWidth:m.strokeWidth,fill:m.fill},g)),p.map((m,g)=>d.jsx("path",{d:m.d,stroke:m.stroke,strokeWidth:m.strokeWidth,fill:m.fill},g))]})})}function o$(e){const t=Du();return b.useMemo(()=>({blob:NL({seed:t,wobble:e}),ring:RL(t,e)}),[t,e])}const a$="list-item-module__listItem___-tw9O",l$="list-item-module__clickable___GLJmd",c$="list-item-module__blobBg___O3Mzh",u$="list-item-module__blobFill___dXHk1",d$="list-item-module__blobRing___S9mas",f$="list-item-module__active___UsL8O",h$="list-item-module__small___9dphK",p$="list-item-module__medium___yGZCr",m$="list-item-module__icon___2b4wU",g$="list-item-module__label___SIzJ4",y$="list-item-module__action___qGh0-",x$="list-item-module__chalkboard___qpWuM",Kt={listItem:a$,static:"list-item-module__static___qtEX6",clickable:l$,blobBg:c$,blobFill:u$,blobRing:d$,active:f$,small:h$,medium:p$,icon:m$,label:g$,action:y$,chalkboard:x$};function Dn({active:e=!1,icon:t,action:n,size:r="medium",wobble:s=.5,surface:i="paper",children:o,className:a,...l}){const c=o$(s),u=!!l.onClick;return d.jsxs("button",{type:"button",className:Q(Kt.listItem,Kt[r],u&&Kt.clickable,!u&&!e&&Kt.static,e&&Kt.active,i==="chalkboard"&&Kt.chalkboard,a),"aria-current":e?"page":void 0,...l,children:[d.jsxs("svg",{className:Kt.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[d.jsx("path",{d:c.blob,className:Kt.blobFill}),d.jsx("path",{d:c.ring,className:Kt.blobRing})]}),t&&d.jsx("span",{className:Kt.icon,children:t}),d.jsx("span",{className:Kt.label,children:o}),n&&d.jsx("span",{className:Kt.action,children:n})]})}const v$="accordion-module__accordion___mqGl-",w$="accordion-module__header___mLfbd",b$="accordion-module__icon___Z90NR",k$="accordion-module__title___HusgG",_$="accordion-module__content___1K0td",S$="accordion-module__chalkboard___am8r4",C$="accordion-module__expanded___836xG",cs={accordion:v$,header:w$,icon:b$,title:k$,content:_$,chalkboard:S$,expanded:C$};function j$({title:e,children:t,expanded:n=!1,onToggle:r,surface:s="paper",className:i}){return d.jsxs("div",{className:Q(cs.accordion,n&&cs.expanded,s==="chalkboard"&&cs.chalkboard,i),children:[d.jsxs("button",{type:"button",className:cs.header,onClick:r,"aria-expanded":n,children:[d.jsx("span",{className:cs.icon,"aria-hidden":"true",children:d.jsx(nS,{size:14})}),d.jsx("span",{className:cs.title,children:e})]}),n&&d.jsx("div",{className:cs.content,children:t})]})}const P$="icon-module__icon___2vrJz",E$="icon-module__blobBg___ENPYJ",T$="icon-module__blobFill___IPbwQ",N$="icon-module__blobRing___1awqV",R$="icon-module__content___TaZR6",A$="icon-module__small___Xp--F",I$="icon-module__medium___tCjMB",M$="icon-module__large___vBtP7",Ys={icon:P$,blobBg:E$,blobFill:T$,blobRing:N$,content:R$,small:A$,medium:I$,large:M$},L$={small:20,medium:24,large:28};function D$({icon:e,size:t="medium",wobble:n=.5,fillColor:r,className:s}){const i=qi(n),o=L$[t];return d.jsxs("span",{className:Q(Ys.icon,Ys[t],s),children:[d.jsxs("svg",{className:Ys.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[d.jsx("path",{d:i.blob,className:Ys.blobFill,style:r?{fill:r}:void 0}),d.jsx("path",{d:i.ring,className:Ys.blobRing})]}),d.jsx("span",{className:Ys.content,style:{width:o,height:o},children:e})]})}const F$="radio-module__wrapper___BB05E",O$="radio-module__blobFill___p5BX4",$$="radio-module__labelLeft___ijB93",z$="radio-module__input___M2nFJ",B$="radio-module__box___H7ofS",V$="radio-module__dot___jVJ-d",U$="radio-module__boxWrapper___Y3qis",W$="radio-module__blobBg___IR-M5",H$="radio-module__labelText___I-nu3",G$="radio-module__chalkboard___IIBqI",En={wrapper:F$,blobFill:O$,labelLeft:$$,input:z$,box:B$,dot:V$,boxWrapper:U$,blobBg:W$,labelText:H$,chalkboard:G$};b.forwardRef(function({label:e,labelPosition:t="right",wobble:n=.4,surface:r="paper",className:s,checked:i,onChange:o,id:a,...l},c){const u=b.useId(),f=a??u,h=qi(n);return d.jsxs("label",{className:Q(En.wrapper,t==="left"&&En.labelLeft,r==="chalkboard"&&En.chalkboard,s),htmlFor:f,children:[d.jsxs("span",{className:En.boxWrapper,children:[d.jsx("input",{ref:c,id:f,type:"radio",className:En.input,checked:i,onChange:o,...l}),d.jsx("svg",{className:En.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:d.jsx("path",{d:h.blob,className:En.blobFill})}),d.jsxs("span",{className:En.box,"aria-hidden":"true",children:[d.jsx(jt,{smooth:!0,shape:"circle",...Pt.control}),d.jsx("span",{className:En.dot})]})]}),e&&d.jsx("span",{className:En.labelText,children:e})]})});const K$="switch-module__wrapper___5-2P1",Y$="switch-module__labelLeft___WlT-N",q$="switch-module__input___YKZRj",Q$="switch-module__track___QNvnO",X$="switch-module__thumb___cunvF",J$="switch-module__small___WPIxc",Z$="switch-module__medium___yPulW",ez="switch-module__large___VlKV1",tz="switch-module__labelText___9Qg39",nz="switch-module__chalkboard___qKTMz",vr={wrapper:K$,labelLeft:Y$,input:q$,track:Q$,thumb:X$,small:J$,medium:Z$,large:ez,labelText:tz,chalkboard:nz},rz=b.forwardRef(function({label:e,labelPosition:t="right",size:n="medium",surface:r="paper",className:s,checked:i,onChange:o,id:a,...l},c){const u=b.useId(),f=a??u;return d.jsxs("label",{className:Q(vr.wrapper,vr[n],t==="left"&&vr.labelLeft,r==="chalkboard"&&vr.chalkboard,s),htmlFor:f,children:[d.jsx("input",{ref:c,id:f,type:"checkbox",className:vr.input,checked:i,onChange:o,...l}),d.jsxs("span",{className:vr.track,"aria-hidden":"true",children:[d.jsx(jt,{...Pt.pill}),d.jsx("span",{className:vr.thumb})]}),e&&d.jsx("span",{className:vr.labelText,children:e})]})}),sz="spinner-module__spinner___FDTk2",iz="spinner-module__chalkboard___DLE1z",oz="spinner-module__svg___JnCWN",az="spinner-module__track___xbnbo",lz="spinner-module__head___j5dWe",ko={spinner:sz,chalkboard:iz,svg:oz,track:az,head:lz},cz={small:18,medium:28,large:40},$v=25,uz=18,zv=Oe.toPaths(Oe.circle($v,$v,uz*2,{seed:7,roughness:1.15,disableMultiStroke:!0})).map(e=>e.d).join(" ");function ar({size:e="medium",color:t,label:n="Loading",surface:r="paper",className:s}){const i=cz[e];return d.jsx("span",{className:Q(ko.spinner,r==="chalkboard"&&ko.chalkboard,s),role:"status","aria-label":n,children:d.jsxs("svg",{width:i,height:i,viewBox:"0 0 50 50",className:ko.svg,style:t?{color:t}:void 0,"aria-hidden":"true",children:[d.jsx("path",{className:ko.track,d:zv,fill:"none",pathLength:100,strokeLinecap:"round"}),d.jsx("path",{className:ko.head,d:zv,fill:"none",pathLength:100,strokeLinecap:"round"})]})})}const dz="skeleton-module__skeleton___HCSvg",fz="skeleton-module__pulse___6eCq1",hz="skeleton-module__svg___OzxGp",pz="skeleton-module__text___v17Nv",mz="skeleton-module__rect___wqIJy",gz="skeleton-module__circle___RCmyR",nf={skeleton:dz,pulse:fz,svg:hz,text:pz,rect:mz,circle:gz},Bv={text:[0,0,200,24],rect:[0,0,200,100],circle:[0,0,40,40]},qs=2;function Mt({variant:e="text",width:t,height:n,surface:r="paper",className:s,style:i}){const o=r==="chalkboard",a=Math.max(1,Math.round(Du()*1e6)),l=o?nt(J.chalkboardBorderBase,.16):nt(J.textPrimary,.09),c=b.useMemo(()=>{const[,,u,f]=Bv[e],h=e==="circle"?Oe.ellipse(u/2,f/2,u-qs*2,f-qs*2,{seed:a,roughness:1.5,fill:l,fillStyle:"solid",stroke:l,strokeWidth:1}):Oe.rectangle(qs,qs,u-qs*2,f-qs*2,{seed:a,roughness:1.4,fill:l,fillStyle:"solid",stroke:l,strokeWidth:1});return Oe.toPaths(h)},[e,a,l]);return d.jsx("span",{className:Q(nf.skeleton,nf[e],s),style:{width:t,height:n,...i},"aria-hidden":"true",children:d.jsx("svg",{className:nf.svg,viewBox:Bv[e].join(" "),preserveAspectRatio:"none","aria-hidden":"true",children:c.map((u,f)=>d.jsx("path",{d:u.d,stroke:u.stroke,strokeWidth:u.strokeWidth,fill:u.fill},f))})})}const yz="divider-module__horizontal___tP3rG",xz="divider-module__line___KnBes",vz="divider-module__label___WiUwZ",wz="divider-module__vertical___wBSrT",bz="divider-module__chalkboard___gXTde",Qs={horizontal:yz,line:xz,label:vz,vertical:wz,chalkboard:bz};function Ou({orientation:e="horizontal",label:t,surface:n="paper",className:r}){const s=n==="chalkboard"&&Qs.chalkboard;return e==="vertical"?d.jsx("span",{className:Q(Qs.vertical,s,r),role:"separator","aria-orientation":"vertical"}):d.jsxs("div",{className:Q(Qs.horizontal,s,r),role:"separator",children:[d.jsx("span",{className:Qs.line}),t!=null&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:Qs.label,children:t}),d.jsx("span",{className:Qs.line})]})]})}const kz="tooltip-module__wrapper___XeVNe",_z="tooltip-module__tooltip___e-rkz",Sz="tooltip-module__tooltipIn___CZbRw",Cz="tooltip-module__top___78WWU",jz="tooltip-module__bottom___Irl3O",Pz="tooltip-module__left___C1Ec4",Ez="tooltip-module__right___oUA-Z",Tz="tooltip-module__chalkboard___Um6dx",jl={wrapper:kz,tooltip:_z,tooltipIn:Sz,top:Cz,bottom:jz,left:Pz,right:Ez,chalkboard:Tz},Pl=8,El=8,Nz=typeof window>"u"?b.useEffect:b.useLayoutEffect;function Rz(e,t,n){let r,s;switch(t){case"bottom":r=e.bottom+Pl,s=e.left+e.width/2-n.width/2;break;case"left":r=e.top+e.height/2-n.height/2,s=e.left-Pl-n.width;break;case"right":r=e.top+e.height/2-n.height/2,s=e.right+Pl;break;default:r=e.top-Pl-n.height,s=e.left+e.width/2-n.width/2}return s=Math.min(Math.max(s,El),window.innerWidth-n.width-El),r=Math.min(Math.max(r,El),window.innerHeight-n.height-El),{top:r,left:s}}function be({content:e,children:t,placement:n="top",delay:r=300,disabled:s=!1,surface:i="paper"}){const o=b.useId(),[a,l]=b.useState(!1),[c,u]=b.useState(!1),[f,h]=b.useState(!1),[p,m]=b.useState(null),[g,w]=b.useState(null),y=b.useRef(null),x=b.useRef(null),v=b.useRef(),k=!s&&!!e&&!f&&(a||c),C=()=>{clearTimeout(v.current),v.current=setTimeout(()=>l(!0),r)},S=()=>{clearTimeout(v.current),l(!1),h(!1)},P=()=>{h(!1),u(!0)},T=()=>{u(!1),h(!1)};Iu(k,()=>h(!0)),b.useEffect(()=>{if(!k){m(null);return}const j=()=>{y.current&&m(y.current.getBoundingClientRect())};return j(),window.addEventListener("scroll",j,{capture:!0,passive:!0}),window.addEventListener("resize",j,{passive:!0}),()=>{window.removeEventListener("scroll",j,{capture:!0}),window.removeEventListener("resize",j)}},[k]),Nz(()=>{if(!k){w(null);return}const j=x.current;j&&w({width:j.offsetWidth,height:j.offsetHeight})},[k,e,n]),b.useEffect(()=>()=>clearTimeout(v.current),[]);const E=t.props;return d.jsxs("span",{ref:y,className:jl.wrapper,onMouseEnter:C,onMouseLeave:S,onFocus:P,onBlur:T,children:[b.cloneElement(t,{"aria-describedby":k?o:E["aria-describedby"]}),k&&p&&typeof document<"u"&&Os.createPortal(d.jsx("span",{ref:x,id:o,role:"tooltip",className:Q(jl.tooltip,jl[n],i==="chalkboard"&&jl.chalkboard),style:g?{position:"fixed",...Rz(p,n,g)}:{position:"fixed",top:0,left:0,visibility:"hidden"},children:e}),document.body)]})}const Az="toast-module__stack___hDi0s",Iz="toast-module__topLeft___Luw-F",Mz="toast-module__topCenter___N1DwF",Lz="toast-module__topRight___Dtgau",Dz="toast-module__bottomLeft___Eb2lo",Fz="toast-module__bottomCenter___gs-Yb",Oz="toast-module__bottomRight___-0e2j",$z="toast-module__item___RFjtm",zz="toast-module__toastIn___9m9iN",Bz="toast-module__card___ZCvJS",Vz="toast-module__surface___mfMl0",Uz="toast-module__iconWrapper___lnjcC",Wz="toast-module__content___AlliM",Hz="toast-module__title___1Oqh8",Gz="toast-module__description___eiUSB",Kz="toast-module__dismiss___tUGx4",Yz="toast-module__info___Nh8S9",qz="toast-module__success___hlKLc",Qz="toast-module__warning___XUMJt",Xz="toast-module__error___pSFFC",Jz="toast-module__chalkboard___c49gt",Yt={stack:Az,topLeft:Iz,topCenter:Mz,topRight:Lz,bottomLeft:Dz,bottomCenter:Fz,bottomRight:Oz,item:$z,toastIn:zz,card:Bz,surface:Vz,iconWrapper:Uz,content:Wz,title:Hz,description:Gz,dismiss:Kz,info:Yz,success:qz,warning:Qz,error:Xz,chalkboard:Jz};function Zz({record:e,surface:t="paper",onDismiss:n}){const r=b.useRef(e.duration),s=b.useRef(0),i=b.useRef(),o=b.useCallback(f=>{clearTimeout(i.current),!(f<=0)&&(s.current=Date.now(),i.current=setTimeout(()=>n(e.id),f))},[n,e.id]);b.useEffect(()=>(o(e.duration),()=>clearTimeout(i.current)),[o,e.duration]);const a=()=>{i.current&&(clearTimeout(i.current),r.current-=Date.now()-s.current)},l=()=>o(r.current),c=t==="chalkboard",u=e.variant==="warning"||e.variant==="error"?"alert":"status";return d.jsx("div",{className:Yt.item,onMouseEnter:a,onMouseLeave:l,children:d.jsxs("div",{className:Q(Yt.card,Yt[e.variant],c&&Yt.chalkboard),role:u,children:[d.jsx(jt,{clip:!0,...Pt.surface}),d.jsx("div",{className:Yt.surface,style:c?void 0:Yi("kraft")}),d.jsx("span",{className:Yt.iconWrapper,children:d.jsx(sS,{variant:e.variant})}),d.jsxs("div",{className:Yt.content,children:[e.title&&d.jsx("div",{className:Yt.title,children:e.title}),d.jsx("div",{className:Yt.description,children:e.description})]}),d.jsx("button",{type:"button",className:Yt.dismiss,onClick:()=>n(e.id),"aria-label":"Dismiss notification",children:d.jsx(Fu,{size:16})})]})})}const oS=b.createContext(null);function e4(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function t4({children:e,position:t="bottom-right",surface:n="paper",defaultDuration:r=5e3}){const[s,i]=b.useState([]),o=b.useRef(0),a=b.useCallback(u=>{i(f=>f.filter(h=>h.id!==u))},[]),l=b.useCallback(u=>{o.current+=1;const f=`toast-${o.current}`;return i(h=>[...h,{id:f,title:u.title,description:u.description,variant:u.variant??"info",duration:u.duration??r}]),f},[r]),c=t.startsWith("top")?[...s].reverse():s;return d.jsxs(oS.Provider,{value:{toast:l,dismiss:a},children:[e,typeof document<"u"&&Os.createPortal(d.jsx("div",{className:Q(Yt.stack,Yt[e4(t)]),role:"region","aria-label":"Notifications",children:c.map(u=>d.jsx(Zz,{record:u,surface:n,onDismiss:a},u.id))}),document.body)]})}function He(){const e=b.useContext(oS);if(!e)throw new Error("useToast must be used within a <ToastProvider>");return e}const n4="breadcrumb-module__breadcrumb___r-ILp",r4="breadcrumb-module__list___V3YFy",s4="breadcrumb-module__item___dDwYf",i4="breadcrumb-module__link___CHC9k",o4="breadcrumb-module__linkButton___XoMW-",a4="breadcrumb-module__current___dprI9",l4="breadcrumb-module__separator___uLhtn",c4="breadcrumb-module__chalkboard___COJpw",Tn={breadcrumb:n4,list:r4,item:s4,link:i4,linkButton:o4,current:a4,static:"breadcrumb-module__static___affaf",separator:l4,chalkboard:c4};function aS({items:e,surface:t="paper",className:n}){return d.jsx("nav",{"aria-label":"Breadcrumb",className:Q(Tn.breadcrumb,t==="chalkboard"&&Tn.chalkboard,n),children:d.jsx("ol",{className:Tn.list,children:e.map((r,s)=>{const i=s===e.length-1;return d.jsxs("li",{className:Tn.item,children:[i?d.jsx("span",{className:Tn.current,"aria-current":"page",children:r.label}):r.href?d.jsx("a",{href:r.href,className:Tn.link,onClick:r.onClick,children:r.label}):r.onClick?d.jsx("button",{type:"button",className:Q(Tn.link,Tn.linkButton),onClick:r.onClick,children:r.label}):d.jsx("span",{className:Tn.static,children:r.label}),!i&&d.jsx(u4,{className:Tn.separator})]},r.id)})})})}function u4({className:e}){return d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e,"aria-hidden":"true",children:d.jsx("polyline",{points:"9 18 15 12 9 6"})})}const d4="menu-module__wrapper___WCtoy",f4="menu-module__menu___i40Wj",h4="menu-module__surface___SJbaB",p4="menu-module__list___YjCfD",m4="menu-module__item___aqcgg",g4="menu-module__icon___1qUvA",y4="menu-module__label___MtQMh",x4="menu-module__danger___p9oZo",v4="menu-module__itemDisabled___HByLP",w4="menu-module__separator___g2uay",b4="menu-module__chalkboard___5jIwI",fn={wrapper:d4,menu:f4,surface:h4,list:p4,item:m4,icon:g4,label:y4,danger:x4,itemDisabled:v4,separator:w4,chalkboard:b4},k4=6;function _4(e){return"type"in e&&e.type==="separator"}function lS({trigger:e,items:t,align:n="start",surface:r="paper",className:s}){const i=b.useId(),[o,a]=b.useState(!1),[l,c]=b.useState(null),u=b.useRef(null),f=b.useRef(null),h=b.useCallback(()=>{var y,x;(x=(y=u.current)==null?void 0:y.querySelector("button, a, [tabindex]"))==null||x.focus()},[]),p=b.useCallback(()=>a(!1),[]);Iu(o,()=>{p(),h()}),b.useEffect(()=>{if(!o)return;const y=x=>{var v,k;const C=x.target;(v=u.current)!=null&&v.contains(C)||(k=f.current)!=null&&k.contains(C)||p()};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[o,p]),b.useEffect(()=>{if(!o){c(null);return}const y=()=>{u.current&&c(u.current.getBoundingClientRect())};return y(),document.addEventListener("scroll",y,{capture:!0,passive:!0}),window.addEventListener("resize",y,{passive:!0}),()=>{document.removeEventListener("scroll",y,{capture:!0}),window.removeEventListener("resize",y)}},[o]),b.useEffect(()=>{var y,x;!o||!l||(x=(y=f.current)==null?void 0:y.querySelector('[role="menuitem"]:not(:disabled)'))==null||x.focus()},[o,l]);const m=y=>{var x,v,k,C,S;const P=Array.from(((x=f.current)==null?void 0:x.querySelectorAll('[role="menuitem"]:not(:disabled)'))??[]);if(P.length===0)return;const T=P.indexOf(document.activeElement);switch(y.key){case"ArrowDown":y.preventDefault(),(v=P[(T+1)%P.length])==null||v.focus();break;case"ArrowUp":y.preventDefault(),(k=P[(T-1+P.length)%P.length])==null||k.focus();break;case"Home":y.preventDefault(),(C=P[0])==null||C.focus();break;case"End":y.preventDefault(),(S=P[P.length-1])==null||S.focus();break;case"Tab":p();break}},g=y=>{var x;y.disabled||(p(),h(),(x=y.onSelect)==null||x.call(y))},w=e.props;return d.jsxs("span",{ref:u,className:fn.wrapper,children:[b.cloneElement(e,{"aria-haspopup":"menu","aria-expanded":o,onClick:y=>{var x;(x=w.onClick)==null||x.call(w,y),a(v=>!v)}}),o&&l&&typeof document<"u"&&Os.createPortal(d.jsxs("div",{ref:f,id:i,role:"menu",className:Q(fn.menu,r==="chalkboard"&&fn.chalkboard,s),style:{position:"fixed",top:l.bottom+k4,minWidth:l.width,...n==="end"?{right:window.innerWidth-l.right}:{left:l.left}},onKeyDown:m,children:[d.jsx(jt,{clip:!0,...Pt.surface}),d.jsx("div",{className:fn.surface}),d.jsx("div",{className:fn.list,children:t.map(y=>_4(y)?d.jsx("div",{role:"separator",className:fn.separator},y.id):d.jsxs("button",{type:"button",role:"menuitem",tabIndex:-1,disabled:y.disabled,className:Q(fn.item,y.danger&&fn.danger,y.disabled&&fn.itemDisabled),onClick:()=>g(y),children:[y.icon&&d.jsx("span",{className:fn.icon,children:y.icon}),d.jsx("span",{className:fn.label,children:y.label})]},y.id))})]}),document.body)]})}const cS=({size:e=16})=>d.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("path",{d:"m12 3-1.6 4.85a2 2 0 0 1-1.27 1.27L4.27 10.7l4.86 1.6a2 2 0 0 1 1.27 1.27L12 18.4l1.6-4.86a2 2 0 0 1 1.27-1.27l4.86-1.6-4.86-1.6a2 2 0 0 1-1.27-1.27L12 3Z"}),d.jsx("path",{d:"M19 3v3"}),d.jsx("path",{d:"M20.5 4.5h-3"})]}),S4=({size:e=16})=>d.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("path",{d:"M12 19V5"}),d.jsx("path",{d:"m5 12 7-7 7 7"})]}),C4=({size:e=16})=>d.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("path",{d:"M12 5v14"}),d.jsx("path",{d:"m5 12 7 7 7-7"})]}),uS=({size:e=16})=>d.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("circle",{cx:"18",cy:"18",r:"3"}),d.jsx("circle",{cx:"6",cy:"6",r:"3"}),d.jsx("path",{d:"M6 9v5c0 .667 3 1 6 1s6-.333 6-1V9"}),d.jsx("path",{d:"M12 17v2"})]}),j4=({size:e=16})=>d.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("path",{d:"M21 12a9 9 0 1 1-2.64-6.36"}),d.jsx("polyline",{points:"21 3 21 9 15 9"})]}),dS=({size:e=16})=>d.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:[d.jsx("circle",{cx:"5",cy:"12",r:"2"}),d.jsx("circle",{cx:"12",cy:"12",r:"2"}),d.jsx("circle",{cx:"19",cy:"12",r:"2"})]}),P4=({size:e=16})=>d.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("path",{d:"m18 4 3 3-3 3"}),d.jsx("path",{d:"M3 7h5.5a3 3 0 0 1 2.5 1.35L15 16.65A3 3 0 0 0 17.5 18H21"}),d.jsx("path",{d:"m18 20 3-3-3-3"}),d.jsx("path",{d:"M3 17h5.5a3 3 0 0 0 2.5-1.35"}),d.jsx("path",{d:"M13 8.35A3 3 0 0 1 15.5 7H21"})]}),E4=({size:e=12})=>d.jsx("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:d.jsx("path",{d:"M6 4l11 6-11 6z"})}),T4=({size:e=12})=>d.jsx("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:d.jsx("rect",{x:"5",y:"5",width:"10",height:"10",rx:"1.5"})}),N4=({size:e=12})=>d.jsx("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:d.jsx("path",{d:"m7 4 6 6-6 6"})}),R4=({size:e=16})=>d.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("path",{d:"M18 8a6 6 0 0 0-12 0c0 7-3 9-3 9h18s-3-2-3-9"}),d.jsx("path",{d:"M13.73 21a2 2 0 0 1-3.46 0"})]}),Vv=({size:e=16})=>d.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("path",{d:"M6 3v12"}),d.jsx("circle",{cx:"18",cy:"6",r:"3"}),d.jsx("circle",{cx:"6",cy:"18",r:"3"}),d.jsx("path",{d:"M18 9a9 9 0 0 1-9 9"})]}),A4=({size:e=12})=>d.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:d.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8Z"})}),Qm=({size:e=14})=>d.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"opacity-[0.55] shrink-0",children:[d.jsx("title",{children:"Idea"}),d.jsx("path",{d:"M9 18h6M10 22h4M12 2a6 6 0 0 0-3.5 10.9c.53.4.9 1.03.9 1.72V15h5.2v-.38c0-.69.37-1.32.9-1.72A6 6 0 0 0 12 2Z"})]}),Xm=({size:e=14})=>d.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"opacity-[0.55] shrink-0",children:[d.jsx("title",{children:"Note"}),d.jsx("path",{d:"M15 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9Z"}),d.jsx("path",{d:"M15 3v6h6"})]}),I4=({state:e,filesEmpty:t})=>{const[n,r]=b.useState(!!e.commitMessage);return b.useEffect(()=>{e.commitMessage&&r(!0)},[e.commitMessage]),d.jsxs("div",{className:"flex flex-col gap-2",children:[e.suggestError&&d.jsx(iS,{dismissible:!0,onDismiss:()=>e.setSuggestError(null),children:e.suggestError}),d.jsxs("div",{className:"flex gap-2 items-center",children:[d.jsx("div",{className:"flex-1",children:d.jsx(La,{size:"small",placeholder:"Commit title",value:e.commitTitle,onChange:s=>e.setCommitTitle(s.currentTarget.value)})}),d.jsx(ot,{icon:d.jsx(cS,{size:16}),size:"small",label:"Suggest title and message from the diff",disabled:t||e.suggesting,onClick:e.handleSuggestFromChanges,wobble:e.suggesting?1:0})]}),n?d.jsx(Da,{size:"small",placeholder:"Commit message (optional)",value:e.commitMessage,onChange:s=>e.setCommitMessage(s.currentTarget.value)}):d.jsx("button",{type:"button",onClick:()=>r(!0),className:"self-start bg-none bg-transparent border-none p-0 [font:inherit] text-2xs opacity-60 cursor-pointer underline",children:"Add a message"})]})};let fS="";function M4(e){fS=e}function G(e){return`${fS}${e}`}const kn=45e3;async function _n(e,t){if(e.ok)return;const n=await e.json().catch(()=>({error:t}));throw new Error(n.error)}const L4=async()=>{const e=await fetch(G("/api/git/status"),{signal:AbortSignal.timeout(kn)});return await _n(e,"Failed to load git status"),e.json()},D4=async()=>{const e=await fetch(G("/api/git/diff"),{signal:AbortSignal.timeout(kn)});return await _n(e,"Failed to load diff"),(await e.json()).files},F4=async e=>{const t=await fetch(G(`/api/git/stash-diff?index=${e}`),{signal:AbortSignal.timeout(kn)});return await _n(t,"Failed to load stash diff"),(await t.json()).patch},ep=async(e,t,n)=>{const r=await fetch(G("/api/git/commit"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:e,title:t,message:n}),signal:AbortSignal.timeout(kn)});await _n(r,"Commit failed")},O4=async e=>{const t=await fetch(G("/api/git/stage"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e}),signal:AbortSignal.timeout(kn)});await _n(t,"Stage failed")},pG=async e=>{const t=await fetch(G("/api/git/unstage"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e}),signal:AbortSignal.timeout(kn)});await _n(t,"Unstage failed")},$4=async()=>{const e=await fetch(G("/api/git/push"),{method:"POST",signal:AbortSignal.timeout(kn)});await _n(e,"Push failed")},hS=async e=>{const t=await fetch(G("/api/git/suggest-commit-message"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:e})});return await _n(t,"Failed to suggest a commit message"),t.json()},z4=async()=>{const e=await fetch(G("/api/git/sync"),{method:"POST",signal:AbortSignal.timeout(kn)});if(e.status===202){const t=await e.json();return t.conflictPrompt?{ok:!1,recovering:!1,conflictPrompt:t.conflictPrompt,message:t.error}:{ok:!1,recovering:t.recovering,message:t.error}}return await _n(e,"Sync failed"),{ok:!0}},B4=async()=>{const e=await fetch(G("/api/git/pull"),{method:"POST",signal:AbortSignal.timeout(kn)});await _n(e,"Pull failed")},V4=async()=>{const e=await fetch(G("/api/git/fix-divergence"),{method:"POST",signal:AbortSignal.timeout(kn)});if(e.status===202){const t=await e.json();return t.conflictPrompt?{ok:!1,recovering:!1,conflictPrompt:t.conflictPrompt,message:t.error}:{ok:!1,recovering:t.recovering,message:t.error}}return await _n(e,"Fix failed"),{ok:!0}},U4=async e=>{const t=await fetch(G("/api/git/resolve-conflict"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:e})});try{return await t.json()}catch{return{ok:!1,error:`Unexpected response (status ${t.status})`}}},W4=async e=>{const t=await fetch(G("/api/git/branch"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e}),signal:AbortSignal.timeout(kn)}),n=await t.json();if(!t.ok)throw new Error(n.error??"Failed to create branch");return{branch:n.branch,warning:n.warning}},H4={},Uv=e=>{let t;const n=new Set,r=(u,f)=>{const h=typeof u=="function"?u(t):u;if(!Object.is(h,t)){const p=t;t=f??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(m=>m(t,p))}},s=()=>t,l={setState:r,getState:s,getInitialState:()=>c,subscribe:u=>(n.add(u),()=>n.delete(u)),destroy:()=>{(H4?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},c=t=e(r,s,l);return l},G4=e=>e?Uv(e):Uv,pS={},{useDebugValue:K4}=Pi,{useSyncExternalStoreWithSelector:Y4}=QT;let Wv=!1;const q4=e=>e;function Q4(e,t=q4,n){(pS?"production":void 0)!=="production"&&n&&!Wv&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),Wv=!0);const r=Y4(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return K4(r),r}const X4=e=>{(pS?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?G4(e):e,n=(r,s)=>Q4(t,r,s);return Object.assign(n,t),n},J4=e=>X4,mS=async()=>{const e=await fetch(G("/api/capabilities"));return e.ok?(await e.json()).capabilities:null},Z4=async()=>{const e=await fetch(G("/api/agent/auth-status"));return e.ok?await e.json():null},mG=async()=>{try{const e=await fetch(G("/api/connections"));return e.ok?(await e.json()).connections:null}catch{return null}},gG=async e=>{try{const t=await fetch(G(`/api/connections/connect?id=${encodeURIComponent(e)}`),{method:"POST"});return t.ok?(await t.json()).connection:null}catch{return null}},Jm=async()=>{try{const e=await fetch(G("/api/config"));return e.ok?e.json():null}catch{return null}},yG=async e=>{try{const t=await fetch(G("/api/config"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(t.ok)return{ok:!0};const n=await t.json().catch(()=>null);return{ok:!1,error:n==null?void 0:n.error}}catch(t){return{ok:!1,error:t.message}}},eB=async()=>{try{const e=await fetch(G("/api/icon"));if(!e.ok)return null;const t=await e.blob();return new Promise(n=>{const r=new FileReader;r.onloadend=()=>n(r.result),r.readAsDataURL(t)})}catch{return null}},xG=async e=>{try{return(await fetch(G("/api/icon"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({dataUri:e})})).ok}catch{return!1}},tB=async()=>{try{const e=await fetch(G("/api/package-name"));return e.ok?e.json():null}catch{return null}},an=async(e,t="Launch failed")=>{if(!e.ok){const n=await e.json().catch(()=>({error:t}));throw new Error(n.error)}},nB=async()=>(await fetch(G("/api/agent/status"))).json(),rB=async()=>(await fetch(G("/api/agent/reconcile-queue"))).json(),sB=async(e,t)=>{const n=await fetch(G("/api/agent/launch"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,phaseIndex:t})});await an(n)},iB=async(e,t)=>{const n=await fetch(G("/api/agent/launch-audit"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,prompt:t})});await an(n)},oB=async(e,t)=>{const n=await fetch(G("/api/agent/launch-reconcile"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,prompt:t})});await an(n)},aB=async(e,t)=>{const n=await fetch(G("/api/agent/launch-draft"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ideaId:e,prompt:t})});await an(n)},lB=async(e,t)=>{const n=await fetch(G("/api/agent/launch-extend"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ideaId:e,prompt:t})});await an(n)},cB=async e=>{const t=await fetch(G("/api/agent/launch-suggest"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:e})});await an(t)},uB=async()=>{const e=await fetch(G("/api/agent/launch-reconcile-all"),{method:"POST"});await an(e)},dB=async e=>{const t=await fetch(G("/api/agent/launch-draft-all"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:e})});await an(t)},fB=async e=>{const t=await fetch(G("/api/agent/launch-run-all"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e})});await an(t)},hB=async e=>{const t=await fetch(G("/api/agent/launch-fix-review"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e})});await an(t)},pB=async e=>{const t=await fetch(G("/api/agent/launch-pr-review"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e})});await an(t)},mB=async e=>{try{const t=await fetch(G(`/api/agent/pr-review-status?planId=${encodeURIComponent(e)}`));return t.ok?t.json():null}catch{return null}},gB=async(e,t,n)=>{const r=await fetch(G("/api/agent/feedback-message"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,text:t,context:n})}),s=await r.json();if(!r.ok)throw new Error(s.error??"Failed to send message");return s},Hv=async(e,t,n,r)=>{const s=await fetch(G("/api/agent/feedback-promote"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,index:t,target:n,note:r})});if(!s.ok){const i=await s.json().catch(()=>null);throw new Error((i==null?void 0:i.error)??`Failed to promote message (${s.status})`)}},yB=async e=>{const t=await fetch(G("/api/agent/feedback-summarize"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e})}),n=await t.json().catch(()=>null);if(!t.ok)throw new Error((n==null?void 0:n.error)??`Failed to summarize feedback (${t.status})`);return n},xB=async(e,t)=>{const n=await fetch(G("/api/agent/feedback-undo"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,commitSha:t})}),r=await n.json();if(!n.ok)throw new Error(r.error??"Failed to undo edit");return r},vB=async e=>{const t=await fetch(G("/api/agent/stop"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskId:e})});await an(t,"Stop failed")},wB=async()=>(await fetch(G("/api/agent/login-relay/start"),{method:"POST"})).json(),bB=async()=>(await fetch(G("/api/agent/login-relay/status"))).json(),kB=async()=>{await fetch(G("/api/agent/login-relay/cancel"),{method:"POST"})},_B=async()=>{const e=await fetch(G("/api/checks"));return e.ok?(await e.json()).checks??[]:[]},gS=async e=>{const t=await fetch(G(`/api/checks/run?name=${encodeURIComponent(e)}`),{method:"POST"});if(!t.ok){const n=await t.json().catch(()=>({error:"Failed to run check"}));throw new Error(n.error??"Failed to run check")}};function dt(e,t,n,r=()=>({}),s){return async()=>{s&&e({[s]:!0});try{const i=await t();e({...n(i),...s&&{[s]:!1}})}catch(i){e({...r(i),...s&&{[s]:!1}})}}}function Nn(e,t){return async(...n)=>{await t(...n),await e().loadAgentStatus()}}let SB=0;const Gv=()=>`preview-${++SB}`;function CB(e,t){return{agentAuthStatus:null,loadAgentAuthStatus:dt(e,Z4,n=>({agentAuthStatus:n}),()=>({agentAuthStatus:null})),agentStatus:[],loadAgentStatus:async()=>{try{const n=await nB(),r=t().agentStatus;if(e({agentStatus:n}),n.find(c=>{var f;if(c.status!=="done"||c.taskKind!=="run-all"&&c.taskKind!=="phase")return!1;const u=r.find(h=>h.id===c.id);if(!u||u.status==="done"||u.status==="error")return!1;if(c.taskKind==="phase"){const h=(f=t().plans)==null?void 0:f.entries.find(p=>p.id===c.planId);if(!h||c.phaseIndex!==h.phases.length-1)return!1}return!0})){t().runConsistencyCheck();for(const c of["lint","test"])gS(c).catch(()=>{})}const i=t().pendingReconcile,o=i?n.find(c=>c.taskKind==="reconcile"&&c.planId===i.planId):void 0;i&&o&&(o.status==="done"?(await t().loadPlans(),e(c=>({reconcileQueue:[...c.reconcileQueue,{...i,previewId:Gv()}],pendingReconcile:null}))):o.status==="error"&&e({pendingReconcile:null}));const a=n.find(c=>c.taskKind==="batch-reconcile"||c.taskKind==="batch-draft"),l=(a==null?void 0:a.taskKind)==="batch-draft"?a.status==="done"||a.status==="error":(a==null?void 0:a.status)==="done";if(a&&l&&!t().batchReconcileConsumed){if(a.taskKind==="batch-reconcile"){const c=await rB();c&&c.length>0&&(await t().loadPlans(),e(u=>({reconcileQueue:[...u.reconcileQueue,...c.map(f=>({planId:f.planId,before:f.before,previewId:Gv()}))]})))}else await t().loadPlans();e({batchReconcileConsumed:!0})}}catch{}},launchAgent:Nn(t,sB),launchPlanAudit:Nn(t,iB),launchPlanReconcile:async(n,r,s)=>{const i=t().pendingReconcile;if(i)throw new Error(i.planId===n?"A reconcile is already in progress for this plan":"A reconcile is already in progress for another plan");if(t().reconcileQueue.some(o=>o.planId===n))throw new Error("Review the pending reconcile for this plan first");e({pendingReconcile:{planId:n,before:s}});try{await oB(n,r)}catch(o){throw e({pendingReconcile:null}),o}await t().loadAgentStatus()},launchPlanDraft:Nn(t,aB),launchIdeaExtend:Nn(t,lB),launchBatchReconcile:Nn(t,async()=>{e({batchReconcileConsumed:!1}),await uB()}),launchBatchDraft:Nn(t,async n=>{e({batchReconcileConsumed:!1}),await dB(n)}),launchSuggestIdeas:Nn(t,cB),launchRunAll:Nn(t,fB),launchFixReview:Nn(t,hB),launchPrReview:Nn(t,pB),stopAgent:async n=>{try{await vB(n)}finally{await t().loadAgentStatus()}},loginRelay:null,startLoginRelay:async()=>{try{const n=await wB();e({loginRelay:n})}catch(n){e({loginRelay:{phase:"error",authorizeUrl:null,error:n.message}})}},loadLoginRelayStatus:dt(e,bB,n=>({loginRelay:n})),cancelLoginRelay:async()=>{try{await kB()}finally{e({loginRelay:null})}},pendingReconcile:null,reconcileQueue:[],removeFromReconcileQueue:n=>e(r=>({reconcileQueue:r.reconcileQueue.filter(s=>s.previewId!==n)})),batchReconcileConsumed:!1}}function jB(e,t){return{diffFiles:null,diffLoadFailed:!1,loadDiffFiles:dt(e,D4,n=>({diffFiles:n,diffLoadFailed:!1}),()=>({diffLoadFailed:!0})),activeDiffPath:null,setActiveDiffPath:n=>{t().activeDiffPath!==n&&e({activeDiffPath:n})},manuallyExpandedDiffPaths:new Set,manuallyCollapsedDiffPaths:new Set,setDiffCollapsed:(n,r)=>{e(s=>{const i=new Set(s.manuallyExpandedDiffPaths),o=new Set(s.manuallyCollapsedDiffPaths);return r?(o.add(n),i.delete(n)):(i.add(n),o.delete(n)),{manuallyExpandedDiffPaths:i,manuallyCollapsedDiffPaths:o}})},expandDiffPath:n=>t().setDiffCollapsed(n,!1)}}const PB=async()=>(await fetch(G("/api/tasks"))).json(),vG=async e=>{const t=await fetch(G(`/api/tasks/output?id=${encodeURIComponent(e)}`));if(!t.ok)throw new Error(`Failed to fetch task log: ${t.status}`);return t.json()},EB=async()=>(await fetch(G("/api/suggestions"))).json(),TB=async e=>{const t=await fetch(G("/api/suggestions/promote"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({suggestion:e})});if(!t.ok){const n=await t.json().catch(()=>({error:"Failed to promote suggestion"}));throw new Error(n.error)}return t.json()},NB=async e=>{const t=await fetch(G("/api/suggestions/dismiss"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({suggestion:e})});if(!t.ok){const n=await t.json().catch(()=>({error:"Failed to dismiss suggestion"}));throw new Error(n.error)}},RB=async()=>(await fetch(G("/api/docs"))).json(),yS=async()=>{const e=await fetch(G("/api/roadmap"));if(!e.ok)throw new Error(`Failed to fetch roadmap: ${e.status}`);return e.json()},AB=async(e,t,n,r)=>{const s=await fetch(G("/api/roadmap/promote"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({horizonTitle:e,item:t,subject:n,candidateName:r})});if(!s.ok){const i=await s.json().catch(()=>({error:"Failed to promote roadmap item"}));throw new Error(i.error)}return s.json()},wG=async(e,t,n)=>{const r=await fetch(G("/api/roadmap/items"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({horizonTitle:e,name:t,description:n})});if(!r.ok){const s=await r.json().catch(()=>({error:"Failed to add roadmap item"}));throw new Error(s.error)}},bG=async(e,t,n)=>{const r=await fetch(G("/api/roadmap/candidates"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({horizonTitle:e,itemName:t,name:n})});if(!r.ok){const s=await r.json().catch(()=>({error:"Failed to add roadmap candidate"}));throw new Error(s.error)}},IB=async()=>(await fetch(G("/api/consistency"))).json(),MB=async()=>(await fetch(G("/api/doctor"))).json(),LB=45e3,xS=async()=>(await fetch(G("/api/ideas"),{signal:AbortSignal.timeout(LB)})).json(),DB=async()=>(await fetch(G("/api/archivable-ideas"))).json(),FB=async e=>{const t=await fetch(G("/api/ideas/archive"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:e})}),n=await t.json();if(!t.ok)throw new Error(n.error??"Failed to archive ideas");return n},vS=async e=>{const t=await fetch(G("/api/ideas"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),n=await t.json();if(!t.ok)throw new Error(n.error??"Failed to create idea");return n.id},wS=async(e,t)=>{const n=await fetch(G("/api/ideas/check-overlap"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:e,candidates:t})}),r=await n.json();if(!n.ok)throw new Error(r.error??"Failed to check overlap");return r},OB=async()=>{const e=await fetch(G("/api/ideas/prioritise"),{method:"POST"}),t=await e.json();if(!e.ok)throw new Error(t.error??"Failed to prioritise queue");return t},$B=async()=>{const e=await fetch(G("/api/notifications"));if(!e.ok)throw new Error(`Failed to fetch notifications: ${e.status}`);return e.json()},zB=async e=>{const t=await fetch(G("/api/notifications/mark-read"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e})});if(!t.ok)throw new Error(`Failed to mark notification read: ${t.status}`)},BB=async()=>{const e=await fetch(G("/api/parked-questions"));if(!e.ok)throw new Error(`Failed to fetch parked questions: ${e.status}`);return e.json()},VB=45e3,bS=async()=>(await fetch(G("/api/plans"),{signal:AbortSignal.timeout(VB)})).json(),UB=async e=>{await fetch(G("/api/plans"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})},WB=async(e,t)=>{const n=await fetch(G(`/api/plans?title=${encodeURIComponent(e)}`),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){const r=await n.json().catch(()=>null);throw new Error((r==null?void 0:r.error)??`Failed to update plan (${n.status})`)}},HB=async()=>{const e=await fetch(G("/api/releases"));if(!e.ok)throw new Error("Failed to load releases");const{versions:t}=await e.json();return t},kG=async e=>{const t=await fetch(G(`/api/release-notes?version=${encodeURIComponent(e)}`));if(!t.ok)throw new Error("Failed to load release notes");return t.json()};function GB(e,t){return{repoDocs:[],repoDocsLoading:!0,loadRepoDocs:async()=>{e({repoDocsLoading:!0});try{const n=await RB();e({repoDocs:n.files,repoDocsLoading:!1});const{activeDocTitle:r}=t();if(!r){const s=["MAIN.md","README.md"].find(i=>n.files.some(o=>o.name===i));s&&e({activeDocTitle:s})}}catch{e({repoDocs:[],repoDocsLoading:!1})}},activeDocTitle:null,setActiveDocTitle:n=>e({activeDocTitle:n}),docSearchQuery:"",setDocSearchQuery:n=>e({docSearchQuery:n}),releaseVersions:[],releaseVersionsLoading:!0,loadReleaseVersions:async()=>{e({releaseVersionsLoading:!0});try{const n=await HB();e({releaseVersions:n,releaseVersionsLoading:!1})}catch{e({releaseVersions:[],releaseVersionsLoading:!1})}},activeReleaseVersion:null,setActiveReleaseVersion:n=>e({activeReleaseVersion:n})}}function KB(e,t){return{ideaEntries:[],loadIdeas:dt(e,xS,n=>({ideaEntries:n.entries}),()=>({ideaEntries:[]})),archivableIdeas:[],loadArchivableIdeas:dt(e,DB,n=>({archivableIdeas:n}),()=>({archivableIdeas:[]})),archiveIdeas:async n=>{await FB(n),await Promise.all([t().loadArchivableIdeas(),t().loadPlans(),t().loadIdeas()])}}}function YB(e,t){return{notifications:null,notificationsLoading:!1,notificationsError:null,loadNotifications:dt(e,$B,n=>({notifications:n,notificationsError:null}),n=>({notificationsError:String(n)}),"notificationsLoading"),markRead:async n=>{const r=t().notifications;if(r){e({notifications:r.map(s=>s.kind!=="question"&&s.id===n?{...s,read:!0}:s)});try{await zB(n)}catch(s){e({notifications:r,notificationsError:String(s)})}}}}}function qB(e){return{parkedQuestions:null,parkedQuestionsLoading:!1,parkedQuestionsError:null,loadParkedQuestions:dt(e,BB,t=>({parkedQuestions:t,parkedQuestionsError:null}),t=>({parkedQuestionsError:String(t)}),"parkedQuestionsLoading")}}const nu=e=>{const t=new Date(e);if(Number.isNaN(t.getTime()))return e;const n=Math.floor((Date.now()-t.getTime())/864e5);return n<=0?"today":n===1?"yesterday":n<7?`${n}d ago`:n<30?`${Math.floor(n/7)}w ago`:n<365?`${Math.floor(n/30)}mo ago`:`${Math.floor(n/365)}y ago`},kS=e=>{const t=new Date(e),n=new Date,r=t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate(),s=t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});return r?`as of ${s}`:`as of ${t.toLocaleDateString()} ${s}`},_S=e=>{if(e.length===0)return null;const t=e.filter(n=>n.done).length;return{done:t,total:e.length,pct:Math.round(t/e.length*100)}},SS=e=>_S(e.phases),Kv=e=>{var t;return((t=SS(e))==null?void 0:t.pct)??null},QB=e=>_S([...e.phases,...e.fixes??[]]),XB=(e,t)=>{const n=QB(e);if(!n)return null;const r=Math.min(n.total,n.done+t);return{done:n.done,total:n.total,pct:r/n.total*100}},Zm=(e,t)=>e?t.find(n=>n.planId===e&&n.status!=="done"&&n.status!=="error"):void 0,JB=(e,t)=>e?t.find(n=>n.planId===e&&n.taskKind==="pr-review"&&n.status!=="done"&&n.status!=="error"):void 0,ZB=e=>{var t;return(t=[...e??[]].reverse().find(n=>n.kind==="review"))==null?void 0:t.text},eg=(e,t)=>e.status==="done"||e.status==="dropped"?e.status:Zm(e.id,t)?"in-progress":e.status,e5=e=>!e.pr&&e.status!=="done"&&e.status!=="dropped"&&e.status!=="review"&&e.phases.length>0&&e.phases.every(t=>t.done)&&(e.fixes??[]).every(t=>t.done);function rf(e,t){const n=e.split(/(\s+)/).filter(u=>u!==""),r=t.split(/(\s+)/).filter(u=>u!==""),s=n.length,i=r.length,o=Array.from({length:s+1},()=>new Array(i+1).fill(0));for(let u=s-1;u>=0;u--)for(let f=i-1;f>=0;f--)o[u][f]=n[u]===r[f]?o[u+1][f+1]+1:Math.max(o[u+1][f],o[u][f+1]);const a=[];let l=0,c=0;for(;l<s&&c<i;)n[l]===r[c]?(a.push({type:"same",text:n[l]}),l++,c++):o[l+1][c]>=o[l][c+1]?(a.push({type:"removed",text:n[l]}),l++):(a.push({type:"added",text:r[c]}),c++);for(;l<s;)a.push({type:"removed",text:n[l]}),l++;for(;c<i;)a.push({type:"added",text:r[c]}),c++;return t5(a)}function t5(e){const t=[];for(const n of e){const r=t[t.length-1];r&&r.type===n.type?r.text+=n.text:t.push({...n})}return t}const n5=["idea","planned","in-progress","review","done","dropped"],r5=["feat","fix","chore","docs","refactor"],_G=["claude-code","opencode"],s5={"claude-code":"Claude Code",opencode:"OpenCode"},SG={"claude-code":{model:["opus","sonnet","fable","haiku"],effort:["low","medium","high","xhigh","max"]},opencode:{model:null}},CG={phase:{agent:"opencode"},planDraft:{agent:"claude-code"},ideaExtend:{agent:"claude-code"},commitSuggest:{agent:"claude-code"},feedback:{agent:"claude-code",model:"sonnet",effort:"medium"},codeReview:{agent:"claude-code",model:"opus",effort:"high"}};function jG(e,t){return e.agent===t.agent&&(e.model??"")===(t.model??"")}const i5=["in-progress","review","planned","idea"],o5=["open"],tg={statuses:i5,tags:[],search:"",sortKey:"order",sortDirection:"asc",noteStatuses:o5,subject:null},Yv={"in-progress":0,review:1,planned:2,idea:3,done:4,dropped:5},Tl=e=>{const t=new Date(e.updated??e.created).getTime();return Number.isNaN(t)?0:t},qv=e=>{const t=new Date(e.created).getTime();return Number.isNaN(t)?0:t},Qv=e=>{var n;const t=(n=e.id)==null?void 0:n.match(/(\d+)\s*$/);return t?Number(t[1]):Number.POSITIVE_INFINITY},sf=(e,t)=>{const n=t.trim().toLowerCase();return n?e.title.toLowerCase().includes(n)||e.body.toLowerCase().includes(n):!0},Xv=(e,t)=>t.size===0?!0:e.tags.some(n=>t.has(n)),Ko=(e,t)=>t===null||e===t,ng=(e,t,n,r="asc")=>{if(n==="order")return e.order!==void 0&&t.order!==void 0?(r==="desc"?-1:1)*(e.order-t.order):e.order!==void 0?-1:t.order!==void 0?1:qv(e)-qv(t);const s=(()=>{switch(n){case"status":{const i=Yv[e.status]-Yv[t.status];return i!==0?i:Tl(t)-Tl(e)}case"updated":return Tl(t)-Tl(e);case"title":return e.title.localeCompare(t.title);case"id":return Qv(e)-Qv(t);case"progress":return(Kv(t)??-1)-(Kv(e)??-1);default:return 0}})();return r==="desc"?-s:s},tp=(e,t)=>{const n={};for(const r of e)for(const s of t(r))n[String(s)]=(n[String(s)]??0)+1;return n},lc=(e,t=tg)=>{const n=new Set(t.tags),r=new Set(t.statuses),s=tp(e.filter(a=>Xv(a,n)&&sf(a,t.search)&&Ko(a.subject,t.subject)),a=>[a.status]);for(const a of n5)s[a]??(s[a]=0);const i=tp(e.filter(a=>r.has(a.status)&&sf(a,t.search)&&Ko(a.subject,t.subject)),a=>a.tags);return{rows:e.filter(a=>r.has(a.status)&&Xv(a,n)&&sf(a,t.search)&&Ko(a.subject,t.subject)).sort((a,l)=>ng(a,l,t.sortKey,t.sortDirection)),statusCounts:s,tagCounts:i}},a5=["open","done","dropped"],l5={open:"idea",done:"done",dropped:"dropped"},of=(e,t)=>{const n=t.trim().toLowerCase();return n?e.title.toLowerCase().includes(n)||e.body.toLowerCase().includes(n):!0},c5=e=>e.type==="plan"?e.plan.subject:e.idea.subject,u5=e=>e.type==="plan"?e.plan.order:e.idea.order,d5=e=>{const t=e.type==="plan"?e.plan.updated??e.plan.created:e.idea.created,n=new Date(t??"").getTime();return Number.isNaN(n)?0:n},Jv=(e,t)=>e.reduce((n,r)=>{const s=u5(r);return s===void 0?n:n===void 0?s:t==="desc"?Math.max(n,s):Math.min(n,s)},void 0),Zv=e=>e.reduce((t,n)=>Math.max(t,d5(n)),0),f5=(e,t="asc",n)=>{var a;const r=new Map,s=[];for(const l of e){const c=c5(l);if(!c||n&&!n.includes(c)){s.push(l);continue}r.has(c)||r.set(c,[]),(a=r.get(c))==null||a.push(l)}const i=t==="desc"?-1:1,o=[...r.entries()].map(([l,c])=>({subject:l,rows:c})).sort((l,c)=>{const u=Jv(l.rows,t),f=Jv(c.rows,t);return u!==void 0&&f!==void 0?i*(u-f):u!==void 0?-1:f!==void 0?1:Zv(c.rows)-Zv(l.rows)});return s.length>0&&o.push({subject:null,rows:s}),o},e0=e=>e.type==="plan"?e.plan:e.type==="note"?{title:e.idea.title,id:e.idea.id??void 0,status:l5[e.idea.status??"open"],created:e.idea.created??"",tags:[],body:e.idea.body,phases:[],order:e.idea.order}:{...(e.children.length>0?[...e.children].sort((n,r)=>ng(n,r,"status"))[0]:void 0)??{status:"idea",created:e.idea.created??"",tags:[],body:e.idea.body,phases:[]},title:e.idea.title,id:e.idea.id??void 0,order:e.idea.order},h5=(e,t,n=tg)=>{const{statusCounts:r,tagCounts:s}=lc(e,n),i=t.filter(p=>p.kind==="note"),o=t.filter(p=>p.kind!=="note"),a=new Set(o.map(p=>p.id).filter(p=>!!p)),l=new Map,c=[];for(const p of e)if(p.idea&&a.has(p.idea)){const m=l.get(p.idea)??[];m.push(p),l.set(p.idea,m)}else c.push(p);const u=new Set(n.noteStatuses),f=tp(i.filter(p=>of(p,n.search)),p=>[p.status??"open"]);for(const p of a5)f[p]??(f[p]=0);const h=lc(c,n).rows.map(p=>({type:"plan",plan:p}));for(const p of o){const m=p.id?l.get(p.id)??[]:[],g=lc(m,n).rows;!Ko(p.subject,n.subject)&&g.length===0||g.length===0&&(m.length>0||!of(p,n.search))||h.push({type:"idea-group",idea:p,children:g})}for(const p of i)u.has(p.status??"open")&&of(p,n.search)&&Ko(p.subject,n.subject)&&h.push({type:"note",idea:p});return h.sort((p,m)=>ng(e0(p),e0(m),n.sortKey,n.sortDirection)),{rows:h,statusCounts:r,tagCounts:s,noteStatusCounts:f}},p5=.2,m5=5,CS=3,jS=2,PS=1,g5=CS+jS+PS,y5=new Set(["a","an","the","and","or","of","to","in","on","for","is","at","with","this","that","it","as","be","by","are","was","were","from","into","so","but","not","its"]),Nl=e=>{const t=e.toLowerCase().split(/[^a-z0-9]+/).filter(n=>n.length>=2&&!y5.has(n));return new Set(t)},af=(e,t)=>{let n=0;for(const r of e)t.has(r)&&(n+=1);return n};function x5(e,t,n={}){const{threshold:r=p5,limit:s=m5}=n,i=Nl(e);if(i.size===0)return[];const o=[];for(const a of t){const l=Nl(a.title),c=Nl(a.body),u=Nl((a.tags??[]).join(" ")),h=(af(i,l)*CS+af(i,u)*jS+af(i,c)*PS)/(i.size*g5);h>=r&&o.push({candidate:a,score:h})}return o.sort((a,l)=>l.score-a.score),o.slice(0,s)}const v5=e=>{if(!e.file)return;const t=e.line_start??e.line;if(!t)return e.file;const n=e.line_end&&e.line_end!==t?`-${e.line_end}`:"";return`${e.file}:${t}${n}`},w5=(e,t)=>{const n=e.description??e.title??e.summary;if(!(n!=null&&n.trim()))throw new Error(`Finding ${t+1} has no description/title/summary`);const r=[v5(e),e.failure_scenario??e.reasoning].filter(Boolean).join(" — ");return{done:!1,text:n.trim(),description:r||void 0,source:"review"}},b5=e=>{let t;try{t=JSON.parse(e)}catch{throw new Error("Not valid JSON")}const n=Array.isArray(t)?t:Array.isArray(t==null?void 0:t.findings)?t.findings:null;if(!n)throw new Error('Expected a JSON array of findings, or an object with a "findings" array');if(n.length===0)throw new Error("No findings to add");return n.map((r,s)=>w5(r,s))},k5=e=>`Fix the failing "${e}" check`,_5=({cmd:e,output:t})=>`The command was \`${e}\`.
66
-
67
- Output from the last run:
68
-
69
- ${t||"(no output captured)"}`,S5=(e,t)=>{const n=i=>t.find(o=>o.name===i),r=n("lint"),s=n("test");return[{name:"Quality",results:r?[r]:[]},{name:"Tests",results:s?[s]:[]},{name:"Consistency",results:[e.consistency]}]},C5=(e,t)=>S5(e,t).flatMap(({name:n,results:r})=>{const s=r.filter(o=>o.status==="fail");if(s.length===0)return[];const i=s.map(_5).join(`
70
-
71
- `);return[{done:!1,text:k5(n),description:`Fix the failing "${n}" check in this repo.
72
-
73
- ${i}`}]}),j5=(e,t,n)=>{const r=new Map(C5(t,n).map(i=>[i.text,i]));return[...e.map(i=>{const o=r.get(i.text);return o?(r.delete(i.text),o):i}),...r.values()]},P5=/^[a-z]+\([a-z-]+\):\s+/,E5=e=>e.replace(P5,""),T5=(e,t)=>[...e,{done:!0,text:E5(t),source:"manual"}],ES="papercamp/",N5=e=>e.length>0&&e.every(t=>t.startsWith(ES)),R5=e=>`${ES}ideas/${e}.md`,A5=14*24*60*60*1e3;function Fa(e){try{const t=localStorage.getItem(e);if(!t)return null;const n=JSON.parse(t);return Date.now()-n.storedAt>A5?(localStorage.removeItem(e),null):n.value}catch{return null}}function Oa(e,t){try{const n={value:t,storedAt:Date.now()};localStorage.setItem(e,JSON.stringify(n))}catch{}}function rg(e){try{localStorage.removeItem(e)}catch{}}const TS="plan-filters",NS="detail-view";function I5(){return Fa(TS)??tg}function M5(){return Fa(NS)??"details"}function us(e){return Oa(TS,e),e}function L5(e,t){return{plans:null,plansLoading:!1,plansError:null,loadPlans:dt(e,bS,n=>({plans:n,plansError:null}),n=>({plansError:String(n)}),"plansLoading"),planFilters:I5(),togglePlanStatus:n=>e(r=>({planFilters:us({...r.planFilters,statuses:r.planFilters.statuses.includes(n)?r.planFilters.statuses.filter(s=>s!==n):[...r.planFilters.statuses,n]})})),togglePlanTag:n=>e(r=>({planFilters:us({...r.planFilters,tags:r.planFilters.tags.includes(n)?r.planFilters.tags.filter(s=>s!==n):[...r.planFilters.tags,n]})})),toggleNoteStatus:n=>e(r=>({planFilters:us({...r.planFilters,noteStatuses:r.planFilters.noteStatuses.includes(n)?r.planFilters.noteStatuses.filter(s=>s!==n):[...r.planFilters.noteStatuses,n]})})),setPlanSearch:n=>e(r=>({planFilters:us({...r.planFilters,search:n})})),setSubjectFilter:n=>e(r=>({planFilters:us({...r.planFilters,subject:n})})),setPlanSortKey:n=>e(r=>({planFilters:us({...r.planFilters,sortKey:n})})),togglePlanSortDirection:()=>e(n=>({planFilters:us({...n.planFilters,sortDirection:n.planFilters.sortDirection==="asc"?"desc":"asc"})})),detailView:M5(),setDetailView:n=>{Oa(NS,n),e({detailView:n})}}}const D5={horizons:[],statuses:[]},F5=e=>[...new Set(e.links.map(t=>t.status))],RS=(e,t)=>t.length===0||e.links.some(n=>t.includes(n.status)),AS=(e,t)=>t.length===0||t.includes(e),PG=(e,t)=>e.horizons.filter(n=>AS(n.title,t.horizons)).map(n=>({...n,items:n.items.filter(r=>RS(r,t.statuses))})),EG=(e,t)=>Object.fromEntries(e.horizons.map(n=>[n.title,n.items.filter(r=>RS(r,t.statuses)).length])),TG=(e,t)=>{const n={};for(const r of e.horizons)if(AS(r.title,t.horizons))for(const s of r.items)for(const i of F5(s))n[i]=(n[i]??0)+1;return n};function O5(e,t){return{roadmap:null,roadmapLoading:!1,roadmapError:null,loadRoadmap:dt(e,yS,n=>({roadmap:n,roadmapError:null}),n=>({roadmapError:String(n)}),"roadmapLoading"),roadmapFilters:D5,toggleRoadmapHorizon:n=>e(r=>({roadmapFilters:{...r.roadmapFilters,horizons:r.roadmapFilters.horizons.includes(n)?r.roadmapFilters.horizons.filter(s=>s!==n):[...r.roadmapFilters.horizons,n]}})),toggleRoadmapStatus:n=>e(r=>({roadmapFilters:{...r.roadmapFilters,statuses:r.roadmapFilters.statuses.includes(n)?r.roadmapFilters.statuses.filter(s=>s!==n):[...r.roadmapFilters.statuses,n]}}))}}const $5=async()=>(await fetch(G("/api/status"))).json(),z5=async()=>{await fetch(G("/api/status/check?name=consistency"),{method:"POST"})},B5=async()=>{const e=await fetch(G("/api/refresh"),{method:"POST"});if(!e.ok)throw new Error(`Failed to drop caches: ${e.statusText}`)};function V5(e,t){return{status:null,refreshing:!1,loadStatus:dt(e,$5,n=>({status:n})),refreshAll:async()=>{e({refreshing:!0});try{await B5().catch(()=>{}),await Promise.all([t().loadPlans(),t().loadIdeas(),t().loadArchivableIdeas(),t().loadSuggestions(),t().loadStatus(),t().loadConsistency(),t().loadDoctor(),t().loadGitStatus(),t().loadAgentStatus(),t().loadAgentAuthStatus()]);const n=t().plansError;return n?{ok:!1,error:n}:{ok:!0}}finally{e({refreshing:!1})}},runConsistencyCheck:async()=>{try{await z5()}catch{}},commitInFlight:!1,setCommitInFlight:n=>e({commitInFlight:n}),activeGitAction:null,setActiveGitAction:n=>e({activeGitAction:n}),quickCommit:async()=>{const{gitStatus:n,loadGitStatus:r,commitInFlight:s}=t();if(s)return{ok:!1,error:"A commit is already in progress"};if(!n||n.length===0)return{ok:!1,error:"Nothing to commit"};const i=n.map(o=>o.path);e({commitInFlight:!0});try{const{title:o,message:a}=await hS(i);return await ep(i,o,a||void 0),await r()?{ok:!0,title:o}:{ok:!0,title:o,warning:"Committed, but the git status refresh failed — reload to confirm"}}catch(o){return{ok:!1,error:o.message}}finally{e({commitInFlight:!1})}},consistency:[],loadConsistency:dt(e,IB,n=>({consistency:n})),doctor:{findings:[],errorCount:0,warningCount:0},loadDoctor:dt(e,MB,n=>({doctor:n})),gitStatus:null,gitBranch:null,gitAhead:0,gitBehind:0,gitDiverged:!1,gitBranchHygiene:null,gitStashes:[],loadGitStatus:async()=>{try{const{branch:n,entries:r,ahead:s,behind:i,diverged:o,branchHygiene:a,stashes:l}=await L4();return e({gitStatus:r,gitBranch:n,gitAhead:s,gitBehind:i,gitDiverged:o,gitBranchHygiene:a,gitStashes:l}),!0}catch{return!1}},capabilities:[],loadCapabilities:dt(e,mS,n=>({capabilities:n??[]}),()=>({capabilities:[]}))}}function U5(e,t){return{suggestions:[],suggestionsLoading:!0,loadSuggestions:dt(e,EB,n=>({suggestions:n.entries}),()=>({suggestions:[]}),"suggestionsLoading"),promoteSuggestion:async n=>{const{id:r}=await TB(n);return await Promise.all([t().loadSuggestions(),t().loadPlans(),t().loadIdeas()]),r},dismissSuggestion:async n=>{await NB(n),await t().loadSuggestions()},promoteRoadmapItem:async(n,r,s,i)=>{const{id:o}=await AB(n,r,s,i);return await Promise.all([t().loadPlans(),t().loadIdeas()]),o},launchPrioritise:async()=>{const n=await OB();return await t().refreshAll(),n}}}function W5(e){return{taskLog:[],taskLogLoading:!0,loadTaskLog:dt(e,PB,t=>({taskLog:t.entries}),()=>({taskLog:[]}),"taskLogLoading")}}const M=J4()((e,t)=>({...L5(e),...O5(e),...KB(e,t),...U5(e,t),...W5(e),...GB(e,t),...V5(e,t),...CB(e,t),...jB(e,t),...qB(e),...YB(e,t)})),$u=e=>e.agentStatus.some(t=>t.status!=="done"&&t.status!=="error"),ur=e=>e.capabilities.length===0||e.capabilities.some(t=>t.id.startsWith("agent:")&&t.status==="ok"),IS=e=>{const t=e.capabilities.find(n=>n.id==="gh");return t===void 0||t.status==="ok"},H5=e=>e.capabilities.filter(t=>t.status!=="ok").length,G5=e=>{var t;return((t=e.agentAuthStatus)==null?void 0:t.loggedIn)===!1},K5=e=>{var t;return((t=e.agentStatus.find(n=>n.rateLimit))==null?void 0:t.rateLimit)??null},Y5=({children:e,onClick:t})=>d.jsx("button",{type:"button",onClick:t,className:"bg-transparent border-none p-0 text-watercolor-amber-dark cursor-pointer underline [font:inherit]",children:e}),q5=e=>e<=0?"today":e===1?"1 day ago":`${e} days ago`,Q5="A sync pop failed and left work parked here. Recover with `git restore --source=origin/main --staged --worktree .` then `git merge --ff-only`.",X5=({entry:e})=>{const[t,n]=b.useState(null),[r,s]=b.useState(!1),[i,o]=b.useState(null),[a,l]=b.useState(!1),c=async()=>{if(a){l(!1);return}if(l(!0),!(t!==null||r)){s(!0),o(null);try{n(await F4(e.index))}catch(u){o(u.message)}finally{s(!1)}}};return d.jsxs("div",{className:"flex flex-col gap-1",children:[d.jsxs(Y5,{onClick:c,children:[e.branch,": ",e.message," · ",q5(e.ageDays)]}),a&&d.jsx("pre",{className:"m-0 max-h-64 overflow-auto whitespace-pre-wrap font-mono text-2xs opacity-80",children:r?"Loading…":i??t})]})},J5=()=>{const e=M(s=>s.gitStashes),[t,n]=b.useState(!1);if(e.length===0)return null;const r=e.some(s=>s.own);return d.jsxs("div",{children:[d.jsx("button",{type:"button",onClick:()=>n(s=>!s),className:"inline-flex bg-none bg-transparent border-none p-0 cursor-pointer","aria-expanded":t,children:d.jsxs(_e,{size:"small",variant:r?"warning":"neutral",children:[e.length," stash",e.length===1?"":"es"]})}),t&&d.jsxs("div",{className:"mt-2 flex flex-col gap-2",children:[r&&d.jsx("p",{className:"m-0 text-2xs opacity-80",children:Q5}),e.map(s=>d.jsx(X5,{entry:s},s.index))]})]})};function We(e){const t=e.split(`
74
- `).map(r=>r.trim()).filter(Boolean);return t.find(r=>r.startsWith("!")||r.startsWith("error:")||r.startsWith("fatal:"))??t.at(-1)??e}function Rl(e,t){const{toast:n}=He(),r=M(o=>o.activeGitAction),s=M(o=>o.setActiveGitAction),i=b.useCallback(async o=>{if(!M.getState().activeGitAction){s(e);try{await o()}catch(a){n({title:t,description:We(a.message),variant:"error"})}finally{s(null)}}},[n,t,e,s]);return[r===e,i]}function Z5(){const e=M(k=>k.loadGitStatus),t=M(k=>k.loadPlans),n=M(k=>k.loadIdeas),r=M(k=>k.activeGitAction!==null),{toast:s,dismiss:i}=He(),o=()=>Promise.all([e(),t(),n()]),[a,l]=Rl("push","Push failed"),[c,u]=Rl("sync","Sync failed"),[f,h]=Rl("pull","Pull failed"),[p,m]=Rl("fix-divergence","Fix failed"),g=b.useCallback((k,C)=>{if(C.recovering)return s({title:`${k} needs help`,description:"Handed off to a recovery agent — see Stack for progress",variant:"warning"}),!0;if("conflictPrompt"in C){const{conflictPrompt:S,message:P}=C,T=s({title:`${k} hit a conflict`,description:d.jsxs("div",{className:"flex flex-col items-start gap-2",children:[d.jsx("span",{children:We(P)}),d.jsx(se,{size:"small",onClick:async()=>{const E=await U4(S).catch(j=>({ok:!1,error:We(j.message)}));E.ok&&i(T),s({title:E.ok?"Resolving conflict":"Could not start the agent",description:E.ok?"Handed off to the agent — see Stack for progress":E.error??"The agent did not start.",variant:E.ok?"warning":"error"})},children:"Ask the agent to resolve"})]}),variant:"error",duration:0});return!0}return!1},[s,i]);return{pushing:a,syncing:c,pulling:f,fixingDivergence:p,gitActionBusy:r,handlePush:()=>l(async()=>{await $4(),await e()}),handleSync:()=>u(async()=>{const k=await z4();if(!k.ok){if(g("Sync",k)){await e();return}throw new Error(k.message)}await o()}),handlePull:()=>h(async()=>{await B4(),await o()}),handleFixDivergence:()=>m(async()=>{const k=await V4();if(!k.ok){if(g("Fix",k)){await e();return}throw new Error(k.message)}await o()})}}const eV=()=>{const e=M(c=>c.gitAhead),t=M(c=>c.gitBranchHygiene),{pushing:n,syncing:r,pulling:s,gitActionBusy:i,handlePush:o,handleSync:a,handlePull:l}=Z5();return d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(be,{content:t==="clean-on-main"?"Already on clean main":void 0,children:d.jsx(se,{size:"small",variant:"secondary",icon:d.jsx(uS,{size:14}),disabled:i||t==="clean-on-main",onClick:a,children:r?"Syncing…":"Sync to main"})}),d.jsx(se,{size:"small",icon:d.jsx(S4,{size:14}),disabled:i||e===0,onClick:o,children:n?"Pushing…":e>0?`Push (${e})`:"Push"}),d.jsx(se,{size:"small",variant:"secondary",icon:d.jsx(C4,{size:14}),disabled:i,onClick:l,children:s?"Pulling…":"Pull"})]})};function tV(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const nV=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,rV=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,sV={};function t0(e,t){return(sV.jsx?rV:nV).test(e)}const iV=/[ \t\n\f\r]/g;function oV(e){return typeof e=="object"?e.type==="text"?n0(e.value):!1:n0(e)}function n0(e){return e.replace(iV,"")===""}class $a{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}$a.prototype.normal={};$a.prototype.property={};$a.prototype.space=void 0;function MS(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new $a(n,r,t)}function np(e){return e.toLowerCase()}class Et{constructor(t,n){this.attribute=n,this.property=t}}Et.prototype.attribute="";Et.prototype.booleanish=!1;Et.prototype.boolean=!1;Et.prototype.commaOrSpaceSeparated=!1;Et.prototype.commaSeparated=!1;Et.prototype.defined=!1;Et.prototype.mustUseProperty=!1;Et.prototype.number=!1;Et.prototype.overloadedBoolean=!1;Et.prototype.property="";Et.prototype.spaceSeparated=!1;Et.prototype.space=void 0;let aV=0;const te=Bs(),Fe=Bs(),rp=Bs(),W=Bs(),ge=Bs(),Ts=Bs(),It=Bs();function Bs(){return 2**++aV}const sp=Object.freeze(Object.defineProperty({__proto__:null,boolean:te,booleanish:Fe,commaOrSpaceSeparated:It,commaSeparated:Ts,number:W,overloadedBoolean:rp,spaceSeparated:ge},Symbol.toStringTag,{value:"Module"})),lf=Object.keys(sp);class sg extends Et{constructor(t,n,r,s){let i=-1;if(super(t,n),r0(this,"space",s),typeof r=="number")for(;++i<lf.length;){const o=lf[i];r0(this,lf[i],(r&sp[o])===sp[o])}}}sg.prototype.defined=!0;function r0(e,t,n){n&&(e[t]=n)}function Xi(e){const t={},n={};for(const[r,s]of Object.entries(e.properties)){const i=new sg(r,e.transform(e.attributes||{},r),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[np(r)]=r,n[np(i.attribute)]=r}return new $a(t,n,e.space)}const LS=Xi({properties:{ariaActiveDescendant:null,ariaAtomic:Fe,ariaAutoComplete:null,ariaBusy:Fe,ariaChecked:Fe,ariaColCount:W,ariaColIndex:W,ariaColSpan:W,ariaControls:ge,ariaCurrent:null,ariaDescribedBy:ge,ariaDetails:null,ariaDisabled:Fe,ariaDropEffect:ge,ariaErrorMessage:null,ariaExpanded:Fe,ariaFlowTo:ge,ariaGrabbed:Fe,ariaHasPopup:null,ariaHidden:Fe,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ge,ariaLevel:W,ariaLive:null,ariaModal:Fe,ariaMultiLine:Fe,ariaMultiSelectable:Fe,ariaOrientation:null,ariaOwns:ge,ariaPlaceholder:null,ariaPosInSet:W,ariaPressed:Fe,ariaReadOnly:Fe,ariaRelevant:null,ariaRequired:Fe,ariaRoleDescription:ge,ariaRowCount:W,ariaRowIndex:W,ariaRowSpan:W,ariaSelected:Fe,ariaSetSize:W,ariaSort:null,ariaValueMax:W,ariaValueMin:W,ariaValueNow:W,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function DS(e,t){return t in e?e[t]:t}function FS(e,t){return DS(e,t.toLowerCase())}const lV=Xi({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ts,acceptCharset:ge,accessKey:ge,action:null,allow:null,allowFullScreen:te,allowPaymentRequest:te,allowUserMedia:te,alpha:te,alt:null,as:null,async:te,autoCapitalize:null,autoComplete:ge,autoFocus:te,autoPlay:te,blocking:ge,capture:null,charSet:null,checked:te,cite:null,className:ge,closedBy:null,colorSpace:null,cols:W,colSpan:W,command:null,commandFor:null,content:null,contentEditable:Fe,controls:te,controlsList:ge,coords:W|Ts,crossOrigin:null,data:null,dateTime:null,decoding:null,default:te,defer:te,dir:null,dirName:null,disabled:te,download:rp,draggable:Fe,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:te,formTarget:null,headers:ge,height:W,hidden:rp,high:W,href:null,hrefLang:null,htmlFor:ge,httpEquiv:ge,id:null,imageSizes:null,imageSrcSet:null,inert:te,inputMode:null,integrity:null,is:null,isMap:te,itemId:null,itemProp:ge,itemRef:ge,itemScope:te,itemType:ge,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:te,low:W,manifest:null,max:null,maxLength:W,media:null,method:null,min:null,minLength:W,multiple:te,muted:te,name:null,nonce:null,noModule:te,noValidate:te,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:te,optimum:W,pattern:null,ping:ge,placeholder:null,playsInline:te,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:te,referrerPolicy:null,rel:ge,required:te,reversed:te,rows:W,rowSpan:W,sandbox:ge,scope:null,scoped:te,seamless:te,selected:te,shadowRootClonable:te,shadowRootCustomElementRegistry:te,shadowRootDelegatesFocus:te,shadowRootMode:null,shadowRootSerializable:te,shape:null,size:W,sizes:null,slot:null,span:W,spellCheck:Fe,src:null,srcDoc:null,srcLang:null,srcSet:null,start:W,step:null,style:null,tabIndex:W,target:null,title:null,translate:null,type:null,typeMustMatch:te,useMap:null,value:Fe,width:W,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ge,axis:null,background:null,bgColor:null,border:W,borderColor:null,bottomMargin:W,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:te,declare:te,event:null,face:null,frame:null,frameBorder:null,hSpace:W,leftMargin:W,link:null,longDesc:null,lowSrc:null,marginHeight:W,marginWidth:W,noResize:te,noHref:te,noShade:te,noWrap:te,object:null,profile:null,prompt:null,rev:null,rightMargin:W,rules:null,scheme:null,scrolling:Fe,standby:null,summary:null,text:null,topMargin:W,valueType:null,version:null,vAlign:null,vLink:null,vSpace:W,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:te,disablePictureInPicture:te,disableRemotePlayback:te,exportParts:Ts,part:ge,prefix:null,property:null,results:W,security:null,unselectable:null},space:"html",transform:FS}),cV=Xi({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:It,accentHeight:W,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:W,amplitude:W,arabicForm:null,ascent:W,attributeName:null,attributeType:null,azimuth:W,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:W,by:null,calcMode:null,capHeight:W,className:ge,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:W,diffuseConstant:W,direction:null,display:null,dur:null,divisor:W,dominantBaseline:null,download:te,dx:null,dy:null,edgeMode:null,editable:null,elevation:W,enableBackground:null,end:null,event:null,exponent:W,externalResourcesRequired:null,fill:null,fillOpacity:W,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:Ts,g2:Ts,glyphName:Ts,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:W,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:W,horizOriginX:W,horizOriginY:W,id:null,ideographic:W,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:W,k:W,k1:W,k2:W,k3:W,k4:W,kernelMatrix:It,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:W,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:W,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:W,overlineThickness:W,paintOrder:null,panose1:null,path:null,pathLength:W,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ge,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:W,pointsAtY:W,pointsAtZ:W,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:It,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:It,rev:It,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:It,requiredFeatures:It,requiredFonts:It,requiredFormats:It,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:W,specularExponent:W,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:W,strikethroughThickness:W,string:null,stroke:null,strokeDashArray:It,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:W,strokeOpacity:W,strokeWidth:null,style:null,surfaceScale:W,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:It,tabIndex:W,tableValues:null,target:null,targetX:W,targetY:W,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:It,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:W,underlineThickness:W,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:W,values:null,vAlphabetic:W,vMathematical:W,vectorEffect:null,vHanging:W,vIdeographic:W,version:null,vertAdvY:W,vertOriginX:W,vertOriginY:W,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:W,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:DS}),OS=Xi({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()}}),$S=Xi({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:FS}),zS=Xi({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),uV={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"},dV=/[A-Z]/g,s0=/-[a-z]/g,fV=/^data[-\w.:]+$/i;function hV(e,t){const n=np(t);let r=t,s=Et;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&fV.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(s0,mV);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!s0.test(i)){let o=i.replace(dV,pV);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}s=sg}return new s(r,t)}function pV(e){return"-"+e.toLowerCase()}function mV(e){return e.charAt(1).toUpperCase()}const gV=MS([LS,lV,OS,$S,zS],"html"),ig=MS([LS,cV,OS,$S,zS],"svg");function yV(e){return e.join(" ").trim()}var og={},i0=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,xV=/\n/g,vV=/^\s*/,wV=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,bV=/^:\s*/,kV=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,_V=/^[;\s]*/,SV=/^\s+|\s+$/g,CV=`
75
- `,o0="/",a0="*",ms="",jV="comment",PV="declaration";function EV(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 s(m){var g=m.match(xV);g&&(n+=g.length);var w=m.lastIndexOf(CV);r=~w?m.length-w:r+m.length}function i(){var m={line:n,column:r};return function(g){return g.position=new o(m),c(),g}}function o(m){this.start=m,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function a(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 l(m){var g=m.exec(e);if(g){var w=g[0];return s(w),e=e.slice(w.length),g}}function c(){l(vV)}function u(m){var g;for(m=m||[];g=f();)g!==!1&&m.push(g);return m}function f(){var m=i();if(!(o0!=e.charAt(0)||a0!=e.charAt(1))){for(var g=2;ms!=e.charAt(g)&&(a0!=e.charAt(g)||o0!=e.charAt(g+1));)++g;if(g+=2,ms===e.charAt(g-1))return a("End of comment missing");var w=e.slice(2,g-2);return r+=2,s(w),e=e.slice(g),r+=2,m({type:jV,comment:w})}}function h(){var m=i(),g=l(wV);if(g){if(f(),!l(bV))return a("property missing ':'");var w=l(kV),y=m({type:PV,property:l0(g[0].replace(i0,ms)),value:w?l0(w[0].replace(i0,ms)):ms});return l(_V),y}}function p(){var m=[];u(m);for(var g;g=h();)g!==!1&&(m.push(g),u(m));return m}return c(),p()}function l0(e){return e?e.replace(SV,ms):ms}var TV=EV,NV=dc&&dc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(og,"__esModule",{value:!0});og.default=AV;const RV=NV(TV);function AV(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,RV.default)(e),s=typeof t=="function";return r.forEach(i=>{if(i.type!=="declaration")return;const{property:o,value:a}=i;s?t(o,a,i):a&&(n=n||{},n[o]=a)}),n}var zu={};Object.defineProperty(zu,"__esModule",{value:!0});zu.camelCase=void 0;var IV=/^--[a-zA-Z0-9_-]+$/,MV=/-([a-z])/g,LV=/^[^-]+$/,DV=/^-(webkit|moz|ms|o|khtml)-/,FV=/^-(ms)-/,OV=function(e){return!e||LV.test(e)||IV.test(e)},$V=function(e,t){return t.toUpperCase()},c0=function(e,t){return"".concat(t,"-")},zV=function(e,t){return t===void 0&&(t={}),OV(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(FV,c0):e=e.replace(DV,c0),e.replace(MV,$V))};zu.camelCase=zV;var BV=dc&&dc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},VV=BV(og),UV=zu;function ip(e,t){var n={};return!e||typeof e!="string"||(0,VV.default)(e,function(r,s){r&&s&&(n[(0,UV.camelCase)(r,t)]=s)}),n}ip.default=ip;var WV=ip;const HV=ou(WV),BS=VS("end"),ag=VS("start");function VS(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 GV(e){const t=ag(e),n=BS(e);if(t&&n)return{start:t,end:n}}function Yo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?u0(e.position):"start"in e||"end"in e?u0(e):"line"in e||"column"in e?op(e):""}function op(e){return d0(e&&e.line)+":"+d0(e&&e.column)}function u0(e){return op(e&&e.start)+"-"+op(e&&e.end)}function d0(e){return e&&typeof e=="number"?e:1}class at extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",i={},o=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?s=t:!i.cause&&t&&(o=!0,s=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?i.ruleId=r:(i.source=r.slice(0,l),i.ruleId=r.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const a=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=a?a.line:void 0,this.name=Yo(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=o&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}at.prototype.file="";at.prototype.name="";at.prototype.reason="";at.prototype.message="";at.prototype.stack="";at.prototype.column=void 0;at.prototype.line=void 0;at.prototype.ancestors=void 0;at.prototype.cause=void 0;at.prototype.fatal=void 0;at.prototype.place=void 0;at.prototype.ruleId=void 0;at.prototype.source=void 0;const lg={}.hasOwnProperty,KV=new Map,YV=/[A-Z]/g,qV=new Set(["table","tbody","thead","tfoot","tr"]),QV=new Set(["td","th"]),US="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function XV(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=i6(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=s6(n,t.jsx,t.jsxs)}const s={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"?ig:gV,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=WS(s,e,void 0);return i&&typeof i!="string"?i:s.create(e,s.Fragment,{children:i||void 0},void 0)}function WS(e,t,n){if(t.type==="element")return JV(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return ZV(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return t6(e,t,n);if(t.type==="mdxjsEsm")return e6(e,t);if(t.type==="root")return n6(e,t,n);if(t.type==="text")return r6(e,t)}function JV(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=ig,e.schema=s),e.ancestors.push(t);const i=GS(e,t.tagName,!1),o=o6(e,t);let a=ug(e,t);return qV.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!oV(l):!0})),HS(e,o,i,t),cg(o,a),e.ancestors.pop(),e.schema=r,e.create(t,i,o,n)}function ZV(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)}Sa(e,t.position)}function e6(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Sa(e,t.position)}function t6(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=ig,e.schema=s),e.ancestors.push(t);const i=t.name===null?e.Fragment:GS(e,t.name,!0),o=a6(e,t),a=ug(e,t);return HS(e,o,i,t),cg(o,a),e.ancestors.pop(),e.schema=r,e.create(t,i,o,n)}function n6(e,t,n){const r={};return cg(r,ug(e,t)),e.create(t,e.Fragment,r,n)}function r6(e,t){return t.value}function HS(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function cg(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function s6(e,t,n){return r;function r(s,i,o,a){const c=Array.isArray(o.children)?n:t;return a?c(i,o,a):c(i,o)}}function i6(e,t){return n;function n(r,s,i,o){const a=Array.isArray(i.children),l=ag(r);return t(s,i,o,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function o6(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&lg.call(t.properties,s)){const i=l6(e,s,t.properties[s]);if(i){const[o,a]=i;e.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&QV.has(t.tagName)?r=a:n[o]=a}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function a6(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const o=i.expression;o.type;const a=o.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Sa(e,t.position);else{const s=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,i=e.evaluater.evaluateExpression(a.expression)}else Sa(e,t.position);else i=r.value===null?!0:r.value;n[s]=i}return n}function ug(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:KV;for(;++r<t.children.length;){const i=t.children[r];let o;if(e.passKeys){const l=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(l){const c=s.get(l)||0;o=l+"-"+c,s.set(l,c+1)}}const a=WS(e,i,o);a!==void 0&&n.push(a)}return n}function l6(e,t,n){const r=hV(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?tV(n):yV(n)),r.property==="style"){let s=typeof n=="object"?n:c6(e,String(n));return e.stylePropertyNameCase==="css"&&(s=u6(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&r.space?uV[r.property]||r.property:r.attribute,n]}}function c6(e,t){try{return HV(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,s=new at("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=US+"#cannot-parse-style-attribute",s}}function GS(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let i=-1,o;for(;++i<s.length;){const a=t0(s[i])?{type:"Identifier",name:s[i]}:{type:"Literal",value:s[i]};o=o?{type:"MemberExpression",object:o,property:a,computed:!!(i&&a.type==="Literal"),optional:!1}:a}r=o}else r=t0(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const s=r.value;return lg.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(r);Sa(e)}function Sa(e,t){const n=new at("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=US+"#cannot-handle-mdx-estrees-without-createevaluater",n}function u6(e){const t={};let n;for(n in e)lg.call(e,n)&&(t[d6(n)]=e[n]);return t}function d6(e){let t=e.replace(YV,f6);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function f6(e){return"-"+e.toLowerCase()}const cf={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"]},h6={};function p6(e,t){const n=h6,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return KS(e,r,s)}function KS(e,t,n){if(m6(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 f0(e.children,t,n)}return Array.isArray(e)?f0(e,t,n):""}function f0(e,t,n){const r=[];let s=-1;for(;++s<e.length;)r[s]=KS(e[s],t,n);return r.join("")}function m6(e){return!!(e&&typeof e=="object")}const h0=document.createElement("i");function dg(e){const t="&"+e+";";h0.innerHTML=t;const n=h0.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Un(e,t,n,r){const s=e.length;let i=0,o;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);i<r.length;)o=r.slice(i,i+1e4),o.unshift(t,0),e.splice(...o),i+=1e4,t+=1e4}function Xt(e,t){return e.length>0?(Un(e,e.length,0,t),e):t}const p0={}.hasOwnProperty;function g6(e){const t={};let n=-1;for(;++n<e.length;)y6(t,e[n]);return t}function y6(e,t){let n;for(n in t){const s=(p0.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let o;if(i)for(o in i){p0.call(s,o)||(s[o]=[]);const a=i[o];x6(s[o],Array.isArray(a)?a:a?[a]:[])}}}function x6(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Un(e,0,0,r)}function YS(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 Ci(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const On=ns(/[A-Za-z]/),Ft=ns(/[\dA-Za-z]/),v6=ns(/[#-'*+\--9=?A-Z^-~]/);function ap(e){return e!==null&&(e<32||e===127)}const lp=ns(/\d/),w6=ns(/[\dA-Fa-f]/),b6=ns(/[!-/:-@[-`{-~]/);function Z(e){return e!==null&&e<-2}function St(e){return e!==null&&(e<0||e===32)}function ce(e){return e===-2||e===-1||e===32}const k6=ns(new RegExp("\\p{P}|\\p{S}","u")),_6=ns(/\s/);function ns(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ji(e){const t=[];let n=-1,r=0,s=0;for(;++n<e.length;){const i=e.charCodeAt(n);let o="";if(i===37&&Ft(e.charCodeAt(n+1))&&Ft(e.charCodeAt(n+2)))s=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(o=String.fromCharCode(i));else if(i>55295&&i<57344){const a=e.charCodeAt(n+1);i<56320&&a>56319&&a<57344?(o=String.fromCharCode(i,a),s=1):o="�"}else o=String.fromCharCode(i);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+s+1,o=""),s&&(n+=s,s=0)}return t.join("")+e.slice(r)}function ke(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return o;function o(l){return ce(l)?(e.enter(n),a(l)):t(l)}function a(l){return ce(l)&&i++<s?(e.consume(l),a):(e.exit(n),t(l))}}const S6={tokenize:C6};function C6(e){const t=e.attempt(this.parser.constructs.contentInitial,r,s);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),ke(e,t,"linePrefix")}function s(a){return e.enter("paragraph"),i(a)}function i(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,o(a)}function o(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return Z(a)?(e.consume(a),e.exit("chunkText"),i):(e.consume(a),o)}}const j6={tokenize:P6},m0={tokenize:E6};function P6(e){const t=this,n=[];let r=0,s,i,o;return a;function a(v){if(r<n.length){const k=n[r];return t.containerState=k[1],e.attempt(k[0].continuation,l,c)(v)}return c(v)}function l(v){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&x();const k=t.events.length;let C=k,S;for(;C--;)if(t.events[C][0]==="exit"&&t.events[C][1].type==="chunkFlow"){S=t.events[C][1].end;break}y(r);let P=k;for(;P<t.events.length;)t.events[P][1].end={...S},P++;return Un(t.events,C+1,0,t.events.slice(k)),t.events.length=P,c(v)}return a(v)}function c(v){if(r===n.length){if(!s)return h(v);if(s.currentConstruct&&s.currentConstruct.concrete)return m(v);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(m0,u,f)(v)}function u(v){return s&&x(),y(r),h(v)}function f(v){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(v)}function h(v){return t.containerState={},e.attempt(m0,p,m)(v)}function p(v){return r++,n.push([t.currentConstruct,t.containerState]),h(v)}function m(v){if(v===null){s&&x(),y(0),e.consume(v);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:i}),g(v)}function g(v){if(v===null){w(e.exit("chunkFlow"),!0),y(0),e.consume(v);return}return Z(v)?(e.consume(v),w(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(v),g)}function w(v,k){const C=t.sliceStream(v);if(k&&C.push(null),v.previous=i,i&&(i.next=v),i=v,s.defineSkip(v.start),s.write(C),t.parser.lazy[v.start.line]){let S=s.events.length;for(;S--;)if(s.events[S][1].start.offset<o&&(!s.events[S][1].end||s.events[S][1].end.offset>o))return;const P=t.events.length;let T=P,E,j;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if(E){j=t.events[T][1].end;break}E=!0}for(y(r),S=P;S<t.events.length;)t.events[S][1].end={...j},S++;Un(t.events,T+1,0,t.events.slice(P)),t.events.length=S}}function y(v){let k=n.length;for(;k-- >v;){const C=n[k];t.containerState=C[1],C[0].exit.call(t,e)}n.length=v}function x(){s.write([null]),i=void 0,s=void 0,t.containerState._closeFlow=void 0}}function E6(e,t,n){return ke(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function g0(e){if(e===null||St(e)||_6(e))return 1;if(k6(e))return 2}function fg(e,t,n){const r=[];let s=-1;for(;++s<e.length;){const i=e[s].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const cp={name:"attention",resolveAll:T6,tokenize:N6};function T6(e,t){let n=-1,r,s,i,o,a,l,c,u;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[r][1].end},h={...e[n][1].start};y0(f,-l),y0(h,l),o={type:l>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},i={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},s={type:l>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},e[r][1].end={...o.start},e[n][1].start={...a.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=Xt(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Xt(c,[["enter",s,t],["enter",o,t],["exit",o,t],["enter",i,t]]),c=Xt(c,fg(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=Xt(c,[["exit",i,t],["enter",a,t],["exit",a,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=Xt(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,Un(e,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function N6(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=g0(r);let i;return o;function o(l){return i=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===i)return e.consume(l),a;const c=e.exit("attentionSequence"),u=g0(l),f=!u||u===2&&s||n.includes(l),h=!s||s===2&&u||n.includes(r);return c._open=!!(i===42?f:f&&(s||!h)),c._close=!!(i===42?h:h&&(u||!f)),t(l)}}function y0(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const R6={name:"autolink",tokenize:A6};function A6(e,t,n){let r=0;return s;function s(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(p){return On(p)?(e.consume(p),o):p===64?n(p):c(p)}function o(p){return p===43||p===45||p===46||Ft(p)?(r=1,a(p)):c(p)}function a(p){return p===58?(e.consume(p),r=0,l):(p===43||p===45||p===46||Ft(p))&&r++<32?(e.consume(p),a):(r=0,c(p))}function l(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||ap(p)?n(p):(e.consume(p),l)}function c(p){return p===64?(e.consume(p),u):v6(p)?(e.consume(p),c):n(p)}function u(p){return Ft(p)?f(p):n(p)}function f(p){return p===46?(e.consume(p),r=0,u):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):h(p)}function h(p){if((p===45||Ft(p))&&r++<63){const m=p===45?h:f;return e.consume(p),m}return n(p)}}const Bu={partial:!0,tokenize:I6};function I6(e,t,n){return r;function r(i){return ce(i)?ke(e,s,"linePrefix")(i):s(i)}function s(i){return i===null||Z(i)?t(i):n(i)}}const qS={continuation:{tokenize:L6},exit:D6,name:"blockQuote",tokenize:M6};function M6(e,t,n){const r=this;return s;function s(o){if(o===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),i}return n(o)}function i(o){return ce(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function L6(e,t,n){const r=this;return s;function s(o){return ce(o)?ke(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):i(o)}function i(o){return e.attempt(qS,t,n)(o)}}function D6(e){e.exit("blockQuote")}const QS={name:"characterEscape",tokenize:F6};function F6(e,t,n){return r;function r(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),s}function s(i){return b6(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const XS={name:"characterReference",tokenize:O6};function O6(e,t,n){const r=this;let s=0,i,o;return a;function a(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),l}function l(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),i=31,o=Ft,u(f))}function c(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,o=w6,u):(e.enter("characterReferenceValue"),i=7,o=lp,u(f))}function u(f){if(f===59&&s){const h=e.exit("characterReferenceValue");return o===Ft&&!dg(r.sliceSerialize(h))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(f)&&s++<i?(e.consume(f),u):n(f)}}const x0={partial:!0,tokenize:z6},v0={concrete:!0,name:"codeFenced",tokenize:$6};function $6(e,t,n){const r=this,s={partial:!0,tokenize:C};let i=0,o=0,a;return l;function l(S){return c(S)}function c(S){const P=r.events[r.events.length-1];return i=P&&P[1].type==="linePrefix"?P[2].sliceSerialize(P[1],!0).length:0,a=S,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(S)}function u(S){return S===a?(o++,e.consume(S),u):o<3?n(S):(e.exit("codeFencedFenceSequence"),ce(S)?ke(e,f,"whitespace")(S):f(S))}function f(S){return S===null||Z(S)?(e.exit("codeFencedFence"),r.interrupt?t(S):e.check(x0,g,k)(S)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(S))}function h(S){return S===null||Z(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(S)):ce(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ke(e,p,"whitespace")(S)):S===96&&S===a?n(S):(e.consume(S),h)}function p(S){return S===null||Z(S)?f(S):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(S))}function m(S){return S===null||Z(S)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(S)):S===96&&S===a?n(S):(e.consume(S),m)}function g(S){return e.attempt(s,k,w)(S)}function w(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),y}function y(S){return i>0&&ce(S)?ke(e,x,"linePrefix",i+1)(S):x(S)}function x(S){return S===null||Z(S)?e.check(x0,g,k)(S):(e.enter("codeFlowValue"),v(S))}function v(S){return S===null||Z(S)?(e.exit("codeFlowValue"),x(S)):(e.consume(S),v)}function k(S){return e.exit("codeFenced"),t(S)}function C(S,P,T){let E=0;return j;function j(A){return S.enter("lineEnding"),S.consume(A),S.exit("lineEnding"),R}function R(A){return S.enter("codeFencedFence"),ce(A)?ke(S,I,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):I(A)}function I(A){return A===a?(S.enter("codeFencedFenceSequence"),D(A)):T(A)}function D(A){return A===a?(E++,S.consume(A),D):E>=o?(S.exit("codeFencedFenceSequence"),ce(A)?ke(S,$,"whitespace")(A):$(A)):T(A)}function $(A){return A===null||Z(A)?(S.exit("codeFencedFence"),P(A)):T(A)}}}function z6(e,t,n){const r=this;return s;function s(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i)}function i(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const uf={name:"codeIndented",tokenize:V6},B6={partial:!0,tokenize:U6};function V6(e,t,n){const r=this;return s;function s(c){return e.enter("codeIndented"),ke(e,i,"linePrefix",5)(c)}function i(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?o(c):n(c)}function o(c){return c===null?l(c):Z(c)?e.attempt(B6,o,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||Z(c)?(e.exit("codeFlowValue"),o(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function U6(e,t,n){const r=this;return s;function s(o){return r.parser.lazy[r.now().line]?n(o):Z(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):ke(e,i,"linePrefix",5)(o)}function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):Z(o)?s(o):n(o)}}const W6={name:"codeText",previous:G6,resolve:H6,tokenize:K6};function H6(e){let t=e.length-4,n=3,r,s;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;)s===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(s=r):(r===t||e[r][1].type==="lineEnding")&&(e[s][1].type="codeTextData",r!==s+2&&(e[s][1].end=e[r-1][1].end,e.splice(s+2,r-s-2),t-=r-s-2,r=s+2),s=void 0);return e}function G6(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function K6(e,t,n){let r=0,s,i;return o;function o(f){return e.enter("codeText"),e.enter("codeTextSequence"),a(f)}function a(f){return f===96?(e.consume(f),r++,a):(e.exit("codeTextSequence"),l(f))}function l(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),l):f===96?(i=e.enter("codeTextSequence"),s=0,u(f)):Z(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(f))}function c(f){return f===null||f===32||f===96||Z(f)?(e.exit("codeTextData"),l(f)):(e.consume(f),c)}function u(f){return f===96?(e.consume(f),s++,u):s===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(i.type="codeTextData",c(f))}}class Y6{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 s=n||0;this.setCursor(Math.trunc(t));const i=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&_o(this.left,r),i.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),_o(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),_o(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);_o(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);_o(this.left,n.reverse())}}}function _o(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 JS(e){const t={};let n=-1,r,s,i,o,a,l,c;const u=new Y6(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type==="chunkFlow"&&u.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,i=0,i<l.length&&l[i][1].type==="lineEndingBlank"&&(i+=2),i<l.length&&l[i][1].type==="content"))for(;++i<l.length&&l[i][1].type!=="content";)l[i][1].type==="chunkText"&&(l[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,q6(u,n)),n=t[n],c=!0);else if(r[1]._container){for(i=n,s=void 0;i--;)if(o=u.get(i),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(s&&(u.get(s)[1].type="lineEndingBlank"),o[1].type="lineEnding",s=i);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;s&&(r[1].end={...u.get(s)[1].start},a=u.slice(s,n),a.unshift(r),u.splice(s,n-s+1,a))}}return Un(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function q6(e,t){const n=e.get(t)[1],r=e.get(t)[2];let s=t-1;const i=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const a=o.events,l=[],c={};let u,f,h=-1,p=n,m=0,g=0;const w=[g];for(;p;){for(;e.get(++s)[1]!==p;);i.push(s),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),f&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),f=p,p=p.next}for(p=n;++h<a.length;)a[h][0]==="exit"&&a[h-1][0]==="enter"&&a[h][1].type===a[h-1][1].type&&a[h][1].start.line!==a[h][1].end.line&&(g=h+1,w.push(g),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):w.pop(),h=w.length;h--;){const y=a.slice(w[h],w[h+1]),x=i.pop();l.push([x,x+y.length-1]),e.splice(x,2,y)}for(l.reverse(),h=-1;++h<l.length;)c[m+l[h][0]]=m+l[h][1],m+=l[h][1]-l[h][0]-1;return c}const Q6={resolve:J6,tokenize:Z6},X6={partial:!0,tokenize:e8};function J6(e){return JS(e),e}function Z6(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(a)}function s(a){return a===null?i(a):Z(a)?e.check(X6,o,i)(a):(e.consume(a),s)}function i(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function o(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function e8(e,t,n){const r=this;return s;function s(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),ke(e,i,"linePrefix")}function i(o){if(o===null||Z(o))return n(o);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function ZS(e,t,n,r,s,i,o,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return f;function f(y){return y===60?(e.enter(r),e.enter(s),e.enter(i),e.consume(y),e.exit(i),h):y===null||y===32||y===41||ap(y)?n(y):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),g(y))}function h(y){return y===62?(e.enter(i),e.consume(y),e.exit(i),e.exit(s),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===62?(e.exit("chunkString"),e.exit(a),h(y)):y===null||y===60||Z(y)?n(y):(e.consume(y),y===92?m:p)}function m(y){return y===60||y===62||y===92?(e.consume(y),p):p(y)}function g(y){return!u&&(y===null||y===41||St(y))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),t(y)):u<c&&y===40?(e.consume(y),u++,g):y===41?(e.consume(y),u--,g):y===null||y===32||y===40||ap(y)?n(y):(e.consume(y),y===92?w:g)}function w(y){return y===40||y===41||y===92?(e.consume(y),g):g(y)}}function eC(e,t,n,r,s,i){const o=this;let a=0,l;return c;function c(p){return e.enter(r),e.enter(s),e.consume(p),e.exit(s),e.enter(i),u}function u(p){return a>999||p===null||p===91||p===93&&!l||p===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?n(p):p===93?(e.exit(i),e.enter(s),e.consume(p),e.exit(s),e.exit(r),t):Z(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===null||p===91||p===93||Z(p)||a++>999?(e.exit("chunkString"),u(p)):(e.consume(p),l||(l=!ce(p)),p===92?h:f)}function h(p){return p===91||p===92||p===93?(e.consume(p),a++,f):f(p)}}function tC(e,t,n,r,s,i){let o;return a;function a(h){return h===34||h===39||h===40?(e.enter(r),e.enter(s),e.consume(h),e.exit(s),o=h===40?41:h,l):n(h)}function l(h){return h===o?(e.enter(s),e.consume(h),e.exit(s),e.exit(r),t):(e.enter(i),c(h))}function c(h){return h===o?(e.exit(i),l(o)):h===null?n(h):Z(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),ke(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(h))}function u(h){return h===o||h===null||Z(h)?(e.exit("chunkString"),c(h)):(e.consume(h),h===92?f:u)}function f(h){return h===o||h===92?(e.consume(h),u):u(h)}}function qo(e,t){let n;return r;function r(s){return Z(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):ce(s)?ke(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const t8={name:"definition",tokenize:r8},n8={partial:!0,tokenize:s8};function r8(e,t,n){const r=this;let s;return i;function i(p){return e.enter("definition"),o(p)}function o(p){return eC.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return s=Ci(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),l):n(p)}function l(p){return St(p)?qo(e,c)(p):c(p)}function c(p){return ZS(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function u(p){return e.attempt(n8,f,f)(p)}function f(p){return ce(p)?ke(e,h,"whitespace")(p):h(p)}function h(p){return p===null||Z(p)?(e.exit("definition"),r.parser.defined.push(s),t(p)):n(p)}}function s8(e,t,n){return r;function r(a){return St(a)?qo(e,s)(a):n(a)}function s(a){return tC(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function i(a){return ce(a)?ke(e,o,"whitespace")(a):o(a)}function o(a){return a===null||Z(a)?t(a):n(a)}}const i8={name:"hardBreakEscape",tokenize:o8};function o8(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),s}function s(i){return Z(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const a8={name:"headingAtx",resolve:l8,tokenize:c8};function l8(e,t){let n=e.length-2,r=3,s,i;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},i={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Un(e,r,n-r+1,[["enter",s,t],["enter",i,t],["exit",i,t],["exit",s,t]])),e}function c8(e,t,n){let r=0;return s;function s(u){return e.enter("atxHeading"),i(u)}function i(u){return e.enter("atxHeadingSequence"),o(u)}function o(u){return u===35&&r++<6?(e.consume(u),o):u===null||St(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||Z(u)?(e.exit("atxHeading"),t(u)):ce(u)?ke(e,a,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),a(u))}function c(u){return u===null||u===35||St(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const u8=["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"],w0=["pre","script","style","textarea"],d8={concrete:!0,name:"htmlFlow",resolveTo:p8,tokenize:m8},f8={partial:!0,tokenize:y8},h8={partial:!0,tokenize:g8};function p8(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 m8(e,t,n){const r=this;let s,i,o,a,l;return c;function c(N){return u(N)}function u(N){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(N),f}function f(N){return N===33?(e.consume(N),h):N===47?(e.consume(N),i=!0,g):N===63?(e.consume(N),s=3,r.interrupt?t:_):On(N)?(e.consume(N),o=String.fromCharCode(N),w):n(N)}function h(N){return N===45?(e.consume(N),s=2,p):N===91?(e.consume(N),s=5,a=0,m):On(N)?(e.consume(N),s=4,r.interrupt?t:_):n(N)}function p(N){return N===45?(e.consume(N),r.interrupt?t:_):n(N)}function m(N){const ae="CDATA[";return N===ae.charCodeAt(a++)?(e.consume(N),a===ae.length?r.interrupt?t:I:m):n(N)}function g(N){return On(N)?(e.consume(N),o=String.fromCharCode(N),w):n(N)}function w(N){if(N===null||N===47||N===62||St(N)){const ae=N===47,pe=o.toLowerCase();return!ae&&!i&&w0.includes(pe)?(s=1,r.interrupt?t(N):I(N)):u8.includes(o.toLowerCase())?(s=6,ae?(e.consume(N),y):r.interrupt?t(N):I(N)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(N):i?x(N):v(N))}return N===45||Ft(N)?(e.consume(N),o+=String.fromCharCode(N),w):n(N)}function y(N){return N===62?(e.consume(N),r.interrupt?t:I):n(N)}function x(N){return ce(N)?(e.consume(N),x):j(N)}function v(N){return N===47?(e.consume(N),j):N===58||N===95||On(N)?(e.consume(N),k):ce(N)?(e.consume(N),v):j(N)}function k(N){return N===45||N===46||N===58||N===95||Ft(N)?(e.consume(N),k):C(N)}function C(N){return N===61?(e.consume(N),S):ce(N)?(e.consume(N),C):v(N)}function S(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),l=N,P):ce(N)?(e.consume(N),S):T(N)}function P(N){return N===l?(e.consume(N),l=null,E):N===null||Z(N)?n(N):(e.consume(N),P)}function T(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||St(N)?C(N):(e.consume(N),T)}function E(N){return N===47||N===62||ce(N)?v(N):n(N)}function j(N){return N===62?(e.consume(N),R):n(N)}function R(N){return N===null||Z(N)?I(N):ce(N)?(e.consume(N),R):n(N)}function I(N){return N===45&&s===2?(e.consume(N),z):N===60&&s===1?(e.consume(N),O):N===62&&s===4?(e.consume(N),B):N===63&&s===3?(e.consume(N),_):N===93&&s===5?(e.consume(N),V):Z(N)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(f8,q,D)(N)):N===null||Z(N)?(e.exit("htmlFlowData"),D(N)):(e.consume(N),I)}function D(N){return e.check(h8,$,q)(N)}function $(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),A}function A(N){return N===null||Z(N)?D(N):(e.enter("htmlFlowData"),I(N))}function z(N){return N===45?(e.consume(N),_):I(N)}function O(N){return N===47?(e.consume(N),o="",L):I(N)}function L(N){if(N===62){const ae=o.toLowerCase();return w0.includes(ae)?(e.consume(N),B):I(N)}return On(N)&&o.length<8?(e.consume(N),o+=String.fromCharCode(N),L):I(N)}function V(N){return N===93?(e.consume(N),_):I(N)}function _(N){return N===62?(e.consume(N),B):N===45&&s===2?(e.consume(N),_):I(N)}function B(N){return N===null||Z(N)?(e.exit("htmlFlowData"),q(N)):(e.consume(N),B)}function q(N){return e.exit("htmlFlow"),t(N)}}function g8(e,t,n){const r=this;return s;function s(o){return Z(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):n(o)}function i(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function y8(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(Bu,t,n)}}const x8={name:"htmlText",tokenize:v8};function v8(e,t,n){const r=this;let s,i,o;return a;function a(_){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(_),l}function l(_){return _===33?(e.consume(_),c):_===47?(e.consume(_),C):_===63?(e.consume(_),v):On(_)?(e.consume(_),T):n(_)}function c(_){return _===45?(e.consume(_),u):_===91?(e.consume(_),i=0,m):On(_)?(e.consume(_),x):n(_)}function u(_){return _===45?(e.consume(_),p):n(_)}function f(_){return _===null?n(_):_===45?(e.consume(_),h):Z(_)?(o=f,O(_)):(e.consume(_),f)}function h(_){return _===45?(e.consume(_),p):f(_)}function p(_){return _===62?z(_):_===45?h(_):f(_)}function m(_){const B="CDATA[";return _===B.charCodeAt(i++)?(e.consume(_),i===B.length?g:m):n(_)}function g(_){return _===null?n(_):_===93?(e.consume(_),w):Z(_)?(o=g,O(_)):(e.consume(_),g)}function w(_){return _===93?(e.consume(_),y):g(_)}function y(_){return _===62?z(_):_===93?(e.consume(_),y):g(_)}function x(_){return _===null||_===62?z(_):Z(_)?(o=x,O(_)):(e.consume(_),x)}function v(_){return _===null?n(_):_===63?(e.consume(_),k):Z(_)?(o=v,O(_)):(e.consume(_),v)}function k(_){return _===62?z(_):v(_)}function C(_){return On(_)?(e.consume(_),S):n(_)}function S(_){return _===45||Ft(_)?(e.consume(_),S):P(_)}function P(_){return Z(_)?(o=P,O(_)):ce(_)?(e.consume(_),P):z(_)}function T(_){return _===45||Ft(_)?(e.consume(_),T):_===47||_===62||St(_)?E(_):n(_)}function E(_){return _===47?(e.consume(_),z):_===58||_===95||On(_)?(e.consume(_),j):Z(_)?(o=E,O(_)):ce(_)?(e.consume(_),E):z(_)}function j(_){return _===45||_===46||_===58||_===95||Ft(_)?(e.consume(_),j):R(_)}function R(_){return _===61?(e.consume(_),I):Z(_)?(o=R,O(_)):ce(_)?(e.consume(_),R):E(_)}function I(_){return _===null||_===60||_===61||_===62||_===96?n(_):_===34||_===39?(e.consume(_),s=_,D):Z(_)?(o=I,O(_)):ce(_)?(e.consume(_),I):(e.consume(_),$)}function D(_){return _===s?(e.consume(_),s=void 0,A):_===null?n(_):Z(_)?(o=D,O(_)):(e.consume(_),D)}function $(_){return _===null||_===34||_===39||_===60||_===61||_===96?n(_):_===47||_===62||St(_)?E(_):(e.consume(_),$)}function A(_){return _===47||_===62||St(_)?E(_):n(_)}function z(_){return _===62?(e.consume(_),e.exit("htmlTextData"),e.exit("htmlText"),t):n(_)}function O(_){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),L}function L(_){return ce(_)?ke(e,V,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):V(_)}function V(_){return e.enter("htmlTextData"),o(_)}}const hg={name:"labelEnd",resolveAll:_8,resolveTo:S8,tokenize:C8},w8={tokenize:j8},b8={tokenize:P8},k8={tokenize:E8};function _8(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 s=r.type==="labelImage"?4:2;r.type="data",t+=s}}return e.length!==n.length&&Un(e,0,e.length,n),e}function S8(e,t){let n=e.length,r=0,s,i,o,a;for(;n--;)if(s=e[n][1],i){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(i=n,s.type!=="labelLink")){r=2;break}}else s.type==="labelEnd"&&(o=n);const l={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[i][1].start},end:{...e[o][1].end}},u={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[o-2][1].start}};return a=[["enter",l,t],["enter",c,t]],a=Xt(a,e.slice(i+1,i+r+3)),a=Xt(a,[["enter",u,t]]),a=Xt(a,fg(t.parser.constructs.insideSpan.null,e.slice(i+r+4,o-3),t)),a=Xt(a,[["exit",u,t],e[o-2],e[o-1],["exit",c,t]]),a=Xt(a,e.slice(o+1)),a=Xt(a,[["exit",l,t]]),Un(e,i,e.length,a),e}function C8(e,t,n){const r=this;let s=r.events.length,i,o;for(;s--;)if((r.events[s][1].type==="labelImage"||r.events[s][1].type==="labelLink")&&!r.events[s][1]._balanced){i=r.events[s][1];break}return a;function a(h){return i?i._inactive?f(h):(o=r.parser.defined.includes(Ci(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),l):n(h)}function l(h){return h===40?e.attempt(w8,u,o?u:f)(h):h===91?e.attempt(b8,u,o?c:f)(h):o?u(h):f(h)}function c(h){return e.attempt(k8,u,f)(h)}function u(h){return t(h)}function f(h){return i._balanced=!0,n(h)}}function j8(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),s}function s(f){return St(f)?qo(e,i)(f):i(f)}function i(f){return f===41?u(f):ZS(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function o(f){return St(f)?qo(e,l)(f):u(f)}function a(f){return n(f)}function l(f){return f===34||f===39||f===40?tC(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):u(f)}function c(f){return St(f)?qo(e,u)(f):u(f)}function u(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function P8(e,t,n){const r=this;return s;function s(a){return eC.call(r,e,i,o,"reference","referenceMarker","referenceString")(a)}function i(a){return r.parser.defined.includes(Ci(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function o(a){return n(a)}}function E8(e,t,n){return r;function r(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),s}function s(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):n(i)}}const T8={name:"labelStartImage",resolveAll:hg.resolveAll,tokenize:N8};function N8(e,t,n){const r=this;return s;function s(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),i}function i(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),o):n(a)}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const R8={name:"labelStartLink",resolveAll:hg.resolveAll,tokenize:A8};function A8(e,t,n){const r=this;return s;function s(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),i}function i(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const df={name:"lineEnding",tokenize:I8};function I8(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ke(e,t,"linePrefix")}}const cc={name:"thematicBreak",tokenize:M8};function M8(e,t,n){let r=0,s;return i;function i(c){return e.enter("thematicBreak"),o(c)}function o(c){return s=c,a(c)}function a(c){return c===s?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||Z(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===s?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),ce(c)?ke(e,a,"whitespace")(c):a(c))}}const yt={continuation:{tokenize:O8},exit:z8,name:"list",tokenize:F8},L8={partial:!0,tokenize:B8},D8={partial:!0,tokenize:$8};function F8(e,t,n){const r=this,s=r.events[r.events.length-1];let i=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,o=0;return a;function a(p){const m=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:lp(p)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(cc,n,c)(p):c(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(p)}return n(p)}function l(p){return lp(p)&&++o<10?(e.consume(p),l):(!r.interrupt||o<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),c(p)):n(p)}function c(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(Bu,r.interrupt?n:u,e.attempt(L8,h,f))}function u(p){return r.containerState.initialBlankLine=!0,i++,h(p)}function f(p){return ce(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function O8(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Bu,s,i);function s(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ke(e,t,"listItemIndent",r.containerState.size+1)(a)}function i(a){return r.containerState.furtherBlankLines||!ce(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(D8,t,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,ke(e,e.attempt(yt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function $8(e,t,n){const r=this;return ke(e,s,"listItemIndent",r.containerState.size+1);function s(i){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(i):n(i)}}function z8(e){e.exit(this.containerState.type)}function B8(e,t,n){const r=this;return ke(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(i){const o=r.events[r.events.length-1];return!ce(i)&&o&&o[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const b0={name:"setextUnderline",resolveTo:V8,tokenize:U8};function V8(e,t){let n=e.length,r,s,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",i?(e.splice(s,0,["enter",o,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end={...e[i][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function U8(e,t,n){const r=this;let s;return i;function i(c){let u=r.events.length,f;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){f=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),s=c,o(c)):n(c)}function o(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===s?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),ce(c)?ke(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||Z(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const W8={tokenize:H8};function H8(e){const t=this,n=e.attempt(Bu,r,e.attempt(this.parser.constructs.flowInitial,s,ke(e,e.attempt(this.parser.constructs.flow,s,e.attempt(Q6,s)),"linePrefix")));return n;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const G8={resolveAll:rC()},K8=nC("string"),Y8=nC("text");function nC(e){return{resolveAll:rC(e==="text"?q8:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],i=n.attempt(s,o,a);return o;function o(u){return c(u)?i(u):a(u)}function a(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),i(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const f=s[u];let h=-1;if(f)for(;++h<f.length;){const p=f[h];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function rC(e){return t;function t(n,r){let s=-1,i;for(;++s<=n.length;)i===void 0?n[s]&&n[s][1].type==="data"&&(i=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==i+2&&(n[i][1].end=n[s-1][1].end,n.splice(i+2,s-i-2),s=i+2),i=void 0);return e?e(n,r):n}}function q8(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],s=t.sliceStream(r);let i=s.length,o=-1,a=0,l;for(;i--;){const c=s[i];if(typeof c=="string"){for(o=c.length;c.charCodeAt(o-1)===32;)a++,o--;if(o)break;o=-1}else if(c===-2)l=!0,a++;else if(c!==-1){i++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const c={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?o:r.start._bufferIndex+o,_index:r.start._index+i,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const Q8={42:yt,43:yt,45:yt,48:yt,49:yt,50:yt,51:yt,52:yt,53:yt,54:yt,55:yt,56:yt,57:yt,62:qS},X8={91:t8},J8={[-2]:uf,[-1]:uf,32:uf},Z8={35:a8,42:cc,45:[b0,cc],60:d8,61:b0,95:cc,96:v0,126:v0},eU={38:XS,92:QS},tU={[-5]:df,[-4]:df,[-3]:df,33:T8,38:XS,42:cp,60:[R6,x8],91:R8,92:[i8,QS],93:hg,95:cp,96:W6},nU={null:[cp,G8]},rU={null:[42,95]},sU={null:[]},iU=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:rU,contentInitial:X8,disable:sU,document:Q8,flow:Z8,flowInitial:J8,insideSpan:nU,string:eU,text:tU},Symbol.toStringTag,{value:"Module"}));function oU(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 s={},i=[];let o=[],a=[];const l={attempt:P(C),check:P(S),consume:x,enter:v,exit:k,interrupt:P(S,{interrupt:!0})},c={code:null,containerState:{},defineSkip:g,events:[],now:m,parser:e,previous:null,sliceSerialize:h,sliceStream:p,write:f};let u=t.tokenize.call(c,l);return t.resolveAll&&i.push(t),c;function f(R){return o=Xt(o,R),w(),o[o.length-1]!==null?[]:(T(t,0),c.events=fg(i,c.events,c),c.events)}function h(R,I){return lU(p(R),I)}function p(R){return aU(o,R)}function m(){const{_bufferIndex:R,_index:I,line:D,column:$,offset:A}=r;return{_bufferIndex:R,_index:I,line:D,column:$,offset:A}}function g(R){s[R.line]=R.column,j()}function w(){let R;for(;r._index<o.length;){const I=o[r._index];if(typeof I=="string")for(R=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===R&&r._bufferIndex<I.length;)y(I.charCodeAt(r._bufferIndex));else y(I)}}function y(R){u=u(R)}function x(R){Z(R)?(r.line++,r.column=1,r.offset+=R===-3?2:1,j()):R!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=R}function v(R,I){const D=I||{};return D.type=R,D.start=m(),c.events.push(["enter",D,c]),a.push(D),D}function k(R){const I=a.pop();return I.end=m(),c.events.push(["exit",I,c]),I}function C(R,I){T(R,I.from)}function S(R,I){I.restore()}function P(R,I){return D;function D($,A,z){let O,L,V,_;return Array.isArray($)?q($):"tokenize"in $?q([$]):B($);function B(fe){return Tt;function Tt(Ge){const Ht=Ge!==null&&fe[Ge],Sn=Ge!==null&&fe.null,Wn=[...Array.isArray(Ht)?Ht:Ht?[Ht]:[],...Array.isArray(Sn)?Sn:Sn?[Sn]:[]];return q(Wn)(Ge)}}function q(fe){return O=fe,L=0,fe.length===0?z:N(fe[L])}function N(fe){return Tt;function Tt(Ge){return _=E(),V=fe,fe.partial||(c.currentConstruct=fe),fe.name&&c.parser.constructs.disable.null.includes(fe.name)?pe():fe.tokenize.call(I?Object.assign(Object.create(c),I):c,l,ae,pe)(Ge)}}function ae(fe){return R(V,_),A}function pe(fe){return _.restore(),++L<O.length?N(O[L]):z}}}function T(R,I){R.resolveAll&&!i.includes(R)&&i.push(R),R.resolve&&Un(c.events,I,c.events.length-I,R.resolve(c.events.slice(I),c)),R.resolveTo&&(c.events=R.resolveTo(c.events,c))}function E(){const R=m(),I=c.previous,D=c.currentConstruct,$=c.events.length,A=Array.from(a);return{from:$,restore:z};function z(){r=R,c.previous=I,c.currentConstruct=D,c.events.length=$,a=A,j()}}function j(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function aU(e,t){const n=t.start._index,r=t.start._bufferIndex,s=t.end._index,i=t.end._bufferIndex;let o;if(n===s)o=[e[n].slice(r,i)];else{if(o=e.slice(n,s),r>-1){const a=o[0];typeof a=="string"?o[0]=a.slice(r):o.shift()}i>0&&o.push(e[s].slice(0,i))}return o}function lU(e,t){let n=-1;const r=[];let s;for(;++n<e.length;){const i=e[n];let o;if(typeof i=="string")o=i;else switch(i){case-5:{o="\r";break}case-4:{o=`
76
- `;break}case-3:{o=`\r
77
- `;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&s)continue;o=" ";break}default:o=String.fromCharCode(i)}s=i===-2,r.push(o)}return r.join("")}function cU(e){const r={constructs:g6([iU,...(e||{}).extensions||[]]),content:s(S6),defined:[],document:s(j6),flow:s(W8),lazy:{},string:s(K8),text:s(Y8)};return r;function s(i){return o;function o(a){return oU(r,i,a)}}}function uU(e){for(;!JS(e););return e}const k0=/[\0\t\n\r]/g;function dU(){let e=1,t="",n=!0,r;return s;function s(i,o,a){const l=[];let c,u,f,h,p;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(o||void 0).decode(i)),f=0,t="",n&&(i.charCodeAt(0)===65279&&f++,n=void 0);f<i.length;){if(k0.lastIndex=f,c=k0.exec(i),h=c&&c.index!==void 0?c.index:i.length,p=i.charCodeAt(h),!c){t=i.slice(f);break}if(p===10&&f===h&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),f<h&&(l.push(i.slice(f,h)),e+=h-f),p){case 0:{l.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,l.push(-2);e++<u;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}f=h+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const fU=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function hU(e){return e.replace(fU,pU)}function pU(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),i=s===120||s===88;return YS(n.slice(i?2:1),i?16:10)}return dg(n)||e}const sC={}.hasOwnProperty;function mU(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),gU(n)(uU(cU(n).document().write(dU()(e,t,!0))))}function gU(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Us),autolinkProtocol:E,autolinkEmail:E,atxHeading:i(Ha),blockQuote:i(Sn),characterEscape:E,characterReference:E,codeFenced:i(Wn),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:i(Wn,o),codeText:i(Vs,o),codeTextData:E,data:E,codeFlowValue:E,definition:i(Ua),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:i(Wa),hardBreakEscape:i(eo),hardBreakTrailing:i(eo),htmlFlow:i(to,o),htmlFlowData:E,htmlText:i(to,o),htmlTextData:E,image:i(dr),label:o,link:i(Us),listItem:i(Ku),listItemValue:h,listOrdered:i(Cn,f),listUnordered:i(Cn),paragraph:i(Ga),reference:N,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:i(Ha),strong:i(Yu),thematicBreak:i(he)},exit:{atxHeading:l(),atxHeadingSequence:C,autolink:l(),autolinkEmail:Ht,autolinkProtocol:Ge,blockQuote:l(),characterEscapeValue:j,characterReferenceMarkerHexadecimal:pe,characterReferenceMarkerNumeric:pe,characterReferenceValue:fe,characterReference:Tt,codeFenced:l(w),codeFencedFence:g,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:j,codeIndented:l(y),codeText:l(A),codeTextData:j,data:j,definition:l(),definitionDestinationString:k,definitionLabelString:x,definitionTitleString:v,emphasis:l(),hardBreakEscape:l(I),hardBreakTrailing:l(I),htmlFlow:l(D),htmlFlowData:j,htmlText:l($),htmlTextData:j,image:l(O),label:V,labelText:L,lineEnding:R,link:l(z),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ae,resourceDestinationString:_,resourceTitleString:B,resource:q,setextHeading:l(T),setextHeadingLineSequence:P,setextHeadingText:S,strong:l(),thematicBreak:l()}};iC(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(F){let H={type:"root",children:[]};const ee={stack:[H],tokenStack:[],config:t,enter:a,exit:c,buffer:o,resume:u,data:n},oe=[];let me=-1;for(;++me<F.length;)if(F[me][1].type==="listOrdered"||F[me][1].type==="listUnordered")if(F[me][0]==="enter")oe.push(me);else{const ln=oe.pop();me=s(F,ln,me)}for(me=-1;++me<F.length;){const ln=t[F[me][0]];sC.call(ln,F[me][1].type)&&ln[F[me][1].type].call(Object.assign({sliceSerialize:F[me][2].sliceSerialize},ee),F[me][1])}if(ee.tokenStack.length>0){const ln=ee.tokenStack[ee.tokenStack.length-1];(ln[1]||_0).call(ee,void 0,ln[0])}for(H.position={start:wr(F.length>0?F[0][1].start:{line:1,column:1,offset:0}),end:wr(F.length>0?F[F.length-2][1].end:{line:1,column:1,offset:0})},me=-1;++me<t.transforms.length;)H=t.transforms[me](H)||H;return H}function s(F,H,ee){let oe=H-1,me=-1,ln=!1,ss,Hn,no,ro;for(;++oe<=ee;){const Nt=F[oe];switch(Nt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Nt[0]==="enter"?me++:me--,ro=void 0;break}case"lineEndingBlank":{Nt[0]==="enter"&&(ss&&!ro&&!me&&!no&&(no=oe),ro=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ro=void 0}if(!me&&Nt[0]==="enter"&&Nt[1].type==="listItemPrefix"||me===-1&&Nt[0]==="exit"&&(Nt[1].type==="listUnordered"||Nt[1].type==="listOrdered")){if(ss){let Ws=oe;for(Hn=void 0;Ws--;){const Gn=F[Ws];if(Gn[1].type==="lineEnding"||Gn[1].type==="lineEndingBlank"){if(Gn[0]==="exit")continue;Hn&&(F[Hn][1].type="lineEndingBlank",ln=!0),Gn[1].type="lineEnding",Hn=Ws}else if(!(Gn[1].type==="linePrefix"||Gn[1].type==="blockQuotePrefix"||Gn[1].type==="blockQuotePrefixWhitespace"||Gn[1].type==="blockQuoteMarker"||Gn[1].type==="listItemIndent"))break}no&&(!Hn||no<Hn)&&(ss._spread=!0),ss.end=Object.assign({},Hn?F[Hn][1].start:Nt[1].end),F.splice(Hn||oe,0,["exit",ss,Nt[2]]),oe++,ee++}if(Nt[1].type==="listItemPrefix"){const Ws={type:"listItem",_spread:!1,start:Object.assign({},Nt[1].start),end:void 0};ss=Ws,F.splice(oe,0,["enter",Ws,Nt[2]]),oe++,ee++,no=void 0,ro=!0}}}return F[H][1]._spread=ln,ee}function i(F,H){return ee;function ee(oe){a.call(this,F(oe),oe),H&&H.call(this,oe)}}function o(){this.stack.push({type:"fragment",children:[]})}function a(F,H,ee){this.stack[this.stack.length-1].children.push(F),this.stack.push(F),this.tokenStack.push([H,ee||void 0]),F.position={start:wr(H.start),end:void 0}}function l(F){return H;function H(ee){F&&F.call(this,ee),c.call(this,ee)}}function c(F,H){const ee=this.stack.pop(),oe=this.tokenStack.pop();if(oe)oe[0].type!==F.type&&(H?H.call(this,F,oe[0]):(oe[1]||_0).call(this,F,oe[0]));else throw new Error("Cannot close `"+F.type+"` ("+Yo({start:F.start,end:F.end})+"): it’s not open");ee.position.end=wr(F.end)}function u(){return p6(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function h(F){if(this.data.expectingFirstListItemValue){const H=this.stack[this.stack.length-2];H.start=Number.parseInt(this.sliceSerialize(F),10),this.data.expectingFirstListItemValue=void 0}}function p(){const F=this.resume(),H=this.stack[this.stack.length-1];H.lang=F}function m(){const F=this.resume(),H=this.stack[this.stack.length-1];H.meta=F}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function w(){const F=this.resume(),H=this.stack[this.stack.length-1];H.value=F.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const F=this.resume(),H=this.stack[this.stack.length-1];H.value=F.replace(/(\r?\n|\r)$/g,"")}function x(F){const H=this.resume(),ee=this.stack[this.stack.length-1];ee.label=H,ee.identifier=Ci(this.sliceSerialize(F)).toLowerCase()}function v(){const F=this.resume(),H=this.stack[this.stack.length-1];H.title=F}function k(){const F=this.resume(),H=this.stack[this.stack.length-1];H.url=F}function C(F){const H=this.stack[this.stack.length-1];if(!H.depth){const ee=this.sliceSerialize(F).length;H.depth=ee}}function S(){this.data.setextHeadingSlurpLineEnding=!0}function P(F){const H=this.stack[this.stack.length-1];H.depth=this.sliceSerialize(F).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function E(F){const ee=this.stack[this.stack.length-1].children;let oe=ee[ee.length-1];(!oe||oe.type!=="text")&&(oe=Ka(),oe.position={start:wr(F.start),end:void 0},ee.push(oe)),this.stack.push(oe)}function j(F){const H=this.stack.pop();H.value+=this.sliceSerialize(F),H.position.end=wr(F.end)}function R(F){const H=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ee=H.children[H.children.length-1];ee.position.end=wr(F.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(H.type)&&(E.call(this,F),j.call(this,F))}function I(){this.data.atHardBreak=!0}function D(){const F=this.resume(),H=this.stack[this.stack.length-1];H.value=F}function $(){const F=this.resume(),H=this.stack[this.stack.length-1];H.value=F}function A(){const F=this.resume(),H=this.stack[this.stack.length-1];H.value=F}function z(){const F=this.stack[this.stack.length-1];if(this.data.inReference){const H=this.data.referenceType||"shortcut";F.type+="Reference",F.referenceType=H,delete F.url,delete F.title}else delete F.identifier,delete F.label;this.data.referenceType=void 0}function O(){const F=this.stack[this.stack.length-1];if(this.data.inReference){const H=this.data.referenceType||"shortcut";F.type+="Reference",F.referenceType=H,delete F.url,delete F.title}else delete F.identifier,delete F.label;this.data.referenceType=void 0}function L(F){const H=this.sliceSerialize(F),ee=this.stack[this.stack.length-2];ee.label=hU(H),ee.identifier=Ci(H).toLowerCase()}function V(){const F=this.stack[this.stack.length-1],H=this.resume(),ee=this.stack[this.stack.length-1];if(this.data.inReference=!0,ee.type==="link"){const oe=F.children;ee.children=oe}else ee.alt=H}function _(){const F=this.resume(),H=this.stack[this.stack.length-1];H.url=F}function B(){const F=this.resume(),H=this.stack[this.stack.length-1];H.title=F}function q(){this.data.inReference=void 0}function N(){this.data.referenceType="collapsed"}function ae(F){const H=this.resume(),ee=this.stack[this.stack.length-1];ee.label=H,ee.identifier=Ci(this.sliceSerialize(F)).toLowerCase(),this.data.referenceType="full"}function pe(F){this.data.characterReferenceType=F.type}function fe(F){const H=this.sliceSerialize(F),ee=this.data.characterReferenceType;let oe;ee?(oe=YS(H,ee==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):oe=dg(H);const me=this.stack[this.stack.length-1];me.value+=oe}function Tt(F){const H=this.stack.pop();H.position.end=wr(F.end)}function Ge(F){j.call(this,F);const H=this.stack[this.stack.length-1];H.url=this.sliceSerialize(F)}function Ht(F){j.call(this,F);const H=this.stack[this.stack.length-1];H.url="mailto:"+this.sliceSerialize(F)}function Sn(){return{type:"blockquote",children:[]}}function Wn(){return{type:"code",lang:null,meta:null,value:""}}function Vs(){return{type:"inlineCode",value:""}}function Ua(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Wa(){return{type:"emphasis",children:[]}}function Ha(){return{type:"heading",depth:0,children:[]}}function eo(){return{type:"break"}}function to(){return{type:"html",value:""}}function dr(){return{type:"image",title:null,url:"",alt:null}}function Us(){return{type:"link",title:null,url:"",children:[]}}function Cn(F){return{type:"list",ordered:F.type==="listOrdered",start:null,spread:F._spread,children:[]}}function Ku(F){return{type:"listItem",spread:F._spread,checked:null,children:[]}}function Ga(){return{type:"paragraph",children:[]}}function Yu(){return{type:"strong",children:[]}}function Ka(){return{type:"text",value:""}}function he(){return{type:"thematicBreak"}}}function wr(e){return{line:e.line,column:e.column,offset:e.offset}}function iC(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?iC(e,r):yU(e,r)}}function yU(e,t){let n;for(n in t)if(sC.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function _0(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Yo({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Yo({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Yo({start:t.start,end:t.end})+") is still open")}function xU(e){const t=this;t.parser=n;function n(r){return mU(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function vU(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 wU(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
78
- `}]}function bU(e,t){const n=t.value?t.value+`
79
- `:"",r={},s=t.lang?t.lang.split(/\s+/):[];s.length>0&&(r.className=["language-"+s[0]]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function kU(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function _U(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function SU(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=Ji(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let o,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=i+1,a+=1,e.footnoteCounts.set(r,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)}function CU(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 jU(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function oC(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 s=e.all(t),i=s[0];i&&i.type==="text"?i.value="["+i.value:s.unshift({type:"text",value:"["});const o=s[s.length-1];return o&&o.type==="text"?o.value+=r:s.push({type:"text",value:r}),s}function PU(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return oC(e,t);const s={src:Ji(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,i),e.applyData(t,i)}function EU(e,t){const n={src:Ji(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 TU(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 NU(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return oC(e,t);const s={href:Ji(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function RU(e,t){const n={href:Ji(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 AU(e,t,n){const r=e.all(t),s=n?IU(n):aC(t),i={},o=[];if(typeof t.checked=="boolean"){const u=r[0];let f;u&&u.type==="element"&&u.tagName==="p"?f=u:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const u=r[a];(s||a!==0||u.type!=="element"||u.tagName!=="p")&&o.push({type:"text",value:`
80
- `}),u.type==="element"&&u.tagName==="p"&&!s?o.push(...u.children):o.push(u)}const l=r[r.length-1];l&&(s||l.type!=="element"||l.tagName!=="p")&&o.push({type:"text",value:`
81
- `});const c={type:"element",tagName:"li",properties:i,children:o};return e.patch(t,c),e.applyData(t,c)}function IU(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=aC(n[r])}return t}function aC(e){const t=e.spread;return t??e.children.length>1}function MU(e,t){const n={},r=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s<r.length;){const o=r[s];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)}function LU(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function DU(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function FU(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function OU(e,t){const n=e.all(t),r=n.shift(),s=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),s.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=ag(t.children[1]),l=BS(t.children[t.children.length-1]);a&&l&&(o.position={start:a,end:l}),s.push(o)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,i),e.applyData(t,i)}function $U(e,t,n){const r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,a=o?o.length:t.children.length;let l=-1;const c=[];for(;++l<a;){const f=t.children[l],h={},p=o?o[l]:void 0;p&&(h.align=p);let m={type:"element",tagName:i,properties:h,children:[]};f&&(m.children=e.all(f),e.patch(f,m),m=e.applyData(f,m)),c.push(m)}const u={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,u),e.applyData(t,u)}function zU(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const S0=9,C0=32;function BU(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),s=0;const i=[];for(;r;)i.push(j0(t.slice(s,r.index),s>0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return i.push(j0(t.slice(s),s>0,!1)),i.join("")}function j0(e,t,n){let r=0,s=e.length;if(t){let i=e.codePointAt(r);for(;i===S0||i===C0;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(s-1);for(;i===S0||i===C0;)s--,i=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function VU(e,t){const n={type:"text",value:BU(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function UU(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const WU={blockquote:vU,break:wU,code:bU,delete:kU,emphasis:_U,footnoteReference:SU,heading:CU,html:jU,imageReference:PU,image:EU,inlineCode:TU,linkReference:NU,link:RU,listItem:AU,list:MU,paragraph:LU,root:DU,strong:FU,table:OU,tableCell:zU,tableRow:$U,text:VU,thematicBreak:UU,toml:Al,yaml:Al,definition:Al,footnoteDefinition:Al};function Al(){}const lC=-1,Vu=0,Qo=1,ru=2,pg=3,mg=4,gg=5,yg=6,cC=7,uC=8,HU=typeof self=="object"?self:globalThis,P0=(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 HU[e](t)},GU=(e,t)=>{const n=(s,i)=>(e.set(i,s),s),r=s=>{if(e.has(s))return e.get(s);const[i,o]=t[s];switch(i){case Vu:case lC:return n(o,s);case Qo:{const a=n([],s);for(const l of o)a.push(r(l));return a}case ru:{const a=n({},s);for(const[l,c]of o)a[r(l)]=r(c);return a}case pg:return n(new Date(o),s);case mg:{const{source:a,flags:l}=o;return n(new RegExp(a,l),s)}case gg:{const a=n(new Map,s);for(const[l,c]of o)a.set(r(l),r(c));return a}case yg:{const a=n(new Set,s);for(const l of o)a.add(r(l));return a}case cC:{const{name:a,message:l}=o;return n(P0(a,l),s)}case uC:return n(BigInt(o),s);case"BigInt":return n(Object(BigInt(o)),s);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:a}=new Uint8Array(o);return n(new DataView(a),o)}}return n(P0(i,o),s)};return r},E0=e=>GU(new Map,e)(0),Xs="",{toString:KU}={},{keys:YU}=Object,So=e=>{const t=typeof e;if(t!=="object"||!e)return[Vu,t];const n=KU.call(e).slice(8,-1);switch(n){case"Array":return[Qo,Xs];case"Object":return[ru,Xs];case"Date":return[pg,Xs];case"RegExp":return[mg,Xs];case"Map":return[gg,Xs];case"Set":return[yg,Xs];case"DataView":return[Qo,n]}return n.includes("Array")?[Qo,n]:n.includes("Error")?[cC,n]:[ru,n]},Il=([e,t])=>e===Vu&&(t==="function"||t==="symbol"),qU=(e,t,n,r)=>{const s=(o,a)=>{const l=r.push(o)-1;return n.set(a,l),l},i=o=>{if(n.has(o))return n.get(o);let[a,l]=So(o);switch(a){case Vu:{let u=o;switch(l){case"bigint":a=uC,u=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return s([lC],o)}return s([a,u],o)}case Qo:{if(l){let h=o;return l==="DataView"?h=new Uint8Array(o.buffer):l==="ArrayBuffer"&&(h=new Uint8Array(o)),s([l,[...h]],o)}const u=[],f=s([a,u],o);for(const h of o)u.push(i(h));return f}case ru:{if(l)switch(l){case"BigInt":return s([l,o.toString()],o);case"Boolean":case"Number":case"String":return s([l,o.valueOf()],o)}if(t&&"toJSON"in o)return i(o.toJSON());const u=[],f=s([a,u],o);for(const h of YU(o))(e||!Il(So(o[h])))&&u.push([i(h),i(o[h])]);return f}case pg:return s([a,o.toISOString()],o);case mg:{const{source:u,flags:f}=o;return s([a,{source:u,flags:f}],o)}case gg:{const u=[],f=s([a,u],o);for(const[h,p]of o)(e||!(Il(So(h))||Il(So(p))))&&u.push([i(h),i(p)]);return f}case yg:{const u=[],f=s([a,u],o);for(const h of o)(e||!Il(So(h)))&&u.push(i(h));return f}}const{message:c}=o;return s([a,{name:l,message:c}],o)};return i},T0=(e,{json:t,lossy:n}={})=>{const r=[];return qU(!(t||n),!!t,new Map,r)(e),r},su=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?E0(T0(e,t)):structuredClone(e):(e,t)=>E0(T0(e,t));function QU(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 XU(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function JU(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||QU,r=e.options.footnoteBackLabel||XU,s=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[l]);if(!c)continue;const u=e.all(c),f=String(c.identifier).toUpperCase(),h=Ji(f.toLowerCase());let p=0;const m=[],g=e.footnoteCounts.get(f);for(;g!==void 0&&++p<=g;){m.length>0&&m.push({type:"text",value:" "});let x=typeof n=="string"?n:n(l,p);typeof x=="string"&&(x={type:"text",value:x}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,p),className:["data-footnote-backref"]},children:Array.isArray(x)?x:[x]})}const w=u[u.length-1];if(w&&w.type==="element"&&w.tagName==="p"){const x=w.children[w.children.length-1];x&&x.type==="text"?x.value+=" ":w.children.push({type:"text",value:" "}),w.children.push(...m)}else u.push(...m);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(u,!0)};e.patch(c,y),a.push(y)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...su(o),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
82
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
83
- `}]}}const dC=function(e){if(e==null)return nW;if(typeof e=="function")return Uu(e);if(typeof e=="object")return Array.isArray(e)?ZU(e):eW(e);if(typeof e=="string")return tW(e);throw new Error("Expected function, string, or object as test")};function ZU(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=dC(e[n]);return Uu(r);function r(...s){let i=-1;for(;++i<t.length;)if(t[i].apply(this,s))return!0;return!1}}function eW(e){const t=e;return Uu(n);function n(r){const s=r;let i;for(i in e)if(s[i]!==t[i])return!1;return!0}}function tW(e){return Uu(t);function t(n){return n&&n.type===e}}function Uu(e){return t;function t(n,r,s){return!!(rW(n)&&e.call(this,n,typeof r=="number"?r:void 0,s||void 0))}}function nW(){return!0}function rW(e){return e!==null&&typeof e=="object"&&"type"in e}const fC=[],sW=!0,N0=!1,iW="skip";function oW(e,t,n,r){let s;typeof t=="function"&&typeof n!="function"?(r=n,n=t):s=t;const i=dC(s),o=r?-1:1;a(e,void 0,[])();function a(l,c,u){const f=l&&typeof l=="object"?l:{};if(typeof f.type=="string"){const p=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(p?"<"+p+">":""))+")"})}return h;function h(){let p=fC,m,g,w;if((!t||i(l,c,u[u.length-1]||void 0))&&(p=aW(n(l,u)),p[0]===N0))return p;if("children"in l&&l.children){const y=l;if(y.children&&p[0]!==iW)for(g=(r?y.children.length:-1)+o,w=u.concat(y);g>-1&&g<y.children.length;){const x=y.children[g];if(m=a(x,g,w)(),m[0]===N0)return m;g=typeof m[1]=="number"?m[1]:g+o}}return p}}}function aW(e){return Array.isArray(e)?e:typeof e=="number"?[sW,e]:e==null?fC:[e]}function hC(e,t,n,r){let s,i,o;typeof t=="function"&&typeof n!="function"?(i=void 0,o=t,s=n):(i=t,o=n,s=r),oW(e,i,a,s);function a(l,c){const u=c[c.length-1],f=u?u.children.indexOf(l):void 0;return o(l,f,u)}}const up={}.hasOwnProperty,lW={};function cW(e,t){const n=t||lW,r=new Map,s=new Map,i=new Map,o={...WU,...n.handlers},a={all:c,applyData:dW,definitionById:r,footnoteById:s,footnoteCounts:i,footnoteOrder:[],handlers:o,one:l,options:n,patch:uW,wrap:hW};return hC(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const f=u.type==="definition"?r:s,h=String(u.identifier).toUpperCase();f.has(h)||f.set(h,u)}}),a;function l(u,f){const h=u.type,p=a.handlers[h];if(up.call(a.handlers,h)&&p)return p(a,u,f);if(a.options.passThrough&&a.options.passThrough.includes(h)){if("children"in u){const{children:g,...w}=u,y=su(w);return y.children=a.all(u),y}return su(u)}return(a.options.unknownHandler||fW)(a,u,f)}function c(u){const f=[];if("children"in u){const h=u.children;let p=-1;for(;++p<h.length;){const m=a.one(h[p],u);if(m){if(p&&h[p-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=R0(m.value)),!Array.isArray(m)&&m.type==="element")){const g=m.children[0];g&&g.type==="text"&&(g.value=R0(g.value))}Array.isArray(m)?f.push(...m):f.push(m)}}}return f}}function uW(e,t){e.position&&(t.position=GV(e))}function dW(e,t){let n=t;if(e&&e.data){const r=e.data.hName,s=e.data.hChildren,i=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const o="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:o}}n.type==="element"&&i&&Object.assign(n.properties,su(i)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function fW(e,t){const n=t.data||{},r="value"in t&&!(up.call(n,"hProperties")||up.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 hW(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
84
- `});++r<e.length;)r&&n.push({type:"text",value:`
85
- `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
86
- `}),n}function R0(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function A0(e,t){const n=cW(e,t),r=n.one(e,void 0),s=JU(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&i.children.push({type:"text",value:`
87
- `},s),i}function pW(e,t){return e&&"run"in e?async function(n,r){const s=A0(n,{file:r,...t});await e.run(s,r)}:function(n,r){return A0(n,{file:r,...e||t})}}function I0(e){if(e)throw e}var uc=Object.prototype.hasOwnProperty,pC=Object.prototype.toString,M0=Object.defineProperty,L0=Object.getOwnPropertyDescriptor,D0=function(t){return typeof Array.isArray=="function"?Array.isArray(t):pC.call(t)==="[object Array]"},F0=function(t){if(!t||pC.call(t)!=="[object Object]")return!1;var n=uc.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&uc.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var s;for(s in t);return typeof s>"u"||uc.call(t,s)},O0=function(t,n){M0&&n.name==="__proto__"?M0(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},$0=function(t,n){if(n==="__proto__")if(uc.call(t,n)){if(L0)return L0(t,n).value}else return;return t[n]},mW=function e(){var t,n,r,s,i,o,a=arguments[0],l=1,c=arguments.length,u=!1;for(typeof a=="boolean"&&(u=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});l<c;++l)if(t=arguments[l],t!=null)for(n in t)r=$0(a,n),s=$0(t,n),a!==s&&(u&&s&&(F0(s)||(i=D0(s)))?(i?(i=!1,o=r&&D0(r)?r:[]):o=r&&F0(r)?r:{},O0(a,{name:n,newValue:e(u,o,s)})):typeof s<"u"&&O0(a,{name:n,newValue:s}));return a};const ff=ou(mW);function dp(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 gW(){const e=[],t={run:n,use:r};return t;function n(...s){let i=-1;const o=s.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);a(null,...s);function a(l,...c){const u=e[++i];let f=-1;if(l){o(l);return}for(;++f<s.length;)(c[f]===null||c[f]===void 0)&&(c[f]=s[f]);s=c,u?yW(u,a)(...c):o(null,...c)}}function r(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function yW(e,t){let n;return r;function r(...o){const a=e.length>o.length;let l;a&&o.push(s);try{l=e.apply(this,o)}catch(c){const u=c;if(a&&n)throw u;return s(u)}a||(l&&l.then&&typeof l.then=="function"?l.then(i,s):l instanceof Error?s(l):i(l))}function s(o,...a){n||(n=!0,t(o,...a))}function i(o){s(null,o)}}const In={basename:xW,dirname:vW,extname:wW,join:bW,sep:"/"};function xW(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');za(e);let n=0,r=-1,s=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(i){n=s+1;break}}else r<0&&(i=!0,r=s+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,a=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(i){n=s+1;break}}else o<0&&(i=!0,o=s+1),a>-1&&(e.codePointAt(s)===t.codePointAt(a--)?a<0&&(r=s):(a=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function vW(e){if(za(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 wW(e){za(e);let t=e.length,n=-1,r=0,s=-1,i=0,o;for(;t--;){const a=e.codePointAt(t);if(a===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),a===46?s<0?s=t:i!==1&&(i=1):s>-1&&(i=-1)}return s<0||n<0||i===0||i===1&&s===n-1&&s===r+1?"":e.slice(s,n)}function bW(...e){let t=-1,n;for(;++t<e.length;)za(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":kW(n)}function kW(e){za(e);const t=e.codePointAt(0)===47;let n=_W(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function _W(e,t){let n="",r=0,s=-1,i=0,o=-1,a,l;for(;++o<=e.length;){if(o<e.length)a=e.codePointAt(o);else{if(a===47)break;a=47}if(a===47){if(!(s===o-1||i===1))if(s!==o-1&&i===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),s=o,i=0;continue}}else if(n.length>0){n="",r=0,s=o,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(s+1,o):n=e.slice(s+1,o),r=o-s-1;s=o,i=0}else a===46&&i>-1?i++:i=-1}return n}function za(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const SW={cwd:CW};function CW(){return"/"}function fp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function jW(e){if(typeof e=="string")e=new URL(e);else if(!fp(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 PW(e)}function PW(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 s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(t)}const hf=["history","path","basename","stem","extname","dirname"];class mC{constructor(t){let n;t?fp(t)?n={path:t}:typeof t=="string"||EW(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":SW.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<hf.length;){const i=hf[r];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let s;for(s in n)hf.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?In.basename(this.path):void 0}set basename(t){mf(t,"basename"),pf(t,"basename"),this.path=In.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?In.dirname(this.path):void 0}set dirname(t){z0(this.basename,"dirname"),this.path=In.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?In.extname(this.path):void 0}set extname(t){if(pf(t,"extname"),z0(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=In.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){fp(t)&&(t=jW(t)),mf(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?In.basename(this.path,this.extname):void 0}set stem(t){mf(t,"stem"),pf(t,"stem"),this.path=In.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const s=this.message(t,n,r);throw s.fatal=!0,s}info(t,n,r){const s=this.message(t,n,r);return s.fatal=void 0,s}message(t,n,r){const s=new at(t,n,r);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function pf(e,t){if(e&&e.includes(In.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+In.sep+"`")}function mf(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function z0(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function EW(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const TW=function(e){const r=this.constructor.prototype,s=r[e],i=function(){return s.apply(i,arguments)};return Object.setPrototypeOf(i,r),i},NW={}.hasOwnProperty;class xg extends TW{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=gW()}copy(){const t=new xg;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(ff(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(xf("data",this.frozen),this.namespace[t]=n,this):NW.call(this.namespace,t)&&this.namespace[t]||void 0:t?(xf("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 s=n.call(t,...r);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Ml(t),r=this.parser||this.Parser;return gf("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),gf("process",this.parser||this.Parser),yf("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(i,o){const a=Ml(t),l=r.parse(a);r.run(l,a,function(u,f,h){if(u||!f||!h)return c(u);const p=f,m=r.stringify(p,h);IW(m)?h.value=m:h.result=m,c(u,h)});function c(u,f){u||!f?o(u):i?i(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),gf("processSync",this.parser||this.Parser),yf("processSync",this.compiler||this.Compiler),this.process(t,s),V0("processSync","process",n),r;function s(i,o){n=!0,I0(i),r=o}}run(t,n,r){B0(t),this.freeze();const s=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?i(void 0,r):new Promise(i);function i(o,a){const l=Ml(n);s.run(t,l,c);function c(u,f,h){const p=f||t;u?a(u):o?o(p):r(void 0,p,h)}}}runSync(t,n){let r=!1,s;return this.run(t,n,i),V0("runSync","run",r),s;function i(o,a){I0(o),s=a,r=!0}}stringify(t,n){this.freeze();const r=Ml(n),s=this.compiler||this.Compiler;return yf("stringify",s),B0(t),s(t,r)}use(t,...n){const r=this.attachers,s=this.namespace;if(xf("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...f]=c;l(u,f)}else o(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function o(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");a(c.plugins),c.settings&&(s.settings=ff(!0,s.settings,c.settings))}function a(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const f=c[u];i(f)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let f=-1,h=-1;for(;++f<r.length;)if(r[f][0]===c){h=f;break}if(h===-1)r.push([c,...u]);else if(u.length>0){let[p,...m]=u;const g=r[h][1];dp(g)&&dp(p)&&(p=ff(!0,g,p)),r[h]=[c,p,...m]}}}}const RW=new xg().freeze();function gf(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function yf(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function xf(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 B0(e){if(!dp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function V0(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Ml(e){return AW(e)?e:new mC(e)}function AW(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function IW(e){return typeof e=="string"||MW(e)}function MW(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const LW="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",U0=[],W0={allowDangerousHtml:!0},DW=/^(https?|ircs?|mailto|xmpp)$/i,FW=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function OW(e){const t=$W(e),n=zW(e);return BW(t.runSync(t.parse(n),n),e)}function $W(e){const t=e.rehypePlugins||U0,n=e.remarkPlugins||U0,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...W0}:W0;return RW().use(xU).use(n).use(pW,r).use(t)}function zW(e){const t=e.children||"",n=new mC;return typeof t=="string"&&(n.value=t),n}function BW(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,i=t.disallowedElements,o=t.skipHtml,a=t.unwrapDisallowed,l=t.urlTransform||VW;for(const u of FW)Object.hasOwn(t,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+LW+u.id,void 0);return hC(e,c),XV(e,{Fragment:d.Fragment,components:s,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0});function c(u,f,h){if(u.type==="raw"&&h&&typeof f=="number")return o?h.children.splice(f,1):h.children[f]={type:"text",value:u.value},f;if(u.type==="element"){let p;for(p in cf)if(Object.hasOwn(cf,p)&&Object.hasOwn(u.properties,p)){const m=u.properties[p],g=cf[p];(g===null||g.includes(u.tagName))&&(u.properties[p]=l(String(m||""),p,u))}}if(u.type==="element"){let p=n?!n.includes(u.tagName):i?i.includes(u.tagName):!1;if(!p&&r&&typeof f=="number"&&(p=!r(u,f,h)),p&&h&&typeof f=="number")return a&&u.children?h.children.splice(f,1,...u.children):h.children.splice(f,1),f}}}function VW(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),s=e.indexOf("/");return t===-1||s!==-1&&t>s||n!==-1&&t>n||r!==-1&&t>r||DW.test(e.slice(0,t))?e:""}const vf=e=>`font-display-luminari font-semibold ${e} mt-6 mb-3 leading-tight`,UW={p:({children:e})=>d.jsx("p",{className:"mb-4",children:e}),strong:({children:e})=>d.jsx("strong",{className:"font-bold",children:e}),h1:({children:e})=>d.jsx("h1",{className:vf("text-lg"),children:e}),h2:({children:e})=>d.jsx("h2",{className:vf("text-[1.3rem]"),children:e}),h3:({children:e})=>d.jsx("h3",{className:vf("text-[1.1rem]"),children:e}),a:({children:e,href:t})=>d.jsx("a",{href:t,target:"_blank",rel:"noreferrer",className:"text-watercolor-amber-dark",children:e}),code:({children:e})=>d.jsx("code",{className:"font-mono text-[0.85em] bg-black/[6%] rounded-[3px] py-[0.1em] px-[0.35em]",children:e}),pre:({children:e})=>d.jsx("pre",{className:"font-mono text-[0.85em] bg-black/[6%] rounded-md py-3 px-4 overflow-x-auto mb-4",children:e}),ul:({children:e})=>d.jsx("ul",{className:"list-disc mb-4 pl-[1.4rem]",children:e}),ol:({children:e})=>d.jsx("ol",{className:"list-decimal mb-4 pl-[1.4rem]",children:e}),li:({children:e})=>d.jsx("li",{className:"mb-[0.4rem]",children:e}),blockquote:({children:e})=>d.jsx("blockquote",{className:"mb-4 pl-4 border-l-[3px] border-solid border-black/[15%] opacity-[0.85]",children:e})},gC=({children:e})=>d.jsx(OW,{components:UW,children:e}),vg=1e3,WW=3e4;let en=null,gi=null,Xo=vg;const Jo=new Set;function HW(e){let t;try{t=JSON.parse(e.data)}catch{return}for(const n of Jo)n(t)}function GW(){Xo=vg}function KW(){en==null||en.close(),en=null,Jo.size!==0&&(gi=setTimeout(()=>{gi=null,yC()},Xo),Xo=Math.min(Xo*2,WW))}function yC(){en=new EventSource(G("/api/activity/stream")),en.onmessage=HW,en.onopen=GW,en.onerror=KW}function Ba(e){return Jo.add(e),!en&&!gi&&yC(),()=>{Jo.delete(e),!(Jo.size>0)&&(gi&&(clearTimeout(gi),gi=null),en&&(en.close(),en=null),Xo=vg)}}function Va(){const[e,t]=b.useState([]),n=b.useCallback(async()=>{try{t(await _B())}catch{}},[]);b.useEffect(()=>{n()},[n]),b.useEffect(()=>{let s;const i=()=>{s&&clearTimeout(s),s=setTimeout(n,80)},o=Ba(a=>{(a.type==="check"||a.message==="changed")&&i()});return()=>{s&&clearTimeout(s),o()}},[n]);const r=b.useCallback(async s=>{await gS(s),await n()},[n]);return{checks:e,run:r}}const ji={accentAmber:"#D4A373",accentAmberDark:"#A67B4F",accentGreen:"#8FB996",accentGreenDark:"#5E8A66",accentRoseDark:"#9E5E5E",accentSlate:"#8A9BA8",chalkPass:"#2d5a3b",chalkPassText:"#b5d6b5",chalkFail:"#5a2d2d",chalkFailText:"#d6a0a0",chalkRunning:"#5a4a2d",chalkRunningText:"#d6c4a0"},wg="font-display-luminari text-base font-semibold text-desk-text-muted mb-3",Wu="text-xs font-semibold uppercase tracking-wide text-desk-text-muted mb-2",jr={pass:ji.chalkPass,fail:ji.chalkFail,running:ji.chalkRunning},Pr={pass:ji.chalkPassText,fail:ji.chalkFailText,running:ji.chalkRunningText},xC=({tooltip:e,onClick:t,disabled:n,disabledCursor:r="not-allowed",ariaExpanded:s,fillColor:i,textColor:o,variant:a,children:l})=>d.jsx(be,{content:e,surface:"chalkboard",children:d.jsx("button",{type:"button",className:`inline-flex border-none bg-transparent bg-none p-0 ${n?r==="default"?"cursor-default":"cursor-not-allowed":"cursor-pointer enabled:hover:-translate-y-px enabled:hover:brightness-[1.15]"}`,onClick:t,disabled:n,"aria-expanded":s,children:d.jsx(_e,{surface:"chalkboard",size:"small",fillColor:i,textColor:o,variant:a,children:l})})}),YW=(e,t)=>e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),vC=e=>{if(!e)return"";const t=new Date(e),n=t.toLocaleTimeString();return YW(t,new Date)?n:`${t.toLocaleDateString()} ${n}`},qW=3,QW="basis-[9.25rem]",XW=e=>{var t,n;switch(e.taskKind){case"phase":return e.phaseIndex!==void 0?`phase ${e.phaseIndex+1}`:"";case"audit":return"audit";case"batch-reconcile":return"batch reconcile";case"batch-draft":return"batch draft";case"reconcile":return"reconcile";case"fix-review":return"fixing review comments";case"draft":return"drafting";case"extend":return"extending";case"commit-suggest":return"suggesting commit message";case"overlap-check":return"checking overlap";case"sync":return"syncing to main";case"resolve-conflict":return"resolving conflict";case"run-all":return"run all phases";case"pr-review":{const r=(n=(t=e.prReviewUrl)==null?void 0:t.match(/\/pull\/(\d+)/))==null?void 0:n[1];return r?`reviewing PR #${r}`:"reviewing PR"}default:return""}},JW=e=>{const t=XW(e);return!t||t.toLowerCase()===e.planTitle.trim().toLowerCase()?"":` — ${t}`},H0={starting:jr.running,running:jr.running,stopping:jr.running,done:jr.pass,error:jr.fail,superseded:jr.running},G0={starting:Pr.running,running:Pr.running,stopping:Pr.running,done:Pr.pass,error:Pr.fail,superseded:Pr.running},ZW=({task:e,onStop:t})=>{const n=mt(),{toast:r}=He(),s=()=>n({to:"/tasks",search:{taskId:e.id}}),i=async o=>{o.stopPropagation();try{await t(e.id)}catch(a){r({title:"Failed to stop agent",description:We(a.message),variant:"error"})}};return d.jsx(de,{surface:"chalkboard",size:"small",className:"stack-task-card",children:d.jsxs("div",{role:"button",tabIndex:0,onClick:s,onKeyDown:o=>{o.target===o.currentTarget&&(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),s())},className:"flex cursor-pointer items-center justify-between gap-2 rounded-[10px]",children:[d.jsxs("div",{className:"flex min-w-0 flex-1 items-baseline gap-1",children:[d.jsxs("span",{className:"min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-display-luminari text-sm font-semibold text-desk-chalk",children:[e.planTitle,JW(e)]}),d.jsxs("span",{className:"shrink-0 text-xs text-desk-text-muted",children:["· ",s5[e.agentId]]}),d.jsx("span",{className:"shrink-0 font-mono text-2xs text-desk-text-muted",children:vC(e.startedAt)})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[e.status==="error"&&e.errorKind==="auth"?d.jsx("button",{type:"button",onClick:o=>{o.stopPropagation(),n({to:"/settings/$section",params:{section:"setup"}})},className:"bg-none bg-transparent border-none p-0 cursor-pointer",children:d.jsx(_e,{surface:"chalkboard",size:"small",fillColor:H0.error,textColor:G0.error,children:"stopped — agent signed out"})}):d.jsx(_e,{surface:"chalkboard",size:"small",fillColor:H0[e.status],textColor:G0[e.status],children:e.status}),(e.status==="running"||e.status==="starting"||e.status==="stopping")&&d.jsx(ot,{icon:d.jsx(Fu,{}),variant:"ghost",size:"small",label:"Stop agent",onClick:i,disabled:e.status==="stopping"})]})]})})},e9=()=>{const e=M(i=>i.agentStatus),t=M(i=>i.stopAgent),n=mt(),r=e.slice(0,qW),s=e.length-r.length;return d.jsxs("div",{className:"flex min-h-0 flex-none flex-col p-6",children:[d.jsx("h3",{className:`${wg} m-0`,children:"Agent"}),d.jsx("div",{className:`flex min-h-0 flex-auto flex-col gap-2 overflow-y-auto ${QW} ${r.length>0?"justify-start":"justify-center"}`,children:r.length>0?d.jsxs(d.Fragment,{children:[r.map(i=>d.jsx(ZW,{task:i,onStop:t},i.id)),s>0&&d.jsxs("button",{type:"button",onClick:()=>n({to:"/tasks"}),className:"bg-none bg-transparent border-none p-0 self-center underline cursor-pointer text-xs text-desk-chalk",children:["+",s," more"]})]}):d.jsx(de,{surface:"chalkboard",size:"small",children:d.jsx("p",{className:"m-0 text-center text-xs opacity-50",children:"No agent running."})})})]})},wC=({label:e="Refresh data",refreshingLabel:t="Refreshing…",surface:n}={})=>{const r=M(l=>l.refreshAll),s=M(l=>l.refreshing),i=M(l=>{var c;return((c=l.status)==null?void 0:c.prFetchedAt)??null}),{toast:o}=He(),a=async()=>{if(s)return;const l=await r();l.ok?o({title:"Up to date",description:"Plans, ideas, checks and PR review state re-read.",variant:"success"}):o({title:"Couldn't refresh",description:l.error??"The read failed — is the dev server running?",variant:"error"})};return d.jsxs("span",{className:"inline-flex items-center gap-2",children:[i!=null&&d.jsx("span",{className:`text-xs whitespace-nowrap ${n==="chalkboard"?"text-desk-text-muted":"opacity-[0.45]"}`,children:kS(i)}),d.jsx(ot,{icon:d.jsx("span",{className:"inline-flex",children:d.jsx(j4,{size:16})}),label:s?t:e,size:"small",variant:"ghost",surface:n,disabled:s,onClick:a})]})},t9=()=>{const[e,t]=b.useState(null),[n,r]=b.useState(!0);return b.useEffect(()=>{let s=!1;return Jm().then(i=>{s||(t((i==null?void 0:i.desk)??null),r(!1))}),()=>{s=!0}},[]),{desk:e,loading:n}},bC="Checks",n9={...jr,stale:void 0},r9={...Pr,stale:void 0},s9=e=>`Fix the failing "${e.name}" check in this repo. The command was \`${e.cmd}\`.
88
-
89
- Output from the last run:
90
-
91
- ${e.output||"(no output captured)"}`,i9=({check:e,onRun:t})=>{const n=e.status==="running",r=vC(e.lastRun);return d.jsxs("div",{className:"flex items-center justify-between gap-2",children:[d.jsxs(xC,{tooltip:`${e.cmd} — click to run.`,onClick:()=>t(e.name),disabled:n,fillColor:n9[e.status],textColor:r9[e.status],variant:e.status==="stale"?"neutral":void 0,children:[e.name,d.jsx("span",{className:n?"visible":"invisible",children:"…"})]}),r&&d.jsx("span",{className:"shrink-0 font-mono text-2xs text-desk-text-muted",children:r})]})},o9=()=>{const{checks:e,run:t}=Va(),n=e.find(i=>i.status==="fail"),[r,s]=b.useState(!1);return d.jsxs("div",{children:[d.jsx("h4",{className:`${Wu} m-0`,children:bC}),e.length>0?d.jsxs("div",{className:"flex flex-col gap-3",children:[d.jsx("div",{className:"flex flex-col gap-2",children:e.map(i=>d.jsx(i9,{check:i,onRun:t},i.name))}),n&&d.jsxs("div",{className:"flex flex-col gap-1 text-center font-handwritten text-sm",children:[d.jsxs("span",{className:"text-desk-text-muted",children:["The ",n.name," check failed."]}),d.jsxs("span",{className:"text-desk-chalk",children:["Suggested fix: ",d.jsx(Zh,{text:s9(n),surface:"chalkboard"}),n.output&&d.jsxs(d.Fragment,{children:[" · ",d.jsx("button",{type:"button",onClick:()=>s(i=>!i),className:"bg-none bg-transparent border-none p-0 underline cursor-pointer [font:inherit] text-desk-chalk","aria-expanded":r,children:r?"Hide output":"Show output"})]})]}),r&&n.output&&d.jsx("pre",{className:"mt-1 max-h-48 overflow-auto whitespace-pre-wrap text-left font-mono text-2xs opacity-70",children:n.output})]})]}):d.jsx(de,{surface:"chalkboard",size:"small",children:d.jsx("p",{className:"m-0 text-center text-xs opacity-50",children:"No checks declared."})})]})},a9=async()=>{try{const e=await fetch(G("/api/ci"));return e.ok?e.json():null}catch{return null}};function l9(){const[e,t]=b.useState(null),[n,r]=b.useState(!0),s=b.useCallback(async()=>{try{t(await a9())}finally{r(!1)}},[]);return b.useEffect(()=>{s()},[s]),{ci:e,loading:n,refresh:s}}const kC="CI & release",c9={success:"bg-chalk-pass-text",failure:"bg-chalk-fail-text",in_progress:"bg-chalk-running-text",queued:"bg-chalk-running-text",cancelled:"bg-desk-text-muted",unknown:"bg-desk-text-muted"},wf="text-desk-chalk underline decoration-desk-border hover:decoration-desk-chalk",u9=({run:e})=>{const t=d.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[d.jsx("span",{"aria-hidden":"true",className:`h-2 w-2 shrink-0 rounded-full ${c9[e.status]}`}),d.jsx("span",{className:"min-w-0 overflow-hidden text-ellipsis whitespace-nowrap text-desk-chalk",children:e.workflow}),d.jsx("span",{className:"shrink-0 font-mono text-2xs text-desk-text-muted",children:e.status})]});return e.url?d.jsx("a",{href:e.url,target:"_blank",rel:"noreferrer",className:"no-underline",children:t}):t},d9=()=>{const{ci:e,loading:t,refresh:n}=l9(),r=M(o=>o.refreshing),s=b.useRef(!1);b.useEffect(()=>{s.current&&!r&&n(),s.current=r},[r,n]);const i=()=>{var a;if(!e)return d.jsx(de,{surface:"chalkboard",size:"small",children:d.jsx("p",{className:"m-0 text-center text-xs opacity-50",children:t?"Checking CI…":"No CI source declared."})});const o=`https://github.com/${e.repo}/actions`;return e.available?d.jsx(de,{surface:"chalkboard",size:"small",children:d.jsxs("div",{className:"flex flex-col gap-2 text-sm",children:[e.runs.length>0?e.runs.map(l=>d.jsx(u9,{run:l},l.workflow)):d.jsxs("span",{className:"text-xs text-desk-text-muted opacity-70",children:["No recent runs on ",e.branch,"."]}),d.jsxs("div",{className:"font-mono text-2xs text-desk-text-muted",children:["Released ",e.releasedVersion??"—"," · Queued ",((a=e.releasePr)==null?void 0:a.version)??"none"]}),d.jsxs("div",{className:"flex flex-wrap gap-x-3 text-2xs",children:[e.releasePr&&d.jsxs("a",{href:e.releasePr.url,target:"_blank",rel:"noreferrer",className:wf,children:["Release PR #",e.releasePr.number]}),d.jsx("a",{href:o,target:"_blank",rel:"noreferrer",className:wf,children:"Open Actions"})]})]})}):d.jsx(de,{surface:"chalkboard",size:"small",children:d.jsxs("p",{className:"m-0 text-center text-xs opacity-70",children:["CI status unavailable —"," ",d.jsx("a",{href:o,target:"_blank",rel:"noreferrer",className:wf,children:"open Actions"})]})})};return d.jsxs("div",{children:[d.jsx("h4",{className:`${Wu} m-0`,children:kC}),i()]})},_C=async(e,t)=>{if(!e.ok){const n=await e.json().catch(()=>({error:t}));throw new Error(n.error??t)}},f9=async()=>{const e=await fetch(G("/api/services"));return e.ok?(await e.json()).services??[]:[]},h9=async e=>{const t=await fetch(G(`/api/services/start?name=${encodeURIComponent(e)}`),{method:"POST"});await _C(t,"Failed to start service")},p9=async e=>{const t=await fetch(G(`/api/services/stop?name=${encodeURIComponent(e)}`),{method:"POST"});await _C(t,"Failed to stop service")},m9=async e=>{const t=await fetch(G(`/api/services/logs?name=${encodeURIComponent(e)}`));return t.ok?(await t.json()).log??"":""};function g9(){const[e,t]=b.useState([]),[n,r]=b.useState(!0),s=b.useCallback(async()=>{try{t(await f9())}catch{}finally{r(!1)}},[]);b.useEffect(()=>{s()},[s]),b.useEffect(()=>{let a;const l=()=>{a&&clearTimeout(a),a=setTimeout(s,80)},c=Ba(u=>{(u.type==="service"||u.message==="changed")&&l()});return()=>{a&&clearTimeout(a),c()}},[s]);const i=b.useCallback(async a=>{await h9(a),await s()},[s]),o=b.useCallback(async a=>{await p9(a),await s()},[s]);return{services:e,loading:n,start:i,stop:o,refresh:s}}const y9=1500,SC="Services",x9=e=>e.status==="crashed"?"bg-chalk-fail-text":e.status==="running"?e.health==="up"?"bg-chalk-pass-text":"bg-chalk-running-text":e.status==="stopping"?"bg-chalk-running-text":"bg-desk-text-muted",v9=({service:e})=>{const t=e.status==="running"?`running · ${e.health}`:e.status;return d.jsx("span",{role:"img","aria-label":t,className:`h-2 w-2 shrink-0 rounded-full ${x9(e)}`,title:t})},w9=({name:e,running:t})=>{const[n,r]=b.useState(""),s=b.useRef(null);return b.useEffect(()=>{let i=!1;const o=async()=>{const l=await m9(e);i||r(l)};o();const a=t?setInterval(o,y9):void 0;return()=>{i=!0,a&&clearInterval(a)}},[e,t]),b.useEffect(()=>{const i=s.current;i&&n&&(i.scrollTop=i.scrollHeight)},[n]),d.jsx("pre",{ref:s,className:"m-0 mt-2 max-h-40 overflow-auto whitespace-pre-wrap break-words rounded-[8px] bg-desk-bg/60 p-2 font-mono text-2xs leading-relaxed text-desk-text-muted",children:n||"No output yet."})},b9=({service:e,onStart:t,onStop:n})=>{const{toast:r}=He(),[s,i]=b.useState(!1),[o,a]=b.useState(!1),l=e.status==="running"||e.status==="stopping",c=e.pid!==null,u=async()=>{if(!s){i(!0);try{await(l?n:t)(e.name)}catch(f){r({title:l?"Failed to stop service":"Failed to start service",description:f.message,variant:"error"})}finally{i(!1)}}};return d.jsxs(de,{surface:"chalkboard",size:"small",children:[d.jsxs("div",{className:"flex items-center justify-between gap-2",children:[d.jsxs("button",{type:"button",onClick:()=>a(f=>!f),"aria-expanded":o,className:"flex min-w-0 cursor-pointer items-center gap-2 border-none bg-transparent p-0 text-left",children:[d.jsx("span",{className:`shrink-0 text-desk-text-muted transition-transform ${o?"rotate-90":""}`,children:d.jsx(N4,{})}),d.jsx(v9,{service:e}),d.jsx("span",{className:"min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-display-luminari text-sm font-semibold text-desk-chalk",children:e.name}),e.port&&d.jsxs("span",{className:"shrink-0 font-mono text-2xs text-desk-text-muted",children:[":",e.port]})]}),d.jsx("div",{className:"flex shrink-0 items-center gap-1",children:s?d.jsx(ar,{size:"small",surface:"chalkboard",label:"Working"}):!l||c?d.jsx(ot,{icon:l?d.jsx(T4,{}):d.jsx(E4,{}),surface:"chalkboard",size:"small",variant:"ghost",label:l?`Stop ${e.name}`:`Start ${e.name}`,onClick:u}):null})]}),o&&d.jsx(w9,{name:e.name,running:l})]})},k9=()=>{const{services:e,start:t,stop:n}=g9(),r=b.useCallback(i=>t(i),[t]),s=b.useCallback(i=>n(i),[n]);return d.jsxs("div",{children:[d.jsx("h4",{className:`${Wu} m-0`,children:SC}),d.jsx("div",{className:"flex flex-col gap-2",children:e.length>0?e.map(i=>d.jsx(b9,{service:i,onStart:r,onStop:s},i.name)):d.jsx(de,{surface:"chalkboard",size:"small",children:d.jsx("p",{className:"m-0 text-center text-xs opacity-50",children:"No services declared."})})})]})},_9=[SC,bC,kC],S9=()=>d.jsx("div",{className:"flex flex-col gap-4","aria-hidden":"true",children:_9.map(e=>d.jsxs("div",{children:[d.jsx("div",{className:Wu,children:e}),d.jsx(Mt,{variant:"rect",width:"100%",height:28,surface:"chalkboard"})]},e))}),C9=()=>d.jsx("div",{className:"flex flex-1 items-center justify-center",children:d.jsxs("p",{className:"m-0 text-center text-xs text-desk-text-muted",children:["Desk isn't configured — add ",d.jsx("code",{children:"desk"})," to ",d.jsx("code",{children:"papercamp/config.json"}),"."]})}),j9=()=>{const{desk:e,loading:t}=t9();return d.jsxs(d.Fragment,{children:[d.jsx(Ou,{surface:"chalkboard"}),d.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto p-6",children:[d.jsxs("div",{className:"flex items-center justify-between gap-2 mb-3",children:[d.jsx("h3",{className:`${wg} m-0`,children:"Desk"}),d.jsx(wC,{label:"Fetch from GitHub",refreshingLabel:"Fetching…",surface:"chalkboard"})]}),t?d.jsx(S9,{}):e?d.jsxs("div",{className:"flex flex-col gap-4",children:[d.jsx(k9,{}),d.jsx(o9,{}),d.jsx(d9,{})]}):d.jsx(C9,{})]})]})},P9=e=>e.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,t=>t.toUpperCase()),E9=()=>{const[e,t]=b.useState(null),[n,r]=b.useState(null),[s,i]=b.useState(!0);return b.useEffect(()=>{let o=!1;return i(!0),Promise.all([tB().then(a=>{!o&&a&&t(P9(a))}),eB().then(a=>{o||r(a)})]).finally(()=>{o||i(!1)}),()=>{o=!0}},[]),{projectName:e,iconDataUri:n,loading:s}},T9=["repo-docs","release-notes"],N9=["subjects","setup","merge-policy"];function CC(e){var t;return((t=e==null?void 0:e.match(/\d+$/))==null?void 0:t[0])??null}function jC(e,t){return e.find(n=>CC(n.id)===t)??e.find(n=>!n.id&&n.title===t)??null}function Ns(e,t){return CC(e)??encodeURIComponent(t)}function bg(){const{planId:e}=zs({strict:!1}),t=M(n=>n.plans);return typeof e!="string"||!t?null:jC(t.entries,decodeURIComponent(e))}function R9(){const{ideaId:e}=zs({strict:!1}),t=M(n=>n.ideaEntries);return typeof e!="string"?null:jC(t,decodeURIComponent(e))}function A9(){const{section:e}=zs({strict:!1});return T9.includes(e)?e:null}function NG(){const{section:e}=zs({strict:!1});return N9.includes(e)?e:null}function RG(){const e=A9(),t=M(r=>r.activeDocTitle),n=M(r=>r.repoDocs);return e??(t&&n.some(r=>r.name===t)?"repo-docs":null)}const I9=250;function PC(e,t,n={}){const{debounceMs:r=I9,...s}=n,[i,o]=b.useState(e);b.useEffect(()=>{const c=setTimeout(()=>o(e),r);return()=>clearTimeout(c)},[e,r]);const{threshold:a,limit:l}=s;return b.useMemo(()=>x5(i,t,{threshold:a,limit:l}),[i,t,a,l])}const EC=()=>{const[e,t]=b.useState([]),[n,r]=b.useState(!0),[s,i]=b.useState(!0);return b.useEffect(()=>{let o=!1;return Jm().then(a=>{o||(t((a==null?void 0:a.subjects)??[]),i(a!==null),r(!1))}),()=>{o=!0}},[]),{subjects:e,loading:n,available:s}},M9=e=>e.errorCount>0?"fail":e.warningCount>0?"running":"pass",K0=({label:e,fillKey:t,hasFindings:n,expanded:r,onToggle:s,tooltip:i})=>d.jsx(xC,{tooltip:i,onClick:s,disabled:!n,disabledCursor:"default",ariaExpanded:n?r:void 0,fillColor:jr[t],textColor:Pr[t],children:e}),L9=({finding:e})=>d.jsxs("div",{className:"font-mono text-2xs opacity-70",children:[e.file,":",e.line," — ",e.message]}),D9=({issue:e,linkedPlan:t,onNavigate:n})=>d.jsx("div",{className:"font-mono text-2xs opacity-70",children:t?d.jsx("button",{type:"button",onClick:n,className:"bg-none bg-transparent border-none p-0 underline cursor-pointer [font:inherit] text-left",children:e.message}):d.jsx("span",{className:"text-left",children:e.message})}),F9=()=>{const e=M(f=>f.doctor),t=M(f=>f.consistency),n=M(f=>f.plans),r=mt(),[s,i]=b.useState(!1),[o,a]=b.useState(!1),l=e.findings.length>0,c=t.length>0,u=b.useCallback(f=>f.planId?n==null?void 0:n.entries.find(h=>h.id===f.planId):void 0,[n==null?void 0:n.entries]);return d.jsxs(d.Fragment,{children:[d.jsx(Ou,{surface:"chalkboard"}),d.jsxs("div",{className:"flex flex-none flex-col gap-3 p-6",children:[d.jsx("h3",{className:`${wg} m-0`,children:"Health"}),d.jsxs("div",{className:"flex flex-wrap gap-2",children:[d.jsx(K0,{label:"doctor",fillKey:M9(e),hasFindings:l,expanded:s,onToggle:()=>i(f=>!f),tooltip:l?`${e.errorCount} error(s), ${e.warningCount} warning(s) — click to show.`:"Corpus doctor — no findings."}),d.jsx(K0,{label:"docs",fillKey:c?"fail":"pass",hasFindings:c,expanded:o,onToggle:()=>a(f=>!f),tooltip:c?"Plan/idea doc findings — orphan subjects & title style. Click to show.":"Plan/idea docs — no findings."})]}),s&&l&&d.jsx("div",{className:"flex flex-col gap-1",children:e.findings.map(f=>d.jsx(L9,{finding:f},`${f.file}:${f.line}:${f.rule}`))}),o&&c&&d.jsx("div",{className:"flex flex-col gap-1",children:t.map((f,h)=>{const p=u(f);return d.jsx(D9,{issue:f,linkedPlan:p,onNavigate:()=>p&&r({to:"/plans/$planId",params:{planId:Ns(p.id,p.title)}})},`${f.kind}-${f.title}-${h}`)})})]})]})},O9=({open:e,onToggle:t,pinned:n=!1})=>{const r=e||n,s=b.useRef(null);b.useEffect(()=>{s.current&&(s.current.inert=!r)},[r]),b.useEffect(()=>{if(!r||n)return;const h=p=>{p.key==="Escape"&&t()};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[r,n,t]);const i=M(h=>h.consistency),o=M(h=>h.doctor),a=M(h=>h.agentStatus);b.useEffect(()=>{const{loadStatus:h,loadConsistency:p,loadDoctor:m,loadGitStatus:g,loadAgentStatus:w,loadArchivableIdeas:y}=M.getState();h(),p(),m(),g(),w(),y()},[]),b.useEffect(()=>{const h=()=>{M.getState().loadPlans(),M.getState().loadGitStatus()};return window.addEventListener("focus",h),()=>window.removeEventListener("focus",h)},[]),b.useEffect(()=>{const h={},p=(g,w,y)=>{h[g]&&clearTimeout(h[g]),h[g]=setTimeout(w,y)},m=Ba(g=>{if(g.type==="status"){p("status",()=>M.getState().loadStatus(),80);return}if(g.type==="agent"){p("agent",()=>M.getState().loadAgentStatus(),120);return}g.message==="changed"&&p("activity",()=>{const{loadPlans:w,loadSuggestions:y,loadStatus:x,loadConsistency:v,loadDoctor:k,loadGitStatus:C,loadAgentStatus:S,loadArchivableIdeas:P}=M.getState();w(),y(),x(),v(),k(),C(),S(),P()},250)});return()=>{for(const g of Object.values(h))g&&clearTimeout(g);m()}},[]);const{checks:l}=Va(),c=i.length>0,u=l.some(h=>h.status==="fail")||c||o.errorCount>0,f=a.some(h=>h.status==="running"||h.status==="starting"||h.status==="stopping");return d.jsxs(d.Fragment,{children:[!r&&d.jsx("div",{className:"fixed right-0 top-[var(--pc-stack-toggle-top,50%)] z-[300] rounded-l-md shadow-[-2px_0_8px_rgba(0,0,0,0.15)] bg-desk-bg bg-chalkboard [background-repeat:repeat,no-repeat] [background-size:200px_200px,auto]",style:{transform:"translateY(-50%)"},children:d.jsx(ot,{icon:f?d.jsx(ar,{size:"small",surface:"chalkboard",label:"Agent running"}):u?d.jsx("span",{"aria-hidden":"true",className:"h-2 w-2 rounded-full bg-chalk-fail-text shadow-[0_0_6px_rgba(214,160,160,0.9)]"}):d.jsx("span",{className:"text-2xs",children:"S"}),surface:"chalkboard",size:"small",label:f?"Open stack panel — agent running":u?"Open stack panel — checks failing":"Open stack panel",onClick:t,className:`w-7 h-[64px] rounded-l-md ${f?"shadow-[inset_0_0_0_1px_rgba(214,196,160,0.6)]":u?"shadow-[inset_0_0_0_1px_rgba(214,160,160,0.6)]":""}`})}),d.jsxs("aside",{ref:s,"aria-label":"Stack",className:"fixed inset-y-0 right-0 z-[300] flex w-[min(480px,100vw)] flex-col overflow-hidden border-l-4 border-paper-950/[12%] text-desk-text bg-desk-bg bg-chalkboard [background-repeat:repeat,no-repeat] [background-size:200px_200px,auto]",style:{transform:r?"translateX(0)":"translateX(100%)"},children:[d.jsxs("div",{className:"flex h-14 shrink-0 items-center justify-between px-6",children:[d.jsx("h2",{className:"m-0 font-display-luminari text-base font-bold text-desk-chalk",children:"Stack"}),!n&&d.jsx(ot,{icon:d.jsx("span",{className:"text-sm leading-none",children:"×"}),surface:"chalkboard",size:"small",label:"Close stack panel",onClick:t,className:"h-7 w-7 border border-desk-border"})]}),d.jsx(Ou,{surface:"chalkboard"}),d.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[d.jsx(e9,{}),d.jsx(j9,{}),d.jsx(F9,{})]})]})]})},$9=({size:e="md"})=>{const{projectName:t,iconDataUri:n,loading:r}=E9();return d.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[n?d.jsx("img",{src:n,alt:"",className:`object-contain shrink-0 ${e==="sm"?"w-[18px] h-[18px]":"w-[20px] h-[20px]"}`}):d.jsx(D$,{icon:d.jsx(I3,{}),size:"small"}),d.jsx("span",{className:`font-display-luminari font-semibold whitespace-nowrap overflow-hidden text-ellipsis min-w-0 ${e==="sm"?"text-sm":"text-md"}`,children:r?"Loading…":t??"Paper Camp"})]})},z9=()=>{const[e,t]=b.useState(null);return b.useEffect(()=>{},[]),e?d.jsxs("div",{role:"alert",className:"bg-watercolor-rose-dark text-desk-text py-2 px-4 text-2xs font-mono shrink-0",children:["Server failed to reload — restart `pnpm dev` to pick up the change. ",e]}):null},B9=({routeKey:e,children:t,mobileOpen:n,onMobileClose:r})=>{const s=b.useRef(null);return b.useEffect(()=>{if(!n)return;const i=o=>{o.key==="Escape"&&r()};return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[n,r]),b.useEffect(()=>{var o;if(!n)return;const i=document.activeElement;return(o=s.current)==null||o.focus(),()=>{var a;return(a=i==null?void 0:i.focus)==null?void 0:a.call(i)}},[n]),d.jsxs(d.Fragment,{children:[n&&d.jsx("button",{type:"button",className:"lg:hidden fixed inset-0 z-[290] cursor-default border-none p-0 bg-ink-900/[40%] backdrop-blur-sm",onClick:r,"aria-label":"Close sidebar",tabIndex:-1}),d.jsx("aside",{ref:s,role:n?"dialog":void 0,"aria-modal":n||void 0,"aria-label":"Sidebar navigation",tabIndex:-1,className:`fixed inset-y-0 left-0 z-[300] w-[224px] shrink-0 flex flex-col overflow-hidden lg:sticky lg:inset-auto lg:top-0 lg:z-auto lg:translate-x-0 h-[var(--pc-sidebar-h,100%)] ${n?"translate-x-0":"-translate-x-full"} ${n?"bg-[var(--pui-bg-base)] shadow-[2px_0_12px_rgba(0,0,0,0.15)]":"bg-transparent"}`,children:d.jsx("div",{className:"flex-1 overflow-y-auto pt-5 relative",children:d.jsx("div",{children:t},e)})})]})};function bf(e){return e==="allowed"?"allowed":/reject|block|exceed|denied/i.test(e)?"rejected":"warning"}function V9(e){return e<1e12?e*1e3:e}function U9(e){const t=[`Claude usage: ${e.status}`];return e.rateLimitType&&t.push(e.rateLimitType),e.resetsAt!==void 0&&t.push(`resets ${new Date(V9(e.resetsAt)).toLocaleTimeString()}`),e.overage&&t.push("overage on"),t.join(" · ")}const W9="flex items-center gap-3 h-8 px-4 border-b border-black/[0.08] text-xs shrink-0 box-border overflow-x-auto overflow-y-hidden whitespace-nowrap",H9="flex items-center gap-3 shrink-0",G9="flex items-center gap-1",K9="opacity-50",Y9="text-[var(--pui-text-primary)]",Y0="opacity-60",q9="flex-1",q0="flex items-center gap-2 shrink-0",Q0="bg-transparent border-none p-0 cursor-pointer",Q9="relative inline-flex",X9="absolute -top-1 -right-1 pointer-events-none",J9=({gitBranch:e,gitAhead:t,changedFileCount:n,agentActive:r,activeTaskStatus:s,agentNotSignedIn:i,capabilityGapCount:o,rateLimit:a,unreadNotificationCount:l,onOpenSetup:c,onOpenGit:u,onOpenNotifications:f,trailing:h})=>d.jsxs("div",{className:W9,style:zi("kraft"),children:[d.jsxs("div",{className:H9,children:[d.jsxs("span",{className:G9,children:[d.jsx("span",{className:K9,children:d.jsx(Vv,{size:12})}),d.jsx("code",{className:Y9,children:e??"no branch"})]}),t>0&&d.jsxs("span",{className:Y0,children:["↑",t]}),d.jsx("span",{className:Y0,children:n>0?`${n} changed`:"clean"}),r&&d.jsx(ar,{size:"small",label:`Agent ${s}…`}),i&&d.jsx(be,{content:"Sign in from Settings → Connections so agent tasks can run",children:d.jsx("button",{type:"button",onClick:c,className:Q0,children:d.jsx(_e,{size:"small",variant:"warning",children:"Agent not signed in"})})}),o>0&&d.jsx(be,{content:"Some features are disabled — open Setup to fix",children:d.jsx("button",{type:"button",onClick:c,className:Q0,children:d.jsxs(_e,{size:"small",variant:"warning",children:["Setup (",o,")"]})})}),a&&bf(a.status)!=="allowed"&&d.jsx(be,{content:U9(a),children:d.jsx(_e,{size:"small",variant:bf(a.status)==="rejected"?"error":"warning",children:bf(a.status)==="rejected"?"Claude limit reached":"Claude usage warning"})})]}),d.jsx("div",{className:q9}),h&&d.jsx("div",{className:q0,children:h}),d.jsxs("div",{className:q0,children:[d.jsx(be,{content:"Git",children:d.jsx(ot,{variant:"ghost",size:"small",icon:d.jsx(Vv,{}),label:"Git",onClick:u})}),d.jsx(be,{content:"Notifications",children:d.jsxs("span",{className:Q9,children:[d.jsx(ot,{variant:"ghost",size:"small",icon:d.jsx(R4,{}),label:"Notifications",onClick:f}),l>0&&d.jsx("span",{className:X9,children:d.jsx(_e,{size:"small",variant:"warning",children:l})})]})})]})]}),Z9=()=>{const e=M(g=>g.agentStatus),t=M(g=>g.gitStatus),n=M(g=>g.gitBranch),r=M(g=>g.gitAhead),s=M(H5),i=M(G5),o=M(K5),a=M(g=>{var w;return((w=g.notifications)==null?void 0:w.filter(y=>y.kind==="question"||!y.read).length)??0}),l=mt(),c=e.find(g=>g.status==="running"||g.status==="starting"||g.status==="stopping"),u=c!==void 0,f=(t==null?void 0:t.length)??0,h=()=>l({to:"/settings/$section",params:{section:"setup"}}),p=()=>l({to:"/git"}),m=()=>l({to:"/inbox"});return d.jsx(J9,{gitBranch:n,gitAhead:r,changedFileCount:f,agentActive:u,activeTaskStatus:c==null?void 0:c.status,agentNotSignedIn:i,capabilityGapCount:s,rateLimit:o,unreadNotificationCount:a,onOpenSetup:h,onOpenGit:p,onOpenNotifications:m})},eH=({children:e})=>d.jsx("h1",{className:"text-4xl font-display-luminari font-semibold text-ink-900 mb-6 leading-[1.1]",children:e}),tH=3*6e4,nH=(e,t)=>{const n=M(o=>o.loadPlans),r=e.thread??[],s=r[r.length-1],i=e.id;b.useEffect(()=>{if(!i||!s||s.kind!=="chat")return;const o=setTimeout(()=>{yB(i).then(a=>{if(!a.skipped)return n()}).catch(()=>{})},tH);return()=>clearTimeout(o)},[t,i,s,n])},Zi=()=>{const e=M(i=>i.loadPlans),{toast:t}=He(),[n,r]=b.useState(!1);return{patch:async(i,o,a)=>{r(!0);try{return await WB(i,o),await e(),!0}catch(l){return t({title:(a==null?void 0:a.errorTitle)??"Update failed",description:l.message,variant:"error"}),!1}finally{r(!1)}},updating:n}},rH=e=>{const t=M(a=>a.loadPlans),{toast:n}=He(),[r,s]=b.useState(null);return{promotingIndex:r,promoteToDurable:async(a,l)=>{if(!(!e.id||r!==null)){s(a);try{await Hv(e.id,a,l),await t()}catch(c){n({title:"Promote failed",description:We(c.message),variant:"error"})}finally{s(null)}}},promoteToIdea:async(a,l)=>{if(!e.id||r!==null)return!1;s(a);try{const c=await vS(l);return await Hv(e.id,a,"log",`Captured as ${c}: ${l.title}`).catch(()=>{}),await t(),!0}catch(c){return n({title:"Promote failed",description:We(c.message),variant:"error"}),!1}finally{s(null)}}}},hp=.95,sH=3e4,pp={implement:{from:0,to:.6},verify:{from:.6,to:.9},checkbox:{from:.95,to:.95}};function iH(e){const t=[...e].sort((r,s)=>r-s),n=Math.floor(t.length/2);return t.length%2===0?(t[n-1]+t[n])/2:t[n]}function oH(e){const t=e.filter(s=>s.taskKind==="phase"&&s.outcome==="done").map(s=>Date.parse(s.endedAt)-Date.parse(s.startedAt)).filter(s=>Number.isFinite(s)&&s>0);if(t.length===0)return{};const n=iH(t),r={};for(const s of["implement","verify"]){const i=pp[s].to-pp[s].from;r[s]=n*i/hp}return r}function aH({anchor:e,anchorEnteredAt:t,lastStreamAt:n,now:r,medians:s}){if(!e)return 0;const i=pp[e],o=Math.min(i.from,hp),a=s==null?void 0:s[e];if(!a||a<=0||t===void 0||i.to===i.from)return o;const l=n===void 0?r:Math.min(r,n+sH),c=Math.min(1,Math.max(0,l-t)/a);return Math.min(i.from+c*(i.to-i.from),hp)}const lH=new Set(["starting","running","stopping"]),cH=1e3;function uH(e,t){const n=e!==void 0&&e.phaseIndex!==void 0&&lH.has(e.status),[r,s]=b.useState(()=>Date.now());return b.useEffect(()=>{if(!n)return;const i=setInterval(()=>s(Date.now()),cH);return()=>clearInterval(i)},[n]),!n||(e==null?void 0:e.phaseIndex)===void 0?null:{index:e.phaseIndex,fraction:aH({anchor:e.phaseAnchor,anchorEnteredAt:e.anchorEnteredAt,lastStreamAt:e.lastStreamAt,now:r,medians:oH(t)})}}const dH=(e,{reload:t,notify:n})=>{const[r,s]=b.useState(!1),[i,o]=b.useState(!1),[a,l]=b.useState(null);return b.useEffect(()=>{l(null)},[e.id]),{sending:r,send:async f=>{if(!e.id)return!1;s(!0),l(null);try{const h={route:window.location.pathname,focusedIdeaId:e.id,viewport:{width:window.innerWidth,height:window.innerHeight}},{error:p,undo:m}=await gB(e.id,f,h);return await t(),m&&l(m),p&&n({title:"Agent did not reply",description:We(p),variant:"error"}),!0}catch(h){return n({title:"Message failed to send",description:We(h.message),variant:"error"}),!1}finally{s(!1)}},undo:a,undoing:i,undoEdit:async()=>{if(!(!e.id||!a)){o(!0);try{const{error:f}=await xB(e.id,a.commitSha);if(f){n({title:"Undo failed",description:We(f),variant:"error"});return}l(null),await t()}catch(f){n({title:"Undo failed",description:We(f.message),variant:"error"})}finally{o(!1)}}}}},fH=async e=>{const t=await fetch(G(`/api/trail?id=${encodeURIComponent(e)}`));if(!t.ok)throw new Error("Failed to load the provenance trail");return t.json()},hH=e=>{const[t,n]=b.useState(null);return b.useEffect(()=>{if(n(null),!e)return;let r=!1;return fH(e).then(s=>{r||n(s)}).catch(()=>{}),()=>{r=!0}},[e]),t};function TC(){const[e,t]=b.useState("idle"),[n,r]=b.useState(null),s=b.useRef(null),i=b.useCallback(async a=>{s.current&&clearTimeout(s.current),t("loading"),r(null);try{await a(),t("success"),s.current=setTimeout(()=>{t("idle")},2e3)}catch(l){t("error"),r(l.message),s.current=setTimeout(()=>{t("idle"),r(null)},4e3)}},[]),o=b.useCallback(()=>{s.current&&clearTimeout(s.current),t("idle"),r(null)},[]);return{state:e,errorMessage:n,run:i,reset:o,loading:e==="loading",success:e==="success"}}const kg="Keep phases short: 3-7 phases, each a one-line imperative title. Add a description only when the phase isn't self-explanatory, and keep it to one sentence. Never restate the idea's body and never summarise the work you did.",NC="A title is a noun/verb phrase, at most 40 characters (roughly 3-6 words), no em-dash subtitles or trailing clauses — the symptom, mechanism, and detail belong in the body's first paragraph, not the title.";function pH(e){const t=e.phases.map((s,i)=>`${i+1}. [${s.done?"x":" "}] ${s.text}`).join(`
92
- `),n=e.log&&e.log.length>0?e.log.map(s=>`- ${s.date}: ${s.text}`).join(`
93
- `):"(none)",r=e.clarifications&&e.clarifications.length>0?e.clarifications.map(s=>`- ${s.date}: ${s.text}`).join(`
94
- `):"(none)";return`You are auditing the plan "${e.title}" (${e.id??"no id"}) for missing phases. The plan is a single file at papercamp/ideas/${e.id??"<ID>"}.md — if it is not there, it is archived at papercamp/ideas/archive/${e.id??"<ID>"}.md. Edit only that file.
95
-
96
- Plan body: ${e.body}
97
-
98
- Current phases:
99
- ${t}
100
-
101
- Log entries (issues, bugs, and review notes recorded so far):
102
- ${n}
103
-
104
- Clarifications (answered scope/design questions):
105
- ${r}
106
-
107
- ${kg}
108
-
109
- Task:
110
- 1. Read the plan above, then inspect the relevant code in this repo.
111
- 2. Identify work that is clearly required to fulfil this plan but is covered by no existing phase. The Log entries are the best source — they often record bugs or gaps that were never turned into phases.
112
- 3. If you found missing work: append one \`- [ ] <short phase title>\` line per item at the end of the \`### Phases\` list. You may add detail below a checkbox line as continuation lines indented with 6 spaces. Then append exactly one line to the \`### Log\` section, formatted \`- YYYY-MM-DD: <what was found and appended>\`, creating that section after the Phases list if it does not exist.
113
- 4. If nothing is missing: make no edits at all — no Log line, no empty heading, no "nothing found" note. This audit re-runs regularly and must leave no trace when there is nothing to add.
114
-
115
- Rules:
116
- - Never modify, reorder, check, uncheck, or delete any existing line, even if it looks stale, wrong, or redundant.
117
- - Never touch the YAML frontmatter.
118
- - Append only: new unchecked phases at the end of the list, plus the single Log line.`}function mH(e){const t=e.phases.length>0,n=t?"plan":"idea",r=t?e.phases.map((s,i)=>`${i+1}. [${s.done?"x":" "}] ${s.text}`).join(`
119
- `):"(none — this is a backlog idea with no phases yet)";return`You are reconciling the ${n} "${e.title}" (${e.id??"no id"}), stored as a single file at papercamp/ideas/${e.id??"<ID>"}.md — if it is not there, it is archived at papercamp/ideas/archive/${e.id??"<ID>"}.md. Edit only that file.
120
-
121
- ${t?"Plan":"Idea"} body: ${e.body}
122
-
123
- Current phases:
124
- ${r}
125
-
126
- Task: this ${n} has drifted from the codebase — some ${t?"phase descriptions and body prose":"body prose"} may reference file paths that moved, code symbols that were renamed or removed, or approaches that were superseded during implementation. Find and fix only that drift.
127
-
128
- 1. Read the ${n} above, then inspect the relevant code in this repo to find what has actually changed since the prose was written.
129
- 2. Reword only the sentences or phrases that are now stale: fix references and superseded approaches. Leave everything else byte-identical.
130
- 3. Do not summarize, restructure, or "improve" prose that is still accurate — an unnecessary rewrite is a failure of this task, not a bonus.
131
-
132
- Hard guardrails, never violate these:
133
- - Never touch the YAML frontmatter (id, title, kind, status, created, idea, tags, or any other field).
134
- - Never un-check, check, delete, or reorder any phase line, checked or unchecked.
135
- - Never add or remove phases.
136
- - Never touch the Log or Clarifications sections.
137
- - If nothing is stale, make no edits at all.`}function _g(e,t,n,r){return`You are ${t} the idea ${e.id??"no id"} ("${e.title}"), stored as a single file at papercamp/ideas/${e.id??"<ID>"}.md. Edit only that file, and within it only the \`### Log\` section.
138
-
139
- ${n}
140
-
141
- ${kg}
142
-
143
- Task:
144
- 1. Explore this codebase and find what is relevant to the idea: the files it would touch, existing helpers or patterns it should build on, and constraints visible in the code.
145
- 2. Write up what you found as a single dated entry — name specific files and symbols, describe a workable approach, and include the architectural context you found. Sharpen the idea's original intent, do not redirect it.
146
- 3. Append exactly one line to the \`### Log\` section, formatted \`- YYYY-MM-DD: <what you found>\`, creating that section at the end of the file if it does not exist. Use today's date, and keep the entry to that single physical line (no literal line breaks).
147
-
148
- Keep unchanged:
149
- ${r}
150
-
151
- Append only — never rewrite or delete the idea's existing body or prior Log lines.`}function gH(e){const t=e.log&&e.log.length>0?e.log.map(s=>`- ${s.date}: ${s.text}`).join(`
152
- `):"(none)",n=`Current idea body, in full (do not modify this):
153
- ${e.body}
154
-
155
- Prior Log entries:
156
- ${t}`,r=`- the YAML frontmatter (id, title)
157
- - the \`## ${e.id??"IDEA-N"}: ${e.title}\` heading line and the original body prose beneath it`;return _g(e,"expanding",n,r)}const RC=`- the YAML frontmatter (id, title, status)
158
- - the original body prose beneath the frontmatter`;function yH(e){const t=`This idea was just promoted from an AI-generated one-liner suggestion — its current body is only that one-liner, with no deeper context yet:
159
- ${e.body}`;return _g(e,"fleshing out",t,RC)}function AG(e,t){const n=`This idea was just promoted from a roadmap item under "${t}" in ROADMAP.md — its current body is only that item's one-line description plus a provenance note, with no deeper context yet:
160
- ${e.body}`;return _g(e,"fleshing out",n,RC)}function xH(e,t){const n=t.filter(s=>s.status!=="done"),r=n.length?n.map(s=>`${s.id??"no id"}: ${s.title} (${s.phases.length} phases)`).join(`
161
- `):"(no other open plans exist yet)";return`You are drafting a plan for the idea ${e.id??"no id"} ("${e.title}"), stored as a single file at papercamp/ideas/${e.id??"<ID>"}.md. The idea and its plan are ONE file: you draft the plan by editing that existing file in place — never create a new file.
162
-
163
- Idea body, in full:
164
- ${e.body}
165
-
166
- ## What drafting adds to the file (see papercamp/about.md)
167
-
168
- The file already has YAML frontmatter (id, title, status, created, …) and the prose body above. Drafting means:
169
-
170
- 1. Add a \`type\` field to the frontmatter: the Conventional Commits type that best fits (\`feat | fix | chore | docs | refactor\` — most are \`feat\`).
171
- 2. Add 1-4 short subsystem \`tags\` to the frontmatter if it has none.
172
- 3. Append a \`### Phases\` checklist at the end of the file (after any \`### Log\` section move it below the phases — Phases, then Log):
173
-
174
- \`\`\`
175
- ### Phases
176
- - [ ] Short phase title
177
- Optional description of the phase, indented with 6 spaces.
178
- \`\`\`
179
-
180
- ${kg}
181
-
182
- Hard rules:
183
- - Never change the \`id\`, \`title\`, \`status\`, or \`created\` fields — \`status\` stays exactly \`idea\`; a human promotes it after reviewing your draft. (${NC} Leave the existing title as-is even if it breaks this; never expand it into a symptom-sentence.)
184
- - Never rewrite or delete the existing prose body or \`### Log\` entries — the idea's history stays intact.
185
- - Phases: actionable steps a future agent or human could pick up one at a time, not one giant phase.
186
-
187
- ## Every other open (non-done) plan, for scope context
188
-
189
- ${r}
190
-
191
- Use the open entities above only to avoid duplicating in-flight scope and to match phase granularity. Edit only papercamp/ideas/${e.id??"<ID>"}.md — never create, edit, move, or rename any other file.`}function vH(e,t){const n=e.length?e.map(s=>s.status==="done"||s.status==="dropped"?`- ${s.id??"no id"}: ${s.title} (status: ${s.status})`:`### ${s.id??"no id"}: ${s.title}
192
- ${s.body}`).join(`
193
-
194
- `):"(no ideas yet)",r=t.length?t.map(s=>`- ${s.date}: ${s.title} — ${s.description}`).join(`
195
- `):"(none yet)";return`You are scanning this repository for ideas worth suggesting, to append to papercamp/suggestions.md — a lightweight holding pen. Edit only that one file.
196
-
197
- Existing ideas (do not repeat anything already covered here):
198
- ${n}
199
-
200
- Existing suggestions already in the holding pen (do not repeat these either):
201
- ${r}
202
-
203
- Task:
204
- 1. Explore this codebase for gaps, rough edges, or "you might want to do X" hunches that aren't already an idea or an existing suggestion above — things like missing error handling, an obvious follow-up to recent work, a TODO left in code, or a UX gap you notice while reading the app.
205
- 2. For each genuinely new one you find (0 to a handful — do not force a quota), append one line to papercamp/suggestions.md formatted exactly \`- YYYY-MM-DD: Title — one-line description\`, using today's date. ${NC} Keep the description to a single physical line (no literal line breaks).
206
- 3. If you find nothing worth suggesting, make no edits at all — no empty line, no placeholder.
207
-
208
- Rules:
209
- - Append only — never modify, reorder, or delete any existing line in suggestions.md.
210
- - Never create papercamp/ideas/ files or touch ideas/index.md — a suggestion is not an idea until a human promotes it.
211
- - Never touch any other file in the repo.`}const Hu=({idea:e,otherPlans:t})=>{const n=M(f=>f.launchPlanDraft),r=M(ur),{state:s,errorMessage:i,run:o}=TC(),{toast:a}=He(),l=()=>{const f=e.id;f&&o(async()=>{try{await n(f,xH(e,t))}catch(h){throw a({title:"Draft failed",description:We(h.message),variant:"error"}),h}})},c=s==="loading"?"Drafting…":s==="success"?"Draft sent!":s==="error"?"Draft failed":"Draft plan",u=s==="error"?i??"Draft failed":e.id?r?void 0:"No agent CLI found — set up in Settings":"Idea needs an ID before an agent can run";return d.jsx(be,{content:u,children:d.jsx(se,{variant:"ghost",size:"small",onClick:l,disabled:s==="loading"||!e.id||!r,className:s==="error"?"text-watercolor-rose-dark":"text-ink-500",children:c})})},wH=({children:e,collapsedLines:t=3,resetKey:n})=>{const r=b.useRef(null),[s,i]=b.useState(!1),[o,a]=b.useState(!1);return b.useLayoutEffect(()=>i(!1),[n]),b.useLayoutEffect(()=>{if(s)return;const l=r.current;if(!l)return;const c=()=>a(l.scrollHeight-l.clientHeight>1);c();const u=new ResizeObserver(c);return u.observe(l),()=>u.disconnect()},[s,n]),d.jsxs("div",{children:[d.jsx("div",{ref:r,className:s?void 0:`line-clamp-[${t}]`,children:e}),o&&d.jsx("button",{type:"button",onClick:()=>i(l=>!l),"aria-expanded":s,className:"self-start bg-none bg-transparent border-none py-1 px-0 [font:inherit] text-xs opacity-60 cursor-pointer underline",children:s?"Show less":"Show more"})]})},kf=new Map,X0=new Map,bH=e=>`commit-draft:${e}`;function kH(e,t){const{formKey:n,suggestedTitle:r,matchesSuggestionTask:s,beforeCommit:i}=t,o=M(j=>j.agentStatus),a=M(j=>j.loadGitStatus),l=M(j=>j.commitInFlight),c=M(j=>j.setCommitInFlight),{toast:u}=He(),[f,h]=b.useState(""),[p,m]=b.useState(""),[g,w]=b.useState(!1),[y,x]=b.useState(!1),[v,k]=b.useState(null),C=b.useMemo(()=>e.map(j=>j.path),[e]),S=b.useMemo(()=>e.filter(j=>j.staged).length,[e]);b.useEffect(()=>{r&&!f&&h(r)},[r,f]);const P=bH(n);b.useEffect(()=>{const j=Fa(P);h((j==null?void 0:j.title)??""),m((j==null?void 0:j.message)??"")},[P]),b.useEffect(()=>{!f&&!p||Oa(P,{title:f,message:p})},[P,f,p]),b.useEffect(()=>{const j=kf.get(n)??Date.now();kf.set(n,j);const R=X0.get(n)??new Set,I=o.find(D=>s(D)&&D.suggestedCommit&&!R.has(D.id)&&(D.lastStreamAt??0)>j);I!=null&&I.suggestedCommit&&(R.add(I.id),X0.set(n,R),h(I.suggestedCommit.title),m(I.suggestedCommit.message))},[o,n,s]);const T=b.useCallback(async()=>{if(!f.trim()||l)return;w(!0),c(!0);let j;try{const R=i?await i(f.trim()):void 0;j=R==null?void 0:R.onFailure;const I=R==null?void 0:R.extraPath;if(S>0)I&&await O4(I),await ep([],f.trim(),p.trim()||void 0);else{const D=I&&!C.includes(I)?[...C,I]:C;await ep(D,f.trim(),p.trim()||void 0)}h(""),m(""),kf.set(n,Date.now()),rg(P),await a()}catch(R){j&&await j(),u({title:"Commit failed",description:We(R.message),variant:"error"}),await a()}finally{w(!1),c(!1)}},[f,p,C,S,a,l,c,u,n,P,i]),E=b.useCallback(async()=>{if(C.length!==0){x(!0),k(null);try{const j=await hS(C);h(j.title),m(j.message)}catch(j){k(j.message)}finally{x(!1)}}},[C]);return{commitTitle:f,setCommitTitle:h,commitMessage:p,setCommitMessage:m,committing:g,commitInFlight:l,stagedCount:S,suggesting:y,suggestError:v,setSuggestError:k,handleCommit:T,handleSuggestFromChanges:E}}const J0=(e,t)=>{var n;return((n=e.find(r=>r.name===t))==null?void 0:n.status)??"stale"};function AC(e,t){var n;return{qualityStatus:J0(t,"lint"),testStatus:J0(t,"test"),consistencyStatus:((n=e==null?void 0:e.consistency)==null?void 0:n.status)??"stale"}}const _H=["core","cli","app","server","agent","plans","ideas","docs","settings","stack","ui","ci","config","deps","repo"];function SH(e){var r;if(e.phases.length>0&&e.phases.every(s=>s.done))return{title:""};const t=((r=e.tags)==null?void 0:r.find(s=>_H.includes(s)))??"repo";return{title:`${e.kind??"feat"}(${t}): ${e.title}`}}const CH={pass:"success",fail:"error",running:"warning",stale:"neutral"},_f=({label:e,status:t,title:n,anyRunning:r,onClick:s})=>d.jsx(be,{content:n,children:d.jsx("button",{type:"button",className:`inline-flex bg-none bg-transparent border-none p-0 enabled:hover:-translate-y-px enabled:hover:brightness-[1.15] enabled:active:translate-y-0 enabled:active:brightness-[0.95] ${r?"cursor-not-allowed":"cursor-pointer"} ${r&&t!=="running"?"opacity-50":"opacity-100"}`,onClick:()=>{r||s()},disabled:r,children:d.jsxs(_e,{size:"small",variant:CH[t],children:[e,d.jsx("span",{className:t==="running"?"visible":"invisible",children:"…"})]})})}),jH=()=>{const e=M(g=>g.status),t=M(g=>g.runConsistencyCheck),{checks:n,run:r}=Va(),s=M(g=>g.consistency),i=M(g=>g.plans),o=mt(),[a,l]=b.useState(!1),{qualityStatus:c,testStatus:u,consistencyStatus:f}=b.useMemo(()=>AC(e,n),[e,n]),h=c==="running"||u==="running"||f==="running",p=s.length>0,m=b.useCallback(g=>g.planId?i==null?void 0:i.entries.find(w=>w.id===g.planId):void 0,[i==null?void 0:i.entries]);return d.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[d.jsx(_f,{label:"Quality",status:c,title:"Code style & formatting (Biome lint + format). Click to run.",anyRunning:h,onClick:()=>r("lint")}),d.jsx(_f,{label:"Tests",status:u,title:"Unit tests (Vitest). Click to run.",anyRunning:h,onClick:()=>r("test")}),d.jsx(_f,{label:"Consistency",status:f,title:"Dead code & architecture (Knip + dependency-cruiser). Click to run.",anyRunning:h,onClick:()=>t()}),d.jsxs("div",{children:[d.jsx(be,{content:p?"Plan/idea doc findings — orphan subjects, title style & stale references. Click to show.":"Plan/idea docs — no findings (orphan subjects, title style, stale references).",children:d.jsx("button",{type:"button",className:`inline-flex bg-none bg-transparent border-none p-0 ${p?"enabled:hover:-translate-y-px enabled:hover:brightness-[1.15] enabled:active:translate-y-0 enabled:active:brightness-[0.95] cursor-pointer":"cursor-default"}`,disabled:!p,"aria-expanded":p?a:void 0,"aria-controls":"deliver-doc-findings",onClick:()=>{p&&l(g=>!g)},children:d.jsx(_e,{size:"small",variant:p?"error":"success",children:"Docs"})})}),a&&p&&d.jsx("div",{id:"deliver-doc-findings",className:"mt-2 flex flex-col gap-2",children:s.map((g,w)=>{const y=m(g);return d.jsx("div",{className:"font-mono text-2xs opacity-70",children:y?d.jsx("button",{type:"button",onClick:()=>o({to:"/plans/$planId",params:{planId:Ns(y.id,y.title)}}),className:"bg-none bg-transparent border-none p-0 underline cursor-pointer [font:inherit] text-left",children:g.message}):d.jsx("span",{className:"text-left",children:g.message})},`${g.kind}-${g.title}-${w}`)})})]}),d.jsx(J5,{})]})},PH=({count:e})=>{const t=mt();return d.jsxs("button",{type:"button",onClick:()=>t({to:"/git"}),className:"bg-none bg-transparent border-none p-0 font-handwritten text-xs opacity-[0.6] underline cursor-pointer",children:[e," file",e===1?"":"s"," changed"]})},EH=(e,t)=>{const n=M(w=>w.status),{checks:r}=Va(),s=M($u),i=M(w=>w.launchRunAll),{patch:o}=Zi(),[a,l]=b.useState(!1),{title:c}=b.useMemo(()=>SH(e),[e]),u=b.useMemo(()=>t.map(w=>w.path),[t]),f=b.useCallback(async w=>{if(!e.id||N5(u))return{};const y=e.id;return await o(e.title,{phases:T5(e.phases,w)})?{extraPath:R5(y),onFailure:async()=>{await o(e.title,{phases:e.phases})}}:{}},[e,u,o]),h=b.useCallback(w=>w.planId===e.id,[e.id]),p=kH(t,{formKey:e.id??"__plan-draft__",suggestedTitle:c,matchesSuggestionTask:h,beforeCommit:f}),m=!!e.id&&!s,g=b.useCallback(async()=>{if(!e.id||!n||a||s)return;const w=e.id;l(!0);try{const y=j5(e.fixes??[],n,r);await o(e.title,{fixes:y})&&await i(w)}finally{l(!1)}},[e,a,s,n,r,o,i]);return{...p,canFix:m,fixing:a,handleFix:g}},TH=({state:e,filesEmpty:t})=>{const n=M(l=>l.status),{checks:r}=Va(),{qualityStatus:s,testStatus:i,consistencyStatus:o}=b.useMemo(()=>AC(n,r),[n,r]);return s==="fail"||i==="fail"||o==="fail"?d.jsx(se,{size:"small",disabled:!e.canFix||e.fixing,onClick:e.handleFix,children:e.fixing?"Fixing…":"Fix"}):d.jsx(se,{size:"small",disabled:t||!e.commitTitle.trim()||e.committing||e.commitInFlight,onClick:e.handleCommit,children:e.committing||e.commitInFlight?"Committing…":e.stagedCount>0?`Commit ${e.stagedCount} staged`:"Commit"})},NH=()=>{const e=M(t=>t.gitAhead);return d.jsxs("div",{className:"flex flex-col items-start gap-3",children:[d.jsx("p",{className:"m-0 text-xs opacity-50",children:e>0?`All changes committed — ${e} commit${e===1?"":"s"} ready to push.`:"No changed files."}),d.jsx(eV,{})]})},RH={review:"review",note:"note",decision:"decision",question:"question",clarification:"clarification"},AH=({messages:e,undo:t,undoing:n,onUndo:r,onPromote:s,promotingIndex:i})=>d.jsx(d.Fragment,{children:e.map((o,a)=>{const l=RH[o.kind],c=o.from==="agent",u=a===e.length-1,f=[{id:"decision",label:"Promote to decision",icon:d.jsx(tS,{size:16}),onSelect:()=>s==null?void 0:s(a,"decision")},{id:"log",label:"Promote to log",icon:d.jsx(Xm,{size:16}),onSelect:()=>s==null?void 0:s(a,"log")},{id:"idea",label:"Promote to idea",icon:d.jsx(eS,{size:16}),onSelect:()=>s==null?void 0:s(a,"idea")}];return d.jsxs("div",{className:`flex flex-col gap-1 ${c?"items-start":"items-end"}`,children:[d.jsx("div",{className:"max-w-[85%]",children:d.jsx(de,{size:"small",surface:"paper",texture:c?"kraft":l?"canvas":"parchment",shade:c,accent:!c,accentColor:l?"rose":"blue",children:d.jsx(wH,{collapsedLines:o.kind==="chat"?1:3,resetKey:`${o.kind}-${o.date??""}-${a}`,children:o.text})})}),d.jsxs("div",{className:"flex items-center gap-2",children:[c&&d.jsx(_e,{size:"small",fillColor:"rgba(0,0,0,0.06)",children:"agent"}),c&&u&&t&&d.jsx(be,{content:"Revert this run's plan edit",children:d.jsx(se,{size:"small",variant:"ghost",onClick:r,disabled:n,children:n?"Undoing…":"Undo"})}),o.date&&d.jsx("span",{className:"text-sm font-semibold opacity-[0.45]",children:o.date}),l&&d.jsx(_e,{size:"small",fillColor:"rgba(0,0,0,0.06)",children:l}),s&&o.kind==="chat"&&(i===a?d.jsx(ar,{size:"small",label:"Promoting…"}):d.jsx(lS,{align:"end",trigger:d.jsx(ot,{icon:d.jsx(dS,{size:14}),label:"Promote this message",size:"small",variant:"ghost"}),items:f}))]})]},`${o.kind}-${o.date??""}-${a}`)})}),rs=({id:e})=>e?d.jsx(_e,{size:"small",fillColor:"rgba(0,0,0,0.08)",children:e}):null,IC={"in-progress":"#C89A5A",planned:"#6A9B72",idea:"#8A9BAA",review:"#9B7AB5",done:"#8A7A8A",dropped:"#A06060"},Sg={idea:"Idea",planned:"Planned","in-progress":"In progress",review:"Review",done:"Done",dropped:"Dropped"},lr={idea:{fill:"rgba(138, 155, 168, 0.25)",text:"#5E7080"},planned:{fill:"rgba(143, 185, 150, 0.25)",text:"#5E8A66"},"in-progress":{fill:"rgba(212, 163, 115, 0.25)",text:"#A67B4F"},review:{fill:"rgba(155, 122, 181, 0.25)",text:"#7B5E9E"},done:{fill:"rgba(168, 155, 168, 0.25)",text:"#6E5E6E"},dropped:{fill:"rgba(201, 139, 139, 0.25)",text:"#6E3A3A"}},MC={open:"Open",done:"Done",dropped:"Dropped"},iu={open:{fill:"rgba(143, 185, 150, 0.25)",text:"#5E8A66"},done:{fill:"rgba(168, 155, 168, 0.25)",text:"#6E5E6E"},dropped:{fill:"rgba(201, 139, 139, 0.25)",text:"#6E3A3A"}},IH={draft:"Draft",open:"Open",closed:"Closed",merged:"Merged"},Z0={draft:{fill:"rgba(138, 155, 168, 0.25)",text:"#5E7080"},open:{fill:"rgba(143, 185, 150, 0.25)",text:"#5E8A66"},closed:{fill:"rgba(201, 139, 139, 0.25)",text:"#6E3A3A"},merged:{fill:"rgba(155, 122, 181, 0.25)",text:"#7B5E9E"}},MH={approved:"Approved","changes-requested":"Changes requested","review-required":"Review required"},ew={approved:{fill:"rgba(143, 185, 150, 0.25)",text:"#5E8A66"},"changes-requested":{fill:"rgba(201, 139, 139, 0.25)",text:"#6E3A3A"},"review-required":{fill:"rgba(212, 163, 115, 0.25)",text:"#A67B4F"}},tw=({pr:e,reviewing:t})=>{const n=M(s=>{var i;return((i=s.status)==null?void 0:i.prFetchedAt)??null}),r=d.jsx(_e,{size:"small",fillColor:Z0[e.state].fill,textColor:Z0[e.state].text,children:d.jsxs("span",{className:"inline-flex items-center gap-1",children:[d.jsx(A4,{}),"#",e.number," ",IH[e.state]]})});return d.jsxs("span",{className:"inline-flex items-center gap-1",children:[d.jsx("a",{href:e.url,target:"_blank",rel:"noreferrer",onClick:s=>s.stopPropagation(),className:"no-underline inline-flex",children:n!=null?d.jsx(be,{content:`Fetched from GitHub ${kS(n)}`,children:r}):r}),t&&d.jsx(ar,{size:"small",label:`Reviewing PR #${e.number}`})]})},LC=({pct:e,color:t,height:n=6})=>d.jsx(i$,{value:e,color:t,height:n}),nw=({pr:e})=>{const{reviewDecision:t,unresolvedThreadCount:n,hasNewCommentsSincePush:r}=e;return!t&&!n?null:d.jsxs("span",{className:"inline-flex items-center gap-2",children:[t&&d.jsx(_e,{size:"small",fillColor:ew[t].fill,textColor:ew[t].text,children:MH[t]}),!!n&&d.jsxs(_e,{size:"small",fillColor:lr["in-progress"].fill,textColor:lr["in-progress"].text,children:[n," unaddressed comment",n===1?"":"s",r?" · new":""]})]})},rw={fill:"rgba(143, 185, 150, 0.25)",text:"#5E8A66"},sw={fill:"rgba(0, 0, 0, 0.05)",text:"rgba(0, 0, 0, 0.35)"},Ll=({reached:e,label:t,tooltip:n,href:r})=>{const s=d.jsx(_e,{size:"small",fillColor:e?rw.fill:sw.fill,textColor:e?rw.text:sw.text,children:t}),i=r?d.jsx("a",{href:r,target:"_blank",rel:"noreferrer",onClick:o=>o.stopPropagation(),className:"no-underline inline-flex",children:s}):s;return n?d.jsx(be,{content:n,children:i}):i},Sf=()=>d.jsx("span",{className:"opacity-30","aria-hidden":"true",children:"→"}),iw=(e,t)=>`${e} ${t}${e===1?"":"s"}`;function LH(e){const t=e.match(/\(\[([0-9a-f]+)\]\((\S+)\)\)\s*$/);return t?{hash:t[1],url:t[2]}:void 0}const DH=({trail:e,released:t,reviewing:n,reviewNote:r})=>{var u,f;const{taskRuns:s,commits:i,pr:o,releaseLine:a}=e,l=a.data?LH(a.data):void 0,c=t?`Released ${t}`:l?`Released ${l.hash}`:"Release";return d.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[d.jsx(Ll,{reached:s.reached,label:s.data?iw(s.data.length,"task run"):"Tasks",tooltip:(u=s.data)==null?void 0:u.map(h=>h.taskKind).join(", ")}),d.jsx(Sf,{}),d.jsx(Ll,{reached:i.reached,label:i.data?iw(i.data.length,"commit"):"Commits",tooltip:(f=i.data)==null?void 0:f.join(`
212
- `)}),d.jsx(Sf,{}),o.data?r&&!n?d.jsx(be,{content:r,children:d.jsxs("span",{className:"inline-flex items-center gap-2",children:[d.jsx(tw,{pr:o.data,reviewing:n}),d.jsx(nw,{pr:o.data})]})}):d.jsxs(d.Fragment,{children:[d.jsx(tw,{pr:o.data,reviewing:n}),!n&&d.jsx(nw,{pr:o.data})]}):d.jsx(Ll,{reached:!1,label:"PR"}),d.jsx(Sf,{}),d.jsx(Ll,{reached:a.reached||!!t,label:c,tooltip:a.data,href:l==null?void 0:l.url})]})},DC=({open:e,onClose:t,onAdd:n,initialContent:r})=>{const[s,i]=b.useState(""),[o,a]=b.useState(""),[l,c]=b.useState(!1),[u,f]=b.useState(!1),[h,p]=b.useState(null),[m,g]=b.useState(null),[w,y]=b.useState(!1),[x,v]=b.useState(null),[k,C]=b.useState(null),S=M(A=>{var z;return((z=A.plans)==null?void 0:z.entries)??[]}),{patch:P}=Zi(),T=mt(),E=PC(s,S.map(A=>({id:A.id,title:A.title,body:A.body,tags:A.tags,log:A.log})));b.useEffect(()=>{e&&(i(""),a(r??""),c(!1),f(!1),p(null),y(!1),v(null),C(null))},[e,r]);const j=(A,z)=>{t(),T({to:"/plans/$planId",params:{planId:Ns(A,z)}})},R=async()=>{const A=`${s.trim()}${o.trim()?`
213
-
214
- ${o.trim()}`:""}`;if(A){y(!0),C(null),v(null);try{const z=S.map(O=>({id:O.id,title:O.title,body:O.body,tags:O.tags}));v(await wS(A,z))}catch(z){C(z.message)}finally{y(!1)}}},I=A=>{const z=S.find(O=>O.id===A);z&&j(z.id,z.title)},D=async(A,z,O)=>{g(A);const V={date:new Date().toISOString().slice(0,10),text:s.trim()},_=await P(z,{log:[...O??[],V]},{errorTitle:"Extend failed"});g(null),_&&t()},$=async A=>{if(A.preventDefault(),!(!s.trim()||u)){p(null),f(!0);try{await n({title:s.trim(),content:o.trim()||void 0,kind:l?"note":void 0}),t()}catch(z){p(z.message)}finally{f(!1)}}};return d.jsx(Qi,{open:e,onClose:t,title:"New idea",size:"small",children:d.jsxs("form",{onSubmit:$,className:"flex flex-col gap-4",children:[d.jsx(La,{label:"Title",value:s,onChange:A=>i(A.target.value),placeholder:"Idea title…",helperText:"Noun/verb phrase, ≤40 chars — no subtitle; the detail goes in the description below.",disabled:u,autoFocus:!0,required:!0}),E.length>0&&d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsx("span",{className:"text-sm opacity-60 font-semibold",children:"Similar ideas"}),E.map(({candidate:A})=>{const z={id:A.id??null,title:A.title,body:A.body,log:A.log},O=S.filter(L=>L.id!==A.id);return d.jsx(de,{size:"small",texture:"canvas",children:d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[d.jsx(rs,{id:A.id}),d.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:A.title})]}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(se,{type:"button",variant:"ghost",size:"small",onClick:()=>j(A.id,A.title),children:"Open it"}),d.jsx(se,{type:"button",variant:"ghost",size:"small",disabled:!A.id||!s.trim()||m!==null,onClick:()=>A.id&&D(A.id,A.title,A.log),children:m===A.id?"Extending…":"Extend it instead"}),d.jsx(Hu,{idea:z,otherPlans:O})]})]})},A.id??A.title)})]}),d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsx("div",{children:d.jsx(se,{type:"button",variant:"ghost",size:"small",disabled:!s.trim()||w,onClick:R,children:w?"Checking overlap…":"Check overlap"})}),k&&d.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:k}),x&&d.jsx(de,{size:"small",texture:"canvas",children:d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsx("span",{className:"font-semibold",children:x.verdict==="new"?"Looks genuinely new":x.verdict==="extend"?`Extends ${x.targetId??"an existing idea"}`:`Belongs inside ${x.targetId??"an existing idea"}`}),d.jsx("span",{className:"text-sm opacity-80",children:x.reasoning}),x.targetId&&d.jsx("div",{className:"flex justify-end",children:d.jsx(se,{type:"button",variant:"ghost",size:"small",onClick:()=>I(x.targetId),children:"Open it"})})]})})]}),d.jsx(Da,{label:"Description",value:o,onChange:A=>a(A.target.value),placeholder:"Optional details…",disabled:u,rows:4}),d.jsx(rz,{label:"Just a note (no plan needed)",checked:l,onChange:A=>c(A.target.checked),disabled:u}),h&&d.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:h}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(se,{type:"button",variant:"ghost",onClick:t,disabled:u,children:"Cancel"}),d.jsx(se,{type:"submit",variant:"primary",disabled:!s.trim()||u,children:"Add"})]})]})})},FH=({open:e,onClose:t,onConfirm:n})=>{const r=M(m=>{var g;return((g=m.plans)==null?void 0:g.entries)??[]}),[s,i]=b.useState([]),[o,a]=b.useState(new Set),[l,c]=b.useState(!1),[u,f]=b.useState(null);b.useEffect(()=>{if(e){const m=r.filter(g=>!!g.id&&g.phases.length===0&&g.status==="idea");i(m),a(new Set(m.map(g=>g.id))),c(!1),f(null)}},[e]);const h=m=>{a(g=>{const w=new Set(g);return w.has(m)?w.delete(m):w.add(m),w})},p=async()=>{c(!0),f(null);try{await n([...o]),t()}catch(m){f(m.message)}finally{c(!1)}};return d.jsx(Qi,{open:e,onClose:t,title:"Draft all",size:"small",children:d.jsxs("div",{className:"flex flex-col gap-4",children:[d.jsxs("p",{className:"m-0 opacity-80",children:[s.length," undrafted idea",s.length===1?"":"s"," will be turned into a plan."]}),s.length>0&&d.jsx("div",{className:"flex max-h-[16rem] flex-col gap-2 overflow-y-auto",children:s.map(m=>d.jsx(Z_,{label:m.title,checked:o.has(m.id),onChange:()=>h(m.id)},m.id))}),u&&d.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:u}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(se,{type:"button",variant:"ghost",onClick:t,disabled:l,children:"Cancel"}),d.jsx(se,{type:"button",variant:"primary",onClick:p,disabled:l||o.size===0,children:l?"Starting…":`Draft ${o.size}`})]})]})})},OH=({suggestion:e,onClose:t})=>{const n=M(u=>u.promoteSuggestion),r=M(u=>u.launchIdeaExtend),[s,i]=b.useState(!1),[o,a]=b.useState(null),{toast:l}=He();b.useEffect(()=>{e&&(i(!1),a(null))},[e]);const c=async()=>{if(e){i(!0),a(null);try{const u=await n(e),f=M.getState().ideaEntries.find(h=>h.id===u);if(f)try{await r(u,yH(f))}catch(h){l({title:"Idea created, but the refine agent failed to launch",description:We(h.message),variant:"error"})}t()}catch(u){a(u.message)}finally{i(!1)}}};return d.jsx(Qi,{open:e!==null,onClose:t,title:(e==null?void 0:e.title)??"",size:"small",children:d.jsxs("div",{className:"flex flex-col gap-4",children:[d.jsx("p",{className:"m-0 opacity-80",children:e==null?void 0:e.description}),o&&d.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:o}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(se,{type:"button",variant:"ghost",onClick:t,disabled:s,children:"Cancel"}),d.jsx(se,{type:"button",variant:"primary",onClick:c,disabled:s,children:s?"Moving…":"Move to ideas"})]})]})})},Cf=({tokens:e})=>d.jsx(d.Fragment,{children:e.map((t,n)=>{if(t.type==="same")return d.jsx("span",{children:t.text},`${t.type}-${n}`);const r=t.type==="added";return d.jsx("span",{className:r?"bg-watercolor-green/[30%] text-watercolor-green-dark no-underline":"bg-watercolor-rose/[30%] text-watercolor-rose-dark line-through",children:t.text},`${t.type}-${n}`)})}),ow=e=>d.jsx("h4",{className:"font-display-luminari text-xs font-semibold mb-2 opacity-[0.65]",children:e}),$H=({plan:e,before:t,onApprove:n,onDiscard:r,queuePosition:s})=>{const[i,o]=b.useState(!1),[a,l]=b.useState(!1),c=e.body!==t.body,u=e.phases.map((m,g)=>({phase:m,before:t.phases[g],index:g})).filter(({phase:m,before:g})=>g!==void 0&&(m.text!==g.text||(m.description??"")!==(g.description??""))),f=i||a,h=async()=>{if(!f){o(!0);try{await r()}finally{o(!1)}}},p=async()=>{l(!0);try{await n()}finally{l(!1)}};return d.jsx(Qi,{open:!0,title:s?`Review reconcile changes (${s.index} of ${s.total})`:"Review reconcile changes",size:"large",onClose:f?()=>{}:h,children:d.jsxs("div",{className:"flex flex-col gap-5",children:[d.jsxs("p",{className:"text-sm m-0 opacity-70",children:['The reconcile agent proposed the rewrite below for "',e.title,'". Approve to keep it, or discard to revert to the prior wording.']}),!c&&u.length===0&&d.jsx("p",{className:"text-sm m-0 opacity-60",children:"No wording changed."}),c&&d.jsxs("div",{children:[ow("Body"),d.jsx("p",{className:"text-base m-0 leading-normal",children:d.jsx(Cf,{tokens:rf(t.body,e.body)})})]}),u.length>0&&d.jsxs("div",{children:[ow("Phases"),d.jsx("div",{className:"flex flex-col gap-3",children:u.map(({phase:m,before:g,index:w})=>d.jsxs("div",{className:"text-sm leading-normal",children:[d.jsx(Cf,{tokens:rf(g.text,m.text)}),(m.description||g.description)&&d.jsx("div",{className:"opacity-[0.85] mt-1",children:d.jsx(Cf,{tokens:rf(g.description??"",m.description??"")})})]},w))})]}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(se,{variant:"danger",size:"small",onClick:h,disabled:f,children:"Discard"}),d.jsx(se,{variant:"primary",size:"small",onClick:p,disabled:f,children:"Approve"})]})]})})},zH=({onOpen:e})=>{const t=M(f=>f.archivableIdeas),n=M(f=>f.archiveIdeas),[r,s]=b.useState(null),[i,o]=b.useState(!1),{toast:a}=He(),l=b.useCallback(async f=>{try{await n(f)}catch(h){a({title:"Archive failed",description:h.message,variant:"error"})}},[n,a]),c=b.useCallback(async f=>{s(f.id);try{await l([f.id])}finally{s(null)}},[l]),u=b.useCallback(async()=>{o(!0);try{await l(t.map(f=>f.id))}finally{o(!1)}},[l,t]);return t.length===0?null:d.jsxs("div",{className:"mt-5",children:[d.jsxs("div",{className:"flex items-center justify-between gap-2 mb-2",children:[d.jsxs("h2",{className:"text-sm m-0 opacity-60",children:["Ready to archive (",t.length,")"]}),d.jsx(se,{variant:"ghost",size:"small",disabled:i||r!==null,onClick:u,children:i?"Archiving…":"Archive all"})]}),d.jsx("div",{className:"flex flex-col gap-1",children:t.map(f=>d.jsx("div",{className:"rounded-[10px]",children:d.jsx(de,{size:"small",texture:"canvas",className:"plan-row-card",children:d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs("div",{role:e?"button":void 0,tabIndex:e?0:void 0,onClick:e?()=>e(f):void 0,onKeyDown:e?h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),e(f))}:void 0,className:`flex items-center gap-2 flex-1 min-w-0 ${e?"cursor-pointer":""}`,children:[d.jsx(rs,{id:f.id}),d.jsx("span",{className:"font-semibold overflow-hidden text-ellipsis whitespace-nowrap",children:f.title})]}),d.jsx(se,{variant:"ghost",size:"small",disabled:r===f.id||i,onClick:()=>c(f),children:r===f.id?"Archiving…":"Archive"})]})})},f.id))})]})},BH="font-display-luminari font-semibold text-[1.75rem] leading-[1.2]";function aw(e,t){return e.toFixed(t).replace(/\.0+$/,"").replace(/(\.\d*?)0+$/,"$1")}function FC(e){const t=Math.round(e/1e3),n=Math.floor(t/3600),r=Math.floor(t%3600/60),s=t%60;return n>0?r>0?`${n}h${r}m`:`${n}h`:r>0?s>0?`${r}m${s}s`:`${r}m`:`${s}s`}function Io(e){return e>=1e6?`${aw(e/1e6,1)}M`:e>=1e3?`${aw(e/1e3,1)}k`:`${Math.round(e)}`}function VH(e,t){var s;const n={runs:0,durationMs:0,inputTokens:0,outputTokens:0,cacheCreationTokens:0,cacheReadTokens:0},r=i=>{n.runs+=1,n.durationMs+=i.durationMs,n.inputTokens+=i.inputTokens,n.outputTokens+=i.outputTokens,n.cacheCreationTokens+=i.cacheCreationTokens,n.cacheReadTokens+=i.cacheReadTokens};for(const i of e)if(!(t&&i.planId!==t))if((s=i.phaseRuns)!=null&&s.length)for(const o of i.phaseRuns)r(o.usage);else i.usage&&r(i.usage);return n}const UH=({onAdd:e,disabled:t,entityId:n})=>{const[r,s]=b.useState(!1),[i,o]=b.useState(""),[a,l]=b.useState(null),[c,u]=b.useState(!1),f=`review-phases-draft:${n}`;b.useEffect(()=>{o(Fa(f)??"")},[f]),b.useEffect(()=>{i&&Oa(f,i)},[f,i]);const h=()=>{s(!1),o(""),l(null),rg(f)},p=async()=>{let m;try{m=b5(i)}catch(g){l(g instanceof Error?g.message:"Could not parse findings");return}u(!0),l(null);try{await e(m),h()}finally{u(!1)}};return d.jsxs(d.Fragment,{children:[d.jsx(be,{content:"Add code-review findings as phases",children:d.jsx(ot,{variant:"ghost",size:"small",onClick:()=>s(!0),disabled:t,"aria-label":"Add code-review findings as phases",icon:d.jsx(M3,{size:16})})}),d.jsx(Qi,{open:r,onClose:h,title:"Add code-review findings",size:"small",children:d.jsxs("div",{className:"flex flex-col gap-4",children:[d.jsxs("p",{className:"text-sm m-0 opacity-70",children:["Paste the JSON findings from a ",d.jsx("code",{children:"/code-review"})," run. Each finding becomes a new, unchecked phase on this plan."]}),d.jsx(Da,{value:i,onChange:m=>o(m.target.value),placeholder:'[{ "description": "...", "file": "src/foo.ts", "line_start": 12, "failure_scenario": "..." }]',rows:10,disabled:c}),a&&d.jsxs(iS,{variant:"warning",children:["Could not add phases — ",a]}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(se,{type:"button",variant:"ghost",onClick:h,disabled:c,children:"Cancel"}),d.jsx(se,{type:"button",variant:"primary",onClick:p,disabled:c||!i.trim(),children:"Add phases"})]})]})})]})},WH=r5.map(e=>({value:e,label:e})),HH=({open:e,onClose:t,onAdd:n})=>{const[r,s]=b.useState(""),[i,o]=b.useState(""),[a,l]=b.useState("feat"),[c,u]=b.useState(!1),[f,h]=b.useState(null),[p,m]=b.useState(null),[g,w]=b.useState(!1),[y,x]=b.useState(null),[v,k]=b.useState(null),C=M(A=>{var z;return((z=A.plans)==null?void 0:z.entries)??[]}),{patch:S}=Zi(),P=mt(),{toast:T}=He(),E=PC(r,C.map(A=>({id:A.id,title:A.title,body:A.body,tags:A.tags,log:A.log})));b.useEffect(()=>{e&&(s(""),o(""),l("feat"),u(!1),h(null),w(!1),x(null),k(null))},[e]),b.useEffect(()=>{x(null),k(null)},[r,i]);const j=(A,z)=>{t(),P({to:"/plans/$planId",params:{planId:Ns(A,z)}})},R=async()=>{const A=`${r.trim()}${i.trim()?`
215
-
216
- ${i.trim()}`:""}`;if(A){w(!0),k(null),x(null);try{const z=C.map(O=>({id:O.id,title:O.title,body:O.body,tags:O.tags}));x(await wS(A,z))}catch(z){k(z.message)}finally{w(!1)}}},I=A=>{const z=C.find(O=>O.id===A);z?j(z.id,z.title):T({title:"Plan not found",description:`No plan with id ${A}`,variant:"error"})},D=async(A,z,O)=>{m(A);const V={date:new Date().toISOString().slice(0,10),text:r.trim()},_=await S(z,{log:[...O??[],V]},{errorTitle:"Extend failed"});m(null),_&&t()},$=async A=>{if(A.preventDefault(),!(!r.trim()||c)){h(null),u(!0);try{await n({title:r.trim(),content:i.trim()||void 0,kind:a}),t()}catch(z){h(z.message)}finally{u(!1)}}};return d.jsx(Qi,{open:e,onClose:t,title:"Quick plan",size:"small",children:d.jsxs("form",{onSubmit:$,className:"flex flex-col gap-4",children:[d.jsx(La,{label:"Title",value:r,onChange:A=>s(A.target.value),placeholder:"Backlog item title…",helperText:"Noun/verb phrase, ≤40 chars — no subtitle; the detail goes in the description below.",disabled:c,autoFocus:!0,required:!0}),E.length>0&&d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsx("span",{className:"text-sm opacity-60 font-semibold",children:"Similar ideas"}),E.map(({candidate:A})=>{const z={id:A.id??null,title:A.title,body:A.body,log:A.log},O=C.filter(L=>L.id!==A.id);return d.jsx(de,{size:"small",texture:"canvas",children:d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[d.jsx(rs,{id:A.id}),d.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:A.title})]}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(se,{type:"button",variant:"ghost",size:"small",onClick:()=>j(A.id,A.title),children:"Open it"}),d.jsx(se,{type:"button",variant:"ghost",size:"small",disabled:!A.id||!r.trim()||p!==null,onClick:()=>A.id&&D(A.id,A.title,A.log),children:p===A.id?"Extending…":"Extend it instead"}),d.jsx(Hu,{idea:z,otherPlans:O})]})]})},A.id??A.title)})]}),d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsx("div",{children:d.jsx(se,{type:"button",variant:"ghost",size:"small",disabled:!r.trim()||g,onClick:R,children:g?"Checking overlap…":"Check overlap"})}),v&&d.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:v}),y&&d.jsx(de,{size:"small",texture:"canvas",children:d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsx("span",{className:"font-semibold",children:y.verdict==="new"?"Looks genuinely new":y.verdict==="extend"?`Extends ${y.targetId??"an existing idea"}`:`Belongs inside ${y.targetId??"an existing idea"}`}),d.jsx("span",{className:"text-sm opacity-80",children:y.reasoning}),y.targetId&&d.jsx("div",{className:"flex justify-end",children:d.jsx(se,{type:"button",variant:"ghost",size:"small",onClick:()=>I(y.targetId),children:"Open it"})})]})})]}),d.jsx(rS,{label:"Kind",value:a,onChange:A=>l(A),options:WH,disabled:c}),d.jsx(Da,{label:"Description",value:i,onChange:A=>o(A.target.value),placeholder:"Optional details…",disabled:c,rows:4}),f&&d.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:f}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(se,{type:"button",variant:"ghost",onClick:t,disabled:c,children:"Cancel"}),d.jsx(se,{type:"submit",variant:"primary",disabled:!r.trim()||c,children:"Add"})]})]})})},GH=()=>d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("path",{d:"M10 6h10M10 12h10M10 18h10"}),d.jsx("path",{d:"M3 6l1.5 1.5L7 5M3 12l1.5 1.5L7 11M3 18l1.5 1.5L7 17"})]}),KH=()=>{const e=M(o=>o.loadPlans),t=M(o=>o.gitBranchHygiene),[n,r]=b.useState(!1),s=t==="stale-merged",i=async o=>{await UB(o),await e(),r(!1)};return d.jsxs(d.Fragment,{children:[d.jsx(be,{content:s?"Switch to main first":void 0,children:d.jsx(ot,{icon:d.jsx(GH,{}),variant:"ghost",size:"small",label:s?"Switch to main first":"Quick plan",disabled:s,onClick:()=>r(!0)})}),d.jsx(HH,{open:n,onClose:()=>r(!1),onAdd:i})]})},YH=({planId:e,phaseIndex:t,disabled:n})=>{const r=M(u=>u.launchAgent),s=M(ur),{toast:i}=He(),[o,a]=b.useState(!1),l=async u=>{if(u.stopPropagation(),!!e){a(!0);try{await r(e,t)}catch(f){i({title:"Failed to start agent",description:We(f.message),variant:"error"})}finally{a(!1)}}},c=e?s?"Start agent on this phase":"No agent CLI found — set up in Settings":"Plan needs an ID before an agent can run";return d.jsx(ot,{icon:d.jsx("span",{className:"text-xs leading-none",children:"▶"}),variant:"ghost",size:"small",label:c,onClick:l,disabled:n||o||!e||!s,className:"text-ink-500"})},qH=({plan:e,disabled:t})=>{const n=M(l=>l.launchPlanAudit),r=M(ur),[s,i]=b.useState(!1),o=async()=>{if(e.id){i(!0);try{await n(e.id,pH(e))}catch(l){alert(l.message)}finally{i(!1)}}},a=e.id?r?void 0:"No agent CLI found — set up in Settings":"Plan needs an ID before an agent can run";return d.jsx(be,{content:a,children:d.jsx(se,{variant:"ghost",size:"small",onClick:o,disabled:t||s||!e.id||!r,children:"Audit"})})},Cg=({idea:e,compact:t})=>{const n=M(h=>h.launchIdeaExtend),r=M(ur),{state:s,errorMessage:i,run:o}=TC(),{toast:a}=He(),l=e.id,c=()=>{l&&o(async()=>{const h=M.getState().ideaEntries.find(p=>p.id===l);if(!h)throw new Error(`Idea ${l} not found`);try{await n(l,gH(h))}catch(p){throw a({title:"Extension failed",description:We(p.message),variant:"error"}),p}})},u=s==="loading"?"Extending…":s==="success"?t?"Sent!":"Extension sent!":s==="error"?"Extension failed":t?"Extend":"Extend with AI",f=s==="error"?i??"Extension failed":l?r?void 0:"No agent CLI found — set up in Settings":"Idea needs an ID before an agent can run";return d.jsx(be,{content:f,children:d.jsx(se,{variant:"ghost",size:"small",onClick:c,disabled:s==="loading"||!l||!r,className:s==="error"?"text-watercolor-rose-dark":void 0,children:u})})},QH=({plan:e,disabled:t})=>{const n=M(u=>u.launchFixReview),r=M(ur),s=M(IS),[i,o]=b.useState(!1),a=async()=>{if(e.id){o(!0);try{await n(e.id)}catch(u){alert(u.message)}finally{o(!1)}}},l=t||i||!e.id||!r||!s,c=e.id?s?r?void 0:"No agent CLI found — set up in Settings":"GitHub CLI needs authentication — set up in Settings":"Plan needs an ID before an agent can run";return d.jsx(be,{content:c,children:d.jsx(Dn,{size:"small",icon:d.jsx("span",{className:"text-watercolor-amber-dark",children:"⚑"}),onClick:a,disabled:l,className:`text-xs leading-4 py-2 ${l?"opacity-50":""}`,children:i?"Starting…":"Fix review comments"})})},XH=()=>{const e=M(s=>s.loadIdeas),[t,n]=b.useState(!1),r=async s=>{await vS(s),await e(),n(!1)};return d.jsxs(d.Fragment,{children:[d.jsx(se,{icon:d.jsx(eS,{size:16}),size:"small",onClick:()=>n(!0),children:"New idea"}),d.jsx(DC,{open:t,onClose:()=>n(!1),onAdd:r})]})};function JH(e){const[t,n]=b.useState(null),r=b.useCallback(async()=>{n(e?await mB(e):null)},[e]);return b.useEffect(()=>{r()},[r]),b.useEffect(()=>{let s;const i=Ba(o=>{o.message==="changed"&&(s&&clearTimeout(s),s=setTimeout(r,250))});return()=>{s&&clearTimeout(s),i()}},[r]),t}const ZH=({plan:e,disabled:t})=>{const n=M(m=>m.launchPrReview),r=M(ur),s=M(IS),[i,o]=b.useState(!1),a=JH(e.id),l=async()=>{if(e.id){o(!0);try{await n(e.id)}catch(m){alert(m.message)}finally{o(!1)}}},c=t||i||!e.id||!r||!s,u=e.id?s?r?void 0:"No agent CLI found — set up in Settings":"GitHub CLI needs authentication — set up in Settings":"Plan needs an ID before an agent can run",f=!!(a!=null&&a.lastReviewedSha&&a.headSha&&a.lastReviewedSha===a.headSha),h=i?"Starting…":f?`Review again — last reviewed at ${((a==null?void 0:a.lastReviewedSha)??"").slice(0,7)}`:"Review PR",p=[a&&!a.ready&&"draft",(a==null?void 0:a.ciGreen)===!1&&"CI not green"].filter(Boolean);return d.jsxs("div",{className:"flex flex-col gap-0.5",children:[d.jsx(be,{content:u,children:d.jsx(Dn,{size:"small",icon:d.jsx("span",{className:"text-watercolor-blue-dark",children:"◎"}),onClick:l,disabled:c,className:`text-xs leading-4 py-2 ${c?"opacity-50":""}`,children:h})}),p.length>0&&d.jsx("div",{className:"text-2xs text-ink-300 px-2",children:p.join(" · ")})]})},e7=({plan:e,disabled:t})=>{const n=M(l=>l.launchPlanReconcile),r=M(ur),[s,i]=b.useState(!1),o=async()=>{if(e.id){i(!0);try{await n(e.id,mH(e),{body:e.body,phases:e.phases})}catch(l){alert(l.message)}finally{i(!1)}}},a=e.id?r?void 0:"No agent CLI found — set up in Settings":"Plan needs an ID before an agent can run";return d.jsx(be,{content:a,children:d.jsx(se,{variant:"ghost",size:"small",onClick:o,disabled:t||s||!e.id||!r,children:"Refresh"})})},t7=({plan:e,disabled:t})=>{const n=M(c=>c.launchRunAll),r=M(ur),[s,i]=b.useState(!1),o=async()=>{if(e.id){i(!0);try{await n(e.id)}catch(c){alert(c.message)}finally{i(!1)}}},a=t||s||!e.id||!r,l=e.id?r?void 0:"No agent CLI found — set up in Settings":"Plan needs an ID before an agent can run";return d.jsx(be,{content:l,children:d.jsx(Dn,{size:"small",icon:d.jsx("span",{className:"text-ink-500",children:"▶"}),onClick:o,disabled:a,className:`text-xs leading-4 py-2 ${a?"opacity-50":""}`,children:s?"Starting…":"Run all phases"})})},n7=()=>{const e=M(v=>v.launchSuggestIdeas),t=M(v=>v.launchBatchReconcile),n=M(v=>v.launchBatchDraft),r=M(v=>v.launchPrioritise),s=M(v=>v.ideaEntries),i=M(v=>v.suggestions),o=M($u),a=M(ur),{toast:l}=He(),[c,u]=b.useState(null),[f,h]=b.useState(!1),p=async()=>{u("suggest");try{await e(vH(s,i))}catch(v){l({title:"Failed to launch",description:We(v.message),variant:"error"})}finally{u(null)}},m=async()=>{u("reconcile");try{await t()}catch(v){l({title:"Failed to launch",description:We(v.message),variant:"error"})}finally{u(null)}},g=async v=>{u("draft-all");try{await n(v)}finally{u(null)}},w=async()=>{u("prioritise");try{const v=await r();l({title:v.moved.length>0?"Queue reordered":"Already in order",description:v.why||void 0,variant:"success"})}catch(v){l({title:"Failed to prioritise",description:We(v.message),variant:"error"})}finally{u(null)}},y=c!==null||o,x=[{id:"suggest-ideas",label:c==="suggest"?"Starting…":"Suggest ideas",icon:d.jsx(cS,{size:16}),disabled:y||!a,onSelect:p},{id:"reconcile-all",label:c==="reconcile"?"Starting…":"Reconcile all",icon:d.jsx(tS,{size:16}),disabled:y||!a,onSelect:m},{id:"draft-all",label:"Draft all",icon:d.jsx(Xm,{size:16}),disabled:y||!a,onSelect:()=>h(!0)},{id:"prioritise",label:c==="prioritise"?"Prioritising…":"Prioritise queue",icon:d.jsx(P4,{size:16}),disabled:y||!a,onSelect:w}];return d.jsxs(d.Fragment,{children:[d.jsx(lS,{align:"end",trigger:d.jsx(ot,{icon:d.jsx(dS,{size:16}),label:"More actions",size:"small",variant:"ghost"}),items:x}),d.jsx(FH,{open:f,onClose:()=>h(!1),onConfirm:g})]})};function r7(e){const t=e==null?void 0:e.match(/^[a-z]+\/([a-z]+-\d+)-/);return t?t[1].toUpperCase():null}const Gu="font-display-luminari text-sm font-semibold opacity-[0.65]",s7=({rollup:e})=>e.runs===0?null:d.jsxs("div",{className:"flex items-center gap-2 text-xs opacity-[0.55] flex-wrap flex-shrink-0 ml-auto",children:[d.jsx("span",{className:"font-semibold opacity-[0.85]",children:"Run cost"}),d.jsx("span",{"aria-hidden":!0,children:"·"}),d.jsxs("span",{children:[e.runs," ",e.runs===1?"run":"runs"]}),d.jsx("span",{"aria-hidden":!0,children:"·"}),d.jsx("span",{children:FC(e.durationMs)}),d.jsx("span",{"aria-hidden":!0,children:"·"}),d.jsx(be,{content:`Cache: ${Io(e.cacheCreationTokens)} write · ${Io(e.cacheReadTokens)} read`,children:d.jsxs("span",{children:[Io(e.inputTokens)," in · ",Io(e.outputTokens)," out"]})})]}),i7=({plan:e,auditRunning:t,agentBusy:n,runningFill:r,updating:s,onTogglePhase:i,onToggleFix:o,onAddReviewPhases:a})=>{const l=M(p=>p.launchRunAll),c=e.fixes??[],u=c.some(p=>!p.done),f=[...e.phases.map((p,m)=>({kind:"phase",item:p,index:m})),...c.map((p,m)=>({kind:"fix",item:p,index:m}))],h=p=>p.kind==="phase"&&!p.item.done&&(r==null?void 0:r.index)===p.index;return d.jsx("div",{className:"mb-8",style:r?{"--phase-fill":`${r.fraction*100}%`}:void 0,children:d.jsx(kF,{data:f,toolbar:{title:d.jsx("h3",{className:`${Gu} m-0`,children:"Phases"}),actions:d.jsxs(d.Fragment,{children:[t&&d.jsx(ar,{size:"small",label:"Audit running…"}),(e.status==="review"||e.status==="done")&&d.jsx(qH,{plan:e}),e.status!=="done"&&d.jsx(e7,{plan:e}),d.jsx(UH,{onAdd:a,disabled:s,entityId:e.id??e.title}),e.id&&u&&d.jsx(be,{content:"Run the open fixes with an agent",children:d.jsx(se,{size:"small",onClick:()=>e.id&&l(e.id),disabled:n,children:n?"Running…":"Run fixes"})})]})},panelFooter:d.jsx(OC,{plan:e}),columns:[{key:"checkbox",header:"",cell:p=>h(p)?d.jsx(ar,{size:"small"}):d.jsx(Z_,{checked:p.item.done,onChange:()=>p.kind==="phase"?i(p.index):o(p.index),disabled:s}),width:1},{key:"title",header:"Title",cell:p=>d.jsxs("span",{className:`inline-flex min-w-0 max-w-full items-center gap-2 ${p.item.done?"line-through opacity-[0.45]":"no-underline"}`,children:[d.jsx("span",{title:p.item.text,className:"overflow-hidden text-ellipsis whitespace-nowrap font-handwritten text-base leading-tight",children:p.item.text}),h(p)&&d.jsxs("span",{className:"text-xs opacity-[0.55]",children:[Math.round(((r==null?void 0:r.fraction)??0)*100),"%"]}),p.kind==="phase"&&p.item.source==="review"&&d.jsx(_e,{size:"small",fillColor:lr.review.fill,textColor:lr.review.text,children:"review"}),p.kind==="phase"&&p.item.source==="manual"&&d.jsx(_e,{size:"small",variant:"neutral",children:"manual"}),p.kind==="fix"&&d.jsx(_e,{size:"small",variant:"warning",children:"fix"})]})},{key:"actions",header:"",align:"end",cell:p=>h(p)?null:p.item.done?p.item.run?d.jsx("div",{className:"flex justify-end",children:d.jsx(_e,{size:"small",fillColor:"var(--pui-texture-shade, rgba(0,0,0,0.06))",textColor:"inherit",children:d.jsxs("span",{className:"whitespace-nowrap font-mono text-3xs font-normal opacity-[0.7]",children:[Io(p.item.run.inputTokens+p.item.run.outputTokens)," tokens · ",FC(p.item.run.durationMs),p.item.run.attempts>1&&` ×${p.item.run.attempts}`,p.item.run.model&&` · ${p.item.run.model}`]})})}):null:p.kind!=="phase"?null:d.jsx("div",{className:"flex justify-end",children:d.jsx(YH,{planId:e.id,phaseIndex:p.index,disabled:n})}),width:5}],expandable:{render:p=>p.item.description||null},hideHeader:!0,density:"compact",showExpandColumn:!1,rowTexture:p=>{if(p.kind==="fix")return"kraft";if(p.kind==="phase"&&p.item.done)return"canvas"},rowClassName:p=>{if(h(p))return"phase-running-row";if(p.kind==="phase"&&p.item.source==="review")return"bg-[rgba(155,122,181,0.08)]"},className:"phase-table-phone"})})},o7=({plan:e,gitBranch:t,onOwnBranch:n,branching:r,onCreateBranch:s})=>{const i=e.status==="planned"||e.status==="in-progress"||e.status==="review";return i?d.jsxs("div",{className:"flex items-center gap-3 flex-wrap mb-3 min-h-8",children:[i&&!n&&d.jsx(de,{size:"small",accent:!0,accentColor:"amber",texture:"kraft",children:d.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[d.jsxs("span",{className:"text-xs",children:[d.jsx("code",{children:t??"unknown"})," — not this plan's branch."]}),e.id&&d.jsx(be,{content:`Creates ${(e.kind??"feat").toLowerCase()}/${e.id.toLowerCase()}-… from main, or switches to it if it already exists`,children:d.jsx(se,{size:"small",onClick:s,disabled:r,children:r?"Switching…":"Create branch"})})]})}),i&&n&&d.jsx(de,{size:"small",texture:"paper",children:d.jsx("span",{className:"text-xs opacity-[0.6]",children:d.jsx("code",{children:t})})})]}):null},a7=({progress:e,color:t,rollup:n})=>e===null&&n.runs===0?null:d.jsxs("div",{className:"flex items-center gap-3 mb-3 flex-wrap",children:[e!==null&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"flex-1 min-w-24",children:d.jsx(LC,{pct:e.pct,color:t})}),d.jsxs("span",{className:"text-sm opacity-50 flex-shrink-0",children:[Math.round(e.pct),"%"]})]}),d.jsx(s7,{rollup:n})]}),l7=({plan:e})=>{const[t,n]=b.useState(!1);return b.useEffect(()=>n(!1),[e.id,e.title]),e.body?d.jsx("div",{className:"mb-4",children:d.jsx(j$,{title:d.jsx("span",{className:Gu,children:"Description"}),expanded:t,onToggle:()=>n(r=>!r),children:d.jsx("div",{className:"opacity-[0.85]",children:d.jsx(gC,{children:e.body})})})}):null},c7=({clarifications:e})=>e.length===0?null:d.jsxs("div",{className:"mb-5",children:[d.jsx("h3",{className:`${Gu} mb-3`,children:"Clarifications"}),d.jsx("div",{className:"flex flex-col gap-2 mb-3",children:e.map((t,n)=>d.jsx("div",{className:"text-sm flex items-start justify-between gap-3 opacity-75",children:d.jsxs("span",{children:[d.jsx("span",{className:"font-semibold mr-2",children:t.date}),t.text]})},`clar-${t.date}-${n}`))})]}),OC=({plan:e})=>{const t=M(i=>i.gitStatus),n=b.useMemo(()=>(t==null?void 0:t.map(i=>({path:i.path,staged:i.staged})))??[],[t]),r=EH(e,n),s=n.length>0;return d.jsxs("div",{className:"grid grid-cols-1 items-start gap-x-6 gap-y-2 md:grid-cols-[minmax(0,1fr)_auto_16rem]",children:[d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsx(jH,{}),s&&d.jsx(I4,{state:r,filesEmpty:!s})]}),d.jsx(Ou,{orientation:"vertical",className:"hidden md:block"}),d.jsx("div",{className:"flex flex-col gap-2",children:s?d.jsxs(d.Fragment,{children:[d.jsx(PH,{count:n.length}),d.jsx(TH,{state:r,filesEmpty:!s})]}):d.jsx(NH,{})})]})},u7=({planId:e,released:t,reviewing:n,reviewNote:r})=>{const s=hH(e);return e?d.jsx("div",{className:"mb-3 text-xs opacity-80",children:s?d.jsx(DH,{trail:s,released:t,reviewing:n,reviewNote:r}):d.jsx("div",{className:"max-w-xs","aria-hidden":"true",children:d.jsx(Mt,{variant:"text",height:32})})}):null};function d7(e){return`feedback-draft:${e.id??e.title}`}const f7=({plan:e,updating:t,onSend:n,undo:r,undoing:s,onUndo:i})=>{var k;const[o,a]=b.useState(""),[l,c]=b.useState(null),[u,f]=b.useState(null),h=e.thread??[],{promotingIndex:p,promoteToDurable:m,promoteToIdea:g}=rH(e);nH(e,!0);const w=d7(e);b.useEffect(()=>{a(Fa(w)??"")},[w]),b.useEffect(()=>{o&&Oa(w,o)},[w,o]);const y=async()=>{const C=o.trim();C&&(c(C),a(""),await n(C)?rg(w):a(S=>S||C),c(null))},x=(C,S)=>{S==="idea"?f(C):m(C,S)},v=async C=>{u!==null&&await g(u,C)&&f(null)};return d.jsxs("div",{className:"mb-8",children:[d.jsx("h3",{className:`${Gu} mb-3`,children:"Feedback"}),d.jsxs(de,{size:"small",accent:!0,accentColor:"slate",texture:"kraft",children:[d.jsx("div",{className:"flex flex-col gap-3 mb-4",children:h.length>0||l?d.jsxs(d.Fragment,{children:[d.jsx(AH,{messages:h,undo:r,undoing:s,onUndo:i,onPromote:x,promotingIndex:p}),l&&d.jsx("div",{className:"flex flex-col gap-1 items-end",children:d.jsx("div",{className:"max-w-[85%]",children:d.jsx(de,{size:"small",surface:"paper",texture:"parchment",accent:!0,accentColor:"blue",children:l})})}),t&&d.jsx("div",{className:"flex flex-col gap-1 items-start",children:d.jsx(de,{size:"small",surface:"paper",texture:"kraft",shade:!0,children:d.jsx(ar,{size:"small",label:"Agent thinking…"})})})]}):d.jsx("p",{className:"text-sm m-0 text-ink-500",children:"Jot a comment, ask a question, or say what's wrong with this plan."})}),d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsx(Da,{value:o,onChange:C=>a(C.target.value),"aria-label":"Feedback message",placeholder:"Write a message…",rows:3}),d.jsx("div",{className:"flex justify-end items-center gap-3",children:d.jsx(se,{size:"small",onClick:y,disabled:t||!o.trim(),children:"Send"})})]})]}),d.jsx(DC,{open:u!==null,onClose:()=>f(null),onAdd:v,initialContent:u!==null?(k=h[u])==null?void 0:k.text:void 0})]})},h7=({plan:e})=>{const t=M(_=>_.plans),n=M(_=>_.gitBranch),r=M(_=>_.loadGitStatus),s=M(_=>_.loadPlans),{toast:i}=He(),{patch:o,updating:a}=Zi(),[l,c]=b.useState(!1),u=M(_=>_.agentStatus),f=M($u),h=M(_=>_.detailView),p=M(_=>_.taskLog),m=M(_=>_.loadTaskLog),g=Zm(e.id,u),w=!!JB(e.id,u),y=ZB(e.thread),x=uH(g,p),v=b.useMemo(()=>VH(p,e.id),[p,e.id]),k=(g==null?void 0:g.taskKind)==="audit",C=XB(e,(x==null?void 0:x.fraction)??0),S=e.phases.length>0,P=h==="feedback",T={id:e.id??null,title:e.title,body:e.body,log:e.log},E=((t==null?void 0:t.entries)??[]).filter(_=>_.id!==e.id),j=e.id!==void 0&&r7(n)===e.id;b.useEffect(()=>{m()},[m]);const R=async()=>{if(e.id){c(!0);try{const{branch:_,warning:B}=await W4(e.id);i({title:"Branch ready",description:`Now on ${_}`,variant:"success"}),B&&i({title:"Stale fork",description:B,variant:"warning"}),await r()}catch(_){i({title:"Branch failed",description:We(_.message),variant:"error"})}finally{c(!1)}}},I=async _=>{const B=e.phases.map((N,ae)=>ae===_?{...N,done:!N.done}:N);B.every(N=>N.done)&&e.status==="in-progress"?await o(e.title,{phases:B,status:"review"}):await o(e.title,{phases:B})},D=async _=>{await o(e.title,{phases:[...e.phases,..._]})},$=async _=>{const B=(e.fixes??[]).map((N,ae)=>ae===_?{...N,done:!N.done}:N);B.every(N=>N.done)&&e.status==="in-progress"?await o(e.title,{fixes:B,status:"review"}):await o(e.title,{fixes:B})},{sending:A,send:z,undo:O,undoing:L,undoEdit:V}=dH(e,{reload:s,notify:i});return d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-baseline justify-between gap-3 mb-2 flex-wrap",children:[d.jsxs("h2",{className:`${BH} m-0 flex items-center gap-3 min-w-0 flex-wrap`,children:[d.jsx(rs,{id:e.id}),e.title]}),d.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[d.jsx("span",{className:"text-sm opacity-[0.45] whitespace-nowrap",children:e.updated?`updated ${nu(e.updated)}`:`created ${nu(e.created)}`}),d.jsx(wC,{})]})]}),d.jsx(u7,{planId:e.id,released:e.released,reviewing:w,reviewNote:y}),P?d.jsx(f7,{plan:e,updating:A,onSend:z,undo:O,undoing:L,onUndo:V}):d.jsxs(d.Fragment,{children:[d.jsx(o7,{plan:e,gitBranch:n,onOwnBranch:j,branching:l,onCreateBranch:R}),d.jsx(a7,{progress:C,color:IC[eg(e,u)],rollup:v}),d.jsx(l7,{plan:e}),d.jsx(c7,{clarifications:e.clarifications??[]}),!S&&d.jsxs("div",{className:"flex items-center gap-3 mb-8",children:[d.jsx(Hu,{idea:T,otherPlans:E}),d.jsx(Cg,{idea:T})]}),!S&&d.jsx(OC,{plan:e}),S&&d.jsx(i7,{plan:e,auditRunning:k,agentBusy:f,runningFill:x,updating:a,onTogglePhase:I,onToggleFix:$,onAddReviewPhases:D})]})]})},p7=()=>{const[e,t]=b.useState(new Set);return b.useEffect(()=>{let n=!1;return yS().then(r=>{n||!r||t(new Set(r.horizons.flatMap(s=>s.items.map(i=>i.name))))}).catch(()=>{}),()=>{n=!0}},[]),e},Co="text-sm font-semibold opacity-60 whitespace-nowrap overflow-hidden",jg=({order:e,done:t,running:n,status:r})=>d.jsx("span",{className:"flex-[0_0_36px] flex items-center justify-center",children:n?d.jsx(ar,{size:"small",label:"Agent running"}):t?d.jsx("span",{"aria-label":"Done",className:"text-watercolor-green-dark text-sm",children:"✓"}):e!==void 0?d.jsx(_e,{size:"small",fillColor:"rgba(0,0,0,0.06)",children:d.jsx("span",{className:"font-handwritten text-xs leading-none",children:e})}):r==="idea"?d.jsx("span",{"aria-label":"Backlog — not planned yet",className:"inline-flex text-ink-300",children:d.jsx(Qm,{size:14})}):null}),mp="grid grid-cols-[76px_minmax(0,1fr)_84px_96px_112px] gap-2.5 items-center max-lg:grid-cols-[76px_minmax(0,1fr)_96px_112px] max-[480px]:grid-cols-1 max-[480px]:gap-1",$C=({plans:e,activePlanTitle:t,onOpen:n,showHeader:r=!0})=>{const s=mp,i=M(o=>o.agentStatus);return d.jsxs("div",{className:"flex flex-col gap-1",children:[r&&d.jsxs("div",{className:"flex items-center",children:[d.jsx("span",{className:"flex-[0_0_36px]"}),d.jsx("div",{className:"flex-1 min-w-0",children:d.jsx(de,{size:"small",texture:"kraft",className:"plan-row-card",children:d.jsxs("div",{className:s,children:[d.jsx("span",{className:Co,children:"Id"}),d.jsx("span",{className:Co,children:"Title"}),d.jsx("span",{className:`max-lg:hidden ${Co}`,children:"Updated"}),d.jsx("span",{className:Co,children:"Progress"}),d.jsx("span",{className:Co,children:"Status"})]})})})]}),e.map(o=>{var c;const a=SS(o),l=eg(o,i);return d.jsxs("div",{className:"flex items-center",children:[d.jsx(jg,{order:o.order,done:o.status==="done",status:o.status,running:!!Zm(o.id,i)}),d.jsx("div",{role:n?"button":void 0,tabIndex:n?0:void 0,onClick:n?()=>n(o.title):void 0,onKeyDown:n?u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),n(o.title))}:void 0,className:`${n?"cursor-pointer":""} rounded-[10px] flex-1 min-w-0 ${o.title===t?"plan-row-highlighted outline outline-2 outline-offset-[-2px] outline-[rgba(200,154,90,0.5)]":""}`,children:d.jsx(de,{size:"small",texture:"canvas",className:"plan-row-card",children:d.jsxs("div",{className:s,children:[d.jsx(rs,{id:o.id}),d.jsx("span",{className:"font-semibold overflow-hidden text-ellipsis whitespace-nowrap",children:o.title}),d.jsx("span",{className:"max-lg:hidden text-sm opacity-[0.45] whitespace-nowrap",children:o.updated?nu(o.updated):nu(o.created)}),a?d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx("div",{className:"flex-1 min-w-0",children:d.jsx(LC,{pct:a.pct,color:IC[l]})}),d.jsxs("span",{className:"text-sm opacity-50 shrink-0",children:[a.done,"/",a.total]})]}):d.jsx("span",{className:"text-sm opacity-30",children:"—"}),d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx(_e,{size:"small",fillColor:lr[l].fill,textColor:lr[l].text,children:Sg[l]}),((c=o.pr)==null?void 0:c.state)==="merged"&&d.jsx(be,{content:`Merged in #${o.pr.number}`,children:d.jsx("span",{className:"inline-flex text-[#7B5E9E]",children:d.jsx(uS,{size:14})})})]})]})})})]},o.title)})]})},m7=5,g7="text-sm font-semibold opacity-60 whitespace-nowrap overflow-hidden",zC="grid grid-cols-[76px_minmax(0,1fr)_84px_96px_112px] gap-2.5 items-center max-lg:grid-cols-[76px_minmax(0,1fr)_96px_112px] max-[480px]:grid-cols-1 max-[480px]:gap-1",lw="font-handwritten text-xs font-semibold opacity-55 leading-none pt-2 pr-1 pb-0 pl-1",cw=`${g7} bg-none bg-transparent border-none p-0 cursor-pointer [font:inherit] text-inherit text-left`,y7=[{key:"id",label:"Id"},{key:"title",label:"Title"},{key:"updated",label:"Updated"},{key:"progress",label:"Progress"},{key:"status",label:"Status"}],BC="flex items-center gap-2 min-w-0 bg-none bg-transparent border-none p-0 cursor-pointer text-left [font:inherit] text-inherit font-semibold",VC="overflow-hidden text-ellipsis whitespace-nowrap",x7=({rows:e,plans:t,activePlanTitle:n,onOpenPlan:r,onOpenIdea:s})=>{const[i,o]=b.useState(new Set),{subjects:a,loading:l,available:c}=EC(),u=p7(),f=mt(),h=zC,p=M(S=>S.planFilters.sortKey),m=M(S=>S.planFilters.sortDirection),g=M(S=>S.setPlanSortKey),w=M(S=>S.togglePlanSortDirection),y=S=>{S===p?w():g(S)},x=S=>{o(P=>{const T=new Set(P);return T.has(S)?T.delete(S):T.add(S),T})},v=S=>S.type==="plan"?d.jsx($C,{plans:[S.plan],activePlanTitle:n,onOpen:r,showHeader:!1},S.plan.title):S.type==="note"?d.jsx(v7,{row:S,onOpen:s},S.idea.title):d.jsx(w7,{row:S,plans:t,activePlanTitle:n,onOpenPlan:r,onOpenIdea:s,expanded:i.has(S.idea.title),onToggleExpanded:()=>x(S.idea.title)},S.idea.title),k=f5(e,m,l||!c?void 0:a),C=k.length>1;return d.jsxs("div",{className:"flex flex-col gap-1",children:[d.jsxs("div",{className:"flex items-center",children:[d.jsx("span",{role:"columnheader",className:"flex-[0_0_36px] flex justify-center","aria-sort":p==="order"?m==="asc"?"ascending":"descending":void 0,children:d.jsxs("button",{type:"button",className:cw,"aria-label":"Sort by run order",onClick:()=>y("order"),children:["#",p==="order"&&(m==="asc"?"▲":"▼")]})}),d.jsx("div",{className:"flex-1 min-w-0",children:d.jsx(de,{size:"small",texture:"kraft",className:"plan-row-card",children:d.jsx("div",{className:h,children:y7.map(({key:S,label:P})=>{const T=S===p;return d.jsx("span",{role:"columnheader",className:S==="updated"?"max-lg:hidden":void 0,"aria-sort":T?m==="asc"?"ascending":"descending":void 0,children:d.jsxs("button",{type:"button",className:cw,onClick:()=>y(S),children:[P,T&&(m==="asc"?" ▲":" ▼")]})},S)})})})})]}),C?k.map(S=>{const P=S.subject;return d.jsxs("div",{className:"flex flex-col gap-1",children:[d.jsx("div",{className:"flex items-baseline gap-2",children:P&&u.has(P)?d.jsx("button",{type:"button",className:`${lw} bg-none bg-transparent border-none cursor-pointer text-left hover:underline`,title:"View in roadmap",onClick:()=>f({to:"/roadmap",search:{item:P}}),children:P}):d.jsx("div",{className:lw,children:P??"No subject"})}),S.rows.map(T=>v(T))]},P??"__no-subject__")}):e.map(S=>v(S))]})},v7=({row:e,onOpen:t})=>{const n=e.idea,r=n.status??"open";return d.jsxs("div",{className:"flex items-center",children:[d.jsx(jg,{order:n.order,done:r==="done",status:r}),d.jsx("div",{role:t?"button":void 0,tabIndex:t?0:void 0,onClick:t?()=>t(n.title):void 0,onKeyDown:t?s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),t(n.title))}:void 0,className:`${t?"cursor-pointer":""} rounded-[10px] flex-1 min-w-0`,children:d.jsx(de,{size:"small",texture:"canvas",className:"plan-row-card",children:d.jsxs("div",{className:zC,children:[n.id?d.jsx(rs,{id:n.id}):d.jsx("span",{}),d.jsxs("span",{className:`${BC} [cursor:inherit]`,children:[d.jsx(Xm,{}),d.jsx("span",{className:VC,children:n.title})]}),d.jsx("span",{className:"max-lg:hidden text-sm opacity-[0.45]",children:"—"}),d.jsx("span",{className:"text-sm opacity-30",children:"—"}),d.jsx(_e,{size:"small",fillColor:iu[r].fill,textColor:iu[r].text,children:MC[r]})]})})})]})},w7=({row:e,plans:t,activePlanTitle:n,onOpenPlan:r,onOpenIdea:s,expanded:i,onToggleExpanded:o})=>{const a=e.idea,l=e.children,c=l.filter(p=>p.status==="done"),u=l.filter(p=>p.status!=="done"),f=l.length>m7,h=f&&!i?u:l;return d.jsxs("div",{className:"flex flex-col gap-1",children:[d.jsxs("div",{className:"flex items-center",children:[d.jsx(jg,{order:a.order,done:a.status==="done",status:a.status}),d.jsx("div",{className:"flex-1 min-w-0",children:d.jsx(de,{size:"small",texture:"canvas",className:"plan-row-card",children:d.jsxs("div",{className:"grid grid-cols-[76px_minmax(0,1fr)_84px_1fr] gap-2 items-center max-[480px]:grid-cols-1 max-[480px]:gap-1",children:[a.id?d.jsx(rs,{id:a.id}):d.jsx("span",{}),d.jsxs("button",{type:"button",onClick:()=>s==null?void 0:s(a.title),className:BC,children:[d.jsx(Qm,{}),d.jsx("span",{className:VC,children:a.title})]}),d.jsx("span",{className:"max-lg:hidden text-sm opacity-[0.45]",children:"—"}),d.jsxs("div",{className:"flex items-center justify-end gap-2",children:[d.jsx("span",{className:`text-sm ${l.length>0?"opacity-60":"opacity-30"}`,children:l.length>0?`${c.length}/${l.length} plans done`:"—"}),d.jsx(Cg,{idea:a,compact:!0}),d.jsx(Hu,{idea:a,otherPlans:t})]})]})})})]}),l.length>0&&d.jsxs("div",{className:"ml-5 pl-3 border-l-2 border-black/[8%] flex flex-col gap-1",children:[d.jsx($C,{plans:h,activePlanTitle:n,onOpen:r,showHeader:!1}),f&&d.jsx("button",{type:"button",onClick:o,className:"self-start bg-none bg-transparent border-none py-1 px-0 opacity-60 cursor-pointer underline text-xs [font:inherit]",children:i?"Show less":`+${c.length} done`})]})]})},b7=({plans:e,rows:t,activePlanTitle:n,onOpenPlan:r,onOpenIdea:s})=>{const i=b.useRef(null);return b.useEffect(()=>{var a;if(!n)return;const o=(a=i.current)==null?void 0:a.querySelector(".plan-row-highlighted");o==null||o.scrollIntoView({behavior:"smooth",block:"center"})},[n]),d.jsx("div",{ref:i,children:t.length>0?d.jsx(x7,{rows:t,plans:e,activePlanTitle:n,onOpenPlan:r,onOpenIdea:s}):d.jsx("p",{className:"opacity-50 py-6 px-0 text-center",children:"Nothing matches these filters — clear one, or check back once something moves into this status."})})},k7=({idea:e})=>d.jsxs("div",{className:"text-base leading-[1.7] text-ink-900",children:[d.jsxs("h2",{className:"font-display-luminari font-semibold text-[1.75rem] leading-tight mt-0 mr-0 mb-4 ml-0 flex items-center gap-3 flex-wrap",children:[d.jsx(rs,{id:e.id??void 0}),e.title,e.status&&d.jsx(_e,{size:"small",fillColor:iu[e.status].fill,textColor:iu[e.status].text,children:MC[e.status]})]}),d.jsx(gC,{children:e.body.replace(/^#{1,3}\s+.+(\n|$)/,"").replace(/^\s*-{3,}\s*(\n|$)/,"").trim()}),d.jsx("div",{className:"mt-6",children:d.jsx(Cg,{idea:e})})]}),jf="__no-subject__",jo="text-2xs font-semibold tracking-[0.08em] uppercase text-ink-300",_7=()=>{var A,z;const e=bg(),t=M($u),n=M(O=>O.agentStatus),{patch:r,updating:s}=Zi(),{subjects:i,available:o}=EC(),a=M(O=>O.detailView),l=M(O=>O.setDetailView),c=M(O=>O.archiveIdeas),{toast:u}=He(),f=mt(),[h,p]=b.useState(""),[m,g]=b.useState(!1);if(b.useEffect(()=>{p((e==null?void 0:e.order)!==void 0?String(e==null?void 0:e.order):"")},[e==null?void 0:e.order]),!e)return null;const w=eg(e,n),y=e.status==="in-progress",x=e.status==="review",v=e.status==="dropped",k=e.status==="done",C=e.phases.some(O=>!O.done),S=(e.status==="planned"||y)&&C,P=e5(e),T=!!(e.pr&&(e.pr.state==="open"||e.pr.state==="draft")&&e.pr.unresolvedThreadCount),E=((A=e.pr)==null?void 0:A.state)==="open"||((z=e.pr)==null?void 0:z.state)==="draft",j=o&&e.subject&&!i.includes(e.subject)?e.subject:void 0,R=O=>r(e.title,O),I=async()=>{if(e.id){g(!0);try{await c([e.id])}catch(O){u({title:"Archive failed",description:O.message,variant:"error"})}finally{g(!1)}}},D=y||x||e.status==="planned",$=async()=>{const O=h.trim(),L=Number(O);if(O===""||!Number.isInteger(L)||L<1){p(e.order!==void 0?String(e.order):"");return}L!==e.order&&await R({order:L})};return d.jsxs("div",{className:"flex flex-col gap-4 -mt-5",children:[d.jsx(aS,{items:[{id:"plans",label:"Plans",onClick:()=>f({to:"/"})},{id:"plan",label:e.title}]}),d.jsxs("div",{children:[d.jsx("div",{className:`${jo} mb-1.5`,children:"Show"}),d.jsxs("div",{className:"flex flex-col gap-1",children:[d.jsx(Dn,{size:"small",active:a==="details",onClick:()=>l("details"),className:"text-xs leading-4 py-2",children:"Details"}),d.jsx(Dn,{size:"small",active:a==="feedback",onClick:()=>l("feedback"),className:"text-xs leading-4 py-2",children:"Feedback"})]})]}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("div",{className:jo,children:"Status"}),d.jsx(_e,{size:"small",fillColor:lr[w].fill,textColor:lr[w].text,children:Sg[w]})]}),d.jsxs("div",{children:[d.jsx("div",{className:`${jo} mb-1.5`,children:"Subject"}),d.jsx(rS,{size:"small",value:e.subject??jf,onChange:O=>R({subject:O===jf?null:O}),disabled:s||!o,options:[{value:jf,label:"No subject"},...j?[{value:j,label:`${j} (orphan)`}]:[],...!o&&e.subject&&!j?[{value:e.subject,label:e.subject}]:[],...i.map(O=>({value:O,label:O}))]})]}),D&&d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("div",{className:jo,children:"Order"}),d.jsx(La,{type:"number",size:"small","aria-label":"Run order",min:1,value:h,onChange:O=>p(O.target.value),onBlur:$,disabled:s,className:"w-20"})]}),d.jsxs("div",{children:[d.jsx("div",{className:`${jo} mb-1.5`,children:"Actions"}),d.jsxs("div",{className:"flex flex-col gap-1",children:[S&&d.jsx(t7,{plan:e,disabled:t||s}),T&&d.jsx(QH,{plan:e,disabled:t||s}),E&&d.jsx(ZH,{plan:e,disabled:t||s}),x&&d.jsx(Dn,{size:"small",icon:d.jsx("span",{className:"text-watercolor-green-dark",children:"✓"}),onClick:()=>R({status:"done"}),disabled:s,className:`text-xs leading-4 py-2 ${s?"opacity-50":""}`,children:"Approve & close"}),k&&d.jsx(Dn,{size:"small",icon:d.jsx("span",{className:"text-ink-300",children:"▣"}),onClick:I,disabled:m||!e.id,className:`text-xs leading-4 py-2 ${m||!e.id?"opacity-50":""}`,children:m?"Archiving…":"Archive"}),P&&d.jsx(Dn,{size:"small",icon:d.jsx("span",{className:"text-watercolor-green-dark",children:"✓"}),onClick:I,disabled:m||!e.id,className:`text-xs leading-4 py-2 ${m||!e.id?"opacity-50":""}`,children:m?"Marking done…":"Mark done"}),!k&&d.jsx(Dn,{size:"small",icon:d.jsx("span",{className:v?"text-watercolor-green-dark":"text-watercolor-rose-dark",children:v?"↺":"⊘"}),onClick:()=>R({status:v?null:"dropped"}),disabled:s,className:`text-xs leading-4 py-2 ${s?"opacity-50":""}`,children:v?"Reopen plan":"Mark dropped"})]})]})]})},S7=["in-progress","review","planned","idea","done","dropped"],C7="text-2xs font-semibold tracking-[0.08em] uppercase text-ink-300 mb-2",j7=()=>{const e=M(f=>f.plans),t=bg(),n=M(f=>f.planFilters),r=M(f=>f.togglePlanStatus),s=M(f=>f.setPlanSearch),i=M(f=>f.setSubjectFilter),o=mt();if(!e||t)return null;const{statusCounts:a}=lc(e.entries,n),l=new Set(n.statuses),c="bg-none bg-transparent border-none p-0 cursor-pointer opacity-70 underline text-2xs",u=S7.filter(f=>a[f]>0||l.has(f));return d.jsxs("div",{className:"flex flex-col gap-8 -mt-5",children:[d.jsx(La,{type:"search",size:"small",placeholder:"Search plans…","aria-label":"Search plans",value:n.search,onChange:f=>s(f.target.value)}),n.subject!==null&&d.jsxs("div",{className:"flex items-center gap-2","data-testid":"subject-filter-chip",children:[d.jsxs("span",{className:"text-2xs opacity-70",children:["Subject: ",n.subject]}),d.jsx("button",{type:"button",onClick:()=>{i(null),o({to:"/",search:{}})},className:c,children:"Clear"})]}),d.jsxs("div",{children:[d.jsx("div",{className:C7,children:"Status"}),d.jsx("div",{className:"flex flex-col gap-1",children:u.map(f=>{const h=l.has(f);return d.jsx(Dn,{size:"small",active:h,onClick:()=>r(f),className:"text-xs leading-4 py-2",icon:d.jsx("span",{className:"w-[9px] h-[9px] rounded-full shrink-0",style:{background:lr[f].text}}),action:d.jsx("span",{className:"text-2xs text-ink-500",children:a[f]}),children:Sg[f]},f)})})]})]})},uw=()=>d.jsxs("div",{className:"flex items-center gap-3 mb-6 flex-wrap",children:[d.jsx("h1",{className:"text-4xl flex-1 font-display-luminari font-semibold text-ink-900 m-0 leading-[1.1]",children:"Plans"}),d.jsx(XH,{}),d.jsx(KH,{}),d.jsx(n7,{})]}),P7=[{key:"a",title:"72%"},{key:"b",title:"54%"},{key:"c",title:"83%"},{key:"d",title:"46%"},{key:"e",title:"66%"},{key:"f",title:"58%"}],E7=()=>d.jsxs("div",{className:"flex flex-col gap-1","aria-hidden":"true",children:[d.jsxs("div",{className:"flex items-center",children:[d.jsx("span",{className:"flex-[0_0_36px]"}),d.jsx("div",{className:"flex-1 min-w-0",children:d.jsx(de,{size:"small",texture:"kraft",className:"plan-row-card",children:d.jsxs("div",{className:mp,children:[d.jsx(Mt,{variant:"text",width:28}),d.jsx(Mt,{variant:"text",width:44}),d.jsx("span",{className:"max-lg:hidden",children:d.jsx(Mt,{variant:"text",width:56})}),d.jsx(Mt,{variant:"text",width:64}),d.jsx(Mt,{variant:"text",width:48})]})})})]}),P7.map(e=>d.jsxs("div",{className:"flex items-center",children:[d.jsx("span",{className:"flex-[0_0_36px] flex items-center justify-center",children:d.jsx(Mt,{variant:"text",width:16})}),d.jsx("div",{className:"flex-1 min-w-0",children:d.jsx(de,{size:"small",className:"plan-row-card",children:d.jsxs("div",{className:mp,children:[d.jsx(Mt,{variant:"rect",width:44,height:18}),d.jsx(Mt,{variant:"text",width:e.title}),d.jsx("span",{className:"max-lg:hidden",children:d.jsx(Mt,{variant:"text",width:52})}),d.jsx(Mt,{variant:"rect",width:80,height:8}),d.jsx(Mt,{variant:"rect",width:64,height:20})]})})})]},e.key))]}),T7=()=>{const e=M(u=>u.reconcileQueue),t=M(u=>u.removeFromReconcileQueue),n=M(u=>u.plans),{patch:r}=Zi(),{toast:s}=He(),i=b.useRef(0),o=e[0]??null,a=o?(n==null?void 0:n.entries.find(u=>u.id===o.planId))??null:null;if(b.useEffect(()=>{o&&!a&&t(o.previewId)},[o,a,t]),b.useEffect(()=>{e.length===0&&(i.current=0)},[e.length]),!o||!a)return null;const l=async()=>{t(o.previewId),i.current+=1,s({title:"Kept the merged version",description:`"${a.title}" keeps the agent's rewrite.`})},c=async()=>{await r(a.title,{body:o.before.body,phases:o.before.phases},{errorTitle:"Discard failed"})&&(t(o.previewId),i.current+=1)};return d.jsx($H,{plan:a,before:o.before,onApprove:l,onDiscard:c,queuePosition:{index:i.current+1,total:i.current+e.length}})},N7=({suggestions:e,onOpen:t,onDismiss:n})=>e.length===0?null:d.jsxs("div",{className:"mt-5",children:[d.jsx("h2",{className:"text-sm mb-2 opacity-60",children:"Suggested from AI"}),d.jsx("div",{className:"flex flex-col gap-1",children:e.map(r=>d.jsx("div",{className:"rounded-[10px]",children:d.jsx(de,{size:"small",texture:"canvas",className:"plan-row-card",children:d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs("button",{type:"button",onClick:()=>t(r),className:"flex-1 min-w-0 flex items-center gap-2 bg-none bg-transparent border-none p-0 cursor-pointer text-left [font:inherit] text-inherit",children:[d.jsx(Qm,{}),d.jsx("span",{className:"font-semibold overflow-hidden text-ellipsis whitespace-nowrap",children:r.title})]}),d.jsx(ot,{icon:d.jsx("span",{children:"×"}),variant:"ghost",size:"small",label:"Dismiss",className:"w-[28px] h-[28px]",onClick:()=>n(r)})]})})},`${r.date}-${r.title}`))})]}),Pg=()=>{const e=M(E=>E.plans),t=M(E=>E.plansError),n=M(E=>E.ideaEntries),r=M(E=>E.suggestions);M(E=>E.loadPlans);const s=M(E=>E.setDetailView),i=M(E=>E.planFilters),o=M(E=>E.setSubjectFilter),a=bg(),l=R9(),{planId:c,ideaId:u}=zs({strict:!1}),f=M(E=>E.dismissSuggestion),h=mt(),{toast:p}=He(),{subject:m}=gm({strict:!1});b.useEffect(()=>{o(m??null)},[m,o]);const g=c??u,w=b.useRef(g);b.useEffect(()=>{w.current!==g&&s("details"),w.current=g},[g,s]);const y=()=>{h({to:"/"})},x=E=>{var R;const j=(R=e==null?void 0:e.entries.find(I=>I.title===E))==null?void 0:R.id;h({to:"/plans/$planId",params:{planId:Ns(j,E)}})},v=E=>{var R;const j=(R=n.find(I=>I.title===E))==null?void 0:R.id;h({to:"/ideas/$ideaId",params:{ideaId:Ns(j,E)}})},k=E=>{h({to:"/plans/$planId",params:{planId:Ns(E.id,E.title)}})},[C,S]=b.useState(null),P=async E=>{try{await f(E)}catch(j){p({title:"Failed to dismiss suggestion",description:j.message,variant:"error"})}};if(t)return d.jsxs("div",{children:[d.jsx(eH,{children:"Plans"}),d.jsxs(de,{size:"small",accent:!0,accentColor:"rose",children:[d.jsx("p",{className:"m-0 font-semibold",children:"Couldn't load plans.md"}),d.jsx("p",{className:"m-0 opacity-75",children:t})]})]});if(!e)return c||u?d.jsxs("div",{children:[d.jsx("output",{"aria-live":"polite",className:"sr-only",children:"Loading…"}),d.jsx("p",{className:"opacity-50",children:"Loading…"})]}):d.jsxs("div",{children:[d.jsx(uw,{}),d.jsx("output",{"aria-live":"polite",className:"sr-only",children:"Loading plans…"}),d.jsx(E7,{})]});const{rows:T}=h5(e.entries,n,i);return d.jsxs(d.Fragment,{children:[d.jsx(T7,{}),a?d.jsx("div",{children:d.jsx(h7,{plan:a})}):l?d.jsxs("div",{children:[d.jsx("div",{className:"mb-4",children:d.jsx(aS,{items:[{id:"plans",label:"Plans",onClick:y},{id:"idea",label:l.title}]})}),d.jsx(k7,{idea:l})]}):d.jsxs("div",{children:[d.jsx(uw,{}),e.warnings.length>0&&d.jsxs(de,{size:"small",accent:!0,accentColor:"amber",children:[d.jsx("p",{className:"m-0 font-semibold",children:"Some entries couldn't be parsed"}),d.jsx("ul",{className:"m-0 pl-5",children:e.warnings.map(E=>d.jsxs("li",{children:[E.title,": ",E.message]},E.title))})]}),e.entries.length===0?d.jsxs("p",{className:"opacity-50",children:["No ideas yet — capture one with ",d.jsx("strong",{children:"New idea"})," above, or click"," ",d.jsx("strong",{children:"Suggest ideas"})," to have an agent propose some."]}):d.jsx(b7,{plans:e.entries,rows:T,activePlanTitle:null,onOpenPlan:x,onOpenIdea:v}),d.jsx(zH,{onOpen:k}),d.jsx(N7,{suggestions:r,onOpen:S,onDismiss:P}),d.jsx(OH,{suggestion:C,onClose:()=>S(null)})]})]})};function R7(e){return e.filter(t=>t.kind!=="question")}function A7(e,t){return t?e.filter(n=>!t.has(n.id)):[]}function I7(){const e=M(r=>r.notifications),t=M(r=>r.loadNotifications),n=b.useRef(null);b.useEffect(()=>{typeof Notification<"u"&&Notification.permission==="default"&&Notification.requestPermission()},[]),b.useEffect(()=>{if(!e)return;const r=R7(e),s=A7(r,n.current);if(n.current=new Set(r.map(i=>i.id)),s.length!==0&&!(typeof Notification>"u"||Notification.permission!=="granted")&&!document.hasFocus())for(const i of s)new Notification(i.entityTitle,{body:i.text})},[e]),b.useEffect(()=>{let r;const s=Ba(i=>{i.message==="changed"&&(r&&clearTimeout(r),r=setTimeout(t,250))});return()=>{r&&clearTimeout(r),s()}},[t])}const M7="data-paper-camp-mount";function L7(e){return(e==null?void 0:e.getAttribute(M7))??""}const UC=typeof document>"u"?"":L7(document.getElementById("root")),WC=b.lazy(()=>bn(()=>import("./index-BNoowtMI.js"),__vite__mapDeps([0,1]),import.meta.url).then(e=>({default:e.DocsPage}))),D7=b.lazy(()=>bn(()=>import("./index-BNoowtMI.js"),__vite__mapDeps([0,1]),import.meta.url).then(e=>({default:e.DocsSidebar}))),HC=b.lazy(()=>bn(()=>import("./index-D5j1njQR.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>({default:e.SettingsPage}))),F7=b.lazy(()=>bn(()=>import("./index-D5j1njQR.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>({default:e.SettingsSidebar}))),O7=b.lazy(()=>bn(()=>import("./index-nuVVSVma.js"),[],import.meta.url).then(e=>({default:e.TasksPage}))),$7=b.lazy(()=>bn(()=>import("./index-D2iIIpI1.js"),[],import.meta.url).then(e=>({default:e.RoadmapPage}))),z7=b.lazy(()=>bn(()=>import("./index-D2iIIpI1.js"),[],import.meta.url).then(e=>({default:e.RoadmapSidebar}))),B7=b.lazy(()=>bn(()=>import("./index-B6251tL6.js"),[],import.meta.url).then(e=>({default:e.StatsPage}))),V7=b.lazy(()=>bn(()=>import("./index-s6CVH54G.js"),[],import.meta.url).then(e=>({default:e.GitPage}))),U7=b.lazy(()=>bn(()=>import("./index-s6CVH54G.js"),[],import.meta.url).then(e=>({default:e.GitFileList}))),W7=b.lazy(()=>bn(()=>import("./index-DLkUANCR.js"),[],import.meta.url).then(e=>({default:e.InboxPage}))),Pf=[{id:"plans",label:"Plans",path:"/"},{id:"roadmap",label:"Roadmap",path:"/roadmap"},{id:"docs",label:"Docs",path:"/docs"},{id:"tasks",label:"Tasks",path:"/tasks"},{id:"stats",label:"Stats",path:"/stats"},{id:"settings",label:"Settings",path:"/settings"}],dw=({item:e})=>d.jsx("span",{className:"inline-flex items-center gap-1.5",children:e.label}),fw=()=>d.jsx("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:d.jsx("path",{d:"M3 5h14M3 10h14M3 15h14",strokeLinecap:"round"})}),GC="stack-open";function H7(){try{return localStorage.getItem(GC)==="true"}catch{return!1}}function G7(e){try{localStorage.setItem(GC,String(e))}catch{}}const K7="(min-width: 1440px)";function Y7(e){const[t,n]=b.useState(()=>typeof window<"u"?window.matchMedia(e).matches:!1);return b.useEffect(()=>{const r=window.matchMedia(e),s=i=>n(i.matches);return n(r.matches),r.addEventListener("change",s),()=>r.removeEventListener("change",s)},[e]),t}const q7=()=>{var T;const e=mt(),t=C2({select:E=>E.location.pathname}),n=M(E=>E.loadPlans),r=M(E=>E.loadIdeas),s=M(E=>E.loadSuggestions),i=M(E=>E.loadCapabilities),o=M(E=>E.loadAgentAuthStatus),a=M(E=>E.loadParkedQuestions),l=M(E=>E.loadNotifications),c=M(E=>E.setActiveDocTitle),u=t==="/"||t.startsWith("/plans/")||t.startsWith("/ideas/"),f=t==="/docs"||t.startsWith("/docs/"),h=t==="/settings"||t.startsWith("/settings/"),p=t==="/roadmap",m=t==="/git",g=u?"plans":f?"docs":h?"settings":(T=Pf.find(E=>E.path===t))==null?void 0:T.id,w=u||f||h||p||m,y=u?"plans":f?"docs":h?"settings":p?"roadmap":"git",[x,v]=b.useState(H7),[k,C]=b.useState(!1),S=Y7(K7),P=b.useRef(!1);return I7(),b.useEffect(()=>{n(),r(),s(),i(),o(),a(),l()},[n,r,s,i,o,a,l]),b.useEffect(()=>{P.current||t!=="/"||(P.current=!0,Promise.all([Jm(),mS()]).then(([E,j])=>{if(!(E!=null&&E.setupDismissed)&&j!==null&&!j.every(R=>R.status==="ok")){e({to:"/settings/$section",params:{section:"setup"}});return}Promise.all([xS(),bS()]).then(([R,I])=>{R.entries.length>1||I.entries.length>0||(c("USAGE.md"),e({to:"/docs"}))})}))},[t,e,c]),b.useEffect(()=>{C(!1)},[t]),d.jsxs(t4,{position:"bottom-left",children:[d.jsxs("div",{className:"h-screen box-border min-[1440px]:pr-[480px] flex flex-col",children:[d.jsx(z9,{}),d.jsx(Z9,{}),d.jsx($D,{style:{flex:"1 1 0%",minHeight:0,height:"auto"},background:{texture:"speckle",ruledType:"grid",ruledColor:"blue"},showHeader:!0,showSidebar:!1,showPage:!1,bleedBottom:!0,headerActions:d.jsxs(d.Fragment,{children:[w&&d.jsx(ot,{variant:"ghost",size:"small",className:"lg:hidden max-[480px]:hidden",label:"Open sidebar",onClick:()=>C(!0),icon:d.jsx(fw,{})}),d.jsx($9,{size:"sm"}),d.jsx("div",{className:"flex-1"}),d.jsx("nav",{"aria-label":"Main navigation",className:"flex items-center gap-1 max-[480px]:hidden",children:Pf.map(E=>d.jsx(se,{variant:"ghost",size:"small",isActive:E.id===g,onClick:()=>e({to:E.path}),"aria-current":E.id===g?"page":void 0,children:d.jsx(dw,{item:E})},E.id))})]}),children:d.jsx("div",{className:"flex flex-col h-full min-h-0",children:d.jsx("div",{className:"flex flex-1 min-h-0 justify-center items-start box-border overflow-y-auto [scrollbar-gutter:stable] -mt-8 -ml-8 -mr-8 pt-0 pl-8 pr-8 pb-[var(--pc-content-pad-bottom,32px)]",children:d.jsxs("div",{className:"flex min-w-0 justify-center lg:[--pc-sidebar-h:calc(100vh-160px)] gap-6 w-full",children:[w&&d.jsxs(B9,{routeKey:y,mobileOpen:k,onMobileClose:()=>C(!1),children:[u&&d.jsxs(d.Fragment,{children:[d.jsx(j7,{}),d.jsx(_7,{})]}),f&&d.jsx(b.Suspense,{fallback:null,children:d.jsx(D7,{})}),h&&d.jsx(b.Suspense,{fallback:null,children:d.jsx(F7,{})}),p&&d.jsx(b.Suspense,{fallback:null,children:d.jsx(z7,{})}),m&&d.jsx(b.Suspense,{fallback:null,children:d.jsx(U7,{})})]}),d.jsx("div",{className:`flex flex-col min-w-0 ${S?"flex-[1_1_0%]":"flex-[0_1_800px]"}`,children:d.jsx("div",{className:"flex flex-col flex-1 min-w-0",children:d.jsx(J_,{texture:{texture:"parchment"},outline:!0,className:`min-h-[calc(100vh-160px)] w-full ${S?"max-w-none":""}`,children:d.jsx(b.Suspense,{fallback:null,children:d.jsx(Zb,{})})})})})]})})})})]}),d.jsx(O9,{open:x,pinned:S,onToggle:()=>{const E=!x;G7(E),v(E)}}),d.jsxs("nav",{"aria-label":"Main navigation",className:"hidden max-[480px]:flex max-[480px]:fixed max-[480px]:left-0 max-[480px]:right-0 max-[480px]:bottom-0 max-[480px]:z-[250] max-[480px]:items-stretch max-[480px]:justify-around max-[480px]:gap-1 max-[480px]:py-2 max-[480px]:px-2 max-[480px]:[padding-bottom:calc(0.5rem+env(safe-area-inset-bottom))] max-[480px]:bg-[var(--pui-bg-base,#fff)] max-[480px]:border-t max-[480px]:border-black/10 max-[480px]:shadow-[0_-2px_8px_rgba(0,0,0,0.08)]",children:[w&&d.jsx(ot,{variant:"ghost",size:"small",label:"Open sidebar",onClick:()=>C(!0),icon:d.jsx(fw,{}),className:"min-h-11"}),Pf.map(E=>d.jsx(se,{variant:"ghost",size:"small",isActive:E.id===g,onClick:()=>e({to:E.path}),"aria-current":E.id===g?"page":void 0,className:"min-h-11",children:d.jsx(dw,{item:E})},E.id))]})]})},Wt=u2({component:q7}),Q7=on({getParentRoute:()=>Wt,path:"/",component:Pg,validateSearch:e=>({subject:typeof e.subject=="string"?e.subject:void 0})}),X7=on({getParentRoute:()=>Wt,path:"/plans/$planId",component:Pg}),J7=on({getParentRoute:()=>Wt,path:"/ideas/$ideaId",component:Pg}),Z7=on({getParentRoute:()=>Wt,path:"/docs",component:WC}),eG=on({getParentRoute:()=>Wt,path:"/docs/$section",component:WC}),tG=on({getParentRoute:()=>Wt,path:"/settings",component:HC}),nG=on({getParentRoute:()=>Wt,path:"/settings/$section",component:HC}),rG=on({getParentRoute:()=>Wt,path:"/roadmap",component:$7,validateSearch:e=>({item:typeof e.item=="string"?e.item:void 0})}),sG=on({getParentRoute:()=>Wt,path:"/inbox",component:W7}),iG=on({getParentRoute:()=>Wt,path:"/stats",component:B7}),oG=on({getParentRoute:()=>Wt,path:"/git",component:V7}),aG=on({getParentRoute:()=>Wt,path:"/tasks",component:O7,validateSearch:e=>({taskId:typeof e.taskId=="string"?e.taskId:void 0})}),lG=Wt.addChildren([Q7,X7,J7,Z7,eG,tG,nG,aG,rG,iG,sG,oG]),cG=b2({routeTree:lG,basepath:UC||"/"});M4(UC);const KC=document.getElementById("root");if(!KC)throw new Error("#root element not found");Cb(KC).render(d.jsx(b.StrictMode,{children:d.jsx(S2,{router:cG})}));export{be as $,SG as A,jG as B,He as C,CG as D,aS as E,gm as F,vG as G,Qi as H,AG as I,se as J,We as K,PG as L,gC as M,Ns as N,bG as O,eH as P,tw as Q,de as R,lr as S,Sg as T,wG as U,EG as V,TG as W,p7 as X,i$ as Y,n5 as Z,Io as _,mt as a,FC as a0,bf as a1,V9 as a2,j$ as a3,kH as a4,Va as a5,AC as a6,Ba as a7,eV as a8,J5 as a9,ar as aa,I4 as ab,Z_ as ac,O4 as ad,pG as ae,rs as af,dH as ag,Fa as ah,Oa as ai,AH as aj,Da as ak,rg as al,RG as b,G as c,BH as d,iS as e,kG as f,_e as g,mG as h,La as i,d as j,Jm as k,gG as l,EC as m,NG as n,E9 as o,Dn as p,ji as q,b as r,yG as s,hG as t,M as u,xG as v,Ou as w,rS as x,_G as y,s5 as z};
217
- //# sourceMappingURL=main--EStESJz.js.map