@dendelion/paper-camp 0.12.0 → 0.13.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.
- package/dist/app/assets/index-BHrFKlRC.js +2 -0
- package/dist/app/assets/index-BHrFKlRC.js.map +1 -0
- package/dist/app/assets/index-BYaEopge.js +2 -0
- package/dist/app/assets/index-BYaEopge.js.map +1 -0
- package/dist/app/assets/index-CVlBKMF5.js +2 -0
- package/dist/app/assets/index-CVlBKMF5.js.map +1 -0
- package/dist/app/assets/index-DmvGoONp.js +6 -0
- package/dist/app/assets/index-DmvGoONp.js.map +1 -0
- package/dist/app/assets/index-DuSUXl7P.js +3 -0
- package/dist/app/assets/index-DuSUXl7P.js.map +1 -0
- package/dist/app/assets/index-Q6C6X2L9.js +4 -0
- package/dist/app/assets/index-Q6C6X2L9.js.map +1 -0
- package/dist/app/assets/main-CTwMgTvE.js +207 -0
- package/dist/app/assets/main-CTwMgTvE.js.map +1 -0
- package/dist/app/assets/main-CU7SFl1f.css +1 -0
- package/dist/app/assets/sidebar-section-C1uCSbsw.js +2 -0
- package/dist/app/assets/sidebar-section-C1uCSbsw.js.map +1 -0
- package/dist/app/assets/tokens-C9JyAXxm.js +2 -0
- package/dist/app/assets/tokens-C9JyAXxm.js.map +1 -0
- package/dist/app/index.html +2 -2
- package/dist/chunks/{scaffold.B_3sY6Rg.js → scaffold.CuJP4koY.js} +1832 -1914
- package/dist/chunks/scaffold.CuJP4koY.js.map +1 -0
- package/dist/cli/index.js +8235 -7150
- package/dist/cli/index.js.map +1 -1
- package/dist/core/git-pr/pr-lookup.d.ts.map +1 -1
- package/dist/core/git-pr/pr.d.ts.map +1 -1
- package/dist/core/index.js +74 -82
- package/dist/core/parse/parser.d.ts +2 -4
- package/dist/core/parse/parser.d.ts.map +1 -1
- package/dist/core/parse/schemas.d.ts +0 -20
- package/dist/core/parse/schemas.d.ts.map +1 -1
- package/dist/core/readers.d.ts.map +1 -1
- package/dist/core/roadmap.d.ts.map +1 -1
- package/dist/core/scaffold/templates.d.ts +1 -1
- package/dist/core/scaffold/templates.d.ts.map +1 -1
- package/dist/core/sections.d.ts +5 -1
- package/dist/core/sections.d.ts.map +1 -1
- package/dist/core/serialize/serializer.d.ts +4 -26
- package/dist/core/serialize/serializer.d.ts.map +1 -1
- package/dist/core/stats.d.ts +10 -0
- package/dist/core/stats.d.ts.map +1 -0
- package/dist/core/stats.test.d.ts +2 -0
- package/dist/core/stats.test.d.ts.map +1 -0
- package/dist/core/status/status.d.ts +1 -0
- package/dist/core/status/status.d.ts.map +1 -1
- package/dist/core/thread.d.ts +15 -0
- package/dist/core/thread.d.ts.map +1 -0
- package/dist/types/index.d.ts +92 -45
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/package.json +9 -4
- package/dist/app/assets/index-B6eOrr41.js +0 -4
- package/dist/app/assets/index-B6eOrr41.js.map +0 -1
- package/dist/app/assets/index-BajRXbXg.js +0 -2
- package/dist/app/assets/index-BajRXbXg.js.map +0 -1
- package/dist/app/assets/index-DAexv1XS.js +0 -3
- package/dist/app/assets/index-DAexv1XS.js.map +0 -1
- package/dist/app/assets/index-DFJlDY3W.js +0 -2
- package/dist/app/assets/index-DFJlDY3W.js.map +0 -1
- package/dist/app/assets/main-Bno8vU-0.js +0 -288
- package/dist/app/assets/main-Bno8vU-0.js.map +0 -1
- package/dist/app/assets/main-RP3LpwgH.css +0 -1
- package/dist/app/assets/sidebar-section-BrJbBK_b.js +0 -2
- package/dist/app/assets/sidebar-section-BrJbBK_b.js.map +0 -1
- package/dist/chunks/scaffold.B_3sY6Rg.js.map +0 -1
|
@@ -1,288 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DFJlDY3W.js","assets/sidebar-section-BrJbBK_b.js","assets/index-BajRXbXg.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var uc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function au(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Y0={exports:{}},lu={},Q0={exports:{}},oe={};/**
|
|
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 Pa=Symbol.for("react.element"),lC=Symbol.for("react.portal"),cC=Symbol.for("react.fragment"),uC=Symbol.for("react.strict_mode"),dC=Symbol.for("react.profiler"),hC=Symbol.for("react.provider"),fC=Symbol.for("react.context"),pC=Symbol.for("react.forward_ref"),mC=Symbol.for("react.suspense"),gC=Symbol.for("react.memo"),yC=Symbol.for("react.lazy"),yg=Symbol.iterator;function xC(e){return e===null||typeof e!="object"?null:(e=yg&&e[yg]||e["@@iterator"],typeof e=="function"?e:null)}var q0={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},X0=Object.assign,J0={};function Us(e,t,n){this.props=e,this.context=t,this.refs=J0,this.updater=n||q0}Us.prototype.isReactComponent={};Us.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")};Us.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Z0(){}Z0.prototype=Us.prototype;function op(e,t,n){this.props=e,this.context=t,this.refs=J0,this.updater=n||q0}var ap=op.prototype=new Z0;ap.constructor=op;X0(ap,Us.prototype);ap.isPureReactComponent=!0;var xg=Array.isArray,ew=Object.prototype.hasOwnProperty,lp={current:null},tw={key:!0,ref:!0,__self:!0,__source:!0};function nw(e,t,n){var r,i={},s=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(s=""+t.key),t)ew.call(t,r)&&!tw.hasOwnProperty(r)&&(i[r]=t[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1<a){for(var l=Array(a),u=0;u<a;u++)l[u]=arguments[u+2];i.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)i[r]===void 0&&(i[r]=a[r]);return{$$typeof:Pa,type:e,key:s,ref:o,props:i,_owner:lp.current}}function vC(e,t){return{$$typeof:Pa,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function cp(e){return typeof e=="object"&&e!==null&&e.$$typeof===Pa}function wC(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var vg=/\/+/g;function Yu(e,t){return typeof e=="object"&&e!==null&&e.key!=null?wC(""+e.key):t.toString(36)}function Ll(e,t,n,r,i){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(s){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Pa:case lC:o=!0}}if(o)return o=e,i=i(o),e=r===""?"."+Yu(o,0):r,xg(i)?(n="",e!=null&&(n=e.replace(vg,"$&/")+"/"),Ll(i,t,n,"",function(u){return u})):i!=null&&(cp(i)&&(i=vC(i,n+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(vg,"$&/")+"/")+e)),t.push(i)),1;if(o=0,r=r===""?".":r+":",xg(e))for(var a=0;a<e.length;a++){s=e[a];var l=r+Yu(s,a);o+=Ll(s,t,n,l,i)}else if(l=xC(e),typeof l=="function")for(e=l.call(e),a=0;!(s=e.next()).done;)s=s.value,l=r+Yu(s,a++),o+=Ll(s,t,n,l,i);else if(s==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function Ha(e,t,n){if(e==null)return e;var r=[],i=0;return Ll(e,r,"","",function(s){return t.call(n,s,i++)}),r}function bC(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 xt={current:null},Dl={transition:null},kC={ReactCurrentDispatcher:xt,ReactCurrentBatchConfig:Dl,ReactCurrentOwner:lp};function rw(){throw Error("act(...) is not supported in production builds of React.")}oe.Children={map:Ha,forEach:function(e,t,n){Ha(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Ha(e,function(){t++}),t},toArray:function(e){return Ha(e,function(t){return t})||[]},only:function(e){if(!cp(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};oe.Component=Us;oe.Fragment=cC;oe.Profiler=dC;oe.PureComponent=op;oe.StrictMode=uC;oe.Suspense=mC;oe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=kC;oe.act=rw;oe.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=X0({},e.props),i=e.key,s=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,o=lp.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)ew.call(t,l)&&!tw.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 u=0;u<l;u++)a[u]=arguments[u+2];r.children=a}return{$$typeof:Pa,type:e.type,key:i,ref:s,props:r,_owner:o}};oe.createContext=function(e){return e={$$typeof:fC,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:hC,_context:e},e.Consumer=e};oe.createElement=nw;oe.createFactory=function(e){var t=nw.bind(null,e);return t.type=e,t};oe.createRef=function(){return{current:null}};oe.forwardRef=function(e){return{$$typeof:pC,render:e}};oe.isValidElement=cp;oe.lazy=function(e){return{$$typeof:yC,_payload:{_status:-1,_result:e},_init:bC}};oe.memo=function(e,t){return{$$typeof:gC,type:e,compare:t===void 0?null:t}};oe.startTransition=function(e){var t=Dl.transition;Dl.transition={};try{e()}finally{Dl.transition=t}};oe.unstable_act=rw;oe.useCallback=function(e,t){return xt.current.useCallback(e,t)};oe.useContext=function(e){return xt.current.useContext(e)};oe.useDebugValue=function(){};oe.useDeferredValue=function(e){return xt.current.useDeferredValue(e)};oe.useEffect=function(e,t){return xt.current.useEffect(e,t)};oe.useId=function(){return xt.current.useId()};oe.useImperativeHandle=function(e,t,n){return xt.current.useImperativeHandle(e,t,n)};oe.useInsertionEffect=function(e,t){return xt.current.useInsertionEffect(e,t)};oe.useLayoutEffect=function(e,t){return xt.current.useLayoutEffect(e,t)};oe.useMemo=function(e,t){return xt.current.useMemo(e,t)};oe.useReducer=function(e,t,n){return xt.current.useReducer(e,t,n)};oe.useRef=function(e){return xt.current.useRef(e)};oe.useState=function(e){return xt.current.useState(e)};oe.useSyncExternalStore=function(e,t,n){return xt.current.useSyncExternalStore(e,t,n)};oe.useTransition=function(){return xt.current.useTransition()};oe.version="18.3.1";Q0.exports=oe;var S=Q0.exports;const Ts=au(S);/**
|
|
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 SC=S,_C=Symbol.for("react.element"),CC=Symbol.for("react.fragment"),jC=Object.prototype.hasOwnProperty,PC=SC.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,EC={key:!0,ref:!0,__self:!0,__source:!0};function iw(e,t,n){var r,i={},s=null,o=null;n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)jC.call(t,r)&&!EC.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:_C,type:e,key:s,ref:o,props:i,_owner:PC.current}}lu.Fragment=CC;lu.jsx=iw;lu.jsxs=iw;Y0.exports=lu;var d=Y0.exports,sw={exports:{}},Kt={},ow={exports:{}},aw={};/**
|
|
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(z,V){var _=z.length;z.push(V);e:for(;0<_;){var B=_-1>>>1,X=z[B];if(0<i(X,V))z[B]=V,z[_]=X,_=B;else break e}}function n(z){return z.length===0?null:z[0]}function r(z){if(z.length===0)return null;var V=z[0],_=z.pop();if(_!==V){z[0]=_;e:for(var B=0,X=z.length,I=X>>>1;B<I;){var ue=2*(B+1)-1,fe=z[ue],de=ue+1,ot=z[de];if(0>i(fe,_))de<X&&0>i(ot,fe)?(z[B]=ot,z[de]=_,B=de):(z[B]=fe,z[ue]=_,B=ue);else if(de<X&&0>i(ot,_))z[B]=ot,z[de]=_,B=de;else break e}}return V}function i(z,V){var _=z.sortIndex-V.sortIndex;return _!==0?_:z.id-V.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var l=[],u=[],c=1,h=null,f=3,p=!1,m=!1,x=!1,w=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function v(z){for(var V=n(u);V!==null;){if(V.callback===null)r(u);else if(V.startTime<=z)r(u),V.sortIndex=V.expirationTime,t(l,V);else break;V=n(u)}}function k(z){if(x=!1,v(z),!m)if(n(l)!==null)m=!0,$(P);else{var V=n(u);V!==null&&U(k,V.startTime-z)}}function P(z,V){m=!1,x&&(x=!1,g(j),j=-1),p=!0;var _=f;try{for(v(V),h=n(l);h!==null&&(!(h.expirationTime>V)||z&&!A());){var B=h.callback;if(typeof B=="function"){h.callback=null,f=h.priorityLevel;var X=B(h.expirationTime<=V);V=e.unstable_now(),typeof X=="function"?h.callback=X:h===n(l)&&r(l),v(V)}else r(l);h=n(l)}if(h!==null)var I=!0;else{var ue=n(u);ue!==null&&U(k,ue.startTime-V),I=!1}return I}finally{h=null,f=_,p=!1}}var b=!1,C=null,j=-1,T=5,E=-1;function A(){return!(e.unstable_now()-E<T)}function M(){if(C!==null){var z=e.unstable_now();E=z;var V=!0;try{V=C(!0,z)}finally{V?F():(b=!1,C=null)}}else b=!1}var F;if(typeof y=="function")F=function(){y(M)};else if(typeof MessageChannel<"u"){var D=new MessageChannel,L=D.port2;D.port1.onmessage=M,F=function(){L.postMessage(null)}}else F=function(){w(M,0)};function $(z){C=z,b||(b=!0,F())}function U(z,V){j=w(function(){z(e.unstable_now())},V)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(z){z.callback=null},e.unstable_continueExecution=function(){m||p||(m=!0,$(P))},e.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<z?Math.floor(1e3/z):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(z){switch(f){case 1:case 2:case 3:var V=3;break;default:V=f}var _=f;f=V;try{return z()}finally{f=_}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(z,V){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var _=f;f=z;try{return V()}finally{f=_}},e.unstable_scheduleCallback=function(z,V,_){var B=e.unstable_now();switch(typeof _=="object"&&_!==null?(_=_.delay,_=typeof _=="number"&&0<_?B+_:B):_=B,z){case 1:var X=-1;break;case 2:X=250;break;case 5:X=1073741823;break;case 4:X=1e4;break;default:X=5e3}return X=_+X,z={id:c++,callback:V,priorityLevel:z,startTime:_,expirationTime:X,sortIndex:-1},_>B?(z.sortIndex=_,t(u,z),n(l)===null&&z===n(u)&&(x?(g(j),j=-1):x=!0,U(k,_-B))):(z.sortIndex=X,t(l,z),m||p||(m=!0,$(P))),z},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(z){var V=f;return function(){var _=f;f=V;try{return z.apply(this,arguments)}finally{f=_}}}})(aw);ow.exports=aw;var TC=ow.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 RC=S,Ht=TC;function W(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 lw=new Set,ea={};function Oi(e,t){Rs(e,t),Rs(e+"Capture",t)}function Rs(e,t){for(ea[e]=t,e=0;e<t.length;e++)lw.add(t[e])}var or=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),vh=Object.prototype.hasOwnProperty,IC=/^[: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]*$/,wg={},bg={};function AC(e){return vh.call(bg,e)?!0:vh.call(wg,e)?!1:IC.test(e)?bg[e]=!0:(wg[e]=!0,!1)}function MC(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 LC(e,t,n,r){if(t===null||typeof t>"u"||MC(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 vt(e,t,n,r,i,s,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var it={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){it[e]=new vt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];it[t]=new vt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){it[e]=new vt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){it[e]=new vt(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){it[e]=new vt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){it[e]=new vt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){it[e]=new vt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){it[e]=new vt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){it[e]=new vt(e,5,!1,e.toLowerCase(),null,!1,!1)});var up=/[\-:]([a-z])/g;function dp(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(up,dp);it[t]=new vt(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(up,dp);it[t]=new vt(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(up,dp);it[t]=new vt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){it[e]=new vt(e,1,!1,e.toLowerCase(),null,!1,!1)});it.xlinkHref=new vt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){it[e]=new vt(e,1,!1,e.toLowerCase(),null,!0,!0)});function hp(e,t,n,r){var i=it.hasOwnProperty(t)?it[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(LC(t,n,i,r)&&(n=null),r||i===null?AC(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var ur=RC.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Ga=Symbol.for("react.element"),is=Symbol.for("react.portal"),ss=Symbol.for("react.fragment"),fp=Symbol.for("react.strict_mode"),wh=Symbol.for("react.profiler"),cw=Symbol.for("react.provider"),uw=Symbol.for("react.context"),pp=Symbol.for("react.forward_ref"),bh=Symbol.for("react.suspense"),kh=Symbol.for("react.suspense_list"),mp=Symbol.for("react.memo"),_r=Symbol.for("react.lazy"),dw=Symbol.for("react.offscreen"),kg=Symbol.iterator;function lo(e){return e===null||typeof e!="object"?null:(e=kg&&e[kg]||e["@@iterator"],typeof e=="function"?e:null)}var ze=Object.assign,Qu;function Ro(e){if(Qu===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Qu=t&&t[1]||""}return`
|
|
35
|
-
`+Qu+e}var qu=!1;function Xu(e,t){if(!e||qu)return"";qu=!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(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var i=u.stack.split(`
|
|
36
|
-
`),s=r.stack.split(`
|
|
37
|
-
`),o=i.length-1,a=s.length-1;1<=o&&0<=a&&i[o]!==s[a];)a--;for(;1<=o&&0<=a;o--,a--)if(i[o]!==s[a]){if(o!==1||a!==1)do if(o--,a--,0>a||i[o]!==s[a]){var l=`
|
|
38
|
-
`+i[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{qu=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ro(e):""}function DC(e){switch(e.tag){case 5:return Ro(e.type);case 16:return Ro("Lazy");case 13:return Ro("Suspense");case 19:return Ro("SuspenseList");case 0:case 2:case 15:return e=Xu(e.type,!1),e;case 11:return e=Xu(e.type.render,!1),e;case 1:return e=Xu(e.type,!0),e;default:return""}}function Sh(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 ss:return"Fragment";case is:return"Portal";case wh:return"Profiler";case fp:return"StrictMode";case bh:return"Suspense";case kh:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case uw:return(e.displayName||"Context")+".Consumer";case cw:return(e._context.displayName||"Context")+".Provider";case pp:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case mp:return t=e.displayName||null,t!==null?t:Sh(e.type)||"Memo";case _r:t=e._payload,e=e._init;try{return Sh(e(t))}catch{}}return null}function NC(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 Sh(t);case 8:return t===fp?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Kr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function hw(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function zC(e){var t=hw(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.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 Ka(e){e._valueTracker||(e._valueTracker=zC(e))}function fw(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=hw(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function dc(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 _h(e,t){var n=t.checked;return ze({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Sg(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Kr(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function pw(e,t){t=t.checked,t!=null&&hp(e,"checked",t,!1)}function Ch(e,t){pw(e,t);var n=Kr(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?jh(e,t.type,n):t.hasOwnProperty("defaultValue")&&jh(e,t.type,Kr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function _g(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 jh(e,t,n){(t!=="number"||dc(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Io=Array.isArray;function ws(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Kr(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Ph(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(W(91));return ze({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Cg(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(W(92));if(Io(n)){if(1<n.length)throw Error(W(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Kr(n)}}function mw(e,t){var n=Kr(t.value),r=Kr(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function jg(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function gw(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 Eh(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?gw(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Ya,yw=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Ya=Ya||document.createElement("div"),Ya.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Ya.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ta(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var zo={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},OC=["Webkit","ms","Moz","O"];Object.keys(zo).forEach(function(e){OC.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),zo[t]=zo[e]})});function xw(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||zo.hasOwnProperty(e)&&zo[e]?(""+t).trim():t+"px"}function vw(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=xw(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var FC=ze({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Th(e,t){if(t){if(FC[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(W(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(W(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(W(61))}if(t.style!=null&&typeof t.style!="object")throw Error(W(62))}}function Rh(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 Ih=null;function gp(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ah=null,bs=null,ks=null;function Pg(e){if(e=Ra(e)){if(typeof Ah!="function")throw Error(W(280));var t=e.stateNode;t&&(t=fu(t),Ah(e.stateNode,e.type,t))}}function ww(e){bs?ks?ks.push(e):ks=[e]:bs=e}function bw(){if(bs){var e=bs,t=ks;if(ks=bs=null,Pg(e),t)for(e=0;e<t.length;e++)Pg(t[e])}}function kw(e,t){return e(t)}function Sw(){}var Ju=!1;function _w(e,t,n){if(Ju)return e(t,n);Ju=!0;try{return kw(e,t,n)}finally{Ju=!1,(bs!==null||ks!==null)&&(Sw(),bw())}}function na(e,t){var n=e.stateNode;if(n===null)return null;var r=fu(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(W(231,t,typeof n));return n}var Mh=!1;if(or)try{var co={};Object.defineProperty(co,"passive",{get:function(){Mh=!0}}),window.addEventListener("test",co,co),window.removeEventListener("test",co,co)}catch{Mh=!1}function $C(e,t,n,r,i,s,o,a,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(c){this.onError(c)}}var Oo=!1,hc=null,fc=!1,Lh=null,BC={onError:function(e){Oo=!0,hc=e}};function VC(e,t,n,r,i,s,o,a,l){Oo=!1,hc=null,$C.apply(BC,arguments)}function WC(e,t,n,r,i,s,o,a,l){if(VC.apply(this,arguments),Oo){if(Oo){var u=hc;Oo=!1,hc=null}else throw Error(W(198));fc||(fc=!0,Lh=u)}}function Fi(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 Cw(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 Eg(e){if(Fi(e)!==e)throw Error(W(188))}function UC(e){var t=e.alternate;if(!t){if(t=Fi(e),t===null)throw Error(W(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return Eg(i),e;if(s===r)return Eg(i),t;s=s.sibling}throw Error(W(188))}if(n.return!==r.return)n=i,r=s;else{for(var o=!1,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){for(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)throw Error(W(189))}}if(n.alternate!==r)throw Error(W(190))}if(n.tag!==3)throw Error(W(188));return n.stateNode.current===n?e:t}function jw(e){return e=UC(e),e!==null?Pw(e):null}function Pw(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Pw(e);if(t!==null)return t;e=e.sibling}return null}var Ew=Ht.unstable_scheduleCallback,Tg=Ht.unstable_cancelCallback,HC=Ht.unstable_shouldYield,GC=Ht.unstable_requestPaint,Ue=Ht.unstable_now,KC=Ht.unstable_getCurrentPriorityLevel,yp=Ht.unstable_ImmediatePriority,Tw=Ht.unstable_UserBlockingPriority,pc=Ht.unstable_NormalPriority,YC=Ht.unstable_LowPriority,Rw=Ht.unstable_IdlePriority,cu=null,Bn=null;function QC(e){if(Bn&&typeof Bn.onCommitFiberRoot=="function")try{Bn.onCommitFiberRoot(cu,e,void 0,(e.current.flags&128)===128)}catch{}}var wn=Math.clz32?Math.clz32:JC,qC=Math.log,XC=Math.LN2;function JC(e){return e>>>=0,e===0?32:31-(qC(e)/XC|0)|0}var Qa=64,qa=4194304;function Ao(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 mc(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,s=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~i;a!==0?r=Ao(a):(s&=o,s!==0&&(r=Ao(s)))}else o=n&~i,o!==0?r=Ao(o):s!==0&&(r=Ao(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,s=t&-t,i>=s||i===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-wn(t),i=1<<n,r|=e[n],t&=~i;return r}function ZC(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 ej(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes;0<s;){var o=31-wn(s),a=1<<o,l=i[o];l===-1?(!(a&n)||a&r)&&(i[o]=ZC(a,t)):l<=t&&(e.expiredLanes|=a),s&=~a}}function Dh(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Iw(){var e=Qa;return Qa<<=1,!(Qa&4194240)&&(Qa=64),e}function Zu(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ea(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-wn(t),e[t]=n}function tj(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-wn(n),s=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~s}}function xp(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-wn(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var ge=0;function Aw(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Mw,vp,Lw,Dw,Nw,Nh=!1,Xa=[],zr=null,Or=null,Fr=null,ra=new Map,ia=new Map,Pr=[],nj="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 Rg(e,t){switch(e){case"focusin":case"focusout":zr=null;break;case"dragenter":case"dragleave":Or=null;break;case"mouseover":case"mouseout":Fr=null;break;case"pointerover":case"pointerout":ra.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ia.delete(t.pointerId)}}function uo(e,t,n,r,i,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},t!==null&&(t=Ra(t),t!==null&&vp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function rj(e,t,n,r,i){switch(t){case"focusin":return zr=uo(zr,e,t,n,r,i),!0;case"dragenter":return Or=uo(Or,e,t,n,r,i),!0;case"mouseover":return Fr=uo(Fr,e,t,n,r,i),!0;case"pointerover":var s=i.pointerId;return ra.set(s,uo(ra.get(s)||null,e,t,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,ia.set(s,uo(ia.get(s)||null,e,t,n,r,i)),!0}return!1}function zw(e){var t=gi(e.target);if(t!==null){var n=Fi(t);if(n!==null){if(t=n.tag,t===13){if(t=Cw(n),t!==null){e.blockedOn=t,Nw(e.priority,function(){Lw(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 Nl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=zh(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Ih=r,n.target.dispatchEvent(r),Ih=null}else return t=Ra(n),t!==null&&vp(t),e.blockedOn=n,!1;t.shift()}return!0}function Ig(e,t,n){Nl(e)&&n.delete(t)}function ij(){Nh=!1,zr!==null&&Nl(zr)&&(zr=null),Or!==null&&Nl(Or)&&(Or=null),Fr!==null&&Nl(Fr)&&(Fr=null),ra.forEach(Ig),ia.forEach(Ig)}function ho(e,t){e.blockedOn===t&&(e.blockedOn=null,Nh||(Nh=!0,Ht.unstable_scheduleCallback(Ht.unstable_NormalPriority,ij)))}function sa(e){function t(i){return ho(i,e)}if(0<Xa.length){ho(Xa[0],e);for(var n=1;n<Xa.length;n++){var r=Xa[n];r.blockedOn===e&&(r.blockedOn=null)}}for(zr!==null&&ho(zr,e),Or!==null&&ho(Or,e),Fr!==null&&ho(Fr,e),ra.forEach(t),ia.forEach(t),n=0;n<Pr.length;n++)r=Pr[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Pr.length&&(n=Pr[0],n.blockedOn===null);)zw(n),n.blockedOn===null&&Pr.shift()}var Ss=ur.ReactCurrentBatchConfig,gc=!0;function sj(e,t,n,r){var i=ge,s=Ss.transition;Ss.transition=null;try{ge=1,wp(e,t,n,r)}finally{ge=i,Ss.transition=s}}function oj(e,t,n,r){var i=ge,s=Ss.transition;Ss.transition=null;try{ge=4,wp(e,t,n,r)}finally{ge=i,Ss.transition=s}}function wp(e,t,n,r){if(gc){var i=zh(e,t,n,r);if(i===null)cd(e,t,r,yc,n),Rg(e,r);else if(rj(i,e,t,n,r))r.stopPropagation();else if(Rg(e,r),t&4&&-1<nj.indexOf(e)){for(;i!==null;){var s=Ra(i);if(s!==null&&Mw(s),s=zh(e,t,n,r),s===null&&cd(e,t,r,yc,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else cd(e,t,r,null,n)}}var yc=null;function zh(e,t,n,r){if(yc=null,e=gp(r),e=gi(e),e!==null)if(t=Fi(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Cw(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 yc=e,null}function Ow(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(KC()){case yp:return 1;case Tw:return 4;case pc:case YC:return 16;case Rw:return 536870912;default:return 16}default:return 16}}var Rr=null,bp=null,zl=null;function Fw(){if(zl)return zl;var e,t=bp,n=t.length,r,i="value"in Rr?Rr.value:Rr.textContent,s=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[s-r];r++);return zl=i.slice(e,1<r?1-r:void 0)}function Ol(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 Ja(){return!0}function Ag(){return!1}function Yt(e){function t(n,r,i,s,o){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(s):s[a]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Ja:Ag,this.isPropagationStopped=Ag,this}return ze(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Ja)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ja)},persist:function(){},isPersistent:Ja}),t}var Hs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},kp=Yt(Hs),Ta=ze({},Hs,{view:0,detail:0}),aj=Yt(Ta),ed,td,fo,uu=ze({},Ta,{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!==fo&&(fo&&e.type==="mousemove"?(ed=e.screenX-fo.screenX,td=e.screenY-fo.screenY):td=ed=0,fo=e),ed)},movementY:function(e){return"movementY"in e?e.movementY:td}}),Mg=Yt(uu),lj=ze({},uu,{dataTransfer:0}),cj=Yt(lj),uj=ze({},Ta,{relatedTarget:0}),nd=Yt(uj),dj=ze({},Hs,{animationName:0,elapsedTime:0,pseudoElement:0}),hj=Yt(dj),fj=ze({},Hs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),pj=Yt(fj),mj=ze({},Hs,{data:0}),Lg=Yt(mj),gj={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},yj={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"},xj={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function vj(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=xj[e])?!!t[e]:!1}function Sp(){return vj}var wj=ze({},Ta,{key:function(e){if(e.key){var t=gj[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ol(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?yj[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"?Ol(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ol(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),bj=Yt(wj),kj=ze({},uu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Dg=Yt(kj),Sj=ze({},Ta,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Sp}),_j=Yt(Sj),Cj=ze({},Hs,{propertyName:0,elapsedTime:0,pseudoElement:0}),jj=Yt(Cj),Pj=ze({},uu,{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}),Ej=Yt(Pj),Tj=[9,13,27,32],_p=or&&"CompositionEvent"in window,Fo=null;or&&"documentMode"in document&&(Fo=document.documentMode);var Rj=or&&"TextEvent"in window&&!Fo,$w=or&&(!_p||Fo&&8<Fo&&11>=Fo),Ng=" ",zg=!1;function Bw(e,t){switch(e){case"keyup":return Tj.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Vw(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var os=!1;function Ij(e,t){switch(e){case"compositionend":return Vw(t);case"keypress":return t.which!==32?null:(zg=!0,Ng);case"textInput":return e=t.data,e===Ng&&zg?null:e;default:return null}}function Aj(e,t){if(os)return e==="compositionend"||!_p&&Bw(e,t)?(e=Fw(),zl=bp=Rr=null,os=!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 $w&&t.locale!=="ko"?null:t.data;default:return null}}var Mj={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 Og(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Mj[e.type]:t==="textarea"}function Ww(e,t,n,r){ww(r),t=xc(t,"onChange"),0<t.length&&(n=new kp("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var $o=null,oa=null;function Lj(e){e1(e,0)}function du(e){var t=cs(e);if(fw(t))return e}function Dj(e,t){if(e==="change")return t}var Uw=!1;if(or){var rd;if(or){var id="oninput"in document;if(!id){var Fg=document.createElement("div");Fg.setAttribute("oninput","return;"),id=typeof Fg.oninput=="function"}rd=id}else rd=!1;Uw=rd&&(!document.documentMode||9<document.documentMode)}function $g(){$o&&($o.detachEvent("onpropertychange",Hw),oa=$o=null)}function Hw(e){if(e.propertyName==="value"&&du(oa)){var t=[];Ww(t,oa,e,gp(e)),_w(Lj,t)}}function Nj(e,t,n){e==="focusin"?($g(),$o=t,oa=n,$o.attachEvent("onpropertychange",Hw)):e==="focusout"&&$g()}function zj(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return du(oa)}function Oj(e,t){if(e==="click")return du(t)}function Fj(e,t){if(e==="input"||e==="change")return du(t)}function $j(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Sn=typeof Object.is=="function"?Object.is:$j;function aa(e,t){if(Sn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!vh.call(t,i)||!Sn(e[i],t[i]))return!1}return!0}function Bg(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Vg(e,t){var n=Bg(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=Bg(n)}}function Gw(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Gw(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Kw(){for(var e=window,t=dc();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=dc(e.document)}return t}function Cp(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 Bj(e){var t=Kw(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Gw(n.ownerDocument.documentElement,n)){if(r!==null&&Cp(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!e.extend&&s>r&&(i=r,r=s,s=i),i=Vg(n,s);var o=Vg(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>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 Vj=or&&"documentMode"in document&&11>=document.documentMode,as=null,Oh=null,Bo=null,Fh=!1;function Wg(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Fh||as==null||as!==dc(r)||(r=as,"selectionStart"in r&&Cp(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}),Bo&&aa(Bo,r)||(Bo=r,r=xc(Oh,"onSelect"),0<r.length&&(t=new kp("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=as)))}function Za(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ls={animationend:Za("Animation","AnimationEnd"),animationiteration:Za("Animation","AnimationIteration"),animationstart:Za("Animation","AnimationStart"),transitionend:Za("Transition","TransitionEnd")},sd={},Yw={};or&&(Yw=document.createElement("div").style,"AnimationEvent"in window||(delete ls.animationend.animation,delete ls.animationiteration.animation,delete ls.animationstart.animation),"TransitionEvent"in window||delete ls.transitionend.transition);function hu(e){if(sd[e])return sd[e];if(!ls[e])return e;var t=ls[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Yw)return sd[e]=t[n];return e}var Qw=hu("animationend"),qw=hu("animationiteration"),Xw=hu("animationstart"),Jw=hu("transitionend"),Zw=new Map,Ug="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Jr(e,t){Zw.set(e,t),Oi(t,[e])}for(var od=0;od<Ug.length;od++){var ad=Ug[od],Wj=ad.toLowerCase(),Uj=ad[0].toUpperCase()+ad.slice(1);Jr(Wj,"on"+Uj)}Jr(Qw,"onAnimationEnd");Jr(qw,"onAnimationIteration");Jr(Xw,"onAnimationStart");Jr("dblclick","onDoubleClick");Jr("focusin","onFocus");Jr("focusout","onBlur");Jr(Jw,"onTransitionEnd");Rs("onMouseEnter",["mouseout","mouseover"]);Rs("onMouseLeave",["mouseout","mouseover"]);Rs("onPointerEnter",["pointerout","pointerover"]);Rs("onPointerLeave",["pointerout","pointerover"]);Oi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Oi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Oi("onBeforeInput",["compositionend","keypress","textInput","paste"]);Oi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Oi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Oi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Mo="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(" "),Hj=new Set("cancel close invalid load scroll toggle".split(" ").concat(Mo));function Hg(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,WC(r,t,void 0,e),e.currentTarget=null}function e1(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var s=void 0;if(t)for(var o=r.length-1;0<=o;o--){var a=r[o],l=a.instance,u=a.currentTarget;if(a=a.listener,l!==s&&i.isPropagationStopped())break e;Hg(i,a,u),s=l}else for(o=0;o<r.length;o++){if(a=r[o],l=a.instance,u=a.currentTarget,a=a.listener,l!==s&&i.isPropagationStopped())break e;Hg(i,a,u),s=l}}}if(fc)throw e=Lh,fc=!1,Lh=null,e}function Te(e,t){var n=t[Uh];n===void 0&&(n=t[Uh]=new Set);var r=e+"__bubble";n.has(r)||(t1(t,e,2,!1),n.add(r))}function ld(e,t,n){var r=0;t&&(r|=4),t1(n,e,r,t)}var el="_reactListening"+Math.random().toString(36).slice(2);function la(e){if(!e[el]){e[el]=!0,lw.forEach(function(n){n!=="selectionchange"&&(Hj.has(n)||ld(n,!1,e),ld(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[el]||(t[el]=!0,ld("selectionchange",!1,t))}}function t1(e,t,n,r){switch(Ow(t)){case 1:var i=sj;break;case 4:i=oj;break;default:i=wp}n=i.bind(null,t,n,e),i=void 0,!Mh||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function cd(e,t,n,r,i){var s=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===i||a.nodeType===8&&a.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;o=o.return}for(;a!==null;){if(o=gi(a),o===null)return;if(l=o.tag,l===5||l===6){r=s=o;continue e}a=a.parentNode}}r=r.return}_w(function(){var u=s,c=gp(n),h=[];e:{var f=Zw.get(e);if(f!==void 0){var p=kp,m=e;switch(e){case"keypress":if(Ol(n)===0)break e;case"keydown":case"keyup":p=bj;break;case"focusin":m="focus",p=nd;break;case"focusout":m="blur",p=nd;break;case"beforeblur":case"afterblur":p=nd;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=Mg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=cj;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=_j;break;case Qw:case qw:case Xw:p=hj;break;case Jw:p=jj;break;case"scroll":p=aj;break;case"wheel":p=Ej;break;case"copy":case"cut":case"paste":p=pj;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=Dg}var x=(t&4)!==0,w=!x&&e==="scroll",g=x?f!==null?f+"Capture":null:f;x=[];for(var y=u,v;y!==null;){v=y;var k=v.stateNode;if(v.tag===5&&k!==null&&(v=k,g!==null&&(k=na(y,g),k!=null&&x.push(ca(y,k,v)))),w)break;y=y.return}0<x.length&&(f=new p(f,m,null,n,c),h.push({event:f,listeners:x}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",f&&n!==Ih&&(m=n.relatedTarget||n.fromElement)&&(gi(m)||m[ar]))break e;if((p||f)&&(f=c.window===c?c:(f=c.ownerDocument)?f.defaultView||f.parentWindow:window,p?(m=n.relatedTarget||n.toElement,p=u,m=m?gi(m):null,m!==null&&(w=Fi(m),m!==w||m.tag!==5&&m.tag!==6)&&(m=null)):(p=null,m=u),p!==m)){if(x=Mg,k="onMouseLeave",g="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(x=Dg,k="onPointerLeave",g="onPointerEnter",y="pointer"),w=p==null?f:cs(p),v=m==null?f:cs(m),f=new x(k,y+"leave",p,n,c),f.target=w,f.relatedTarget=v,k=null,gi(c)===u&&(x=new x(g,y+"enter",m,n,c),x.target=v,x.relatedTarget=w,k=x),w=k,p&&m)t:{for(x=p,g=m,y=0,v=x;v;v=Ki(v))y++;for(v=0,k=g;k;k=Ki(k))v++;for(;0<y-v;)x=Ki(x),y--;for(;0<v-y;)g=Ki(g),v--;for(;y--;){if(x===g||g!==null&&x===g.alternate)break t;x=Ki(x),g=Ki(g)}x=null}else x=null;p!==null&&Gg(h,f,p,x,!1),m!==null&&w!==null&&Gg(h,w,m,x,!0)}}e:{if(f=u?cs(u):window,p=f.nodeName&&f.nodeName.toLowerCase(),p==="select"||p==="input"&&f.type==="file")var P=Dj;else if(Og(f))if(Uw)P=Fj;else{P=zj;var b=Nj}else(p=f.nodeName)&&p.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(P=Oj);if(P&&(P=P(e,u))){Ww(h,P,n,c);break e}b&&b(e,f,u),e==="focusout"&&(b=f._wrapperState)&&b.controlled&&f.type==="number"&&jh(f,"number",f.value)}switch(b=u?cs(u):window,e){case"focusin":(Og(b)||b.contentEditable==="true")&&(as=b,Oh=u,Bo=null);break;case"focusout":Bo=Oh=as=null;break;case"mousedown":Fh=!0;break;case"contextmenu":case"mouseup":case"dragend":Fh=!1,Wg(h,n,c);break;case"selectionchange":if(Vj)break;case"keydown":case"keyup":Wg(h,n,c)}var C;if(_p)e:{switch(e){case"compositionstart":var j="onCompositionStart";break e;case"compositionend":j="onCompositionEnd";break e;case"compositionupdate":j="onCompositionUpdate";break e}j=void 0}else os?Bw(e,n)&&(j="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(j="onCompositionStart");j&&($w&&n.locale!=="ko"&&(os||j!=="onCompositionStart"?j==="onCompositionEnd"&&os&&(C=Fw()):(Rr=c,bp="value"in Rr?Rr.value:Rr.textContent,os=!0)),b=xc(u,j),0<b.length&&(j=new Lg(j,e,null,n,c),h.push({event:j,listeners:b}),C?j.data=C:(C=Vw(n),C!==null&&(j.data=C)))),(C=Rj?Ij(e,n):Aj(e,n))&&(u=xc(u,"onBeforeInput"),0<u.length&&(c=new Lg("onBeforeInput","beforeinput",null,n,c),h.push({event:c,listeners:u}),c.data=C))}e1(h,t)})}function ca(e,t,n){return{instance:e,listener:t,currentTarget:n}}function xc(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=na(e,n),s!=null&&r.unshift(ca(e,s,i)),s=na(e,t),s!=null&&r.push(ca(e,s,i))),e=e.return}return r}function Ki(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Gg(e,t,n,r,i){for(var s=t._reactName,o=[];n!==null&&n!==r;){var a=n,l=a.alternate,u=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&u!==null&&(a=u,i?(l=na(n,s),l!=null&&o.unshift(ca(n,l,a))):i||(l=na(n,s),l!=null&&o.push(ca(n,l,a)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Gj=/\r\n?/g,Kj=/\u0000|\uFFFD/g;function Kg(e){return(typeof e=="string"?e:""+e).replace(Gj,`
|
|
39
|
-
`).replace(Kj,"")}function tl(e,t,n){if(t=Kg(t),Kg(e)!==t&&n)throw Error(W(425))}function vc(){}var $h=null,Bh=null;function Vh(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 Wh=typeof setTimeout=="function"?setTimeout:void 0,Yj=typeof clearTimeout=="function"?clearTimeout:void 0,Yg=typeof Promise=="function"?Promise:void 0,Qj=typeof queueMicrotask=="function"?queueMicrotask:typeof Yg<"u"?function(e){return Yg.resolve(null).then(e).catch(qj)}:Wh;function qj(e){setTimeout(function(){throw e})}function ud(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),sa(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);sa(t)}function $r(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 Qg(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 Gs=Math.random().toString(36).slice(2),On="__reactFiber$"+Gs,ua="__reactProps$"+Gs,ar="__reactContainer$"+Gs,Uh="__reactEvents$"+Gs,Xj="__reactListeners$"+Gs,Jj="__reactHandles$"+Gs;function gi(e){var t=e[On];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ar]||n[On]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Qg(e);e!==null;){if(n=e[On])return n;e=Qg(e)}return t}e=n,n=e.parentNode}return null}function Ra(e){return e=e[On]||e[ar],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function cs(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(W(33))}function fu(e){return e[ua]||null}var Hh=[],us=-1;function Zr(e){return{current:e}}function Re(e){0>us||(e.current=Hh[us],Hh[us]=null,us--)}function _e(e,t){us++,Hh[us]=e.current,e.current=t}var Yr={},ht=Zr(Yr),jt=Zr(!1),Ai=Yr;function Is(e,t){var n=e.type.contextTypes;if(!n)return Yr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Pt(e){return e=e.childContextTypes,e!=null}function wc(){Re(jt),Re(ht)}function qg(e,t,n){if(ht.current!==Yr)throw Error(W(168));_e(ht,t),_e(jt,n)}function n1(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(W(108,NC(e)||"Unknown",i));return ze({},n,r)}function bc(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Yr,Ai=ht.current,_e(ht,e),_e(jt,jt.current),!0}function Xg(e,t,n){var r=e.stateNode;if(!r)throw Error(W(169));n?(e=n1(e,t,Ai),r.__reactInternalMemoizedMergedChildContext=e,Re(jt),Re(ht),_e(ht,e)):Re(jt),_e(jt,n)}var er=null,pu=!1,dd=!1;function r1(e){er===null?er=[e]:er.push(e)}function Zj(e){pu=!0,r1(e)}function ei(){if(!dd&&er!==null){dd=!0;var e=0,t=ge;try{var n=er;for(ge=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}er=null,pu=!1}catch(i){throw er!==null&&(er=er.slice(e+1)),Ew(yp,ei),i}finally{ge=t,dd=!1}}return null}var ds=[],hs=0,kc=null,Sc=0,en=[],tn=0,Mi=null,tr=1,nr="";function ui(e,t){ds[hs++]=Sc,ds[hs++]=kc,kc=e,Sc=t}function i1(e,t,n){en[tn++]=tr,en[tn++]=nr,en[tn++]=Mi,Mi=e;var r=tr;e=nr;var i=32-wn(r)-1;r&=~(1<<i),n+=1;var s=32-wn(t)+i;if(30<s){var o=i-i%5;s=(r&(1<<o)-1).toString(32),r>>=o,i-=o,tr=1<<32-wn(t)+i|n<<i|r,nr=s+e}else tr=1<<s|n<<i|r,nr=e}function jp(e){e.return!==null&&(ui(e,1),i1(e,1,0))}function Pp(e){for(;e===kc;)kc=ds[--hs],ds[hs]=null,Sc=ds[--hs],ds[hs]=null;for(;e===Mi;)Mi=en[--tn],en[tn]=null,nr=en[--tn],en[tn]=null,tr=en[--tn],en[tn]=null}var Wt=null,$t=null,Ae=!1,vn=null;function s1(e,t){var n=rn(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 Jg(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,Wt=e,$t=$r(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Wt=e,$t=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Mi!==null?{id:tr,overflow:nr}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=rn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Wt=e,$t=null,!0):!1;default:return!1}}function Gh(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Kh(e){if(Ae){var t=$t;if(t){var n=t;if(!Jg(e,t)){if(Gh(e))throw Error(W(418));t=$r(n.nextSibling);var r=Wt;t&&Jg(e,t)?s1(r,n):(e.flags=e.flags&-4097|2,Ae=!1,Wt=e)}}else{if(Gh(e))throw Error(W(418));e.flags=e.flags&-4097|2,Ae=!1,Wt=e}}}function Zg(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Wt=e}function nl(e){if(e!==Wt)return!1;if(!Ae)return Zg(e),Ae=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Vh(e.type,e.memoizedProps)),t&&(t=$t)){if(Gh(e))throw o1(),Error(W(418));for(;t;)s1(e,t),t=$r(t.nextSibling)}if(Zg(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(W(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){$t=$r(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}$t=null}}else $t=Wt?$r(e.stateNode.nextSibling):null;return!0}function o1(){for(var e=$t;e;)e=$r(e.nextSibling)}function As(){$t=Wt=null,Ae=!1}function Ep(e){vn===null?vn=[e]:vn.push(e)}var eP=ur.ReactCurrentBatchConfig;function po(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(W(309));var r=n.stateNode}if(!r)throw Error(W(147,e));var i=r,s=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===s?t.ref:(t=function(o){var a=i.refs;o===null?delete a[s]:a[s]=o},t._stringRef=s,t)}if(typeof e!="string")throw Error(W(284));if(!n._owner)throw Error(W(290,e))}return e}function rl(e,t){throw e=Object.prototype.toString.call(t),Error(W(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function ey(e){var t=e._init;return t(e._payload)}function a1(e){function t(g,y){if(e){var v=g.deletions;v===null?(g.deletions=[y],g.flags|=16):v.push(y)}}function n(g,y){if(!e)return null;for(;y!==null;)t(g,y),y=y.sibling;return null}function r(g,y){for(g=new Map;y!==null;)y.key!==null?g.set(y.key,y):g.set(y.index,y),y=y.sibling;return g}function i(g,y){return g=Ur(g,y),g.index=0,g.sibling=null,g}function s(g,y,v){return g.index=v,e?(v=g.alternate,v!==null?(v=v.index,v<y?(g.flags|=2,y):v):(g.flags|=2,y)):(g.flags|=1048576,y)}function o(g){return e&&g.alternate===null&&(g.flags|=2),g}function a(g,y,v,k){return y===null||y.tag!==6?(y=xd(v,g.mode,k),y.return=g,y):(y=i(y,v),y.return=g,y)}function l(g,y,v,k){var P=v.type;return P===ss?c(g,y,v.props.children,k,v.key):y!==null&&(y.elementType===P||typeof P=="object"&&P!==null&&P.$$typeof===_r&&ey(P)===y.type)?(k=i(y,v.props),k.ref=po(g,y,v),k.return=g,k):(k=Hl(v.type,v.key,v.props,null,g.mode,k),k.ref=po(g,y,v),k.return=g,k)}function u(g,y,v,k){return y===null||y.tag!==4||y.stateNode.containerInfo!==v.containerInfo||y.stateNode.implementation!==v.implementation?(y=vd(v,g.mode,k),y.return=g,y):(y=i(y,v.children||[]),y.return=g,y)}function c(g,y,v,k,P){return y===null||y.tag!==7?(y=Ci(v,g.mode,k,P),y.return=g,y):(y=i(y,v),y.return=g,y)}function h(g,y,v){if(typeof y=="string"&&y!==""||typeof y=="number")return y=xd(""+y,g.mode,v),y.return=g,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Ga:return v=Hl(y.type,y.key,y.props,null,g.mode,v),v.ref=po(g,null,y),v.return=g,v;case is:return y=vd(y,g.mode,v),y.return=g,y;case _r:var k=y._init;return h(g,k(y._payload),v)}if(Io(y)||lo(y))return y=Ci(y,g.mode,v,null),y.return=g,y;rl(g,y)}return null}function f(g,y,v,k){var P=y!==null?y.key:null;if(typeof v=="string"&&v!==""||typeof v=="number")return P!==null?null:a(g,y,""+v,k);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Ga:return v.key===P?l(g,y,v,k):null;case is:return v.key===P?u(g,y,v,k):null;case _r:return P=v._init,f(g,y,P(v._payload),k)}if(Io(v)||lo(v))return P!==null?null:c(g,y,v,k,null);rl(g,v)}return null}function p(g,y,v,k,P){if(typeof k=="string"&&k!==""||typeof k=="number")return g=g.get(v)||null,a(y,g,""+k,P);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case Ga:return g=g.get(k.key===null?v:k.key)||null,l(y,g,k,P);case is:return g=g.get(k.key===null?v:k.key)||null,u(y,g,k,P);case _r:var b=k._init;return p(g,y,v,b(k._payload),P)}if(Io(k)||lo(k))return g=g.get(v)||null,c(y,g,k,P,null);rl(y,k)}return null}function m(g,y,v,k){for(var P=null,b=null,C=y,j=y=0,T=null;C!==null&&j<v.length;j++){C.index>j?(T=C,C=null):T=C.sibling;var E=f(g,C,v[j],k);if(E===null){C===null&&(C=T);break}e&&C&&E.alternate===null&&t(g,C),y=s(E,y,j),b===null?P=E:b.sibling=E,b=E,C=T}if(j===v.length)return n(g,C),Ae&&ui(g,j),P;if(C===null){for(;j<v.length;j++)C=h(g,v[j],k),C!==null&&(y=s(C,y,j),b===null?P=C:b.sibling=C,b=C);return Ae&&ui(g,j),P}for(C=r(g,C);j<v.length;j++)T=p(C,g,j,v[j],k),T!==null&&(e&&T.alternate!==null&&C.delete(T.key===null?j:T.key),y=s(T,y,j),b===null?P=T:b.sibling=T,b=T);return e&&C.forEach(function(A){return t(g,A)}),Ae&&ui(g,j),P}function x(g,y,v,k){var P=lo(v);if(typeof P!="function")throw Error(W(150));if(v=P.call(v),v==null)throw Error(W(151));for(var b=P=null,C=y,j=y=0,T=null,E=v.next();C!==null&&!E.done;j++,E=v.next()){C.index>j?(T=C,C=null):T=C.sibling;var A=f(g,C,E.value,k);if(A===null){C===null&&(C=T);break}e&&C&&A.alternate===null&&t(g,C),y=s(A,y,j),b===null?P=A:b.sibling=A,b=A,C=T}if(E.done)return n(g,C),Ae&&ui(g,j),P;if(C===null){for(;!E.done;j++,E=v.next())E=h(g,E.value,k),E!==null&&(y=s(E,y,j),b===null?P=E:b.sibling=E,b=E);return Ae&&ui(g,j),P}for(C=r(g,C);!E.done;j++,E=v.next())E=p(C,g,j,E.value,k),E!==null&&(e&&E.alternate!==null&&C.delete(E.key===null?j:E.key),y=s(E,y,j),b===null?P=E:b.sibling=E,b=E);return e&&C.forEach(function(M){return t(g,M)}),Ae&&ui(g,j),P}function w(g,y,v,k){if(typeof v=="object"&&v!==null&&v.type===ss&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case Ga:e:{for(var P=v.key,b=y;b!==null;){if(b.key===P){if(P=v.type,P===ss){if(b.tag===7){n(g,b.sibling),y=i(b,v.props.children),y.return=g,g=y;break e}}else if(b.elementType===P||typeof P=="object"&&P!==null&&P.$$typeof===_r&&ey(P)===b.type){n(g,b.sibling),y=i(b,v.props),y.ref=po(g,b,v),y.return=g,g=y;break e}n(g,b);break}else t(g,b);b=b.sibling}v.type===ss?(y=Ci(v.props.children,g.mode,k,v.key),y.return=g,g=y):(k=Hl(v.type,v.key,v.props,null,g.mode,k),k.ref=po(g,y,v),k.return=g,g=k)}return o(g);case is:e:{for(b=v.key;y!==null;){if(y.key===b)if(y.tag===4&&y.stateNode.containerInfo===v.containerInfo&&y.stateNode.implementation===v.implementation){n(g,y.sibling),y=i(y,v.children||[]),y.return=g,g=y;break e}else{n(g,y);break}else t(g,y);y=y.sibling}y=vd(v,g.mode,k),y.return=g,g=y}return o(g);case _r:return b=v._init,w(g,y,b(v._payload),k)}if(Io(v))return m(g,y,v,k);if(lo(v))return x(g,y,v,k);rl(g,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,y!==null&&y.tag===6?(n(g,y.sibling),y=i(y,v),y.return=g,g=y):(n(g,y),y=xd(v,g.mode,k),y.return=g,g=y),o(g)):n(g,y)}return w}var Ms=a1(!0),l1=a1(!1),_c=Zr(null),Cc=null,fs=null,Tp=null;function Rp(){Tp=fs=Cc=null}function Ip(e){var t=_c.current;Re(_c),e._currentValue=t}function Yh(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 _s(e,t){Cc=e,Tp=fs=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(_t=!0),e.firstContext=null)}function ln(e){var t=e._currentValue;if(Tp!==e)if(e={context:e,memoizedValue:t,next:null},fs===null){if(Cc===null)throw Error(W(308));fs=e,Cc.dependencies={lanes:0,firstContext:e}}else fs=fs.next=e;return t}var yi=null;function Ap(e){yi===null?yi=[e]:yi.push(e)}function c1(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Ap(t)):(n.next=i.next,i.next=n),t.interleaved=n,lr(e,r)}function lr(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 Cr=!1;function Mp(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function u1(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 rr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Br(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ce&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,lr(e,n)}return i=r.interleaved,i===null?(t.next=t,Ap(r)):(t.next=i.next,i.next=t),r.interleaved=t,lr(e,n)}function Fl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,xp(e,n)}}function ty(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?i=s=t:s=s.next=t}else i=s=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function jc(e,t,n,r){var i=e.updateQueue;Cr=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,u=l.next;l.next=null,o===null?s=u:o.next=u,o=l;var c=e.alternate;c!==null&&(c=c.updateQueue,a=c.lastBaseUpdate,a!==o&&(a===null?c.firstBaseUpdate=u:a.next=u,c.lastBaseUpdate=l))}if(s!==null){var h=i.baseState;o=0,c=u=l=null,a=s;do{var f=a.lane,p=a.eventTime;if((r&f)===f){c!==null&&(c=c.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var m=e,x=a;switch(f=t,p=n,x.tag){case 1:if(m=x.payload,typeof m=="function"){h=m.call(p,h,f);break e}h=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=x.payload,f=typeof m=="function"?m.call(p,h,f):m,f==null)break e;h=ze({},h,f);break e;case 2:Cr=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[a]:f.push(a))}else p={eventTime:p,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},c===null?(u=c=p,l=h):c=c.next=p,o|=f;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;f=a,a=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(c===null&&(l=h),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);Di|=o,e.lanes=o,e.memoizedState=h}}function ny(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(W(191,i));i.call(r)}}}var Ia={},Vn=Zr(Ia),da=Zr(Ia),ha=Zr(Ia);function xi(e){if(e===Ia)throw Error(W(174));return e}function Lp(e,t){switch(_e(ha,t),_e(da,e),_e(Vn,Ia),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Eh(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Eh(t,e)}Re(Vn),_e(Vn,t)}function Ls(){Re(Vn),Re(da),Re(ha)}function d1(e){xi(ha.current);var t=xi(Vn.current),n=Eh(t,e.type);t!==n&&(_e(da,e),_e(Vn,n))}function Dp(e){da.current===e&&(Re(Vn),Re(da))}var De=Zr(0);function Pc(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var hd=[];function Np(){for(var e=0;e<hd.length;e++)hd[e]._workInProgressVersionPrimary=null;hd.length=0}var $l=ur.ReactCurrentDispatcher,fd=ur.ReactCurrentBatchConfig,Li=0,Ne=null,Qe=null,Je=null,Ec=!1,Vo=!1,fa=0,tP=0;function at(){throw Error(W(321))}function zp(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Sn(e[n],t[n]))return!1;return!0}function Op(e,t,n,r,i,s){if(Li=s,Ne=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,$l.current=e===null||e.memoizedState===null?sP:oP,e=n(r,i),Vo){s=0;do{if(Vo=!1,fa=0,25<=s)throw Error(W(301));s+=1,Je=Qe=null,t.updateQueue=null,$l.current=aP,e=n(r,i)}while(Vo)}if($l.current=Tc,t=Qe!==null&&Qe.next!==null,Li=0,Je=Qe=Ne=null,Ec=!1,t)throw Error(W(300));return e}function Fp(){var e=fa!==0;return fa=0,e}function An(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Je===null?Ne.memoizedState=Je=e:Je=Je.next=e,Je}function cn(){if(Qe===null){var e=Ne.alternate;e=e!==null?e.memoizedState:null}else e=Qe.next;var t=Je===null?Ne.memoizedState:Je.next;if(t!==null)Je=t,Qe=e;else{if(e===null)throw Error(W(310));Qe=e,e={memoizedState:Qe.memoizedState,baseState:Qe.baseState,baseQueue:Qe.baseQueue,queue:Qe.queue,next:null},Je===null?Ne.memoizedState=Je=e:Je=Je.next=e}return Je}function pa(e,t){return typeof t=="function"?t(e):t}function pd(e){var t=cn(),n=t.queue;if(n===null)throw Error(W(311));n.lastRenderedReducer=e;var r=Qe,i=r.baseQueue,s=n.pending;if(s!==null){if(i!==null){var o=i.next;i.next=s.next,s.next=o}r.baseQueue=i=s,n.pending=null}if(i!==null){s=i.next,r=r.baseState;var a=o=null,l=null,u=s;do{var c=u.lane;if((Li&c)===c)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var h={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(a=l=h,o=r):l=l.next=h,Ne.lanes|=c,Di|=c}u=u.next}while(u!==null&&u!==s);l===null?o=r:l.next=a,Sn(r,t.memoizedState)||(_t=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do s=i.lane,Ne.lanes|=s,Di|=s,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function md(e){var t=cn(),n=t.queue;if(n===null)throw Error(W(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,s=t.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do s=e(s,o.action),o=o.next;while(o!==i);Sn(s,t.memoizedState)||(_t=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function h1(){}function f1(e,t){var n=Ne,r=cn(),i=t(),s=!Sn(r.memoizedState,i);if(s&&(r.memoizedState=i,_t=!0),r=r.queue,$p(g1.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||Je!==null&&Je.memoizedState.tag&1){if(n.flags|=2048,ma(9,m1.bind(null,n,r,i,t),void 0,null),Ze===null)throw Error(W(349));Li&30||p1(n,t,i)}return i}function p1(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ne.updateQueue,t===null?(t={lastEffect:null,stores:null},Ne.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function m1(e,t,n,r){t.value=n,t.getSnapshot=r,y1(t)&&x1(e)}function g1(e,t,n){return n(function(){y1(t)&&x1(e)})}function y1(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Sn(e,n)}catch{return!0}}function x1(e){var t=lr(e,1);t!==null&&bn(t,e,1,-1)}function ry(e){var t=An();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:pa,lastRenderedState:e},t.queue=e,e=e.dispatch=iP.bind(null,Ne,e),[t.memoizedState,e]}function ma(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 v1(){return cn().memoizedState}function Bl(e,t,n,r){var i=An();Ne.flags|=e,i.memoizedState=ma(1|t,n,void 0,r===void 0?null:r)}function mu(e,t,n,r){var i=cn();r=r===void 0?null:r;var s=void 0;if(Qe!==null){var o=Qe.memoizedState;if(s=o.destroy,r!==null&&zp(r,o.deps)){i.memoizedState=ma(t,n,s,r);return}}Ne.flags|=e,i.memoizedState=ma(1|t,n,s,r)}function iy(e,t){return Bl(8390656,8,e,t)}function $p(e,t){return mu(2048,8,e,t)}function w1(e,t){return mu(4,2,e,t)}function b1(e,t){return mu(4,4,e,t)}function k1(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 S1(e,t,n){return n=n!=null?n.concat([e]):null,mu(4,4,k1.bind(null,t,e),n)}function Bp(){}function _1(e,t){var n=cn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&zp(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function C1(e,t){var n=cn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&zp(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function j1(e,t,n){return Li&21?(Sn(n,t)||(n=Iw(),Ne.lanes|=n,Di|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,_t=!0),e.memoizedState=n)}function nP(e,t){var n=ge;ge=n!==0&&4>n?n:4,e(!0);var r=fd.transition;fd.transition={};try{e(!1),t()}finally{ge=n,fd.transition=r}}function P1(){return cn().memoizedState}function rP(e,t,n){var r=Wr(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},E1(e))T1(t,n);else if(n=c1(e,t,n,r),n!==null){var i=yt();bn(n,e,r,i),R1(n,t,r)}}function iP(e,t,n){var r=Wr(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(E1(e))T1(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,a=s(o,n);if(i.hasEagerState=!0,i.eagerState=a,Sn(a,o)){var l=t.interleaved;l===null?(i.next=i,Ap(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=c1(e,t,i,r),n!==null&&(i=yt(),bn(n,e,r,i),R1(n,t,r))}}function E1(e){var t=e.alternate;return e===Ne||t!==null&&t===Ne}function T1(e,t){Vo=Ec=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function R1(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,xp(e,n)}}var Tc={readContext:ln,useCallback:at,useContext:at,useEffect:at,useImperativeHandle:at,useInsertionEffect:at,useLayoutEffect:at,useMemo:at,useReducer:at,useRef:at,useState:at,useDebugValue:at,useDeferredValue:at,useTransition:at,useMutableSource:at,useSyncExternalStore:at,useId:at,unstable_isNewReconciler:!1},sP={readContext:ln,useCallback:function(e,t){return An().memoizedState=[e,t===void 0?null:t],e},useContext:ln,useEffect:iy,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Bl(4194308,4,k1.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Bl(4194308,4,e,t)},useInsertionEffect:function(e,t){return Bl(4,2,e,t)},useMemo:function(e,t){var n=An();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=An();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=rP.bind(null,Ne,e),[r.memoizedState,e]},useRef:function(e){var t=An();return e={current:e},t.memoizedState=e},useState:ry,useDebugValue:Bp,useDeferredValue:function(e){return An().memoizedState=e},useTransition:function(){var e=ry(!1),t=e[0];return e=nP.bind(null,e[1]),An().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ne,i=An();if(Ae){if(n===void 0)throw Error(W(407));n=n()}else{if(n=t(),Ze===null)throw Error(W(349));Li&30||p1(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,iy(g1.bind(null,r,s,e),[e]),r.flags|=2048,ma(9,m1.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=An(),t=Ze.identifierPrefix;if(Ae){var n=nr,r=tr;n=(r&~(1<<32-wn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=fa++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=tP++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},oP={readContext:ln,useCallback:_1,useContext:ln,useEffect:$p,useImperativeHandle:S1,useInsertionEffect:w1,useLayoutEffect:b1,useMemo:C1,useReducer:pd,useRef:v1,useState:function(){return pd(pa)},useDebugValue:Bp,useDeferredValue:function(e){var t=cn();return j1(t,Qe.memoizedState,e)},useTransition:function(){var e=pd(pa)[0],t=cn().memoizedState;return[e,t]},useMutableSource:h1,useSyncExternalStore:f1,useId:P1,unstable_isNewReconciler:!1},aP={readContext:ln,useCallback:_1,useContext:ln,useEffect:$p,useImperativeHandle:S1,useInsertionEffect:w1,useLayoutEffect:b1,useMemo:C1,useReducer:md,useRef:v1,useState:function(){return md(pa)},useDebugValue:Bp,useDeferredValue:function(e){var t=cn();return Qe===null?t.memoizedState=e:j1(t,Qe.memoizedState,e)},useTransition:function(){var e=md(pa)[0],t=cn().memoizedState;return[e,t]},useMutableSource:h1,useSyncExternalStore:f1,useId:P1,unstable_isNewReconciler:!1};function yn(e,t){if(e&&e.defaultProps){t=ze({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Qh(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:ze({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var gu={isMounted:function(e){return(e=e._reactInternals)?Fi(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=yt(),i=Wr(e),s=rr(r,i);s.payload=t,n!=null&&(s.callback=n),t=Br(e,s,i),t!==null&&(bn(t,e,i,r),Fl(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=yt(),i=Wr(e),s=rr(r,i);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=Br(e,s,i),t!==null&&(bn(t,e,i,r),Fl(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=yt(),r=Wr(e),i=rr(n,r);i.tag=2,t!=null&&(i.callback=t),t=Br(e,i,r),t!==null&&(bn(t,e,r,n),Fl(t,e,r))}};function sy(e,t,n,r,i,s,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,s,o):t.prototype&&t.prototype.isPureReactComponent?!aa(n,r)||!aa(i,s):!0}function I1(e,t,n){var r=!1,i=Yr,s=t.contextType;return typeof s=="object"&&s!==null?s=ln(s):(i=Pt(t)?Ai:ht.current,r=t.contextTypes,s=(r=r!=null)?Is(e,i):Yr),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=gu,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=s),t}function oy(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&&gu.enqueueReplaceState(t,t.state,null)}function qh(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},Mp(e);var s=t.contextType;typeof s=="object"&&s!==null?i.context=ln(s):(s=Pt(t)?Ai:ht.current,i.context=Is(e,s)),i.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(Qh(e,t,s,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&gu.enqueueReplaceState(i,i.state,null),jc(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function Ds(e,t){try{var n="",r=t;do n+=DC(r),r=r.return;while(r);var i=n}catch(s){i=`
|
|
40
|
-
Error generating stack: `+s.message+`
|
|
41
|
-
`+s.stack}return{value:e,source:t,stack:i,digest:null}}function gd(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Xh(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var lP=typeof WeakMap=="function"?WeakMap:Map;function A1(e,t,n){n=rr(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Ic||(Ic=!0,lf=r),Xh(e,t)},n}function M1(e,t,n){n=rr(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){Xh(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){Xh(e,t),typeof r!="function"&&(Vr===null?Vr=new Set([this]):Vr.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function ay(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new lP;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=kP.bind(null,e,t,n),t.then(e,e))}function ly(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 cy(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=rr(-1,1),t.tag=2,Br(n,t,1))),n.lanes|=1),e)}var cP=ur.ReactCurrentOwner,_t=!1;function pt(e,t,n,r){t.child=e===null?l1(t,null,n,r):Ms(t,e.child,n,r)}function uy(e,t,n,r,i){n=n.render;var s=t.ref;return _s(t,i),r=Op(e,t,n,r,s,i),n=Fp(),e!==null&&!_t?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,cr(e,t,i)):(Ae&&n&&jp(t),t.flags|=1,pt(e,t,r,i),t.child)}function dy(e,t,n,r,i){if(e===null){var s=n.type;return typeof s=="function"&&!Qp(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,L1(e,t,s,r,i)):(e=Hl(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&i)){var o=s.memoizedProps;if(n=n.compare,n=n!==null?n:aa,n(o,r)&&e.ref===t.ref)return cr(e,t,i)}return t.flags|=1,e=Ur(s,r),e.ref=t.ref,e.return=t,t.child=e}function L1(e,t,n,r,i){if(e!==null){var s=e.memoizedProps;if(aa(s,r)&&e.ref===t.ref)if(_t=!1,t.pendingProps=r=s,(e.lanes&i)!==0)e.flags&131072&&(_t=!0);else return t.lanes=e.lanes,cr(e,t,i)}return Jh(e,t,n,r,i)}function D1(e,t,n){var r=t.pendingProps,i=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},_e(ms,Ft),Ft|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,_e(ms,Ft),Ft|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,_e(ms,Ft),Ft|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,_e(ms,Ft),Ft|=r;return pt(e,t,i,n),t.child}function N1(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Jh(e,t,n,r,i){var s=Pt(n)?Ai:ht.current;return s=Is(t,s),_s(t,i),n=Op(e,t,n,r,s,i),r=Fp(),e!==null&&!_t?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,cr(e,t,i)):(Ae&&r&&jp(t),t.flags|=1,pt(e,t,n,i),t.child)}function hy(e,t,n,r,i){if(Pt(n)){var s=!0;bc(t)}else s=!1;if(_s(t,i),t.stateNode===null)Vl(e,t),I1(t,n,r),qh(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,a=t.memoizedProps;o.props=a;var l=o.context,u=n.contextType;typeof u=="object"&&u!==null?u=ln(u):(u=Pt(n)?Ai:ht.current,u=Is(t,u));var c=n.getDerivedStateFromProps,h=typeof c=="function"||typeof o.getSnapshotBeforeUpdate=="function";h||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||l!==u)&&oy(t,o,r,u),Cr=!1;var f=t.memoizedState;o.state=f,jc(t,r,o,i),l=t.memoizedState,a!==r||f!==l||jt.current||Cr?(typeof c=="function"&&(Qh(t,n,c,r),l=t.memoizedState),(a=Cr||sy(t,n,a,r,f,l,u))?(h||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=u,r=a):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,u1(e,t),a=t.memoizedProps,u=t.type===t.elementType?a:yn(t.type,a),o.props=u,h=t.pendingProps,f=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=ln(l):(l=Pt(n)?Ai:ht.current,l=Is(t,l));var p=n.getDerivedStateFromProps;(c=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==h||f!==l)&&oy(t,o,r,l),Cr=!1,f=t.memoizedState,o.state=f,jc(t,r,o,i);var m=t.memoizedState;a!==h||f!==m||jt.current||Cr?(typeof p=="function"&&(Qh(t,n,p,r),m=t.memoizedState),(u=Cr||sy(t,n,u,r,f,m,l)||!1)?(c||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&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),o.props=r,o.state=m,o.context=l,r=u):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Zh(e,t,n,r,s,i)}function Zh(e,t,n,r,i,s){N1(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return i&&Xg(t,n,!1),cr(e,t,s);r=t.stateNode,cP.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Ms(t,e.child,null,s),t.child=Ms(t,null,a,s)):pt(e,t,a,s),t.memoizedState=r.state,i&&Xg(t,n,!0),t.child}function z1(e){var t=e.stateNode;t.pendingContext?qg(e,t.pendingContext,t.pendingContext!==t.context):t.context&&qg(e,t.context,!1),Lp(e,t.containerInfo)}function fy(e,t,n,r,i){return As(),Ep(i),t.flags|=256,pt(e,t,n,r),t.child}var ef={dehydrated:null,treeContext:null,retryLane:0};function tf(e){return{baseLanes:e,cachePool:null,transitions:null}}function O1(e,t,n){var r=t.pendingProps,i=De.current,s=!1,o=(t.flags&128)!==0,a;if((a=o)||(a=e!==null&&e.memoizedState===null?!1:(i&2)!==0),a?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),_e(De,i&1),e===null)return Kh(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,s?(r=t.mode,s=t.child,o={mode:"hidden",children:o},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=vu(o,r,0,null),e=Ci(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=tf(n),t.memoizedState=ef,e):Vp(t,o));if(i=e.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return uP(e,t,o,r,a,i,n);if(s){s=r.fallback,o=t.mode,i=e.child,a=i.sibling;var l={mode:"hidden",children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=Ur(i,l),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=Ur(a,s):(s=Ci(s,o,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,o=e.child.memoizedState,o=o===null?tf(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=e.childLanes&~n,t.memoizedState=ef,r}return s=e.child,e=s.sibling,r=Ur(s,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Vp(e,t){return t=vu({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function il(e,t,n,r){return r!==null&&Ep(r),Ms(t,e.child,null,n),e=Vp(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function uP(e,t,n,r,i,s,o){if(n)return t.flags&256?(t.flags&=-257,r=gd(Error(W(422))),il(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,i=t.mode,r=vu({mode:"visible",children:r.children},i,0,null),s=Ci(s,i,o,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&Ms(t,e.child,null,o),t.child.memoizedState=tf(o),t.memoizedState=ef,s);if(!(t.mode&1))return il(e,t,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,s=Error(W(419)),r=gd(s,r,void 0),il(e,t,o,r)}if(a=(o&e.childLanes)!==0,_t||a){if(r=Ze,r!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,lr(e,i),bn(r,e,i,-1))}return Yp(),r=gd(Error(W(421))),il(e,t,o,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=SP.bind(null,e),i._reactRetry=t,null):(e=s.treeContext,$t=$r(i.nextSibling),Wt=t,Ae=!0,vn=null,e!==null&&(en[tn++]=tr,en[tn++]=nr,en[tn++]=Mi,tr=e.id,nr=e.overflow,Mi=t),t=Vp(t,r.children),t.flags|=4096,t)}function py(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Yh(e.return,t,n)}function yd(e,t,n,r,i){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i)}function F1(e,t,n){var r=t.pendingProps,i=r.revealOrder,s=r.tail;if(pt(e,t,r.children,n),r=De.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&&py(e,n,t);else if(e.tag===19)py(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(_e(De,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Pc(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),yd(t,!1,i,n,s);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Pc(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}yd(t,!0,n,null,s);break;case"together":yd(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Vl(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function cr(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Di|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(W(153));if(t.child!==null){for(e=t.child,n=Ur(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ur(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function dP(e,t,n){switch(t.tag){case 3:z1(t),As();break;case 5:d1(t);break;case 1:Pt(t.type)&&bc(t);break;case 4:Lp(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;_e(_c,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(_e(De,De.current&1),t.flags|=128,null):n&t.child.childLanes?O1(e,t,n):(_e(De,De.current&1),e=cr(e,t,n),e!==null?e.sibling:null);_e(De,De.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return F1(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),_e(De,De.current),r)break;return null;case 22:case 23:return t.lanes=0,D1(e,t,n)}return cr(e,t,n)}var $1,nf,B1,V1;$1=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}};nf=function(){};B1=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,xi(Vn.current);var s=null;switch(n){case"input":i=_h(e,i),r=_h(e,r),s=[];break;case"select":i=ze({},i,{value:void 0}),r=ze({},r,{value:void 0}),s=[];break;case"textarea":i=Ph(e,i),r=Ph(e,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=vc)}Th(n,r);var o;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var a=i[u];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(ea.hasOwnProperty(u)?s||(s=[]):(s=s||[]).push(u,null));for(u in r){var l=r[u];if(a=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&l!==a&&(l!=null||a!=null))if(u==="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||(s||(s=[]),s.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(s=s||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(ea.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&Te("scroll",e),s||a===l||(s=[])):(s=s||[]).push(u,l))}n&&(s=s||[]).push("style",n);var u=s;(t.updateQueue=u)&&(t.flags|=4)}};V1=function(e,t,n,r){n!==r&&(t.flags|=4)};function mo(e,t){if(!Ae)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 lt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function hP(e,t,n){var r=t.pendingProps;switch(Pp(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return lt(t),null;case 1:return Pt(t.type)&&wc(),lt(t),null;case 3:return r=t.stateNode,Ls(),Re(jt),Re(ht),Np(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(nl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,vn!==null&&(df(vn),vn=null))),nf(e,t),lt(t),null;case 5:Dp(t);var i=xi(ha.current);if(n=t.type,e!==null&&t.stateNode!=null)B1(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(W(166));return lt(t),null}if(e=xi(Vn.current),nl(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[On]=t,r[ua]=s,e=(t.mode&1)!==0,n){case"dialog":Te("cancel",r),Te("close",r);break;case"iframe":case"object":case"embed":Te("load",r);break;case"video":case"audio":for(i=0;i<Mo.length;i++)Te(Mo[i],r);break;case"source":Te("error",r);break;case"img":case"image":case"link":Te("error",r),Te("load",r);break;case"details":Te("toggle",r);break;case"input":Sg(r,s),Te("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},Te("invalid",r);break;case"textarea":Cg(r,s),Te("invalid",r)}Th(n,s),i=null;for(var o in s)if(s.hasOwnProperty(o)){var a=s[o];o==="children"?typeof a=="string"?r.textContent!==a&&(s.suppressHydrationWarning!==!0&&tl(r.textContent,a,e),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&tl(r.textContent,a,e),i=["children",""+a]):ea.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&Te("scroll",r)}switch(n){case"input":Ka(r),_g(r,s,!0);break;case"textarea":Ka(r),jg(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=vc)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=gw(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[On]=t,e[ua]=r,$1(e,t,!1,!1),t.stateNode=e;e:{switch(o=Rh(n,r),n){case"dialog":Te("cancel",e),Te("close",e),i=r;break;case"iframe":case"object":case"embed":Te("load",e),i=r;break;case"video":case"audio":for(i=0;i<Mo.length;i++)Te(Mo[i],e);i=r;break;case"source":Te("error",e),i=r;break;case"img":case"image":case"link":Te("error",e),Te("load",e),i=r;break;case"details":Te("toggle",e),i=r;break;case"input":Sg(e,r),i=_h(e,r),Te("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=ze({},r,{value:void 0}),Te("invalid",e);break;case"textarea":Cg(e,r),i=Ph(e,r),Te("invalid",e);break;default:i=r}Th(n,i),a=i;for(s in a)if(a.hasOwnProperty(s)){var l=a[s];s==="style"?vw(e,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&yw(e,l)):s==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&ta(e,l):typeof l=="number"&&ta(e,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(ea.hasOwnProperty(s)?l!=null&&s==="onScroll"&&Te("scroll",e):l!=null&&hp(e,s,l,o))}switch(n){case"input":Ka(e),_g(e,r,!1);break;case"textarea":Ka(e),jg(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Kr(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?ws(e,!!r.multiple,s,!1):r.defaultValue!=null&&ws(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=vc)}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 lt(t),null;case 6:if(e&&t.stateNode!=null)V1(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(W(166));if(n=xi(ha.current),xi(Vn.current),nl(t)){if(r=t.stateNode,n=t.memoizedProps,r[On]=t,(s=r.nodeValue!==n)&&(e=Wt,e!==null))switch(e.tag){case 3:tl(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&tl(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[On]=t,t.stateNode=r}return lt(t),null;case 13:if(Re(De),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ae&&$t!==null&&t.mode&1&&!(t.flags&128))o1(),As(),t.flags|=98560,s=!1;else if(s=nl(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(W(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(W(317));s[On]=t}else As(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;lt(t),s=!1}else vn!==null&&(df(vn),vn=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||De.current&1?qe===0&&(qe=3):Yp())),t.updateQueue!==null&&(t.flags|=4),lt(t),null);case 4:return Ls(),nf(e,t),e===null&&la(t.stateNode.containerInfo),lt(t),null;case 10:return Ip(t.type._context),lt(t),null;case 17:return Pt(t.type)&&wc(),lt(t),null;case 19:if(Re(De),s=t.memoizedState,s===null)return lt(t),null;if(r=(t.flags&128)!==0,o=s.rendering,o===null)if(r)mo(s,!1);else{if(qe!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Pc(e),o!==null){for(t.flags|=128,mo(s,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)s=n,e=r,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,e=o.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return _e(De,De.current&1|2),t.child}e=e.sibling}s.tail!==null&&Ue()>Ns&&(t.flags|=128,r=!0,mo(s,!1),t.lanes=4194304)}else{if(!r)if(e=Pc(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),mo(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Ae)return lt(t),null}else 2*Ue()-s.renderingStartTime>Ns&&n!==1073741824&&(t.flags|=128,r=!0,mo(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(n=s.last,n!==null?n.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=Ue(),t.sibling=null,n=De.current,_e(De,r?n&1|2:n&1),t):(lt(t),null);case 22:case 23:return Kp(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Ft&1073741824&&(lt(t),t.subtreeFlags&6&&(t.flags|=8192)):lt(t),null;case 24:return null;case 25:return null}throw Error(W(156,t.tag))}function fP(e,t){switch(Pp(t),t.tag){case 1:return Pt(t.type)&&wc(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ls(),Re(jt),Re(ht),Np(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Dp(t),null;case 13:if(Re(De),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(W(340));As()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Re(De),null;case 4:return Ls(),null;case 10:return Ip(t.type._context),null;case 22:case 23:return Kp(),null;case 24:return null;default:return null}}var sl=!1,ut=!1,pP=typeof WeakSet=="function"?WeakSet:Set,Y=null;function ps(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){$e(e,t,r)}else n.current=null}function rf(e,t,n){try{n()}catch(r){$e(e,t,r)}}var my=!1;function mP(e,t){if($h=gc,e=Kw(),Cp(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,a=-1,l=-1,u=0,c=0,h=e,f=null;t:for(;;){for(var p;h!==n||i!==0&&h.nodeType!==3||(a=o+i),h!==s||r!==0&&h.nodeType!==3||(l=o+r),h.nodeType===3&&(o+=h.nodeValue.length),(p=h.firstChild)!==null;)f=h,h=p;for(;;){if(h===e)break t;if(f===n&&++u===i&&(a=o),f===s&&++c===r&&(l=o),(p=h.nextSibling)!==null)break;h=f,f=h.parentNode}h=p}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Bh={focusedElem:e,selectionRange:n},gc=!1,Y=t;Y!==null;)if(t=Y,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Y=e;else for(;Y!==null;){t=Y;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 x=m.memoizedProps,w=m.memoizedState,g=t.stateNode,y=g.getSnapshotBeforeUpdate(t.elementType===t.type?x:yn(t.type,x),w);g.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var v=t.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(W(163))}}catch(k){$e(t,t.return,k)}if(e=t.sibling,e!==null){e.return=t.return,Y=e;break}Y=t.return}return m=my,my=!1,m}function Wo(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,s!==void 0&&rf(t,n,s)}i=i.next}while(i!==r)}}function yu(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 sf(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 W1(e){var t=e.alternate;t!==null&&(e.alternate=null,W1(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[On],delete t[ua],delete t[Uh],delete t[Xj],delete t[Jj])),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 U1(e){return e.tag===5||e.tag===3||e.tag===4}function gy(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||U1(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 of(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=vc));else if(r!==4&&(e=e.child,e!==null))for(of(e,t,n),e=e.sibling;e!==null;)of(e,t,n),e=e.sibling}function af(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(af(e,t,n),e=e.sibling;e!==null;)af(e,t,n),e=e.sibling}var et=null,xn=!1;function pr(e,t,n){for(n=n.child;n!==null;)H1(e,t,n),n=n.sibling}function H1(e,t,n){if(Bn&&typeof Bn.onCommitFiberUnmount=="function")try{Bn.onCommitFiberUnmount(cu,n)}catch{}switch(n.tag){case 5:ut||ps(n,t);case 6:var r=et,i=xn;et=null,pr(e,t,n),et=r,xn=i,et!==null&&(xn?(e=et,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):et.removeChild(n.stateNode));break;case 18:et!==null&&(xn?(e=et,n=n.stateNode,e.nodeType===8?ud(e.parentNode,n):e.nodeType===1&&ud(e,n),sa(e)):ud(et,n.stateNode));break;case 4:r=et,i=xn,et=n.stateNode.containerInfo,xn=!0,pr(e,t,n),et=r,xn=i;break;case 0:case 11:case 14:case 15:if(!ut&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&rf(n,t,o),i=i.next}while(i!==r)}pr(e,t,n);break;case 1:if(!ut&&(ps(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){$e(n,t,a)}pr(e,t,n);break;case 21:pr(e,t,n);break;case 22:n.mode&1?(ut=(r=ut)||n.memoizedState!==null,pr(e,t,n),ut=r):pr(e,t,n);break;default:pr(e,t,n)}}function yy(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new pP),t.forEach(function(r){var i=_P.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function dn(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var s=e,o=t,a=o;e:for(;a!==null;){switch(a.tag){case 5:et=a.stateNode,xn=!1;break e;case 3:et=a.stateNode.containerInfo,xn=!0;break e;case 4:et=a.stateNode.containerInfo,xn=!0;break e}a=a.return}if(et===null)throw Error(W(160));H1(s,o,i),et=null,xn=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(u){$e(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)G1(t,e),t=t.sibling}function G1(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(dn(t,e),En(e),r&4){try{Wo(3,e,e.return),yu(3,e)}catch(x){$e(e,e.return,x)}try{Wo(5,e,e.return)}catch(x){$e(e,e.return,x)}}break;case 1:dn(t,e),En(e),r&512&&n!==null&&ps(n,n.return);break;case 5:if(dn(t,e),En(e),r&512&&n!==null&&ps(n,n.return),e.flags&32){var i=e.stateNode;try{ta(i,"")}catch(x){$e(e,e.return,x)}}if(r&4&&(i=e.stateNode,i!=null)){var s=e.memoizedProps,o=n!==null?n.memoizedProps:s,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&s.type==="radio"&&s.name!=null&&pw(i,s),Rh(a,o);var u=Rh(a,s);for(o=0;o<l.length;o+=2){var c=l[o],h=l[o+1];c==="style"?vw(i,h):c==="dangerouslySetInnerHTML"?yw(i,h):c==="children"?ta(i,h):hp(i,c,h,u)}switch(a){case"input":Ch(i,s);break;case"textarea":mw(i,s);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var p=s.value;p!=null?ws(i,!!s.multiple,p,!1):f!==!!s.multiple&&(s.defaultValue!=null?ws(i,!!s.multiple,s.defaultValue,!0):ws(i,!!s.multiple,s.multiple?[]:"",!1))}i[ua]=s}catch(x){$e(e,e.return,x)}}break;case 6:if(dn(t,e),En(e),r&4){if(e.stateNode===null)throw Error(W(162));i=e.stateNode,s=e.memoizedProps;try{i.nodeValue=s}catch(x){$e(e,e.return,x)}}break;case 3:if(dn(t,e),En(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{sa(t.containerInfo)}catch(x){$e(e,e.return,x)}break;case 4:dn(t,e),En(e);break;case 13:dn(t,e),En(e),i=e.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(Hp=Ue())),r&4&&yy(e);break;case 22:if(c=n!==null&&n.memoizedState!==null,e.mode&1?(ut=(u=ut)||c,dn(t,e),ut=u):dn(t,e),En(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!c&&e.mode&1)for(Y=e,c=e.child;c!==null;){for(h=Y=c;Y!==null;){switch(f=Y,p=f.child,f.tag){case 0:case 11:case 14:case 15:Wo(4,f,f.return);break;case 1:ps(f,f.return);var m=f.stateNode;if(typeof m.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(x){$e(r,n,x)}}break;case 5:ps(f,f.return);break;case 22:if(f.memoizedState!==null){vy(h);continue}}p!==null?(p.return=f,Y=p):vy(h)}c=c.sibling}e:for(c=null,h=e;;){if(h.tag===5){if(c===null){c=h;try{i=h.stateNode,u?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(a=h.stateNode,l=h.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=xw("display",o))}catch(x){$e(e,e.return,x)}}}else if(h.tag===6){if(c===null)try{h.stateNode.nodeValue=u?"":h.memoizedProps}catch(x){$e(e,e.return,x)}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===e)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===e)break e;for(;h.sibling===null;){if(h.return===null||h.return===e)break e;c===h&&(c=null),h=h.return}c===h&&(c=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:dn(t,e),En(e),r&4&&yy(e);break;case 21:break;default:dn(t,e),En(e)}}function En(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(U1(n)){var r=n;break e}n=n.return}throw Error(W(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(ta(i,""),r.flags&=-33);var s=gy(e);af(e,s,i);break;case 3:case 4:var o=r.stateNode.containerInfo,a=gy(e);of(e,a,o);break;default:throw Error(W(161))}}catch(l){$e(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function gP(e,t,n){Y=e,K1(e)}function K1(e,t,n){for(var r=(e.mode&1)!==0;Y!==null;){var i=Y,s=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||sl;if(!o){var a=i.alternate,l=a!==null&&a.memoizedState!==null||ut;a=sl;var u=ut;if(sl=o,(ut=l)&&!u)for(Y=i;Y!==null;)o=Y,l=o.child,o.tag===22&&o.memoizedState!==null?wy(i):l!==null?(l.return=o,Y=l):wy(i);for(;s!==null;)Y=s,K1(s),s=s.sibling;Y=i,sl=a,ut=u}xy(e)}else i.subtreeFlags&8772&&s!==null?(s.return=i,Y=s):xy(e)}}function xy(e){for(;Y!==null;){var t=Y;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:ut||yu(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!ut)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:yn(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&ny(t,s,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}ny(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 u=t.alternate;if(u!==null){var c=u.memoizedState;if(c!==null){var h=c.dehydrated;h!==null&&sa(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(W(163))}ut||t.flags&512&&sf(t)}catch(f){$e(t,t.return,f)}}if(t===e){Y=null;break}if(n=t.sibling,n!==null){n.return=t.return,Y=n;break}Y=t.return}}function vy(e){for(;Y!==null;){var t=Y;if(t===e){Y=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Y=n;break}Y=t.return}}function wy(e){for(;Y!==null;){var t=Y;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{yu(4,t)}catch(l){$e(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(l){$e(t,i,l)}}var s=t.return;try{sf(t)}catch(l){$e(t,s,l)}break;case 5:var o=t.return;try{sf(t)}catch(l){$e(t,o,l)}}}catch(l){$e(t,t.return,l)}if(t===e){Y=null;break}var a=t.sibling;if(a!==null){a.return=t.return,Y=a;break}Y=t.return}}var yP=Math.ceil,Rc=ur.ReactCurrentDispatcher,Wp=ur.ReactCurrentOwner,on=ur.ReactCurrentBatchConfig,ce=0,Ze=null,Ke=null,rt=0,Ft=0,ms=Zr(0),qe=0,ga=null,Di=0,xu=0,Up=0,Uo=null,St=null,Hp=0,Ns=1/0,Zn=null,Ic=!1,lf=null,Vr=null,ol=!1,Ir=null,Ac=0,Ho=0,cf=null,Wl=-1,Ul=0;function yt(){return ce&6?Ue():Wl!==-1?Wl:Wl=Ue()}function Wr(e){return e.mode&1?ce&2&&rt!==0?rt&-rt:eP.transition!==null?(Ul===0&&(Ul=Iw()),Ul):(e=ge,e!==0||(e=window.event,e=e===void 0?16:Ow(e.type)),e):1}function bn(e,t,n,r){if(50<Ho)throw Ho=0,cf=null,Error(W(185));Ea(e,n,r),(!(ce&2)||e!==Ze)&&(e===Ze&&(!(ce&2)&&(xu|=n),qe===4&&Er(e,rt)),Et(e,r),n===1&&ce===0&&!(t.mode&1)&&(Ns=Ue()+500,pu&&ei()))}function Et(e,t){var n=e.callbackNode;ej(e,t);var r=mc(e,e===Ze?rt:0);if(r===0)n!==null&&Tg(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Tg(n),t===1)e.tag===0?Zj(by.bind(null,e)):r1(by.bind(null,e)),Qj(function(){!(ce&6)&&ei()}),n=null;else{switch(Aw(r)){case 1:n=yp;break;case 4:n=Tw;break;case 16:n=pc;break;case 536870912:n=Rw;break;default:n=pc}n=tb(n,Y1.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Y1(e,t){if(Wl=-1,Ul=0,ce&6)throw Error(W(327));var n=e.callbackNode;if(Cs()&&e.callbackNode!==n)return null;var r=mc(e,e===Ze?rt:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Mc(e,r);else{t=r;var i=ce;ce|=2;var s=q1();(Ze!==e||rt!==t)&&(Zn=null,Ns=Ue()+500,_i(e,t));do try{wP();break}catch(a){Q1(e,a)}while(!0);Rp(),Rc.current=s,ce=i,Ke!==null?t=0:(Ze=null,rt=0,t=qe)}if(t!==0){if(t===2&&(i=Dh(e),i!==0&&(r=i,t=uf(e,i))),t===1)throw n=ga,_i(e,0),Er(e,r),Et(e,Ue()),n;if(t===6)Er(e,r);else{if(i=e.current.alternate,!(r&30)&&!xP(i)&&(t=Mc(e,r),t===2&&(s=Dh(e),s!==0&&(r=s,t=uf(e,s))),t===1))throw n=ga,_i(e,0),Er(e,r),Et(e,Ue()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(W(345));case 2:di(e,St,Zn);break;case 3:if(Er(e,r),(r&130023424)===r&&(t=Hp+500-Ue(),10<t)){if(mc(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){yt(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Wh(di.bind(null,e,St,Zn),t);break}di(e,St,Zn);break;case 4:if(Er(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var o=31-wn(r);s=1<<o,o=t[o],o>i&&(i=o),r&=~s}if(r=i,r=Ue()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*yP(r/1960))-r,10<r){e.timeoutHandle=Wh(di.bind(null,e,St,Zn),r);break}di(e,St,Zn);break;case 5:di(e,St,Zn);break;default:throw Error(W(329))}}}return Et(e,Ue()),e.callbackNode===n?Y1.bind(null,e):null}function uf(e,t){var n=Uo;return e.current.memoizedState.isDehydrated&&(_i(e,t).flags|=256),e=Mc(e,t),e!==2&&(t=St,St=n,t!==null&&df(t)),e}function df(e){St===null?St=e:St.push.apply(St,e)}function xP(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],s=i.getSnapshot;i=i.value;try{if(!Sn(s(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Er(e,t){for(t&=~Up,t&=~xu,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-wn(t),r=1<<n;e[n]=-1,t&=~r}}function by(e){if(ce&6)throw Error(W(327));Cs();var t=mc(e,0);if(!(t&1))return Et(e,Ue()),null;var n=Mc(e,t);if(e.tag!==0&&n===2){var r=Dh(e);r!==0&&(t=r,n=uf(e,r))}if(n===1)throw n=ga,_i(e,0),Er(e,t),Et(e,Ue()),n;if(n===6)throw Error(W(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,di(e,St,Zn),Et(e,Ue()),null}function Gp(e,t){var n=ce;ce|=1;try{return e(t)}finally{ce=n,ce===0&&(Ns=Ue()+500,pu&&ei())}}function Ni(e){Ir!==null&&Ir.tag===0&&!(ce&6)&&Cs();var t=ce;ce|=1;var n=on.transition,r=ge;try{if(on.transition=null,ge=1,e)return e()}finally{ge=r,on.transition=n,ce=t,!(ce&6)&&ei()}}function Kp(){Ft=ms.current,Re(ms)}function _i(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Yj(n)),Ke!==null)for(n=Ke.return;n!==null;){var r=n;switch(Pp(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&wc();break;case 3:Ls(),Re(jt),Re(ht),Np();break;case 5:Dp(r);break;case 4:Ls();break;case 13:Re(De);break;case 19:Re(De);break;case 10:Ip(r.type._context);break;case 22:case 23:Kp()}n=n.return}if(Ze=e,Ke=e=Ur(e.current,null),rt=Ft=t,qe=0,ga=null,Up=xu=Di=0,St=Uo=null,yi!==null){for(t=0;t<yi.length;t++)if(n=yi[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,s=n.pending;if(s!==null){var o=s.next;s.next=i,r.next=o}n.pending=r}yi=null}return e}function Q1(e,t){do{var n=Ke;try{if(Rp(),$l.current=Tc,Ec){for(var r=Ne.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Ec=!1}if(Li=0,Je=Qe=Ne=null,Vo=!1,fa=0,Wp.current=null,n===null||n.return===null){qe=1,ga=t,Ke=null;break}e:{var s=e,o=n.return,a=n,l=t;if(t=rt,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,c=a,h=c.tag;if(!(c.mode&1)&&(h===0||h===11||h===15)){var f=c.alternate;f?(c.updateQueue=f.updateQueue,c.memoizedState=f.memoizedState,c.lanes=f.lanes):(c.updateQueue=null,c.memoizedState=null)}var p=ly(o);if(p!==null){p.flags&=-257,cy(p,o,a,s,t),p.mode&1&&ay(s,u,t),t=p,l=u;var m=t.updateQueue;if(m===null){var x=new Set;x.add(l),t.updateQueue=x}else m.add(l);break e}else{if(!(t&1)){ay(s,u,t),Yp();break e}l=Error(W(426))}}else if(Ae&&a.mode&1){var w=ly(o);if(w!==null){!(w.flags&65536)&&(w.flags|=256),cy(w,o,a,s,t),Ep(Ds(l,a));break e}}s=l=Ds(l,a),qe!==4&&(qe=2),Uo===null?Uo=[s]:Uo.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var g=A1(s,l,t);ty(s,g);break e;case 1:a=l;var y=s.type,v=s.stateNode;if(!(s.flags&128)&&(typeof y.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(Vr===null||!Vr.has(v)))){s.flags|=65536,t&=-t,s.lanes|=t;var k=M1(s,a,t);ty(s,k);break e}}s=s.return}while(s!==null)}J1(n)}catch(P){t=P,Ke===n&&n!==null&&(Ke=n=n.return);continue}break}while(!0)}function q1(){var e=Rc.current;return Rc.current=Tc,e===null?Tc:e}function Yp(){(qe===0||qe===3||qe===2)&&(qe=4),Ze===null||!(Di&268435455)&&!(xu&268435455)||Er(Ze,rt)}function Mc(e,t){var n=ce;ce|=2;var r=q1();(Ze!==e||rt!==t)&&(Zn=null,_i(e,t));do try{vP();break}catch(i){Q1(e,i)}while(!0);if(Rp(),ce=n,Rc.current=r,Ke!==null)throw Error(W(261));return Ze=null,rt=0,qe}function vP(){for(;Ke!==null;)X1(Ke)}function wP(){for(;Ke!==null&&!HC();)X1(Ke)}function X1(e){var t=eb(e.alternate,e,Ft);e.memoizedProps=e.pendingProps,t===null?J1(e):Ke=t,Wp.current=null}function J1(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=fP(n,t),n!==null){n.flags&=32767,Ke=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{qe=6,Ke=null;return}}else if(n=hP(n,t,Ft),n!==null){Ke=n;return}if(t=t.sibling,t!==null){Ke=t;return}Ke=t=e}while(t!==null);qe===0&&(qe=5)}function di(e,t,n){var r=ge,i=on.transition;try{on.transition=null,ge=1,bP(e,t,n,r)}finally{on.transition=i,ge=r}return null}function bP(e,t,n,r){do Cs();while(Ir!==null);if(ce&6)throw Error(W(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(W(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(tj(e,s),e===Ze&&(Ke=Ze=null,rt=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||ol||(ol=!0,tb(pc,function(){return Cs(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=on.transition,on.transition=null;var o=ge;ge=1;var a=ce;ce|=4,Wp.current=null,mP(e,n),G1(n,e),Bj(Bh),gc=!!$h,Bh=$h=null,e.current=n,gP(n),GC(),ce=a,ge=o,on.transition=s}else e.current=n;if(ol&&(ol=!1,Ir=e,Ac=i),s=e.pendingLanes,s===0&&(Vr=null),QC(n.stateNode),Et(e,Ue()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(Ic)throw Ic=!1,e=lf,lf=null,e;return Ac&1&&e.tag!==0&&Cs(),s=e.pendingLanes,s&1?e===cf?Ho++:(Ho=0,cf=e):Ho=0,ei(),null}function Cs(){if(Ir!==null){var e=Aw(Ac),t=on.transition,n=ge;try{if(on.transition=null,ge=16>e?16:e,Ir===null)var r=!1;else{if(e=Ir,Ir=null,Ac=0,ce&6)throw Error(W(331));var i=ce;for(ce|=4,Y=e.current;Y!==null;){var s=Y,o=s.child;if(Y.flags&16){var a=s.deletions;if(a!==null){for(var l=0;l<a.length;l++){var u=a[l];for(Y=u;Y!==null;){var c=Y;switch(c.tag){case 0:case 11:case 15:Wo(8,c,s)}var h=c.child;if(h!==null)h.return=c,Y=h;else for(;Y!==null;){c=Y;var f=c.sibling,p=c.return;if(W1(c),c===u){Y=null;break}if(f!==null){f.return=p,Y=f;break}Y=p}}}var m=s.alternate;if(m!==null){var x=m.child;if(x!==null){m.child=null;do{var w=x.sibling;x.sibling=null,x=w}while(x!==null)}}Y=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,Y=o;else e:for(;Y!==null;){if(s=Y,s.flags&2048)switch(s.tag){case 0:case 11:case 15:Wo(9,s,s.return)}var g=s.sibling;if(g!==null){g.return=s.return,Y=g;break e}Y=s.return}}var y=e.current;for(Y=y;Y!==null;){o=Y;var v=o.child;if(o.subtreeFlags&2064&&v!==null)v.return=o,Y=v;else e:for(o=y;Y!==null;){if(a=Y,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:yu(9,a)}}catch(P){$e(a,a.return,P)}if(a===o){Y=null;break e}var k=a.sibling;if(k!==null){k.return=a.return,Y=k;break e}Y=a.return}}if(ce=i,ei(),Bn&&typeof Bn.onPostCommitFiberRoot=="function")try{Bn.onPostCommitFiberRoot(cu,e)}catch{}r=!0}return r}finally{ge=n,on.transition=t}}return!1}function ky(e,t,n){t=Ds(n,t),t=A1(e,t,1),e=Br(e,t,1),t=yt(),e!==null&&(Ea(e,1,t),Et(e,t))}function $e(e,t,n){if(e.tag===3)ky(e,e,n);else for(;t!==null;){if(t.tag===3){ky(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Vr===null||!Vr.has(r))){e=Ds(n,e),e=M1(t,e,1),t=Br(t,e,1),e=yt(),t!==null&&(Ea(t,1,e),Et(t,e));break}}t=t.return}}function kP(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=yt(),e.pingedLanes|=e.suspendedLanes&n,Ze===e&&(rt&n)===n&&(qe===4||qe===3&&(rt&130023424)===rt&&500>Ue()-Hp?_i(e,0):Up|=n),Et(e,t)}function Z1(e,t){t===0&&(e.mode&1?(t=qa,qa<<=1,!(qa&130023424)&&(qa=4194304)):t=1);var n=yt();e=lr(e,t),e!==null&&(Ea(e,t,n),Et(e,n))}function SP(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Z1(e,n)}function _P(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(W(314))}r!==null&&r.delete(t),Z1(e,n)}var eb;eb=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||jt.current)_t=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return _t=!1,dP(e,t,n);_t=!!(e.flags&131072)}else _t=!1,Ae&&t.flags&1048576&&i1(t,Sc,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Vl(e,t),e=t.pendingProps;var i=Is(t,ht.current);_s(t,n),i=Op(null,t,r,e,i,n);var s=Fp();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Pt(r)?(s=!0,bc(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Mp(t),i.updater=gu,t.stateNode=i,i._reactInternals=t,qh(t,r,e,n),t=Zh(null,t,r,!0,s,n)):(t.tag=0,Ae&&s&&jp(t),pt(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Vl(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=jP(r),e=yn(r,e),i){case 0:t=Jh(null,t,r,e,n);break e;case 1:t=hy(null,t,r,e,n);break e;case 11:t=uy(null,t,r,e,n);break e;case 14:t=dy(null,t,r,yn(r.type,e),n);break e}throw Error(W(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:yn(r,i),Jh(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:yn(r,i),hy(e,t,r,i,n);case 3:e:{if(z1(t),e===null)throw Error(W(387));r=t.pendingProps,s=t.memoizedState,i=s.element,u1(e,t),jc(t,r,null,n);var o=t.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=Ds(Error(W(423)),t),t=fy(e,t,r,n,i);break e}else if(r!==i){i=Ds(Error(W(424)),t),t=fy(e,t,r,n,i);break e}else for($t=$r(t.stateNode.containerInfo.firstChild),Wt=t,Ae=!0,vn=null,n=l1(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(As(),r===i){t=cr(e,t,n);break e}pt(e,t,r,n)}t=t.child}return t;case 5:return d1(t),e===null&&Kh(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,o=i.children,Vh(r,i)?o=null:s!==null&&Vh(r,s)&&(t.flags|=32),N1(e,t),pt(e,t,o,n),t.child;case 6:return e===null&&Kh(t),null;case 13:return O1(e,t,n);case 4:return Lp(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ms(t,null,r,n):pt(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:yn(r,i),uy(e,t,r,i,n);case 7:return pt(e,t,t.pendingProps,n),t.child;case 8:return pt(e,t,t.pendingProps.children,n),t.child;case 12:return pt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,s=t.memoizedProps,o=i.value,_e(_c,r._currentValue),r._currentValue=o,s!==null)if(Sn(s.value,o)){if(s.children===i.children&&!jt.current){t=cr(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=rr(-1,n&-n),l.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),Yh(s.return,n,t),a.lanes|=n;break}l=l.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(W(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Yh(o,n,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}pt(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,_s(t,n),i=ln(i),r=r(i),t.flags|=1,pt(e,t,r,n),t.child;case 14:return r=t.type,i=yn(r,t.pendingProps),i=yn(r.type,i),dy(e,t,r,i,n);case 15:return L1(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:yn(r,i),Vl(e,t),t.tag=1,Pt(r)?(e=!0,bc(t)):e=!1,_s(t,n),I1(t,r,i),qh(t,r,i,n),Zh(null,t,r,!0,e,n);case 19:return F1(e,t,n);case 22:return D1(e,t,n)}throw Error(W(156,t.tag))};function tb(e,t){return Ew(e,t)}function CP(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 rn(e,t,n,r){return new CP(e,t,n,r)}function Qp(e){return e=e.prototype,!(!e||!e.isReactComponent)}function jP(e){if(typeof e=="function")return Qp(e)?1:0;if(e!=null){if(e=e.$$typeof,e===pp)return 11;if(e===mp)return 14}return 2}function Ur(e,t){var n=e.alternate;return n===null?(n=rn(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 Hl(e,t,n,r,i,s){var o=2;if(r=e,typeof e=="function")Qp(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case ss:return Ci(n.children,i,s,t);case fp:o=8,i|=8;break;case wh:return e=rn(12,n,t,i|2),e.elementType=wh,e.lanes=s,e;case bh:return e=rn(13,n,t,i),e.elementType=bh,e.lanes=s,e;case kh:return e=rn(19,n,t,i),e.elementType=kh,e.lanes=s,e;case dw:return vu(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case cw:o=10;break e;case uw:o=9;break e;case pp:o=11;break e;case mp:o=14;break e;case _r:o=16,r=null;break e}throw Error(W(130,e==null?e:typeof e,""))}return t=rn(o,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function Ci(e,t,n,r){return e=rn(7,e,r,t),e.lanes=n,e}function vu(e,t,n,r){return e=rn(22,e,r,t),e.elementType=dw,e.lanes=n,e.stateNode={isHidden:!1},e}function xd(e,t,n){return e=rn(6,e,null,t),e.lanes=n,e}function vd(e,t,n){return t=rn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function PP(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Zu(0),this.expirationTimes=Zu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Zu(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function qp(e,t,n,r,i,s,o,a,l){return e=new PP(e,t,n,a,l),t===1?(t=1,s===!0&&(t|=8)):t=0,s=rn(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Mp(s),e}function EP(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:is,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function nb(e){if(!e)return Yr;e=e._reactInternals;e:{if(Fi(e)!==e||e.tag!==1)throw Error(W(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Pt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(W(171))}if(e.tag===1){var n=e.type;if(Pt(n))return n1(e,n,t)}return t}function rb(e,t,n,r,i,s,o,a,l){return e=qp(n,r,!0,e,i,s,o,a,l),e.context=nb(null),n=e.current,r=yt(),i=Wr(n),s=rr(r,i),s.callback=t??null,Br(n,s,i),e.current.lanes=i,Ea(e,i,r),Et(e,r),e}function wu(e,t,n,r){var i=t.current,s=yt(),o=Wr(i);return n=nb(n),t.context===null?t.context=n:t.pendingContext=n,t=rr(s,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Br(i,t,o),e!==null&&(bn(e,i,o,s),Fl(e,i,o)),o}function Lc(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Sy(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Xp(e,t){Sy(e,t),(e=e.alternate)&&Sy(e,t)}function TP(){return null}var ib=typeof reportError=="function"?reportError:function(e){console.error(e)};function Jp(e){this._internalRoot=e}bu.prototype.render=Jp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(W(409));wu(e,t,null,null)};bu.prototype.unmount=Jp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ni(function(){wu(null,e,null,null)}),t[ar]=null}};function bu(e){this._internalRoot=e}bu.prototype.unstable_scheduleHydration=function(e){if(e){var t=Dw();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Pr.length&&t!==0&&t<Pr[n].priority;n++);Pr.splice(n,0,e),n===0&&zw(e)}};function Zp(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ku(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function _y(){}function RP(e,t,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var u=Lc(o);s.call(u)}}var o=rb(t,r,e,0,null,!1,!1,"",_y);return e._reactRootContainer=o,e[ar]=o.current,la(e.nodeType===8?e.parentNode:e),Ni(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var u=Lc(l);a.call(u)}}var l=qp(e,0,!1,null,null,!1,!1,"",_y);return e._reactRootContainer=l,e[ar]=l.current,la(e.nodeType===8?e.parentNode:e),Ni(function(){wu(t,l,n,r)}),l}function Su(e,t,n,r,i){var s=n._reactRootContainer;if(s){var o=s;if(typeof i=="function"){var a=i;i=function(){var l=Lc(o);a.call(l)}}wu(t,o,e,i)}else o=RP(n,t,e,i,r);return Lc(o)}Mw=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Ao(t.pendingLanes);n!==0&&(xp(t,n|1),Et(t,Ue()),!(ce&6)&&(Ns=Ue()+500,ei()))}break;case 13:Ni(function(){var r=lr(e,1);if(r!==null){var i=yt();bn(r,e,1,i)}}),Xp(e,1)}};vp=function(e){if(e.tag===13){var t=lr(e,134217728);if(t!==null){var n=yt();bn(t,e,134217728,n)}Xp(e,134217728)}};Lw=function(e){if(e.tag===13){var t=Wr(e),n=lr(e,t);if(n!==null){var r=yt();bn(n,e,t,r)}Xp(e,t)}};Dw=function(){return ge};Nw=function(e,t){var n=ge;try{return ge=e,t()}finally{ge=n}};Ah=function(e,t,n){switch(t){case"input":if(Ch(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=fu(r);if(!i)throw Error(W(90));fw(r),Ch(r,i)}}}break;case"textarea":mw(e,n);break;case"select":t=n.value,t!=null&&ws(e,!!n.multiple,t,!1)}};kw=Gp;Sw=Ni;var IP={usingClientEntryPoint:!1,Events:[Ra,cs,fu,ww,bw,Gp]},go={findFiberByHostInstance:gi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},AP={bundleType:go.bundleType,version:go.version,rendererPackageName:go.rendererPackageName,rendererConfig:go.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ur.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=jw(e),e===null?null:e.stateNode},findFiberByHostInstance:go.findFiberByHostInstance||TP,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 al=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!al.isDisabled&&al.supportsFiber)try{cu=al.inject(AP),Bn=al}catch{}}Kt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=IP;Kt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Zp(t))throw Error(W(200));return EP(e,t,null,n)};Kt.createRoot=function(e,t){if(!Zp(e))throw Error(W(299));var n=!1,r="",i=ib;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=qp(e,1,!1,null,null,n,!1,r,i),e[ar]=t.current,la(e.nodeType===8?e.parentNode:e),new Jp(t)};Kt.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(W(188)):(e=Object.keys(e).join(","),Error(W(268,e)));return e=jw(t),e=e===null?null:e.stateNode,e};Kt.flushSync=function(e){return Ni(e)};Kt.hydrate=function(e,t,n){if(!ku(t))throw Error(W(200));return Su(null,e,t,!0,n)};Kt.hydrateRoot=function(e,t,n){if(!Zp(e))throw Error(W(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",o=ib;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=rb(t,null,e,1,n??null,i,!1,s,o),e[ar]=t.current,la(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new bu(t)};Kt.render=function(e,t,n){if(!ku(t))throw Error(W(200));return Su(null,e,t,!1,n)};Kt.unmountComponentAtNode=function(e){if(!ku(e))throw Error(W(40));return e._reactRootContainer?(Ni(function(){Su(null,null,e,!1,function(){e._reactRootContainer=null,e[ar]=null})}),!0):!1};Kt.unstable_batchedUpdates=Gp;Kt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!ku(n))throw Error(W(200));if(e==null||e._reactInternals===void 0)throw Error(W(38));return Su(e,t,n,!1,r)};Kt.version="18.3.1-next-f1338f8080-20240426";function sb(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(sb)}catch(e){console.error(e)}}sb(),sw.exports=Kt;var $i=sw.exports,ob,Cy=$i;ob=Cy.createRoot,Cy.hydrateRoot;var Lo=typeof window<"u"?S.useLayoutEffect:S.useEffect;function wd(e){const t=S.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function MP(e,t,n={},r={}){S.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const i=new IntersectionObserver(([s])=>{t(s)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,r.disabled,e])}function LP(e){const t=S.useRef(null);return S.useImperativeHandle(e,()=>t.current,[]),t}const ab=!1;function ya(e){return e[e.length-1]}function DP(e){return typeof e=="function"}function Ar(e,t){return DP(e)?e(t):e}const NP=Object.prototype.hasOwnProperty,jy=Object.prototype.propertyIsEnumerable,zP=()=>Object.create(null),si=(e,t)=>Mr(e,t,zP);function Mr(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;const i=t,s=Ty(e)&&Ty(i);if(!s&&!(zs(e)&&zs(i)))return i;const o=s?e:Py(e);if(!o)return i;const a=s?i:Py(i);if(!a)return i;const l=o.length,u=a.length,c=s?new Array(u):n();let h=0;for(let f=0;f<u;f++){const p=s?f:a[f],m=e[p],x=i[p];if(m===x){c[p]=m,(s?f<l:NP.call(e,p))&&h++;continue}if(m===null||x===null||typeof m!="object"||typeof x!="object"){c[p]=x;continue}const w=Mr(m,x,n,r+1);c[p]=w,w===m&&h++}return l===u&&h===l?e:c}function Py(e){const t=Object.getOwnPropertyNames(e);for(const i of t)if(!jy.call(e,i))return!1;const n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;const r=t;for(const i of n){if(!jy.call(e,i))return!1;r.push(i)}return r}function zs(e){if(!Ey(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!Ey(n)||!n.hasOwnProperty("isPrototypeOf"))}function Ey(e){return Object.prototype.toString.call(e)==="[object Object]"}function Ty(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ji(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,i=e.length;r<i;r++)if(!ji(e[r],t[r],n))return!1;return!0}if(zs(e)&&zs(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)&&!ji(e[o],t[o],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(const o in e)e[o]!==void 0&&i++;let s=0;for(const o in t)if((!r||t[o]!==void 0)&&(s++,s>i||!ji(e[o],t[o],n)))return!1;return i===s}return!1}function Os(e){let t,n;const r=new Promise((i,s)=>{t=i,n=s});return r.status="pending",r.resolve=i=>{r.status="resolved",r.value=i,t(i),e==null||e(i)},r.reject=i=>{r.status="rejected",n(i)},r}function xa(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function OP(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function Ry(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 OP(t)}const FP=["http:","https:","mailto:","tel:"];function Dc(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function yo(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="",i;for(;(i=t.exec(e))!==null;)r+=Ry(e.slice(n,i.index))+i[0],n=t.lastIndex;r=r+Ry(n?e.slice(n):e);let s=!1;return r.startsWith("//")&&(s=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:s}}function $P(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function BP(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 ir(){throw new Error("Invariant failed")}function va(e){const t=new Map;let n,r;const i=s=>{s.next&&(s.prev?(s.prev.next=s.next,s.next.prev=s.prev,s.next=void 0,r&&(r.next=s,s.prev=r)):(s.next.prev=void 0,n=s.next,s.next=void 0,r&&(s.prev=r,r.next=s)),r=s)};return{get(s){const o=t.get(s);if(o)return i(o),o.value},set(s,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(s);if(a)a.value=o,i(a);else{const l={key:s,value:o,prev:r};r&&(r.next=l),r=l,n||(n=l),t.set(s,l)}},clear(){t.clear(),n=void 0,r=void 0}}}const Lr=4,lb=5;function VP(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 em(e,t,n=new Uint16Array(6)){const r=e.indexOf("/",t),i=r===-1?e.length:r,s=e.substring(t,i);if(!s||!s.includes("$"))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(s==="$"){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(s.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;const o=VP(s);if(o){const[a,l]=o,u=s.charCodeAt(a+1);if(u===45){if(a+2<s.length&&s.charCodeAt(a+2)===36){const c=a+3,h=l;if(c<h)return n[0]=3,n[1]=t+a,n[2]=t+c,n[3]=t+h,n[4]=t+l+1,n[5]=i,n}}else if(u===36){const c=a+1,h=a+2;return h===l?(n[0]=2,n[1]=t+a,n[2]=t+c,n[3]=t+h,n[4]=t+l+1,n[5]=e.length,n):(n[0]=1,n[1]=t+a,n[2]=t+h,n[3]=t+l,n[4]=t+l+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function _u(e,t,n,r,i,s,o){var l,u,c,h,f,p,m,x,w,g,y,v,k;o==null||o(n);let a=r;{const P=n.fullPath??n.from,b=P.length,C=((l=n.options)==null?void 0:l.caseSensitive)??e,j=!!((c=(u=n.options)==null?void 0:u.params)!=null&&c.parse&&((f=(h=n.options)==null?void 0:h.skipRouteOnParseError)!=null&&f.params));for(;a<b;){const E=em(P,a,t);let A;const M=a,F=E[5];switch(a=F+1,s++,E[0]){case 0:{const D=P.substring(E[2],E[3]);if(C){const L=(p=i.static)==null?void 0:p.get(D);if(L)A=L;else{i.static??(i.static=new Map);const $=vi(n.fullPath??n.from);$.parent=i,$.depth=s,A=$,i.static.set(D,$)}}else{const L=D.toLowerCase(),$=(m=i.staticInsensitive)==null?void 0:m.get(L);if($)A=$;else{i.staticInsensitive??(i.staticInsensitive=new Map);const U=vi(n.fullPath??n.from);U.parent=i,U.depth=s,A=U,i.staticInsensitive.set(L,U)}}break}case 1:{const D=P.substring(M,E[1]),L=P.substring(E[4],F),$=C&&!!(D||L),U=D?$?D:D.toLowerCase():void 0,z=L?$?L:L.toLowerCase():void 0,V=!j&&((x=i.dynamic)==null?void 0:x.find(_=>!_.skipOnParamError&&_.caseSensitive===$&&_.prefix===U&&_.suffix===z));if(V)A=V;else{const _=kd(1,n.fullPath??n.from,$,U,z);A=_,_.depth=s,_.parent=i,i.dynamic??(i.dynamic=[]),i.dynamic.push(_)}break}case 3:{const D=P.substring(M,E[1]),L=P.substring(E[4],F),$=C&&!!(D||L),U=D?$?D:D.toLowerCase():void 0,z=L?$?L:L.toLowerCase():void 0,V=!j&&((w=i.optional)==null?void 0:w.find(_=>!_.skipOnParamError&&_.caseSensitive===$&&_.prefix===U&&_.suffix===z));if(V)A=V;else{const _=kd(3,n.fullPath??n.from,$,U,z);A=_,_.parent=i,_.depth=s,i.optional??(i.optional=[]),i.optional.push(_)}break}case 2:{const D=P.substring(M,E[1]),L=P.substring(E[4],F),$=C&&!!(D||L),U=D?$?D:D.toLowerCase():void 0,z=L?$?L:L.toLowerCase():void 0,V=kd(2,n.fullPath??n.from,$,U,z);A=V,V.parent=i,V.depth=s,i.wildcard??(i.wildcard=[]),i.wildcard.push(V)}}i=A}if(j&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const E=vi(n.fullPath??n.from);E.kind=lb,E.parent=i,s++,E.depth=s,i.pathless??(i.pathless=[]),i.pathless.push(E),i=E}const T=(n.path||!n.children)&&!n.isRoot;if(T&&P.endsWith("/")){const E=vi(n.fullPath??n.from);E.kind=Lr,E.parent=i,s++,E.depth=s,i.index=E,i=E}i.parse=((y=(g=n.options)==null?void 0:g.params)==null?void 0:y.parse)??null,i.skipOnParamError=j,i.parsingPriority=((k=(v=n.options)==null?void 0:v.skipRouteOnParseError)==null?void 0:k.priority)??0,T&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(const P of n.children)_u(e,t,P,a,i,s,o)}function bd(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 jr(e){var t,n,r;if(e.pathless)for(const i of e.pathless)jr(i);if(e.static)for(const i of e.static.values())jr(i);if(e.staticInsensitive)for(const i of e.staticInsensitive.values())jr(i);if((t=e.dynamic)!=null&&t.length){e.dynamic.sort(bd);for(const i of e.dynamic)jr(i)}if((n=e.optional)!=null&&n.length){e.optional.sort(bd);for(const i of e.optional)jr(i)}if((r=e.wildcard)!=null&&r.length){e.wildcard.sort(bd);for(const i of e.wildcard)jr(i)}}function vi(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 kd(e,t,n,r,i){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:i}}function WP(e,t){const n=vi("/"),r=new Uint16Array(6);for(const i of e)_u(!1,r,i,1,n,0);jr(n),t.masksTree=n,t.flatCache=va(1e3)}function UP(e,t){e||(e="/");const n=t.flatCache.get(e);if(n)return n;const r=tm(e,t.masksTree);return t.flatCache.set(e,r),r}function HP(e,t,n,r,i){e||(e="/"),r||(r="/");const s=t?`case\0${e}`:e;let o=i.singleCache.get(s);return o||(o=vi("/"),_u(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(s,o)),tm(r,o,n)}function GP(e,t,n=!1){const r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||(e="/");let s;try{s=tm(e,t.segmentTree,n)}catch(o){if(o instanceof URIError)s=null;else throw o}return s&&(s.branch=QP(s.route)),t.matchCache.set(r,s),s}function KP(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function YP(e,t=!1,n){const r=vi(e.fullPath),i=new Uint16Array(6),s={},o={};let a=0;return _u(t,i,e,1,r,0,l=>{if(n==null||n(l,a),l.id in s&&ir(),s[l.id]=l,a!==0&&l.path){const u=KP(l.fullPath);(!o[u]||l.fullPath.endsWith("/"))&&(o[u]=l)}a++}),jr(r),{processedTree:{segmentTree:r,singleCache:va(1e3),matchCache:va(1e3),flatCache:null,masksTree:null},routesById:s,routesByPath:o}}function tm(e,t,n=!1){const r=e.split("/"),i=XP(e,r,t,n);if(!i)return null;const[s]=cb(e,r,i);return{route:i.node.route,rawParams:s,parsedParams:i.parsedParams}}function cb(e,t,n){var c,h,f,p,m,x,w,g,y,v;const r=qP(n.node);let i=null;const s=Object.create(null);let o=((c=n.extract)==null?void 0:c.part)??0,a=((h=n.extract)==null?void 0:h.node)??0,l=((f=n.extract)==null?void 0:f.path)??0,u=((p=n.extract)==null?void 0:p.segment)??0;for(;a<r.length;o++,a++,l++,u++){const k=r[a];if(k.kind===Lr)break;if(k.kind===lb){u--,o--,l--;continue}const P=t[o],b=l;if(P&&(l+=P.length),k.kind===1){i??(i=n.node.fullPath.split("/"));const C=i[u],j=((m=k.prefix)==null?void 0:m.length)??0;if(C.charCodeAt(j)===123){const T=((x=k.suffix)==null?void 0:x.length)??0,E=C.substring(j+2,C.length-T-1),A=P.substring(j,P.length-T);s[E]=decodeURIComponent(A)}else{const T=C.substring(1);s[T]=decodeURIComponent(P)}}else if(k.kind===3){if(n.skipped&1<<a){o--,l=b-1;continue}i??(i=n.node.fullPath.split("/"));const C=i[u],j=((w=k.prefix)==null?void 0:w.length)??0,T=((g=k.suffix)==null?void 0:g.length)??0,E=C.substring(j+3,C.length-T-1),A=k.suffix||k.prefix?P.substring(j,P.length-T):P;A&&(s[E]=decodeURIComponent(A))}else if(k.kind===2){const C=k,j=e.substring(b+(((y=C.prefix)==null?void 0:y.length)??0),e.length-(((v=C.suffix)==null?void 0:v.length)??0)),T=decodeURIComponent(j);s["*"]=T,s._splat=T;break}}return n.rawParams&&Object.assign(s,n.rawParams),[s,{part:o,node:a,path:l,segment:u}]}function QP(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function qP(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function XP(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const i=!ya(t),s=i&&e!=="/",o=t.length-(i?1:0),a=[{node:n,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}];let l=null,u=null;for(;a.length;){const c=a.pop(),{node:h,index:f,skipped:p,depth:m,statics:x,dynamics:w,optionals:g}=c;let{extract:y,rawParams:v,parsedParams:k}=c;if(h.kind===2&&h.route&&!cl(u,c))continue;if(h.skipOnParamError){if(!Iy(e,t,c))continue;v=c.rawParams,y=c.extract,k=c.parsedParams}r&&h.route&&h.kind!==Lr&&cl(l,c)&&(l=c);const P=f===o;if(P&&(h.route&&(!s||h.kind===Lr||h.kind===2)&&cl(u,c)&&(u=c),!h.optional&&!h.wildcard&&!h.index&&!h.pathless))continue;const b=P?void 0:t[f];let C;if(P&&h.index){const j={node:h.index,index:f,skipped:p,depth:m+1,statics:x,dynamics:w,optionals:g,extract:y,rawParams:v,parsedParams:k};let T=!0;if(h.index.skipOnParamError&&(Iy(e,t,j)||(T=!1)),T){if(!w&&!g&&!p&&JP(x,o))return j;cl(u,j)&&(u=j)}}if(h.wildcard)for(let j=h.wildcard.length-1;j>=0;j--){const T=h.wildcard[j],{prefix:E,suffix:A}=T;if(!(E&&(P||!(T.caseSensitive?b:C??(C=b.toLowerCase())).startsWith(E)))){if(A){if(P)continue;const M=t.slice(f).join("/").slice(-A.length);if((T.caseSensitive?M:M.toLowerCase())!==A)continue}a.push({node:T,index:o,skipped:p,depth:m+1,statics:x,dynamics:w,optionals:g,extract:y,rawParams:v,parsedParams:k})}}if(h.optional){const j=p|1<<m,T=m+1;for(let E=h.optional.length-1;E>=0;E--){const A=h.optional[E];a.push({node:A,index:f,skipped:j,depth:T,statics:x,dynamics:w,optionals:g,extract:y,rawParams:v,parsedParams:k})}if(!P)for(let E=h.optional.length-1;E>=0;E--){const A=h.optional[E],{prefix:M,suffix:F}=A;if(M||F){const D=A.caseSensitive?b:C??(C=b.toLowerCase());if(M&&!D.startsWith(M)||F&&!D.endsWith(F))continue}a.push({node:A,index:f+1,skipped:p,depth:T,statics:x,dynamics:w,optionals:g+ll(o,f),extract:y,rawParams:v,parsedParams:k})}}if(!P&&h.dynamic&&b)for(let j=h.dynamic.length-1;j>=0;j--){const T=h.dynamic[j],{prefix:E,suffix:A}=T;if(E||A){const M=T.caseSensitive?b:C??(C=b.toLowerCase());if(E&&!M.startsWith(E)||A&&!M.endsWith(A))continue}a.push({node:T,index:f+1,skipped:p,depth:m+1,statics:x,dynamics:w+ll(o,f),optionals:g,extract:y,rawParams:v,parsedParams:k})}if(!P&&h.staticInsensitive){const j=h.staticInsensitive.get(C??(C=b.toLowerCase()));j&&a.push({node:j,index:f+1,skipped:p,depth:m+1,statics:x+ll(o,f),dynamics:w,optionals:g,extract:y,rawParams:v,parsedParams:k})}if(!P&&h.static){const j=h.static.get(b);j&&a.push({node:j,index:f+1,skipped:p,depth:m+1,statics:x+ll(o,f),dynamics:w,optionals:g,extract:y,rawParams:v,parsedParams:k})}if(h.pathless){const j=m+1;for(let T=h.pathless.length-1;T>=0;T--){const E=h.pathless[T];a.push({node:E,index:f,skipped:p,depth:j,statics:x,dynamics:w,optionals:g,extract:y,rawParams:v,parsedParams:k})}}}if(u)return u;if(r&&l){let c=l.index;for(let f=0;f<l.index;f++)c+=t[f].length;const h=c===e.length?"/":e.slice(c);return l.rawParams??(l.rawParams=Object.create(null)),l.rawParams["**"]=decodeURIComponent(h),l}return null}function ll(e,t){return 2**(e-t-1)}function JP(e,t){return e===2**(t-1)-1}function Iy(e,t,n){try{const[r,i]=cb(e,t,n);n.rawParams=r,n.extract=i;const s=n.node.parse(r);return n.parsedParams=Object.assign(Object.create(null),n.parsedParams,s),!0}catch{return null}}function cl(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===Lr)>(e.node.kind===Lr)||t.node.kind===Lr==(e.node.kind===Lr)&&t.depth>e.depth))):!0}function Gl(e){return nm(e.filter(t=>t!==void 0).join("/"))}function nm(e){return e.replace(/\/{2,}/g,"/")}function ub(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Hr(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function db(e){return Hr(ub(e))}function Nc(e,t){return e!=null&&e.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function ZP(e,t,n){return Nc(e,n)===Nc(t,n)}function eE({base:e,to:t,trailingSlash:n="never",cache:r}){const i=t.startsWith("/"),s=!i&&t===".";let o;if(r){o=i?t:s?e:e+"\0"+t;const h=r.get(o);if(h)return h}let a;if(s)a=e.split("/");else if(i)a=t.split("/");else{for(a=e.split("/");a.length>1&&ya(a)==="";)a.pop();const h=t.split("/");for(let f=0,p=h.length;f<p;f++){const m=h[f];m===""?f?f===p-1&&a.push(m):a=[m]:m===".."?a.pop():m==="."||a.push(m)}}a.length>1&&(ya(a)===""?n==="never"&&a.pop():n==="always"&&a.push(""));let l,u="";for(let h=0;h<a.length;h++){h>0&&(u+="/");const f=a[h];if(!f)continue;l=em(f,0,l);const p=l[0];if(p===0){u+=f;continue}const m=l[5],x=f.substring(0,l[1]),w=f.substring(l[4],m),g=f.substring(l[2],l[3]);p===1?u+=x||w?`${x}{$${g}}${w}`:`$${g}`:p===2?u+=x||w?`${x}{$}${w}`:"$":u+=`${x}{-$${g}}${w}`}u=nm(u);const c=u||"/";return o&&r&&r.set(o,c),c}function tE(e){const t=new Map(e.map(i=>[encodeURIComponent(i),i])),n=Array.from(t.keys()).map(i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(n,"g");return i=>i.replace(r,s=>t.get(s)??s)}function Sd(e,t,n){const r=t[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(i=>My(i,n)).join("/"):My(r,n)}function Ay({path:e,params:t,decoder:n,...r}){let i=!1;const s=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:s,isMissingParams:i};if(!e.includes("$"))return{interpolatedPath:e,usedParams:s,isMissingParams:i};const o=e.length;let a=0,l,u="";for(;a<o;){const c=a;l=em(e,c,l);const h=l[5];if(a=h+1,c===h)continue;const f=l[0];if(f===0){u+="/"+e.substring(c,h);continue}if(f===2){const p=t._splat;s._splat=p,s["*"]=p;const m=e.substring(c,l[1]),x=e.substring(l[4],h);if(!p){i=!0,(m||x)&&(u+="/"+m+x);continue}const w=Sd("_splat",t,n);u+="/"+m+w+x;continue}if(f===1){const p=e.substring(l[2],l[3]);!i&&!(p in t)&&(i=!0),s[p]=t[p];const m=e.substring(c,l[1]),x=e.substring(l[4],h),w=Sd(p,t,n)??"undefined";u+="/"+m+w+x;continue}if(f===3){const p=e.substring(l[2],l[3]),m=t[p];if(m==null)continue;s[p]=m;const x=e.substring(c,l[1]),w=e.substring(l[4],h),g=Sd(p,t,n)??"";u+="/"+x+g+w;continue}}return e.endsWith("/")&&(u+="/"),{usedParams:s,interpolatedPath:u||"/",isMissingParams:i}}function My(e,t){const n=encodeURIComponent(e);return(t==null?void 0:t(n))??n}function dt(e){return(e==null?void 0:e.isNotFound)===!0}function nE(){try{return typeof window<"u"&&typeof window.sessionStorage=="object"?window.sessionStorage:void 0}catch{return}}const rE="tsr-scroll-restoration-v1_3";function iE(){const e=nE();if(!e)return null;let t={};try{const r=JSON.parse(e.getItem("tsr-scroll-restoration-v1_3")||"{}");zs(r)&&(t=r)}catch{}return{get state(){return t},set:r=>{t=Ar(r,t)||t},persist:()=>{try{e.setItem(rE,JSON.stringify(t))}catch{}}}}const Ly=iE(),sE=e=>e.state.__TSR_key||e.href;function oE(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 ul=!1;const xo="window",Dy="data-scroll-restoration-id";function aE(e,t){if(!Ly)return;const n=Ly;if((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!n)return;e.isScrollRestorationSetup=!0,ul=!1;const r=e.options.getScrollRestorationKey||sE,i=new Map;window.history.scrollRestoration="manual";const s=a=>{if(!(ul||!e.isScrollRestoring))if(a.target===document||a.target===window)i.set(xo,{scrollX:window.scrollX||0,scrollY:window.scrollY||0});else{const l=a.target;i.set(l,{scrollX:l.scrollLeft||0,scrollY:l.scrollTop||0})}},o=a=>{var u;if(!e.isScrollRestoring||!a||i.size===0||!n)return;const l=(u=n.state)[a]||(u[a]={});for(const[c,h]of i){let f;if(c===xo)f=xo;else if(c.isConnected){const p=c.getAttribute(Dy);f=p?`[${Dy}="${p}"]`:oE(c)}f&&(l[f]=h)}};document.addEventListener("scroll",s,!0),e.subscribe("onBeforeLoad",a=>{o(a.fromLocation?r(a.fromLocation):void 0),i.clear()}),window.addEventListener("pagehide",()=>{o(r(e.stores.resolvedLocation.get()??e.stores.location.get())),n.persist()}),e.subscribe("onRendered",a=>{var h;const l=r(a.toLocation),u=e.options.scrollRestorationBehavior,c=e.options.scrollToTopSelectors;if(i.clear(),!e.resetNextScroll){e.resetNextScroll=!0;return}if(!(typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))){ul=!0;try{const f=e.isScrollRestoring?n.state[l]:void 0;let p=!1;if(f)for(const m in f){const x=f[m];if(!zs(x))continue;const{scrollX:w,scrollY:g}=x;if(!(!Number.isFinite(w)||!Number.isFinite(g))){if(m===xo)window.scrollTo({top:g,left:w,behavior:u}),p=!0;else if(m){let y;try{y=document.querySelector(m)}catch{continue}y&&(y.scrollLeft=w,y.scrollTop=g,p=!0)}}}if(!p){const m=e.history.location.hash.slice(1);if(m){const x=((h=window.history.state)==null?void 0:h.__hashScrollIntoViewOptions)??!0;if(x){const w=document.getElementById(m);w&&w.scrollIntoView(x)}}else{const x={top:0,left:0,behavior:u};if(window.scrollTo(x),c)for(const w of c){if(w===xo)continue;const g=typeof w=="function"?w():document.querySelector(w);g&&g.scrollTo(x)}}}}finally{ul=!1}e.isScrollRestoring&&n.set(f=>(f[l]||(f[l]={}),f))}})}function lE(e,t=String){const n=new URLSearchParams;for(const r in e){const i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function _d(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function cE(e){const t=new URLSearchParams(e),n=Object.create(null);for(const[r,i]of t.entries()){const s=n[r];s==null?n[r]=_d(i):Array.isArray(s)?s.push(_d(i)):n[r]=[s,_d(i)]}return n}const uE=hE(JSON.parse),dE=fE(JSON.stringify,JSON.parse);function hE(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=cE(t);for(const r in n){const i=n[r];if(typeof i=="string")try{n[r]=e(i)}catch{}}return n}}function fE(e,t){const n=typeof t=="function";function r(i){if(typeof i=="object"&&i!==null)try{return e(i)}catch{}else if(n&&typeof i=="string")try{return t(i),e(i)}catch{}return i}return i=>{const s=lE(i,r);return s?`?${s}`:""}}const Pi="__root__";function pE(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 Ct(e){return e instanceof Response&&!!e.options}function mE(e){return{input:({url:t})=>{for(const n of e)t=hf(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=hb(e[n],t);return t}}}function gE(e){const t=db(e.basepath),n=`/${t}`,r=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),s=e.caseSensitive?r:r.toLowerCase();return{input:({url:o})=>{const a=e.caseSensitive?o.pathname:o.pathname.toLowerCase();return a===i?o.pathname="/":a.startsWith(s)&&(o.pathname=o.pathname.slice(n.length)),o},output:({url:o})=>(o.pathname=Gl(["/",t,o.pathname]),o)}}function hf(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 hb(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 yE(e,t){const{createMutableStore:n,createReadonlyStore:r,batch:i,init:s}=t,o=new Map,a=new Map,l=new Map,u=n(e.status),c=n(e.loadedAt),h=n(e.isLoading),f=n(e.isTransitioning),p=n(e.location),m=n(e.resolvedLocation),x=n(e.statusCode),w=n(e.redirect),g=n([]),y=n([]),v=n([]),k=r(()=>Cd(o,g.get())),P=r(()=>Cd(a,y.get())),b=r(()=>Cd(l,v.get())),C=r(()=>g.get()[0]),j=r(()=>g.get().some(U=>{var z;return((z=o.get(U))==null?void 0:z.get().status)==="pending"})),T=r(()=>{var U;return{locationHref:p.get().href,resolvedLocationHref:(U=m.get())==null?void 0:U.href,status:u.get()}}),E=r(()=>({status:u.get(),loadedAt:c.get(),isLoading:h.get(),isTransitioning:f.get(),matches:k.get(),location:p.get(),resolvedLocation:m.get(),statusCode:x.get(),redirect:w.get()})),A=va(64);function M(U){let z=A.get(U);return z||(z=r(()=>{const V=g.get();for(const _ of V){const B=o.get(_);if(B&&B.routeId===U)return B.get()}}),A.set(U,z)),z}const F={status:u,loadedAt:c,isLoading:h,isTransitioning:f,location:p,resolvedLocation:m,statusCode:x,redirect:w,matchesId:g,pendingIds:y,cachedIds:v,matches:k,pendingMatches:P,cachedMatches:b,firstId:C,hasPending:j,matchRouteDeps:T,matchStores:o,pendingMatchStores:a,cachedMatchStores:l,__store:E,getRouteMatchStore:M,setMatches:D,setPending:L,setCached:$};D(e.matches),s==null||s(F);function D(U){jd(U,o,g,n,i)}function L(U){jd(U,a,y,n,i)}function $(U){jd(U,l,v,n,i)}return F}function Cd(e,t){const n=[];for(const r of t){const i=e.get(r);i&&n.push(i.get())}return n}function jd(e,t,n,r,i){const s=e.map(a=>a.id),o=new Set(s);i(()=>{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 u=r(a);u.routeId=a.routeId,t.set(a.id,u);continue}l.routeId=a.routeId,l.get()!==a&&l.set(a)}BP(n.get(),s)||n.set(s)})}const ff=e=>{var t;if(!e.rendered)return e.rendered=!0,(t=e.onReady)==null?void 0:t.call(e)},xE=e=>e.stores.matchesId.get().some(t=>{var n;return(n=e.stores.matchStores.get(t))==null?void 0:n.get()._forcePending}),Cu=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),Ei=(e,t,n=!0)=>{const r={...e.router.options.context??{}},i=n?t:t-1;for(let s=0;s<=i;s++){const o=e.matches[s];if(!o)continue;const a=e.router.getMatch(o.id);a&&Object.assign(r,a.__routeContext,a.__beforeLoadContext)}return r},Ny=(e,t)=>{if(!e.matches.length)return;const n=t.routeId,r=e.matches.findIndex(o=>o.routeId===e.router.routeTree.id),i=r>=0?r:0;let s=n?e.matches.findIndex(o=>o.routeId===n):e.firstBadMatchIndex??e.matches.length-1;s<0&&(s=i);for(let o=s;o>=0;o--){const a=e.matches[o];if(e.router.looseRoutesById[a.routeId].options.notFoundComponent)return o}return n?s:i},Dr=(e,t,n)=>{var r,i,s;if(!(!Ct(n)&&!dt(n)))throw Ct(n)&&n.redirectHandled&&!n.options.reloadDocument||(t&&((r=t._nonReactive.beforeLoadPromise)==null||r.resolve(),(i=t._nonReactive.loaderPromise)==null||i.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,o=>({...o,status:Ct(n)?"redirected":dt(n)?"notFound":o.status==="pending"?"success":o.status,context:Ei(e,t.index),isFetching:!1,error:n})),dt(n)&&!n.routeId&&(n.routeId=t.routeId),(s=t._nonReactive.loadPromise)==null||s.resolve()),Ct(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},fb=(e,t)=>{const n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},zy=(e,t,n)=>{const r=Ei(e,n);e.updateMatch(t,i=>({...i,context:r}))},vo=(e,t,n,r)=>{var a,l;const{id:i,routeId:s}=e.matches[t],o=e.router.looseRoutesById[s];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??(e.firstBadMatchIndex=t),Dr(e,e.router.getMatch(i),n);try{(l=(a=o.options).onError)==null||l.call(a,n)}catch(u){n=u,Dr(e,e.router.getMatch(i),n)}e.updateMatch(i,u=>{var c,h;return(c=u._nonReactive.beforeLoadPromise)==null||c.resolve(),u._nonReactive.beforeLoadPromise=void 0,(h=u._nonReactive.loadPromise)==null||h.resolve(),{...u,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}}),!e.preload&&!Ct(n)&&!dt(n)&&(e.serialError??(e.serialError=n))},pb=(e,t,n,r)=>{var s;if(r._nonReactive.pendingTimeout!==void 0)return;const i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Cu(e,t)&&(n.options.loader||n.options.beforeLoad||gb(n))&&typeof i=="number"&&i!==1/0&&(n.options.pendingComponent??((s=e.router.options)==null?void 0:s.defaultPendingComponent))){const o=setTimeout(()=>{ff(e)},i);r._nonReactive.pendingTimeout=o}},vE=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;pb(e,t,n,r);const i=()=>{const s=e.router.getMatch(t);s.preload&&(s.status==="redirected"||s.status==="notFound")&&Dr(e,s,s.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},wE=(e,t,n,r)=>{const i=e.router.getMatch(t);let s=i._nonReactive.loadPromise;i._nonReactive.loadPromise=Os(()=>{s==null||s.resolve(),s=void 0});const{paramsError:o,searchError:a}=i;o&&vo(e,n,o,"PARSE_PARAMS"),a&&vo(e,n,a,"VALIDATE_SEARCH"),pb(e,t,r,i);const l=new AbortController;let u=!1;const c=()=>{u||(u=!0,e.updateMatch(t,k=>({...k,isFetching:"beforeLoad",fetchCount:k.fetchCount+1,abortController:l})))},h=()=>{var k;(k=i._nonReactive.beforeLoadPromise)==null||k.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,P=>({...P,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{c(),h()});return}i._nonReactive.beforeLoadPromise=Os();const f={...Ei(e,n,!1),...i.__routeContext},{search:p,params:m,cause:x}=i,w=Cu(e,t),g={search:p,abortController:l,params:m,preload:w,context:f,location:e.location,navigate:k=>e.router.navigate({...k,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:w?"preload":x,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},y=k=>{if(k===void 0){e.router.batch(()=>{c(),h()});return}(Ct(k)||dt(k))&&(c(),vo(e,n,k,"BEFORE_LOAD")),e.router.batch(()=>{c(),e.updateMatch(t,P=>({...P,__beforeLoadContext:k})),h()})};let v;try{if(v=r.options.beforeLoad(g),xa(v))return c(),v.catch(k=>{vo(e,n,k,"BEFORE_LOAD")}).then(y)}catch(k){c(),vo(e,n,k,"BEFORE_LOAD")}y(v)},bE=(e,t)=>{const{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],s=()=>a(),o=()=>wE(e,n,t,i),a=()=>{if(fb(e,n))return;const l=vE(e,n,i);return xa(l)?l.then(o):o()};return s()},kE=(e,t,n)=>{var s,o,a,l,u,c;const r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([(o=(s=n.options).head)==null?void 0:o.call(s,i),(l=(a=n.options).scripts)==null?void 0:l.call(a,i),(c=(u=n.options).headers)==null?void 0:c.call(u,i)]).then(([h,f,p])=>({meta:h==null?void 0:h.meta,links:h==null?void 0:h.links,headScripts:h==null?void 0:h.scripts,headers:p,scripts:f,styles:h==null?void 0:h.styles}))},mb=(e,t,n,r,i)=>{const s=t[r-1],{params:o,loaderDeps:a,abortController:l,cause:u}=e.router.getMatch(n),c=Ei(e,r),h=Cu(e,n);return{params:o,deps:a,preload:!!h,parentMatchPromise:s,abortController:l,context:c,location:e.location,navigate:f=>e.router.navigate({...f,_fromLocation:e.location}),cause:h?"preload":u,route:i,...e.router.options.additionalContext}},Oy=async(e,t,n,r,i)=>{var s,o,a,l,u;try{const c=e.router.getMatch(n);try{(!(ab??e.router.isServer)||c.ssr===!0)&&wa(i);const h=i.options.loader,f=typeof h=="function"?h:h==null?void 0:h.handler,p=f==null?void 0:f(mb(e,t,n,r,i)),m=!!f&&xa(p);if((m||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||c._nonReactive.minPendingPromise)&&e.updateMatch(n,w=>({...w,isFetching:"loader"})),f){const w=m?await p:p;Dr(e,e.router.getMatch(n),w),w!==void 0&&e.updateMatch(n,g=>({...g,loaderData:w}))}i._lazyPromise&&await i._lazyPromise;const x=c._nonReactive.minPendingPromise;x&&await x,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,w=>({...w,error:void 0,context:Ei(e,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(h){let f=h;if((f==null?void 0:f.name)==="AbortError"){if(c.abortController.signal.aborted){(s=c._nonReactive.loaderPromise)==null||s.resolve(),c._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,m=>({...m,status:m.status==="pending"?"success":m.status,isFetching:!1,context:Ei(e,r)}));return}const p=c._nonReactive.minPendingPromise;p&&await p,dt(h)&&await((a=(o=i.options.notFoundComponent)==null?void 0:o.preload)==null?void 0:a.call(o)),Dr(e,e.router.getMatch(n),h);try{(u=(l=i.options).onError)==null||u.call(l,h)}catch(m){f=m,Dr(e,e.router.getMatch(n),m)}!Ct(f)&&!dt(f)&&await wa(i,["errorComponent"]),e.updateMatch(n,m=>({...m,error:f,context:Ei(e,r),status:"error",isFetching:!1}))}}catch(c){const h=e.router.getMatch(n);h&&(h._nonReactive.loaderPromise=void 0),Dr(e,h,c)}},SE=async(e,t,n)=>{var p,m,x,w;async function r(g,y,v,k,P){const b=Date.now()-y.updatedAt,C=g?P.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:P.options.staleTime??e.router.options.defaultStaleTime??0,j=P.options.shouldReload,T=typeof j=="function"?j(mb(e,t,i,n,P)):j,{status:E,invalid:A}=k,M=b>=C&&(!!e.forceStaleReload||k.cause==="enter"||v!==void 0&&v!==k.id);o=E==="success"&&(A||(T??M)),g&&P.options.preload===!1||(o&&!e.sync&&c?(a=!0,(async()=>{var F,D;try{await Oy(e,t,i,n,P);const L=e.router.getMatch(i);(F=L._nonReactive.loaderPromise)==null||F.resolve(),(D=L._nonReactive.loadPromise)==null||D.resolve(),L._nonReactive.loaderPromise=void 0,L._nonReactive.loadPromise=void 0}catch(L){Ct(L)&&await e.router.navigate(L.options)}})()):E!=="success"||o?await Oy(e,t,i,n,P):zy(e,i,n))}const{id:i,routeId:s}=e.matches[n];let o=!1,a=!1;const l=e.router.looseRoutesById[s],u=l.options.loader,c=((typeof u=="function"||u==null?void 0:u.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(fb(e,i)){if(!e.router.getMatch(i))return e.matches[n];zy(e,i,n)}else{const g=e.router.getMatch(i),y=e.router.stores.matchesId.get()[n],v=((p=y&&e.router.stores.matchStores.get(y)||null)==null?void 0:p.routeId)===s?y:(m=e.router.stores.matches.get().find(P=>P.routeId===s))==null?void 0:m.id,k=Cu(e,i);if(g._nonReactive.loaderPromise){if(g.status==="success"&&!e.sync&&!g.preload&&c)return g;await g._nonReactive.loaderPromise;const P=e.router.getMatch(i),b=P._nonReactive.error||P.error;b&&Dr(e,P,b),P.status==="pending"&&await r(k,g,v,P,l)}else{const P=k&&!e.router.stores.matchStores.has(i),b=e.router.getMatch(i);b._nonReactive.loaderPromise=Os(),P!==b.preload&&e.updateMatch(i,C=>({...C,preload:P})),await r(k,g,v,b,l)}}const h=e.router.getMatch(i);a||((x=h._nonReactive.loaderPromise)==null||x.resolve(),(w=h._nonReactive.loadPromise)==null||w.resolve(),h._nonReactive.loadPromise=void 0),clearTimeout(h._nonReactive.pendingTimeout),h._nonReactive.pendingTimeout=void 0,a||(h._nonReactive.loaderPromise=void 0),h._nonReactive.dehydrated=void 0;const f=a?h.isFetching:!1;return f!==h.isFetching||h.invalid!==!1?(e.updateMatch(i,g=>({...g,isFetching:f,invalid:!1})),e.router.getMatch(i)):h};async function Fy(e){var f,p;const t=e,n=[];xE(t.router)&&ff(t);let r;for(let m=0;m<t.matches.length;m++){try{const x=bE(t,m);xa(x)&&await x}catch(x){if(Ct(x))throw x;if(dt(x))r=x;else if(!t.preload)throw x;break}if(t.serialError||t.firstBadMatchIndex!=null)break}const i=t.firstBadMatchIndex??t.matches.length,s=r&&!t.preload?Ny(t,r):void 0,o=r&&t.preload?0:s!==void 0?Math.min(s+1,i):i;let a,l;for(let m=0;m<o;m++)n.push(SE(t,n,m));try{await Promise.all(n)}catch{const m=await Promise.allSettled(n);for(const x of m){if(x.status!=="rejected")continue;const w=x.reason;if(Ct(w))throw w;dt(w)?a??(a=w):l??(l=w)}if(l!==void 0)throw l}const u=a??(r&&!t.preload?r:void 0);let c=t.firstBadMatchIndex!==void 0?t.firstBadMatchIndex:t.matches.length-1;if(!u&&r&&t.preload)return t.matches;if(u){const m=Ny(t,u);m===void 0&&ir();const x=t.matches[m],w=t.router.looseRoutesById[x.routeId],g=(f=t.router.options)==null?void 0:f.defaultNotFoundComponent;!w.options.notFoundComponent&&g&&(w.options.notFoundComponent=g),u.routeId=x.routeId;const y=x.routeId===t.router.routeTree.id;t.updateMatch(x.id,v=>({...v,...y?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:u},isFetching:!1})),c=m,await wa(w,["notFoundComponent"])}else if(!t.preload){const m=t.matches[0];m.globalNotFound||(p=t.router.getMatch(m.id))!=null&&p.globalNotFound&&t.updateMatch(m.id,x=>({...x,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const m=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await wa(m,["errorComponent"])}for(let m=0;m<=c;m++){const{id:x,routeId:w}=t.matches[m],g=t.router.looseRoutesById[w];try{const y=kE(t,x,g);if(y){const v=await y;t.updateMatch(x,k=>({...k,...v}))}}catch(y){console.error(`Error executing head for route ${w}:`,y)}}const h=ff(t);if(xa(h)&&await h,u)throw u;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function $y(e,t){const n=t.map(r=>{var i,s;return(s=(i=e.options[r])==null?void 0:i.preload)==null?void 0:s.call(i)}).filter(Boolean);if(n.length!==0)return Promise.all(n)}function wa(e,t=Kl){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(r=>{const{id:i,...s}=r.options;Object.assign(e.options,s),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);const n=()=>e._componentsLoaded?void 0:t===Kl?(()=>{if(e._componentsPromise===void 0){const r=$y(e,Kl);r?e._componentsPromise=r.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():$y(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function gb(e){var t;for(const n of Kl)if((t=e.options[n])!=null&&t.preload)return!0;return!1}const Kl=["component","errorComponent","pendingComponent","notFoundComponent"];var Gr="__TSR_index",By="popstate",Vy="beforeunload";function _E(e){let t=e.getLocation();const n=new Set,r=o=>{t=e.getLocation(),n.forEach(a=>a({location:t,action:o}))},i=o=>{e.notifyOnIndexChange??!0?r(o):t=e.getLocation()},s=async({task:o,navigateOpts:a,...l})=>{var h,f;if((a==null?void 0:a.ignoreBlocker)??!1){o();return}const u=((h=e.getBlockers)==null?void 0:h.call(e))??[],c=l.type==="PUSH"||l.type==="REPLACE";if(typeof document<"u"&&u.length&&c)for(const p of u){const m=zc(l.path,l.state);if(await p.blockerFn({currentLocation:t,nextLocation:m,action:l.type})){(f=e.onBlocked)==null||f.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 u=t.state[Gr];a=Wy(u+1,a),s({task:()=>{e.pushState(o,a),r({type:"PUSH"})},navigateOpts:l,type:"PUSH",path:o,state:a})},replace:(o,a,l)=>{const u=t.state[Gr];a=Wy(u,a),s({task:()=>{e.replaceState(o,a),r({type:"REPLACE"})},navigateOpts:l,type:"REPLACE",path:o,state:a})},go:(o,a)=>{s({task:()=>{e.go(o),i({type:"GO",index:o})},navigateOpts:a,type:"GO"})},back:o=>{s({task:()=>{e.back((o==null?void 0:o.ignoreBlocker)??!1),i({type:"BACK"})},navigateOpts:o,type:"BACK"})},forward:o=>{s({task:()=>{e.forward((o==null?void 0:o.ignoreBlocker)??!1),i({type:"FORWARD"})},navigateOpts:o,type:"FORWARD"})},canGoBack:()=>t.state[Gr]!==0,createHref:o=>e.createHref(o),block:o=>{var l;if(!e.setBlockers)return()=>{};const a=((l=e.getBlockers)==null?void 0:l.call(e))??[];return e.setBlockers([...a,o]),()=>{var c,h;const u=((c=e.getBlockers)==null?void 0:c.call(e))??[];(h=e.setBlockers)==null||h.call(e,u.filter(f=>f!==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 Wy(e,t){t||(t={});const n=rm();return{...t,key:n,__TSR_key:n,[Gr]:e}}function CE(e){var j,T;const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let i=[];const s=()=>i,o=E=>i=E,a=E=>E,l=()=>zc(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state);if(!((j=t.history.state)!=null&&j.__TSR_key)&&!((T=t.history.state)!=null&&T.key)){const E=rm();t.history.replaceState({[Gr]:0,key:E,__TSR_key:E},"")}let u=l(),c,h=!1,f=!1,p=!1,m=!1;const x=()=>u;let w,g;const y=()=>{w&&(C._ignoreSubscribers=!0,(w.isPush?t.history.pushState:t.history.replaceState)(w.state,"",w.href),C._ignoreSubscribers=!1,w=void 0,g=void 0,c=void 0)},v=(E,A,M)=>{const F=a(A);g||(c=u),u=zc(A,M),w={href:F,state:M,isPush:(w==null?void 0:w.isPush)||E==="push"},g||(g=Promise.resolve().then(()=>y()))},k=E=>{u=l(),C.notify({type:E})},P=async()=>{if(f){f=!1;return}const E=l(),A=E.state[Gr]-u.state[Gr],M=A===1,F=A===-1,D=!M&&!F||h;h=!1;const L=D?"GO":F?"BACK":"FORWARD",$=D?{type:"GO",index:A}:{type:F?"BACK":"FORWARD"};if(p)p=!1;else{const U=s();if(typeof document<"u"&&U.length){for(const z of U)if(await z.blockerFn({currentLocation:u,nextLocation:E,action:L})){f=!0,t.history.go(1),C.notify($);return}}}u=l(),C.notify($)},b=E=>{if(m){m=!1;return}let A=!1;const M=s();if(typeof document<"u"&&M.length)for(const F of M){const D=F.enableBeforeUnload??!0;if(D===!0){A=!0;break}if(typeof D=="function"&&D()===!0){A=!0;break}}if(A)return E.preventDefault(),E.returnValue=""},C=_E({getLocation:x,getLength:()=>t.history.length,pushState:(E,A)=>v("push",E,A),replaceState:(E,A)=>v("replace",E,A),back:E=>(E&&(p=!0),m=!0,t.history.back()),forward:E=>{E&&(p=!0),m=!0,t.history.forward()},go:E=>{h=!0,t.history.go(E)},createHref:E=>a(E),flush:y,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(Vy,b,{capture:!0}),t.removeEventListener(By,P)},onBlocked:()=>{c&&u!==c&&(u=c)},getBlockers:s,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(Vy,b,{capture:!0}),t.addEventListener(By,P),t.history.pushState=function(...E){const A=n.apply(t.history,E);return C._ignoreSubscribers||k("PUSH"),A},t.history.replaceState=function(...E){const A=r.apply(t.history,E);return C._ignoreSubscribers||k("REPLACE"),A},C}function jE(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function zc(e,t){const n=jE(e),r=n.indexOf("#"),i=n.indexOf("?"),s=rm();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):"",search:i>-1?n.slice(i,r===-1?void 0:r):"",state:t||{[Gr]:0,key:s,__TSR_key:s}}}function rm(){return(Math.random()+1).toString(36).substring(7)}function js(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 PE=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 c;const r=this.options,i=this.basepath??(r==null?void 0:r.basepath)??"/",s=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=tE(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=CE()),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 h;this.resolvePathCache=va(1e3),h=this.buildRouteTree(),this.setRoutes(h)}if(!this.stores&&this.latestLocation){const h=this.getStoreConfig(this);this.batch=h.batch,this.stores=yE(TE(this.latestLocation),h),aE(this)}let a=!1;const l=this.options.basepath??"/",u=this.options.rewrite;if(s||i!==l||o!==u){this.basepath=l;const h=[],f=db(l);f&&f!=="/"&&h.push(gE({basepath:l})),u&&h.push(u),this.rewrite=h.length===0?void 0:h.length===1?h[0]:mE(h),this.history&&this.updateLatestLocation(),a=!0}a&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<"u"&&"CSS"in window&&typeof((c=window.CSS)==null?void 0:c.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=YP(this.routeTree,this.options.caseSensitive,(r,i)=>{r.init({originalIndex:i})});return this.options.routeMasks&&WP(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,r)=>{const i={eventType:n,fn:r};return this.subscribers.add(i),()=>{this.subscribers.delete(i)}},this.emit=n=>{this.subscribers.forEach(r=>{r.eventType===n.type&&r.fn(n)})},this.parseLocation=(n,r)=>{const i=({pathname:l,search:u,hash:c,href:h,state:f})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(l)){const g=this.options.parseSearch(u),y=this.options.stringifySearch(g);return{href:l+y+c,publicHref:l+y+c,pathname:yo(l).path,external:!1,searchStr:y,search:si(r==null?void 0:r.search,g),hash:yo(c.slice(1)).path,state:Mr(r==null?void 0:r.state,f)}}const p=new URL(h,this.origin),m=hf(this.rewrite,p),x=this.options.parseSearch(m.search),w=this.options.stringifySearch(x);return m.search=w,{href:m.href.replace(m.origin,""),publicHref:h,pathname:yo(m.pathname).path,external:!!this.rewrite&&m.origin!==this.origin,searchStr:w,search:si(r==null?void 0:r.search,x),hash:yo(m.hash.slice(1)).path,state:Mr(r==null?void 0:r.state,f)}},s=i(n),{__tempLocation:o,__tempKey:a}=s.state;if(o&&(!a||a===this.tempLocationKey)){const l=i(o);return l.state.key=s.state.key,l.state.__TSR_key=s.state.__TSR_key,delete l.state.__tempLocation,{...l,maskedLocation:s}}return s},this.resolvePathWithBase=(n,r)=>eE({base:n,to:nm(r),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,r,i)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:r},i):this.matchRoutesInternal(n,r),this.getMatchedRoutes=n=>RE({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 i;if(this.stores.pendingMatchStores.has(n))return;const r=(i=this.stores.matchStores.get(n))==null?void 0:i.get();r&&(r.status==="pending"||r.isFetching==="loader")&&this.cancelMatch(n)})},this.buildLocation=n=>{const r=(s={})=>{var E,A;const o=s._fromLocation||this.pendingBuiltLocation||this.latestLocation,a=this.matchRoutesLightweight(o);s.from;const l=s.unsafeRelative==="path"?o.pathname:s.from??a.fullPath,u=this.resolvePathWithBase(l,"."),c=a.search,h=Object.assign(Object.create(null),a.params),f=s.to?this.resolvePathWithBase(u,`${s.to}`):this.resolvePathWithBase(u,"."),p=s.params===!1||s.params===null?Object.create(null):(s.params??!0)===!0?h:Object.assign(h,Ar(s.params,h)),m=this.getMatchedRoutes(f);let x=m.matchedRoutes;if((!m.foundRoute||m.foundRoute.path!=="/"&&m.routeParams["**"])&&this.options.notFoundRoute&&(x=[...x,this.options.notFoundRoute]),Object.keys(p).length>0)for(const M of x){const F=((E=M.options.params)==null?void 0:E.stringify)??M.options.stringifyParams;if(F)try{Object.assign(p,F(p))}catch{}}const w=n.leaveParams?f:yo(Ay({path:f,params:p,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let g=c;if(n._includeValidateSearch&&((A=this.options.search)!=null&&A.strict)){const M={};x.forEach(F=>{if(F.options.validateSearch)try{Object.assign(M,Yl(F.options.validateSearch,{...M,...g}))}catch{}}),g=M}g=IE({search:g,dest:s,destRoutes:x,_includeValidateSearch:n._includeValidateSearch}),g=si(c,g);const y=this.options.stringifySearch(g),v=s.hash===!0?o.hash:s.hash?Ar(s.hash,o.hash):void 0,k=v?`#${v}`:"";let P=s.state===!0?o.state:s.state?Ar(s.state,o.state):{};P=Mr(o.state,P);const b=`${w}${y}${k}`;let C,j,T=!1;if(this.rewrite){const M=new URL(b,this.origin),F=hb(this.rewrite,M);C=M.href.replace(M.origin,""),F.origin!==this.origin?(j=F.href,T=!0):j=F.pathname+F.search+F.hash}else C=$P(b),j=C;return{publicHref:j,href:C,pathname:w,search:g,searchStr:y,state:P,hash:v??"",external:T,unmaskOnReload:s.unmaskOnReload}},i=(s={},o)=>{const a=r(s);let l=o?r(o):void 0;if(!l){const u=Object.create(null);if(this.options.routeMasks){const c=UP(a.pathname,this.processedTree);if(c){Object.assign(u,c.rawParams);const{from:h,params:f,...p}=c.route,m=f===!1||f===null?Object.create(null):(f??!0)===!0?u:Object.assign(u,Ar(f,u));o={from:n.from,...p,params:m},l=r(o)}}}return l&&(a.maskedLocation=l),a};return n.mask?i(n,{from:n.from,...n.mask}):i(n)},this.commitLocation=async({viewTransition:n,ignoreBlocker:r,...i})=>{const s=()=>{const l=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];l.forEach(c=>{i.state[c]=this.latestLocation.state[c]});const u=ji(i.state,this.latestLocation.state);return l.forEach(c=>{delete i.state[c]}),u},o=Hr(this.latestLocation.href)===Hr(i.href);let a=this.commitLocationPromise;if(this.commitLocationPromise=Os(()=>{a==null||a.resolve(),a=void 0}),o&&s())this.load();else{let{maskedLocation:l,hashScrollIntoView:u,...c}=i;l&&(c={...l,state:{...l.state,__tempKey:void 0,__tempLocation:{...c,search:c.searchStr,state:{...c.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(c.unmaskOnReload??this.options.unmaskOnReload??!1)&&(c.state.__tempKey=this.tempLocationKey)),c.state.__hashScrollIntoViewOptions=u??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[i.replace?"replace":"push"](c.publicHref,c.state,{ignoreBlocker:r})}return this.resetNextScroll=i.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:r,hashScrollIntoView:i,viewTransition:s,ignoreBlocker:o,href:a,...l}={})=>{if(a){const h=this.history.location.state.__TSR_index,f=zc(a,{__TSR_index:n?h:h+1}),p=new URL(f.pathname,this.origin);l.to=hf(this.rewrite,p).pathname,l.search=this.options.parseSearch(f.search),l.hash=f.hash.slice(1)}const u=this.buildLocation({...l,_includeValidateSearch:!0});this.pendingBuiltLocation=u;const c=this.commitLocation({...u,viewTransition:s,replace:n,resetScroll:r,hashScrollIntoView:i,ignoreBlocker:o});return Promise.resolve().then(()=>{this.pendingBuiltLocation===u&&(this.pendingBuiltLocation=void 0)}),c},this.navigate=async({to:n,reloadDocument:r,href:i,publicHref:s,...o})=>{var l,u;let a=!1;if(i)try{new URL(`${i}`),a=!0}catch{}if(a&&!r&&(r=!0),r){if(n!==void 0||!i){const h=this.buildLocation({to:n,...o});i=i??h.publicHref,s=s??h.publicHref}const c=!a&&s?s:i;if(Dc(c,this.protocolAllowlist))return Promise.resolve();if(!o.ignoreBlocker){const h=((u=(l=this.history).getBlockers)==null?void 0:u.call(l))??[];for(const f of h)if(f!=null&&f.blockerFn&&await f.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return o.replace?window.location.replace(c):window.location.href=c,Promise.resolve()}return this.buildAndCommitLocation({...o,href:i,to:n,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const n=this.matchRoutes(this.latestLocation),r=this.stores.cachedMatches.get().filter(i=>!n.some(s=>s.id===i.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,i,s;const o=this.stores.resolvedLocation.get()??this.stores.location.get();for(s=new Promise(l=>{this.startTransition(async()=>{var u;try{this.beforeLoad();const c=this.latestLocation,h=js(c,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:"onBeforeNavigate",...h}),this.emit({type:"onBeforeLoad",...h}),await Fy({router:this,sync:n==null?void 0:n.sync,forceStaleReload:o.href===c.href,matches:this.stores.pendingMatches.get(),location:c,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{var w,g;let f=null,p=null,m=null,x=null;this.batch(()=>{const y=this.stores.pendingMatches.get(),v=y.length,k=this.stores.matches.get();f=v?k.filter(C=>!this.stores.pendingMatchStores.has(C.id)):null;const P=new Set;for(const C of this.stores.pendingMatchStores.values())C.routeId&&P.add(C.routeId);const b=new Set;for(const C of this.stores.matchStores.values())C.routeId&&b.add(C.routeId);p=v?k.filter(C=>!P.has(C.routeId)):null,m=v?y.filter(C=>!b.has(C.routeId)):null,x=v?y.filter(C=>b.has(C.routeId)):k,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),v&&(this.stores.setMatches(y),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...f.filter(C=>C.status!=="error"&&C.status!=="notFound"&&C.status!=="redirected")]),this.clearExpiredCache())});for(const[y,v]of[[p,"onLeave"],[m,"onEnter"],[x,"onStay"]])if(y)for(const k of y)(g=(w=this.looseRoutesById[k.routeId].options)[v])==null||g.call(w,k)})})}})}catch(c){Ct(c)?(r=c,this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):dt(c)&&(i=c);const h=r?r.status:i?404:this.stores.matches.get().some(f=>f.status==="error")?500:200;this.batch(()=>{this.stores.statusCode.set(h),this.stores.redirect.set(r)})}this.latestLoadPromise===s&&((u=this.commitLocationPromise)==null||u.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),l()})}),this.latestLoadPromise=s,await s;this.latestLoadPromise&&s!==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 i;if(typeof r=="object"&&this.isViewTransitionTypesSupported){const s=this.latestLocation,o=this.stores.resolvedLocation.get(),a=typeof r.types=="function"?r.types(js(s,o)):r.types;if(a===!1){n();return}i={update:n,types:a}}else i=n;document.startViewTransition(i)}else n()},this.updateMatch=(n,r)=>{this.startTransition(()=>{const i=this.stores.pendingMatchStores.get(n);if(i){i.set(r);return}const s=this.stores.matchStores.get(n);if(s){s.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(u=>u!==n)):o.set(a)}})},this.getMatch=n=>{var r,i,s;return((r=this.stores.cachedMatchStores.get(n))==null?void 0:r.get())??((i=this.stores.pendingMatchStores.get(n))==null?void 0:i.get())??((s=this.stores.matchStores.get(n))==null?void 0:s.get())},this.invalidate=n=>{const r=i=>{var s;return((s=n==null?void 0:n.filter)==null?void 0:s.call(n,i))??!0?{...i,invalid:!0,...n!=null&&n.forcePending||i.status==="error"||i.status==="notFound"?{status:"pending",error:void 0}:void 0}:i};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 i=n.options._builtLocation??this.buildLocation(n.options),s=this.getParsedLocationHref(i);n.options.href=s,n.headers.set("Location",s)}else if(r)try{const i=new URL(r);if(this.origin&&i.origin===this.origin){const s=i.pathname+i.search+i.hash;n.options.href=s,n.headers.set("Location",s)}}catch{}if(n.options.href&&!n.options._builtLocation&&Dc(n.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const r=n==null?void 0:n.filter;r!==void 0?this.stores.setCached(this.stores.cachedMatches.get().filter(i=>!r(i))):this.stores.setCached([])},this.clearExpiredCache=()=>{const n=Date.now(),r=i=>{const s=this.looseRoutesById[i.routeId];if(!s.options.loader)return!0;const o=(i.preload?s.options.preloadGcTime??this.options.defaultPreloadGcTime:s.options.gcTime??this.options.defaultGcTime)??300*1e3;return i.status==="error"?!0:n-i.updatedAt>=o};this.clearCache({filter:r})},this.loadRouteChunk=wa,this.preloadRoute=async n=>{const r=n._builtLocation??this.buildLocation(n);let i=this.matchRoutes(r,{throwOnError:!0,preload:!0,dest:n});const s=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),o=new Set([...s,...this.stores.cachedIds.get()]),a=i.filter(l=>!o.has(l.id));if(a.length){const l=this.stores.cachedMatches.get();this.stores.setCached([...l,...a])}try{return i=await Fy({router:this,matches:i,location:r,preload:!0,updateMatch:(l,u)=>{s.has(l)?i=i.map(c=>c.id===l?u(c):c):this.updateMatch(l,u)}}),i}catch(l){if(Ct(l))return l.options.reloadDocument?void 0:await this.preloadRoute({...l.options,_fromLocation:r});dt(l)||console.error(l);return}},this.matchRoute=(n,r)=>{const i={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},s=this.buildLocation(i);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=HP(s.pathname,(r==null?void 0:r.caseSensitive)??!1,(r==null?void 0:r.fuzzy)??!1,o.pathname,this.processedTree);return!a||n.params&&!ji(a.rawParams,n.params,{partial:!0})?!1:(r==null?void 0:r.includeSearch)??!0?ji(o.search,s.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??dE,parseSearch:e.parseSearch??uE,protocolAllowlist:e.protocolAllowlist??FP}),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 h,f;const n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i,parsedParams:s}=n;let{matchedRoutes:o}=n,a=!1;(r?r.path!=="/"&&i["**"]:Hr(e.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:a=!0);const l=a?ME(this.options.notFoundMode,o):void 0,u=new Array(o.length),c=new Map;for(const p of this.stores.matchStores.values())p.routeId&&c.set(p.routeId,p.get());for(let p=0;p<o.length;p++){const m=o[p],x=u[p-1];let w,g,y;{const L=(x==null?void 0:x.search)??e.search,$=(x==null?void 0:x._strictSearch)??void 0;try{const U=Yl(m.options.validateSearch,{...L})??void 0;w={...L,...U},g={...$,...U},y=void 0}catch(U){let z=U;if(U instanceof Oc||(z=new Oc(U.message,{cause:U})),t!=null&&t.throwOnError)throw z;w=L,g={},y=z}}const v=((f=(h=m.options).loaderDeps)==null?void 0:f.call(h,{search:w}))??"",k=v?JSON.stringify(v):"",{interpolatedPath:P,usedParams:b}=Ay({path:m.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),C=m.id+P+k,j=this.getMatch(C),T=c.get(m.id),E=(j==null?void 0:j._strictParams)??b;let A;if(!j)try{Uy(m,b,s,E)}catch(L){if(dt(L)||Ct(L)?A=L:A=new EE(L.message,{cause:L}),t!=null&&t.throwOnError)throw A}Object.assign(i,E);const M=T?"stay":"enter";let F;if(j)F={...j,cause:M,params:(T==null?void 0:T.params)??i,_strictParams:E,search:si(T?T.search:j.search,w),_strictSearch:g};else{const L=m.options.loader||m.options.beforeLoad||m.lazyFn||gb(m)?"pending":"success";F={id:C,ssr:m.options.ssr,index:p,routeId:m.id,params:(T==null?void 0:T.params)??i,_strictParams:E,pathname:P,updatedAt:Date.now(),search:T?si(T.search,w):w,_strictSearch:g,searchError:void 0,status:L,isFetching:!1,error:void 0,paramsError:A,__routeContext:void 0,_nonReactive:{loadPromise:Os()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:M,loaderDeps:T?Mr(T.loaderDeps,v):v,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:m.options.staticData||{},fullPath:m.fullPath}}t!=null&&t.preload||(F.globalNotFound=l===m.id),F.searchError=y;const D=this.getParentContext(x);F.context={...D,...F.__routeContext,...F.__beforeLoadContext},u[p]=F}for(let p=0;p<u.length;p++){const m=u[p],x=this.looseRoutesById[m.routeId],w=this.getMatch(m.id),g=c.get(m.routeId);if(m.params=g?si(g.params,i):i,!w){const y=u[p-1],v=this.getParentContext(y);if(x.options.context){const k={deps:m.loaderDeps,params:m.params,context:v??{},location:e,navigate:P=>this.navigate({...P,_fromLocation:e}),buildLocation:this.buildLocation,cause:m.cause,abortController:m.abortController,preload:!!m.preload,matches:u,routeId:x.id};m.__routeContext=x.options.context(k)??void 0}m.context={...v,...m.__routeContext,...m.__beforeLoadContext}}}return u}matchRoutesLightweight(e){var c;const{matchedRoutes:t,routeParams:n,parsedParams:r}=this.getMatchedRoutes(e.pathname),i=ya(t),s={...e.search};for(const h of t)try{Object.assign(s,Yl(h.options.validateSearch,s))}catch{}const o=ya(this.stores.matchesId.get()),a=o&&((c=this.stores.matchStores.get(o))==null?void 0:c.get()),l=a&&a.routeId===i.id&&a.pathname===e.pathname;let u;if(l)u=a.params;else{const h=Object.assign(Object.create(null),n);for(const f of t)try{Uy(f,n,r??{},h)}catch{}u=h}return{matchedRoutes:t,fullPath:i.fullPath,search:s,params:u}}},Oc=class extends Error{},EE=class extends Error{};function TE(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function Yl(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Oc("Async validation not supported");if(n.issues)throw new Oc(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 RE({pathname:e,routesById:t,processedTree:n}){const r=Object.create(null),i=Hr(e);let s,o;const a=GP(i,n,!0);return a&&(s=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:s,parsedParams:o}}function IE({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return AE(n)(e,t,r??!1)}function AE(e){var i;const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const s of e){if("search"in s.options)(i=s.options.search)!=null&&i.middlewares&&t.middlewares.push(...s.options.search.middlewares);else if(s.options.preSearchFilters||s.options.postSearchFilters){const o=({search:a,next:l})=>{let u=a;"preSearchFilters"in s.options&&s.options.preSearchFilters&&(u=s.options.preSearchFilters.reduce((h,f)=>f(h),a));const c=l(u);return"postSearchFilters"in s.options&&s.options.postSearchFilters?s.options.postSearchFilters.reduce((h,f)=>f(h),c):c};t.middlewares.push(o)}if(s.options.validateSearch){const o=({search:a,next:l})=>{const u=l(a);if(!t._includeValidateSearch)return u;try{return{...u,...Yl(s.options.validateSearch,u)??void 0}}catch{return u}};t.middlewares.push(o)}}const n=({search:s})=>{const o=t.dest;return o.search?o.search===!0?s:Ar(o.search,s):{}};t.middlewares.push(n);const r=(s,o,a)=>{if(s>=a.length)return o;const l=a[s];return l({search:o,next:c=>r(s+1,c,a)})};return function(o,a,l){return t.dest=a,t._includeValidateSearch=l,r(0,o,t.middlewares)}}function ME(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 Pi}function Uy(e,t,n,r){var s;const i=((s=e.options.params)==null?void 0:s.parse)??e.options.parseParams;if(i)if(e.options.skipRouteOnParseError)for(const o in t)o in n&&(r[o]=n[o]);else{const o=i(r);Object.assign(r,o)}}const LE="Error preloading route! ☝️";var yb=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,u;this.originalIndex=t.originalIndex;const n=this.options,r=!(n!=null&&n.path)&&!(n!=null&&n.id);this.parentRoute=(u=(l=this.options).getParentRoute)==null?void 0:u.call(l),r?this._path=Pi:this.parentRoute||ir();let i=r?Pi:n==null?void 0:n.path;i&&i!=="/"&&(i=ub(i));const s=(n==null?void 0:n.id)||i;let o=r?Pi:Gl([this.parentRoute.id==="__root__"?"":this.parentRoute.id,s]);i==="__root__"&&(i="/"),o!=="__root__"&&(o=Gl(["/",o]));const a=o==="__root__"?"/":Gl([this.parentRoute.fullPath,i]);this._path=i,this._id=o,this._fullPath=a,this._to=Hr(a)},this.addChildren=t=>this._addFileChildren(t),this._addFileChildren=t=>(Array.isArray(t)&&(this.children=t),typeof t=="object"&&t!==null&&(this.children=Object.values(t)),this),this._addFileTypes=()=>this,this.updateLoader=t=>(Object.assign(this.options,t),this),this.update=t=>(Object.assign(this.options,t),this),this.lazy=t=>(this.lazyFn=t,this),this.redirect=t=>pE({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.")}},DE=class extends yb{constructor(e){super(e)}};function NE(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??sm;return d.jsx(zE,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?S.createElement(t,{error:n,reset:r}):e.children})}var zE=class extends S.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 sm({error:e}){const[t,n]=S.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 OE({children:e,fallback:t=null}){return xb()?d.jsx(Ts.Fragment,{children:e}):d.jsx(Ts.Fragment,{children:t})}function xb(){return Ts.useSyncExternalStore(FE,()=>!0,()=>!1)}function FE(){return()=>{}}var vb=S.createContext(null);function Qt(e){return S.useContext(vb)}var ju=S.createContext(void 0),$E=S.createContext(void 0),Ie=(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))(Ie||{});function BE({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:s,checkDirty:o,shallowPropagate:a};function r(u,c,h){const f=c.depsTail;if(f!==void 0&&f.dep===u)return;const p=f!==void 0?f.nextDep:c.deps;if(p!==void 0&&p.dep===u){p.version=h,c.depsTail=p;return}const m=u.subsTail;if(m!==void 0&&m.version===h&&m.sub===c)return;const x=c.depsTail=u.subsTail={version:h,dep:u,sub:c,prevDep:f,nextDep:p,prevSub:m,nextSub:void 0};p!==void 0&&(p.prevDep=x),f!==void 0?f.nextDep=x:c.deps=x,m!==void 0?m.nextSub=x:u.subs=x}function i(u,c=u.sub){const h=u.dep,f=u.prevDep,p=u.nextDep,m=u.nextSub,x=u.prevSub;return p!==void 0?p.prevDep=f:c.depsTail=f,f!==void 0?f.nextDep=p:c.deps=p,m!==void 0?m.prevSub=x:h.subsTail=x,x!==void 0?x.nextSub=m:(h.subs=m)===void 0&&n(h),p}function s(u){let c=u.nextSub,h;e:do{const f=u.sub;let p=f.flags;if(p&60?p&12?p&4?!(p&48)&&l(u,f)?(f.flags=p|40,p&=1):p=0:f.flags=p&-9|32:p=0:f.flags=p|32,p&2&&t(f),p&1){const m=f.subs;if(m!==void 0){const x=(u=m).nextSub;x!==void 0&&(h={value:c,prev:h},c=x);continue}}if((u=c)!==void 0){c=u.nextSub;continue}for(;h!==void 0;)if(u=h.value,h=h.prev,u!==void 0){c=u.nextSub;continue e}break}while(!0)}function o(u,c){let h,f=0,p=!1;e:do{const m=u.dep,x=m.flags;if(c.flags&16)p=!0;else if((x&17)===17){if(e(m)){const w=m.subs;w.nextSub!==void 0&&a(w),p=!0}}else if((x&33)===33){(u.nextSub!==void 0||u.prevSub!==void 0)&&(h={value:u,prev:h}),u=m.deps,c=m,++f;continue}if(!p){const w=u.nextDep;if(w!==void 0){u=w;continue}}for(;f--;){const w=c.subs,g=w.nextSub!==void 0;if(g?(u=h.value,h=h.prev):u=w,p){if(e(c)){g&&a(w),c=u.sub;continue}p=!1}else c.flags&=-33;c=u.sub;const y=u.nextDep;if(y!==void 0){u=y;continue e}}return p}while(!0)}function a(u){do{const c=u.sub,h=c.flags;(h&48)===32&&(c.flags=h|16,(h&6)===2&&t(c))}while((u=u.nextSub)!==void 0)}function l(u,c){let h=c.depsTail;for(;h!==void 0;){if(h===u)return!0;h=h.prevDep}return!1}}function VE(e,t,n){var s,o,a;const r=typeof e=="object",i=r?e:void 0;return{next:(s=r?e.next:e)==null?void 0:s.bind(i),error:(o=r?e.error:t)==null?void 0:o.bind(i),complete:(a=r?e.complete:n)==null?void 0:a.bind(i)}}const pf=[];let Ql=0;const{link:Hy,unlink:WE,propagate:UE,checkDirty:wb,shallowPropagate:Gy}=BE({update(e){return e._update()},notify(e){pf[mf++]=e,e.flags&=~Ie.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=Ie.Mutable|Ie.Dirty,Fc(e))}});let dl=0,mf=0,Nn,gf=0;function bb(e){try{++gf,e()}finally{--gf||kb()}}function Fc(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=WE(n,e)}function kb(){if(!(gf>0)){for(;dl<mf;){const e=pf[dl];pf[dl++]=void 0,e.notify()}dl=0,mf=0}}function Ky(e,t){const n=typeof e=="function",r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?Ie.None:Ie.Mutable,get(){return Nn!==void 0&&Hy(i,Nn,Ql),i._snapshot},subscribe(s){const o=VE(s),a={current:!1},l=HE(()=>{var u;i.get(),a.current?(u=o.next)==null||u.call(o,i._snapshot):a.current=!0});return{unsubscribe:()=>{l.stop()}}},_update(s){const o=Nn,a=(t==null?void 0:t.compare)??Object.is;if(n)Nn=i,++Ql,i.depsTail=void 0;else if(s===void 0)return!1;n&&(i.flags=Ie.Mutable|Ie.RecursedCheck);try{const l=i._snapshot,u=typeof s=="function"?s(l):s===void 0&&n?r(l):s;return l===void 0||!a(l,u)?(i._snapshot=u,!0):!1}finally{Nn=o,n&&(i.flags&=~Ie.RecursedCheck),Fc(i)}}};return n?(i.flags=Ie.Mutable|Ie.Dirty,i.get=function(){const s=i.flags;if(s&Ie.Dirty||s&Ie.Pending&&wb(i.deps,i)){if(i._update()){const o=i.subs;o!==void 0&&Gy(o)}}else s&Ie.Pending&&(i.flags=s&~Ie.Pending);return Nn!==void 0&&Hy(i,Nn,Ql),i._snapshot}):i.set=function(s){if(i._update(s)){const o=i.subs;o!==void 0&&(UE(o),Gy(o),kb())}},i}function HE(e){const t=()=>{const r=Nn;Nn=n,++Ql,n.depsTail=void 0,n.flags=Ie.Watching|Ie.RecursedCheck;try{return e()}finally{Nn=r,n.flags&=~Ie.RecursedCheck,Fc(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Ie.Watching|Ie.RecursedCheck,notify(){const r=this.flags;r&Ie.Dirty||r&Ie.Pending&&wb(this.deps,this)?t():this.flags=Ie.Watching},stop(){this.flags=Ie.None,this.depsTail=void 0,Fc(this)}};return t(),n}var Sb={exports:{}},_b={},Cb={exports:{}},jb={};/**
|
|
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 Fs=S;function GE(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var KE=typeof Object.is=="function"?Object.is:GE,YE=Fs.useState,QE=Fs.useEffect,qE=Fs.useLayoutEffect,XE=Fs.useDebugValue;function JE(e,t){var n=t(),r=YE({inst:{value:n,getSnapshot:t}}),i=r[0].inst,s=r[1];return qE(function(){i.value=n,i.getSnapshot=t,Pd(i)&&s({inst:i})},[e,n,t]),QE(function(){return Pd(i)&&s({inst:i}),e(function(){Pd(i)&&s({inst:i})})},[e]),XE(n),n}function Pd(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!KE(e,n)}catch{return!0}}function ZE(e,t){return t()}var eT=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?ZE:JE;jb.useSyncExternalStore=Fs.useSyncExternalStore!==void 0?Fs.useSyncExternalStore:eT;Cb.exports=jb;var tT=Cb.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 Pu=S,nT=tT;function rT(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var iT=typeof Object.is=="function"?Object.is:rT,sT=nT.useSyncExternalStore,oT=Pu.useRef,aT=Pu.useEffect,lT=Pu.useMemo,cT=Pu.useDebugValue;_b.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var s=oT(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=lT(function(){function l(p){if(!u){if(u=!0,c=p,p=r(p),i!==void 0&&o.hasValue){var m=o.value;if(i(m,p))return h=m}return h=p}if(m=h,iT(c,p))return m;var x=r(p);return i!==void 0&&i(m,x)?(c=p,m):(c=p,h=x)}var u=!1,c,h,f=n===void 0?null:n;return[function(){return l(t())},f===null?void 0:function(){return l(f())}]},[t,n,r,i]);var a=sT(e,s[0],s[1]);return aT(function(){o.hasValue=!0,o.value=a},[a]),cT(a),a};Sb.exports=_b;var Pb=Sb.exports;const uT=au(Pb);function dT(e,t){return e===t}function It(e,t,n=dT){const r=S.useCallback(o=>{if(!e)return()=>{};const{unsubscribe:a}=e.subscribe(o);return a},[e]),i=S.useCallback(()=>e==null?void 0:e.get(),[e]);return Pb.useSyncExternalStoreWithSelector(r,i,i,t,n)}var hT={get:()=>{},subscribe:()=>({unsubscribe:()=>{}})};function Bi(e){const t=Qt(),n=S.useContext(e.from?$E:ju),r=e.from??n,i=r?e.from?t.stores.getRouteMatchStore(r):t.stores.matchStores.get(r):void 0,s=S.useRef(void 0);return It(i??hT,o=>{if((e.shouldThrow??!0)&&!o&&ir(),o===void 0)return;const a=e.select?e.select(o):o;if(e.structuralSharing??t.options.defaultStructuralSharing){const l=Mr(s.current,a);return s.current=l,l}return a})}function Eb(e){return Bi({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Tb(e){const{select:t,...n}=e;return Bi({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function Ks(e){return Bi({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 om(e){return Bi({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function _n(e){const t=Qt();return S.useCallback(n=>t.navigate({...n,from:n.from??(e==null?void 0:e.from)}),[e==null?void 0:e.from,t])}function Rb(e){return Bi({...e,select:t=>e.select?e.select(t.context):t.context})}function fT(e,t){const n=Qt(),r=LP(t),{activeProps:i,inactiveProps:s,activeOptions:o,to:a,preload:l,preloadDelay:u,preloadIntentProximity:c,hashScrollIntoView:h,replace:f,startTransition:p,resetScroll:m,viewTransition:x,children:w,target:g,disabled:y,style:v,className:k,onClick:P,onBlur:b,onFocus:C,onMouseEnter:j,onMouseLeave:T,onTouchStart:E,ignoreBlocker:A,params:M,search:F,hash:D,state:L,mask:$,reloadDocument:U,unsafeRelative:z,from:V,_fromLocation:_,...B}=e,X=xb(),I=S.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ue=It(n.stores.location,ye=>ye,(ye,O)=>ye.href===O.href),fe=S.useMemo(()=>{const ye={_fromLocation:ue,...I};return n.buildLocation(ye)},[n,ue,I]),de=fe.maskedLocation?fe.maskedLocation.publicHref:fe.publicHref,ot=fe.maskedLocation?fe.maskedLocation.external:fe.external,Ve=S.useMemo(()=>vT(de,ot,n.history,y),[y,ot,de,n.history]),K=S.useMemo(()=>{if(Ve!=null&&Ve.external)return Dc(Ve.href,n.protocolAllowlist)?void 0:Ve.href;if(!wT(a)&&!(typeof a!="string"||a.indexOf(":")===-1))try{return new URL(a),Dc(a,n.protocolAllowlist)?void 0:a}catch{}},[a,Ve,n.protocolAllowlist]),xe=S.useMemo(()=>{if(K)return!1;if(o!=null&&o.exact){if(!ZP(ue.pathname,fe.pathname,n.basepath))return!1}else{const ye=Nc(ue.pathname,n.basepath),O=Nc(fe.pathname,n.basepath);if(!(ye.startsWith(O)&&(ye.length===O.length||ye[O.length]==="/")))return!1}return((o==null?void 0:o.includeSearch)??!0)&&!ji(ue.search,fe.search,{partial:!(o!=null&&o.exact),ignoreUndefined:!(o!=null&&o.explicitUndefined)})?!1:o!=null&&o.includeHash?X&&ue.hash===fe.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,ue,K,X,fe.hash,fe.pathname,fe.search,n.basepath]),Le=xe?Ar(i,{})??pT:Ed,wt=xe?Ed:Ar(s,{})??Ed,Ui=[k,Le.className,wt.className].filter(Boolean).join(" "),Ba=(v||Le.style||wt.style)&&{...v,...Le.style,...wt.style},[Va,io]=S.useState(!1),so=S.useRef(!1),fr=e.reloadDocument||K?!1:l??n.options.defaultPreload,Hi=u??n.options.defaultPreloadDelay??0,Pn=S.useCallback(()=>{n.preloadRoute({...I,_builtLocation:fe}).catch(ye=>{console.warn(ye),console.warn(LE)})},[n,I,fe]);MP(r,S.useCallback(ye=>{ye!=null&&ye.isIntersecting&&Pn()},[Pn]),xT,{disabled:!!y||fr!=="viewport"}),S.useEffect(()=>{so.current||!y&&fr==="render"&&(Pn(),so.current=!0)},[y,Pn,fr]);const Gu=ye=>{const O=ye.currentTarget.getAttribute("target"),G=g!==void 0?g:O;if(!y&&!bT(ye)&&!ye.defaultPrevented&&(!G||G==="_self")&&ye.button===0){ye.preventDefault(),$i.flushSync(()=>{io(!0)});const ne=n.subscribe("onResolved",()=>{ne(),io(!1)});n.navigate({...I,replace:f,resetScroll:m,hashScrollIntoView:h,startTransition:p,viewTransition:x,ignoreBlocker:A})}};if(K)return{...B,ref:r,href:K,...w&&{children:w},...g&&{target:g},...y&&{disabled:y},...v&&{style:v},...k&&{className:k},...P&&{onClick:P},...b&&{onBlur:b},...C&&{onFocus:C},...j&&{onMouseEnter:j},...T&&{onMouseLeave:T},...E&&{onTouchStart:E}};const Wa=ye=>{if(y||fr!=="intent")return;if(!Hi){Pn();return}const O=ye.currentTarget;if(wo.has(O))return;const G=setTimeout(()=>{wo.delete(O),Pn()},Hi);wo.set(O,G)},Ku=ye=>{y||fr!=="intent"||Pn()},Ua=ye=>{if(y||!fr||!Hi)return;const O=ye.currentTarget,G=wo.get(O);G&&(clearTimeout(G),wo.delete(O))};return{...B,...Le,...wt,href:Ve==null?void 0:Ve.href,ref:r,onClick:Yi([P,Gu]),onBlur:Yi([b,Ua]),onFocus:Yi([C,Wa]),onMouseEnter:Yi([j,Wa]),onMouseLeave:Yi([T,Ua]),onTouchStart:Yi([E,Ku]),disabled:!!y,target:g,...Ba&&{style:Ba},...Ui&&{className:Ui},...y&&mT,...xe&&gT,...X&&Va&&yT}}var Ed={},pT={className:"active"},mT={role:"link","aria-disabled":!0},gT={"data-status":"active","aria-current":"page"},yT={"data-transitioning":"transitioning"},wo=new WeakMap,xT={rootMargin:"100px"},Yi=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function vT(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function wT(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Ib=S.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:i,...s}=fT(r,t),o=typeof r.children=="function"?r.children({isActive:s["data-status"]==="active"}):r.children;if(!n){const{disabled:a,...l}=s;return S.createElement("a",l,o)}return S.createElement(n,s,o)});function bT(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var kT=class extends yb{constructor(e){super(e),this.useMatch=t=>Bi({select:t==null?void 0:t.select,from:this.id,structuralSharing:t==null?void 0:t.structuralSharing}),this.useRouteContext=t=>Rb({...t,from:this.id}),this.useSearch=t=>om({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useParams=t=>Ks({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useLoaderDeps=t=>Tb({...t,from:this.id}),this.useLoaderData=t=>Eb({...t,from:this.id}),this.useNavigate=()=>_n({from:this.fullPath}),this.Link=Ts.forwardRef((t,n)=>d.jsx(Ib,{ref:n,from:this.fullPath,...t}))}};function dr(e){return new kT(e)}var ST=class extends DE{constructor(e){super(e),this.useMatch=t=>Bi({select:t==null?void 0:t.select,from:this.id,structuralSharing:t==null?void 0:t.structuralSharing}),this.useRouteContext=t=>Rb({...t,from:this.id}),this.useSearch=t=>om({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useParams=t=>Ks({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useLoaderDeps=t=>Tb({...t,from:this.id}),this.useLoaderData=t=>Eb({...t,from:this.id}),this.useNavigate=()=>_n({from:this.fullPath}),this.Link=Ts.forwardRef((t,n)=>d.jsx(Ib,{ref:n,from:this.fullPath,...t}))}};function _T(e){return new ST(e)}function CT(e){const t=Qt(),n=`not-found-${It(t.stores.location,r=>r.pathname)}-${It(t.stores.status,r=>r)}`;return d.jsx(im,{getResetKey:()=>n,onCatch:(r,i)=>{var s;if(dt(r))(s=e.onCatch)==null||s.call(e,r,i);else throw r},errorComponent:({error:r})=>{var i;if(dt(r))return(i=e.fallback)==null?void 0:i.call(e,r);throw r},children:e.children})}function jT(){return d.jsx("p",{children:"Not Found"})}function ns(e){return d.jsx(d.Fragment,{children:e.children})}function Ab(e,t,n){return t.options.notFoundComponent?d.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?d.jsx(e.options.defaultNotFoundComponent,{...n}):d.jsx(jT,{})}function PT(e){return null}function ET(){return PT(Qt()),null}var Mb=S.memo(function({matchId:t}){const n=Qt(),r=n.stores.matchStores.get(t);r||ir();const i=It(n.stores.loadedAt,o=>o),s=It(r,o=>o);return d.jsx(TT,{router:n,matchId:t,resetKey:i,matchState:S.useMemo(()=>{var l;const o=s.routeId,a=(l=n.routesById[o].parentRoute)==null?void 0:l.id;return{routeId:o,ssr:s.ssr,_displayPending:s._displayPending,parentRouteId:a}},[s._displayPending,s.routeId,s.ssr,n.routesById])})});function TT({router:e,matchId:t,resetKey:n,matchState:r}){var m,x;const i=e.routesById[r.routeId],s=i.options.pendingComponent??e.options.defaultPendingComponent,o=s?d.jsx(s,{}):null,a=i.options.errorComponent??e.options.defaultErrorComponent,l=i.options.onCatch??e.options.defaultOnCatch,u=i.isRoot?i.options.notFoundComponent??((m=e.options.notFoundRoute)==null?void 0:m.options.component):i.options.notFoundComponent,c=r.ssr===!1||r.ssr==="data-only",h=(!i.isRoot||i.options.wrapInSuspense||c)&&(i.options.wrapInSuspense??s??(((x=i.options.errorComponent)==null?void 0:x.preload)||c))?S.Suspense:ns,f=a?im:ns,p=u?CT:ns;return d.jsxs(i.isRoot?i.options.shellComponent??ns:ns,{children:[d.jsx(ju.Provider,{value:t,children:d.jsx(h,{fallback:o,children:d.jsx(f,{getResetKey:()=>n,errorComponent:a||sm,onCatch:(w,g)=>{if(dt(w))throw w.routeId??(w.routeId=r.routeId),w;l==null||l(w,g)},children:d.jsx(p,{fallback:w=>{if(w.routeId??(w.routeId=r.routeId),!u||w.routeId&&w.routeId!==r.routeId||!w.routeId&&!i.isRoot)throw w;return S.createElement(u,w)},children:c||r._displayPending?d.jsx(OE,{fallback:o,children:d.jsx(Yy,{matchId:t})}):d.jsx(Yy,{matchId:t})})})})}),r.parentRouteId===Pi?d.jsxs(d.Fragment,{children:[d.jsx(RT,{resetKey:n}),e.options.scrollRestoration&&ab?d.jsx(ET,{}):null]}):null]})}function RT({resetKey:e}){const t=Qt(),n=S.useRef(void 0);return Lo(()=>{const r=t.latestLocation.href;(n.current===void 0||n.current!==r)&&(t.emit({type:"onRendered",...js(t.stores.location.get(),t.stores.resolvedLocation.get())}),n.current=r)},[t.latestLocation.state.__TSR_key,e,t]),null}var Yy=S.memo(function({matchId:t}){const n=Qt(),r=(c,h)=>{var f;return((f=n.getMatch(c.id))==null?void 0:f._nonReactive[h])??c._nonReactive[h]},i=n.stores.matchStores.get(t);i||ir();const s=It(i,c=>c),o=s.routeId,a=n.routesById[o],l=S.useMemo(()=>{var h;const c=(h=n.routesById[o].options.remountDeps??n.options.defaultRemountDeps)==null?void 0:h({routeId:o,loaderDeps:s.loaderDeps,params:s._strictParams,search:s._strictSearch});return c?JSON.stringify(c):void 0},[o,s.loaderDeps,s._strictParams,s._strictSearch,n.options.defaultRemountDeps,n.routesById]),u=S.useMemo(()=>{const c=a.options.component??n.options.defaultComponent;return c?d.jsx(c,{},l):d.jsx(Lb,{})},[l,a.options.component,n.options.defaultComponent]);if(s._displayPending)throw r(s,"displayPendingPromise");if(s._forcePending)throw r(s,"minPendingPromise");if(s.status==="pending"){const c=a.options.pendingMinMs??n.options.defaultPendingMinMs;if(c){const h=n.getMatch(s.id);if(h&&!h._nonReactive.minPendingPromise){const f=Os();h._nonReactive.minPendingPromise=f,setTimeout(()=>{f.resolve(),h._nonReactive.minPendingPromise=void 0},c)}}throw r(s,"loadPromise")}if(s.status==="notFound")return dt(s.error)||ir(),Ab(n,a,s.error);if(s.status==="redirected")throw Ct(s.error)||ir(),r(s,"loadPromise");if(s.status==="error")throw s.error;return u}),Lb=S.memo(function(){const t=Qt(),n=S.useContext(ju);let r,i=!1,s;{const u=n?t.stores.matchStores.get(n):void 0;[r,i]=It(u,c=>[c==null?void 0:c.routeId,(c==null?void 0:c.globalNotFound)??!1]),s=It(t.stores.matchesId,c=>c[c.findIndex(h=>h===n)+1])}const o=r?t.routesById[r]:void 0,a=t.options.defaultPendingComponent?d.jsx(t.options.defaultPendingComponent,{}):null;if(i)return o||ir(),Ab(t,o,void 0);if(!s)return null;const l=d.jsx(Mb,{matchId:s});return r===Pi?d.jsx(S.Suspense,{fallback:a,children:l}):l});function IT(){const e=Qt(),t=S.useRef({router:e,mounted:!1}),[n,r]=S.useState(!1),i=It(e.stores.isLoading,h=>h),s=It(e.stores.hasPending,h=>h),o=wd(i),a=i||n||s,l=wd(a),u=i||s,c=wd(u);return e.startTransition=h=>{r(!0),S.startTransition(()=>{h(),r(!1)})},S.useEffect(()=>{const h=e.history.subscribe(e.load),f=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Hr(e.latestLocation.publicHref)!==Hr(f.publicHref)&&e.commitLocation({...f,replace:!0}),()=>{h()}},[e,e.history]),Lo(()=>{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(f){console.error(f)}})()},[e]),Lo(()=>{o&&!i&&e.emit({type:"onLoad",...js(e.stores.location.get(),e.stores.resolvedLocation.get())})},[o,e,i]),Lo(()=>{c&&!u&&e.emit({type:"onBeforeRouteMount",...js(e.stores.location.get(),e.stores.resolvedLocation.get())})},[u,c,e]),Lo(()=>{if(l&&!a){const h=js(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:"onResolved",...h}),bb(()=>{e.stores.status.set("idle"),e.stores.resolvedLocation.set(e.stores.location.get())}),h.hrefChanged&&NE(e)}},[a,l,e]),null}function AT(){const e=Qt(),t=e.routesById[Pi].options.pendingComponent??e.options.defaultPendingComponent,n=t?d.jsx(t,{}):null,r=d.jsxs(typeof document<"u"&&e.ssr?ns:S.Suspense,{fallback:n,children:[d.jsx(IT,{}),d.jsx(MT,{})]});return e.options.InnerWrap?d.jsx(e.options.InnerWrap,{children:r}):r}function MT(){const e=Qt(),t=It(e.stores.firstId,i=>i),n=It(e.stores.loadedAt,i=>i),r=t?d.jsx(Mb,{matchId:t}):null;return d.jsx(ju.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:d.jsx(im,{getResetKey:()=>n,errorComponent:sm,onCatch:void 0,children:r})})}var LT=e=>({createMutableStore:Ky,createReadonlyStore:Ky,batch:bb}),DT=e=>new NT(e),NT=class extends PE{constructor(e){super(e,LT)}};function zT({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(vb.Provider,{value:e,children:t});return e.options.Wrap?d.jsx(e.options.Wrap,{children:r}):r}function OT({router:e,...t}){return d.jsx(zT,{router:e,...t,children:d.jsx(AT,{})})}function FT(e){const t=Qt({warn:(e==null?void 0:e.router)===void 0}),n=(e==null?void 0:e.router)||t,r=S.useRef(void 0);return It(n.stores.__store,i=>{if(e!=null&&e.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const s=Mr(r.current,e.select(i));return r.current=s,s}return e.select(i)}return i})}const $T="modulepreload",BT=function(e){return"/"+e},Qy={},Ys=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=Promise.allSettled(n.map(l=>{if(l=BT(l),l in Qy)return;Qy[l]=!0;const u=l.endsWith(".css"),c=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${c}`))return;const h=document.createElement("link");if(h.rel=u?"stylesheet":$T,u||(h.as="script"),h.crossOrigin="",h.href=l,a&&h.setAttribute("nonce",a),document.head.appendChild(h),u)return new Promise((f,p)=>{h.addEventListener("load",f),h.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${l}`)))})}))}function s(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return i.then(o=>{for(const a of o||[])a.status==="rejected"&&s(a.reason);return t().catch(s)})},je={serif:"'Luminari', 'Cormorant Garamond', Georgia, serif",body:"'Cormorant Garamond', Georgia, serif",handwritten:"'Caveat', cursive",mono:"'JetBrains Mono', monospace"},R={1:"0.25rem",2:"0.5rem",3:"0.75rem",4:"1rem",5:"1.25rem",6:"1.5rem",8:"2rem"},J={"2xs":"0.75rem",xs:"0.875rem",sm:"1rem",base:"1.125rem",md:"1.25rem",lg:"1.5rem"},$c={tight:1.2,normal:1.5,relaxed:1.7},ie={textPrimary:"#1A1917",textProse:"#1C1B18",textSecondary:"#68635C",textTertiary:"#A8A399",accentAmber:"#D4A373",accentAmberDark:"#A67B4F",accentGreen:"#8FB996",accentGreenDark:"#5E8A66",accentRoseDark:"#9E5E5E",accentSlate:"#8A9BA8",deskBg:"#1e3a2d",deskLight:"#264a3a",deskText:"#e8e4d9",deskTextMuted:"#a8b5a0",deskBorder:"rgba(200, 210, 195, 0.15)",deskChalk:"#d4e8cb"},Db={sidebarWidth:224,stackPanelWidth:480};function VT(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const WT=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,UT=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,HT={};function qy(e,t){return(HT.jsx?UT:WT).test(e)}const GT=/[ \t\n\f\r]/g;function KT(e){return typeof e=="object"?e.type==="text"?Xy(e.value):!1:Xy(e)}function Xy(e){return e.replace(GT,"")===""}class Aa{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Aa.prototype.normal={};Aa.prototype.property={};Aa.prototype.space=void 0;function Nb(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Aa(n,r,t)}function yf(e){return e.toLowerCase()}class Lt{constructor(t,n){this.attribute=n,this.property=t}}Lt.prototype.attribute="";Lt.prototype.booleanish=!1;Lt.prototype.boolean=!1;Lt.prototype.commaOrSpaceSeparated=!1;Lt.prototype.commaSeparated=!1;Lt.prototype.defined=!1;Lt.prototype.mustUseProperty=!1;Lt.prototype.number=!1;Lt.prototype.overloadedBoolean=!1;Lt.prototype.property="";Lt.prototype.spaceSeparated=!1;Lt.prototype.space=void 0;let YT=0;const re=Vi(),He=Vi(),xf=Vi(),H=Vi(),we=Vi(),Ti=Vi(),Ot=Vi();function Vi(){return 2**++YT}const vf=Object.freeze(Object.defineProperty({__proto__:null,boolean:re,booleanish:He,commaOrSpaceSeparated:Ot,commaSeparated:Ti,number:H,overloadedBoolean:xf,spaceSeparated:we},Symbol.toStringTag,{value:"Module"})),Td=Object.keys(vf);class am extends Lt{constructor(t,n,r,i){let s=-1;if(super(t,n),Jy(this,"space",i),typeof r=="number")for(;++s<Td.length;){const o=Td[s];Jy(this,Td[s],(r&vf[o])===vf[o])}}}am.prototype.defined=!0;function Jy(e,t,n){n&&(e[t]=n)}function Qs(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const s=new am(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[yf(r)]=r,n[yf(s.attribute)]=r}return new Aa(t,n,e.space)}const zb=Qs({properties:{ariaActiveDescendant:null,ariaAtomic:He,ariaAutoComplete:null,ariaBusy:He,ariaChecked:He,ariaColCount:H,ariaColIndex:H,ariaColSpan:H,ariaControls:we,ariaCurrent:null,ariaDescribedBy:we,ariaDetails:null,ariaDisabled:He,ariaDropEffect:we,ariaErrorMessage:null,ariaExpanded:He,ariaFlowTo:we,ariaGrabbed:He,ariaHasPopup:null,ariaHidden:He,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:we,ariaLevel:H,ariaLive:null,ariaModal:He,ariaMultiLine:He,ariaMultiSelectable:He,ariaOrientation:null,ariaOwns:we,ariaPlaceholder:null,ariaPosInSet:H,ariaPressed:He,ariaReadOnly:He,ariaRelevant:null,ariaRequired:He,ariaRoleDescription:we,ariaRowCount:H,ariaRowIndex:H,ariaRowSpan:H,ariaSelected:He,ariaSetSize:H,ariaSort:null,ariaValueMax:H,ariaValueMin:H,ariaValueNow:H,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Ob(e,t){return t in e?e[t]:t}function Fb(e,t){return Ob(e,t.toLowerCase())}const QT=Qs({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ti,acceptCharset:we,accessKey:we,action:null,allow:null,allowFullScreen:re,allowPaymentRequest:re,allowUserMedia:re,alpha:re,alt:null,as:null,async:re,autoCapitalize:null,autoComplete:we,autoFocus:re,autoPlay:re,blocking:we,capture:null,charSet:null,checked:re,cite:null,className:we,closedBy:null,colorSpace:null,cols:H,colSpan:H,command:null,commandFor:null,content:null,contentEditable:He,controls:re,controlsList:we,coords:H|Ti,crossOrigin:null,data:null,dateTime:null,decoding:null,default:re,defer:re,dir:null,dirName:null,disabled:re,download:xf,draggable:He,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:re,formTarget:null,headers:we,height:H,hidden:xf,high:H,href:null,hrefLang:null,htmlFor:we,httpEquiv:we,id:null,imageSizes:null,imageSrcSet:null,inert:re,inputMode:null,integrity:null,is:null,isMap:re,itemId:null,itemProp:we,itemRef:we,itemScope:re,itemType:we,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:re,low:H,manifest:null,max:null,maxLength:H,media:null,method:null,min:null,minLength:H,multiple:re,muted:re,name:null,nonce:null,noModule:re,noValidate:re,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:re,optimum:H,pattern:null,ping:we,placeholder:null,playsInline:re,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:re,referrerPolicy:null,rel:we,required:re,reversed:re,rows:H,rowSpan:H,sandbox:we,scope:null,scoped:re,seamless:re,selected:re,shadowRootClonable:re,shadowRootCustomElementRegistry:re,shadowRootDelegatesFocus:re,shadowRootMode:null,shadowRootSerializable:re,shape:null,size:H,sizes:null,slot:null,span:H,spellCheck:He,src:null,srcDoc:null,srcLang:null,srcSet:null,start:H,step:null,style:null,tabIndex:H,target:null,title:null,translate:null,type:null,typeMustMatch:re,useMap:null,value:He,width:H,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:we,axis:null,background:null,bgColor:null,border:H,borderColor:null,bottomMargin:H,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:re,declare:re,event:null,face:null,frame:null,frameBorder:null,hSpace:H,leftMargin:H,link:null,longDesc:null,lowSrc:null,marginHeight:H,marginWidth:H,noResize:re,noHref:re,noShade:re,noWrap:re,object:null,profile:null,prompt:null,rev:null,rightMargin:H,rules:null,scheme:null,scrolling:He,standby:null,summary:null,text:null,topMargin:H,valueType:null,version:null,vAlign:null,vLink:null,vSpace:H,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:re,disablePictureInPicture:re,disableRemotePlayback:re,exportParts:Ti,part:we,prefix:null,property:null,results:H,security:null,unselectable:null},space:"html",transform:Fb}),qT=Qs({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:Ot,accentHeight:H,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:H,amplitude:H,arabicForm:null,ascent:H,attributeName:null,attributeType:null,azimuth:H,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:H,by:null,calcMode:null,capHeight:H,className:we,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:H,diffuseConstant:H,direction:null,display:null,dur:null,divisor:H,dominantBaseline:null,download:re,dx:null,dy:null,edgeMode:null,editable:null,elevation:H,enableBackground:null,end:null,event:null,exponent:H,externalResourcesRequired:null,fill:null,fillOpacity:H,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:Ti,g2:Ti,glyphName:Ti,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:H,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:H,horizOriginX:H,horizOriginY:H,id:null,ideographic:H,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:H,k:H,k1:H,k2:H,k3:H,k4:H,kernelMatrix:Ot,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:H,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:H,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:H,overlineThickness:H,paintOrder:null,panose1:null,path:null,pathLength:H,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:we,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:H,pointsAtY:H,pointsAtZ:H,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ot,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ot,rev:Ot,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ot,requiredFeatures:Ot,requiredFonts:Ot,requiredFormats:Ot,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:H,specularExponent:H,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:H,strikethroughThickness:H,string:null,stroke:null,strokeDashArray:Ot,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:H,strokeOpacity:H,strokeWidth:null,style:null,surfaceScale:H,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ot,tabIndex:H,tableValues:null,target:null,targetX:H,targetY:H,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ot,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:H,underlineThickness:H,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:H,values:null,vAlphabetic:H,vMathematical:H,vectorEffect:null,vHanging:H,vIdeographic:H,version:null,vertAdvY:H,vertOriginX:H,vertOriginY:H,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:H,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Ob}),$b=Qs({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()}}),Bb=Qs({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Fb}),Vb=Qs({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),XT={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"},JT=/[A-Z]/g,Zy=/-[a-z]/g,ZT=/^data[-\w.:]+$/i;function e2(e,t){const n=yf(t);let r=t,i=Lt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&ZT.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(Zy,n2);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!Zy.test(s)){let o=s.replace(JT,t2);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=am}return new i(r,t)}function t2(e){return"-"+e.toLowerCase()}function n2(e){return e.charAt(1).toUpperCase()}const r2=Nb([zb,QT,$b,Bb,Vb],"html"),lm=Nb([zb,qT,$b,Bb,Vb],"svg");function i2(e){return e.join(" ").trim()}var cm={},ex=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,s2=/\n/g,o2=/^\s*/,a2=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,l2=/^:\s*/,c2=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u2=/^[;\s]*/,d2=/^\s+|\s+$/g,h2=`
|
|
58
|
-
`,tx="/",nx="*",mi="",f2="comment",p2="declaration";function m2(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(m){var x=m.match(s2);x&&(n+=x.length);var w=m.lastIndexOf(h2);r=~w?m.length-w:r+m.length}function s(){var m={line:n,column:r};return function(x){return x.position=new o(m),u(),x}}function o(m){this.start=m,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function a(m){var x=new Error(t.source+":"+n+":"+r+": "+m);if(x.reason=m,x.filename=t.source,x.line=n,x.column=r,x.source=e,!t.silent)throw x}function l(m){var x=m.exec(e);if(x){var w=x[0];return i(w),e=e.slice(w.length),x}}function u(){l(o2)}function c(m){var x;for(m=m||[];x=h();)x!==!1&&m.push(x);return m}function h(){var m=s();if(!(tx!=e.charAt(0)||nx!=e.charAt(1))){for(var x=2;mi!=e.charAt(x)&&(nx!=e.charAt(x)||tx!=e.charAt(x+1));)++x;if(x+=2,mi===e.charAt(x-1))return a("End of comment missing");var w=e.slice(2,x-2);return r+=2,i(w),e=e.slice(x),r+=2,m({type:f2,comment:w})}}function f(){var m=s(),x=l(a2);if(x){if(h(),!l(l2))return a("property missing ':'");var w=l(c2),g=m({type:p2,property:rx(x[0].replace(ex,mi)),value:w?rx(w[0].replace(ex,mi)):mi});return l(u2),g}}function p(){var m=[];c(m);for(var x;x=f();)x!==!1&&(m.push(x),c(m));return m}return u(),p()}function rx(e){return e?e.replace(d2,mi):mi}var g2=m2,y2=uc&&uc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(cm,"__esModule",{value:!0});cm.default=v2;const x2=y2(g2);function v2(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,x2.default)(e),i=typeof t=="function";return r.forEach(s=>{if(s.type!=="declaration")return;const{property:o,value:a}=s;i?t(o,a,s):a&&(n=n||{},n[o]=a)}),n}var Eu={};Object.defineProperty(Eu,"__esModule",{value:!0});Eu.camelCase=void 0;var w2=/^--[a-zA-Z0-9_-]+$/,b2=/-([a-z])/g,k2=/^[^-]+$/,S2=/^-(webkit|moz|ms|o|khtml)-/,_2=/^-(ms)-/,C2=function(e){return!e||k2.test(e)||w2.test(e)},j2=function(e,t){return t.toUpperCase()},ix=function(e,t){return"".concat(t,"-")},P2=function(e,t){return t===void 0&&(t={}),C2(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(_2,ix):e=e.replace(S2,ix),e.replace(b2,j2))};Eu.camelCase=P2;var E2=uc&&uc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},T2=E2(cm),R2=Eu;function wf(e,t){var n={};return!e||typeof e!="string"||(0,T2.default)(e,function(r,i){r&&i&&(n[(0,R2.camelCase)(r,t)]=i)}),n}wf.default=wf;var I2=wf;const A2=au(I2),Wb=Ub("end"),um=Ub("start");function Ub(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 M2(e){const t=um(e),n=Wb(e);if(t&&n)return{start:t,end:n}}function Go(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?sx(e.position):"start"in e||"end"in e?sx(e):"line"in e||"column"in e?bf(e):""}function bf(e){return ox(e&&e.line)+":"+ox(e&&e.column)}function sx(e){return bf(e&&e.start)+"-"+bf(e&&e.end)}function ox(e){return e&&typeof e=="number"?e:1}class ft extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},o=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?i=t:!s.cause&&t&&(o=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?s.ruleId=r:(s.source=r.slice(0,l),s.ruleId=r.slice(l+1))}if(!s.place&&s.ancestors&&s.ancestors){const l=s.ancestors[s.ancestors.length-1];l&&(s.place=l.position)}const a=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=Go(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ft.prototype.file="";ft.prototype.name="";ft.prototype.reason="";ft.prototype.message="";ft.prototype.stack="";ft.prototype.column=void 0;ft.prototype.line=void 0;ft.prototype.ancestors=void 0;ft.prototype.cause=void 0;ft.prototype.fatal=void 0;ft.prototype.place=void 0;ft.prototype.ruleId=void 0;ft.prototype.source=void 0;const dm={}.hasOwnProperty,L2=new Map,D2=/[A-Z]/g,N2=new Set(["table","tbody","thead","tfoot","tr"]),z2=new Set(["td","th"]),Hb="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function O2(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=G2(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=H2(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?lm:r2,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=Gb(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function Gb(e,t,n){if(t.type==="element")return F2(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return $2(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return V2(e,t,n);if(t.type==="mdxjsEsm")return B2(e,t);if(t.type==="root")return W2(e,t,n);if(t.type==="text")return U2(e,t)}function F2(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=lm,e.schema=i),e.ancestors.push(t);const s=Yb(e,t.tagName,!1),o=K2(e,t);let a=fm(e,t);return N2.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!KT(l):!0})),Kb(e,o,s,t),hm(o,a),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function $2(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)}ba(e,t.position)}function B2(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ba(e,t.position)}function V2(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=lm,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:Yb(e,t.name,!0),o=Y2(e,t),a=fm(e,t);return Kb(e,o,s,t),hm(o,a),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function W2(e,t,n){const r={};return hm(r,fm(e,t)),e.create(t,e.Fragment,r,n)}function U2(e,t){return t.value}function Kb(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 H2(e,t,n){return r;function r(i,s,o,a){const u=Array.isArray(o.children)?n:t;return a?u(s,o,a):u(s,o)}}function G2(e,t){return n;function n(r,i,s,o){const a=Array.isArray(s.children),l=um(r);return t(i,s,o,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function K2(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&dm.call(t.properties,i)){const s=Q2(e,i,t.properties[i]);if(s){const[o,a]=s;e.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&z2.has(t.tagName)?r=a:n[o]=a}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Y2(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const o=s.expression;o.type;const a=o.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else ba(e,t.position);else{const i=r.name;let s;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,s=e.evaluater.evaluateExpression(a.expression)}else ba(e,t.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function fm(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:L2;for(;++r<t.children.length;){const s=t.children[r];let o;if(e.passKeys){const l=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(l){const u=i.get(l)||0;o=l+"-"+u,i.set(l,u+1)}}const a=Gb(e,s,o);a!==void 0&&n.push(a)}return n}function Q2(e,t,n){const r=e2(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?VT(n):i2(n)),r.property==="style"){let i=typeof n=="object"?n:q2(e,String(n));return e.stylePropertyNameCase==="css"&&(i=X2(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?XT[r.property]||r.property:r.attribute,n]}}function q2(e,t){try{return A2(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new ft("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=Hb+"#cannot-parse-style-attribute",i}}function Yb(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let s=-1,o;for(;++s<i.length;){const a=qy(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};o=o?{type:"MemberExpression",object:o,property:a,computed:!!(s&&a.type==="Literal"),optional:!1}:a}r=o}else r=qy(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return dm.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);ba(e)}function ba(e,t){const n=new ft("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=Hb+"#cannot-handle-mdx-estrees-without-createevaluater",n}function X2(e){const t={};let n;for(n in e)dm.call(e,n)&&(t[J2(n)]=e[n]);return t}function J2(e){let t=e.replace(D2,Z2);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Z2(e){return"-"+e.toLowerCase()}const Rd={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"]},eR={};function tR(e,t){const n=eR,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Qb(e,r,i)}function Qb(e,t,n){if(nR(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 ax(e.children,t,n)}return Array.isArray(e)?ax(e,t,n):""}function ax(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Qb(e[i],t,n);return r.join("")}function nR(e){return!!(e&&typeof e=="object")}const lx=document.createElement("i");function pm(e){const t="&"+e+";";lx.innerHTML=t;const n=lx.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Un(e,t,n,r){const i=e.length;let s=0,o;if(t<0?t=-t>i?0:i+t:t=t>i?i: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);s<r.length;)o=r.slice(s,s+1e4),o.unshift(t,0),e.splice(...o),s+=1e4,t+=1e4}function nn(e,t){return e.length>0?(Un(e,e.length,0,t),e):t}const cx={}.hasOwnProperty;function rR(e){const t={};let n=-1;for(;++n<e.length;)iR(t,e[n]);return t}function iR(e,t){let n;for(n in t){const i=(cx.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let o;if(s)for(o in s){cx.call(i,o)||(i[o]=[]);const a=s[o];sR(i[o],Array.isArray(a)?a:a?[a]:[])}}}function sR(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Un(e,0,0,r)}function qb(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 Ps(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Fn=ti(/[A-Za-z]/),Bt=ti(/[\dA-Za-z]/),oR=ti(/[#-'*+\--9=?A-Z^-~]/);function kf(e){return e!==null&&(e<32||e===127)}const Sf=ti(/\d/),aR=ti(/[\dA-Fa-f]/),lR=ti(/[!-/:-@[-`{-~]/);function te(e){return e!==null&&e<-2}function Tt(e){return e!==null&&(e<0||e===32)}function he(e){return e===-2||e===-1||e===32}const cR=ti(new RegExp("\\p{P}|\\p{S}","u")),uR=ti(/\s/);function ti(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function qs(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const s=e.charCodeAt(n);let o="";if(s===37&&Bt(e.charCodeAt(n+1))&&Bt(e.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(o=String.fromCharCode(s));else if(s>55295&&s<57344){const a=e.charCodeAt(n+1);s<56320&&a>56319&&a<57344?(o=String.fromCharCode(s,a),i=1):o="�"}else o=String.fromCharCode(s);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Ce(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return o;function o(l){return he(l)?(e.enter(n),a(l)):t(l)}function a(l){return he(l)&&s++<i?(e.consume(l),a):(e.exit(n),t(l))}}const dR={tokenize:hR};function hR(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Ce(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),s(a)}function s(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 te(a)?(e.consume(a),e.exit("chunkText"),s):(e.consume(a),o)}}const fR={tokenize:pR},ux={tokenize:mR};function pR(e){const t=this,n=[];let r=0,i,s,o;return a;function a(v){if(r<n.length){const k=n[r];return t.containerState=k[1],e.attempt(k[0].continuation,l,u)(v)}return u(v)}function l(v){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&y();const k=t.events.length;let P=k,b;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){b=t.events[P][1].end;break}g(r);let C=k;for(;C<t.events.length;)t.events[C][1].end={...b},C++;return Un(t.events,P+1,0,t.events.slice(k)),t.events.length=C,u(v)}return a(v)}function u(v){if(r===n.length){if(!i)return f(v);if(i.currentConstruct&&i.currentConstruct.concrete)return m(v);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(ux,c,h)(v)}function c(v){return i&&y(),g(r),f(v)}function h(v){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(v)}function f(v){return t.containerState={},e.attempt(ux,p,m)(v)}function p(v){return r++,n.push([t.currentConstruct,t.containerState]),f(v)}function m(v){if(v===null){i&&y(),g(0),e.consume(v);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),x(v)}function x(v){if(v===null){w(e.exit("chunkFlow"),!0),g(0),e.consume(v);return}return te(v)?(e.consume(v),w(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(v),x)}function w(v,k){const P=t.sliceStream(v);if(k&&P.push(null),v.previous=s,s&&(s.next=v),s=v,i.defineSkip(v.start),i.write(P),t.parser.lazy[v.start.line]){let b=i.events.length;for(;b--;)if(i.events[b][1].start.offset<o&&(!i.events[b][1].end||i.events[b][1].end.offset>o))return;const C=t.events.length;let j=C,T,E;for(;j--;)if(t.events[j][0]==="exit"&&t.events[j][1].type==="chunkFlow"){if(T){E=t.events[j][1].end;break}T=!0}for(g(r),b=C;b<t.events.length;)t.events[b][1].end={...E},b++;Un(t.events,j+1,0,t.events.slice(C)),t.events.length=b}}function g(v){let k=n.length;for(;k-- >v;){const P=n[k];t.containerState=P[1],P[0].exit.call(t,e)}n.length=v}function y(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function mR(e,t,n){return Ce(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function dx(e){if(e===null||Tt(e)||uR(e))return 1;if(cR(e))return 2}function mm(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const s=e[i].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const _f={name:"attention",resolveAll:gR,tokenize:yR};function gR(e,t){let n=-1,r,i,s,o,a,l,u,c;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;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 h={...e[r][1].end},f={...e[n][1].start};hx(h,-l),hx(f,l),o={type:l>1?"strongSequence":"emphasisSequence",start:h,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:f},s={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},e[r][1].end={...o.start},e[n][1].start={...a.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=nn(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=nn(u,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",s,t]]),u=nn(u,mm(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=nn(u,[["exit",s,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(c=2,u=nn(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,Un(e,r-1,n-r+3,u),n=r+u.length-c-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function yR(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=dx(r);let s;return o;function o(l){return s=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===s)return e.consume(l),a;const u=e.exit("attentionSequence"),c=dx(l),h=!c||c===2&&i||n.includes(l),f=!i||i===2&&c||n.includes(r);return u._open=!!(s===42?h:h&&(i||!f)),u._close=!!(s===42?f:f&&(c||!h)),t(l)}}function hx(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const xR={name:"autolink",tokenize:vR};function vR(e,t,n){let r=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(p){return Fn(p)?(e.consume(p),o):p===64?n(p):u(p)}function o(p){return p===43||p===45||p===46||Bt(p)?(r=1,a(p)):u(p)}function a(p){return p===58?(e.consume(p),r=0,l):(p===43||p===45||p===46||Bt(p))&&r++<32?(e.consume(p),a):(r=0,u(p))}function l(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||kf(p)?n(p):(e.consume(p),l)}function u(p){return p===64?(e.consume(p),c):oR(p)?(e.consume(p),u):n(p)}function c(p){return Bt(p)?h(p):n(p)}function h(p){return p===46?(e.consume(p),r=0,c):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):f(p)}function f(p){if((p===45||Bt(p))&&r++<63){const m=p===45?f:h;return e.consume(p),m}return n(p)}}const Tu={partial:!0,tokenize:wR};function wR(e,t,n){return r;function r(s){return he(s)?Ce(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||te(s)?t(s):n(s)}}const Xb={continuation:{tokenize:kR},exit:SR,name:"blockQuote",tokenize:bR};function bR(e,t,n){const r=this;return i;function i(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"),s}return n(o)}function s(o){return he(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function kR(e,t,n){const r=this;return i;function i(o){return he(o)?Ce(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):s(o)}function s(o){return e.attempt(Xb,t,n)(o)}}function SR(e){e.exit("blockQuote")}const Jb={name:"characterEscape",tokenize:_R};function _R(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),i}function i(s){return lR(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const Zb={name:"characterReference",tokenize:CR};function CR(e,t,n){const r=this;let i=0,s,o;return a;function a(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),l}function l(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),s=31,o=Bt,c(h))}function u(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,o=aR,c):(e.enter("characterReferenceValue"),s=7,o=Sf,c(h))}function c(h){if(h===59&&i){const f=e.exit("characterReferenceValue");return o===Bt&&!pm(r.sliceSerialize(f))?n(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(h)&&i++<s?(e.consume(h),c):n(h)}}const fx={partial:!0,tokenize:PR},px={concrete:!0,name:"codeFenced",tokenize:jR};function jR(e,t,n){const r=this,i={partial:!0,tokenize:P};let s=0,o=0,a;return l;function l(b){return u(b)}function u(b){const C=r.events[r.events.length-1];return s=C&&C[1].type==="linePrefix"?C[2].sliceSerialize(C[1],!0).length:0,a=b,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(b)}function c(b){return b===a?(o++,e.consume(b),c):o<3?n(b):(e.exit("codeFencedFenceSequence"),he(b)?Ce(e,h,"whitespace")(b):h(b))}function h(b){return b===null||te(b)?(e.exit("codeFencedFence"),r.interrupt?t(b):e.check(fx,x,k)(b)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(b))}function f(b){return b===null||te(b)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(b)):he(b)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ce(e,p,"whitespace")(b)):b===96&&b===a?n(b):(e.consume(b),f)}function p(b){return b===null||te(b)?h(b):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(b))}function m(b){return b===null||te(b)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(b)):b===96&&b===a?n(b):(e.consume(b),m)}function x(b){return e.attempt(i,k,w)(b)}function w(b){return e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),g}function g(b){return s>0&&he(b)?Ce(e,y,"linePrefix",s+1)(b):y(b)}function y(b){return b===null||te(b)?e.check(fx,x,k)(b):(e.enter("codeFlowValue"),v(b))}function v(b){return b===null||te(b)?(e.exit("codeFlowValue"),y(b)):(e.consume(b),v)}function k(b){return e.exit("codeFenced"),t(b)}function P(b,C,j){let T=0;return E;function E(L){return b.enter("lineEnding"),b.consume(L),b.exit("lineEnding"),A}function A(L){return b.enter("codeFencedFence"),he(L)?Ce(b,M,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):M(L)}function M(L){return L===a?(b.enter("codeFencedFenceSequence"),F(L)):j(L)}function F(L){return L===a?(T++,b.consume(L),F):T>=o?(b.exit("codeFencedFenceSequence"),he(L)?Ce(b,D,"whitespace")(L):D(L)):j(L)}function D(L){return L===null||te(L)?(b.exit("codeFencedFence"),C(L)):j(L)}}}function PR(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const Id={name:"codeIndented",tokenize:TR},ER={partial:!0,tokenize:RR};function TR(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),Ce(e,s,"linePrefix",5)(u)}function s(u){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?o(u):n(u)}function o(u){return u===null?l(u):te(u)?e.attempt(ER,o,l)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||te(u)?(e.exit("codeFlowValue"),o(u)):(e.consume(u),a)}function l(u){return e.exit("codeIndented"),t(u)}}function RR(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):te(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):Ce(e,s,"linePrefix",5)(o)}function s(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):te(o)?i(o):n(o)}}const IR={name:"codeText",previous:MR,resolve:AR,tokenize:LR};function AR(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function MR(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function LR(e,t,n){let r=0,i,s;return o;function o(h){return e.enter("codeText"),e.enter("codeTextSequence"),a(h)}function a(h){return h===96?(e.consume(h),r++,a):(e.exit("codeTextSequence"),l(h))}function l(h){return h===null?n(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),l):h===96?(s=e.enter("codeTextSequence"),i=0,c(h)):te(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),l):(e.enter("codeTextData"),u(h))}function u(h){return h===null||h===32||h===96||te(h)?(e.exit("codeTextData"),l(h)):(e.consume(h),u)}function c(h){return h===96?(e.consume(h),i++,c):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(s.type="codeTextData",u(h))}}class DR{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&bo(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),bo(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),bo(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);bo(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);bo(this.left,n.reverse())}}}function bo(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 ek(e){const t={};let n=-1,r,i,s,o,a,l,u;const c=new DR(e);for(;++n<c.length;){for(;n in t;)n=t[n];if(r=c.get(n),n&&r[1].type==="chunkFlow"&&c.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,s=0,s<l.length&&l[s][1].type==="lineEndingBlank"&&(s+=2),s<l.length&&l[s][1].type==="content"))for(;++s<l.length&&l[s][1].type!=="content";)l[s][1].type==="chunkText"&&(l[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,NR(c,n)),n=t[n],u=!0);else if(r[1]._container){for(s=n,i=void 0;s--;)if(o=c.get(s),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(c.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=s);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(r[1].end={...c.get(i)[1].start},a=c.slice(i,n),a.unshift(r),c.splice(i,n-i+1,a))}}return Un(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!u}function NR(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const s=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const a=o.events,l=[],u={};let c,h,f=-1,p=n,m=0,x=0;const w=[x];for(;p;){for(;e.get(++i)[1]!==p;);s.push(i),p._tokenizer||(c=r.sliceStream(p),p.next||c.push(null),h&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(c),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),h=p,p=p.next}for(p=n;++f<a.length;)a[f][0]==="exit"&&a[f-1][0]==="enter"&&a[f][1].type===a[f-1][1].type&&a[f][1].start.line!==a[f][1].end.line&&(x=f+1,w.push(x),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):w.pop(),f=w.length;f--;){const g=a.slice(w[f],w[f+1]),y=s.pop();l.push([y,y+g.length-1]),e.splice(y,2,g)}for(l.reverse(),f=-1;++f<l.length;)u[m+l[f][0]]=m+l[f][1],m+=l[f][1]-l[f][0]-1;return u}const zR={resolve:FR,tokenize:$R},OR={partial:!0,tokenize:BR};function FR(e){return ek(e),e}function $R(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?s(a):te(a)?e.check(OR,o,s)(a):(e.consume(a),i)}function s(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,i}}function BR(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Ce(e,s,"linePrefix")}function s(o){if(o===null||te(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 tk(e,t,n,r,i,s,o,a,l){const u=l||Number.POSITIVE_INFINITY;let c=0;return h;function h(g){return g===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(g),e.exit(s),f):g===null||g===32||g===41||kf(g)?n(g):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),x(g))}function f(g){return g===62?(e.enter(s),e.consume(g),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(g))}function p(g){return g===62?(e.exit("chunkString"),e.exit(a),f(g)):g===null||g===60||te(g)?n(g):(e.consume(g),g===92?m:p)}function m(g){return g===60||g===62||g===92?(e.consume(g),p):p(g)}function x(g){return!c&&(g===null||g===41||Tt(g))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),t(g)):c<u&&g===40?(e.consume(g),c++,x):g===41?(e.consume(g),c--,x):g===null||g===32||g===40||kf(g)?n(g):(e.consume(g),g===92?w:x)}function w(g){return g===40||g===41||g===92?(e.consume(g),x):x(g)}}function nk(e,t,n,r,i,s){const o=this;let a=0,l;return u;function u(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(s),c}function c(p){return a>999||p===null||p===91||p===93&&!l||p===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?n(p):p===93?(e.exit(s),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):te(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),h(p))}function h(p){return p===null||p===91||p===93||te(p)||a++>999?(e.exit("chunkString"),c(p)):(e.consume(p),l||(l=!he(p)),p===92?f:h)}function f(p){return p===91||p===92||p===93?(e.consume(p),a++,h):h(p)}}function rk(e,t,n,r,i,s){let o;return a;function a(f){return f===34||f===39||f===40?(e.enter(r),e.enter(i),e.consume(f),e.exit(i),o=f===40?41:f,l):n(f)}function l(f){return f===o?(e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):(e.enter(s),u(f))}function u(f){return f===o?(e.exit(s),l(o)):f===null?n(f):te(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),Ce(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(f))}function c(f){return f===o||f===null||te(f)?(e.exit("chunkString"),u(f)):(e.consume(f),f===92?h:c)}function h(f){return f===o||f===92?(e.consume(f),c):c(f)}}function Ko(e,t){let n;return r;function r(i){return te(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):he(i)?Ce(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const VR={name:"definition",tokenize:UR},WR={partial:!0,tokenize:HR};function UR(e,t,n){const r=this;let i;return s;function s(p){return e.enter("definition"),o(p)}function o(p){return nk.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return i=Ps(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),l):n(p)}function l(p){return Tt(p)?Ko(e,u)(p):u(p)}function u(p){return tk(e,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function c(p){return e.attempt(WR,h,h)(p)}function h(p){return he(p)?Ce(e,f,"whitespace")(p):f(p)}function f(p){return p===null||te(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function HR(e,t,n){return r;function r(a){return Tt(a)?Ko(e,i)(a):n(a)}function i(a){return rk(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function s(a){return he(a)?Ce(e,o,"whitespace")(a):o(a)}function o(a){return a===null||te(a)?t(a):n(a)}}const GR={name:"hardBreakEscape",tokenize:KR};function KR(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return te(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const YR={name:"headingAtx",resolve:QR,tokenize:qR};function QR(e,t){let n=e.length-2,r=3,i,s;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Un(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function qR(e,t,n){let r=0;return i;function i(c){return e.enter("atxHeading"),s(c)}function s(c){return e.enter("atxHeadingSequence"),o(c)}function o(c){return c===35&&r++<6?(e.consume(c),o):c===null||Tt(c)?(e.exit("atxHeadingSequence"),a(c)):n(c)}function a(c){return c===35?(e.enter("atxHeadingSequence"),l(c)):c===null||te(c)?(e.exit("atxHeading"),t(c)):he(c)?Ce(e,a,"whitespace")(c):(e.enter("atxHeadingText"),u(c))}function l(c){return c===35?(e.consume(c),l):(e.exit("atxHeadingSequence"),a(c))}function u(c){return c===null||c===35||Tt(c)?(e.exit("atxHeadingText"),a(c)):(e.consume(c),u)}}const XR=["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"],mx=["pre","script","style","textarea"],JR={concrete:!0,name:"htmlFlow",resolveTo:tI,tokenize:nI},ZR={partial:!0,tokenize:iI},eI={partial:!0,tokenize:rI};function tI(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 nI(e,t,n){const r=this;let i,s,o,a,l;return u;function u(I){return c(I)}function c(I){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(I),h}function h(I){return I===33?(e.consume(I),f):I===47?(e.consume(I),s=!0,x):I===63?(e.consume(I),i=3,r.interrupt?t:_):Fn(I)?(e.consume(I),o=String.fromCharCode(I),w):n(I)}function f(I){return I===45?(e.consume(I),i=2,p):I===91?(e.consume(I),i=5,a=0,m):Fn(I)?(e.consume(I),i=4,r.interrupt?t:_):n(I)}function p(I){return I===45?(e.consume(I),r.interrupt?t:_):n(I)}function m(I){const ue="CDATA[";return I===ue.charCodeAt(a++)?(e.consume(I),a===ue.length?r.interrupt?t:M:m):n(I)}function x(I){return Fn(I)?(e.consume(I),o=String.fromCharCode(I),w):n(I)}function w(I){if(I===null||I===47||I===62||Tt(I)){const ue=I===47,fe=o.toLowerCase();return!ue&&!s&&mx.includes(fe)?(i=1,r.interrupt?t(I):M(I)):XR.includes(o.toLowerCase())?(i=6,ue?(e.consume(I),g):r.interrupt?t(I):M(I)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(I):s?y(I):v(I))}return I===45||Bt(I)?(e.consume(I),o+=String.fromCharCode(I),w):n(I)}function g(I){return I===62?(e.consume(I),r.interrupt?t:M):n(I)}function y(I){return he(I)?(e.consume(I),y):E(I)}function v(I){return I===47?(e.consume(I),E):I===58||I===95||Fn(I)?(e.consume(I),k):he(I)?(e.consume(I),v):E(I)}function k(I){return I===45||I===46||I===58||I===95||Bt(I)?(e.consume(I),k):P(I)}function P(I){return I===61?(e.consume(I),b):he(I)?(e.consume(I),P):v(I)}function b(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),l=I,C):he(I)?(e.consume(I),b):j(I)}function C(I){return I===l?(e.consume(I),l=null,T):I===null||te(I)?n(I):(e.consume(I),C)}function j(I){return I===null||I===34||I===39||I===47||I===60||I===61||I===62||I===96||Tt(I)?P(I):(e.consume(I),j)}function T(I){return I===47||I===62||he(I)?v(I):n(I)}function E(I){return I===62?(e.consume(I),A):n(I)}function A(I){return I===null||te(I)?M(I):he(I)?(e.consume(I),A):n(I)}function M(I){return I===45&&i===2?(e.consume(I),$):I===60&&i===1?(e.consume(I),U):I===62&&i===4?(e.consume(I),B):I===63&&i===3?(e.consume(I),_):I===93&&i===5?(e.consume(I),V):te(I)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(ZR,X,F)(I)):I===null||te(I)?(e.exit("htmlFlowData"),F(I)):(e.consume(I),M)}function F(I){return e.check(eI,D,X)(I)}function D(I){return e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),L}function L(I){return I===null||te(I)?F(I):(e.enter("htmlFlowData"),M(I))}function $(I){return I===45?(e.consume(I),_):M(I)}function U(I){return I===47?(e.consume(I),o="",z):M(I)}function z(I){if(I===62){const ue=o.toLowerCase();return mx.includes(ue)?(e.consume(I),B):M(I)}return Fn(I)&&o.length<8?(e.consume(I),o+=String.fromCharCode(I),z):M(I)}function V(I){return I===93?(e.consume(I),_):M(I)}function _(I){return I===62?(e.consume(I),B):I===45&&i===2?(e.consume(I),_):M(I)}function B(I){return I===null||te(I)?(e.exit("htmlFlowData"),X(I)):(e.consume(I),B)}function X(I){return e.exit("htmlFlow"),t(I)}}function rI(e,t,n){const r=this;return i;function i(o){return te(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):n(o)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function iI(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Tu,t,n)}}const sI={name:"htmlText",tokenize:oI};function oI(e,t,n){const r=this;let i,s,o;return a;function a(_){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(_),l}function l(_){return _===33?(e.consume(_),u):_===47?(e.consume(_),P):_===63?(e.consume(_),v):Fn(_)?(e.consume(_),j):n(_)}function u(_){return _===45?(e.consume(_),c):_===91?(e.consume(_),s=0,m):Fn(_)?(e.consume(_),y):n(_)}function c(_){return _===45?(e.consume(_),p):n(_)}function h(_){return _===null?n(_):_===45?(e.consume(_),f):te(_)?(o=h,U(_)):(e.consume(_),h)}function f(_){return _===45?(e.consume(_),p):h(_)}function p(_){return _===62?$(_):_===45?f(_):h(_)}function m(_){const B="CDATA[";return _===B.charCodeAt(s++)?(e.consume(_),s===B.length?x:m):n(_)}function x(_){return _===null?n(_):_===93?(e.consume(_),w):te(_)?(o=x,U(_)):(e.consume(_),x)}function w(_){return _===93?(e.consume(_),g):x(_)}function g(_){return _===62?$(_):_===93?(e.consume(_),g):x(_)}function y(_){return _===null||_===62?$(_):te(_)?(o=y,U(_)):(e.consume(_),y)}function v(_){return _===null?n(_):_===63?(e.consume(_),k):te(_)?(o=v,U(_)):(e.consume(_),v)}function k(_){return _===62?$(_):v(_)}function P(_){return Fn(_)?(e.consume(_),b):n(_)}function b(_){return _===45||Bt(_)?(e.consume(_),b):C(_)}function C(_){return te(_)?(o=C,U(_)):he(_)?(e.consume(_),C):$(_)}function j(_){return _===45||Bt(_)?(e.consume(_),j):_===47||_===62||Tt(_)?T(_):n(_)}function T(_){return _===47?(e.consume(_),$):_===58||_===95||Fn(_)?(e.consume(_),E):te(_)?(o=T,U(_)):he(_)?(e.consume(_),T):$(_)}function E(_){return _===45||_===46||_===58||_===95||Bt(_)?(e.consume(_),E):A(_)}function A(_){return _===61?(e.consume(_),M):te(_)?(o=A,U(_)):he(_)?(e.consume(_),A):T(_)}function M(_){return _===null||_===60||_===61||_===62||_===96?n(_):_===34||_===39?(e.consume(_),i=_,F):te(_)?(o=M,U(_)):he(_)?(e.consume(_),M):(e.consume(_),D)}function F(_){return _===i?(e.consume(_),i=void 0,L):_===null?n(_):te(_)?(o=F,U(_)):(e.consume(_),F)}function D(_){return _===null||_===34||_===39||_===60||_===61||_===96?n(_):_===47||_===62||Tt(_)?T(_):(e.consume(_),D)}function L(_){return _===47||_===62||Tt(_)?T(_):n(_)}function $(_){return _===62?(e.consume(_),e.exit("htmlTextData"),e.exit("htmlText"),t):n(_)}function U(_){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),z}function z(_){return he(_)?Ce(e,V,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):V(_)}function V(_){return e.enter("htmlTextData"),o(_)}}const gm={name:"labelEnd",resolveAll:uI,resolveTo:dI,tokenize:hI},aI={tokenize:fI},lI={tokenize:pI},cI={tokenize:mI};function uI(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&Un(e,0,e.length,n),e}function dI(e,t){let n=e.length,r=0,i,s,o,a;for(;n--;)if(i=e[n][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=n);const l={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[s][1].start},end:{...e[o][1].end}},c={type:"labelText",start:{...e[s+r+2][1].end},end:{...e[o-2][1].start}};return a=[["enter",l,t],["enter",u,t]],a=nn(a,e.slice(s+1,s+r+3)),a=nn(a,[["enter",c,t]]),a=nn(a,mm(t.parser.constructs.insideSpan.null,e.slice(s+r+4,o-3),t)),a=nn(a,[["exit",c,t],e[o-2],e[o-1],["exit",u,t]]),a=nn(a,e.slice(o+1)),a=nn(a,[["exit",l,t]]),Un(e,s,e.length,a),e}function hI(e,t,n){const r=this;let i=r.events.length,s,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return a;function a(f){return s?s._inactive?h(f):(o=r.parser.defined.includes(Ps(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelEnd"),l):n(f)}function l(f){return f===40?e.attempt(aI,c,o?c:h)(f):f===91?e.attempt(lI,c,o?u:h)(f):o?c(f):h(f)}function u(f){return e.attempt(cI,c,h)(f)}function c(f){return t(f)}function h(f){return s._balanced=!0,n(f)}}function fI(e,t,n){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),i}function i(h){return Tt(h)?Ko(e,s)(h):s(h)}function s(h){return h===41?c(h):tk(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function o(h){return Tt(h)?Ko(e,l)(h):c(h)}function a(h){return n(h)}function l(h){return h===34||h===39||h===40?rk(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):c(h)}function u(h){return Tt(h)?Ko(e,c)(h):c(h)}function c(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function pI(e,t,n){const r=this;return i;function i(a){return nk.call(r,e,s,o,"reference","referenceMarker","referenceString")(a)}function s(a){return r.parser.defined.includes(Ps(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function o(a){return n(a)}}function mI(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),i}function i(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const gI={name:"labelStartImage",resolveAll:gm.resolveAll,tokenize:yI};function yI(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),s}function s(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 xI={name:"labelStartLink",resolveAll:gm.resolveAll,tokenize:vI};function vI(e,t,n){const r=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),s}function s(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const Ad={name:"lineEnding",tokenize:wI};function wI(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Ce(e,t,"linePrefix")}}const ql={name:"thematicBreak",tokenize:bI};function bI(e,t,n){let r=0,i;return s;function s(u){return e.enter("thematicBreak"),o(u)}function o(u){return i=u,a(u)}function a(u){return u===i?(e.enter("thematicBreakSequence"),l(u)):r>=3&&(u===null||te(u))?(e.exit("thematicBreak"),t(u)):n(u)}function l(u){return u===i?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),he(u)?Ce(e,a,"whitespace")(u):a(u))}}const kt={continuation:{tokenize:CI},exit:PI,name:"list",tokenize:_I},kI={partial:!0,tokenize:EI},SI={partial:!0,tokenize:jI};function _I(e,t,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return a;function a(p){const m=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:Sf(p)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(ql,n,u)(p):u(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(p)}return n(p)}function l(p){return Sf(p)&&++o<10?(e.consume(p),l):(!r.interrupt||o<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),u(p)):n(p)}function u(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(Tu,r.interrupt?n:c,e.attempt(kI,f,h))}function c(p){return r.containerState.initialBlankLine=!0,s++,f(p)}function h(p){return he(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),f):n(p)}function f(p){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function CI(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Tu,i,s);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ce(e,t,"listItemIndent",r.containerState.size+1)(a)}function s(a){return r.containerState.furtherBlankLines||!he(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(SI,t,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ce(e,e.attempt(kt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function jI(e,t,n){const r=this;return Ce(e,i,"listItemIndent",r.containerState.size+1);function i(s){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(s):n(s)}}function PI(e){e.exit(this.containerState.type)}function EI(e,t,n){const r=this;return Ce(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const o=r.events[r.events.length-1];return!he(s)&&o&&o[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const gx={name:"setextUnderline",resolveTo:TI,tokenize:RI};function TI(e,t){let n=e.length,r,i,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",s?(e.splice(i,0,["enter",o,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end={...e[s][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function RI(e,t,n){const r=this;let i;return s;function s(u){let c=r.events.length,h;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){h=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),i=u,o(u)):n(u)}function o(u){return e.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===i?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),he(u)?Ce(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||te(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const II={tokenize:AI};function AI(e){const t=this,n=e.attempt(Tu,r,e.attempt(this.parser.constructs.flowInitial,i,Ce(e,e.attempt(this.parser.constructs.flow,i,e.attempt(zR,i)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const MI={resolveAll:sk()},LI=ik("string"),DI=ik("text");function ik(e){return{resolveAll:sk(e==="text"?NI:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,o,a);return o;function o(c){return u(c)?s(c):a(c)}function a(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),l}function l(c){return u(c)?(n.exit("data"),s(c)):(n.consume(c),l)}function u(c){if(c===null)return!0;const h=i[c];let f=-1;if(h)for(;++f<h.length;){const p=h[f];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function sk(e){return t;function t(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return e?e(n,r):n}}function NI(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let s=i.length,o=-1,a=0,l;for(;s--;){const u=i[s];if(typeof u=="string"){for(o=u.length;u.charCodeAt(o-1)===32;)a++,o--;if(o)break;o=-1}else if(u===-2)l=!0,a++;else if(u!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const u={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?o:r.start._bufferIndex+o,_index:r.start._index+s,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const zI={42:kt,43:kt,45:kt,48:kt,49:kt,50:kt,51:kt,52:kt,53:kt,54:kt,55:kt,56:kt,57:kt,62:Xb},OI={91:VR},FI={[-2]:Id,[-1]:Id,32:Id},$I={35:YR,42:ql,45:[gx,ql],60:JR,61:gx,95:ql,96:px,126:px},BI={38:Zb,92:Jb},VI={[-5]:Ad,[-4]:Ad,[-3]:Ad,33:gI,38:Zb,42:_f,60:[xR,sI],91:xI,92:[GR,Jb],93:gm,95:_f,96:IR},WI={null:[_f,MI]},UI={null:[42,95]},HI={null:[]},GI=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:UI,contentInitial:OI,disable:HI,document:zI,flow:$I,flowInitial:FI,insideSpan:WI,string:BI,text:VI},Symbol.toStringTag,{value:"Module"}));function KI(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},s=[];let o=[],a=[];const l={attempt:C(P),check:C(b),consume:y,enter:v,exit:k,interrupt:C(b,{interrupt:!0})},u={code:null,containerState:{},defineSkip:x,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:h};let c=t.tokenize.call(u,l);return t.resolveAll&&s.push(t),u;function h(A){return o=nn(o,A),w(),o[o.length-1]!==null?[]:(j(t,0),u.events=mm(s,u.events,u),u.events)}function f(A,M){return QI(p(A),M)}function p(A){return YI(o,A)}function m(){const{_bufferIndex:A,_index:M,line:F,column:D,offset:L}=r;return{_bufferIndex:A,_index:M,line:F,column:D,offset:L}}function x(A){i[A.line]=A.column,E()}function w(){let A;for(;r._index<o.length;){const M=o[r._index];if(typeof M=="string")for(A=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===A&&r._bufferIndex<M.length;)g(M.charCodeAt(r._bufferIndex));else g(M)}}function g(A){c=c(A)}function y(A){te(A)?(r.line++,r.column=1,r.offset+=A===-3?2:1,E()):A!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=A}function v(A,M){const F=M||{};return F.type=A,F.start=m(),u.events.push(["enter",F,u]),a.push(F),F}function k(A){const M=a.pop();return M.end=m(),u.events.push(["exit",M,u]),M}function P(A,M){j(A,M.from)}function b(A,M){M.restore()}function C(A,M){return F;function F(D,L,$){let U,z,V,_;return Array.isArray(D)?X(D):"tokenize"in D?X([D]):B(D);function B(de){return ot;function ot(Ve){const K=Ve!==null&&de[Ve],xe=Ve!==null&&de.null,Le=[...Array.isArray(K)?K:K?[K]:[],...Array.isArray(xe)?xe:xe?[xe]:[]];return X(Le)(Ve)}}function X(de){return U=de,z=0,de.length===0?$:I(de[z])}function I(de){return ot;function ot(Ve){return _=T(),V=de,de.partial||(u.currentConstruct=de),de.name&&u.parser.constructs.disable.null.includes(de.name)?fe():de.tokenize.call(M?Object.assign(Object.create(u),M):u,l,ue,fe)(Ve)}}function ue(de){return A(V,_),L}function fe(de){return _.restore(),++z<U.length?I(U[z]):$}}}function j(A,M){A.resolveAll&&!s.includes(A)&&s.push(A),A.resolve&&Un(u.events,M,u.events.length-M,A.resolve(u.events.slice(M),u)),A.resolveTo&&(u.events=A.resolveTo(u.events,u))}function T(){const A=m(),M=u.previous,F=u.currentConstruct,D=u.events.length,L=Array.from(a);return{from:D,restore:$};function $(){r=A,u.previous=M,u.currentConstruct=F,u.events.length=D,a=L,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function YI(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,s=t.end._bufferIndex;let o;if(n===i)o=[e[n].slice(r,s)];else{if(o=e.slice(n,i),r>-1){const a=o[0];typeof a=="string"?o[0]=a.slice(r):o.shift()}s>0&&o.push(e[i].slice(0,s))}return o}function QI(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const s=e[n];let o;if(typeof s=="string")o=s;else switch(s){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&&i)continue;o=" ";break}default:o=String.fromCharCode(s)}i=s===-2,r.push(o)}return r.join("")}function qI(e){const r={constructs:rR([GI,...(e||{}).extensions||[]]),content:i(dR),defined:[],document:i(fR),flow:i(II),lazy:{},string:i(LI),text:i(DI)};return r;function i(s){return o;function o(a){return KI(r,s,a)}}}function XI(e){for(;!ek(e););return e}const yx=/[\0\t\n\r]/g;function JI(){let e=1,t="",n=!0,r;return i;function i(s,o,a){const l=[];let u,c,h,f,p;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(o||void 0).decode(s)),h=0,t="",n&&(s.charCodeAt(0)===65279&&h++,n=void 0);h<s.length;){if(yx.lastIndex=h,u=yx.exec(s),f=u&&u.index!==void 0?u.index:s.length,p=s.charCodeAt(f),!u){t=s.slice(h);break}if(p===10&&h===f&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),h<f&&(l.push(s.slice(h,f)),e+=f-h),p){case 0:{l.push(65533),e++;break}case 9:{for(c=Math.ceil(e/4)*4,l.push(-2);e++<c;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}h=f+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const ZI=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function eA(e){return e.replace(ZI,tA)}function tA(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return qb(n.slice(s?2:1),s?16:10)}return pm(n)||e}const ok={}.hasOwnProperty;function nA(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),rA(n)(XI(qI(n).document().write(JI()(e,t,!0))))}function rA(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Hi),autolinkProtocol:T,autolinkEmail:T,atxHeading:s(Va),blockQuote:s(xe),characterEscape:T,characterReference:T,codeFenced:s(Le),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:s(Le,o),codeText:s(wt,o),codeTextData:T,data:T,codeFlowValue:T,definition:s(Ui),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:s(Ba),hardBreakEscape:s(io),hardBreakTrailing:s(io),htmlFlow:s(so,o),htmlFlowData:T,htmlText:s(so,o),htmlTextData:T,image:s(fr),label:o,link:s(Hi),listItem:s(Gu),listItemValue:f,listOrdered:s(Pn,h),listUnordered:s(Pn),paragraph:s(Wa),reference:I,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:s(Va),strong:s(Ku),thematicBreak:s(ye)},exit:{atxHeading:l(),atxHeadingSequence:P,autolink:l(),autolinkEmail:K,autolinkProtocol:Ve,blockQuote:l(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:fe,characterReferenceMarkerNumeric:fe,characterReferenceValue:de,characterReference:ot,codeFenced:l(w),codeFencedFence:x,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:l(g),codeText:l(L),codeTextData:E,data:E,definition:l(),definitionDestinationString:k,definitionLabelString:y,definitionTitleString:v,emphasis:l(),hardBreakEscape:l(M),hardBreakTrailing:l(M),htmlFlow:l(F),htmlFlowData:E,htmlText:l(D),htmlTextData:E,image:l(U),label:V,labelText:z,lineEnding:A,link:l($),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ue,resourceDestinationString:_,resourceTitleString:B,resource:X,setextHeading:l(j),setextHeadingLineSequence:C,setextHeadingText:b,strong:l(),thematicBreak:l()}};ak(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(O){let G={type:"root",children:[]};const ne={stack:[G],tokenStack:[],config:t,enter:a,exit:u,buffer:o,resume:c,data:n},ae=[];let ve=-1;for(;++ve<O.length;)if(O[ve][1].type==="listOrdered"||O[ve][1].type==="listUnordered")if(O[ve][0]==="enter")ae.push(ve);else{const un=ae.pop();ve=i(O,un,ve)}for(ve=-1;++ve<O.length;){const un=t[O[ve][0]];ok.call(un,O[ve][1].type)&&un[O[ve][1].type].call(Object.assign({sliceSerialize:O[ve][2].sliceSerialize},ne),O[ve][1])}if(ne.tokenStack.length>0){const un=ne.tokenStack[ne.tokenStack.length-1];(un[1]||xx).call(ne,void 0,un[0])}for(G.position={start:mr(O.length>0?O[0][1].start:{line:1,column:1,offset:0}),end:mr(O.length>0?O[O.length-2][1].end:{line:1,column:1,offset:0})},ve=-1;++ve<t.transforms.length;)G=t.transforms[ve](G)||G;return G}function i(O,G,ne){let ae=G-1,ve=-1,un=!1,ii,Kn,oo,ao;for(;++ae<=ne;){const Dt=O[ae];switch(Dt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Dt[0]==="enter"?ve++:ve--,ao=void 0;break}case"lineEndingBlank":{Dt[0]==="enter"&&(ii&&!ao&&!ve&&!oo&&(oo=ae),ao=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ao=void 0}if(!ve&&Dt[0]==="enter"&&Dt[1].type==="listItemPrefix"||ve===-1&&Dt[0]==="exit"&&(Dt[1].type==="listUnordered"||Dt[1].type==="listOrdered")){if(ii){let Gi=ae;for(Kn=void 0;Gi--;){const Yn=O[Gi];if(Yn[1].type==="lineEnding"||Yn[1].type==="lineEndingBlank"){if(Yn[0]==="exit")continue;Kn&&(O[Kn][1].type="lineEndingBlank",un=!0),Yn[1].type="lineEnding",Kn=Gi}else if(!(Yn[1].type==="linePrefix"||Yn[1].type==="blockQuotePrefix"||Yn[1].type==="blockQuotePrefixWhitespace"||Yn[1].type==="blockQuoteMarker"||Yn[1].type==="listItemIndent"))break}oo&&(!Kn||oo<Kn)&&(ii._spread=!0),ii.end=Object.assign({},Kn?O[Kn][1].start:Dt[1].end),O.splice(Kn||ae,0,["exit",ii,Dt[2]]),ae++,ne++}if(Dt[1].type==="listItemPrefix"){const Gi={type:"listItem",_spread:!1,start:Object.assign({},Dt[1].start),end:void 0};ii=Gi,O.splice(ae,0,["enter",Gi,Dt[2]]),ae++,ne++,oo=void 0,ao=!0}}}return O[G][1]._spread=un,ne}function s(O,G){return ne;function ne(ae){a.call(this,O(ae),ae),G&&G.call(this,ae)}}function o(){this.stack.push({type:"fragment",children:[]})}function a(O,G,ne){this.stack[this.stack.length-1].children.push(O),this.stack.push(O),this.tokenStack.push([G,ne||void 0]),O.position={start:mr(G.start),end:void 0}}function l(O){return G;function G(ne){O&&O.call(this,ne),u.call(this,ne)}}function u(O,G){const ne=this.stack.pop(),ae=this.tokenStack.pop();if(ae)ae[0].type!==O.type&&(G?G.call(this,O,ae[0]):(ae[1]||xx).call(this,O,ae[0]));else throw new Error("Cannot close `"+O.type+"` ("+Go({start:O.start,end:O.end})+"): it’s not open");ne.position.end=mr(O.end)}function c(){return tR(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function f(O){if(this.data.expectingFirstListItemValue){const G=this.stack[this.stack.length-2];G.start=Number.parseInt(this.sliceSerialize(O),10),this.data.expectingFirstListItemValue=void 0}}function p(){const O=this.resume(),G=this.stack[this.stack.length-1];G.lang=O}function m(){const O=this.resume(),G=this.stack[this.stack.length-1];G.meta=O}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function w(){const O=this.resume(),G=this.stack[this.stack.length-1];G.value=O.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function g(){const O=this.resume(),G=this.stack[this.stack.length-1];G.value=O.replace(/(\r?\n|\r)$/g,"")}function y(O){const G=this.resume(),ne=this.stack[this.stack.length-1];ne.label=G,ne.identifier=Ps(this.sliceSerialize(O)).toLowerCase()}function v(){const O=this.resume(),G=this.stack[this.stack.length-1];G.title=O}function k(){const O=this.resume(),G=this.stack[this.stack.length-1];G.url=O}function P(O){const G=this.stack[this.stack.length-1];if(!G.depth){const ne=this.sliceSerialize(O).length;G.depth=ne}}function b(){this.data.setextHeadingSlurpLineEnding=!0}function C(O){const G=this.stack[this.stack.length-1];G.depth=this.sliceSerialize(O).codePointAt(0)===61?1:2}function j(){this.data.setextHeadingSlurpLineEnding=void 0}function T(O){const ne=this.stack[this.stack.length-1].children;let ae=ne[ne.length-1];(!ae||ae.type!=="text")&&(ae=Ua(),ae.position={start:mr(O.start),end:void 0},ne.push(ae)),this.stack.push(ae)}function E(O){const G=this.stack.pop();G.value+=this.sliceSerialize(O),G.position.end=mr(O.end)}function A(O){const G=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ne=G.children[G.children.length-1];ne.position.end=mr(O.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(G.type)&&(T.call(this,O),E.call(this,O))}function M(){this.data.atHardBreak=!0}function F(){const O=this.resume(),G=this.stack[this.stack.length-1];G.value=O}function D(){const O=this.resume(),G=this.stack[this.stack.length-1];G.value=O}function L(){const O=this.resume(),G=this.stack[this.stack.length-1];G.value=O}function $(){const O=this.stack[this.stack.length-1];if(this.data.inReference){const G=this.data.referenceType||"shortcut";O.type+="Reference",O.referenceType=G,delete O.url,delete O.title}else delete O.identifier,delete O.label;this.data.referenceType=void 0}function U(){const O=this.stack[this.stack.length-1];if(this.data.inReference){const G=this.data.referenceType||"shortcut";O.type+="Reference",O.referenceType=G,delete O.url,delete O.title}else delete O.identifier,delete O.label;this.data.referenceType=void 0}function z(O){const G=this.sliceSerialize(O),ne=this.stack[this.stack.length-2];ne.label=eA(G),ne.identifier=Ps(G).toLowerCase()}function V(){const O=this.stack[this.stack.length-1],G=this.resume(),ne=this.stack[this.stack.length-1];if(this.data.inReference=!0,ne.type==="link"){const ae=O.children;ne.children=ae}else ne.alt=G}function _(){const O=this.resume(),G=this.stack[this.stack.length-1];G.url=O}function B(){const O=this.resume(),G=this.stack[this.stack.length-1];G.title=O}function X(){this.data.inReference=void 0}function I(){this.data.referenceType="collapsed"}function ue(O){const G=this.resume(),ne=this.stack[this.stack.length-1];ne.label=G,ne.identifier=Ps(this.sliceSerialize(O)).toLowerCase(),this.data.referenceType="full"}function fe(O){this.data.characterReferenceType=O.type}function de(O){const G=this.sliceSerialize(O),ne=this.data.characterReferenceType;let ae;ne?(ae=qb(G,ne==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ae=pm(G);const ve=this.stack[this.stack.length-1];ve.value+=ae}function ot(O){const G=this.stack.pop();G.position.end=mr(O.end)}function Ve(O){E.call(this,O);const G=this.stack[this.stack.length-1];G.url=this.sliceSerialize(O)}function K(O){E.call(this,O);const G=this.stack[this.stack.length-1];G.url="mailto:"+this.sliceSerialize(O)}function xe(){return{type:"blockquote",children:[]}}function Le(){return{type:"code",lang:null,meta:null,value:""}}function wt(){return{type:"inlineCode",value:""}}function Ui(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ba(){return{type:"emphasis",children:[]}}function Va(){return{type:"heading",depth:0,children:[]}}function io(){return{type:"break"}}function so(){return{type:"html",value:""}}function fr(){return{type:"image",title:null,url:"",alt:null}}function Hi(){return{type:"link",title:null,url:"",children:[]}}function Pn(O){return{type:"list",ordered:O.type==="listOrdered",start:null,spread:O._spread,children:[]}}function Gu(O){return{type:"listItem",spread:O._spread,checked:null,children:[]}}function Wa(){return{type:"paragraph",children:[]}}function Ku(){return{type:"strong",children:[]}}function Ua(){return{type:"text",value:""}}function ye(){return{type:"thematicBreak"}}}function mr(e){return{line:e.line,column:e.column,offset:e.offset}}function ak(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?ak(e,r):iA(e,r)}}function iA(e,t){let n;for(n in t)if(ok.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 xx(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Go({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Go({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Go({start:t.start,end:t.end})+") is still open")}function sA(e){const t=this;t.parser=n;function n(r){return nA(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function oA(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 aA(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
61
|
-
`}]}function lA(e,t){const n=t.value?t.value+`
|
|
62
|
-
`:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function cA(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function uA(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function dA(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=qs(r.toLowerCase()),s=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=s+1,a+=1,e.footnoteCounts.set(r,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,u),e.applyData(t,u)}function hA(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 fA(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function lk(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function pA(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return lk(e,t);const i={src:qs(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,s),e.applyData(t,s)}function mA(e,t){const n={src:qs(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 gA(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 yA(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return lk(e,t);const i={href:qs(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function xA(e,t){const n={href:qs(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 vA(e,t,n){const r=e.all(t),i=n?wA(n):ck(t),s={},o=[];if(typeof t.checked=="boolean"){const c=r[0];let h;c&&c.type==="element"&&c.tagName==="p"?h=c:(h={type:"element",tagName:"p",properties:{},children:[]},r.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const c=r[a];(i||a!==0||c.type!=="element"||c.tagName!=="p")&&o.push({type:"text",value:`
|
|
63
|
-
`}),c.type==="element"&&c.tagName==="p"&&!i?o.push(...c.children):o.push(c)}const l=r[r.length-1];l&&(i||l.type!=="element"||l.tagName!=="p")&&o.push({type:"text",value:`
|
|
64
|
-
`});const u={type:"element",tagName:"li",properties:s,children:o};return e.patch(t,u),e.applyData(t,u)}function wA(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=ck(n[r])}return t}function ck(e){const t=e.spread;return t??e.children.length>1}function bA(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const o=r[i];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 s={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function kA(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function SA(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function _A(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function CA(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),i.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=um(t.children[1]),l=Wb(t.children[t.children.length-1]);a&&l&&(o.position={start:a,end:l}),i.push(o)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)}function jA(e,t,n){const r=n?n.children:void 0,s=(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 u=[];for(;++l<a;){const h=t.children[l],f={},p=o?o[l]:void 0;p&&(f.align=p);let m={type:"element",tagName:s,properties:f,children:[]};h&&(m.children=e.all(h),e.patch(h,m),m=e.applyData(h,m)),u.push(m)}const c={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,c),e.applyData(t,c)}function PA(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const vx=9,wx=32;function EA(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const s=[];for(;r;)s.push(bx(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return s.push(bx(t.slice(i),i>0,!1)),s.join("")}function bx(e,t,n){let r=0,i=e.length;if(t){let s=e.codePointAt(r);for(;s===vx||s===wx;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(i-1);for(;s===vx||s===wx;)i--,s=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function TA(e,t){const n={type:"text",value:EA(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function RA(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const IA={blockquote:oA,break:aA,code:lA,delete:cA,emphasis:uA,footnoteReference:dA,heading:hA,html:fA,imageReference:pA,image:mA,inlineCode:gA,linkReference:yA,link:xA,listItem:vA,list:bA,paragraph:kA,root:SA,strong:_A,table:CA,tableCell:PA,tableRow:jA,text:TA,thematicBreak:RA,toml:hl,yaml:hl,definition:hl,footnoteDefinition:hl};function hl(){}const uk=-1,Ru=0,Yo=1,Bc=2,ym=3,xm=4,vm=5,wm=6,dk=7,hk=8,AA=typeof self=="object"?self:globalThis,kx=(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 AA[e](t)},MA=(e,t)=>{const n=(i,s)=>(e.set(s,i),i),r=i=>{if(e.has(i))return e.get(i);const[s,o]=t[i];switch(s){case Ru:case uk:return n(o,i);case Yo:{const a=n([],i);for(const l of o)a.push(r(l));return a}case Bc:{const a=n({},i);for(const[l,u]of o)a[r(l)]=r(u);return a}case ym:return n(new Date(o),i);case xm:{const{source:a,flags:l}=o;return n(new RegExp(a,l),i)}case vm:{const a=n(new Map,i);for(const[l,u]of o)a.set(r(l),r(u));return a}case wm:{const a=n(new Set,i);for(const l of o)a.add(r(l));return a}case dk:{const{name:a,message:l}=o;return n(kx(a,l),i)}case hk:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);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(kx(s,o),i)};return r},Sx=e=>MA(new Map,e)(0),Qi="",{toString:LA}={},{keys:DA}=Object,ko=e=>{const t=typeof e;if(t!=="object"||!e)return[Ru,t];const n=LA.call(e).slice(8,-1);switch(n){case"Array":return[Yo,Qi];case"Object":return[Bc,Qi];case"Date":return[ym,Qi];case"RegExp":return[xm,Qi];case"Map":return[vm,Qi];case"Set":return[wm,Qi];case"DataView":return[Yo,n]}return n.includes("Array")?[Yo,n]:n.includes("Error")?[dk,n]:[Bc,n]},fl=([e,t])=>e===Ru&&(t==="function"||t==="symbol"),NA=(e,t,n,r)=>{const i=(o,a)=>{const l=r.push(o)-1;return n.set(a,l),l},s=o=>{if(n.has(o))return n.get(o);let[a,l]=ko(o);switch(a){case Ru:{let c=o;switch(l){case"bigint":a=hk,c=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);c=null;break;case"undefined":return i([uk],o)}return i([a,c],o)}case Yo:{if(l){let f=o;return l==="DataView"?f=new Uint8Array(o.buffer):l==="ArrayBuffer"&&(f=new Uint8Array(o)),i([l,[...f]],o)}const c=[],h=i([a,c],o);for(const f of o)c.push(s(f));return h}case Bc:{if(l)switch(l){case"BigInt":return i([l,o.toString()],o);case"Boolean":case"Number":case"String":return i([l,o.valueOf()],o)}if(t&&"toJSON"in o)return s(o.toJSON());const c=[],h=i([a,c],o);for(const f of DA(o))(e||!fl(ko(o[f])))&&c.push([s(f),s(o[f])]);return h}case ym:return i([a,o.toISOString()],o);case xm:{const{source:c,flags:h}=o;return i([a,{source:c,flags:h}],o)}case vm:{const c=[],h=i([a,c],o);for(const[f,p]of o)(e||!(fl(ko(f))||fl(ko(p))))&&c.push([s(f),s(p)]);return h}case wm:{const c=[],h=i([a,c],o);for(const f of o)(e||!fl(ko(f)))&&c.push(s(f));return h}}const{message:u}=o;return i([a,{name:l,message:u}],o)};return s},_x=(e,{json:t,lossy:n}={})=>{const r=[];return NA(!(t||n),!!t,new Map,r)(e),r},Vc=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Sx(_x(e,t)):structuredClone(e):(e,t)=>Sx(_x(e,t));function zA(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 OA(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function FA(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||zA,r=e.options.footnoteBackLabel||OA,i=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[l]);if(!u)continue;const c=e.all(u),h=String(u.identifier).toUpperCase(),f=qs(h.toLowerCase());let p=0;const m=[],x=e.footnoteCounts.get(h);for(;x!==void 0&&++p<=x;){m.length>0&&m.push({type:"text",value:" "});let y=typeof n=="string"?n:n(l,p);typeof y=="string"&&(y={type:"text",value:y}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+f+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,p),className:["data-footnote-backref"]},children:Array.isArray(y)?y:[y]})}const w=c[c.length-1];if(w&&w.type==="element"&&w.tagName==="p"){const y=w.children[w.children.length-1];y&&y.type==="text"?y.value+=" ":w.children.push({type:"text",value:" "}),w.children.push(...m)}else c.push(...m);const g={type:"element",tagName:"li",properties:{id:t+"fn-"+f},children:e.wrap(c,!0)};e.patch(u,g),a.push(g)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...Vc(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
65
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
|
|
66
|
-
`}]}}const fk=function(e){if(e==null)return WA;if(typeof e=="function")return Iu(e);if(typeof e=="object")return Array.isArray(e)?$A(e):BA(e);if(typeof e=="string")return VA(e);throw new Error("Expected function, string, or object as test")};function $A(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=fk(e[n]);return Iu(r);function r(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function BA(e){const t=e;return Iu(n);function n(r){const i=r;let s;for(s in e)if(i[s]!==t[s])return!1;return!0}}function VA(e){return Iu(t);function t(n){return n&&n.type===e}}function Iu(e){return t;function t(n,r,i){return!!(UA(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function WA(){return!0}function UA(e){return e!==null&&typeof e=="object"&&"type"in e}const pk=[],HA=!0,Cx=!1,GA="skip";function KA(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const s=fk(i),o=r?-1:1;a(e,void 0,[])();function a(l,u,c){const h=l&&typeof l=="object"?l:{};if(typeof h.type=="string"){const p=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(f,"name",{value:"node ("+(l.type+(p?"<"+p+">":""))+")"})}return f;function f(){let p=pk,m,x,w;if((!t||s(l,u,c[c.length-1]||void 0))&&(p=YA(n(l,c)),p[0]===Cx))return p;if("children"in l&&l.children){const g=l;if(g.children&&p[0]!==GA)for(x=(r?g.children.length:-1)+o,w=c.concat(g);x>-1&&x<g.children.length;){const y=g.children[x];if(m=a(y,x,w)(),m[0]===Cx)return m;x=typeof m[1]=="number"?m[1]:x+o}}return p}}}function YA(e){return Array.isArray(e)?e:typeof e=="number"?[HA,e]:e==null?pk:[e]}function mk(e,t,n,r){let i,s,o;typeof t=="function"&&typeof n!="function"?(s=void 0,o=t,i=n):(s=t,o=n,i=r),KA(e,s,a,i);function a(l,u){const c=u[u.length-1],h=c?c.children.indexOf(l):void 0;return o(l,h,c)}}const Cf={}.hasOwnProperty,QA={};function qA(e,t){const n=t||QA,r=new Map,i=new Map,s=new Map,o={...IA,...n.handlers},a={all:u,applyData:JA,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:o,one:l,options:n,patch:XA,wrap:eM};return mk(e,function(c){if(c.type==="definition"||c.type==="footnoteDefinition"){const h=c.type==="definition"?r:i,f=String(c.identifier).toUpperCase();h.has(f)||h.set(f,c)}}),a;function l(c,h){const f=c.type,p=a.handlers[f];if(Cf.call(a.handlers,f)&&p)return p(a,c,h);if(a.options.passThrough&&a.options.passThrough.includes(f)){if("children"in c){const{children:x,...w}=c,g=Vc(w);return g.children=a.all(c),g}return Vc(c)}return(a.options.unknownHandler||ZA)(a,c,h)}function u(c){const h=[];if("children"in c){const f=c.children;let p=-1;for(;++p<f.length;){const m=a.one(f[p],c);if(m){if(p&&f[p-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=jx(m.value)),!Array.isArray(m)&&m.type==="element")){const x=m.children[0];x&&x.type==="text"&&(x.value=jx(x.value))}Array.isArray(m)?h.push(...m):h.push(m)}}}return h}}function XA(e,t){e.position&&(t.position=M2(e))}function JA(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,s=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const o="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:o}}n.type==="element"&&s&&Object.assign(n.properties,Vc(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function ZA(e,t){const n=t.data||{},r="value"in t&&!(Cf.call(n,"hProperties")||Cf.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 eM(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 jx(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Px(e,t){const n=qA(e,t),r=n.one(e,void 0),i=FA(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
|
|
70
|
-
`},i),s}function tM(e,t){return e&&"run"in e?async function(n,r){const i=Px(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Px(n,{file:r,...e||t})}}function Ex(e){if(e)throw e}var Xl=Object.prototype.hasOwnProperty,gk=Object.prototype.toString,Tx=Object.defineProperty,Rx=Object.getOwnPropertyDescriptor,Ix=function(t){return typeof Array.isArray=="function"?Array.isArray(t):gk.call(t)==="[object Array]"},Ax=function(t){if(!t||gk.call(t)!=="[object Object]")return!1;var n=Xl.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Xl.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Xl.call(t,i)},Mx=function(t,n){Tx&&n.name==="__proto__"?Tx(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Lx=function(t,n){if(n==="__proto__")if(Xl.call(t,n)){if(Rx)return Rx(t,n).value}else return;return t[n]},nM=function e(){var t,n,r,i,s,o,a=arguments[0],l=1,u=arguments.length,c=!1;for(typeof a=="boolean"&&(c=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});l<u;++l)if(t=arguments[l],t!=null)for(n in t)r=Lx(a,n),i=Lx(t,n),a!==i&&(c&&i&&(Ax(i)||(s=Ix(i)))?(s?(s=!1,o=r&&Ix(r)?r:[]):o=r&&Ax(r)?r:{},Mx(a,{name:n,newValue:e(c,o,i)})):typeof i<"u"&&Mx(a,{name:n,newValue:i}));return a};const Md=au(nM);function jf(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 rM(){const e=[],t={run:n,use:r};return t;function n(...i){let s=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);a(null,...i);function a(l,...u){const c=e[++s];let h=-1;if(l){o(l);return}for(;++h<i.length;)(u[h]===null||u[h]===void 0)&&(u[h]=i[h]);i=u,c?iM(c,a)(...u):o(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function iM(e,t){let n;return r;function r(...o){const a=e.length>o.length;let l;a&&o.push(i);try{l=e.apply(this,o)}catch(u){const c=u;if(a&&n)throw c;return i(c)}a||(l&&l.then&&typeof l.then=="function"?l.then(s,i):l instanceof Error?i(l):s(l))}function i(o,...a){n||(n=!0,t(o,...a))}function s(o){i(null,o)}}const Mn={basename:sM,dirname:oM,extname:aM,join:lM,sep:"/"};function sM(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Ma(e);let n=0,r=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else o<0&&(s=!0,o=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function oM(e){if(Ma(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 aM(e){Ma(e);let t=e.length,n=-1,r=0,i=-1,s=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?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function lM(...e){let t=-1,n;for(;++t<e.length;)Ma(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":cM(n)}function cM(e){Ma(e);const t=e.codePointAt(0)===47;let n=uM(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function uM(e,t){let n="",r=0,i=-1,s=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(!(i===o-1||s===1))if(i!==o-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=o,s=0;continue}}else if(n.length>0){n="",r=0,i=o,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,s=0}else a===46&&s>-1?s++:s=-1}return n}function Ma(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const dM={cwd:hM};function hM(){return"/"}function Pf(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function fM(e){if(typeof e=="string")e=new URL(e);else if(!Pf(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 pM(e)}function pM(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const Ld=["history","path","basename","stem","extname","dirname"];class yk{constructor(t){let n;t?Pf(t)?n={path:t}:typeof t=="string"||mM(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":dM.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Ld.length;){const s=Ld[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)Ld.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Mn.basename(this.path):void 0}set basename(t){Nd(t,"basename"),Dd(t,"basename"),this.path=Mn.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Mn.dirname(this.path):void 0}set dirname(t){Dx(this.basename,"dirname"),this.path=Mn.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Mn.extname(this.path):void 0}set extname(t){if(Dd(t,"extname"),Dx(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=Mn.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Pf(t)&&(t=fM(t)),Nd(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Mn.basename(this.path,this.extname):void 0}set stem(t){Nd(t,"stem"),Dd(t,"stem"),this.path=Mn.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new ft(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Dd(e,t){if(e&&e.includes(Mn.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Mn.sep+"`")}function Nd(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Dx(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function mM(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const gM=function(e){const r=this.constructor.prototype,i=r[e],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s},yM={}.hasOwnProperty;class bm extends gM{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=rM()}copy(){const t=new bm;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Md(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Fd("data",this.frozen),this.namespace[t]=n,this):yM.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Fd("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=pl(t),r=this.parser||this.Parser;return zd("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),zd("process",this.parser||this.Parser),Od("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,o){const a=pl(t),l=r.parse(a);r.run(l,a,function(c,h,f){if(c||!h||!f)return u(c);const p=h,m=r.stringify(p,f);wM(m)?f.value=m:f.result=m,u(c,f)});function u(c,h){c||!h?o(c):s?s(h):n(void 0,h)}}}processSync(t){let n=!1,r;return this.freeze(),zd("processSync",this.parser||this.Parser),Od("processSync",this.compiler||this.Compiler),this.process(t,i),zx("processSync","process",n),r;function i(s,o){n=!0,Ex(s),r=o}}run(t,n,r){Nx(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(o,a){const l=pl(n);i.run(t,l,u);function u(c,h,f){const p=h||t;c?a(c):o?o(p):r(void 0,p,f)}}}runSync(t,n){let r=!1,i;return this.run(t,n,s),zx("runSync","run",r),i;function s(o,a){Ex(o),i=a,r=!0}}stringify(t,n){this.freeze();const r=pl(n),i=this.compiler||this.Compiler;return Od("stringify",i),Nx(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Fd("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 s(u){if(typeof u=="function")l(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[c,...h]=u;l(c,h)}else o(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function o(u){if(!("plugins"in u)&&!("settings"in u))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(u.plugins),u.settings&&(i.settings=Md(!0,i.settings,u.settings))}function a(u){let c=-1;if(u!=null)if(Array.isArray(u))for(;++c<u.length;){const h=u[c];s(h)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function l(u,c){let h=-1,f=-1;for(;++h<r.length;)if(r[h][0]===u){f=h;break}if(f===-1)r.push([u,...c]);else if(c.length>0){let[p,...m]=c;const x=r[f][1];jf(x)&&jf(p)&&(p=Md(!0,x,p)),r[f]=[u,p,...m]}}}}const xM=new bm().freeze();function zd(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Od(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Fd(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 Nx(e){if(!jf(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 pl(e){return vM(e)?e:new yk(e)}function vM(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function wM(e){return typeof e=="string"||bM(e)}function bM(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const kM="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Ox=[],Fx={allowDangerousHtml:!0},SM=/^(https?|ircs?|mailto|xmpp)$/i,_M=[{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 CM(e){const t=jM(e),n=PM(e);return EM(t.runSync(t.parse(n),n),e)}function jM(e){const t=e.rehypePlugins||Ox,n=e.remarkPlugins||Ox,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Fx}:Fx;return xM().use(sA).use(n).use(tM,r).use(t)}function PM(e){const t=e.children||"",n=new yk;return typeof t=="string"&&(n.value=t),n}function EM(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,s=t.disallowedElements,o=t.skipHtml,a=t.unwrapDisallowed,l=t.urlTransform||TM;for(const c of _M)Object.hasOwn(t,c.from)&&(""+c.from+(c.to?"use `"+c.to+"` instead":"remove it")+kM+c.id,void 0);return mk(e,u),O2(e,{Fragment:d.Fragment,components:i,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0});function u(c,h,f){if(c.type==="raw"&&f&&typeof h=="number")return o?f.children.splice(h,1):f.children[h]={type:"text",value:c.value},h;if(c.type==="element"){let p;for(p in Rd)if(Object.hasOwn(Rd,p)&&Object.hasOwn(c.properties,p)){const m=c.properties[p],x=Rd[p];(x===null||x.includes(c.tagName))&&(c.properties[p]=l(String(m||""),p,c))}}if(c.type==="element"){let p=n?!n.includes(c.tagName):s?s.includes(c.tagName):!1;if(!p&&r&&typeof h=="number"&&(p=!r(c,h,f)),p&&f&&typeof h=="number")return a&&c.children?f.children.splice(h,1,...c.children):f.children.splice(h,1),h}}}function TM(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||SM.test(e.slice(0,t))?e:""}const $d=e=>({fontFamily:je.serif,fontWeight:600,fontSize:e,margin:`${R[6]} 0 ${R[3]}`,lineHeight:1.25}),RM={p:({children:e})=>d.jsx("p",{style:{margin:`0 0 ${R[4]}`},children:e}),strong:({children:e})=>d.jsx("strong",{style:{fontWeight:700},children:e}),h1:({children:e})=>d.jsx("h1",{style:$d(J.lg),children:e}),h2:({children:e})=>d.jsx("h2",{style:$d("1.3rem"),children:e}),h3:({children:e})=>d.jsx("h3",{style:$d("1.1rem"),children:e}),a:({children:e,href:t})=>d.jsx("a",{href:t,target:"_blank",rel:"noreferrer",style:{color:ie.accentAmberDark},children:e}),code:({children:e})=>d.jsx("code",{style:{fontFamily:je.mono,fontSize:"0.85em",background:"rgba(0,0,0,0.06)",borderRadius:3,padding:"0.1em 0.35em"},children:e}),pre:({children:e})=>d.jsx("pre",{style:{fontFamily:je.mono,fontSize:"0.85em",background:"rgba(0,0,0,0.06)",borderRadius:6,padding:`${R[3]} ${R[4]}`,overflowX:"auto",margin:`0 0 ${R[4]}`},children:e}),ul:({children:e})=>d.jsx("ul",{style:{listStyle:"disc",margin:`0 0 ${R[4]}`,paddingLeft:"1.4rem"},children:e}),ol:({children:e})=>d.jsx("ol",{style:{listStyle:"decimal",margin:`0 0 ${R[4]}`,paddingLeft:"1.4rem"},children:e}),li:({children:e})=>d.jsx("li",{style:{marginBottom:"0.4rem"},children:e}),blockquote:({children:e})=>d.jsx("blockquote",{style:{margin:`0 0 ${R[4]}`,paddingLeft:R[4],borderLeft:"3px solid rgba(0,0,0,0.15)",opacity:.85},children:e})},ka=({children:e})=>d.jsx(CM,{components:RM,children:e}),Wc=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`},km=e=>{if(e.phases.length===0)return null;const t=e.phases.filter(n=>n.done).length;return{done:t,total:e.phases.length,pct:Math.round(t/e.phases.length*100)}},$x=e=>{var t;return((t=km(e))==null?void 0:t.pct)??null},Sm=(e,t)=>e?t.find(n=>n.planId===e&&n.status!=="done"&&n.status!=="error"):void 0,_m=(e,t)=>e.status==="done"||e.status==="dropped"?e.status:Sm(e.id,t)?"in-progress":e.status,xk=(e,t)=>(e??[]).filter(n=>n.state==="open"&&(t.kind==="phase"?n.anchor.kind==="phase"&&n.anchor.index===t.index:n.anchor.kind==="body")),vk=e=>(e??[]).filter(t=>t.state==="open"),IM=(e,t)=>e.kind==="phase"&&t.kind==="phase"?e.index===t.index:e.kind===t.kind,AM=(e,t)=>(e??[]).map(n=>n.state==="open"&&t.some(r=>IM(r.anchor,n.anchor)&&r.prose===n.prose)?{...n,state:"resolved"}:n),MM=(e,t)=>{const n=new Set(t.tags);return t.subject&&n.add(t.subject),n.size===0?[]:e.filter(r=>(r.tags??[]).some(i=>n.has(i))).sort((r,i)=>i.date.localeCompare(r.date))},LM=(e,t)=>{if(e)return e.find(n=>n.status==="in-progress"||n.status==="review")};function wi(e,t){const n=e.split(/(\s+)/).filter(c=>c!==""),r=t.split(/(\s+)/).filter(c=>c!==""),i=n.length,s=r.length,o=Array.from({length:i+1},()=>new Array(s+1).fill(0));for(let c=i-1;c>=0;c--)for(let h=s-1;h>=0;h--)o[c][h]=n[c]===r[h]?o[c+1][h+1]+1:Math.max(o[c+1][h],o[c][h+1]);const a=[];let l=0,u=0;for(;l<i&&u<s;)n[l]===r[u]?(a.push({type:"same",text:n[l]}),l++,u++):o[l+1][u]>=o[l][u+1]?(a.push({type:"removed",text:n[l]}),l++):(a.push({type:"added",text:r[u]}),u++);for(;l<i;)a.push({type:"removed",text:n[l]}),l++;for(;u<s;)a.push({type:"added",text:r[u]}),u++;return DM(a)}function DM(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 NM=["idea","planned","in-progress","review","done","dropped"],zM=["feat","fix","chore","docs","refactor"],OM=["claude-code","opencode"],wk={"claude-code":"Claude Code",opencode:"OpenCode"},f9={"claude-code":{model:["opus","sonnet","fable","haiku"],effort:["low","medium","high","xhigh","max"]},opencode:{model:null}},p9={phase:{agent:"opencode"},planDraft:{agent:"claude-code"},ideaExtend:{agent:"claude-code"},commitSuggest:{agent:"claude-code"}},FM=["in-progress","review","planned","idea"],$M=["open"],Cm={statuses:FM,tags:[],search:"",sortKey:"order",sortDirection:"asc",noteStatuses:$M,subject:null},Bx={"in-progress":0,review:1,planned:2,idea:3,done:4,dropped:5},ml=e=>{const t=new Date(e.updated??e.created).getTime();return Number.isNaN(t)?0:t},Vx=e=>{const t=new Date(e.created).getTime();return Number.isNaN(t)?0:t},Wx=e=>{var n;const t=(n=e.id)==null?void 0:n.match(/(\d+)\s*$/);return t?Number(t[1]):Number.POSITIVE_INFINITY},Bd=(e,t)=>{const n=t.trim().toLowerCase();return n?e.title.toLowerCase().includes(n)||e.body.toLowerCase().includes(n):!0},Ux=(e,t)=>t.size===0?!0:e.tags.some(n=>t.has(n)),Qo=(e,t)=>t===null||e===t,jm=(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:Vx(e)-Vx(t);const i=(()=>{switch(n){case"status":{const s=Bx[e.status]-Bx[t.status];return s!==0?s:ml(t)-ml(e)}case"updated":return ml(t)-ml(e);case"title":return e.title.localeCompare(t.title);case"id":return Wx(e)-Wx(t);case"progress":return($x(t)??-1)-($x(e)??-1);default:return 0}})();return r==="desc"?-i:i},Ef=(e,t)=>{const n={};for(const r of e)for(const i of t(r))n[String(i)]=(n[String(i)]??0)+1;return n},Jl=(e,t=Cm)=>{const n=new Set(t.tags),r=new Set(t.statuses),i=Ef(e.filter(a=>Ux(a,n)&&Bd(a,t.search)&&Qo(a.subject,t.subject)),a=>[a.status]);for(const a of NM)i[a]??(i[a]=0);const s=Ef(e.filter(a=>r.has(a.status)&&Bd(a,t.search)&&Qo(a.subject,t.subject)),a=>a.tags);return{rows:e.filter(a=>r.has(a.status)&&Ux(a,n)&&Bd(a,t.search)&&Qo(a.subject,t.subject)).sort((a,l)=>jm(a,l,t.sortKey,t.sortDirection)),statusCounts:i,tagCounts:s}},BM=["open","done","dropped"],VM={open:"idea",done:"done",dropped:"dropped"},Vd=(e,t)=>{const n=t.trim().toLowerCase();return n?e.title.toLowerCase().includes(n)||e.body.toLowerCase().includes(n):!0},WM=e=>e.type==="plan"?e.plan.subject:e.idea.subject,UM=(e,t)=>{var a;const n=[],r=new Map,i=[];for(const l of e){const u=WM(l);if(!u||t&&!t.includes(u)){i.push(l);continue}r.has(u)||(n.push(u),r.set(u,[])),(a=r.get(u))==null||a.push(l)}const o=(t?t.filter(l=>r.has(l)):n).map(l=>({subject:l,rows:r.get(l)??[]}));return i.length>0&&o.push({subject:null,rows:i}),o},Hx=e=>e.type==="plan"?e.plan:e.type==="note"?{title:e.idea.title,id:e.idea.id??void 0,status:VM[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)=>jm(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},HM=(e,t,n=Cm)=>{const{statusCounts:r,tagCounts:i}=Jl(e,n),s=t.filter(p=>p.kind==="note"),o=t.filter(p=>p.kind!=="note"),a=new Set(o.map(p=>p.id).filter(p=>!!p)),l=new Map,u=[];for(const p of e)if(p.idea&&a.has(p.idea)){const m=l.get(p.idea)??[];m.push(p),l.set(p.idea,m)}else u.push(p);const c=new Set(n.noteStatuses),h=Ef(s.filter(p=>Vd(p,n.search)),p=>[p.status??"open"]);for(const p of BM)h[p]??(h[p]=0);const f=Jl(u,n).rows.map(p=>({type:"plan",plan:p}));for(const p of o){const m=p.id?l.get(p.id)??[]:[],x=Jl(m,n).rows;!Qo(p.subject,n.subject)&&x.length===0||x.length===0&&(m.length>0||!Vd(p,n.search))||f.push({type:"idea-group",idea:p,children:x})}for(const p of s)c.has(p.status??"open")&&Vd(p,n.search)&&Qo(p.subject,n.subject)&&f.push({type:"note",idea:p});return f.sort((p,m)=>jm(Hx(p),Hx(m),n.sortKey,n.sortDirection)),{rows:f,statusCounts:r,tagCounts:i,noteStatusCounts:h}},GM=.2,KM=5,bk=3,kk=2,Sk=1,YM=bk+kk+Sk,QM=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"]),gl=e=>{const t=e.toLowerCase().split(/[^a-z0-9]+/).filter(n=>n.length>=2&&!QM.has(n));return new Set(t)},Wd=(e,t)=>{let n=0;for(const r of e)t.has(r)&&(n+=1);return n};function qM(e,t,n={}){const{threshold:r=GM,limit:i=KM}=n,s=gl(e);if(s.size===0)return[];const o=[];for(const a of t){const l=gl(a.title),u=gl(a.body),c=gl((a.tags??[]).join(" ")),f=(Wd(s,l)*bk+Wd(s,c)*kk+Wd(s,u)*Sk)/(s.size*YM);f>=r&&o.push({candidate:a,score:f})}return o.sort((a,l)=>l.score-a.score),o.slice(0,i)}const XM=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}`},JM=(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=[XM(e),e.failure_scenario??e.reasoning].filter(Boolean).join(" — ");return{done:!1,text:n.trim(),description:r||void 0,source:"review"}},ZM=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,i)=>JM(r,i))},_k=async()=>{const e=await fetch("/api/capabilities");return e.ok?(await e.json()).capabilities:null},eL=async()=>{const e=await fetch("/api/agent/auth-status");return e.ok?await e.json():null},m9=async()=>{try{const e=await fetch("/api/connections");return e.ok?(await e.json()).connections:null}catch{return null}},g9=async e=>{try{const t=await fetch(`/api/connections/connect?id=${encodeURIComponent(e)}`,{method:"POST"});return t.ok?(await t.json()).connection:null}catch{return null}},Ck=async()=>{try{const e=await fetch("/api/config");return e.ok?e.json():null}catch{return null}},y9=async e=>{try{const t=await fetch("/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}}},tL=async()=>{try{const e=await fetch("/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}},x9=async e=>{try{return(await fetch("/api/icon",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({dataUri:e})})).ok}catch{return!1}},nL=async()=>{try{const e=await fetch("/api/package-name");return e.ok?e.json():null}catch{return null}},rL={},Gx=e=>{let t;const n=new Set,r=(c,h)=>{const f=typeof c=="function"?c(t):c;if(!Object.is(f,t)){const p=t;t=h??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(m=>m(t,p))}},i=()=>t,l={setState:r,getState:i,getInitialState:()=>u,subscribe:c=>(n.add(c),()=>n.delete(c)),destroy:()=>{(rL?"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()}},u=t=e(r,i,l);return l},iL=e=>e?Gx(e):Gx,jk={},{useDebugValue:sL}=Ts,{useSyncExternalStoreWithSelector:oL}=uT;let Kx=!1;const aL=e=>e;function lL(e,t=aL,n){(jk?"production":void 0)!=="production"&&n&&!Kx&&(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"),Kx=!0);const r=oL(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return sL(r),r}const Yx=e=>{(jk?"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"?iL(e):e,n=(r,i)=>lL(t,r,i);return Object.assign(n,t),n},cL=e=>e?Yx(e):Yx,Cn=async(e,t="Launch failed")=>{if(!e.ok){const n=await e.json().catch(()=>({error:t}));throw new Error(n.error)}},uL=async()=>(await fetch("/api/agent/status")).json(),dL=async()=>(await fetch("/api/agent/reconcile-queue")).json(),hL=async(e,t)=>{const n=await fetch("/api/agent/launch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,phaseIndex:t})});await Cn(n)},fL=async(e,t)=>{const n=await fetch("/api/agent/launch-audit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,prompt:t})});await Cn(n)},pL=async(e,t)=>{const n=await fetch("/api/agent/launch-rework",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,prompt:t})});await Cn(n)},mL=async(e,t)=>{const n=await fetch("/api/agent/launch-reconcile",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,prompt:t})});await Cn(n)},gL=async(e,t)=>{const n=await fetch("/api/agent/launch-draft",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ideaId:e,prompt:t})});await Cn(n)},yL=async(e,t)=>{const n=await fetch("/api/agent/launch-extend",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ideaId:e,prompt:t})});await Cn(n)},xL=async e=>{const t=await fetch("/api/agent/launch-suggest",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:e})});await Cn(t)},vL=async()=>{const e=await fetch("/api/agent/launch-reconcile-all",{method:"POST"});await Cn(e)},wL=async e=>{const t=await fetch("/api/agent/launch-run-all",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e})});await Cn(t)},bL=async e=>{const t=await fetch("/api/agent/launch-fix-review",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e})});await Cn(t)},kL=async e=>{const t=await fetch("/api/agent/split-review",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e})}),n=await t.json();if(!t.ok)throw new Error(n.error??"Failed to split review");return n},SL=async e=>{const t=await fetch("/api/agent/stop",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskId:e})});await Cn(t,"Stop failed")},_L=async()=>(await fetch("/api/tasks")).json(),v9=async e=>{const t=await fetch(`/api/tasks/output?id=${encodeURIComponent(e)}`);if(!t.ok)throw new Error(`Failed to fetch task log: ${t.status}`);return t.json()},CL=async()=>(await fetch("/api/suggestions")).json(),jL=async e=>{const t=await fetch("/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()},PL=async e=>{const t=await fetch("/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)}},EL=async()=>(await fetch("/api/docs")).json(),TL=async()=>{const e=await fetch("/api/roadmap");if(!e.ok)throw new Error(`Failed to fetch roadmap: ${e.status}`);return e.json()},RL=async(e,t,n,r)=>{const i=await fetch("/api/roadmap/promote",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({horizonTitle:e,item:t,subject:n,candidateName:r})});if(!i.ok){const s=await i.json().catch(()=>({error:"Failed to promote roadmap item"}));throw new Error(s.error)}return i.json()},w9=async(e,t,n)=>{const r=await fetch("/api/roadmap/items",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({horizonTitle:e,name:t,description:n})});if(!r.ok){const i=await r.json().catch(()=>({error:"Failed to add roadmap item"}));throw new Error(i.error)}},b9=async(e,t,n)=>{const r=await fetch("/api/roadmap/candidates",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({horizonTitle:e,itemName:t,name:n})});if(!r.ok){const i=await r.json().catch(()=>({error:"Failed to add roadmap candidate"}));throw new Error(i.error)}},IL=async()=>(await fetch("/api/consistency")).json(),AL=async()=>{const e=await fetch("/api/decisions");if(!e.ok)throw new Error(`Failed to fetch decisions: ${e.status}`);return e.json()},ML=async()=>{const e=await fetch("/api/open-questions");if(!e.ok){const t=await e.json().catch(()=>({error:"Failed to load open questions"}));throw new Error(t.error)}return e.json()},LL=async(e,t,n)=>{const r=await fetch("/api/decisions/supersede",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e,newTitle:t,rationale:n})});if(!r.ok){const i=await r.json().catch(()=>({error:"Failed to supersede decision"}));throw new Error(i.error)}},DL=async(e,t,n)=>{const r=await fetch(`/api/open-questions/resolve?title=${encodeURIComponent(e)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:t,rationale:n})});if(!r.ok){const i=await r.json().catch(()=>({error:"Failed to resolve question"}));throw new Error(i.error)}},NL=async(e,t)=>{const n=await fetch("/api/clarifications/promote",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({entityId:e,clarification:t})});if(!n.ok){const r=await n.json().catch(()=>({error:"Failed to promote clarification"}));throw new Error(r.error)}},zL=async(e,t,n,r,i)=>{const s=await fetch("/api/decisions/promote",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({entityId:e,source:t,entry:n,title:r,rationale:i})});if(!s.ok){const o=await s.json().catch(()=>({error:"Failed to promote to decision"}));throw new Error(o.error)}},Pk=async()=>(await fetch("/api/ideas")).json(),OL=async()=>(await fetch("/api/archivable-ideas")).json(),FL=async e=>{const t=await fetch("/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("/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("/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},$L=async()=>{const e=await fetch("/api/ideas/prioritise",{method:"POST"}),t=await e.json();if(!e.ok)throw new Error(t.error??"Failed to prioritise queue");return t},Rk=async()=>(await fetch("/api/plans")).json(),BL=async e=>{await fetch("/api/plans",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})},VL=async(e,t)=>{const n=await fetch(`/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})`)}};async function Xs(e,t){if(e.ok)return;const n=await e.json().catch(()=>({error:t}));throw new Error(n.error)}const WL=async()=>{const e=await fetch("/api/git/status");return await Xs(e,"Failed to load git status"),e.json()},Ik=async(e,t,n)=>{const r=await fetch("/api/git/commit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:e,title:t,message:n})});await Xs(r,"Commit failed")},UL=async()=>{const e=await fetch("/api/git/push",{method:"POST"});await Xs(e,"Push failed")},Ak=async e=>{const t=await fetch("/api/git/suggest-commit-message",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:e})});return await Xs(t,"Failed to suggest a commit message"),t.json()},HL=async()=>{const e=await fetch("/api/git/sync",{method:"POST"});if(e.status===202){const t=await e.json();return{ok:!1,recovering:t.recovering,message:t.error}}return await Xs(e,"Sync failed"),{ok:!0}},GL=async()=>{const e=await fetch("/api/git/pull",{method:"POST"});await Xs(e,"Pull failed")},KL=async e=>{const t=await fetch("/api/git/branch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e})}),n=await t.json();if(!t.ok)throw new Error(n.error??"Failed to create branch");return n.branch},YL=async()=>(await fetch("/api/status")).json(),QL=async e=>{await fetch(`/api/status/check?name=${e}`,{method:"POST"})},qL=async()=>{await fetch("/api/status/fix",{method:"POST"})},XL=async()=>{const e=await fetch("/api/refresh",{method:"POST"});if(!e.ok)throw new Error(`Failed to drop caches: ${e.statusText}`)};let JL=0;const Qx=()=>`preview-${++JL}`,Pm=e=>e.agentStatus.some(t=>t.status!=="done"&&t.status!=="error"),jn=e=>e.capabilities.length===0||e.capabilities.some(t=>t.id.startsWith("agent:")&&t.status==="ok"),ZL=e=>{const t=e.capabilities.find(n=>n.id==="gh");return t===void 0||t.status==="ok"},eD=e=>e.capabilities.filter(t=>t.status!=="ok").length,tD=e=>e.openQuestions.filter(t=>t.status==="open").length,nD=e=>{var t;return((t=e.agentAuthStatus)==null?void 0:t.loggedIn)===!1};function hn(e,t,n,r=()=>({}),i){return async()=>{i&&e({[i]:!0});try{const s=await t();e({...n(s),...i&&{[i]:!1}})}catch(s){e({...r(s),...i&&{[i]:!1}})}}}const N=cL((e,t)=>({plans:null,plansLoading:!1,plansError:null,loadPlans:hn(e,Rk,n=>({plans:n,plansError:null}),n=>({plansError:String(n)}),"plansLoading"),ideaEntries:[],loadIdeas:hn(e,Pk,n=>({ideaEntries:n.entries}),()=>({ideaEntries:[]})),archivableIdeas:[],loadArchivableIdeas:hn(e,OL,n=>({archivableIdeas:n}),()=>({archivableIdeas:[]})),archiveIdeas:async n=>{await FL(n),await Promise.all([t().loadArchivableIdeas(),t().loadPlans(),t().loadIdeas()])},planFilters:Cm,togglePlanStatus:n=>e(r=>({planFilters:{...r.planFilters,statuses:r.planFilters.statuses.includes(n)?r.planFilters.statuses.filter(i=>i!==n):[...r.planFilters.statuses,n]}})),togglePlanTag:n=>e(r=>({planFilters:{...r.planFilters,tags:r.planFilters.tags.includes(n)?r.planFilters.tags.filter(i=>i!==n):[...r.planFilters.tags,n]}})),toggleNoteStatus:n=>e(r=>({planFilters:{...r.planFilters,noteStatuses:r.planFilters.noteStatuses.includes(n)?r.planFilters.noteStatuses.filter(i=>i!==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}),suggestions:[],suggestionsLoading:!0,loadSuggestions:hn(e,CL,n=>({suggestions:n.entries}),()=>({suggestions:[]}),"suggestionsLoading"),promoteSuggestion:async n=>{const{id:r}=await jL(n);return await Promise.all([t().loadSuggestions(),t().loadPlans(),t().loadIdeas()]),r},dismissSuggestion:async n=>{await PL(n),await t().loadSuggestions()},promoteRoadmapItem:async(n,r,i,s)=>{const{id:o}=await RL(n,r,i,s);return await Promise.all([t().loadPlans(),t().loadIdeas()]),o},taskLog:[],taskLogLoading:!0,loadTaskLog:hn(e,_L,n=>({taskLog:n.entries}),()=>({taskLog:[]}),"taskLogLoading"),repoDocs:[],repoDocsLoading:!0,loadRepoDocs:async()=>{e({repoDocsLoading:!0});try{const n=await EL();e({repoDocs:n.files,repoDocsLoading:!1});const{activeDocTitle:r}=t();if(!r){const i=["MAIN.md","README.md"].find(s=>n.files.some(o=>o.name===s));i&&e({activeDocTitle:i})}}catch{e({repoDocs:[],repoDocsLoading:!1})}},activeDocTitle:null,setActiveDocTitle:n=>e({activeDocTitle:n}),docSearchQuery:"",setDocSearchQuery:n=>e({docSearchQuery:n}),status:null,refreshing:!1,loadStatus:hn(e,YL,n=>({status:n})),refreshAll:async()=>{e({refreshing:!0});try{await XL().catch(()=>{}),await Promise.all([t().loadPlans(),t().loadIdeas(),t().loadArchivableIdeas(),t().loadSuggestions(),t().loadStatus(),t().loadConsistency(),t().loadDecisions(),t().loadOpenQuestions(),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 QL(n)}catch{}},fixQuality:async()=>{try{await qL()}catch{}},commitInFlight:!1,setCommitInFlight:n=>e({commitInFlight:n}),activeGitAction:null,setActiveGitAction:n=>e({activeGitAction:n}),quickCommit:async()=>{const{gitStatus:n,loadGitStatus:r,commitInFlight:i}=t();if(i)return{ok:!1,error:"A commit is already in progress"};if(!n||n.length===0)return{ok:!1,error:"Nothing to commit"};const s=n.map(o=>o.path);e({commitInFlight:!0});try{const{title:o,message:a}=await Ak(s);return await Ik(s,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:hn(e,IL,n=>({consistency:n})),decisions:[],loadDecisions:hn(e,AL,n=>({decisions:n.entries}),()=>({decisions:[]})),supersedeDecision:async(n,r,i)=>{await LL(n,r,i),await Promise.all([t().loadDecisions(),t().loadConsistency()])},openQuestions:[],loadOpenQuestions:hn(e,ML,n=>({openQuestions:n.entries}),()=>({openQuestions:[]})),resolveOpenQuestion:async(n,r,i)=>{await DL(n,r,i),await t().loadOpenQuestions()},promoteClarification:async(n,r)=>{await NL(n,r),await Promise.all([t().loadOpenQuestions(),t().loadPlans()])},promoteToDecision:async(n,r,i,s,o)=>{await zL(n,r,i,s,o),await Promise.all([t().loadDecisions(),t().loadPlans()])},gitStatus:null,gitBranch:null,gitAhead:0,gitBranchHygiene:null,loadGitStatus:async()=>{try{const{branch:n,entries:r,ahead:i,branchHygiene:s}=await WL();return e({gitStatus:r,gitBranch:n,gitAhead:i,gitBranchHygiene:s}),!0}catch{return!1}},capabilities:[],loadCapabilities:hn(e,_k,n=>({capabilities:n??[]}),()=>({capabilities:[]})),agentAuthStatus:null,loadAgentAuthStatus:hn(e,eL,n=>({agentAuthStatus:n}),()=>({agentAuthStatus:null})),agentStatus:[],loadAgentStatus:async()=>{try{const n=await uL();e({agentStatus:n});const r=t().pendingReconcile,i=r?n.find(o=>(o.taskKind==="reconcile"||o.taskKind==="rework")&&o.planId===r.planId):void 0;r&&i&&(i.status==="done"?(await t().loadPlans(),e(o=>({reconcileQueue:[...o.reconcileQueue,{...r,previewId:Qx()}],pendingReconcile:null}))):i.status==="error"&&e({pendingReconcile:null}));const s=n.find(o=>o.taskKind==="batch-reconcile");if((s==null?void 0:s.status)==="done"&&!t().batchReconcileConsumed){const o=await dL();o&&o.length>0&&(await t().loadPlans(),e(a=>({reconcileQueue:[...a.reconcileQueue,...o.map(l=>({planId:l.planId,before:l.before,previewId:Qx()}))]}))),e({batchReconcileConsumed:!0})}}catch{}},launchAgent:async(n,r)=>{await hL(n,r),await t().loadAgentStatus()},launchPlanAudit:async(n,r)=>{await fL(n,r),await t().loadAgentStatus()},launchPlanReconcile:async(n,r,i)=>{const s=t().pendingReconcile;if(s)throw new Error(s.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:i}});try{await mL(n,r)}catch(o){throw e({pendingReconcile:null}),o}await t().loadAgentStatus()},launchPlanRework:async(n,r,i,s)=>{const o=t().pendingReconcile;if(o)throw new Error(o.planId===n?"A rewrite is already in progress for this plan":"A rewrite is already in progress for another plan");if(t().reconcileQueue.some(a=>a.planId===n))throw new Error("Review the pending changes for this plan first");e({pendingReconcile:{planId:n,before:i,notes:s}});try{await pL(n,r)}catch(a){throw e({pendingReconcile:null}),a}await t().loadAgentStatus()},launchPlanDraft:async(n,r)=>{await gL(n,r),await t().loadAgentStatus()},launchIdeaExtend:async(n,r)=>{await yL(n,r),await t().loadAgentStatus()},launchBatchReconcile:async()=>{e({batchReconcileConsumed:!1}),await vL(),await t().loadAgentStatus()},launchSuggestIdeas:async n=>{await xL(n),await t().loadAgentStatus()},launchPrioritise:async()=>{const n=await $L();return await t().refreshAll(),n},launchRunAll:async n=>{await wL(n),await t().loadAgentStatus()},launchFixReview:async n=>{await bL(n),await t().loadAgentStatus()},stopAgent:async n=>{try{await SL(n)}finally{await t().loadAgentStatus()}},pendingReconcile:null,reconcileQueue:[],removeFromReconcileQueue:n=>e(r=>({reconcileQueue:r.reconcileQueue.filter(i=>i.previewId!==n)})),batchReconcileConsumed:!1}));function rD(e){return e.includes("running")?"running":e.includes("fail")?"fail":e.every(t=>t==="stale")?"stale":"pass"}function Mk(e){var t,n,r,i;return{qualityStatus:rD([((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:((i=e==null?void 0:e.consistency)==null?void 0:i.status)??"stale"}}function Lk(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Lk(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function iD(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Lk(e))&&(r&&(r+=" "),r+=t);return r}const Em="-",sD=e=>{const t=aD(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const a=o.split(Em);return a[0]===""&&a.length!==1&&a.shift(),Dk(a,t)||oD(o)},getConflictingClassGroupIds:(o,a)=>{const l=n[o]||[];return a&&r[o]?[...l,...r[o]]:l}}},Dk=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?Dk(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const s=e.join(Em);return(o=t.validators.find(({validator:a})=>a(s)))==null?void 0:o.classGroupId},qx=/^\[(.+)\]$/,oD=e=>{if(qx.test(e)){const t=qx.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},aD=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return cD(Object.entries(e.classGroups),n).forEach(([s,o])=>{Tf(o,r,s,t)}),r},Tf=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const s=i===""?t:Xx(t,i);s.classGroupId=n;return}if(typeof i=="function"){if(lD(i)){Tf(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([s,o])=>{Tf(o,Xx(t,s),n,r)})})},Xx=(e,t)=>{let n=e;return t.split(Em).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},lD=e=>e.isThemeGetter,cD=(e,t)=>t?e.map(([n,r])=>{const i=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([o,a])=>[t+o,a])):s);return[n,i]}):e,uD=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(s,o)=>{n.set(s,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let o=n.get(s);if(o!==void 0)return o;if((o=r.get(s))!==void 0)return i(s,o),o},set(s,o){n.has(s)?n.set(s,o):i(s,o)}}},Nk="!",dD=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],s=t.length,o=a=>{const l=[];let u=0,c=0,h;for(let w=0;w<a.length;w++){let g=a[w];if(u===0){if(g===i&&(r||a.slice(w,w+s)===t)){l.push(a.slice(c,w)),c=w+s;continue}if(g==="/"){h=w;continue}}g==="["?u++:g==="]"&&u--}const f=l.length===0?a:a.substring(c),p=f.startsWith(Nk),m=p?f.substring(1):f,x=h&&h>c?h-c:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:x}};return n?a=>n({className:a,parseClassName:o}):o},hD=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},fD=e=>({cache:uD(e.cacheSize),parseClassName:dD(e),...sD(e)}),pD=/\s+/,mD=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,s=[],o=e.trim().split(pD);let a="";for(let l=o.length-1;l>=0;l-=1){const u=o[l],{modifiers:c,hasImportantModifier:h,baseClassName:f,maybePostfixModifierPosition:p}=n(u);let m=!!p,x=r(m?f.substring(0,p):f);if(!x){if(!m){a=u+(a.length>0?" "+a:a);continue}if(x=r(f),!x){a=u+(a.length>0?" "+a:a);continue}m=!1}const w=hD(c).join(":"),g=h?w+Nk:w,y=g+x;if(s.includes(y))continue;s.push(y);const v=i(x,m);for(let k=0;k<v.length;++k){const P=v[k];s.push(g+P)}a=u+(a.length>0?" "+a:a)}return a};function gD(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=zk(t))&&(r&&(r+=" "),r+=n);return r}const zk=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=zk(e[r]))&&(n&&(n+=" "),n+=t);return n};function yD(e,...t){let n,r,i,s=o;function o(l){const u=t.reduce((c,h)=>h(c),e());return n=fD(u),r=n.cache.get,i=n.cache.set,s=a,a(l)}function a(l){const u=r(l);if(u)return u;const c=mD(l,n);return i(l,c),c}return function(){return s(gD.apply(null,arguments))}}const Ee=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Ok=/^\[(?:([a-z-]+):)?(.+)\]$/i,xD=/^\d+\/\d+$/,vD=new Set(["px","full","screen"]),wD=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,bD=/\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$/,kD=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,SD=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,_D=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Qn=e=>Es(e)||vD.has(e)||xD.test(e),gr=e=>Js(e,"length",AD),Es=e=>!!e&&!Number.isNaN(Number(e)),Ud=e=>Js(e,"number",Es),So=e=>!!e&&Number.isInteger(Number(e)),CD=e=>e.endsWith("%")&&Es(e.slice(0,-1)),se=e=>Ok.test(e),yr=e=>wD.test(e),jD=new Set(["length","size","percentage"]),PD=e=>Js(e,jD,Fk),ED=e=>Js(e,"position",Fk),TD=new Set(["image","url"]),RD=e=>Js(e,TD,LD),ID=e=>Js(e,"",MD),_o=()=>!0,Js=(e,t,n)=>{const r=Ok.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},AD=e=>bD.test(e)&&!kD.test(e),Fk=()=>!1,MD=e=>SD.test(e),LD=e=>_D.test(e),DD=()=>{const e=Ee("colors"),t=Ee("spacing"),n=Ee("blur"),r=Ee("brightness"),i=Ee("borderColor"),s=Ee("borderRadius"),o=Ee("borderSpacing"),a=Ee("borderWidth"),l=Ee("contrast"),u=Ee("grayscale"),c=Ee("hueRotate"),h=Ee("invert"),f=Ee("gap"),p=Ee("gradientColorStops"),m=Ee("gradientColorStopPositions"),x=Ee("inset"),w=Ee("margin"),g=Ee("opacity"),y=Ee("padding"),v=Ee("saturate"),k=Ee("scale"),P=Ee("sepia"),b=Ee("skew"),C=Ee("space"),j=Ee("translate"),T=()=>["auto","contain","none"],E=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto",se,t],M=()=>[se,t],F=()=>["",Qn,gr],D=()=>["auto",Es,se],L=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],$=()=>["solid","dashed","dotted","double","none"],U=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],z=()=>["start","end","center","between","around","evenly","stretch"],V=()=>["","0",se],_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],B=()=>[Es,se];return{cacheSize:500,separator:":",theme:{colors:[_o],spacing:[Qn,gr],blur:["none","",yr,se],brightness:B(),borderColor:[e],borderRadius:["none","","full",yr,se],borderSpacing:M(),borderWidth:F(),contrast:B(),grayscale:V(),hueRotate:B(),invert:V(),gap:M(),gradientColorStops:[e],gradientColorStopPositions:[CD,gr],inset:A(),margin:A(),opacity:B(),padding:M(),saturate:B(),scale:B(),sepia:V(),skew:B(),space:M(),translate:M()},classGroups:{aspect:[{aspect:["auto","square","video",se]}],container:["container"],columns:[{columns:[yr]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...L(),se]}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[x]}],"inset-x":[{"inset-x":[x]}],"inset-y":[{"inset-y":[x]}],start:[{start:[x]}],end:[{end:[x]}],top:[{top:[x]}],right:[{right:[x]}],bottom:[{bottom:[x]}],left:[{left:[x]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",So,se]}],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",se]}],grow:[{grow:V()}],shrink:[{shrink:V()}],order:[{order:["first","last","none",So,se]}],"grid-cols":[{"grid-cols":[_o]}],"col-start-end":[{col:["auto",{span:["full",So,se]},se]}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":[_o]}],"row-start-end":[{row:["auto",{span:[So,se]},se]}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",se]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",se]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...z()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...z(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...z(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[w]}],mx:[{mx:[w]}],my:[{my:[w]}],ms:[{ms:[w]}],me:[{me:[w]}],mt:[{mt:[w]}],mr:[{mr:[w]}],mb:[{mb:[w]}],ml:[{ml:[w]}],"space-x":[{"space-x":[C]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[C]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",se,t]}],"min-w":[{"min-w":[se,t,"min","max","fit"]}],"max-w":[{"max-w":[se,t,"none","full","min","max","fit","prose",{screen:[yr]},yr]}],h:[{h:[se,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[se,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[se,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[se,t,"auto","min","max","fit"]}],"font-size":[{text:["base",yr,gr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ud]}],"font-family":[{font:[_o]}],"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",se]}],"line-clamp":[{"line-clamp":["none",Es,Ud]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Qn,se]}],"list-image":[{"list-image":["none",se]}],"list-style-type":[{list:["none","disc","decimal",se]}],"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:[...$(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Qn,gr]}],"underline-offset":[{"underline-offset":["auto",Qn,se]}],"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:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",se]}],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",se]}],"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:[...L(),ED]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",PD]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},RD]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"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:[...$(),"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:$()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...$()]}],"outline-offset":[{"outline-offset":[Qn,se]}],"outline-w":[{outline:[Qn,gr]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:F()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[Qn,gr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",yr,ID]}],"shadow-color":[{shadow:[_o]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...U(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":U()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",yr,se]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[h]}],saturate:[{saturate:[v]}],sepia:[{sepia:[P]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[g]}],"backdrop-saturate":[{"backdrop-saturate":[v]}],"backdrop-sepia":[{"backdrop-sepia":[P]}],"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",se]}],duration:[{duration:B()}],ease:[{ease:["linear","in","out","in-out",se]}],delay:[{delay:B()}],animate:[{animate:["none","spin","ping","pulse","bounce",se]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[k]}],"scale-x":[{"scale-x":[k]}],"scale-y":[{"scale-y":[k]}],rotate:[{rotate:[So,se]}],"translate-x":[{"translate-x":[j]}],"translate-y":[{"translate-y":[j]}],"skew-x":[{"skew-x":[b]}],"skew-y":[{"skew-y":[b]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",se]}],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",se]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"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",se]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Qn,gr,Ud]}],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"]}}},ND=yD(DD);function Hd(e,t,n){if(e&&e.length){const[r,i]=t,s=Math.PI/180*n,o=Math.cos(s),a=Math.sin(s);for(const l of e){const[u,c]=l;l[0]=(u-r)*o-(c-i)*a+r,l[1]=(u-r)*a+(c-i)*o+i}}}function zD(e,t){return e[0]===t[0]&&e[1]===t[1]}function OD(e,t,n,r=1){const i=n,s=Math.max(t,.1),o=e[0]&&e[0][0]&&typeof e[0][0]=="number"?[e]:e,a=[0,0];if(i)for(const u of o)Hd(u,a,i);const l=function(u,c,h){const f=[];for(const y of u){const v=[...y];zD(v[0],v[v.length-1])||v.push([v[0][0],v[0][1]]),v.length>2&&f.push(v)}const p=[];c=Math.max(c,.1);const m=[];for(const y of f)for(let v=0;v<y.length-1;v++){const k=y[v],P=y[v+1];if(k[1]!==P[1]){const b=Math.min(k[1],P[1]);m.push({ymin:b,ymax:Math.max(k[1],P[1]),x:b===k[1]?k[0]:P[0],islope:(P[0]-k[0])/(P[1]-k[1])})}}if(m.sort((y,v)=>y.ymin<v.ymin?-1:y.ymin>v.ymin?1:y.x<v.x?-1:y.x>v.x?1:y.ymax===v.ymax?0:(y.ymax-v.ymax)/Math.abs(y.ymax-v.ymax)),!m.length)return p;let x=[],w=m[0].ymin,g=0;for(;x.length||m.length;){if(m.length){let y=-1;for(let v=0;v<m.length&&!(m[v].ymin>w);v++)y=v;m.splice(0,y+1).forEach(v=>{x.push({s:w,edge:v})})}if(x=x.filter(y=>!(y.edge.ymax<=w)),x.sort((y,v)=>y.edge.x===v.edge.x?0:(y.edge.x-v.edge.x)/Math.abs(y.edge.x-v.edge.x)),(h!==1||g%c==0)&&x.length>1)for(let y=0;y<x.length;y+=2){const v=y+1;if(v>=x.length)break;const k=x[y].edge,P=x[v].edge;p.push([[Math.round(k.x),w],[Math.round(P.x),w]])}w+=h,x.forEach(y=>{y.edge.x=y.edge.x+h*y.edge.islope}),g++}return p}(o,s,r);if(i){for(const u of o)Hd(u,a,-i);(function(u,c,h){const f=[];u.forEach(p=>f.push(...p)),Hd(f,c,h)})(l,a,-i)}return l}function La(e,t){var n;const r=t.hachureAngle+90;let i=t.hachureGap;i<0&&(i=4*t.strokeWidth),i=Math.round(Math.max(i,.1));let s=1;return t.roughness>=1&&(((n=t.randomizer)===null||n===void 0?void 0:n.next())||Math.random())>.7&&(s=i),OD(e,i,r,s||1)}class Tm{constructor(t){this.helper=t}fillPolygons(t,n){return this._fillPolygons(t,n)}_fillPolygons(t,n){const r=La(t,n);return{type:"fillSketch",ops:this.renderLines(r,n)}}renderLines(t,n){const r=[];for(const i of t)r.push(...this.helper.doubleLineOps(i[0][0],i[0][1],i[1][0],i[1][1],n));return r}}function Au(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 FD extends Tm{fillPolygons(t,n){let r=n.hachureGap;r<0&&(r=4*n.strokeWidth),r=Math.max(r,.1);const i=La(t,Object.assign({},n,{hachureGap:r})),s=Math.PI/180*n.hachureAngle,o=[],a=.5*r*Math.cos(s),l=.5*r*Math.sin(s);for(const[u,c]of i)Au([u,c])&&o.push([[u[0]-a,u[1]+l],[...c]],[[u[0]+a,u[1]-l],[...c]]);return{type:"fillSketch",ops:this.renderLines(o,n)}}}class $D extends Tm{fillPolygons(t,n){const r=this._fillPolygons(t,n),i=Object.assign({},n,{hachureAngle:n.hachureAngle+90}),s=this._fillPolygons(t,i);return r.ops=r.ops.concat(s.ops),r}}class BD{constructor(t){this.helper=t}fillPolygons(t,n){const r=La(t,n=Object.assign({},n,{hachureAngle:0}));return this.dotsOnLines(r,n)}dotsOnLines(t,n){const r=[];let i=n.hachureGap;i<0&&(i=4*n.strokeWidth),i=Math.max(i,.1);let s=n.fillWeight;s<0&&(s=n.strokeWidth/2);const o=i/4;for(const a of t){const l=Au(a),u=l/i,c=Math.ceil(u)-1,h=l-c*i,f=(a[0][0]+a[1][0])/2-i/4,p=Math.min(a[0][1],a[1][1]);for(let m=0;m<c;m++){const x=p+h+m*i,w=f-o+2*Math.random()*o,g=x-o+2*Math.random()*o,y=this.helper.ellipse(w,g,s,s,n);r.push(...y.ops)}}return{type:"fillSketch",ops:r}}}class VD{constructor(t){this.helper=t}fillPolygons(t,n){const r=La(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,i=n.dashGap<0?n.hachureGap<0?4*n.strokeWidth:n.hachureGap:n.dashGap,s=[];return t.forEach(o=>{const a=Au(o),l=Math.floor(a/(r+i)),u=(a+i-l*(r+i))/2;let c=o[0],h=o[1];c[0]>h[0]&&(c=o[1],h=o[0]);const f=Math.atan((h[1]-c[1])/(h[0]-c[0]));for(let p=0;p<l;p++){const m=p*(r+i),x=m+r,w=[c[0]+m*Math.cos(f)+u*Math.cos(f),c[1]+m*Math.sin(f)+u*Math.sin(f)],g=[c[0]+x*Math.cos(f)+u*Math.cos(f),c[1]+x*Math.sin(f)+u*Math.sin(f)];s.push(...this.helper.doubleLineOps(w[0],w[1],g[0],g[1],n))}}),s}}class WD{constructor(t){this.helper=t}fillPolygons(t,n){const r=n.hachureGap<0?4*n.strokeWidth:n.hachureGap,i=n.zigzagOffset<0?r:n.zigzagOffset,s=La(t,n=Object.assign({},n,{hachureGap:r+i}));return{type:"fillSketch",ops:this.zigzagLines(s,i,n)}}zigzagLines(t,n,r){const i=[];return t.forEach(s=>{const o=Au(s),a=Math.round(o/(2*n));let l=s[0],u=s[1];l[0]>u[0]&&(l=s[1],u=s[0]);const c=Math.atan((u[1]-l[1])/(u[0]-l[0]));for(let h=0;h<a;h++){const f=2*h*n,p=2*(h+1)*n,m=Math.sqrt(2*Math.pow(n,2)),x=[l[0]+f*Math.cos(c),l[1]+f*Math.sin(c)],w=[l[0]+p*Math.cos(c),l[1]+p*Math.sin(c)],g=[x[0]+m*Math.cos(c+Math.PI/4),x[1]+m*Math.sin(c+Math.PI/4)];i.push(...this.helper.doubleLineOps(x[0],x[1],g[0],g[1],r),...this.helper.doubleLineOps(g[0],g[1],w[0],w[1],r))}}),i}}const bt={};class UD{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const HD=0,Gd=1,Jx=2,yl={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 Kd(e,t){return e.type===t}function Rm(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:HD,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:Gd,text:`${parseFloat(RegExp.$1)}`},o=o.substr(RegExp.$1.length)}return a[a.length]={type:Jx,text:""},a}(e);let r="BOD",i=0,s=n[i];for(;!Kd(s,Jx);){let o=0;const a=[];if(r==="BOD"){if(s.text!=="M"&&s.text!=="m")return Rm("M0,0"+e);i++,o=yl[s.text],r=s.text}else Kd(s,Gd)?o=yl[r]:(i++,o=yl[s.text],r=s.text);if(!(i+o<n.length))throw new Error("Path data ended short");for(let l=i;l<i+o;l++){const u=n[l];if(!Kd(u,Gd))throw new Error("Param not a number: "+r+","+u.text);a[a.length]=+u.text}if(typeof yl[r]!="number")throw new Error("Bad segment: "+r);{const l={key:r,data:a};t.push(l),i+=o,s=n[i],r==="M"&&(r="L"),r==="m"&&(r="l")}}return t}function $k(e){let t=0,n=0,r=0,i=0;const s=[];for(const{key:o,data:a}of e)switch(o){case"M":s.push({key:"M",data:[...a]}),[t,n]=a,[r,i]=a;break;case"m":t+=a[0],n+=a[1],s.push({key:"M",data:[t,n]}),r=t,i=n;break;case"L":s.push({key:"L",data:[...a]}),[t,n]=a;break;case"l":t+=a[0],n+=a[1],s.push({key:"L",data:[t,n]});break;case"C":s.push({key:"C",data:[...a]}),t=a[4],n=a[5];break;case"c":{const l=a.map((u,c)=>c%2?u+n:u+t);s.push({key:"C",data:l}),t=l[4],n=l[5];break}case"Q":s.push({key:"Q",data:[...a]}),t=a[2],n=a[3];break;case"q":{const l=a.map((u,c)=>c%2?u+n:u+t);s.push({key:"Q",data:l}),t=l[2],n=l[3];break}case"A":s.push({key:"A",data:[...a]}),t=a[5],n=a[6];break;case"a":t+=a[5],n+=a[6],s.push({key:"A",data:[a[0],a[1],a[2],a[3],a[4],t,n]});break;case"H":s.push({key:"H",data:[...a]}),t=a[0];break;case"h":t+=a[0],s.push({key:"H",data:[t]});break;case"V":s.push({key:"V",data:[...a]}),n=a[0];break;case"v":n+=a[0],s.push({key:"V",data:[n]});break;case"S":s.push({key:"S",data:[...a]}),t=a[2],n=a[3];break;case"s":{const l=a.map((u,c)=>c%2?u+n:u+t);s.push({key:"S",data:l}),t=l[2],n=l[3];break}case"T":s.push({key:"T",data:[...a]}),t=a[0],n=a[1];break;case"t":t+=a[0],n+=a[1],s.push({key:"T",data:[t,n]});break;case"Z":case"z":s.push({key:"Z",data:[]}),t=r,n=i}return s}function Bk(e){const t=[];let n="",r=0,i=0,s=0,o=0,a=0,l=0;for(const{key:u,data:c}of e){switch(u){case"M":t.push({key:"M",data:[...c]}),[r,i]=c,[s,o]=c;break;case"C":t.push({key:"C",data:[...c]}),r=c[4],i=c[5],a=c[2],l=c[3];break;case"L":t.push({key:"L",data:[...c]}),[r,i]=c;break;case"H":r=c[0],t.push({key:"L",data:[r,i]});break;case"V":i=c[0],t.push({key:"L",data:[r,i]});break;case"S":{let h=0,f=0;n==="C"||n==="S"?(h=r+(r-a),f=i+(i-l)):(h=r,f=i),t.push({key:"C",data:[h,f,...c]}),a=c[0],l=c[1],r=c[2],i=c[3];break}case"T":{const[h,f]=c;let p=0,m=0;n==="Q"||n==="T"?(p=r+(r-a),m=i+(i-l)):(p=r,m=i);const x=r+2*(p-r)/3,w=i+2*(m-i)/3,g=h+2*(p-h)/3,y=f+2*(m-f)/3;t.push({key:"C",data:[x,w,g,y,h,f]}),a=p,l=m,r=h,i=f;break}case"Q":{const[h,f,p,m]=c,x=r+2*(h-r)/3,w=i+2*(f-i)/3,g=p+2*(h-p)/3,y=m+2*(f-m)/3;t.push({key:"C",data:[x,w,g,y,p,m]}),a=h,l=f,r=p,i=m;break}case"A":{const h=Math.abs(c[0]),f=Math.abs(c[1]),p=c[2],m=c[3],x=c[4],w=c[5],g=c[6];h===0||f===0?(t.push({key:"C",data:[r,i,w,g,w,g]}),r=w,i=g):(r!==w||i!==g)&&(Vk(r,i,w,g,h,f,p,m,x).forEach(function(y){t.push({key:"C",data:y})}),r=w,i=g);break}case"Z":t.push({key:"Z",data:[]}),r=s,i=o}n=u}return t}function Co(e,t,n){return[e*Math.cos(n)-t*Math.sin(n),e*Math.sin(n)+t*Math.cos(n)]}function Vk(e,t,n,r,i,s,o,a,l,u){const c=(h=o,Math.PI*h/180);var h;let f=[],p=0,m=0,x=0,w=0;if(u)[p,m,x,w]=u;else{[e,t]=Co(e,t,-c),[n,r]=Co(n,r,-c);const F=(e-n)/2,D=(t-r)/2;let L=F*F/(i*i)+D*D/(s*s);L>1&&(L=Math.sqrt(L),i*=L,s*=L);const $=i*i,U=s*s,z=$*U-$*D*D-U*F*F,V=$*D*D+U*F*F,_=(a===l?-1:1)*Math.sqrt(Math.abs(z/V));x=_*i*D/s+(e+n)/2,w=_*-s*F/i+(t+r)/2,p=Math.asin(parseFloat(((t-w)/s).toFixed(9))),m=Math.asin(parseFloat(((r-w)/s).toFixed(9))),e<x&&(p=Math.PI-p),n<x&&(m=Math.PI-m),p<0&&(p=2*Math.PI+p),m<0&&(m=2*Math.PI+m),l&&p>m&&(p-=2*Math.PI),!l&&m>p&&(m-=2*Math.PI)}let g=m-p;if(Math.abs(g)>120*Math.PI/180){const F=m,D=n,L=r;m=l&&m>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,f=Vk(n=x+i*Math.cos(m),r=w+s*Math.sin(m),D,L,i,s,o,0,l,[m,F,x,w])}g=m-p;const y=Math.cos(p),v=Math.sin(p),k=Math.cos(m),P=Math.sin(m),b=Math.tan(g/4),C=4/3*i*b,j=4/3*s*b,T=[e,t],E=[e+C*v,t-j*y],A=[n+C*P,r-j*k],M=[n,r];if(E[0]=2*T[0]-E[0],E[1]=2*T[1]-E[1],u)return[E,A,M].concat(f);{f=[E,A,M].concat(f);const F=[];for(let D=0;D<f.length;D+=3){const L=Co(f[D][0],f[D][1],c),$=Co(f[D+1][0],f[D+1][1],c),U=Co(f[D+2][0],f[D+2][1],c);F.push([L[0],L[1],$[0],$[1],U[0],U[1]])}return F}}const GD={randOffset:function(e,t){return ee(e,t)},randOffsetWithRange:function(e,t,n){return Uc(e,t,n)},ellipse:function(e,t,n,r,i){const s=Uk(n,r,i);return Rf(e,t,i,s).opset},doubleLineOps:function(e,t,n,r,i){return Qr(e,t,n,r,i,!0)}};function Wk(e,t,n,r,i){return{type:"path",ops:Qr(e,t,n,r,i)}}function Zl(e,t,n){const r=(e||[]).length;if(r>2){const i=[];for(let s=0;s<r-1;s++)i.push(...Qr(e[s][0],e[s][1],e[s+1][0],e[s+1][1],n));return t&&i.push(...Qr(e[r-1][0],e[r-1][1],e[0][0],e[0][1],n)),{type:"path",ops:i}}return r===2?Wk(e[0][0],e[0][1],e[1][0],e[1][1],n):{type:"path",ops:[]}}function KD(e,t,n,r,i){return function(s,o){return Zl(s,!0,o)}([[e,t],[e+n,t],[e+n,t+r],[e,t+r]],i)}function Zx(e,t){if(e.length){const n=typeof e[0][0]=="number"?[e]:e,r=xl(n[0],1*(1+.2*t.roughness),t),i=t.disableMultiStroke?[]:xl(n[0],1.5*(1+.22*t.roughness),nv(t));for(let s=1;s<n.length;s++){const o=n[s];if(o.length){const a=xl(o,1*(1+.2*t.roughness),t),l=t.disableMultiStroke?[]:xl(o,1.5*(1+.22*t.roughness),nv(t));for(const u of a)u.op!=="move"&&r.push(u);for(const u of l)u.op!=="move"&&i.push(u)}}return{type:"path",ops:r.concat(i)}}return{type:"path",ops:[]}}function Uk(e,t,n){const r=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(e/2,2)+Math.pow(t/2,2))/2)),i=Math.ceil(Math.max(n.curveStepCount,n.curveStepCount/Math.sqrt(200)*r)),s=2*Math.PI/i;let o=Math.abs(e/2),a=Math.abs(t/2);const l=1-n.curveFitting;return o+=ee(o*l,n),a+=ee(a*l,n),{increment:s,rx:o,ry:a}}function Rf(e,t,n,r){const[i,s]=rv(r.increment,e,t,r.rx,r.ry,1,r.increment*Uc(.1,Uc(.4,1,n),n),n);let o=Hc(i,null,n);if(!n.disableMultiStroke&&n.roughness!==0){const[a]=rv(r.increment,e,t,r.rx,r.ry,1.5,0,n),l=Hc(a,null,n);o=o.concat(l)}return{estimatedPoints:s,opset:{type:"path",ops:o}}}function ev(e,t,n,r,i,s,o,a,l){const u=e,c=t;let h=Math.abs(n/2),f=Math.abs(r/2);h+=ee(.01*h,l),f+=ee(.01*f,l);let p=i,m=s;for(;p<0;)p+=2*Math.PI,m+=2*Math.PI;m-p>2*Math.PI&&(p=0,m=2*Math.PI);const x=2*Math.PI/l.curveStepCount,w=Math.min(x/2,(m-p)/2),g=iv(w,u,c,h,f,p,m,1,l);if(!l.disableMultiStroke){const y=iv(w,u,c,h,f,p,m,1.5,l);g.push(...y)}return o&&(a?g.push(...Qr(u,c,u+h*Math.cos(p),c+f*Math.sin(p),l),...Qr(u,c,u+h*Math.cos(m),c+f*Math.sin(m),l)):g.push({op:"lineTo",data:[u,c]},{op:"lineTo",data:[u+h*Math.cos(p),c+f*Math.sin(p)]})),{type:"path",ops:g}}function tv(e,t){const n=Bk($k(Rm(e))),r=[];let i=[0,0],s=[0,0];for(const{key:o,data:a}of n)switch(o){case"M":s=[a[0],a[1]],i=[a[0],a[1]];break;case"L":r.push(...Qr(s[0],s[1],a[0],a[1],t)),s=[a[0],a[1]];break;case"C":{const[l,u,c,h,f,p]=a;r.push(...YD(l,u,c,h,f,p,s,t)),s=[f,p];break}case"Z":r.push(...Qr(s[0],s[1],i[0],i[1],t)),s=[i[0],i[1]]}return{type:"path",ops:r}}function Yd(e,t){const n=[];for(const r of e)if(r.length){const i=t.maxRandomnessOffset||0,s=r.length;if(s>2){n.push({op:"move",data:[r[0][0]+ee(i,t),r[0][1]+ee(i,t)]});for(let o=1;o<s;o++)n.push({op:"lineTo",data:[r[o][0]+ee(i,t),r[o][1]+ee(i,t)]})}}return{type:"fillPath",ops:n}}function qi(e,t){return function(n,r){let i=n.fillStyle||"hachure";if(!bt[i])switch(i){case"zigzag":bt[i]||(bt[i]=new FD(r));break;case"cross-hatch":bt[i]||(bt[i]=new $D(r));break;case"dots":bt[i]||(bt[i]=new BD(r));break;case"dashed":bt[i]||(bt[i]=new VD(r));break;case"zigzag-line":bt[i]||(bt[i]=new WD(r));break;default:i="hachure",bt[i]||(bt[i]=new Tm(r))}return bt[i]}(t,GD).fillPolygons(e,t)}function nv(e){const t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function Hk(e){return e.randomizer||(e.randomizer=new UD(e.seed||0)),e.randomizer.next()}function Uc(e,t,n,r=1){return n.roughness*r*(Hk(n)*(t-e)+e)}function ee(e,t,n=1){return Uc(-e,e,t,n)}function Qr(e,t,n,r,i,s=!1){const o=s?i.disableMultiStrokeFill:i.disableMultiStroke,a=If(e,t,n,r,i,!0,!1);if(o)return a;const l=If(e,t,n,r,i,!0,!0);return a.concat(l)}function If(e,t,n,r,i,s,o){const a=Math.pow(e-n,2)+Math.pow(t-r,2),l=Math.sqrt(a);let u=1;u=l<200?1:l>500?.4:-.0016668*l+1.233334;let c=i.maxRandomnessOffset||0;c*c*100>a&&(c=l/10);const h=c/2,f=.2+.2*Hk(i);let p=i.bowing*i.maxRandomnessOffset*(r-t)/200,m=i.bowing*i.maxRandomnessOffset*(e-n)/200;p=ee(p,i,u),m=ee(m,i,u);const x=[],w=()=>ee(h,i,u),g=()=>ee(c,i,u),y=i.preserveVertices;return o?x.push({op:"move",data:[e+(y?0:w()),t+(y?0:w())]}):x.push({op:"move",data:[e+(y?0:ee(c,i,u)),t+(y?0:ee(c,i,u))]}),o?x.push({op:"bcurveTo",data:[p+e+(n-e)*f+w(),m+t+(r-t)*f+w(),p+e+2*(n-e)*f+w(),m+t+2*(r-t)*f+w(),n+(y?0:w()),r+(y?0:w())]}):x.push({op:"bcurveTo",data:[p+e+(n-e)*f+g(),m+t+(r-t)*f+g(),p+e+2*(n-e)*f+g(),m+t+2*(r-t)*f+g(),n+(y?0:g()),r+(y?0:g())]}),x}function xl(e,t,n){if(!e.length)return[];const r=[];r.push([e[0][0]+ee(t,n),e[0][1]+ee(t,n)]),r.push([e[0][0]+ee(t,n),e[0][1]+ee(t,n)]);for(let i=1;i<e.length;i++)r.push([e[i][0]+ee(t,n),e[i][1]+ee(t,n)]),i===e.length-1&&r.push([e[i][0]+ee(t,n),e[i][1]+ee(t,n)]);return Hc(r,null,n)}function Hc(e,t,n){const r=e.length,i=[];if(r>3){const s=[],o=1-n.curveTightness;i.push({op:"move",data:[e[1][0],e[1][1]]});for(let a=1;a+2<r;a++){const l=e[a];s[0]=[l[0],l[1]],s[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],s[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],s[3]=[e[a+1][0],e[a+1][1]],i.push({op:"bcurveTo",data:[s[1][0],s[1][1],s[2][0],s[2][1],s[3][0],s[3][1]]})}}else r===3?(i.push({op:"move",data:[e[1][0],e[1][1]]}),i.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):r===2&&i.push(...If(e[0][0],e[0][1],e[1][0],e[1][1],n,!0,!0));return i}function rv(e,t,n,r,i,s,o,a){const l=[],u=[];if(a.roughness===0){e/=4,u.push([t+r*Math.cos(-e),n+i*Math.sin(-e)]);for(let c=0;c<=2*Math.PI;c+=e){const h=[t+r*Math.cos(c),n+i*Math.sin(c)];l.push(h),u.push(h)}u.push([t+r*Math.cos(0),n+i*Math.sin(0)]),u.push([t+r*Math.cos(e),n+i*Math.sin(e)])}else{const c=ee(.5,a)-Math.PI/2;u.push([ee(s,a)+t+.9*r*Math.cos(c-e),ee(s,a)+n+.9*i*Math.sin(c-e)]);const h=2*Math.PI+c-.01;for(let f=c;f<h;f+=e){const p=[ee(s,a)+t+r*Math.cos(f),ee(s,a)+n+i*Math.sin(f)];l.push(p),u.push(p)}u.push([ee(s,a)+t+r*Math.cos(c+2*Math.PI+.5*o),ee(s,a)+n+i*Math.sin(c+2*Math.PI+.5*o)]),u.push([ee(s,a)+t+.98*r*Math.cos(c+o),ee(s,a)+n+.98*i*Math.sin(c+o)]),u.push([ee(s,a)+t+.9*r*Math.cos(c+.5*o),ee(s,a)+n+.9*i*Math.sin(c+.5*o)])}return[u,l]}function iv(e,t,n,r,i,s,o,a,l){const u=s+ee(.1,l),c=[];c.push([ee(a,l)+t+.9*r*Math.cos(u-e),ee(a,l)+n+.9*i*Math.sin(u-e)]);for(let h=u;h<=o;h+=e)c.push([ee(a,l)+t+r*Math.cos(h),ee(a,l)+n+i*Math.sin(h)]);return c.push([t+r*Math.cos(o),n+i*Math.sin(o)]),c.push([t+r*Math.cos(o),n+i*Math.sin(o)]),Hc(c,null,l)}function YD(e,t,n,r,i,s,o,a){const l=[],u=[a.maxRandomnessOffset||1,(a.maxRandomnessOffset||1)+.3];let c=[0,0];const h=a.disableMultiStroke?1:2,f=a.preserveVertices;for(let p=0;p<h;p++)p===0?l.push({op:"move",data:[o[0],o[1]]}):l.push({op:"move",data:[o[0]+(f?0:ee(u[0],a)),o[1]+(f?0:ee(u[0],a))]}),c=f?[i,s]:[i+ee(u[p],a),s+ee(u[p],a)],l.push({op:"bcurveTo",data:[e+ee(u[p],a),t+ee(u[p],a),n+ee(u[p],a),r+ee(u[p],a),c[0],c[1]]});return l}function jo(e){return[...e]}function sv(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(jo(e[0]),jo(e[1]),jo(e[2]),jo(e[2]));else{const i=[];i.push(e[0],e[0]);for(let a=1;a<e.length;a++)i.push(e[a]),a===e.length-1&&i.push(e[a]);const s=[],o=1-t;r.push(jo(i[0]));for(let a=1;a+2<i.length;a++){const l=i[a];s[0]=[l[0],l[1]],s[1]=[l[0]+(o*i[a+1][0]-o*i[a-1][0])/6,l[1]+(o*i[a+1][1]-o*i[a-1][1])/6],s[2]=[i[a+1][0]+(o*i[a][0]-o*i[a+2][0])/6,i[a+1][1]+(o*i[a][1]-o*i[a+2][1])/6],s[3]=[i[a+1][0],i[a+1][1]],r.push(s[1],s[2],s[3])}}return r}function ec(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function QD(e,t,n){const r=ec(t,n);if(r===0)return ec(e,t);let i=((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/r;return i=Math.max(0,Math.min(1,i)),ec(e,hi(t,n,i))}function hi(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function Af(e,t,n,r){const i=r||[];if(function(a,l){const u=a[l+0],c=a[l+1],h=a[l+2],f=a[l+3];let p=3*c[0]-2*u[0]-f[0];p*=p;let m=3*c[1]-2*u[1]-f[1];m*=m;let x=3*h[0]-2*f[0]-u[0];x*=x;let w=3*h[1]-2*f[1]-u[1];return w*=w,p<x&&(p=x),m<w&&(m=w),p+m}(e,t)<n){const a=e[t+0];i.length?(s=i[i.length-1],o=a,Math.sqrt(ec(s,o))>1&&i.push(a)):i.push(a),i.push(e[t+3])}else{const l=e[t+0],u=e[t+1],c=e[t+2],h=e[t+3],f=hi(l,u,.5),p=hi(u,c,.5),m=hi(c,h,.5),x=hi(f,p,.5),w=hi(p,m,.5),g=hi(x,w,.5);Af([l,f,x,g],0,n,i),Af([g,w,m,h],0,n,i)}var s,o;return i}function qD(e,t){return Gc(e,0,e.length,t)}function Gc(e,t,n,r,i){const s=i||[],o=e[t],a=e[n-1];let l=0,u=1;for(let c=t+1;c<n-1;++c){const h=QD(e[c],o,a);h>l&&(l=h,u=c)}return Math.sqrt(l)>r?(Gc(e,t,u+1,r,s),Gc(e,u,n,r,s)):(s.length||s.push(o),s.push(a)),s}function Qd(e,t=.15,n){const r=[],i=(e.length-1)/3;for(let s=0;s<i;s++)Af(e,3*s,t,r);return n&&n>0?Gc(r,0,r.length,n):r}const Nt="none";let Kc=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,i,s){const o=this._o(s);return this._d("line",[Wk(t,n,r,i,o)],o)}rectangle(t,n,r,i,s){const o=this._o(s),a=[],l=KD(t,n,r,i,o);if(o.fill){const u=[[t,n],[t+r,n],[t+r,n+i],[t,n+i]];o.fillStyle==="solid"?a.push(Yd([u],o)):a.push(qi([u],o))}return o.stroke!==Nt&&a.push(l),this._d("rectangle",a,o)}ellipse(t,n,r,i,s){const o=this._o(s),a=[],l=Uk(r,i,o),u=Rf(t,n,o,l);if(o.fill)if(o.fillStyle==="solid"){const c=Rf(t,n,o,l).opset;c.type="fillPath",a.push(c)}else a.push(qi([u.estimatedPoints],o));return o.stroke!==Nt&&a.push(u.opset),this._d("ellipse",a,o)}circle(t,n,r,i){const s=this.ellipse(t,n,r,r,i);return s.shape="circle",s}linearPath(t,n){const r=this._o(n);return this._d("linearPath",[Zl(t,!1,r)],r)}arc(t,n,r,i,s,o,a=!1,l){const u=this._o(l),c=[],h=ev(t,n,r,i,s,o,a,!0,u);if(a&&u.fill)if(u.fillStyle==="solid"){const f=Object.assign({},u);f.disableMultiStroke=!0;const p=ev(t,n,r,i,s,o,!0,!1,f);p.type="fillPath",c.push(p)}else c.push(function(f,p,m,x,w,g,y){const v=f,k=p;let P=Math.abs(m/2),b=Math.abs(x/2);P+=ee(.01*P,y),b+=ee(.01*b,y);let C=w,j=g;for(;C<0;)C+=2*Math.PI,j+=2*Math.PI;j-C>2*Math.PI&&(C=0,j=2*Math.PI);const T=(j-C)/y.curveStepCount,E=[];for(let A=C;A<=j;A+=T)E.push([v+P*Math.cos(A),k+b*Math.sin(A)]);return E.push([v+P*Math.cos(j),k+b*Math.sin(j)]),E.push([v,k]),qi([E],y)}(t,n,r,i,s,o,u));return u.stroke!==Nt&&c.push(h),this._d("arc",c,u)}curve(t,n){const r=this._o(n),i=[],s=Zx(t,r);if(r.fill&&r.fill!==Nt)if(r.fillStyle==="solid"){const o=Zx(t,Object.assign(Object.assign({},r),{disableMultiStroke:!0,roughness:r.roughness?r.roughness+r.fillShapeRoughnessGain:0}));i.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 u of l)u.length<3?o.push(...u):u.length===3?o.push(...Qd(sv([u[0],u[0],u[1],u[2]]),10,(1+r.roughness)/2)):o.push(...Qd(sv(u),10,(1+r.roughness)/2))}o.length&&i.push(qi([o],r))}return r.stroke!==Nt&&i.push(s),this._d("curve",i,r)}polygon(t,n){const r=this._o(n),i=[],s=Zl(t,!0,r);return r.fill&&(r.fillStyle==="solid"?i.push(Yd([t],r)):i.push(qi([t],r))),r.stroke!==Nt&&i.push(s),this._d("polygon",i,r)}path(t,n){const r=this._o(n),i=[];if(!t)return this._d("path",i,r);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const s=r.fill&&r.fill!=="transparent"&&r.fill!==Nt,o=r.stroke!==Nt,a=!!(r.simplification&&r.simplification<1),l=function(c,h,f){const p=Bk($k(Rm(c))),m=[];let x=[],w=[0,0],g=[];const y=()=>{g.length>=4&&x.push(...Qd(g,h)),g=[]},v=()=>{y(),x.length&&(m.push(x),x=[])};for(const{key:P,data:b}of p)switch(P){case"M":v(),w=[b[0],b[1]],x.push(w);break;case"L":y(),x.push([b[0],b[1]]);break;case"C":if(!g.length){const C=x.length?x[x.length-1]:w;g.push([C[0],C[1]])}g.push([b[0],b[1]]),g.push([b[2],b[3]]),g.push([b[4],b[5]]);break;case"Z":y(),x.push([w[0],w[1]])}if(v(),!f)return m;const k=[];for(const P of m){const b=qD(P,f);b.length&&k.push(b)}return k}(t,1,a?4-4*(r.simplification||1):(1+r.roughness)/2),u=tv(t,r);if(s)if(r.fillStyle==="solid")if(l.length===1){const c=tv(t,Object.assign(Object.assign({},r),{disableMultiStroke:!0,roughness:r.roughness?r.roughness+r.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(c.ops)})}else i.push(Yd(l,r));else i.push(qi(l,r));return o&&(a?l.forEach(c=>{i.push(Zl(c,!1,r))}):i.push(u)),this._d("path",i,r)}opsToPath(t,n){let r="";for(const i of t.ops){const s=typeof n=="number"&&n>=0?i.data.map(o=>+o.toFixed(n)):i.data;switch(i.op){case"move":r+=`M${s[0]} ${s[1]} `;break;case"bcurveTo":r+=`C${s[0]} ${s[1]}, ${s[2]} ${s[3]}, ${s[4]} ${s[5]} `;break;case"lineTo":r+=`L${s[0]} ${s[1]} `}}return r.trim()}toPaths(t){const n=t.sets||[],r=t.options||this.defaultOptions,i=[];for(const s of n){let o=null;switch(s.type){case"path":o={d:this.opsToPath(s),stroke:r.stroke,strokeWidth:r.strokeWidth,fill:Nt};break;case"fillPath":o={d:this.opsToPath(s),stroke:Nt,strokeWidth:0,fill:r.fill||Nt};break;case"fillSketch":o=this.fillSketch(s,r)}o&&i.push(o)}return i}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")}};class XD{constructor(t,n){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new Kc(n)}draw(t){const n=t.sets||[],r=t.options||this.getDefaultOptions(),i=this.ctx,s=t.options.fixedDecimalPlaceDigits;for(const o of n)switch(o.type){case"path":i.save(),i.strokeStyle=r.stroke==="none"?"transparent":r.stroke,i.lineWidth=r.strokeWidth,r.strokeLineDash&&i.setLineDash(r.strokeLineDash),r.strokeLineDashOffset&&(i.lineDashOffset=r.strokeLineDashOffset),this._drawToContext(i,o,s),i.restore();break;case"fillPath":{i.save(),i.fillStyle=r.fill||"";const a=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(i,o,s,a),i.restore();break}case"fillSketch":this.fillSketch(i,o,r)}}fillSketch(t,n,r){let i=r.fillWeight;i<0&&(i=r.strokeWidth/2),t.save(),r.fillLineDash&&t.setLineDash(r.fillLineDash),r.fillLineDashOffset&&(t.lineDashOffset=r.fillLineDashOffset),t.strokeStyle=r.fill||"",t.lineWidth=i,this._drawToContext(t,n,r.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,n,r,i="nonzero"){t.beginPath();for(const s of n.ops){const o=typeof r=="number"&&r>=0?s.data.map(a=>+a.toFixed(r)):s.data;switch(s.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(i):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,n,r,i,s){const o=this.gen.line(t,n,r,i,s);return this.draw(o),o}rectangle(t,n,r,i,s){const o=this.gen.rectangle(t,n,r,i,s);return this.draw(o),o}ellipse(t,n,r,i,s){const o=this.gen.ellipse(t,n,r,i,s);return this.draw(o),o}circle(t,n,r,i){const s=this.gen.circle(t,n,r,i);return this.draw(s),s}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,i,s,o,a=!1,l){const u=this.gen.arc(t,n,r,i,s,o,a,l);return this.draw(u),u}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 vl="http://www.w3.org/2000/svg";class JD{constructor(t,n){this.svg=t,this.gen=new Kc(n)}draw(t){const n=t.sets||[],r=t.options||this.getDefaultOptions(),i=this.svg.ownerDocument||window.document,s=i.createElementNS(vl,"g"),o=t.options.fixedDecimalPlaceDigits;for(const a of n){let l=null;switch(a.type){case"path":l=i.createElementNS(vl,"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=i.createElementNS(vl,"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(i,a,r)}l&&s.appendChild(l)}return s}fillSketch(t,n,r){let i=r.fillWeight;i<0&&(i=r.strokeWidth/2);const s=t.createElementNS(vl,"path");return s.setAttribute("d",this.opsToPath(n,r.fixedDecimalPlaceDigits)),s.setAttribute("stroke",r.fill||""),s.setAttribute("stroke-width",i+""),s.setAttribute("fill","none"),r.fillLineDash&&s.setAttribute("stroke-dasharray",r.fillLineDash.join(" ").trim()),r.fillLineDashOffset&&s.setAttribute("stroke-dashoffset",`${r.fillLineDashOffset}`),s}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,n){return this.gen.opsToPath(t,n)}line(t,n,r,i,s){const o=this.gen.line(t,n,r,i,s);return this.draw(o)}rectangle(t,n,r,i,s){const o=this.gen.rectangle(t,n,r,i,s);return this.draw(o)}ellipse(t,n,r,i,s){const o=this.gen.ellipse(t,n,r,i,s);return this.draw(o)}circle(t,n,r,i){const s=this.gen.circle(t,n,r,i);return this.draw(s)}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,i,s,o,a=!1,l){const u=this.gen.arc(t,n,r,i,s,o,a,l);return this.draw(u)}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 ZD={canvas:(e,t)=>new XD(e,t),svg:(e,t)=>new JD(e,t),generator:e=>new Kc(e),newSeed:()=>Kc.newSeed()};const Im=S.createContext({});function Am(e){const t=S.useRef(null);return t.current===null&&(t.current=e()),t.current}const eN=typeof window<"u",Gk=eN?S.useLayoutEffect:S.useEffect,Mu=S.createContext(null);function Mm(e,t){e.indexOf(t)===-1&&e.push(t)}function Yc(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Hn=(e,t,n)=>n>t?t:n<e?e:n;let Lm=()=>{};const qr={},Kk=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Yk=e=>typeof e=="object"&&e!==null,Qk=e=>/^0[^.\s]+$/u.test(e);function qk(e){let t;return()=>(t===void 0&&(t=e()),t)}const an=e=>e,Da=(...e)=>e.reduce((t,n)=>r=>n(t(r))),Sa=(e,t,n)=>{const r=t-e;return r?(n-e)/r:1};class Dm{constructor(){this.subscriptions=[]}add(t){return Mm(this.subscriptions,t),()=>Yc(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let s=0;s<i;s++){const o=this.subscriptions[s];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Ut=e=>e*1e3,sn=e=>e/1e3,Xk=(e,t)=>t?e*(1e3/t):0,Jk=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,tN=1e-7,nN=12;function rN(e,t,n,r,i){let s,o,a=0;do o=t+(n-t)/2,s=Jk(o,r,i)-e,s>0?n=o:t=o;while(Math.abs(s)>tN&&++a<nN);return o}function Na(e,t,n,r){if(e===t&&n===r)return an;const i=s=>rN(s,0,1,e,n);return s=>s===0||s===1?s:Jk(i(s),t,r)}const Zk=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,eS=e=>t=>1-e(1-t),tS=Na(.33,1.53,.69,.99),Nm=eS(tS),nS=Zk(Nm),rS=e=>e>=1?1:(e*=2)<1?.5*Nm(e):.5*(2-Math.pow(2,-10*(e-1))),zm=e=>1-Math.sin(Math.acos(e)),iS=eS(zm),sS=Zk(zm),iN=Na(.42,0,1,1),sN=Na(0,0,.58,1),oS=Na(.42,0,.58,1),oN=e=>Array.isArray(e)&&typeof e[0]!="number",aS=e=>Array.isArray(e)&&typeof e[0]=="number",aN={linear:an,easeIn:iN,easeInOut:oS,easeOut:sN,circIn:zm,circInOut:sS,circOut:iS,backIn:Nm,backInOut:nS,backOut:tS,anticipate:rS},lN=e=>typeof e=="string",ov=e=>{if(aS(e)){Lm(e.length===4);const[t,n,r,i]=e;return Na(t,n,r,i)}else if(lN(e))return aN[e];return e},wl=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function cN(e,t){let n=new Set,r=new Set,i=!1,s=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(c){o.has(c)&&(u.schedule(c),e()),c(a)}const u={schedule:(c,h=!1,f=!1)=>{const m=f&&i?n:r;return h&&o.add(c),m.add(c),c},cancel:c=>{r.delete(c),o.delete(c)},process:c=>{if(a=c,i){s=!0;return}i=!0;const h=n;n=r,r=h,n.forEach(l),n.clear(),i=!1,s&&(s=!1,u.process(c))}};return u}const uN=40;function lS(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,o=wl.reduce((v,k)=>(v[k]=cN(s),v),{}),{setup:a,read:l,resolveKeyframes:u,preUpdate:c,update:h,preRender:f,render:p,postRender:m}=o,x=()=>{const v=qr.useManualTiming,k=v?i.timestamp:performance.now();n=!1,v||(i.delta=r?1e3/60:Math.max(Math.min(k-i.timestamp,uN),1)),i.timestamp=k,i.isProcessing=!0,a.process(i),l.process(i),u.process(i),c.process(i),h.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(x))},w=()=>{n=!0,r=!0,i.isProcessing||e(x)};return{schedule:wl.reduce((v,k)=>{const P=o[k];return v[k]=(b,C=!1,j=!1)=>(n||w(),P.schedule(b,C,j)),v},{}),cancel:v=>{for(let k=0;k<wl.length;k++)o[wl[k]].cancel(v)},state:i,steps:o}}const{schedule:ke,cancel:Xr,state:tt,steps:qd}=lS(typeof requestAnimationFrame<"u"?requestAnimationFrame:an,!0);let tc;function dN(){tc=void 0}const mt={now:()=>(tc===void 0&&mt.set(tt.isProcessing||qr.useManualTiming?tt.timestamp:performance.now()),tc),set:e=>{tc=e,queueMicrotask(dN)}},cS=e=>t=>typeof t=="string"&&t.startsWith(e),uS=cS("--"),hN=cS("var(--"),Om=e=>hN(e)?fN.test(e.split("/*")[0].trim()):!1,fN=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function av(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Zs={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},_a={...Zs,transform:e=>Hn(0,1,e)},bl={...Zs,default:1},qo=e=>Math.round(e*1e5)/1e5,Fm=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function pN(e){return e==null}const mN=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,$m=(e,t)=>n=>!!(typeof n=="string"&&mN.test(n)&&n.startsWith(e)||t&&!pN(n)&&Object.prototype.hasOwnProperty.call(n,t)),dS=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,s,o,a]=r.match(Fm);return{[e]:parseFloat(i),[t]:parseFloat(s),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},gN=e=>Hn(0,255,e),Xd={...Zs,transform:e=>Math.round(gN(e))},bi={test:$m("rgb","red"),parse:dS("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Xd.transform(e)+", "+Xd.transform(t)+", "+Xd.transform(n)+", "+qo(_a.transform(r))+")"};function yN(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const Mf={test:$m("#"),parse:yN,transform:bi.transform},za=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Jn=za("deg"),Wn=za("%"),Q=za("px"),xN=za("vh"),vN=za("vw"),lv={...Wn,parse:e=>Wn.parse(e)/100,transform:e=>Wn.transform(e*100)},gs={test:$m("hsl","hue"),parse:dS("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Wn.transform(qo(t))+", "+Wn.transform(qo(n))+", "+qo(_a.transform(r))+")"},Ge={test:e=>bi.test(e)||Mf.test(e)||gs.test(e),parse:e=>bi.test(e)?bi.parse(e):gs.test(e)?gs.parse(e):Mf.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?bi.transform(e):gs.transform(e),getAnimatableNone:e=>{const t=Ge.parse(e);return t.alpha=0,Ge.transform(t)}},wN=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function bN(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Fm))==null?void 0:t.length)||0)+(((n=e.match(wN))==null?void 0:n.length)||0)>0}const hS="number",fS="color",kN="var",SN="var(",cv="${}",_N=/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 $s(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const a=t.replace(_N,l=>(Ge.test(l)?(r.color.push(s),i.push(fS),n.push(Ge.parse(l))):l.startsWith(SN)?(r.var.push(s),i.push(kN),n.push(l)):(r.number.push(s),i.push(hS),n.push(parseFloat(l))),++s,cv)).split(cv);return{values:n,split:a,indexes:r,types:i}}function CN(e){return $s(e).values}function pS({split:e,types:t}){const n=e.length;return r=>{let i="";for(let s=0;s<n;s++)if(i+=e[s],r[s]!==void 0){const o=t[s];o===hS?i+=qo(r[s]):o===fS?i+=Ge.transform(r[s]):i+=r[s]}return i}}function jN(e){return pS($s(e))}const PN=e=>typeof e=="number"?0:Ge.test(e)?Ge.getAnimatableNone(e):e,EN=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:PN(e);function TN(e){const t=$s(e);return pS(t)(t.values.map((r,i)=>EN(r,t.split[i])))}const kn={test:bN,parse:CN,createTransformer:jN,getAnimatableNone:TN};function Jd(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 RN({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,s=0,o=0;if(!t)i=s=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;i=Jd(l,a,e+1/3),s=Jd(l,a,e),o=Jd(l,a,e-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:r}}function Qc(e,t){return n=>n>0?t:e}const be=(e,t,n)=>e+(t-e)*n,Zd=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},IN=[Mf,bi,gs],AN=e=>IN.find(t=>t.test(e));function uv(e){const t=AN(e);if(!t)return!1;let n=t.parse(e);return t===gs&&(n=RN(n)),n}const dv=(e,t)=>{const n=uv(e),r=uv(t);if(!n||!r)return Qc(e,t);const i={...n};return s=>(i.red=Zd(n.red,r.red,s),i.green=Zd(n.green,r.green,s),i.blue=Zd(n.blue,r.blue,s),i.alpha=be(n.alpha,r.alpha,s),bi.transform(i))},Lf=new Set(["none","hidden"]);function MN(e,t){return Lf.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function LN(e,t){return n=>be(e,t,n)}function Bm(e){return typeof e=="number"?LN:typeof e=="string"?Om(e)?Qc:Ge.test(e)?dv:zN:Array.isArray(e)?mS:typeof e=="object"?Ge.test(e)?dv:DN:Qc}function mS(e,t){const n=[...e],r=n.length,i=e.map((s,o)=>Bm(s)(s,t[o]));return s=>{for(let o=0;o<r;o++)n[o]=i[o](s);return n}}function DN(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Bm(e[i])(e[i],t[i]));return i=>{for(const s in r)n[s]=r[s](i);return n}}function NN(e,t){const n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const s=t.types[i],o=e.indexes[s][r[s]],a=e.values[o]??0;n[i]=a,r[s]++}return n}const zN=(e,t)=>{const n=kn.createTransformer(t),r=$s(e),i=$s(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?Lf.has(e)&&!i.values.length||Lf.has(t)&&!r.values.length?MN(e,t):Da(mS(NN(r,i),i.values),n):Qc(e,t)};function gS(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?be(e,t,n):Bm(e)(e,t)}const ON=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>ke.update(t,n),stop:()=>Xr(t),now:()=>tt.isProcessing?tt.timestamp:mt.now()}},yS=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let s=0;s<i;s++)r+=Math.round(e(s/(i-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},qc=2e4;function Vm(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<qc;)t+=n,r=e.next(t);return t>=qc?1/0:t}function FN(e,t=100,n){const r=n({...e,keyframes:[0,t]}),i=Math.min(Vm(r),qc);return{type:"keyframes",ease:s=>r.next(i*s).value/t,duration:sn(i)}}const Fe={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 Df(e,t){return e*Math.sqrt(1-t*t)}const $N=12;function BN(e,t,n){let r=n;for(let i=1;i<$N;i++)r=r-e(r)/t(r);return r}const eh=.001;function VN({duration:e=Fe.duration,bounce:t=Fe.bounce,velocity:n=Fe.velocity,mass:r=Fe.mass}){let i,s,o=1-t;o=Hn(Fe.minDamping,Fe.maxDamping,o),e=Hn(Fe.minDuration,Fe.maxDuration,sn(e)),o<1?(i=u=>{const c=u*o,h=c*e,f=c-n,p=Df(u,o),m=Math.exp(-h);return eh-f/p*m},s=u=>{const h=u*o*e,f=h*n+n,p=Math.pow(o,2)*Math.pow(u,2)*e,m=Math.exp(-h),x=Df(Math.pow(u,2),o);return(-i(u)+eh>0?-1:1)*((f-p)*m)/x}):(i=u=>{const c=Math.exp(-u*e),h=(u-n)*e+1;return-eh+c*h},s=u=>{const c=Math.exp(-u*e),h=(n-u)*(e*e);return c*h});const a=5/e,l=BN(i,s,a);if(e=Ut(e),isNaN(l))return{stiffness:Fe.stiffness,damping:Fe.damping,duration:e};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:o*2*Math.sqrt(r*u),duration:e}}}const WN=["duration","bounce"],UN=["stiffness","damping","mass"];function hv(e,t){return t.some(n=>e[n]!==void 0)}function HN(e){let t={velocity:Fe.velocity,stiffness:Fe.stiffness,damping:Fe.damping,mass:Fe.mass,isResolvedFromDuration:!1,...e};if(!hv(e,UN)&&hv(e,WN))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,s=2*Hn(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:Fe.mass,stiffness:i,damping:s}}else{const n=VN({...e,velocity:0});t={...t,...n,mass:Fe.mass},t.isResolvedFromDuration=!0}return t}function Xc(e=Fe.visualDuration,t=Fe.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const s=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:l,damping:u,mass:c,duration:h,velocity:f,isResolvedFromDuration:p}=HN({...n,velocity:-sn(n.velocity||0)}),m=f||0,x=u/(2*Math.sqrt(l*c)),w=o-s,g=sn(Math.sqrt(l/c)),y=Math.abs(w)<5;r||(r=y?Fe.restSpeed.granular:Fe.restSpeed.default),i||(i=y?Fe.restDelta.granular:Fe.restDelta.default);let v,k,P,b,C,j;if(x<1)P=Df(g,x),b=(m+x*g*w)/P,v=E=>{const A=Math.exp(-x*g*E);return o-A*(b*Math.sin(P*E)+w*Math.cos(P*E))},C=x*g*b+w*P,j=x*g*w-b*P,k=E=>Math.exp(-x*g*E)*(C*Math.sin(P*E)+j*Math.cos(P*E));else if(x===1){v=A=>o-Math.exp(-g*A)*(w+(m+g*w)*A);const E=m+g*w;k=A=>Math.exp(-g*A)*(g*E*A-m)}else{const E=g*Math.sqrt(x*x-1);v=D=>{const L=Math.exp(-x*g*D),$=Math.min(E*D,300);return o-L*((m+x*g*w)*Math.sinh($)+E*w*Math.cosh($))/E};const A=(m+x*g*w)/E,M=x*g*A-w*E,F=x*g*w-A*E;k=D=>{const L=Math.exp(-x*g*D),$=Math.min(E*D,300);return L*(M*Math.sinh($)+F*Math.cosh($))}}const T={calculatedDuration:p&&h||null,velocity:E=>Ut(k(E)),next:E=>{if(!p&&x<1){const M=Math.exp(-x*g*E),F=Math.sin(P*E),D=Math.cos(P*E),L=o-M*(b*F+w*D),$=Ut(M*(C*F+j*D));return a.done=Math.abs($)<=r&&Math.abs(o-L)<=i,a.value=a.done?o:L,a}const A=v(E);if(p)a.done=E>=h;else{const M=Ut(k(E));a.done=Math.abs(M)<=r&&Math.abs(o-A)<=i}return a.value=a.done?o:A,a},toString:()=>{const E=Math.min(Vm(T),qc),A=yS(M=>T.next(E*M).value,E,30);return E+"ms "+A},toTransition:()=>{}};return T}Xc.applyToOptions=e=>{const t=FN(e,100,Xc);return e.ease=t.ease,e.duration=Ut(t.duration),e.type="keyframes",e};const GN=5;function xS(e,t,n){const r=Math.max(t-GN,0);return Xk(n-e(r),t-r)}function Nf({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:c}){const h=e[0],f={done:!1,value:h},p=j=>a!==void 0&&j<a||l!==void 0&&j>l,m=j=>a===void 0?l:l===void 0||Math.abs(a-j)<Math.abs(l-j)?a:l;let x=n*t;const w=h+x,g=o===void 0?w:o(w);g!==w&&(x=g-h);const y=j=>-x*Math.exp(-j/r),v=j=>g+y(j),k=j=>{const T=y(j),E=v(j);f.done=Math.abs(T)<=u,f.value=f.done?g:E};let P,b;const C=j=>{p(f.value)&&(P=j,b=Xc({keyframes:[f.value,m(f.value)],velocity:xS(v,j,f.value),damping:i,stiffness:s,restDelta:u,restSpeed:c}))};return C(0),{calculatedDuration:null,next:j=>{let T=!1;return!b&&P===void 0&&(T=!0,k(j),C(j)),P!==void 0&&j>=P?b.next(j-P):(!T&&k(j),f)}}}function KN(e,t,n){const r=[],i=n||qr.mix||gS,s=e.length-1;for(let o=0;o<s;o++){let a=i(e[o],e[o+1]);if(t){const l=Array.isArray(t)?t[o]||an:t;a=Da(l,a)}r.push(a)}return r}function YN(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const s=e.length;if(Lm(s===t.length),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=KN(t,r,i),l=a.length,u=c=>{if(o&&c<e[0])return t[0];let h=0;if(l>1)for(;h<e.length-2&&!(c<e[h+1]);h++);const f=Sa(e[h],e[h+1],c);return a[h](f)};return n?c=>u(Hn(e[0],e[s-1],c)):u}function QN(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=Sa(0,t,r);e.push(be(n,1,i))}}function qN(e){const t=[0];return QN(t,e.length-1),t}function XN(e,t){return e.map(n=>n*t)}function JN(e,t){return e.map(()=>t||oS).splice(0,e.length-1)}function Xo({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=oN(r)?r.map(ov):ov(r),s={done:!1,value:t[0]},o=XN(n&&n.length===t.length?n:qN(t),e),a=YN(o,t,{ease:Array.isArray(i)?i:JN(t,i)});return{calculatedDuration:e,next:l=>(s.value=a(l),s.done=l>=e,s)}}const ZN=e=>e!==null;function Lu(e,{repeat:t,repeatType:n="loop"},r,i=1){const s=e.filter(ZN),a=i<0||t&&n!=="loop"&&t%2===1?0:s.length-1;return!a||r===void 0?s[a]:r}const e3={decay:Nf,inertia:Nf,tween:Xo,keyframes:Xo,spring:Xc};function vS(e){typeof e.type=="string"&&(e.type=e3[e.type])}class Wm{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 t3=e=>e/100;class Jc extends Wm{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,i;const{motionValue:n}=this.options;n&&n.updatedAt!==mt.now()&&this.tick(mt.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(r=this.options).onStop)==null||i.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;vS(t);const{type:n=Xo,repeat:r=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=t;let{keyframes:a}=t;const l=n||Xo;l!==Xo&&typeof a[0]!="number"&&(this.mixKeyframes=Da(t3,gS(a[0],a[1])),a=[0,100]);const u=l({...t,keyframes:a});s==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...a].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=Vm(u));const{calculatedDuration:c}=u;this.calculatedDuration=c,this.resolvedDuration=c+i,this.totalDuration=this.resolvedDuration*(r+1)-i,this.generator=u}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:i,mixKeyframes:s,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return r.next(0);const{delay:u=0,keyframes:c,repeat:h,repeatType:f,repeatDelay:p,type:m,onUpdate:x,finalKeyframe:w}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const g=this.currentTime-u*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?g<0:g>i;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let v=this.currentTime,k=r;if(h){const j=Math.min(this.currentTime,i)/a;let T=Math.floor(j),E=j%1;!E&&j>=1&&(E=1),E===1&&T--,T=Math.min(T,h+1),!!(T%2)&&(f==="reverse"?(E=1-E,p&&(E-=p/a)):f==="mirror"&&(k=o)),v=Hn(0,1,E)*a}let P;y?(this.delayState.value=c[0],P=this.delayState):P=k.next(v),s&&!y&&(P.value=s(P.value));let{done:b}=P;!y&&l!==null&&(b=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const C=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&b);return C&&m!==Nf&&(P.value=Lu(c,this.options,w,this.speed)),x&&x(P.value),C&&this.finish(),P}then(t,n){return this.finished.then(t,n)}get duration(){return sn(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+sn(t)}get time(){return sn(this.currentTime)}set time(t){t=Ut(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 xS(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(mt.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=sn(this.currentTime))}play(){var i,s;if(this.isStopped)return;const{driver:t=ON,startTime:n}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),(s=(i=this.options).onPlay)==null||s.call(i);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(mt.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 n3(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const ki=e=>e*180/Math.PI,zf=e=>{const t=ki(Math.atan2(e[1],e[0]));return Of(t)},r3={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:zf,rotateZ:zf,skewX:e=>ki(Math.atan(e[1])),skewY:e=>ki(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Of=e=>(e=e%360,e<0&&(e+=360),e),fv=zf,pv=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),mv=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),i3={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:pv,scaleY:mv,scale:e=>(pv(e)+mv(e))/2,rotateX:e=>Of(ki(Math.atan2(e[6],e[5]))),rotateY:e=>Of(ki(Math.atan2(-e[2],e[0]))),rotateZ:fv,rotate:fv,skewX:e=>ki(Math.atan(e[4])),skewY:e=>ki(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Ff(e){return e.includes("scale")?1:0}function $f(e,t){if(!e||e==="none")return Ff(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,i;if(n)r=i3,i=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=r3,i=a}if(!i)return Ff(t);const s=r[t],o=i[1].split(",").map(o3);return typeof s=="function"?s(o):o[s]}const s3=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return $f(n,t)};function o3(e){return parseFloat(e.trim())}const eo=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],to=new Set([...eo,"pathRotation"]),gv=e=>e===Zs||e===Q,a3=new Set(["x","y","z"]),l3=eo.filter(e=>!a3.has(e));function c3(e){const t=[];return l3.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 i=e.max-e.min;return r==="border-box"?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:r})=>{const i=e.max-e.min;return r==="border-box"?i:i-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})=>$f(t,"x"),y:(e,{transform:t})=>$f(t,"y")};Nr.translateX=Nr.x;Nr.translateY=Nr.y;const Ri=new Set;let Bf=!1,Vf=!1,Wf=!1;function wS(){if(Vf){const e=Array.from(Ri).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=c3(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([s,o])=>{var a;(a=r.getValue(s))==null||a.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Vf=!1,Bf=!1,Ri.forEach(e=>e.complete(Wf)),Ri.clear()}function bS(){Ri.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Vf=!0)})}function u3(){Wf=!0,bS(),wS(),Wf=!1}class Um{constructor(t,n,r,i,s,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(Ri.add(this),Bf||(Bf=!0,ke.read(bS),ke.resolveKeyframes(wS))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;if(t[0]===null){const s=i==null?void 0:i.get(),o=t[t.length-1];if(s!==void 0)t[0]=s;else if(r&&n){const a=r.readValue(n,o);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=o),i&&s===void 0&&i.set(t[0])}n3(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Ri.delete(this)}cancel(){this.state==="scheduled"&&(Ri.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const d3=e=>e.startsWith("--");function kS(e,t,n){d3(t)?e.style.setProperty(t,n):e.style[t]=n}const h3={};function SS(e,t){const n=qk(e);return()=>h3[t]??n()}const f3=SS(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),_S=SS(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Do=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,yv={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Do([0,.65,.55,1]),circOut:Do([.55,0,1,.45]),backIn:Do([.31,.01,.66,-.59]),backOut:Do([.33,1.53,.69,.99])};function CS(e,t){if(e)return typeof e=="function"?_S()?yS(e,t):"ease-out":aS(e)?Do(e):Array.isArray(e)?e.map(n=>CS(n,t)||yv.easeOut):yv[e]}function p3(e,t,n,{delay:r=0,duration:i=300,repeat:s=0,repeatType:o="loop",ease:a="easeOut",times:l}={},u=void 0){const c={[t]:n};l&&(c.offset=l);const h=CS(a,i);Array.isArray(h)&&(c.easing=h);const f={delay:r,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"};return u&&(f.pseudoElement=u),e.animate(c,f)}function jS(e){return typeof e=="function"&&"applyToOptions"in e}function m3({type:e,...t}){return jS(e)&&_S()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class PS extends Wm{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:r,keyframes:i,pseudoElement:s,allowFlatten:o=!1,finalKeyframe:a,onComplete:l}=t;this.isPseudoElement=!!s,this.allowFlatten=o,this.options=t,Lm(typeof t.type!="string");const u=m3(t);this.animation=p3(n,r,i,u,s),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const c=Lu(i,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(c),kS(n,r,c),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,i;const t=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((i=(r=this.animation).commitStyles)==null||i.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 sn(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+sn(t)}get time(){return sn(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Ut(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:i}){var s;return this.allowFlatten&&((s=this.animation.effect)==null||s.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&f3()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),an):i(this)}}const ES={anticipate:rS,backInOut:nS,circInOut:sS};function g3(e){return e in ES}function y3(e){typeof e.ease=="string"&&g3(e.ease)&&(e.ease=ES[e.ease])}const th=10;class x3 extends PS{constructor(t){y3(t),vS(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:i,element:s,...o}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new Jc({...o,autoplay:!1}),l=Math.max(th,mt.now()-this.startTime),u=Hn(0,th,l-th),c=a.sample(l).value,{name:h}=this.options;s&&h&&kS(s,h,c),n.setWithVelocity(a.sample(Math.max(0,l-u)).value,c,u),a.stop()}}const xv=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(kn.test(e)||e==="0")&&!e.startsWith("url("));function v3(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 w3(e,t,n,r){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const s=e[e.length-1],o=xv(i,t),a=xv(s,t);return!o||!a?!1:v3(e)||(n==="spring"||jS(n))&&r}function Uf(e){e.duration=0,e.type="keyframes"}const TS=new Set(["opacity","clipPath","filter","transform"]),b3=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function k3(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&b3.test(e[t]))return!0;return!1}const S3=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),_3=qk(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function C3(e){var h;const{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:s,type:o,keyframes:a}=e;if(!(((h=t==null?void 0:t.owner)==null?void 0:h.current)instanceof HTMLElement))return!1;const{onUpdate:u,transformTemplate:c}=t.owner.getProps();return _3()&&n&&(TS.has(n)||S3.has(n)&&k3(a))&&(n!=="transform"||!c)&&!u&&!r&&i!=="mirror"&&s!==0&&o!=="inertia"}const j3=40;class P3 extends Wm{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",keyframes:a,name:l,motionValue:u,element:c,...h}){var m;super(),this.stop=()=>{var x,w;this._animation&&(this._animation.stop(),(x=this.stopTimeline)==null||x.call(this)),(w=this.keyframeResolver)==null||w.cancel()},this.createdAt=mt.now();const f={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:s,repeatType:o,name:l,motionValue:u,element:c,...h},p=(c==null?void 0:c.KeyframeResolver)||Um;this.keyframeResolver=new p(a,(x,w,g)=>this.onKeyframesResolved(x,w,f,!g),l,u,c),(m=this.keyframeResolver)==null||m.scheduleResolve()}onKeyframesResolved(t,n,r,i){var g,y;this.keyframeResolver=void 0;const{name:s,type:o,velocity:a,delay:l,isHandoff:u,onUpdate:c}=r;this.resolvedAt=mt.now();let h=!0;w3(t,s,o,a)||(h=!1,(qr.instantAnimations||!l)&&(c==null||c(Lu(t,r,n))),t[0]=t[t.length-1],Uf(r),r.repeat=0);const p={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>j3?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},m=h&&!u&&C3(p),x=(y=(g=p.motionValue)==null?void 0:g.owner)==null?void 0:y.current;let w;if(m)try{w=new x3({...p,element:x})}catch{w=new Jc(p)}else w=new Jc(p);w.finished.then(()=>{this.notifyFinished()}).catch(an),this.pendingTimeline&&(this.stopTimeline=w.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=w}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),u3()),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 RS(e,t,n,r=0,i=1){const s=Array.from(e).sort((u,c)=>u.sortNodePosition(c)).indexOf(t),o=e.size,a=(o-1)*r;return typeof n=="function"?n(s,o):i===1?s*r:a-s*r}const vv=30,E3=e=>!isNaN(parseFloat(e));class T3{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var s;const i=mt.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((s=this.events.change)==null||s.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=mt.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=E3(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 Dm);const r=this.events[t].add(n);return t==="change"?()=>{r(),ke.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=mt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>vv)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,vv);return Xk(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 Bs(e,t){return new T3(e,t)}function IS(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function Hm(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?IS(n,e):n}const R3={type:"spring",stiffness:500,damping:25,restSpeed:10},I3=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),A3={type:"keyframes",duration:.8},M3={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},L3=(e,{keyframes:t})=>t.length>2?A3:to.has(e)?e.startsWith("scale")?I3(t[1]):R3:M3,D3=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function N3(e){for(const t in e)if(!D3.has(t))return!0;return!1}const Gm=(e,t,n,r={},i,s)=>o=>{const a=Hm(r,e)||{},l=a.delay||r.delay||0;let{elapsed:u=0}=r;u=u-Ut(l);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-u,onUpdate:f=>{t.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:s?void 0:i};N3(a)||Object.assign(c,L3(e,c)),c.duration&&(c.duration=Ut(c.duration)),c.repeatDelay&&(c.repeatDelay=Ut(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let h=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(Uf(c),c.delay===0&&(h=!0)),(qr.instantAnimations||qr.skipAnimations||i!=null&&i.shouldSkipAnimations||a.skipAnimations)&&(h=!0,Uf(c),c.delay=0),c.allowFlatten=!a.type&&!a.ease,h&&!s&&t.get()!==void 0){const f=Lu(c.keyframes,a);if(f!==void 0){ke.update(()=>{c.onUpdate(f),c.onComplete()});return}}return a.isSync?new Jc(c):new P3(c)},z3=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function O3(e){const t=z3.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}function AS(e,t,n=1){const[r,i]=O3(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const o=s.trim();return Kk(o)?parseFloat(o):o}return Om(i)?AS(i,t,n+1):i}function wv(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Km(e,t,n,r){if(typeof t=="function"){const[i,s]=wv(r);t=t(n!==void 0?n:e.custom,i,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,s]=wv(r);t=t(n!==void 0?n:e.custom,i,s)}return t}function Ii(e,t,n){const r=e.getProps();return Km(r,t,n!==void 0?n:r.custom,e)}const MS=new Set(["width","height","top","left","right","bottom",...eo]),Hf=e=>Array.isArray(e);function F3(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Bs(n))}function $3(e){return Hf(e)?e[e.length-1]||0:e}function B3(e,t){const n=Ii(e,t);let{transitionEnd:r={},transition:i={},...s}=n||{};s={...s,...r};for(const o in s){const a=$3(s[o]);F3(e,o,a)}}const nt=e=>!!(e&&e.getVelocity);function V3(e){return!!(nt(e)&&e.add)}function Gf(e,t){const n=e.getValue("willChange");if(V3(n))return n.add(t);if(!n&&qr.WillChange){const r=new qr.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Ym(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const W3="framerAppearId",LS="data-"+Ym(W3);function DS(e){return e.props[LS]}function U3({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function NS(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:s,transitionEnd:o,...a}=t;const l=e.getDefaultTransition();s=s?IS(s,l):l;const u=s==null?void 0:s.reduceMotion,c=s==null?void 0:s.skipAnimations;r&&(s=r);const h=[],f=i&&e.animationState&&e.animationState.getState()[i],p=s==null?void 0:s.path;p&&p.animateVisualElement(e,a,s,n,h);for(const m in a){const x=e.getValue(m,e.latestValues[m]??null),w=a[m];if(w===void 0||f&&U3(f,m))continue;const g={delay:n,...Hm(s||{},m)};c&&(g.skipAnimations=!0);const y=x.get();if(y!==void 0&&!x.isAnimating()&&!Array.isArray(w)&&w===y&&!g.velocity){ke.update(()=>x.set(w));continue}let v=!1;if(window.MotionHandoffAnimation){const b=DS(e);if(b){const C=window.MotionHandoffAnimation(b,m,ke);C!==null&&(g.startTime=C,v=!0)}}Gf(e,m);const k=u??e.shouldReduceMotion;x.start(Gm(m,x,w,k&&MS.has(m)?{type:!1}:g,e,v));const P=x.animation;P&&h.push(P)}if(o){const m=()=>ke.update(()=>{o&&B3(e,o)});h.length?Promise.all(h).then(m):m()}return h}function Kf(e,t,n={}){var l;const r=Ii(e,t,n.type==="exit"?(l=e.presenceContext)==null?void 0:l.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const s=r?()=>Promise.all(NS(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:c=0,staggerChildren:h,staggerDirection:f}=i;return H3(e,t,u,c,h,f,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[u,c]=a==="beforeChildren"?[s,o]:[o,s];return u().then(()=>c())}else return Promise.all([s(),o(n.delay)])}function H3(e,t,n=0,r=0,i=0,s=1,o){const a=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),a.push(Kf(l,t,{...o,delay:n+(typeof r=="function"?0:r)+RS(e.variantChildren,l,r,i,s)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(a)}function G3(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(s=>Kf(e,s,n));r=Promise.all(i)}else if(typeof t=="string")r=Kf(e,t,n);else{const i=typeof t=="function"?Ii(e,t,n.custom):t;r=Promise.all(NS(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const K3={test:e=>e==="auto",parse:e=>e},zS=e=>t=>t.test(e),OS=[Zs,Q,Wn,Jn,vN,xN,K3],bv=e=>OS.find(zS(e));function Y3(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Qk(e):!0}const Q3=new Set(["brightness","contrast","saturate","opacity"]);function q3(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Fm)||[];if(!r)return e;const i=n.replace(r,"");let s=Q3.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+i+")"}const X3=/\b([a-z-]*)\(.*?\)/gu,Yf={...kn,getAnimatableNone:e=>{const t=e.match(X3);return t?t.map(q3).join(" "):e}},Qf={...kn,getAnimatableNone:e=>{const t=kn.parse(e);return kn.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},kv={...Zs,transform:Math.round},J3={rotate:Jn,pathRotation:Jn,rotateX:Jn,rotateY:Jn,rotateZ:Jn,scale:bl,scaleX:bl,scaleY:bl,scaleZ:bl,skew:Jn,skewX:Jn,skewY:Jn,distance:Q,translateX:Q,translateY:Q,translateZ:Q,x:Q,y:Q,z:Q,perspective:Q,transformPerspective:Q,opacity:_a,originX:lv,originY:lv,originZ:Q},Zc={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,...J3,zIndex:kv,fillOpacity:_a,strokeOpacity:_a,numOctaves:kv},Z3={...Zc,color:Ge,backgroundColor:Ge,outlineColor:Ge,fill:Ge,stroke:Ge,borderColor:Ge,borderTopColor:Ge,borderRightColor:Ge,borderBottomColor:Ge,borderLeftColor:Ge,filter:Yf,WebkitFilter:Yf,mask:Qf,WebkitMask:Qf},FS=e=>Z3[e],ez=new Set([Yf,Qf]);function $S(e,t){let n=FS(e);return ez.has(n)||(n=kn),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const tz=new Set(["auto","none","0"]);function nz(e,t,n){let r=0,i;for(;r<e.length&&!i;){const s=e[r];typeof s=="string"&&!tz.has(s)&&$s(s).values.length&&(i=e[r]),r++}if(i&&n)for(const s of t)e[s]=$S(n,i)}class rz extends Um{constructor(t,n,r,i,s){super(t,n,r,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<t.length;c++){let h=t[c];if(typeof h=="string"&&(h=h.trim(),Om(h))){const f=AS(h,n.current);f!==void 0&&(t[c]=f),c===t.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!MS.has(r)||t.length!==2)return;const[i,s]=t,o=bv(i),a=bv(s),l=av(i),u=av(s);if(l!==u&&Nr[r]){this.needsMeasurement=!0;return}if(o!==a)if(gv(o)&&gv(a))for(let c=0;c<t.length;c++){const h=t[c];typeof h=="string"&&(t[c]=parseFloat(h))}else Nr[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let i=0;i<t.length;i++)(t[i]===null||Y3(t[i]))&&r.push(i);r.length&&nz(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 i=n[n.length-1];i!==void 0&&t.getValue(r,i).jump(i,!1)}measureEndState(){var a;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const i=t.getValue(n);i&&i.jump(this.measuredOrigin,!1);const s=r.length-1,o=r[s];r[s]=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,u])=>{t.getValue(l).set(u)}),this.resolveNoneKeyframes()}}function BS(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const i=(n==null?void 0:n[e])??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(r=>r!=null)}const qf=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function nc(e){return Yk(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:Qm}=lS(queueMicrotask,!1),gn={x:!1,y:!1};function VS(){return gn.x||gn.y}function iz(e){return e==="x"||e==="y"?gn[e]?null:(gn[e]=!0,()=>{gn[e]=!1}):gn.x||gn.y?null:(gn.x=gn.y=!0,()=>{gn.x=gn.y=!1})}function WS(e,t){const n=BS(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function sz(e){return!(e.pointerType==="touch"||VS())}function oz(e,t,n={}){const[r,i,s]=WS(e,n);return r.forEach(o=>{let a=!1,l=!1,u;const c=()=>{o.removeEventListener("pointerleave",m)},h=w=>{u&&(u(w),u=void 0),c()},f=w=>{a=!1,window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f),l&&(l=!1,h(w))},p=()=>{a=!0,window.addEventListener("pointerup",f,i),window.addEventListener("pointercancel",f,i)},m=w=>{if(w.pointerType!=="touch"){if(a){l=!0;return}h(w)}},x=w=>{if(!sz(w))return;l=!1;const g=t(o,w);typeof g=="function"&&(u=g,o.addEventListener("pointerleave",m,i))};o.addEventListener("pointerenter",x,i),o.addEventListener("pointerdown",p,i)}),s}const US=(e,t)=>t?e===t?!0:US(e,t.parentElement):!1,qm=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,az=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function lz(e){return az.has(e.tagName)||e.isContentEditable===!0}const cz=new Set(["INPUT","SELECT","TEXTAREA"]);function uz(e){return cz.has(e.tagName)||e.isContentEditable===!0}const rc=new WeakSet;function Sv(e){return t=>{t.key==="Enter"&&e(t)}}function nh(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const dz=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Sv(()=>{if(rc.has(n))return;nh(n,"down");const i=Sv(()=>{nh(n,"up")}),s=()=>nh(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function _v(e){return qm(e)&&!VS()}const Cv=new WeakSet;function hz(e,t,n={}){const[r,i,s]=WS(e,n),o=a=>{const l=a.currentTarget;if(!_v(a)||Cv.has(a))return;rc.add(l),n.stopPropagation&&Cv.add(a);const u=t(l,a),c=(p,m)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",f),rc.has(l)&&rc.delete(l),_v(p)&&typeof u=="function"&&u(p,{success:m})},h=p=>{c(p,l===window||l===document||n.useGlobalTarget||US(l,p.target))},f=p=>{c(p,!1)};window.addEventListener("pointerup",h,i),window.addEventListener("pointercancel",f,i)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),nc(a)&&(a.addEventListener("focus",u=>dz(u,i)),!lz(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),s}function Xm(e){return Yk(e)&&"ownerSVGElement"in e}const ic=new WeakMap;let Sr;const HS=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+"Size"]:Xm(r)&&"getBBox"in r?r.getBBox()[t]:r[n],fz=HS("inline","width","offsetWidth"),pz=HS("block","height","offsetHeight");function mz({target:e,borderBoxSize:t}){var n;(n=ic.get(e))==null||n.forEach(r=>{r(e,{get width(){return fz(e,t)},get height(){return pz(e,t)}})})}function gz(e){e.forEach(mz)}function yz(){typeof ResizeObserver>"u"||(Sr=new ResizeObserver(gz))}function xz(e,t){Sr||yz();const n=BS(e);return n.forEach(r=>{let i=ic.get(r);i||(i=new Set,ic.set(r,i)),i.add(t),Sr==null||Sr.observe(r)}),()=>{n.forEach(r=>{const i=ic.get(r);i==null||i.delete(t),i!=null&&i.size||Sr==null||Sr.unobserve(r)})}}const sc=new Set;let ys;function vz(){ys=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};sc.forEach(t=>t(e))},window.addEventListener("resize",ys)}function wz(e){return sc.add(e),ys||vz(),()=>{sc.delete(e),!sc.size&&typeof ys=="function"&&(window.removeEventListener("resize",ys),ys=void 0)}}function jv(e,t){return typeof e=="function"?wz(e):xz(e,t)}function bz(e){return Xm(e)&&e.tagName==="svg"}const kz=[...OS,Ge,kn],Sz=e=>kz.find(zS(e)),Pv=()=>({translate:0,scale:1,origin:0,originPoint:0}),xs=()=>({x:Pv(),y:Pv()}),Ev=()=>({min:0,max:0}),Ye=()=>({x:Ev(),y:Ev()}),_z=new WeakMap;function Du(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Ca(e){return typeof e=="string"||Array.isArray(e)}const Jm=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Zm=["initial",...Jm];function Nu(e){return Du(e.animate)||Zm.some(t=>Ca(e[t]))}function GS(e){return!!(Nu(e)||e.variants)}function Cz(e,t,n){for(const r in t){const i=t[r],s=n[r];if(nt(i))e.addValue(r,i);else if(nt(s))e.addValue(r,Bs(i,{owner:e}));else if(s!==i)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=e.getStaticValue(r);e.addValue(r,Bs(o!==void 0?o:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const eu={current:null},eg={current:!1},jz=typeof window<"u";function KS(){if(eg.current=!0,!!jz)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>eu.current=e.matches;e.addEventListener("change",t),t()}else eu.current=!1}const Tv=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let tu={};function YS(e){tu=e}function Pz(){return tu}class Ez{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,skipAnimations:s,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=Um,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=mt.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,ke.render(this.render,!1,!0))};const{latestValues:u,renderState:c}=a;this.latestValues=u,this.baseTarget={...u},this.initialValues=n.initial?{...u}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=s,this.options=l,this.blockInitialAnimation=!!o,this.isControllingVariants=Nu(n),this.isVariantNode=GS(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:h,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in f){const m=f[p];u[p]!==void 0&&nt(m)&&m.set(u[p])}}mount(t){var n,r;if(this.hasBeenMounted)for(const i in this.initialValues)(n=this.values.get(i))==null||n.jump(this.initialValues[i]),this.latestValues[i]=this.initialValues[i];this.current=t,_z.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((i,s)=>this.bindToMotionValue(s,i)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(eg.current||KS(),this.shouldReduceMotion=eu.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),Xr(this.notifyUpdate),Xr(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&TS.has(t)&&this.current instanceof HTMLElement){const{factory:o,keyframes:a,times:l,ease:u,duration:c}=n.accelerate,h=new PS({element:this.current,name:t,keyframes:a,times:l,ease:u,duration:Ut(c)}),f=o(h);this.valueSubscriptions.set(t,()=>{f(),h.cancel()});return}const r=to.has(t);r&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&ke.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;typeof window<"u"&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),s&&s()})}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 tu){const n=tu[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ye()}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<Tv.length;r++){const i=Tv[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const s="on"+i,o=t[s];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=Cz(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=Bs(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"&&(Kk(r)||Qk(r))?r=parseFloat(r):!Sz(r)&&kn.test(n)&&(r=$S(t,n)),this.setBaseTarget(t,nt(r)?r.get():r)),nt(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var s;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=Km(this.props,n,(s=this.presenceContext)==null?void 0:s.custom);o&&(r=o[t])}if(n&&r!==void 0)return r;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!nt(i)?i:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Dm),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Qm.render(this.render)}}class QS extends Ez{constructor(){super(...arguments),this.KeyframeResolver=rz}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;nt(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class ni{constructor(t){this.isMounted=!1,this.node=t}update(){}}function qS({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Tz({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Rz(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 rh(e){return e===void 0||e===1}function Xf({scale:e,scaleX:t,scaleY:n}){return!rh(e)||!rh(t)||!rh(n)}function fi(e){return Xf(e)||XS(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function XS(e){return Rv(e.x)||Rv(e.y)}function Rv(e){return e&&e!=="0%"}function nu(e,t,n){const r=e-n,i=t*r;return n+i}function Iv(e,t,n,r,i){return i!==void 0&&(e=nu(e,i,r)),nu(e,n,r)+t}function Jf(e,t=0,n=1,r,i){e.min=Iv(e.min,t,n,r,i),e.max=Iv(e.max,t,n,r,i)}function JS(e,{x:t,y:n}){Jf(e.x,t.translate,t.scale,t.originPoint),Jf(e.y,n.translate,n.scale,n.originPoint)}const Av=.999999999999,Mv=1.0000000000001;function Iz(e,t,n,r=!1){var a;const i=n.length;if(!i)return;t.x=t.y=1;let s,o;for(let l=0;l<i;l++){s=n[l],o=s.projectionDelta;const{visualElement:u}=s.options;u&&u.props.style&&u.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&(zn(e.x,-s.scroll.offset.x),zn(e.y,-s.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,JS(e,o)),r&&fi(s.latestValues)&&oc(e,s.latestValues,(a=s.layout)==null?void 0:a.layoutBox))}t.x<Mv&&t.x>Av&&(t.x=1),t.y<Mv&&t.y>Av&&(t.y=1)}function zn(e,t){e.min+=t,e.max+=t}function Lv(e,t,n,r,i=.5){const s=be(e.min,e.max,i);Jf(e,t,n,s,r)}function Dv(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function oc(e,t,n){const r=n??e;Lv(e.x,Dv(t.x,r.x),t.scaleX,t.scale,t.originX),Lv(e.y,Dv(t.y,r.y),t.scaleY,t.scale,t.originY)}function ZS(e,t){return qS(Rz(e.getBoundingClientRect(),t))}function Az(e,t,n){const r=ZS(e,n),{scroll:i}=t;return i&&(zn(r.x,i.offset.x),zn(r.y,i.offset.y)),r}const Mz={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Lz=eo.length;function Dz(e,t,n){let r="",i=!0;for(let o=0;o<Lz;o++){const a=eo[o],l=e[a];if(l===void 0)continue;let u=!0;if(typeof l=="number")u=l===(a.startsWith("scale")?1:0);else{const c=parseFloat(l);u=a.startsWith("scale")?c===1:c===0}if(!u||n){const c=qf(l,Zc[a]);if(!u){i=!1;const h=Mz[a]||a;r+=`${h}(${c}) `}n&&(t[a]=c)}}const s=e.pathRotation;return s&&(i=!1,r+=`rotate(${qf(s,Zc.pathRotation)}) `),r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function tg(e,t,n){const{style:r,vars:i,transformOrigin:s}=e;let o=!1,a=!1;for(const l in t){const u=t[l];if(to.has(l)){o=!0;continue}else if(uS(l)){i[l]=u;continue}else{const c=qf(u,Zc[l]);l.startsWith("origin")?(a=!0,s[l]=c):r[l]=c}}if(t.transform||(o||n?r.transform=Dz(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:u="50%",originZ:c=0}=s;r.transformOrigin=`${l} ${u} ${c}`}}function e_(e,{style:t,vars:n},r,i){const s=e.style;let o;for(o in t)s[o]=t[o];i==null||i.applyProjectionStyles(s,r);for(o in n)s.setProperty(o,n[o])}function Nv(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Po={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Q.test(e))e=parseFloat(e);else return e;const n=Nv(e,t.target.x),r=Nv(e,t.target.y);return`${n}% ${r}%`}},Nz={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=kn.parse(e);if(i.length>5)return r;const s=kn.createTransformer(e),o=typeof i[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;i[0+o]/=a,i[1+o]/=l;const u=be(a,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=u),typeof i[3+o]=="number"&&(i[3+o]/=u),s(i)}},Zf={borderRadius:{...Po,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Po,borderTopRightRadius:Po,borderBottomLeftRadius:Po,borderBottomRightRadius:Po,boxShadow:Nz};function t_(e,{layout:t,layoutId:n}){return to.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Zf[e]||e==="opacity")}function ng(e,t,n){var o;const r=e.style,i=t==null?void 0:t.style,s={};if(!r)return s;for(const a in r)(nt(r[a])||i&&nt(i[a])||t_(a,e)||((o=n==null?void 0:n.getValue(a))==null?void 0:o.liveStyle)!==void 0)&&(s[a]=r[a]);return s}function zz(e){return window.getComputedStyle(e)}class Oz extends QS{constructor(){super(...arguments),this.type="html",this.renderInstance=e_}readValueFromInstance(t,n){var r;if(to.has(n))return(r=this.projection)!=null&&r.isProjecting?Ff(n):s3(t,n);{const i=zz(t),s=(uS(n)?i.getPropertyValue(n):i[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return ZS(t,n)}build(t,n,r){tg(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return ng(t,n,r)}}const Fz={offset:"stroke-dashoffset",array:"stroke-dasharray"},$z={offset:"strokeDashoffset",array:"strokeDasharray"};function Bz(e,t,n=1,r=0,i=!0){e.pathLength=1;const s=i?Fz:$z;e[s.offset]=`${-r}`,e[s.array]=`${t} ${n}`}const Vz=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function n_(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:s=1,pathOffset:o=0,...a},l,u,c){if(tg(e,a,u),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:f}=e;h.transform&&(f.transform=h.transform,delete h.transform),(f.transform||h.transformOrigin)&&(f.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),f.transform&&(f.transformBox=(c==null?void 0:c.transformBox)??"fill-box",delete h.transformBox);for(const p of Vz)h[p]!==void 0&&(f[p]=h[p],delete h[p]);t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),i!==void 0&&Bz(h,i,s,o,!1)}const r_=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"]),i_=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Wz(e,t,n,r){e_(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(r_.has(i)?i:Ym(i),t.attrs[i])}function s_(e,t,n){const r=ng(e,t,n);for(const i in e)if(nt(e[i])||nt(t[i])){const s=eo.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=e[i]}return r}class Uz extends QS{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ye}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(to.has(n)){const r=FS(n);return r&&r.default||0}return n=r_.has(n)?n:Ym(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return s_(t,n,r)}build(t,n,r){n_(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,i){Wz(t,n,r,i)}mount(t){this.isSVGTag=i_(t.tagName),super.mount(t)}}const Hz=Zm.length;function o_(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?o_(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Hz;n++){const r=Zm[n],i=e.props[r];(Ca(i)||i===!1)&&(t[r]=i)}return t}function a_(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 Gz=[...Jm].reverse(),Kz=Jm.length;function Yz(e){return t=>Promise.all(t.map(({animation:n,options:r})=>G3(e,n,r)))}function Qz(e){let t=Yz(e),n=zv(),r=!0,i=!1;const s=u=>(c,h)=>{var p;const f=Ii(e,h,u==="exit"?(p=e.presenceContext)==null?void 0:p.custom:void 0);if(f){const{transition:m,transitionEnd:x,...w}=f;c={...c,...w,...x}}return c};function o(u){t=u(e)}function a(u){const{props:c}=e,h=o_(e.parent)||{},f=[],p=new Set;let m={},x=1/0;for(let g=0;g<Kz;g++){const y=Gz[g],v=n[y],k=c[y]!==void 0?c[y]:h[y],P=Ca(k),b=y===u?v.isActive:null;b===!1&&(x=g);let C=k===h[y]&&k!==c[y]&&P;if(C&&(r||i)&&e.manuallyAnimateOnMount&&(C=!1),v.protectedKeys={...m},!v.isActive&&b===null||!k&&!v.prevProp||Du(k)||typeof k=="boolean")continue;if(y==="exit"&&v.isActive&&b!==!0){v.prevResolvedValues&&(m={...m,...v.prevResolvedValues});continue}const j=qz(v.prevProp,k);let T=j||y===u&&v.isActive&&!C&&P||g>x&&P,E=!1;const A=Array.isArray(k)?k:[k];let M=A.reduce(s(y),{});b===!1&&(M={});const{prevResolvedValues:F={}}=v,D={...F,...M},L=z=>{T=!0,p.has(z)&&(E=!0,p.delete(z)),v.needsAnimating[z]=!0;const V=e.getValue(z);V&&(V.liveStyle=!1)};for(const z in D){const V=M[z],_=F[z];if(m.hasOwnProperty(z))continue;let B=!1;Hf(V)&&Hf(_)?B=!a_(V,_)||j:B=V!==_,B?V!=null?L(z):p.add(z):V!==void 0&&p.has(z)?L(z):v.protectedKeys[z]=!0}v.prevProp=k,v.prevResolvedValues=M,v.isActive&&(m={...m,...M}),(r||i)&&e.blockInitialAnimation&&(T=!1);const $=C&&j;T&&(!$||E)&&f.push(...A.map(z=>{const V={type:y};if(typeof z=="string"&&(r||i)&&!$&&e.manuallyAnimateOnMount&&e.parent){const{parent:_}=e,B=Ii(_,z);if(_.enteringChildren&&B){const{delayChildren:X}=B.transition||{};V.delay=RS(_.enteringChildren,e,X)}}return{animation:z,options:V}}))}if(p.size){const g={};if(typeof c.initial!="boolean"){const y=Ii(e,Array.isArray(c.initial)?c.initial[0]:c.initial);y&&y.transition&&(g.transition=y.transition)}p.forEach(y=>{const v=e.getBaseTarget(y),k=e.getValue(y);k&&(k.liveStyle=!0),g[y]=v??null}),f.push({animation:g})}let w=!!f.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(w=!1),r=!1,i=!1,w?t(f):Promise.resolve()}function l(u,c){var f;if(n[u].isActive===c)return Promise.resolve();(f=e.variantChildren)==null||f.forEach(p=>{var m;return(m=p.animationState)==null?void 0:m.setActive(u,c)}),n[u].isActive=c;const h=a(u);for(const p in n)n[p].protectedKeys={};return h}return{animateChanges:a,setActive:l,setAnimateFunction:o,getState:()=>n,reset:()=>{n=zv(),i=!0}}}function qz(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!a_(t,e):!1}function oi(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function zv(){return{animate:oi(!0),whileInView:oi(),whileHover:oi(),whileTap:oi(),whileDrag:oi(),whileFocus:oi(),exit:oi()}}function ep(e,t){e.min=t.min,e.max=t.max}function fn(e,t){ep(e.x,t.x),ep(e.y,t.y)}function Ov(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const l_=1e-4,Xz=1-l_,Jz=1+l_,c_=.01,Zz=0-c_,eO=0+c_;function gt(e){return e.max-e.min}function tO(e,t,n){return Math.abs(e-t)<=n}function Fv(e,t,n,r=.5){e.origin=r,e.originPoint=be(t.min,t.max,e.origin),e.scale=gt(n)/gt(t),e.translate=be(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Xz&&e.scale<=Jz||isNaN(e.scale))&&(e.scale=1),(e.translate>=Zz&&e.translate<=eO||isNaN(e.translate))&&(e.translate=0)}function Jo(e,t,n,r){Fv(e.x,t.x,n.x,r?r.originX:void 0),Fv(e.y,t.y,n.y,r?r.originY:void 0)}function $v(e,t,n,r=0){const i=r?be(n.min,n.max,r):n.min;e.min=i+t.min,e.max=e.min+gt(t)}function nO(e,t,n,r){$v(e.x,t.x,n.x,r==null?void 0:r.x),$v(e.y,t.y,n.y,r==null?void 0:r.y)}function Bv(e,t,n,r=0){const i=r?be(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+gt(t)}function ru(e,t,n,r){Bv(e.x,t.x,n.x,r==null?void 0:r.x),Bv(e.y,t.y,n.y,r==null?void 0:r.y)}function Vv(e,t,n,r,i){return e-=t,e=nu(e,1/n,r),i!==void 0&&(e=nu(e,1/i,r)),e}function rO(e,t=0,n=1,r=.5,i,s=e,o=e){if(Wn.test(t)&&(t=parseFloat(t),t=be(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=be(s.min,s.max,r);e===s&&(a-=t),e.min=Vv(e.min,t,n,a,i),e.max=Vv(e.max,t,n,a,i)}function Wv(e,t,[n,r,i],s,o){rO(e,t[n],t[r],t[i],t.scale,s,o)}const iO=["x","scaleX","originX"],sO=["y","scaleY","originY"];function Uv(e,t,n,r){Wv(e.x,t,iO,n?n.x:void 0,r?r.x:void 0),Wv(e.y,t,sO,n?n.y:void 0,r?r.y:void 0)}function Hv(e){return e.translate===0&&e.scale===1}function u_(e){return Hv(e.x)&&Hv(e.y)}function Gv(e,t){return e.min===t.min&&e.max===t.max}function oO(e,t){return Gv(e.x,t.x)&&Gv(e.y,t.y)}function Kv(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function d_(e,t){return Kv(e.x,t.x)&&Kv(e.y,t.y)}function Yv(e){return gt(e.x)/gt(e.y)}function Qv(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Ln(e){return[e("x"),e("y")]}function aO(e,t,n){let r="";const i=e.x.translate/t.x,s=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((i||s||o)&&(r=`translate3d(${i}px, ${s}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:c,pathRotation:h,rotateX:f,rotateY:p,skewX:m,skewY:x}=n;u&&(r=`perspective(${u}px) ${r}`),c&&(r+=`rotate(${c}deg) `),h&&(r+=`rotate(${h}deg) `),f&&(r+=`rotateX(${f}deg) `),p&&(r+=`rotateY(${p}deg) `),m&&(r+=`skewX(${m}deg) `),x&&(r+=`skewY(${x}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 h_=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],lO=h_.length,qv=e=>typeof e=="string"?parseFloat(e):e,Xv=e=>typeof e=="number"||Q.test(e);function cO(e,t,n,r,i,s){i?(e.opacity=be(0,n.opacity??1,uO(r)),e.opacityExit=be(t.opacity??1,0,dO(r))):s&&(e.opacity=be(t.opacity??1,n.opacity??1,r));for(let o=0;o<lO;o++){const a=h_[o];let l=Jv(t,a),u=Jv(n,a);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||Xv(l)===Xv(u)?(e[a]=Math.max(be(qv(l),qv(u),r),0),(Wn.test(u)||Wn.test(l))&&(e[a]+="%")):e[a]=u}(t.rotate||n.rotate)&&(e.rotate=be(t.rotate||0,n.rotate||0,r))}function Jv(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const uO=f_(0,.5,iS),dO=f_(.5,.95,an);function f_(e,t,n){return r=>r<e?0:r>t?1:n(Sa(e,t,r))}function hO(e,t,n){const r=nt(e)?e:Bs(e);return r.start(Gm("",r,t,n)),r.animation}function ja(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const fO=(e,t)=>e.depth-t.depth;class pO{constructor(){this.children=[],this.isDirty=!1}add(t){Mm(this.children,t),this.isDirty=!0}remove(t){Yc(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(fO),this.isDirty=!1,this.children.forEach(t)}}function mO(e,t){const n=mt.now(),r=({timestamp:i})=>{const s=i-n;s>=t&&(Xr(r),e(s-t))};return ke.setup(r,!0),()=>Xr(r)}function ac(e){return nt(e)?e.get():e}class gO{constructor(){this.members=[]}add(t){Mm(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 i=r.instance;(!i||i.isConnected===!1)&&!r.snapshot&&(Yc(this.members,r),r.unmount())}t.scheduleRender()}remove(t){if(Yc(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 i=this.members[r];if(i.isPresent!==!1&&((n=i.instance)==null?void 0:n.isConnected)!==!1)return this.promote(i),!0}return!1}promote(t,n){var i;const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.updateSnapshot(),t.scheduleRender();const{layoutDependency:s}=r.options,{layoutDependency:o}=t.options;(s===void 0||s!==o)&&(t.resumeFrom=r,n&&(r.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),(i=t.root)!=null&&i.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var n,r,i,s,o;(r=(n=t.options).onExitComplete)==null||r.call(n),(o=(i=t.resumingFrom)==null?void 0:(s=i.options).onExitComplete)==null||o.call(s)})}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 lc={hasAnimatedSinceResize:!0,hasEverUpdated:!1},ih=["","X","Y","Z"],yO=1e3;let xO=0;function sh(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function p_(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=DS(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",ke,!(i||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&p_(r)}function m_({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(o={},a=t==null?void 0:t()){this.id=xO++,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(bO),this.nodes.forEach(PO),this.nodes.forEach(EO),this.nodes.forEach(kO)},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 pO)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Dm),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=Xm(o)&&!bz(o),this.instance=o;const{layoutId:a,layout:l,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),e){let c,h=0;const f=()=>this.root.updateBlockedByResize=!1;ke.read(()=>{h=window.innerWidth}),e(o,()=>{const p=window.innerWidth;p!==h&&(h=p,this.root.updateBlockedByResize=!0,c&&c(),c=mO(f,250),lc.hasAnimatedSinceResize&&(lc.hasAnimatedSinceResize=!1,this.nodes.forEach(t0)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(a||l)&&this.addEventListener("didUpdate",({delta:c,hasLayoutChanged:h,hasRelativeLayoutChanged:f,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||u.getDefaultTransition()||MO,{onLayoutAnimationStart:x,onLayoutAnimationComplete:w}=u.getProps(),g=!this.targetLayout||!d_(this.targetLayout,p),y=!h&&f;if(this.options.layoutRoot||this.resumeFrom||y||h&&(g||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const v={...Hm(m,"layout"),onPlay:x,onComplete:w};(u.shouldReduceMotion||this.options.layoutRoot)&&(v.delay=0,v.type=!1),this.startAnimation(v),this.setAnimationOrigin(c,y,v.path)}else h||t0(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Xr(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(TO),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&&p_(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const h=this.path[c];h.shouldResetTransform=!0,(typeof h.latestValues.x=="string"||typeof h.latestValues.y=="string")&&(h.isLayoutDirty=!0),h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(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(_O),this.nodes.forEach(Zv);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(e0);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(CO),this.nodes.forEach(jO),this.nodes.forEach(vO),this.nodes.forEach(wO)):this.nodes.forEach(e0),this.clearAllSnapshots();const a=mt.now();tt.delta=Hn(0,1e3/60,a-tt.timestamp),tt.timestamp=a,tt.isProcessing=!0,qd.update.process(tt),qd.preRender.process(tt),qd.render.process(tt),tt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Qm.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(SO),this.sharedNodes.forEach(RO)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ke.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ke.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!gt(this.snapshot.measuredBox.x)&&!gt(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=Ye()),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(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!u_(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;o&&this.instance&&(a||fi(this.latestValues)||c)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),LO(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:o}=this.options;if(!o)return Ye();const a=o.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(DO))){const{scroll:c}=this.root;c&&(zn(a.x,c.offset.x),zn(a.y,c.offset.y))}return a}removeElementScroll(o){var l;const a=Ye();if(fn(a,o),(l=this.scroll)!=null&&l.wasRoot)return a;for(let u=0;u<this.path.length;u++){const c=this.path[u],{scroll:h,options:f}=c;c!==this.root&&h&&f.layoutScroll&&(h.wasRoot&&fn(a,o),zn(a.x,h.offset.x),zn(a.y,h.offset.y))}return a}applyTransform(o,a=!1,l){var c,h;const u=l||Ye();fn(u,o);for(let f=0;f<this.path.length;f++){const p=this.path[f];!a&&p.options.layoutScroll&&p.scroll&&p!==p.root&&(zn(u.x,-p.scroll.offset.x),zn(u.y,-p.scroll.offset.y)),fi(p.latestValues)&&oc(u,p.latestValues,(c=p.layout)==null?void 0:c.layoutBox)}return fi(this.latestValues)&&oc(u,this.latestValues,(h=this.layout)==null?void 0:h.layoutBox),u}removeTransform(o){var l;const a=Ye();fn(a,o);for(let u=0;u<this.path.length;u++){const c=this.path[u];if(!fi(c.latestValues))continue;let h;c.instance&&(Xf(c.latestValues)&&c.updateSnapshot(),h=Ye(),fn(h,c.measurePageBox())),Uv(a,c.latestValues,(l=c.snapshot)==null?void 0:l.layoutBox,h)}return fi(this.latestValues)&&Uv(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!==tt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var p;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(o||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(p=this.parent)!=null&&p.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:c,layoutId:h}=this.options;if(!this.layout||!(c||h))return;this.resolvedRelativeTargetAt=tt.timestamp;const f=this.getClosestProjectingParent();f&&this.linkedParentVersion!==f.layoutVersion&&!f.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&f&&f.layout?this.createRelativeTarget(f,this.layout.layoutBox,f.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Ye(),this.targetWithTransforms=Ye()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),nO(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):fn(this.target,this.layout.layoutBox),JS(this.target,this.targetDelta)):fn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?this.createRelativeTarget(f,this.target,f.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Xf(this.parent.latestValues)||XS(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=Ye(),this.relativeTargetOrigin=Ye(),ru(this.relativeTargetOrigin,a,l,this.options.layoutAnchor||void 0),fn(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===tt.timestamp&&(l=!1),l)return;const{layout:u,layoutId:c}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||c))return;fn(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,f=this.treeScale.y;Iz(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=Ye());const{target:p}=o;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Ov(this.prevProjectionDelta.x,this.projectionDelta.x),Ov(this.prevProjectionDelta.y,this.projectionDelta.y)),Jo(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==f||!Qv(this.projectionDelta.x,this.prevProjectionDelta.x)||!Qv(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=xs(),this.projectionDelta=xs(),this.projectionDeltaWithTransform=xs()}setAnimationOrigin(o,a=!1,l){const u=this.snapshot,c=u?u.latestValues:{},h={...this.latestValues},f=xs();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const p=Ye(),m=u?u.source:void 0,x=this.layout?this.layout.source:void 0,w=m!==x,g=this.getStack(),y=!g||g.members.length<=1,v=!!(w&&!y&&this.options.crossfade===!0&&!this.path.some(AO));this.animationProgress=0;let k;const P=l==null?void 0:l.interpolateProjection(o);this.mixTargetDelta=b=>{const C=b/1e3,j=P==null?void 0:P(C);j?(f.x.translate=j.x,f.x.scale=be(o.x.scale,1,C),f.x.origin=o.x.origin,f.x.originPoint=o.x.originPoint,f.y.translate=j.y,f.y.scale=be(o.y.scale,1,C),f.y.origin=o.y.origin,f.y.originPoint=o.y.originPoint):(n0(f.x,o.x,C),n0(f.y,o.y,C)),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ru(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),IO(this.relativeTarget,this.relativeTargetOrigin,p,C),k&&oO(this.relativeTarget,k)&&(this.isProjectionDirty=!1),k||(k=Ye()),fn(k,this.relativeTarget)),w&&(this.animationValues=h,cO(h,c,this.latestValues,C,v,y)),j&&j.rotate!==void 0&&(this.animationValues||(this.animationValues=h),this.animationValues.pathRotation=j.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=C},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var a,l,u;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(u=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||u.stop(),this.pendingAnimation&&(Xr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ke.update(()=>{lc.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Bs(0)),this.motionValue.jump(0,!1),this.currentAnimation=hO(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:c=>{this.mixTargetDelta(c),o.onUpdate&&o.onUpdate(c)},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(yO),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:c}=o;if(!(!a||!l||!u)){if(this!==o&&this.layout&&u&&g_(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||Ye();const h=gt(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+h;const f=gt(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+f}fn(a,l),oc(a,c),Jo(this.projectionDeltaWithTransform,this.layoutCorrected,a,c)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new gO),this.sharedNodes.get(o).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.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 u=this.getStack();u&&u.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 u={};l.z&&sh("z",o,u,this.animationValues);for(let c=0;c<ih.length;c++)sh(`rotate${ih[c]}`,o,u,this.animationValues),sh(`skew${ih[c]}`,o,u,this.animationValues);o.render();for(const c in u)o.setStaticValue(c,u[c]),this.animationValues&&(this.animationValues[c]=u[c]);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=ac(a==null?void 0:a.pointerEvents)||"",o.transform=l?l(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=ac(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!fi(this.latestValues)&&(o.transform=l?l({},""):"none",this.hasProjected=!1);return}o.visibility="";const c=u.animationValues||u.latestValues;this.applyTransformsToTarget();let h=aO(this.projectionDeltaWithTransform,this.treeScale,c);l&&(h=l(c,h)),o.transform=h;const{x:f,y:p}=this.projectionDelta;o.transformOrigin=`${f.origin*100}% ${p.origin*100}% 0`,u.animationValues?o.opacity=u===this?c.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:c.opacityExit:o.opacity=u===this?c.opacity!==void 0?c.opacity:"":c.opacityExit!==void 0?c.opacityExit:0;for(const m in Zf){if(c[m]===void 0)continue;const{correct:x,applyTo:w,isCSSVariable:g}=Zf[m],y=h==="none"?c[m]:x(c[m],u);if(w){const v=w.length;for(let k=0;k<v;k++)o[w[k]]=y}else g?this.options.visualElement.renderState.vars[m]=y:o[m]=y}this.options.layoutId&&(o.pointerEvents=u===this?ac(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(Zv),this.root.sharedNodes.clear()}}}function vO(e){e.updateLayout()}function wO(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:i}=e.layout,{animationType:s}=e.options,o=t.source!==e.layout.source;if(s==="size")Ln(h=>{const f=o?t.measuredBox[h]:t.layoutBox[h],p=gt(f);f.min=r[h].min,f.max=f.min+p});else if(s==="x"||s==="y"){const h=s==="x"?"y":"x";ep(o?t.measuredBox[h]:t.layoutBox[h],r[h])}else g_(s,t.layoutBox,r)&&Ln(h=>{const f=o?t.measuredBox[h]:t.layoutBox[h],p=gt(r[h]);f.max=f.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[h].max=e.relativeTarget[h].min+p)});const a=xs();Jo(a,r,t.layoutBox);const l=xs();o?Jo(l,e.applyTransform(i,!0),t.measuredBox):Jo(l,r,t.layoutBox);const u=!u_(a);let c=!1;if(!e.resumeFrom){const h=e.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:f,layout:p}=h;if(f&&p){const m=e.options.layoutAnchor||void 0,x=Ye();ru(x,t.layoutBox,f.layoutBox,m);const w=Ye();ru(w,r,p.layoutBox,m),d_(x,w)||(c=!0),h.options.layoutRoot&&(e.relativeTarget=w,e.relativeTargetOrigin=x,e.relativeParent=h)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:l,layoutDelta:a,hasLayoutChanged:u,hasRelativeLayoutChanged:c})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function bO(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 kO(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function SO(e){e.clearSnapshot()}function Zv(e){e.clearMeasurements()}function _O(e){e.isLayoutDirty=!0,e.updateLayout()}function e0(e){e.isLayoutDirty=!1}function CO(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function jO(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function t0(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function PO(e){e.resolveTargetDelta()}function EO(e){e.calcProjection()}function TO(e){e.resetSkewAndRotation()}function RO(e){e.removeLeadSnapshot()}function n0(e,t,n){e.translate=be(t.translate,0,n),e.scale=be(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function r0(e,t,n,r){e.min=be(t.min,n.min,r),e.max=be(t.max,n.max,r)}function IO(e,t,n,r){r0(e.x,t.x,n.x,r),r0(e.y,t.y,n.y,r)}function AO(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const MO={duration:.45,ease:[.4,0,.1,1]},i0=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),s0=i0("applewebkit/")&&!i0("chrome/")?Math.round:an;function o0(e){e.min=s0(e.min),e.max=s0(e.max)}function LO(e){o0(e.x),o0(e.y)}function g_(e,t,n){return e==="position"||e==="preserve-aspect"&&!tO(Yv(t),Yv(n),.2)}function DO(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const NO=m_({attachResizeListener:(e,t)=>ja(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}),oh={current:void 0},y_=m_({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!oh.current){const e=new NO({});e.mount(window),e.setOptions({layoutScroll:!0}),oh.current=e}return oh.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),rg=S.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function a0(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function zO(...e){return t=>{let n=!1;const r=e.map(i=>{const s=a0(i,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let i=0;i<r.length;i++){const s=r[i];typeof s=="function"?s():a0(e[i],null)}}}}function OO(...e){return S.useCallback(zO(...e),e)}class FO extends S.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(nc(n)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,i=nc(r)&&r.offsetWidth||0,s=nc(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=i-a.width-a.left,a.bottom=s-a.height-a.top,a.direction=o.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function $O({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:s}){var f;const o=S.useId(),a=S.useRef(null),l=S.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:u}=S.useContext(rg),c=((f=e.props)==null?void 0:f.ref)??(e==null?void 0:e.ref),h=OO(a,c);return S.useInsertionEffect(()=>{const{width:p,height:m,top:x,left:w,right:g,bottom:y,direction:v}=l.current;if(t||s===!1||!a.current||!p||!m)return;const k=v==="rtl",P=n==="left"?k?`right: ${g}`:`left: ${w}`:k?`left: ${w}`:`right: ${g}`,b=r==="bottom"?`bottom: ${y}`:`top: ${x}`;a.current.dataset.motionPopId=o;const C=document.createElement("style");u&&(C.nonce=u);const j=i??document.head;return j.appendChild(C),C.sheet&&C.sheet.insertRule(`
|
|
71
|
-
[data-motion-pop-id="${o}"] {
|
|
72
|
-
position: absolute !important;
|
|
73
|
-
width: ${p}px !important;
|
|
74
|
-
height: ${m}px !important;
|
|
75
|
-
${P}px !important;
|
|
76
|
-
${b}px !important;
|
|
77
|
-
}
|
|
78
|
-
`),()=>{var T;(T=a.current)==null||T.removeAttribute("data-motion-pop-id"),j.contains(C)&&j.removeChild(C)}},[t]),d.jsx(FO,{isPresent:t,childRef:a,sizeRef:l,pop:s,children:s===!1?e:S.cloneElement(e,{ref:h})})}const BO=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:s,mode:o,anchorX:a,anchorY:l,root:u})=>{const c=Am(VO),h=S.useId();let f=!0,p=S.useMemo(()=>(f=!1,{id:h,initial:t,isPresent:n,custom:i,onExitComplete:m=>{c.set(m,!0);for(const x of c.values())if(!x)return;r&&r()},register:m=>(c.set(m,!1),()=>c.delete(m))}),[n,c,r]);return s&&f&&(p={...p}),S.useMemo(()=>{c.forEach((m,x)=>c.set(x,!1))},[n]),S.useEffect(()=>{!n&&!c.size&&r&&r()},[n]),e=d.jsx($O,{pop:o==="popLayout",isPresent:n,anchorX:a,anchorY:l,root:u,children:e}),d.jsx(Mu.Provider,{value:p,children:e})};function VO(){return new Map}function x_(e=!0){const t=S.useContext(Mu);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,s=S.useId();S.useEffect(()=>{if(e)return i(s)},[e]);const o=S.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,o]:[!0]}const kl=e=>e.key||"";function l0(e){const t=[];return S.Children.forEach(e,n=>{S.isValidElement(n)&&t.push(n)}),t}const v_=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:s="sync",propagate:o=!1,anchorX:a="left",anchorY:l="top",root:u})=>{const[c,h]=x_(o),f=S.useMemo(()=>l0(e),[e]),p=o&&!c?[]:f.map(kl),m=S.useRef(!0),x=S.useRef(f),w=Am(()=>new Map),g=S.useRef(new Set),[y,v]=S.useState(f),[k,P]=S.useState(f);Gk(()=>{m.current=!1,x.current=f;for(let j=0;j<k.length;j++){const T=kl(k[j]);p.includes(T)?(w.delete(T),g.current.delete(T)):w.get(T)!==!0&&w.set(T,!1)}},[k,p.length,p.join("-")]);const b=[];if(f!==y){let j=[...f];for(let T=0;T<k.length;T++){const E=k[T],A=kl(E);p.includes(A)||(j.splice(T,0,E),b.push(E))}return s==="wait"&&b.length&&(j=b),P(l0(j)),v(f),null}const{forceRender:C}=S.useContext(Im);return d.jsx(d.Fragment,{children:k.map(j=>{const T=kl(j),E=o&&!c?!1:f===k||p.includes(T),A=()=>{if(g.current.has(T))return;if(w.has(T))g.current.add(T),w.set(T,!0);else return;let M=!0;w.forEach(F=>{F||(M=!1)}),M&&(C==null||C(),P(x.current),o&&(h==null||h()),r&&r())};return d.jsx(BO,{isPresent:E,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:s,root:u,onExitComplete:E?void 0:A,anchorX:a,anchorY:l,children:j},T)})})},w_=S.createContext({strict:!1}),c0={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 u0=!1;function WO(){if(u0)return;const e={};for(const t in c0)e[t]={isEnabled:n=>c0[t].some(r=>!!n[r])};YS(e),u0=!0}function b_(){return WO(),Pz()}function UO(e){const t=b_();for(const n in e)t[n]={...t[n],...e[n]};YS(t)}const HO=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 iu(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||HO.has(e)}let k_=e=>!iu(e);function GO(e){typeof e=="function"&&(k_=t=>t.startsWith("on")?!iu(t):e(t))}try{GO(require("@emotion/is-prop-valid").default)}catch{}function KO(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||nt(e[i])||(k_(i)||n===!0&&iu(i)||!t&&!iu(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}const zu=S.createContext({});function YO(e,t){if(Nu(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Ca(n)?n:void 0,animate:Ca(r)?r:void 0}}return e.inherit!==!1?t:{}}function QO(e){const{initial:t,animate:n}=YO(e,S.useContext(zu));return S.useMemo(()=>({initial:t,animate:n}),[d0(t),d0(n)])}function d0(e){return Array.isArray(e)?e.join(" "):e}const ig=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function S_(e,t,n){for(const r in t)!nt(t[r])&&!t_(r,n)&&(e[r]=t[r])}function qO({transformTemplate:e},t){return S.useMemo(()=>{const n=ig();return tg(n,t,e),Object.assign({},n.vars,n.style)},[t])}function XO(e,t){const n=e.style||{},r={};return S_(r,n,e),Object.assign(r,qO(e,t)),r}function JO(e,t){const n={},r=XO(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 __=()=>({...ig(),attrs:{}});function ZO(e,t,n,r){const i=S.useMemo(()=>{const s=__();return n_(s,t,i_(r),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};S_(s,e.style,e),i.style={...s,...i.style}}return i}const eF=["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 sg(e){return typeof e!="string"||e.includes("-")?!1:!!(eF.indexOf(e)>-1||/[A-Z]/u.test(e))}function tF(e,t,n,{latestValues:r},i,s=!1,o){const l=(o??sg(e)?ZO:JO)(t,r,i,e),u=KO(t,typeof e=="string",s),c=e!==S.Fragment?{...u,...l,ref:n}:{},{children:h}=t,f=S.useMemo(()=>nt(h)?h.get():h,[h]);return S.createElement(e,{...c,children:f})}function nF({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:rF(n,r,i,e),renderState:t()}}function rF(e,t,n,r){const i={},s=r(e,{});for(const f in s)i[f]=ac(s[f]);let{initial:o,animate:a}=e;const l=Nu(e),u=GS(e);t&&u&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let c=n?n.initial===!1:!1;c=c||o===!1;const h=c?a:o;if(h&&typeof h!="boolean"&&!Du(h)){const f=Array.isArray(h)?h:[h];for(let p=0;p<f.length;p++){const m=Km(e,f[p]);if(m){const{transitionEnd:x,transition:w,...g}=m;for(const y in g){let v=g[y];if(Array.isArray(v)){const k=c?v.length-1:0;v=v[k]}v!==null&&(i[y]=v)}for(const y in x)i[y]=x[y]}}}return i}const C_=e=>(t,n)=>{const r=S.useContext(zu),i=S.useContext(Mu),s=()=>nF(e,t,r,i);return n?s():Am(s)},iF=C_({scrapeMotionValuesFromProps:ng,createRenderState:ig}),sF=C_({scrapeMotionValuesFromProps:s_,createRenderState:__}),oF=Symbol.for("motionComponentSymbol");function aF(e,t,n){const r=S.useRef(n);S.useInsertionEffect(()=>{r.current=n});const i=S.useRef(null);return S.useCallback(s=>{var a;s&&((a=e.onMount)==null||a.call(e,s)),t&&(s?t.mount(s):t.unmount());const o=r.current;if(typeof o=="function")if(s){const l=o(s);typeof l=="function"&&(i.current=l)}else i.current?(i.current(),i.current=null):o(s);else o&&(o.current=s)},[t])}const j_=S.createContext({});function rs(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function lF(e,t,n,r,i,s){var v,k;const{visualElement:o}=S.useContext(zu),a=S.useContext(w_),l=S.useContext(Mu),u=S.useContext(rg),c=u.reducedMotion,h=u.skipAnimations,f=S.useRef(null),p=S.useRef(!1);r=r||a.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:c,skipAnimations:h,isSVG:s}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));const m=f.current,x=S.useContext(j_);m&&!m.projection&&i&&(m.type==="html"||m.type==="svg")&&cF(f.current,n,i,x);const w=S.useRef(!1);S.useInsertionEffect(()=>{m&&w.current&&m.update(n,l)});const g=n[LS],y=S.useRef(!!g&&typeof window<"u"&&!((v=window.MotionHandoffIsComplete)!=null&&v.call(window,g))&&((k=window.MotionHasOptimisedAnimation)==null?void 0:k.call(window,g)));return Gk(()=>{p.current=!0,m&&(w.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),y.current&&m.animationState&&m.animationState.animateChanges())}),S.useEffect(()=>{m&&(!y.current&&m.animationState&&m.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{var P;(P=window.MotionHandoffMarkAsComplete)==null||P.call(window,g)}),y.current=!1),m.enteringChildren=void 0)}),m}function cF(e,t,n,r){const{layoutId:i,layout:s,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:u,layoutAnchor:c,layoutCrossfade:h}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:P_(e.parent)),e.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!o||a&&rs(a),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:h,layoutScroll:l,layoutRoot:u,layoutAnchor:c})}function P_(e){if(e)return e.options.allowProjection!==!1?e.projection:P_(e.parent)}function ah(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&UO(r);const s=n?n==="svg":sg(e),o=s?sF:iF;function a(u,c){let h;const f={...S.useContext(rg),...u,layoutId:uF(u)},{isStatic:p}=f,m=QO(u),x=o(u,p);if(!p&&typeof window<"u"){dF();const w=hF(f);h=w.MeasureLayout,m.visualElement=lF(e,x,f,i,w.ProjectionNode,s)}return d.jsxs(zu.Provider,{value:m,children:[h&&m.visualElement?d.jsx(h,{visualElement:m.visualElement,...f}):null,tF(e,u,aF(x,m.visualElement,c),x,p,t,s)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const l=S.forwardRef(a);return l[oF]=e,l}function uF({layoutId:e}){const t=S.useContext(Im).id;return t&&e!==void 0?t+"-"+e:e}function dF(e,t){S.useContext(w_).strict}function hF(e){const t=b_(),{drag:n,layout:r}=t;if(!n&&!r)return{};const i={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(e)||r!=null&&r.isEnabled(e)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function fF(e,t){if(typeof Proxy>"u")return ah;const n=new Map,r=(s,o)=>ah(s,o,e,t),i=(s,o)=>r(s,o);return new Proxy(i,{get:(s,o)=>o==="create"?r:(n.has(o)||n.set(o,ah(o,void 0,e,t)),n.get(o))})}const pF=(e,t)=>t.isSVG??sg(e)?new Uz(t):new Oz(t,{allowProjection:e!==S.Fragment});class mF extends ni{constructor(t){super(t),t.animationState||(t.animationState=Qz(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Du(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 gF=0;class yF extends ni{constructor(){super(...arguments),this.id=gF++,this.isExitComplete=!1}update(){var s;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=Ii(this.node,o,a);if(l){const{transition:u,transitionEnd:c,...h}=l;for(const f in h)(s=this.node.getValue(f))==null||s.jump(h[f])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.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 xF={animation:{Feature:mF},exit:{Feature:yF}};function Oa(e){return{point:{x:e.pageX,y:e.pageY}}}const vF=e=>t=>qm(t)&&e(t,Oa(t));function Zo(e,t,n,r){return ja(e,t,vF(n),r)}const E_=({current:e})=>e?e.ownerDocument.defaultView:null,h0=(e,t)=>Math.abs(e-t);function wF(e,t){const n=h0(e.x,t.x),r=h0(e.y,t.y);return Math.sqrt(n**2+r**2)}const f0=new Set(["auto","scroll"]);class T_{constructor(t,n,{transformPagePoint:r,contextWindow:i=window,dragSnapToOrigin:s=!1,distanceThreshold:o=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=p=>{this.handleScroll(p.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Sl(this.lastRawMoveEventInfo,this.transformPagePoint));const p=lh(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,x=wF(p.offset,{x:0,y:0})>=this.distanceThreshold;if(!m&&!x)return;const{point:w}=p,{timestamp:g}=tt;this.history.push({...w,timestamp:g});const{onStart:y,onMove:v}=this.handlers;m||(y&&y(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,p)},this.handlePointerMove=(p,m)=>{this.lastMoveEvent=p,this.lastRawMoveEventInfo=m,this.lastMoveEventInfo=Sl(m,this.transformPagePoint),ke.update(this.updatePoint,!0)},this.handlePointerUp=(p,m)=>{this.end();const{onEnd:x,onSessionEnd:w,resumeAnimation:g}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&g&&g(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=lh(p.type==="pointercancel"?this.lastMoveEventInfo:Sl(m,this.transformPagePoint),this.history);this.startEvent&&x&&x(p,y),w&&w(p,y)},!qm(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=i||window;const l=Oa(t),u=Sl(l,this.transformPagePoint),{point:c}=u,{timestamp:h}=tt;this.history=[{...c,timestamp:h}];const{onSessionStart:f}=n;f&&f(t,lh(u,this.history)),this.removeListeners=Da(Zo(this.contextWindow,"pointermove",this.handlePointerMove),Zo(this.contextWindow,"pointerup",this.handlePointerUp),Zo(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(f0.has(r.overflowX)||f0.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,i=r?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},s={x:i.x-n.x,y:i.y-n.y};s.x===0&&s.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s.x,this.lastMoveEventInfo.point.y+=s.y):this.history.length>0&&(this.history[0].x-=s.x,this.history[0].y-=s.y),this.scrollPositions.set(t,i),ke.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Xr(this.updatePoint)}}function Sl(e,t){return t?{point:t(e.point)}:e}function p0(e,t){return{x:e.x-t.x,y:e.y-t.y}}function lh({point:e},t){return{point:e,delta:p0(e,R_(t)),offset:p0(e,bF(t)),velocity:kF(t,.1)}}function bF(e){return e[0]}function R_(e){return e[e.length-1]}function kF(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=R_(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Ut(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>Ut(t)*2&&(r=e[1]);const s=sn(i.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const o={x:(i.x-r.x)/s,y:(i.y-r.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function SF(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?be(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?be(n,e,r.max):Math.min(e,n)),e}function m0(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 _F(e,{top:t,left:n,bottom:r,right:i}){return{x:m0(e.x,n,i),y:m0(e.y,t,r)}}function g0(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 CF(e,t){return{x:g0(e.x,t.x),y:g0(e.y,t.y)}}function jF(e,t){let n=.5;const r=gt(e),i=gt(t);return i>r?n=Sa(t.min,t.max-r,e.min):r>i&&(n=Sa(e.min,e.max-i,t.min)),Hn(0,1,n)}function PF(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 EF(e=tp){return e===!1?e=0:e===!0&&(e=tp),{x:y0(e,"left","right"),y:y0(e,"top","bottom")}}function y0(e,t,n){return{min:x0(e,t),max:x0(e,n)}}function x0(e,t){return typeof e=="number"?e:e[t]||0}const TF=new WeakMap;class RF{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=Ye(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const s=h=>{n&&this.snapToCursor(Oa(h).point),this.stopAnimation()},o=(h,f)=>{const{drag:p,dragPropagation:m,onDragStart:x}=this.getProps();if(p&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=iz(p),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ln(g=>{let y=this.getAxisMotionValue(g).get()||0;if(Wn.test(y)){const{projection:v}=this.visualElement;if(v&&v.layout){const k=v.layout.layoutBox[g];k&&(y=gt(k)*(parseFloat(y)/100))}}this.originPoint[g]=y}),x&&ke.update(()=>x(h,f),!1,!0),Gf(this.visualElement,"transform");const{animationState:w}=this.visualElement;w&&w.setActive("whileDrag",!0)},a=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f;const{dragPropagation:p,dragDirectionLock:m,onDirectionLock:x,onDrag:w}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:g}=f;if(m&&this.currentDirection===null){this.currentDirection=AF(g),this.currentDirection!==null&&x&&x(this.currentDirection);return}this.updateAxis("x",f.point,g),this.updateAxis("y",f.point,g),this.visualElement.render(),w&&ke.update(()=>w(h,f),!1,!0)},l=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f,this.stop(h,f),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>{const{dragSnapToOrigin:h}=this.getProps();(h||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:c}=this.getProps();this.panSession=new T_(t,{onSessionStart:s,onStart:o,onMove:a,onSessionEnd:l,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,distanceThreshold:r,contextWindow:E_(this.visualElement),element:this.visualElement.current})}stop(t,n){const r=t||this.latestPointerEvent,i=n||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!i||!r)return;const{velocity:o}=i;this.startAnimation(o);const{onDragEnd:a}=this.getProps();a&&ke.postRender(()=>a(r,i))}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:i}=this.getProps();if(!r||!_l(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=SF(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){var s;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)==null?void 0:s.layout,i=this.constraints;t&&rs(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=_F(r.layoutBox,t):this.constraints=!1,this.elastic=EF(n),i!==this.constraints&&!rs(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&Ln(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=PF(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!rs(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;i.root&&(i.root.scroll=void 0,i.root.updateScroll());const s=Az(r,i.root,this.visualElement.getTransformPagePoint());let o=CF(i.layout.layoutBox,s);if(n){const a=n(Tz(o));this.hasMutatedConstraints=!!a,a&&(o=qS(a))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=Ln(c=>{if(!_l(c,n,this.currentDirection))return;let h=l&&l[c]||{};(o===!0||o===c)&&(h={min:0,max:0});const f=i?200:1e6,p=i?40:1e7,m={type:"inertia",velocity:r?t[c]:0,bounceStiffness:f,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...s,...h};return this.startAxisValueAnimation(c,m)});return Promise.all(u).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Gf(this.visualElement,t),r.start(Gm(t,r,0,n,this.visualElement,!1))}stopAnimation(){Ln(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,i=this.visualElement.getProps()[n];return i||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor(t){Ln(n=>{const{drag:r}=this.getProps();if(!_l(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[n],l=s.get()||0;s.set(t[n]-be(o,a,.5)+l)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!rs(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Ln(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();i[o]=jF({min:l,max:l},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),Ln(o=>{if(!_l(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:u}=this.constraints[o];a.set(be(l,u,i[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;TF.set(this.visualElement,this);const t=this.visualElement.current,n=Zo(t,"pointerdown",u=>{const{drag:c,dragListener:h=!0}=this.getProps(),f=u.target,p=f!==t&&uz(f);c&&h&&!p&&this.start(u)});let r;const i=()=>{const{dragConstraints:u}=this.getProps();rs(u)&&u.current&&(this.constraints=this.resolveRefConstraints(),r||(r=IF(t,u.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,o=s.addEventListener("measure",i);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),ke.read(i);const a=ja(window,"resize",()=>this.scalePositionWithinConstraints()),l=s.addEventListener("didUpdate",({delta:u,hasLayoutChanged:c})=>{this.isDragging&&c&&(Ln(h=>{const f=this.getAxisMotionValue(h);f&&(this.originPoint[h]+=u[h].translate,f.set(f.get()+u[h].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:i=!1,dragConstraints:s=!1,dragElastic:o=tp,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function v0(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function IF(e,t,n){const r=jv(e,v0(n)),i=jv(t,v0(n));return()=>{r(),i()}}function _l(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function AF(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class MF extends ni{constructor(t){super(t),this.removeGroupControls=an,this.removeListeners=an,this.controls=new RF(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||an}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 ch=e=>(t,n)=>{e&&ke.update(()=>e(t,n),!1,!0)};class LF extends ni{constructor(){super(...arguments),this.removePointerDownListener=an}onPointerDown(t){this.session=new T_(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:E_(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:ch(t),onStart:ch(n),onMove:ch(r),onEnd:(s,o)=>{delete this.session,i&&ke.postRender(()=>i(s,o))}}}mount(){this.removePointerDownListener=Zo(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 uh=!1;class DF extends S.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=t;s&&(n.group&&n.group.add(s),r&&r.register&&i&&r.register(s),uh&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),lc.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:s}=this.props,{projection:o}=r;return o&&(o.isPresent=s,t.layoutDependency!==n&&o.setOptions({...o.options,layoutDependency:n}),uh=!0,i||t.layoutDependency!==n||n===void 0||t.isPresent!==s?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||ke.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(),Qm.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;uh=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function I_(e){const[t,n]=x_(),r=S.useContext(Im);return d.jsx(DF,{...e,layoutGroup:r,switchLayoutGroup:S.useContext(j_),isPresent:t,safeToRemove:n})}const NF={pan:{Feature:LF},drag:{Feature:MF,ProjectionNode:y_,MeasureLayout:I_}};function w0(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,s=r[i];s&&ke.postRender(()=>s(t,Oa(t)))}class zF extends ni{mount(){const{current:t}=this.node;t&&(this.unmount=oz(t,(n,r)=>(w0(this.node,r,"Start"),i=>w0(this.node,i,"End"))))}unmount(){}}class OF extends ni{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=Da(ja(this.node.current,"focus",()=>this.onFocus()),ja(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function b0(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 i="onTap"+(n==="End"?"":n),s=r[i];s&&ke.postRender(()=>s(t,Oa(t)))}class FF extends ni{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=hz(t,(i,s)=>(b0(this.node,s,"Start"),(o,{success:a})=>b0(this.node,o,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const np=new WeakMap,dh=new WeakMap,$F=e=>{const t=np.get(e.target);t&&t(e)},BF=e=>{e.forEach($F)};function VF({root:e,...t}){const n=e||document;dh.has(n)||dh.set(n,{});const r=dh.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(BF,{root:e,...t})),r[i]}function WF(e,t,n){const r=VF(t);return np.set(e,n),r.observe(e),()=>{np.delete(e),r.unobserve(e)}}const UF={some:0,all:1};class HF extends ni{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:i="some",once:s}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:UF[i]},a=u=>{const{isIntersecting:c}=u;if(this.isInView===c||(this.isInView=c,s&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:h,onViewportLeave:f}=this.node.getProps(),p=c?h:f;p&&p(u)};this.stopObserver=WF(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(GF(t,n))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function GF({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const KF={inView:{Feature:HF},tap:{Feature:FF},focus:{Feature:OF},hover:{Feature:zF}},YF={layout:{ProjectionNode:y_,MeasureLayout:I_}},QF={...xF,...KF,...NF,...YF},Vs=fF(QF,pF);function Ou(){!eg.current&&KS();const[e]=S.useState(eu.current);return e}function Fu(e,t){const n=S.useRef(t);n.current=t,S.useEffect(()=>{if(!e)return;const r=i=>{i.key==="Escape"&&n.current()};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e])}const cc={stackPanelWidth:480,navIslandBottom:"1.5rem",navIslandHeight:"4.5rem",contentGap:"1.5rem"},pe={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",chalkboardBg:"#142e22",chalkboardChalk:"#d4e8cb",chalkboardBorderBase:"#C8D2C3"};function ct(e,t){const n=e.replace("#",""),r=Number.parseInt(n.slice(0,2),16),i=Number.parseInt(n.slice(2,4),16),s=Number.parseInt(n.slice(4,6),16);return`rgba(${r}, ${i}, ${s}, ${t})`}const qF={4:"1rem"};function Z(...e){return ND(iD(e))}const XF={height:32,lineHeight:"32px",padding:"0 16px"},JF={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")`},ZF={white:pe.bgBase,paper:pe.bgSurface,speckle:pe.bgSurface,parchment:pe.bgElevated,canvas:pe.canvasBase,kraft:pe.canvas300,chalkboard:pe.chalkboardBg},e$={blue:"rgba(168, 200, 216, 0.35)",brown:"rgba(164, 144, 120, 0.35)",black:"rgba(61, 53, 43, 0.15)"};function $u(e){const t=typeof e=="string"?{texture:e}:e,n=t.texture??"paper",r=t.ruledType??"none",i=t.ruledColor??"blue",s=JF[n],o=ZF[n],a=e$[i];return r==="none"?{backgroundColor:o,backgroundImage:s,backgroundRepeat:"repeat",backgroundSize:"200px 200px"}:r==="lines"?{backgroundColor:o,backgroundImage:`${s}, repeating-linear-gradient(180deg, transparent, transparent 31px, ${a} 31px, ${a} 32px)`,backgroundRepeat:"repeat, repeat",backgroundSize:"200px 200px, 100% 32px"}:{backgroundColor:o,backgroundImage:`${s}, 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 Wi(e,t="paper"){if(e!==!1)return $u(e===!0?t:e)}function t$(e){const t=Vu((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),i=50,s=50,o=46,a=2+n*14,l=[];for(let u=0;u<r;u++){const c=u/r*Math.PI*2+(t()-.5)*.15*n,h=o+(t()-.5)*a*2;l.push({x:i+Math.cos(c)*h,y:s+Math.sin(c)*h})}return Bu(l)}function n$(e,t){const n=Vu(`${e}-ring`),r=Math.max(0,Math.min(1,t??.5)),i=8+Math.round(r*6),s=50,o=50,a=49,l=2+r*14,u=[];for(let c=0;c<i;c++){const h=c/i*Math.PI*2+(n()-.5)*.15*r,f=a+(n()-.5)*l*2;u.push({x:s+Math.cos(h)*f,y:o+Math.sin(h)*f})}return Bu(u)}function r$(e){const t=Vu((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),i=2,s=3+n*10,o=[],a=[{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 l of a)for(let u=0;u<r;u++){const c=(u+.5)/r,h=l.ax+(l.bx-l.ax)*c,f=l.ay+(l.by-l.ay)*c,p=l.bx-l.ax,m=l.by-l.ay,x=Math.sqrt(p*p+m*m)||1,w=-m/x,g=p/x,y=(t()-.5)*s*2;o.push({x:h+w*y,y:f+g*y})}return Bu(o)}function i$(e,t){const n=Vu(`${e}-ring`),r=Math.max(0,Math.min(1,t??.5)),i=3+Math.round(r*3),s=0,o=3+r*10,a=[],l=[{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 u of l)for(let c=0;c<i;c++){const h=(c+.5)/i,f=u.ax+(u.bx-u.ax)*h,p=u.ay+(u.by-u.ay)*h,m=u.bx-u.ax,x=u.by-u.ay,w=Math.sqrt(m*m+x*x)||1,g=-x/w,y=m/w,v=(n()-.5)*o*2;a.push({x:f+g*v,y:p+y*v})}return Bu(a)}function Bu(e){const t=e.length;if(t<3)return"";let n=`M ${xr(e[0].x)} ${xr(e[0].y)}`;for(let r=0;r<t;r++){const i=e[(r-1+t)%t],s=e[r],o=e[(r+1)%t],a=e[(r+2)%t],l=s.x+(o.x-i.x)/6,u=s.y+(o.y-i.y)/6,c=o.x-(a.x-s.x)/6,h=o.y-(a.y-s.y)/6;n+=` C ${xr(l)} ${xr(u)}, ${xr(c)} ${xr(h)}, ${xr(o.x)} ${xr(o.y)}`}return n+=" Z",n}function xr(e){return e.toFixed(2)}function Vu(e){let t=typeof e=="string"?s$(e):e;return()=>(t=t*16807%2147483647,(t-1)/2147483646)}function s$(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 Wu(){const e=S.useId();return S.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 no(e){const t=Wu();return S.useMemo(()=>({blob:t$({seed:t,wobble:e}),ring:n$(t,e)}),[t,e])}const o$="button-module__button___Z331g",a$="button-module__blobBg___QQFzf",l$="button-module__blobFill___XwLjV",c$="button-module__blobRing___567UW",u$="button-module__isActive___FXNSJ",d$="button-module__primary___ppbyq",h$="button-module__secondary___esy5L",f$="button-module__ghost___NisA0",p$="button-module__danger___Wnvuq",m$="button-module__chalkboard___d3Nqb",g$="button-module__small___u7y8a",y$="button-module__medium___HBIAj",x$="button-module__large___RPzNy",v$="button-module__fullWidth___H0P0F",w$="button-module__iconLeft___s60SZ",b$="button-module__iconRight___75eFu",k$="button-module__label___pXAyM",qt={button:o$,blobBg:a$,blobFill:l$,blobRing:c$,isActive:u$,primary:d$,secondary:h$,ghost:f$,danger:p$,chalkboard:m$,small:g$,medium:y$,large:x$,fullWidth:v$,iconLeft:w$,iconRight:b$,label:k$},q=S.forwardRef(function({variant:e="primary",surface:t="paper",size:n="medium",icon:r,iconRight:i,fullWidth:s=!1,wobble:o=.5,isActive:a=!1,children:l,className:u,...c},h){const f=no(o);return d.jsxs("button",{ref:h,type:"button",className:Z(qt.button,qt[e],qt[n],t==="chalkboard"&&qt.chalkboard,a&&qt.isActive,s&&qt.fullWidth,u),...c,children:[d.jsxs("svg",{className:qt.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[d.jsx("path",{d:f.blob,className:qt.blobFill}),d.jsx("path",{d:f.ring,className:qt.blobRing})]}),r&&d.jsx("span",{className:qt.iconLeft,children:r}),d.jsx("span",{className:qt.label,children:l}),i&&d.jsx("span",{className:qt.iconRight,children:i})]})});function og(e){return{blue:e.accentBlue,green:e.accentGreen,amber:e.accentAmber,rose:e.accentRose,slate:e.accentSlate}}const Xe=ZD.generator(),S$="sketch-border-module__svg___whV4x",_$="sketch-border-module__behind___lgdYV",C$="sketch-border-module__stroke___vAm-v",j$="sketch-border-module__fill___zlpd6",Cl={svg:S$,behind:_$,stroke:C$,fill:j$};function At({shape:e="rect",radius:t=9,roughness:n=1.2,bowing:r=1,strokeWidth:i=1,inset:s=2,fill:o=!1,clip:a=!1,smooth:l=!1,strokeInset:u=!0,className:c}){const[h]=S.useState(Math.random),f=S.useRef(null),[p,m]=S.useState(null);S.useEffect(()=>{var g;const y=(g=f.current)==null?void 0:g.parentElement;if(!y)return;const v=new ResizeObserver(()=>{const k=y.offsetWidth,P=y.offsetHeight;m(b=>b&&b.width===k&&b.height===P?b:{width:k,height:P})});return v.observe(y),()=>v.disconnect()},[]);const{parts:x,clipPath:w}=S.useMemo(()=>{if(!p||p.width<8||p.height<8)return{parts:null,clipPath:null};const g=Math.max(1,Math.round(h*1e6)),y=g,v=g*2654435761%2147483647,k=j=>Xe.toPaths(Xe.path(j,{seed:y,roughness:n,bowing:r,preserveVertices:!0,strokeWidth:i})).filter(T=>!T.fill||T.fill==="none").map(T=>({d:T.d,filled:!1}));if(l){const j={seed:y,roughness:n,bowing:r,strokeWidth:i,disableMultiStroke:!0},T=A=>Xe.toPaths(A).filter(M=>!M.fill||M.fill==="none").map(M=>({d:M.d,filled:!1}));if(a){const A=jl(e,p,s,t,Xi(v),n*1.1),M=u?k0(i,n):0,F=M?jl(e,p,s+M,t,Xi(v),n*1.1):A;return{parts:T(Xe.path(F,{...j,preserveVertices:!0})),clipPath:A}}const E=e==="circle"?Xe.ellipse(p.width/2,p.height/2,p.width-s*2,p.height-s*2,j):Xe.path(_0(p,s,t,Xi(y)),{...j,preserveVertices:!0});return{parts:T(E),clipPath:null}}if(a){const j=jl(e,p,s,t,Xi(v),n*1.1),T=u?k0(i,n):0,E=T?jl(e,p,s+T,t,Xi(v),n*1.1):j;return{parts:k(E),clipPath:j}}const P=(j,T)=>{const E=T?{fill:"#000",fillStyle:"solid"}:{},A=e==="circle"?Xe.ellipse(p.width/2,p.height/2,p.width-s*2,p.height-s*2,{seed:j,roughness:n,bowing:r,strokeWidth:i,...E}):Xe.path(_0(p,s,t,Xi(j)),{seed:j,roughness:n,bowing:r,preserveVertices:!0,strokeWidth:i,...E});return Xe.toPaths(A)},b=o?P(v,!0).filter(j=>!!j.fill&&j.fill!=="none").map(j=>({d:j.d,filled:!0})):[],C=P(y,!1).filter(j=>!j.fill||j.fill==="none").map(j=>({d:j.d,filled:!1}));return{parts:[...b,...C],clipPath:null}},[p,h,a,l,e,t,n,r,i,s,o,u]);return S.useEffect(()=>{var g;const y=(g=f.current)==null?void 0:g.parentElement;if(y)return w?y.style.setProperty("--sketch-clip",`path("${w}")`):y.style.removeProperty("--sketch-clip"),()=>{y.style.removeProperty("--sketch-clip")}},[w]),d.jsx("svg",{ref:f,className:Z(Cl.svg,o&&Cl.behind,c),viewBox:p?`0 0 ${p.width} ${p.height}`:void 0,"aria-hidden":"true",children:x==null?void 0:x.map((g,y)=>g.filled?d.jsx("path",{className:Cl.fill,d:g.d},`f-${y}`):d.jsx("path",{className:Cl.stroke,d:g.d,strokeWidth:i},`s-${y}`))})}function k0(e,t){return e/2+t*1.5}function Xi(e){let t=e;return()=>(t=t*16807%2147483647,(t-1)/2147483646)}function jl(e,t,n,r,i,s){const o=t.width-n*2,a=t.height-n*2,l=t.width/2,u=t.height/2,c=()=>(i()-.5)*s*2,h=[];if(e==="circle")for(let f=0;f<16;f++){const p=f/16*Math.PI*2;h.push({x:l+Math.cos(p)*o/2+c(),y:u+Math.sin(p)*a/2+c()})}else{const f=Math.max(2,Math.min(r,o/2,a/2)),p=n,m=n,x=(y,v,k)=>{for(const P of[0,45,90]){const b=(k+P)*Math.PI/180;h.push({x:y+Math.cos(b)*f+c(),y:v+Math.sin(b)*f+c()})}},w=(y,v,k,P)=>{const b=Math.hypot(k-y,P-v),C=Math.min(12,Math.max(1,Math.round(b/160)));for(let j=1;j<=C;j++){const T=j/(C+1);h.push({x:y+(k-y)*T+c(),y:v+(P-v)*T+c()})}};x(p+f,m+f,180),w(p+f,m,p+o-f,m),x(p+o-f,m+f,270),w(p+o,m+f,p+o,m+a-f),x(p+o-f,m+a-f,0),w(p+o-f,m+a,p+f,m+a),x(p+f,m+a-f,90),w(p,m+a-f,p,m+f);const g=3;return S0([...h.slice(g),...h.slice(0,g)])}return S0(h)}function S0(e){const t=e.length;if(t<3)return"";const n=(i,s)=>Math.max(.001,Math.hypot(s.x-i.x,s.y-i.y)**.5);let r=`M ${e[0].x.toFixed(2)} ${e[0].y.toFixed(2)}`;for(let i=0;i<t;i++){const s=e[(i-1+t)%t],o=e[i],a=e[(i+1)%t],l=e[(i+2)%t],u=n(s,o),c=n(o,a),h=n(a,l),f=a.x-o.x+c*((o.x-s.x)/u-(a.x-s.x)/(u+c)),p=a.y-o.y+c*((o.y-s.y)/u-(a.y-s.y)/(u+c)),m=a.x-o.x+c*((l.x-a.x)/h-(l.x-o.x)/(c+h)),x=a.y-o.y+c*((l.y-a.y)/h-(l.y-o.y)/(c+h)),w=o.x+f/3,g=o.y+p/3,y=a.x-m/3,v=a.y-x/3;r+=` C ${w.toFixed(2)} ${g.toFixed(2)}, ${y.toFixed(2)} ${v.toFixed(2)}, ${a.x.toFixed(2)} ${a.y.toFixed(2)}`}return`${r} Z`}function _0(e,t,n,r){const i=[0,0,0,0].map(()=>Math.max(2,n+(r()-.5)*3));return P$(t,t,e.width-t*2,e.height-t*2,i)}function P$(e,t,n,r,i){const s=c=>Math.min(c,n/2,r/2),[o,a,l,u]=i.map(s);return[`M ${Se(e+o)} ${Se(t)}`,`L ${Se(e+n-a)} ${Se(t)}`,`Q ${Se(e+n)} ${Se(t)} ${Se(e+n)} ${Se(t+a)}`,`L ${Se(e+n)} ${Se(t+r-l)}`,`Q ${Se(e+n)} ${Se(t+r)} ${Se(e+n-l)} ${Se(t+r)}`,`L ${Se(e+u)} ${Se(t+r)}`,`Q ${Se(e)} ${Se(t+r)} ${Se(e)} ${Se(t+r-u)}`,`L ${Se(e)} ${Se(t+o)}`,`Q ${Se(e)} ${Se(t)} ${Se(e+o)} ${Se(t)}`,"Z"].join(" ")}function Se(e){return e.toFixed(2)}const Mt={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}},E$="page-module__page___-uHnG",T$="page-module__outlined___Wwtyg",R$="page-module__surface___sWfI6",I$="page-module__withAccent___lsv-m",A$="page-module__accentBlue___XxbMV",M$="page-module__accentGreen___Ne6Q8",L$="page-module__accentAmber___kLAwa",D$="page-module__accentRose___O9ZbZ",N$="page-module__accentSlate___xCB66",No={page:E$,outlined:T$,surface:R$,withAccent:I$,accentBlue:A$,accentGreen:M$,accentAmber:L$,accentRose:D$,accentSlate:N$},z$=og(No),O$={all:14,top:14,none:2};function A_({children:e,className:t,style:n,texture:r=!0,withAccent:i=!1,accentColor:s="blue",rounded:o="all",outline:a=!1}){const l=Wi(r,{texture:"white",ruledType:"lines",ruledColor:"blue"})??{backgroundColor:"var(--pui-bg-base)"};return d.jsxs("div",{className:Z(No.page,a&&No.outlined,i&&No.withAccent,i&&z$[s],t),style:n,children:[d.jsx(At,{clip:!0,...Mt.surface,radius:O$[o]}),d.jsx("div",{className:No.surface,style:l,children:e})]})}const F$="layout-module__layout___O1aWi",$$="layout-module__header___I-kxe",B$="layout-module__headerLeft___JChJQ",V$="layout-module__headerTitles___aqSUG",W$="layout-module__headerTitle___wvr39",U$="layout-module__headerSubtitle___6f5BD",H$="layout-module__headerActions___adC12",G$="layout-module__mobileToggle___4WpVG",K$="layout-module__body___tywNf",Y$="layout-module__mobileOverlay___tzbBC",Q$="layout-module__sidebar___8VKGq",q$="layout-module__sidebarOpen___47rtr",X$="layout-module__sidebarInner___tq2X6",J$="layout-module__logoArea___RLnC0",Z$="layout-module__logoText___pAmfV",eB="layout-module__nav___FxcrZ",tB="layout-module__main___9z7bu",nB="layout-module__navIslandFixed___H4TwP",rB="layout-module__content___jL-VB",iB="layout-module__contentWithPage___vVdfN",sB="layout-module__footer___LyakU",oB="layout-module__footerText___8BYxc",Oe={layout:F$,header:$$,headerLeft:B$,headerTitles:V$,headerTitle:W$,headerSubtitle:U$,headerActions:H$,mobileToggle:G$,body:K$,mobileOverlay:Y$,sidebar:Q$,sidebarOpen:q$,sidebarInner:X$,logoArea:J$,logoText:Z$,nav:eB,main:tB,navIslandFixed:nB,content:rB,contentWithPage:iB,footer:sB,footerText:oB};function aB(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"}:$u(e)}function lB({children:e,showHeader:t=!0,showFooter:n=!1,showSidebar:r=!0,showPage:i=!0,background:s="paper",title:o,subtitle:a,headerActions:l,headerHeight:u,headerTexture:c,navigationItems:h=[],activeItemId:f,onNavigate:p,logo:m,footerContent:x,navigationIsland:w,style:g,bleedBottom:y=!0,routeKey:v,stackOpen:k}){const[P,b]=S.useState(!1),C=Ou();Fu(P,()=>b(!1));const j=aB(s),T=r&&h.length>0,E=u!==void 0||c!==void 0?{...c!==void 0?$u(c):{},...u!==void 0?{height:typeof u=="number"?`${u}px`:u}:{}}:void 0;return d.jsxs("div",{className:Oe.layout,style:{...j,...g},children:[t&&d.jsxs("header",{className:Oe.header,style:E,children:[d.jsxs("div",{className:Oe.headerLeft,children:[T&&d.jsx("button",{type:"button",className:Oe.mobileToggle,onClick:()=>b(!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:Oe.headerTitles,children:[o&&d.jsx("h1",{className:Oe.headerTitle,children:o}),a&&d.jsx("span",{className:Oe.headerSubtitle,children:a})]})]}),l&&d.jsx("div",{className:Oe.headerActions,children:l})]}),d.jsxs("div",{className:Oe.body,children:[P&&d.jsx("button",{type:"button",className:Oe.mobileOverlay,onClick:()=>b(!1),"aria-label":"Close navigation",tabIndex:-1}),T&&d.jsx("aside",{className:Z(Oe.sidebar,P&&Oe.sidebarOpen),children:d.jsxs("div",{className:Oe.sidebarInner,children:[d.jsx("div",{className:Oe.logoArea,children:m||d.jsx("span",{className:Oe.logoText,children:"Paper UI"})}),d.jsx("nav",{className:Oe.nav,"aria-label":"Main navigation",children:h.map(A=>{const M=A.id===f;return d.jsx(q,{variant:"ghost",size:"small",isActive:M,onClick:()=>{p==null||p(A),b(!1)},"aria-current":M?"page":void 0,icon:A.icon,style:XF,children:A.label},A.id)})})]})}),d.jsx("div",{className:Oe.main,children:d.jsx("main",{className:i?Oe.contentWithPage:Oe.content,style:y?{paddingBottom:0}:void 0,children:(()=>{const A=v!==void 0?d.jsx(v_,{mode:"wait",children:d.jsx(Vs.div,{initial:C?void 0:{opacity:0,y:8},animate:{opacity:1,y:0},exit:C?void 0:{opacity:0,y:-8},transition:{duration:.2,ease:"easeOut"},style:{height:"100%"},children:e},v)}):e;return i?d.jsx(A_,{rounded:y?"top":"all",style:y&&w?{paddingBottom:`calc(${cc.navIslandBottom} + ${cc.navIslandHeight} + ${qF[4]})`}:void 0,children:A}):A})()})})]}),w&&d.jsx("div",{className:Oe.navIslandFixed,children:k!==void 0?d.jsx(Vs.div,{animate:{x:k?`-${cc.stackPanelWidth/2}px`:0},transition:{duration:C?0:.3,ease:[.4,0,.2,1]},children:w}):w}),n&&d.jsx("footer",{className:Oe.footer,children:x||d.jsx("p",{className:Oe.footerText,children:"Paper UI — Natural Materials Component Library"})})]})}const cB="checkbox-module__wrapper___uLYMI",uB="checkbox-module__blobFill___mPJSR",dB="checkbox-module__input___Ptgt7",hB="checkbox-module__blobBg___bw3sn",fB="checkbox-module__labelLeft___-vAmH",pB="checkbox-module__box___yAh-r",mB="checkbox-module__checkmark___tTyBz",gB="checkbox-module__indeterminateLine___IosI-",yB="checkbox-module__boxWrapper___byjoS",xB="checkbox-module__icon___RO-yn",vB="checkbox-module__labelText___bAnLr",wB="checkbox-module__chalkboard___sv6SL",zt={wrapper:cB,blobFill:uB,input:dB,blobBg:hB,labelLeft:fB,box:pB,checkmark:mB,indeterminateLine:gB,boxWrapper:yB,icon:xB,labelText:vB,chalkboard:wB},bB=S.forwardRef(function({label:e,labelPosition:t="right",indeterminate:n=!1,wobble:r=.4,surface:i="paper",className:s,checked:o,onChange:a,id:l,...u},c){const h=S.useId(),f=l??h,p=no(r),m=S.useRef(null);return S.useEffect(()=>{m.current&&(m.current.indeterminate=n)},[n]),d.jsxs("label",{className:Z(zt.wrapper,t==="left"&&zt.labelLeft,i==="chalkboard"&&zt.chalkboard,s),htmlFor:f,children:[d.jsxs("span",{className:zt.boxWrapper,children:[d.jsx("input",{ref:x=>{m.current=x,typeof c=="function"?c(x):c&&(c.current=x)},id:f,type:"checkbox",className:zt.input,checked:o,onChange:a,...u}),d.jsx("svg",{className:zt.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:d.jsx("path",{d:p.blob,className:zt.blobFill})}),d.jsxs("span",{className:zt.box,"aria-hidden":"true",children:[d.jsx(At,{smooth:!0,...Mt.control}),n?d.jsx("svg",{viewBox:"0 0 20 20",fill:"none",className:zt.icon,children:d.jsx("line",{x1:"4",y1:"10",x2:"16",y2:"10",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",className:zt.indeterminateLine})}):d.jsx("svg",{viewBox:"0 0 20 20",fill:"none",className:zt.icon,children:d.jsx("path",{d:"M4 10 L8 14 L16 6",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:zt.checkmark})})]})]}),e&&d.jsx("span",{className:zt.labelText,children:e})]})}),kB="icon-button-module__iconButton___avg6i",SB="icon-button-module__blobBg___466Vy",_B="icon-button-module__blobFill___FTN1g",CB="icon-button-module__blobRing___hRdQb",jB="icon-button-module__isActive___XlvtM",PB="icon-button-module__icon___h204x",EB="icon-button-module__ghost___Wbxog",TB="icon-button-module__danger___p0Xz5",RB="icon-button-module__small___bPnCU",IB="icon-button-module__medium___nOxPf",AB="icon-button-module__large___UBU5z",MB="icon-button-module__chalkboard___mi0sQ",qn={iconButton:kB,blobBg:SB,blobFill:_B,blobRing:CB,isActive:jB,icon:PB,default:"icon-button-module__default___9frNR",ghost:EB,danger:TB,small:RB,medium:IB,large:AB,chalkboard:MB},st=S.forwardRef(function({icon:e,variant:t="default",surface:n="paper",size:r="medium",label:i,wobble:s=.5,isActive:o=!1,className:a,...l},u){const c=no(s);return d.jsxs("button",{ref:u,type:"button",className:Z(qn.iconButton,qn[t],n==="chalkboard"&&qn.chalkboard,qn[r],o&&qn.isActive,a),"aria-label":i,title:i,...l,children:[d.jsxs("svg",{className:qn.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[d.jsx("path",{d:c.blob,className:qn.blobFill}),d.jsx("path",{d:c.ring,className:qn.blobRing})]}),d.jsx("span",{className:qn.icon,children:e})]})}),LB="stamp-module__stamp___5qaNY",DB="stamp-module__small___BBlBg",NB="stamp-module__medium___HG2YD",zB="stamp-module__large___aUT0I",OB="stamp-module__blobBg___Mdrdd",FB="stamp-module__blobFill___QyCeB",$B="stamp-module__blobRing___EUDx7",BB="stamp-module__dot___qZyCR",VB="stamp-module__label___T89iH",WB="stamp-module__chalkboard___syI4T",vr={stamp:LB,small:DB,medium:NB,large:zB,blobBg:OB,blobFill:FB,blobRing:$B,dot:BB,label:VB,chalkboard:WB},hh={neutral:{fill:ct(pe.accentSlate,.14),text:pe.accentSlateDark,ring:ct(pe.accentSlateDark,.35)},info:{fill:ct(pe.accentBlue,.14),text:pe.accentBlueDark,ring:ct(pe.accentBlueDark,.35)},success:{fill:ct(pe.accentGreen,.16),text:pe.accentGreenDark,ring:ct(pe.accentGreenDark,.35)},warning:{fill:ct(pe.accentAmber,.16),text:pe.accentAmberDark,ring:ct(pe.accentAmberDark,.4)},error:{fill:ct(pe.accentRose,.16),text:pe.accentRoseDark,ring:ct(pe.accentRoseDark,.35)}},C0={fill:ct(pe.chalkboardBorderBase,.1),ring:ct(pe.chalkboardBorderBase,.35)};function Be({children:e,size:t="medium",variant:n,dot:r=!1,fillColor:i,textColor:s,wobble:o=.3,surface:a="paper",className:l}){const u=no(o),c=a==="chalkboard",h=n?c?C0.ring:hh[n].ring:void 0,f=i??(n?c?C0.fill:hh[n].fill:"transparent"),p=s??(n&&!c?hh[n].text:void 0);return d.jsxs("span",{className:Z(vr.stamp,vr[t],c&&vr.chalkboard,l),style:p?{color:p}:void 0,children:[d.jsxs("svg",{className:vr.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[d.jsx("path",{d:u.blob,className:vr.blobFill,style:{fill:f}}),h&&d.jsx("path",{d:u.ring,className:vr.blobRing,style:{stroke:h}})]}),r&&d.jsx("span",{className:vr.dot,"aria-hidden":"true"}),d.jsx("span",{className:vr.label,children:e})]})}const UB="copy-button-module__copyButton___-hTo4",HB="copy-button-module__dark___O45N-",GB="copy-button-module__chalkboard___hW4aw",KB="copy-button-module__copied___XlHFr",Pl={copyButton:UB,dark:HB,chalkboard:GB,copied:KB};function su({text:e,variant:t="light",surface:n="paper",className:r,...i}){const[s,o]=S.useState(!1),a=S.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:Z(Pl.copyButton,t==="dark"&&Pl.dark,n==="chalkboard"&&Pl.chalkboard,s&&Pl.copied,r),...i,children:s?"Copied!":"Copy"})}const YB="code-block-module__codeBlock___dq28o",QB="code-block-module__header___42Fek",qB="code-block-module__relative___oO-zy",XB="code-block-module__copyOverlay___PjAuq",JB="code-block-module__pre___zXzLZ",ZB="code-block-module__chalkboard___bdo9J",e4="code-block-module__chalkboardHeader___3RiVd",t4="code-block-module__chalkboardPre___iRBFR",wr={codeBlock:YB,header:QB,relative:qB,copyOverlay:XB,pre:JB,chalkboard:ZB,chalkboardHeader:e4,chalkboardPre:t4};function _9({code:e,filename:t,surface:n="paper"}){return d.jsxs("div",{className:Z(wr.codeBlock,n==="chalkboard"&&wr.chalkboard),children:[t&&d.jsxs("div",{className:Z(wr.header,n==="chalkboard"&&wr.chalkboardHeader),children:[d.jsx("span",{children:t}),d.jsx(su,{text:e,variant:"light",surface:n})]}),!t&&d.jsx("div",{className:wr.relative,children:d.jsx("div",{className:wr.copyOverlay,children:d.jsx(su,{text:e,variant:"dark",surface:n})})}),d.jsx("pre",{className:Z(wr.pre,n==="chalkboard"&&wr.chalkboardPre),children:d.jsx("code",{children:e})})]})}function Fa({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 M_({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 ag({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 n4({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("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),d.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}function r4({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 i4({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 L_({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 s4="table-module__tableFrame___KP-90",o4="table-module__tableWrapper___gc3Y3",a4="table-module__toolbar___zhCel",l4="table-module__search___zIBk2",c4="table-module__searchIcon___ayhK8",u4="table-module__searchInput___PqsEG",d4="table-module__toolbarActions___EX6qS",h4="table-module__tableScroll___1gvc4",f4="table-module__table___tdU5g",p4="table-module__th___GQbKk",m4="table-module__td___WktB5",g4="table-module__tr___xeZno",y4="table-module__expandTh___uxkR4",x4="table-module__expandTd___VoBRC",v4="table-module__expandIcon___8V45X",w4="table-module__expandable___R7o2l",b4="table-module__expandedRow___1TbTQ",k4="table-module__expandedCell___sKAaD",S4="table-module__boardScroll___Y1yqm",_4="table-module__board___kFAI-",C4="table-module__boardColumn___-W9bP",j4="table-module__boardColumnHeader___kY3Fj",P4="table-module__accentBlue___PEJ1V",E4="table-module__accentGreen___wJ53r",T4="table-module__accentAmber___Iezjv",R4="table-module__accentRose___W8zxc",I4="table-module__accentSlate___oUZCX",A4="table-module__boardColumnLabel___JBEed",M4="table-module__boardColumnCount___Pkpiq",L4="table-module__boardColumnBody___uAgRF",D4="table-module__boardRow___C1P60",N4="table-module__boardEmpty___IKv2W",z4="table-module__chalkboardFrame___xB3N5",O4="table-module__chalkboardWrapper___KjY5r",F4="table-module__chalkboard___v0m3A",le={tableFrame:s4,tableWrapper:o4,toolbar:a4,search:l4,searchIcon:c4,searchInput:u4,toolbarActions:d4,tableScroll:h4,table:f4,th:p4,td:m4,tr:g4,expandTh:y4,expandTd:x4,expandIcon:v4,expandable:w4,expandedRow:b4,expandedCell:k4,boardScroll:S4,board:_4,boardColumn:C4,boardColumnHeader:j4,accentBlue:P4,accentGreen:E4,accentAmber:T4,accentRose:R4,accentSlate:I4,boardColumnLabel:A4,boardColumnCount:M4,boardColumnBody:L4,boardRow:D4,boardEmpty:N4,chalkboardFrame:z4,chalkboardWrapper:O4,chalkboard:F4},$4=og(le);function B4({data:e=[],columns:t=[],board:n,surface:r="paper",texture:i=!0,toolbar:s,expandable:o,showExpandColumn:a=!0,rowKey:l,rowClassName:u,className:c}){const h=Wi(i,r==="chalkboard"?"chalkboard":"paper"),f=!!s,[p,m]=S.useState(new Set),x=y=>{m(v=>{const k=new Set(v);return k.has(y)?k.delete(y):k.add(y),k})},w=!!(o&&a),g=w?t.length+1:t.length;return d.jsxs("div",{className:Z(le.tableFrame,r==="chalkboard"&&le.chalkboardFrame,c),children:[d.jsx(At,{clip:!0,...Mt.surface}),d.jsxs("div",{className:Z(le.tableWrapper,r==="chalkboard"&&le.chalkboardWrapper),style:h,children:[f&&d.jsxs("div",{className:le.toolbar,children:[s.search&&d.jsxs("div",{className:le.search,children:[d.jsx(V4,{className:le.searchIcon}),d.jsx("input",{type:"text",className:le.searchInput,placeholder:s.search.placeholder??"Search...","aria-label":s.search.placeholder??"Search",value:s.search.value,onChange:y=>{var v,k;return(k=(v=s.search)==null?void 0:v.onChange)==null?void 0:k.call(v,y.target.value)}}),d.jsx(At,{fill:!0,...Mt.field})]}),s.actions&&d.jsx("div",{className:le.toolbarActions,children:typeof s.actions=="function"?s.actions(r):s.actions})]}),n?d.jsx("div",{className:le.boardScroll,children:d.jsx("div",{className:le.board,children:n.map(y=>d.jsxs("div",{className:le.boardColumn,children:[d.jsxs("div",{className:Z(le.boardColumnHeader,r==="chalkboard"&&le.chalkboard,y.accent&&$4[y.accent]),children:[d.jsx("span",{className:le.boardColumnLabel,children:y.label}),d.jsx("span",{className:le.boardColumnCount,children:y.items.length})]}),d.jsx("div",{className:le.boardColumnBody,children:y.items.length===0?d.jsx("div",{className:le.boardEmpty,children:y.emptyLabel??"empty"}):y.items.map((v,k)=>d.jsx("div",{className:Z(le.boardRow,r==="chalkboard"&&le.chalkboard),children:y.renderItem(v,k,r)},y.getKey?y.getKey(v,k):k))})]},y.key))})}):d.jsx("div",{className:le.tableScroll,children:d.jsxs("table",{className:Z(le.table,r==="chalkboard"&&le.chalkboard),children:[d.jsxs("colgroup",{children:[w&&d.jsx("col",{style:{width:"48px"}}),t.map(y=>d.jsx("col",{style:y.width?{width:`${y.width*32}px`}:void 0},y.key))]}),d.jsx("thead",{children:d.jsxs("tr",{children:[w&&d.jsx("th",{className:Z(le.th,le.expandTh),"aria-label":"Expand"}),t.map(y=>d.jsx("th",{className:le.th,children:y.header},y.key))]})}),d.jsx("tbody",{children:e.map((y,v)=>{const k=l?l(y,v):v,P=o==null?void 0:o.render(y,v,r),b=!!P,C=b&&p.has(k);return d.jsxs(S.Fragment,{children:[d.jsxs("tr",{className:Z(le.tr,b&&le.expandable,u==null?void 0:u(y,v)),onClick:()=>b&&x(k),children:[w&&d.jsx("td",{className:Z(le.td,le.expandTd),children:b&&d.jsx("button",{type:"button",className:le.expandIcon,"aria-expanded":C,"aria-label":C?"Collapse row":"Expand row",onClick:j=>{j.stopPropagation(),x(k)},children:d.jsx(L_,{size:14})})}),t.map(j=>d.jsx("td",{className:le.td,children:j.cell(y,v,r)},j.key))]}),C&&d.jsx("tr",{className:le.expandedRow,children:d.jsx("td",{colSpan:g,className:le.expandedCell,children:P})})]},k)})})]})})]})]})}function V4({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 W4="card-module__borderLayer___WSpJq",U4="card-module__elevated___uhWj9",H4="card-module__textureLayer___Kcofz",G4="card-module__small___HXUTr",K4="card-module__withAccent___2t7bV",Y4="card-module__accentBlue___a1KIq",Q4="card-module__accentGreen___RNWoA",q4="card-module__accentAmber___uMhom",X4="card-module__accentRose___VPI3t",J4="card-module__accentSlate___-l4jE",Z4="card-module__chalkboard___bQ48O",pi={borderLayer:W4,default:"card-module__default___glPy-",elevated:U4,textureLayer:H4,small:G4,withAccent:K4,accentBlue:Y4,accentGreen:Q4,accentAmber:q4,accentRose:X4,accentSlate:J4,chalkboard:Z4},e5=og(pi);function Pe({children:e,variant:t="default",surface:n="paper",size:r="medium",texture:i="parchment",accent:s=!1,accentColor:o="blue",className:a}){return d.jsxs("div",{className:Z(pi.borderLayer,pi[t],n==="chalkboard"&&pi.chalkboard,pi[r],s&&pi.withAccent,s&&e5[o],a),children:[d.jsx(At,{clip:!0,...Mt.surface}),d.jsx("div",{className:pi.textureLayer,style:n==="chalkboard"?void 0:Wi(i),children:e})]})}const t5="input-module__wrapper___xaEw6",n5="input-module__label___lu7R1",r5="input-module__field___khFpX",i5="input-module__input___h7K-F",s5="input-module__small___SkByh",o5="input-module__medium___0QPuV",a5="input-module__large___zGwRu",l5="input-module__error___QDqga",c5="input-module__disabled___K-5hi",u5="input-module__helperText___njeLH",d5="input-module__helperError___qDBpD",h5="input-module__chalkboard___Xh-5s",Tn={wrapper:t5,label:n5,field:r5,input:i5,small:s5,medium:o5,large:a5,error:l5,disabled:c5,helperText:u5,helperError:d5,chalkboard:h5},$a=S.forwardRef(function({label:e,helperText:t,error:n=!1,size:r="medium",surface:i="paper",className:s,id:o,...a},l){const u=S.useId(),c=o??u;return d.jsxs("div",{className:Z(Tn.wrapper,i==="chalkboard"&&Tn.chalkboard,s),children:[e&&d.jsx("label",{htmlFor:c,className:Tn.label,children:e}),d.jsxs("span",{className:Z(Tn.field,Tn[r],n&&Tn.error,a.disabled&&Tn.disabled),children:[d.jsx("input",{ref:l,id:c,className:Tn.input,...a}),d.jsx(At,{fill:!0,...Mt.field})]}),t&&d.jsx("span",{className:Z(Tn.helperText,n&&Tn.helperError),children:t})]})}),f5="select-module__wrapper___Hc5F3",p5="select-module__label___ay-3s",m5="select-module__nativeSelect___UA2d-",g5="select-module__trigger___xMYHi",y5="select-module__open___w3mbZ",x5="select-module__triggerLabel___ihpER",v5="select-module__placeholder___0VOFP",w5="select-module__small___iU9W9",b5="select-module__chevron___0dCTg",k5="select-module__medium___B-XBN",S5="select-module__large___iII2c",_5="select-module__chevronOpen___cFOYe",C5="select-module__error___P5RBk",j5="select-module__dropdown___Q-uK3",P5="select-module__slideDown___sT374",E5="select-module__options___HmrQ0",T5="select-module__option___vNnue",R5="select-module__optionDisabled___ex2zq",I5="select-module__optionSelected___tAFjn",A5="select-module__optionHighlighted___zYQLq",M5="select-module__helperText___r5gyn",L5="select-module__helperError___ydSPT",D5="select-module__chalkboard___sXBw8",We={wrapper:f5,label:p5,nativeSelect:m5,trigger:g5,open:y5,triggerLabel:x5,placeholder:v5,small:w5,chevron:b5,medium:k5,large:S5,chevronOpen:_5,error:C5,dropdown:j5,slideDown:P5,options:E5,option:T5,optionDisabled:R5,optionSelected:I5,optionHighlighted:A5,helperText:M5,helperError:L5,chalkboard:D5};function rp({label:e,helperText:t,error:n=!1,size:r="medium",surface:i="paper",options:s,placeholder:o,value:a,defaultValue:l,onChange:u,name:c,disabled:h=!1,width:f,texture:p=!1,className:m}){const x=S.useId(),[w,g]=S.useState(!1),[y,v]=S.useState(-1),[k,P]=S.useState(l??""),[b,C]=S.useState(null),j=S.useRef(null),T=S.useRef(null),E=a!==void 0,A=E?a:k,M=s.find(_=>_.value===A),F=(M==null?void 0:M.label)??o??"Select...",D=S.useCallback(()=>{if(h)return;g(!0);const _=s.findIndex(B=>B.value===A);v(_>=0?_:0)},[h,s,A]),L=S.useCallback(()=>{g(!1),v(-1)},[]),$=S.useCallback(_=>{var B;_.disabled||(E||P(_.value),u==null||u(_.value),L(),(B=j.current)==null||B.focus())},[E,u,L]),U=S.useCallback(_=>{if(!h)switch(_.key){case"Enter":case" ":_.preventDefault(),w&&y>=0?$(s[y]):D();break;case"Escape":_.preventDefault(),w&&L();break;case"ArrowDown":_.preventDefault(),w?v(B=>{let X=B+1;for(;X<s.length&&s[X].disabled;)X++;return X<s.length?X:B}):D();break;case"ArrowUp":_.preventDefault(),w?v(B=>{let X=B-1;for(;X>=0&&s[X].disabled;)X--;return X>=0?X:B}):D();break;case"Home":if(_.preventDefault(),w){let B=0;for(;B<s.length&&s[B].disabled;)B++;B<s.length&&v(B)}break;case"End":if(_.preventDefault(),w){let B=s.length-1;for(;B>=0&&s[B].disabled;)B--;B>=0&&v(B)}break;case"Tab":w&&L();break}},[h,w,y,s,D,L,$]);S.useEffect(()=>{if(!w)return;const _=B=>{var X,I;const ue=B.target;(X=j.current)!=null&&X.contains(ue)||(I=T.current)!=null&&I.contains(ue)||L()};return document.addEventListener("mousedown",_),()=>document.removeEventListener("mousedown",_)},[w,L]),S.useEffect(()=>{if(!w||y<0||!T.current)return;const _=T.current.querySelector(`[data-option-index="${y}"]`);_==null||_.scrollIntoView({block:"nearest"})},[w,y]),S.useEffect(()=>{if(!w){C(null);return}const _=()=>{if(!j.current)return;const B=j.current.getBoundingClientRect();if(B.bottom<0||B.top>window.innerHeight){L();return}C(B)};return _(),document.addEventListener("scroll",_,{capture:!0,passive:!0}),window.addEventListener("resize",_,{passive:!0}),()=>{document.removeEventListener("scroll",_,{capture:!0}),window.removeEventListener("resize",_)}},[w,L]);const z=Wi(p),V=z?{"--sketch-fill":z.backgroundColor}:void 0;return d.jsxs("div",{className:Z(We.wrapper,i==="chalkboard"&&We.chalkboard,m),style:f?{width:typeof f=="number"?`${f}px`:f}:void 0,children:[e&&d.jsx("label",{htmlFor:x,className:We.label,children:e}),d.jsxs("select",{id:x,name:c,className:We.nativeSelect,value:A,onChange:_=>u==null?void 0:u(_.target.value),disabled:h,"aria-hidden":"true",tabIndex:-1,children:[o&&d.jsx("option",{value:"",children:o}),s.map(_=>d.jsx("option",{value:_.value,disabled:_.disabled,children:_.label},_.value))]}),d.jsxs("button",{ref:j,type:"button",role:"combobox","aria-expanded":w,"aria-haspopup":"listbox","aria-controls":w?`${x}-listbox`:void 0,"aria-activedescendant":w&&y>=0?`${x}-option-${y}`:void 0,className:Z(We.trigger,We[r],n&&We.error,w&&We.open,h&&We.disabled),onClick:()=>w?L():D(),onKeyDown:U,disabled:h,children:[d.jsx("span",{className:Z(We.triggerLabel,!M&&We.placeholder),children:F}),d.jsx(N5,{className:Z(We.chevron,w&&We.chevronOpen)}),d.jsx(At,{fill:!0,...Mt.field})]}),w&&b&&$i.createPortal(d.jsxs("div",{ref:T,id:`${x}-listbox`,role:"listbox",tabIndex:-1,className:We.dropdown,style:{...V,position:"fixed",top:b.bottom+6,left:b.left,width:b.width},onKeyDown:_=>{var B;_.key==="Escape"&&(_.preventDefault(),L(),(B=j.current)==null||B.focus())},children:[d.jsx(At,{fill:!0,...Mt.surface}),d.jsx("div",{className:We.options,children:s.map((_,B)=>d.jsx("div",{id:`${x}-option-${B}`,role:"option","aria-selected":_.value===A,tabIndex:-1,"data-option-index":B,className:Z(We.option,_.value===A&&We.optionSelected,B===y&&We.optionHighlighted,_.disabled&&We.optionDisabled),onClick:X=>{X.stopPropagation(),$(_)},onMouseEnter:()=>v(B),children:_.label},_.value))})]}),document.body),t&&d.jsx("span",{className:Z(We.helperText,n&&We.helperError),children:t})]})}function N5({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 D_({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 z5="alert-module__alert___j7ZRS",O5="alert-module__surface___IaVgU",F5="alert-module__iconWrapper___kLoxT",$5="alert-module__message___klR2U",B5="alert-module__dismiss___f2uoG",V5="alert-module__info___PBo1l",W5="alert-module__success___AVBKS",U5="alert-module__warning___zkMaJ",H5="alert-module__error___cxg96",G5="alert-module__chalkboard___7pgWk",ai={alert:z5,surface:O5,iconWrapper:F5,message:$5,dismiss:B5,info:V5,success:W5,warning:U5,error:H5,chalkboard:G5};function N_({children:e,variant:t="info",surface:n="paper",texture:r="kraft",dismissible:i=!1,onDismiss:s,className:o}){const a=n==="chalkboard";return d.jsxs("div",{className:Z(ai.alert,ai[t],a&&ai.chalkboard,o),role:t==="warning"||t==="error"?"alert":"status",children:[d.jsx(At,{clip:!0,...Mt.surface}),d.jsx("div",{className:ai.surface,style:a?void 0:Wi(r)}),d.jsx("span",{className:ai.iconWrapper,children:d.jsx(D_,{variant:t})}),d.jsx("div",{className:ai.message,children:e}),i&&d.jsx("button",{type:"button",className:ai.dismiss,onClick:s,"aria-label":"Dismiss alert",children:d.jsx(Fa,{size:16})})]})}const K5="modal-module__overlay___a52Ni",Y5="modal-module__fadeIn___5OWd5",Q5="modal-module__backdrop___RS4yj",q5="modal-module__modal___ZioOV",X5="modal-module__slideUp___vfFrm",J5="modal-module__small___hcxwF",Z5="modal-module__medium___mjbM5",eV="modal-module__large___1dzyf",tV="modal-module__header___iP09B",nV="modal-module__title___nj06m",rV="modal-module__close___gQou9",iV="modal-module__body___Y-EdA",sV="modal-module__chalkboard___qY8qo",Xn={overlay:K5,fadeIn:Y5,backdrop:Q5,modal:q5,slideUp:X5,small:J5,medium:Z5,large:eV,header:tV,title:nV,close:rV,body:iV,chalkboard:sV},oV='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';function hr({open:e,onClose:t,title:n,children:r,size:i="medium",surface:s="paper",texture:o=!1,className:a}){const l=S.useId(),u=S.useRef(null),c=S.useRef(null);if(Fu(e,t),S.useEffect(()=>{var f;if(!e)return;c.current=document.activeElement,(f=u.current)==null||f.focus();const p=x=>{var w;if(x.key!=="Tab")return;const g=(w=u.current)==null?void 0:w.querySelectorAll(oV);if(!g||g.length===0){x.preventDefault();return}const y=g[0],v=g[g.length-1];x.shiftKey&&document.activeElement===y?(x.preventDefault(),v.focus()):!x.shiftKey&&document.activeElement===v&&(x.preventDefault(),y.focus())};document.addEventListener("keydown",p);const m=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{var x,w;document.removeEventListener("keydown",p),document.body.style.overflow=m,(w=(x=c.current)==null?void 0:x.focus)==null||w.call(x)}},[e]),!e||typeof document>"u")return null;const h=Wi(o);return $i.createPortal(d.jsxs("div",{className:Xn.overlay,children:[d.jsx("button",{type:"button",className:Xn.backdrop,"aria-label":"Close modal",onClick:t}),d.jsxs("div",{ref:u,className:Z(Xn.modal,Xn[i],s==="chalkboard"&&Xn.chalkboard,a),style:h,role:"dialog","aria-modal":"true","aria-labelledby":n?l:void 0,tabIndex:-1,children:[d.jsxs("div",{className:Xn.header,children:[n&&d.jsx("h2",{id:l,className:Xn.title,children:n}),d.jsx("button",{type:"button",className:Xn.close,onClick:t,"aria-label":"Close modal",children:d.jsx(Fa,{size:18})})]}),d.jsx("div",{className:Xn.body,children:r})]})]}),document.body)}const aV="textarea-module__wrapper___NbiNO",lV="textarea-module__label___ejhyZ",cV="textarea-module__field___KluQf",uV="textarea-module__textarea___0y-7v",dV="textarea-module__resizeGrip___lONlE",hV="textarea-module__small___yPyr8",fV="textarea-module__medium___ezQxA",pV="textarea-module__large___xfeKi",mV="textarea-module__error___EkXKJ",gV="textarea-module__disabled___9CKbb",yV="textarea-module__helperText___l1sPh",xV="textarea-module__helperError___VfTLy",vV="textarea-module__chalkboard___zZ0X0",pn={wrapper:aV,label:lV,field:cV,textarea:uV,resizeGrip:dV,small:hV,medium:fV,large:pV,error:mV,disabled:gV,helperText:yV,helperError:xV,chalkboard:vV},wV=48,Gt=S.forwardRef(function({label:e,helperText:t,error:n=!1,size:r="medium",surface:i="paper",className:s,id:o,...a},l){const u=S.useId(),c=o??u,h=S.useRef(null),f=S.useCallback(m=>{h.current=m,typeof l=="function"?l(m):l&&(l.current=m)},[l]),p=S.useCallback(m=>{const x=h.current;if(!x)return;m.preventDefault();const w=m.clientY,g=x.offsetHeight,y=k=>{x.style.height=`${Math.max(wV,g+k.clientY-w)}px`},v=()=>{window.removeEventListener("pointermove",y),window.removeEventListener("pointerup",v)};window.addEventListener("pointermove",y),window.addEventListener("pointerup",v)},[]);return d.jsxs("div",{className:Z(pn.wrapper,i==="chalkboard"&&pn.chalkboard,s),children:[e&&d.jsx("label",{htmlFor:c,className:pn.label,children:e}),d.jsxs("span",{className:Z(pn.field,pn[r],n&&pn.error,a.disabled&&pn.disabled),children:[d.jsx("textarea",{ref:f,id:c,className:pn.textarea,...a}),d.jsx(At,{fill:!0,...Mt.field}),!a.disabled&&d.jsx("span",{className:pn.resizeGrip,onPointerDown:p,"aria-hidden":"true",title:"Drag to resize",children:d.jsxs("svg",{viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:[d.jsx("path",{d:"M11 4.5 L4.5 11"}),d.jsx("path",{d:"M11 8.5 L8.5 11"})]})})]}),t&&d.jsx("span",{className:Z(pn.helperText,n&&pn.helperError),children:t})]})}),bV="progress-module__track___a5BMO",kV="progress-module__svg___3U0-E",j0={track:bV,svg:kV},fh=300,br=1;function SV({value:e,max:t=100,color:n,height:r=6,surface:i="paper",className:s}){const o=t>0?Math.max(0,Math.min(100,Math.round(e/t*100))):0,a=i==="chalkboard",l=Math.max(1,Math.round(Wu()*1e6)),u=a?ct(pe.chalkboardBorderBase,.16):ct(pe.textPrimary,.12),c=n??(a?pe.chalkboardChalk:pe.textSecondary),h=S.useMemo(()=>Xe.toPaths(Xe.rectangle(br,br,fh-br*2,r-br*2,{seed:l,roughness:2.2,fill:u,fillStyle:"solid",stroke:u,strokeWidth:1.5})),[l,u,r]),f=Math.max(o/100*(fh-br*2),0),p=S.useMemo(()=>f>0?Xe.toPaths(Xe.rectangle(br,br,f,r-br*2,{seed:l+1,roughness:2,fill:c,fillStyle:"solid",stroke:c,strokeWidth:1})):[],[l,c,f,r]);return d.jsx("div",{className:Z(j0.track,s),style:{height:r,borderRadius:r/2},children:d.jsxs("svg",{className:j0.svg,viewBox:`0 0 ${fh} ${r}`,preserveAspectRatio:"none","aria-hidden":"true",children:[h.map((m,x)=>d.jsx("path",{d:m.d,stroke:m.stroke,strokeWidth:m.strokeWidth,fill:m.fill},x)),p.map((m,x)=>d.jsx("path",{d:m.d,stroke:m.stroke,strokeWidth:m.strokeWidth,fill:m.fill},x))]})})}function _V(e){const t=Wu();return S.useMemo(()=>({blob:r$({seed:t,wobble:e}),ring:i$(t,e)}),[t,e])}const CV="list-item-module__listItem___-tw9O",jV="list-item-module__clickable___GLJmd",PV="list-item-module__blobBg___O3Mzh",EV="list-item-module__blobFill___dXHk1",TV="list-item-module__blobRing___S9mas",RV="list-item-module__active___UsL8O",IV="list-item-module__small___9dphK",AV="list-item-module__medium___yGZCr",MV="list-item-module__icon___2b4wU",LV="list-item-module__label___SIzJ4",DV="list-item-module__action___qGh0-",NV="list-item-module__chalkboard___qpWuM",Xt={listItem:CV,static:"list-item-module__static___qtEX6",clickable:jV,blobBg:PV,blobFill:EV,blobRing:TV,active:RV,small:IV,medium:AV,icon:MV,label:LV,action:DV,chalkboard:NV};function vs({active:e=!1,icon:t,action:n,size:r="medium",wobble:i=.5,surface:s="paper",children:o,className:a,...l}){const u=_V(i),c=!!l.onClick;return d.jsxs("button",{type:"button",className:Z(Xt.listItem,Xt[r],c&&Xt.clickable,!c&&!e&&Xt.static,e&&Xt.active,s==="chalkboard"&&Xt.chalkboard,a),"aria-current":e?"page":void 0,...l,children:[d.jsxs("svg",{className:Xt.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[d.jsx("path",{d:u.blob,className:Xt.blobFill}),d.jsx("path",{d:u.ring,className:Xt.blobRing})]}),t&&d.jsx("span",{className:Xt.icon,children:t}),d.jsx("span",{className:Xt.label,children:o}),n&&d.jsx("span",{className:Xt.action,children:n})]})}const zV="accordion-module__accordion___mqGl-",OV="accordion-module__header___mLfbd",FV="accordion-module__icon___Z90NR",$V="accordion-module__title___HusgG",BV="accordion-module__content___1K0td",VV="accordion-module__chalkboard___am8r4",WV="accordion-module__expanded___836xG",li={accordion:zV,header:OV,icon:FV,title:$V,content:BV,chalkboard:VV,expanded:WV};function UV({title:e,children:t,expanded:n=!1,onToggle:r,surface:i="paper",className:s}){return d.jsxs("div",{className:Z(li.accordion,n&&li.expanded,i==="chalkboard"&&li.chalkboard,s),children:[d.jsxs("button",{type:"button",className:li.header,onClick:r,"aria-expanded":n,children:[d.jsx("span",{className:li.icon,"aria-hidden":"true",children:d.jsx(L_,{size:14})}),d.jsx("span",{className:li.title,children:e})]}),n&&d.jsx("div",{className:li.content,children:t})]})}const HV="icon-module__icon___2vrJz",GV="icon-module__blobBg___ENPYJ",KV="icon-module__blobFill___IPbwQ",YV="icon-module__blobRing___1awqV",QV="icon-module__content___TaZR6",qV="icon-module__small___Xp--F",XV="icon-module__medium___tCjMB",JV="icon-module__large___vBtP7",Ji={icon:HV,blobBg:GV,blobFill:KV,blobRing:YV,content:QV,small:qV,medium:XV,large:JV},ZV={small:20,medium:24,large:28};function e6({icon:e,size:t="medium",wobble:n=.5,fillColor:r,className:i}){const s=no(n),o=ZV[t];return d.jsxs("span",{className:Z(Ji.icon,Ji[t],i),children:[d.jsxs("svg",{className:Ji.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[d.jsx("path",{d:s.blob,className:Ji.blobFill,style:r?{fill:r}:void 0}),d.jsx("path",{d:s.ring,className:Ji.blobRing})]}),d.jsx("span",{className:Ji.content,style:{width:o,height:o},children:e})]})}const t6="radio-module__wrapper___BB05E",n6="radio-module__blobFill___p5BX4",r6="radio-module__labelLeft___ijB93",i6="radio-module__input___M2nFJ",s6="radio-module__box___H7ofS",o6="radio-module__dot___jVJ-d",a6="radio-module__boxWrapper___Y3qis",l6="radio-module__blobBg___IR-M5",c6="radio-module__labelText___I-nu3",u6="radio-module__chalkboard___IIBqI",Rn={wrapper:t6,blobFill:n6,labelLeft:r6,input:i6,box:s6,dot:o6,boxWrapper:a6,blobBg:l6,labelText:c6,chalkboard:u6};S.forwardRef(function({label:e,labelPosition:t="right",wobble:n=.4,surface:r="paper",className:i,checked:s,onChange:o,id:a,...l},u){const c=S.useId(),h=a??c,f=no(n);return d.jsxs("label",{className:Z(Rn.wrapper,t==="left"&&Rn.labelLeft,r==="chalkboard"&&Rn.chalkboard,i),htmlFor:h,children:[d.jsxs("span",{className:Rn.boxWrapper,children:[d.jsx("input",{ref:u,id:h,type:"radio",className:Rn.input,checked:s,onChange:o,...l}),d.jsx("svg",{className:Rn.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:d.jsx("path",{d:f.blob,className:Rn.blobFill})}),d.jsxs("span",{className:Rn.box,"aria-hidden":"true",children:[d.jsx(At,{smooth:!0,shape:"circle",...Mt.control}),d.jsx("span",{className:Rn.dot})]})]}),e&&d.jsx("span",{className:Rn.labelText,children:e})]})});const d6="switch-module__wrapper___5-2P1",h6="switch-module__labelLeft___WlT-N",f6="switch-module__input___YKZRj",p6="switch-module__track___QNvnO",m6="switch-module__thumb___cunvF",g6="switch-module__small___WPIxc",y6="switch-module__medium___yPulW",x6="switch-module__large___VlKV1",v6="switch-module__labelText___9Qg39",w6="switch-module__chalkboard___qKTMz",kr={wrapper:d6,labelLeft:h6,input:f6,track:p6,thumb:m6,small:g6,medium:y6,large:x6,labelText:v6,chalkboard:w6},b6=S.forwardRef(function({label:e,labelPosition:t="right",size:n="medium",surface:r="paper",className:i,checked:s,onChange:o,id:a,...l},u){const c=S.useId(),h=a??c;return d.jsxs("label",{className:Z(kr.wrapper,kr[n],t==="left"&&kr.labelLeft,r==="chalkboard"&&kr.chalkboard,i),htmlFor:h,children:[d.jsx("input",{ref:u,id:h,type:"checkbox",className:kr.input,checked:s,onChange:o,...l}),d.jsxs("span",{className:kr.track,"aria-hidden":"true",children:[d.jsx(At,{...Mt.pill}),d.jsx("span",{className:kr.thumb})]}),e&&d.jsx("span",{className:kr.labelText,children:e})]})}),k6="spinner-module__spinner___FDTk2",S6="spinner-module__chalkboard___DLE1z",_6="spinner-module__svg___JnCWN",C6="spinner-module__track___xbnbo",j6="spinner-module__head___j5dWe",Eo={spinner:k6,chalkboard:S6,svg:_6,track:C6,head:j6},P6={small:18,medium:28,large:40},P0=25,E6=18,E0=Xe.toPaths(Xe.circle(P0,P0,E6*2,{seed:7,roughness:1.15,disableMultiStroke:!0})).map(e=>e.d).join(" ");function Ws({size:e="medium",color:t,label:n="Loading",surface:r="paper",className:i}){const s=P6[e];return d.jsx("span",{className:Z(Eo.spinner,r==="chalkboard"&&Eo.chalkboard,i),role:"status","aria-label":n,children:d.jsxs("svg",{width:s,height:s,viewBox:"0 0 50 50",className:Eo.svg,style:t?{color:t}:void 0,"aria-hidden":"true",children:[d.jsx("path",{className:Eo.track,d:E0,fill:"none",pathLength:100,strokeLinecap:"round"}),d.jsx("path",{className:Eo.head,d:E0,fill:"none",pathLength:100,strokeLinecap:"round"})]})})}const T6="skeleton-module__skeleton___HCSvg",R6="skeleton-module__pulse___6eCq1",I6="skeleton-module__svg___OzxGp",A6="skeleton-module__text___v17Nv",M6="skeleton-module__rect___wqIJy",L6="skeleton-module__circle___RCmyR",ph={skeleton:T6,pulse:R6,svg:I6,text:A6,rect:M6,circle:L6},T0={text:[0,0,200,24],rect:[0,0,200,100],circle:[0,0,40,40]},Zi=2;function Jt({variant:e="text",width:t,height:n,surface:r="paper",className:i,style:s}){const o=r==="chalkboard",a=Math.max(1,Math.round(Wu()*1e6)),l=o?ct(pe.chalkboardBorderBase,.16):ct(pe.textPrimary,.09),u=S.useMemo(()=>{const[,,c,h]=T0[e],f=e==="circle"?Xe.ellipse(c/2,h/2,c-Zi*2,h-Zi*2,{seed:a,roughness:1.5,fill:l,fillStyle:"solid",stroke:l,strokeWidth:1}):Xe.rectangle(Zi,Zi,c-Zi*2,h-Zi*2,{seed:a,roughness:1.4,fill:l,fillStyle:"solid",stroke:l,strokeWidth:1});return Xe.toPaths(f)},[e,a,l]);return d.jsx("span",{className:Z(ph.skeleton,ph[e],i),style:{width:t,height:n,...s},"aria-hidden":"true",children:d.jsx("svg",{className:ph.svg,viewBox:T0[e].join(" "),preserveAspectRatio:"none","aria-hidden":"true",children:u.map((c,h)=>d.jsx("path",{d:c.d,stroke:c.stroke,strokeWidth:c.strokeWidth,fill:c.fill},h))})})}const D6="divider-module__horizontal___tP3rG",N6="divider-module__line___KnBes",z6="divider-module__label___WiUwZ",O6="divider-module__vertical___wBSrT",F6="divider-module__chalkboard___gXTde",es={horizontal:D6,line:N6,label:z6,vertical:O6,chalkboard:F6};function R0({orientation:e="horizontal",label:t,surface:n="paper",className:r}){const i=n==="chalkboard"&&es.chalkboard;return e==="vertical"?d.jsx("span",{className:Z(es.vertical,i,r),role:"separator","aria-orientation":"vertical"}):d.jsxs("div",{className:Z(es.horizontal,i,r),role:"separator",children:[d.jsx("span",{className:es.line}),t!=null&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:es.label,children:t}),d.jsx("span",{className:es.line})]})]})}const $6="tooltip-module__wrapper___XeVNe",B6="tooltip-module__tooltip___e-rkz",V6="tooltip-module__tooltipIn___CZbRw",W6="tooltip-module__top___78WWU",U6="tooltip-module__bottom___Irl3O",H6="tooltip-module__left___C1Ec4",G6="tooltip-module__right___oUA-Z",K6="tooltip-module__chalkboard___Um6dx",El={wrapper:$6,tooltip:B6,tooltipIn:V6,top:W6,bottom:U6,left:H6,right:G6,chalkboard:K6},Tl=8,Rl=8,Y6=typeof window>"u"?S.useEffect:S.useLayoutEffect;function Q6(e,t,n){let r,i;switch(t){case"bottom":r=e.bottom+Tl,i=e.left+e.width/2-n.width/2;break;case"left":r=e.top+e.height/2-n.height/2,i=e.left-Tl-n.width;break;case"right":r=e.top+e.height/2-n.height/2,i=e.right+Tl;break;default:r=e.top-Tl-n.height,i=e.left+e.width/2-n.width/2}return i=Math.min(Math.max(i,Rl),window.innerWidth-n.width-Rl),r=Math.min(Math.max(r,Rl),window.innerHeight-n.height-Rl),{top:r,left:i}}function me({content:e,children:t,placement:n="top",delay:r=300,disabled:i=!1,surface:s="paper"}){const o=S.useId(),[a,l]=S.useState(!1),[u,c]=S.useState(!1),[h,f]=S.useState(!1),[p,m]=S.useState(null),[x,w]=S.useState(null),g=S.useRef(null),y=S.useRef(null),v=S.useRef(),k=!i&&!!e&&!h&&(a||u),P=()=>{clearTimeout(v.current),v.current=setTimeout(()=>l(!0),r)},b=()=>{clearTimeout(v.current),l(!1),f(!1)},C=()=>{f(!1),c(!0)},j=()=>{c(!1),f(!1)};Fu(k,()=>f(!0)),S.useEffect(()=>{if(!k){m(null);return}const E=()=>{g.current&&m(g.current.getBoundingClientRect())};return E(),window.addEventListener("scroll",E,{capture:!0,passive:!0}),window.addEventListener("resize",E,{passive:!0}),()=>{window.removeEventListener("scroll",E,{capture:!0}),window.removeEventListener("resize",E)}},[k]),Y6(()=>{if(!k){w(null);return}const E=y.current;E&&w({width:E.offsetWidth,height:E.offsetHeight})},[k,e,n]),S.useEffect(()=>()=>clearTimeout(v.current),[]);const T=t.props;return d.jsxs("span",{ref:g,className:El.wrapper,onMouseEnter:P,onMouseLeave:b,onFocus:C,onBlur:j,children:[S.cloneElement(t,{"aria-describedby":k?o:T["aria-describedby"]}),k&&p&&typeof document<"u"&&$i.createPortal(d.jsx("span",{ref:y,id:o,role:"tooltip",className:Z(El.tooltip,El[n],s==="chalkboard"&&El.chalkboard),style:x?{position:"fixed",...Q6(p,n,x)}:{position:"fixed",top:0,left:0,visibility:"hidden"},children:e}),document.body)]})}const q6="toast-module__stack___hDi0s",X6="toast-module__topLeft___Luw-F",J6="toast-module__topCenter___N1DwF",Z6="toast-module__topRight___Dtgau",e8="toast-module__bottomLeft___Eb2lo",t8="toast-module__bottomCenter___gs-Yb",n8="toast-module__bottomRight___-0e2j",r8="toast-module__item___RFjtm",i8="toast-module__toastIn___9m9iN",s8="toast-module__card___ZCvJS",o8="toast-module__surface___mfMl0",a8="toast-module__iconWrapper___lnjcC",l8="toast-module__content___AlliM",c8="toast-module__title___1Oqh8",u8="toast-module__description___eiUSB",d8="toast-module__dismiss___tUGx4",h8="toast-module__info___Nh8S9",f8="toast-module__success___hlKLc",p8="toast-module__warning___XUMJt",m8="toast-module__error___pSFFC",g8="toast-module__chalkboard___c49gt",Zt={stack:q6,topLeft:X6,topCenter:J6,topRight:Z6,bottomLeft:e8,bottomCenter:t8,bottomRight:n8,item:r8,toastIn:i8,card:s8,surface:o8,iconWrapper:a8,content:l8,title:c8,description:u8,dismiss:d8,info:h8,success:f8,warning:p8,error:m8,chalkboard:g8};function y8({record:e,surface:t="paper",onDismiss:n}){const r=S.useRef(e.duration),i=S.useRef(0),s=S.useRef(),o=S.useCallback(h=>{clearTimeout(s.current),!(h<=0)&&(i.current=Date.now(),s.current=setTimeout(()=>n(e.id),h))},[n,e.id]);S.useEffect(()=>(o(e.duration),()=>clearTimeout(s.current)),[o,e.duration]);const a=()=>{s.current&&(clearTimeout(s.current),r.current-=Date.now()-i.current)},l=()=>o(r.current),u=t==="chalkboard",c=e.variant==="warning"||e.variant==="error"?"alert":"status";return d.jsx("div",{className:Zt.item,onMouseEnter:a,onMouseLeave:l,children:d.jsxs("div",{className:Z(Zt.card,Zt[e.variant],u&&Zt.chalkboard),role:c,children:[d.jsx(At,{clip:!0,...Mt.surface}),d.jsx("div",{className:Zt.surface,style:u?void 0:Wi("kraft")}),d.jsx("span",{className:Zt.iconWrapper,children:d.jsx(D_,{variant:e.variant})}),d.jsxs("div",{className:Zt.content,children:[e.title&&d.jsx("div",{className:Zt.title,children:e.title}),d.jsx("div",{className:Zt.description,children:e.description})]}),d.jsx("button",{type:"button",className:Zt.dismiss,onClick:()=>n(e.id),"aria-label":"Dismiss notification",children:d.jsx(Fa,{size:16})})]})})}const z_=S.createContext(null);function x8(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function v8({children:e,position:t="bottom-right",surface:n="paper",defaultDuration:r=5e3}){const[i,s]=S.useState([]),o=S.useRef(0),a=S.useCallback(c=>{s(h=>h.filter(f=>f.id!==c))},[]),l=S.useCallback(c=>{o.current+=1;const h=`toast-${o.current}`;return s(f=>[...f,{id:h,title:c.title,description:c.description,variant:c.variant??"info",duration:c.duration??r}]),h},[r]),u=t.startsWith("top")?[...i].reverse():i;return d.jsxs(z_.Provider,{value:{toast:l,dismiss:a},children:[e,typeof document<"u"&&$i.createPortal(d.jsx("div",{className:Z(Zt.stack,Zt[x8(t)]),role:"region","aria-label":"Notifications",children:u.map(c=>d.jsx(y8,{record:c,surface:n,onDismiss:a},c.id))}),document.body)]})}function Me(){const e=S.useContext(z_);if(!e)throw new Error("useToast must be used within a <ToastProvider>");return e}const w8="breadcrumb-module__breadcrumb___r-ILp",b8="breadcrumb-module__list___V3YFy",k8="breadcrumb-module__item___dDwYf",S8="breadcrumb-module__link___CHC9k",_8="breadcrumb-module__linkButton___XoMW-",C8="breadcrumb-module__current___dprI9",j8="breadcrumb-module__separator___uLhtn",P8="breadcrumb-module__chalkboard___COJpw",In={breadcrumb:w8,list:b8,item:k8,link:S8,linkButton:_8,current:C8,static:"breadcrumb-module__static___affaf",separator:j8,chalkboard:P8};function I0({items:e,surface:t="paper",className:n}){return d.jsx("nav",{"aria-label":"Breadcrumb",className:Z(In.breadcrumb,t==="chalkboard"&&In.chalkboard,n),children:d.jsx("ol",{className:In.list,children:e.map((r,i)=>{const s=i===e.length-1;return d.jsxs("li",{className:In.item,children:[s?d.jsx("span",{className:In.current,"aria-current":"page",children:r.label}):r.href?d.jsx("a",{href:r.href,className:In.link,onClick:r.onClick,children:r.label}):r.onClick?d.jsx("button",{type:"button",className:Z(In.link,In.linkButton),onClick:r.onClick,children:r.label}):d.jsx("span",{className:In.static,children:r.label}),!s&&d.jsx(E8,{className:In.separator})]},r.id)})})})}function E8({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 T8="menu-module__wrapper___WCtoy",R8="menu-module__menu___i40Wj",I8="menu-module__surface___SJbaB",A8="menu-module__list___YjCfD",M8="menu-module__item___aqcgg",L8="menu-module__icon___1qUvA",D8="menu-module__label___MtQMh",N8="menu-module__danger___p9oZo",z8="menu-module__itemDisabled___HByLP",O8="menu-module__separator___g2uay",F8="menu-module__chalkboard___5jIwI",mn={wrapper:T8,menu:R8,surface:I8,list:A8,item:M8,icon:L8,label:D8,danger:N8,itemDisabled:z8,separator:O8,chalkboard:F8},$8=6;function B8(e){return"type"in e&&e.type==="separator"}function V8({trigger:e,items:t,align:n="start",surface:r="paper",className:i}){const s=S.useId(),[o,a]=S.useState(!1),[l,u]=S.useState(null),c=S.useRef(null),h=S.useRef(null),f=S.useCallback(()=>{var g,y;(y=(g=c.current)==null?void 0:g.querySelector("button, a, [tabindex]"))==null||y.focus()},[]),p=S.useCallback(()=>a(!1),[]);Fu(o,()=>{p(),f()}),S.useEffect(()=>{if(!o)return;const g=y=>{var v,k;const P=y.target;(v=c.current)!=null&&v.contains(P)||(k=h.current)!=null&&k.contains(P)||p()};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[o,p]),S.useEffect(()=>{if(!o){u(null);return}const g=()=>{c.current&&u(c.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]),S.useEffect(()=>{var g,y;!o||!l||(y=(g=h.current)==null?void 0:g.querySelector('[role="menuitem"]:not(:disabled)'))==null||y.focus()},[o,l]);const m=g=>{var y,v,k,P,b;const C=Array.from(((y=h.current)==null?void 0:y.querySelectorAll('[role="menuitem"]:not(:disabled)'))??[]);if(C.length===0)return;const j=C.indexOf(document.activeElement);switch(g.key){case"ArrowDown":g.preventDefault(),(v=C[(j+1)%C.length])==null||v.focus();break;case"ArrowUp":g.preventDefault(),(k=C[(j-1+C.length)%C.length])==null||k.focus();break;case"Home":g.preventDefault(),(P=C[0])==null||P.focus();break;case"End":g.preventDefault(),(b=C[C.length-1])==null||b.focus();break;case"Tab":p();break}},x=g=>{var y;g.disabled||(p(),f(),(y=g.onSelect)==null||y.call(g))},w=e.props;return d.jsxs("span",{ref:c,className:mn.wrapper,children:[S.cloneElement(e,{"aria-haspopup":"menu","aria-expanded":o,onClick:g=>{var y;(y=w.onClick)==null||y.call(w,g),a(v=>!v)}}),o&&l&&typeof document<"u"&&$i.createPortal(d.jsxs("div",{ref:h,id:s,role:"menu",className:Z(mn.menu,r==="chalkboard"&&mn.chalkboard,i),style:{position:"fixed",top:l.bottom+$8,minWidth:l.width,...n==="end"?{right:window.innerWidth-l.right}:{left:l.left}},onKeyDown:m,children:[d.jsx(At,{clip:!0,...Mt.surface}),d.jsx("div",{className:mn.surface}),d.jsx("div",{className:mn.list,children:t.map(g=>B8(g)?d.jsx("div",{role:"separator",className:mn.separator},g.id):d.jsxs("button",{type:"button",role:"menuitem",tabIndex:-1,disabled:g.disabled,className:Z(mn.item,g.danger&&mn.danger,g.disabled&&mn.itemDisabled),onClick:()=>x(g),children:[g.icon&&d.jsx("span",{className:mn.icon,children:g.icon}),d.jsx("span",{className:mn.label,children:g.label})]},g.id))})]}),document.body)]})}function Rt(e){const t=e.split(`
|
|
79
|
-
`).map(r=>r.trim()).filter(Boolean);return t.find(r=>r.startsWith("!")||r.startsWith("error:")||r.startsWith("fatal:"))??t.at(-1)??e}const Il=ie.deskBg,A0=ie.deskLight,W8=ie.deskText,Dn=ie.deskTextMuted,U8=ie.deskBorder,sr=ie.deskChalk,M0=`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")`,lg={fontFamily:je.serif,fontSize:J.base,fontWeight:600,color:Dn,marginBottom:R[3]},Tr={pass:"#2d5a3b",fail:"#5a2d2d",running:"#5a4a2d"},$n={pass:"#b5d6b5",fail:"#d6a0a0",running:"#d6c4a0"},H8=Rt,G8=["claude auth login","claude setup-token"],K8=()=>d.jsx("div",{onClick:e=>e.stopPropagation(),style:{display:"flex",flexDirection:"column",gap:R[1],marginTop:R[2]},children:G8.map(e=>d.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:R[2]},children:[d.jsx("code",{style:{fontFamily:je.mono,fontSize:J.xs,color:sr},children:e}),d.jsx(su,{text:e,surface:"chalkboard"})]},e))}),ip=3,Y8="2.75rem",Q8=`calc(${ip} * ${Y8} + ${ip-1} * ${R[2]})`,q8=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"run-all":return" — run all phases";default:return""}},X8=({task:e,onStop:t})=>{const n=_n(),{toast:r}=Me(),i=()=>n({to:"/tasks",search:{taskId:e.id}}),s=async l=>{l.stopPropagation();try{await t(e.id)}catch(u){r({title:"Failed to stop agent",description:Rt(u.message),variant:"error"})}},o={starting:Tr.running,running:Tr.running,stopping:Tr.running,done:Tr.pass,error:Tr.fail},a={starting:$n.running,running:$n.running,stopping:$n.running,done:$n.pass,error:$n.fail};return d.jsxs(Pe,{surface:"chalkboard",size:"small",className:"stack-task-card",children:[d.jsxs("div",{role:"button",tabIndex:0,onClick:i,onKeyDown:l=>{l.target===l.currentTarget&&(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),i())},style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:R[2],cursor:"pointer",borderRadius:10},children:[d.jsxs("span",{style:{fontFamily:je.serif,fontWeight:600,fontSize:J.sm,color:sr,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[e.planTitle,q8(e)," · ",wk[e.agentId]]}),d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:R[2]},children:[d.jsx(Be,{surface:"chalkboard",size:"small",fillColor:o[e.status],textColor:a[e.status],children:e.status==="error"&&e.errorKind==="auth"?"not signed in":e.status}),(e.status==="running"||e.status==="starting"||e.status==="stopping")&&d.jsx(st,{icon:d.jsx(Fa,{}),variant:"ghost",size:"small",label:"Stop agent",onClick:s,disabled:e.status==="stopping"})]})]}),e.status==="error"&&e.errorKind==="auth"&&d.jsx(K8,{})]})},J8=()=>{const e=N(r=>r.agentStatus),t=N(r=>r.stopAgent),n=e.slice(0,ip);return d.jsxs("div",{style:{flex:"0 0 auto",display:"flex",flexDirection:"column",padding:R[6]},children:[d.jsx("div",{style:lg,children:"Agent"}),d.jsx("div",{style:{display:"flex",flexDirection:"column",justifyContent:n.length>0?"flex-start":"center",gap:R[2],minHeight:Q8},children:n.length>0?n.map(r=>d.jsx(X8,{task:r,onStop:t},r.id)):d.jsx(Pe,{surface:"chalkboard",size:"small",children:d.jsx("p",{style:{opacity:.5,fontSize:J.xs,margin:0,textAlign:"center"},children:"No agent running."})})})]})};function mh(e,t){const{toast:n}=Me(),r=N(o=>o.activeGitAction),i=N(o=>o.setActiveGitAction),s=S.useCallback(async o=>{if(!N.getState().activeGitAction){i(e);try{await o()}catch(a){n({title:t,description:Rt(a.message),variant:"error"})}finally{i(null)}}},[n,t,e,i]);return[r===e,s]}function cg(){const e=N(x=>x.loadGitStatus),t=N(x=>x.loadPlans),n=N(x=>x.loadIdeas),r=N(x=>x.activeGitAction!==null),{toast:i}=Me(),s=()=>Promise.all([e(),t(),n()]),[o,a]=mh("push","Push failed"),[l,u]=mh("sync","Sync failed"),[c,h]=mh("pull","Pull failed");return{pushing:o,syncing:l,pulling:c,gitActionBusy:r,handlePush:()=>a(async()=>{await UL(),await e()}),handleSync:()=>u(async()=>{const x=await HL();if(!x.ok&&x.recovering){i({title:"Sync needs help",description:"Handed off to a recovery agent — see Stack for progress",variant:"warning"}),await e();return}if(!x.ok)throw new Error(x.message);await s()}),handlePull:()=>h(async()=>{await GL(),await s()})}}const O_=({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"})]}),F_=({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"})]}),$_=({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"})]}),Uu=({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"})]}),Z8=({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"})]}),eW=({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"})]}),tW=({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"})]}),nW=({size:e=12})=>d.jsxs("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round","aria-hidden":"true",children:[d.jsx("circle",{cx:"10",cy:"10",r:"3"}),d.jsx("path",{d:"M2.5 10h4.5M13 10h4.5"})]}),rW=({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"})}),ug=({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",style:{opacity:.55,flexShrink: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"})]}),iW=({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",style:{opacity:.55,flexShrink: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"})]}),L0="papercamp.commitMessage",sW=["core","cli","app","server","agent","plans","ideas","docs","settings","stack","ui","ci","config","deps","repo"];function oW(e){try{return localStorage.getItem(e)??""}catch{return""}}function aW(e,t){try{t?localStorage.setItem(e,t):localStorage.removeItem(e)}catch{}}function lW(e){var o;if(!e||e.phases.length>0&&e.phases.every(a=>a.done))return{title:"",message:""};const t=((o=e.tags)==null?void 0:o.find(a=>sW.includes(a)))??"repo",r=`${e.kind??"feat"}(${t}): ${e.title}`,i=e.id?`Refs: ${e.id}`:"",s=e.phases.length?e.phases.map(a=>`- ${a.text}`).join(`
|
|
80
|
-
`):"";return{title:r,message:[s,i].filter(Boolean).join(`
|
|
81
|
-
|
|
82
|
-
`)}}function cW(e){const[t,n]=S.useState(new Set),r=S.useRef(new Set);S.useEffect(()=>{if(!e)return;const s=r.current;r.current=new Set(e.map(o=>o.path)),n(o=>{const a=new Set;for(const l of e)(!s.has(l.path)||o.has(l.path))&&a.add(l.path);return a})},[e]);const i=S.useCallback(s=>{n(o=>{const a=new Set(o);return a.has(s)?a.delete(s):a.add(s),a})},[]);return{selectedFiles:t,onToggleFile:i}}const uW=({gitStatus:e,expanded:t,onToggleExpanded:n,selectedFiles:r,onToggleFile:i})=>d.jsx("div",{style:{flex:"1 1 auto",minHeight:0,overflowY:"auto"},children:d.jsx(UV,{title:`${e.length} file${e.length===1?"":"s"} changed`,expanded:t,onToggle:n,children:d.jsx("div",{style:{display:"flex",flexDirection:"column",gap:R[2],paddingTop:R[2]},children:e.map(s=>d.jsxs("label",{style:{display:"flex",alignItems:"center",gap:R[2],fontFamily:je.mono,fontSize:J["2xs"],color:sr,cursor:"pointer"},children:[d.jsx("input",{type:"checkbox",checked:r.has(s.path),onChange:()=>i(s.path),style:{accentColor:sr}}),d.jsx("span",{style:{color:s.staged?sr:Dn,minWidth:24},children:s.status}),d.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s.path})]},s.path))})})}),dW=({selectedFiles:e,onCommitted:t})=>{const n=N(T=>T.plans),r=N(T=>T.agentStatus),i=N(T=>T.loadGitStatus),s=N(T=>T.commitInFlight),o=N(T=>T.setCommitInFlight),{toast:a}=Me(),[l,u]=S.useState(""),[c,h]=S.useState(()=>oW(L0)),[f,p]=S.useState(!1),[m,x]=S.useState(!1),[w,g]=S.useState(null),y=S.useMemo(()=>LM(n==null?void 0:n.entries),[n==null?void 0:n.entries]),{title:v,message:k}=S.useMemo(()=>lW(y),[y]);S.useEffect(()=>{v&&!l&&u(v)},[v,l]);const P=S.useRef(null),b=S.useRef(null);S.useEffect(()=>{if(P.current===null){if(r.length===0)return;P.current=new Set(r.filter(E=>E.suggestedCommit).map(E=>E.id))}const T=r.find(E=>{var A;return E.suggestedCommit&&!((A=P.current)!=null&&A.has(E.id))});!(T!=null&&T.suggestedCommit)||b.current===T.id||(b.current=T.id,u(T.suggestedCommit.title),h(T.suggestedCommit.message))},[r]),S.useEffect(()=>{k&&!c&&h(k)},[k,c]),S.useEffect(()=>{aW(L0,c)},[c]);const C=S.useCallback(async()=>{if(!(!l.trim()||s)){p(!0),o(!0);try{await Ik([...e],l.trim(),c.trim()||void 0),u(""),h(""),t(),await i()}catch(T){a({title:"Commit failed",description:H8(T.message),variant:"error"}),await i()}finally{p(!1),o(!1)}}},[l,c,e,i,s,o,t,a]),j=S.useCallback(async()=>{if(e.size!==0){x(!0),g(null);try{const T=await Ak([...e]);u(T.title),h(T.message)}catch(T){g(T.message)}finally{x(!1)}}},[e]);return d.jsxs(d.Fragment,{children:[w&&d.jsx(N_,{surface:"chalkboard",dismissible:!0,onDismiss:()=>g(null),children:w}),d.jsxs("div",{style:{display:"flex",gap:R[2],alignItems:"center"},children:[d.jsx("div",{style:{flex:1},children:d.jsx($a,{surface:"chalkboard",size:"small",placeholder:"Commit title",value:l,onChange:T=>u(T.currentTarget.value)})}),d.jsx(st,{icon:d.jsx(O_,{size:16}),surface:"chalkboard",size:"small",label:"Suggest title and message from the diff",disabled:e.size===0||m,onClick:j,wobble:m?1:0})]}),d.jsx(Gt,{surface:"chalkboard",size:"small",placeholder:"Commit message (optional)",value:c,onChange:T=>h(T.currentTarget.value),rows:2}),d.jsx(q,{surface:"chalkboard",size:"small",fullWidth:!0,disabled:e.size===0||!l.trim()||f||s,onClick:C,children:f||s?"Committing…":"Commit"})]})},hW=()=>{const{syncing:e,gitActionBusy:t,handleSync:n}=cg();return d.jsx(q,{surface:"chalkboard",size:"small",fullWidth:!0,icon:d.jsx(Uu,{size:14}),disabled:t,onClick:n,children:e?"Syncing…":"Branch merged — sync to main"})},fW=({gitAhead:e,gitBranchHygiene:t})=>{const{pushing:n,syncing:r,pulling:i,gitActionBusy:s,handlePush:o,handleSync:a,handlePull:l}=cg();return e>0?d.jsxs(d.Fragment,{children:[d.jsxs("p",{style:{opacity:.5,fontSize:J.xs,margin:0},children:["All changes committed — ",e," commit",e===1?"":"s"," ready to push."]}),d.jsx(q,{surface:"chalkboard",size:"small",icon:d.jsx(F_,{size:14}),disabled:s,onClick:o,children:n?"Pushing…":`Push ${e} commit${e===1?"":"s"}`})]}):d.jsxs(d.Fragment,{children:[d.jsx("p",{style:{opacity:.5,fontSize:J.xs,margin:0},children:"No changed files."}),d.jsxs("div",{style:{display:"flex",gap:R[2],alignItems:"center"},children:[d.jsx(me,{content:t==="clean-on-main"?"Already on clean main":void 0,surface:"chalkboard",children:d.jsx(q,{surface:"chalkboard",size:"small",icon:d.jsx(Uu,{size:14}),disabled:s||t==="clean-on-main",onClick:a,children:r?"Syncing…":"Sync to main"})}),d.jsx(q,{surface:"chalkboard",size:"small",icon:d.jsx($_,{size:14}),disabled:s,onClick:l,children:i?"Pulling…":"Pull"})]})]})},pW=()=>{const e=N(l=>l.gitStatus),t=N(l=>l.gitBranch),n=N(l=>l.gitAhead),r=N(l=>l.gitBranchHygiene),{selectedFiles:i,onToggleFile:s}=cW(e),[o,a]=S.useState(!1);return d.jsxs("div",{style:{flex:"1 1 auto",minHeight:0,display:"flex",flexDirection:"column",padding:R[6]},children:[d.jsxs("div",{style:{...lg,display:"flex",alignItems:"center",gap:R[2]},children:["Commit",t&&d.jsx(Be,{surface:"chalkboard",size:"small",children:t})]}),d.jsx(Pe,{surface:"chalkboard",size:"small",className:"stack-card-fill",children:e&&e.length>0?d.jsxs(d.Fragment,{children:[d.jsx(uW,{gitStatus:e,expanded:o,onToggleExpanded:()=>a(!o),selectedFiles:i,onToggleFile:s}),d.jsx("div",{style:{flexShrink:0,display:"flex",flexDirection:"column",gap:R[3],marginTop:R[3]},children:r==="stale-merged"?d.jsx(hW,{}):d.jsx(dW,{selectedFiles:i,onCommitted:()=>a(!1)})})]}):d.jsx("div",{style:{flex:1,minHeight:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:R[3]},children:d.jsx(fW,{gitAhead:n,gitBranchHygiene:r})})})]})};function D0(e){const t=e.match(/Found (\d+) errors?\./);return t?Number(t[1]):0}function mW(e,t){const n=D0(e)+D0(t);return n>0?`${n} lint/format issue${n===1?"":"s"} found.`:"Lint or format check failed."}function gW(e){const t=e.match(/Tests\s+(\d+) failed/);return t?`${t[1]} test${t[1]==="1"?"":"s"} failed.`:"Tests failed."}const B_=({decision:e,onClose:t})=>{const n=N(w=>w.supersedeDecision),[r,i]=S.useState(!1),[s,o]=S.useState(""),[a,l]=S.useState(""),[u,c]=S.useState(!1),[h,f]=S.useState(null),{toast:p}=Me();S.useEffect(()=>{e&&(i(!1),o(""),l(""),c(!1),f(null))},[e]);const m=()=>{p({title:"Decision stands",variant:"success"}),t()},x=async()=>{if(!(!e||!s.trim())){c(!0),f(null);try{await n(e.title,s.trim(),a.trim()),p({title:"Decision superseded",variant:"success"}),t()}catch(w){f(w.message)}finally{c(!1)}}};return d.jsx(hr,{open:e!==null,onClose:t,title:(e==null?void 0:e.title)??"",size:"small",children:d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:R[4]},children:[d.jsxs("div",{style:{display:"flex",gap:R[2],alignItems:"center"},children:[d.jsx(Be,{size:"small",variant:(e==null?void 0:e.status)==="superseded"?"warning":"success",children:(e==null?void 0:e.status)??""}),d.jsx("span",{style:{fontFamily:je.mono,fontSize:J.sm,opacity:.7},children:e==null?void 0:e.date})]}),(e==null?void 0:e.supersededBy)&&d.jsxs("p",{style:{margin:0,fontSize:J.sm,opacity:.8},children:['Superseded by "',e.supersededBy,'"']}),d.jsx(ka,{children:(e==null?void 0:e.body)??""}),(e==null?void 0:e.status)==="decided"&&(r?d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:R[3]},children:[d.jsx(Gt,{value:s,onChange:w=>o(w.target.value),placeholder:"New decision — what supersedes this?",rows:2,disabled:u}),d.jsx(Gt,{value:a,onChange:w=>l(w.target.value),placeholder:"Rationale (optional)",rows:3,disabled:u}),h&&d.jsx("p",{style:{margin:0,color:ie.accentRoseDark,fontSize:J.sm},children:h}),d.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:R[2]},children:[d.jsx(q,{type:"button",variant:"ghost",onClick:()=>i(!1),disabled:u,children:"Back"}),d.jsx(q,{type:"button",variant:"primary",onClick:x,disabled:u||!s.trim(),children:u?"Superseding…":"Supersede"})]})]}):d.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:R[2]},children:[d.jsx(q,{type:"button",variant:"ghost",onClick:()=>i(!0),children:"Supersede…"}),d.jsx(q,{type:"button",variant:"primary",onClick:m,children:"Honour"})]}))]})})},yW=()=>{const e=N(v=>v.status),t=N(v=>v.runCheck),n=N(v=>v.fixQuality),r=N(v=>v.consistency),i=N(v=>v.plans),s=N(v=>v.decisions),o=_n(),[a,l]=S.useState(!1),[u,c]=S.useState(null),{qualityStatus:h,testStatus:f,consistencyStatus:p}=S.useMemo(()=>Mk(e),[e]),m=h==="running"||f==="running"||p==="running",x=r.length>0,w=S.useCallback(v=>(v.kind==="blocked-plan-active"||v.kind==="orphan-subject")&&v.planId?i==null?void 0:i.entries.find(k=>k.id===v.planId):void 0,[i==null?void 0:i.entries]),g=S.useCallback(v=>v.kind==="dangling-superseded-by"?s.find(k=>k.title===v.title):void 0,[s]),y=S.useCallback(v=>{const k=w(v);if(k){o({to:"/plans/$planId",params:{planId:encodeURIComponent(k.title)}});return}const P=g(v);P&&c(P)},[w,g,o]);return d.jsxs("div",{style:{flex:"0 0 auto",display:"flex",flexDirection:"column",padding:R[6]},children:[d.jsx("div",{style:lg,children:"Status"}),d.jsx(Pe,{surface:"chalkboard",size:"small",className:"stack-card-fill",children:(()=>{var T,E,A;const v={...Tr,stale:"transparent"},k={...$n,stale:void 0},P=m,b=x;`${((T=e==null?void 0:e.lint)==null?void 0:T.output)||"(none)"}${((E=e==null?void 0:e.format)==null?void 0:E.output)||"(none)"}`;const C=`Fix the failing tests in this repo. Output from the last test run:
|
|
83
|
-
|
|
84
|
-
${((A=e==null?void 0:e.test)==null?void 0:A.output)||"(no output captured)"}`,j=M=>d.jsx(me,{content:M.title,surface:"chalkboard",children:d.jsx("button",{type:"button",className:"stack-check-btn",onClick:()=>{P||M.onClick()},disabled:P,style:{cursor:P?"not-allowed":"pointer",opacity:P&&M.status!=="running"?.5:1,display:"inline-flex",background:"none",border:"none",padding:0},children:d.jsxs(Be,{surface:"chalkboard",size:"small",fillColor:v[M.status],textColor:k[M.status],children:[M.label,d.jsx("span",{style:{visibility:M.status==="running"?"visible":"hidden"},children:"…"})]})})});return d.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center",gap:R[3]},children:[d.jsxs("div",{style:{display:"flex",gap:R[2],flexWrap:"wrap",justifyContent:"center"},children:[j({label:"Quality",status:h,title:"Run lint and format checks",onClick:()=>{t("lint"),t("format")}}),j({label:"Tests",status:f,title:"Run tests",onClick:()=>t("test")}),j({label:"Consistency",status:p,title:"Run codebase consistency (knip + dependency-cruiser)",onClick:()=>t("consistency")}),d.jsxs("div",{children:[d.jsx(me,{content:b?"Show plan/decision doc findings":"No plan/decision doc findings",surface:"chalkboard",children:d.jsx("button",{type:"button",className:b?"stack-check-btn":void 0,onClick:()=>{b&&l(M=>!M)},style:{cursor:b?"pointer":"default",display:"inline-flex",background:"none",border:"none",padding:0},children:d.jsx(Be,{surface:"chalkboard",size:"small",fillColor:b?Tr.fail:Tr.pass,textColor:b?$n.fail:$n.pass,children:"Docs"})})}),a&&b&&d.jsx("div",{style:{marginTop:R[2],display:"flex",flexDirection:"column",gap:R[2]},children:r.map((M,F)=>d.jsx("div",{style:{fontFamily:je.mono,fontSize:J["2xs"],color:Dn},children:w(M)||g(M)?d.jsx("button",{type:"button",onClick:()=>y(M),style:{background:"none",border:"none",padding:0,color:sr,textDecoration:"underline",cursor:"pointer",font:"inherit",textAlign:"left"},children:M.message}):d.jsx("span",{style:{textAlign:"left"},children:M.message})},`${M.kind}-${M.title}-${F}`))})]})]}),(()=>{var D,L,$;let M,F=null;return P?M=d.jsx("span",{style:{color:Dn},children:"Running checks…"}):h==="fail"?(M=d.jsx("span",{style:{color:Dn},children:mW(((D=e==null?void 0:e.lint)==null?void 0:D.output)??"",((L=e==null?void 0:e.format)==null?void 0:L.output)??"")}),F=d.jsx("button",{type:"button",onClick:n,style:{background:"none",border:"none",padding:0,color:sr,textDecoration:"underline",cursor:"pointer",font:"inherit"},children:"Suggested fix: run biome --write"})):f==="fail"?(M=d.jsx("span",{style:{color:Dn},children:gW((($=e==null?void 0:e.test)==null?void 0:$.output)??"")}),F=d.jsxs("span",{style:{color:sr},children:["Suggested fix: ",d.jsx(su,{text:C,surface:"chalkboard"})]})):p==="fail"?(M=d.jsx("span",{style:{color:Dn},children:"Codebase consistency failed (knip / dependency-cruiser)."}),F=d.jsx("span",{style:{color:Dn,opacity:.8},children:"Run pnpm run consistency for details."})):x?M=d.jsx("span",{style:{color:Dn},children:"Plan/decision doc issues — see the Docs stamp."}):h==="pass"&&f==="pass"&&p==="pass"?M=d.jsx("span",{style:{color:$n.pass},children:"All checks passing."}):M=d.jsx("span",{style:{color:Dn,opacity:.6},children:"Checks haven't run yet."}),d.jsxs("div",{style:{textAlign:"center",display:"flex",flexDirection:"column",gap:R[1],fontFamily:je.handwritten,fontSize:J.sm},children:[M,d.jsx("span",{style:{visibility:F?"visible":"hidden"},children:F??" "})]})})()]})})()}),d.jsx(B_,{decision:u,onClose:()=>c(null)})]})},xW=({open:e,onToggle:t,pinned:n=!1})=>{const r=e||n,i=N(C=>C.loadPlans),s=N(C=>C.status),o=N(C=>C.loadStatus),a=N(C=>C.consistency),l=N(C=>C.loadConsistency),u=N(C=>C.loadDecisions),c=N(C=>C.loadGitStatus),h=N(C=>C.agentStatus),f=N(C=>C.loadAgentStatus),p=N(C=>C.loadSuggestions),m=N(C=>C.loadArchivableIdeas),x=Ou(),w=S.useRef({loadPlans:i,loadStatus:o,loadConsistency:l,loadDecisions:u,loadGitStatus:c,loadAgentStatus:f,loadSuggestions:p,loadArchivableIdeas:m});S.useEffect(()=>{w.current={loadPlans:i,loadStatus:o,loadConsistency:l,loadDecisions:u,loadGitStatus:c,loadAgentStatus:f,loadSuggestions:p,loadArchivableIdeas:m}}),S.useEffect(()=>{w.current.loadStatus(),w.current.loadConsistency(),w.current.loadDecisions(),w.current.loadGitStatus(),w.current.loadAgentStatus(),w.current.loadArchivableIdeas()},[]),S.useEffect(()=>{const C=new EventSource("/api/activity/stream"),j={},T=(E,A,M)=>{j[E]&&clearTimeout(j[E]),j[E]=setTimeout(A,M)};return C.onmessage=E=>{const A=JSON.parse(E.data);if(A.type==="status"){T("status",()=>w.current.loadStatus(),80);return}if(A.type==="agent"){T("agent",()=>w.current.loadAgentStatus(),120);return}A.message==="changed"&&T("activity",()=>{w.current.loadPlans(),w.current.loadSuggestions(),w.current.loadStatus(),w.current.loadConsistency(),w.current.loadDecisions(),w.current.loadGitStatus(),w.current.loadAgentStatus(),w.current.loadArchivableIdeas()},250)},()=>{for(const E of Object.values(j))E&&clearTimeout(E);C.close()}},[]);const{qualityStatus:g,testStatus:y,consistencyStatus:v}=S.useMemo(()=>Mk(s),[s]),k=a.length>0,P=g==="fail"||y==="fail"||v==="fail"||k,b=h.some(C=>C.status==="running"||C.status==="starting"||C.status==="stopping");return d.jsxs(d.Fragment,{children:[d.jsx(v_,{children:!r&&d.jsx(Vs.div,{initial:x?void 0:{opacity:0,x:20},animate:{opacity:1,x:0},exit:x?void 0:{opacity:0,x:20},transition:{duration:x?0:.2,ease:"easeOut"},style:{position:"fixed",right:0,top:"var(--pc-stack-toggle-top, 50%)",transform:"translateY(-50%)",zIndex:300,borderRadius:"6px 0 0 6px",background:Il,backgroundImage:`${M0}, linear-gradient(135deg, ${A0} 0%, ${Il} 60%)`,backgroundRepeat:"repeat, no-repeat",backgroundSize:"200px 200px, auto",boxShadow:"-2px 0 8px rgba(0,0,0,0.15)"},children:d.jsx(st,{icon:b?d.jsx(Ws,{size:"small",surface:"chalkboard",label:"Agent running"}):P?d.jsx("span",{"aria-hidden":"true",style:{width:8,height:8,borderRadius:"50%",background:$n.fail,boxShadow:"0 0 6px rgba(214, 160, 160, 0.9)"}}):d.jsx("span",{style:{fontSize:J["2xs"]},children:"S"}),surface:"chalkboard",size:"small",label:b?"Open stack panel — agent running":P?"Open stack panel — checks failing":"Open stack panel",onClick:t,style:{width:28,height:64,borderRadius:"6px 0 0 6px",boxShadow:b?"inset 0 0 0 1px rgba(214, 196, 160, 0.6)":P?"inset 0 0 0 1px rgba(214, 160, 160, 0.6)":void 0}})})}),d.jsxs(Vs.div,{animate:{x:r?0:"100%"},transition:{duration:x?0:.3,ease:[.4,0,.2,1]},style:{position:"fixed",top:0,right:0,bottom:0,width:`min(${Db.stackPanelWidth}px, 100vw)`,borderLeft:"4px solid rgba(61, 53, 43, 0.12)",backgroundColor:Il,backgroundImage:`${M0}, linear-gradient(135deg, ${A0} 0%, ${Il} 60%)`,backgroundRepeat:"repeat, no-repeat",backgroundSize:"200px 200px, auto",color:W8,display:"flex",flexDirection:"column",overflow:"hidden",zIndex:300},children:[d.jsxs("div",{style:{height:80,padding:`0 ${R[6]}`,display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0},children:[d.jsx("span",{style:{fontFamily:je.serif,fontSize:J.base,fontWeight:700,color:sr},children:"Stack"}),!n&&d.jsx(st,{icon:d.jsx("span",{style:{fontSize:J.sm,lineHeight:1},children:"×"}),surface:"chalkboard",size:"small",label:"Close stack panel",onClick:t,style:{width:28,height:28,border:`1px solid ${U8}`}})]}),d.jsx(R0,{surface:"chalkboard"}),d.jsxs("div",{style:{flex:1,minHeight:0,display:"flex",flexDirection:"column",fontFamily:je.body},children:[d.jsx(J8,{}),d.jsx(R0,{surface:"chalkboard"}),d.jsx(yW,{}),d.jsx(pW,{})]})]})]})},vW=e=>e.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,t=>t.toUpperCase()),wW=()=>{const[e,t]=S.useState(null),[n,r]=S.useState(null),[i,s]=S.useState(!0);return S.useEffect(()=>{let o=!1;return s(!0),Promise.all([nL().then(a=>{!o&&a&&t(vW(a))}),tL().then(a=>{o||r(a)})]).finally(()=>{o||s(!1)}),()=>{o=!0}},[]),{projectName:e,iconDataUri:n,loading:i}},bW=["repo-docs"],kW=["subjects","setup","merge-policy"];function dg(){const{planId:e}=Ks({strict:!1});return typeof e=="string"?decodeURIComponent(e):null}function SW(){const{ideaId:e}=Ks({strict:!1});return typeof e=="string"?decodeURIComponent(e):null}function _W(){const{section:e}=Ks({strict:!1});return bW.includes(e)?e:null}function C9(){const{section:e}=Ks({strict:!1});return kW.includes(e)?e:null}function j9(){const e=_W(),t=N(r=>r.activeDocTitle),n=N(r=>r.repoDocs);return e??(t&&n.some(r=>r.name===t)?"repo-docs":null)}const CW=250;function V_(e,t,n={}){const{debounceMs:r=CW,...i}=n,[s,o]=S.useState(e);S.useEffect(()=>{const u=setTimeout(()=>o(e),r);return()=>clearTimeout(u)},[e,r]);const{threshold:a,limit:l}=i;return S.useMemo(()=>qM(s,t,{threshold:a,limit:l}),[s,t,a,l])}const W_=()=>{const[e,t]=S.useState([]),[n,r]=S.useState(!0),[i,s]=S.useState(!0);return S.useEffect(()=>{let o=!1;return Ck().then(a=>{o||(t((a==null?void 0:a.subjects)??[]),s(a!==null),r(!1))}),()=>{o=!0}},[]),{subjects:e,loading:n,available:i}},jW=({size:e="md"})=>{const{projectName:t,iconDataUri:n,loading:r}=wW(),i=e==="sm"?18:20,s=e==="sm"?J.sm:J.md;return d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:R[3],minWidth:0},children:[n?d.jsx("img",{src:n,alt:"",style:{width:i,height:i,objectFit:"contain",flexShrink:0}}):d.jsx(e6,{icon:d.jsx(r4,{}),size:"small"}),d.jsx("span",{style:{fontFamily:je.serif,fontWeight:600,fontSize:s,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",minWidth:0},children:r?"Loading…":t??"Paper Camp"})]})},PW=()=>{const[e,t]=S.useState(null);return S.useEffect(()=>{},[]),e?d.jsxs("div",{role:"alert",style:{background:ie.accentRoseDark,color:ie.deskText,padding:`${R[2]} ${R[4]}`,fontSize:J["2xs"],fontFamily:je.mono,flexShrink:0},children:["Server failed to reload — restart `pnpm dev` to pick up the change. ",e]}):null};function U_(e,t=0){return e?{duration:0,ease:"easeOut"}:{duration:.18,ease:"easeOut",delay:t}}function H_(e,t={y:8}){return{initial:e?void 0:{opacity:0,...t},animate:{opacity:1,x:0,y:0}}}const EW=({routeKey:e,children:t,mobileOpen:n,onMobileClose:r})=>{const i=Ou(),s=S.useRef(null);return S.useEffect(()=>{if(!n)return;const o=a=>{a.key==="Escape"&&r()};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[n,r]),S.useEffect(()=>{var a;if(!n)return;const o=document.activeElement;return(a=s.current)==null||a.focus(),()=>{var l;return(l=o==null?void 0:o.focus)==null?void 0:l.call(o)}},[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",style:{background:"rgba(26, 25, 23, 0.4)",backdropFilter:"blur(4px)"},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] transition-transform duration-300 ease-out lg:sticky lg:inset-auto lg:top-0 lg:z-auto lg:translate-x-0 ${n?"translate-x-0":"-translate-x-full"}`,style:{width:Db.sidebarWidth,flexShrink:0,height:"var(--pc-sidebar-h, 100%)",display:"flex",flexDirection:"column",background:n?"var(--pui-bg-base)":"transparent",boxShadow:n?"2px 0 12px rgba(0,0,0,0.15)":void 0,overflow:"hidden"},children:d.jsx("div",{style:{flex:1,overflowY:"auto",paddingTop:R[5],position:"relative"},children:d.jsx(Vs.div,{...H_(i,{x:-8}),transition:U_(i,.08),children:t},e)})})]})},Al={fontSize:J["2xs"]},TW=()=>{const e=N(C=>C.agentStatus),t=N(C=>C.gitStatus),n=N(C=>C.gitBranch),r=N(C=>C.gitAhead),i=N(C=>C.gitBranchHygiene),s=N(C=>C.quickCommit),o=N(C=>C.commitInFlight),a=N(eD),l=N(tD),u=N(nD),{pushing:c,syncing:h,pulling:f,gitActionBusy:p,handlePush:m,handleSync:x,handlePull:w}=cg(),{toast:g}=Me(),y=_n(),v=e.find(C=>C.status==="running"||C.status==="starting"||C.status==="stopping"),k=v!==void 0,P=(t==null?void 0:t.length)??0,b=async()=>{if(o||P===0)return;const C=await s();C.ok?g({title:"Committed",description:C.warning??C.title,variant:C.warning?"warning":"success"}):g({title:"Commit failed",description:C.error,variant:"error"})};return d.jsxs("div",{style:{...$u("kraft"),display:"flex",alignItems:"center",gap:R[3],height:"32px",padding:`0 ${R[4]}`,borderBottom:"1px solid rgba(0,0,0,0.08)",fontSize:J["2xs"],flexShrink:0,boxSizing:"border-box",overflowX:"auto",overflowY:"hidden",whiteSpace:"nowrap"},children:[d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:R[3],flexShrink:0},children:[d.jsxs("span",{style:{display:"flex",alignItems:"center",gap:R[1]},children:[d.jsx("span",{style:{opacity:.5},children:"⌥"}),d.jsx("code",{style:{color:ie.textPrimary},children:n??"no branch"})]}),r>0&&d.jsxs("span",{style:{opacity:.6},children:["↑",r]}),d.jsx("span",{style:{opacity:.6},children:P>0?`${P} changed`:"clean"}),k&&d.jsx(Ws,{size:"small",label:`Agent ${v==null?void 0:v.status}…`}),u&&d.jsx(me,{content:"Run `claude auth login` (or `claude setup-token`) so agent tasks can run",children:d.jsx(Be,{size:"small",variant:"warning",children:"Agent not signed in"})}),l>0&&d.jsx(me,{content:"Unresolved questions in papercamp/open-questions.md",children:d.jsxs(Be,{size:"small",variant:"warning",children:["Open questions (",l,")"]})}),a>0&&d.jsx(me,{content:"Some features are disabled — open Setup to fix",children:d.jsx("button",{type:"button",onClick:()=>y({to:"/settings/$section",params:{section:"setup"}}),style:{background:"none",border:"none",padding:0,cursor:"pointer"},children:d.jsxs(Be,{size:"small",variant:"warning",children:["Setup (",a,")"]})})})]}),d.jsx("div",{style:{flex:1}}),d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:R[2],flexShrink:0},children:[d.jsx(me,{content:i==="clean-on-main"?"Already on clean main":"Sync to main",children:d.jsx(q,{variant:"ghost",size:"small",icon:d.jsx(Uu,{}),style:Al,disabled:p||i==="clean-on-main",onClick:x,children:h?"Syncing…":"Sync to main"})}),d.jsx(me,{content:"Push commits to origin",children:d.jsx(q,{variant:"ghost",size:"small",icon:d.jsx(F_,{}),style:Al,disabled:p||r===0,onClick:m,children:c?"Pushing…":r>0?`Push (${r})`:"Push"})}),d.jsx(me,{content:"Fast-forward the current branch from origin",children:d.jsx(q,{variant:"ghost",size:"small",icon:d.jsx($_,{}),style:Al,disabled:p,onClick:w,children:f?"Pulling…":"Pull"})}),d.jsx(me,{content:"Commit all changes with an auto-suggested message",children:d.jsx(q,{variant:"ghost",size:"small",icon:d.jsx(nW,{}),style:Al,disabled:o||P===0,onClick:b,children:o?"Committing…":P>0?`Commit (${P})`:"Commit"})})]})]})},RW=({children:e})=>d.jsx("h1",{className:"text-4xl",style:{fontFamily:je.serif,fontWeight:600,color:ie.textPrimary,margin:`0 0 ${R[6]}`,lineHeight:1.1},children:e}),ro=()=>{const e=N(s=>s.loadPlans),{toast:t}=Me(),[n,r]=S.useState(!1);return{patch:async(s,o,a)=>{r(!0);try{return await VL(s,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}},IW=e=>{const{toast:t}=Me(),{patch:n}=ro(),[r,i]=S.useState(!1),[s,o]=S.useState(null),[a,l]=S.useState(null),u=S.useRef(new Set);return{launching:r,result:s,outcome:a,launch:async()=>{const p=e.review??[];if(!(!e.id||p.length===0)){i(!0),l(null),u.current=new Set;try{o(await kL(e.id))}catch(m){t({title:"Could not split the review",description:Rt(m.message),variant:"error"})}finally{i(!1)}}},approve:async()=>{if(s)try{const p=s.items.flatMap((y,v)=>y.kind==="idea"&&y.followUp?[{index:v,followUp:y.followUp}]:[]),m=p.filter(({index:y})=>!u.current.has(y)),x=await Promise.allSettled(m.map(({index:y,followUp:v})=>Ek({title:v.title,content:v.body}).then(()=>y)));for(const y of x)y.status==="fulfilled"&&u.current.add(y.value);if(x.some(y=>y.status==="rejected"))throw new Error("Failed to create one or more follow-up ideas");const w=s.items.flatMap(y=>y.kind==="rework"?y.phases??[]:[]).map(y=>({done:!1,text:y.text,description:y.description,source:"review"}));if(!await n(e.title,{review:[],...w.length>0&&{phases:[...e.phases,...w]}}))return;o(null),l({phasesAdded:w.length,ideaTitles:p.map(({followUp:y})=>y.title)})}catch(p){t({title:"Could not apply the split",description:Rt(p.message),variant:"error"})}},discard:async()=>o(null)}},AW=async e=>{const t=await fetch(`/api/trail?id=${encodeURIComponent(e)}`);if(!t.ok)throw new Error("Failed to load the provenance trail");return t.json()},MW=e=>{const[t,n]=S.useState(null);return S.useEffect(()=>{if(n(null),!e)return;let r=!1;return AW(e).then(i=>{r||n(i)}).catch(()=>{}),()=>{r=!0}},[e]),t};function G_(){const[e,t]=S.useState("idle"),[n,r]=S.useState(null),i=S.useRef(null),s=S.useCallback(async a=>{i.current&&clearTimeout(i.current),t("loading"),r(null);try{await a(),t("success"),i.current=setTimeout(()=>{t("idle")},2e3)}catch(l){t("error"),r(l.message),i.current=setTimeout(()=>{t("idle"),r(null)},4e3)}},[]),o=S.useCallback(()=>{i.current&&clearTimeout(i.current),t("idle"),r(null)},[]);return{state:e,errorMessage:n,run:s,reset:o,loading:e==="loading",success:e==="success"}}function LW(e){const t=e.phases.map((i,s)=>`${s+1}. [${i.done?"x":" "}] ${i.text}`).join(`
|
|
85
|
-
`),n=e.log&&e.log.length>0?e.log.map(i=>`- ${i.date}: ${i.text}`).join(`
|
|
86
|
-
`):"(none)",r=e.clarifications&&e.clarifications.length>0?e.clarifications.map(i=>`- ${i.date}: ${i.text}`).join(`
|
|
87
|
-
`):"(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.
|
|
88
|
-
|
|
89
|
-
Plan body: ${e.body}
|
|
90
|
-
|
|
91
|
-
Current phases:
|
|
92
|
-
${t}
|
|
93
|
-
|
|
94
|
-
Log entries (issues, bugs, and review notes recorded so far):
|
|
95
|
-
${n}
|
|
96
|
-
|
|
97
|
-
Clarifications (answered scope/design questions):
|
|
98
|
-
${r}
|
|
99
|
-
|
|
100
|
-
Task:
|
|
101
|
-
1. Read the plan above, then inspect the relevant code in this repo.
|
|
102
|
-
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.
|
|
103
|
-
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.
|
|
104
|
-
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.
|
|
105
|
-
|
|
106
|
-
Rules:
|
|
107
|
-
- Never modify, reorder, check, uncheck, or delete any existing line, even if it looks stale, wrong, or redundant.
|
|
108
|
-
- Never touch the YAML frontmatter.
|
|
109
|
-
- Append only: new unchecked phases at the end of the list, plus the single Log line.`}function DW(e,t){const n=e.phases.length>0,r=n?"plan":"idea",i=n?e.phases.map((o,a)=>`${a+1}. [${o.done?"x":" "}] ${o.text}`).join(`
|
|
110
|
-
`):"(none — this is a backlog idea with no phases yet)",s=t.map(o=>`- ${o.date}: ${o.text}`).join(`
|
|
111
|
-
`);return`You are reworking the ${r} "${e.title}" (${e.id??"no id"}) from its author's notes, 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.
|
|
112
|
-
|
|
113
|
-
Current status: ${e.status}
|
|
114
|
-
|
|
115
|
-
${n?"Plan":"Idea"} body: ${e.body}
|
|
116
|
-
|
|
117
|
-
Current phases:
|
|
118
|
-
${i}
|
|
119
|
-
|
|
120
|
-
The author's notes — this is the work to act on:
|
|
121
|
-
${s}
|
|
122
|
-
|
|
123
|
-
Task: make the ${r} reflect these notes, so that acting on the ${r} afterwards delivers what the author asked for.
|
|
124
|
-
|
|
125
|
-
1. Read each note and decide what it means for this ${r}: new work to do, a correction to the body prose, or a statement that something believed finished is not.
|
|
126
|
-
2. Add a phase for each piece of new work the notes describe — imperative title line, then an indented description naming the files or areas involved, matching the style of the existing phases.
|
|
127
|
-
3. Reword body prose only where a note contradicts it.
|
|
128
|
-
4. If the notes mean work remains on a ${r} marked \`review\` or \`done\`, set \`status\` back to \`in-progress\` so it re-enters the queue. Leave the status alone otherwise.
|
|
129
|
-
5. Append one line to the Log recording what you changed, dated today, so these notes are not applied twice.
|
|
130
|
-
|
|
131
|
-
Hard guardrails, never violate these:
|
|
132
|
-
- Never delete or un-check an already-completed phase — finished history stays, new work becomes new phases.
|
|
133
|
-
- Never remove or reword the author's own note lines in the Log.
|
|
134
|
-
- Never change anything the notes do not ask about: id, title, created, idea, tags, and unrelated prose stay byte-identical.
|
|
135
|
-
- Never touch a different file, and never implement the work itself — you are editing the ${r}, not the codebase.
|
|
136
|
-
- If a note is purely a remark with nothing to act on, leave the ${r} unchanged and say so in your Log line.`}function NW(e,t){if(t.kind==="body")return"the body prose";const n=e.phases[t.index];return n?`phase ${t.index+1} ("${n.text}")`:`phase ${t.index+1}`}function zW(e,t){const n=e.phases.length>0,r=n?"plan":"idea",i=n?e.phases.map((o,a)=>{const l=o.description?`
|
|
137
|
-
${o.description}`:"";return`${a+1}. [${o.done?"x":" "}] ${o.text}${l}`}).join(`
|
|
138
|
-
`):"(none — this is a backlog idea with no phases yet)",s=t.map(o=>`- On ${NW(e,o.anchor)}: "${o.prose}"`).join(`
|
|
139
|
-
`);return`You are reworking the ${r} "${e.title}" (${e.id??"no id"}) from margin notes anchored to specific phases or the body prose, 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.
|
|
140
|
-
|
|
141
|
-
Current status: ${e.status}
|
|
142
|
-
|
|
143
|
-
${n?"Plan":"Idea"} body: ${e.body}
|
|
144
|
-
|
|
145
|
-
Current phases:
|
|
146
|
-
${i}
|
|
147
|
-
|
|
148
|
-
The author's margin notes — this is the work to act on, each quoted against what it is about:
|
|
149
|
-
${s}
|
|
150
|
-
|
|
151
|
-
Task: make the ${r} reflect these notes, so that acting on the ${r} afterwards delivers what the author asked for.
|
|
152
|
-
|
|
153
|
-
1. Read each note together with what it is anchored to, and decide what it means: new work to do, a correction to that phase or the body prose, or a statement that something believed finished is not.
|
|
154
|
-
2. A note anchored to a phase is about that phase specifically — reword its title or description, or add a new phase near it, rather than editing unrelated parts of the ${r}.
|
|
155
|
-
3. A note anchored to the body prose is about the ${r}'s overall description — reword only the part of the body it contradicts.
|
|
156
|
-
4. Add a phase for each piece of new work a note describes — imperative title line, then an indented description naming the files or areas involved, matching the style of the existing phases.
|
|
157
|
-
5. If the notes mean work remains on a ${r} marked \`review\` or \`done\`, set \`status\` back to \`in-progress\` so it re-enters the queue. Leave the status alone otherwise.
|
|
158
|
-
|
|
159
|
-
Hard guardrails, never violate these:
|
|
160
|
-
- Never delete or un-check an already-completed phase — finished history stays, new work becomes new phases.
|
|
161
|
-
- Never touch the \`### Notes\` section at all — the app resolves the notes a rework addresses once its result is approved, not you.
|
|
162
|
-
- Never change anything the notes do not ask about: id, title, created, idea, tags, and unrelated prose stay byte-identical.
|
|
163
|
-
- Never touch a different file, and never implement the work itself — you are editing the ${r}, not the codebase.
|
|
164
|
-
- If a note is purely a remark with nothing to act on, leave the ${r} unchanged.`}function OW(e){const t=e.phases.length>0,n=t?"plan":"idea",r=t?e.phases.map((i,s)=>`${s+1}. [${i.done?"x":" "}] ${i.text}`).join(`
|
|
165
|
-
`):"(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.
|
|
166
|
-
|
|
167
|
-
${t?"Plan":"Idea"} body: ${e.body}
|
|
168
|
-
|
|
169
|
-
Current phases:
|
|
170
|
-
${r}
|
|
171
|
-
|
|
172
|
-
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.
|
|
173
|
-
|
|
174
|
-
1. Read the ${n} above, then inspect the relevant code in this repo to find what has actually changed since the prose was written.
|
|
175
|
-
2. Reword only the sentences or phrases that are now stale: fix references and superseded approaches. Leave everything else byte-identical.
|
|
176
|
-
3. Do not summarize, restructure, or "improve" prose that is still accurate — an unnecessary rewrite is a failure of this task, not a bonus.
|
|
177
|
-
|
|
178
|
-
Hard guardrails, never violate these:
|
|
179
|
-
- Never touch the YAML frontmatter (id, title, kind, status, created, idea, tags, or any other field).
|
|
180
|
-
- Never un-check, check, delete, or reorder any phase line, checked or unchecked.
|
|
181
|
-
- Never add or remove phases.
|
|
182
|
-
- Never touch the Log or Clarifications sections.
|
|
183
|
-
- If nothing is stale, make no edits at all.`}function FW(e){const t=e.log&&e.log.length>0?e.log.map(n=>`- ${n.date}: ${n.text}`).join(`
|
|
184
|
-
`):"(none)";return`You are expanding 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.
|
|
185
|
-
|
|
186
|
-
Current idea body, in full (do not modify this):
|
|
187
|
-
${e.body}
|
|
188
|
-
|
|
189
|
-
Prior Log entries:
|
|
190
|
-
${t}
|
|
191
|
-
|
|
192
|
-
Task:
|
|
193
|
-
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.
|
|
194
|
-
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. Keep the idea's original intent — sharpen it, do not redirect it.
|
|
195
|
-
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).
|
|
196
|
-
|
|
197
|
-
Keep unchanged:
|
|
198
|
-
- the YAML frontmatter (id, title)
|
|
199
|
-
- the \`## ${e.id??"IDEA-N"}: ${e.title}\` heading line and the original body prose beneath it
|
|
200
|
-
|
|
201
|
-
Append only — never rewrite or delete the idea's existing body or prior Log lines.`}function $W(e){return`You are fleshing out 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.
|
|
202
|
-
|
|
203
|
-
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:
|
|
204
|
-
${e.body}
|
|
205
|
-
|
|
206
|
-
Task:
|
|
207
|
-
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.
|
|
208
|
-
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.
|
|
209
|
-
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).
|
|
210
|
-
|
|
211
|
-
Keep unchanged:
|
|
212
|
-
- the YAML frontmatter (id, title, status)
|
|
213
|
-
- the original body prose beneath the frontmatter
|
|
214
|
-
|
|
215
|
-
Append only — never rewrite or delete the idea's existing body or prior Log lines.`}function P9(e,t){return`You are fleshing out 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.
|
|
216
|
-
|
|
217
|
-
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:
|
|
218
|
-
${e.body}
|
|
219
|
-
|
|
220
|
-
Task:
|
|
221
|
-
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.
|
|
222
|
-
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.
|
|
223
|
-
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).
|
|
224
|
-
|
|
225
|
-
Keep unchanged:
|
|
226
|
-
- the YAML frontmatter (id, title, status)
|
|
227
|
-
- the original body prose beneath the frontmatter
|
|
228
|
-
|
|
229
|
-
Append only — never rewrite or delete the idea's existing body or prior Log lines.`}function BW(e,t){const n=t.filter(i=>i.status!=="done"),r=n.length?n.map(i=>{const s=i.phases.map(o=>` - [${o.done?"x":" "}] ${o.text}`).join(`
|
|
230
|
-
`);return`### ${i.id??"no id"}: ${i.title} (status: ${i.status}${i.idea?`, idea: ${i.idea}`:""})
|
|
231
|
-
${i.body}
|
|
232
|
-
${s||" (no phases yet)"}`}).join(`
|
|
233
|
-
|
|
234
|
-
`):"(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.
|
|
235
|
-
|
|
236
|
-
Idea body, in full:
|
|
237
|
-
${e.body}
|
|
238
|
-
|
|
239
|
-
## What drafting adds to the file (see papercamp/about.md)
|
|
240
|
-
|
|
241
|
-
The file already has YAML frontmatter (id, title, status, created, …) and the prose body above. Drafting means:
|
|
242
|
-
|
|
243
|
-
1. Add a \`type\` field to the frontmatter: the Conventional Commits type that best fits (\`feat | fix | chore | docs | refactor\` — most are \`feat\`).
|
|
244
|
-
2. Add 1-4 short subsystem \`tags\` to the frontmatter if it has none.
|
|
245
|
-
3. Append a \`### Phases\` checklist at the end of the file (after any \`### Log\` section move it below the phases — Phases, then Log):
|
|
246
|
-
|
|
247
|
-
\`\`\`
|
|
248
|
-
### Phases
|
|
249
|
-
- [ ] Short phase title
|
|
250
|
-
Optional description of the phase, indented with 6 spaces.
|
|
251
|
-
\`\`\`
|
|
252
|
-
|
|
253
|
-
Hard rules:
|
|
254
|
-
- Never change the \`id\`, \`title\`, \`status\`, or \`created\` fields — \`status\` stays exactly \`idea\`; a human promotes it after reviewing your draft (per papercamp/decisions.md, "Plan-drafting agent writes directly, same as phase execution").
|
|
255
|
-
- Never rewrite or delete the existing prose body or \`### Log\` entries — the idea's history stays intact.
|
|
256
|
-
- Phases: actionable steps a future agent or human could pick up one at a time — match the granularity of the phases in the entities shown below, not one giant phase.
|
|
257
|
-
|
|
258
|
-
## Every other open (non-done) entity, for scope context
|
|
259
|
-
|
|
260
|
-
${r}
|
|
261
|
-
|
|
262
|
-
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 VW(e,t){const n=e.length?e.map(i=>`### ${i.id??"no id"}: ${i.title}
|
|
263
|
-
${i.body}`).join(`
|
|
264
|
-
|
|
265
|
-
`):"(no ideas yet)",r=t.length?t.map(i=>`- ${i.date}: ${i.title} — ${i.description}`).join(`
|
|
266
|
-
`):"(none yet)";return`You are scanning this repository for ideas worth suggesting, to append to papercamp/suggestions.md — a lightweight holding pen, sibling to decisions.md/open-questions.md. Edit only that one file.
|
|
267
|
-
|
|
268
|
-
Existing ideas (do not repeat anything already covered here):
|
|
269
|
-
${n}
|
|
270
|
-
|
|
271
|
-
Existing suggestions already in the holding pen (do not repeat these either):
|
|
272
|
-
${r}
|
|
273
|
-
|
|
274
|
-
Task:
|
|
275
|
-
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.
|
|
276
|
-
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. Keep the title short (a few words, like an idea title) and the description to a single physical line (no literal line breaks).
|
|
277
|
-
3. If you find nothing worth suggesting, make no edits at all — no empty line, no placeholder.
|
|
278
|
-
|
|
279
|
-
Rules:
|
|
280
|
-
- Append only — never modify, reorder, or delete any existing line in suggestions.md.
|
|
281
|
-
- Never create papercamp/ideas/ files or touch ideas/index.md — a suggestion is not an idea until a human promotes it.
|
|
282
|
-
- Never touch any other file in the repo.`}const Hu=({idea:e,otherPlans:t})=>{const n=N(h=>h.launchPlanDraft),r=N(jn),{state:i,errorMessage:s,run:o}=G_(),{toast:a}=Me(),l=()=>{const h=e.id;h&&o(async()=>{try{await n(h,BW(e,t))}catch(f){throw a({title:"Draft failed",description:Rt(f.message),variant:"error"}),f}})},u=i==="loading"?"Drafting…":i==="success"?"Draft sent!":i==="error"?"Draft failed":"Draft plan",c=i==="error"?s??"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(me,{content:c,children:d.jsx(q,{variant:"ghost",size:"small",onClick:l,disabled:i==="loading"||!e.id||!r,style:{color:i==="error"?ie.accentRoseDark:ie.textSecondary},children:u})})},WW=({children:e,collapsedLines:t=3,resetKey:n})=>{const r=S.useRef(null),[i,s]=S.useState(!1),[o,a]=S.useState(!1);return S.useLayoutEffect(()=>s(!1),[n]),S.useLayoutEffect(()=>{if(i)return;const l=r.current;if(!l)return;const u=()=>a(l.scrollHeight-l.clientHeight>1);u();const c=new ResizeObserver(u);return c.observe(l),()=>c.disconnect()},[i,n]),d.jsxs("div",{children:[d.jsx("div",{ref:r,style:i?void 0:{display:"-webkit-box",WebkitLineClamp:t,WebkitBoxOrient:"vertical",overflow:"hidden"},children:e}),o&&d.jsx("button",{type:"button",onClick:()=>s(l=>!l),"aria-expanded":i,style:{alignSelf:"flex-start",background:"none",border:"none",padding:`${R[1]} 0`,font:"inherit",fontSize:J.xs,opacity:.6,cursor:"pointer",textDecoration:"underline"},children:i?"Show less":"Show more"})]})},K_=({label:e,onAdd:t,disabled:n})=>{const[r,i]=S.useState(!1),[s,o]=S.useState(""),[a,l]=S.useState(!1),u=()=>{i(!1),o("")},c=async()=>{if(s.trim()){l(!0);try{await t(s.trim())&&u()}finally{l(!1)}}};return d.jsxs(d.Fragment,{children:[d.jsx(me,{content:e,children:d.jsx(st,{variant:"ghost",size:"small",onClick:()=>i(!0),disabled:n,"aria-label":e,icon:d.jsx(M_,{size:16})})}),d.jsx(hr,{open:r,onClose:u,title:e,size:"small",children:d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:R[4]},children:[d.jsx(Gt,{value:s,onChange:h=>o(h.target.value),placeholder:"What should change here?",rows:4,disabled:a}),d.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:R[2]},children:[d.jsx(q,{type:"button",variant:"ghost",onClick:u,disabled:a,children:"Cancel"}),d.jsx(q,{type:"button",variant:"primary",onClick:c,disabled:a||n||!s.trim(),children:"Add note"})]})]})})]})},Y_=({notes:e,onResolve:t,disabled:n})=>{const[r,i]=S.useState(null);if(e.length===0)return null;const s=async o=>{i(o);try{await t(o)}finally{i(null)}};return d.jsx("div",{style:{display:"flex",flexDirection:"column",gap:R[2]},children:e.map((o,a)=>d.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:R[2],background:"rgba(0,0,0,0.05)",borderRadius:R[2],padding:`${R[2]} ${R[3]}`},children:[d.jsx("span",{className:"text-sm",style:{flex:1,opacity:.85},children:o.prose}),d.jsx(me,{content:"Resolve note",children:d.jsx(st,{variant:"ghost",size:"small",onClick:()=>s(o),disabled:n||r!==null,"aria-label":"Resolve note",icon:d.jsx(ag,{size:16})})})]},`${o.prose}-${a}`))})},ri=({id:e})=>e?d.jsx(Be,{size:"small",fillColor:"rgba(0,0,0,0.08)",children:e}):null,Q_={"in-progress":"#C89A5A",planned:"#6A9B72",idea:"#8A9BAA",review:"#9B7AB5",done:"#8A7A8A",dropped:"#A06060"},hg={idea:"Idea",planned:"Planned","in-progress":"In progress",review:"Review",done:"Done",dropped:"Dropped"},Vt={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"}},q_={open:"Open",done:"Done",dropped:"Dropped"},ou={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"}},UW={draft:"Draft",open:"Open",closed:"Closed",merged:"Merged"},sp={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"}},HW={approved:"Approved","changes-requested":"Changes requested","review-required":"Review required"},N0={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"}},X_=({pr:e})=>d.jsx("a",{href:e.url,target:"_blank",rel:"noreferrer",onClick:t=>t.stopPropagation(),style:{textDecoration:"none",display:"inline-flex"},children:d.jsx(Be,{size:"small",fillColor:sp[e.state].fill,textColor:sp[e.state].text,children:d.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:R[1]},children:[d.jsx(rW,{}),"#",e.number," ",UW[e.state]]})})}),J_=({pct:e,color:t,height:n=6})=>d.jsx(SV,{value:e,color:t,height:n}),z0={fill:"rgba(143, 185, 150, 0.25)",text:"#5E8A66"},O0={fill:"rgba(0, 0, 0, 0.05)",text:"rgba(0, 0, 0, 0.35)"},Ml=({reached:e,label:t,tooltip:n,href:r})=>{const i=d.jsx(Be,{size:"small",fillColor:e?z0.fill:O0.fill,textColor:e?z0.text:O0.text,children:t}),s=r?d.jsx("a",{href:r,target:"_blank",rel:"noreferrer",onClick:o=>o.stopPropagation(),style:{textDecoration:"none",display:"inline-flex"},children:i}):i;return n?d.jsx(me,{content:n,children:s}):s},gh=()=>d.jsx("span",{style:{opacity:.3},"aria-hidden":"true",children:"→"}),F0=(e,t)=>`${e} ${t}${e===1?"":"s"}`;function GW(e){const t=e.match(/\(\[([0-9a-f]+)\]\((\S+)\)\)\s*$/);return t?{hash:t[1],url:t[2]}:void 0}const KW=({trail:e})=>{var o,a;const{taskRuns:t,commits:n,pr:r,releaseLine:i}=e,s=i.data?GW(i.data):void 0;return d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:R[2],flexWrap:"wrap"},children:[d.jsx(Ml,{reached:t.reached,label:t.data?F0(t.data.length,"task run"):"Tasks",tooltip:(o=t.data)==null?void 0:o.map(l=>l.taskKind).join(", ")}),d.jsx(gh,{}),d.jsx(Ml,{reached:n.reached,label:n.data?F0(n.data.length,"commit"):"Commits",tooltip:(a=n.data)==null?void 0:a.join(`
|
|
283
|
-
`)}),d.jsx(gh,{}),r.data?d.jsx(X_,{pr:r.data}):d.jsx(Ml,{reached:!1,label:"PR"}),d.jsx(gh,{}),d.jsx(Ml,{reached:i.reached,label:s?`Released ${s.hash}`:"Release",tooltip:i.data,href:s==null?void 0:s.url})]})},YW=({pr:e})=>{const{reviewDecision:t,unresolvedThreadCount:n,hasNewCommentsSincePush:r}=e;return!t&&!n?null:d.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:R[2]},children:[t&&d.jsx(Be,{size:"small",fillColor:N0[t].fill,textColor:N0[t].text,children:HW[t]}),!!n&&d.jsxs(Be,{size:"small",fillColor:Vt["in-progress"].fill,textColor:Vt["in-progress"].text,children:[n," unaddressed comment",n===1?"":"s",r?" · new":""]})]})},Si=({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",{style:{backgroundColor:r?"rgba(143, 185, 150, 0.3)":"rgba(201, 139, 139, 0.3)",textDecoration:r?"none":"line-through",color:r?ie.accentGreenDark:ie.accentRoseDark},children:t.text},`${t.type}-${n}`)})}),$0=e=>d.jsx("h4",{style:{fontFamily:je.serif,fontSize:J.xs,fontWeight:600,margin:`0 0 ${R[2]}`,opacity:.65},children:e}),QW=({plan:e,before:t,onApprove:n,onDiscard:r,queuePosition:i})=>{const[s,o]=S.useState(!1),[a,l]=S.useState(!1),u=e.body!==t.body,c=e.phases.map((m,x)=>({phase:m,before:t.phases[x],index:x})).filter(({phase:m,before:x})=>x!==void 0&&(m.text!==x.text||(m.description??"")!==(x.description??""))),h=s||a,f=async()=>{if(!h){o(!0);try{await r()}finally{o(!1)}}},p=async()=>{l(!0);try{await n()}finally{l(!1)}};return d.jsx(hr,{open:!0,title:i?`Review reconcile changes (${i.index} of ${i.total})`:"Review reconcile changes",size:"large",onClose:h?()=>{}:f,children:d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:R[5]},children:[d.jsxs("p",{className:"text-sm",style:{margin:0,opacity:.7},children:['The reconcile agent proposed the rewrite below for "',e.title,'". Approve to keep it, or discard to revert to the prior wording.']}),!u&&c.length===0&&d.jsx("p",{className:"text-sm",style:{margin:0,opacity:.6},children:"No wording changed."}),u&&d.jsxs("div",{children:[$0("Body"),d.jsx("p",{className:"text-base",style:{margin:0,lineHeight:$c.normal},children:d.jsx(Si,{tokens:wi(t.body,e.body)})})]}),c.length>0&&d.jsxs("div",{children:[$0("Phases"),d.jsx("div",{style:{display:"flex",flexDirection:"column",gap:R[3]},children:c.map(({phase:m,before:x,index:w})=>d.jsxs("div",{className:"text-sm",style:{lineHeight:$c.normal},children:[d.jsx(Si,{tokens:wi(x.text,m.text)}),(m.description||x.description)&&d.jsx("div",{style:{opacity:.85,marginTop:R[1]},children:d.jsx(Si,{tokens:wi(x.description??"",m.description??"")})})]},w))})]}),d.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:R[2]},children:[d.jsx(q,{variant:"danger",size:"small",onClick:f,disabled:h,children:"Discard"}),d.jsx(q,{variant:"primary",size:"small",onClick:p,disabled:h,children:"Approve"})]})]})})},qW=e=>{const t=[];return e.phasesAdded>0&&t.push(`${e.phasesAdded} phase${e.phasesAdded===1?"":"s"} appended`),e.ideaTitles.length>0&&t.push(`idea${e.ideaTitles.length===1?"":"s"} minted: ${e.ideaTitles.join(", ")}`),t.length>0?`Applied — ${t.join(" · ")}.`:"Applied — the review is clear."},B0={background:"rgba(0,0,0,0.05)",borderRadius:R[2],borderBottomLeftRadius:R[1],padding:`${R[3]} ${R[4]}`,alignSelf:"flex-start",maxWidth:"100%"},XW=e=>d.jsxs("p",{className:"text-sm",style:{margin:`0 0 ${R[2]}`,opacity:.7,fontStyle:"italic"},children:['"',e,'"']}),JW=({launching:e,result:t,outcome:n,onApprove:r,onDiscard:i})=>{const[s,o]=S.useState(!1),[a,l]=S.useState(!1),u=s||a;if(!e&&!t&&!n)return null;if(!e&&!t&&n)return d.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:R[1],marginBottom:R[3]},children:[d.jsx("div",{className:"text-sm",style:B0,children:qW(n)}),d.jsx("span",{className:"text-sm",style:{fontWeight:600,opacity:.45},children:"Agent"})]});const c=async()=>{if(!u){o(!0);try{await i()}finally{o(!1)}}},h=async()=>{l(!0);try{await r()}finally{l(!1)}};return d.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:R[1],marginBottom:R[3]},children:[d.jsx("div",{className:"text-sm",style:B0,children:t?d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:R[5]},children:[d.jsx("p",{style:{margin:0,opacity:.7},children:"Proposed split — approve to keep it, or discard to leave the review untouched."}),t.items.map((f,p)=>d.jsxs("div",{children:[XW(f.point),d.jsx("div",{style:{display:"flex",alignItems:"center",gap:R[2]},children:d.jsx(Be,{size:"small",fillColor:f.kind==="rework"?Vt.planned.fill:Vt.idea.fill,textColor:f.kind==="rework"?Vt.planned.text:Vt.idea.text,children:f.kind==="rework"?"rework":"follow-up idea"})}),f.kind==="rework"&&f.phases&&d.jsx("div",{style:{display:"flex",flexDirection:"column",gap:R[2],marginTop:R[2]},children:f.phases.map((m,x)=>d.jsxs("div",{className:"text-sm",style:{lineHeight:1.5},children:[d.jsx(Si,{tokens:wi("",m.text)}),m.description&&d.jsx("div",{style:{opacity:.85,marginTop:R[1]},children:d.jsx(Si,{tokens:wi("",m.description)})})]},`${m.text}-${x}`))}),f.kind==="idea"&&f.followUp&&d.jsxs("div",{style:{marginTop:R[2]},children:[d.jsx("p",{className:"text-sm",style:{margin:0,fontFamily:je.serif,fontWeight:600},children:d.jsx(Si,{tokens:wi("",f.followUp.title)})}),d.jsx("p",{className:"text-sm",style:{margin:`${R[1]} 0 0`,lineHeight:1.5},children:d.jsx(Si,{tokens:wi("",f.followUp.body)})})]})]},`${f.point}-${p}`)),d.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:R[2]},children:[d.jsx(q,{variant:"danger",size:"small",onClick:c,disabled:u,children:"Discard"}),d.jsx(q,{variant:"primary",size:"small",onClick:h,disabled:u,children:"Approve"})]})]}):d.jsx(Ws,{size:"small",label:"Splitting the review…"})}),d.jsx("span",{className:"text-sm",style:{fontWeight:600,opacity:.45},children:"Agent"})]})},ZW=({open:e,onClose:t,onAdd:n})=>{const[r,i]=S.useState(""),[s,o]=S.useState(""),[a,l]=S.useState(!1),[u,c]=S.useState(!1),[h,f]=S.useState(null),[p,m]=S.useState(null),[x,w]=S.useState(!1),[g,y]=S.useState(null),[v,k]=S.useState(null),P=N(D=>{var L;return((L=D.plans)==null?void 0:L.entries)??[]}),{patch:b}=ro(),C=_n(),j=V_(r,P.map(D=>({id:D.id,title:D.title,body:D.body,tags:D.tags,log:D.log})));S.useEffect(()=>{e&&(i(""),o(""),l(!1),c(!1),f(null),w(!1),y(null),k(null))},[e]);const T=D=>{t(),C({to:"/plans/$planId",params:{planId:encodeURIComponent(D)}})},E=async()=>{const D=`${r.trim()}${s.trim()?`
|
|
284
|
-
|
|
285
|
-
${s.trim()}`:""}`;if(D){w(!0),k(null),y(null);try{const L=P.map($=>({id:$.id,title:$.title,body:$.body,tags:$.tags}));y(await Tk(D,L))}catch(L){k(L.message)}finally{w(!1)}}},A=D=>{const L=P.find($=>$.id===D);L&&T(L.title)},M=async(D,L,$)=>{m(D);const z={date:new Date().toISOString().slice(0,10),text:r.trim()},V=await b(L,{log:[...$??[],z]},{errorTitle:"Extend failed"});m(null),V&&t()},F=async D=>{if(D.preventDefault(),!(!r.trim()||u)){f(null),c(!0);try{await n({title:r.trim(),content:s.trim()||void 0,kind:a?"note":void 0}),t()}catch(L){f(L.message)}finally{c(!1)}}};return d.jsx(hr,{open:e,onClose:t,title:"New idea",size:"small",children:d.jsxs("form",{onSubmit:F,style:{display:"flex",flexDirection:"column",gap:R[4]},children:[d.jsx($a,{label:"Title",value:r,onChange:D=>i(D.target.value),placeholder:"Idea title…",disabled:u,autoFocus:!0,required:!0}),j.length>0&&d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:R[2]},children:[d.jsx("span",{style:{fontSize:J.sm,opacity:.6,fontWeight:600},children:"Similar ideas"}),j.map(({candidate:D})=>{const L={id:D.id??null,title:D.title,body:D.body,log:D.log},$=P.filter(U=>U.id!==D.id);return d.jsx(Pe,{size:"small",texture:"canvas",children:d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:R[2]},children:[d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:R[2],minWidth:0},children:[d.jsx(ri,{id:D.id}),d.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:D.title})]}),d.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:R[2]},children:[d.jsx(q,{type:"button",variant:"ghost",size:"small",onClick:()=>T(D.title),children:"Open it"}),d.jsx(q,{type:"button",variant:"ghost",size:"small",disabled:!D.id||!r.trim()||p!==null,onClick:()=>D.id&&M(D.id,D.title,D.log),children:p===D.id?"Extending…":"Extend it instead"}),d.jsx(Hu,{idea:L,otherPlans:$})]})]})},D.id??D.title)})]}),d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:R[2]},children:[d.jsx("div",{children:d.jsx(q,{type:"button",variant:"ghost",size:"small",disabled:!r.trim()||x,onClick:E,children:x?"Checking overlap…":"Check overlap"})}),v&&d.jsx("p",{style:{margin:0,color:ie.accentRoseDark,fontSize:J.sm},children:v}),g&&d.jsx(Pe,{size:"small",texture:"canvas",children:d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:R[2]},children:[d.jsx("span",{style:{fontWeight:600},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",{style:{fontSize:J.sm,opacity:.8},children:g.reasoning}),g.targetId&&d.jsx("div",{style:{display:"flex",justifyContent:"flex-end"},children:d.jsx(q,{type:"button",variant:"ghost",size:"small",onClick:()=>A(g.targetId),children:"Open it"})})]})})]}),d.jsx(Gt,{label:"Description",value:s,onChange:D=>o(D.target.value),placeholder:"Optional details…",disabled:u,rows:4}),d.jsx(b6,{label:"Note — never needs a plan",checked:a,onChange:D=>l(D.target.checked),disabled:u}),h&&d.jsx("p",{style:{margin:0,color:ie.accentRoseDark,fontSize:J.sm},children:h}),d.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:R[2]},children:[d.jsx(q,{type:"button",variant:"ghost",onClick:t,disabled:u,children:"Cancel"}),d.jsx(q,{type:"submit",variant:"primary",disabled:!r.trim()||u,children:"Add"})]})]})})},eU=({entityId:e,source:t,entry:n,onClose:r})=>{const i=N(x=>x.promoteToDecision),[s,o]=S.useState(""),[a,l]=S.useState(""),[u,c]=S.useState(!1),[h,f]=S.useState(null),{toast:p}=Me();S.useEffect(()=>{n&&(o(n.text),l(""),c(!1),f(null))},[n]);const m=async()=>{if(!(!n||!s.trim())){c(!0),f(null);try{await i(e,t,n,s.trim(),a.trim()),p({title:"Promoted to a decision",variant:"success"}),r()}catch(x){f(x.message)}finally{c(!1)}}};return d.jsx(hr,{open:n!==null,onClose:r,title:"Promote to a decision",size:"small",children:d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:R[4]},children:[d.jsx("p",{style:{margin:0,opacity:.8},children:n==null?void 0:n.text}),d.jsx(Gt,{value:s,onChange:x=>o(x.target.value),placeholder:"Decision title",rows:2,disabled:u}),d.jsx(Gt,{value:a,onChange:x=>l(x.target.value),placeholder:"Rationale (optional — defaults to the source text)",rows:3,disabled:u}),h&&d.jsx("p",{style:{margin:0,color:ie.accentRoseDark,fontSize:J.sm},children:h}),d.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:R[2]},children:[d.jsx(q,{type:"button",variant:"ghost",onClick:r,disabled:u,children:"Cancel"}),d.jsx(q,{type:"button",variant:"primary",onClick:m,disabled:u||!s.trim(),children:u?"Promoting…":"Promote to decision"})]})]})})},tU=({suggestion:e,onClose:t})=>{const n=N(c=>c.promoteSuggestion),r=N(c=>c.launchIdeaExtend),[i,s]=S.useState(!1),[o,a]=S.useState(null),{toast:l}=Me();S.useEffect(()=>{e&&(s(!1),a(null))},[e]);const u=async()=>{if(e){s(!0),a(null);try{const c=await n(e),h=N.getState().ideaEntries.find(f=>f.id===c);if(h)try{await r(c,$W(h))}catch(f){l({title:"Idea created, but the refine agent failed to launch",description:Rt(f.message),variant:"error"})}t()}catch(c){a(c.message)}finally{s(!1)}}};return d.jsx(hr,{open:e!==null,onClose:t,title:(e==null?void 0:e.title)??"",size:"small",children:d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:R[4]},children:[d.jsx("p",{style:{margin:0,opacity:.8},children:e==null?void 0:e.description}),o&&d.jsx("p",{style:{margin:0,color:ie.accentRoseDark,fontSize:J.sm},children:o}),d.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:R[2]},children:[d.jsx(q,{type:"button",variant:"ghost",onClick:t,disabled:i,children:"Cancel"}),d.jsx(q,{type:"button",variant:"primary",onClick:u,disabled:i,children:i?"Moving…":"Move to ideas"})]})]})})},nU=({question:e,onClose:t})=>{const n=N(p=>p.resolveOpenQuestion),[r,i]=S.useState(""),[s,o]=S.useState(""),[a,l]=S.useState(!1),[u,c]=S.useState(null),{toast:h}=Me();S.useEffect(()=>{e&&(i(""),o(""),l(!1),c(null))},[e]);const f=async()=>{if(!(!e||!r.trim())){l(!0),c(null);try{await n(e.title,r.trim(),s.trim()),h({title:"Question resolved",variant:"success"}),t()}catch(p){c(p.message)}finally{l(!1)}}};return d.jsx(hr,{open:e!==null,onClose:t,title:(e==null?void 0:e.title)??"",size:"small",children:d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:R[4]},children:[d.jsx("p",{style:{margin:0,opacity:.8},children:e==null?void 0:e.body}),d.jsx(Gt,{value:r,onChange:p=>i(p.target.value),placeholder:"Decision — what did we settle on?",rows:2,disabled:a}),d.jsx(Gt,{value:s,onChange:p=>o(p.target.value),placeholder:"Rationale (optional)",rows:3,disabled:a}),u&&d.jsx("p",{style:{margin:0,color:ie.accentRoseDark,fontSize:J.sm},children:u}),d.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:R[2]},children:[d.jsx(q,{type:"button",variant:"ghost",onClick:t,disabled:a,children:"Cancel"}),d.jsx(q,{type:"button",variant:"primary",onClick:f,disabled:a||!r.trim(),children:a?"Resolving…":"Resolve into decision"})]})]})})},rU=()=>{const e=N(c=>c.archivableIdeas),t=N(c=>c.archiveIdeas),[n,r]=S.useState(null),[i,s]=S.useState(!1),{toast:o}=Me(),a=S.useCallback(async c=>{try{await t(c)}catch(h){o({title:"Archive failed",description:h.message,variant:"error"})}},[t,o]),l=S.useCallback(async c=>{r(c.id);try{await a([c.id])}finally{r(null)}},[a]),u=S.useCallback(async()=>{s(!0);try{await a(e.map(c=>c.id))}finally{s(!1)}},[a,e]);return e.length===0?null:d.jsxs("div",{style:{marginTop:R[5]},children:[d.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:R[2],margin:`0 0 ${R[2]}`},children:[d.jsxs("h2",{className:"text-sm",style:{margin:0,opacity:.6},children:["Ready to archive (",e.length,")"]}),d.jsx(q,{variant:"ghost",size:"small",disabled:i||n!==null,onClick:u,children:i?"Archiving…":"Archive all"})]}),d.jsx("div",{style:{display:"flex",flexDirection:"column",gap:R[1]},children:e.map(c=>d.jsx("div",{style:{borderRadius:10},children:d.jsx(Pe,{size:"small",texture:"canvas",className:"plan-row-card",children:d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:R[2]},children:[d.jsx(ri,{id:c.id}),d.jsx("span",{style:{flex:1,minWidth:0,fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:c.title}),d.jsx(st,{icon:d.jsx("span",{children:"→"}),variant:"ghost",size:"small",label:`Archive ${c.title}`,disabled:n===c.id||i,onClick:()=>l(c),style:{width:28,height:28}})]})})},c.id))})]})},Z_={fontFamily:je.serif,fontWeight:600,fontSize:"1.75rem",lineHeight:$c.tight},iU=({onAdd:e,disabled:t})=>{const[n,r]=S.useState(!1),[i,s]=S.useState(""),[o,a]=S.useState(null),[l,u]=S.useState(!1),c=()=>{r(!1),s(""),a(null)},h=async()=>{let f;try{f=ZM(i)}catch(p){a(p instanceof Error?p.message:"Could not parse findings");return}u(!0),a(null);try{await e(f),c()}finally{u(!1)}};return d.jsxs(d.Fragment,{children:[d.jsx(me,{content:"Add /code-review findings as phases",children:d.jsx(st,{variant:"ghost",size:"small",onClick:()=>r(!0),disabled:t,"aria-label":"Add code-review findings as phases",icon:d.jsx(i4,{size:16})})}),d.jsx(hr,{open:n,onClose:c,title:"Add /code-review findings",size:"small",children:d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:R[4]},children:[d.jsxs("p",{className:"text-sm",style:{margin:0,opacity:.7},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(Gt,{value:i,onChange:f=>s(f.target.value),placeholder:'[{ "description": "...", "file": "src/foo.ts", "line_start": 12, "failure_scenario": "..." }]',rows:10,disabled:l}),o&&d.jsxs(N_,{variant:"warning",children:["Could not add phases — ",o]}),d.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:R[2]},children:[d.jsx(q,{type:"button",variant:"ghost",onClick:c,disabled:l,children:"Cancel"}),d.jsx(q,{type:"button",variant:"primary",onClick:h,disabled:l||!i.trim(),children:"Add phases"})]})]})})]})},sU=zM.map(e=>({value:e,label:e})),oU=({open:e,onClose:t,onAdd:n})=>{const[r,i]=S.useState(""),[s,o]=S.useState(""),[a,l]=S.useState("feat"),[u,c]=S.useState(!1),[h,f]=S.useState(null),[p,m]=S.useState(null),[x,w]=S.useState(!1),[g,y]=S.useState(null),[v,k]=S.useState(null),P=N(L=>{var $;return(($=L.plans)==null?void 0:$.entries)??[]}),{patch:b}=ro(),C=_n(),{toast:j}=Me(),T=V_(r,P.map(L=>({id:L.id,title:L.title,body:L.body,tags:L.tags,log:L.log})));S.useEffect(()=>{e&&(i(""),o(""),l("feat"),c(!1),f(null),w(!1),y(null),k(null))},[e]),S.useEffect(()=>{y(null),k(null)},[r,s]);const E=L=>{t(),C({to:"/plans/$planId",params:{planId:encodeURIComponent(L)}})},A=async()=>{const L=`${r.trim()}${s.trim()?`
|
|
286
|
-
|
|
287
|
-
${s.trim()}`:""}`;if(L){w(!0),k(null),y(null);try{const $=P.map(U=>({id:U.id,title:U.title,body:U.body,tags:U.tags}));y(await Tk(L,$))}catch($){k($.message)}finally{w(!1)}}},M=L=>{const $=P.find(U=>U.id===L);$?E($.title):j({title:"Plan not found",description:`No plan with id ${L}`,variant:"error"})},F=async(L,$,U)=>{m(L);const V={date:new Date().toISOString().slice(0,10),text:r.trim()},_=await b($,{log:[...U??[],V]},{errorTitle:"Extend failed"});m(null),_&&t()},D=async L=>{if(L.preventDefault(),!(!r.trim()||u)){f(null),c(!0);try{await n({title:r.trim(),content:s.trim()||void 0,kind:a}),t()}catch($){f($.message)}finally{c(!1)}}};return d.jsx(hr,{open:e,onClose:t,title:"Quick plan",size:"small",children:d.jsxs("form",{onSubmit:D,style:{display:"flex",flexDirection:"column",gap:R[4]},children:[d.jsx($a,{label:"Title",value:r,onChange:L=>i(L.target.value),placeholder:"Backlog item title…",disabled:u,autoFocus:!0,required:!0}),T.length>0&&d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:R[2]},children:[d.jsx("span",{style:{fontSize:J.sm,opacity:.6,fontWeight:600},children:"Similar ideas"}),T.map(({candidate:L})=>{const $={id:L.id??null,title:L.title,body:L.body,log:L.log},U=P.filter(z=>z.id!==L.id);return d.jsx(Pe,{size:"small",texture:"canvas",children:d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:R[2]},children:[d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:R[2],minWidth:0},children:[d.jsx(ri,{id:L.id}),d.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:L.title})]}),d.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:R[2]},children:[d.jsx(q,{type:"button",variant:"ghost",size:"small",onClick:()=>E(L.title),children:"Open it"}),d.jsx(q,{type:"button",variant:"ghost",size:"small",disabled:!L.id||!r.trim()||p!==null,onClick:()=>L.id&&F(L.id,L.title,L.log),children:p===L.id?"Extending…":"Extend it instead"}),d.jsx(Hu,{idea:$,otherPlans:U})]})]})},L.id??L.title)})]}),d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:R[2]},children:[d.jsx("div",{children:d.jsx(q,{type:"button",variant:"ghost",size:"small",disabled:!r.trim()||x,onClick:A,children:x?"Checking overlap…":"Check overlap"})}),v&&d.jsx("p",{style:{margin:0,color:ie.accentRoseDark,fontSize:J.sm},children:v}),g&&d.jsx(Pe,{size:"small",texture:"canvas",children:d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:R[2]},children:[d.jsx("span",{style:{fontWeight:600},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",{style:{fontSize:J.sm,opacity:.8},children:g.reasoning}),g.targetId&&d.jsx("div",{style:{display:"flex",justifyContent:"flex-end"},children:d.jsx(q,{type:"button",variant:"ghost",size:"small",onClick:()=>M(g.targetId),children:"Open it"})})]})})]}),d.jsx(rp,{label:"Kind",value:a,onChange:L=>l(L),options:sU,disabled:u}),d.jsx(Gt,{label:"Description",value:s,onChange:L=>o(L.target.value),placeholder:"Optional details…",disabled:u,rows:4}),h&&d.jsx("p",{style:{margin:0,color:ie.accentRoseDark,fontSize:J.sm},children:h}),d.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:R[2]},children:[d.jsx(q,{type:"button",variant:"ghost",onClick:t,disabled:u,children:"Cancel"}),d.jsx(q,{type:"submit",variant:"primary",disabled:!r.trim()||u,children:"Add"})]})]})})},aU=()=>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"})]}),lU=()=>{const e=N(o=>o.loadPlans),t=N(o=>o.gitBranchHygiene),[n,r]=S.useState(!1),i=t==="stale-merged",s=async o=>{await BL(o),await e(),r(!1)};return d.jsxs(d.Fragment,{children:[d.jsx(me,{content:i?"Switch to main first":void 0,children:d.jsx(st,{icon:d.jsx(aU,{}),variant:"ghost",size:"small",label:i?"Switch to main first":"Quick plan",disabled:i,onClick:()=>r(!0)})}),d.jsx(oU,{open:n,onClose:()=>r(!1),onAdd:s})]})},cU=({planId:e,phaseIndex:t,disabled:n})=>{const r=N(c=>c.launchAgent),i=N(jn),{toast:s}=Me(),[o,a]=S.useState(!1),l=async c=>{if(c.stopPropagation(),!!e){a(!0);try{await r(e,t)}catch(h){s({title:"Failed to start agent",description:Rt(h.message),variant:"error"})}finally{a(!1)}}},u=e?i?"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(st,{icon:d.jsx("span",{style:{fontSize:12,lineHeight:1},children:"▶"}),variant:"ghost",size:"small",label:u,onClick:l,disabled:n||o||!e||!i,className:"transition-opacity",style:{color:ie.textSecondary}})},uU=({plan:e,disabled:t})=>{const n=N(l=>l.launchPlanAudit),r=N(jn),[i,s]=S.useState(!1),o=async()=>{if(e.id){s(!0);try{await n(e.id,LW(e))}catch(l){alert(l.message)}finally{s(!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(me,{content:a,children:d.jsx(q,{variant:"ghost",size:"small",onClick:o,disabled:t||i||!e.id||!r,children:"Audit"})})},fg=({idea:e,compact:t})=>{const n=N(f=>f.launchIdeaExtend),r=N(jn),{state:i,errorMessage:s,run:o}=G_(),{toast:a}=Me(),l=e.id,u=()=>{l&&o(async()=>{const f=N.getState().ideaEntries.find(p=>p.id===l);if(!f)throw new Error(`Idea ${l} not found`);try{await n(l,FW(f))}catch(p){throw a({title:"Extension failed",description:Rt(p.message),variant:"error"}),p}})},c=i==="loading"?"Extending…":i==="success"?t?"Sent!":"Extension sent!":i==="error"?"Extension failed":t?"Extend":"Extend with AI",h=i==="error"?s??"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(me,{content:h,children:d.jsx(q,{variant:"ghost",size:"small",onClick:u,disabled:i==="loading"||!l||!r,style:{color:i==="error"?ie.accentRoseDark:void 0},children:c})})},dU=({plan:e,disabled:t})=>{const n=N(c=>c.launchFixReview),r=N(jn),i=N(ZL),[s,o]=S.useState(!1),a=async()=>{if(e.id){o(!0);try{await n(e.id)}catch(c){alert(c.message)}finally{o(!1)}}},l=t||s||!e.id||!r||!i,u=e.id?i?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(me,{content:u,children:d.jsx(vs,{size:"small",icon:d.jsx("span",{style:{color:ie.accentAmberDark},children:"⚑"}),onClick:a,disabled:l,style:l?{opacity:.5}:void 0,children:s?"Starting…":"Fix review comments"})})},hU=()=>{const e=N(i=>i.loadIdeas),[t,n]=S.useState(!1),r=async i=>{await Ek(i),await e(),n(!1)};return d.jsxs(d.Fragment,{children:[d.jsx(st,{icon:d.jsx(M_,{size:16}),variant:"ghost",size:"small",label:"New idea",onClick:()=>n(!0)}),d.jsx(ZW,{open:t,onClose:()=>n(!1),onAdd:r})]})};async function fU(e){var r;if((r=navigator.clipboard)!=null&&r.writeText)try{return await navigator.clipboard.writeText(e),!0}catch{}const t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select();let n=!1;try{n=document.execCommand("copy")}catch{n=!1}return document.body.removeChild(t),n}const pU=({planTitle:e,planId:t,phaseIndex:n})=>{const[r,i]=S.useState("idle"),s=async o=>{o.stopPropagation();const a=`Start phase ${n+1} of plan "${e}" in papercamp/ideas/${t??"<ID>"}.md`,l=await fU(a);i(l?"copied":"failed"),setTimeout(()=>i("idle"),1500)};return d.jsx(st,{icon:r==="copied"?d.jsx(ag,{size:16}):r==="failed"?d.jsx(Fa,{size:16}):d.jsx(n4,{size:16}),variant:"ghost",size:"small",label:r==="copied"?"Copied":r==="failed"?"Copy failed — select and copy manually":"Copy phase prompt",onClick:s,className:"transition-opacity",style:{color:r==="copied"?"#6A9B72":r==="failed"?"#A06060":ie.textSecondary}})},mU=({plan:e,disabled:t})=>{const n=N(c=>c.launchPlanRework),r=N(jn),{toast:i}=Me(),[s,o]=S.useState(!1),a=e.log??[],l=async()=>{if(!(!e.id||a.length===0)){o(!0);try{await n(e.id,DW(e,a),{body:e.body,phases:e.phases}),i({title:"Applying your notes",description:"The agent is reworking this entry — you can approve or discard the result."})}catch(c){i({title:"Could not apply notes",description:c.message,variant:"error"})}finally{o(!1)}}},u=e.id?a.length===0?"Add a comment first — this turns your comments into phases and edits":r?"Rework this entry from your comments":"No agent CLI found — set up in Settings":"Needs an ID before an agent can run";return d.jsx(me,{content:u,children:d.jsx(q,{variant:"secondary",size:"small",onClick:l,disabled:t||s||!e.id||!r||a.length===0,children:s?"Applying…":"Apply notes"})})},gU=({plan:e,disabled:t})=>{const n=N(l=>l.launchPlanReconcile),r=N(jn),[i,s]=S.useState(!1),o=async()=>{if(e.id){s(!0);try{await n(e.id,OW(e),{body:e.body,phases:e.phases})}catch(l){alert(l.message)}finally{s(!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(me,{content:a,children:d.jsx(q,{variant:"ghost",size:"small",onClick:o,disabled:t||i||!e.id||!r,children:"Refresh"})})},eC=()=>{const e=N(i=>i.refreshAll),t=N(i=>i.refreshing),{toast:n}=Me(),r=async()=>{if(t)return;const i=await e();i.ok?n({title:"Up to date",description:"Plans, ideas, checks and PR review state re-read.",variant:"success"}):n({title:"Couldn't refresh",description:i.error??"The read failed — is the dev server running?",variant:"error"})};return d.jsx(st,{icon:d.jsx("span",{style:{display:"inline-flex"},className:t?"pc-spin":void 0,children:d.jsx(Z8,{size:16})}),label:t?"Refreshing…":"Refresh data",size:"small",variant:"ghost",disabled:t,onClick:r})},yU=({plan:e,disabled:t})=>{const n=N(c=>c.launchPlanRework),r=N(jn),{toast:i}=Me(),[s,o]=S.useState(!1),a=vk(e.notes),l=async()=>{if(!(!e.id||a.length===0)){o(!0);try{await n(e.id,zW(e,a),{body:e.body,phases:e.phases},a),i({title:"Reworking from your notes",description:"The agent is reworking this entry — you can approve or discard the result."})}catch(c){i({title:"Could not rework from notes",description:c.message,variant:"error"})}finally{o(!1)}}},u=e.id?a.length===0?"Add a margin note first — this turns open notes into phases and edits":r?"Rework this entry from your open margin notes":"No agent CLI found — set up in Settings":"Needs an ID before an agent can run";return d.jsx(me,{content:u,children:d.jsx(q,{variant:"secondary",size:"small",onClick:l,disabled:t||s||!e.id||!r||a.length===0,children:s?"Reworking…":"Rework from my notes"})})},xU=({plan:e,disabled:t})=>{const n=N(u=>u.launchRunAll),r=N(jn),[i,s]=S.useState(!1),o=async()=>{if(e.id){s(!0);try{await n(e.id)}catch(u){alert(u.message)}finally{s(!1)}}},a=t||i||!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(me,{content:l,children:d.jsx(vs,{size:"small",icon:d.jsx("span",{style:{color:ie.textSecondary},children:"▶"}),onClick:o,disabled:a,style:a?{opacity:.5}:void 0,children:i?"Starting…":"Run all phases"})})},vU=({planId:e,hasPoints:t,launching:n,onClick:r,disabled:i})=>{const s=N(jn),o=e?t?s?"Split each review point into rework or a follow-up idea":"No agent CLI found — set up in Settings":"Add a review point first — this proposes rework phases or a follow-up idea for each":"Needs an ID before an agent can run";return d.jsx(me,{content:o,children:d.jsx(q,{variant:"secondary",size:"small",onClick:r,disabled:i||n||!e||!s||!t,children:n?"Splitting…":"Split review"})})},wU=()=>{const e=N(x=>x.launchSuggestIdeas),t=N(x=>x.launchBatchReconcile),n=N(x=>x.launchPrioritise),r=N(x=>x.ideaEntries),i=N(x=>x.suggestions),s=N(Pm),o=N(jn),{toast:a}=Me(),[l,u]=S.useState(null),c=async()=>{u("suggest");try{await e(VW(r,i))}catch(x){a({title:"Failed to launch",description:Rt(x.message),variant:"error"})}finally{u(null)}},h=async()=>{u("actualise");try{await t()}catch(x){a({title:"Failed to launch",description:Rt(x.message),variant:"error"})}finally{u(null)}},f=async()=>{u("prioritise");try{const x=await n();a({title:x.moved.length>0?"Queue reordered":"Already in order",description:x.why||void 0,variant:"success"})}catch(x){a({title:"Failed to prioritise",description:Rt(x.message),variant:"error"})}finally{u(null)}},p=l!==null||s,m=[{id:"suggest-ideas",label:l==="suggest"?"Starting…":"Suggest ideas",icon:d.jsx(O_,{size:16}),disabled:p||!o,onSelect:c},{id:"actualise-all",label:l==="actualise"?"Starting…":"Actualise all",icon:d.jsx(ag,{size:16}),disabled:p||!o,onSelect:h},{id:"prioritise",label:l==="prioritise"?"Prioritising…":"Prioritise queue",icon:d.jsx(tW,{size:16}),disabled:p||!o,onSelect:f}];return d.jsx(V8,{align:"end",trigger:d.jsx(st,{icon:d.jsx(eW,{size:16}),label:"More actions",size:"small",variant:"ghost"}),items:m})};function bU(e){const t=e==null?void 0:e.match(/^[a-z]+\/([a-z]+-\d+)-/);return t?t[1].toUpperCase():null}const zi={fontFamily:je.serif,fontSize:J.sm,fontWeight:600,opacity:.65},kU=({plan:e,auditRunning:t,agentBusy:n,agentPhaseIndex:r,planTask:i,updating:s,onTogglePhase:o,onAddReviewPhases:a,onAddNote:l,onResolveNote:u})=>d.jsxs("div",{style:{marginBottom:R[8]},children:[d.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:R[3],marginBottom:R[3],flexWrap:"wrap"},children:[d.jsx("h3",{style:{...zi,margin:0},children:"Phases"}),d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:R[2],flexWrap:"wrap"},children:[t&&d.jsx(Ws,{size:"small",label:"Audit running…"}),(e.status==="review"||e.status==="done")&&d.jsx(uU,{plan:e}),e.status!=="done"&&d.jsx(gU,{plan:e}),d.jsx(iU,{onAdd:a,disabled:s})]})]}),d.jsx(B4,{data:e.phases,columns:[{key:"checkbox",header:"Status",cell:(c,h)=>d.jsx(bB,{checked:c.done,onChange:()=>o(h),disabled:s}),width:2},{key:"title",header:"Title",cell:c=>d.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:R[2],textDecoration:c.done?"line-through":"none",opacity:c.done?.45:1},children:[c.text,c.source==="review"&&d.jsx(Be,{size:"small",fillColor:Vt.review.fill,textColor:Vt.review.text,children:"review"})]})},{key:"actions",header:"Actions",cell:(c,h)=>d.jsxs("div",{style:{display:"flex",gap:R[2],alignItems:"center"},children:[d.jsx(pU,{planTitle:e.title,planId:e.id,phaseIndex:h}),d.jsx(K_,{label:"Add a note on this phase",onAdd:f=>l({kind:"phase",index:h},f),disabled:s}),!c.done&&r===h?d.jsx(Ws,{size:"small",label:`Agent ${i==null?void 0:i.status}…`}):!c.done&&d.jsx(cU,{planId:e.id,phaseIndex:h,disabled:n})]}),width:5}],expandable:{render:(c,h)=>{const f=xk(e.notes,{kind:"phase",index:h});return!c.description&&f.length===0?null:d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:R[3]},children:[c.description,f.length>0&&d.jsx(Y_,{notes:f,onResolve:u,disabled:s})]})}},showExpandColumn:!1,rowClassName:c=>c.source==="review"?"phase-row-review":void 0,className:"phase-table-phone"})]}),SU=({decisions:e,onSelect:t})=>d.jsxs("div",{style:{marginBottom:R[5]},children:[d.jsx("h3",{style:{...zi,margin:`0 0 ${R[3]}`},children:"Decisions"}),d.jsx("div",{style:{display:"flex",flexDirection:"column",gap:R[3],marginBottom:R[3]},children:e.map(n=>d.jsx(Pe,{size:"small",accent:!0,accentColor:"slate",children:d.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:R[3]},children:[d.jsxs("div",{children:[d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:R[2],marginBottom:R[1]},children:[d.jsx("span",{className:"text-sm",style:{fontWeight:600},children:n.title}),d.jsx(Be,{size:"small",variant:n.status==="superseded"?"warning":"success",children:n.status})]}),d.jsx("div",{className:"text-sm",style:{opacity:.85},children:d.jsx(ka,{children:n.body})})]}),d.jsx(q,{variant:"secondary",size:"small",onClick:()=>t(n),children:"View"})]})},n.title))})]}),_U=({planId:e})=>{const t=MW(e);return t?d.jsxs("div",{style:{marginBottom:R[8]},children:[d.jsx("h3",{style:{...zi,margin:`0 0 ${R[3]}`},children:"Provenance"}),d.jsx(KW,{trail:t})]}):null},CU=({entries:e,onPromote:t})=>d.jsx("div",{style:{display:"flex",flexDirection:"column",gap:R[3],marginBottom:R[4]},children:e.map((n,r)=>d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:R[1]},children:[d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:R[2]},children:[d.jsx("span",{className:"text-sm",style:{fontWeight:600,opacity:.5},children:n.date}),t&&d.jsx(me,{content:"Promote this into a decision",children:d.jsx(q,{variant:"ghost",size:"small",onClick:()=>t(n),children:"Promote to decision"})})]}),d.jsx("div",{className:"text-sm",style:{background:"rgba(0,0,0,0.05)",borderRadius:R[2],padding:`${R[2]} ${R[3]}`,alignSelf:"flex-start",maxWidth:"100%",opacity:.85},children:n.text})]},`${n.date}-${r}`))}),jU=({plan:e,log:t,updating:n,onAdd:r,onPromote:i})=>{const[s,o]=S.useState(""),a=async()=>{s.trim()&&await r(s.trim())&&o("")};return d.jsxs("div",{style:{marginBottom:R[8]},children:[d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:R[3],margin:`0 0 ${R[3]}`},children:[d.jsx("h3",{style:{...zi,margin:0,flex:1},children:"Comments"}),d.jsx(mU,{plan:e,disabled:n})]}),d.jsxs(Pe,{size:"small",children:[t&&t.length>0&&d.jsx(CU,{entries:t,onPromote:i}),d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:R[2]},children:[d.jsx(Gt,{value:s,onChange:l=>o(l.target.value),placeholder:"Add a comment…",rows:2}),d.jsx("div",{style:{display:"flex",justifyContent:"flex-end"},children:d.jsx(q,{variant:"secondary",size:"small",onClick:a,disabled:n||!s.trim(),children:"Send"})})]})]})]})},PU=({entries:e})=>d.jsx("div",{style:{display:"flex",flexDirection:"column",gap:R[3],marginBottom:R[4]},children:e.map((t,n)=>d.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-end",gap:R[1]},children:[d.jsx("div",{className:"text-sm",style:{background:ie.accentSlate,color:"#fff",borderRadius:R[2],borderBottomRightRadius:R[1],padding:`${R[2]} ${R[3]}`,maxWidth:"85%"},children:t.text}),d.jsxs("span",{className:"text-sm",style:{fontWeight:600,opacity:.45},children:["You · ",t.date]})]},`${t.date}-${n}`))}),EU=({plan:e,review:t,updating:n,onAdd:r})=>{const[i,s]=S.useState(""),{toast:o}=Me(),a=t!==void 0&&t.length>0,{launching:l,result:u,outcome:c,launch:h,approve:f,discard:p}=IW(e),m=async()=>{i.trim()&&await r(i.trim())&&(s(""),o({title:"Added to the review",variant:"success"}))};return d.jsxs("div",{style:{marginBottom:R[8]},children:[d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:R[3],margin:`0 0 ${R[3]}`},children:[d.jsx("h3",{style:{...zi,margin:0,flex:1},children:"Review"}),d.jsx(vU,{planId:e.id,hasPoints:(e.review??[]).length>0,launching:l,onClick:h,disabled:n})]}),d.jsxs(Pe,{size:"small",accent:!0,accentColor:"slate",children:[a?d.jsx(PU,{entries:t}):d.jsx("p",{className:"text-sm",style:{margin:`0 0 ${R[3]}`,color:ie.textSecondary},children:"Talk through what's wrong in your own words — then Split review turns each point into rework phases here or a follow-up idea."}),d.jsx(JW,{launching:l,result:u,outcome:c,onApprove:f,onDiscard:p}),d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:R[2]},children:[d.jsx(Gt,{value:i,onChange:x=>s(x.target.value),placeholder:"What's wrong with this plan, in your own words…",rows:3,disabled:n}),d.jsx("div",{style:{display:"flex",justifyContent:"flex-end"},children:d.jsx(q,{variant:"secondary",size:"small",onClick:m,disabled:n||!i.trim(),children:"Add review"})})]})]})]})},TU=({plan:e})=>{const t=N(K=>K.plans),n=N(K=>K.openQuestions),r=N(K=>K.decisions),[i,s]=S.useState(null),o=N(K=>K.gitBranch),a=N(K=>K.loadGitStatus),{toast:l}=Me(),{patch:u,updating:c}=ro(),[h,f]=S.useState(!1),[p,m]=S.useState(null),x=N(K=>K.promoteClarification),[w,g]=S.useState(null),[y,v]=S.useState(null),k=N(K=>K.agentStatus),P=N(Pm),b=N(K=>K.detailView),C=Sm(e.id,k),j=C?C.phaseIndex:null,T=(C==null?void 0:C.taskKind)==="audit",E=km(e),A=e.phases.length>0,M=e.status==="review"||e.status==="done",F=b==="feedback"&&M,D={id:e.id??null,title:e.title,body:e.body,log:e.log},L=((t==null?void 0:t.entries)??[]).filter(K=>K.id!==e.id),$=e.id!==void 0&&bU(o)===e.id,U=e.status==="planned"||e.status==="in-progress"||e.status==="review",z=async()=>{if(e.id){f(!0);try{const K=await KL(e.id);l({title:"Branch ready",description:`Now on ${K}`,variant:"success"}),await a()}catch(K){l({title:"Branch failed",description:Rt(K.message),variant:"error"})}finally{f(!1)}}},V=async K=>{const xe=e.phases.map((wt,Ui)=>Ui===K?{...wt,done:!wt.done}:wt);xe.every(wt=>wt.done)&&e.status==="in-progress"?await u(e.title,{phases:xe,status:"review"}):await u(e.title,{phases:xe})},_=async K=>{await u(e.title,{phases:[...e.phases,...K]})},B=async K=>{const Le={date:new Date().toISOString().slice(0,10),text:K.replace(/\n/g," ")};return u(e.title,{log:[...e.log??[],Le]})},X=async K=>{const Le={date:new Date().toISOString().slice(0,10),text:K.replace(/\n/g," ")};return u(e.title,{review:[...e.review??[],Le]})},I=async(K,xe)=>{const Le={anchor:K,prose:xe,state:"open"};return u(e.title,{notes:[...e.notes??[],Le]})},ue=async K=>{var Le;if(!e.id)return;const xe=(Le=e.clarifications)==null?void 0:Le[K];if(xe){g(K);try{await x(e.id,xe),l({title:"Promoted to an open question",variant:"success"})}catch(wt){l({title:"Promote failed",description:Rt(wt.message),variant:"error"})}finally{g(null)}}},fe=async K=>{const xe=(e.notes??[]).map(Le=>Le===K?{...Le,state:"resolved"}:Le);return u(e.title,{notes:xe})},de=xk(e.notes,{kind:"body"}),ot=n.filter(K=>K.status==="open"&&K.blocks===e.id),Ve=MM(r,e);return d.jsxs("div",{children:[d.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:R[3],margin:`0 0 ${R[3]}`,flexWrap:"wrap"},children:[d.jsxs("h2",{style:{...Z_,margin:0,display:"flex",alignItems:"center",gap:R[3],minWidth:0,flexWrap:"wrap"},children:[d.jsx(ri,{id:e.id}),e.title]}),d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:R[2],flexShrink:0},children:[d.jsx("span",{className:"text-sm",style:{opacity:.45,whiteSpace:"nowrap"},children:e.updated?`updated ${Wc(e.updated)}`:`created ${Wc(e.created)}`}),vk(e.notes).length>0&&d.jsx(yU,{plan:e,disabled:c}),d.jsx(eC,{})]})]}),F?d.jsx(EU,{plan:e,review:e.review,updating:c,onAdd:X}):d.jsxs(d.Fragment,{children:[(U||e.pr)&&d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:R[3],flexWrap:"wrap",marginBottom:R[4]},children:[U&&!$&&d.jsx(Pe,{size:"small",accent:!0,accentColor:"amber",children:d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:R[3],flexWrap:"wrap"},children:[d.jsxs("span",{className:"text-sm",children:["Working branch: ",d.jsx("code",{children:o??"unknown"})," — not this plan's branch."]}),e.id&&d.jsx(me,{content:`Creates ${(e.kind??"feat").toLowerCase()}/${e.id.toLowerCase()}-… from main, or switches to it if it already exists`,children:d.jsx(q,{variant:"secondary",size:"small",onClick:z,disabled:h,children:h?"Switching…":"Create branch"})})]})}),U&&$&&d.jsxs("span",{className:"text-sm",style:{opacity:.45},children:["Working branch: ",d.jsx("code",{children:o})]}),e.pr&&d.jsx(X_,{pr:e.pr}),e.pr&&d.jsx(YW,{pr:e.pr})]}),E!==null&&d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:R[3],marginBottom:R[4]},children:[d.jsx("div",{style:{flex:1},children:d.jsx(J_,{pct:E.pct,color:Q_[_m(e,k)]})}),d.jsxs("span",{className:"text-sm",style:{opacity:.5,flexShrink:0},children:[E.done,"/",E.total]})]}),d.jsxs("div",{style:{marginBottom:R[4]},children:[d.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:R[2]},children:[d.jsx("div",{style:{flex:1,opacity:.85},children:e.body&&d.jsx(WW,{resetKey:e.id??e.title,children:d.jsx(ka,{children:e.body})})}),d.jsx(K_,{label:"Add a note on this plan's body",onAdd:K=>I({kind:"body"},K),disabled:c})]}),de.length>0&&d.jsx("div",{style:{marginTop:R[3]},children:d.jsx(Y_,{notes:de,onResolve:fe,disabled:c})})]}),ot.length>0&&d.jsxs("div",{style:{marginBottom:R[5]},children:[d.jsx("h3",{style:{...zi,margin:`0 0 ${R[3]}`},children:"Open questions"}),d.jsx("div",{style:{display:"flex",flexDirection:"column",gap:R[3],marginBottom:R[3]},children:ot.map(K=>d.jsx(Pe,{size:"small",accent:!0,accentColor:"amber",children:d.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:R[3]},children:[d.jsxs("div",{children:[d.jsx("div",{className:"text-sm",style:{fontWeight:600,marginBottom:R[1]},children:K.title}),d.jsx("div",{className:"text-sm",style:{opacity:.85},children:d.jsx(ka,{children:K.body})})]}),d.jsx(q,{variant:"secondary",size:"small",onClick:()=>m(K),children:"Resolve"})]})},K.title))})]}),Ve.length>0&&d.jsx(SU,{decisions:Ve,onSelect:s}),e.clarifications&&e.clarifications.length>0&&d.jsxs("div",{style:{marginBottom:R[5]},children:[d.jsx("h3",{style:{...zi,margin:`0 0 ${R[3]}`},children:"Clarifications"}),d.jsx("div",{style:{display:"flex",flexDirection:"column",gap:R[2],marginBottom:R[3]},children:e.clarifications.map((K,xe)=>d.jsxs("div",{className:"text-sm",style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:R[3],opacity:.75},children:[d.jsxs("span",{children:[d.jsx("span",{style:{fontWeight:600,marginRight:R[2]},children:K.date}),K.text]}),d.jsxs("div",{style:{display:"flex",gap:R[2],flexShrink:0},children:[d.jsx(me,{content:"Graduate this into an open question that outlives this entity",children:d.jsx(q,{variant:"ghost",size:"small",onClick:()=>ue(xe),disabled:w!==null,children:w===xe?"Promoting…":"Promote"})}),d.jsx(me,{content:"Promote this straight into a decision",children:d.jsx(q,{variant:"ghost",size:"small",onClick:()=>v({source:"clarification",entry:K}),children:"Promote to decision"})})]})]},`clar-${K.date}-${xe}`))})]}),!A&&d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:R[3],marginBottom:R[8]},children:[d.jsx(Hu,{idea:D,otherPlans:L}),d.jsx(fg,{idea:D})]}),A&&d.jsx(kU,{plan:e,auditRunning:T,agentBusy:P,agentPhaseIndex:j,planTask:C,updating:c,onTogglePhase:V,onAddReviewPhases:_,onAddNote:I,onResolveNote:fe}),d.jsx(_U,{planId:e.id}),d.jsx(jU,{plan:e,log:e.log,updating:c,onAdd:B,onPromote:K=>v({source:"comment",entry:K})})]}),d.jsx(nU,{question:p,onClose:()=>m(null)}),d.jsx(B_,{decision:i,onClose:()=>s(null)}),e.id&&d.jsx(eU,{entityId:e.id,source:(y==null?void 0:y.source)??"comment",entry:(y==null?void 0:y.entry)??null,onClose:()=>v(null)})]})},RU=()=>{const[e,t]=S.useState(new Set);return S.useEffect(()=>{let n=!1;return TL().then(r=>{n||!r||t(new Set(r.horizons.flatMap(i=>i.items.map(s=>s.name))))}).catch(()=>{}),()=>{n=!0}},[]),e},To={fontSize:J.sm,fontWeight:600,opacity:.6,whiteSpace:"nowrap",overflow:"hidden"},pg=36,mg=({order:e,done:t,running:n,status:r})=>d.jsx("span",{style:{flex:`0 0 ${pg}px`,display:"flex",alignItems:"center",justifyContent:"center"},children:n?d.jsx(Ws,{size:"small",label:"Agent running"}):t?d.jsx("span",{"aria-label":"Done",style:{color:ie.accentGreenDark,fontSize:J.sm},children:"✓"}):e!==void 0?d.jsx(Be,{size:"small",fillColor:"rgba(0,0,0,0.06)",children:d.jsx("span",{style:{fontFamily:je.handwritten,fontSize:J.xs,lineHeight:1},children:e})}):r==="idea"?d.jsx("span",{"aria-label":"Backlog — not planned yet",style:{display:"inline-flex",color:ie.textTertiary},children:d.jsx(ug,{size:14})}):null}),tC=({plans:e,activePlanTitle:t,onOpen:n,showHeader:r=!0})=>{const i="plan-rows-grid",s=N(o=>o.agentStatus);return d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:R[1]},children:[r&&d.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[d.jsx("span",{style:{flex:`0 0 ${pg}px`}}),d.jsx("div",{style:{flex:1,minWidth:0},children:d.jsx(Pe,{size:"small",texture:"kraft",className:"plan-row-card",children:d.jsxs("div",{className:i,children:[d.jsx("span",{style:To,children:"Id"}),d.jsx("span",{style:To,children:"Title"}),d.jsx("span",{className:"plan-rows-cell-updated",style:To,children:"Updated"}),d.jsx("span",{style:To,children:"Progress"}),d.jsx("span",{style:To,children:"Status"})]})})})]}),e.map(o=>{var u;const a=km(o),l=_m(o,s);return d.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[d.jsx(mg,{order:o.order,done:o.status==="done",status:o.status,running:!!Sm(o.id,s)}),d.jsx("div",{role:n?"button":void 0,tabIndex:n?0:void 0,onClick:n?()=>n(o.title):void 0,onKeyDown:n?c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),n(o.title))}:void 0,className:o.title===t?"plan-row-highlighted":void 0,style:{cursor:n?"pointer":void 0,borderRadius:10,flex:1,minWidth:0},children:d.jsx(Pe,{size:"small",texture:"canvas",className:"plan-row-card",children:d.jsxs("div",{className:i,children:[d.jsx(ri,{id:o.id}),d.jsx("span",{style:{fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:o.title}),d.jsx("span",{className:"plan-rows-cell-updated text-sm",style:{opacity:.45,whiteSpace:"nowrap"},children:o.updated?Wc(o.updated):Wc(o.created)}),a?d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:R[1]},children:[d.jsx("div",{style:{flex:1,minWidth:0},children:d.jsx(J_,{pct:a.pct,color:Q_[l]})}),d.jsxs("span",{className:"text-sm",style:{opacity:.5,flexShrink:0},children:[a.done,"/",a.total]})]}):d.jsx("span",{className:"text-sm",style:{opacity:.3},children:"—"}),d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:R[1]},children:[d.jsx(Be,{size:"small",fillColor:Vt[l].fill,textColor:Vt[l].text,children:hg[l]}),((u=o.pr)==null?void 0:u.state)==="merged"&&d.jsx(me,{content:`Merged in #${o.pr.number}`,children:d.jsx("span",{style:{display:"inline-flex",color:sp.merged.text},children:d.jsx(Uu,{size:14})})})]})]})})})]},o.title)})]})},IU=5,AU={fontSize:J.sm,fontWeight:600,opacity:.6,whiteSpace:"nowrap",overflow:"hidden"},V0={fontFamily:je.handwritten,fontSize:J.xs,fontWeight:600,opacity:.55,lineHeight:1,padding:`${R[2]} ${R[1]} 0`},W0={...AU,background:"none",border:"none",padding:0,cursor:"pointer",font:"inherit",color:"inherit",textAlign:"left"},MU=[{key:"id",label:"Id"},{key:"title",label:"Title"},{key:"updated",label:"Updated"},{key:"progress",label:"Progress"},{key:"status",label:"Status"}],nC={display:"flex",alignItems:"center",gap:R[2],minWidth:0,background:"none",border:"none",padding:0,cursor:"pointer",textAlign:"left",font:"inherit",color:"inherit",fontWeight:600},rC={overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},LU=({rows:e,plans:t,activePlanTitle:n,onOpenPlan:r,onOpenIdea:i})=>{const[s,o]=S.useState(new Set),{subjects:a,loading:l,available:u}=W_(),c=RU(),h=_n(),f="plan-rows-grid",p=N(b=>b.planFilters.sortKey),m=N(b=>b.planFilters.sortDirection),x=N(b=>b.setPlanSortKey),w=N(b=>b.togglePlanSortDirection),g=b=>{b===p?w():x(b)},y=b=>{o(C=>{const j=new Set(C);return j.has(b)?j.delete(b):j.add(b),j})},v=b=>b.type==="plan"?d.jsx(tC,{plans:[b.plan],activePlanTitle:n,onOpen:r,showHeader:!1},b.plan.title):b.type==="note"?d.jsx(DU,{row:b,onOpen:i},b.idea.title):d.jsx(NU,{row:b,plans:t,activePlanTitle:n,onOpenPlan:r,onOpenIdea:i,expanded:s.has(b.idea.title),onToggleExpanded:()=>y(b.idea.title)},b.idea.title),k=UM(e,l||!u?void 0:a),P=k.length>1;return d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:R[1]},children:[d.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[d.jsx("span",{role:"columnheader",style:{flex:`0 0 ${pg}px`,display:"flex",justifyContent:"center"},"aria-sort":p==="order"?m==="asc"?"ascending":"descending":void 0,children:d.jsxs("button",{type:"button",style:W0,"aria-label":"Sort by run order",onClick:()=>g("order"),children:["#",p==="order"&&(m==="asc"?"▲":"▼")]})}),d.jsx("div",{style:{flex:1,minWidth:0},children:d.jsx(Pe,{size:"small",texture:"kraft",className:"plan-row-card",children:d.jsx("div",{className:f,children:MU.map(({key:b,label:C})=>{const j=b===p;return d.jsx("span",{role:"columnheader",className:b==="updated"?"plan-rows-cell-updated":void 0,"aria-sort":j?m==="asc"?"ascending":"descending":void 0,children:d.jsxs("button",{type:"button",style:W0,onClick:()=>g(b),children:[C,j&&(m==="asc"?" ▲":" ▼")]})},b)})})})})]}),P?k.map(b=>{const C=b.subject;return d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:R[1]},children:[d.jsx("div",{style:{display:"flex",alignItems:"baseline",gap:R[2]},children:C&&c.has(C)?d.jsx("button",{type:"button",className:"subject-header-link",title:"View in roadmap",onClick:()=>h({to:"/roadmap",search:{item:C}}),style:{...V0,background:"none",border:"none",cursor:"pointer",textAlign:"left"},children:C}):d.jsx("div",{style:V0,children:C??"No subject"})}),b.rows.map(j=>v(j))]},C??"__no-subject__")}):e.map(b=>v(b))]})},DU=({row:e,onOpen:t})=>{const n=e.idea,r=n.status??"open";return d.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[d.jsx(mg,{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?i=>{(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),t(n.title))}:void 0,style:{cursor:t?"pointer":void 0,borderRadius:10,flex:1,minWidth:0},children:d.jsx(Pe,{size:"small",texture:"canvas",className:"plan-row-card",children:d.jsxs("div",{className:"plan-rows-grid",children:[n.id?d.jsx(ri,{id:n.id}):d.jsx("span",{}),d.jsxs("span",{style:{...nC,cursor:"inherit"},children:[d.jsx(iW,{}),d.jsx("span",{style:rC,children:n.title})]}),d.jsx("span",{className:"plan-rows-cell-updated text-sm",style:{opacity:.45},children:"—"}),d.jsx("span",{className:"text-sm",style:{opacity:.3},children:"—"}),d.jsx(Be,{size:"small",fillColor:ou[r].fill,textColor:ou[r].text,children:q_[r]})]})})})]})},NU=({row:e,plans:t,activePlanTitle:n,onOpenPlan:r,onOpenIdea:i,expanded:s,onToggleExpanded:o})=>{const a=e.idea,l=e.children,u=l.filter(p=>p.status==="done"),c=l.filter(p=>p.status!=="done"),h=l.length>IU,f=h&&!s?c:l;return d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:R[1]},children:[d.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[d.jsx(mg,{order:a.order,done:a.status==="done",status:a.status}),d.jsx("div",{style:{flex:1,minWidth:0},children:d.jsx(Pe,{size:"small",texture:"canvas",className:"plan-row-card",children:d.jsxs("div",{className:"idea-group-row-grid",style:{display:"grid",gridTemplateColumns:"76px minmax(0, 1fr) 84px 1fr",gap:R[2],alignItems:"center"},children:[a.id?d.jsx(ri,{id:a.id}):d.jsx("span",{}),d.jsxs("button",{type:"button",onClick:()=>i==null?void 0:i(a.title),style:nC,children:[d.jsx(ug,{}),d.jsx("span",{style:rC,children:a.title})]}),d.jsx("span",{className:"plan-rows-cell-updated text-sm",style:{opacity:.45},children:"—"}),d.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:R[2]},children:[d.jsx("span",{className:"text-sm",style:{opacity:l.length>0?.6:.3},children:l.length>0?`${u.length}/${l.length} plans done`:"—"}),d.jsx(fg,{idea:a,compact:!0}),d.jsx(Hu,{idea:a,otherPlans:t})]})]})})})]}),l.length>0&&d.jsxs("div",{style:{marginLeft:R[5],paddingLeft:R[3],borderLeft:"2px solid rgba(0,0,0,0.08)",display:"flex",flexDirection:"column",gap:R[1]},children:[d.jsx(tC,{plans:f,activePlanTitle:n,onOpen:r,showHeader:!1}),h&&d.jsx("button",{type:"button",onClick:o,style:{alignSelf:"flex-start",background:"none",border:"none",padding:`${R[1]} 0`,opacity:.6,cursor:"pointer",textDecoration:"underline",fontSize:J.xs,font:"inherit"},children:s?"Show less":`+${u.length} done`})]})]})},zU=({plans:e,rows:t,activePlanTitle:n,onOpenPlan:r,onOpenIdea:i})=>{const s=S.useRef(null);return S.useEffect(()=>{var a;if(!n)return;const o=(a=s.current)==null?void 0:a.querySelector(".plan-row-highlighted");o==null||o.scrollIntoView({behavior:"smooth",block:"center"})},[n]),d.jsx("div",{ref:s,children:t.length>0?d.jsx(LU,{rows:t,plans:e,activePlanTitle:n,onOpenPlan:r,onOpenIdea:i}):d.jsx("p",{style:{opacity:.5,padding:`${R[6]} 0`,textAlign:"center"},children:"Nothing matches these filters — clear one, or check back once something moves into this status."})})},OU=({idea:e})=>d.jsxs("div",{style:{fontFamily:je.body,fontSize:J.base,lineHeight:$c.relaxed,color:ie.textProse},children:[d.jsxs("h2",{style:{...Z_,margin:`0 0 ${R[4]}`,display:"flex",alignItems:"center",gap:R[3],flexWrap:"wrap"},children:[d.jsx(ri,{id:e.id??void 0}),e.title,e.status&&d.jsx(Be,{size:"small",fillColor:ou[e.status].fill,textColor:ou[e.status].text,children:q_[e.status]})]}),d.jsx(ka,{children:e.body.replace(/^#{1,3}\s+.+(\n|$)/,"").replace(/^\s*-{3,}\s*(\n|$)/,"").trim()}),d.jsx("div",{style:{marginTop:R[6]},children:d.jsx(fg,{idea:e})})]}),yh="__no-subject__",ci={fontFamily:je.handwritten,fontSize:J.xs,fontWeight:600,lineHeight:1,color:ie.textTertiary,margin:`0 0 ${R[2]}`},FU=()=>{const e=N(j=>j.plans),t=dg(),n=N(Pm),r=N(j=>j.agentStatus),{patch:i,updating:s}=ro(),{subjects:o,available:a}=W_(),l=N(j=>j.detailView),u=N(j=>j.setDetailView),c=t?e==null?void 0:e.entries.find(j=>j.title===t):null,[h,f]=S.useState("");if(S.useEffect(()=>{f((c==null?void 0:c.order)!==void 0?String(c==null?void 0:c.order):"")},[c==null?void 0:c.order]),!c)return null;const p=_m(c,r),m=c.status==="in-progress",x=c.status==="review",w=c.status==="dropped",g=c.phases.some(j=>!j.done),y=(c.status==="planned"||m)&&g,v=!!(c.pr&&(c.pr.state==="open"||c.pr.state==="draft")&&c.pr.unresolvedThreadCount),k=a&&c.subject&&!o.includes(c.subject)?c.subject:void 0,P=j=>i(c.title,j),b=m||x||c.status==="planned",C=async()=>{const j=h.trim(),T=Number(j);if(j===""||!Number.isInteger(T)||T<1){f(c.order!==void 0?String(c.order):"");return}T!==c.order&&await P({order:T})};return d.jsx("div",{style:{marginTop:`calc(-1 * ${R[5]})`},children:d.jsx(Pe,{surface:"paper",texture:"speckle",size:"small",children:d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:R[5]},children:[d.jsx("h2",{style:{margin:0,fontFamily:je.serif,fontSize:J.base,color:ie.textPrimary},children:"Plan"}),(x||c.status==="done")&&d.jsxs("div",{children:[d.jsx("div",{style:ci,children:"Views"}),d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:R[1]},children:[d.jsx(vs,{size:"small",active:l==="details",onClick:()=>u("details"),children:"Details"}),d.jsx(vs,{size:"small",active:l==="feedback",onClick:()=>u("feedback"),children:"Feedback"})]})]}),d.jsxs("div",{children:[d.jsx("div",{style:ci,children:"Status"}),d.jsx(Be,{size:"small",fillColor:Vt[p].fill,textColor:Vt[p].text,children:hg[p]})]}),d.jsxs("div",{children:[d.jsx("div",{style:ci,children:"Subject"}),d.jsx(rp,{size:"small",value:c.subject??yh,onChange:j=>P({subject:j===yh?null:j}),disabled:s||!a,options:[{value:yh,label:"No subject"},...k?[{value:k,label:`${k} (orphan)`}]:[],...!a&&c.subject&&!k?[{value:c.subject,label:c.subject}]:[],...o.map(j=>({value:j,label:j}))]})]}),b&&d.jsxs("div",{children:[d.jsx("div",{style:ci,children:"Order"}),d.jsx($a,{type:"number",size:"small","aria-label":"Run order",min:1,value:h,onChange:j=>f(j.target.value),onBlur:C,disabled:s})]}),d.jsxs("div",{children:[d.jsx("div",{style:ci,children:"Agent"}),d.jsx(rp,{size:"small",value:c.agent??"",onChange:j=>P({agent:j||null}),disabled:s,options:[{value:"",label:"Project default agent"},...OM.map(j=>({value:j,label:wk[j]}))]})]}),c.tags.length>0&&d.jsxs("div",{children:[d.jsx("div",{style:ci,children:"Tags"}),d.jsx("div",{style:{display:"flex",alignItems:"center",gap:R[1],flexWrap:"wrap"},children:c.tags.map(j=>d.jsx(Be,{size:"small",fillColor:"rgba(0,0,0,0.06)",children:j},j))})]}),d.jsxs("div",{children:[d.jsx("div",{style:ci,children:"Actions"}),d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:R[1]},children:[y&&d.jsx(xU,{plan:c,disabled:n||s}),v&&d.jsx(dU,{plan:c,disabled:n||s}),x&&d.jsx(vs,{size:"small",icon:d.jsx("span",{style:{color:ie.accentGreenDark},children:"✓"}),onClick:()=>P({status:"done"}),disabled:s,style:s?{opacity:.5}:void 0,children:"Approve & close"}),d.jsx(vs,{size:"small",icon:d.jsx("span",{style:{color:w?ie.accentGreenDark:ie.accentRoseDark},children:w?"↺":"⊘"}),onClick:()=>P({status:w?null:"dropped"}),disabled:s,style:s?{opacity:.5}:void 0,children:w?"Reopen plan":"Mark dropped"})]})]})]})})})},U0=8,$U=["in-progress","review","planned","idea","done","dropped"],BU={...hg,idea:"Backlog"},H0={fontSize:J["2xs"],fontWeight:600,letterSpacing:"0.08em",textTransform:"uppercase",color:ie.textTertiary,margin:`0 0 ${R[2]}`},VU=()=>{const e=N(v=>v.plans),t=dg(),n=N(v=>v.planFilters),r=N(v=>v.togglePlanStatus),i=N(v=>v.togglePlanTag),s=N(v=>v.setPlanSearch),o=N(v=>v.setSubjectFilter),a=_n(),[l,u]=S.useState(!1);if(!e||t)return null;const{statusCounts:c,tagCounts:h}=Jl(e.entries,n),f=new Set(n.statuses),p=new Set(n.tags),x=[...new Set([...Object.keys(h),...n.tags])].sort((v,k)=>{const P=(h[k]??0)-(h[v]??0);return P!==0?P:v.localeCompare(k)}),w=l?x:x.slice(0,U0),g=x.length-w.length,y={background:"none",border:"none",padding:0,cursor:"pointer",opacity:.7,textDecoration:"underline",fontSize:J["2xs"]};return d.jsx("div",{style:{marginTop:`calc(-1 * ${R[5]})`},children:d.jsx(Pe,{surface:"paper",texture:"speckle",size:"small",children:d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:R[5]},children:[d.jsx("h2",{style:{margin:0,fontFamily:je.serif,fontSize:J.base,color:ie.textPrimary},children:"Filters"}),d.jsx($a,{type:"search",size:"small",placeholder:"Search plans…","aria-label":"Search plans",value:n.search,onChange:v=>s(v.target.value)}),n.subject!==null&&d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:R[2]},"data-testid":"subject-filter-chip",children:[d.jsxs("span",{style:{fontSize:J["2xs"],opacity:.7},children:["Subject: ",n.subject]}),d.jsx("button",{type:"button",onClick:()=>{o(null),a({to:"/",search:{}})},style:y,children:"Clear"})]}),d.jsxs("div",{children:[d.jsx("div",{style:H0,children:"Status"}),d.jsx("div",{style:{display:"flex",flexDirection:"column",gap:R[1]},children:$U.map(v=>{const k=f.has(v);return d.jsxs("button",{type:"button",onClick:()=>r(v),"aria-pressed":k,style:{display:"flex",alignItems:"center",gap:R[2],width:"100%",padding:`${R[1]} ${R[2]}`,borderRadius:6,border:"none",cursor:"pointer",textAlign:"left",background:k?"rgba(0,0,0,0.05)":"transparent",opacity:k?1:.5},children:[d.jsx("span",{style:{width:9,height:9,borderRadius:"50%",flexShrink:0,background:Vt[v].text}}),d.jsx("span",{style:{flex:1,fontSize:J.xs,color:ie.textPrimary},children:BU[v]}),d.jsx("span",{style:{fontSize:J["2xs"],color:ie.textSecondary},children:c[v]})]},v)})})]}),d.jsxs("div",{children:[d.jsx("div",{style:H0,children:"Tags"}),d.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:R[1],alignItems:"center"},children:[x.length===0&&d.jsx("span",{style:{opacity:.5,fontSize:J["2xs"]},children:"No tags"}),w.map(v=>{const k=p.has(v);return d.jsxs("button",{type:"button",onClick:()=>i(v),"aria-pressed":k,style:{fontSize:J["2xs"],padding:`2px ${R[2]}`,borderRadius:6,border:"0.5px solid rgba(0,0,0,0.12)",cursor:"pointer",background:k?"rgba(0,0,0,0.08)":"transparent",opacity:k?1:.55},children:[v," ",h[v]??0]},v)}),g>0&&d.jsxs("button",{type:"button",onClick:()=>u(!0),style:y,children:["+",g," more"]}),l&&x.length>U0&&d.jsx("button",{type:"button",onClick:()=>u(!1),style:y,children:"Show less"})]})]})]})})})},G0=()=>d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:R[3],marginBottom:R[6],flexWrap:"wrap"},children:[d.jsx("h1",{className:"text-4xl",style:{flex:1,fontFamily:je.serif,fontWeight:600,color:ie.textPrimary,margin:0,lineHeight:1.1},children:"Ideas"}),d.jsx(eC,{}),d.jsx(hU,{}),d.jsx(lU,{}),d.jsx(wU,{})]}),WU=[{key:"a",title:"72%"},{key:"b",title:"54%"},{key:"c",title:"83%"},{key:"d",title:"46%"},{key:"e",title:"66%"},{key:"f",title:"58%"}],UU=()=>d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:R[1]},"aria-hidden":"true",children:[d.jsx(Pe,{size:"small",texture:"kraft",className:"plan-row-card",children:d.jsxs("div",{className:"plan-rows-grid",children:[d.jsx(Jt,{variant:"text",width:36}),d.jsx(Jt,{variant:"text",width:28}),d.jsx(Jt,{variant:"text",width:44}),d.jsx("span",{className:"plan-rows-cell-updated",children:d.jsx(Jt,{variant:"text",width:56})}),d.jsx(Jt,{variant:"text",width:64}),d.jsx(Jt,{variant:"text",width:48})]})}),WU.map(e=>d.jsx(Pe,{size:"small",className:"plan-row-card",children:d.jsxs("div",{className:"plan-rows-grid",children:[d.jsx(Jt,{variant:"text",width:16}),d.jsx(Jt,{variant:"rect",width:44,height:18}),d.jsx(Jt,{variant:"text",width:e.title}),d.jsx("span",{className:"plan-rows-cell-updated",children:d.jsx(Jt,{variant:"text",width:52})}),d.jsx(Jt,{variant:"rect",width:80,height:8}),d.jsx(Jt,{variant:"rect",width:64,height:20})]})},e.key))]}),HU=()=>{const e=N(c=>c.reconcileQueue),t=N(c=>c.removeFromReconcileQueue),n=N(c=>c.plans),{patch:r}=ro(),{toast:i}=Me(),s=S.useRef(0),o=e[0]??null,a=o?(n==null?void 0:n.entries.find(c=>c.id===o.planId))??null:null;if(S.useEffect(()=>{o&&!a&&t(o.previewId)},[o,a,t]),S.useEffect(()=>{e.length===0&&(s.current=0)},[e.length]),!o||!a)return null;const l=async()=>{o.notes&&o.notes.length>0&&!await r(a.title,{notes:AM(a.notes,o.notes)},{errorTitle:"Could not resolve notes"})||(t(o.previewId),s.current+=1,i({title:"Kept the reconciled version",description:`"${a.title}" keeps the agent's rewrite.`}))},u=async()=>{await r(a.title,{body:o.before.body,phases:o.before.phases},{errorTitle:"Discard failed"})&&(t(o.previewId),s.current+=1)};return d.jsx(QW,{plan:a,before:o.before,onApprove:l,onDiscard:u,queuePosition:{index:s.current+1,total:s.current+e.length}})},GU=({suggestions:e,onOpen:t,onDismiss:n})=>e.length===0?null:d.jsxs("div",{style:{marginTop:R[5]},children:[d.jsx("h2",{className:"text-sm",style:{margin:`0 0 ${R[2]}`,opacity:.6},children:"Suggested from AI"}),d.jsx("div",{style:{display:"flex",flexDirection:"column",gap:R[1]},children:e.map(r=>d.jsx("div",{style:{borderRadius:10},children:d.jsx(Pe,{size:"small",texture:"canvas",className:"plan-row-card",children:d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:R[2]},children:[d.jsxs("button",{type:"button",onClick:()=>t(r),style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:R[2],background:"none",border:"none",padding:0,cursor:"pointer",textAlign:"left",font:"inherit",color:"inherit"},children:[d.jsx(ug,{}),d.jsx("span",{style:{fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:r.title})]}),d.jsx(st,{icon:d.jsx("span",{children:"×"}),variant:"ghost",size:"small",label:"Dismiss",style:{width:28,height:28},onClick:()=>n(r)})]})})},`${r.date}-${r.title}`))})]}),gg=()=>{const e=N(b=>b.plans),t=N(b=>b.plansError),n=N(b=>b.ideaEntries),r=N(b=>b.suggestions);N(b=>b.loadPlans);const i=N(b=>b.setDetailView),s=N(b=>b.planFilters),o=N(b=>b.setSubjectFilter),a=dg(),l=SW(),u=N(b=>b.dismissSuggestion),c=_n(),{toast:h}=Me(),{subject:f}=om({strict:!1});S.useEffect(()=>{o(f??null)},[f,o]),S.useEffect(()=>{i("details")},[a,l,i]);const p=()=>{c({to:"/"})},m=b=>{c({to:"/plans/$planId",params:{planId:encodeURIComponent(b)}})},x=b=>{c({to:"/ideas/$ideaId",params:{ideaId:encodeURIComponent(b)}})},[w,g]=S.useState(null),y=async b=>{try{await u(b)}catch(C){h({title:"Failed to dismiss suggestion",description:C.message,variant:"error"})}},v=a?e==null?void 0:e.entries.find(b=>b.title===a):null,k=l?n.find(b=>b.title===l):null;if(t)return d.jsxs("div",{children:[d.jsx(RW,{children:"Ideas"}),d.jsxs(Pe,{size:"small",accent:!0,accentColor:"rose",children:[d.jsx("p",{style:{margin:0,fontWeight:600},children:"Couldn't load plans.md"}),d.jsx("p",{style:{margin:0,opacity:.75},children:t})]})]});if(!e)return d.jsxs("div",{children:[d.jsx(G0,{}),d.jsx("output",{"aria-live":"polite",className:"sr-only",children:"Loading plans…"}),d.jsx(UU,{})]});const{rows:P}=HM(e.entries,n,s);return d.jsxs(d.Fragment,{children:[d.jsx(HU,{}),v?d.jsxs("div",{children:[d.jsx("div",{style:{marginBottom:R[4]},children:d.jsx(I0,{items:[{id:"plans",label:"Ideas",onClick:p},{id:"plan",label:v.title}]})}),d.jsx(TU,{plan:v})]}):k?d.jsxs("div",{children:[d.jsx("div",{style:{marginBottom:R[4]},children:d.jsx(I0,{items:[{id:"plans",label:"Ideas",onClick:p},{id:"idea",label:k.title}]})}),d.jsx(OU,{idea:k})]}):d.jsxs("div",{children:[d.jsx(G0,{}),e.warnings.length>0&&d.jsxs(Pe,{size:"small",accent:!0,accentColor:"amber",children:[d.jsx("p",{style:{margin:0,fontWeight:600},children:"Some entries couldn't be parsed"}),d.jsx("ul",{style:{margin:0,paddingLeft:R[5]},children:e.warnings.map(b=>d.jsxs("li",{children:[b.title,": ",b.message]},b.title))})]}),e.entries.length===0?d.jsxs("p",{style:{opacity:.5},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(zU,{plans:e.entries,rows:P,activePlanTitle:a,onOpenPlan:m,onOpenIdea:x}),d.jsx(rU,{}),d.jsx(GU,{suggestions:r,onOpen:g,onDismiss:y}),d.jsx(tU,{suggestion:w,onClose:()=>g(null)})]})]})},iC=S.lazy(()=>Ys(()=>import("./index-DFJlDY3W.js"),__vite__mapDeps([0,1])).then(e=>({default:e.DocsPage}))),KU=S.lazy(()=>Ys(()=>import("./index-DFJlDY3W.js"),__vite__mapDeps([0,1])).then(e=>({default:e.DocsSidebar}))),sC=S.lazy(()=>Ys(()=>import("./index-BajRXbXg.js"),__vite__mapDeps([2,1])).then(e=>({default:e.SettingsPage}))),YU=S.lazy(()=>Ys(()=>import("./index-BajRXbXg.js"),__vite__mapDeps([2,1])).then(e=>({default:e.SettingsSidebar}))),QU=S.lazy(()=>Ys(()=>import("./index-DAexv1XS.js"),[]).then(e=>({default:e.TasksPage}))),qU=S.lazy(()=>Ys(()=>import("./index-B6eOrr41.js"),[]).then(e=>({default:e.RoadmapPage}))),xh=[{id:"plans",label:"Ideas",path:"/"},{id:"roadmap",label:"Roadmap",path:"/roadmap"},{id:"docs",label:"Docs",path:"/docs"},{id:"tasks",label:"Tasks",path:"/tasks"},{id:"settings",label:"Settings",path:"/settings"}],K0=()=>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"})}),oC="stack-open";function XU(){try{return localStorage.getItem(oC)==="true"}catch{return!1}}function JU(e){try{localStorage.setItem(oC,String(e))}catch{}}const ZU="(min-width: 1440px)",ts=32;function e9(e){const[t,n]=S.useState(()=>typeof window<"u"?window.matchMedia(e).matches:!1);return S.useEffect(()=>{const r=window.matchMedia(e),i=s=>n(s.matches);return n(r.matches),r.addEventListener("change",i),()=>r.removeEventListener("change",i)},[e]),t}const t9=()=>{var P;const e=_n(),t=FT({select:b=>b.location.pathname}),n=N(b=>b.loadPlans),r=N(b=>b.loadIdeas),i=N(b=>b.loadSuggestions),s=N(b=>b.loadCapabilities),o=N(b=>b.loadAgentAuthStatus),a=N(b=>b.setActiveDocTitle),l=t==="/"||t.startsWith("/plans/")||t.startsWith("/ideas/"),u=t==="/docs"||t.startsWith("/docs/"),c=t==="/settings"||t.startsWith("/settings/"),h=l?"plans":u?"docs":c?"settings":(P=xh.find(b=>b.path===t))==null?void 0:P.id,f=l||u||c,p=l?"plans":u?"docs":"settings",[m,x]=S.useState(XU),[w,g]=S.useState(!1),y=Ou(),v=e9(ZU),k=S.useRef(!1);return S.useEffect(()=>{n(),r(),i(),s(),o()},[n,r,i,s,o]),S.useEffect(()=>{k.current||t!=="/"||(k.current=!0,Promise.all([Ck(),_k()]).then(([b,C])=>{if(!(b!=null&&b.setupDismissed)&&C!==null&&!C.every(j=>j.status==="ok")){e({to:"/settings/$section",params:{section:"setup"}});return}Promise.all([Pk(),Rk()]).then(([j,T])=>{j.entries.length>1||T.entries.length>0||(a("USAGE.md"),e({to:"/docs"}))})}))},[t,e,a]),S.useEffect(()=>{g(!1)},[t]),d.jsxs(v8,{position:"bottom-left",children:[d.jsxs("div",{className:"h-screen box-border min-[1440px]:pr-[480px] flex flex-col",children:[d.jsx(PW,{}),d.jsx(TW,{}),d.jsx(lB,{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:[f&&d.jsx(st,{variant:"ghost",size:"small",className:"lg:hidden max-[480px]:hidden",label:"Open sidebar",onClick:()=>g(!0),icon:d.jsx(K0,{})}),d.jsx(jW,{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:xh.map(b=>d.jsx(q,{variant:"ghost",size:"small",isActive:b.id===h,onClick:()=>e({to:b.path}),"aria-current":b.id===h?"page":void 0,children:b.label},b.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",style:{marginTop:-ts,marginLeft:-ts,marginRight:-ts,paddingTop:0,paddingBottom:`var(--pc-content-pad-bottom, ${ts}px)`,paddingLeft:ts,paddingRight:ts},children:d.jsxs("div",{className:"flex min-w-0 justify-center lg:[--pc-sidebar-h:calc(100vh-160px)]",style:{gap:cc.contentGap,width:"100%"},children:[f&&d.jsxs(EW,{routeKey:p,mobileOpen:w,onMobileClose:()=>g(!1),children:[l&&d.jsxs(d.Fragment,{children:[d.jsx(VU,{}),d.jsx(FU,{})]}),u&&d.jsx(S.Suspense,{fallback:null,children:d.jsx(KU,{})}),c&&d.jsx(S.Suspense,{fallback:null,children:d.jsx(YU,{})})]}),d.jsx("div",{className:"flex flex-col min-w-0",style:{flex:v?"1 1 0%":"0 1 800px"},children:d.jsx(Vs.div,{...H_(y),transition:U_(y),style:{display:"flex",flexDirection:"column",flex:1,minWidth:0},children:d.jsx(A_,{texture:{texture:"parchment"},outline:!0,style:{minHeight:"calc(100vh - 160px)",width:"100%",...v?{maxWidth:"none"}:{}},children:d.jsx(S.Suspense,{fallback:null,children:d.jsx(Lb,{})})})},t)})]})})})})]}),d.jsx(xW,{open:m,pinned:v,onToggle:()=>{const b=!m;JU(b),x(b)}}),d.jsxs("nav",{"aria-label":"Main navigation",className:"phone-bottom-nav",children:[f&&d.jsx(st,{variant:"ghost",size:"small",label:"Open sidebar",onClick:()=>g(!0),icon:d.jsx(K0,{})}),xh.map(b=>d.jsx(q,{variant:"ghost",size:"small",isActive:b.id===h,onClick:()=>e({to:b.path}),"aria-current":b.id===h?"page":void 0,children:b.label},b.id))]})]})},Gn=_T({component:t9}),n9=dr({getParentRoute:()=>Gn,path:"/",component:gg,validateSearch:e=>({subject:typeof e.subject=="string"?e.subject:void 0})}),r9=dr({getParentRoute:()=>Gn,path:"/plans/$planId",component:gg}),i9=dr({getParentRoute:()=>Gn,path:"/ideas/$ideaId",component:gg}),s9=dr({getParentRoute:()=>Gn,path:"/docs",component:iC}),o9=dr({getParentRoute:()=>Gn,path:"/docs/$section",component:iC}),a9=dr({getParentRoute:()=>Gn,path:"/settings",component:sC}),l9=dr({getParentRoute:()=>Gn,path:"/settings/$section",component:sC}),c9=dr({getParentRoute:()=>Gn,path:"/roadmap",component:qU,validateSearch:e=>({item:typeof e.item=="string"?e.item:void 0})}),u9=dr({getParentRoute:()=>Gn,path:"/tasks",component:QU,validateSearch:e=>({taskId:typeof e.taskId=="string"?e.taskId:void 0})}),d9=Gn.addChildren([n9,r9,i9,s9,o9,a9,l9,u9,c9]),h9=DT({routeTree:d9}),aC=document.getElementById("root");if(!aC)throw new Error("#root element not found");ob(aC).render(d.jsx(S.StrictMode,{children:d.jsx(OT,{router:h9})}));export{x9 as A,f9 as B,OM as C,p9 as D,wk as E,om as F,v9 as G,P9 as H,Rt as I,hr as J,TL as K,b9 as L,ka as M,w9 as N,Be as O,RW as P,X_ as Q,hg as R,Vt as S,RU as T,$a as X,rp as Y,q as Z,_n as a,J as b,ie as c,Z_ as d,j9 as e,je as f,Me as g,I0 as h,N_ as i,d as j,R0 as k,$c as l,m9 as m,Ck as n,vs as o,Pe as p,me as q,S as r,R as s,g9 as t,N as u,y9 as v,_9 as w,W_ as x,C9 as y,wW as z};
|
|
288
|
-
//# sourceMappingURL=main-Bno8vU-0.js.map
|