@dendelion/paper-camp 0.18.1 → 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 (82) 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-BHmWkgBW.js +2 -0
  4. package/dist/app/assets/{index-Bm61MVP8.js.map → index-BHmWkgBW.js.map} +1 -1
  5. package/dist/app/assets/index-BuzzfADD.js +2 -0
  6. package/dist/app/assets/index-BuzzfADD.js.map +1 -0
  7. package/dist/app/assets/index-CkLeljbk.js +2 -0
  8. package/dist/app/assets/index-CkLeljbk.js.map +1 -0
  9. package/dist/app/assets/{index-Dz77-ZQi.js → index-DMDqfoCe.js} +3 -3
  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-NfzGv6aM.js → index-DfekHwwU.js} +3 -3
  14. package/dist/app/assets/{index-NfzGv6aM.js.map → index-DfekHwwU.js.map} +1 -1
  15. package/dist/app/assets/index-Gi97Lmex.js +4 -0
  16. package/dist/app/assets/{index-0_VbynEu.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 +3933 -3844
  24. package/dist/app/toolbar.js.map +1 -1
  25. package/dist/chunks/{phase-progress.BIIDRJmI.js → phase-progress.DPAZ01Gg.js} +1942 -1706
  26. package/dist/chunks/phase-progress.DPAZ01Gg.js.map +1 -0
  27. package/dist/cli/index.js +8515 -7725
  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 +39 -2
  37. package/dist/core/git-pr/pr-lookup.d.ts.map +1 -1
  38. package/dist/core/git-pr/pr.d.ts +15 -1
  39. package/dist/core/git-pr/pr.d.ts.map +1 -1
  40. package/dist/core/index.js +108 -101
  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 +16 -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 +116 -5
  62. package/dist/types/index.d.ts.map +1 -1
  63. package/dist/types/index.js +23 -17
  64. package/dist/types/index.js.map +1 -1
  65. package/package.json +2 -2
  66. package/dist/app/assets/index-0_VbynEu.js +0 -4
  67. package/dist/app/assets/index-Bm61MVP8.js +0 -2
  68. package/dist/app/assets/index-CHYyIAaz.js +0 -6
  69. package/dist/app/assets/index-CHYyIAaz.js.map +0 -1
  70. package/dist/app/assets/index-DNRXB82k.js +0 -2
  71. package/dist/app/assets/index-DNRXB82k.js.map +0 -1
  72. package/dist/app/assets/index-Dz77-ZQi.js.map +0 -1
  73. package/dist/app/assets/index-pnCSf_Qk.js +0 -2
  74. package/dist/app/assets/index-pnCSf_Qk.js.map +0 -1
  75. package/dist/app/assets/main-AfQrNPNu.js +0 -217
  76. package/dist/app/assets/main-AfQrNPNu.js.map +0 -1
  77. package/dist/app/assets/main-BuCfycKH.css +0 -1
  78. package/dist/app/assets/sidebar-section-AupYBPL3.js +0 -2
  79. package/dist/app/assets/sidebar-section-AupYBPL3.js.map +0 -1
  80. package/dist/app/assets/tokens-C3C44lLs.js +0 -2
  81. package/dist/app/assets/tokens-C3C44lLs.js.map +0 -1
  82. package/dist/chunks/phase-progress.BIIDRJmI.js.map +0 -1
@@ -1,217 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-NfzGv6aM.js","./sidebar-section-AupYBPL3.js","./index-DNRXB82k.js","./tokens-C3C44lLs.js","./index-Dz77-ZQi.js","./index-Bm61MVP8.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 ic=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function eu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Y0={exports:{}},tu={},X0={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 ka=Symbol.for("react.element"),wC=Symbol.for("react.portal"),bC=Symbol.for("react.fragment"),kC=Symbol.for("react.strict_mode"),_C=Symbol.for("react.profiler"),SC=Symbol.for("react.provider"),CC=Symbol.for("react.context"),jC=Symbol.for("react.forward_ref"),PC=Symbol.for("react.suspense"),EC=Symbol.for("react.memo"),TC=Symbol.for("react.lazy"),vg=Symbol.iterator;function NC(e){return e===null||typeof e!="object"?null:(e=vg&&e[vg]||e["@@iterator"],typeof e=="function"?e:null)}var J0={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Z0=Object.assign,ew={};function Oi(e,t,n){this.props=e,this.context=t,this.refs=ew,this.updater=n||J0}Oi.prototype.isReactComponent={};Oi.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")};Oi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function tw(){}tw.prototype=Oi.prototype;function ap(e,t,n){this.props=e,this.context=t,this.refs=ew,this.updater=n||J0}var lp=ap.prototype=new tw;lp.constructor=ap;Z0(lp,Oi.prototype);lp.isPureReactComponent=!0;var wg=Array.isArray,nw=Object.prototype.hasOwnProperty,cp={current:null},rw={key:!0,ref:!0,__self:!0,__source:!0};function sw(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)nw.call(t,r)&&!rw.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:ka,type:e,key:i,ref:o,props:s,_owner:cp.current}}function RC(e,t){return{$$typeof:ka,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function up(e){return typeof e=="object"&&e!==null&&e.$$typeof===ka}function AC(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var bg=/\/+/g;function Vu(e,t){return typeof e=="object"&&e!==null&&e.key!=null?AC(""+e.key):t.toString(36)}function Nl(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 ka:case wC:o=!0}}if(o)return o=e,s=s(o),e=r===""?"."+Vu(o,0):r,wg(s)?(n="",e!=null&&(n=e.replace(bg,"$&/")+"/"),Nl(s,t,n,"",function(c){return c})):s!=null&&(up(s)&&(s=RC(s,n+(!s.key||o&&o.key===s.key?"":(""+s.key).replace(bg,"$&/")+"/")+e)),t.push(s)),1;if(o=0,r=r===""?".":r+":",wg(e))for(var a=0;a<e.length;a++){i=e[a];var l=r+Vu(i,a);o+=Nl(i,t,n,l,s)}else if(l=NC(e),typeof l=="function")for(e=l.call(e),a=0;!(i=e.next()).done;)i=i.value,l=r+Vu(i,a++),o+=Nl(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 Va(e,t,n){if(e==null)return e;var r=[],s=0;return Nl(e,r,"","",function(i){return t.call(n,i,s++)}),r}function IC(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},Rl={transition:null},MC={ReactCurrentDispatcher:ht,ReactCurrentBatchConfig:Rl,ReactCurrentOwner:cp};function iw(){throw Error("act(...) is not supported in production builds of React.")}ie.Children={map:Va,forEach:function(e,t,n){Va(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Va(e,function(){t++}),t},toArray:function(e){return Va(e,function(t){return t})||[]},only:function(e){if(!up(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ie.Component=Oi;ie.Fragment=bC;ie.Profiler=_C;ie.PureComponent=ap;ie.StrictMode=kC;ie.Suspense=PC;ie.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=MC;ie.act=iw;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=Z0({},e.props),s=e.key,i=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,o=cp.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)nw.call(t,l)&&!rw.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:ka,type:e.type,key:s,ref:i,props:r,_owner:o}};ie.createContext=function(e){return e={$$typeof:CC,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:SC,_context:e},e.Consumer=e};ie.createElement=sw;ie.createFactory=function(e){var t=sw.bind(null,e);return t.type=e,t};ie.createRef=function(){return{current:null}};ie.forwardRef=function(e){return{$$typeof:jC,render:e}};ie.isValidElement=up;ie.lazy=function(e){return{$$typeof:TC,_payload:{_status:-1,_result:e},_init:IC}};ie.memo=function(e,t){return{$$typeof:EC,type:e,compare:t===void 0?null:t}};ie.startTransition=function(e){var t=Rl.transition;Rl.transition={};try{e()}finally{Rl.transition=t}};ie.unstable_act=iw;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";X0.exports=ie;var b=X0.exports;const Si=eu(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 LC=b,DC=Symbol.for("react.element"),FC=Symbol.for("react.fragment"),OC=Object.prototype.hasOwnProperty,zC=LC.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,$C={key:!0,ref:!0,__self:!0,__source:!0};function ow(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)OC.call(t,r)&&!$C.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:DC,type:e,key:i,ref:o,props:s,_owner:zC.current}}tu.Fragment=FC;tu.jsx=ow;tu.jsxs=ow;Y0.exports=tu;var d=Y0.exports,aw={exports:{}},zt={},lw={exports:{}},cw={};/**
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,B){var C=L.length;L.push(B);e:for(;0<C;){var $=C-1>>>1,Q=L[$];if(0<s(Q,B))L[$]=B,L[C]=Q,C=$;else break e}}function n(L){return L.length===0?null:L[0]}function r(L){if(L.length===0)return null;var B=L[0],C=L.pop();if(C!==B){L[0]=C;e:for(var $=0,Q=L.length,R=Q>>>1;$<R;){var ce=2*($+1)-1,pe=L[ce],fe=ce+1,Et=L[fe];if(0>s(pe,C))fe<Q&&0>s(Et,pe)?(L[$]=Et,L[fe]=C,$=fe):(L[$]=pe,L[ce]=C,$=ce);else if(fe<Q&&0>s(Et,C))L[$]=Et,L[fe]=C,$=fe;else break e}}return B}function s(L,B){var C=L.sortIndex-B.sortIndex;return C!==0?C:L.id-B.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,p=3,h=!1,m=!1,y=!1,v=typeof setTimeout=="function"?setTimeout:null,g=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 w(L){for(var B=n(c);B!==null;){if(B.callback===null)r(c);else if(B.startTime<=L)r(c),B.sortIndex=B.expirationTime,t(l,B);else break;B=n(c)}}function k(L){if(y=!1,w(L),!m)if(n(l)!==null)m=!0,z(j);else{var B=n(c);B!==null&&V(k,B.startTime-L)}}function j(L,B){m=!1,y&&(y=!1,g(E),E=-1),h=!0;var C=p;try{for(w(B),f=n(l);f!==null&&(!(f.expirationTime>B)||L&&!A());){var $=f.callback;if(typeof $=="function"){f.callback=null,p=f.priorityLevel;var Q=$(f.expirationTime<=B);B=e.unstable_now(),typeof Q=="function"?f.callback=Q:f===n(l)&&r(l),w(B)}else r(l);f=n(l)}if(f!==null)var R=!0;else{var ce=n(c);ce!==null&&V(k,ce.startTime-B),R=!1}return R}finally{f=null,p=C,h=!1}}var _=!1,S=null,E=-1,T=5,P=-1;function A(){return!(e.unstable_now()-P<T)}function I(){if(S!==null){var L=e.unstable_now();P=L;var B=!0;try{B=S(!0,L)}finally{B?O():(_=!1,S=null)}}else _=!1}var O;if(typeof x=="function")O=function(){x(I)};else if(typeof MessageChannel<"u"){var M=new MessageChannel,N=M.port2;M.port1.onmessage=I,O=function(){N.postMessage(null)}}else O=function(){v(I,0)};function z(L){S=L,_||(_=!0,O())}function V(L,B){E=v(function(){L(e.unstable_now())},B)}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||h||(m=!0,z(j))},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"):T=0<L?Math.floor(1e3/L):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(L){switch(p){case 1:case 2:case 3:var B=3;break;default:B=p}var C=p;p=B;try{return L()}finally{p=C}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(L,B){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var C=p;p=L;try{return B()}finally{p=C}},e.unstable_scheduleCallback=function(L,B,C){var $=e.unstable_now();switch(typeof C=="object"&&C!==null?(C=C.delay,C=typeof C=="number"&&0<C?$+C:$):C=$,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=C+Q,L={id:u++,callback:B,priorityLevel:L,startTime:C,expirationTime:Q,sortIndex:-1},C>$?(L.sortIndex=C,t(c,L),n(l)===null&&L===n(c)&&(y?(g(E),E=-1):y=!0,V(k,C-$))):(L.sortIndex=Q,t(l,L),m||h||(m=!0,z(j))),L},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(L){var B=p;return function(){var C=p;p=B;try{return L.apply(this,arguments)}finally{p=C}}}})(cw);lw.exports=cw;var BC=lw.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 VC=b,Ot=BC;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 uw=new Set,Qo={};function Ms(e,t){Ci(e,t),Ci(e+"Capture",t)}function Ci(e,t){for(Qo[e]=t,e=0;e<t.length;e++)uw.add(t[e])}var er=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),wf=Object.prototype.hasOwnProperty,UC=/^[: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]*$/,kg={},_g={};function WC(e){return wf.call(_g,e)?!0:wf.call(kg,e)?!1:UC.test(e)?_g[e]=!0:(kg[e]=!0,!1)}function HC(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 GC(e,t,n,r){if(t===null||typeof t>"u"||HC(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 dp=/[\-:]([a-z])/g;function fp(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(dp,fp);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(dp,fp);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(dp,fp);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 hp(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")&&(GC(t,n,s,r)&&(n=null),r||s===null?WC(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 ir=VC.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Ua=Symbol.for("react.element"),Zs=Symbol.for("react.portal"),ei=Symbol.for("react.fragment"),pp=Symbol.for("react.strict_mode"),bf=Symbol.for("react.profiler"),dw=Symbol.for("react.provider"),fw=Symbol.for("react.context"),mp=Symbol.for("react.forward_ref"),kf=Symbol.for("react.suspense"),_f=Symbol.for("react.suspense_list"),gp=Symbol.for("react.memo"),vr=Symbol.for("react.lazy"),hw=Symbol.for("react.offscreen"),Sg=Symbol.iterator;function eo(e){return e===null||typeof e!="object"?null:(e=Sg&&e[Sg]||e["@@iterator"],typeof e=="function"?e:null)}var Re=Object.assign,Uu;function _o(e){if(Uu===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Uu=t&&t[1]||""}return`
35
- `+Uu+e}var Wu=!1;function Hu(e,t){if(!e||Wu)return"";Wu=!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{Wu=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?_o(e):""}function KC(e){switch(e.tag){case 5:return _o(e.type);case 16:return _o("Lazy");case 13:return _o("Suspense");case 19:return _o("SuspenseList");case 0:case 2:case 15:return e=Hu(e.type,!1),e;case 11:return e=Hu(e.type.render,!1),e;case 1:return e=Hu(e.type,!0),e;default:return""}}function Sf(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 ei:return"Fragment";case Zs:return"Portal";case bf:return"Profiler";case pp:return"StrictMode";case kf:return"Suspense";case _f:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case fw:return(e.displayName||"Context")+".Consumer";case dw:return(e._context.displayName||"Context")+".Provider";case mp:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case gp:return t=e.displayName||null,t!==null?t:Sf(e.type)||"Memo";case vr:t=e._payload,e=e._init;try{return Sf(e(t))}catch{}}return null}function qC(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 Sf(t);case 8:return t===pp?"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 Br(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function pw(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function QC(e){var t=pw(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 Wa(e){e._valueTracker||(e._valueTracker=QC(e))}function mw(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=pw(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function oc(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 Cf(e,t){var n=t.checked;return Re({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Cg(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Br(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 gw(e,t){t=t.checked,t!=null&&hp(e,"checked",t,!1)}function jf(e,t){gw(e,t);var n=Br(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")?Pf(e,t.type,n):t.hasOwnProperty("defaultValue")&&Pf(e,t.type,Br(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function jg(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 Pf(e,t,n){(t!=="number"||oc(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var So=Array.isArray;function mi(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=""+Br(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 Ef(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(U(91));return Re({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Pg(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(So(n)){if(1<n.length)throw Error(U(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Br(n)}}function yw(e,t){var n=Br(t.value),r=Br(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 Eg(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function xw(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 Tf(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?xw(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Ha,vw=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(Ha=Ha||document.createElement("div"),Ha.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Ha.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Yo(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var No={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},YC=["Webkit","ms","Moz","O"];Object.keys(No).forEach(function(e){YC.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),No[t]=No[e]})});function ww(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||No.hasOwnProperty(e)&&No[e]?(""+t).trim():t+"px"}function bw(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=ww(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var XC=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 Nf(e,t){if(t){if(XC[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 Rf(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 Af=null;function yp(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var If=null,gi=null,yi=null;function Tg(e){if(e=Ca(e)){if(typeof If!="function")throw Error(U(280));var t=e.stateNode;t&&(t=ou(t),If(e.stateNode,e.type,t))}}function kw(e){gi?yi?yi.push(e):yi=[e]:gi=e}function _w(){if(gi){var e=gi,t=yi;if(yi=gi=null,Tg(e),t)for(e=0;e<t.length;e++)Tg(t[e])}}function Sw(e,t){return e(t)}function Cw(){}var Gu=!1;function jw(e,t,n){if(Gu)return e(t,n);Gu=!0;try{return Sw(e,t,n)}finally{Gu=!1,(gi!==null||yi!==null)&&(Cw(),_w())}}function Xo(e,t){var n=e.stateNode;if(n===null)return null;var r=ou(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 Mf=!1;if(er)try{var to={};Object.defineProperty(to,"passive",{get:function(){Mf=!0}}),window.addEventListener("test",to,to),window.removeEventListener("test",to,to)}catch{Mf=!1}function JC(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 Ro=!1,ac=null,lc=!1,Lf=null,ZC={onError:function(e){Ro=!0,ac=e}};function ej(e,t,n,r,s,i,o,a,l){Ro=!1,ac=null,JC.apply(ZC,arguments)}function tj(e,t,n,r,s,i,o,a,l){if(ej.apply(this,arguments),Ro){if(Ro){var c=ac;Ro=!1,ac=null}else throw Error(U(198));lc||(lc=!0,Lf=c)}}function Ls(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 Pw(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 Ng(e){if(Ls(e)!==e)throw Error(U(188))}function nj(e){var t=e.alternate;if(!t){if(t=Ls(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 Ng(s),e;if(i===r)return Ng(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 Ew(e){return e=nj(e),e!==null?Tw(e):null}function Tw(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Tw(e);if(t!==null)return t;e=e.sibling}return null}var Nw=Ot.unstable_scheduleCallback,Rg=Ot.unstable_cancelCallback,rj=Ot.unstable_shouldYield,sj=Ot.unstable_requestPaint,De=Ot.unstable_now,ij=Ot.unstable_getCurrentPriorityLevel,xp=Ot.unstable_ImmediatePriority,Rw=Ot.unstable_UserBlockingPriority,cc=Ot.unstable_NormalPriority,oj=Ot.unstable_LowPriority,Aw=Ot.unstable_IdlePriority,nu=null,Mn=null;function aj(e){if(Mn&&typeof Mn.onCommitFiberRoot=="function")try{Mn.onCommitFiberRoot(nu,e,void 0,(e.current.flags&128)===128)}catch{}}var gn=Math.clz32?Math.clz32:uj,lj=Math.log,cj=Math.LN2;function uj(e){return e>>>=0,e===0?32:31-(lj(e)/cj|0)|0}var Ga=64,Ka=4194304;function Co(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 uc(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=Co(a):(i&=o,i!==0&&(r=Co(i)))}else o=n&~s,o!==0?r=Co(o):i!==0&&(r=Co(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-gn(t),s=1<<n,r|=e[n],t&=~s;return r}function dj(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 fj(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,i=e.pendingLanes;0<i;){var o=31-gn(i),a=1<<o,l=s[o];l===-1?(!(a&n)||a&r)&&(s[o]=dj(a,t)):l<=t&&(e.expiredLanes|=a),i&=~a}}function Df(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Iw(){var e=Ga;return Ga<<=1,!(Ga&4194240)&&(Ga=64),e}function Ku(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function _a(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-gn(t),e[t]=n}function hj(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-gn(n),i=1<<s;t[s]=0,r[s]=-1,e[s]=-1,n&=~i}}function vp(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-gn(n),s=1<<r;s&t|e[r]&t&&(e[r]|=t),n&=~s}}var ue=0;function Mw(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Lw,wp,Dw,Fw,Ow,Ff=!1,qa=[],Rr=null,Ar=null,Ir=null,Jo=new Map,Zo=new Map,kr=[],pj="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 Ag(e,t){switch(e){case"focusin":case"focusout":Rr=null;break;case"dragenter":case"dragleave":Ar=null;break;case"mouseover":case"mouseout":Ir=null;break;case"pointerover":case"pointerout":Jo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Zo.delete(t.pointerId)}}function no(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=Ca(t),t!==null&&wp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function mj(e,t,n,r,s){switch(t){case"focusin":return Rr=no(Rr,e,t,n,r,s),!0;case"dragenter":return Ar=no(Ar,e,t,n,r,s),!0;case"mouseover":return Ir=no(Ir,e,t,n,r,s),!0;case"pointerover":var i=s.pointerId;return Jo.set(i,no(Jo.get(i)||null,e,t,n,r,s)),!0;case"gotpointercapture":return i=s.pointerId,Zo.set(i,no(Zo.get(i)||null,e,t,n,r,s)),!0}return!1}function zw(e){var t=ms(e.target);if(t!==null){var n=Ls(t);if(n!==null){if(t=n.tag,t===13){if(t=Pw(n),t!==null){e.blockedOn=t,Ow(e.priority,function(){Dw(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 Al(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Of(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Af=r,n.target.dispatchEvent(r),Af=null}else return t=Ca(n),t!==null&&wp(t),e.blockedOn=n,!1;t.shift()}return!0}function Ig(e,t,n){Al(e)&&n.delete(t)}function gj(){Ff=!1,Rr!==null&&Al(Rr)&&(Rr=null),Ar!==null&&Al(Ar)&&(Ar=null),Ir!==null&&Al(Ir)&&(Ir=null),Jo.forEach(Ig),Zo.forEach(Ig)}function ro(e,t){e.blockedOn===t&&(e.blockedOn=null,Ff||(Ff=!0,Ot.unstable_scheduleCallback(Ot.unstable_NormalPriority,gj)))}function ea(e){function t(s){return ro(s,e)}if(0<qa.length){ro(qa[0],e);for(var n=1;n<qa.length;n++){var r=qa[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Rr!==null&&ro(Rr,e),Ar!==null&&ro(Ar,e),Ir!==null&&ro(Ir,e),Jo.forEach(t),Zo.forEach(t),n=0;n<kr.length;n++)r=kr[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<kr.length&&(n=kr[0],n.blockedOn===null);)zw(n),n.blockedOn===null&&kr.shift()}var xi=ir.ReactCurrentBatchConfig,dc=!0;function yj(e,t,n,r){var s=ue,i=xi.transition;xi.transition=null;try{ue=1,bp(e,t,n,r)}finally{ue=s,xi.transition=i}}function xj(e,t,n,r){var s=ue,i=xi.transition;xi.transition=null;try{ue=4,bp(e,t,n,r)}finally{ue=s,xi.transition=i}}function bp(e,t,n,r){if(dc){var s=Of(e,t,n,r);if(s===null)rd(e,t,r,fc,n),Ag(e,r);else if(mj(s,e,t,n,r))r.stopPropagation();else if(Ag(e,r),t&4&&-1<pj.indexOf(e)){for(;s!==null;){var i=Ca(s);if(i!==null&&Lw(i),i=Of(e,t,n,r),i===null&&rd(e,t,r,fc,n),i===s)break;s=i}s!==null&&r.stopPropagation()}else rd(e,t,r,null,n)}}var fc=null;function Of(e,t,n,r){if(fc=null,e=yp(r),e=ms(e),e!==null)if(t=Ls(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Pw(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 fc=e,null}function $w(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 xp:return 1;case Rw:return 4;case cc:case oj:return 16;case Aw:return 536870912;default:return 16}default:return 16}}var Sr=null,kp=null,Il=null;function Bw(){if(Il)return Il;var e,t=kp,n=t.length,r,s="value"in Sr?Sr.value:Sr.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 Il=s.slice(e,1<r?1-r:void 0)}function Ml(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 Qa(){return!0}function Mg(){return!1}function $t(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)?Qa:Mg,this.isPropagationStopped=Mg,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=Qa)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Qa)},persist:function(){},isPersistent:Qa}),t}var zi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},_p=$t(zi),Sa=Re({},zi,{view:0,detail:0}),vj=$t(Sa),qu,Qu,so,ru=Re({},Sa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Sp,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!==so&&(so&&e.type==="mousemove"?(qu=e.screenX-so.screenX,Qu=e.screenY-so.screenY):Qu=qu=0,so=e),qu)},movementY:function(e){return"movementY"in e?e.movementY:Qu}}),Lg=$t(ru),wj=Re({},ru,{dataTransfer:0}),bj=$t(wj),kj=Re({},Sa,{relatedTarget:0}),Yu=$t(kj),_j=Re({},zi,{animationName:0,elapsedTime:0,pseudoElement:0}),Sj=$t(_j),Cj=Re({},zi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),jj=$t(Cj),Pj=Re({},zi,{data:0}),Dg=$t(Pj),Ej={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Tj={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"},Nj={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Rj(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Nj[e])?!!t[e]:!1}function Sp(){return Rj}var Aj=Re({},Sa,{key:function(e){if(e.key){var t=Ej[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ml(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Tj[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Sp,charCode:function(e){return e.type==="keypress"?Ml(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ml(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Ij=$t(Aj),Mj=Re({},ru,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Fg=$t(Mj),Lj=Re({},Sa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Sp}),Dj=$t(Lj),Fj=Re({},zi,{propertyName:0,elapsedTime:0,pseudoElement:0}),Oj=$t(Fj),zj=Re({},ru,{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}),$j=$t(zj),Bj=[9,13,27,32],Cp=er&&"CompositionEvent"in window,Ao=null;er&&"documentMode"in document&&(Ao=document.documentMode);var Vj=er&&"TextEvent"in window&&!Ao,Vw=er&&(!Cp||Ao&&8<Ao&&11>=Ao),Og=" ",zg=!1;function Uw(e,t){switch(e){case"keyup":return Bj.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ww(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ti=!1;function Uj(e,t){switch(e){case"compositionend":return Ww(t);case"keypress":return t.which!==32?null:(zg=!0,Og);case"textInput":return e=t.data,e===Og&&zg?null:e;default:return null}}function Wj(e,t){if(ti)return e==="compositionend"||!Cp&&Uw(e,t)?(e=Bw(),Il=kp=Sr=null,ti=!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 Vw&&t.locale!=="ko"?null:t.data;default:return null}}var Hj={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 $g(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Hj[e.type]:t==="textarea"}function Hw(e,t,n,r){kw(r),t=hc(t,"onChange"),0<t.length&&(n=new _p("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Io=null,ta=null;function Gj(e){n1(e,0)}function su(e){var t=si(e);if(mw(t))return e}function Kj(e,t){if(e==="change")return t}var Gw=!1;if(er){var Xu;if(er){var Ju="oninput"in document;if(!Ju){var Bg=document.createElement("div");Bg.setAttribute("oninput","return;"),Ju=typeof Bg.oninput=="function"}Xu=Ju}else Xu=!1;Gw=Xu&&(!document.documentMode||9<document.documentMode)}function Vg(){Io&&(Io.detachEvent("onpropertychange",Kw),ta=Io=null)}function Kw(e){if(e.propertyName==="value"&&su(ta)){var t=[];Hw(t,ta,e,yp(e)),jw(Gj,t)}}function qj(e,t,n){e==="focusin"?(Vg(),Io=t,ta=n,Io.attachEvent("onpropertychange",Kw)):e==="focusout"&&Vg()}function Qj(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return su(ta)}function Yj(e,t){if(e==="click")return su(t)}function Xj(e,t){if(e==="input"||e==="change")return su(t)}function Jj(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var vn=typeof Object.is=="function"?Object.is:Jj;function na(e,t){if(vn(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(!wf.call(t,s)||!vn(e[s],t[s]))return!1}return!0}function Ug(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Wg(e,t){var n=Ug(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=Ug(n)}}function qw(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?qw(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Qw(){for(var e=window,t=oc();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=oc(e.document)}return t}function jp(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 Zj(e){var t=Qw(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&qw(n.ownerDocument.documentElement,n)){if(r!==null&&jp(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=Wg(n,i);var o=Wg(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=er&&"documentMode"in document&&11>=document.documentMode,ni=null,zf=null,Mo=null,$f=!1;function Hg(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;$f||ni==null||ni!==oc(r)||(r=ni,"selectionStart"in r&&jp(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}),Mo&&na(Mo,r)||(Mo=r,r=hc(zf,"onSelect"),0<r.length&&(t=new _p("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=ni)))}function Ya(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ri={animationend:Ya("Animation","AnimationEnd"),animationiteration:Ya("Animation","AnimationIteration"),animationstart:Ya("Animation","AnimationStart"),transitionend:Ya("Transition","TransitionEnd")},Zu={},Yw={};er&&(Yw=document.createElement("div").style,"AnimationEvent"in window||(delete ri.animationend.animation,delete ri.animationiteration.animation,delete ri.animationstart.animation),"TransitionEvent"in window||delete ri.transitionend.transition);function iu(e){if(Zu[e])return Zu[e];if(!ri[e])return e;var t=ri[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Yw)return Zu[e]=t[n];return e}var Xw=iu("animationend"),Jw=iu("animationiteration"),Zw=iu("animationstart"),e1=iu("transitionend"),t1=new Map,Gg="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 Kr(e,t){t1.set(e,t),Ms(t,[e])}for(var ed=0;ed<Gg.length;ed++){var td=Gg[ed],tP=td.toLowerCase(),nP=td[0].toUpperCase()+td.slice(1);Kr(tP,"on"+nP)}Kr(Xw,"onAnimationEnd");Kr(Jw,"onAnimationIteration");Kr(Zw,"onAnimationStart");Kr("dblclick","onDoubleClick");Kr("focusin","onFocus");Kr("focusout","onBlur");Kr(e1,"onTransitionEnd");Ci("onMouseEnter",["mouseout","mouseover"]);Ci("onMouseLeave",["mouseout","mouseover"]);Ci("onPointerEnter",["pointerout","pointerover"]);Ci("onPointerLeave",["pointerout","pointerover"]);Ms("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Ms("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Ms("onBeforeInput",["compositionend","keypress","textInput","paste"]);Ms("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Ms("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Ms("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var jo="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(jo));function Kg(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,tj(r,t,void 0,e),e.currentTarget=null}function n1(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;Kg(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;Kg(s,a,c),i=l}}}if(lc)throw e=Lf,lc=!1,Lf=null,e}function _e(e,t){var n=t[Hf];n===void 0&&(n=t[Hf]=new Set);var r=e+"__bubble";n.has(r)||(r1(t,e,2,!1),n.add(r))}function nd(e,t,n){var r=0;t&&(r|=4),r1(n,e,r,t)}var Xa="_reactListening"+Math.random().toString(36).slice(2);function ra(e){if(!e[Xa]){e[Xa]=!0,uw.forEach(function(n){n!=="selectionchange"&&(rP.has(n)||nd(n,!1,e),nd(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Xa]||(t[Xa]=!0,nd("selectionchange",!1,t))}}function r1(e,t,n,r){switch($w(t)){case 1:var s=yj;break;case 4:s=xj;break;default:s=bp}n=s.bind(null,t,n,e),s=void 0,!Mf||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 rd(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=ms(a),o===null)return;if(l=o.tag,l===5||l===6){r=i=o;continue e}a=a.parentNode}}r=r.return}jw(function(){var c=i,u=yp(n),f=[];e:{var p=t1.get(e);if(p!==void 0){var h=_p,m=e;switch(e){case"keypress":if(Ml(n)===0)break e;case"keydown":case"keyup":h=Ij;break;case"focusin":m="focus",h=Yu;break;case"focusout":m="blur",h=Yu;break;case"beforeblur":case"afterblur":h=Yu;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":h=Lg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=bj;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=Dj;break;case Xw:case Jw:case Zw:h=Sj;break;case e1:h=Oj;break;case"scroll":h=vj;break;case"wheel":h=$j;break;case"copy":case"cut":case"paste":h=jj;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=Fg}var y=(t&4)!==0,v=!y&&e==="scroll",g=y?p!==null?p+"Capture":null:p;y=[];for(var x=c,w;x!==null;){w=x;var k=w.stateNode;if(w.tag===5&&k!==null&&(w=k,g!==null&&(k=Xo(x,g),k!=null&&y.push(sa(x,k,w)))),v)break;x=x.return}0<y.length&&(p=new h(p,m,null,n,u),f.push({event:p,listeners:y}))}}if(!(t&7)){e:{if(p=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",p&&n!==Af&&(m=n.relatedTarget||n.fromElement)&&(ms(m)||m[tr]))break e;if((h||p)&&(p=u.window===u?u:(p=u.ownerDocument)?p.defaultView||p.parentWindow:window,h?(m=n.relatedTarget||n.toElement,h=c,m=m?ms(m):null,m!==null&&(v=Ls(m),m!==v||m.tag!==5&&m.tag!==6)&&(m=null)):(h=null,m=c),h!==m)){if(y=Lg,k="onMouseLeave",g="onMouseEnter",x="mouse",(e==="pointerout"||e==="pointerover")&&(y=Fg,k="onPointerLeave",g="onPointerEnter",x="pointer"),v=h==null?p:si(h),w=m==null?p:si(m),p=new y(k,x+"leave",h,n,u),p.target=v,p.relatedTarget=w,k=null,ms(u)===c&&(y=new y(g,x+"enter",m,n,u),y.target=w,y.relatedTarget=v,k=y),v=k,h&&m)t:{for(y=h,g=m,x=0,w=y;w;w=Us(w))x++;for(w=0,k=g;k;k=Us(k))w++;for(;0<x-w;)y=Us(y),x--;for(;0<w-x;)g=Us(g),w--;for(;x--;){if(y===g||g!==null&&y===g.alternate)break t;y=Us(y),g=Us(g)}y=null}else y=null;h!==null&&qg(f,p,h,y,!1),m!==null&&v!==null&&qg(f,v,m,y,!0)}}e:{if(p=c?si(c):window,h=p.nodeName&&p.nodeName.toLowerCase(),h==="select"||h==="input"&&p.type==="file")var j=Kj;else if($g(p))if(Gw)j=Xj;else{j=Qj;var _=qj}else(h=p.nodeName)&&h.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(j=Yj);if(j&&(j=j(e,c))){Hw(f,j,n,u);break e}_&&_(e,p,c),e==="focusout"&&(_=p._wrapperState)&&_.controlled&&p.type==="number"&&Pf(p,"number",p.value)}switch(_=c?si(c):window,e){case"focusin":($g(_)||_.contentEditable==="true")&&(ni=_,zf=c,Mo=null);break;case"focusout":Mo=zf=ni=null;break;case"mousedown":$f=!0;break;case"contextmenu":case"mouseup":case"dragend":$f=!1,Hg(f,n,u);break;case"selectionchange":if(eP)break;case"keydown":case"keyup":Hg(f,n,u)}var S;if(Cp)e:{switch(e){case"compositionstart":var E="onCompositionStart";break e;case"compositionend":E="onCompositionEnd";break e;case"compositionupdate":E="onCompositionUpdate";break e}E=void 0}else ti?Uw(e,n)&&(E="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(E="onCompositionStart");E&&(Vw&&n.locale!=="ko"&&(ti||E!=="onCompositionStart"?E==="onCompositionEnd"&&ti&&(S=Bw()):(Sr=u,kp="value"in Sr?Sr.value:Sr.textContent,ti=!0)),_=hc(c,E),0<_.length&&(E=new Dg(E,e,null,n,u),f.push({event:E,listeners:_}),S?E.data=S:(S=Ww(n),S!==null&&(E.data=S)))),(S=Vj?Uj(e,n):Wj(e,n))&&(c=hc(c,"onBeforeInput"),0<c.length&&(u=new Dg("onBeforeInput","beforeinput",null,n,u),f.push({event:u,listeners:c}),u.data=S))}n1(f,t)})}function sa(e,t,n){return{instance:e,listener:t,currentTarget:n}}function hc(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,i=s.stateNode;s.tag===5&&i!==null&&(s=i,i=Xo(e,n),i!=null&&r.unshift(sa(e,i,s)),i=Xo(e,t),i!=null&&r.push(sa(e,i,s))),e=e.return}return r}function Us(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function qg(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=Xo(n,i),l!=null&&o.unshift(sa(n,l,a))):s||(l=Xo(n,i),l!=null&&o.push(sa(n,l,a)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var sP=/\r\n?/g,iP=/\u0000|\uFFFD/g;function Qg(e){return(typeof e=="string"?e:""+e).replace(sP,`
39
- `).replace(iP,"")}function Ja(e,t,n){if(t=Qg(t),Qg(e)!==t&&n)throw Error(U(425))}function pc(){}var Bf=null,Vf=null;function Uf(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 Wf=typeof setTimeout=="function"?setTimeout:void 0,oP=typeof clearTimeout=="function"?clearTimeout:void 0,Yg=typeof Promise=="function"?Promise:void 0,aP=typeof queueMicrotask=="function"?queueMicrotask:typeof Yg<"u"?function(e){return Yg.resolve(null).then(e).catch(lP)}:Wf;function lP(e){setTimeout(function(){throw e})}function sd(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),ea(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);ea(t)}function Mr(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 Xg(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 $i=Math.random().toString(36).slice(2),An="__reactFiber$"+$i,ia="__reactProps$"+$i,tr="__reactContainer$"+$i,Hf="__reactEvents$"+$i,cP="__reactListeners$"+$i,uP="__reactHandles$"+$i;function ms(e){var t=e[An];if(t)return t;for(var n=e.parentNode;n;){if(t=n[tr]||n[An]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Xg(e);e!==null;){if(n=e[An])return n;e=Xg(e)}return t}e=n,n=e.parentNode}return null}function Ca(e){return e=e[An]||e[tr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function si(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(U(33))}function ou(e){return e[ia]||null}var Gf=[],ii=-1;function qr(e){return{current:e}}function Se(e){0>ii||(e.current=Gf[ii],Gf[ii]=null,ii--)}function we(e,t){ii++,Gf[ii]=e.current,e.current=t}var Vr={},it=qr(Vr),wt=qr(!1),Ts=Vr;function ji(e,t){var n=e.type.contextTypes;if(!n)return Vr;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 bt(e){return e=e.childContextTypes,e!=null}function mc(){Se(wt),Se(it)}function Jg(e,t,n){if(it.current!==Vr)throw Error(U(168));we(it,t),we(wt,n)}function s1(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,qC(e)||"Unknown",s));return Re({},n,r)}function gc(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Vr,Ts=it.current,we(it,e),we(wt,wt.current),!0}function Zg(e,t,n){var r=e.stateNode;if(!r)throw Error(U(169));n?(e=s1(e,t,Ts),r.__reactInternalMemoizedMergedChildContext=e,Se(wt),Se(it),we(it,e)):Se(wt),we(wt,n)}var qn=null,au=!1,id=!1;function i1(e){qn===null?qn=[e]:qn.push(e)}function dP(e){au=!0,i1(e)}function Qr(){if(!id&&qn!==null){id=!0;var e=0,t=ue;try{var n=qn;for(ue=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}qn=null,au=!1}catch(s){throw qn!==null&&(qn=qn.slice(e+1)),Nw(xp,Qr),s}finally{ue=t,id=!1}}return null}var oi=[],ai=0,yc=null,xc=0,Qt=[],Yt=0,Ns=null,Yn=1,Xn="";function ls(e,t){oi[ai++]=xc,oi[ai++]=yc,yc=e,xc=t}function o1(e,t,n){Qt[Yt++]=Yn,Qt[Yt++]=Xn,Qt[Yt++]=Ns,Ns=e;var r=Yn;e=Xn;var s=32-gn(r)-1;r&=~(1<<s),n+=1;var i=32-gn(t)+s;if(30<i){var o=s-s%5;i=(r&(1<<o)-1).toString(32),r>>=o,s-=o,Yn=1<<32-gn(t)+s|n<<s|r,Xn=i+e}else Yn=1<<i|n<<s|r,Xn=e}function Pp(e){e.return!==null&&(ls(e,1),o1(e,1,0))}function Ep(e){for(;e===yc;)yc=oi[--ai],oi[ai]=null,xc=oi[--ai],oi[ai]=null;for(;e===Ns;)Ns=Qt[--Yt],Qt[Yt]=null,Xn=Qt[--Yt],Qt[Yt]=null,Yn=Qt[--Yt],Qt[Yt]=null}var Dt=null,Mt=null,je=!1,mn=null;function a1(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 ey(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,Dt=e,Mt=Mr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Dt=e,Mt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Ns!==null?{id:Yn,overflow:Xn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Jt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Dt=e,Mt=null,!0):!1;default:return!1}}function Kf(e){return(e.mode&1)!==0&&(e.flags&128)===0}function qf(e){if(je){var t=Mt;if(t){var n=t;if(!ey(e,t)){if(Kf(e))throw Error(U(418));t=Mr(n.nextSibling);var r=Dt;t&&ey(e,t)?a1(r,n):(e.flags=e.flags&-4097|2,je=!1,Dt=e)}}else{if(Kf(e))throw Error(U(418));e.flags=e.flags&-4097|2,je=!1,Dt=e}}}function ty(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Dt=e}function Za(e){if(e!==Dt)return!1;if(!je)return ty(e),je=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Uf(e.type,e.memoizedProps)),t&&(t=Mt)){if(Kf(e))throw l1(),Error(U(418));for(;t;)a1(e,t),t=Mr(t.nextSibling)}if(ty(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){Mt=Mr(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Mt=null}}else Mt=Dt?Mr(e.stateNode.nextSibling):null;return!0}function l1(){for(var e=Mt;e;)e=Mr(e.nextSibling)}function Pi(){Mt=Dt=null,je=!1}function Tp(e){mn===null?mn=[e]:mn.push(e)}var fP=ir.ReactCurrentBatchConfig;function io(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 el(e,t){throw e=Object.prototype.toString.call(t),Error(U(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function ny(e){var t=e._init;return t(e._payload)}function c1(e){function t(g,x){if(e){var w=g.deletions;w===null?(g.deletions=[x],g.flags|=16):w.push(x)}}function n(g,x){if(!e)return null;for(;x!==null;)t(g,x),x=x.sibling;return null}function r(g,x){for(g=new Map;x!==null;)x.key!==null?g.set(x.key,x):g.set(x.index,x),x=x.sibling;return g}function s(g,x){return g=Or(g,x),g.index=0,g.sibling=null,g}function i(g,x,w){return g.index=w,e?(w=g.alternate,w!==null?(w=w.index,w<x?(g.flags|=2,x):w):(g.flags|=2,x)):(g.flags|=1048576,x)}function o(g){return e&&g.alternate===null&&(g.flags|=2),g}function a(g,x,w,k){return x===null||x.tag!==6?(x=fd(w,g.mode,k),x.return=g,x):(x=s(x,w),x.return=g,x)}function l(g,x,w,k){var j=w.type;return j===ei?u(g,x,w.props.children,k,w.key):x!==null&&(x.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===vr&&ny(j)===x.type)?(k=s(x,w.props),k.ref=io(g,x,w),k.return=g,k):(k=Bl(w.type,w.key,w.props,null,g.mode,k),k.ref=io(g,x,w),k.return=g,k)}function c(g,x,w,k){return x===null||x.tag!==4||x.stateNode.containerInfo!==w.containerInfo||x.stateNode.implementation!==w.implementation?(x=hd(w,g.mode,k),x.return=g,x):(x=s(x,w.children||[]),x.return=g,x)}function u(g,x,w,k,j){return x===null||x.tag!==7?(x=ks(w,g.mode,k,j),x.return=g,x):(x=s(x,w),x.return=g,x)}function f(g,x,w){if(typeof x=="string"&&x!==""||typeof x=="number")return x=fd(""+x,g.mode,w),x.return=g,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Ua:return w=Bl(x.type,x.key,x.props,null,g.mode,w),w.ref=io(g,null,x),w.return=g,w;case Zs:return x=hd(x,g.mode,w),x.return=g,x;case vr:var k=x._init;return f(g,k(x._payload),w)}if(So(x)||eo(x))return x=ks(x,g.mode,w,null),x.return=g,x;el(g,x)}return null}function p(g,x,w,k){var j=x!==null?x.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return j!==null?null:a(g,x,""+w,k);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Ua:return w.key===j?l(g,x,w,k):null;case Zs:return w.key===j?c(g,x,w,k):null;case vr:return j=w._init,p(g,x,j(w._payload),k)}if(So(w)||eo(w))return j!==null?null:u(g,x,w,k,null);el(g,w)}return null}function h(g,x,w,k,j){if(typeof k=="string"&&k!==""||typeof k=="number")return g=g.get(w)||null,a(x,g,""+k,j);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case Ua:return g=g.get(k.key===null?w:k.key)||null,l(x,g,k,j);case Zs:return g=g.get(k.key===null?w:k.key)||null,c(x,g,k,j);case vr:var _=k._init;return h(g,x,w,_(k._payload),j)}if(So(k)||eo(k))return g=g.get(w)||null,u(x,g,k,j,null);el(x,k)}return null}function m(g,x,w,k){for(var j=null,_=null,S=x,E=x=0,T=null;S!==null&&E<w.length;E++){S.index>E?(T=S,S=null):T=S.sibling;var P=p(g,S,w[E],k);if(P===null){S===null&&(S=T);break}e&&S&&P.alternate===null&&t(g,S),x=i(P,x,E),_===null?j=P:_.sibling=P,_=P,S=T}if(E===w.length)return n(g,S),je&&ls(g,E),j;if(S===null){for(;E<w.length;E++)S=f(g,w[E],k),S!==null&&(x=i(S,x,E),_===null?j=S:_.sibling=S,_=S);return je&&ls(g,E),j}for(S=r(g,S);E<w.length;E++)T=h(S,g,E,w[E],k),T!==null&&(e&&T.alternate!==null&&S.delete(T.key===null?E:T.key),x=i(T,x,E),_===null?j=T:_.sibling=T,_=T);return e&&S.forEach(function(A){return t(g,A)}),je&&ls(g,E),j}function y(g,x,w,k){var j=eo(w);if(typeof j!="function")throw Error(U(150));if(w=j.call(w),w==null)throw Error(U(151));for(var _=j=null,S=x,E=x=0,T=null,P=w.next();S!==null&&!P.done;E++,P=w.next()){S.index>E?(T=S,S=null):T=S.sibling;var A=p(g,S,P.value,k);if(A===null){S===null&&(S=T);break}e&&S&&A.alternate===null&&t(g,S),x=i(A,x,E),_===null?j=A:_.sibling=A,_=A,S=T}if(P.done)return n(g,S),je&&ls(g,E),j;if(S===null){for(;!P.done;E++,P=w.next())P=f(g,P.value,k),P!==null&&(x=i(P,x,E),_===null?j=P:_.sibling=P,_=P);return je&&ls(g,E),j}for(S=r(g,S);!P.done;E++,P=w.next())P=h(S,g,E,P.value,k),P!==null&&(e&&P.alternate!==null&&S.delete(P.key===null?E:P.key),x=i(P,x,E),_===null?j=P:_.sibling=P,_=P);return e&&S.forEach(function(I){return t(g,I)}),je&&ls(g,E),j}function v(g,x,w,k){if(typeof w=="object"&&w!==null&&w.type===ei&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Ua:e:{for(var j=w.key,_=x;_!==null;){if(_.key===j){if(j=w.type,j===ei){if(_.tag===7){n(g,_.sibling),x=s(_,w.props.children),x.return=g,g=x;break e}}else if(_.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===vr&&ny(j)===_.type){n(g,_.sibling),x=s(_,w.props),x.ref=io(g,_,w),x.return=g,g=x;break e}n(g,_);break}else t(g,_);_=_.sibling}w.type===ei?(x=ks(w.props.children,g.mode,k,w.key),x.return=g,g=x):(k=Bl(w.type,w.key,w.props,null,g.mode,k),k.ref=io(g,x,w),k.return=g,g=k)}return o(g);case Zs:e:{for(_=w.key;x!==null;){if(x.key===_)if(x.tag===4&&x.stateNode.containerInfo===w.containerInfo&&x.stateNode.implementation===w.implementation){n(g,x.sibling),x=s(x,w.children||[]),x.return=g,g=x;break e}else{n(g,x);break}else t(g,x);x=x.sibling}x=hd(w,g.mode,k),x.return=g,g=x}return o(g);case vr:return _=w._init,v(g,x,_(w._payload),k)}if(So(w))return m(g,x,w,k);if(eo(w))return y(g,x,w,k);el(g,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,x!==null&&x.tag===6?(n(g,x.sibling),x=s(x,w),x.return=g,g=x):(n(g,x),x=fd(w,g.mode,k),x.return=g,g=x),o(g)):n(g,x)}return v}var Ei=c1(!0),u1=c1(!1),vc=qr(null),wc=null,li=null,Np=null;function Rp(){Np=li=wc=null}function Ap(e){var t=vc.current;Se(vc),e._currentValue=t}function Qf(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 vi(e,t){wc=e,Np=li=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(xt=!0),e.firstContext=null)}function rn(e){var t=e._currentValue;if(Np!==e)if(e={context:e,memoizedValue:t,next:null},li===null){if(wc===null)throw Error(U(308));li=e,wc.dependencies={lanes:0,firstContext:e}}else li=li.next=e;return t}var gs=null;function Ip(e){gs===null?gs=[e]:gs.push(e)}function d1(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,Ip(t)):(n.next=s.next,s.next=n),t.interleaved=n,nr(e,r)}function nr(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 wr=!1;function Mp(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function f1(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 Jn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Lr(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ae&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,nr(e,n)}return s=r.interleaved,s===null?(t.next=t,Ip(r)):(t.next=s.next,s.next=t),r.interleaved=t,nr(e,n)}function Ll(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,vp(e,n)}}function ry(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 bc(e,t,n,r){var s=e.updateQueue;wr=!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 p=a.lane,h=a.eventTime;if((r&p)===p){u!==null&&(u=u.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var m=e,y=a;switch(p=t,h=n,y.tag){case 1:if(m=y.payload,typeof m=="function"){f=m.call(h,f,p);break e}f=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=y.payload,p=typeof m=="function"?m.call(h,f,p):m,p==null)break e;f=Re({},f,p);break e;case 2:wr=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,p=s.effects,p===null?s.effects=[a]:p.push(a))}else h={eventTime:h,lane:p,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(c=u=h,l=f):u=u.next=h,o|=p;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;p=a,a=p.next,p.next=null,s.lastBaseUpdate=p,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);As|=o,e.lanes=o,e.memoizedState=f}}function sy(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 ja={},Ln=qr(ja),oa=qr(ja),aa=qr(ja);function ys(e){if(e===ja)throw Error(U(174));return e}function Lp(e,t){switch(we(aa,t),we(oa,e),we(Ln,ja),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Tf(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Tf(t,e)}Se(Ln),we(Ln,t)}function Ti(){Se(Ln),Se(oa),Se(aa)}function h1(e){ys(aa.current);var t=ys(Ln.current),n=Tf(t,e.type);t!==n&&(we(oa,e),we(Ln,n))}function Dp(e){oa.current===e&&(Se(Ln),Se(oa))}var Ee=qr(0);function kc(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 od=[];function Fp(){for(var e=0;e<od.length;e++)od[e]._workInProgressVersionPrimary=null;od.length=0}var Dl=ir.ReactCurrentDispatcher,ad=ir.ReactCurrentBatchConfig,Rs=0,Ne=null,Ve=null,Ke=null,_c=!1,Lo=!1,la=0,hP=0;function et(){throw Error(U(321))}function Op(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!vn(e[n],t[n]))return!1;return!0}function zp(e,t,n,r,s,i){if(Rs=i,Ne=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Dl.current=e===null||e.memoizedState===null?yP:xP,e=n(r,s),Lo){i=0;do{if(Lo=!1,la=0,25<=i)throw Error(U(301));i+=1,Ke=Ve=null,t.updateQueue=null,Dl.current=vP,e=n(r,s)}while(Lo)}if(Dl.current=Sc,t=Ve!==null&&Ve.next!==null,Rs=0,Ke=Ve=Ne=null,_c=!1,t)throw Error(U(300));return e}function $p(){var e=la!==0;return la=0,e}function Pn(){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 ca(e,t){return typeof t=="function"?t(e):t}function ld(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((Rs&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,As|=u}c=c.next}while(c!==null&&c!==i);l===null?o=r:l.next=a,vn(r,t.memoizedState)||(xt=!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,As|=i,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function cd(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);vn(i,t.memoizedState)||(xt=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function p1(){}function m1(e,t){var n=Ne,r=sn(),s=t(),i=!vn(r.memoizedState,s);if(i&&(r.memoizedState=s,xt=!0),r=r.queue,Bp(x1.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||Ke!==null&&Ke.memoizedState.tag&1){if(n.flags|=2048,ua(9,y1.bind(null,n,r,s,t),void 0,null),qe===null)throw Error(U(349));Rs&30||g1(n,t,s)}return s}function g1(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 y1(e,t,n,r){t.value=n,t.getSnapshot=r,v1(t)&&w1(e)}function x1(e,t,n){return n(function(){v1(t)&&w1(e)})}function v1(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!vn(e,n)}catch{return!0}}function w1(e){var t=nr(e,1);t!==null&&yn(t,e,1,-1)}function iy(e){var t=Pn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ca,lastRenderedState:e},t.queue=e,e=e.dispatch=gP.bind(null,Ne,e),[t.memoizedState,e]}function ua(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 b1(){return sn().memoizedState}function Fl(e,t,n,r){var s=Pn();Ne.flags|=e,s.memoizedState=ua(1|t,n,void 0,r===void 0?null:r)}function lu(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&&Op(r,o.deps)){s.memoizedState=ua(t,n,i,r);return}}Ne.flags|=e,s.memoizedState=ua(1|t,n,i,r)}function oy(e,t){return Fl(8390656,8,e,t)}function Bp(e,t){return lu(2048,8,e,t)}function k1(e,t){return lu(4,2,e,t)}function _1(e,t){return lu(4,4,e,t)}function S1(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 C1(e,t,n){return n=n!=null?n.concat([e]):null,lu(4,4,S1.bind(null,t,e),n)}function Vp(){}function j1(e,t){var n=sn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Op(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function P1(e,t){var n=sn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Op(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function E1(e,t,n){return Rs&21?(vn(n,t)||(n=Iw(),Ne.lanes|=n,As|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,xt=!0),e.memoizedState=n)}function pP(e,t){var n=ue;ue=n!==0&&4>n?n:4,e(!0);var r=ad.transition;ad.transition={};try{e(!1),t()}finally{ue=n,ad.transition=r}}function T1(){return sn().memoizedState}function mP(e,t,n){var r=Fr(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},N1(e))R1(t,n);else if(n=d1(e,t,n,r),n!==null){var s=ft();yn(n,e,r,s),A1(n,t,r)}}function gP(e,t,n){var r=Fr(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(N1(e))R1(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,vn(a,o)){var l=t.interleaved;l===null?(s.next=s,Ip(t)):(s.next=l.next,l.next=s),t.interleaved=s;return}}catch{}finally{}n=d1(e,t,s,r),n!==null&&(s=ft(),yn(n,e,r,s),A1(n,t,r))}}function N1(e){var t=e.alternate;return e===Ne||t!==null&&t===Ne}function R1(e,t){Lo=_c=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function A1(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,vp(e,n)}}var Sc={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},yP={readContext:rn,useCallback:function(e,t){return Pn().memoizedState=[e,t===void 0?null:t],e},useContext:rn,useEffect:oy,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Fl(4194308,4,S1.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Fl(4194308,4,e,t)},useInsertionEffect:function(e,t){return Fl(4,2,e,t)},useMemo:function(e,t){var n=Pn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Pn();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=mP.bind(null,Ne,e),[r.memoizedState,e]},useRef:function(e){var t=Pn();return e={current:e},t.memoizedState=e},useState:iy,useDebugValue:Vp,useDeferredValue:function(e){return Pn().memoizedState=e},useTransition:function(){var e=iy(!1),t=e[0];return e=pP.bind(null,e[1]),Pn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ne,s=Pn();if(je){if(n===void 0)throw Error(U(407));n=n()}else{if(n=t(),qe===null)throw Error(U(349));Rs&30||g1(r,t,n)}s.memoizedState=n;var i={value:n,getSnapshot:t};return s.queue=i,oy(x1.bind(null,r,i,e),[e]),r.flags|=2048,ua(9,y1.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Pn(),t=qe.identifierPrefix;if(je){var n=Xn,r=Yn;n=(r&~(1<<32-gn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=la++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=hP++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},xP={readContext:rn,useCallback:j1,useContext:rn,useEffect:Bp,useImperativeHandle:C1,useInsertionEffect:k1,useLayoutEffect:_1,useMemo:P1,useReducer:ld,useRef:b1,useState:function(){return ld(ca)},useDebugValue:Vp,useDeferredValue:function(e){var t=sn();return E1(t,Ve.memoizedState,e)},useTransition:function(){var e=ld(ca)[0],t=sn().memoizedState;return[e,t]},useMutableSource:p1,useSyncExternalStore:m1,useId:T1,unstable_isNewReconciler:!1},vP={readContext:rn,useCallback:j1,useContext:rn,useEffect:Bp,useImperativeHandle:C1,useInsertionEffect:k1,useLayoutEffect:_1,useMemo:P1,useReducer:cd,useRef:b1,useState:function(){return cd(ca)},useDebugValue:Vp,useDeferredValue:function(e){var t=sn();return Ve===null?t.memoizedState=e:E1(t,Ve.memoizedState,e)},useTransition:function(){var e=cd(ca)[0],t=sn().memoizedState;return[e,t]},useMutableSource:p1,useSyncExternalStore:m1,useId:T1,unstable_isNewReconciler:!1};function hn(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 Yf(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 cu={isMounted:function(e){return(e=e._reactInternals)?Ls(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=ft(),s=Fr(e),i=Jn(r,s);i.payload=t,n!=null&&(i.callback=n),t=Lr(e,i,s),t!==null&&(yn(t,e,s,r),Ll(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=ft(),s=Fr(e),i=Jn(r,s);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Lr(e,i,s),t!==null&&(yn(t,e,s,r),Ll(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=ft(),r=Fr(e),s=Jn(n,r);s.tag=2,t!=null&&(s.callback=t),t=Lr(e,s,r),t!==null&&(yn(t,e,r,n),Ll(t,e,r))}};function ay(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?!na(n,r)||!na(s,i):!0}function I1(e,t,n){var r=!1,s=Vr,i=t.contextType;return typeof i=="object"&&i!==null?i=rn(i):(s=bt(t)?Ts:it.current,r=t.contextTypes,i=(r=r!=null)?ji(e,s):Vr),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=cu,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=i),t}function ly(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&&cu.enqueueReplaceState(t,t.state,null)}function Xf(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},Mp(e);var i=t.contextType;typeof i=="object"&&i!==null?s.context=rn(i):(i=bt(t)?Ts:it.current,s.context=ji(e,i)),s.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Yf(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&&cu.enqueueReplaceState(s,s.state,null),bc(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function Ni(e,t){try{var n="",r=t;do n+=KC(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 ud(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Jf(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var wP=typeof WeakMap=="function"?WeakMap:Map;function M1(e,t,n){n=Jn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){jc||(jc=!0,lh=r),Jf(e,t)},n}function L1(e,t,n){n=Jn(-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(){Jf(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Jf(e,t),typeof r!="function"&&(Dr===null?Dr=new Set([this]):Dr.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function cy(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new wP;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=MP.bind(null,e,t,n),t.then(e,e))}function uy(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 dy(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=Jn(-1,1),t.tag=2,Lr(n,t,1))),n.lanes|=1),e)}var bP=ir.ReactCurrentOwner,xt=!1;function lt(e,t,n,r){t.child=e===null?u1(t,null,n,r):Ei(t,e.child,n,r)}function fy(e,t,n,r,s){n=n.render;var i=t.ref;return vi(t,s),r=zp(e,t,n,r,i,s),n=$p(),e!==null&&!xt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,rr(e,t,s)):(je&&n&&Pp(t),t.flags|=1,lt(e,t,r,s),t.child)}function hy(e,t,n,r,s){if(e===null){var i=n.type;return typeof i=="function"&&!Yp(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,D1(e,t,i,r,s)):(e=Bl(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:na,n(o,r)&&e.ref===t.ref)return rr(e,t,s)}return t.flags|=1,e=Or(i,r),e.ref=t.ref,e.return=t,t.child=e}function D1(e,t,n,r,s){if(e!==null){var i=e.memoizedProps;if(na(i,r)&&e.ref===t.ref)if(xt=!1,t.pendingProps=r=i,(e.lanes&s)!==0)e.flags&131072&&(xt=!0);else return t.lanes=e.lanes,rr(e,t,s)}return Zf(e,t,n,r,s)}function F1(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(ui,It),It|=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(ui,It),It|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,we(ui,It),It|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,we(ui,It),It|=r;return lt(e,t,s,n),t.child}function O1(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Zf(e,t,n,r,s){var i=bt(n)?Ts:it.current;return i=ji(t,i),vi(t,s),n=zp(e,t,n,r,i,s),r=$p(),e!==null&&!xt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,rr(e,t,s)):(je&&r&&Pp(t),t.flags|=1,lt(e,t,n,s),t.child)}function py(e,t,n,r,s){if(bt(n)){var i=!0;gc(t)}else i=!1;if(vi(t,s),t.stateNode===null)Ol(e,t),I1(t,n,r),Xf(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=bt(n)?Ts:it.current,c=ji(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)&&ly(t,o,r,c),wr=!1;var p=t.memoizedState;o.state=p,bc(t,r,o,s),l=t.memoizedState,a!==r||p!==l||wt.current||wr?(typeof u=="function"&&(Yf(t,n,u,r),l=t.memoizedState),(a=wr||ay(t,n,a,r,p,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,f1(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:hn(t.type,a),o.props=c,f=t.pendingProps,p=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=rn(l):(l=bt(n)?Ts:it.current,l=ji(t,l));var h=n.getDerivedStateFromProps;(u=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==f||p!==l)&&ly(t,o,r,l),wr=!1,p=t.memoizedState,o.state=p,bc(t,r,o,s);var m=t.memoizedState;a!==f||p!==m||wt.current||wr?(typeof h=="function"&&(Yf(t,n,h,r),m=t.memoizedState),(c=wr||ay(t,n,c,r,p,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&&p===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&p===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&&p===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return eh(e,t,n,r,i,s)}function eh(e,t,n,r,s,i){O1(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return s&&Zg(t,n,!1),rr(e,t,i);r=t.stateNode,bP.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Ei(t,e.child,null,i),t.child=Ei(t,null,a,i)):lt(e,t,a,i),t.memoizedState=r.state,s&&Zg(t,n,!0),t.child}function z1(e){var t=e.stateNode;t.pendingContext?Jg(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Jg(e,t.context,!1),Lp(e,t.containerInfo)}function my(e,t,n,r,s){return Pi(),Tp(s),t.flags|=256,lt(e,t,n,r),t.child}var th={dehydrated:null,treeContext:null,retryLane:0};function nh(e){return{baseLanes:e,cachePool:null,transitions:null}}function $1(e,t,n){var r=t.pendingProps,s=Ee.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(Ee,s&1),e===null)return qf(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=fu(o,r,0,null),e=ks(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=nh(n),t.memoizedState=th,e):Up(t,o));if(s=e.memoizedState,s!==null&&(a=s.dehydrated,a!==null))return kP(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=Or(s,l),r.subtreeFlags=s.subtreeFlags&14680064),a!==null?i=Or(a,i):(i=ks(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?nh(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=e.childLanes&~n,t.memoizedState=th,r}return i=e.child,e=i.sibling,r=Or(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 Up(e,t){return t=fu({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function tl(e,t,n,r){return r!==null&&Tp(r),Ei(t,e.child,null,n),e=Up(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function kP(e,t,n,r,s,i,o){if(n)return t.flags&256?(t.flags&=-257,r=ud(Error(U(422))),tl(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,s=t.mode,r=fu({mode:"visible",children:r.children},s,0,null),i=ks(i,s,o,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&Ei(t,e.child,null,o),t.child.memoizedState=nh(o),t.memoizedState=th,i);if(!(t.mode&1))return tl(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=ud(i,r,void 0),tl(e,t,o,r)}if(a=(o&e.childLanes)!==0,xt||a){if(r=qe,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,nr(e,s),yn(r,e,s,-1))}return Qp(),r=ud(Error(U(421))),tl(e,t,o,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=LP.bind(null,e),s._reactRetry=t,null):(e=i.treeContext,Mt=Mr(s.nextSibling),Dt=t,je=!0,mn=null,e!==null&&(Qt[Yt++]=Yn,Qt[Yt++]=Xn,Qt[Yt++]=Ns,Yn=e.id,Xn=e.overflow,Ns=t),t=Up(t,r.children),t.flags|=4096,t)}function gy(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Qf(e.return,t,n)}function dd(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 B1(e,t,n){var r=t.pendingProps,s=r.revealOrder,i=r.tail;if(lt(e,t,r.children,n),r=Ee.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&gy(e,n,t);else if(e.tag===19)gy(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(we(Ee,r),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&kc(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),dd(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&&kc(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}dd(t,!0,n,null,i);break;case"together":dd(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ol(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function rr(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),As|=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=Or(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Or(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function _P(e,t,n){switch(t.tag){case 3:z1(t),Pi();break;case 5:h1(t);break;case 1:bt(t.type)&&gc(t);break;case 4:Lp(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;we(vc,r._currentValue),r._currentValue=s;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(we(Ee,Ee.current&1),t.flags|=128,null):n&t.child.childLanes?$1(e,t,n):(we(Ee,Ee.current&1),e=rr(e,t,n),e!==null?e.sibling:null);we(Ee,Ee.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return B1(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),we(Ee,Ee.current),r)break;return null;case 22:case 23:return t.lanes=0,F1(e,t,n)}return rr(e,t,n)}var V1,rh,U1,W1;V1=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}};rh=function(){};U1=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,ys(Ln.current);var i=null;switch(n){case"input":s=Cf(e,s),r=Cf(e,r),i=[];break;case"select":s=Re({},s,{value:void 0}),r=Re({},r,{value:void 0}),i=[];break;case"textarea":s=Ef(e,s),r=Ef(e,r),i=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=pc)}Nf(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"&&(Qo.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"&&(Qo.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&_e("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)}};W1=function(e,t,n,r){n!==r&&(t.flags|=4)};function oo(e,t){if(!je)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 SP(e,t,n){var r=t.pendingProps;switch(Ep(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 bt(t.type)&&mc(),tt(t),null;case 3:return r=t.stateNode,Ti(),Se(wt),Se(it),Fp(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Za(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,mn!==null&&(dh(mn),mn=null))),rh(e,t),tt(t),null;case 5:Dp(t);var s=ys(aa.current);if(n=t.type,e!==null&&t.stateNode!=null)U1(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=ys(Ln.current),Za(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[An]=t,r[ia]=i,e=(t.mode&1)!==0,n){case"dialog":_e("cancel",r),_e("close",r);break;case"iframe":case"object":case"embed":_e("load",r);break;case"video":case"audio":for(s=0;s<jo.length;s++)_e(jo[s],r);break;case"source":_e("error",r);break;case"img":case"image":case"link":_e("error",r),_e("load",r);break;case"details":_e("toggle",r);break;case"input":Cg(r,i),_e("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},_e("invalid",r);break;case"textarea":Pg(r,i),_e("invalid",r)}Nf(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&&Ja(r.textContent,a,e),s=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&Ja(r.textContent,a,e),s=["children",""+a]):Qo.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&_e("scroll",r)}switch(n){case"input":Wa(r),jg(r,i,!0);break;case"textarea":Wa(r),Eg(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=pc)}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=xw(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[An]=t,e[ia]=r,V1(e,t,!1,!1),t.stateNode=e;e:{switch(o=Rf(n,r),n){case"dialog":_e("cancel",e),_e("close",e),s=r;break;case"iframe":case"object":case"embed":_e("load",e),s=r;break;case"video":case"audio":for(s=0;s<jo.length;s++)_e(jo[s],e);s=r;break;case"source":_e("error",e),s=r;break;case"img":case"image":case"link":_e("error",e),_e("load",e),s=r;break;case"details":_e("toggle",e),s=r;break;case"input":Cg(e,r),s=Cf(e,r),_e("invalid",e);break;case"option":s=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=Re({},r,{value:void 0}),_e("invalid",e);break;case"textarea":Pg(e,r),s=Ef(e,r),_e("invalid",e);break;default:s=r}Nf(n,s),a=s;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?bw(e,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&vw(e,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&Yo(e,l):typeof l=="number"&&Yo(e,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Qo.hasOwnProperty(i)?l!=null&&i==="onScroll"&&_e("scroll",e):l!=null&&hp(e,i,l,o))}switch(n){case"input":Wa(e),jg(e,r,!1);break;case"textarea":Wa(e),Eg(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Br(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?mi(e,!!r.multiple,i,!1):r.defaultValue!=null&&mi(e,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=pc)}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)W1(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(U(166));if(n=ys(aa.current),ys(Ln.current),Za(t)){if(r=t.stateNode,n=t.memoizedProps,r[An]=t,(i=r.nodeValue!==n)&&(e=Dt,e!==null))switch(e.tag){case 3:Ja(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Ja(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[An]=t,t.stateNode=r}return tt(t),null;case 13:if(Se(Ee),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(je&&Mt!==null&&t.mode&1&&!(t.flags&128))l1(),Pi(),t.flags|=98560,i=!1;else if(i=Za(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[An]=t}else Pi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;tt(t),i=!1}else mn!==null&&(dh(mn),mn=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||Ee.current&1?Ue===0&&(Ue=3):Qp())),t.updateQueue!==null&&(t.flags|=4),tt(t),null);case 4:return Ti(),rh(e,t),e===null&&ra(t.stateNode.containerInfo),tt(t),null;case 10:return Ap(t.type._context),tt(t),null;case 17:return bt(t.type)&&mc(),tt(t),null;case 19:if(Se(Ee),i=t.memoizedState,i===null)return tt(t),null;if(r=(t.flags&128)!==0,o=i.rendering,o===null)if(r)oo(i,!1);else{if(Ue!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=kc(e),o!==null){for(t.flags|=128,oo(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(Ee,Ee.current&1|2),t.child}e=e.sibling}i.tail!==null&&De()>Ri&&(t.flags|=128,r=!0,oo(i,!1),t.lanes=4194304)}else{if(!r)if(e=kc(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),oo(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!je)return tt(t),null}else 2*De()-i.renderingStartTime>Ri&&n!==1073741824&&(t.flags|=128,r=!0,oo(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=Ee.current,we(Ee,r?n&1|2:n&1),t):(tt(t),null);case 22:case 23:return qp(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?It&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 CP(e,t){switch(Ep(t),t.tag){case 1:return bt(t.type)&&mc(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ti(),Se(wt),Se(it),Fp(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Dp(t),null;case 13:if(Se(Ee),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(U(340));Pi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Se(Ee),null;case 4:return Ti(),null;case 10:return Ap(t.type._context),null;case 22:case 23:return qp(),null;case 24:return null;default:return null}}var nl=!1,rt=!1,jP=typeof WeakSet=="function"?WeakSet:Set,K=null;function ci(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 sh(e,t,n){try{n()}catch(r){Me(e,t,r)}}var yy=!1;function PP(e,t){if(Bf=dc,e=Qw(),jp(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,p=null;t:for(;;){for(var h;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),(h=f.firstChild)!==null;)p=f,f=h;for(;;){if(f===e)break t;if(p===n&&++c===s&&(a=o),p===i&&++u===r&&(l=o),(h=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=h}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Vf={focusedElem:e,selectionRange:n},dc=!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 y=m.memoizedProps,v=m.memoizedState,g=t.stateNode,x=g.getSnapshotBeforeUpdate(t.elementType===t.type?y:hn(t.type,y),v);g.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.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=yy,yy=!1,m}function Do(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&&sh(t,n,i)}s=s.next}while(s!==r)}}function uu(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 ih(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 H1(e){var t=e.alternate;t!==null&&(e.alternate=null,H1(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[An],delete t[ia],delete t[Hf],delete t[cP],delete t[uP])),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 G1(e){return e.tag===5||e.tag===3||e.tag===4}function xy(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||G1(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 oh(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=pc));else if(r!==4&&(e=e.child,e!==null))for(oh(e,t,n),e=e.sibling;e!==null;)oh(e,t,n),e=e.sibling}function ah(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(ah(e,t,n),e=e.sibling;e!==null;)ah(e,t,n),e=e.sibling}var Qe=null,pn=!1;function ar(e,t,n){for(n=n.child;n!==null;)K1(e,t,n),n=n.sibling}function K1(e,t,n){if(Mn&&typeof Mn.onCommitFiberUnmount=="function")try{Mn.onCommitFiberUnmount(nu,n)}catch{}switch(n.tag){case 5:rt||ci(n,t);case 6:var r=Qe,s=pn;Qe=null,ar(e,t,n),Qe=r,pn=s,Qe!==null&&(pn?(e=Qe,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Qe.removeChild(n.stateNode));break;case 18:Qe!==null&&(pn?(e=Qe,n=n.stateNode,e.nodeType===8?sd(e.parentNode,n):e.nodeType===1&&sd(e,n),ea(e)):sd(Qe,n.stateNode));break;case 4:r=Qe,s=pn,Qe=n.stateNode.containerInfo,pn=!0,ar(e,t,n),Qe=r,pn=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)&&sh(n,t,o),s=s.next}while(s!==r)}ar(e,t,n);break;case 1:if(!rt&&(ci(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)}ar(e,t,n);break;case 21:ar(e,t,n);break;case 22:n.mode&1?(rt=(r=rt)||n.memoizedState!==null,ar(e,t,n),rt=r):ar(e,t,n);break;default:ar(e,t,n)}}function vy(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new jP),t.forEach(function(r){var s=DP.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function ln(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,pn=!1;break e;case 3:Qe=a.stateNode.containerInfo,pn=!0;break e;case 4:Qe=a.stateNode.containerInfo,pn=!0;break e}a=a.return}if(Qe===null)throw Error(U(160));K1(i,o,s),Qe=null,pn=!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;)q1(t,e),t=t.sibling}function q1(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(ln(t,e),_n(e),r&4){try{Do(3,e,e.return),uu(3,e)}catch(y){Me(e,e.return,y)}try{Do(5,e,e.return)}catch(y){Me(e,e.return,y)}}break;case 1:ln(t,e),_n(e),r&512&&n!==null&&ci(n,n.return);break;case 5:if(ln(t,e),_n(e),r&512&&n!==null&&ci(n,n.return),e.flags&32){var s=e.stateNode;try{Yo(s,"")}catch(y){Me(e,e.return,y)}}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&&gw(s,i),Rf(a,o);var c=Rf(a,i);for(o=0;o<l.length;o+=2){var u=l[o],f=l[o+1];u==="style"?bw(s,f):u==="dangerouslySetInnerHTML"?vw(s,f):u==="children"?Yo(s,f):hp(s,u,f,c)}switch(a){case"input":jf(s,i);break;case"textarea":yw(s,i);break;case"select":var p=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!i.multiple;var h=i.value;h!=null?mi(s,!!i.multiple,h,!1):p!==!!i.multiple&&(i.defaultValue!=null?mi(s,!!i.multiple,i.defaultValue,!0):mi(s,!!i.multiple,i.multiple?[]:"",!1))}s[ia]=i}catch(y){Me(e,e.return,y)}}break;case 6:if(ln(t,e),_n(e),r&4){if(e.stateNode===null)throw Error(U(162));s=e.stateNode,i=e.memoizedProps;try{s.nodeValue=i}catch(y){Me(e,e.return,y)}}break;case 3:if(ln(t,e),_n(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{ea(t.containerInfo)}catch(y){Me(e,e.return,y)}break;case 4:ln(t,e),_n(e);break;case 13:ln(t,e),_n(e),s=e.child,s.flags&8192&&(i=s.memoizedState!==null,s.stateNode.isHidden=i,!i||s.alternate!==null&&s.alternate.memoizedState!==null||(Gp=De())),r&4&&vy(e);break;case 22:if(u=n!==null&&n.memoizedState!==null,e.mode&1?(rt=(c=rt)||u,ln(t,e),rt=c):ln(t,e),_n(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(p=K,h=p.child,p.tag){case 0:case 11:case 14:case 15:Do(4,p,p.return);break;case 1:ci(p,p.return);var m=p.stateNode;if(typeof m.componentWillUnmount=="function"){r=p,n=p.return;try{t=r,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(y){Me(r,n,y)}}break;case 5:ci(p,p.return);break;case 22:if(p.memoizedState!==null){by(f);continue}}h!==null?(h.return=p,K=h):by(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=ww("display",o))}catch(y){Me(e,e.return,y)}}}else if(f.tag===6){if(u===null)try{f.stateNode.nodeValue=c?"":f.memoizedProps}catch(y){Me(e,e.return,y)}}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:ln(t,e),_n(e),r&4&&vy(e);break;case 21:break;default:ln(t,e),_n(e)}}function _n(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(G1(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&&(Yo(s,""),r.flags&=-33);var i=xy(e);ah(e,i,s);break;case 3:case 4:var o=r.stateNode.containerInfo,a=xy(e);oh(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 EP(e,t,n){K=e,Q1(e)}function Q1(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||nl;if(!o){var a=s.alternate,l=a!==null&&a.memoizedState!==null||rt;a=nl;var c=rt;if(nl=o,(rt=l)&&!c)for(K=s;K!==null;)o=K,l=o.child,o.tag===22&&o.memoizedState!==null?ky(s):l!==null?(l.return=o,K=l):ky(s);for(;i!==null;)K=i,Q1(i),i=i.sibling;K=s,nl=a,rt=c}wy(e)}else s.subtreeFlags&8772&&i!==null?(i.return=s,K=i):wy(e)}}function wy(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||uu(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:hn(t.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&sy(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}sy(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&&ea(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(U(163))}rt||t.flags&512&&ih(t)}catch(p){Me(t,t.return,p)}}if(t===e){K=null;break}if(n=t.sibling,n!==null){n.return=t.return,K=n;break}K=t.return}}function by(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 ky(e){for(;K!==null;){var t=K;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{uu(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{ih(t)}catch(l){Me(t,i,l)}break;case 5:var o=t.return;try{ih(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 TP=Math.ceil,Cc=ir.ReactCurrentDispatcher,Wp=ir.ReactCurrentOwner,tn=ir.ReactCurrentBatchConfig,ae=0,qe=null,$e=null,Je=0,It=0,ui=qr(0),Ue=0,da=null,As=0,du=0,Hp=0,Fo=null,yt=null,Gp=0,Ri=1/0,Kn=null,jc=!1,lh=null,Dr=null,rl=!1,Cr=null,Pc=0,Oo=0,ch=null,zl=-1,$l=0;function ft(){return ae&6?De():zl!==-1?zl:zl=De()}function Fr(e){return e.mode&1?ae&2&&Je!==0?Je&-Je:fP.transition!==null?($l===0&&($l=Iw()),$l):(e=ue,e!==0||(e=window.event,e=e===void 0?16:$w(e.type)),e):1}function yn(e,t,n,r){if(50<Oo)throw Oo=0,ch=null,Error(U(185));_a(e,n,r),(!(ae&2)||e!==qe)&&(e===qe&&(!(ae&2)&&(du|=n),Ue===4&&_r(e,Je)),kt(e,r),n===1&&ae===0&&!(t.mode&1)&&(Ri=De()+500,au&&Qr()))}function kt(e,t){var n=e.callbackNode;fj(e,t);var r=uc(e,e===qe?Je:0);if(r===0)n!==null&&Rg(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Rg(n),t===1)e.tag===0?dP(_y.bind(null,e)):i1(_y.bind(null,e)),aP(function(){!(ae&6)&&Qr()}),n=null;else{switch(Mw(r)){case 1:n=xp;break;case 4:n=Rw;break;case 16:n=cc;break;case 536870912:n=Aw;break;default:n=cc}n=rb(n,Y1.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Y1(e,t){if(zl=-1,$l=0,ae&6)throw Error(U(327));var n=e.callbackNode;if(wi()&&e.callbackNode!==n)return null;var r=uc(e,e===qe?Je:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Ec(e,r);else{t=r;var s=ae;ae|=2;var i=J1();(qe!==e||Je!==t)&&(Kn=null,Ri=De()+500,bs(e,t));do try{AP();break}catch(a){X1(e,a)}while(!0);Rp(),Cc.current=i,ae=s,$e!==null?t=0:(qe=null,Je=0,t=Ue)}if(t!==0){if(t===2&&(s=Df(e),s!==0&&(r=s,t=uh(e,s))),t===1)throw n=da,bs(e,0),_r(e,r),kt(e,De()),n;if(t===6)_r(e,r);else{if(s=e.current.alternate,!(r&30)&&!NP(s)&&(t=Ec(e,r),t===2&&(i=Df(e),i!==0&&(r=i,t=uh(e,i))),t===1))throw n=da,bs(e,0),_r(e,r),kt(e,De()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(U(345));case 2:cs(e,yt,Kn);break;case 3:if(_r(e,r),(r&130023424)===r&&(t=Gp+500-De(),10<t)){if(uc(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){ft(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=Wf(cs.bind(null,e,yt,Kn),t);break}cs(e,yt,Kn);break;case 4:if(_r(e,r),(r&4194240)===r)break;for(t=e.eventTimes,s=-1;0<r;){var o=31-gn(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*TP(r/1960))-r,10<r){e.timeoutHandle=Wf(cs.bind(null,e,yt,Kn),r);break}cs(e,yt,Kn);break;case 5:cs(e,yt,Kn);break;default:throw Error(U(329))}}}return kt(e,De()),e.callbackNode===n?Y1.bind(null,e):null}function uh(e,t){var n=Fo;return e.current.memoizedState.isDehydrated&&(bs(e,t).flags|=256),e=Ec(e,t),e!==2&&(t=yt,yt=n,t!==null&&dh(t)),e}function dh(e){yt===null?yt=e:yt.push.apply(yt,e)}function NP(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(!vn(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 _r(e,t){for(t&=~Hp,t&=~du,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-gn(t),r=1<<n;e[n]=-1,t&=~r}}function _y(e){if(ae&6)throw Error(U(327));wi();var t=uc(e,0);if(!(t&1))return kt(e,De()),null;var n=Ec(e,t);if(e.tag!==0&&n===2){var r=Df(e);r!==0&&(t=r,n=uh(e,r))}if(n===1)throw n=da,bs(e,0),_r(e,t),kt(e,De()),n;if(n===6)throw Error(U(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,cs(e,yt,Kn),kt(e,De()),null}function Kp(e,t){var n=ae;ae|=1;try{return e(t)}finally{ae=n,ae===0&&(Ri=De()+500,au&&Qr())}}function Is(e){Cr!==null&&Cr.tag===0&&!(ae&6)&&wi();var t=ae;ae|=1;var n=tn.transition,r=ue;try{if(tn.transition=null,ue=1,e)return e()}finally{ue=r,tn.transition=n,ae=t,!(ae&6)&&Qr()}}function qp(){It=ui.current,Se(ui)}function bs(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,oP(n)),$e!==null)for(n=$e.return;n!==null;){var r=n;switch(Ep(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&mc();break;case 3:Ti(),Se(wt),Se(it),Fp();break;case 5:Dp(r);break;case 4:Ti();break;case 13:Se(Ee);break;case 19:Se(Ee);break;case 10:Ap(r.type._context);break;case 22:case 23:qp()}n=n.return}if(qe=e,$e=e=Or(e.current,null),Je=It=t,Ue=0,da=null,Hp=du=As=0,yt=Fo=null,gs!==null){for(t=0;t<gs.length;t++)if(n=gs[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}gs=null}return e}function X1(e,t){do{var n=$e;try{if(Rp(),Dl.current=Sc,_c){for(var r=Ne.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}_c=!1}if(Rs=0,Ke=Ve=Ne=null,Lo=!1,la=0,Wp.current=null,n===null||n.return===null){Ue=1,da=t,$e=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 p=u.alternate;p?(u.updateQueue=p.updateQueue,u.memoizedState=p.memoizedState,u.lanes=p.lanes):(u.updateQueue=null,u.memoizedState=null)}var h=uy(o);if(h!==null){h.flags&=-257,dy(h,o,a,i,t),h.mode&1&&cy(i,c,t),t=h,l=c;var m=t.updateQueue;if(m===null){var y=new Set;y.add(l),t.updateQueue=y}else m.add(l);break e}else{if(!(t&1)){cy(i,c,t),Qp();break e}l=Error(U(426))}}else if(je&&a.mode&1){var v=uy(o);if(v!==null){!(v.flags&65536)&&(v.flags|=256),dy(v,o,a,i,t),Tp(Ni(l,a));break e}}i=l=Ni(l,a),Ue!==4&&(Ue=2),Fo===null?Fo=[i]:Fo.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var g=M1(i,l,t);ry(i,g);break e;case 1:a=l;var x=i.type,w=i.stateNode;if(!(i.flags&128)&&(typeof x.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(Dr===null||!Dr.has(w)))){i.flags|=65536,t&=-t,i.lanes|=t;var k=L1(i,a,t);ry(i,k);break e}}i=i.return}while(i!==null)}eb(n)}catch(j){t=j,$e===n&&n!==null&&($e=n=n.return);continue}break}while(!0)}function J1(){var e=Cc.current;return Cc.current=Sc,e===null?Sc:e}function Qp(){(Ue===0||Ue===3||Ue===2)&&(Ue=4),qe===null||!(As&268435455)&&!(du&268435455)||_r(qe,Je)}function Ec(e,t){var n=ae;ae|=2;var r=J1();(qe!==e||Je!==t)&&(Kn=null,bs(e,t));do try{RP();break}catch(s){X1(e,s)}while(!0);if(Rp(),ae=n,Cc.current=r,$e!==null)throw Error(U(261));return qe=null,Je=0,Ue}function RP(){for(;$e!==null;)Z1($e)}function AP(){for(;$e!==null&&!rj();)Z1($e)}function Z1(e){var t=nb(e.alternate,e,It);e.memoizedProps=e.pendingProps,t===null?eb(e):$e=t,Wp.current=null}function eb(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=CP(n,t),n!==null){n.flags&=32767,$e=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ue=6,$e=null;return}}else if(n=SP(n,t,It),n!==null){$e=n;return}if(t=t.sibling,t!==null){$e=t;return}$e=t=e}while(t!==null);Ue===0&&(Ue=5)}function cs(e,t,n){var r=ue,s=tn.transition;try{tn.transition=null,ue=1,IP(e,t,n,r)}finally{tn.transition=s,ue=r}return null}function IP(e,t,n,r){do wi();while(Cr!==null);if(ae&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(hj(e,i),e===qe&&($e=qe=null,Je=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||rl||(rl=!0,rb(cc,function(){return wi(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=tn.transition,tn.transition=null;var o=ue;ue=1;var a=ae;ae|=4,Wp.current=null,PP(e,n),q1(n,e),Zj(Vf),dc=!!Bf,Vf=Bf=null,e.current=n,EP(n),sj(),ae=a,ue=o,tn.transition=i}else e.current=n;if(rl&&(rl=!1,Cr=e,Pc=s),i=e.pendingLanes,i===0&&(Dr=null),aj(n.stateNode),kt(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(jc)throw jc=!1,e=lh,lh=null,e;return Pc&1&&e.tag!==0&&wi(),i=e.pendingLanes,i&1?e===ch?Oo++:(Oo=0,ch=e):Oo=0,Qr(),null}function wi(){if(Cr!==null){var e=Mw(Pc),t=tn.transition,n=ue;try{if(tn.transition=null,ue=16>e?16:e,Cr===null)var r=!1;else{if(e=Cr,Cr=null,Pc=0,ae&6)throw Error(U(331));var s=ae;for(ae|=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:Do(8,u,i)}var f=u.child;if(f!==null)f.return=u,K=f;else for(;K!==null;){u=K;var p=u.sibling,h=u.return;if(H1(u),u===c){K=null;break}if(p!==null){p.return=h,K=p;break}K=h}}}var m=i.alternate;if(m!==null){var y=m.child;if(y!==null){m.child=null;do{var v=y.sibling;y.sibling=null,y=v}while(y!==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:Do(9,i,i.return)}var g=i.sibling;if(g!==null){g.return=i.return,K=g;break e}K=i.return}}var x=e.current;for(K=x;K!==null;){o=K;var w=o.child;if(o.subtreeFlags&2064&&w!==null)w.return=o,K=w;else e:for(o=x;K!==null;){if(a=K,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:uu(9,a)}}catch(j){Me(a,a.return,j)}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(ae=s,Qr(),Mn&&typeof Mn.onPostCommitFiberRoot=="function")try{Mn.onPostCommitFiberRoot(nu,e)}catch{}r=!0}return r}finally{ue=n,tn.transition=t}}return!1}function Sy(e,t,n){t=Ni(n,t),t=M1(e,t,1),e=Lr(e,t,1),t=ft(),e!==null&&(_a(e,1,t),kt(e,t))}function Me(e,t,n){if(e.tag===3)Sy(e,e,n);else for(;t!==null;){if(t.tag===3){Sy(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Dr===null||!Dr.has(r))){e=Ni(n,e),e=L1(t,e,1),t=Lr(t,e,1),e=ft(),t!==null&&(_a(t,1,e),kt(t,e));break}}t=t.return}}function MP(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=ft(),e.pingedLanes|=e.suspendedLanes&n,qe===e&&(Je&n)===n&&(Ue===4||Ue===3&&(Je&130023424)===Je&&500>De()-Gp?bs(e,0):Hp|=n),kt(e,t)}function tb(e,t){t===0&&(e.mode&1?(t=Ka,Ka<<=1,!(Ka&130023424)&&(Ka=4194304)):t=1);var n=ft();e=nr(e,t),e!==null&&(_a(e,t,n),kt(e,n))}function LP(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),tb(e,n)}function DP(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),tb(e,n)}var nb;nb=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||wt.current)xt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return xt=!1,_P(e,t,n);xt=!!(e.flags&131072)}else xt=!1,je&&t.flags&1048576&&o1(t,xc,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ol(e,t),e=t.pendingProps;var s=ji(t,it.current);vi(t,n),s=zp(null,t,r,e,s,n);var i=$p();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,bt(r)?(i=!0,gc(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Mp(t),s.updater=cu,t.stateNode=s,s._reactInternals=t,Xf(t,r,e,n),t=eh(null,t,r,!0,i,n)):(t.tag=0,je&&i&&Pp(t),lt(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ol(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=OP(r),e=hn(r,e),s){case 0:t=Zf(null,t,r,e,n);break e;case 1:t=py(null,t,r,e,n);break e;case 11:t=fy(null,t,r,e,n);break e;case 14:t=hy(null,t,r,hn(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:hn(r,s),Zf(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:hn(r,s),py(e,t,r,s,n);case 3:e:{if(z1(t),e===null)throw Error(U(387));r=t.pendingProps,i=t.memoizedState,s=i.element,f1(e,t),bc(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=Ni(Error(U(423)),t),t=my(e,t,r,n,s);break e}else if(r!==s){s=Ni(Error(U(424)),t),t=my(e,t,r,n,s);break e}else for(Mt=Mr(t.stateNode.containerInfo.firstChild),Dt=t,je=!0,mn=null,n=u1(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Pi(),r===s){t=rr(e,t,n);break e}lt(e,t,r,n)}t=t.child}return t;case 5:return h1(t),e===null&&qf(t),r=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,o=s.children,Uf(r,s)?o=null:i!==null&&Uf(r,i)&&(t.flags|=32),O1(e,t),lt(e,t,o,n),t.child;case 6:return e===null&&qf(t),null;case 13:return $1(e,t,n);case 4:return Lp(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ei(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:hn(r,s),fy(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(vc,r._currentValue),r._currentValue=o,i!==null)if(vn(i.value,o)){if(i.children===s.children&&!wt.current){t=rr(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=Jn(-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),Qf(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),Qf(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,vi(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=hn(r,t.pendingProps),s=hn(r.type,s),hy(e,t,r,s,n);case 15:return D1(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:hn(r,s),Ol(e,t),t.tag=1,bt(r)?(e=!0,gc(t)):e=!1,vi(t,n),I1(t,r,s),Xf(t,r,s,n),eh(null,t,r,!0,e,n);case 19:return B1(e,t,n);case 22:return F1(e,t,n)}throw Error(U(156,t.tag))};function rb(e,t){return Nw(e,t)}function FP(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 FP(e,t,n,r)}function Yp(e){return e=e.prototype,!(!e||!e.isReactComponent)}function OP(e){if(typeof e=="function")return Yp(e)?1:0;if(e!=null){if(e=e.$$typeof,e===mp)return 11;if(e===gp)return 14}return 2}function Or(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 Bl(e,t,n,r,s,i){var o=2;if(r=e,typeof e=="function")Yp(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case ei:return ks(n.children,s,i,t);case pp:o=8,s|=8;break;case bf:return e=Jt(12,n,t,s|2),e.elementType=bf,e.lanes=i,e;case kf:return e=Jt(13,n,t,s),e.elementType=kf,e.lanes=i,e;case _f:return e=Jt(19,n,t,s),e.elementType=_f,e.lanes=i,e;case hw:return fu(n,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case dw:o=10;break e;case fw:o=9;break e;case mp:o=11;break e;case gp:o=14;break e;case vr: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 ks(e,t,n,r){return e=Jt(7,e,r,t),e.lanes=n,e}function fu(e,t,n,r){return e=Jt(22,e,r,t),e.elementType=hw,e.lanes=n,e.stateNode={isHidden:!1},e}function fd(e,t,n){return e=Jt(6,e,null,t),e.lanes=n,e}function hd(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 zP(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=Ku(0),this.expirationTimes=Ku(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ku(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Xp(e,t,n,r,s,i,o,a,l){return e=new zP(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},Mp(i),e}function $P(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Zs,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function sb(e){if(!e)return Vr;e=e._reactInternals;e:{if(Ls(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(bt(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(bt(n))return s1(e,n,t)}return t}function ib(e,t,n,r,s,i,o,a,l){return e=Xp(n,r,!0,e,s,i,o,a,l),e.context=sb(null),n=e.current,r=ft(),s=Fr(n),i=Jn(r,s),i.callback=t??null,Lr(n,i,s),e.current.lanes=s,_a(e,s,r),kt(e,r),e}function hu(e,t,n,r){var s=t.current,i=ft(),o=Fr(s);return n=sb(n),t.context===null?t.context=n:t.pendingContext=n,t=Jn(i,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Lr(s,t,o),e!==null&&(yn(e,s,o,i),Ll(e,s,o)),o}function Tc(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 Cy(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Jp(e,t){Cy(e,t),(e=e.alternate)&&Cy(e,t)}function BP(){return null}var ob=typeof reportError=="function"?reportError:function(e){console.error(e)};function Zp(e){this._internalRoot=e}pu.prototype.render=Zp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(U(409));hu(e,t,null,null)};pu.prototype.unmount=Zp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Is(function(){hu(null,e,null,null)}),t[tr]=null}};function pu(e){this._internalRoot=e}pu.prototype.unstable_scheduleHydration=function(e){if(e){var t=Fw();e={blockedOn:null,target:e,priority:t};for(var n=0;n<kr.length&&t!==0&&t<kr[n].priority;n++);kr.splice(n,0,e),n===0&&zw(e)}};function em(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function mu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function jy(){}function VP(e,t,n,r,s){if(s){if(typeof r=="function"){var i=r;r=function(){var c=Tc(o);i.call(c)}}var o=ib(t,r,e,0,null,!1,!1,"",jy);return e._reactRootContainer=o,e[tr]=o.current,ra(e.nodeType===8?e.parentNode:e),Is(),o}for(;s=e.lastChild;)e.removeChild(s);if(typeof r=="function"){var a=r;r=function(){var c=Tc(l);a.call(c)}}var l=Xp(e,0,!1,null,null,!1,!1,"",jy);return e._reactRootContainer=l,e[tr]=l.current,ra(e.nodeType===8?e.parentNode:e),Is(function(){hu(t,l,n,r)}),l}function gu(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=Tc(o);a.call(l)}}hu(t,o,e,s)}else o=VP(n,t,e,s,r);return Tc(o)}Lw=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Co(t.pendingLanes);n!==0&&(vp(t,n|1),kt(t,De()),!(ae&6)&&(Ri=De()+500,Qr()))}break;case 13:Is(function(){var r=nr(e,1);if(r!==null){var s=ft();yn(r,e,1,s)}}),Jp(e,1)}};wp=function(e){if(e.tag===13){var t=nr(e,134217728);if(t!==null){var n=ft();yn(t,e,134217728,n)}Jp(e,134217728)}};Dw=function(e){if(e.tag===13){var t=Fr(e),n=nr(e,t);if(n!==null){var r=ft();yn(n,e,t,r)}Jp(e,t)}};Fw=function(){return ue};Ow=function(e,t){var n=ue;try{return ue=e,t()}finally{ue=n}};If=function(e,t,n){switch(t){case"input":if(jf(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=ou(r);if(!s)throw Error(U(90));mw(r),jf(r,s)}}}break;case"textarea":yw(e,n);break;case"select":t=n.value,t!=null&&mi(e,!!n.multiple,t,!1)}};Sw=Kp;Cw=Is;var UP={usingClientEntryPoint:!1,Events:[Ca,si,ou,kw,_w,Kp]},ao={findFiberByHostInstance:ms,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},WP={bundleType:ao.bundleType,version:ao.version,rendererPackageName:ao.rendererPackageName,rendererConfig:ao.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ir.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Ew(e),e===null?null:e.stateNode},findFiberByHostInstance:ao.findFiberByHostInstance||BP,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 sl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!sl.isDisabled&&sl.supportsFiber)try{nu=sl.inject(WP),Mn=sl}catch{}}zt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=UP;zt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!em(t))throw Error(U(200));return $P(e,t,null,n)};zt.createRoot=function(e,t){if(!em(e))throw Error(U(299));var n=!1,r="",s=ob;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=Xp(e,1,!1,null,null,n,!1,r,s),e[tr]=t.current,ra(e.nodeType===8?e.parentNode:e),new Zp(t)};zt.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=Ew(t),e=e===null?null:e.stateNode,e};zt.flushSync=function(e){return Is(e)};zt.hydrate=function(e,t,n){if(!mu(t))throw Error(U(200));return gu(null,e,t,!0,n)};zt.hydrateRoot=function(e,t,n){if(!em(e))throw Error(U(405));var r=n!=null&&n.hydratedSources||null,s=!1,i="",o=ob;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=ib(t,null,e,1,n??null,s,!1,i,o),e[tr]=t.current,ra(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 pu(t)};zt.render=function(e,t,n){if(!mu(t))throw Error(U(200));return gu(null,e,t,!1,n)};zt.unmountComponentAtNode=function(e){if(!mu(e))throw Error(U(40));return e._reactRootContainer?(Is(function(){gu(null,null,e,!1,function(){e._reactRootContainer=null,e[tr]=null})}),!0):!1};zt.unstable_batchedUpdates=Kp;zt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!mu(n))throw Error(U(200));if(e==null||e._reactInternals===void 0)throw Error(U(38));return gu(e,t,n,!1,r)};zt.version="18.3.1-next-f1338f8080-20240426";function ab(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(ab)}catch(e){console.error(e)}}ab(),aw.exports=zt;var Ds=aw.exports,lb,Py=Ds;lb=Py.createRoot,Py.hydrateRoot;var Po=typeof window<"u"?b.useLayoutEffect:b.useEffect;function pd(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 HP(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 GP(e){const t=b.useRef(null);return b.useImperativeHandle(e,()=>t.current,[]),t}const cb=!1;function fa(e){return e[e.length-1]}function KP(e){return typeof e=="function"}function jr(e,t){return KP(e)?e(t):e}const qP=Object.prototype.hasOwnProperty,Ey=Object.prototype.propertyIsEnumerable,QP=()=>Object.create(null),rs=(e,t)=>Pr(e,t,QP);function Pr(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;const s=t,i=Ry(e)&&Ry(s);if(!i&&!(Ai(e)&&Ai(s)))return s;const o=i?e:Ty(e);if(!o)return s;const a=i?s:Ty(s);if(!a)return s;const l=o.length,c=a.length,u=i?new Array(c):n();let f=0;for(let p=0;p<c;p++){const h=i?p:a[p],m=e[h],y=s[h];if(m===y){u[h]=m,(i?p<l:qP.call(e,h))&&f++;continue}if(m===null||y===null||typeof m!="object"||typeof y!="object"){u[h]=y;continue}const v=Pr(m,y,n,r+1);u[h]=v,v===m&&f++}return l===c&&f===l?e:u}function Ty(e){const t=Object.getOwnPropertyNames(e);for(const s of t)if(!Ey.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(!Ey.call(e,s))return!1;r.push(s)}return r}function Ai(e){if(!Ny(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!Ny(n)||!n.hasOwnProperty("isPrototypeOf"))}function Ny(e){return Object.prototype.toString.call(e)==="[object Object]"}function Ry(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function _s(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(!_s(e[r],t[r],n))return!1;return!0}if(Ai(e)&&Ai(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)&&!_s(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||!_s(e[o],t[o],n)))return!1;return s===i}return!1}function Ii(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 ha(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function YP(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function Ay(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 YP(t)}const XP=["http:","https:","mailto:","tel:"];function Nc(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function lo(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+=Ay(e.slice(n,s.index))+s[0],n=t.lastIndex;r=r+Ay(n?e.slice(n):e);let i=!1;return r.startsWith("//")&&(i=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:i}}function JP(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function ZP(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 Zn(){throw new Error("Invariant failed")}function pa(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 Er=4,ub=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 tm(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 yu(e,t,n,r,s,i,o){var l,c,u,f,p,h,m,y,v,g,x,w,k;o==null||o(n);let a=r;{const j=n.fullPath??n.from,_=j.length,S=((l=n.options)==null?void 0:l.caseSensitive)??e,E=!!((u=(c=n.options)==null?void 0:c.params)!=null&&u.parse&&((p=(f=n.options)==null?void 0:f.skipRouteOnParseError)!=null&&p.params));for(;a<_;){const P=tm(j,a,t);let A;const I=a,O=P[5];switch(a=O+1,i++,P[0]){case 0:{const M=j.substring(P[2],P[3]);if(S){const N=(h=s.static)==null?void 0:h.get(M);if(N)A=N;else{s.static??(s.static=new Map);const z=xs(n.fullPath??n.from);z.parent=s,z.depth=i,A=z,s.static.set(M,z)}}else{const N=M.toLowerCase(),z=(m=s.staticInsensitive)==null?void 0:m.get(N);if(z)A=z;else{s.staticInsensitive??(s.staticInsensitive=new Map);const V=xs(n.fullPath??n.from);V.parent=s,V.depth=i,A=V,s.staticInsensitive.set(N,V)}}break}case 1:{const M=j.substring(I,P[1]),N=j.substring(P[4],O),z=S&&!!(M||N),V=M?z?M:M.toLowerCase():void 0,L=N?z?N:N.toLowerCase():void 0,B=!E&&((y=s.dynamic)==null?void 0:y.find(C=>!C.skipOnParamError&&C.caseSensitive===z&&C.prefix===V&&C.suffix===L));if(B)A=B;else{const C=gd(1,n.fullPath??n.from,z,V,L);A=C,C.depth=i,C.parent=s,s.dynamic??(s.dynamic=[]),s.dynamic.push(C)}break}case 3:{const M=j.substring(I,P[1]),N=j.substring(P[4],O),z=S&&!!(M||N),V=M?z?M:M.toLowerCase():void 0,L=N?z?N:N.toLowerCase():void 0,B=!E&&((v=s.optional)==null?void 0:v.find(C=>!C.skipOnParamError&&C.caseSensitive===z&&C.prefix===V&&C.suffix===L));if(B)A=B;else{const C=gd(3,n.fullPath??n.from,z,V,L);A=C,C.parent=s,C.depth=i,s.optional??(s.optional=[]),s.optional.push(C)}break}case 2:{const M=j.substring(I,P[1]),N=j.substring(P[4],O),z=S&&!!(M||N),V=M?z?M:M.toLowerCase():void 0,L=N?z?N:N.toLowerCase():void 0,B=gd(2,n.fullPath??n.from,z,V,L);A=B,B.parent=s,B.depth=i,s.wildcard??(s.wildcard=[]),s.wildcard.push(B)}}s=A}if(E&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const P=xs(n.fullPath??n.from);P.kind=ub,P.parent=s,i++,P.depth=i,s.pathless??(s.pathless=[]),s.pathless.push(P),s=P}const T=(n.path||!n.children)&&!n.isRoot;if(T&&j.endsWith("/")){const P=xs(n.fullPath??n.from);P.kind=Er,P.parent=s,i++,P.depth=i,s.index=P,s=P}s.parse=((x=(g=n.options)==null?void 0:g.params)==null?void 0:x.parse)??null,s.skipOnParamError=E,s.parsingPriority=((k=(w=n.options)==null?void 0:w.skipRouteOnParseError)==null?void 0:k.priority)??0,T&&!s.route&&(s.route=n,s.fullPath=n.fullPath??n.from)}if(n.children)for(const j of n.children)yu(e,t,j,a,s,i,o)}function md(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 br(e){var t,n,r;if(e.pathless)for(const s of e.pathless)br(s);if(e.static)for(const s of e.static.values())br(s);if(e.staticInsensitive)for(const s of e.staticInsensitive.values())br(s);if((t=e.dynamic)!=null&&t.length){e.dynamic.sort(md);for(const s of e.dynamic)br(s)}if((n=e.optional)!=null&&n.length){e.optional.sort(md);for(const s of e.optional)br(s)}if((r=e.wildcard)!=null&&r.length){e.wildcard.sort(md);for(const s of e.wildcard)br(s)}}function xs(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 gd(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=xs("/"),r=new Uint16Array(6);for(const s of e)yu(!1,r,s,1,n,0);br(n),t.masksTree=n,t.flatCache=pa(1e3)}function nE(e,t){e||(e="/");const n=t.flatCache.get(e);if(n)return n;const r=nm(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=xs("/"),yu(t,new Uint16Array(6),{from:e},1,o,0),s.singleCache.set(i,o)),nm(r,o,n)}function sE(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=nm(e,t.segmentTree,n)}catch(o){if(o instanceof URIError)i=null;else throw o}return i&&(i.branch=aE(i.route)),t.matchCache.set(r,i),i}function iE(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function oE(e,t=!1,n){const r=xs(e.fullPath),s=new Uint16Array(6),i={},o={};let a=0;return yu(t,s,e,1,r,0,l=>{if(n==null||n(l,a),l.id in i&&Zn(),i[l.id]=l,a!==0&&l.path){const c=iE(l.fullPath);(!o[c]||l.fullPath.endsWith("/"))&&(o[c]=l)}a++}),br(r),{processedTree:{segmentTree:r,singleCache:pa(1e3),matchCache:pa(1e3),flatCache:null,masksTree:null},routesById:i,routesByPath:o}}function nm(e,t,n=!1){const r=e.split("/"),s=cE(e,r,t,n);if(!s)return null;const[i]=db(e,r,s);return{route:s.node.route,rawParams:i,parsedParams:s.parsedParams}}function db(e,t,n){var u,f,p,h,m,y,v,g,x,w;const r=lE(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=((p=n.extract)==null?void 0:p.path)??0,c=((h=n.extract)==null?void 0:h.segment)??0;for(;a<r.length;o++,a++,l++,c++){const k=r[a];if(k.kind===Er)break;if(k.kind===ub){c--,o--,l--;continue}const j=t[o],_=l;if(j&&(l+=j.length),k.kind===1){s??(s=n.node.fullPath.split("/"));const S=s[c],E=((m=k.prefix)==null?void 0:m.length)??0;if(S.charCodeAt(E)===123){const T=((y=k.suffix)==null?void 0:y.length)??0,P=S.substring(E+2,S.length-T-1),A=j.substring(E,j.length-T);i[P]=decodeURIComponent(A)}else{const T=S.substring(1);i[T]=decodeURIComponent(j)}}else if(k.kind===3){if(n.skipped&1<<a){o--,l=_-1;continue}s??(s=n.node.fullPath.split("/"));const S=s[c],E=((v=k.prefix)==null?void 0:v.length)??0,T=((g=k.suffix)==null?void 0:g.length)??0,P=S.substring(E+3,S.length-T-1),A=k.suffix||k.prefix?j.substring(E,j.length-T):j;A&&(i[P]=decodeURIComponent(A))}else if(k.kind===2){const S=k,E=e.substring(_+(((x=S.prefix)==null?void 0:x.length)??0),e.length-(((w=S.suffix)==null?void 0:w.length)??0)),T=decodeURIComponent(E);i["*"]=T,i._splat=T;break}}return n.rawParams&&Object.assign(i,n.rawParams),[i,{part:o,node:a,path:l,segment:c}]}function aE(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function lE(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function cE(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const s=!fa(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:p,skipped:h,depth:m,statics:y,dynamics:v,optionals:g}=u;let{extract:x,rawParams:w,parsedParams:k}=u;if(f.kind===2&&f.route&&!ol(c,u))continue;if(f.skipOnParamError){if(!Iy(e,t,u))continue;w=u.rawParams,x=u.extract,k=u.parsedParams}r&&f.route&&f.kind!==Er&&ol(l,u)&&(l=u);const j=p===o;if(j&&(f.route&&(!i||f.kind===Er||f.kind===2)&&ol(c,u)&&(c=u),!f.optional&&!f.wildcard&&!f.index&&!f.pathless))continue;const _=j?void 0:t[p];let S;if(j&&f.index){const E={node:f.index,index:p,skipped:h,depth:m+1,statics:y,dynamics:v,optionals:g,extract:x,rawParams:w,parsedParams:k};let T=!0;if(f.index.skipOnParamError&&(Iy(e,t,E)||(T=!1)),T){if(!v&&!g&&!h&&uE(y,o))return E;ol(c,E)&&(c=E)}}if(f.wildcard)for(let E=f.wildcard.length-1;E>=0;E--){const T=f.wildcard[E],{prefix:P,suffix:A}=T;if(!(P&&(j||!(T.caseSensitive?_:S??(S=_.toLowerCase())).startsWith(P)))){if(A){if(j)continue;const I=t.slice(p).join("/").slice(-A.length);if((T.caseSensitive?I:I.toLowerCase())!==A)continue}a.push({node:T,index:o,skipped:h,depth:m+1,statics:y,dynamics:v,optionals:g,extract:x,rawParams:w,parsedParams:k})}}if(f.optional){const E=h|1<<m,T=m+1;for(let P=f.optional.length-1;P>=0;P--){const A=f.optional[P];a.push({node:A,index:p,skipped:E,depth:T,statics:y,dynamics:v,optionals:g,extract:x,rawParams:w,parsedParams:k})}if(!j)for(let P=f.optional.length-1;P>=0;P--){const A=f.optional[P],{prefix:I,suffix:O}=A;if(I||O){const M=A.caseSensitive?_:S??(S=_.toLowerCase());if(I&&!M.startsWith(I)||O&&!M.endsWith(O))continue}a.push({node:A,index:p+1,skipped:h,depth:T,statics:y,dynamics:v,optionals:g+il(o,p),extract:x,rawParams:w,parsedParams:k})}}if(!j&&f.dynamic&&_)for(let E=f.dynamic.length-1;E>=0;E--){const T=f.dynamic[E],{prefix:P,suffix:A}=T;if(P||A){const I=T.caseSensitive?_:S??(S=_.toLowerCase());if(P&&!I.startsWith(P)||A&&!I.endsWith(A))continue}a.push({node:T,index:p+1,skipped:h,depth:m+1,statics:y,dynamics:v+il(o,p),optionals:g,extract:x,rawParams:w,parsedParams:k})}if(!j&&f.staticInsensitive){const E=f.staticInsensitive.get(S??(S=_.toLowerCase()));E&&a.push({node:E,index:p+1,skipped:h,depth:m+1,statics:y+il(o,p),dynamics:v,optionals:g,extract:x,rawParams:w,parsedParams:k})}if(!j&&f.static){const E=f.static.get(_);E&&a.push({node:E,index:p+1,skipped:h,depth:m+1,statics:y+il(o,p),dynamics:v,optionals:g,extract:x,rawParams:w,parsedParams:k})}if(f.pathless){const E=m+1;for(let T=f.pathless.length-1;T>=0;T--){const P=f.pathless[T];a.push({node:P,index:p,skipped:h,depth:E,statics:y,dynamics:v,optionals:g,extract:x,rawParams:w,parsedParams:k})}}}if(c)return c;if(r&&l){let u=l.index;for(let p=0;p<l.index;p++)u+=t[p].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 il(e,t){return 2**(e-t-1)}function uE(e,t){return e===2**(t-1)-1}function Iy(e,t,n){try{const[r,s]=db(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 ol(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===Er)>(e.node.kind===Er)||t.node.kind===Er==(e.node.kind===Er)&&t.depth>e.depth))):!0}function Vl(e){return rm(e.filter(t=>t!==void 0).join("/"))}function rm(e){return e.replace(/\/{2,}/g,"/")}function fb(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function zr(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function hb(e){return zr(fb(e))}function Rc(e,t){return e!=null&&e.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function dE(e,t,n){return Rc(e,n)===Rc(t,n)}function fE({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&&fa(a)==="";)a.pop();const f=t.split("/");for(let p=0,h=f.length;p<h;p++){const m=f[p];m===""?p?p===h-1&&a.push(m):a=[m]:m===".."?a.pop():m==="."||a.push(m)}}a.length>1&&(fa(a)===""?n==="never"&&a.pop():n==="always"&&a.push(""));let l,c="";for(let f=0;f<a.length;f++){f>0&&(c+="/");const p=a[f];if(!p)continue;l=tm(p,0,l);const h=l[0];if(h===0){c+=p;continue}const m=l[5],y=p.substring(0,l[1]),v=p.substring(l[4],m),g=p.substring(l[2],l[3]);h===1?c+=y||v?`${y}{$${g}}${v}`:`$${g}`:h===2?c+=y||v?`${y}{$}${v}`:"$":c+=`${y}{-$${g}}${v}`}c=rm(c);const u=c||"/";return o&&r&&r.set(o,u),u}function hE(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 yd(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=>Ly(s,n)).join("/"):Ly(r,n)}function My({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=tm(e,u,l);const f=l[5];if(a=f+1,u===f)continue;const p=l[0];if(p===0){c+="/"+e.substring(u,f);continue}if(p===2){const h=t._splat;i._splat=h,i["*"]=h;const m=e.substring(u,l[1]),y=e.substring(l[4],f);if(!h){s=!0,(m||y)&&(c+="/"+m+y);continue}const v=yd("_splat",t,n);c+="/"+m+v+y;continue}if(p===1){const h=e.substring(l[2],l[3]);!s&&!(h in t)&&(s=!0),i[h]=t[h];const m=e.substring(u,l[1]),y=e.substring(l[4],f),v=yd(h,t,n)??"undefined";c+="/"+m+v+y;continue}if(p===3){const h=e.substring(l[2],l[3]),m=t[h];if(m==null)continue;i[h]=m;const y=e.substring(u,l[1]),v=e.substring(l[4],f),g=yd(h,t,n)??"";c+="/"+y+g+v;continue}}return e.endsWith("/")&&(c+="/"),{usedParams:i,interpolatedPath:c||"/",isMissingParams:s}}function Ly(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 pE(){try{return typeof window<"u"&&typeof window.sessionStorage=="object"?window.sessionStorage:void 0}catch{return}}const mE="tsr-scroll-restoration-v1_3";function gE(){const e=pE();if(!e)return null;let t={};try{const r=JSON.parse(e.getItem("tsr-scroll-restoration-v1_3")||"{}");Ai(r)&&(t=r)}catch{}return{get state(){return t},set:r=>{t=jr(r,t)||t},persist:()=>{try{e.setItem(mE,JSON.stringify(t))}catch{}}}}const Dy=gE(),yE=e=>e.state.__TSR_key||e.href;function xE(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 al=!1;const co="window",Fy="data-scroll-restoration-id";function vE(e,t){if(!Dy)return;const n=Dy;if((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!n)return;e.isScrollRestorationSetup=!0,al=!1;const r=e.options.getScrollRestorationKey||yE,s=new Map;window.history.scrollRestoration="manual";const i=a=>{if(!(al||!e.isScrollRestoring))if(a.target===document||a.target===window)s.set(co,{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 p;if(u===co)p=co;else if(u.isConnected){const h=u.getAttribute(Fy);p=h?`[${Fy}="${h}"]`:xE(u)}p&&(l[p]=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}))){al=!0;try{const p=e.isScrollRestoring?n.state[l]:void 0;let h=!1;if(p)for(const m in p){const y=p[m];if(!Ai(y))continue;const{scrollX:v,scrollY:g}=y;if(!(!Number.isFinite(v)||!Number.isFinite(g))){if(m===co)window.scrollTo({top:g,left:v,behavior:c}),h=!0;else if(m){let x;try{x=document.querySelector(m)}catch{continue}x&&(x.scrollLeft=v,x.scrollTop=g,h=!0)}}}if(!h){const m=e.history.location.hash.slice(1);if(m){const y=((f=window.history.state)==null?void 0:f.__hashScrollIntoViewOptions)??!0;if(y){const v=document.getElementById(m);v&&v.scrollIntoView(y)}}else{const y={top:0,left:0,behavior:c};if(window.scrollTo(y),u)for(const v of u){if(v===co)continue;const g=typeof v=="function"?v():document.querySelector(v);g&&g.scrollTo(y)}}}}finally{al=!1}e.isScrollRestoring&&n.set(p=>(p[l]||(p[l]={}),p))}})}function wE(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 xd(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function bE(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]=xd(s):Array.isArray(i)?i.push(xd(s)):n[r]=[i,xd(s)]}return n}const kE=SE(JSON.parse),_E=CE(JSON.stringify,JSON.parse);function SE(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=bE(t);for(const r in n){const s=n[r];if(typeof s=="string")try{n[r]=e(s)}catch{}}return n}}function CE(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=wE(s,r);return i?`?${i}`:""}}const Ss="__root__";function jE(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 vt(e){return e instanceof Response&&!!e.options}function PE(e){return{input:({url:t})=>{for(const n of e)t=fh(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=pb(e[n],t);return t}}}function EE(e){const t=hb(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=Vl(["/",t,o.pathname]),o)}}function fh(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 pb(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 TE(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),p=n(e.isTransitioning),h=n(e.location),m=n(e.resolvedLocation),y=n(e.statusCode),v=n(e.redirect),g=n([]),x=n([]),w=n([]),k=r(()=>vd(o,g.get())),j=r(()=>vd(a,x.get())),_=r(()=>vd(l,w.get())),S=r(()=>g.get()[0]),E=r(()=>g.get().some(V=>{var L;return((L=o.get(V))==null?void 0:L.get().status)==="pending"})),T=r(()=>{var V;return{locationHref:h.get().href,resolvedLocationHref:(V=m.get())==null?void 0:V.href,status:c.get()}}),P=r(()=>({status:c.get(),loadedAt:u.get(),isLoading:f.get(),isTransitioning:p.get(),matches:k.get(),location:h.get(),resolvedLocation:m.get(),statusCode:y.get(),redirect:v.get()})),A=pa(64);function I(V){let L=A.get(V);return L||(L=r(()=>{const B=g.get();for(const C of B){const $=o.get(C);if($&&$.routeId===V)return $.get()}}),A.set(V,L)),L}const O={status:c,loadedAt:u,isLoading:f,isTransitioning:p,location:h,resolvedLocation:m,statusCode:y,redirect:v,matchesId:g,pendingIds:x,cachedIds:w,matches:k,pendingMatches:j,cachedMatches:_,firstId:S,hasPending:E,matchRouteDeps:T,matchStores:o,pendingMatchStores:a,cachedMatchStores:l,__store:P,getRouteMatchStore:I,setMatches:M,setPending:N,setCached:z};M(e.matches),i==null||i(O);function M(V){wd(V,o,g,n,s)}function N(V){wd(V,a,x,n,s)}function z(V){wd(V,l,w,n,s)}return O}function vd(e,t){const n=[];for(const r of t){const s=e.get(r);s&&n.push(s.get())}return n}function wd(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)}ZP(n.get(),i)||n.set(i)})}const hh=e=>{var t;if(!e.rendered)return e.rendered=!0,(t=e.onReady)==null?void 0:t.call(e)},NE=e=>e.stores.matchesId.get().some(t=>{var n;return(n=e.stores.matchStores.get(t))==null?void 0:n.get()._forcePending}),xu=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),Cs=(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},Oy=(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},Tr=(e,t,n)=>{var r,s,i;if(!(!vt(n)&&!st(n)))throw vt(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:vt(n)?"redirected":st(n)?"notFound":o.status==="pending"?"success":o.status,context:Cs(e,t.index),isFetching:!1,error:n})),st(n)&&!n.routeId&&(n.routeId=t.routeId),(i=t._nonReactive.loadPromise)==null||i.resolve()),vt(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},mb=(e,t)=>{const n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},zy=(e,t,n)=>{const r=Cs(e,n);e.updateMatch(t,s=>({...s,context:r}))},uo=(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),Tr(e,e.router.getMatch(s),n);try{(l=(a=o.options).onError)==null||l.call(a,n)}catch(c){n=c,Tr(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&&!vt(n)&&!st(n)&&(e.serialError??(e.serialError=n))},gb=(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&&!xu(e,t)&&(n.options.loader||n.options.beforeLoad||xb(n))&&typeof s=="number"&&s!==1/0&&(n.options.pendingComponent??((i=e.router.options)==null?void 0:i.defaultPendingComponent))){const o=setTimeout(()=>{hh(e)},s);r._nonReactive.pendingTimeout=o}},RE=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;gb(e,t,n,r);const s=()=>{const i=e.router.getMatch(t);i.preload&&(i.status==="redirected"||i.status==="notFound")&&Tr(e,i,i.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(s):s()},AE=(e,t,n,r)=>{const s=e.router.getMatch(t);let i=s._nonReactive.loadPromise;s._nonReactive.loadPromise=Ii(()=>{i==null||i.resolve(),i=void 0});const{paramsError:o,searchError:a}=s;o&&uo(e,n,o,"PARSE_PARAMS"),a&&uo(e,n,a,"VALIDATE_SEARCH"),gb(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,j=>({...j,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{u(),f()});return}s._nonReactive.beforeLoadPromise=Ii();const p={...Cs(e,n,!1),...s.__routeContext},{search:h,params:m,cause:y}=s,v=xu(e,t),g={search:h,abortController:l,params:m,preload:v,context:p,location:e.location,navigate:k=>e.router.navigate({...k,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:v?"preload":y,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},x=k=>{if(k===void 0){e.router.batch(()=>{u(),f()});return}(vt(k)||st(k))&&(u(),uo(e,n,k,"BEFORE_LOAD")),e.router.batch(()=>{u(),e.updateMatch(t,j=>({...j,__beforeLoadContext:k})),f()})};let w;try{if(w=r.options.beforeLoad(g),ha(w))return u(),w.catch(k=>{uo(e,n,k,"BEFORE_LOAD")}).then(x)}catch(k){u(),uo(e,n,k,"BEFORE_LOAD")}x(w)},IE=(e,t)=>{const{id:n,routeId:r}=e.matches[t],s=e.router.looseRoutesById[r],i=()=>a(),o=()=>AE(e,n,t,s),a=()=>{if(mb(e,n))return;const l=RE(e,n,s);return ha(l)?l.then(o):o()};return i()},ME=(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,p,h])=>({meta:f==null?void 0:f.meta,links:f==null?void 0:f.links,headScripts:f==null?void 0:f.scripts,headers:h,scripts:p,styles:f==null?void 0:f.styles}))},yb=(e,t,n,r,s)=>{const i=t[r-1],{params:o,loaderDeps:a,abortController:l,cause:c}=e.router.getMatch(n),u=Cs(e,r),f=xu(e,n);return{params:o,deps:a,preload:!!f,parentMatchPromise:i,abortController:l,context:u,location:e.location,navigate:p=>e.router.navigate({...p,_fromLocation:e.location}),cause:f?"preload":c,route:s,...e.router.options.additionalContext}},$y=async(e,t,n,r,s)=>{var i,o,a,l,c;try{const u=e.router.getMatch(n);try{(!(cb??e.router.isServer)||u.ssr===!0)&&ma(s);const f=s.options.loader,p=typeof f=="function"?f:f==null?void 0:f.handler,h=p==null?void 0:p(yb(e,t,n,r,s)),m=!!p&&ha(h);if((m||s._lazyPromise||s._componentsPromise||s.options.head||s.options.scripts||s.options.headers||u._nonReactive.minPendingPromise)&&e.updateMatch(n,v=>({...v,isFetching:"loader"})),p){const v=m?await h:h;Tr(e,e.router.getMatch(n),v),v!==void 0&&e.updateMatch(n,g=>({...g,loaderData:v}))}s._lazyPromise&&await s._lazyPromise;const y=u._nonReactive.minPendingPromise;y&&await y,s._componentsPromise&&await s._componentsPromise,e.updateMatch(n,v=>({...v,error:void 0,context:Cs(e,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(f){let p=f;if((p==null?void 0:p.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:Cs(e,r)}));return}const h=u._nonReactive.minPendingPromise;h&&await h,st(f)&&await((a=(o=s.options.notFoundComponent)==null?void 0:o.preload)==null?void 0:a.call(o)),Tr(e,e.router.getMatch(n),f);try{(c=(l=s.options).onError)==null||c.call(l,f)}catch(m){p=m,Tr(e,e.router.getMatch(n),m)}!vt(p)&&!st(p)&&await ma(s,["errorComponent"]),e.updateMatch(n,m=>({...m,error:p,context:Cs(e,r),status:"error",isFetching:!1}))}}catch(u){const f=e.router.getMatch(n);f&&(f._nonReactive.loaderPromise=void 0),Tr(e,f,u)}},LE=async(e,t,n)=>{var h,m,y,v;async function r(g,x,w,k,j){const _=Date.now()-x.updatedAt,S=g?j.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:j.options.staleTime??e.router.options.defaultStaleTime??0,E=j.options.shouldReload,T=typeof E=="function"?E(yb(e,t,s,n,j)):E,{status:P,invalid:A}=k,I=_>=S&&(!!e.forceStaleReload||k.cause==="enter"||w!==void 0&&w!==k.id);o=P==="success"&&(A||(T??I)),g&&j.options.preload===!1||(o&&!e.sync&&u?(a=!0,(async()=>{var O,M;try{await $y(e,t,s,n,j);const N=e.router.getMatch(s);(O=N._nonReactive.loaderPromise)==null||O.resolve(),(M=N._nonReactive.loadPromise)==null||M.resolve(),N._nonReactive.loaderPromise=void 0,N._nonReactive.loadPromise=void 0}catch(N){vt(N)&&await e.router.navigate(N.options)}})()):P!=="success"||o?await $y(e,t,s,n,j):zy(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(mb(e,s)){if(!e.router.getMatch(s))return e.matches[n];zy(e,s,n)}else{const g=e.router.getMatch(s),x=e.router.stores.matchesId.get()[n],w=((h=x&&e.router.stores.matchStores.get(x)||null)==null?void 0:h.routeId)===i?x:(m=e.router.stores.matches.get().find(j=>j.routeId===i))==null?void 0:m.id,k=xu(e,s);if(g._nonReactive.loaderPromise){if(g.status==="success"&&!e.sync&&!g.preload&&u)return g;await g._nonReactive.loaderPromise;const j=e.router.getMatch(s),_=j._nonReactive.error||j.error;_&&Tr(e,j,_),j.status==="pending"&&await r(k,g,w,j,l)}else{const j=k&&!e.router.stores.matchStores.has(s),_=e.router.getMatch(s);_._nonReactive.loaderPromise=Ii(),j!==_.preload&&e.updateMatch(s,S=>({...S,preload:j})),await r(k,g,w,_,l)}}const f=e.router.getMatch(s);a||((y=f._nonReactive.loaderPromise)==null||y.resolve(),(v=f._nonReactive.loadPromise)==null||v.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 p=a?f.isFetching:!1;return p!==f.isFetching||f.invalid!==!1?(e.updateMatch(s,g=>({...g,isFetching:p,invalid:!1})),e.router.getMatch(s)):f};async function By(e){var p,h;const t=e,n=[];NE(t.router)&&hh(t);let r;for(let m=0;m<t.matches.length;m++){try{const y=IE(t,m);ha(y)&&await y}catch(y){if(vt(y))throw y;if(st(y))r=y;else if(!t.preload)throw y;break}if(t.serialError||t.firstBadMatchIndex!=null)break}const s=t.firstBadMatchIndex??t.matches.length,i=r&&!t.preload?Oy(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(LE(t,n,m));try{await Promise.all(n)}catch{const m=await Promise.allSettled(n);for(const y of m){if(y.status!=="rejected")continue;const v=y.reason;if(vt(v))throw v;st(v)?a??(a=v):l??(l=v)}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=Oy(t,c);m===void 0&&Zn();const y=t.matches[m],v=t.router.looseRoutesById[y.routeId],g=(p=t.router.options)==null?void 0:p.defaultNotFoundComponent;!v.options.notFoundComponent&&g&&(v.options.notFoundComponent=g),c.routeId=y.routeId;const x=y.routeId===t.router.routeTree.id;t.updateMatch(y.id,w=>({...w,...x?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:c},isFetching:!1})),u=m,await ma(v,["notFoundComponent"])}else if(!t.preload){const m=t.matches[0];m.globalNotFound||(h=t.router.getMatch(m.id))!=null&&h.globalNotFound&&t.updateMatch(m.id,y=>({...y,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const m=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await ma(m,["errorComponent"])}for(let m=0;m<=u;m++){const{id:y,routeId:v}=t.matches[m],g=t.router.looseRoutesById[v];try{const x=ME(t,y,g);if(x){const w=await x;t.updateMatch(y,k=>({...k,...w}))}}catch(x){console.error(`Error executing head for route ${v}:`,x)}}const f=hh(t);if(ha(f)&&await f,c)throw c;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function Vy(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 ma(e,t=Ul){!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===Ul?(()=>{if(e._componentsPromise===void 0){const r=Vy(e,Ul);r?e._componentsPromise=r.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():Vy(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function xb(e){var t;for(const n of Ul)if((t=e.options[n])!=null&&t.preload)return!0;return!1}const Ul=["component","errorComponent","pendingComponent","notFoundComponent"];var $r="__TSR_index",Uy="popstate",Wy="beforeunload";function DE(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,p;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 h of c){const m=Ac(l.path,l.state);if(await h.blockerFn({currentLocation:t,nextLocation:m,action:l.type})){(p=e.onBlocked)==null||p.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[$r];a=Hy(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[$r];a=Hy(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[$r]!==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(p=>p!==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 Hy(e,t){t||(t={});const n=sm();return{...t,key:n,__TSR_key:n,[$r]:e}}function FE(e){var E,T;const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let s=[];const i=()=>s,o=P=>s=P,a=P=>P,l=()=>Ac(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state);if(!((E=t.history.state)!=null&&E.__TSR_key)&&!((T=t.history.state)!=null&&T.key)){const P=sm();t.history.replaceState({[$r]:0,key:P,__TSR_key:P},"")}let c=l(),u,f=!1,p=!1,h=!1,m=!1;const y=()=>c;let v,g;const x=()=>{v&&(S._ignoreSubscribers=!0,(v.isPush?t.history.pushState:t.history.replaceState)(v.state,"",v.href),S._ignoreSubscribers=!1,v=void 0,g=void 0,u=void 0)},w=(P,A,I)=>{const O=a(A);g||(u=c),c=Ac(A,I),v={href:O,state:I,isPush:(v==null?void 0:v.isPush)||P==="push"},g||(g=Promise.resolve().then(()=>x()))},k=P=>{c=l(),S.notify({type:P})},j=async()=>{if(p){p=!1;return}const P=l(),A=P.state[$r]-c.state[$r],I=A===1,O=A===-1,M=!I&&!O||f;f=!1;const N=M?"GO":O?"BACK":"FORWARD",z=M?{type:"GO",index:A}:{type:O?"BACK":"FORWARD"};if(h)h=!1;else{const V=i();if(typeof document<"u"&&V.length){for(const L of V)if(await L.blockerFn({currentLocation:c,nextLocation:P,action:N})){p=!0,t.history.go(1),S.notify(z);return}}}c=l(),S.notify(z)},_=P=>{if(m){m=!1;return}let A=!1;const I=i();if(typeof document<"u"&&I.length)for(const O of I){const M=O.enableBeforeUnload??!0;if(M===!0){A=!0;break}if(typeof M=="function"&&M()===!0){A=!0;break}}if(A)return P.preventDefault(),P.returnValue=""},S=DE({getLocation:y,getLength:()=>t.history.length,pushState:(P,A)=>w("push",P,A),replaceState:(P,A)=>w("replace",P,A),back:P=>(P&&(h=!0),m=!0,t.history.back()),forward:P=>{P&&(h=!0),m=!0,t.history.forward()},go:P=>{f=!0,t.history.go(P)},createHref:P=>a(P),flush:x,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(Wy,_,{capture:!0}),t.removeEventListener(Uy,j)},onBlocked:()=>{u&&c!==u&&(c=u)},getBlockers:i,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(Wy,_,{capture:!0}),t.addEventListener(Uy,j),t.history.pushState=function(...P){const A=n.apply(t.history,P);return S._ignoreSubscribers||k("PUSH"),A},t.history.replaceState=function(...P){const A=r.apply(t.history,P);return S._ignoreSubscribers||k("REPLACE"),A},S}function OE(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Ac(e,t){const n=OE(e),r=n.indexOf("#"),s=n.indexOf("?"),i=sm();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||{[$r]:0,key:i,__TSR_key:i}}}function sm(){return(Math.random()+1).toString(36).substring(7)}function bi(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 zE=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=hE(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=FE()),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=pa(1e3),f=this.buildRouteTree(),this.setRoutes(f)}if(!this.stores&&this.latestLocation){const f=this.getStoreConfig(this);this.batch=f.batch,this.stores=TE(BE(this.latestLocation),f),vE(this)}let a=!1;const l=this.options.basepath??"/",c=this.options.rewrite;if(i||s!==l||o!==c){this.basepath=l;const f=[],p=hb(l);p&&p!=="/"&&f.push(EE({basepath:l})),c&&f.push(c),this.rewrite=f.length===0?void 0:f.length===1?f[0]:PE(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=oE(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:p})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(l)){const g=this.options.parseSearch(c),x=this.options.stringifySearch(g);return{href:l+x+u,publicHref:l+x+u,pathname:lo(l).path,external:!1,searchStr:x,search:rs(r==null?void 0:r.search,g),hash:lo(u.slice(1)).path,state:Pr(r==null?void 0:r.state,p)}}const h=new URL(f,this.origin),m=fh(this.rewrite,h),y=this.options.parseSearch(m.search),v=this.options.stringifySearch(y);return m.search=v,{href:m.href.replace(m.origin,""),publicHref:f,pathname:lo(m.pathname).path,external:!!this.rewrite&&m.origin!==this.origin,searchStr:v,search:rs(r==null?void 0:r.search,y),hash:lo(m.hash.slice(1)).path,state:Pr(r==null?void 0:r.state,p)}},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)=>fE({base:n,to:rm(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=>VE({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 P,A;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),p=i.to?this.resolvePathWithBase(c,`${i.to}`):this.resolvePathWithBase(c,"."),h=i.params===!1||i.params===null?Object.create(null):(i.params??!0)===!0?f:Object.assign(f,jr(i.params,f)),m=this.getMatchedRoutes(p);let y=m.matchedRoutes;if((!m.foundRoute||m.foundRoute.path!=="/"&&m.routeParams["**"])&&this.options.notFoundRoute&&(y=[...y,this.options.notFoundRoute]),Object.keys(h).length>0)for(const I of y){const O=((P=I.options.params)==null?void 0:P.stringify)??I.options.stringifyParams;if(O)try{Object.assign(h,O(h))}catch{}}const v=n.leaveParams?p:lo(My({path:p,params:h,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let g=u;if(n._includeValidateSearch&&((A=this.options.search)!=null&&A.strict)){const I={};y.forEach(O=>{if(O.options.validateSearch)try{Object.assign(I,Wl(O.options.validateSearch,{...I,...g}))}catch{}}),g=I}g=UE({search:g,dest:i,destRoutes:y,_includeValidateSearch:n._includeValidateSearch}),g=rs(u,g);const x=this.options.stringifySearch(g),w=i.hash===!0?o.hash:i.hash?jr(i.hash,o.hash):void 0,k=w?`#${w}`:"";let j=i.state===!0?o.state:i.state?jr(i.state,o.state):{};j=Pr(o.state,j);const _=`${v}${x}${k}`;let S,E,T=!1;if(this.rewrite){const I=new URL(_,this.origin),O=pb(this.rewrite,I);S=I.href.replace(I.origin,""),O.origin!==this.origin?(E=O.href,T=!0):E=O.pathname+O.search+O.hash}else S=JP(_),E=S;return{publicHref:E,href:S,pathname:v,search:g,searchStr:x,state:j,hash:w??"",external:T,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:p,...h}=u.route,m=p===!1||p===null?Object.create(null):(p??!0)===!0?c:Object.assign(c,jr(p,c));o={from:n.from,...h,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=_s(s.state,this.latestLocation.state);return l.forEach(u=>{delete s.state[u]}),c},o=zr(this.latestLocation.href)===zr(s.href);let a=this.commitLocationPromise;if(this.commitLocationPromise=Ii(()=>{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,p=Ac(a,{__TSR_index:n?f:f+1}),h=new URL(p.pathname,this.origin);l.to=fh(this.rewrite,h).pathname,l.search=this.options.parseSearch(p.search),l.hash=p.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(Nc(u,this.protocolAllowlist))return Promise.resolve();if(!o.ignoreBlocker){const f=((c=(l=this.history).getBlockers)==null?void 0:c.call(l))??[];for(const p of f)if(p!=null&&p.blockerFn&&await p.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=bi(u,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:"onBeforeNavigate",...f}),this.emit({type:"onBeforeLoad",...f}),await By({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 v,g;let p=null,h=null,m=null,y=null;this.batch(()=>{const x=this.stores.pendingMatches.get(),w=x.length,k=this.stores.matches.get();p=w?k.filter(S=>!this.stores.pendingMatchStores.has(S.id)):null;const j=new Set;for(const S of this.stores.pendingMatchStores.values())S.routeId&&j.add(S.routeId);const _=new Set;for(const S of this.stores.matchStores.values())S.routeId&&_.add(S.routeId);h=w?k.filter(S=>!j.has(S.routeId)):null,m=w?x.filter(S=>!_.has(S.routeId)):null,y=w?x.filter(S=>_.has(S.routeId)):k,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),w&&(this.stores.setMatches(x),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...p.filter(S=>S.status!=="error"&&S.status!=="notFound"&&S.status!=="redirected")]),this.clearExpiredCache())});for(const[x,w]of[[h,"onLeave"],[m,"onEnter"],[y,"onStay"]])if(x)for(const k of x)(g=(v=this.looseRoutesById[k.routeId].options)[w])==null||g.call(v,k)})})}})}catch(u){vt(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(p=>p.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(bi(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&&Nc(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=ma,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 By({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(vt(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&&!_s(a.rawParams,n.params,{partial:!0})?!1:(r==null?void 0:r.includeSearch)??!0?_s(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??_E,parseSearch:e.parseSearch??kE,protocolAllowlist:e.protocolAllowlist??XP}),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,p;const n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:s,parsedParams:i}=n;let{matchedRoutes:o}=n,a=!1;(r?r.path!=="/"&&s["**"]:zr(e.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:a=!0);const l=a?HE(this.options.notFoundMode,o):void 0,c=new Array(o.length),u=new Map;for(const h of this.stores.matchStores.values())h.routeId&&u.set(h.routeId,h.get());for(let h=0;h<o.length;h++){const m=o[h],y=c[h-1];let v,g,x;{const N=(y==null?void 0:y.search)??e.search,z=(y==null?void 0:y._strictSearch)??void 0;try{const V=Wl(m.options.validateSearch,{...N})??void 0;v={...N,...V},g={...z,...V},x=void 0}catch(V){let L=V;if(V instanceof Ic||(L=new Ic(V.message,{cause:V})),t!=null&&t.throwOnError)throw L;v=N,g={},x=L}}const w=((p=(f=m.options).loaderDeps)==null?void 0:p.call(f,{search:v}))??"",k=w?JSON.stringify(w):"",{interpolatedPath:j,usedParams:_}=My({path:m.fullPath,params:s,decoder:this.pathParamsDecoder,server:this.isServer}),S=m.id+j+k,E=this.getMatch(S),T=u.get(m.id),P=(E==null?void 0:E._strictParams)??_;let A;if(!E)try{Gy(m,_,i,P)}catch(N){if(st(N)||vt(N)?A=N:A=new $E(N.message,{cause:N}),t!=null&&t.throwOnError)throw A}Object.assign(s,P);const I=T?"stay":"enter";let O;if(E)O={...E,cause:I,params:(T==null?void 0:T.params)??s,_strictParams:P,search:rs(T?T.search:E.search,v),_strictSearch:g};else{const N=m.options.loader||m.options.beforeLoad||m.lazyFn||xb(m)?"pending":"success";O={id:S,ssr:m.options.ssr,index:h,routeId:m.id,params:(T==null?void 0:T.params)??s,_strictParams:P,pathname:j,updatedAt:Date.now(),search:T?rs(T.search,v):v,_strictSearch:g,searchError:void 0,status:N,isFetching:!1,error:void 0,paramsError:A,__routeContext:void 0,_nonReactive:{loadPromise:Ii()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:I,loaderDeps:T?Pr(T.loaderDeps,w):w,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||(O.globalNotFound=l===m.id),O.searchError=x;const M=this.getParentContext(y);O.context={...M,...O.__routeContext,...O.__beforeLoadContext},c[h]=O}for(let h=0;h<c.length;h++){const m=c[h],y=this.looseRoutesById[m.routeId],v=this.getMatch(m.id),g=u.get(m.routeId);if(m.params=g?rs(g.params,s):s,!v){const x=c[h-1],w=this.getParentContext(x);if(y.options.context){const k={deps:m.loaderDeps,params:m.params,context:w??{},location:e,navigate:j=>this.navigate({...j,_fromLocation:e}),buildLocation:this.buildLocation,cause:m.cause,abortController:m.abortController,preload:!!m.preload,matches:c,routeId:y.id};m.__routeContext=y.options.context(k)??void 0}m.context={...w,...m.__routeContext,...m.__beforeLoadContext}}}return c}matchRoutesLightweight(e){var u;const{matchedRoutes:t,routeParams:n,parsedParams:r}=this.getMatchedRoutes(e.pathname),s=fa(t),i={...e.search};for(const f of t)try{Object.assign(i,Wl(f.options.validateSearch,i))}catch{}const o=fa(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 p of t)try{Gy(p,n,r??{},f)}catch{}c=f}return{matchedRoutes:t,fullPath:s.fullPath,search:i,params:c}}},Ic=class extends Error{},$E=class extends Error{};function BE(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function Wl(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Ic("Async validation not supported");if(n.issues)throw new Ic(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 VE({pathname:e,routesById:t,processedTree:n}){const r=Object.create(null),s=zr(e);let i,o;const a=sE(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 UE({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return WE(n)(e,t,r??!1)}function WE(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,p)=>p(f),a));const u=l(c);return"postSearchFilters"in i.options&&i.options.postSearchFilters?i.options.postSearchFilters.reduce((f,p)=>p(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,...Wl(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:jr(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 HE(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 Ss}function Gy(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 GE="Error preloading route! ☝️";var vb=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=Ss:this.parentRoute||Zn();let s=r?Ss:n==null?void 0:n.path;s&&s!=="/"&&(s=fb(s));const i=(n==null?void 0:n.id)||s;let o=r?Ss:Vl([this.parentRoute.id==="__root__"?"":this.parentRoute.id,i]);s==="__root__"&&(s="/"),o!=="__root__"&&(o=Vl(["/",o]));const a=o==="__root__"?"/":Vl([this.parentRoute.fullPath,s]);this._path=s,this._id=o,this._fullPath=a,this._to=zr(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=>jE({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.")}},KE=class extends vb{constructor(e){super(e)}};function qE(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 im(e){const t=e.errorComponent??om;return d.jsx(QE,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?b.createElement(t,{error:n,reset:r}):e.children})}var QE=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 om({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 YE({children:e,fallback:t=null}){return wb()?d.jsx(Si.Fragment,{children:e}):d.jsx(Si.Fragment,{children:t})}function wb(){return Si.useSyncExternalStore(XE,()=>!0,()=>!1)}function XE(){return()=>{}}var bb=b.createContext(null);function Bt(e){return b.useContext(bb)}var vu=b.createContext(void 0),JE=b.createContext(void 0),Ce=(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))(Ce||{});function ZE({update:e,notify:t,unwatched:n}){return{link:r,unlink:s,propagate:i,checkDirty:o,shallowPropagate:a};function r(c,u,f){const p=u.depsTail;if(p!==void 0&&p.dep===c)return;const h=p!==void 0?p.nextDep:u.deps;if(h!==void 0&&h.dep===c){h.version=f,u.depsTail=h;return}const m=c.subsTail;if(m!==void 0&&m.version===f&&m.sub===u)return;const y=u.depsTail=c.subsTail={version:f,dep:c,sub:u,prevDep:p,nextDep:h,prevSub:m,nextSub:void 0};h!==void 0&&(h.prevDep=y),p!==void 0?p.nextDep=y:u.deps=y,m!==void 0?m.nextSub=y:c.subs=y}function s(c,u=c.sub){const f=c.dep,p=c.prevDep,h=c.nextDep,m=c.nextSub,y=c.prevSub;return h!==void 0?h.prevDep=p:u.depsTail=p,p!==void 0?p.nextDep=h:u.deps=h,m!==void 0?m.prevSub=y:f.subsTail=y,y!==void 0?y.nextSub=m:(f.subs=m)===void 0&&n(f),h}function i(c){let u=c.nextSub,f;e:do{const p=c.sub;let h=p.flags;if(h&60?h&12?h&4?!(h&48)&&l(c,p)?(p.flags=h|40,h&=1):h=0:p.flags=h&-9|32:h=0:p.flags=h|32,h&2&&t(p),h&1){const m=p.subs;if(m!==void 0){const y=(c=m).nextSub;y!==void 0&&(f={value:u,prev:f},u=y);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,p=0,h=!1;e:do{const m=c.dep,y=m.flags;if(u.flags&16)h=!0;else if((y&17)===17){if(e(m)){const v=m.subs;v.nextSub!==void 0&&a(v),h=!0}}else if((y&33)===33){(c.nextSub!==void 0||c.prevSub!==void 0)&&(f={value:c,prev:f}),c=m.deps,u=m,++p;continue}if(!h){const v=c.nextDep;if(v!==void 0){c=v;continue}}for(;p--;){const v=u.subs,g=v.nextSub!==void 0;if(g?(c=f.value,f=f.prev):c=v,h){if(e(u)){g&&a(v),u=c.sub;continue}h=!1}else u.flags&=-33;u=c.sub;const x=c.nextDep;if(x!==void 0){c=x;continue e}}return h}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 ph=[];let Hl=0;const{link:Ky,unlink:tT,propagate:nT,checkDirty:kb,shallowPropagate:qy}=ZE({update(e){return e._update()},notify(e){ph[mh++]=e,e.flags&=~Ce.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=Ce.Mutable|Ce.Dirty,Mc(e))}});let ll=0,mh=0,Nn,gh=0;function _b(e){try{++gh,e()}finally{--gh||Sb()}}function Mc(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=tT(n,e)}function Sb(){if(!(gh>0)){for(;ll<mh;){const e=ph[ll];ph[ll++]=void 0,e.notify()}ll=0,mh=0}}function Qy(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?Ce.None:Ce.Mutable,get(){return Nn!==void 0&&Ky(s,Nn,Hl),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=Nn,a=(t==null?void 0:t.compare)??Object.is;if(n)Nn=s,++Hl,s.depsTail=void 0;else if(i===void 0)return!1;n&&(s.flags=Ce.Mutable|Ce.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{Nn=o,n&&(s.flags&=~Ce.RecursedCheck),Mc(s)}}};return n?(s.flags=Ce.Mutable|Ce.Dirty,s.get=function(){const i=s.flags;if(i&Ce.Dirty||i&Ce.Pending&&kb(s.deps,s)){if(s._update()){const o=s.subs;o!==void 0&&qy(o)}}else i&Ce.Pending&&(s.flags=i&~Ce.Pending);return Nn!==void 0&&Ky(s,Nn,Hl),s._snapshot}):s.set=function(i){if(s._update(i)){const o=s.subs;o!==void 0&&(nT(o),qy(o),Sb())}},s}function rT(e){const t=()=>{const r=Nn;Nn=n,++Hl,n.depsTail=void 0,n.flags=Ce.Watching|Ce.RecursedCheck;try{return e()}finally{Nn=r,n.flags&=~Ce.RecursedCheck,Mc(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Ce.Watching|Ce.RecursedCheck,notify(){const r=this.flags;r&Ce.Dirty||r&Ce.Pending&&kb(this.deps,this)?t():this.flags=Ce.Watching},stop(){this.flags=Ce.None,this.depsTail=void 0,Mc(this)}};return t(),n}var Cb={exports:{}},jb={},Pb={exports:{}},Eb={};/**
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 Mi=b;function sT(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var iT=typeof Object.is=="function"?Object.is:sT,oT=Mi.useState,aT=Mi.useEffect,lT=Mi.useLayoutEffect,cT=Mi.useDebugValue;function uT(e,t){var n=t(),r=oT({inst:{value:n,getSnapshot:t}}),s=r[0].inst,i=r[1];return lT(function(){s.value=n,s.getSnapshot=t,bd(s)&&i({inst:s})},[e,n,t]),aT(function(){return bd(s)&&i({inst:s}),e(function(){bd(s)&&i({inst:s})})},[e]),cT(n),n}function bd(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!iT(e,n)}catch{return!0}}function dT(e,t){return t()}var fT=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?dT:uT;Eb.useSyncExternalStore=Mi.useSyncExternalStore!==void 0?Mi.useSyncExternalStore:fT;Pb.exports=Eb;var hT=Pb.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 wu=b,pT=hT;function mT(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var gT=typeof Object.is=="function"?Object.is:mT,yT=pT.useSyncExternalStore,xT=wu.useRef,vT=wu.useEffect,wT=wu.useMemo,bT=wu.useDebugValue;jb.useSyncExternalStoreWithSelector=function(e,t,n,r,s){var i=xT(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=wT(function(){function l(h){if(!c){if(c=!0,u=h,h=r(h),s!==void 0&&o.hasValue){var m=o.value;if(s(m,h))return f=m}return f=h}if(m=f,gT(u,h))return m;var y=r(h);return s!==void 0&&s(m,y)?(u=h,m):(u=h,f=y)}var c=!1,u,f,p=n===void 0?null:n;return[function(){return l(t())},p===null?void 0:function(){return l(p())}]},[t,n,r,s]);var a=yT(e,i[0],i[1]);return vT(function(){o.hasValue=!0,o.value=a},[a]),bT(a),a};Cb.exports=jb;var Tb=Cb.exports;const kT=eu(Tb);function _T(e,t){return e===t}function St(e,t,n=_T){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 Tb.useSyncExternalStoreWithSelector(r,s,s,t,n)}var ST={get:()=>{},subscribe:()=>({unsubscribe:()=>{}})};function Fs(e){const t=Bt(),n=b.useContext(e.from?JE:vu),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 St(s??ST,o=>{if((e.shouldThrow??!0)&&!o&&Zn(),o===void 0)return;const a=e.select?e.select(o):o;if(e.structuralSharing??t.options.defaultStructuralSharing){const l=Pr(i.current,a);return i.current=l,l}return a})}function Nb(e){return Fs({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Rb(e){const{select:t,...n}=e;return Fs({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function Os(e){return Fs({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 am(e){return Fs({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Vt(e){const t=Bt();return b.useCallback(n=>t.navigate({...n,from:n.from??(e==null?void 0:e.from)}),[e==null?void 0:e.from,t])}function Ab(e){return Fs({...e,select:t=>e.select?e.select(t.context):t.context})}function CT(e,t){const n=Bt(),r=GP(t),{activeProps:s,inactiveProps:i,activeOptions:o,to:a,preload:l,preloadDelay:c,preloadIntentProximity:u,hashScrollIntoView:f,replace:p,startTransition:h,resetScroll:m,viewTransition:y,children:v,target:g,disabled:x,style:w,className:k,onClick:j,onBlur:_,onFocus:S,onMouseEnter:E,onMouseLeave:T,onTouchStart:P,ignoreBlocker:A,params:I,search:O,hash:M,state:N,mask:z,reloadDocument:V,unsafeRelative:L,from:B,_fromLocation:C,...$}=e,Q=wb(),R=b.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ce=St(n.stores.location,he=>he,(he,F)=>he.href===F.href),pe=b.useMemo(()=>{const he={_fromLocation:ce,...R};return n.buildLocation(he)},[n,ce,R]),fe=pe.maskedLocation?pe.maskedLocation.publicHref:pe.publicHref,Et=pe.maskedLocation?pe.maskedLocation.external:pe.external,Ge=b.useMemo(()=>RT(fe,Et,n.history,x),[x,Et,fe,n.history]),Wt=b.useMemo(()=>{if(Ge!=null&&Ge.external)return Nc(Ge.href,n.protocolAllowlist)?void 0:Ge.href;if(!AT(a)&&!(typeof a!="string"||a.indexOf(":")===-1))try{return new URL(a),Nc(a,n.protocolAllowlist)?void 0:a}catch{}},[a,Ge,n.protocolAllowlist]),bn=b.useMemo(()=>{if(Wt)return!1;if(o!=null&&o.exact){if(!dE(ce.pathname,pe.pathname,n.basepath))return!1}else{const he=Rc(ce.pathname,n.basepath),F=Rc(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)&&!_s(ce.search,pe.search,{partial:!(o!=null&&o.exact),ignoreUndefined:!(o!=null&&o.explicitUndefined)})?!1:o!=null&&o.includeHash?Q&&ce.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,ce,Wt,Q,pe.hash,pe.pathname,pe.search,n.basepath]),$n=bn?jr(s,{})??jT:kd,$s=bn?kd:jr(i,{})??kd,Fa=[k,$n.className,$s.className].filter(Boolean).join(" "),Oa=(w||$n.style||$s.style)&&{...w,...$n.style,...$s.style},[za,Yi]=b.useState(!1),Xi=b.useRef(!1),or=e.reloadDocument||Wt?!1:l??n.options.defaultPreload,Bs=c??n.options.defaultPreloadDelay??0,kn=b.useCallback(()=>{n.preloadRoute({...R,_builtLocation:pe}).catch(he=>{console.warn(he),console.warn(GE)})},[n,R,pe]);HP(r,b.useCallback(he=>{he!=null&&he.isIntersecting&&kn()},[kn]),NT,{disabled:!!x||or!=="viewport"}),b.useEffect(()=>{Xi.current||!x&&or==="render"&&(kn(),Xi.current=!0)},[x,kn,or]);const $u=he=>{const F=he.currentTarget.getAttribute("target"),H=g!==void 0?g:F;if(!x&&!IT(he)&&!he.defaultPrevented&&(!H||H==="_self")&&he.button===0){he.preventDefault(),Ds.flushSync(()=>{Yi(!0)});const ee=n.subscribe("onResolved",()=>{ee(),Yi(!1)});n.navigate({...R,replace:p,resetScroll:m,hashScrollIntoView:f,startTransition:h,viewTransition:y,ignoreBlocker:A})}};if(Wt)return{...$,ref:r,href:Wt,...v&&{children:v},...g&&{target:g},...x&&{disabled:x},...w&&{style:w},...k&&{className:k},...j&&{onClick:j},..._&&{onBlur:_},...S&&{onFocus:S},...E&&{onMouseEnter:E},...T&&{onMouseLeave:T},...P&&{onTouchStart:P}};const $a=he=>{if(x||or!=="intent")return;if(!Bs){kn();return}const F=he.currentTarget;if(fo.has(F))return;const H=setTimeout(()=>{fo.delete(F),kn()},Bs);fo.set(F,H)},Bu=he=>{x||or!=="intent"||kn()},Ba=he=>{if(x||!or||!Bs)return;const F=he.currentTarget,H=fo.get(F);H&&(clearTimeout(H),fo.delete(F))};return{...$,...$n,...$s,href:Ge==null?void 0:Ge.href,ref:r,onClick:Ws([j,$u]),onBlur:Ws([_,Ba]),onFocus:Ws([S,$a]),onMouseEnter:Ws([E,$a]),onMouseLeave:Ws([T,Ba]),onTouchStart:Ws([P,Bu]),disabled:!!x,target:g,...Oa&&{style:Oa},...Fa&&{className:Fa},...x&&PT,...bn&&ET,...Q&&za&&TT}}var kd={},jT={className:"active"},PT={role:"link","aria-disabled":!0},ET={"data-status":"active","aria-current":"page"},TT={"data-transitioning":"transitioning"},fo=new WeakMap,NT={rootMargin:"100px"},Ws=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function RT(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function AT(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Ib=b.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:s,...i}=CT(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 IT(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var MT=class extends vb{constructor(e){super(e),this.useMatch=t=>Fs({select:t==null?void 0:t.select,from:this.id,structuralSharing:t==null?void 0:t.structuralSharing}),this.useRouteContext=t=>Ab({...t,from:this.id}),this.useSearch=t=>am({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useParams=t=>Os({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useLoaderDeps=t=>Rb({...t,from:this.id}),this.useLoaderData=t=>Nb({...t,from:this.id}),this.useNavigate=()=>Vt({from:this.fullPath}),this.Link=Si.forwardRef((t,n)=>d.jsx(Ib,{ref:n,from:this.fullPath,...t}))}};function on(e){return new MT(e)}var LT=class extends KE{constructor(e){super(e),this.useMatch=t=>Fs({select:t==null?void 0:t.select,from:this.id,structuralSharing:t==null?void 0:t.structuralSharing}),this.useRouteContext=t=>Ab({...t,from:this.id}),this.useSearch=t=>am({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useParams=t=>Os({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useLoaderDeps=t=>Rb({...t,from:this.id}),this.useLoaderData=t=>Nb({...t,from:this.id}),this.useNavigate=()=>Vt({from:this.fullPath}),this.Link=Si.forwardRef((t,n)=>d.jsx(Ib,{ref:n,from:this.fullPath,...t}))}};function DT(e){return new LT(e)}function FT(e){const t=Bt(),n=`not-found-${St(t.stores.location,r=>r.pathname)}-${St(t.stores.status,r=>r)}`;return d.jsx(im,{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 OT(){return d.jsx("p",{children:"Not Found"})}function Ys(e){return d.jsx(d.Fragment,{children:e.children})}function Mb(e,t,n){return t.options.notFoundComponent?d.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?d.jsx(e.options.defaultNotFoundComponent,{...n}):d.jsx(OT,{})}function zT(e){return null}function $T(){return zT(Bt()),null}var Lb=b.memo(function({matchId:t}){const n=Bt(),r=n.stores.matchStores.get(t);r||Zn();const s=St(n.stores.loadedAt,o=>o),i=St(r,o=>o);return d.jsx(BT,{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 BT({router:e,matchId:t,resetKey:n,matchState:r}){var m,y;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??(((y=s.options.errorComponent)==null?void 0:y.preload)||u))?b.Suspense:Ys,p=a?im:Ys,h=c?FT:Ys;return d.jsxs(s.isRoot?s.options.shellComponent??Ys:Ys,{children:[d.jsx(vu.Provider,{value:t,children:d.jsx(f,{fallback:o,children:d.jsx(p,{getResetKey:()=>n,errorComponent:a||om,onCatch:(v,g)=>{if(st(v))throw v.routeId??(v.routeId=r.routeId),v;l==null||l(v,g)},children:d.jsx(h,{fallback:v=>{if(v.routeId??(v.routeId=r.routeId),!c||v.routeId&&v.routeId!==r.routeId||!v.routeId&&!s.isRoot)throw v;return b.createElement(c,v)},children:u||r._displayPending?d.jsx(YE,{fallback:o,children:d.jsx(Yy,{matchId:t})}):d.jsx(Yy,{matchId:t})})})})}),r.parentRouteId===Ss?d.jsxs(d.Fragment,{children:[d.jsx(VT,{resetKey:n}),e.options.scrollRestoration&&cb?d.jsx($T,{}):null]}):null]})}function VT({resetKey:e}){const t=Bt(),n=b.useRef(void 0);return Po(()=>{const r=t.latestLocation.href;(n.current===void 0||n.current!==r)&&(t.emit({type:"onRendered",...bi(t.stores.location.get(),t.stores.resolvedLocation.get())}),n.current=r)},[t.latestLocation.state.__TSR_key,e,t]),null}var Yy=b.memo(function({matchId:t}){const n=Bt(),r=(u,f)=>{var p;return((p=n.getMatch(u.id))==null?void 0:p._nonReactive[f])??u._nonReactive[f]},s=n.stores.matchStores.get(t);s||Zn();const i=St(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(Db,{})},[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 p=Ii();f._nonReactive.minPendingPromise=p,setTimeout(()=>{p.resolve(),f._nonReactive.minPendingPromise=void 0},u)}}throw r(i,"loadPromise")}if(i.status==="notFound")return st(i.error)||Zn(),Mb(n,a,i.error);if(i.status==="redirected")throw vt(i.error)||Zn(),r(i,"loadPromise");if(i.status==="error")throw i.error;return c}),Db=b.memo(function(){const t=Bt(),n=b.useContext(vu);let r,s=!1,i;{const c=n?t.stores.matchStores.get(n):void 0;[r,s]=St(c,u=>[u==null?void 0:u.routeId,(u==null?void 0:u.globalNotFound)??!1]),i=St(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||Zn(),Mb(t,o,void 0);if(!i)return null;const l=d.jsx(Lb,{matchId:i});return r===Ss?d.jsx(b.Suspense,{fallback:a,children:l}):l});function UT(){const e=Bt(),t=b.useRef({router:e,mounted:!1}),[n,r]=b.useState(!1),s=St(e.stores.isLoading,f=>f),i=St(e.stores.hasPending,f=>f),o=pd(s),a=s||n||i,l=pd(a),c=s||i,u=pd(c);return e.startTransition=f=>{r(!0),b.startTransition(()=>{f(),r(!1)})},b.useEffect(()=>{const f=e.history.subscribe(e.load),p=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return zr(e.latestLocation.publicHref)!==zr(p.publicHref)&&e.commitLocation({...p,replace:!0}),()=>{f()}},[e,e.history]),Po(()=>{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(p){console.error(p)}})()},[e]),Po(()=>{o&&!s&&e.emit({type:"onLoad",...bi(e.stores.location.get(),e.stores.resolvedLocation.get())})},[o,e,s]),Po(()=>{u&&!c&&e.emit({type:"onBeforeRouteMount",...bi(e.stores.location.get(),e.stores.resolvedLocation.get())})},[c,u,e]),Po(()=>{if(l&&!a){const f=bi(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:"onResolved",...f}),_b(()=>{e.stores.status.set("idle"),e.stores.resolvedLocation.set(e.stores.location.get())}),f.hrefChanged&&qE(e)}},[a,l,e]),null}function WT(){const e=Bt(),t=e.routesById[Ss].options.pendingComponent??e.options.defaultPendingComponent,n=t?d.jsx(t,{}):null,r=d.jsxs(typeof document<"u"&&e.ssr?Ys:b.Suspense,{fallback:n,children:[d.jsx(UT,{}),d.jsx(HT,{})]});return e.options.InnerWrap?d.jsx(e.options.InnerWrap,{children:r}):r}function HT(){const e=Bt(),t=St(e.stores.firstId,s=>s),n=St(e.stores.loadedAt,s=>s),r=t?d.jsx(Lb,{matchId:t}):null;return d.jsx(vu.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:d.jsx(im,{getResetKey:()=>n,errorComponent:om,onCatch:void 0,children:r})})}var GT=e=>({createMutableStore:Qy,createReadonlyStore:Qy,batch:_b}),KT=e=>new qT(e),qT=class extends zE{constructor(e){super(e,GT)}};function QT({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(bb.Provider,{value:e,children:t});return e.options.Wrap?d.jsx(e.options.Wrap,{children:r}):r}function YT({router:e,...t}){return d.jsx(QT,{router:e,...t,children:d.jsx(WT,{})})}function XT(e){const t=Bt({warn:(e==null?void 0:e.router)===void 0}),n=(e==null?void 0:e.router)||t,r=b.useRef(void 0);return St(n.stores.__store,s=>{if(e!=null&&e.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const i=Pr(r.current,e.select(s));return r.current=i,i}return e.select(s)}return s})}const JT="modulepreload",ZT=function(e,t){return new URL(e,t).href},Xy={},wn=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=ZT(c,r),c in Xy)return;Xy[c]=!0;const u=c.endsWith(".css"),f=u?'[rel="stylesheet"]':"";if(!!r)for(let m=o.length-1;m>=0;m--){const y=o[m];if(y.href===c&&(!u||y.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${c}"]${f}`))return;const h=document.createElement("link");if(h.rel=u?"stylesheet":JT,u||(h.as="script"),h.crossOrigin="",h.href=c,l&&h.setAttribute("nonce",l),document.head.appendChild(h),u)return new Promise((m,y)=>{h.addEventListener("load",m),h.addEventListener("error",()=>y(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 e2(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const t2=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,n2=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,r2={};function Jy(e,t){return(r2.jsx?n2:t2).test(e)}const s2=/[ \t\n\f\r]/g;function i2(e){return typeof e=="object"?e.type==="text"?Zy(e.value):!1:Zy(e)}function Zy(e){return e.replace(s2,"")===""}class Pa{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Pa.prototype.normal={};Pa.prototype.property={};Pa.prototype.space=void 0;function Fb(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new Pa(n,r,t)}function yh(e){return e.toLowerCase()}class Pt{constructor(t,n){this.attribute=n,this.property=t}}Pt.prototype.attribute="";Pt.prototype.booleanish=!1;Pt.prototype.boolean=!1;Pt.prototype.commaOrSpaceSeparated=!1;Pt.prototype.commaSeparated=!1;Pt.prototype.defined=!1;Pt.prototype.mustUseProperty=!1;Pt.prototype.number=!1;Pt.prototype.overloadedBoolean=!1;Pt.prototype.property="";Pt.prototype.spaceSeparated=!1;Pt.prototype.space=void 0;let o2=0;const te=zs(),Fe=zs(),xh=zs(),W=zs(),ge=zs(),js=zs(),At=zs();function zs(){return 2**++o2}const vh=Object.freeze(Object.defineProperty({__proto__:null,boolean:te,booleanish:Fe,commaOrSpaceSeparated:At,commaSeparated:js,number:W,overloadedBoolean:xh,spaceSeparated:ge},Symbol.toStringTag,{value:"Module"})),_d=Object.keys(vh);class lm extends Pt{constructor(t,n,r,s){let i=-1;if(super(t,n),ex(this,"space",s),typeof r=="number")for(;++i<_d.length;){const o=_d[i];ex(this,_d[i],(r&vh[o])===vh[o])}}}lm.prototype.defined=!0;function ex(e,t,n){n&&(e[t]=n)}function Bi(e){const t={},n={};for(const[r,s]of Object.entries(e.properties)){const i=new lm(r,e.transform(e.attributes||{},r),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[yh(r)]=r,n[yh(i.attribute)]=r}return new Pa(t,n,e.space)}const Ob=Bi({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 zb(e,t){return t in e?e[t]:t}function $b(e,t){return zb(e,t.toLowerCase())}const a2=Bi({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:js,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|js,crossOrigin:null,data:null,dateTime:null,decoding:null,default:te,defer:te,dir:null,dirName:null,disabled:te,download:xh,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:xh,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:js,part:ge,prefix:null,property:null,results:W,security:null,unselectable:null},space:"html",transform:$b}),l2=Bi({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:At,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:js,g2:js,glyphName:js,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:At,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:At,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:At,rev:At,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:At,requiredFeatures:At,requiredFonts:At,requiredFormats:At,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:At,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:At,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:At,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:zb}),Bb=Bi({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()}}),Vb=Bi({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:$b}),Ub=Bi({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),c2={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"},u2=/[A-Z]/g,tx=/-[a-z]/g,d2=/^data[-\w.:]+$/i;function f2(e,t){const n=yh(t);let r=t,s=Pt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&d2.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(tx,p2);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!tx.test(i)){let o=i.replace(u2,h2);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}s=lm}return new s(r,t)}function h2(e){return"-"+e.toLowerCase()}function p2(e){return e.charAt(1).toUpperCase()}const m2=Fb([Ob,a2,Bb,Vb,Ub],"html"),cm=Fb([Ob,l2,Bb,Vb,Ub],"svg");function g2(e){return e.join(" ").trim()}var um={},nx=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,y2=/\n/g,x2=/^\s*/,v2=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,w2=/^:\s*/,b2=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,k2=/^[;\s]*/,_2=/^\s+|\s+$/g,S2=`
58
- `,rx="/",sx="*",ps="",C2="comment",j2="declaration";function P2(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 y=m.match(y2);y&&(n+=y.length);var v=m.lastIndexOf(S2);r=~v?m.length-v:r+m.length}function i(){var m={line:n,column:r};return function(y){return y.position=new o(m),c(),y}}function o(m){this.start=m,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function a(m){var y=new Error(t.source+":"+n+":"+r+": "+m);if(y.reason=m,y.filename=t.source,y.line=n,y.column=r,y.source=e,!t.silent)throw y}function l(m){var y=m.exec(e);if(y){var v=y[0];return s(v),e=e.slice(v.length),y}}function c(){l(x2)}function u(m){var y;for(m=m||[];y=f();)y!==!1&&m.push(y);return m}function f(){var m=i();if(!(rx!=e.charAt(0)||sx!=e.charAt(1))){for(var y=2;ps!=e.charAt(y)&&(sx!=e.charAt(y)||rx!=e.charAt(y+1));)++y;if(y+=2,ps===e.charAt(y-1))return a("End of comment missing");var v=e.slice(2,y-2);return r+=2,s(v),e=e.slice(y),r+=2,m({type:C2,comment:v})}}function p(){var m=i(),y=l(v2);if(y){if(f(),!l(w2))return a("property missing ':'");var v=l(b2),g=m({type:j2,property:ix(y[0].replace(nx,ps)),value:v?ix(v[0].replace(nx,ps)):ps});return l(k2),g}}function h(){var m=[];u(m);for(var y;y=p();)y!==!1&&(m.push(y),u(m));return m}return c(),h()}function ix(e){return e?e.replace(_2,ps):ps}var E2=P2,T2=ic&&ic.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(um,"__esModule",{value:!0});um.default=R2;const N2=T2(E2);function R2(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,N2.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 bu={};Object.defineProperty(bu,"__esModule",{value:!0});bu.camelCase=void 0;var A2=/^--[a-zA-Z0-9_-]+$/,I2=/-([a-z])/g,M2=/^[^-]+$/,L2=/^-(webkit|moz|ms|o|khtml)-/,D2=/^-(ms)-/,F2=function(e){return!e||M2.test(e)||A2.test(e)},O2=function(e,t){return t.toUpperCase()},ox=function(e,t){return"".concat(t,"-")},z2=function(e,t){return t===void 0&&(t={}),F2(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(D2,ox):e=e.replace(L2,ox),e.replace(I2,O2))};bu.camelCase=z2;var $2=ic&&ic.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},B2=$2(um),V2=bu;function wh(e,t){var n={};return!e||typeof e!="string"||(0,B2.default)(e,function(r,s){r&&s&&(n[(0,V2.camelCase)(r,t)]=s)}),n}wh.default=wh;var U2=wh;const W2=eu(U2),Wb=Hb("end"),dm=Hb("start");function Hb(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 H2(e){const t=dm(e),n=Wb(e);if(t&&n)return{start:t,end:n}}function zo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?ax(e.position):"start"in e||"end"in e?ax(e):"line"in e||"column"in e?bh(e):""}function bh(e){return lx(e&&e.line)+":"+lx(e&&e.column)}function ax(e){return bh(e&&e.start)+"-"+bh(e&&e.end)}function lx(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=zo(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 fm={}.hasOwnProperty,G2=new Map,K2=/[A-Z]/g,q2=new Set(["table","tbody","thead","tfoot","tr"]),Q2=new Set(["td","th"]),Gb="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Y2(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=sN(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=rN(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"?cm:m2,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=Kb(s,e,void 0);return i&&typeof i!="string"?i:s.create(e,s.Fragment,{children:i||void 0},void 0)}function Kb(e,t,n){if(t.type==="element")return X2(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return J2(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return eN(e,t,n);if(t.type==="mdxjsEsm")return Z2(e,t);if(t.type==="root")return tN(e,t,n);if(t.type==="text")return nN(e,t)}function X2(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=cm,e.schema=s),e.ancestors.push(t);const i=Qb(e,t.tagName,!1),o=iN(e,t);let a=pm(e,t);return q2.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!i2(l):!0})),qb(e,o,i,t),hm(o,a),e.ancestors.pop(),e.schema=r,e.create(t,i,o,n)}function J2(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)}ga(e,t.position)}function Z2(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ga(e,t.position)}function eN(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=cm,e.schema=s),e.ancestors.push(t);const i=t.name===null?e.Fragment:Qb(e,t.name,!0),o=oN(e,t),a=pm(e,t);return qb(e,o,i,t),hm(o,a),e.ancestors.pop(),e.schema=r,e.create(t,i,o,n)}function tN(e,t,n){const r={};return hm(r,pm(e,t)),e.create(t,e.Fragment,r,n)}function nN(e,t){return t.value}function qb(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function hm(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function rN(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 sN(e,t){return n;function n(r,s,i,o){const a=Array.isArray(i.children),l=dm(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 iN(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&fm.call(t.properties,s)){const i=aN(e,s,t.properties[s]);if(i){const[o,a]=i;e.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&Q2.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 oN(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 ga(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 ga(e,t.position);else i=r.value===null?!0:r.value;n[s]=i}return n}function pm(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:G2;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=Kb(e,i,o);a!==void 0&&n.push(a)}return n}function aN(e,t,n){const r=f2(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?e2(n):g2(n)),r.property==="style"){let s=typeof n=="object"?n:lN(e,String(n));return e.stylePropertyNameCase==="css"&&(s=cN(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&r.space?c2[r.property]||r.property:r.attribute,n]}}function lN(e,t){try{return W2(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=Gb+"#cannot-parse-style-attribute",s}}function Qb(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=Jy(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=Jy(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const s=r.value;return fm.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(r);ga(e)}function ga(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=Gb+"#cannot-handle-mdx-estrees-without-createevaluater",n}function cN(e){const t={};let n;for(n in e)fm.call(e,n)&&(t[uN(n)]=e[n]);return t}function uN(e){let t=e.replace(K2,dN);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function dN(e){return"-"+e.toLowerCase()}const Sd={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},fN={};function hN(e,t){const n=fN,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Yb(e,r,s)}function Yb(e,t,n){if(pN(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 cx(e.children,t,n)}return Array.isArray(e)?cx(e,t,n):""}function cx(e,t,n){const r=[];let s=-1;for(;++s<e.length;)r[s]=Yb(e[s],t,n);return r.join("")}function pN(e){return!!(e&&typeof e=="object")}const ux=document.createElement("i");function mm(e){const t="&"+e+";";ux.innerHTML=t;const n=ux.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Fn(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?(Fn(e,e.length,0,t),e):t}const dx={}.hasOwnProperty;function mN(e){const t={};let n=-1;for(;++n<e.length;)gN(t,e[n]);return t}function gN(e,t){let n;for(n in t){const s=(dx.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let o;if(i)for(o in i){dx.call(s,o)||(s[o]=[]);const a=i[o];yN(s[o],Array.isArray(a)?a:a?[a]:[])}}}function yN(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Fn(e,0,0,r)}function Xb(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 ki(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const In=Yr(/[A-Za-z]/),Lt=Yr(/[\dA-Za-z]/),xN=Yr(/[#-'*+\--9=?A-Z^-~]/);function kh(e){return e!==null&&(e<32||e===127)}const _h=Yr(/\d/),vN=Yr(/[\dA-Fa-f]/),wN=Yr(/[!-/:-@[-`{-~]/);function Z(e){return e!==null&&e<-2}function _t(e){return e!==null&&(e<0||e===32)}function le(e){return e===-2||e===-1||e===32}const bN=Yr(new RegExp("\\p{P}|\\p{S}","u")),kN=Yr(/\s/);function Yr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Vi(e){const t=[];let n=-1,r=0,s=0;for(;++n<e.length;){const i=e.charCodeAt(n);let o="";if(i===37&&Lt(e.charCodeAt(n+1))&&Lt(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 be(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return o;function o(l){return le(l)?(e.enter(n),a(l)):t(l)}function a(l){return le(l)&&i++<s?(e.consume(l),a):(e.exit(n),t(l))}}const _N={tokenize:SN};function SN(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"),be(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 CN={tokenize:jN},fx={tokenize:PN};function jN(e){const t=this,n=[];let r=0,s,i,o;return a;function a(w){if(r<n.length){const k=n[r];return t.containerState=k[1],e.attempt(k[0].continuation,l,c)(w)}return c(w)}function l(w){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&x();const k=t.events.length;let j=k,_;for(;j--;)if(t.events[j][0]==="exit"&&t.events[j][1].type==="chunkFlow"){_=t.events[j][1].end;break}g(r);let S=k;for(;S<t.events.length;)t.events[S][1].end={..._},S++;return Fn(t.events,j+1,0,t.events.slice(k)),t.events.length=S,c(w)}return a(w)}function c(w){if(r===n.length){if(!s)return p(w);if(s.currentConstruct&&s.currentConstruct.concrete)return m(w);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(fx,u,f)(w)}function u(w){return s&&x(),g(r),p(w)}function f(w){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(w)}function p(w){return t.containerState={},e.attempt(fx,h,m)(w)}function h(w){return r++,n.push([t.currentConstruct,t.containerState]),p(w)}function m(w){if(w===null){s&&x(),g(0),e.consume(w);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:i}),y(w)}function y(w){if(w===null){v(e.exit("chunkFlow"),!0),g(0),e.consume(w);return}return Z(w)?(e.consume(w),v(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(w),y)}function v(w,k){const j=t.sliceStream(w);if(k&&j.push(null),w.previous=i,i&&(i.next=w),i=w,s.defineSkip(w.start),s.write(j),t.parser.lazy[w.start.line]){let _=s.events.length;for(;_--;)if(s.events[_][1].start.offset<o&&(!s.events[_][1].end||s.events[_][1].end.offset>o))return;const S=t.events.length;let E=S,T,P;for(;E--;)if(t.events[E][0]==="exit"&&t.events[E][1].type==="chunkFlow"){if(T){P=t.events[E][1].end;break}T=!0}for(g(r),_=S;_<t.events.length;)t.events[_][1].end={...P},_++;Fn(t.events,E+1,0,t.events.slice(S)),t.events.length=_}}function g(w){let k=n.length;for(;k-- >w;){const j=n[k];t.containerState=j[1],j[0].exit.call(t,e)}n.length=w}function x(){s.write([null]),i=void 0,s=void 0,t.containerState._closeFlow=void 0}}function PN(e,t,n){return be(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function hx(e){if(e===null||_t(e)||kN(e))return 1;if(bN(e))return 2}function gm(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 Sh={name:"attention",resolveAll:EN,tokenize:TN};function EN(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},p={...e[n][1].start};px(f,-l),px(p,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:p},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,gm(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,Fn(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 TN(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=hx(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=hx(l),f=!u||u===2&&s||n.includes(l),p=!s||s===2&&u||n.includes(r);return c._open=!!(i===42?f:f&&(s||!p)),c._close=!!(i===42?p:p&&(u||!f)),t(l)}}function px(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const NN={name:"autolink",tokenize:RN};function RN(e,t,n){let r=0;return s;function s(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(h){return In(h)?(e.consume(h),o):h===64?n(h):c(h)}function o(h){return h===43||h===45||h===46||Lt(h)?(r=1,a(h)):c(h)}function a(h){return h===58?(e.consume(h),r=0,l):(h===43||h===45||h===46||Lt(h))&&r++<32?(e.consume(h),a):(r=0,c(h))}function l(h){return h===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):h===null||h===32||h===60||kh(h)?n(h):(e.consume(h),l)}function c(h){return h===64?(e.consume(h),u):xN(h)?(e.consume(h),c):n(h)}function u(h){return Lt(h)?f(h):n(h)}function f(h){return h===46?(e.consume(h),r=0,u):h===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):p(h)}function p(h){if((h===45||Lt(h))&&r++<63){const m=h===45?p:f;return e.consume(h),m}return n(h)}}const ku={partial:!0,tokenize:AN};function AN(e,t,n){return r;function r(i){return le(i)?be(e,s,"linePrefix")(i):s(i)}function s(i){return i===null||Z(i)?t(i):n(i)}}const Jb={continuation:{tokenize:MN},exit:LN,name:"blockQuote",tokenize:IN};function IN(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 le(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function MN(e,t,n){const r=this;return s;function s(o){return le(o)?be(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):i(o)}function i(o){return e.attempt(Jb,t,n)(o)}}function LN(e){e.exit("blockQuote")}const Zb={name:"characterEscape",tokenize:DN};function DN(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 wN(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const ek={name:"characterReference",tokenize:FN};function FN(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=Lt,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=vN,u):(e.enter("characterReferenceValue"),i=7,o=_h,u(f))}function u(f){if(f===59&&s){const p=e.exit("characterReferenceValue");return o===Lt&&!mm(r.sliceSerialize(p))?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 mx={partial:!0,tokenize:zN},gx={concrete:!0,name:"codeFenced",tokenize:ON};function ON(e,t,n){const r=this,s={partial:!0,tokenize:j};let i=0,o=0,a;return l;function l(_){return c(_)}function c(_){const S=r.events[r.events.length-1];return i=S&&S[1].type==="linePrefix"?S[2].sliceSerialize(S[1],!0).length:0,a=_,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(_)}function u(_){return _===a?(o++,e.consume(_),u):o<3?n(_):(e.exit("codeFencedFenceSequence"),le(_)?be(e,f,"whitespace")(_):f(_))}function f(_){return _===null||Z(_)?(e.exit("codeFencedFence"),r.interrupt?t(_):e.check(mx,y,k)(_)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(_))}function p(_){return _===null||Z(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(_)):le(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),be(e,h,"whitespace")(_)):_===96&&_===a?n(_):(e.consume(_),p)}function h(_){return _===null||Z(_)?f(_):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(_))}function m(_){return _===null||Z(_)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(_)):_===96&&_===a?n(_):(e.consume(_),m)}function y(_){return e.attempt(s,k,v)(_)}function v(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),g}function g(_){return i>0&&le(_)?be(e,x,"linePrefix",i+1)(_):x(_)}function x(_){return _===null||Z(_)?e.check(mx,y,k)(_):(e.enter("codeFlowValue"),w(_))}function w(_){return _===null||Z(_)?(e.exit("codeFlowValue"),x(_)):(e.consume(_),w)}function k(_){return e.exit("codeFenced"),t(_)}function j(_,S,E){let T=0;return P;function P(N){return _.enter("lineEnding"),_.consume(N),_.exit("lineEnding"),A}function A(N){return _.enter("codeFencedFence"),le(N)?be(_,I,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):I(N)}function I(N){return N===a?(_.enter("codeFencedFenceSequence"),O(N)):E(N)}function O(N){return N===a?(T++,_.consume(N),O):T>=o?(_.exit("codeFencedFenceSequence"),le(N)?be(_,M,"whitespace")(N):M(N)):E(N)}function M(N){return N===null||Z(N)?(_.exit("codeFencedFence"),S(N)):E(N)}}}function zN(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 Cd={name:"codeIndented",tokenize:BN},$N={partial:!0,tokenize:VN};function BN(e,t,n){const r=this;return s;function s(c){return e.enter("codeIndented"),be(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($N,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 VN(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):be(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 UN={name:"codeText",previous:HN,resolve:WN,tokenize:GN};function WN(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 HN(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function GN(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 KN{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&&ho(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),ho(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),ho(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);ho(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);ho(this.left,n.reverse())}}}function ho(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 tk(e){const t={};let n=-1,r,s,i,o,a,l,c;const u=new KN(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,qN(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 Fn(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function qN(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,p=-1,h=n,m=0,y=0;const v=[y];for(;h;){for(;e.get(++s)[1]!==h;);i.push(s),h._tokenizer||(u=r.sliceStream(h),h.next||u.push(null),f&&o.defineSkip(h.start),h._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),h._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),f=h,h=h.next}for(h=n;++p<a.length;)a[p][0]==="exit"&&a[p-1][0]==="enter"&&a[p][1].type===a[p-1][1].type&&a[p][1].start.line!==a[p][1].end.line&&(y=p+1,v.push(y),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(o.events=[],h?(h._tokenizer=void 0,h.previous=void 0):v.pop(),p=v.length;p--;){const g=a.slice(v[p],v[p+1]),x=i.pop();l.push([x,x+g.length-1]),e.splice(x,2,g)}for(l.reverse(),p=-1;++p<l.length;)c[m+l[p][0]]=m+l[p][1],m+=l[p][1]-l[p][0]-1;return c}const QN={resolve:XN,tokenize:JN},YN={partial:!0,tokenize:ZN};function XN(e){return tk(e),e}function JN(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(YN,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 ZN(e,t,n){const r=this;return s;function s(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),be(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 nk(e,t,n,r,s,i,o,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return f;function f(g){return g===60?(e.enter(r),e.enter(s),e.enter(i),e.consume(g),e.exit(i),p):g===null||g===32||g===41||kh(g)?n(g):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),y(g))}function p(g){return g===62?(e.enter(i),e.consume(g),e.exit(i),e.exit(s),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),h(g))}function h(g){return g===62?(e.exit("chunkString"),e.exit(a),p(g)):g===null||g===60||Z(g)?n(g):(e.consume(g),g===92?m:h)}function m(g){return g===60||g===62||g===92?(e.consume(g),h):h(g)}function y(g){return!u&&(g===null||g===41||_t(g))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),t(g)):u<c&&g===40?(e.consume(g),u++,y):g===41?(e.consume(g),u--,y):g===null||g===32||g===40||kh(g)?n(g):(e.consume(g),g===92?v:y)}function v(g){return g===40||g===41||g===92?(e.consume(g),y):y(g)}}function rk(e,t,n,r,s,i){const o=this;let a=0,l;return c;function c(h){return e.enter(r),e.enter(s),e.consume(h),e.exit(s),e.enter(i),u}function u(h){return a>999||h===null||h===91||h===93&&!l||h===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?n(h):h===93?(e.exit(i),e.enter(s),e.consume(h),e.exit(s),e.exit(r),t):Z(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===null||h===91||h===93||Z(h)||a++>999?(e.exit("chunkString"),u(h)):(e.consume(h),l||(l=!le(h)),h===92?p:f)}function p(h){return h===91||h===92||h===93?(e.consume(h),a++,f):f(h)}}function sk(e,t,n,r,s,i){let o;return a;function a(p){return p===34||p===39||p===40?(e.enter(r),e.enter(s),e.consume(p),e.exit(s),o=p===40?41:p,l):n(p)}function l(p){return p===o?(e.enter(s),e.consume(p),e.exit(s),e.exit(r),t):(e.enter(i),c(p))}function c(p){return p===o?(e.exit(i),l(o)):p===null?n(p):Z(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),be(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(p))}function u(p){return p===o||p===null||Z(p)?(e.exit("chunkString"),c(p)):(e.consume(p),p===92?f:u)}function f(p){return p===o||p===92?(e.consume(p),u):u(p)}}function $o(e,t){let n;return r;function r(s){return Z(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):le(s)?be(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const eR={name:"definition",tokenize:nR},tR={partial:!0,tokenize:rR};function nR(e,t,n){const r=this;let s;return i;function i(h){return e.enter("definition"),o(h)}function o(h){return rk.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return s=ki(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),l):n(h)}function l(h){return _t(h)?$o(e,c)(h):c(h)}function c(h){return nk(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function u(h){return e.attempt(tR,f,f)(h)}function f(h){return le(h)?be(e,p,"whitespace")(h):p(h)}function p(h){return h===null||Z(h)?(e.exit("definition"),r.parser.defined.push(s),t(h)):n(h)}}function rR(e,t,n){return r;function r(a){return _t(a)?$o(e,s)(a):n(a)}function s(a){return sk(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function i(a){return le(a)?be(e,o,"whitespace")(a):o(a)}function o(a){return a===null||Z(a)?t(a):n(a)}}const sR={name:"hardBreakEscape",tokenize:iR};function iR(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 oR={name:"headingAtx",resolve:aR,tokenize:lR};function aR(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"},Fn(e,r,n-r+1,[["enter",s,t],["enter",i,t],["exit",i,t],["exit",s,t]])),e}function lR(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||_t(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)):le(u)?be(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||_t(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const cR=["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"],yx=["pre","script","style","textarea"],uR={concrete:!0,name:"htmlFlow",resolveTo:hR,tokenize:pR},dR={partial:!0,tokenize:gR},fR={partial:!0,tokenize:mR};function hR(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 pR(e,t,n){const r=this;let s,i,o,a,l;return c;function c(R){return u(R)}function u(R){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(R),f}function f(R){return R===33?(e.consume(R),p):R===47?(e.consume(R),i=!0,y):R===63?(e.consume(R),s=3,r.interrupt?t:C):In(R)?(e.consume(R),o=String.fromCharCode(R),v):n(R)}function p(R){return R===45?(e.consume(R),s=2,h):R===91?(e.consume(R),s=5,a=0,m):In(R)?(e.consume(R),s=4,r.interrupt?t:C):n(R)}function h(R){return R===45?(e.consume(R),r.interrupt?t:C):n(R)}function m(R){const ce="CDATA[";return R===ce.charCodeAt(a++)?(e.consume(R),a===ce.length?r.interrupt?t:I:m):n(R)}function y(R){return In(R)?(e.consume(R),o=String.fromCharCode(R),v):n(R)}function v(R){if(R===null||R===47||R===62||_t(R)){const ce=R===47,pe=o.toLowerCase();return!ce&&!i&&yx.includes(pe)?(s=1,r.interrupt?t(R):I(R)):cR.includes(o.toLowerCase())?(s=6,ce?(e.consume(R),g):r.interrupt?t(R):I(R)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(R):i?x(R):w(R))}return R===45||Lt(R)?(e.consume(R),o+=String.fromCharCode(R),v):n(R)}function g(R){return R===62?(e.consume(R),r.interrupt?t:I):n(R)}function x(R){return le(R)?(e.consume(R),x):P(R)}function w(R){return R===47?(e.consume(R),P):R===58||R===95||In(R)?(e.consume(R),k):le(R)?(e.consume(R),w):P(R)}function k(R){return R===45||R===46||R===58||R===95||Lt(R)?(e.consume(R),k):j(R)}function j(R){return R===61?(e.consume(R),_):le(R)?(e.consume(R),j):w(R)}function _(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(e.consume(R),l=R,S):le(R)?(e.consume(R),_):E(R)}function S(R){return R===l?(e.consume(R),l=null,T):R===null||Z(R)?n(R):(e.consume(R),S)}function E(R){return R===null||R===34||R===39||R===47||R===60||R===61||R===62||R===96||_t(R)?j(R):(e.consume(R),E)}function T(R){return R===47||R===62||le(R)?w(R):n(R)}function P(R){return R===62?(e.consume(R),A):n(R)}function A(R){return R===null||Z(R)?I(R):le(R)?(e.consume(R),A):n(R)}function I(R){return R===45&&s===2?(e.consume(R),z):R===60&&s===1?(e.consume(R),V):R===62&&s===4?(e.consume(R),$):R===63&&s===3?(e.consume(R),C):R===93&&s===5?(e.consume(R),B):Z(R)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(dR,Q,O)(R)):R===null||Z(R)?(e.exit("htmlFlowData"),O(R)):(e.consume(R),I)}function O(R){return e.check(fR,M,Q)(R)}function M(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),N}function N(R){return R===null||Z(R)?O(R):(e.enter("htmlFlowData"),I(R))}function z(R){return R===45?(e.consume(R),C):I(R)}function V(R){return R===47?(e.consume(R),o="",L):I(R)}function L(R){if(R===62){const ce=o.toLowerCase();return yx.includes(ce)?(e.consume(R),$):I(R)}return In(R)&&o.length<8?(e.consume(R),o+=String.fromCharCode(R),L):I(R)}function B(R){return R===93?(e.consume(R),C):I(R)}function C(R){return R===62?(e.consume(R),$):R===45&&s===2?(e.consume(R),C):I(R)}function $(R){return R===null||Z(R)?(e.exit("htmlFlowData"),Q(R)):(e.consume(R),$)}function Q(R){return e.exit("htmlFlow"),t(R)}}function mR(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 gR(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(ku,t,n)}}const yR={name:"htmlText",tokenize:xR};function xR(e,t,n){const r=this;let s,i,o;return a;function a(C){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(C),l}function l(C){return C===33?(e.consume(C),c):C===47?(e.consume(C),j):C===63?(e.consume(C),w):In(C)?(e.consume(C),E):n(C)}function c(C){return C===45?(e.consume(C),u):C===91?(e.consume(C),i=0,m):In(C)?(e.consume(C),x):n(C)}function u(C){return C===45?(e.consume(C),h):n(C)}function f(C){return C===null?n(C):C===45?(e.consume(C),p):Z(C)?(o=f,V(C)):(e.consume(C),f)}function p(C){return C===45?(e.consume(C),h):f(C)}function h(C){return C===62?z(C):C===45?p(C):f(C)}function m(C){const $="CDATA[";return C===$.charCodeAt(i++)?(e.consume(C),i===$.length?y:m):n(C)}function y(C){return C===null?n(C):C===93?(e.consume(C),v):Z(C)?(o=y,V(C)):(e.consume(C),y)}function v(C){return C===93?(e.consume(C),g):y(C)}function g(C){return C===62?z(C):C===93?(e.consume(C),g):y(C)}function x(C){return C===null||C===62?z(C):Z(C)?(o=x,V(C)):(e.consume(C),x)}function w(C){return C===null?n(C):C===63?(e.consume(C),k):Z(C)?(o=w,V(C)):(e.consume(C),w)}function k(C){return C===62?z(C):w(C)}function j(C){return In(C)?(e.consume(C),_):n(C)}function _(C){return C===45||Lt(C)?(e.consume(C),_):S(C)}function S(C){return Z(C)?(o=S,V(C)):le(C)?(e.consume(C),S):z(C)}function E(C){return C===45||Lt(C)?(e.consume(C),E):C===47||C===62||_t(C)?T(C):n(C)}function T(C){return C===47?(e.consume(C),z):C===58||C===95||In(C)?(e.consume(C),P):Z(C)?(o=T,V(C)):le(C)?(e.consume(C),T):z(C)}function P(C){return C===45||C===46||C===58||C===95||Lt(C)?(e.consume(C),P):A(C)}function A(C){return C===61?(e.consume(C),I):Z(C)?(o=A,V(C)):le(C)?(e.consume(C),A):T(C)}function I(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(e.consume(C),s=C,O):Z(C)?(o=I,V(C)):le(C)?(e.consume(C),I):(e.consume(C),M)}function O(C){return C===s?(e.consume(C),s=void 0,N):C===null?n(C):Z(C)?(o=O,V(C)):(e.consume(C),O)}function M(C){return C===null||C===34||C===39||C===60||C===61||C===96?n(C):C===47||C===62||_t(C)?T(C):(e.consume(C),M)}function N(C){return C===47||C===62||_t(C)?T(C):n(C)}function z(C){return C===62?(e.consume(C),e.exit("htmlTextData"),e.exit("htmlText"),t):n(C)}function V(C){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),L}function L(C){return le(C)?be(e,B,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):B(C)}function B(C){return e.enter("htmlTextData"),o(C)}}const ym={name:"labelEnd",resolveAll:kR,resolveTo:_R,tokenize:SR},vR={tokenize:CR},wR={tokenize:jR},bR={tokenize:PR};function kR(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&&Fn(e,0,e.length,n),e}function _R(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,gm(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]]),Fn(e,i,e.length,a),e}function SR(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(p){return i?i._inactive?f(p):(o=r.parser.defined.includes(ki(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),l):n(p)}function l(p){return p===40?e.attempt(vR,u,o?u:f)(p):p===91?e.attempt(wR,u,o?c:f)(p):o?u(p):f(p)}function c(p){return e.attempt(bR,u,f)(p)}function u(p){return t(p)}function f(p){return i._balanced=!0,n(p)}}function CR(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 _t(f)?$o(e,i)(f):i(f)}function i(f){return f===41?u(f):nk(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function o(f){return _t(f)?$o(e,l)(f):u(f)}function a(f){return n(f)}function l(f){return f===34||f===39||f===40?sk(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):u(f)}function c(f){return _t(f)?$o(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 jR(e,t,n){const r=this;return s;function s(a){return rk.call(r,e,i,o,"reference","referenceMarker","referenceString")(a)}function i(a){return r.parser.defined.includes(ki(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function o(a){return n(a)}}function PR(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 ER={name:"labelStartImage",resolveAll:ym.resolveAll,tokenize:TR};function TR(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 NR={name:"labelStartLink",resolveAll:ym.resolveAll,tokenize:RR};function RR(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 jd={name:"lineEnding",tokenize:AR};function AR(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),be(e,t,"linePrefix")}}const Gl={name:"thematicBreak",tokenize:IR};function IR(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"),le(c)?be(e,a,"whitespace")(c):a(c))}}const gt={continuation:{tokenize:FR},exit:zR,name:"list",tokenize:DR},MR={partial:!0,tokenize:$R},LR={partial:!0,tokenize:OR};function DR(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(h){const m=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:_h(h)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(Gl,n,c)(h):c(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(h)}return n(h)}function l(h){return _h(h)&&++o<10?(e.consume(h),l):(!r.interrupt||o<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),c(h)):n(h)}function c(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(ku,r.interrupt?n:u,e.attempt(MR,p,f))}function u(h){return r.containerState.initialBlankLine=!0,i++,p(h)}function f(h){return le(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),p):n(h)}function p(h){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function FR(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(ku,s,i);function s(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,be(e,t,"listItemIndent",r.containerState.size+1)(a)}function i(a){return r.containerState.furtherBlankLines||!le(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(LR,t,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,be(e,e.attempt(gt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function OR(e,t,n){const r=this;return be(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 zR(e){e.exit(this.containerState.type)}function $R(e,t,n){const r=this;return be(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!le(i)&&o&&o[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const xx={name:"setextUnderline",resolveTo:BR,tokenize:VR};function BR(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 VR(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"),le(c)?be(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||Z(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const UR={tokenize:WR};function WR(e){const t=this,n=e.attempt(ku,r,e.attempt(this.parser.constructs.flowInitial,s,be(e,e.attempt(this.parser.constructs.flow,s,e.attempt(QN,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 HR={resolveAll:ok()},GR=ik("string"),KR=ik("text");function ik(e){return{resolveAll:ok(e==="text"?qR: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 p=-1;if(f)for(;++p<f.length;){const h=f[p];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function ok(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 qR(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 QR={42:gt,43:gt,45:gt,48:gt,49:gt,50:gt,51:gt,52:gt,53:gt,54:gt,55:gt,56:gt,57:gt,62:Jb},YR={91:eR},XR={[-2]:Cd,[-1]:Cd,32:Cd},JR={35:oR,42:Gl,45:[xx,Gl],60:uR,61:xx,95:Gl,96:gx,126:gx},ZR={38:ek,92:Zb},eA={[-5]:jd,[-4]:jd,[-3]:jd,33:ER,38:ek,42:Sh,60:[NN,yR],91:NR,92:[sR,Zb],93:ym,95:Sh,96:UN},tA={null:[Sh,HR]},nA={null:[42,95]},rA={null:[]},sA=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:nA,contentInitial:YR,disable:rA,document:QR,flow:JR,flowInitial:XR,insideSpan:tA,string:ZR,text:eA},Symbol.toStringTag,{value:"Module"}));function iA(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:S(j),check:S(_),consume:x,enter:w,exit:k,interrupt:S(_,{interrupt:!0})},c={code:null,containerState:{},defineSkip:y,events:[],now:m,parser:e,previous:null,sliceSerialize:p,sliceStream:h,write:f};let u=t.tokenize.call(c,l);return t.resolveAll&&i.push(t),c;function f(A){return o=Xt(o,A),v(),o[o.length-1]!==null?[]:(E(t,0),c.events=gm(i,c.events,c),c.events)}function p(A,I){return aA(h(A),I)}function h(A){return oA(o,A)}function m(){const{_bufferIndex:A,_index:I,line:O,column:M,offset:N}=r;return{_bufferIndex:A,_index:I,line:O,column:M,offset:N}}function y(A){s[A.line]=A.column,P()}function v(){let A;for(;r._index<o.length;){const I=o[r._index];if(typeof I=="string")for(A=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===A&&r._bufferIndex<I.length;)g(I.charCodeAt(r._bufferIndex));else g(I)}}function g(A){u=u(A)}function x(A){Z(A)?(r.line++,r.column=1,r.offset+=A===-3?2:1,P()):A!==-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=A}function w(A,I){const O=I||{};return O.type=A,O.start=m(),c.events.push(["enter",O,c]),a.push(O),O}function k(A){const I=a.pop();return I.end=m(),c.events.push(["exit",I,c]),I}function j(A,I){E(A,I.from)}function _(A,I){I.restore()}function S(A,I){return O;function O(M,N,z){let V,L,B,C;return Array.isArray(M)?Q(M):"tokenize"in M?Q([M]):$(M);function $(fe){return Et;function Et(Ge){const Wt=Ge!==null&&fe[Ge],bn=Ge!==null&&fe.null,$n=[...Array.isArray(Wt)?Wt:Wt?[Wt]:[],...Array.isArray(bn)?bn:bn?[bn]:[]];return Q($n)(Ge)}}function Q(fe){return V=fe,L=0,fe.length===0?z:R(fe[L])}function R(fe){return Et;function Et(Ge){return C=T(),B=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,ce,pe)(Ge)}}function ce(fe){return A(B,C),N}function pe(fe){return C.restore(),++L<V.length?R(V[L]):z}}}function E(A,I){A.resolveAll&&!i.includes(A)&&i.push(A),A.resolve&&Fn(c.events,I,c.events.length-I,A.resolve(c.events.slice(I),c)),A.resolveTo&&(c.events=A.resolveTo(c.events,c))}function T(){const A=m(),I=c.previous,O=c.currentConstruct,M=c.events.length,N=Array.from(a);return{from:M,restore:z};function z(){r=A,c.previous=I,c.currentConstruct=O,c.events.length=M,a=N,P()}}function P(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function oA(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 aA(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=`
59
- `;break}case-3:{o=`\r
60
- `;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 lA(e){const r={constructs:mN([sA,...(e||{}).extensions||[]]),content:s(_N),defined:[],document:s(CN),flow:s(UR),lazy:{},string:s(GR),text:s(KR)};return r;function s(i){return o;function o(a){return iA(r,i,a)}}}function cA(e){for(;!tk(e););return e}const vx=/[\0\t\n\r]/g;function uA(){let e=1,t="",n=!0,r;return s;function s(i,o,a){const l=[];let c,u,f,p,h;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(vx.lastIndex=f,c=vx.exec(i),p=c&&c.index!==void 0?c.index:i.length,h=i.charCodeAt(p),!c){t=i.slice(f);break}if(h===10&&f===p&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),f<p&&(l.push(i.slice(f,p)),e+=p-f),h){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=p+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const dA=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function fA(e){return e.replace(dA,hA)}function hA(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),i=s===120||s===88;return Xb(n.slice(i?2:1),i?16:10)}return mm(n)||e}const ak={}.hasOwnProperty;function pA(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),mA(n)(cA(lA(n).document().write(uA()(e,t,!0))))}function mA(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Bs),autolinkProtocol:T,autolinkEmail:T,atxHeading:i(za),blockQuote:i(bn),characterEscape:T,characterReference:T,codeFenced:i($n),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:i($n,o),codeText:i($s,o),codeTextData:T,data:T,codeFlowValue:T,definition:i(Fa),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:i(Oa),hardBreakEscape:i(Yi),hardBreakTrailing:i(Yi),htmlFlow:i(Xi,o),htmlFlowData:T,htmlText:i(Xi,o),htmlTextData:T,image:i(or),label:o,link:i(Bs),listItem:i($u),listItemValue:p,listOrdered:i(kn,f),listUnordered:i(kn),paragraph:i($a),reference:R,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:i(za),strong:i(Bu),thematicBreak:i(he)},exit:{atxHeading:l(),atxHeadingSequence:j,autolink:l(),autolinkEmail:Wt,autolinkProtocol:Ge,blockQuote:l(),characterEscapeValue:P,characterReferenceMarkerHexadecimal:pe,characterReferenceMarkerNumeric:pe,characterReferenceValue:fe,characterReference:Et,codeFenced:l(v),codeFencedFence:y,codeFencedFenceInfo:h,codeFencedFenceMeta:m,codeFlowValue:P,codeIndented:l(g),codeText:l(N),codeTextData:P,data:P,definition:l(),definitionDestinationString:k,definitionLabelString:x,definitionTitleString:w,emphasis:l(),hardBreakEscape:l(I),hardBreakTrailing:l(I),htmlFlow:l(O),htmlFlowData:P,htmlText:l(M),htmlTextData:P,image:l(V),label:B,labelText:L,lineEnding:A,link:l(z),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ce,resourceDestinationString:C,resourceTitleString:$,resource:Q,setextHeading:l(E),setextHeadingLineSequence:S,setextHeadingText:_,strong:l(),thematicBreak:l()}};lk(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 an=oe.pop();me=s(F,an,me)}for(me=-1;++me<F.length;){const an=t[F[me][0]];ak.call(an,F[me][1].type)&&an[F[me][1].type].call(Object.assign({sliceSerialize:F[me][2].sliceSerialize},ee),F[me][1])}if(ee.tokenStack.length>0){const an=ee.tokenStack[ee.tokenStack.length-1];(an[1]||wx).call(ee,void 0,an[0])}for(H.position={start:lr(F.length>0?F[0][1].start:{line:1,column:1,offset:0}),end:lr(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,an=!1,ns,Bn,Ji,Zi;for(;++oe<=ee;){const Tt=F[oe];switch(Tt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Tt[0]==="enter"?me++:me--,Zi=void 0;break}case"lineEndingBlank":{Tt[0]==="enter"&&(ns&&!Zi&&!me&&!Ji&&(Ji=oe),Zi=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Zi=void 0}if(!me&&Tt[0]==="enter"&&Tt[1].type==="listItemPrefix"||me===-1&&Tt[0]==="exit"&&(Tt[1].type==="listUnordered"||Tt[1].type==="listOrdered")){if(ns){let Vs=oe;for(Bn=void 0;Vs--;){const Vn=F[Vs];if(Vn[1].type==="lineEnding"||Vn[1].type==="lineEndingBlank"){if(Vn[0]==="exit")continue;Bn&&(F[Bn][1].type="lineEndingBlank",an=!0),Vn[1].type="lineEnding",Bn=Vs}else if(!(Vn[1].type==="linePrefix"||Vn[1].type==="blockQuotePrefix"||Vn[1].type==="blockQuotePrefixWhitespace"||Vn[1].type==="blockQuoteMarker"||Vn[1].type==="listItemIndent"))break}Ji&&(!Bn||Ji<Bn)&&(ns._spread=!0),ns.end=Object.assign({},Bn?F[Bn][1].start:Tt[1].end),F.splice(Bn||oe,0,["exit",ns,Tt[2]]),oe++,ee++}if(Tt[1].type==="listItemPrefix"){const Vs={type:"listItem",_spread:!1,start:Object.assign({},Tt[1].start),end:void 0};ns=Vs,F.splice(oe,0,["enter",Vs,Tt[2]]),oe++,ee++,Ji=void 0,Zi=!0}}}return F[H][1]._spread=an,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:lr(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]||wx).call(this,F,oe[0]));else throw new Error("Cannot close `"+F.type+"` ("+zo({start:F.start,end:F.end})+"): it’s not open");ee.position.end=lr(F.end)}function u(){return hN(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(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 h(){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 y(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function v(){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 g(){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=ki(this.sliceSerialize(F)).toLowerCase()}function w(){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 j(F){const H=this.stack[this.stack.length-1];if(!H.depth){const ee=this.sliceSerialize(F).length;H.depth=ee}}function _(){this.data.setextHeadingSlurpLineEnding=!0}function S(F){const H=this.stack[this.stack.length-1];H.depth=this.sliceSerialize(F).codePointAt(0)===61?1:2}function E(){this.data.setextHeadingSlurpLineEnding=void 0}function T(F){const ee=this.stack[this.stack.length-1].children;let oe=ee[ee.length-1];(!oe||oe.type!=="text")&&(oe=Ba(),oe.position={start:lr(F.start),end:void 0},ee.push(oe)),this.stack.push(oe)}function P(F){const H=this.stack.pop();H.value+=this.sliceSerialize(F),H.position.end=lr(F.end)}function A(F){const H=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ee=H.children[H.children.length-1];ee.position.end=lr(F.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(H.type)&&(T.call(this,F),P.call(this,F))}function I(){this.data.atHardBreak=!0}function O(){const F=this.resume(),H=this.stack[this.stack.length-1];H.value=F}function M(){const F=this.resume(),H=this.stack[this.stack.length-1];H.value=F}function N(){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 V(){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=fA(H),ee.identifier=ki(H).toLowerCase()}function B(){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 C(){const F=this.resume(),H=this.stack[this.stack.length-1];H.url=F}function $(){const F=this.resume(),H=this.stack[this.stack.length-1];H.title=F}function Q(){this.data.inReference=void 0}function R(){this.data.referenceType="collapsed"}function ce(F){const H=this.resume(),ee=this.stack[this.stack.length-1];ee.label=H,ee.identifier=ki(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=Xb(H,ee==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):oe=mm(H);const me=this.stack[this.stack.length-1];me.value+=oe}function Et(F){const H=this.stack.pop();H.position.end=lr(F.end)}function Ge(F){P.call(this,F);const H=this.stack[this.stack.length-1];H.url=this.sliceSerialize(F)}function Wt(F){P.call(this,F);const H=this.stack[this.stack.length-1];H.url="mailto:"+this.sliceSerialize(F)}function bn(){return{type:"blockquote",children:[]}}function $n(){return{type:"code",lang:null,meta:null,value:""}}function $s(){return{type:"inlineCode",value:""}}function Fa(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Oa(){return{type:"emphasis",children:[]}}function za(){return{type:"heading",depth:0,children:[]}}function Yi(){return{type:"break"}}function Xi(){return{type:"html",value:""}}function or(){return{type:"image",title:null,url:"",alt:null}}function Bs(){return{type:"link",title:null,url:"",children:[]}}function kn(F){return{type:"list",ordered:F.type==="listOrdered",start:null,spread:F._spread,children:[]}}function $u(F){return{type:"listItem",spread:F._spread,checked:null,children:[]}}function $a(){return{type:"paragraph",children:[]}}function Bu(){return{type:"strong",children:[]}}function Ba(){return{type:"text",value:""}}function he(){return{type:"thematicBreak"}}}function lr(e){return{line:e.line,column:e.column,offset:e.offset}}function lk(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?lk(e,r):gA(e,r)}}function gA(e,t){let n;for(n in t)if(ak.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 wx(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+zo({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+zo({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+zo({start:t.start,end:t.end})+") is still open")}function yA(e){const t=this;t.parser=n;function n(r){return pA(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function xA(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 vA(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
61
- `}]}function wA(e,t){const n=t.value?t.value+`
62
- `:"",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 bA(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function kA(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function _A(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=Vi(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 SA(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 CA(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function ck(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 jA(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return ck(e,t);const s={src:Vi(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 PA(e,t){const n={src:Vi(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 EA(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 TA(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return ck(e,t);const s={href:Vi(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 NA(e,t){const n={href:Vi(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 RA(e,t,n){const r=e.all(t),s=n?AA(n):uk(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:`
63
- `}),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:`
64
- `});const c={type:"element",tagName:"li",properties:i,children:o};return e.patch(t,c),e.applyData(t,c)}function AA(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=uk(n[r])}return t}function uk(e){const t=e.spread;return t??e.children.length>1}function IA(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 MA(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function LA(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function DA(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function FA(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=dm(t.children[1]),l=Wb(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 OA(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],p={},h=o?o[l]:void 0;h&&(p.align=h);let m={type:"element",tagName:i,properties:p,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 zA(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const bx=9,kx=32;function $A(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),s=0;const i=[];for(;r;)i.push(_x(t.slice(s,r.index),s>0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return i.push(_x(t.slice(s),s>0,!1)),i.join("")}function _x(e,t,n){let r=0,s=e.length;if(t){let i=e.codePointAt(r);for(;i===bx||i===kx;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(s-1);for(;i===bx||i===kx;)s--,i=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function BA(e,t){const n={type:"text",value:$A(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function VA(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const UA={blockquote:xA,break:vA,code:wA,delete:bA,emphasis:kA,footnoteReference:_A,heading:SA,html:CA,imageReference:jA,image:PA,inlineCode:EA,linkReference:TA,link:NA,listItem:RA,list:IA,paragraph:MA,root:LA,strong:DA,table:FA,tableCell:zA,tableRow:OA,text:BA,thematicBreak:VA,toml:cl,yaml:cl,definition:cl,footnoteDefinition:cl};function cl(){}const dk=-1,_u=0,Bo=1,Lc=2,xm=3,vm=4,wm=5,bm=6,fk=7,hk=8,WA=typeof self=="object"?self:globalThis,Sx=(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 WA[e](t)},HA=(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 _u:case dk:return n(o,s);case Bo:{const a=n([],s);for(const l of o)a.push(r(l));return a}case Lc:{const a=n({},s);for(const[l,c]of o)a[r(l)]=r(c);return a}case xm:return n(new Date(o),s);case vm:{const{source:a,flags:l}=o;return n(new RegExp(a,l),s)}case wm:{const a=n(new Map,s);for(const[l,c]of o)a.set(r(l),r(c));return a}case bm:{const a=n(new Set,s);for(const l of o)a.add(r(l));return a}case fk:{const{name:a,message:l}=o;return n(Sx(a,l),s)}case hk: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(Sx(i,o),s)};return r},Cx=e=>HA(new Map,e)(0),Hs="",{toString:GA}={},{keys:KA}=Object,po=e=>{const t=typeof e;if(t!=="object"||!e)return[_u,t];const n=GA.call(e).slice(8,-1);switch(n){case"Array":return[Bo,Hs];case"Object":return[Lc,Hs];case"Date":return[xm,Hs];case"RegExp":return[vm,Hs];case"Map":return[wm,Hs];case"Set":return[bm,Hs];case"DataView":return[Bo,n]}return n.includes("Array")?[Bo,n]:n.includes("Error")?[fk,n]:[Lc,n]},ul=([e,t])=>e===_u&&(t==="function"||t==="symbol"),qA=(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]=po(o);switch(a){case _u:{let u=o;switch(l){case"bigint":a=hk,u=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return s([dk],o)}return s([a,u],o)}case Bo:{if(l){let p=o;return l==="DataView"?p=new Uint8Array(o.buffer):l==="ArrayBuffer"&&(p=new Uint8Array(o)),s([l,[...p]],o)}const u=[],f=s([a,u],o);for(const p of o)u.push(i(p));return f}case Lc:{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 p of KA(o))(e||!ul(po(o[p])))&&u.push([i(p),i(o[p])]);return f}case xm:return s([a,o.toISOString()],o);case vm:{const{source:u,flags:f}=o;return s([a,{source:u,flags:f}],o)}case wm:{const u=[],f=s([a,u],o);for(const[p,h]of o)(e||!(ul(po(p))||ul(po(h))))&&u.push([i(p),i(h)]);return f}case bm:{const u=[],f=s([a,u],o);for(const p of o)(e||!ul(po(p)))&&u.push(i(p));return f}}const{message:c}=o;return s([a,{name:l,message:c}],o)};return i},jx=(e,{json:t,lossy:n}={})=>{const r=[];return qA(!(t||n),!!t,new Map,r)(e),r},Dc=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Cx(jx(e,t)):structuredClone(e):(e,t)=>Cx(jx(e,t));function QA(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 YA(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function XA(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||QA,r=e.options.footnoteBackLabel||YA,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(),p=Vi(f.toLowerCase());let h=0;const m=[],y=e.footnoteCounts.get(f);for(;y!==void 0&&++h<=y;){m.length>0&&m.push({type:"text",value:" "});let x=typeof n=="string"?n:n(l,h);typeof x=="string"&&(x={type:"text",value:x}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(h>1?"-"+h:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,h),className:["data-footnote-backref"]},children:Array.isArray(x)?x:[x]})}const v=u[u.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const x=v.children[v.children.length-1];x&&x.type==="text"?x.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...m)}else u.push(...m);const g={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(u,!0)};e.patch(c,g),a.push(g)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...Dc(o),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
65
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
66
- `}]}}const pk=function(e){if(e==null)return tI;if(typeof e=="function")return Su(e);if(typeof e=="object")return Array.isArray(e)?JA(e):ZA(e);if(typeof e=="string")return eI(e);throw new Error("Expected function, string, or object as test")};function JA(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=pk(e[n]);return Su(r);function r(...s){let i=-1;for(;++i<t.length;)if(t[i].apply(this,s))return!0;return!1}}function ZA(e){const t=e;return Su(n);function n(r){const s=r;let i;for(i in e)if(s[i]!==t[i])return!1;return!0}}function eI(e){return Su(t);function t(n){return n&&n.type===e}}function Su(e){return t;function t(n,r,s){return!!(nI(n)&&e.call(this,n,typeof r=="number"?r:void 0,s||void 0))}}function tI(){return!0}function nI(e){return e!==null&&typeof e=="object"&&"type"in e}const mk=[],rI=!0,Px=!1,sI="skip";function iI(e,t,n,r){let s;typeof t=="function"&&typeof n!="function"?(r=n,n=t):s=t;const i=pk(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 h=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(l.type+(h?"<"+h+">":""))+")"})}return p;function p(){let h=mk,m,y,v;if((!t||i(l,c,u[u.length-1]||void 0))&&(h=oI(n(l,u)),h[0]===Px))return h;if("children"in l&&l.children){const g=l;if(g.children&&h[0]!==sI)for(y=(r?g.children.length:-1)+o,v=u.concat(g);y>-1&&y<g.children.length;){const x=g.children[y];if(m=a(x,y,v)(),m[0]===Px)return m;y=typeof m[1]=="number"?m[1]:y+o}}return h}}}function oI(e){return Array.isArray(e)?e:typeof e=="number"?[rI,e]:e==null?mk:[e]}function gk(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),iI(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 Ch={}.hasOwnProperty,aI={};function lI(e,t){const n=t||aI,r=new Map,s=new Map,i=new Map,o={...UA,...n.handlers},a={all:c,applyData:uI,definitionById:r,footnoteById:s,footnoteCounts:i,footnoteOrder:[],handlers:o,one:l,options:n,patch:cI,wrap:fI};return gk(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const f=u.type==="definition"?r:s,p=String(u.identifier).toUpperCase();f.has(p)||f.set(p,u)}}),a;function l(u,f){const p=u.type,h=a.handlers[p];if(Ch.call(a.handlers,p)&&h)return h(a,u,f);if(a.options.passThrough&&a.options.passThrough.includes(p)){if("children"in u){const{children:y,...v}=u,g=Dc(v);return g.children=a.all(u),g}return Dc(u)}return(a.options.unknownHandler||dI)(a,u,f)}function c(u){const f=[];if("children"in u){const p=u.children;let h=-1;for(;++h<p.length;){const m=a.one(p[h],u);if(m){if(h&&p[h-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=Ex(m.value)),!Array.isArray(m)&&m.type==="element")){const y=m.children[0];y&&y.type==="text"&&(y.value=Ex(y.value))}Array.isArray(m)?f.push(...m):f.push(m)}}}return f}}function cI(e,t){e.position&&(t.position=H2(e))}function uI(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,Dc(i)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function dI(e,t){const n=t.data||{},r="value"in t&&!(Ch.call(n,"hProperties")||Ch.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 fI(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
67
- `});++r<e.length;)r&&n.push({type:"text",value:`
68
- `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
69
- `}),n}function Ex(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Tx(e,t){const n=lI(e,t),r=n.one(e,void 0),s=XA(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&i.children.push({type:"text",value:`
70
- `},s),i}function hI(e,t){return e&&"run"in e?async function(n,r){const s=Tx(n,{file:r,...t});await e.run(s,r)}:function(n,r){return Tx(n,{file:r,...e||t})}}function Nx(e){if(e)throw e}var Kl=Object.prototype.hasOwnProperty,yk=Object.prototype.toString,Rx=Object.defineProperty,Ax=Object.getOwnPropertyDescriptor,Ix=function(t){return typeof Array.isArray=="function"?Array.isArray(t):yk.call(t)==="[object Array]"},Mx=function(t){if(!t||yk.call(t)!=="[object Object]")return!1;var n=Kl.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Kl.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var s;for(s in t);return typeof s>"u"||Kl.call(t,s)},Lx=function(t,n){Rx&&n.name==="__proto__"?Rx(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Dx=function(t,n){if(n==="__proto__")if(Kl.call(t,n)){if(Ax)return Ax(t,n).value}else return;return t[n]},pI=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=Dx(a,n),s=Dx(t,n),a!==s&&(u&&s&&(Mx(s)||(i=Ix(s)))?(i?(i=!1,o=r&&Ix(r)?r:[]):o=r&&Mx(r)?r:{},Lx(a,{name:n,newValue:e(u,o,s)})):typeof s<"u"&&Lx(a,{name:n,newValue:s}));return a};const Pd=eu(pI);function jh(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 mI(){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?gI(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 gI(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 En={basename:yI,dirname:xI,extname:vI,join:wI,sep:"/"};function yI(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Ea(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 xI(e){if(Ea(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 vI(e){Ea(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 wI(...e){let t=-1,n;for(;++t<e.length;)Ea(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":bI(n)}function bI(e){Ea(e);const t=e.codePointAt(0)===47;let n=kI(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function kI(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 Ea(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const _I={cwd:SI};function SI(){return"/"}function Ph(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function CI(e){if(typeof e=="string")e=new URL(e);else if(!Ph(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 jI(e)}function jI(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 Ed=["history","path","basename","stem","extname","dirname"];class xk{constructor(t){let n;t?Ph(t)?n={path:t}:typeof t=="string"||PI(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":_I.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Ed.length;){const i=Ed[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)Ed.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?En.basename(this.path):void 0}set basename(t){Nd(t,"basename"),Td(t,"basename"),this.path=En.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?En.dirname(this.path):void 0}set dirname(t){Fx(this.basename,"dirname"),this.path=En.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?En.extname(this.path):void 0}set extname(t){if(Td(t,"extname"),Fx(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=En.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Ph(t)&&(t=CI(t)),Nd(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?En.basename(this.path,this.extname):void 0}set stem(t){Nd(t,"stem"),Td(t,"stem"),this.path=En.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 Td(e,t){if(e&&e.includes(En.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+En.sep+"`")}function Nd(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Fx(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function PI(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const EI=function(e){const r=this.constructor.prototype,s=r[e],i=function(){return s.apply(i,arguments)};return Object.setPrototypeOf(i,r),i},TI={}.hasOwnProperty;class km extends EI{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=mI()}copy(){const t=new km;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Pd(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Id("data",this.frozen),this.namespace[t]=n,this):TI.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Id("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=dl(t),r=this.parser||this.Parser;return Rd("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Rd("process",this.parser||this.Parser),Ad("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(i,o){const a=dl(t),l=r.parse(a);r.run(l,a,function(u,f,p){if(u||!f||!p)return c(u);const h=f,m=r.stringify(h,p);AI(m)?p.value=m:p.result=m,c(u,p)});function c(u,f){u||!f?o(u):i?i(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),Rd("processSync",this.parser||this.Parser),Ad("processSync",this.compiler||this.Compiler),this.process(t,s),zx("processSync","process",n),r;function s(i,o){n=!0,Nx(i),r=o}}run(t,n,r){Ox(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=dl(n);s.run(t,l,c);function c(u,f,p){const h=f||t;u?a(u):o?o(h):r(void 0,h,p)}}}runSync(t,n){let r=!1,s;return this.run(t,n,i),zx("runSync","run",r),s;function i(o,a){Nx(o),s=a,r=!0}}stringify(t,n){this.freeze();const r=dl(n),s=this.compiler||this.Compiler;return Ad("stringify",s),Ox(t),s(t,r)}use(t,...n){const r=this.attachers,s=this.namespace;if(Id("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=Pd(!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,p=-1;for(;++f<r.length;)if(r[f][0]===c){p=f;break}if(p===-1)r.push([c,...u]);else if(u.length>0){let[h,...m]=u;const y=r[p][1];jh(y)&&jh(h)&&(h=Pd(!0,y,h)),r[p]=[c,h,...m]}}}}const NI=new km().freeze();function Rd(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Ad(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Id(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 Ox(e){if(!jh(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function zx(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function dl(e){return RI(e)?e:new xk(e)}function RI(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function AI(e){return typeof e=="string"||II(e)}function II(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const MI="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",$x=[],Bx={allowDangerousHtml:!0},LI=/^(https?|ircs?|mailto|xmpp)$/i,DI=[{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 FI(e){const t=OI(e),n=zI(e);return $I(t.runSync(t.parse(n),n),e)}function OI(e){const t=e.rehypePlugins||$x,n=e.remarkPlugins||$x,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Bx}:Bx;return NI().use(yA).use(n).use(hI,r).use(t)}function zI(e){const t=e.children||"",n=new xk;return typeof t=="string"&&(n.value=t),n}function $I(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,i=t.disallowedElements,o=t.skipHtml,a=t.unwrapDisallowed,l=t.urlTransform||BI;for(const u of DI)Object.hasOwn(t,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+MI+u.id,void 0);return gk(e,c),Y2(e,{Fragment:d.Fragment,components:s,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0});function c(u,f,p){if(u.type==="raw"&&p&&typeof f=="number")return o?p.children.splice(f,1):p.children[f]={type:"text",value:u.value},f;if(u.type==="element"){let h;for(h in Sd)if(Object.hasOwn(Sd,h)&&Object.hasOwn(u.properties,h)){const m=u.properties[h],y=Sd[h];(y===null||y.includes(u.tagName))&&(u.properties[h]=l(String(m||""),h,u))}}if(u.type==="element"){let h=n?!n.includes(u.tagName):i?i.includes(u.tagName):!1;if(!h&&r&&typeof f=="number"&&(h=!r(u,f,p)),h&&p&&typeof f=="number")return a&&u.children?p.children.splice(f,1,...u.children):p.children.splice(f,1),f}}}function BI(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||LI.test(e.slice(0,t))?e:""}const Md=e=>`font-display-luminari font-semibold ${e} mt-6 mb-3 leading-tight`,VI={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:Md("text-lg"),children:e}),h2:({children:e})=>d.jsx("h2",{className:Md("text-[1.3rem]"),children:e}),h3:({children:e})=>d.jsx("h3",{className:Md("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})},vk=({children:e})=>d.jsx(FI,{components:VI,children:e});let wk="";function UI(e){wk=e}function G(e){return`${wk}${e}`}const _m=1e3,WI=3e4;let Zt=null,di=null,Vo=_m;const Uo=new Set;function HI(e){let t;try{t=JSON.parse(e.data)}catch{return}for(const n of Uo)n(t)}function GI(){Vo=_m}function KI(){Zt==null||Zt.close(),Zt=null,Uo.size!==0&&(di=setTimeout(()=>{di=null,bk()},Vo),Vo=Math.min(Vo*2,WI))}function bk(){Zt=new EventSource(G("/api/activity/stream")),Zt.onmessage=HI,Zt.onopen=GI,Zt.onerror=KI}function Ta(e){return Uo.add(e),!Zt&&!di&&bk(),()=>{Uo.delete(e),!(Uo.size>0)&&(di&&(clearTimeout(di),di=null),Zt&&(Zt.close(),Zt=null),Vo=_m)}}const qI={},Vx=e=>{let t;const n=new Set,r=(u,f)=>{const p=typeof u=="function"?u(t):u;if(!Object.is(p,t)){const h=t;t=f??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(m=>m(t,h))}},s=()=>t,l={setState:r,getState:s,getInitialState:()=>c,subscribe:u=>(n.add(u),()=>n.delete(u)),destroy:()=>{(qI?"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},QI=e=>e?Vx(e):Vx,kk={},{useDebugValue:YI}=Si,{useSyncExternalStoreWithSelector:XI}=kT;let Ux=!1;const JI=e=>e;function ZI(e,t=JI,n){(kk?"production":void 0)!=="production"&&n&&!Ux&&(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"),Ux=!0);const r=XI(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return YI(r),r}const eM=e=>{(kk?"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"?QI(e):e,n=(r,s)=>ZI(t,r,s);return Object.assign(n,t),n},tM=e=>eM,_k=async()=>{const e=await fetch(G("/api/capabilities"));return e.ok?(await e.json()).capabilities:null},nM=async()=>{const e=await fetch(G("/api/agent/auth-status"));return e.ok?await e.json():null},c7=async()=>{try{const e=await fetch(G("/api/connections"));return e.ok?(await e.json()).connections:null}catch{return null}},u7=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}},Sm=async()=>{try{const e=await fetch(G("/api/config"));return e.ok?e.json():null}catch{return null}},d7=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}}},rM=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}},f7=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}},sM=async()=>{try{const e=await fetch(G("/api/package-name"));return e.ok?e.json():null}catch{return null}},zn=async(e,t="Launch failed")=>{if(!e.ok){const n=await e.json().catch(()=>({error:t}));throw new Error(n.error)}},iM=async()=>(await fetch(G("/api/agent/status"))).json(),oM=async()=>(await fetch(G("/api/agent/reconcile-queue"))).json(),aM=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 zn(n)},lM=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 zn(n)},cM=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 zn(n)},uM=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 zn(n)},dM=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 zn(n)},fM=async e=>{const t=await fetch(G("/api/agent/launch-suggest"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:e})});await zn(t)},hM=async()=>{const e=await fetch(G("/api/agent/launch-reconcile-all"),{method:"POST"});await zn(e)},pM=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 zn(t)},mM=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 zn(t)},gM=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},Wx=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})`)}},yM=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},xM=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},vM=async e=>{const t=await fetch(G("/api/agent/stop"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskId:e})});await zn(t,"Stop failed")},wM=async()=>(await fetch(G("/api/agent/login-relay/start"),{method:"POST"})).json(),bM=async()=>(await fetch(G("/api/agent/login-relay/status"))).json(),kM=async()=>{await fetch(G("/api/agent/login-relay/cancel"),{method:"POST"})};function ct(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 cr(e,t){return async(...n)=>{await t(...n),await e().loadAgentStatus()}}let _M=0;const Hx=()=>`preview-${++_M}`;function SM(e,t){return{agentAuthStatus:null,loadAgentAuthStatus:ct(e,nM,n=>({agentAuthStatus:n}),()=>({agentAuthStatus:null})),agentStatus:[],loadAgentStatus:async()=>{try{const n=await iM(),r=t().agentStatus;if(e({agentStatus:n}),n.find(l=>{var u;if(l.status!=="done"||l.taskKind!=="run-all"&&l.taskKind!=="phase")return!1;const c=r.find(f=>f.id===l.id);if(!c||c.status==="done"||c.status==="error")return!1;if(l.taskKind==="phase"){const f=(u=t().plans)==null?void 0:u.entries.find(p=>p.id===l.planId);if(!f||l.phaseIndex!==f.phases.length-1)return!1}return!0})){const{runCheck:l}=t();for(const c of["lint","format","test","consistency"])l(c)}const i=t().pendingReconcile,o=i?n.find(l=>l.taskKind==="reconcile"&&l.planId===i.planId):void 0;i&&o&&(o.status==="done"?(await t().loadPlans(),e(l=>({reconcileQueue:[...l.reconcileQueue,{...i,previewId:Hx()}],pendingReconcile:null}))):o.status==="error"&&e({pendingReconcile:null}));const a=n.find(l=>l.taskKind==="batch-reconcile");if((a==null?void 0:a.status)==="done"&&!t().batchReconcileConsumed){const l=await oM();l&&l.length>0&&(await t().loadPlans(),e(c=>({reconcileQueue:[...c.reconcileQueue,...l.map(u=>({planId:u.planId,before:u.before,previewId:Hx()}))]}))),e({batchReconcileConsumed:!0})}}catch{}},launchAgent:cr(t,aM),launchPlanAudit:cr(t,lM),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 cM(n,r)}catch(o){throw e({pendingReconcile:null}),o}await t().loadAgentStatus()},launchPlanDraft:cr(t,uM),launchIdeaExtend:cr(t,dM),launchBatchReconcile:cr(t,async()=>{e({batchReconcileConsumed:!1}),await hM()}),launchSuggestIdeas:cr(t,fM),launchRunAll:cr(t,pM),launchFixReview:cr(t,mM),stopAgent:async n=>{try{await vM(n)}finally{await t().loadAgentStatus()}},loginRelay:null,startLoginRelay:async()=>{try{const n=await wM();e({loginRelay:n})}catch(n){e({loginRelay:{phase:"error",authorizeUrl:null,error:n.message}})}},loadLoginRelayStatus:ct(e,bM,n=>({loginRelay:n})),cancelLoginRelay:async()=>{try{await kM()}finally{e({loginRelay:null})}},pendingReconcile:null,reconcileQueue:[],removeFromReconcileQueue:n=>e(r=>({reconcileQueue:r.reconcileQueue.filter(s=>s.previewId!==n)})),batchReconcileConsumed:!1}}const Xr=45e3;async function Jr(e,t){if(e.ok)return;const n=await e.json().catch(()=>({error:t}));throw new Error(n.error)}const CM=async()=>{const e=await fetch(G("/api/git/status"),{signal:AbortSignal.timeout(Xr)});return await Jr(e,"Failed to load git status"),e.json()},jM=async()=>{const e=await fetch(G("/api/git/diff"),{signal:AbortSignal.timeout(Xr)});return await Jr(e,"Failed to load diff"),(await e.json()).files},Sk=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(Xr)});await Jr(r,"Commit failed")},PM=async()=>{const e=await fetch(G("/api/git/push"),{method:"POST",signal:AbortSignal.timeout(Xr)});await Jr(e,"Push failed")},Ck=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 Jr(t,"Failed to suggest a commit message"),t.json()},EM=async()=>{const e=await fetch(G("/api/git/sync"),{method:"POST",signal:AbortSignal.timeout(Xr)});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 Jr(e,"Sync failed"),{ok:!0}},TM=async()=>{const e=await fetch(G("/api/git/pull"),{method:"POST",signal:AbortSignal.timeout(Xr)});await Jr(e,"Pull failed")},NM=async()=>{const e=await fetch(G("/api/git/fix-divergence"),{method:"POST",signal:AbortSignal.timeout(Xr)});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 Jr(e,"Fix failed"),{ok:!0}},RM=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})`}}},AM=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(Xr)}),n=await t.json();if(!t.ok)throw new Error(n.error??"Failed to create branch");return n.branch};function IM(e,t){return{diffFiles:null,diffLoadFailed:!1,loadDiffFiles:ct(e,jM,n=>({diffFiles:n,diffLoadFailed:!1}),()=>({diffLoadFailed:!0})),activeDiffPath:null,setActiveDiffPath:n=>{t().activeDiffPath!==n&&e({activeDiffPath:n})}}}const MM=async()=>(await fetch(G("/api/tasks"))).json(),h7=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()},LM=async()=>(await fetch(G("/api/suggestions"))).json(),DM=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()},FM=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)}},OM=async()=>(await fetch(G("/api/docs"))).json(),jk=async()=>{const e=await fetch(G("/api/roadmap"));if(!e.ok)throw new Error(`Failed to fetch roadmap: ${e.status}`);return e.json()},zM=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()},p7=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)}},m7=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)}},$M=async()=>(await fetch(G("/api/consistency"))).json(),BM=async()=>(await fetch(G("/api/doctor"))).json(),VM=45e3,Pk=async()=>(await fetch(G("/api/ideas"),{signal:AbortSignal.timeout(VM)})).json(),UM=async()=>(await fetch(G("/api/archivable-ideas"))).json(),WM=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},Ek=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},Tk=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},HM=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},GM=async()=>{const e=await fetch(G("/api/notifications"));if(!e.ok)throw new Error(`Failed to fetch notifications: ${e.status}`);return e.json()},KM=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}`)},qM=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()},QM=45e3,Nk=async()=>(await fetch(G("/api/plans"),{signal:AbortSignal.timeout(QM)})).json(),YM=async e=>{await fetch(G("/api/plans"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})},XM=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})`)}},JM=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},g7=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 ZM(e,t){return{repoDocs:[],repoDocsLoading:!0,loadRepoDocs:async()=>{e({repoDocsLoading:!0});try{const n=await OM();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 JM();e({releaseVersions:n,releaseVersionsLoading:!1})}catch{e({releaseVersions:[],releaseVersionsLoading:!1})}},activeReleaseVersion:null,setActiveReleaseVersion:n=>e({activeReleaseVersion:n})}}function eL(e,t){return{ideaEntries:[],loadIdeas:ct(e,Pk,n=>({ideaEntries:n.entries}),()=>({ideaEntries:[]})),archivableIdeas:[],loadArchivableIdeas:ct(e,UM,n=>({archivableIdeas:n}),()=>({archivableIdeas:[]})),archiveIdeas:async n=>{await WM(n),await Promise.all([t().loadArchivableIdeas(),t().loadPlans(),t().loadIdeas()])}}}function tL(e,t){return{notifications:null,notificationsLoading:!1,notificationsError:null,loadNotifications:ct(e,GM,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 KM(n)}catch(s){e({notifications:r,notificationsError:String(s)})}}}}}function nL(e){return{parkedQuestions:null,parkedQuestionsLoading:!1,parkedQuestionsError:null,loadParkedQuestions:ct(e,qM,t=>({parkedQuestions:t,parkedQuestionsError:null}),t=>({parkedQuestionsError:String(t)}),"parkedQuestionsLoading")}}const Fc=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`},Rk=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)}},Ak=e=>Rk(e.phases),Gx=e=>{var t;return((t=Ak(e))==null?void 0:t.pct)??null},rL=e=>Rk([...e.phases,...e.fixes??[]]),sL=(e,t)=>{const n=rL(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}},Cm=(e,t)=>e?t.find(n=>n.planId===e&&n.status!=="done"&&n.status!=="error"):void 0,jm=(e,t)=>e.status==="done"||e.status==="dropped"?e.status:Cm(e.id,t)?"in-progress":e.status,iL=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 Ld(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 oL(a)}function oL(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 aL=["idea","planned","in-progress","review","done","dropped"],lL=["feat","fix","chore","docs","refactor"],y7=["claude-code","opencode"],cL={"claude-code":"Claude Code",opencode:"OpenCode"},x7={"claude-code":{model:["opus","sonnet","fable","haiku"],effort:["low","medium","high","xhigh","max"]},opencode:{model:null}},v7={phase:{agent:"opencode"},planDraft:{agent:"claude-code"},ideaExtend:{agent:"claude-code"},commitSuggest:{agent:"claude-code"},feedback:{agent:"claude-code",model:"sonnet",effort:"medium"}},uL=["in-progress","review","planned","idea"],dL=["open"],Pm={statuses:uL,tags:[],search:"",sortKey:"order",sortDirection:"asc",noteStatuses:dL,subject:null},Kx={"in-progress":0,review:1,planned:2,idea:3,done:4,dropped:5},fl=e=>{const t=new Date(e.updated??e.created).getTime();return Number.isNaN(t)?0:t},qx=e=>{const t=new Date(e.created).getTime();return Number.isNaN(t)?0:t},Qx=e=>{var n;const t=(n=e.id)==null?void 0:n.match(/(\d+)\s*$/);return t?Number(t[1]):Number.POSITIVE_INFINITY},Dd=(e,t)=>{const n=t.trim().toLowerCase();return n?e.title.toLowerCase().includes(n)||e.body.toLowerCase().includes(n):!0},Yx=(e,t)=>t.size===0?!0:e.tags.some(n=>t.has(n)),Wo=(e,t)=>t===null||e===t,Em=(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:qx(e)-qx(t);const s=(()=>{switch(n){case"status":{const i=Kx[e.status]-Kx[t.status];return i!==0?i:fl(t)-fl(e)}case"updated":return fl(t)-fl(e);case"title":return e.title.localeCompare(t.title);case"id":return Qx(e)-Qx(t);case"progress":return(Gx(t)??-1)-(Gx(e)??-1);default:return 0}})();return r==="desc"?-s:s},Eh=(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},ql=(e,t=Pm)=>{const n=new Set(t.tags),r=new Set(t.statuses),s=Eh(e.filter(a=>Yx(a,n)&&Dd(a,t.search)&&Wo(a.subject,t.subject)),a=>[a.status]);for(const a of aL)s[a]??(s[a]=0);const i=Eh(e.filter(a=>r.has(a.status)&&Dd(a,t.search)&&Wo(a.subject,t.subject)),a=>a.tags);return{rows:e.filter(a=>r.has(a.status)&&Yx(a,n)&&Dd(a,t.search)&&Wo(a.subject,t.subject)).sort((a,l)=>Em(a,l,t.sortKey,t.sortDirection)),statusCounts:s,tagCounts:i}},fL=["open","done","dropped"],hL={open:"idea",done:"done",dropped:"dropped"},Fd=(e,t)=>{const n=t.trim().toLowerCase();return n?e.title.toLowerCase().includes(n)||e.body.toLowerCase().includes(n):!0},pL=e=>e.type==="plan"?e.plan.subject:e.idea.subject,mL=e=>e.type==="plan"?e.plan.order:e.idea.order,gL=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},Xx=(e,t)=>e.reduce((n,r)=>{const s=mL(r);return s===void 0?n:n===void 0?s:t==="desc"?Math.max(n,s):Math.min(n,s)},void 0),Jx=e=>e.reduce((t,n)=>Math.max(t,gL(n)),0),yL=(e,t="asc",n)=>{var a;const r=new Map,s=[];for(const l of e){const c=pL(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=Xx(l.rows,t),f=Xx(c.rows,t);return u!==void 0&&f!==void 0?i*(u-f):u!==void 0?-1:f!==void 0?1:Jx(c.rows)-Jx(l.rows)});return s.length>0&&o.push({subject:null,rows:s}),o},Zx=e=>e.type==="plan"?e.plan:e.type==="note"?{title:e.idea.title,id:e.idea.id??void 0,status:hL[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)=>Em(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},xL=(e,t,n=Pm)=>{const{statusCounts:r,tagCounts:s}=ql(e,n),i=t.filter(h=>h.kind==="note"),o=t.filter(h=>h.kind!=="note"),a=new Set(o.map(h=>h.id).filter(h=>!!h)),l=new Map,c=[];for(const h of e)if(h.idea&&a.has(h.idea)){const m=l.get(h.idea)??[];m.push(h),l.set(h.idea,m)}else c.push(h);const u=new Set(n.noteStatuses),f=Eh(i.filter(h=>Fd(h,n.search)),h=>[h.status??"open"]);for(const h of fL)f[h]??(f[h]=0);const p=ql(c,n).rows.map(h=>({type:"plan",plan:h}));for(const h of o){const m=h.id?l.get(h.id)??[]:[],y=ql(m,n).rows;!Wo(h.subject,n.subject)&&y.length===0||y.length===0&&(m.length>0||!Fd(h,n.search))||p.push({type:"idea-group",idea:h,children:y})}for(const h of i)u.has(h.status??"open")&&Fd(h,n.search)&&Wo(h.subject,n.subject)&&p.push({type:"note",idea:h});return p.sort((h,m)=>Em(Zx(h),Zx(m),n.sortKey,n.sortDirection)),{rows:p,statusCounts:r,tagCounts:s,noteStatusCounts:f}},vL=.2,wL=5,Ik=3,Mk=2,Lk=1,bL=Ik+Mk+Lk,kL=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"]),hl=e=>{const t=e.toLowerCase().split(/[^a-z0-9]+/).filter(n=>n.length>=2&&!kL.has(n));return new Set(t)},Od=(e,t)=>{let n=0;for(const r of e)t.has(r)&&(n+=1);return n};function _L(e,t,n={}){const{threshold:r=vL,limit:s=wL}=n,i=hl(e);if(i.size===0)return[];const o=[];for(const a of t){const l=hl(a.title),c=hl(a.body),u=hl((a.tags??[]).join(" ")),p=(Od(i,l)*Ik+Od(i,u)*Mk+Od(i,c)*Lk)/(i.size*bL);p>=r&&o.push({candidate:a,score:p})}return o.sort((a,l)=>l.score-a.score),o.slice(0,s)}const SL=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}`},CL=(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=[SL(e),e.failure_scenario??e.reasoning].filter(Boolean).join(" — ");return{done:!1,text:n.trim(),description:r||void 0,source:"review"}},jL=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)=>CL(r,s))},PL=e=>`Fix the failing "${e}" check`,EL=[{name:"Quality",keys:["lint","format"]},{name:"Tests",keys:["test"]},{name:"Consistency",keys:["consistency"]}],TL=({cmd:e,output:t})=>`The command was \`${e}\`.
71
-
72
- Output from the last run:
73
-
74
- ${t||"(no output captured)"}`,NL=e=>EL.flatMap(({name:t,keys:n})=>{const r=n.map(i=>e[i]).filter(i=>i.status==="fail");if(r.length===0)return[];const s=r.map(TL).join(`
75
-
76
- `);return[{done:!1,text:PL(t),description:`Fix the failing "${t}" check in this repo.
77
-
78
- ${s}`}]}),RL=(e,t)=>{const n=new Map(NL(t).map(s=>[s.text,s]));return[...e.map(s=>{const i=n.get(s.text);return i?(n.delete(s.text),i):s}),...n.values()]};function AL(e,t){return{plans:null,plansLoading:!1,plansError:null,loadPlans:ct(e,Nk,n=>({plans:n,plansError:null}),n=>({plansError:String(n)}),"plansLoading"),planFilters:Pm,togglePlanStatus:n=>e(r=>({planFilters:{...r.planFilters,statuses:r.planFilters.statuses.includes(n)?r.planFilters.statuses.filter(s=>s!==n):[...r.planFilters.statuses,n]}})),togglePlanTag:n=>e(r=>({planFilters:{...r.planFilters,tags:r.planFilters.tags.includes(n)?r.planFilters.tags.filter(s=>s!==n):[...r.planFilters.tags,n]}})),toggleNoteStatus:n=>e(r=>({planFilters:{...r.planFilters,noteStatuses:r.planFilters.noteStatuses.includes(n)?r.planFilters.noteStatuses.filter(s=>s!==n):[...r.planFilters.noteStatuses,n]}})),setPlanSearch:n=>e(r=>({planFilters:{...r.planFilters,search:n}})),setSubjectFilter:n=>e(r=>({planFilters:{...r.planFilters,subject:n}})),setPlanSortKey:n=>e(r=>({planFilters:{...r.planFilters,sortKey:n}})),togglePlanSortDirection:()=>e(n=>({planFilters:{...n.planFilters,sortDirection:n.planFilters.sortDirection==="asc"?"desc":"asc"}})),detailView:"details",setDetailView:n=>e({detailView:n})}}const IL={horizons:[],statuses:[]},ML=e=>[...new Set(e.links.map(t=>t.status))],Dk=(e,t)=>t.length===0||e.links.some(n=>t.includes(n.status)),Fk=(e,t)=>t.length===0||t.includes(e),w7=(e,t)=>e.horizons.filter(n=>Fk(n.title,t.horizons)).map(n=>({...n,items:n.items.filter(r=>Dk(r,t.statuses))})),b7=(e,t)=>Object.fromEntries(e.horizons.map(n=>[n.title,n.items.filter(r=>Dk(r,t.statuses)).length])),k7=(e,t)=>{const n={};for(const r of e.horizons)if(Fk(r.title,t.horizons))for(const s of r.items)for(const i of ML(s))n[i]=(n[i]??0)+1;return n};function LL(e,t){return{roadmap:null,roadmapLoading:!1,roadmapError:null,loadRoadmap:ct(e,jk,n=>({roadmap:n,roadmapError:null}),n=>({roadmapError:String(n)}),"roadmapLoading"),roadmapFilters:IL,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 DL=async()=>(await fetch(G("/api/status"))).json(),FL=async e=>{await fetch(G(`/api/status/check?name=${e}`),{method:"POST"})},OL=async()=>{await fetch(G("/api/status/fix"),{method:"POST"})},zL=async()=>{const e=await fetch(G("/api/refresh"),{method:"POST"});if(!e.ok)throw new Error(`Failed to drop caches: ${e.statusText}`)};function $L(e,t){return{status:null,refreshing:!1,loadStatus:ct(e,DL,n=>({status:n})),refreshAll:async()=>{e({refreshing:!0});try{await zL().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})}},runCheck:async n=>{try{await FL(n)}catch{}},fixQuality:async()=>{try{await OL()}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 Ck(i);return await Sk(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:ct(e,$M,n=>({consistency:n})),doctor:{findings:[],errorCount:0,warningCount:0},loadDoctor:ct(e,BM,n=>({doctor:n})),gitStatus:null,gitBranch:null,gitAhead:0,gitBehind:0,gitDiverged:!1,gitBranchHygiene:null,loadGitStatus:async()=>{try{const{branch:n,entries:r,ahead:s,behind:i,diverged:o,branchHygiene:a}=await CM();return e({gitStatus:r,gitBranch:n,gitAhead:s,gitBehind:i,gitDiverged:o,gitBranchHygiene:a}),!0}catch{return!1}},capabilities:[],loadCapabilities:ct(e,_k,n=>({capabilities:n??[]}),()=>({capabilities:[]}))}}function BL(e,t){return{suggestions:[],suggestionsLoading:!0,loadSuggestions:ct(e,LM,n=>({suggestions:n.entries}),()=>({suggestions:[]}),"suggestionsLoading"),promoteSuggestion:async n=>{const{id:r}=await DM(n);return await Promise.all([t().loadSuggestions(),t().loadPlans(),t().loadIdeas()]),r},dismissSuggestion:async n=>{await FM(n),await t().loadSuggestions()},promoteRoadmapItem:async(n,r,s,i)=>{const{id:o}=await zM(n,r,s,i);return await Promise.all([t().loadPlans(),t().loadIdeas()]),o},launchPrioritise:async()=>{const n=await HM();return await t().refreshAll(),n}}}function VL(e){return{taskLog:[],taskLogLoading:!0,loadTaskLog:ct(e,MM,t=>({taskLog:t.entries}),()=>({taskLog:[]}),"taskLogLoading")}}const D=tM()((e,t)=>({...AL(e),...LL(e),...eL(e,t),...BL(e,t),...VL(e),...ZM(e,t),...$L(e,t),...SM(e,t),...IM(e,t),...nL(e),...tL(e,t)})),Cu=e=>e.agentStatus.some(t=>t.status!=="done"&&t.status!=="error"),Zr=e=>e.capabilities.length===0||e.capabilities.some(t=>t.id.startsWith("agent:")&&t.status==="ok"),UL=e=>{const t=e.capabilities.find(n=>n.id==="gh");return t===void 0||t.status==="ok"},WL=e=>e.capabilities.filter(t=>t.status!=="ok").length,HL=e=>{var t;return((t=e.agentAuthStatus)==null?void 0:t.loggedIn)===!1},GL=e=>{var t;return((t=e.agentStatus.find(n=>n.rateLimit))==null?void 0:t.rateLimit)??null};function KL(e){return e.includes("running")?"running":e.includes("fail")?"fail":e.every(t=>t==="stale")?"stale":"pass"}function Tm(e){var t,n,r,s;return{qualityStatus:KL([((t=e==null?void 0:e.lint)==null?void 0:t.status)??"stale",((n=e==null?void 0:e.format)==null?void 0:n.status)??"stale"]),testStatus:((r=e==null?void 0:e.test)==null?void 0:r.status)??"stale",consistencyStatus:((s=e==null?void 0:e.consistency)==null?void 0:s.status)??"stale"}}function Ok(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=Ok(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function qL(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=Ok(e))&&(r&&(r+=" "),r+=t);return r}const Nm="-",QL=e=>{const t=XL(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const a=o.split(Nm);return a[0]===""&&a.length!==1&&a.shift(),zk(a,t)||YL(o)},getConflictingClassGroupIds:(o,a)=>{const l=n[o]||[];return a&&r[o]?[...l,...r[o]]:l}}},zk=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?zk(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const i=e.join(Nm);return(o=t.validators.find(({validator:a})=>a(i)))==null?void 0:o.classGroupId},ev=/^\[(.+)\]$/,YL=e=>{if(ev.test(e)){const t=ev.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},XL=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return ZL(Object.entries(e.classGroups),n).forEach(([i,o])=>{Th(o,r,i,t)}),r},Th=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const i=s===""?t:tv(t,s);i.classGroupId=n;return}if(typeof s=="function"){if(JL(s)){Th(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([i,o])=>{Th(o,tv(t,i),n,r)})})},tv=(e,t)=>{let n=e;return t.split(Nm).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},JL=e=>e.isThemeGetter,ZL=(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,eD=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)}}},$k="!",tD=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 v=0;v<a.length;v++){let g=a[v];if(c===0){if(g===s&&(r||a.slice(v,v+i)===t)){l.push(a.slice(u,v)),u=v+i;continue}if(g==="/"){f=v;continue}}g==="["?c++:g==="]"&&c--}const p=l.length===0?a:a.substring(u),h=p.startsWith($k),m=h?p.substring(1):p,y=f&&f>u?f-u:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:y}};return n?a=>n({className:a,parseClassName:o}):o},nD=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},rD=e=>({cache:eD(e.cacheSize),parseClassName:tD(e),...QL(e)}),sD=/\s+/,iD=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,i=[],o=e.trim().split(sD);let a="";for(let l=o.length-1;l>=0;l-=1){const c=o[l],{modifiers:u,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:h}=n(c);let m=!!h,y=r(m?p.substring(0,h):p);if(!y){if(!m){a=c+(a.length>0?" "+a:a);continue}if(y=r(p),!y){a=c+(a.length>0?" "+a:a);continue}m=!1}const v=nD(u).join(":"),g=f?v+$k:v,x=g+y;if(i.includes(x))continue;i.push(x);const w=s(y,m);for(let k=0;k<w.length;++k){const j=w[k];i.push(g+j)}a=c+(a.length>0?" "+a:a)}return a};function oD(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Bk(t))&&(r&&(r+=" "),r+=n);return r}const Bk=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Bk(e[r]))&&(n&&(n+=" "),n+=t);return n};function aD(e,...t){let n,r,s,i=o;function o(l){const c=t.reduce((u,f)=>f(u),e());return n=rD(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=iD(l,n);return s(l,u),u}return function(){return i(oD.apply(null,arguments))}}const ke=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Vk=/^\[(?:([a-z-]+):)?(.+)\]$/i,lD=/^\d+\/\d+$/,cD=new Set(["px","full","screen"]),uD=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,dD=/\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$/,fD=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,hD=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,pD=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Un=e=>_i(e)||cD.has(e)||lD.test(e),ur=e=>Ui(e,"length",kD),_i=e=>!!e&&!Number.isNaN(Number(e)),zd=e=>Ui(e,"number",_i),mo=e=>!!e&&Number.isInteger(Number(e)),mD=e=>e.endsWith("%")&&_i(e.slice(0,-1)),ne=e=>Vk.test(e),dr=e=>uD.test(e),gD=new Set(["length","size","percentage"]),yD=e=>Ui(e,gD,Uk),xD=e=>Ui(e,"position",Uk),vD=new Set(["image","url"]),wD=e=>Ui(e,vD,SD),bD=e=>Ui(e,"",_D),go=()=>!0,Ui=(e,t,n)=>{const r=Vk.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},kD=e=>dD.test(e)&&!fD.test(e),Uk=()=>!1,_D=e=>hD.test(e),SD=e=>pD.test(e),CD=()=>{const e=ke("colors"),t=ke("spacing"),n=ke("blur"),r=ke("brightness"),s=ke("borderColor"),i=ke("borderRadius"),o=ke("borderSpacing"),a=ke("borderWidth"),l=ke("contrast"),c=ke("grayscale"),u=ke("hueRotate"),f=ke("invert"),p=ke("gap"),h=ke("gradientColorStops"),m=ke("gradientColorStopPositions"),y=ke("inset"),v=ke("margin"),g=ke("opacity"),x=ke("padding"),w=ke("saturate"),k=ke("scale"),j=ke("sepia"),_=ke("skew"),S=ke("space"),E=ke("translate"),T=()=>["auto","contain","none"],P=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto",ne,t],I=()=>[ne,t],O=()=>["",Un,ur],M=()=>["auto",_i,ne],N=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],z=()=>["solid","dashed","dotted","double","none"],V=()=>["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"],B=()=>["","0",ne],C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],$=()=>[_i,ne];return{cacheSize:500,separator:":",theme:{colors:[go],spacing:[Un,ur],blur:["none","",dr,ne],brightness:$(),borderColor:[e],borderRadius:["none","","full",dr,ne],borderSpacing:I(),borderWidth:O(),contrast:$(),grayscale:B(),hueRotate:$(),invert:B(),gap:I(),gradientColorStops:[e],gradientColorStopPositions:[mD,ur],inset:A(),margin:A(),opacity:$(),padding:I(),saturate:$(),scale:$(),sepia:B(),skew:$(),space:I(),translate:I()},classGroups:{aspect:[{aspect:["auto","square","video",ne]}],container:["container"],columns:[{columns:[dr]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"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:[...N(),ne]}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",mo,ne]}],basis:[{basis:A()}],"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:B()}],shrink:[{shrink:B()}],order:[{order:["first","last","none",mo,ne]}],"grid-cols":[{"grid-cols":[go]}],"col-start-end":[{col:["auto",{span:["full",mo,ne]},ne]}],"col-start":[{"col-start":M()}],"col-end":[{"col-end":M()}],"grid-rows":[{"grid-rows":[go]}],"row-start-end":[{row:["auto",{span:[mo,ne]},ne]}],"row-start":[{"row-start":M()}],"row-end":[{"row-end":M()}],"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:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"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:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[S]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[S]}],"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:[dr]},dr]}],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",dr,ur]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",zd]}],"font-family":[{font:[go]}],"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",_i,zd]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Un,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":[g]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[g]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...z(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Un,ur]}],"underline-offset":[{"underline-offset":["auto",Un,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":[g]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...N(),xD]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",yD]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},wD]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],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":[g]}],"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":[g]}],"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":[Un,ne]}],"outline-w":[{outline:[Un,ur]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:O()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[Un,ur]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",dr,bD]}],"shadow-color":[{shadow:[go]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...V(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":V()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",dr,ne]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[f]}],saturate:[{saturate:[w]}],sepia:[{sepia:[j]}],"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":[g]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[j]}],"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:$()}],ease:[{ease:["linear","in","out","in-out",ne]}],delay:[{delay:$()}],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:[mo,ne]}],"translate-x":[{"translate-x":[E]}],"translate-y":[{"translate-y":[E]}],"skew-x":[{"skew-x":[_]}],"skew-y":[{"skew-y":[_]}],"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:[Un,ur,zd]}],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"]}}},jD=aD(CD);function $d(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 PD(e,t){return e[0]===t[0]&&e[1]===t[1]}function ED(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)$d(c,a,s);const l=function(c,u,f){const p=[];for(const x of c){const w=[...x];PD(w[0],w[w.length-1])||w.push([w[0][0],w[0][1]]),w.length>2&&p.push(w)}const h=[];u=Math.max(u,.1);const m=[];for(const x of p)for(let w=0;w<x.length-1;w++){const k=x[w],j=x[w+1];if(k[1]!==j[1]){const _=Math.min(k[1],j[1]);m.push({ymin:_,ymax:Math.max(k[1],j[1]),x:_===k[1]?k[0]:j[0],islope:(j[0]-k[0])/(j[1]-k[1])})}}if(m.sort((x,w)=>x.ymin<w.ymin?-1:x.ymin>w.ymin?1:x.x<w.x?-1:x.x>w.x?1:x.ymax===w.ymax?0:(x.ymax-w.ymax)/Math.abs(x.ymax-w.ymax)),!m.length)return h;let y=[],v=m[0].ymin,g=0;for(;y.length||m.length;){if(m.length){let x=-1;for(let w=0;w<m.length&&!(m[w].ymin>v);w++)x=w;m.splice(0,x+1).forEach(w=>{y.push({s:v,edge:w})})}if(y=y.filter(x=>!(x.edge.ymax<=v)),y.sort((x,w)=>x.edge.x===w.edge.x?0:(x.edge.x-w.edge.x)/Math.abs(x.edge.x-w.edge.x)),(f!==1||g%u==0)&&y.length>1)for(let x=0;x<y.length;x+=2){const w=x+1;if(w>=y.length)break;const k=y[x].edge,j=y[w].edge;h.push([[Math.round(k.x),v],[Math.round(j.x),v]])}v+=f,y.forEach(x=>{x.edge.x=x.edge.x+f*x.edge.islope}),g++}return h}(o,i,r);if(s){for(const c of o)$d(c,a,-s);(function(c,u,f){const p=[];c.forEach(h=>p.push(...h)),$d(p,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),ED(e,s,r,i||1)}class Rm{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 ju(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 TD extends Rm{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)ju([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 ND extends Rm{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 RD{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=ju(a),c=l/s,u=Math.ceil(c)-1,f=l-u*s,p=(a[0][0]+a[1][0])/2-s/4,h=Math.min(a[0][1],a[1][1]);for(let m=0;m<u;m++){const y=h+f+m*s,v=p-o+2*Math.random()*o,g=y-o+2*Math.random()*o,x=this.helper.ellipse(v,g,i,i,n);r.push(...x.ops)}}return{type:"fillSketch",ops:r}}}class AD{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=ju(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 p=Math.atan((f[1]-u[1])/(f[0]-u[0]));for(let h=0;h<l;h++){const m=h*(r+s),y=m+r,v=[u[0]+m*Math.cos(p)+c*Math.cos(p),u[1]+m*Math.sin(p)+c*Math.sin(p)],g=[u[0]+y*Math.cos(p)+c*Math.cos(p),u[1]+y*Math.sin(p)+c*Math.sin(p)];i.push(...this.helper.doubleLineOps(v[0],v[1],g[0],g[1],n))}}),i}}class ID{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=ju(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 p=2*f*n,h=2*(f+1)*n,m=Math.sqrt(2*Math.pow(n,2)),y=[l[0]+p*Math.cos(u),l[1]+p*Math.sin(u)],v=[l[0]+h*Math.cos(u),l[1]+h*Math.sin(u)],g=[y[0]+m*Math.cos(u+Math.PI/4),y[1]+m*Math.sin(u+Math.PI/4)];s.push(...this.helper.doubleLineOps(y[0],y[1],g[0],g[1],r),...this.helper.doubleLineOps(g[0],g[1],v[0],v[1],r))}}),s}}const mt={};class MD{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const LD=0,Bd=1,nv=2,pl={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 Vd(e,t){return e.type===t}function Am(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:LD,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:Bd,text:`${parseFloat(RegExp.$1)}`},o=o.substr(RegExp.$1.length)}return a[a.length]={type:nv,text:""},a}(e);let r="BOD",s=0,i=n[s];for(;!Vd(i,nv);){let o=0;const a=[];if(r==="BOD"){if(i.text!=="M"&&i.text!=="m")return Am("M0,0"+e);s++,o=pl[i.text],r=i.text}else Vd(i,Bd)?o=pl[r]:(s++,o=pl[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(!Vd(c,Bd))throw new Error("Param not a number: "+r+","+c.text);a[a.length]=+c.text}if(typeof pl[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 Wk(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 Hk(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,p=0;n==="C"||n==="S"?(f=r+(r-a),p=s+(s-l)):(f=r,p=s),t.push({key:"C",data:[f,p,...u]}),a=u[0],l=u[1],r=u[2],s=u[3];break}case"T":{const[f,p]=u;let h=0,m=0;n==="Q"||n==="T"?(h=r+(r-a),m=s+(s-l)):(h=r,m=s);const y=r+2*(h-r)/3,v=s+2*(m-s)/3,g=f+2*(h-f)/3,x=p+2*(m-p)/3;t.push({key:"C",data:[y,v,g,x,f,p]}),a=h,l=m,r=f,s=p;break}case"Q":{const[f,p,h,m]=u,y=r+2*(f-r)/3,v=s+2*(p-s)/3,g=h+2*(f-h)/3,x=m+2*(p-m)/3;t.push({key:"C",data:[y,v,g,x,h,m]}),a=f,l=p,r=h,s=m;break}case"A":{const f=Math.abs(u[0]),p=Math.abs(u[1]),h=u[2],m=u[3],y=u[4],v=u[5],g=u[6];f===0||p===0?(t.push({key:"C",data:[r,s,v,g,v,g]}),r=v,s=g):(r!==v||s!==g)&&(Gk(r,s,v,g,f,p,h,m,y).forEach(function(x){t.push({key:"C",data:x})}),r=v,s=g);break}case"Z":t.push({key:"Z",data:[]}),r=i,s=o}n=c}return t}function yo(e,t,n){return[e*Math.cos(n)-t*Math.sin(n),e*Math.sin(n)+t*Math.cos(n)]}function Gk(e,t,n,r,s,i,o,a,l,c){const u=(f=o,Math.PI*f/180);var f;let p=[],h=0,m=0,y=0,v=0;if(c)[h,m,y,v]=c;else{[e,t]=yo(e,t,-u),[n,r]=yo(n,r,-u);const O=(e-n)/2,M=(t-r)/2;let N=O*O/(s*s)+M*M/(i*i);N>1&&(N=Math.sqrt(N),s*=N,i*=N);const z=s*s,V=i*i,L=z*V-z*M*M-V*O*O,B=z*M*M+V*O*O,C=(a===l?-1:1)*Math.sqrt(Math.abs(L/B));y=C*s*M/i+(e+n)/2,v=C*-i*O/s+(t+r)/2,h=Math.asin(parseFloat(((t-v)/i).toFixed(9))),m=Math.asin(parseFloat(((r-v)/i).toFixed(9))),e<y&&(h=Math.PI-h),n<y&&(m=Math.PI-m),h<0&&(h=2*Math.PI+h),m<0&&(m=2*Math.PI+m),l&&h>m&&(h-=2*Math.PI),!l&&m>h&&(m-=2*Math.PI)}let g=m-h;if(Math.abs(g)>120*Math.PI/180){const O=m,M=n,N=r;m=l&&m>h?h+120*Math.PI/180*1:h+120*Math.PI/180*-1,p=Gk(n=y+s*Math.cos(m),r=v+i*Math.sin(m),M,N,s,i,o,0,l,[m,O,y,v])}g=m-h;const x=Math.cos(h),w=Math.sin(h),k=Math.cos(m),j=Math.sin(m),_=Math.tan(g/4),S=4/3*s*_,E=4/3*i*_,T=[e,t],P=[e+S*w,t-E*x],A=[n+S*j,r-E*k],I=[n,r];if(P[0]=2*T[0]-P[0],P[1]=2*T[1]-P[1],c)return[P,A,I].concat(p);{p=[P,A,I].concat(p);const O=[];for(let M=0;M<p.length;M+=3){const N=yo(p[M][0],p[M][1],u),z=yo(p[M+1][0],p[M+1][1],u),V=yo(p[M+2][0],p[M+2][1],u);O.push([N[0],N[1],z[0],z[1],V[0],V[1]])}return O}}const DD={randOffset:function(e,t){return X(e,t)},randOffsetWithRange:function(e,t,n){return Oc(e,t,n)},ellipse:function(e,t,n,r,s){const i=qk(n,r,s);return Nh(e,t,s,i).opset},doubleLineOps:function(e,t,n,r,s){return Ur(e,t,n,r,s,!0)}};function Kk(e,t,n,r,s){return{type:"path",ops:Ur(e,t,n,r,s)}}function Ql(e,t,n){const r=(e||[]).length;if(r>2){const s=[];for(let i=0;i<r-1;i++)s.push(...Ur(e[i][0],e[i][1],e[i+1][0],e[i+1][1],n));return t&&s.push(...Ur(e[r-1][0],e[r-1][1],e[0][0],e[0][1],n)),{type:"path",ops:s}}return r===2?Kk(e[0][0],e[0][1],e[1][0],e[1][1],n):{type:"path",ops:[]}}function FD(e,t,n,r,s){return function(i,o){return Ql(i,!0,o)}([[e,t],[e+n,t],[e+n,t+r],[e,t+r]],s)}function rv(e,t){if(e.length){const n=typeof e[0][0]=="number"?[e]:e,r=ml(n[0],1*(1+.2*t.roughness),t),s=t.disableMultiStroke?[]:ml(n[0],1.5*(1+.22*t.roughness),ov(t));for(let i=1;i<n.length;i++){const o=n[i];if(o.length){const a=ml(o,1*(1+.2*t.roughness),t),l=t.disableMultiStroke?[]:ml(o,1.5*(1+.22*t.roughness),ov(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 qk(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 Nh(e,t,n,r){const[s,i]=av(r.increment,e,t,r.rx,r.ry,1,r.increment*Oc(.1,Oc(.4,1,n),n),n);let o=zc(s,null,n);if(!n.disableMultiStroke&&n.roughness!==0){const[a]=av(r.increment,e,t,r.rx,r.ry,1.5,0,n),l=zc(a,null,n);o=o.concat(l)}return{estimatedPoints:i,opset:{type:"path",ops:o}}}function sv(e,t,n,r,s,i,o,a,l){const c=e,u=t;let f=Math.abs(n/2),p=Math.abs(r/2);f+=X(.01*f,l),p+=X(.01*p,l);let h=s,m=i;for(;h<0;)h+=2*Math.PI,m+=2*Math.PI;m-h>2*Math.PI&&(h=0,m=2*Math.PI);const y=2*Math.PI/l.curveStepCount,v=Math.min(y/2,(m-h)/2),g=lv(v,c,u,f,p,h,m,1,l);if(!l.disableMultiStroke){const x=lv(v,c,u,f,p,h,m,1.5,l);g.push(...x)}return o&&(a?g.push(...Ur(c,u,c+f*Math.cos(h),u+p*Math.sin(h),l),...Ur(c,u,c+f*Math.cos(m),u+p*Math.sin(m),l)):g.push({op:"lineTo",data:[c,u]},{op:"lineTo",data:[c+f*Math.cos(h),u+p*Math.sin(h)]})),{type:"path",ops:g}}function iv(e,t){const n=Hk(Wk(Am(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(...Ur(i[0],i[1],a[0],a[1],t)),i=[a[0],a[1]];break;case"C":{const[l,c,u,f,p,h]=a;r.push(...OD(l,c,u,f,p,h,i,t)),i=[p,h];break}case"Z":r.push(...Ur(i[0],i[1],s[0],s[1],t)),i=[s[0],s[1]]}return{type:"path",ops:r}}function Ud(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 Gs(e,t){return function(n,r){let s=n.fillStyle||"hachure";if(!mt[s])switch(s){case"zigzag":mt[s]||(mt[s]=new TD(r));break;case"cross-hatch":mt[s]||(mt[s]=new ND(r));break;case"dots":mt[s]||(mt[s]=new RD(r));break;case"dashed":mt[s]||(mt[s]=new AD(r));break;case"zigzag-line":mt[s]||(mt[s]=new ID(r));break;default:s="hachure",mt[s]||(mt[s]=new Rm(r))}return mt[s]}(t,DD).fillPolygons(e,t)}function ov(e){const t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function Qk(e){return e.randomizer||(e.randomizer=new MD(e.seed||0)),e.randomizer.next()}function Oc(e,t,n,r=1){return n.roughness*r*(Qk(n)*(t-e)+e)}function X(e,t,n=1){return Oc(-e,e,t,n)}function Ur(e,t,n,r,s,i=!1){const o=i?s.disableMultiStrokeFill:s.disableMultiStroke,a=Rh(e,t,n,r,s,!0,!1);if(o)return a;const l=Rh(e,t,n,r,s,!0,!0);return a.concat(l)}function Rh(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,p=.2+.2*Qk(s);let h=s.bowing*s.maxRandomnessOffset*(r-t)/200,m=s.bowing*s.maxRandomnessOffset*(e-n)/200;h=X(h,s,c),m=X(m,s,c);const y=[],v=()=>X(f,s,c),g=()=>X(u,s,c),x=s.preserveVertices;return o?y.push({op:"move",data:[e+(x?0:v()),t+(x?0:v())]}):y.push({op:"move",data:[e+(x?0:X(u,s,c)),t+(x?0:X(u,s,c))]}),o?y.push({op:"bcurveTo",data:[h+e+(n-e)*p+v(),m+t+(r-t)*p+v(),h+e+2*(n-e)*p+v(),m+t+2*(r-t)*p+v(),n+(x?0:v()),r+(x?0:v())]}):y.push({op:"bcurveTo",data:[h+e+(n-e)*p+g(),m+t+(r-t)*p+g(),h+e+2*(n-e)*p+g(),m+t+2*(r-t)*p+g(),n+(x?0:g()),r+(x?0:g())]}),y}function ml(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 zc(r,null,n)}function zc(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(...Rh(e[0][0],e[0][1],e[1][0],e[1][1],n,!0,!0));return s}function av(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 p=u;p<f;p+=e){const h=[X(i,a)+t+r*Math.cos(p),X(i,a)+n+s*Math.sin(p)];l.push(h),c.push(h)}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 lv(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)]),zc(u,null,l)}function OD(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,p=a.preserveVertices;for(let h=0;h<f;h++)h===0?l.push({op:"move",data:[o[0],o[1]]}):l.push({op:"move",data:[o[0]+(p?0:X(c[0],a)),o[1]+(p?0:X(c[0],a))]}),u=p?[s,i]:[s+X(c[h],a),i+X(c[h],a)],l.push({op:"bcurveTo",data:[e+X(c[h],a),t+X(c[h],a),n+X(c[h],a),r+X(c[h],a),u[0],u[1]]});return l}function xo(e){return[...e]}function cv(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(xo(e[0]),xo(e[1]),xo(e[2]),xo(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(xo(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 Yl(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function zD(e,t,n){const r=Yl(t,n);if(r===0)return Yl(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)),Yl(e,us(t,n,s))}function us(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function Ah(e,t,n,r){const s=r||[];if(function(a,l){const c=a[l+0],u=a[l+1],f=a[l+2],p=a[l+3];let h=3*u[0]-2*c[0]-p[0];h*=h;let m=3*u[1]-2*c[1]-p[1];m*=m;let y=3*f[0]-2*p[0]-c[0];y*=y;let v=3*f[1]-2*p[1]-c[1];return v*=v,h<y&&(h=y),m<v&&(m=v),h+m}(e,t)<n){const a=e[t+0];s.length?(i=s[s.length-1],o=a,Math.sqrt(Yl(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],p=us(l,c,.5),h=us(c,u,.5),m=us(u,f,.5),y=us(p,h,.5),v=us(h,m,.5),g=us(y,v,.5);Ah([l,p,y,g],0,n,s),Ah([g,v,m,f],0,n,s)}var i,o;return s}function $D(e,t){return $c(e,0,e.length,t)}function $c(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=zD(e[u],o,a);f>l&&(l=f,c=u)}return Math.sqrt(l)>r?($c(e,t,c+1,r,i),$c(e,c,n,r,i)):(i.length||i.push(o),i.push(a)),i}function Wd(e,t=.15,n){const r=[],s=(e.length-1)/3;for(let i=0;i<s;i++)Ah(e,3*i,t,r);return n&&n>0?$c(r,0,r.length,n):r}const Nt="none";let Bc=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",[Kk(t,n,r,s,o)],o)}rectangle(t,n,r,s,i){const o=this._o(i),a=[],l=FD(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(Ud([c],o)):a.push(Gs([c],o))}return o.stroke!==Nt&&a.push(l),this._d("rectangle",a,o)}ellipse(t,n,r,s,i){const o=this._o(i),a=[],l=qk(r,s,o),c=Nh(t,n,o,l);if(o.fill)if(o.fillStyle==="solid"){const u=Nh(t,n,o,l).opset;u.type="fillPath",a.push(u)}else a.push(Gs([c.estimatedPoints],o));return o.stroke!==Nt&&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",[Ql(t,!1,r)],r)}arc(t,n,r,s,i,o,a=!1,l){const c=this._o(l),u=[],f=sv(t,n,r,s,i,o,a,!0,c);if(a&&c.fill)if(c.fillStyle==="solid"){const p=Object.assign({},c);p.disableMultiStroke=!0;const h=sv(t,n,r,s,i,o,!0,!1,p);h.type="fillPath",u.push(h)}else u.push(function(p,h,m,y,v,g,x){const w=p,k=h;let j=Math.abs(m/2),_=Math.abs(y/2);j+=X(.01*j,x),_+=X(.01*_,x);let S=v,E=g;for(;S<0;)S+=2*Math.PI,E+=2*Math.PI;E-S>2*Math.PI&&(S=0,E=2*Math.PI);const T=(E-S)/x.curveStepCount,P=[];for(let A=S;A<=E;A+=T)P.push([w+j*Math.cos(A),k+_*Math.sin(A)]);return P.push([w+j*Math.cos(E),k+_*Math.sin(E)]),P.push([w,k]),Gs([P],x)}(t,n,r,s,i,o,c));return c.stroke!==Nt&&u.push(f),this._d("arc",u,c)}curve(t,n){const r=this._o(n),s=[],i=rv(t,r);if(r.fill&&r.fill!==Nt)if(r.fillStyle==="solid"){const o=rv(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(...Wd(cv([c[0],c[0],c[1],c[2]]),10,(1+r.roughness)/2)):o.push(...Wd(cv(c),10,(1+r.roughness)/2))}o.length&&s.push(Gs([o],r))}return r.stroke!==Nt&&s.push(i),this._d("curve",s,r)}polygon(t,n){const r=this._o(n),s=[],i=Ql(t,!0,r);return r.fill&&(r.fillStyle==="solid"?s.push(Ud([t],r)):s.push(Gs([t],r))),r.stroke!==Nt&&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!==Nt,o=r.stroke!==Nt,a=!!(r.simplification&&r.simplification<1),l=function(u,f,p){const h=Hk(Wk(Am(u))),m=[];let y=[],v=[0,0],g=[];const x=()=>{g.length>=4&&y.push(...Wd(g,f)),g=[]},w=()=>{x(),y.length&&(m.push(y),y=[])};for(const{key:j,data:_}of h)switch(j){case"M":w(),v=[_[0],_[1]],y.push(v);break;case"L":x(),y.push([_[0],_[1]]);break;case"C":if(!g.length){const S=y.length?y[y.length-1]:v;g.push([S[0],S[1]])}g.push([_[0],_[1]]),g.push([_[2],_[3]]),g.push([_[4],_[5]]);break;case"Z":x(),y.push([v[0],v[1]])}if(w(),!p)return m;const k=[];for(const j of m){const _=$D(j,p);_.length&&k.push(_)}return k}(t,1,a?4-4*(r.simplification||1):(1+r.roughness)/2),c=iv(t,r);if(i)if(r.fillStyle==="solid")if(l.length===1){const u=iv(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(Ud(l,r));else s.push(Gs(l,r));return o&&(a?l.forEach(u=>{s.push(Ql(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:Nt};break;case"fillPath":o={d:this.opsToPath(i),stroke:Nt,strokeWidth:0,fill:r.fill||Nt};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||Nt,strokeWidth:r,fill:Nt}}_mergedShape(t){return t.filter((n,r)=>r===0||n.op!=="move")}},BD=class{constructor(t,n){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new Bc(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 gl="http://www.w3.org/2000/svg";class VD{constructor(t,n){this.svg=t,this.gen=new Bc(n)}draw(t){const n=t.sets||[],r=t.options||this.getDefaultOptions(),s=this.svg.ownerDocument||window.document,i=s.createElementNS(gl,"g"),o=t.options.fixedDecimalPlaceDigits;for(const a of n){let l=null;switch(a.type){case"path":l=s.createElementNS(gl,"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(gl,"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(gl,"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 UD={canvas:(e,t)=>new BD(e,t),svg:(e,t)=>new VD(e,t),generator:e=>new Bc(e),newSeed:()=>Bc.newSeed()};const Im=b.createContext({});function Mm(e){const t=b.useRef(null);return t.current===null&&(t.current=e()),t.current}const WD=typeof window<"u",Yk=WD?b.useLayoutEffect:b.useEffect,Pu=b.createContext(null);function Lm(e,t){e.indexOf(t)===-1&&e.push(t)}function Vc(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const On=(e,t,n)=>n>t?t:n<e?e:n;let Dm=()=>{};const Wr={},Xk=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Jk=e=>typeof e=="object"&&e!==null,Zk=e=>/^0[^.\s]+$/u.test(e);function e_(e){let t;return()=>(t===void 0&&(t=e()),t)}const nn=e=>e,Ra=(...e)=>e.reduce((t,n)=>r=>n(t(r))),ya=(e,t,n)=>{const r=t-e;return r?(n-e)/r:1};class Fm{constructor(){this.subscriptions=[]}add(t){return Lm(this.subscriptions,t),()=>Vc(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 Ft=e=>e*1e3,en=e=>e/1e3,t_=(e,t)=>t?e*(1e3/t):0,n_=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,HD=1e-7,GD=12;function KD(e,t,n,r,s){let i,o,a=0;do o=t+(n-t)/2,i=n_(o,r,s)-e,i>0?n=o:t=o;while(Math.abs(i)>HD&&++a<GD);return o}function Aa(e,t,n,r){if(e===t&&n===r)return nn;const s=i=>KD(i,0,1,e,n);return i=>i===0||i===1?i:n_(s(i),t,r)}const r_=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,s_=e=>t=>1-e(1-t),i_=Aa(.33,1.53,.69,.99),Om=s_(i_),o_=r_(Om),a_=e=>e>=1?1:(e*=2)<1?.5*Om(e):.5*(2-Math.pow(2,-10*(e-1))),zm=e=>1-Math.sin(Math.acos(e)),l_=s_(zm),c_=r_(zm),qD=Aa(.42,0,1,1),QD=Aa(0,0,.58,1),u_=Aa(.42,0,.58,1),YD=e=>Array.isArray(e)&&typeof e[0]!="number",d_=e=>Array.isArray(e)&&typeof e[0]=="number",XD={linear:nn,easeIn:qD,easeInOut:u_,easeOut:QD,circIn:zm,circInOut:c_,circOut:l_,backIn:Om,backInOut:o_,backOut:i_,anticipate:a_},JD=e=>typeof e=="string",uv=e=>{if(d_(e)){Dm(e.length===4);const[t,n,r,s]=e;return Aa(t,n,r,s)}else if(JD(e))return XD[e];return e},yl=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function ZD(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,p=!1)=>{const m=p&&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 e3=40;function f_(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=yl.reduce((w,k)=>(w[k]=ZD(i),w),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:u,update:f,preRender:p,render:h,postRender:m}=o,y=()=>{const w=Wr.useManualTiming,k=w?s.timestamp:performance.now();n=!1,w||(s.delta=r?1e3/60:Math.max(Math.min(k-s.timestamp,e3),1)),s.timestamp=k,s.isProcessing=!0,a.process(s),l.process(s),c.process(s),u.process(s),f.process(s),p.process(s),h.process(s),m.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(y))},v=()=>{n=!0,r=!0,s.isProcessing||e(y)};return{schedule:yl.reduce((w,k)=>{const j=o[k];return w[k]=(_,S=!1,E=!1)=>(n||v(),j.schedule(_,S,E)),w},{}),cancel:w=>{for(let k=0;k<yl.length;k++)o[yl[k]].cancel(w)},state:s,steps:o}}const{schedule:xe,cancel:Hr,state:Ye,steps:Hd}=f_(typeof requestAnimationFrame<"u"?requestAnimationFrame:nn,!0);let Xl;function t3(){Xl=void 0}const ut={now:()=>(Xl===void 0&&ut.set(Ye.isProcessing||Wr.useManualTiming?Ye.timestamp:performance.now()),Xl),set:e=>{Xl=e,queueMicrotask(t3)}},h_=e=>t=>typeof t=="string"&&t.startsWith(e),p_=h_("--"),n3=h_("var(--"),$m=e=>n3(e)?r3.test(e.split("/*")[0].trim()):!1,r3=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function dv(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Wi={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},xa={...Wi,transform:e=>On(0,1,e)},xl={...Wi,default:1},Ho=e=>Math.round(e*1e5)/1e5,Bm=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function s3(e){return e==null}const i3=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Vm=(e,t)=>n=>!!(typeof n=="string"&&i3.test(n)&&n.startsWith(e)||t&&!s3(n)&&Object.prototype.hasOwnProperty.call(n,t)),m_=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,a]=r.match(Bm);return{[e]:parseFloat(s),[t]:parseFloat(i),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},o3=e=>On(0,255,e),Gd={...Wi,transform:e=>Math.round(o3(e))},vs={test:Vm("rgb","red"),parse:m_("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Gd.transform(e)+", "+Gd.transform(t)+", "+Gd.transform(n)+", "+Ho(xa.transform(r))+")"};function a3(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 Ih={test:Vm("#"),parse:a3,transform:vs.transform},Ia=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Gn=Ia("deg"),Dn=Ia("%"),q=Ia("px"),l3=Ia("vh"),c3=Ia("vw"),fv={...Dn,parse:e=>Dn.parse(e)/100,transform:e=>Dn.transform(e*100)},fi={test:Vm("hsl","hue"),parse:m_("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Dn.transform(Ho(t))+", "+Dn.transform(Ho(n))+", "+Ho(xa.transform(r))+")"},ze={test:e=>vs.test(e)||Ih.test(e)||fi.test(e),parse:e=>vs.test(e)?vs.parse(e):fi.test(e)?fi.parse(e):Ih.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?vs.transform(e):fi.transform(e),getAnimatableNone:e=>{const t=ze.parse(e);return t.alpha=0,ze.transform(t)}},u3=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function d3(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Bm))==null?void 0:t.length)||0)+(((n=e.match(u3))==null?void 0:n.length)||0)>0}const g_="number",y_="color",f3="var",h3="var(",hv="${}",p3=/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 Li(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const a=t.replace(p3,l=>(ze.test(l)?(r.color.push(i),s.push(y_),n.push(ze.parse(l))):l.startsWith(h3)?(r.var.push(i),s.push(f3),n.push(l)):(r.number.push(i),s.push(g_),n.push(parseFloat(l))),++i,hv)).split(hv);return{values:n,split:a,indexes:r,types:s}}function m3(e){return Li(e).values}function x_({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===g_?s+=Ho(r[i]):o===y_?s+=ze.transform(r[i]):s+=r[i]}return s}}function g3(e){return x_(Li(e))}const y3=e=>typeof e=="number"?0:ze.test(e)?ze.getAnimatableNone(e):e,x3=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:y3(e);function v3(e){const t=Li(e);return x_(t)(t.values.map((r,s)=>x3(r,t.split[s])))}const xn={test:d3,parse:m3,createTransformer:g3,getAnimatableNone:v3};function Kd(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 w3({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=Kd(l,a,e+1/3),i=Kd(l,a,e),o=Kd(l,a,e-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function Uc(e,t){return n=>n>0?t:e}const ye=(e,t,n)=>e+(t-e)*n,qd=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},b3=[Ih,vs,fi],k3=e=>b3.find(t=>t.test(e));function pv(e){const t=k3(e);if(!t)return!1;let n=t.parse(e);return t===fi&&(n=w3(n)),n}const mv=(e,t)=>{const n=pv(e),r=pv(t);if(!n||!r)return Uc(e,t);const s={...n};return i=>(s.red=qd(n.red,r.red,i),s.green=qd(n.green,r.green,i),s.blue=qd(n.blue,r.blue,i),s.alpha=ye(n.alpha,r.alpha,i),vs.transform(s))},Mh=new Set(["none","hidden"]);function _3(e,t){return Mh.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function S3(e,t){return n=>ye(e,t,n)}function Um(e){return typeof e=="number"?S3:typeof e=="string"?$m(e)?Uc:ze.test(e)?mv:P3:Array.isArray(e)?v_:typeof e=="object"?ze.test(e)?mv:C3:Uc}function v_(e,t){const n=[...e],r=n.length,s=e.map((i,o)=>Um(i)(i,t[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function C3(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=Um(e[s])(e[s],t[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function j3(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 P3=(e,t)=>{const n=xn.createTransformer(t),r=Li(e),s=Li(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?Mh.has(e)&&!s.values.length||Mh.has(t)&&!r.values.length?_3(e,t):Ra(v_(j3(r,s),s.values),n):Uc(e,t)};function w_(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?ye(e,t,n):Um(e)(e,t)}const E3=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>xe.update(t,n),stop:()=>Hr(t),now:()=>Ye.isProcessing?Ye.timestamp:ut.now()}},b_=(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)})`},Wc=2e4;function Wm(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Wc;)t+=n,r=e.next(t);return t>=Wc?1/0:t}function T3(e,t=100,n){const r=n({...e,keyframes:[0,t]}),s=Math.min(Wm(r),Wc);return{type:"keyframes",ease:i=>r.next(s*i).value/t,duration:en(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 Lh(e,t){return e*Math.sqrt(1-t*t)}const N3=12;function R3(e,t,n){let r=n;for(let s=1;s<N3;s++)r=r-e(r)/t(r);return r}const Qd=.001;function A3({duration:e=Ie.duration,bounce:t=Ie.bounce,velocity:n=Ie.velocity,mass:r=Ie.mass}){let s,i,o=1-t;o=On(Ie.minDamping,Ie.maxDamping,o),e=On(Ie.minDuration,Ie.maxDuration,en(e)),o<1?(s=c=>{const u=c*o,f=u*e,p=u-n,h=Lh(c,o),m=Math.exp(-f);return Qd-p/h*m},i=c=>{const f=c*o*e,p=f*n+n,h=Math.pow(o,2)*Math.pow(c,2)*e,m=Math.exp(-f),y=Lh(Math.pow(c,2),o);return(-s(c)+Qd>0?-1:1)*((p-h)*m)/y}):(s=c=>{const u=Math.exp(-c*e),f=(c-n)*e+1;return-Qd+u*f},i=c=>{const u=Math.exp(-c*e),f=(n-c)*(e*e);return u*f});const a=5/e,l=R3(s,i,a);if(e=Ft(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 I3=["duration","bounce"],M3=["stiffness","damping","mass"];function gv(e,t){return t.some(n=>e[n]!==void 0)}function L3(e){let t={velocity:Ie.velocity,stiffness:Ie.stiffness,damping:Ie.damping,mass:Ie.mass,isResolvedFromDuration:!1,...e};if(!gv(e,M3)&&gv(e,I3))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*On(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:Ie.mass,stiffness:s,damping:i}}else{const n=A3({...e,velocity:0});t={...t,...n,mass:Ie.mass},t.isResolvedFromDuration=!0}return t}function Hc(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:p,isResolvedFromDuration:h}=L3({...n,velocity:-en(n.velocity||0)}),m=p||0,y=c/(2*Math.sqrt(l*u)),v=o-i,g=en(Math.sqrt(l/u)),x=Math.abs(v)<5;r||(r=x?Ie.restSpeed.granular:Ie.restSpeed.default),s||(s=x?Ie.restDelta.granular:Ie.restDelta.default);let w,k,j,_,S,E;if(y<1)j=Lh(g,y),_=(m+y*g*v)/j,w=P=>{const A=Math.exp(-y*g*P);return o-A*(_*Math.sin(j*P)+v*Math.cos(j*P))},S=y*g*_+v*j,E=y*g*v-_*j,k=P=>Math.exp(-y*g*P)*(S*Math.sin(j*P)+E*Math.cos(j*P));else if(y===1){w=A=>o-Math.exp(-g*A)*(v+(m+g*v)*A);const P=m+g*v;k=A=>Math.exp(-g*A)*(g*P*A-m)}else{const P=g*Math.sqrt(y*y-1);w=M=>{const N=Math.exp(-y*g*M),z=Math.min(P*M,300);return o-N*((m+y*g*v)*Math.sinh(z)+P*v*Math.cosh(z))/P};const A=(m+y*g*v)/P,I=y*g*A-v*P,O=y*g*v-A*P;k=M=>{const N=Math.exp(-y*g*M),z=Math.min(P*M,300);return N*(I*Math.sinh(z)+O*Math.cosh(z))}}const T={calculatedDuration:h&&f||null,velocity:P=>Ft(k(P)),next:P=>{if(!h&&y<1){const I=Math.exp(-y*g*P),O=Math.sin(j*P),M=Math.cos(j*P),N=o-I*(_*O+v*M),z=Ft(I*(S*O+E*M));return a.done=Math.abs(z)<=r&&Math.abs(o-N)<=s,a.value=a.done?o:N,a}const A=w(P);if(h)a.done=P>=f;else{const I=Ft(k(P));a.done=Math.abs(I)<=r&&Math.abs(o-A)<=s}return a.value=a.done?o:A,a},toString:()=>{const P=Math.min(Wm(T),Wc),A=b_(I=>T.next(P*I).value,P,30);return P+"ms "+A},toTransition:()=>{}};return T}Hc.applyToOptions=e=>{const t=T3(e,100,Hc);return e.ease=t.ease,e.duration=Ft(t.duration),e.type="keyframes",e};const D3=5;function k_(e,t,n){const r=Math.max(t-D3,0);return t_(n-e(r),t-r)}function Dh({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],p={done:!1,value:f},h=E=>a!==void 0&&E<a||l!==void 0&&E>l,m=E=>a===void 0?l:l===void 0||Math.abs(a-E)<Math.abs(l-E)?a:l;let y=n*t;const v=f+y,g=o===void 0?v:o(v);g!==v&&(y=g-f);const x=E=>-y*Math.exp(-E/r),w=E=>g+x(E),k=E=>{const T=x(E),P=w(E);p.done=Math.abs(T)<=c,p.value=p.done?g:P};let j,_;const S=E=>{h(p.value)&&(j=E,_=Hc({keyframes:[p.value,m(p.value)],velocity:k_(w,E,p.value),damping:s,stiffness:i,restDelta:c,restSpeed:u}))};return S(0),{calculatedDuration:null,next:E=>{let T=!1;return!_&&j===void 0&&(T=!0,k(E),S(E)),j!==void 0&&E>=j?_.next(E-j):(!T&&k(E),p)}}}function F3(e,t,n){const r=[],s=n||Wr.mix||w_,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 O3(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const i=e.length;if(Dm(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=F3(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 p=ya(e[f],e[f+1],u);return a[f](p)};return n?u=>c(On(e[0],e[i-1],u)):c}function z3(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=ya(0,t,r);e.push(ye(n,1,s))}}function $3(e){const t=[0];return z3(t,e.length-1),t}function B3(e,t){return e.map(n=>n*t)}function V3(e,t){return e.map(()=>t||u_).splice(0,e.length-1)}function Go({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=YD(r)?r.map(uv):uv(r),i={done:!1,value:t[0]},o=B3(n&&n.length===t.length?n:$3(t),e),a=O3(o,t,{ease:Array.isArray(s)?s:V3(t,s)});return{calculatedDuration:e,next:l=>(i.value=a(l),i.done=l>=e,i)}}const U3=e=>e!==null;function Eu(e,{repeat:t,repeatType:n="loop"},r,s=1){const i=e.filter(U3),a=s<0||t&&n!=="loop"&&t%2===1?0:i.length-1;return!a||r===void 0?i[a]:r}const W3={decay:Dh,inertia:Dh,tween:Go,keyframes:Go,spring:Hc};function __(e){typeof e.type=="string"&&(e.type=W3[e.type])}class Hm{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 H3=e=>e/100;class Gc extends Hm{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!==ut.now()&&this.tick(ut.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;__(t);const{type:n=Go,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:o=0}=t;let{keyframes:a}=t;const l=n||Go;l!==Go&&typeof a[0]!="number"&&(this.mixKeyframes=Ra(H3,w_(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=Wm(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:p,repeatDelay:h,type:m,onUpdate:y,finalKeyframe:v}=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 g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),x=this.playbackSpeed>=0?g<0:g>s;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let w=this.currentTime,k=r;if(f){const E=Math.min(this.currentTime,s)/a;let T=Math.floor(E),P=E%1;!P&&E>=1&&(P=1),P===1&&T--,T=Math.min(T,f+1),!!(T%2)&&(p==="reverse"?(P=1-P,h&&(P-=h/a)):p==="mirror"&&(k=o)),w=On(0,1,P)*a}let j;x?(this.delayState.value=u[0],j=this.delayState):j=k.next(w),i&&!x&&(j.value=i(j.value));let{done:_}=j;!x&&l!==null&&(_=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const S=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&_);return S&&m!==Dh&&(j.value=Eu(u,this.options,v,this.speed)),y&&y(j.value),S&&this.finish(),j}then(t,n){return this.finished.then(t,n)}get duration(){return en(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+en(t)}get time(){return en(this.currentTime)}set time(t){t=Ft(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 k_(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(ut.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=en(this.currentTime))}play(){var s,i;if(this.isStopped)return;const{driver:t=E3,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(ut.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 G3(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const ws=e=>e*180/Math.PI,Fh=e=>{const t=ws(Math.atan2(e[1],e[0]));return Oh(t)},K3={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Fh,rotateZ:Fh,skewX:e=>ws(Math.atan(e[1])),skewY:e=>ws(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Oh=e=>(e=e%360,e<0&&(e+=360),e),yv=Fh,xv=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),vv=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),q3={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:xv,scaleY:vv,scale:e=>(xv(e)+vv(e))/2,rotateX:e=>Oh(ws(Math.atan2(e[6],e[5]))),rotateY:e=>Oh(ws(Math.atan2(-e[2],e[0]))),rotateZ:yv,rotate:yv,skewX:e=>ws(Math.atan(e[4])),skewY:e=>ws(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function zh(e){return e.includes("scale")?1:0}function $h(e,t){if(!e||e==="none")return zh(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=q3,s=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=K3,s=a}if(!s)return zh(t);const i=r[t],o=s[1].split(",").map(Y3);return typeof i=="function"?i(o):o[i]}const Q3=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return $h(n,t)};function Y3(e){return parseFloat(e.trim())}const Hi=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Gi=new Set([...Hi,"pathRotation"]),wv=e=>e===Wi||e===q,X3=new Set(["x","y","z"]),J3=Hi.filter(e=>!X3.has(e));function Z3(e){const t=[];return J3.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Nr={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})=>$h(t,"x"),y:(e,{transform:t})=>$h(t,"y")};Nr.translateX=Nr.x;Nr.translateY=Nr.y;const Ps=new Set;let Bh=!1,Vh=!1,Uh=!1;function S_(){if(Vh){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=Z3(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)})}Vh=!1,Bh=!1,Ps.forEach(e=>e.complete(Uh)),Ps.clear()}function C_(){Ps.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Vh=!0)})}function eF(){Uh=!0,C_(),S_(),Uh=!1}class Gm{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),Bh||(Bh=!0,xe.read(C_),xe.resolveKeyframes(S_))):(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])}G3(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 tF=e=>e.startsWith("--");function j_(e,t,n){tF(t)?e.style.setProperty(t,n):e.style[t]=n}const nF={};function P_(e,t){const n=e_(e);return()=>nF[t]??n()}const rF=P_(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),E_=P_(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Eo=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,bv={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Eo([0,.65,.55,1]),circOut:Eo([.55,0,1,.45]),backIn:Eo([.31,.01,.66,-.59]),backOut:Eo([.33,1.53,.69,.99])};function T_(e,t){if(e)return typeof e=="function"?E_()?b_(e,t):"ease-out":d_(e)?Eo(e):Array.isArray(e)?e.map(n=>T_(n,t)||bv.easeOut):bv[e]}function sF(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=T_(a,s);Array.isArray(f)&&(u.easing=f);const p={delay:r,duration:s,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"};return c&&(p.pseudoElement=c),e.animate(u,p)}function N_(e){return typeof e=="function"&&"applyToOptions"in e}function iF({type:e,...t}){return N_(e)&&E_()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class R_ extends Hm{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,Dm(typeof t.type!="string");const c=iF(t);this.animation=sF(n,r,s,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const u=Eu(s,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(u),j_(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 en(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+en(t)}get time(){return en(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Ft(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&&rF()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),nn):s(this)}}const A_={anticipate:a_,backInOut:o_,circInOut:c_};function oF(e){return e in A_}function aF(e){typeof e.ease=="string"&&oF(e.ease)&&(e.ease=A_[e.ease])}const Yd=10;class lF extends R_{constructor(t){aF(t),__(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 Gc({...o,autoplay:!1}),l=Math.max(Yd,ut.now()-this.startTime),c=On(0,Yd,l-Yd),u=a.sample(l).value,{name:f}=this.options;i&&f&&j_(i,f,u),n.setWithVelocity(a.sample(Math.max(0,l-c)).value,u,c),a.stop()}}const kv=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(xn.test(e)||e==="0")&&!e.startsWith("url("));function cF(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 uF(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=kv(s,t),a=kv(i,t);return!o||!a?!1:cF(e)||(n==="spring"||N_(n))&&r}function Wh(e){e.duration=0,e.type="keyframes"}const I_=new Set(["opacity","clipPath","filter","transform"]),dF=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function fF(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&dF.test(e[t]))return!0;return!1}const hF=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),pF=e_(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function mF(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 pF()&&n&&(I_.has(n)||hF.has(n)&&fF(a))&&(n!=="transform"||!u)&&!c&&!r&&s!=="mirror"&&i!==0&&o!=="inertia"}const gF=40;class yF extends Hm{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 y,v;this._animation&&(this._animation.stop(),(y=this.stopTimeline)==null||y.call(this)),(v=this.keyframeResolver)==null||v.cancel()},this.createdAt=ut.now();const p={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:o,name:l,motionValue:c,element:u,...f},h=(u==null?void 0:u.KeyframeResolver)||Gm;this.keyframeResolver=new h(a,(y,v,g)=>this.onKeyframesResolved(y,v,p,!g),l,c,u),(m=this.keyframeResolver)==null||m.scheduleResolve()}onKeyframesResolved(t,n,r,s){var g,x;this.keyframeResolver=void 0;const{name:i,type:o,velocity:a,delay:l,isHandoff:c,onUpdate:u}=r;this.resolvedAt=ut.now();let f=!0;uF(t,i,o,a)||(f=!1,(Wr.instantAnimations||!l)&&(u==null||u(Eu(t,r,n))),t[0]=t[t.length-1],Wh(r),r.repeat=0);const h={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>gF?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},m=f&&!c&&mF(h),y=(x=(g=h.motionValue)==null?void 0:g.owner)==null?void 0:x.current;let v;if(m)try{v=new lF({...h,element:y})}catch{v=new Gc(h)}else v=new Gc(h);v.finished.then(()=>{this.notifyFinished()}).catch(nn),this.pendingTimeline&&(this.stopTimeline=v.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=v}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(),eF()),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 M_(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 _v=30,xF=e=>!isNaN(parseFloat(e));class vF{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const s=ut.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=ut.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=xF(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 Fm);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=ut.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>_v)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,_v);return t_(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 Di(e,t){return new vF(e,t)}function L_(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function Km(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?L_(n,e):n}const wF={type:"spring",stiffness:500,damping:25,restSpeed:10},bF=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),kF={type:"keyframes",duration:.8},_F={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},SF=(e,{keyframes:t})=>t.length>2?kF:Gi.has(e)?e.startsWith("scale")?bF(t[1]):wF:_F,CF=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function jF(e){for(const t in e)if(!CF.has(t))return!0;return!1}const qm=(e,t,n,r={},s,i)=>o=>{const a=Km(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-Ft(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:p=>{t.set(p),a.onUpdate&&a.onUpdate(p)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:i?void 0:s};jF(a)||Object.assign(u,SF(e,u)),u.duration&&(u.duration=Ft(u.duration)),u.repeatDelay&&(u.repeatDelay=Ft(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let f=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(Wh(u),u.delay===0&&(f=!0)),(Wr.instantAnimations||Wr.skipAnimations||s!=null&&s.shouldSkipAnimations||a.skipAnimations)&&(f=!0,Wh(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,f&&!i&&t.get()!==void 0){const p=Eu(u.keyframes,a);if(p!==void 0){xe.update(()=>{u.onUpdate(p),u.onComplete()});return}}return a.isSync?new Gc(u):new yF(u)},PF=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function EF(e){const t=PF.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function D_(e,t,n=1){const[r,s]=EF(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const o=i.trim();return Xk(o)?parseFloat(o):o}return $m(s)?D_(s,t,n+1):s}function Sv(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Qm(e,t,n,r){if(typeof t=="function"){const[s,i]=Sv(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]=Sv(r);t=t(n!==void 0?n:e.custom,s,i)}return t}function Es(e,t,n){const r=e.getProps();return Qm(r,t,n!==void 0?n:r.custom,e)}const F_=new Set(["width","height","top","left","right","bottom",...Hi]),Hh=e=>Array.isArray(e);function TF(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Di(n))}function NF(e){return Hh(e)?e[e.length-1]||0:e}function RF(e,t){const n=Es(e,t);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const a=NF(i[o]);TF(e,o,a)}}const Xe=e=>!!(e&&e.getVelocity);function AF(e){return!!(Xe(e)&&e.add)}function Gh(e,t){const n=e.getValue("willChange");if(AF(n))return n.add(t);if(!n&&Wr.WillChange){const r=new Wr.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Ym(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const IF="framerAppearId",O_="data-"+Ym(IF);function z_(e){return e.props[O_]}function MF({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function $_(e,t,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i,transitionEnd:o,...a}=t;const l=e.getDefaultTransition();i=i?L_(i,l):l;const c=i==null?void 0:i.reduceMotion,u=i==null?void 0:i.skipAnimations;r&&(i=r);const f=[],p=s&&e.animationState&&e.animationState.getState()[s],h=i==null?void 0:i.path;h&&h.animateVisualElement(e,a,i,n,f);for(const m in a){const y=e.getValue(m,e.latestValues[m]??null),v=a[m];if(v===void 0||p&&MF(p,m))continue;const g={delay:n,...Km(i||{},m)};u&&(g.skipAnimations=!0);const x=y.get();if(x!==void 0&&!y.isAnimating()&&!Array.isArray(v)&&v===x&&!g.velocity){xe.update(()=>y.set(v));continue}let w=!1;if(window.MotionHandoffAnimation){const _=z_(e);if(_){const S=window.MotionHandoffAnimation(_,m,xe);S!==null&&(g.startTime=S,w=!0)}}Gh(e,m);const k=c??e.shouldReduceMotion;y.start(qm(m,y,v,k&&F_.has(m)?{type:!1}:g,e,w));const j=y.animation;j&&f.push(j)}if(o){const m=()=>xe.update(()=>{o&&RF(e,o)});f.length?Promise.all(f).then(m):m()}return f}function Kh(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($_(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:f,staggerDirection:p}=s;return LF(e,t,c,u,f,p,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 LF(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(Kh(l,t,{...o,delay:n+(typeof r=="function"?0:r)+M_(e.variantChildren,l,r,s,i)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(a)}function DF(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(i=>Kh(e,i,n));r=Promise.all(s)}else if(typeof t=="string")r=Kh(e,t,n);else{const s=typeof t=="function"?Es(e,t,n.custom):t;r=Promise.all($_(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const FF={test:e=>e==="auto",parse:e=>e},B_=e=>t=>t.test(e),V_=[Wi,q,Dn,Gn,c3,l3,FF],Cv=e=>V_.find(B_(e));function OF(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Zk(e):!0}const zF=new Set(["brightness","contrast","saturate","opacity"]);function $F(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Bm)||[];if(!r)return e;const s=n.replace(r,"");let i=zF.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+s+")"}const BF=/\b([a-z-]*)\(.*?\)/gu,qh={...xn,getAnimatableNone:e=>{const t=e.match(BF);return t?t.map($F).join(" "):e}},Qh={...xn,getAnimatableNone:e=>{const t=xn.parse(e);return xn.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},jv={...Wi,transform:Math.round},VF={rotate:Gn,pathRotation:Gn,rotateX:Gn,rotateY:Gn,rotateZ:Gn,scale:xl,scaleX:xl,scaleY:xl,scaleZ:xl,skew:Gn,skewX:Gn,skewY:Gn,distance:q,translateX:q,translateY:q,translateZ:q,x:q,y:q,z:q,perspective:q,transformPerspective:q,opacity:xa,originX:fv,originY:fv,originZ:q},Kc={borderWidth:q,borderTopWidth:q,borderRightWidth:q,borderBottomWidth:q,borderLeftWidth:q,borderRadius:q,borderTopLeftRadius:q,borderTopRightRadius:q,borderBottomRightRadius:q,borderBottomLeftRadius:q,width:q,maxWidth:q,height:q,maxHeight:q,top:q,right:q,bottom:q,left:q,inset:q,insetBlock:q,insetBlockStart:q,insetBlockEnd:q,insetInline:q,insetInlineStart:q,insetInlineEnd:q,padding:q,paddingTop:q,paddingRight:q,paddingBottom:q,paddingLeft:q,paddingBlock:q,paddingBlockStart:q,paddingBlockEnd:q,paddingInline:q,paddingInlineStart:q,paddingInlineEnd:q,margin:q,marginTop:q,marginRight:q,marginBottom:q,marginLeft:q,marginBlock:q,marginBlockStart:q,marginBlockEnd:q,marginInline:q,marginInlineStart:q,marginInlineEnd:q,fontSize:q,backgroundPositionX:q,backgroundPositionY:q,...VF,zIndex:jv,fillOpacity:xa,strokeOpacity:xa,numOctaves:jv},UF={...Kc,color:ze,backgroundColor:ze,outlineColor:ze,fill:ze,stroke:ze,borderColor:ze,borderTopColor:ze,borderRightColor:ze,borderBottomColor:ze,borderLeftColor:ze,filter:qh,WebkitFilter:qh,mask:Qh,WebkitMask:Qh},U_=e=>UF[e],WF=new Set([qh,Qh]);function W_(e,t){let n=U_(e);return WF.has(n)||(n=xn),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const HF=new Set(["auto","none","0"]);function GF(e,t,n){let r=0,s;for(;r<e.length&&!s;){const i=e[r];typeof i=="string"&&!HF.has(i)&&Li(i).values.length&&(s=e[r]),r++}if(s&&n)for(const i of t)e[i]=W_(n,s)}class KF extends Gm{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(),$m(f))){const p=D_(f,n.current);p!==void 0&&(t[u]=p),u===t.length-1&&(this.finalKeyframe=f)}}if(this.resolveNoneKeyframes(),!F_.has(r)||t.length!==2)return;const[s,i]=t,o=Cv(s),a=Cv(i),l=dv(s),c=dv(i);if(l!==c&&Nr[r]){this.needsMeasurement=!0;return}if(o!==a)if(wv(o)&&wv(a))for(let u=0;u<t.length;u++){const f=t[u];typeof f=="string"&&(t[u]=parseFloat(f))}else Nr[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)(t[s]===null||OF(t[s]))&&r.push(s);r.length&&GF(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=Nr[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]=Nr[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 H_(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 Yh=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Jl(e){return Jk(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:Xm}=f_(queueMicrotask,!1),fn={x:!1,y:!1};function G_(){return fn.x||fn.y}function qF(e){return e==="x"||e==="y"?fn[e]?null:(fn[e]=!0,()=>{fn[e]=!1}):fn.x||fn.y?null:(fn.x=fn.y=!0,()=>{fn.x=fn.y=!1})}function K_(e,t){const n=H_(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function QF(e){return!(e.pointerType==="touch"||G_())}function YF(e,t,n={}){const[r,s,i]=K_(e,n);return r.forEach(o=>{let a=!1,l=!1,c;const u=()=>{o.removeEventListener("pointerleave",m)},f=v=>{c&&(c(v),c=void 0),u()},p=v=>{a=!1,window.removeEventListener("pointerup",p),window.removeEventListener("pointercancel",p),l&&(l=!1,f(v))},h=()=>{a=!0,window.addEventListener("pointerup",p,s),window.addEventListener("pointercancel",p,s)},m=v=>{if(v.pointerType!=="touch"){if(a){l=!0;return}f(v)}},y=v=>{if(!QF(v))return;l=!1;const g=t(o,v);typeof g=="function"&&(c=g,o.addEventListener("pointerleave",m,s))};o.addEventListener("pointerenter",y,s),o.addEventListener("pointerdown",h,s)}),i}const q_=(e,t)=>t?e===t?!0:q_(e,t.parentElement):!1,Jm=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,XF=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function JF(e){return XF.has(e.tagName)||e.isContentEditable===!0}const ZF=new Set(["INPUT","SELECT","TEXTAREA"]);function eO(e){return ZF.has(e.tagName)||e.isContentEditable===!0}const Zl=new WeakSet;function Pv(e){return t=>{t.key==="Enter"&&e(t)}}function Xd(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const tO=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Pv(()=>{if(Zl.has(n))return;Xd(n,"down");const s=Pv(()=>{Xd(n,"up")}),i=()=>Xd(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 Ev(e){return Jm(e)&&!G_()}const Tv=new WeakSet;function nO(e,t,n={}){const[r,s,i]=K_(e,n),o=a=>{const l=a.currentTarget;if(!Ev(a)||Tv.has(a))return;Zl.add(l),n.stopPropagation&&Tv.add(a);const c=t(l,a),u=(h,m)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",p),Zl.has(l)&&Zl.delete(l),Ev(h)&&typeof c=="function"&&c(h,{success:m})},f=h=>{u(h,l===window||l===document||n.useGlobalTarget||q_(l,h.target))},p=h=>{u(h,!1)};window.addEventListener("pointerup",f,s),window.addEventListener("pointercancel",p,s)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,s),Jl(a)&&(a.addEventListener("focus",c=>tO(c,s)),!JF(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),i}function Zm(e){return Jk(e)&&"ownerSVGElement"in e}const ec=new WeakMap;let yr;const Q_=(e,t,n)=>(r,s)=>s&&s[0]?s[0][e+"Size"]:Zm(r)&&"getBBox"in r?r.getBBox()[t]:r[n],rO=Q_("inline","width","offsetWidth"),sO=Q_("block","height","offsetHeight");function iO({target:e,borderBoxSize:t}){var n;(n=ec.get(e))==null||n.forEach(r=>{r(e,{get width(){return rO(e,t)},get height(){return sO(e,t)}})})}function oO(e){e.forEach(iO)}function aO(){typeof ResizeObserver>"u"||(yr=new ResizeObserver(oO))}function lO(e,t){yr||aO();const n=H_(e);return n.forEach(r=>{let s=ec.get(r);s||(s=new Set,ec.set(r,s)),s.add(t),yr==null||yr.observe(r)}),()=>{n.forEach(r=>{const s=ec.get(r);s==null||s.delete(t),s!=null&&s.size||yr==null||yr.unobserve(r)})}}const tc=new Set;let hi;function cO(){hi=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};tc.forEach(t=>t(e))},window.addEventListener("resize",hi)}function uO(e){return tc.add(e),hi||cO(),()=>{tc.delete(e),!tc.size&&typeof hi=="function"&&(window.removeEventListener("resize",hi),hi=void 0)}}function Nv(e,t){return typeof e=="function"?uO(e):lO(e,t)}function dO(e){return Zm(e)&&e.tagName==="svg"}const fO=[...V_,ze,xn],hO=e=>fO.find(B_(e)),Rv=()=>({translate:0,scale:1,origin:0,originPoint:0}),pi=()=>({x:Rv(),y:Rv()}),Av=()=>({min:0,max:0}),Be=()=>({x:Av(),y:Av()}),pO=new WeakMap;function Tu(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function va(e){return typeof e=="string"||Array.isArray(e)}const eg=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],tg=["initial",...eg];function Nu(e){return Tu(e.animate)||tg.some(t=>va(e[t]))}function Y_(e){return!!(Nu(e)||e.variants)}function mO(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,Di(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,Di(o!==void 0?o:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const qc={current:null},ng={current:!1},gO=typeof window<"u";function X_(){if(ng.current=!0,!!gO)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>qc.current=e.matches;e.addEventListener("change",t),t()}else qc.current=!1}const Iv=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Qc={};function J_(e){Qc=e}function yO(){return Qc}class xO{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=Gm,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 h=ut.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,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=Nu(n),this.isVariantNode=Y_(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:f,...p}=this.scrapeMotionValuesFromProps(n,{},this);for(const h in p){const m=p[h];c[h]!==void 0&&Xe(m)&&m.set(c[h])}}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,pO.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:(ng.current||X_(),this.shouldReduceMotion=qc.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(),Hr(this.notifyUpdate),Hr(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&&I_.has(t)&&this.current instanceof HTMLElement){const{factory:o,keyframes:a,times:l,ease:c,duration:u}=n.accelerate,f=new R_({element:this.current,name:t,keyframes:a,times:l,ease:c,duration:Ft(u)}),p=o(f);this.valueSubscriptions.set(t,()=>{p(),f.cancel()});return}const r=Gi.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 Qc){const n=Qc[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<Iv.length;r++){const s=Iv[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=mO(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=Di(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"&&(Xk(r)||Zk(r))?r=parseFloat(r):!hO(r)&&xn.test(n)&&(r=W_(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=Qm(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 Fm),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Xm.render(this.render)}}class Z_ extends xO{constructor(){super(...arguments),this.KeyframeResolver=KF}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 es{constructor(t){this.isMounted=!1,this.node=t}update(){}}function eS({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function vO({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function wO(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 Jd(e){return e===void 0||e===1}function Xh({scale:e,scaleX:t,scaleY:n}){return!Jd(e)||!Jd(t)||!Jd(n)}function ds(e){return Xh(e)||tS(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function tS(e){return Mv(e.x)||Mv(e.y)}function Mv(e){return e&&e!=="0%"}function Yc(e,t,n){const r=e-n,s=t*r;return n+s}function Lv(e,t,n,r,s){return s!==void 0&&(e=Yc(e,s,r)),Yc(e,n,r)+t}function Jh(e,t=0,n=1,r,s){e.min=Lv(e.min,t,n,r,s),e.max=Lv(e.max,t,n,r,s)}function nS(e,{x:t,y:n}){Jh(e.x,t.translate,t.scale,t.originPoint),Jh(e.y,n.translate,n.scale,n.originPoint)}const Dv=.999999999999,Fv=1.0000000000001;function bO(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&&(Rn(e.x,-i.scroll.offset.x),Rn(e.y,-i.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,nS(e,o)),r&&ds(i.latestValues)&&nc(e,i.latestValues,(a=i.layout)==null?void 0:a.layoutBox))}t.x<Fv&&t.x>Dv&&(t.x=1),t.y<Fv&&t.y>Dv&&(t.y=1)}function Rn(e,t){e.min+=t,e.max+=t}function Ov(e,t,n,r,s=.5){const i=ye(e.min,e.max,s);Jh(e,t,n,i,r)}function zv(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function nc(e,t,n){const r=n??e;Ov(e.x,zv(t.x,r.x),t.scaleX,t.scale,t.originX),Ov(e.y,zv(t.y,r.y),t.scaleY,t.scale,t.originY)}function rS(e,t){return eS(wO(e.getBoundingClientRect(),t))}function kO(e,t,n){const r=rS(e,n),{scroll:s}=t;return s&&(Rn(r.x,s.offset.x),Rn(r.y,s.offset.y)),r}const _O={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},SO=Hi.length;function CO(e,t,n){let r="",s=!0;for(let o=0;o<SO;o++){const a=Hi[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=Yh(l,Kc[a]);if(!c){s=!1;const f=_O[a]||a;r+=`${f}(${u}) `}n&&(t[a]=u)}}const i=e.pathRotation;return i&&(s=!1,r+=`rotate(${Yh(i,Kc.pathRotation)}) `),r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function rg(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(Gi.has(l)){o=!0;continue}else if(p_(l)){s[l]=c;continue}else{const u=Yh(c,Kc[l]);l.startsWith("origin")?(a=!0,i[l]=u):r[l]=u}}if(t.transform||(o||n?r.transform=CO(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 sS(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 $v(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const vo={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(q.test(e))e=parseFloat(e);else return e;const n=$v(e,t.target.x),r=$v(e,t.target.y);return`${n}% ${r}%`}},jO={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=xn.parse(e);if(s.length>5)return r;const i=xn.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)}},Zh={borderRadius:{...vo,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:vo,borderTopRightRadius:vo,borderBottomLeftRadius:vo,borderBottomRightRadius:vo,boxShadow:jO};function iS(e,{layout:t,layoutId:n}){return Gi.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Zh[e]||e==="opacity")}function sg(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])||iS(a,e)||((o=n==null?void 0:n.getValue(a))==null?void 0:o.liveStyle)!==void 0)&&(i[a]=r[a]);return i}function PO(e){return window.getComputedStyle(e)}class EO extends Z_{constructor(){super(...arguments),this.type="html",this.renderInstance=sS}readValueFromInstance(t,n){var r;if(Gi.has(n))return(r=this.projection)!=null&&r.isProjecting?zh(n):Q3(t,n);{const s=PO(t),i=(p_(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return rS(t,n)}build(t,n,r){rg(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return sg(t,n,r)}}const TO={offset:"stroke-dashoffset",array:"stroke-dasharray"},NO={offset:"strokeDashoffset",array:"strokeDasharray"};function RO(e,t,n=1,r=0,s=!0){e.pathLength=1;const i=s?TO:NO;e[i.offset]=`${-r}`,e[i.array]=`${t} ${n}`}const AO=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function oS(e,{attrX:t,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:o=0,...a},l,c,u){if(rg(e,a,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:p}=e;f.transform&&(p.transform=f.transform,delete f.transform),(p.transform||f.transformOrigin)&&(p.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),p.transform&&(p.transformBox=(u==null?void 0:u.transformBox)??"fill-box",delete f.transformBox);for(const h of AO)f[h]!==void 0&&(p[h]=f[h],delete f[h]);t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),s!==void 0&&RO(f,s,i,o,!1)}const aS=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"]),lS=e=>typeof e=="string"&&e.toLowerCase()==="svg";function IO(e,t,n,r){sS(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(aS.has(s)?s:Ym(s),t.attrs[s])}function cS(e,t,n){const r=sg(e,t,n);for(const s in e)if(Xe(e[s])||Xe(t[s])){const i=Hi.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=e[s]}return r}class MO extends Z_{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Be}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Gi.has(n)){const r=U_(n);return r&&r.default||0}return n=aS.has(n)?n:Ym(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return cS(t,n,r)}build(t,n,r){oS(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,s){IO(t,n,r,s)}mount(t){this.isSVGTag=lS(t.tagName),super.mount(t)}}const LO=tg.length;function uS(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?uS(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<LO;n++){const r=tg[n],s=e.props[r];(va(s)||s===!1)&&(t[r]=s)}return t}function dS(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 DO=[...eg].reverse(),FO=eg.length;function OO(e){return t=>Promise.all(t.map(({animation:n,options:r})=>DF(e,n,r)))}function zO(e){let t=OO(e),n=Bv(),r=!0,s=!1;const i=c=>(u,f)=>{var h;const p=Es(e,f,c==="exit"?(h=e.presenceContext)==null?void 0:h.custom:void 0);if(p){const{transition:m,transitionEnd:y,...v}=p;u={...u,...v,...y}}return u};function o(c){t=c(e)}function a(c){const{props:u}=e,f=uS(e.parent)||{},p=[],h=new Set;let m={},y=1/0;for(let g=0;g<FO;g++){const x=DO[g],w=n[x],k=u[x]!==void 0?u[x]:f[x],j=va(k),_=x===c?w.isActive:null;_===!1&&(y=g);let S=k===f[x]&&k!==u[x]&&j;if(S&&(r||s)&&e.manuallyAnimateOnMount&&(S=!1),w.protectedKeys={...m},!w.isActive&&_===null||!k&&!w.prevProp||Tu(k)||typeof k=="boolean")continue;if(x==="exit"&&w.isActive&&_!==!0){w.prevResolvedValues&&(m={...m,...w.prevResolvedValues});continue}const E=$O(w.prevProp,k);let T=E||x===c&&w.isActive&&!S&&j||g>y&&j,P=!1;const A=Array.isArray(k)?k:[k];let I=A.reduce(i(x),{});_===!1&&(I={});const{prevResolvedValues:O={}}=w,M={...O,...I},N=L=>{T=!0,h.has(L)&&(P=!0,h.delete(L)),w.needsAnimating[L]=!0;const B=e.getValue(L);B&&(B.liveStyle=!1)};for(const L in M){const B=I[L],C=O[L];if(m.hasOwnProperty(L))continue;let $=!1;Hh(B)&&Hh(C)?$=!dS(B,C)||E:$=B!==C,$?B!=null?N(L):h.add(L):B!==void 0&&h.has(L)?N(L):w.protectedKeys[L]=!0}w.prevProp=k,w.prevResolvedValues=I,w.isActive&&(m={...m,...I}),(r||s)&&e.blockInitialAnimation&&(T=!1);const z=S&&E;T&&(!z||P)&&p.push(...A.map(L=>{const B={type:x};if(typeof L=="string"&&(r||s)&&!z&&e.manuallyAnimateOnMount&&e.parent){const{parent:C}=e,$=Es(C,L);if(C.enteringChildren&&$){const{delayChildren:Q}=$.transition||{};B.delay=M_(C.enteringChildren,e,Q)}}return{animation:L,options:B}}))}if(h.size){const g={};if(typeof u.initial!="boolean"){const x=Es(e,Array.isArray(u.initial)?u.initial[0]:u.initial);x&&x.transition&&(g.transition=x.transition)}h.forEach(x=>{const w=e.getBaseTarget(x),k=e.getValue(x);k&&(k.liveStyle=!0),g[x]=w??null}),p.push({animation:g})}let v=!!p.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(v=!1),r=!1,s=!1,v?t(p):Promise.resolve()}function l(c,u){var p;if(n[c].isActive===u)return Promise.resolve();(p=e.variantChildren)==null||p.forEach(h=>{var m;return(m=h.animationState)==null?void 0:m.setActive(c,u)}),n[c].isActive=u;const f=a(c);for(const h in n)n[h].protectedKeys={};return f}return{animateChanges:a,setActive:l,setAnimateFunction:o,getState:()=>n,reset:()=>{n=Bv(),s=!0}}}function $O(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!dS(t,e):!1}function ss(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Bv(){return{animate:ss(!0),whileInView:ss(),whileHover:ss(),whileTap:ss(),whileDrag:ss(),whileFocus:ss(),exit:ss()}}function ep(e,t){e.min=t.min,e.max=t.max}function cn(e,t){ep(e.x,t.x),ep(e.y,t.y)}function Vv(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const fS=1e-4,BO=1-fS,VO=1+fS,hS=.01,UO=0-hS,WO=0+hS;function dt(e){return e.max-e.min}function HO(e,t,n){return Math.abs(e-t)<=n}function Uv(e,t,n,r=.5){e.origin=r,e.originPoint=ye(t.min,t.max,e.origin),e.scale=dt(n)/dt(t),e.translate=ye(n.min,n.max,e.origin)-e.originPoint,(e.scale>=BO&&e.scale<=VO||isNaN(e.scale))&&(e.scale=1),(e.translate>=UO&&e.translate<=WO||isNaN(e.translate))&&(e.translate=0)}function Ko(e,t,n,r){Uv(e.x,t.x,n.x,r?r.originX:void 0),Uv(e.y,t.y,n.y,r?r.originY:void 0)}function Wv(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+dt(t)}function GO(e,t,n,r){Wv(e.x,t.x,n.x,r==null?void 0:r.x),Wv(e.y,t.y,n.y,r==null?void 0:r.y)}function Hv(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+dt(t)}function Xc(e,t,n,r){Hv(e.x,t.x,n.x,r==null?void 0:r.x),Hv(e.y,t.y,n.y,r==null?void 0:r.y)}function Gv(e,t,n,r,s){return e-=t,e=Yc(e,1/n,r),s!==void 0&&(e=Yc(e,1/s,r)),e}function KO(e,t=0,n=1,r=.5,s,i=e,o=e){if(Dn.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=Gv(e.min,t,n,a,s),e.max=Gv(e.max,t,n,a,s)}function Kv(e,t,[n,r,s],i,o){KO(e,t[n],t[r],t[s],t.scale,i,o)}const qO=["x","scaleX","originX"],QO=["y","scaleY","originY"];function qv(e,t,n,r){Kv(e.x,t,qO,n?n.x:void 0,r?r.x:void 0),Kv(e.y,t,QO,n?n.y:void 0,r?r.y:void 0)}function Qv(e){return e.translate===0&&e.scale===1}function pS(e){return Qv(e.x)&&Qv(e.y)}function Yv(e,t){return e.min===t.min&&e.max===t.max}function YO(e,t){return Yv(e.x,t.x)&&Yv(e.y,t.y)}function Xv(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function mS(e,t){return Xv(e.x,t.x)&&Xv(e.y,t.y)}function Jv(e){return dt(e.x)/dt(e.y)}function Zv(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Tn(e){return[e("x"),e("y")]}function XO(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:p,rotateY:h,skewX:m,skewY:y}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),f&&(r+=`rotate(${f}deg) `),p&&(r+=`rotateX(${p}deg) `),h&&(r+=`rotateY(${h}deg) `),m&&(r+=`skewX(${m}deg) `),y&&(r+=`skewY(${y}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 gS=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],JO=gS.length,e0=e=>typeof e=="string"?parseFloat(e):e,t0=e=>typeof e=="number"||q.test(e);function ZO(e,t,n,r,s,i){s?(e.opacity=ye(0,n.opacity??1,ez(r)),e.opacityExit=ye(t.opacity??1,0,tz(r))):i&&(e.opacity=ye(t.opacity??1,n.opacity??1,r));for(let o=0;o<JO;o++){const a=gS[o];let l=n0(t,a),c=n0(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||t0(l)===t0(c)?(e[a]=Math.max(ye(e0(l),e0(c),r),0),(Dn.test(c)||Dn.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=ye(t.rotate||0,n.rotate||0,r))}function n0(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const ez=yS(0,.5,l_),tz=yS(.5,.95,nn);function yS(e,t,n){return r=>r<e?0:r>t?1:n(ya(e,t,r))}function nz(e,t,n){const r=Xe(e)?e:Di(e);return r.start(qm("",r,t,n)),r.animation}function wa(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const rz=(e,t)=>e.depth-t.depth;class sz{constructor(){this.children=[],this.isDirty=!1}add(t){Lm(this.children,t),this.isDirty=!0}remove(t){Vc(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(rz),this.isDirty=!1,this.children.forEach(t)}}function iz(e,t){const n=ut.now(),r=({timestamp:s})=>{const i=s-n;i>=t&&(Hr(r),e(i-t))};return xe.setup(r,!0),()=>Hr(r)}function rc(e){return Xe(e)?e.get():e}class oz{constructor(){this.members=[]}add(t){Lm(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&&(Vc(this.members,r),r.unmount())}t.scheduleRender()}remove(t){if(Vc(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 sc={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Zd=["","X","Y","Z"],az=1e3;let lz=0;function ef(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function xS(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=z_(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&&xS(r)}function vS({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},a=t==null?void 0:t()){this.id=lz++,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(dz),this.nodes.forEach(yz),this.nodes.forEach(xz),this.nodes.forEach(fz)},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 sz)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Fm),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)&&!dO(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 p=()=>this.root.updateBlockedByResize=!1;xe.read(()=>{f=window.innerWidth}),e(o,()=>{const h=window.innerWidth;h!==f&&(f=h,this.root.updateBlockedByResize=!0,u&&u(),u=iz(p,250),sc.hasAnimatedSinceResize&&(sc.hasAnimatedSinceResize=!1,this.nodes.forEach(i0)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:f,hasRelativeLayoutChanged:p,layout:h})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||c.getDefaultTransition()||_z,{onLayoutAnimationStart:y,onLayoutAnimationComplete:v}=c.getProps(),g=!this.targetLayout||!mS(this.targetLayout,h),x=!f&&p;if(this.options.layoutRoot||this.resumeFrom||x||f&&(g||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const w={...Km(m,"layout"),onPlay:y,onComplete:v};(c.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w),this.setAnimationOrigin(u,x,w.path)}else f||i0(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=h})}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(),Hr(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(vz),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&&xS(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(pz),this.nodes.forEach(r0);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(s0);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(mz),this.nodes.forEach(gz),this.nodes.forEach(cz),this.nodes.forEach(uz)):this.nodes.forEach(s0),this.clearAllSnapshots();const a=ut.now();Ye.delta=On(0,1e3/60,a-Ye.timestamp),Ye.timestamp=a,Ye.isProcessing=!0,Hd.update.process(Ye),Hd.preRender.process(Ye),Hd.render.process(Ye),Ye.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Xm.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(hz),this.sharedNodes.forEach(wz)}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&&!dt(this.snapshot.measuredBox.x)&&!dt(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&&!pS(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;o&&this.instance&&(a||ds(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)),Sz(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(Cz))){const{scroll:u}=this.root;u&&(Rn(a.x,u.offset.x),Rn(a.y,u.offset.y))}return a}removeElementScroll(o){var l;const a=Be();if(cn(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:p}=u;u!==this.root&&f&&p.layoutScroll&&(f.wasRoot&&cn(a,o),Rn(a.x,f.offset.x),Rn(a.y,f.offset.y))}return a}applyTransform(o,a=!1,l){var u,f;const c=l||Be();cn(c,o);for(let p=0;p<this.path.length;p++){const h=this.path[p];!a&&h.options.layoutScroll&&h.scroll&&h!==h.root&&(Rn(c.x,-h.scroll.offset.x),Rn(c.y,-h.scroll.offset.y)),ds(h.latestValues)&&nc(c,h.latestValues,(u=h.layout)==null?void 0:u.layoutBox)}return ds(this.latestValues)&&nc(c,this.latestValues,(f=this.layout)==null?void 0:f.layoutBox),c}removeTransform(o){var l;const a=Be();cn(a,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!ds(u.latestValues))continue;let f;u.instance&&(Xh(u.latestValues)&&u.updateSnapshot(),f=Be(),cn(f,u.measurePageBox())),qv(a,u.latestValues,(l=u.snapshot)==null?void 0:l.layoutBox,f)}return ds(this.latestValues)&&qv(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!==Ye.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var h;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||(h=this.parent)!=null&&h.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:f}=this.options;if(!this.layout||!(u||f))return;this.resolvedRelativeTargetAt=Ye.timestamp;const p=this.getClosestProjectingParent();p&&this.linkedParentVersion!==p.layoutVersion&&!p.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&p&&p.layout?this.createRelativeTarget(p,this.layout.layoutBox,p.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(),GO(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):cn(this.target,this.layout.layoutBox),nS(this.target,this.targetDelta)):cn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&p&&!!p.resumingFrom==!!this.resumingFrom&&!p.options.layoutScroll&&p.target&&this.animationProgress!==1?this.createRelativeTarget(p,this.target,p.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Xh(this.parent.latestValues)||tS(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(),Xc(this.relativeTargetOrigin,a,l,this.options.layoutAnchor||void 0),cn(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===Ye.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;cn(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,p=this.treeScale.y;bO(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:h}=o;if(!h){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Vv(this.prevProjectionDelta.x,this.projectionDelta.x),Vv(this.prevProjectionDelta.y,this.projectionDelta.y)),Ko(this.projectionDelta,this.layoutCorrected,h,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==p||!Zv(this.projectionDelta.x,this.prevProjectionDelta.x)||!Zv(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",h))}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=pi(),this.projectionDelta=pi(),this.projectionDeltaWithTransform=pi()}setAnimationOrigin(o,a=!1,l){const c=this.snapshot,u=c?c.latestValues:{},f={...this.latestValues},p=pi();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const h=Be(),m=c?c.source:void 0,y=this.layout?this.layout.source:void 0,v=m!==y,g=this.getStack(),x=!g||g.members.length<=1,w=!!(v&&!x&&this.options.crossfade===!0&&!this.path.some(kz));this.animationProgress=0;let k;const j=l==null?void 0:l.interpolateProjection(o);this.mixTargetDelta=_=>{const S=_/1e3,E=j==null?void 0:j(S);E?(p.x.translate=E.x,p.x.scale=ye(o.x.scale,1,S),p.x.origin=o.x.origin,p.x.originPoint=o.x.originPoint,p.y.translate=E.y,p.y.scale=ye(o.y.scale,1,S),p.y.origin=o.y.origin,p.y.originPoint=o.y.originPoint):(o0(p.x,o.x,S),o0(p.y,o.y,S)),this.setTargetDelta(p),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Xc(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),bz(this.relativeTarget,this.relativeTargetOrigin,h,S),k&&YO(this.relativeTarget,k)&&(this.isProjectionDirty=!1),k||(k=Be()),cn(k,this.relativeTarget)),v&&(this.animationValues=f,ZO(f,u,this.latestValues,S,w,x)),E&&E.rotate!==void 0&&(this.animationValues||(this.animationValues=f),this.animationValues.pathRotation=E.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},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&&(Hr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=xe.update(()=>{sc.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Di(0)),this.motionValue.jump(0,!1),this.currentAnimation=nz(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(az),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&&wS(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||Be();const f=dt(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+f;const p=dt(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+p}cn(a,l),nc(a,u),Ko(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new oz),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&&ef("z",o,c,this.animationValues);for(let u=0;u<Zd.length;u++)ef(`rotate${Zd[u]}`,o,c,this.animationValues),ef(`skew${Zd[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=rc(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=rc(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!ds(this.latestValues)&&(o.transform=l?l({},""):"none",this.hasProjected=!1);return}o.visibility="";const u=c.animationValues||c.latestValues;this.applyTransformsToTarget();let f=XO(this.projectionDeltaWithTransform,this.treeScale,u);l&&(f=l(u,f)),o.transform=f;const{x:p,y:h}=this.projectionDelta;o.transformOrigin=`${p.origin*100}% ${h.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 Zh){if(u[m]===void 0)continue;const{correct:y,applyTo:v,isCSSVariable:g}=Zh[m],x=f==="none"?u[m]:y(u[m],c);if(v){const w=v.length;for(let k=0;k<w;k++)o[v[k]]=x}else g?this.options.visualElement.renderState.vars[m]=x:o[m]=x}this.options.layoutId&&(o.pointerEvents=c===this?rc(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(r0),this.root.sharedNodes.clear()}}}function cz(e){e.updateLayout()}function uz(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")Tn(f=>{const p=o?t.measuredBox[f]:t.layoutBox[f],h=dt(p);p.min=r[f].min,p.max=p.min+h});else if(i==="x"||i==="y"){const f=i==="x"?"y":"x";ep(o?t.measuredBox[f]:t.layoutBox[f],r[f])}else wS(i,t.layoutBox,r)&&Tn(f=>{const p=o?t.measuredBox[f]:t.layoutBox[f],h=dt(r[f]);p.max=p.min+h,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+h)});const a=pi();Ko(a,r,t.layoutBox);const l=pi();o?Ko(l,e.applyTransform(s,!0),t.measuredBox):Ko(l,r,t.layoutBox);const c=!pS(a);let u=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:p,layout:h}=f;if(p&&h){const m=e.options.layoutAnchor||void 0,y=Be();Xc(y,t.layoutBox,p.layoutBox,m);const v=Be();Xc(v,r,h.layoutBox,m),mS(y,v)||(u=!0),f.options.layoutRoot&&(e.relativeTarget=v,e.relativeTargetOrigin=y,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 dz(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 fz(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function hz(e){e.clearSnapshot()}function r0(e){e.clearMeasurements()}function pz(e){e.isLayoutDirty=!0,e.updateLayout()}function s0(e){e.isLayoutDirty=!1}function mz(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function gz(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function i0(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function yz(e){e.resolveTargetDelta()}function xz(e){e.calcProjection()}function vz(e){e.resetSkewAndRotation()}function wz(e){e.removeLeadSnapshot()}function o0(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 a0(e,t,n,r){e.min=ye(t.min,n.min,r),e.max=ye(t.max,n.max,r)}function bz(e,t,n,r){a0(e.x,t.x,n.x,r),a0(e.y,t.y,n.y,r)}function kz(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const _z={duration:.45,ease:[.4,0,.1,1]},l0=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),c0=l0("applewebkit/")&&!l0("chrome/")?Math.round:nn;function u0(e){e.min=c0(e.min),e.max=c0(e.max)}function Sz(e){u0(e.x),u0(e.y)}function wS(e,t,n){return e==="position"||e==="preserve-aspect"&&!HO(Jv(t),Jv(n),.2)}function Cz(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const jz=vS({attachResizeListener:(e,t)=>wa(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}),tf={current:void 0},bS=vS({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!tf.current){const e=new jz({});e.mount(window),e.setOptions({layoutScroll:!0}),tf.current=e}return tf.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),ig=b.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function d0(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Pz(...e){return t=>{let n=!1;const r=e.map(s=>{const i=d0(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():d0(e[s],null)}}}}function Ez(...e){return b.useCallback(Pz(...e),e)}class Tz extends b.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(Jl(n)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,s=Jl(r)&&r.offsetWidth||0,i=Jl(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 Nz({children:e,isPresent:t,anchorX:n,anchorY:r,root:s,pop:i}){var p;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(ig),u=((p=e.props)==null?void 0:p.ref)??(e==null?void 0:e.ref),f=Ez(a,u);return b.useInsertionEffect(()=>{const{width:h,height:m,top:y,left:v,right:g,bottom:x,direction:w}=l.current;if(t||i===!1||!a.current||!h||!m)return;const k=w==="rtl",j=n==="left"?k?`right: ${g}`:`left: ${v}`:k?`left: ${v}`:`right: ${g}`,_=r==="bottom"?`bottom: ${x}`:`top: ${y}`;a.current.dataset.motionPopId=o;const S=document.createElement("style");c&&(S.nonce=c);const E=s??document.head;return E.appendChild(S),S.sheet&&S.sheet.insertRule(`
79
- [data-motion-pop-id="${o}"] {
80
- position: absolute !important;
81
- width: ${h}px !important;
82
- height: ${m}px !important;
83
- ${j}px !important;
84
- ${_}px !important;
85
- }
86
- `),()=>{var T;(T=a.current)==null||T.removeAttribute("data-motion-pop-id"),E.contains(S)&&E.removeChild(S)}},[t]),d.jsx(Tz,{isPresent:t,childRef:a,sizeRef:l,pop:i,children:i===!1?e:b.cloneElement(e,{ref:f})})}const Rz=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:o,anchorX:a,anchorY:l,root:c})=>{const u=Mm(Az),f=b.useId();let p=!0,h=b.useMemo(()=>(p=!1,{id:f,initial:t,isPresent:n,custom:s,onExitComplete:m=>{u.set(m,!0);for(const y of u.values())if(!y)return;r&&r()},register:m=>(u.set(m,!1),()=>u.delete(m))}),[n,u,r]);return i&&p&&(h={...h}),b.useMemo(()=>{u.forEach((m,y)=>u.set(y,!1))},[n]),b.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=d.jsx(Nz,{pop:o==="popLayout",isPresent:n,anchorX:a,anchorY:l,root:c,children:e}),d.jsx(Pu.Provider,{value:h,children:e})};function Az(){return new Map}function kS(e=!0){const t=b.useContext(Pu);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 vl=e=>e.key||"";function f0(e){const t=[];return b.Children.forEach(e,n=>{b.isValidElement(n)&&t.push(n)}),t}const Iz=({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]=kS(o),p=b.useMemo(()=>f0(e),[e]),h=o&&!u?[]:p.map(vl),m=b.useRef(!0),y=b.useRef(p),v=Mm(()=>new Map),g=b.useRef(new Set),[x,w]=b.useState(p),[k,j]=b.useState(p);Yk(()=>{m.current=!1,y.current=p;for(let E=0;E<k.length;E++){const T=vl(k[E]);h.includes(T)?(v.delete(T),g.current.delete(T)):v.get(T)!==!0&&v.set(T,!1)}},[k,h.length,h.join("-")]);const _=[];if(p!==x){let E=[...p];for(let T=0;T<k.length;T++){const P=k[T],A=vl(P);h.includes(A)||(E.splice(T,0,P),_.push(P))}return i==="wait"&&_.length&&(E=_),j(f0(E)),w(p),null}const{forceRender:S}=b.useContext(Im);return d.jsx(d.Fragment,{children:k.map(E=>{const T=vl(E),P=o&&!u?!1:p===k||h.includes(T),A=()=>{if(g.current.has(T))return;if(v.has(T))g.current.add(T),v.set(T,!0);else return;let I=!0;v.forEach(O=>{O||(I=!1)}),I&&(S==null||S(),j(y.current),o&&(f==null||f()),r&&r())};return d.jsx(Rz,{isPresent:P,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:i,root:c,onExitComplete:P?void 0:A,anchorX:a,anchorY:l,children:E},T)})})},_S=b.createContext({strict:!1}),h0={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 p0=!1;function Mz(){if(p0)return;const e={};for(const t in h0)e[t]={isEnabled:n=>h0[t].some(r=>!!n[r])};J_(e),p0=!0}function SS(){return Mz(),yO()}function Lz(e){const t=SS();for(const n in e)t[n]={...t[n],...e[n]};J_(t)}const Dz=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 Jc(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Dz.has(e)}let CS=e=>!Jc(e);function Fz(e){typeof e=="function"&&(CS=t=>t.startsWith("on")?!Jc(t):e(t))}try{Fz(require("@emotion/is-prop-valid").default)}catch{}function Oz(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||Xe(e[s])||(CS(s)||n===!0&&Jc(s)||!t&&!Jc(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const Ru=b.createContext({});function zz(e,t){if(Nu(e)){const{initial:n,animate:r}=e;return{initial:n===!1||va(n)?n:void 0,animate:va(r)?r:void 0}}return e.inherit!==!1?t:{}}function $z(e){const{initial:t,animate:n}=zz(e,b.useContext(Ru));return b.useMemo(()=>({initial:t,animate:n}),[m0(t),m0(n)])}function m0(e){return Array.isArray(e)?e.join(" "):e}const og=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function jS(e,t,n){for(const r in t)!Xe(t[r])&&!iS(r,n)&&(e[r]=t[r])}function Bz({transformTemplate:e},t){return b.useMemo(()=>{const n=og();return rg(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Vz(e,t){const n=e.style||{},r={};return jS(r,n,e),Object.assign(r,Bz(e,t)),r}function Uz(e,t){const n={},r=Vz(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 PS=()=>({...og(),attrs:{}});function Wz(e,t,n,r){const s=b.useMemo(()=>{const i=PS();return oS(i,t,lS(r),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};jS(i,e.style,e),s.style={...i,...s.style}}return s}const Hz=["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 ag(e){return typeof e!="string"||e.includes("-")?!1:!!(Hz.indexOf(e)>-1||/[A-Z]/u.test(e))}function Gz(e,t,n,{latestValues:r},s,i=!1,o){const l=(o??ag(e)?Wz:Uz)(t,r,s,e),c=Oz(t,typeof e=="string",i),u=e!==b.Fragment?{...c,...l,ref:n}:{},{children:f}=t,p=b.useMemo(()=>Xe(f)?f.get():f,[f]);return b.createElement(e,{...u,children:p})}function Kz({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:qz(n,r,s,e),renderState:t()}}function qz(e,t,n,r){const s={},i=r(e,{});for(const p in i)s[p]=rc(i[p]);let{initial:o,animate:a}=e;const l=Nu(e),c=Y_(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"&&!Tu(f)){const p=Array.isArray(f)?f:[f];for(let h=0;h<p.length;h++){const m=Qm(e,p[h]);if(m){const{transitionEnd:y,transition:v,...g}=m;for(const x in g){let w=g[x];if(Array.isArray(w)){const k=u?w.length-1:0;w=w[k]}w!==null&&(s[x]=w)}for(const x in y)s[x]=y[x]}}}return s}const ES=e=>(t,n)=>{const r=b.useContext(Ru),s=b.useContext(Pu),i=()=>Kz(e,t,r,s);return n?i():Mm(i)},Qz=ES({scrapeMotionValuesFromProps:sg,createRenderState:og}),Yz=ES({scrapeMotionValuesFromProps:cS,createRenderState:PS}),Xz=Symbol.for("motionComponentSymbol");function Jz(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 TS=b.createContext({});function Xs(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Zz(e,t,n,r,s,i){var w,k;const{visualElement:o}=b.useContext(Ru),a=b.useContext(_S),l=b.useContext(Pu),c=b.useContext(ig),u=c.reducedMotion,f=c.skipAnimations,p=b.useRef(null),h=b.useRef(!1);r=r||a.renderer,!p.current&&r&&(p.current=r(e,{visualState:t,parent:o,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:u,skipAnimations:f,isSVG:i}),h.current&&p.current&&(p.current.manuallyAnimateOnMount=!0));const m=p.current,y=b.useContext(TS);m&&!m.projection&&s&&(m.type==="html"||m.type==="svg")&&e$(p.current,n,s,y);const v=b.useRef(!1);b.useInsertionEffect(()=>{m&&v.current&&m.update(n,l)});const g=n[O_],x=b.useRef(!!g&&typeof window<"u"&&!((w=window.MotionHandoffIsComplete)!=null&&w.call(window,g))&&((k=window.MotionHasOptimisedAnimation)==null?void 0:k.call(window,g)));return Yk(()=>{h.current=!0,m&&(v.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 j;(j=window.MotionHandoffMarkAsComplete)==null||j.call(window,g)}),x.current=!1),m.enteringChildren=void 0)}),m}function e$(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:NS(e.parent)),e.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!o||a&&Xs(a),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:f,layoutScroll:l,layoutRoot:c,layoutAnchor:u})}function NS(e){if(e)return e.options.allowProjection!==!1?e.projection:NS(e.parent)}function nf(e,{forwardMotionProps:t=!1,type:n}={},r,s){r&&Lz(r);const i=n?n==="svg":ag(e),o=i?Yz:Qz;function a(c,u){let f;const p={...b.useContext(ig),...c,layoutId:t$(c)},{isStatic:h}=p,m=$z(c),y=o(c,h);if(!h&&typeof window<"u"){n$();const v=r$(p);f=v.MeasureLayout,m.visualElement=Zz(e,y,p,s,v.ProjectionNode,i)}return d.jsxs(Ru.Provider,{value:m,children:[f&&m.visualElement?d.jsx(f,{visualElement:m.visualElement,...p}):null,Gz(e,c,Jz(y,m.visualElement,u),y,h,t,i)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const l=b.forwardRef(a);return l[Xz]=e,l}function t$({layoutId:e}){const t=b.useContext(Im).id;return t&&e!==void 0?t+"-"+e:e}function n$(e,t){b.useContext(_S).strict}function r$(e){const t=SS(),{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 s$(e,t){if(typeof Proxy>"u")return nf;const n=new Map,r=(i,o)=>nf(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,nf(o,void 0,e,t)),n.get(o))})}const i$=(e,t)=>t.isSVG??ag(e)?new MO(t):new EO(t,{allowProjection:e!==b.Fragment});class o$ extends es{constructor(t){super(t),t.animationState||(t.animationState=zO(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Tu(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 a$=0;class l$ extends es{constructor(){super(...arguments),this.id=a$++,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 p in f)(i=this.node.getValue(p))==null||i.jump(f[p])}}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 c$={animation:{Feature:o$},exit:{Feature:l$}};function Ma(e){return{point:{x:e.pageX,y:e.pageY}}}const u$=e=>t=>Jm(t)&&e(t,Ma(t));function qo(e,t,n,r){return wa(e,t,u$(n),r)}const RS=({current:e})=>e?e.ownerDocument.defaultView:null,g0=(e,t)=>Math.abs(e-t);function d$(e,t){const n=g0(e.x,t.x),r=g0(e.y,t.y);return Math.sqrt(n**2+r**2)}const y0=new Set(["auto","scroll"]);class AS{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=h=>{this.handleScroll(h.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=wl(this.lastRawMoveEventInfo,this.transformPagePoint));const h=rf(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,y=d$(h.offset,{x:0,y:0})>=this.distanceThreshold;if(!m&&!y)return;const{point:v}=h,{timestamp:g}=Ye;this.history.push({...v,timestamp:g});const{onStart:x,onMove:w}=this.handlers;m||(x&&x(this.lastMoveEvent,h),this.startEvent=this.lastMoveEvent),w&&w(this.lastMoveEvent,h)},this.handlePointerMove=(h,m)=>{this.lastMoveEvent=h,this.lastRawMoveEventInfo=m,this.lastMoveEventInfo=wl(m,this.transformPagePoint),xe.update(this.updatePoint,!0)},this.handlePointerUp=(h,m)=>{this.end();const{onEnd:y,onSessionEnd:v,resumeAnimation:g}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&g&&g(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=rf(h.type==="pointercancel"?this.lastMoveEventInfo:wl(m,this.transformPagePoint),this.history);this.startEvent&&y&&y(h,x),v&&v(h,x)},!Jm(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=s||window;const l=Ma(t),c=wl(l,this.transformPagePoint),{point:u}=c,{timestamp:f}=Ye;this.history=[{...u,timestamp:f}];const{onSessionStart:p}=n;p&&p(t,rf(c,this.history)),this.removeListeners=Ra(qo(this.contextWindow,"pointermove",this.handlePointerMove),qo(this.contextWindow,"pointerup",this.handlePointerUp),qo(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(y0.has(r.overflowX)||y0.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(),Hr(this.updatePoint)}}function wl(e,t){return t?{point:t(e.point)}:e}function x0(e,t){return{x:e.x-t.x,y:e.y-t.y}}function rf({point:e},t){return{point:e,delta:x0(e,IS(t)),offset:x0(e,f$(t)),velocity:h$(t,.1)}}function f$(e){return e[0]}function IS(e){return e[e.length-1]}function h$(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=IS(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>Ft(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&s.timestamp-r.timestamp>Ft(t)*2&&(r=e[1]);const i=en(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 p$(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 v0(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 m$(e,{top:t,left:n,bottom:r,right:s}){return{x:v0(e.x,n,s),y:v0(e.y,t,r)}}function w0(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 g$(e,t){return{x:w0(e.x,t.x),y:w0(e.y,t.y)}}function y$(e,t){let n=.5;const r=dt(e),s=dt(t);return s>r?n=ya(t.min,t.max-r,e.min):r>s&&(n=ya(e.min,e.max-s,t.min)),On(0,1,n)}function x$(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 tp=.35;function v$(e=tp){return e===!1?e=0:e===!0&&(e=tp),{x:b0(e,"left","right"),y:b0(e,"top","bottom")}}function b0(e,t,n){return{min:k0(e,t),max:k0(e,n)}}function k0(e,t){return typeof e=="number"?e:e[t]||0}const w$=new WeakMap;class b${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,p)=>{const{drag:h,dragPropagation:m,onDragStart:y}=this.getProps();if(h&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=qF(h),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=p,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Tn(g=>{let x=this.getAxisMotionValue(g).get()||0;if(Dn.test(x)){const{projection:w}=this.visualElement;if(w&&w.layout){const k=w.layout.layoutBox[g];k&&(x=dt(k)*(parseFloat(x)/100))}}this.originPoint[g]=x}),y&&xe.update(()=>y(f,p),!1,!0),Gh(this.visualElement,"transform");const{animationState:v}=this.visualElement;v&&v.setActive("whileDrag",!0)},a=(f,p)=>{this.latestPointerEvent=f,this.latestPanInfo=p;const{dragPropagation:h,dragDirectionLock:m,onDirectionLock:y,onDrag:v}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:g}=p;if(m&&this.currentDirection===null){this.currentDirection=_$(g),this.currentDirection!==null&&y&&y(this.currentDirection);return}this.updateAxis("x",p.point,g),this.updateAxis("y",p.point,g),this.visualElement.render(),v&&xe.update(()=>v(f,p),!1,!0)},l=(f,p)=>{this.latestPointerEvent=f,this.latestPanInfo=p,this.stop(f,p),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 AS(t,{onSessionStart:i,onStart:o,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:r,contextWindow:RS(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||!bl(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=p$(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&&Xs(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=m$(r.layoutBox,t):this.constraints=!1,this.elastic=v$(n),s!==this.constraints&&!Xs(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&Tn(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=x$(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Xs(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=kO(r,s.root,this.visualElement.getTransformPagePoint());let o=g$(s.layout.layoutBox,i);if(n){const a=n(vO(o));this.hasMutatedConstraints=!!a,a&&(o=eS(a))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=Tn(u=>{if(!bl(u,n,this.currentDirection))return;let f=l&&l[u]||{};(o===!0||o===u)&&(f={min:0,max:0});const p=s?200:1e6,h=s?40:1e7,m={type:"inertia",velocity:r?t[u]:0,bounceStiffness:p,bounceDamping:h,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 Gh(this.visualElement,t),r.start(qm(t,r,0,n,this.visualElement,!1))}stopAnimation(){Tn(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){Tn(n=>{const{drag:r}=this.getProps();if(!bl(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(!Xs(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Tn(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();s[o]=y$({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(),Tn(o=>{if(!bl(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;w$.set(this.visualElement,this);const t=this.visualElement.current,n=qo(t,"pointerdown",c=>{const{drag:u,dragListener:f=!0}=this.getProps(),p=c.target,h=p!==t&&eO(p);u&&f&&!h&&this.start(c)});let r;const s=()=>{const{dragConstraints:c}=this.getProps();Xs(c)&&c.current&&(this.constraints=this.resolveRefConstraints(),r||(r=k$(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=wa(window,"resize",()=>this.scalePositionWithinConstraints()),l=i.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(Tn(f=>{const p=this.getAxisMotionValue(f);p&&(this.originPoint[f]+=c[f].translate,p.set(p.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=tp,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:a}}}function _0(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function k$(e,t,n){const r=Nv(e,_0(n)),s=Nv(t,_0(n));return()=>{r(),s()}}function bl(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function _$(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class S$ extends es{constructor(t){super(t),this.removeGroupControls=nn,this.removeListeners=nn,this.controls=new b$(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 sf=e=>(t,n)=>{e&&xe.update(()=>e(t,n),!1,!0)};class C$ extends es{constructor(){super(...arguments),this.removePointerDownListener=nn}onPointerDown(t){this.session=new AS(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:RS(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:sf(t),onStart:sf(n),onMove:sf(r),onEnd:(i,o)=>{delete this.session,s&&xe.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=qo(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 of=!1;class j$ 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),of&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),sc.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}),of=!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(),Xm.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;of=!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 MS(e){const[t,n]=kS(),r=b.useContext(Im);return d.jsx(j$,{...e,layoutGroup:r,switchLayoutGroup:b.useContext(TS),isPresent:t,safeToRemove:n})}const P$={pan:{Feature:C$},drag:{Feature:S$,ProjectionNode:bS,MeasureLayout:MS}};function S0(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 E$ extends es{mount(){const{current:t}=this.node;t&&(this.unmount=YF(t,(n,r)=>(S0(this.node,r,"Start"),s=>S0(this.node,s,"End"))))}unmount(){}}class T$ extends es{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(wa(this.node.current,"focus",()=>this.onFocus()),wa(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function C0(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 N$ extends es{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=nO(t,(s,i)=>(C0(this.node,i,"Start"),(o,{success:a})=>C0(this.node,o,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const np=new WeakMap,af=new WeakMap,R$=e=>{const t=np.get(e.target);t&&t(e)},A$=e=>{e.forEach(R$)};function I$({root:e,...t}){const n=e||document;af.has(n)||af.set(n,{});const r=af.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(A$,{root:e,...t})),r[s]}function M$(e,t,n){const r=I$(t);return np.set(e,n),r.observe(e),()=>{np.delete(e),r.unobserve(e)}}const L$={some:0,all:1};class D$ extends es{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:L$[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:p}=this.node.getProps(),h=u?f:p;h&&h(c)};this.stopObserver=M$(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(F$(t,n))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function F$({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const O$={inView:{Feature:D$},tap:{Feature:N$},focus:{Feature:T$},hover:{Feature:E$}},z$={layout:{ProjectionNode:bS,MeasureLayout:MS}},$$={...c$,...O$,...P$,...z$},j0=s$($$,i$);function B$(){!ng.current&&X_();const[e]=b.useState(qc.current);return e}function Au(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 lf={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 V$={4:"1rem"};function Y(...e){return jD(qL(e))}const U$={height:32,lineHeight:"32px",padding:"0 16px"},W$={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")`},H$={white:J.bgBase,paper:J.bgSurface,speckle:J.bgSurface,parchment:J.bgElevated,canvas:J.canvasBase,kraft:J.canvas300,chalkboard:J.chalkboardBg},P0={white:J.bgElevated,paper:J.bgElevated,speckle:J.bgElevated,parchment:J.canvasBase,canvas:J.canvas300,kraft:J.canvasDark,chalkboard:J.chalkboardBg},G$={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},K$={blue:"rgba(168, 200, 216, 0.35)",brown:"rgba(164, 144, 120, 0.35)",black:"rgba(61, 53, 43, 0.15)"};function LS(e){const t=typeof e=="string"?{texture:e}:e,n=t.texture??"paper",r=t.ruledType??"none",s=t.ruledColor??"blue",i=W$[n],o=t.fill?G$[t.fill]:t.shade?P0[n]:H$[n],a=K$[s],l={"--pui-texture-shade":P0[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 Fi(e){return LS(e)}function Ki(e,t="paper"){if(e!==!1)return Fi(e===!0?t:e)}function q$(e){const t=Mu((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 Iu(l)}function Q$(e,t){const n=Mu(`${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,p=a+(n()-.5)*l*2;c.push({x:i+Math.cos(f)*p,y:o+Math.sin(f)*p})}return Iu(c)}function Y$(e){const t=Mu((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,p=l.ay+(l.by-l.ay)*u,h=l.bx-l.ax,m=l.by-l.ay,y=Math.sqrt(h*h+m*m)||1,v=-m/y,g=h/y,x=(t()-.5)*i*2;o.push({x:f+v*x,y:p+g*x})}return Iu(o)}function X$(e,t){const n=Mu(`${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,p=c.ax+(c.bx-c.ax)*f,h=c.ay+(c.by-c.ay)*f,m=c.bx-c.ax,y=c.by-c.ay,v=Math.sqrt(m*m+y*y)||1,g=-y/v,x=m/v,w=(n()-.5)*o*2;a.push({x:p+g*w,y:h+x*w})}return Iu(a)}function Iu(e){const t=e.length;if(t<3)return"";let n=`M ${fr(e[0].x)} ${fr(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 ${fr(l)} ${fr(c)}, ${fr(u)} ${fr(f)}, ${fr(o.x)} ${fr(o.y)}`}return n+=" Z",n}function fr(e){return e.toFixed(2)}function Mu(e){let t=typeof e=="string"?J$(e):e;return()=>(t=t*16807%2147483647,(t-1)/2147483646)}function J$(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 Lu(){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=Lu();return b.useMemo(()=>({blob:q$({seed:t,wobble:e}),ring:Q$(t,e)}),[t,e])}const Z$="button-module__button___Z331g",e4="button-module__blobBg___QQFzf",t4="button-module__blobFill___XwLjV",n4="button-module__blobRing___567UW",r4="button-module__isActive___FXNSJ",s4="button-module__primary___ppbyq",i4="button-module__secondary___esy5L",o4="button-module__ghost___NisA0",a4="button-module__danger___Wnvuq",l4="button-module__chalkboard___d3Nqb",c4="button-module__tiny___8ZZ7A",u4="button-module__small___u7y8a",d4="button-module__medium___HBIAj",f4="button-module__large___RPzNy",h4="button-module__fullWidth___H0P0F",p4="button-module__iconLeft___s60SZ",m4="button-module__iconRight___75eFu",g4="button-module__label___pXAyM",Ht={button:Z$,blobBg:e4,blobFill:t4,blobRing:n4,isActive:r4,primary:s4,secondary:i4,ghost:o4,danger:a4,chalkboard:l4,tiny:c4,small:u4,medium:d4,large:f4,fullWidth:h4,iconLeft:p4,iconRight:m4,label:g4},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 p=qi(o);return d.jsxs("button",{ref:f,type:"button",className:Y(Ht.button,Ht[e],Ht[n],t==="chalkboard"&&Ht.chalkboard,a&&Ht.isActive,i&&Ht.fullWidth,c),...u,children:[d.jsxs("svg",{className:Ht.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[d.jsx("path",{d:p.blob,className:Ht.blobFill}),d.jsx("path",{d:p.ring,className:Ht.blobRing})]}),r&&d.jsx("span",{className:Ht.iconLeft,children:r}),d.jsx("span",{className:Ht.label,children:l}),s&&d.jsx("span",{className:Ht.iconRight,children:s})]})});function lg(e){return{blue:e.accentBlue,green:e.accentGreen,amber:e.accentAmber,rose:e.accentRose,slate:e.accentSlate}}const Oe=UD.generator(),y4="sketch-border-module__svg___whV4x",x4="sketch-border-module__behind___lgdYV",v4="sketch-border-module__stroke___vAm-v",w4="sketch-border-module__fill___zlpd6",kl={svg:y4,behind:x4,stroke:v4,fill:w4},b4=1.2,k4=.7;function Ct({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[p]=b.useState(Math.random),h=b.useRef(null),[m,y]=b.useState(null);b.useEffect(()=>{var x;const w=(x=h.current)==null?void 0:x.parentElement;if(!w)return;const k=new ResizeObserver(()=>{const j=w.offsetWidth,_=w.offsetHeight;y(S=>S&&S.width===j&&S.height===_?S:{width:j,height:_})});return k.observe(w),()=>k.disconnect()},[]);const{parts:v,clipPath:g}=b.useMemo(()=>{if(!m||m.width<8||m.height<8)return{parts:null,clipPath:null};const x=Math.max(1,Math.round(p*1e6)),w=x,k=x*2654435761%2147483647,j=T=>Oe.toPaths(Oe.path(T,{seed:w,roughness:n,bowing:r,preserveVertices:!0,strokeWidth:s})).filter(P=>!P.fill||P.fill==="none").map(P=>({d:P.d,filled:!1}));if(l){const T={seed:w,roughness:n,bowing:r,strokeWidth:s,disableMultiStroke:!0},P=I=>Oe.toPaths(I).filter(O=>!O.fill||O.fill==="none").map(O=>({d:O.d,filled:!1}));if(a){const I=_l(e,m,i,t,is(k),n*1.1),O=u?E0(s,n):0,M=O?_l(e,m,i+O,t,is(k),n*1.1):I;return{parts:P(Oe.path(M,{...T,preserveVertices:!0})),clipPath:I}}const A=e==="circle"?Oe.ellipse(m.width/2,m.height/2,m.width-i*2,m.height-i*2,T):Oe.path(cf(m,i,t,is(w)),{...T,preserveVertices:!0});return{parts:P(A),clipPath:null}}if(a){if(c){const I=cf(m,i,t,is(k)),O=Oe.toPaths(Oe.path(I,{seed:w,roughness:b4,bowing:k4,preserveVertices:!0,strokeWidth:s})).filter(M=>!M.fill||M.fill==="none").map(M=>({d:M.d,filled:!1}));return{parts:O.length?O:[{d:I,filled:!1}],clipPath:I}}const T=_l(e,m,i,t,is(k),n*1.1),P=u?E0(s,n):0,A=P?_l(e,m,i+P,t,is(k),n*1.1):T;return{parts:j(A),clipPath:T}}const _=(T,P)=>{const A=P?{fill:"#000",fillStyle:"solid"}:{},I=e==="circle"?Oe.ellipse(m.width/2,m.height/2,m.width-i*2,m.height-i*2,{seed:T,roughness:n,bowing:r,strokeWidth:s,...A}):Oe.path(cf(m,i,t,is(T)),{seed:T,roughness:n,bowing:r,preserveVertices:!0,strokeWidth:s,...A});return Oe.toPaths(I)},S=o?_(k,!0).filter(T=>!!T.fill&&T.fill!=="none").map(T=>({d:T.d,filled:!0})):[],E=_(w,!1).filter(T=>!T.fill||T.fill==="none").map(T=>({d:T.d,filled:!1}));return{parts:[...S,...E],clipPath:null}},[m,p,a,l,c,e,t,n,r,s,i,o,u]);return b.useEffect(()=>{var x;const w=(x=h.current)==null?void 0:x.parentElement;if(w)return g?w.style.setProperty("--sketch-clip",`path("${g}")`):w.style.removeProperty("--sketch-clip"),()=>{w.style.removeProperty("--sketch-clip")}},[g]),d.jsx("svg",{ref:h,className:Y(kl.svg,o&&kl.behind,f),viewBox:m?`0 0 ${m.width} ${m.height}`:void 0,"aria-hidden":"true",children:v==null?void 0:v.map((x,w)=>x.filled?d.jsx("path",{className:kl.fill,d:x.d},`f-${w}`):d.jsx("path",{className:kl.stroke,d:x.d,strokeWidth:s},`s-${w}`))})}function E0(e,t){return e/2+t*1.5}function is(e){let t=e;return()=>(t=t*16807%2147483647,(t-1)/2147483646)}function _l(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 p=0;p<16;p++){const h=p/16*Math.PI*2;f.push({x:l+Math.cos(h)*o/2+u(),y:c+Math.sin(h)*a/2+u()})}else{const p=Math.max(2,Math.min(r,o/2,a/2)),h=n,m=n,y=(x,w,k)=>{for(const j of[0,45,90]){const _=(k+j)*Math.PI/180;f.push({x:x+Math.cos(_)*p+u(),y:w+Math.sin(_)*p+u()})}},v=(x,w,k,j)=>{const _=Math.hypot(k-x,j-w),S=Math.min(12,Math.max(1,Math.round(_/160)));for(let E=1;E<=S;E++){const T=E/(S+1);f.push({x:x+(k-x)*T+u(),y:w+(j-w)*T+u()})}};y(h+p,m+p,180),v(h+p,m,h+o-p,m),y(h+o-p,m+p,270),v(h+o,m+p,h+o,m+a-p),y(h+o-p,m+a-p,0),v(h+o-p,m+a,h+p,m+a),y(h+p,m+a-p,90),v(h,m+a-p,h,m+p);const g=3;return T0([...f.slice(g),...f.slice(0,g)])}return T0(f)}function T0(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),p=a.x-o.x+u*((o.x-i.x)/c-(a.x-i.x)/(c+u)),h=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)),y=a.y-o.y+u*((l.y-a.y)/f-(l.y-o.y)/(u+f)),v=o.x+p/3,g=o.y+h/3,x=a.x-m/3,w=a.y-y/3;r+=` C ${v.toFixed(2)} ${g.toFixed(2)}, ${x.toFixed(2)} ${w.toFixed(2)}, ${a.x.toFixed(2)} ${a.y.toFixed(2)}`}return`${r} Z`}function cf(e,t,n,r){const s=[0,0,0,0].map(()=>Math.max(2,n+(r()-.5)*3));return _4(t,t,e.width-t*2,e.height-t*2,s)}function _4(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 jt={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}},S4="page-module__page___-uHnG",C4="page-module__outlined___Wwtyg",j4="page-module__surface___sWfI6",P4="page-module__flat___HlOaY",E4="page-module__withAccent___lsv-m",T4="page-module__accentBlue___XxbMV",N4="page-module__accentGreen___Ne6Q8",R4="page-module__accentAmber___kLAwa",A4="page-module__accentRose___O9ZbZ",I4="page-module__accentSlate___xCB66",Js={page:S4,outlined:C4,surface:j4,flat:P4,withAccent:E4,accentBlue:T4,accentGreen:N4,accentAmber:R4,accentRose:A4,accentSlate:I4},M4=lg(Js),L4={all:14,top:14,none:2};function DS({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=Ki(r,{texture:"white",ruledType:"lines",ruledColor:"blue"})??{backgroundColor:"var(--pui-bg-base)"};return d.jsxs("div",{className:Y(Js.page,a&&Js.outlined,s&&Js.withAccent,s&&M4[i],!l&&Js.flat,t),style:n,children:[d.jsx(Ct,{clip:!0,...jt.surface,radius:L4[o],straight:!l}),d.jsx("div",{className:Js.surface,style:c,children:e})]})}const D4="layout-module__layout___O1aWi",F4="layout-module__header___I-kxe",O4="layout-module__headerLeft___JChJQ",z4="layout-module__headerTitles___aqSUG",$4="layout-module__headerTitle___wvr39",B4="layout-module__headerSubtitle___6f5BD",V4="layout-module__headerActions___adC12",U4="layout-module__mobileToggle___4WpVG",W4="layout-module__body___tywNf",H4="layout-module__mobileOverlay___tzbBC",G4="layout-module__sidebar___8VKGq",K4="layout-module__sidebarOpen___47rtr",q4="layout-module__sidebarInner___tq2X6",Q4="layout-module__logoArea___RLnC0",Y4="layout-module__logoText___pAmfV",X4="layout-module__nav___FxcrZ",J4="layout-module__main___9z7bu",Z4="layout-module__navIslandFixed___H4TwP",eB="layout-module__content___jL-VB",tB="layout-module__contentWithPage___vVdfN",nB="layout-module__footer___LyakU",rB="layout-module__footerText___8BYxc",Ae={layout:D4,header:F4,headerLeft:O4,headerTitles:z4,headerTitle:$4,headerSubtitle:B4,headerActions:V4,mobileToggle:U4,body:W4,mobileOverlay:H4,sidebar:G4,sidebarOpen:K4,sidebarInner:q4,logoArea:Q4,logoText:Y4,nav:X4,main:J4,navIslandFixed:Z4,content:eB,contentWithPage:tB,footer:nB,footerText:rB};function sB(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"}:Fi(e)}function iB({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:p,onNavigate:h,logo:m,footerContent:y,navigationIsland:v,style:g,bleedBottom:x=!0,routeKey:w,stackOpen:k}){const[j,_]=b.useState(!1),S=B$();Au(j,()=>_(!1));const E=sB(i),T=r&&f.length>0,P=c!==void 0||u!==void 0?{...u!==void 0?Fi(u):{},...c!==void 0?{height:typeof c=="number"?`${c}px`:c}:{}}:void 0;return d.jsxs("div",{className:Ae.layout,style:{...E,...g},children:[t&&d.jsxs("header",{className:Ae.header,style:P,children:[d.jsxs("div",{className:Ae.headerLeft,children:[T&&d.jsx("button",{type:"button",className:Ae.mobileToggle,onClick:()=>_(!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:[j&&d.jsx("button",{type:"button",className:Ae.mobileOverlay,onClick:()=>_(!1),"aria-label":"Close navigation",tabIndex:-1}),T&&d.jsx("aside",{className:Y(Ae.sidebar,j&&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(A=>{const I=A.id===p;return d.jsx(se,{variant:"ghost",size:"small",isActive:I,onClick:()=>{h==null||h(A),_(!1)},"aria-current":I?"page":void 0,icon:A.icon,style:U$,children:A.label},A.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 A=w!==void 0?d.jsx(Iz,{mode:"wait",children:d.jsx(j0.div,{initial:S?void 0:{opacity:0,y:8},animate:{opacity:1,y:0},exit:S?void 0:{opacity:0,y:-8},transition:{duration:.2,ease:"easeOut"},style:{height:"100%"},children:e},w)}):e;return s?d.jsx(DS,{rounded:x?"top":"all",style:x&&v?{paddingBottom:`calc(${lf.navIslandBottom} + ${lf.navIslandHeight} + ${V$[4]})`}:void 0,children:A}):A})()})})]}),v&&d.jsx("div",{className:Ae.navIslandFixed,children:k!==void 0?d.jsx(j0.div,{animate:{x:k?`-${lf.stackPanelWidth/2}px`:0},transition:{duration:S?0:.3,ease:[.4,0,.2,1]},children:v}):v}),n&&d.jsx("footer",{className:Ae.footer,children:y||d.jsx("p",{className:Ae.footerText,children:"Paper UI — Natural Materials Component Library"})})]})}const oB="checkbox-module__wrapper___uLYMI",aB="checkbox-module__blobFill___mPJSR",lB="checkbox-module__input___Ptgt7",cB="checkbox-module__blobBg___bw3sn",uB="checkbox-module__labelLeft___-vAmH",dB="checkbox-module__box___yAh-r",fB="checkbox-module__checkmark___tTyBz",hB="checkbox-module__indeterminateLine___IosI-",pB="checkbox-module__boxWrapper___byjoS",mB="checkbox-module__icon___RO-yn",gB="checkbox-module__labelText___bAnLr",yB="checkbox-module__chalkboard___sv6SL",Rt={wrapper:oB,blobFill:aB,input:lB,blobBg:cB,labelLeft:uB,box:dB,checkmark:fB,indeterminateLine:hB,boxWrapper:pB,icon:mB,labelText:gB,chalkboard:yB},xB=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(),p=l??f,h=qi(r),m=b.useRef(null);return b.useEffect(()=>{m.current&&(m.current.indeterminate=n)},[n]),d.jsxs("label",{className:Y(Rt.wrapper,t==="left"&&Rt.labelLeft,s==="chalkboard"&&Rt.chalkboard,i),htmlFor:p,children:[d.jsxs("span",{className:Rt.boxWrapper,children:[d.jsx("input",{ref:y=>{m.current=y,typeof u=="function"?u(y):u&&(u.current=y)},id:p,type:"checkbox",className:Rt.input,checked:o,onChange:a,...c}),d.jsx("svg",{className:Rt.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:d.jsx("path",{d:h.blob,className:Rt.blobFill})}),d.jsxs("span",{className:Rt.box,"aria-hidden":"true",children:[d.jsx(Ct,{smooth:!0,...jt.control}),n?d.jsx("svg",{viewBox:"0 0 20 20",fill:"none",className:Rt.icon,children:d.jsx("line",{x1:"4",y1:"10",x2:"16",y2:"10",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",className:Rt.indeterminateLine})}):d.jsx("svg",{viewBox:"0 0 20 20",fill:"none",className:Rt.icon,children:d.jsx("path",{d:"M4 10 L8 14 L16 6",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:Rt.checkmark})})]})]}),e&&d.jsx("span",{className:Rt.labelText,children:e})]})}),vB="icon-button-module__iconButton___avg6i",wB="icon-button-module__blobBg___466Vy",bB="icon-button-module__blobFill___FTN1g",kB="icon-button-module__blobRing___hRdQb",_B="icon-button-module__isActive___XlvtM",SB="icon-button-module__icon___h204x",CB="icon-button-module__ghost___Wbxog",jB="icon-button-module__danger___p0Xz5",PB="icon-button-module__tiny___4WYvA",EB="icon-button-module__small___bPnCU",TB="icon-button-module__medium___nOxPf",NB="icon-button-module__large___UBU5z",RB="icon-button-module__chalkboard___mi0sQ",Wn={iconButton:vB,blobBg:wB,blobFill:bB,blobRing:kB,isActive:_B,icon:SB,default:"icon-button-module__default___9frNR",ghost:CB,danger:jB,tiny:PB,small:EB,medium:TB,large:NB,chalkboard:RB},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:Y(Wn.iconButton,Wn[t],n==="chalkboard"&&Wn.chalkboard,Wn[r],o&&Wn.isActive,a),"aria-label":s,title:s,...l,children:[d.jsxs("svg",{className:Wn.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[d.jsx("path",{d:u.blob,className:Wn.blobFill}),d.jsx("path",{d:u.ring,className:Wn.blobRing})]}),d.jsx("span",{className:Wn.icon,children:e})]})}),AB="stamp-module__stamp___5qaNY",IB="stamp-module__small___BBlBg",MB="stamp-module__medium___HG2YD",LB="stamp-module__large___aUT0I",DB="stamp-module__blobBg___Mdrdd",FB="stamp-module__blobFill___QyCeB",OB="stamp-module__blobRing___EUDx7",zB="stamp-module__dot___qZyCR",$B="stamp-module__label___T89iH",BB="stamp-module__chalkboard___syI4T",hr={stamp:AB,small:IB,medium:MB,large:LB,blobBg:DB,blobFill:FB,blobRing:OB,dot:zB,label:$B,chalkboard:BB},uf={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)}},N0={fill:nt(J.chalkboardBorderBase,.1),ring:nt(J.chalkboardBorderBase,.35)};function Pe({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?N0.ring:uf[n].ring:void 0,p=s??(n?u?N0.fill:uf[n].fill:"transparent"),h=i??(n&&!u?uf[n].text:void 0);return d.jsxs("span",{className:Y(hr.stamp,hr[t],u&&hr.chalkboard,l),style:h?{color:h}:void 0,children:[d.jsxs("svg",{className:hr.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[d.jsx("path",{d:c.blob,className:hr.blobFill,style:{fill:p}}),f&&d.jsx("path",{d:c.ring,className:hr.blobRing,style:{stroke:f}})]}),r&&d.jsx("span",{className:hr.dot,"aria-hidden":"true"}),d.jsx("span",{className:hr.label,children:e})]})}const VB="copy-button-module__copyButton___-hTo4",UB="copy-button-module__dark___O45N-",WB="copy-button-module__chalkboard___hW4aw",HB="copy-button-module__copied___XlHFr",Sl={copyButton:VB,dark:UB,chalkboard:WB,copied:HB};function rp({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:Y(Sl.copyButton,t==="dark"&&Sl.dark,n==="chalkboard"&&Sl.chalkboard,i&&Sl.copied,r),...s,children:i?"Copied!":"Copy"})}const GB="code-block-module__codeBlock___dq28o",KB="code-block-module__header___42Fek",qB="code-block-module__relative___oO-zy",QB="code-block-module__copyOverlay___PjAuq",YB="code-block-module__pre___zXzLZ",XB="code-block-module__chalkboard___bdo9J",JB="code-block-module__chalkboardHeader___3RiVd",ZB="code-block-module__chalkboardPre___iRBFR",pr={codeBlock:GB,header:KB,relative:qB,copyOverlay:QB,pre:YB,chalkboard:XB,chalkboardHeader:JB,chalkboardPre:ZB};function j7({code:e,filename:t,surface:n="paper"}){return d.jsxs("div",{className:Y(pr.codeBlock,n==="chalkboard"&&pr.chalkboard),children:[t&&d.jsxs("div",{className:Y(pr.header,n==="chalkboard"&&pr.chalkboardHeader),children:[d.jsx("span",{children:t}),d.jsx(rp,{text:e,variant:"light",surface:n})]}),!t&&d.jsx("div",{className:pr.relative,children:d.jsx("div",{className:pr.copyOverlay,children:d.jsx(rp,{text:e,variant:"dark",surface:n})})}),d.jsx("pre",{className:Y(pr.pre,n==="chalkboard"&&pr.chalkboardPre),children:d.jsx("code",{children:e})})]})}function Du({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 FS({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 OS({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 e5({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 t5({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 zS({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 n5="table-module__tableFrame___KP-90",r5="table-module__tableWrapper___gc3Y3",s5="table-module__toolbar___zhCel",i5="table-module__toolbarTitle___D8oH-",o5="table-module__panelFooter___lCCKo",a5="table-module__compact___mG-2Y",l5="table-module__toolbarActions___EX6qS",c5="table-module__search___zIBk2",u5="table-module__searchIcon___ayhK8",d5="table-module__searchInput___PqsEG",f5="table-module__tableScroll___1gvc4",h5="table-module__table___tdU5g",p5="table-module__th___GQbKk",m5="table-module__td___WktB5",g5="table-module__footerCell___bM-jv",y5="table-module__tr___xeZno",x5="table-module__expandTh___uxkR4",v5="table-module__expandTd___VoBRC",w5="table-module__expandIcon___8V45X",b5="table-module__expandable___R7o2l",k5="table-module__footerRow___ik1DH",_5="table-module__expandedRow___1TbTQ",S5="table-module__expandedCell___sKAaD",C5="table-module__boardScroll___Y1yqm",j5="table-module__board___kFAI-",P5="table-module__boardColumn___-W9bP",E5="table-module__boardColumnHeader___kY3Fj",T5="table-module__accentBlue___PEJ1V",N5="table-module__accentGreen___wJ53r",R5="table-module__accentAmber___Iezjv",A5="table-module__accentRose___W8zxc",I5="table-module__accentSlate___oUZCX",M5="table-module__boardColumnLabel___JBEed",L5="table-module__boardColumnCount___Pkpiq",D5="table-module__boardColumnBody___uAgRF",F5="table-module__boardRow___C1P60",O5="table-module__boardEmpty___IKv2W",z5="table-module__chalkboardFrame___xB3N5",$5="table-module__chalkboardWrapper___KjY5r",B5="table-module__chalkboard___v0m3A",re={tableFrame:n5,tableWrapper:r5,toolbar:s5,toolbarTitle:i5,panelFooter:o5,compact:a5,toolbarActions:l5,search:c5,searchIcon:u5,searchInput:d5,tableScroll:f5,table:h5,th:p5,td:m5,footerCell:g5,tr:y5,expandTh:x5,expandTd:v5,expandIcon:w5,expandable:b5,footerRow:k5,expandedRow:_5,expandedCell:S5,boardScroll:C5,board:j5,boardColumn:P5,boardColumnHeader:E5,accentBlue:T5,accentGreen:N5,accentAmber:R5,accentRose:A5,accentSlate:I5,boardColumnLabel:M5,boardColumnCount:L5,boardColumnBody:D5,boardRow:F5,boardEmpty:O5,chalkboardFrame:z5,chalkboardWrapper:$5,chalkboard:B5},V5=lg(re);function U5({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:p=!1,density:h="comfortable",panelFooter:m,className:y}){const v=Ki(s,r==="chalkboard"?"chalkboard":"paper"),g=!!i,[x,w]=b.useState(new Set),k=S=>{w(E=>{const T=new Set(E);return T.has(S)?T.delete(S):T.add(S),T})},j=!!(o&&a),_=j?t.length+1:t.length;return d.jsxs("div",{className:Y(re.tableFrame,r==="chalkboard"&&re.chalkboardFrame,y),children:[d.jsx(Ct,{clip:!0,...jt.surface}),d.jsxs("div",{className:Y(re.tableWrapper,r==="chalkboard"&&re.chalkboardWrapper,h==="compact"&&re.compact),style:v,children:[g&&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(W5,{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:S=>{var E,T;return(T=(E=i.search)==null?void 0:E.onChange)==null?void 0:T.call(E,S.target.value)}}),d.jsx(Ct,{fill:!0,...jt.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(S=>d.jsxs("div",{className:re.boardColumn,children:[d.jsxs("div",{className:Y(re.boardColumnHeader,r==="chalkboard"&&re.chalkboard,S.accent&&V5[S.accent]),children:[d.jsx("span",{className:re.boardColumnLabel,children:S.label}),d.jsx("span",{className:re.boardColumnCount,children:S.items.length})]}),d.jsx("div",{className:re.boardColumnBody,children:S.items.length===0?d.jsx("div",{className:re.boardEmpty,children:S.emptyLabel??"empty"}):S.items.map((E,T)=>d.jsx("div",{className:Y(re.boardRow,r==="chalkboard"&&re.chalkboard),children:S.renderItem(E,T,r)},S.getKey?S.getKey(E,T):T))})]},S.key))})}):d.jsx("div",{className:re.tableScroll,children:d.jsxs("table",{className:Y(re.table,r==="chalkboard"&&re.chalkboard,h==="compact"&&re.compact),children:[d.jsxs("colgroup",{children:[j&&d.jsx("col",{style:{width:"48px"}}),t.map(S=>d.jsx("col",{style:S.width?{width:`${S.width*32}px`}:void 0},S.key))]}),!p&&d.jsx("thead",{children:d.jsxs("tr",{children:[j&&d.jsx("th",{className:Y(re.th,re.expandTh),"aria-label":"Expand"}),t.map(S=>d.jsx("th",{className:re.th,style:S.align?{textAlign:S.align}:void 0,children:S.header},S.key))]})}),d.jsx("tbody",{children:e.map((S,E)=>{const T=l?l(S,E):E,P=o==null?void 0:o.render(S,E,r),A=f==null?void 0:f(S,E,r),I=!!P,O=I&&x.has(T),M=u==null?void 0:u(S,E);return d.jsxs(b.Fragment,{children:[d.jsxs("tr",{className:Y(re.tr,I&&re.expandable,c==null?void 0:c(S,E)),style:M?Fi(M):void 0,onClick:()=>I&&k(T),children:[j&&d.jsx("td",{className:Y(re.td,re.expandTd),children:I&&d.jsx("button",{type:"button",className:re.expandIcon,"aria-expanded":O,"aria-label":O?"Collapse row":"Expand row",onClick:N=>{N.stopPropagation(),k(T)},children:d.jsx(zS,{size:14})})}),t.map(N=>d.jsx("td",{className:re.td,style:N.align?{textAlign:N.align}:void 0,children:N.cell(S,E,r)},N.key))]}),A&&d.jsx("tr",{className:re.footerRow,style:M?Fi(M):void 0,children:d.jsx("td",{colSpan:_,className:re.footerCell,children:A})}),O&&d.jsx("tr",{className:re.expandedRow,children:d.jsx("td",{colSpan:_,className:re.expandedCell,children:P})})]},T)})})]})}),m&&d.jsx("div",{className:re.panelFooter,children:m})]})]})}function W5({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 H5="card-module__borderLayer___WSpJq",G5="card-module__elevated___uhWj9",K5="card-module__textureLayer___Kcofz",q5="card-module__flat___KnG5z",Q5="card-module__small___HXUTr",Y5="card-module__withAccent___2t7bV",X5="card-module__accentBlue___a1KIq",J5="card-module__accentGreen___RNWoA",Z5="card-module__accentAmber___uMhom",eV="card-module__accentRose___VPI3t",tV="card-module__accentSlate___-l4jE",nV="card-module__chalkboard___bQ48O",xr={borderLayer:H5,default:"card-module__default___glPy-",elevated:G5,textureLayer:K5,flat:q5,small:Q5,withAccent:Y5,accentBlue:X5,accentGreen:J5,accentAmber:Z5,accentRose:eV,accentSlate:tV,chalkboard:nV},rV=lg(xr);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:LS({...s===!0||typeof s=="string"?{texture:s===!0?"parchment":s}:s,...i?{fill:i}:{},...o?{shade:o}:{}});return d.jsxs("div",{className:Y(xr.borderLayer,xr[t],n==="chalkboard"&&xr.chalkboard,xr[r],a&&xr.withAccent,a&&rV[l],!c&&xr.flat,u),children:[d.jsx(Ct,{clip:!0,...jt.surface,straight:!c}),d.jsx("div",{className:xr.textureLayer,style:f,children:e})]})}const sV="input-module__wrapper___xaEw6",iV="input-module__label___lu7R1",oV="input-module__field___khFpX",aV="input-module__input___h7K-F",lV="input-module__small___SkByh",cV="input-module__medium___0QPuV",uV="input-module__large___zGwRu",dV="input-module__error___QDqga",fV="input-module__disabled___K-5hi",hV="input-module__helperText___njeLH",pV="input-module__helperError___qDBpD",mV="input-module__chalkboard___Xh-5s",Sn={wrapper:sV,label:iV,field:oV,input:aV,small:lV,medium:cV,large:uV,error:dV,disabled:fV,helperText:hV,helperError:pV,chalkboard:mV},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:Y(Sn.wrapper,s==="chalkboard"&&Sn.chalkboard,i),children:[e&&d.jsx("label",{htmlFor:u,className:Sn.label,children:e}),d.jsxs("span",{className:Y(Sn.field,Sn[r],n&&Sn.error,a.disabled&&Sn.disabled),children:[d.jsx("input",{ref:l,id:u,className:Sn.input,...a}),d.jsx(Ct,{fill:!0,...jt.field})]}),t&&d.jsx("span",{className:Y(Sn.helperText,n&&Sn.helperError),children:t})]})}),gV="select-module__wrapper___Hc5F3",yV="select-module__label___ay-3s",xV="select-module__nativeSelect___UA2d-",vV="select-module__trigger___xMYHi",wV="select-module__open___w3mbZ",bV="select-module__triggerLabel___ihpER",kV="select-module__placeholder___0VOFP",_V="select-module__small___iU9W9",SV="select-module__chevron___0dCTg",CV="select-module__medium___B-XBN",jV="select-module__large___iII2c",PV="select-module__chevronOpen___cFOYe",EV="select-module__error___P5RBk",TV="select-module__dropdown___Q-uK3",NV="select-module__slideDown___sT374",RV="select-module__options___HmrQ0",AV="select-module__option___vNnue",IV="select-module__optionDisabled___ex2zq",MV="select-module__optionSelected___tAFjn",LV="select-module__optionHighlighted___zYQLq",DV="select-module__helperText___r5gyn",FV="select-module__helperError___ydSPT",OV="select-module__chalkboard___sXBw8",Le={wrapper:gV,label:yV,nativeSelect:xV,trigger:vV,open:wV,triggerLabel:bV,placeholder:kV,small:_V,chevron:SV,medium:CV,large:jV,chevronOpen:PV,error:EV,dropdown:TV,slideDown:NV,options:RV,option:AV,optionDisabled:IV,optionSelected:MV,optionHighlighted:LV,helperText:DV,helperError:FV,chalkboard:OV};function $S({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:p,texture:h=!1,className:m}){const y=b.useId(),[v,g]=b.useState(!1),[x,w]=b.useState(-1),[k,j]=b.useState(l??""),[_,S]=b.useState(null),E=b.useRef(null),T=b.useRef(null),P=a!==void 0,A=P?a:k,I=i.find(C=>C.value===A),O=(I==null?void 0:I.label)??o??"Select...",M=b.useCallback(()=>{if(f)return;g(!0);const C=i.findIndex($=>$.value===A);w(C>=0?C:0)},[f,i,A]),N=b.useCallback(()=>{g(!1),w(-1)},[]),z=b.useCallback(C=>{var $;C.disabled||(P||j(C.value),c==null||c(C.value),N(),($=E.current)==null||$.focus())},[P,c,N]),V=b.useCallback(C=>{if(!f)switch(C.key){case"Enter":case" ":C.preventDefault(),v&&x>=0?z(i[x]):M();break;case"Escape":C.preventDefault(),v&&N();break;case"ArrowDown":C.preventDefault(),v?w($=>{let Q=$+1;for(;Q<i.length&&i[Q].disabled;)Q++;return Q<i.length?Q:$}):M();break;case"ArrowUp":C.preventDefault(),v?w($=>{let Q=$-1;for(;Q>=0&&i[Q].disabled;)Q--;return Q>=0?Q:$}):M();break;case"Home":if(C.preventDefault(),v){let $=0;for(;$<i.length&&i[$].disabled;)$++;$<i.length&&w($)}break;case"End":if(C.preventDefault(),v){let $=i.length-1;for(;$>=0&&i[$].disabled;)$--;$>=0&&w($)}break;case"Tab":v&&N();break}},[f,v,x,i,M,N,z]);b.useEffect(()=>{if(!v)return;const C=$=>{var Q,R;const ce=$.target;(Q=E.current)!=null&&Q.contains(ce)||(R=T.current)!=null&&R.contains(ce)||N()};return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[v,N]),b.useEffect(()=>{if(!v||x<0||!T.current)return;const C=T.current.querySelector(`[data-option-index="${x}"]`);C==null||C.scrollIntoView({block:"nearest"})},[v,x]),b.useEffect(()=>{if(!v){S(null);return}const C=()=>{if(!E.current)return;const $=E.current.getBoundingClientRect();if($.bottom<0||$.top>window.innerHeight){N();return}S($)};return C(),document.addEventListener("scroll",C,{capture:!0,passive:!0}),window.addEventListener("resize",C,{passive:!0}),()=>{document.removeEventListener("scroll",C,{capture:!0}),window.removeEventListener("resize",C)}},[v,N]);const L=Ki(h),B=L?{"--sketch-fill":L.backgroundColor}:void 0;return d.jsxs("div",{className:Y(Le.wrapper,s==="chalkboard"&&Le.chalkboard,m),style:p?{width:typeof p=="number"?`${p}px`:p}:void 0,children:[e&&d.jsx("label",{htmlFor:y,className:Le.label,children:e}),d.jsxs("select",{id:y,name:u,className:Le.nativeSelect,value:A,onChange:C=>c==null?void 0:c(C.target.value),disabled:f,"aria-hidden":"true",tabIndex:-1,children:[o&&d.jsx("option",{value:"",children:o}),i.map(C=>d.jsx("option",{value:C.value,disabled:C.disabled,children:C.label},C.value))]}),d.jsxs("button",{ref:E,type:"button",role:"combobox","aria-expanded":v,"aria-haspopup":"listbox","aria-controls":v?`${y}-listbox`:void 0,"aria-activedescendant":v&&x>=0?`${y}-option-${x}`:void 0,className:Y(Le.trigger,Le[r],n&&Le.error,v&&Le.open,f&&Le.disabled),onClick:()=>v?N():M(),onKeyDown:V,disabled:f,children:[d.jsx("span",{className:Y(Le.triggerLabel,!I&&Le.placeholder),children:O}),d.jsx(zV,{className:Y(Le.chevron,v&&Le.chevronOpen)}),d.jsx(Ct,{fill:!0,...jt.field})]}),v&&_&&Ds.createPortal(d.jsxs("div",{ref:T,id:`${y}-listbox`,role:"listbox",tabIndex:-1,className:Le.dropdown,style:{...B,position:"fixed",top:_.bottom+6,left:_.left,width:_.width},onKeyDown:C=>{var $;C.key==="Escape"&&(C.preventDefault(),N(),($=E.current)==null||$.focus())},children:[d.jsx(Ct,{fill:!0,...jt.surface}),d.jsx("div",{className:Le.options,children:i.map((C,$)=>d.jsx("div",{id:`${y}-option-${$}`,role:"option","aria-selected":C.value===A,tabIndex:-1,"data-option-index":$,className:Y(Le.option,C.value===A&&Le.optionSelected,$===x&&Le.optionHighlighted,C.disabled&&Le.optionDisabled),onClick:Q=>{Q.stopPropagation(),z(C)},onMouseEnter:()=>w($),children:C.label},C.value))})]}),document.body),t&&d.jsx("span",{className:Y(Le.helperText,n&&Le.helperError),children:t})]})}function zV({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 BS({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 $V="alert-module__alert___j7ZRS",BV="alert-module__surface___IaVgU",VV="alert-module__iconWrapper___kLoxT",UV="alert-module__message___klR2U",WV="alert-module__dismiss___f2uoG",HV="alert-module__info___PBo1l",GV="alert-module__success___AVBKS",KV="alert-module__warning___zkMaJ",qV="alert-module__error___cxg96",QV="alert-module__chalkboard___7pgWk",os={alert:$V,surface:BV,iconWrapper:VV,message:UV,dismiss:WV,info:HV,success:GV,warning:KV,error:qV,chalkboard:QV};function VS({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:Y(os.alert,os[t],a&&os.chalkboard,o),role:t==="warning"||t==="error"?"alert":"status",children:[d.jsx(Ct,{clip:!0,...jt.surface}),d.jsx("div",{className:os.surface,style:a?void 0:Ki(r)}),d.jsx("span",{className:os.iconWrapper,children:d.jsx(BS,{variant:t})}),d.jsx("div",{className:os.message,children:e}),s&&d.jsx("button",{type:"button",className:os.dismiss,onClick:i,"aria-label":"Dismiss alert",children:d.jsx(Du,{size:16})})]})}const YV="modal-module__overlay___a52Ni",XV="modal-module__fadeIn___5OWd5",JV="modal-module__backdrop___RS4yj",ZV="modal-module__modal___ZioOV",e6="modal-module__slideUp___vfFrm",t6="modal-module__small___hcxwF",n6="modal-module__medium___mjbM5",r6="modal-module__large___1dzyf",s6="modal-module__header___iP09B",i6="modal-module__title___nj06m",o6="modal-module__close___gQou9",a6="modal-module__body___Y-EdA",l6="modal-module__chalkboard___qY8qo",Hn={overlay:YV,fadeIn:XV,backdrop:JV,modal:ZV,slideUp:e6,small:t6,medium:n6,large:r6,header:s6,title:i6,close:o6,body:a6,chalkboard:l6},c6='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';function Da({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(Au(e,t),b.useEffect(()=>{var p;if(!e)return;u.current=document.activeElement,(p=c.current)==null||p.focus();const h=y=>{var v;if(y.key!=="Tab")return;const g=(v=c.current)==null?void 0:v.querySelectorAll(c6);if(!g||g.length===0){y.preventDefault();return}const x=g[0],w=g[g.length-1];y.shiftKey&&document.activeElement===x?(y.preventDefault(),w.focus()):!y.shiftKey&&document.activeElement===w&&(y.preventDefault(),x.focus())};document.addEventListener("keydown",h);const m=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{var y,v;document.removeEventListener("keydown",h),document.body.style.overflow=m,(v=(y=u.current)==null?void 0:y.focus)==null||v.call(y)}},[e]),!e||typeof document>"u")return null;const f=Ki(o);return Ds.createPortal(d.jsxs("div",{className:Hn.overlay,children:[d.jsx("button",{type:"button",className:Hn.backdrop,"aria-label":"Close modal",onClick:t}),d.jsxs("div",{ref:c,className:Y(Hn.modal,Hn[s],i==="chalkboard"&&Hn.chalkboard,a),style:f,role:"dialog","aria-modal":"true","aria-labelledby":n?l:void 0,tabIndex:-1,children:[d.jsxs("div",{className:Hn.header,children:[n&&d.jsx("h2",{id:l,className:Hn.title,children:n}),d.jsx("button",{type:"button",className:Hn.close,onClick:t,"aria-label":"Close modal",children:d.jsx(Du,{size:18})})]}),d.jsx("div",{className:Hn.body,children:r})]})]}),document.body)}const u6="textarea-module__wrapper___NbiNO",d6="textarea-module__label___ejhyZ",f6="textarea-module__field___KluQf",h6="textarea-module__textarea___0y-7v",p6="textarea-module__resizeGrip___lONlE",m6="textarea-module__small___yPyr8",g6="textarea-module__medium___ezQxA",y6="textarea-module__large___xfeKi",x6="textarea-module__error___EkXKJ",v6="textarea-module__disabled___9CKbb",w6="textarea-module__helperText___l1sPh",b6="textarea-module__helperError___VfTLy",k6="textarea-module__chalkboard___zZ0X0",un={wrapper:u6,label:d6,field:f6,textarea:h6,resizeGrip:p6,small:m6,medium:g6,large:y6,error:x6,disabled:v6,helperText:w6,helperError:b6,chalkboard:k6},_6=48,Fu=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),p=b.useCallback(m=>{f.current=m,typeof l=="function"?l(m):l&&(l.current=m)},[l]),h=b.useCallback(m=>{const y=f.current;if(!y)return;m.preventDefault();const v=m.clientY,g=y.offsetHeight,x=k=>{y.style.height=`${Math.max(_6,g+k.clientY-v)}px`},w=()=>{window.removeEventListener("pointermove",x),window.removeEventListener("pointerup",w)};window.addEventListener("pointermove",x),window.addEventListener("pointerup",w)},[]);return d.jsxs("div",{className:Y(un.wrapper,s==="chalkboard"&&un.chalkboard,i),children:[e&&d.jsx("label",{htmlFor:u,className:un.label,children:e}),d.jsxs("span",{className:Y(un.field,un[r],n&&un.error,a.disabled&&un.disabled),children:[d.jsx("textarea",{ref:p,id:u,className:un.textarea,...a}),d.jsx(Ct,{fill:!0,...jt.field}),!a.disabled&&d.jsx("span",{className:un.resizeGrip,onPointerDown:h,"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:Y(un.helperText,n&&un.helperError),children:t})]})}),S6="progress-module__track___a5BMO",C6="progress-module__svg___3U0-E",R0={track:S6,svg:C6},df=300,mr=1;function j6({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(Lu()*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(mr,mr,df-mr*2,r-mr*2,{seed:l,roughness:2.2,fill:c,fillStyle:"solid",stroke:c,strokeWidth:1.5})),[l,c,r]),p=Math.max(o/100*(df-mr*2),0),h=b.useMemo(()=>p>0?Oe.toPaths(Oe.rectangle(mr,mr,p,r-mr*2,{seed:l+1,roughness:2,fill:u,fillStyle:"solid",stroke:u,strokeWidth:1})):[],[l,u,p,r]);return d.jsx("div",{className:Y(R0.track,i),style:{height:r,borderRadius:r/2},children:d.jsxs("svg",{className:R0.svg,viewBox:`0 0 ${df} ${r}`,preserveAspectRatio:"none","aria-hidden":"true",children:[f.map((m,y)=>d.jsx("path",{d:m.d,stroke:m.stroke,strokeWidth:m.strokeWidth,fill:m.fill},y)),h.map((m,y)=>d.jsx("path",{d:m.d,stroke:m.stroke,strokeWidth:m.strokeWidth,fill:m.fill},y))]})})}function P6(e){const t=Lu();return b.useMemo(()=>({blob:Y$({seed:t,wobble:e}),ring:X$(t,e)}),[t,e])}const E6="list-item-module__listItem___-tw9O",T6="list-item-module__clickable___GLJmd",N6="list-item-module__blobBg___O3Mzh",R6="list-item-module__blobFill___dXHk1",A6="list-item-module__blobRing___S9mas",I6="list-item-module__active___UsL8O",M6="list-item-module__small___9dphK",L6="list-item-module__medium___yGZCr",D6="list-item-module__icon___2b4wU",F6="list-item-module__label___SIzJ4",O6="list-item-module__action___qGh0-",z6="list-item-module__chalkboard___qpWuM",Gt={listItem:E6,static:"list-item-module__static___qtEX6",clickable:T6,blobBg:N6,blobFill:R6,blobRing:A6,active:I6,small:M6,medium:L6,icon:D6,label:F6,action:O6,chalkboard:z6};function Qn({active:e=!1,icon:t,action:n,size:r="medium",wobble:s=.5,surface:i="paper",children:o,className:a,...l}){const c=P6(s),u=!!l.onClick;return d.jsxs("button",{type:"button",className:Y(Gt.listItem,Gt[r],u&&Gt.clickable,!u&&!e&&Gt.static,e&&Gt.active,i==="chalkboard"&&Gt.chalkboard,a),"aria-current":e?"page":void 0,...l,children:[d.jsxs("svg",{className:Gt.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[d.jsx("path",{d:c.blob,className:Gt.blobFill}),d.jsx("path",{d:c.ring,className:Gt.blobRing})]}),t&&d.jsx("span",{className:Gt.icon,children:t}),d.jsx("span",{className:Gt.label,children:o}),n&&d.jsx("span",{className:Gt.action,children:n})]})}const $6="accordion-module__accordion___mqGl-",B6="accordion-module__header___mLfbd",V6="accordion-module__icon___Z90NR",U6="accordion-module__title___HusgG",W6="accordion-module__content___1K0td",H6="accordion-module__chalkboard___am8r4",G6="accordion-module__expanded___836xG",as={accordion:$6,header:B6,icon:V6,title:U6,content:W6,chalkboard:H6,expanded:G6};function K6({title:e,children:t,expanded:n=!1,onToggle:r,surface:s="paper",className:i}){return d.jsxs("div",{className:Y(as.accordion,n&&as.expanded,s==="chalkboard"&&as.chalkboard,i),children:[d.jsxs("button",{type:"button",className:as.header,onClick:r,"aria-expanded":n,children:[d.jsx("span",{className:as.icon,"aria-hidden":"true",children:d.jsx(zS,{size:14})}),d.jsx("span",{className:as.title,children:e})]}),n&&d.jsx("div",{className:as.content,children:t})]})}const q6="icon-module__icon___2vrJz",Q6="icon-module__blobBg___ENPYJ",Y6="icon-module__blobFill___IPbwQ",X6="icon-module__blobRing___1awqV",J6="icon-module__content___TaZR6",Z6="icon-module__small___Xp--F",e8="icon-module__medium___tCjMB",t8="icon-module__large___vBtP7",Ks={icon:q6,blobBg:Q6,blobFill:Y6,blobRing:X6,content:J6,small:Z6,medium:e8,large:t8},n8={small:20,medium:24,large:28};function r8({icon:e,size:t="medium",wobble:n=.5,fillColor:r,className:s}){const i=qi(n),o=n8[t];return d.jsxs("span",{className:Y(Ks.icon,Ks[t],s),children:[d.jsxs("svg",{className:Ks.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[d.jsx("path",{d:i.blob,className:Ks.blobFill,style:r?{fill:r}:void 0}),d.jsx("path",{d:i.ring,className:Ks.blobRing})]}),d.jsx("span",{className:Ks.content,style:{width:o,height:o},children:e})]})}const s8="radio-module__wrapper___BB05E",i8="radio-module__blobFill___p5BX4",o8="radio-module__labelLeft___ijB93",a8="radio-module__input___M2nFJ",l8="radio-module__box___H7ofS",c8="radio-module__dot___jVJ-d",u8="radio-module__boxWrapper___Y3qis",d8="radio-module__blobBg___IR-M5",f8="radio-module__labelText___I-nu3",h8="radio-module__chalkboard___IIBqI",Cn={wrapper:s8,blobFill:i8,labelLeft:o8,input:a8,box:l8,dot:c8,boxWrapper:u8,blobBg:d8,labelText:f8,chalkboard:h8};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,p=qi(n);return d.jsxs("label",{className:Y(Cn.wrapper,t==="left"&&Cn.labelLeft,r==="chalkboard"&&Cn.chalkboard,s),htmlFor:f,children:[d.jsxs("span",{className:Cn.boxWrapper,children:[d.jsx("input",{ref:c,id:f,type:"radio",className:Cn.input,checked:i,onChange:o,...l}),d.jsx("svg",{className:Cn.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:d.jsx("path",{d:p.blob,className:Cn.blobFill})}),d.jsxs("span",{className:Cn.box,"aria-hidden":"true",children:[d.jsx(Ct,{smooth:!0,shape:"circle",...jt.control}),d.jsx("span",{className:Cn.dot})]})]}),e&&d.jsx("span",{className:Cn.labelText,children:e})]})});const p8="switch-module__wrapper___5-2P1",m8="switch-module__labelLeft___WlT-N",g8="switch-module__input___YKZRj",y8="switch-module__track___QNvnO",x8="switch-module__thumb___cunvF",v8="switch-module__small___WPIxc",w8="switch-module__medium___yPulW",b8="switch-module__large___VlKV1",k8="switch-module__labelText___9Qg39",_8="switch-module__chalkboard___qKTMz",gr={wrapper:p8,labelLeft:m8,input:g8,track:y8,thumb:x8,small:v8,medium:w8,large:b8,labelText:k8,chalkboard:_8},S8=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:Y(gr.wrapper,gr[n],t==="left"&&gr.labelLeft,r==="chalkboard"&&gr.chalkboard,s),htmlFor:f,children:[d.jsx("input",{ref:c,id:f,type:"checkbox",className:gr.input,checked:i,onChange:o,...l}),d.jsxs("span",{className:gr.track,"aria-hidden":"true",children:[d.jsx(Ct,{...jt.pill}),d.jsx("span",{className:gr.thumb})]}),e&&d.jsx("span",{className:gr.labelText,children:e})]})}),C8="spinner-module__spinner___FDTk2",j8="spinner-module__chalkboard___DLE1z",P8="spinner-module__svg___JnCWN",E8="spinner-module__track___xbnbo",T8="spinner-module__head___j5dWe",wo={spinner:C8,chalkboard:j8,svg:P8,track:E8,head:T8},N8={small:18,medium:28,large:40},A0=25,R8=18,I0=Oe.toPaths(Oe.circle(A0,A0,R8*2,{seed:7,roughness:1.15,disableMultiStroke:!0})).map(e=>e.d).join(" ");function Gr({size:e="medium",color:t,label:n="Loading",surface:r="paper",className:s}){const i=N8[e];return d.jsx("span",{className:Y(wo.spinner,r==="chalkboard"&&wo.chalkboard,s),role:"status","aria-label":n,children:d.jsxs("svg",{width:i,height:i,viewBox:"0 0 50 50",className:wo.svg,style:t?{color:t}:void 0,"aria-hidden":"true",children:[d.jsx("path",{className:wo.track,d:I0,fill:"none",pathLength:100,strokeLinecap:"round"}),d.jsx("path",{className:wo.head,d:I0,fill:"none",pathLength:100,strokeLinecap:"round"})]})})}const A8="skeleton-module__skeleton___HCSvg",I8="skeleton-module__pulse___6eCq1",M8="skeleton-module__svg___OzxGp",L8="skeleton-module__text___v17Nv",D8="skeleton-module__rect___wqIJy",F8="skeleton-module__circle___RCmyR",ff={skeleton:A8,pulse:I8,svg:M8,text:L8,rect:D8,circle:F8},M0={text:[0,0,200,24],rect:[0,0,200,100],circle:[0,0,40,40]},qs=2;function Kt({variant:e="text",width:t,height:n,surface:r="paper",className:s,style:i}){const o=r==="chalkboard",a=Math.max(1,Math.round(Lu()*1e6)),l=o?nt(J.chalkboardBorderBase,.16):nt(J.textPrimary,.09),c=b.useMemo(()=>{const[,,u,f]=M0[e],p=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(p)},[e,a,l]);return d.jsx("span",{className:Y(ff.skeleton,ff[e],s),style:{width:t,height:n,...i},"aria-hidden":"true",children:d.jsx("svg",{className:ff.svg,viewBox:M0[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 O8="divider-module__horizontal___tP3rG",z8="divider-module__line___KnBes",$8="divider-module__label___WiUwZ",B8="divider-module__vertical___wBSrT",V8="divider-module__chalkboard___gXTde",Qs={horizontal:O8,line:z8,label:$8,vertical:B8,chalkboard:V8};function cg({orientation:e="horizontal",label:t,surface:n="paper",className:r}){const s=n==="chalkboard"&&Qs.chalkboard;return e==="vertical"?d.jsx("span",{className:Y(Qs.vertical,s,r),role:"separator","aria-orientation":"vertical"}):d.jsxs("div",{className:Y(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 U8="tooltip-module__wrapper___XeVNe",W8="tooltip-module__tooltip___e-rkz",H8="tooltip-module__tooltipIn___CZbRw",G8="tooltip-module__top___78WWU",K8="tooltip-module__bottom___Irl3O",q8="tooltip-module__left___C1Ec4",Q8="tooltip-module__right___oUA-Z",Y8="tooltip-module__chalkboard___Um6dx",Cl={wrapper:U8,tooltip:W8,tooltipIn:H8,top:G8,bottom:K8,left:q8,right:Q8,chalkboard:Y8},jl=8,Pl=8,X8=typeof window>"u"?b.useEffect:b.useLayoutEffect;function J8(e,t,n){let r,s;switch(t){case"bottom":r=e.bottom+jl,s=e.left+e.width/2-n.width/2;break;case"left":r=e.top+e.height/2-n.height/2,s=e.left-jl-n.width;break;case"right":r=e.top+e.height/2-n.height/2,s=e.right+jl;break;default:r=e.top-jl-n.height,s=e.left+e.width/2-n.width/2}return s=Math.min(Math.max(s,Pl),window.innerWidth-n.width-Pl),r=Math.min(Math.max(r,Pl),window.innerHeight-n.height-Pl),{top:r,left:s}}function Te({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,p]=b.useState(!1),[h,m]=b.useState(null),[y,v]=b.useState(null),g=b.useRef(null),x=b.useRef(null),w=b.useRef(),k=!s&&!!e&&!f&&(a||c),j=()=>{clearTimeout(w.current),w.current=setTimeout(()=>l(!0),r)},_=()=>{clearTimeout(w.current),l(!1),p(!1)},S=()=>{p(!1),u(!0)},E=()=>{u(!1),p(!1)};Au(k,()=>p(!0)),b.useEffect(()=>{if(!k){m(null);return}const P=()=>{g.current&&m(g.current.getBoundingClientRect())};return P(),window.addEventListener("scroll",P,{capture:!0,passive:!0}),window.addEventListener("resize",P,{passive:!0}),()=>{window.removeEventListener("scroll",P,{capture:!0}),window.removeEventListener("resize",P)}},[k]),X8(()=>{if(!k){v(null);return}const P=x.current;P&&v({width:P.offsetWidth,height:P.offsetHeight})},[k,e,n]),b.useEffect(()=>()=>clearTimeout(w.current),[]);const T=t.props;return d.jsxs("span",{ref:g,className:Cl.wrapper,onMouseEnter:j,onMouseLeave:_,onFocus:S,onBlur:E,children:[b.cloneElement(t,{"aria-describedby":k?o:T["aria-describedby"]}),k&&h&&typeof document<"u"&&Ds.createPortal(d.jsx("span",{ref:x,id:o,role:"tooltip",className:Y(Cl.tooltip,Cl[n],i==="chalkboard"&&Cl.chalkboard),style:y?{position:"fixed",...J8(h,n,y)}:{position:"fixed",top:0,left:0,visibility:"hidden"},children:e}),document.body)]})}const Z8="toast-module__stack___hDi0s",eU="toast-module__topLeft___Luw-F",tU="toast-module__topCenter___N1DwF",nU="toast-module__topRight___Dtgau",rU="toast-module__bottomLeft___Eb2lo",sU="toast-module__bottomCenter___gs-Yb",iU="toast-module__bottomRight___-0e2j",oU="toast-module__item___RFjtm",aU="toast-module__toastIn___9m9iN",lU="toast-module__card___ZCvJS",cU="toast-module__surface___mfMl0",uU="toast-module__iconWrapper___lnjcC",dU="toast-module__content___AlliM",fU="toast-module__title___1Oqh8",hU="toast-module__description___eiUSB",pU="toast-module__dismiss___tUGx4",mU="toast-module__info___Nh8S9",gU="toast-module__success___hlKLc",yU="toast-module__warning___XUMJt",xU="toast-module__error___pSFFC",vU="toast-module__chalkboard___c49gt",qt={stack:Z8,topLeft:eU,topCenter:tU,topRight:nU,bottomLeft:rU,bottomCenter:sU,bottomRight:iU,item:oU,toastIn:aU,card:lU,surface:cU,iconWrapper:uU,content:dU,title:fU,description:hU,dismiss:pU,info:mU,success:gU,warning:yU,error:xU,chalkboard:vU};function wU({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:qt.item,onMouseEnter:a,onMouseLeave:l,children:d.jsxs("div",{className:Y(qt.card,qt[e.variant],c&&qt.chalkboard),role:u,children:[d.jsx(Ct,{clip:!0,...jt.surface}),d.jsx("div",{className:qt.surface,style:c?void 0:Ki("kraft")}),d.jsx("span",{className:qt.iconWrapper,children:d.jsx(BS,{variant:e.variant})}),d.jsxs("div",{className:qt.content,children:[e.title&&d.jsx("div",{className:qt.title,children:e.title}),d.jsx("div",{className:qt.description,children:e.description})]}),d.jsx("button",{type:"button",className:qt.dismiss,onClick:()=>n(e.id),"aria-label":"Dismiss notification",children:d.jsx(Du,{size:16})})]})})}const US=b.createContext(null);function bU(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function kU({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(p=>p.id!==u))},[]),l=b.useCallback(u=>{o.current+=1;const f=`toast-${o.current}`;return i(p=>[...p,{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(US.Provider,{value:{toast:l,dismiss:a},children:[e,typeof document<"u"&&Ds.createPortal(d.jsx("div",{className:Y(qt.stack,qt[bU(t)]),role:"region","aria-label":"Notifications",children:c.map(u=>d.jsx(wU,{record:u,surface:n,onDismiss:a},u.id))}),document.body)]})}function He(){const e=b.useContext(US);if(!e)throw new Error("useToast must be used within a <ToastProvider>");return e}const _U="breadcrumb-module__breadcrumb___r-ILp",SU="breadcrumb-module__list___V3YFy",CU="breadcrumb-module__item___dDwYf",jU="breadcrumb-module__link___CHC9k",PU="breadcrumb-module__linkButton___XoMW-",EU="breadcrumb-module__current___dprI9",TU="breadcrumb-module__separator___uLhtn",NU="breadcrumb-module__chalkboard___COJpw",jn={breadcrumb:_U,list:SU,item:CU,link:jU,linkButton:PU,current:EU,static:"breadcrumb-module__static___affaf",separator:TU,chalkboard:NU};function WS({items:e,surface:t="paper",className:n}){return d.jsx("nav",{"aria-label":"Breadcrumb",className:Y(jn.breadcrumb,t==="chalkboard"&&jn.chalkboard,n),children:d.jsx("ol",{className:jn.list,children:e.map((r,s)=>{const i=s===e.length-1;return d.jsxs("li",{className:jn.item,children:[i?d.jsx("span",{className:jn.current,"aria-current":"page",children:r.label}):r.href?d.jsx("a",{href:r.href,className:jn.link,onClick:r.onClick,children:r.label}):r.onClick?d.jsx("button",{type:"button",className:Y(jn.link,jn.linkButton),onClick:r.onClick,children:r.label}):d.jsx("span",{className:jn.static,children:r.label}),!i&&d.jsx(RU,{className:jn.separator})]},r.id)})})})}function RU({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 AU="menu-module__wrapper___WCtoy",IU="menu-module__menu___i40Wj",MU="menu-module__surface___SJbaB",LU="menu-module__list___YjCfD",DU="menu-module__item___aqcgg",FU="menu-module__icon___1qUvA",OU="menu-module__label___MtQMh",zU="menu-module__danger___p9oZo",$U="menu-module__itemDisabled___HByLP",BU="menu-module__separator___g2uay",VU="menu-module__chalkboard___5jIwI",dn={wrapper:AU,menu:IU,surface:MU,list:LU,item:DU,icon:FU,label:OU,danger:zU,itemDisabled:$U,separator:BU,chalkboard:VU},UU=6;function WU(e){return"type"in e&&e.type==="separator"}function HS({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),p=b.useCallback(()=>{var g,x;(x=(g=u.current)==null?void 0:g.querySelector("button, a, [tabindex]"))==null||x.focus()},[]),h=b.useCallback(()=>a(!1),[]);Au(o,()=>{h(),p()}),b.useEffect(()=>{if(!o)return;const g=x=>{var w,k;const j=x.target;(w=u.current)!=null&&w.contains(j)||(k=f.current)!=null&&k.contains(j)||h()};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[o,h]),b.useEffect(()=>{if(!o){c(null);return}const g=()=>{u.current&&c(u.current.getBoundingClientRect())};return g(),document.addEventListener("scroll",g,{capture:!0,passive:!0}),window.addEventListener("resize",g,{passive:!0}),()=>{document.removeEventListener("scroll",g,{capture:!0}),window.removeEventListener("resize",g)}},[o]),b.useEffect(()=>{var g,x;!o||!l||(x=(g=f.current)==null?void 0:g.querySelector('[role="menuitem"]:not(:disabled)'))==null||x.focus()},[o,l]);const m=g=>{var x,w,k,j,_;const S=Array.from(((x=f.current)==null?void 0:x.querySelectorAll('[role="menuitem"]:not(:disabled)'))??[]);if(S.length===0)return;const E=S.indexOf(document.activeElement);switch(g.key){case"ArrowDown":g.preventDefault(),(w=S[(E+1)%S.length])==null||w.focus();break;case"ArrowUp":g.preventDefault(),(k=S[(E-1+S.length)%S.length])==null||k.focus();break;case"Home":g.preventDefault(),(j=S[0])==null||j.focus();break;case"End":g.preventDefault(),(_=S[S.length-1])==null||_.focus();break;case"Tab":h();break}},y=g=>{var x;g.disabled||(h(),p(),(x=g.onSelect)==null||x.call(g))},v=e.props;return d.jsxs("span",{ref:u,className:dn.wrapper,children:[b.cloneElement(e,{"aria-haspopup":"menu","aria-expanded":o,onClick:g=>{var x;(x=v.onClick)==null||x.call(v,g),a(w=>!w)}}),o&&l&&typeof document<"u"&&Ds.createPortal(d.jsxs("div",{ref:f,id:i,role:"menu",className:Y(dn.menu,r==="chalkboard"&&dn.chalkboard,s),style:{position:"fixed",top:l.bottom+UU,minWidth:l.width,...n==="end"?{right:window.innerWidth-l.right}:{left:l.left}},onKeyDown:m,children:[d.jsx(Ct,{clip:!0,...jt.surface}),d.jsx("div",{className:dn.surface}),d.jsx("div",{className:dn.list,children:t.map(g=>WU(g)?d.jsx("div",{role:"separator",className:dn.separator},g.id):d.jsxs("button",{type:"button",role:"menuitem",tabIndex:-1,disabled:g.disabled,className:Y(dn.item,g.danger&&dn.danger,g.disabled&&dn.itemDisabled),onClick:()=>y(g),children:[g.icon&&d.jsx("span",{className:dn.icon,children:g.icon}),d.jsx("span",{className:dn.label,children:g.label})]},g.id))})]}),document.body)]})}function We(e){const t=e.split(`
87
- `).map(r=>r.trim()).filter(Boolean);return t.find(r=>r.startsWith("!")||r.startsWith("error:")||r.startsWith("fatal:"))??t.at(-1)??e}const GS="font-display-luminari text-base font-semibold text-desk-text-muted mb-3",ug="font-display-luminari text-xs font-semibold uppercase tracking-wide text-desk-text-muted mb-2",fs={pass:"#2d5a3b",fail:"#5a2d2d",running:"#5a4a2d"},hs={pass:"#b5d6b5",fail:"#d6a0a0",running:"#d6c4a0"},HU=3,GU="basis-[9.25rem]",KU=e=>{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"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";default:return""}},qU=({task:e,onStop:t})=>{const n=Vt(),{toast:r}=He(),s=()=>n({to:"/tasks",search:{taskId:e.id}}),i=async l=>{l.stopPropagation();try{await t(e.id)}catch(c){r({title:"Failed to stop agent",description:We(c.message),variant:"error"})}},o={starting:fs.running,running:fs.running,stopping:fs.running,done:fs.pass,error:fs.fail,superseded:fs.running},a={starting:hs.running,running:hs.running,stopping:hs.running,done:hs.pass,error:hs.fail,superseded:hs.running};return d.jsx(de,{surface:"chalkboard",size:"small",className:"stack-task-card",children:d.jsxs("div",{role:"button",tabIndex:0,onClick:s,onKeyDown:l=>{l.target===l.currentTarget&&(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),s())},className:"flex cursor-pointer items-center justify-between gap-2 rounded-[10px]",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,KU(e)," · ",cL[e.agentId]]}),d.jsxs("div",{className:"flex items-center gap-2",children:[e.status==="error"&&e.errorKind==="auth"?d.jsx("button",{type:"button",onClick:l=>{l.stopPropagation(),n({to:"/settings/$section",params:{section:"setup"}})},className:"bg-none bg-transparent border-none p-0 cursor-pointer",children:d.jsx(Pe,{surface:"chalkboard",size:"small",fillColor:o.error,textColor:a.error,children:"stopped — agent signed out"})}):d.jsx(Pe,{surface:"chalkboard",size:"small",fillColor:o[e.status],textColor:a[e.status],children:e.status}),(e.status==="running"||e.status==="starting"||e.status==="stopping")&&d.jsx(ot,{icon:d.jsx(Du,{}),variant:"ghost",size:"small",label:"Stop agent",onClick:i,disabled:e.status==="stopping"})]})]})})},QU=()=>{const e=D(r=>r.agentStatus),t=D(r=>r.stopAgent),n=e.slice(0,HU);return d.jsxs("div",{className:"flex min-h-0 flex-none flex-col p-6",children:[d.jsx("div",{className:GS,children:"Agent"}),d.jsx("div",{className:`flex min-h-0 flex-auto flex-col gap-2 overflow-y-auto ${GU} ${n.length>0?"justify-start":"justify-center"}`,children:n.length>0?n.map(r=>d.jsx(qU,{task:r,onStop:t},r.id)):d.jsx(de,{surface:"chalkboard",size:"small",children:d.jsx("p",{className:"m-0 text-center text-xs opacity-50",children:"No agent running."})})})]})},YU=()=>{const[e,t]=b.useState(null),[n,r]=b.useState(!0);return b.useEffect(()=>{let s=!1;return Sm().then(i=>{s||(t((i==null?void 0:i.desk)??null),r(!1))}),()=>{s=!0}},[]),{desk:e,loading:n}},XU=async()=>{const e=await fetch(G("/api/checks"));return e.ok?(await e.json()).checks??[]:[]},JU=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 ZU(){const[e,t]=b.useState([]),n=b.useCallback(async()=>{try{t(await XU())}catch{}},[]);b.useEffect(()=>{n()},[n]),b.useEffect(()=>{let s;const i=()=>{s&&clearTimeout(s),s=setTimeout(n,80)},o=Ta(a=>{(a.type==="check"||a.message==="changed")&&i()});return()=>{s&&clearTimeout(s),o()}},[n]);const r=b.useCallback(async s=>{await JU(s),await n()},[n]);return{checks:e,run:r,refresh:n}}const eW={...fs,stale:"transparent"},tW={...hs,stale:void 0},nW=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)"}`,rW=({check:e,onRun:t})=>{const n=e.status==="running";return d.jsx(Te,{content:`${e.cmd} — click to run.`,surface:"chalkboard",children:d.jsx("button",{type:"button",className:`inline-flex border-none bg-transparent bg-none p-0 ${n?"cursor-not-allowed":"cursor-pointer enabled:hover:-translate-y-px enabled:hover:brightness-[1.15]"}`,onClick:()=>{n||t(e.name)},disabled:n,children:d.jsxs(Pe,{surface:"chalkboard",size:"small",fillColor:eW[e.status],textColor:tW[e.status],children:[e.name,d.jsx("span",{className:n?"visible":"invisible",children:"…"})]})})})},sW=()=>{const{checks:e,run:t}=ZU(),n=e.find(r=>r.status==="fail");return d.jsxs("div",{children:[d.jsx("div",{className:ug,children:"Checks"}),e.length>0?d.jsxs("div",{className:"flex flex-col gap-3",children:[d.jsx("div",{className:"flex flex-wrap gap-2",children:e.map(r=>d.jsx(rW,{check:r,onRun:t},r.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(rp,{text:nW(n),surface:"chalkboard"})]})]})]}):d.jsx(de,{surface:"chalkboard",size:"small",children:d.jsx("p",{className:"m-0 text-center text-xs opacity-50",children:"No checks declared."})})]})},iW=async()=>{try{const e=await fetch(G("/api/ci"));return e.ok?e.json():null}catch{return null}};function oW(){const[e,t]=b.useState(null),[n,r]=b.useState(!0),s=b.useCallback(async()=>{try{t(await iW())}finally{r(!1)}},[]);return b.useEffect(()=>{s()},[s]),b.useEffect(()=>{let i;const o=Ta(l=>{l.message==="changed"&&(i&&clearTimeout(i),i=setTimeout(s,250))}),a=()=>s();return window.addEventListener("focus",a),()=>{i&&clearTimeout(i),window.removeEventListener("focus",a),o()}},[s]),{ci:e,loading:n,refresh:s}}const aW={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"},hf="text-desk-chalk underline decoration-desk-border hover:decoration-desk-chalk",lW=({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 ${aW[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},cW=()=>{const{ci:e,loading:t}=oW(),n=()=>{var s;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 r=`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(i=>d.jsx(lW,{run:i},i.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 ",((s=e.releasePr)==null?void 0:s.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:hf,children:["Release PR #",e.releasePr.number]}),d.jsx("a",{href:r,target:"_blank",rel:"noreferrer",className:hf,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:r,target:"_blank",rel:"noreferrer",className:hf,children:"open Actions"})]})})};return d.jsxs("div",{children:[d.jsx("div",{className:ug,children:"CI & release"}),n()]})},KS=async(e,t)=>{if(!e.ok){const n=await e.json().catch(()=>({error:t}));throw new Error(n.error??t)}},uW=async()=>{const e=await fetch(G("/api/services"));return e.ok?(await e.json()).services??[]:[]},dW=async e=>{const t=await fetch(G(`/api/services/start?name=${encodeURIComponent(e)}`),{method:"POST"});await KS(t,"Failed to start service")},fW=async e=>{const t=await fetch(G(`/api/services/stop?name=${encodeURIComponent(e)}`),{method:"POST"});await KS(t,"Failed to stop service")},hW=async e=>{const t=await fetch(G(`/api/services/logs?name=${encodeURIComponent(e)}`));return t.ok?(await t.json()).log??"":""};function pW(){const[e,t]=b.useState([]),[n,r]=b.useState(!0),s=b.useCallback(async()=>{try{t(await uW())}catch{}finally{r(!1)}},[]);b.useEffect(()=>{s()},[s]),b.useEffect(()=>{let a;const l=()=>{a&&clearTimeout(a),a=setTimeout(s,80)},c=Ta(u=>{(u.type==="service"||u.message==="changed")&&l()});return()=>{a&&clearTimeout(a),c()}},[s]);const i=b.useCallback(async a=>{await dW(a),await s()},[s]),o=b.useCallback(async a=>{await fW(a),await s()},[s]);return{services:e,loading:n,start:i,stop:o,refresh:s}}const qS=({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"})]}),mW=({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"})]}),gW=({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"})]}),QS=({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"})]}),yW=({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"})]}),YS=({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"})]}),xW=({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"})]}),vW=({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"})}),wW=({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"})}),bW=({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"})]}),kW=({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"})]}),_W=({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"})}),dg=({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"})]}),XS=({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"})]}),SW=1500,CW=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",jW=({service:e})=>d.jsx("span",{"aria-hidden":"true",className:`h-2 w-2 shrink-0 rounded-full ${CW(e)}`,title:e.status==="running"?`running · ${e.health}`:e.status}),PW=({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 hW(e);i||r(l)};if(o(),!t)return;const a=setInterval(o,SW);return()=>{i=!0,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."})},EW=({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=async()=>{if(!s){i(!0);try{await(l?n:t)(e.name)}catch(u){r({title:l?"Failed to stop service":"Failed to start service",description:u.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(u=>!u),className:"flex min-w-0 cursor-pointer items-center gap-2 border-none bg-transparent p-0 text-left",children:[d.jsx(jW,{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(Gr,{size:"small",surface:"chalkboard",label:"Working"}):d.jsx(ot,{icon:l?d.jsx(wW,{}):d.jsx(vW,{}),surface:"chalkboard",size:"small",variant:"ghost",label:l?`Stop ${e.name}`:`Start ${e.name}`,onClick:c})})]}),o&&d.jsx(PW,{name:e.name,running:l})]})},TW=()=>{const{services:e,start:t,stop:n}=pW(),r=b.useCallback(i=>t(i),[t]),s=b.useCallback(i=>n(i),[n]);return d.jsxs("div",{children:[d.jsx("div",{className:ug,children:"Services"}),d.jsx("div",{className:"flex flex-col gap-2",children:e.length>0?e.map(i=>d.jsx(EW,{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."})})})]})},NW=()=>{const{desk:e,loading:t}=YU();return t||!e?null:d.jsxs(d.Fragment,{children:[d.jsx(cg,{surface:"chalkboard"}),d.jsxs("div",{className:"min-h-0 flex-1 p-6",children:[d.jsx("div",{className:GS,children:"Desk"}),d.jsxs("div",{className:"flex flex-col gap-4",children:[d.jsx(TW,{}),d.jsx(sW,{}),d.jsx(cW,{})]})]})]})},RW=({open:e,onToggle:t,pinned:n=!1})=>{const r=e||n,s=D(S=>S.loadPlans),i=D(S=>S.status),o=D(S=>S.loadStatus),a=D(S=>S.consistency),l=D(S=>S.loadConsistency),c=D(S=>S.doctor),u=D(S=>S.loadDoctor),f=D(S=>S.loadGitStatus),p=D(S=>S.agentStatus),h=D(S=>S.loadAgentStatus),m=D(S=>S.loadSuggestions),y=D(S=>S.loadArchivableIdeas),v=b.useRef({loadPlans:s,loadStatus:o,loadConsistency:l,loadDoctor:u,loadGitStatus:f,loadAgentStatus:h,loadSuggestions:m,loadArchivableIdeas:y});b.useEffect(()=>{v.current={loadPlans:s,loadStatus:o,loadConsistency:l,loadDoctor:u,loadGitStatus:f,loadAgentStatus:h,loadSuggestions:m,loadArchivableIdeas:y}}),b.useEffect(()=>{v.current.loadStatus(),v.current.loadConsistency(),v.current.loadDoctor(),v.current.loadGitStatus(),v.current.loadAgentStatus(),v.current.loadArchivableIdeas()},[]),b.useEffect(()=>{const S=()=>{v.current.loadPlans(),v.current.loadGitStatus()};return window.addEventListener("focus",S),()=>window.removeEventListener("focus",S)},[]),b.useEffect(()=>{const S={},E=(P,A,I)=>{S[P]&&clearTimeout(S[P]),S[P]=setTimeout(A,I)},T=Ta(P=>{if(P.type==="status"){E("status",()=>v.current.loadStatus(),80);return}if(P.type==="agent"){E("agent",()=>v.current.loadAgentStatus(),120);return}P.message==="changed"&&E("activity",()=>{v.current.loadPlans(),v.current.loadSuggestions(),v.current.loadStatus(),v.current.loadConsistency(),v.current.loadDoctor(),v.current.loadGitStatus(),v.current.loadAgentStatus(),v.current.loadArchivableIdeas()},250)});return()=>{for(const P of Object.values(S))P&&clearTimeout(P);T()}},[]);const{qualityStatus:g,testStatus:x,consistencyStatus:w}=b.useMemo(()=>Tm(i),[i]),k=a.length>0,j=g==="fail"||x==="fail"||w==="fail"||k||c.errorCount>0,_=p.some(S=>S.status==="running"||S.status==="starting"||S.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:_?d.jsx(Gr,{size:"small",surface:"chalkboard",label:"Agent running"}):j?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:_?"Open stack panel — agent running":j?"Open stack panel — checks failing":"Open stack panel",onClick:t,className:`w-7 h-[64px] rounded-l-md ${_?"shadow-[inset_0_0_0_1px_rgba(214,196,160,0.6)]":j?"shadow-[inset_0_0_0_1px_rgba(214,160,160,0.6)]":""}`})}),d.jsxs("div",{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-20 shrink-0 items-center justify-between px-6",children:[d.jsx("span",{className:"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(cg,{surface:"chalkboard"}),d.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[d.jsx(QU,{}),d.jsx(NW,{})]})]})]})},AW=e=>e.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,t=>t.toUpperCase()),IW=()=>{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([sM().then(a=>{!o&&a&&t(AW(a))}),rM().then(a=>{o||r(a)})]).finally(()=>{o||i(!1)}),()=>{o=!0}},[]),{projectName:e,iconDataUri:n,loading:s}},MW=["repo-docs","release-notes"],LW=["subjects","setup","merge-policy"];function JS(e){var t;return((t=e==null?void 0:e.match(/\d+$/))==null?void 0:t[0])??null}function ZS(e,t){return e.find(n=>JS(n.id)===t)??e.find(n=>!n.id&&n.title===t)??null}function ba(e,t){return JS(e)??encodeURIComponent(t)}function fg(){const{planId:e}=Os({strict:!1}),t=D(n=>n.plans);return typeof e!="string"||!t?null:ZS(t.entries,decodeURIComponent(e))}function DW(){const{ideaId:e}=Os({strict:!1}),t=D(n=>n.ideaEntries);return typeof e!="string"?null:ZS(t,decodeURIComponent(e))}function FW(){const{section:e}=Os({strict:!1});return MW.includes(e)?e:null}function P7(){const{section:e}=Os({strict:!1});return LW.includes(e)?e:null}function E7(){const e=FW(),t=D(r=>r.activeDocTitle),n=D(r=>r.repoDocs);return e??(t&&n.some(r=>r.name===t)?"repo-docs":null)}const OW=250;function eC(e,t,n={}){const{debounceMs:r=OW,...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(()=>_L(i,t,{threshold:a,limit:l}),[i,t,a,l])}const tC=()=>{const[e,t]=b.useState([]),[n,r]=b.useState(!0),[s,i]=b.useState(!0);return b.useEffect(()=>{let o=!1;return Sm().then(a=>{o||(t((a==null?void 0:a.subjects)??[]),i(a!==null),r(!1))}),()=>{o=!0}},[]),{subjects:e,loading:n,available:s}},zW=({size:e="md"})=>{const{projectName:t,iconDataUri:n,loading:r}=IW();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(r8,{icon:d.jsx(e5,{}),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"})]})},$W=()=>{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},BW=({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 pf(e){return e==="allowed"?"allowed":/reject|block|exceed|denied/i.test(e)?"rejected":"warning"}function VW(e){return e<1e12?e*1e3:e}function UW(e){const t=[`Claude usage: ${e.status}`];return e.rateLimitType&&t.push(e.rateLimitType),e.resetsAt!==void 0&&t.push(`resets ${new Date(VW(e.resetsAt)).toLocaleTimeString()}`),e.overage&&t.push("overage on"),t.join(" · ")}const WW={...Fi("kraft"),display:"flex",alignItems:"center",gap:"0.75rem",height:"2rem",paddingLeft:"1rem",paddingRight:"1rem",borderBottom:"1px solid rgba(0, 0, 0, 0.08)",fontSize:"0.75rem",flexShrink:0,boxSizing:"border-box",overflowX:"auto",overflowY:"hidden",whiteSpace:"nowrap"},HW={display:"flex",alignItems:"center",gap:"0.75rem",flexShrink:0},GW={display:"flex",alignItems:"center",gap:"0.25rem"},KW={opacity:.5},qW={color:"var(--pui-text-primary)"},L0={opacity:.6},QW={flex:1},D0={display:"flex",alignItems:"center",gap:"0.5rem",flexShrink:0},F0={background:"none",backgroundColor:"transparent",border:"none",padding:0,cursor:"pointer"},YW={position:"relative",display:"inline-flex"},XW={position:"absolute",top:"-0.25rem",right:"-0.25rem",pointerEvents:"none"},JW=({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:p})=>d.jsxs("div",{style:WW,children:[d.jsxs("div",{style:HW,children:[d.jsxs("span",{style:GW,children:[d.jsx("span",{style:KW,children:"⌥"}),d.jsx("code",{style:qW,children:e??"no branch"})]}),t>0&&d.jsxs("span",{style:L0,children:["↑",t]}),d.jsx("span",{style:L0,children:n>0?`${n} changed`:"clean"}),r&&d.jsx(Gr,{size:"small",label:`Agent ${s}…`}),i&&d.jsx(Te,{content:"Sign in from Settings → Connections so agent tasks can run",children:d.jsx("button",{type:"button",onClick:c,style:F0,children:d.jsx(Pe,{size:"small",variant:"warning",children:"Agent not signed in"})})}),o>0&&d.jsx(Te,{content:"Some features are disabled — open Setup to fix",children:d.jsx("button",{type:"button",onClick:c,style:F0,children:d.jsxs(Pe,{size:"small",variant:"warning",children:["Setup (",o,")"]})})}),a&&pf(a.status)!=="allowed"&&d.jsx(Te,{content:UW(a),children:d.jsx(Pe,{size:"small",variant:pf(a.status)==="rejected"?"error":"warning",children:pf(a.status)==="rejected"?"Claude limit reached":"Claude usage warning"})})]}),d.jsx("div",{style:QW}),p&&d.jsx("div",{style:D0,children:p}),d.jsxs("div",{style:D0,children:[d.jsx(Te,{content:"Git",children:d.jsx(ot,{variant:"ghost",size:"small",icon:d.jsx(kW,{}),label:"Git",onClick:u})}),d.jsx(Te,{content:"Notifications",children:d.jsxs("span",{style:YW,children:[d.jsx(ot,{variant:"ghost",size:"small",icon:d.jsx(bW,{}),label:"Notifications",onClick:f}),l>0&&d.jsx("span",{style:XW,children:d.jsx(Pe,{size:"small",variant:"warning",children:l})})]})})]})]}),ZW=()=>{const e=D(y=>y.agentStatus),t=D(y=>y.gitStatus),n=D(y=>y.gitBranch),r=D(y=>y.gitAhead),s=D(WL),i=D(HL),o=D(GL),a=D(y=>{var v;return((v=y.notifications)==null?void 0:v.filter(g=>g.kind==="question"||!g.read).length)??0}),l=Vt(),c=e.find(y=>y.status==="running"||y.status==="starting"||y.status==="stopping"),u=c!==void 0,f=(t==null?void 0:t.length)??0,p=()=>l({to:"/settings/$section",params:{section:"setup"}}),h=()=>l({to:"/git"}),m=()=>l({to:"/inbox"});return d.jsx(JW,{gitBranch:n,gitAhead:r,changedFileCount:f,agentActive:u,activeTaskStatus:c==null?void 0:c.status,agentNotSignedIn:i,capabilityGapCount:s,rateLimit:o,unreadNotificationCount:a,onOpenSetup:p,onOpenGit:h,onOpenNotifications:m})},e9=({children:e})=>d.jsx("h1",{className:"text-4xl font-display-luminari font-semibold text-ink-900 mb-6 leading-[1.1]",children:e}),t9=3*6e4,n9=(e,t)=>{const n=D(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(()=>{yM(i).then(a=>{if(!a.skipped)return n()}).catch(()=>{})},t9);return()=>clearTimeout(o)},[t,i,s,n])},Qi=()=>{const e=D(i=>i.loadPlans),{toast:t}=He(),[n,r]=b.useState(!1);return{patch:async(i,o,a)=>{r(!0);try{return await XM(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}},r9=e=>{const t=D(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 Wx(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 Ek(l);return await Wx(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)}}}},sp=.95,s9=3e4,ip={implement:{from:0,to:.6},verify:{from:.6,to:.9},checkbox:{from:.95,to:.95}};function i9(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 o9(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=i9(t),r={};for(const s of["implement","verify"]){const i=ip[s].to-ip[s].from;r[s]=n*i/sp}return r}function a9({anchor:e,anchorEnteredAt:t,lastStreamAt:n,now:r,medians:s}){if(!e)return 0;const i=ip[e],o=Math.min(i.from,sp),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+s9),c=Math.min(1,Math.max(0,l-t)/a);return Math.min(i.from+c*(i.to-i.from),sp)}const l9=new Set(["starting","running","stopping"]),c9=1e3;function u9(e,t){const n=e!==void 0&&e.phaseIndex!==void 0&&l9.has(e.status),[r,s]=b.useState(()=>Date.now());return b.useEffect(()=>{if(!n)return;const i=setInterval(()=>s(Date.now()),c9);return()=>clearInterval(i)},[n]),!n||(e==null?void 0:e.phaseIndex)===void 0?null:{index:e.phaseIndex,fraction:a9({anchor:e.phaseAnchor,anchorEnteredAt:e.anchorEnteredAt,lastStreamAt:e.lastStreamAt,now:r,medians:o9(t)})}}const d9=(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 p={route:window.location.pathname,focusedIdeaId:e.id,viewport:{width:window.innerWidth,height:window.innerHeight}},{error:h,undo:m}=await gM(e.id,f,p);return await t(),m&&l(m),h&&n({title:"Agent did not reply",description:We(h),variant:"error"}),!0}catch(p){return n({title:"Message failed to send",description:We(p.message),variant:"error"}),!1}finally{s(!1)}},undo:a,undoing:i,undoEdit:async()=>{if(!(!e.id||!a)){o(!0);try{const{error:f}=await xM(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)}}}}},f9=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()},h9=e=>{const[t,n]=b.useState(null);return b.useEffect(()=>{if(n(null),!e)return;let r=!1;return f9(e).then(s=>{r||n(s)}).catch(()=>{}),()=>{r=!0}},[e]),t};function nC(){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 hg="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.",rC="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 p9(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
- ${hg}
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 m9(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 pg(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
- ${hg}
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 g9(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 pg(e,"expanding",n,r)}const sC=`- the YAML frontmatter (id, title, status)
158
- - the original body prose beneath the frontmatter`;function y9(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 pg(e,"fleshing out",t,sC)}function T7(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 pg(e,"fleshing out",n,sC)}function x9(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
- ${hg}
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. (${rC} 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 v9(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. ${rC} 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 Ou=({idea:e,otherPlans:t})=>{const n=D(f=>f.launchPlanDraft),r=D(Zr),{state:s,errorMessage:i,run:o}=nC(),{toast:a}=He(),l=()=>{const f=e.id;f&&o(async()=>{try{await n(f,x9(e,t))}catch(p){throw a({title:"Draft failed",description:We(p.message),variant:"error"}),p}})},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(Te,{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})})},w9=({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"})]})};function El(e,t){const{toast:n}=He(),r=D(o=>o.activeGitAction),s=D(o=>o.setActiveGitAction),i=b.useCallback(async o=>{if(!D.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 b9(){const e=D(k=>k.loadGitStatus),t=D(k=>k.loadPlans),n=D(k=>k.loadIdeas),r=D(k=>k.activeGitAction!==null),{toast:s,dismiss:i}=He(),o=()=>Promise.all([e(),t(),n()]),[a,l]=El("push","Push failed"),[c,u]=El("sync","Sync failed"),[f,p]=El("pull","Pull failed"),[h,m]=El("fix-divergence","Fix failed"),y=b.useCallback((k,j)=>{if(j.recovering)return s({title:`${k} needs help`,description:"Handed off to a recovery agent — see Stack for progress",variant:"warning"}),!0;if("conflictPrompt"in j){const{conflictPrompt:_,message:S}=j,E=s({title:`${k} hit a conflict`,description:d.jsxs("div",{className:"flex flex-col items-start gap-2",children:[d.jsx("span",{children:We(S)}),d.jsx(se,{size:"small",onClick:async()=>{const T=await RM(_).catch(P=>({ok:!1,error:We(P.message)}));T.ok&&i(E),s({title:T.ok?"Resolving conflict":"Could not start the agent",description:T.ok?"Handed off to the agent — see Stack for progress":T.error??"The agent did not start.",variant:T.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:h,gitActionBusy:r,handlePush:()=>l(async()=>{await PM(),await e()}),handleSync:()=>u(async()=>{const k=await EM();if(!k.ok){if(y("Sync",k)){await e();return}throw new Error(k.message)}await o()}),handlePull:()=>p(async()=>{await TM(),await o()}),handleFixDivergence:()=>m(async()=>{const k=await NM();if(!k.ok){if(y("Fix",k)){await e();return}throw new Error(k.message)}await o()})}}const k9=["core","cli","app","server","agent","plans","ideas","docs","settings","stack","ui","ci","config","deps","repo"];function _9(e){var r;if(!e||e.phases.length>0&&e.phases.every(s=>s.done))return{title:""};const t=((r=e.tags)==null?void 0:r.find(s=>k9.includes(s)))??"repo";return{title:`${e.kind??"feat"}(${t}): ${e.title}`}}const S9={pass:"success",fail:"error",running:"warning",stale:"neutral"},mf=({label:e,status:t,title:n,anyRunning:r,onClick:s})=>d.jsx(Te,{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(Pe,{size:"small",variant:S9[t],children:[e,d.jsx("span",{className:t==="running"?"visible":"invisible",children:"…"})]})})}),C9=()=>{const e=D(h=>h.status),t=D(h=>h.runCheck),n=D(h=>h.consistency),r=D(h=>h.plans),s=Vt(),[i,o]=b.useState(!1),{qualityStatus:a,testStatus:l,consistencyStatus:c}=b.useMemo(()=>Tm(e),[e]),u=a==="running"||l==="running"||c==="running",f=n.length>0,p=b.useCallback(h=>h.planId?r==null?void 0:r.entries.find(m=>m.id===h.planId):void 0,[r==null?void 0:r.entries]);return d.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[d.jsx(mf,{label:"Quality",status:a,title:"Code style & formatting (Biome lint + format). Click to run.",anyRunning:u,onClick:()=>{t("lint"),t("format")}}),d.jsx(mf,{label:"Tests",status:l,title:"Unit tests (Vitest). Click to run.",anyRunning:u,onClick:()=>t("test")}),d.jsx(mf,{label:"Consistency",status:c,title:"Dead code & architecture (Knip + dependency-cruiser). Click to run.",anyRunning:u,onClick:()=>t("consistency")}),d.jsxs("div",{children:[d.jsx(Te,{content:f?"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 ${f?"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:!f,"aria-expanded":f?i:void 0,"aria-controls":"deliver-doc-findings",onClick:()=>{f&&o(h=>!h)},children:d.jsx(Pe,{size:"small",variant:f?"error":"success",children:"Docs"})})}),i&&f&&d.jsx("div",{id:"deliver-doc-findings",className:"mt-2 flex flex-col gap-2",children:n.map((h,m)=>{const y=p(h);return d.jsx("div",{className:"font-mono text-2xs opacity-70",children:y?d.jsx("button",{type:"button",onClick:()=>s({to:"/plans/$planId",params:{planId:ba(y.id,y.title)}}),className:"bg-none bg-transparent border-none p-0 underline cursor-pointer [font:inherit] text-left",children:h.message}):d.jsx("span",{className:"text-left",children:h.message})},`${h.kind}-${h.title}-${m}`)})})]})]})},j9=({count:e})=>{const t=Vt();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"]})},P9=(e,t)=>{const n=D(M=>M.agentStatus),r=D(M=>M.loadGitStatus),s=D(M=>M.commitInFlight),i=D(M=>M.setCommitInFlight),o=D(M=>M.status),a=D(Cu),l=D(M=>M.launchRunAll),{patch:c}=Qi(),{toast:u}=He(),[f,p]=b.useState(""),[h,m]=b.useState(""),[y,v]=b.useState(!1),[g,x]=b.useState(!1),[w,k]=b.useState(null),[j,_]=b.useState(!1),{title:S}=b.useMemo(()=>_9(e),[e]);b.useEffect(()=>{S&&!f&&p(S)},[S,f]);const E=b.useRef(null),T=b.useRef(null);b.useEffect(()=>{if(!e)return;if(E.current===null){if(n.length===0)return;E.current=new Set(n.filter(N=>N.suggestedCommit).map(N=>N.id))}const M=n.find(N=>{var z;return N.planId===e.id&&N.suggestedCommit&&!((z=E.current)!=null&&z.has(N.id))});!(M!=null&&M.suggestedCommit)||T.current===M.id||(T.current=M.id,p(M.suggestedCommit.title),m(M.suggestedCommit.message))},[n,e]);const P=b.useCallback(async()=>{if(!(!f.trim()||s)){v(!0),i(!0);try{await Sk(t,f.trim(),h.trim()||void 0),p(""),m(""),await r()}catch(M){u({title:"Commit failed",description:We(M.message),variant:"error"}),await r()}finally{v(!1),i(!1)}}},[f,h,t,r,s,i,u]),A=b.useCallback(async()=>{if(t.length!==0){x(!0),k(null);try{const M=await Ck(t);p(M.title),m(M.message)}catch(M){k(M.message)}finally{x(!1)}}},[t]),I=!!(e!=null&&e.id)&&!a,O=b.useCallback(async()=>{if(!(!(e!=null&&e.id)||!o||j||a)){_(!0);try{const M=RL(e.fixes??[],o);await c(e.title,{fixes:M})&&await l(e.id)}finally{_(!1)}}},[e,j,a,o,c,l]);return{commitTitle:f,setCommitTitle:p,committing:y,commitInFlight:s,suggesting:g,suggestError:w,setSuggestError:k,handleCommit:P,handleSuggestFromChanges:A,canFix:I,fixing:j,handleFix:O}},E9=({state:e,filesEmpty:t})=>d.jsxs("div",{className:"flex flex-col gap-2",children:[e.suggestError&&d.jsx(VS,{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:n=>e.setCommitTitle(n.currentTarget.value)})}),d.jsx(ot,{icon:d.jsx(qS,{size:16}),size:"small",label:"Suggest title and message from the diff",disabled:t||e.suggesting,onClick:e.handleSuggestFromChanges,wobble:e.suggesting?1:0})]})]}),T9=({state:e,filesEmpty:t})=>{const n=D(a=>a.status),{qualityStatus:r,testStatus:s,consistencyStatus:i}=b.useMemo(()=>Tm(n),[n]);return r==="fail"||s==="fail"||i==="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…":"Commit"})},N9=()=>{const e=D(c=>c.gitAhead),t=D(c=>c.gitBranchHygiene),{pushing:n,syncing:r,pulling:s,gitActionBusy:i,handlePush:o,handleSync:a,handlePull:l}=b9();return e>0?d.jsxs("div",{className:"flex flex-col items-start gap-3",children:[d.jsxs("p",{className:"m-0 text-xs opacity-50",children:["All changes committed — ",e," commit",e===1?"":"s"," ready to push."]}),d.jsx(se,{size:"small",icon:d.jsx(mW,{size:14}),disabled:i,onClick:o,children:n?"Pushing…":`Push ${e} commit${e===1?"":"s"}`})]}):d.jsxs("div",{className:"flex flex-col items-start gap-3",children:[d.jsx("p",{className:"m-0 text-xs opacity-50",children:"No changed files."}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Te,{content:t==="clean-on-main"?"Already on clean main":void 0,children:d.jsx(se,{size:"small",icon:d.jsx(QS,{size:14}),disabled:i||t==="clean-on-main",onClick:a,children:r?"Syncing…":"Sync to main"})}),d.jsx(se,{size:"small",icon:d.jsx(gW,{size:14}),disabled:i,onClick:l,children:s?"Pulling…":"Pull"})]})]})},R9={review:"review",note:"note",decision:"decision",question:"question",clarification:"clarification"},A9=({messages:e,undo:t,undoing:n,onUndo:r,onPromote:s,promotingIndex:i})=>d.jsx(d.Fragment,{children:e.map((o,a)=>{const l=R9[o.kind],c=o.from==="agent",u=a===e.length-1,f=[{id:"decision",label:"Promote to decision",icon:d.jsx(OS,{size:16}),onSelect:()=>s==null?void 0:s(a,"decision")},{id:"log",label:"Promote to log",icon:d.jsx(XS,{size:16}),onSelect:()=>s==null?void 0:s(a,"log")},{id:"idea",label:"Promote to idea",icon:d.jsx(FS,{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(w9,{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(Pe,{size:"small",fillColor:"rgba(0,0,0,0.06)",children:"agent"}),c&&u&&t&&d.jsx(Te,{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(Pe,{size:"small",fillColor:"rgba(0,0,0,0.06)",children:l}),s&&o.kind==="chat"&&(i===a?d.jsx(Gr,{size:"small",label:"Promoting…"}):d.jsx(HS,{align:"end",trigger:d.jsx(ot,{icon:d.jsx(YS,{size:14}),label:"Promote this message",size:"small",variant:"ghost"}),items:f}))]})]},`${o.kind}-${o.date??""}-${a}`)})}),ts=({id:e})=>e?d.jsx(Pe,{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"},mg={idea:"Idea",planned:"Planned","in-progress":"In progress",review:"Review",done:"Done",dropped:"Dropped"},sr={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"}},oC={open:"Open",done:"Done",dropped:"Dropped"},Zc={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"}},I9={draft:"Draft",open:"Open",closed:"Closed",merged:"Merged"},O0={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"}},M9={approved:"Approved","changes-requested":"Changes requested","review-required":"Review required"},z0={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"}},L9=({pr:e})=>d.jsx("a",{href:e.url,target:"_blank",rel:"noreferrer",onClick:t=>t.stopPropagation(),className:"no-underline inline-flex",children:d.jsx(Pe,{size:"small",fillColor:O0[e.state].fill,textColor:O0[e.state].text,children:d.jsxs("span",{className:"inline-flex items-center gap-1",children:[d.jsx(_W,{}),"#",e.number," ",I9[e.state]]})})}),aC=({pct:e,color:t,height:n=6})=>d.jsx(j6,{value:e,color:t,height:n}),$0={fill:"rgba(143, 185, 150, 0.25)",text:"#5E8A66"},B0={fill:"rgba(0, 0, 0, 0.05)",text:"rgba(0, 0, 0, 0.35)"},Tl=({reached:e,label:t,tooltip:n,href:r})=>{const s=d.jsx(Pe,{size:"small",fillColor:e?$0.fill:B0.fill,textColor:e?$0.text:B0.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(Te,{content:n,children:i}):i},gf=()=>d.jsx("span",{className:"opacity-30","aria-hidden":"true",children:"→"}),V0=(e,t)=>`${e} ${t}${e===1?"":"s"}`;function D9(e){const t=e.match(/\(\[([0-9a-f]+)\]\((\S+)\)\)\s*$/);return t?{hash:t[1],url:t[2]}:void 0}const F9=({trail:e,released:t})=>{var l,c;const{taskRuns:n,commits:r,pr:s,releaseLine:i}=e,o=i.data?D9(i.data):void 0,a=t?`Released ${t}`:o?`Released ${o.hash}`:"Release";return d.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[d.jsx(Tl,{reached:n.reached,label:n.data?V0(n.data.length,"task run"):"Tasks",tooltip:(l=n.data)==null?void 0:l.map(u=>u.taskKind).join(", ")}),d.jsx(gf,{}),d.jsx(Tl,{reached:r.reached,label:r.data?V0(r.data.length,"commit"):"Commits",tooltip:(c=r.data)==null?void 0:c.join(`
212
- `)}),d.jsx(gf,{}),s.data?d.jsx(L9,{pr:s.data}):d.jsx(Tl,{reached:!1,label:"PR"}),d.jsx(gf,{}),d.jsx(Tl,{reached:i.reached||!!t,label:a,tooltip:i.data,href:o==null?void 0:o.url})]})},O9=({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(Pe,{size:"small",fillColor:z0[t].fill,textColor:z0[t].text,children:M9[t]}),!!n&&d.jsxs(Pe,{size:"small",fillColor:sr["in-progress"].fill,textColor:sr["in-progress"].text,children:[n," unaddressed comment",n===1?"":"s",r?" · new":""]})]})},lC=({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),[p,h]=b.useState(null),[m,y]=b.useState(null),[v,g]=b.useState(!1),[x,w]=b.useState(null),[k,j]=b.useState(null),_=D(N=>{var z;return((z=N.plans)==null?void 0:z.entries)??[]}),{patch:S}=Qi(),E=Vt(),T=eC(s,_.map(N=>({id:N.id,title:N.title,body:N.body,tags:N.tags,log:N.log})));b.useEffect(()=>{e&&(i(""),a(r??""),c(!1),f(!1),h(null),g(!1),w(null),j(null))},[e,r]);const P=(N,z)=>{t(),E({to:"/plans/$planId",params:{planId:ba(N,z)}})},A=async()=>{const N=`${s.trim()}${o.trim()?`
213
-
214
- ${o.trim()}`:""}`;if(N){g(!0),j(null),w(null);try{const z=_.map(V=>({id:V.id,title:V.title,body:V.body,tags:V.tags}));w(await Tk(N,z))}catch(z){j(z.message)}finally{g(!1)}}},I=N=>{const z=_.find(V=>V.id===N);z&&P(z.id,z.title)},O=async(N,z,V)=>{y(N);const B={date:new Date().toISOString().slice(0,10),text:s.trim()},C=await S(z,{log:[...V??[],B]},{errorTitle:"Extend failed"});y(null),C&&t()},M=async N=>{if(N.preventDefault(),!(!s.trim()||u)){h(null),f(!0);try{await n({title:s.trim(),content:o.trim()||void 0,kind:l?"note":void 0}),t()}catch(z){h(z.message)}finally{f(!1)}}};return d.jsx(Da,{open:e,onClose:t,title:"New idea",size:"small",children:d.jsxs("form",{onSubmit:M,className:"flex flex-col gap-4",children:[d.jsx(La,{label:"Title",value:s,onChange:N=>i(N.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}),T.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"}),T.map(({candidate:N})=>{const z={id:N.id??null,title:N.title,body:N.body,log:N.log},V=_.filter(L=>L.id!==N.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(ts,{id:N.id}),d.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:N.title})]}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(se,{type:"button",variant:"ghost",size:"small",onClick:()=>P(N.id,N.title),children:"Open it"}),d.jsx(se,{type:"button",variant:"ghost",size:"small",disabled:!N.id||!s.trim()||m!==null,onClick:()=>N.id&&O(N.id,N.title,N.log),children:m===N.id?"Extending…":"Extend it instead"}),d.jsx(Ou,{idea:z,otherPlans:V})]})]})},N.id??N.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()||v,onClick:A,children:v?"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(Fu,{label:"Description",value:o,onChange:N=>a(N.target.value),placeholder:"Optional details…",disabled:u,rows:4}),d.jsx(S8,{label:"Just a note (no plan needed)",checked:l,onChange:N=>c(N.target.checked),disabled:u}),p&&d.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:p}),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"})]})]})})},z9=({suggestion:e,onClose:t})=>{const n=D(u=>u.promoteSuggestion),r=D(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=D.getState().ideaEntries.find(p=>p.id===u);if(f)try{await r(u,y9(f))}catch(p){l({title:"Idea created, but the refine agent failed to launch",description:We(p.message),variant:"error"})}t()}catch(u){a(u.message)}finally{i(!1)}}};return d.jsx(Da,{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"})]})]})})},yf=({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}`)})}),U0=e=>d.jsx("h4",{className:"font-display-luminari text-xs font-semibold mb-2 opacity-[0.65]",children:e}),$9=({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,y)=>({phase:m,before:t.phases[y],index:y})).filter(({phase:m,before:y})=>y!==void 0&&(m.text!==y.text||(m.description??"")!==(y.description??""))),f=i||a,p=async()=>{if(!f){o(!0);try{await r()}finally{o(!1)}}},h=async()=>{l(!0);try{await n()}finally{l(!1)}};return d.jsx(Da,{open:!0,title:s?`Review reconcile changes (${s.index} of ${s.total})`:"Review reconcile changes",size:"large",onClose:f?()=>{}:p,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:[U0("Body"),d.jsx("p",{className:"text-base m-0 leading-normal",children:d.jsx(yf,{tokens:Ld(t.body,e.body)})})]}),u.length>0&&d.jsxs("div",{children:[U0("Phases"),d.jsx("div",{className:"flex flex-col gap-3",children:u.map(({phase:m,before:y,index:v})=>d.jsxs("div",{className:"text-sm leading-normal",children:[d.jsx(yf,{tokens:Ld(y.text,m.text)}),(m.description||y.description)&&d.jsx("div",{className:"opacity-[0.85] mt-1",children:d.jsx(yf,{tokens:Ld(y.description??"",m.description??"")})})]},v))})]}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(se,{variant:"danger",size:"small",onClick:p,disabled:f,children:"Discard"}),d.jsx(se,{variant:"primary",size:"small",onClick:h,disabled:f,children:"Approve"})]})]})})},B9=({onOpenIdea:e})=>{const t=D(f=>f.archivableIdeas),n=D(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(p){a({title:"Archive failed",description:p.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.title):void 0,onKeyDown:e?p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),e(f.title))}:void 0,className:`flex items-center gap-2 flex-1 min-w-0 ${e?"cursor-pointer":""}`,children:[d.jsx(ts,{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))})]})},V9="font-display-luminari font-semibold text-[1.75rem] leading-[1.2]";function W0(e,t){return e.toFixed(t).replace(/\.0+$/,"").replace(/(\.\d*?)0+$/,"$1")}function cC(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 To(e){return e>=1e6?`${W0(e/1e6,1)}M`:e>=1e3?`${W0(e/1e3,1)}k`:`${Math.round(e)}`}function U9(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 W9=({onAdd:e,disabled:t})=>{const[n,r]=b.useState(!1),[s,i]=b.useState(""),[o,a]=b.useState(null),[l,c]=b.useState(!1),u=()=>{r(!1),i(""),a(null)},f=async()=>{let p;try{p=jL(s)}catch(h){a(h instanceof Error?h.message:"Could not parse findings");return}c(!0),a(null);try{await e(p),u()}finally{c(!1)}};return d.jsxs(d.Fragment,{children:[d.jsx(Te,{content:"Add code-review findings as phases",children:d.jsx(ot,{variant:"ghost",size:"small",onClick:()=>r(!0),disabled:t,"aria-label":"Add code-review findings as phases",icon:d.jsx(t5,{size:16})})}),d.jsx(Da,{open:n,onClose:u,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(Fu,{value:s,onChange:p=>i(p.target.value),placeholder:'[{ "description": "...", "file": "src/foo.ts", "line_start": 12, "failure_scenario": "..." }]',rows:10,disabled:l}),o&&d.jsxs(VS,{variant:"warning",children:["Could not add phases — ",o]}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(se,{type:"button",variant:"ghost",onClick:u,disabled:l,children:"Cancel"}),d.jsx(se,{type:"button",variant:"primary",onClick:f,disabled:l||!s.trim(),children:"Add phases"})]})]})})]})},H9=lL.map(e=>({value:e,label:e})),G9=({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,p]=b.useState(null),[h,m]=b.useState(null),[y,v]=b.useState(!1),[g,x]=b.useState(null),[w,k]=b.useState(null),j=D(N=>{var z;return((z=N.plans)==null?void 0:z.entries)??[]}),{patch:_}=Qi(),S=Vt(),{toast:E}=He(),T=eC(r,j.map(N=>({id:N.id,title:N.title,body:N.body,tags:N.tags,log:N.log})));b.useEffect(()=>{e&&(s(""),o(""),l("feat"),u(!1),p(null),v(!1),x(null),k(null))},[e]),b.useEffect(()=>{x(null),k(null)},[r,i]);const P=(N,z)=>{t(),S({to:"/plans/$planId",params:{planId:ba(N,z)}})},A=async()=>{const N=`${r.trim()}${i.trim()?`
215
-
216
- ${i.trim()}`:""}`;if(N){v(!0),k(null),x(null);try{const z=j.map(V=>({id:V.id,title:V.title,body:V.body,tags:V.tags}));x(await Tk(N,z))}catch(z){k(z.message)}finally{v(!1)}}},I=N=>{const z=j.find(V=>V.id===N);z?P(z.id,z.title):E({title:"Plan not found",description:`No plan with id ${N}`,variant:"error"})},O=async(N,z,V)=>{m(N);const B={date:new Date().toISOString().slice(0,10),text:r.trim()},C=await _(z,{log:[...V??[],B]},{errorTitle:"Extend failed"});m(null),C&&t()},M=async N=>{if(N.preventDefault(),!(!r.trim()||c)){p(null),u(!0);try{await n({title:r.trim(),content:i.trim()||void 0,kind:a}),t()}catch(z){p(z.message)}finally{u(!1)}}};return d.jsx(Da,{open:e,onClose:t,title:"Quick plan",size:"small",children:d.jsxs("form",{onSubmit:M,className:"flex flex-col gap-4",children:[d.jsx(La,{label:"Title",value:r,onChange:N=>s(N.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}),T.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"}),T.map(({candidate:N})=>{const z={id:N.id??null,title:N.title,body:N.body,log:N.log},V=j.filter(L=>L.id!==N.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(ts,{id:N.id}),d.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:N.title})]}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(se,{type:"button",variant:"ghost",size:"small",onClick:()=>P(N.id,N.title),children:"Open it"}),d.jsx(se,{type:"button",variant:"ghost",size:"small",disabled:!N.id||!r.trim()||h!==null,onClick:()=>N.id&&O(N.id,N.title,N.log),children:h===N.id?"Extending…":"Extend it instead"}),d.jsx(Ou,{idea:z,otherPlans:V})]})]})},N.id??N.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()||y,onClick:A,children:y?"Checking overlap…":"Check overlap"})}),w&&d.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:w}),g&&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:g.verdict==="new"?"Looks genuinely new":g.verdict==="extend"?`Extends ${g.targetId??"an existing idea"}`:`Belongs inside ${g.targetId??"an existing idea"}`}),d.jsx("span",{className:"text-sm opacity-80",children:g.reasoning}),g.targetId&&d.jsx("div",{className:"flex justify-end",children:d.jsx(se,{type:"button",variant:"ghost",size:"small",onClick:()=>I(g.targetId),children:"Open it"})})]})})]}),d.jsx($S,{label:"Kind",value:a,onChange:N=>l(N),options:H9,disabled:c}),d.jsx(Fu,{label:"Description",value:i,onChange:N=>o(N.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"})]})]})})},K9=()=>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"})]}),q9=()=>{const e=D(o=>o.loadPlans),t=D(o=>o.gitBranchHygiene),[n,r]=b.useState(!1),s=t==="stale-merged",i=async o=>{await YM(o),await e(),r(!1)};return d.jsxs(d.Fragment,{children:[d.jsx(Te,{content:s?"Switch to main first":void 0,children:d.jsx(ot,{icon:d.jsx(K9,{}),variant:"ghost",size:"small",label:s?"Switch to main first":"Quick plan",disabled:s,onClick:()=>r(!0)})}),d.jsx(G9,{open:n,onClose:()=>r(!1),onAdd:i})]})},Q9=({planId:e,phaseIndex:t,disabled:n})=>{const r=D(u=>u.launchAgent),s=D(Zr),{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"})},Y9=({plan:e,disabled:t})=>{const n=D(l=>l.launchPlanAudit),r=D(Zr),[s,i]=b.useState(!1),o=async()=>{if(e.id){i(!0);try{await n(e.id,p9(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(Te,{content:a,children:d.jsx(se,{variant:"ghost",size:"small",onClick:o,disabled:t||s||!e.id||!r,children:"Audit"})})},gg=({idea:e,compact:t})=>{const n=D(p=>p.launchIdeaExtend),r=D(Zr),{state:s,errorMessage:i,run:o}=nC(),{toast:a}=He(),l=e.id,c=()=>{l&&o(async()=>{const p=D.getState().ideaEntries.find(h=>h.id===l);if(!p)throw new Error(`Idea ${l} not found`);try{await n(l,g9(p))}catch(h){throw a({title:"Extension failed",description:We(h.message),variant:"error"}),h}})},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(Te,{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})})},X9=({plan:e,disabled:t})=>{const n=D(u=>u.launchFixReview),r=D(Zr),s=D(UL),[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(Te,{content:c,children:d.jsx(Qn,{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"})})},J9=()=>{const e=D(s=>s.loadIdeas),[t,n]=b.useState(!1),r=async s=>{await Ek(s),await e(),n(!1)};return d.jsxs(d.Fragment,{children:[d.jsx(se,{icon:d.jsx(FS,{size:16}),size:"small",onClick:()=>n(!0),children:"New idea"}),d.jsx(lC,{open:t,onClose:()=>n(!1),onAdd:r})]})},Z9=({plan:e,disabled:t})=>{const n=D(l=>l.launchPlanReconcile),r=D(Zr),[s,i]=b.useState(!1),o=async()=>{if(e.id){i(!0);try{await n(e.id,m9(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(Te,{content:a,children:d.jsx(se,{variant:"ghost",size:"small",onClick:o,disabled:t||s||!e.id||!r,children:"Refresh"})})},eH=()=>{const e=D(s=>s.refreshAll),t=D(s=>s.refreshing),{toast:n}=He(),r=async()=>{if(t)return;const s=await e();s.ok?n({title:"Up to date",description:"Plans, ideas, checks and PR review state re-read.",variant:"success"}):n({title:"Couldn't refresh",description:s.error??"The read failed — is the dev server running?",variant:"error"})};return d.jsx(ot,{icon:d.jsx("span",{className:"inline-flex",children:d.jsx(yW,{size:16})}),label:t?"Refreshing…":"Refresh data",size:"small",variant:"ghost",disabled:t,onClick:r})},tH=({plan:e,disabled:t})=>{const n=D(c=>c.launchRunAll),r=D(Zr),[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(Te,{content:l,children:d.jsx(Qn,{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"})})},nH=()=>{const e=D(y=>y.launchSuggestIdeas),t=D(y=>y.launchBatchReconcile),n=D(y=>y.launchPrioritise),r=D(y=>y.ideaEntries),s=D(y=>y.suggestions),i=D(Cu),o=D(Zr),{toast:a}=He(),[l,c]=b.useState(null),u=async()=>{c("suggest");try{await e(v9(r,s))}catch(y){a({title:"Failed to launch",description:We(y.message),variant:"error"})}finally{c(null)}},f=async()=>{c("reconcile");try{await t()}catch(y){a({title:"Failed to launch",description:We(y.message),variant:"error"})}finally{c(null)}},p=async()=>{c("prioritise");try{const y=await n();a({title:y.moved.length>0?"Queue reordered":"Already in order",description:y.why||void 0,variant:"success"})}catch(y){a({title:"Failed to prioritise",description:We(y.message),variant:"error"})}finally{c(null)}},h=l!==null||i,m=[{id:"suggest-ideas",label:l==="suggest"?"Starting…":"Suggest ideas",icon:d.jsx(qS,{size:16}),disabled:h||!o,onSelect:u},{id:"reconcile-all",label:l==="reconcile"?"Starting…":"Reconcile all",icon:d.jsx(OS,{size:16}),disabled:h||!o,onSelect:f},{id:"prioritise",label:l==="prioritise"?"Prioritising…":"Prioritise queue",icon:d.jsx(xW,{size:16}),disabled:h||!o,onSelect:p}];return d.jsx(HS,{align:"end",trigger:d.jsx(ot,{icon:d.jsx(YS,{size:16}),label:"More actions",size:"small",variant:"ghost"}),items:m})};function rH(e){const t=e==null?void 0:e.match(/^[a-z]+\/([a-z]+-\d+)-/);return t?t[1].toUpperCase():null}const zu="font-display-luminari text-sm font-semibold opacity-[0.65]",sH=({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:cC(e.durationMs)}),d.jsx("span",{"aria-hidden":!0,children:"·"}),d.jsx(Te,{content:`Cache: ${To(e.cacheCreationTokens)} write · ${To(e.cacheReadTokens)} read`,children:d.jsxs("span",{children:[To(e.inputTokens)," in · ",To(e.outputTokens)," out"]})})]}),iH=({plan:e,auditRunning:t,agentBusy:n,runningFill:r,updating:s,onTogglePhase:i,onToggleFix:o,onAddReviewPhases:a})=>{const l=D(h=>h.launchRunAll),c=e.fixes??[],u=c.some(h=>!h.done),f=[...e.phases.map((h,m)=>({kind:"phase",item:h,index:m})),...c.map((h,m)=>({kind:"fix",item:h,index:m}))],p=h=>h.kind==="phase"&&!h.item.done&&(r==null?void 0:r.index)===h.index;return d.jsx("div",{className:"mb-8",style:r?{"--phase-fill":`${r.fraction*100}%`}:void 0,children:d.jsx(U5,{data:f,toolbar:{title:d.jsx("h3",{className:`${zu} m-0`,children:"Phases"}),actions:d.jsxs(d.Fragment,{children:[t&&d.jsx(Gr,{size:"small",label:"Audit running…"}),(e.status==="review"||e.status==="done")&&d.jsx(Y9,{plan:e}),e.status!=="done"&&d.jsx(Z9,{plan:e}),d.jsx(W9,{onAdd:a,disabled:s}),e.id&&u&&d.jsx(Te,{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(uC,{plan:e}),columns:[{key:"checkbox",header:"",cell:h=>p(h)?d.jsx(Gr,{size:"small"}):d.jsx(xB,{checked:h.item.done,onChange:()=>h.kind==="phase"?i(h.index):o(h.index),disabled:s}),width:1},{key:"title",header:"Title",cell:h=>d.jsxs("span",{className:`inline-flex min-w-0 max-w-full items-center gap-2 ${h.item.done?"line-through opacity-[0.45]":"no-underline"}`,children:[d.jsx("span",{title:h.item.text,className:"overflow-hidden text-ellipsis whitespace-nowrap font-handwritten text-base leading-tight",children:h.item.text}),p(h)&&d.jsxs("span",{className:"text-xs opacity-[0.55]",children:[Math.round(((r==null?void 0:r.fraction)??0)*100),"%"]}),h.kind==="phase"&&h.item.source==="review"&&d.jsx(Pe,{size:"small",fillColor:sr.review.fill,textColor:sr.review.text,children:"review"}),h.kind==="fix"&&d.jsx(Pe,{size:"small",variant:"warning",children:"fix"})]})},{key:"actions",header:"",align:"end",cell:h=>p(h)?null:h.item.done?h.item.run?d.jsx("div",{className:"flex justify-end",children:d.jsx(Pe,{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:[To(h.item.run.inputTokens+h.item.run.outputTokens)," tokens · ",cC(h.item.run.durationMs),h.item.run.attempts>1&&` ×${h.item.run.attempts}`,h.item.run.model&&` · ${h.item.run.model}`]})})}):null:h.kind!=="phase"?null:d.jsx("div",{className:"flex justify-end",children:d.jsx(Q9,{planId:e.id,phaseIndex:h.index,disabled:n})}),width:5}],expandable:{render:h=>h.item.description||null},hideHeader:!0,density:"compact",showExpandColumn:!1,rowTexture:h=>{if(h.kind==="fix")return"kraft";if(h.kind==="phase"&&h.item.done)return"canvas"},rowClassName:h=>{if(p(h))return"phase-running-row";if(h.kind==="phase"&&h.item.source==="review")return"bg-[rgba(155,122,181,0.08)]"},className:"phase-table-phone"})})},oH=({plan:e,gitBranch:t,onOwnBranch:n,branching:r,onCreateBranch:s})=>{const i=e.status==="planned"||e.status==="in-progress"||e.status==="review";return!i&&!e.pr?null: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(Te,{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})})}),e.pr&&d.jsx(O9,{pr:e.pr})]})},aH=({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(aC,{pct:e.pct,color:t})}),d.jsxs("span",{className:"text-sm opacity-50 flex-shrink-0",children:[Math.round(e.pct),"%"]})]}),d.jsx(sH,{rollup:n})]}),lH=({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(K6,{title:d.jsx("span",{className:zu,children:"Description"}),expanded:t,onToggle:()=>n(r=>!r),children:d.jsx("div",{className:"opacity-[0.85]",children:d.jsx(vk,{children:e.body})})})}):null},cH=({clarifications:e})=>e.length===0?null:d.jsxs("div",{className:"mb-5",children:[d.jsx("h3",{className:`${zu} 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}`))})]}),uC=({plan:e})=>{const t=D(i=>i.gitStatus),n=b.useMemo(()=>(t==null?void 0:t.map(i=>i.path))??[],[t]),r=P9(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(C9,{}),s&&d.jsx(E9,{state:r,filesEmpty:!s})]}),d.jsx(cg,{orientation:"vertical",className:"hidden md:block"}),d.jsx("div",{className:"flex flex-col gap-2",children:s?d.jsxs(d.Fragment,{children:[d.jsx(j9,{count:n.length}),d.jsx(T9,{state:r,filesEmpty:!s})]}):d.jsx(N9,{})})]})},uH=({planId:e,released:t})=>{const n=h9(e);return e?d.jsx("div",{className:"mb-3 text-xs opacity-80",children:n?d.jsx(F9,{trail:n,released:t}):d.jsx("div",{className:"max-w-xs","aria-hidden":"true",children:d.jsx(Kt,{variant:"text",height:32})})}):null},dH=({plan:e,updating:t,onSend:n,undo:r,undoing:s,onUndo:i})=>{var w;const[o,a]=b.useState(""),[l,c]=b.useState(null),[u,f]=b.useState(null),p=e.thread??[],{promotingIndex:h,promoteToDurable:m,promoteToIdea:y}=r9(e);n9(e,!0);const v=async()=>{const k=o.trim();k&&(c(k),a(""),await n(k)||a(j=>j||k),c(null))},g=(k,j)=>{j==="idea"?f(k):m(k,j)},x=async k=>{u!==null&&await y(u,k)&&f(null)};return d.jsxs("div",{className:"mb-8",children:[d.jsx("h3",{className:`${zu} 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:p.length>0||l?d.jsxs(d.Fragment,{children:[d.jsx(A9,{messages:p,undo:r,undoing:s,onUndo:i,onPromote:g,promotingIndex:h}),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(Gr,{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(Fu,{value:o,onChange:k=>a(k.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:v,disabled:t||!o.trim(),children:"Send"})})]})]}),d.jsx(lC,{open:u!==null,onClose:()=>f(null),onAdd:x,initialContent:u!==null?(w=p[u])==null?void 0:w.text:void 0})]})},fH=({plan:e})=>{const t=D(L=>L.plans),n=D(L=>L.gitBranch),r=D(L=>L.loadGitStatus),s=D(L=>L.loadPlans),{toast:i}=He(),{patch:o,updating:a}=Qi(),[l,c]=b.useState(!1),u=D(L=>L.agentStatus),f=D(Cu),p=D(L=>L.detailView),h=D(L=>L.taskLog),m=D(L=>L.loadTaskLog),y=Cm(e.id,u),v=u9(y,h),g=b.useMemo(()=>U9(h,e.id),[h,e.id]),x=(y==null?void 0:y.taskKind)==="audit",w=sL(e,(v==null?void 0:v.fraction)??0),k=e.phases.length>0,j=p==="feedback",_={id:e.id??null,title:e.title,body:e.body,log:e.log},S=((t==null?void 0:t.entries)??[]).filter(L=>L.id!==e.id),E=e.id!==void 0&&rH(n)===e.id;b.useEffect(()=>{m()},[m]);const T=async()=>{if(e.id){c(!0);try{const L=await AM(e.id);i({title:"Branch ready",description:`Now on ${L}`,variant:"success"}),await r()}catch(L){i({title:"Branch failed",description:We(L.message),variant:"error"})}finally{c(!1)}}},P=async L=>{const B=e.phases.map(($,Q)=>Q===L?{...$,done:!$.done}:$);B.every($=>$.done)&&e.status==="in-progress"?await o(e.title,{phases:B,status:"review"}):await o(e.title,{phases:B})},A=async L=>{await o(e.title,{phases:[...e.phases,...L]})},I=async L=>{const B=(e.fixes??[]).map(($,Q)=>Q===L?{...$,done:!$.done}:$);B.every($=>$.done)&&e.status==="in-progress"?await o(e.title,{fixes:B,status:"review"}):await o(e.title,{fixes:B})},{sending:O,send:M,undo:N,undoing:z,undoEdit:V}=d9(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:`${V9} m-0 flex items-center gap-3 min-w-0 flex-wrap`,children:[d.jsx(ts,{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 ${Fc(e.updated)}`:`created ${Fc(e.created)}`}),d.jsx(eH,{})]})]}),d.jsx(uH,{planId:e.id,released:e.released}),j?d.jsx(dH,{plan:e,updating:O,onSend:M,undo:N,undoing:z,onUndo:V}):d.jsxs(d.Fragment,{children:[d.jsx(oH,{plan:e,gitBranch:n,onOwnBranch:E,branching:l,onCreateBranch:T}),d.jsx(aH,{progress:w,color:iC[jm(e,u)],rollup:g}),d.jsx(lH,{plan:e}),d.jsx(cH,{clarifications:e.clarifications??[]}),!k&&d.jsxs("div",{className:"flex items-center gap-3 mb-8",children:[d.jsx(Ou,{idea:_,otherPlans:S}),d.jsx(gg,{idea:_})]}),!k&&d.jsx(uC,{plan:e}),k&&d.jsx(iH,{plan:e,auditRunning:x,agentBusy:f,runningFill:v,updating:a,onTogglePhase:P,onToggleFix:I,onAddReviewPhases:A})]})]})},hH=()=>{const[e,t]=b.useState(new Set);return b.useEffect(()=>{let n=!1;return jk().then(r=>{n||!r||t(new Set(r.horizons.flatMap(s=>s.items.map(i=>i.name))))}).catch(()=>{}),()=>{n=!0}},[]),e},bo="text-sm font-semibold opacity-60 whitespace-nowrap overflow-hidden",yg=({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(Gr,{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(Pe,{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(dg,{size:14})}):null}),op="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",dC=({plans:e,activePlanTitle:t,onOpen:n,showHeader:r=!0})=>{const s=op,i=D(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:bo,children:"Id"}),d.jsx("span",{className:bo,children:"Title"}),d.jsx("span",{className:`max-lg:hidden ${bo}`,children:"Updated"}),d.jsx("span",{className:bo,children:"Progress"}),d.jsx("span",{className:bo,children:"Status"})]})})})]}),e.map(o=>{var c;const a=Ak(o),l=jm(o,i);return d.jsxs("div",{className:"flex items-center",children:[d.jsx(yg,{order:o.order,done:o.status==="done",status:o.status,running:!!Cm(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(ts,{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?Fc(o.updated):Fc(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(aC,{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(Pe,{size:"small",fillColor:sr[l].fill,textColor:sr[l].text,children:mg[l]}),((c=o.pr)==null?void 0:c.state)==="merged"&&d.jsx(Te,{content:`Merged in #${o.pr.number}`,children:d.jsx("span",{className:"inline-flex text-[#7B5E9E]",children:d.jsx(QS,{size:14})})})]})]})})})]},o.title)})]})},pH=5,mH="text-sm font-semibold opacity-60 whitespace-nowrap overflow-hidden",fC="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",H0="font-handwritten text-xs font-semibold opacity-55 leading-none pt-2 pr-1 pb-0 pl-1",G0=`${mH} bg-none bg-transparent border-none p-0 cursor-pointer [font:inherit] text-inherit text-left`,gH=[{key:"id",label:"Id"},{key:"title",label:"Title"},{key:"updated",label:"Updated"},{key:"progress",label:"Progress"},{key:"status",label:"Status"}],hC="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",pC="overflow-hidden text-ellipsis whitespace-nowrap",yH=({rows:e,plans:t,activePlanTitle:n,onOpenPlan:r,onOpenIdea:s})=>{const[i,o]=b.useState(new Set),{subjects:a,loading:l,available:c}=tC(),u=hH(),f=Vt(),p=fC,h=D(_=>_.planFilters.sortKey),m=D(_=>_.planFilters.sortDirection),y=D(_=>_.setPlanSortKey),v=D(_=>_.togglePlanSortDirection),g=_=>{_===h?v():y(_)},x=_=>{o(S=>{const E=new Set(S);return E.has(_)?E.delete(_):E.add(_),E})},w=_=>_.type==="plan"?d.jsx(dC,{plans:[_.plan],activePlanTitle:n,onOpen:r,showHeader:!1},_.plan.title):_.type==="note"?d.jsx(xH,{row:_,onOpen:s},_.idea.title):d.jsx(vH,{row:_,plans:t,activePlanTitle:n,onOpenPlan:r,onOpenIdea:s,expanded:i.has(_.idea.title),onToggleExpanded:()=>x(_.idea.title)},_.idea.title),k=yL(e,m,l||!c?void 0:a),j=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":h==="order"?m==="asc"?"ascending":"descending":void 0,children:d.jsxs("button",{type:"button",className:G0,"aria-label":"Sort by run order",onClick:()=>g("order"),children:["#",h==="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:p,children:gH.map(({key:_,label:S})=>{const E=_===h;return d.jsx("span",{role:"columnheader",className:_==="updated"?"max-lg:hidden":void 0,"aria-sort":E?m==="asc"?"ascending":"descending":void 0,children:d.jsxs("button",{type:"button",className:G0,onClick:()=>g(_),children:[S,E&&(m==="asc"?" ▲":" ▼")]})},_)})})})})]}),j?k.map(_=>{const S=_.subject;return d.jsxs("div",{className:"flex flex-col gap-1",children:[d.jsx("div",{className:"flex items-baseline gap-2",children:S&&u.has(S)?d.jsx("button",{type:"button",className:`${H0} bg-none bg-transparent border-none cursor-pointer text-left hover:underline`,title:"View in roadmap",onClick:()=>f({to:"/roadmap",search:{item:S}}),children:S}):d.jsx("div",{className:H0,children:S??"No subject"})}),_.rows.map(E=>w(E))]},S??"__no-subject__")}):e.map(_=>w(_))]})},xH=({row:e,onOpen:t})=>{const n=e.idea,r=n.status??"open";return d.jsxs("div",{className:"flex items-center",children:[d.jsx(yg,{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:fC,children:[n.id?d.jsx(ts,{id:n.id}):d.jsx("span",{}),d.jsxs("span",{className:`${hC} [cursor:inherit]`,children:[d.jsx(XS,{}),d.jsx("span",{className:pC,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(Pe,{size:"small",fillColor:Zc[r].fill,textColor:Zc[r].text,children:oC[r]})]})})})]})},vH=({row:e,plans:t,activePlanTitle:n,onOpenPlan:r,onOpenIdea:s,expanded:i,onToggleExpanded:o})=>{const a=e.idea,l=e.children,c=l.filter(h=>h.status==="done"),u=l.filter(h=>h.status!=="done"),f=l.length>pH,p=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(yg,{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(ts,{id:a.id}):d.jsx("span",{}),d.jsxs("button",{type:"button",onClick:()=>s==null?void 0:s(a.title),className:hC,children:[d.jsx(dg,{}),d.jsx("span",{className:pC,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(gg,{idea:a,compact:!0}),d.jsx(Ou,{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(dC,{plans:p,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`})]})]})},wH=({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(yH,{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."})})},bH=({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(ts,{id:e.id??void 0}),e.title,e.status&&d.jsx(Pe,{size:"small",fillColor:Zc[e.status].fill,textColor:Zc[e.status].text,children:oC[e.status]})]}),d.jsx(vk,{children:e.body.replace(/^#{1,3}\s+.+(\n|$)/,"").replace(/^\s*-{3,}\s*(\n|$)/,"").trim()}),d.jsx("div",{className:"mt-6",children:d.jsx(gg,{idea:e})})]}),xf="__no-subject__",ko="text-2xs font-semibold tracking-[0.08em] uppercase text-ink-300",kH=()=>{const e=fg(),t=D(Cu),n=D(M=>M.agentStatus),{patch:r,updating:s}=Qi(),{subjects:i,available:o}=tC(),a=D(M=>M.detailView),l=D(M=>M.setDetailView),c=D(M=>M.archiveIdeas),{toast:u}=He(),f=Vt(),[p,h]=b.useState(""),[m,y]=b.useState(!1);if(b.useEffect(()=>{h((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 v=jm(e,n),g=e.status==="in-progress",x=e.status==="review",w=e.status==="dropped",k=e.status==="done",j=e.phases.some(M=>!M.done),_=(e.status==="planned"||g)&&j,S=iL(e),E=!!(e.pr&&(e.pr.state==="open"||e.pr.state==="draft")&&e.pr.unresolvedThreadCount),T=o&&e.subject&&!i.includes(e.subject)?e.subject:void 0,P=M=>r(e.title,M),A=async()=>{if(e.id){y(!0);try{await c([e.id])}catch(M){u({title:"Archive failed",description:M.message,variant:"error"})}finally{y(!1)}}},I=g||x||e.status==="planned",O=async()=>{const M=p.trim(),N=Number(M);if(M===""||!Number.isInteger(N)||N<1){h(e.order!==void 0?String(e.order):"");return}N!==e.order&&await P({order:N})};return d.jsxs("div",{className:"flex flex-col gap-4 -mt-5",children:[d.jsx(WS,{items:[{id:"plans",label:"Plans",onClick:()=>f({to:"/"})},{id:"plan",label:e.title}]}),d.jsxs("div",{children:[d.jsx("div",{className:`${ko} mb-1.5`,children:"Show"}),d.jsxs("div",{className:"flex flex-col gap-1",children:[d.jsx(Qn,{size:"small",active:a==="details",onClick:()=>l("details"),className:"text-xs leading-4 py-2",children:"Details"}),d.jsx(Qn,{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:ko,children:"Status"}),d.jsx(Pe,{size:"small",fillColor:sr[v].fill,textColor:sr[v].text,children:mg[v]})]}),d.jsxs("div",{children:[d.jsx("div",{className:`${ko} mb-1.5`,children:"Subject"}),d.jsx($S,{size:"small",value:e.subject??xf,onChange:M=>P({subject:M===xf?null:M}),disabled:s||!o,options:[{value:xf,label:"No subject"},...T?[{value:T,label:`${T} (orphan)`}]:[],...!o&&e.subject&&!T?[{value:e.subject,label:e.subject}]:[],...i.map(M=>({value:M,label:M}))]})]}),I&&d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("div",{className:ko,children:"Order"}),d.jsx(La,{type:"number",size:"small","aria-label":"Run order",min:1,value:p,onChange:M=>h(M.target.value),onBlur:O,disabled:s,className:"w-20"})]}),d.jsxs("div",{children:[d.jsx("div",{className:`${ko} mb-1.5`,children:"Actions"}),d.jsxs("div",{className:"flex flex-col gap-1",children:[_&&d.jsx(tH,{plan:e,disabled:t||s}),E&&d.jsx(X9,{plan:e,disabled:t||s}),x&&d.jsx(Qn,{size:"small",icon:d.jsx("span",{className:"text-watercolor-green-dark",children:"✓"}),onClick:()=>P({status:"done"}),disabled:s,className:`text-xs leading-4 py-2 ${s?"opacity-50":""}`,children:"Approve & close"}),k&&d.jsx(Qn,{size:"small",icon:d.jsx("span",{className:"text-ink-300",children:"▣"}),onClick:A,disabled:m||!e.id,className:`text-xs leading-4 py-2 ${m||!e.id?"opacity-50":""}`,children:m?"Archiving…":"Archive"}),S&&d.jsx(Qn,{size:"small",icon:d.jsx("span",{className:"text-watercolor-green-dark",children:"✓"}),onClick:A,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(Qn,{size:"small",icon:d.jsx("span",{className:w?"text-watercolor-green-dark":"text-watercolor-rose-dark",children:w?"↺":"⊘"}),onClick:()=>P({status:w?null:"dropped"}),disabled:s,className:`text-xs leading-4 py-2 ${s?"opacity-50":""}`,children:w?"Reopen plan":"Mark dropped"})]})]})]})},_H=["in-progress","review","planned","idea","done","dropped"],SH="text-2xs font-semibold tracking-[0.08em] uppercase text-ink-300 mb-2",CH=()=>{const e=D(f=>f.plans),t=fg(),n=D(f=>f.planFilters),r=D(f=>f.togglePlanStatus),s=D(f=>f.setPlanSearch),i=D(f=>f.setSubjectFilter),o=Vt();if(!e||t)return null;const{statusCounts:a}=ql(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=_H.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:SH,children:"Status"}),d.jsx("div",{className:"flex flex-col gap-1",children:u.map(f=>{const p=l.has(f);return d.jsx(Qn,{size:"small",active:p,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:sr[f].text}}),action:d.jsx("span",{className:"text-2xs text-ink-500",children:a[f]}),children:mg[f]},f)})})]})]})},K0=()=>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(J9,{}),d.jsx(q9,{}),d.jsx(nH,{})]}),jH=[{key:"a",title:"72%"},{key:"b",title:"54%"},{key:"c",title:"83%"},{key:"d",title:"46%"},{key:"e",title:"66%"},{key:"f",title:"58%"}],PH=()=>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:op,children:[d.jsx(Kt,{variant:"text",width:28}),d.jsx(Kt,{variant:"text",width:44}),d.jsx("span",{className:"max-lg:hidden",children:d.jsx(Kt,{variant:"text",width:56})}),d.jsx(Kt,{variant:"text",width:64}),d.jsx(Kt,{variant:"text",width:48})]})})})]}),jH.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(Kt,{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:op,children:[d.jsx(Kt,{variant:"rect",width:44,height:18}),d.jsx(Kt,{variant:"text",width:e.title}),d.jsx("span",{className:"max-lg:hidden",children:d.jsx(Kt,{variant:"text",width:52})}),d.jsx(Kt,{variant:"rect",width:80,height:8}),d.jsx(Kt,{variant:"rect",width:64,height:20})]})})})]},e.key))]}),EH=()=>{const e=D(u=>u.reconcileQueue),t=D(u=>u.removeFromReconcileQueue),n=D(u=>u.plans),{patch:r}=Qi(),{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($9,{plan:a,before:o.before,onApprove:l,onDiscard:c,queuePosition:{index:i.current+1,total:i.current+e.length}})},TH=({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(dg,{}),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}`))})]}),xg=()=>{const e=D(_=>_.plans),t=D(_=>_.plansError),n=D(_=>_.ideaEntries),r=D(_=>_.suggestions);D(_=>_.loadPlans);const s=D(_=>_.setDetailView),i=D(_=>_.planFilters),o=D(_=>_.setSubjectFilter),a=fg(),l=DW(),{planId:c,ideaId:u}=Os({strict:!1}),f=D(_=>_.dismissSuggestion),p=Vt(),{toast:h}=He(),{subject:m}=am({strict:!1});b.useEffect(()=>{o(m??null)},[m,o]),b.useEffect(()=>{s("details")},[a,l,s]);const y=()=>{p({to:"/"})},v=_=>{var E;const S=(E=e==null?void 0:e.entries.find(T=>T.title===_))==null?void 0:E.id;p({to:"/plans/$planId",params:{planId:ba(S,_)}})},g=_=>{var E;const S=(E=n.find(T=>T.title===_))==null?void 0:E.id;p({to:"/ideas/$ideaId",params:{ideaId:ba(S,_)}})},[x,w]=b.useState(null),k=async _=>{try{await f(_)}catch(S){h({title:"Failed to dismiss suggestion",description:S.message,variant:"error"})}};if(t)return d.jsxs("div",{children:[d.jsx(e9,{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(K0,{}),d.jsx("output",{"aria-live":"polite",className:"sr-only",children:"Loading plans…"}),d.jsx(PH,{})]});const{rows:j}=xL(e.entries,n,i);return d.jsxs(d.Fragment,{children:[d.jsx(EH,{}),a?d.jsx("div",{children:d.jsx(fH,{plan:a})}):l?d.jsxs("div",{children:[d.jsx("div",{className:"mb-4",children:d.jsx(WS,{items:[{id:"plans",label:"Plans",onClick:y},{id:"idea",label:l.title}]})}),d.jsx(bH,{idea:l})]}):d.jsxs("div",{children:[d.jsx(K0,{}),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(_=>d.jsxs("li",{children:[_.title,": ",_.message]},_.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(wH,{plans:e.entries,rows:j,activePlanTitle:null,onOpenPlan:v,onOpenIdea:g}),d.jsx(B9,{onOpenIdea:g}),d.jsx(TH,{suggestions:r,onOpen:w,onDismiss:k}),d.jsx(z9,{suggestion:x,onClose:()=>w(null)})]})]})};function NH(e){return e.filter(t=>t.kind!=="question")}function RH(e,t){return t?e.filter(n=>!t.has(n.id)):[]}function AH(){const e=D(r=>r.notifications),t=D(r=>r.loadNotifications),n=b.useRef(null);b.useEffect(()=>{typeof Notification<"u"&&Notification.permission==="default"&&Notification.requestPermission()},[]),b.useEffect(()=>{if(!e)return;const r=NH(e),s=RH(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=Ta(i=>{i.message==="changed"&&(r&&clearTimeout(r),r=setTimeout(t,250))});return()=>{r&&clearTimeout(r),s()}},[t])}const IH="data-paper-camp-mount";function MH(e){return(e==null?void 0:e.getAttribute(IH))??""}const mC=typeof document>"u"?"":MH(document.getElementById("root")),gC=b.lazy(()=>wn(()=>import("./index-NfzGv6aM.js"),__vite__mapDeps([0,1]),import.meta.url).then(e=>({default:e.DocsPage}))),LH=b.lazy(()=>wn(()=>import("./index-NfzGv6aM.js"),__vite__mapDeps([0,1]),import.meta.url).then(e=>({default:e.DocsSidebar}))),yC=b.lazy(()=>wn(()=>import("./index-DNRXB82k.js"),__vite__mapDeps([2,3,1]),import.meta.url).then(e=>({default:e.SettingsPage}))),DH=b.lazy(()=>wn(()=>import("./index-DNRXB82k.js"),__vite__mapDeps([2,3,1]),import.meta.url).then(e=>({default:e.SettingsSidebar}))),FH=b.lazy(()=>wn(()=>import("./index-Dz77-ZQi.js"),__vite__mapDeps([4,3]),import.meta.url).then(e=>({default:e.TasksPage}))),OH=b.lazy(()=>wn(()=>import("./index-0_VbynEu.js"),[],import.meta.url).then(e=>({default:e.RoadmapPage}))),zH=b.lazy(()=>wn(()=>import("./index-0_VbynEu.js"),[],import.meta.url).then(e=>({default:e.RoadmapSidebar}))),$H=b.lazy(()=>wn(()=>import("./index-Bm61MVP8.js"),__vite__mapDeps([5,3]),import.meta.url).then(e=>({default:e.StatsPage}))),BH=b.lazy(()=>wn(()=>import("./index-CHYyIAaz.js"),[],import.meta.url).then(e=>({default:e.GitPage}))),VH=b.lazy(()=>wn(()=>import("./index-CHYyIAaz.js"),[],import.meta.url).then(e=>({default:e.GitFileList}))),UH=b.lazy(()=>wn(()=>import("./index-pnCSf_Qk.js"),[],import.meta.url).then(e=>({default:e.InboxPage}))),vf=[{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"}],q0=({item:e})=>d.jsx("span",{className:"inline-flex items-center gap-1.5",children:e.label}),Q0=()=>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"})}),xC="stack-open";function WH(){try{return localStorage.getItem(xC)==="true"}catch{return!1}}function HH(e){try{localStorage.setItem(xC,String(e))}catch{}}const GH="(min-width: 1440px)";function KH(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 qH=()=>{var E;const e=Vt(),t=XT({select:T=>T.location.pathname}),n=D(T=>T.loadPlans),r=D(T=>T.loadIdeas),s=D(T=>T.loadSuggestions),i=D(T=>T.loadCapabilities),o=D(T=>T.loadAgentAuthStatus),a=D(T=>T.loadParkedQuestions),l=D(T=>T.loadNotifications),c=D(T=>T.setActiveDocTitle),u=t==="/"||t.startsWith("/plans/")||t.startsWith("/ideas/"),f=t==="/docs"||t.startsWith("/docs/"),p=t==="/settings"||t.startsWith("/settings/"),h=t==="/roadmap",m=t==="/git",y=u?"plans":f?"docs":p?"settings":(E=vf.find(T=>T.path===t))==null?void 0:E.id,v=u||f||p||h||m,g=u?"plans":f?"docs":p?"settings":h?"roadmap":"git",[x,w]=b.useState(WH),[k,j]=b.useState(!1),_=KH(GH),S=b.useRef(!1);return AH(),b.useEffect(()=>{n(),r(),s(),i(),o(),a(),l()},[n,r,s,i,o,a,l]),b.useEffect(()=>{S.current||t!=="/"||(S.current=!0,Promise.all([Sm(),_k()]).then(([T,P])=>{if(!(T!=null&&T.setupDismissed)&&P!==null&&!P.every(A=>A.status==="ok")){e({to:"/settings/$section",params:{section:"setup"}});return}Promise.all([Pk(),Nk()]).then(([A,I])=>{A.entries.length>1||I.entries.length>0||(c("USAGE.md"),e({to:"/docs"}))})}))},[t,e,c]),b.useEffect(()=>{j(!1)},[t]),d.jsxs(kU,{position:"bottom-left",children:[d.jsxs("div",{className:"h-screen box-border min-[1440px]:pr-[480px] flex flex-col",children:[d.jsx($W,{}),d.jsx(ZW,{}),d.jsx(iB,{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:[v&&d.jsx(ot,{variant:"ghost",size:"small",className:"lg:hidden max-[480px]:hidden",label:"Open sidebar",onClick:()=>j(!0),icon:d.jsx(Q0,{})}),d.jsx(zW,{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:vf.map(T=>d.jsx(se,{variant:"ghost",size:"small",isActive:T.id===y,onClick:()=>e({to:T.path}),"aria-current":T.id===y?"page":void 0,children:d.jsx(q0,{item:T})},T.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:[v&&d.jsxs(BW,{routeKey:g,mobileOpen:k,onMobileClose:()=>j(!1),children:[u&&d.jsxs(d.Fragment,{children:[d.jsx(CH,{}),d.jsx(kH,{})]}),f&&d.jsx(b.Suspense,{fallback:null,children:d.jsx(LH,{})}),p&&d.jsx(b.Suspense,{fallback:null,children:d.jsx(DH,{})}),h&&d.jsx(b.Suspense,{fallback:null,children:d.jsx(zH,{})}),m&&d.jsx(b.Suspense,{fallback:null,children:d.jsx(VH,{})})]}),d.jsx("div",{className:`flex flex-col min-w-0 ${_?"flex-[1_1_0%]":"flex-[0_1_800px]"}`,children:d.jsx("div",{className:"flex flex-col flex-1 min-w-0",children:d.jsx(DS,{texture:{texture:"parchment"},outline:!0,className:`min-h-[calc(100vh-160px)] w-full ${_?"max-w-none":""}`,children:d.jsx(b.Suspense,{fallback:null,children:d.jsx(Db,{})})})})})]})})})})]}),d.jsx(RW,{open:x,pinned:_,onToggle:()=>{const T=!x;HH(T),w(T)}}),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:[v&&d.jsx(ot,{variant:"ghost",size:"small",label:"Open sidebar",onClick:()=>j(!0),icon:d.jsx(Q0,{}),className:"min-h-11"}),vf.map(T=>d.jsx(se,{variant:"ghost",size:"small",isActive:T.id===y,onClick:()=>e({to:T.path}),"aria-current":T.id===y?"page":void 0,className:"min-h-11",children:d.jsx(q0,{item:T})},T.id))]})]})},Ut=DT({component:qH}),QH=on({getParentRoute:()=>Ut,path:"/",component:xg,validateSearch:e=>({subject:typeof e.subject=="string"?e.subject:void 0})}),YH=on({getParentRoute:()=>Ut,path:"/plans/$planId",component:xg}),XH=on({getParentRoute:()=>Ut,path:"/ideas/$ideaId",component:xg}),JH=on({getParentRoute:()=>Ut,path:"/docs",component:gC}),ZH=on({getParentRoute:()=>Ut,path:"/docs/$section",component:gC}),e7=on({getParentRoute:()=>Ut,path:"/settings",component:yC}),t7=on({getParentRoute:()=>Ut,path:"/settings/$section",component:yC}),n7=on({getParentRoute:()=>Ut,path:"/roadmap",component:OH,validateSearch:e=>({item:typeof e.item=="string"?e.item:void 0})}),r7=on({getParentRoute:()=>Ut,path:"/inbox",component:UH}),s7=on({getParentRoute:()=>Ut,path:"/stats",component:$H}),i7=on({getParentRoute:()=>Ut,path:"/git",component:BH}),o7=on({getParentRoute:()=>Ut,path:"/tasks",component:FH,validateSearch:e=>({taskId:typeof e.taskId=="string"?e.taskId:void 0})}),a7=Ut.addChildren([QH,YH,XH,JH,ZH,e7,t7,o7,n7,s7,r7,i7]),l7=KT({routeTree:a7,basepath:mC||"/"});UI(mC);const vC=document.getElementById("root");if(!vC)throw new Error("#root element not found");lb(vC).render(d.jsx(b.StrictMode,{children:d.jsx(YT,{router:l7})}));export{Te as $,x7 as A,h7 as B,He as C,v7 as D,WS as E,Da as F,T7 as G,We as H,w7 as I,se as J,ba as K,m7 as L,vk as M,L9 as N,mg as O,e9 as P,p7 as Q,de as R,sr as S,b7 as T,k7 as U,hH as V,j6 as W,aL as X,To as Y,cC as Z,pf as _,Vt as a,VW as a0,P9 as a1,Ta as a2,E9 as a3,T9 as a4,b9 as a5,QS as a6,mW as a7,gW as a8,ts as a9,d9 as aa,A9 as ab,Fu as ac,Gr as ad,E7 as b,G as c,V9 as d,VS as e,g7 as f,Pe as g,c7 as h,La as i,d as j,Sm as k,u7 as l,tC as m,P7 as n,IW as o,Qn as p,f7 as q,b as r,d7 as s,j7 as t,D as u,$S as v,cg as w,y7 as x,cL as y,am as z};
217
- //# sourceMappingURL=main-AfQrNPNu.js.map