@dendelion/paper-camp 0.17.1 → 0.18.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-2KbxO2gv.js +2 -0
- package/dist/app/assets/index-2KbxO2gv.js.map +1 -0
- package/dist/app/assets/{index-DJwR0UyW.js → index-B_KrbzkW.js} +2 -2
- package/dist/app/assets/{index-DJwR0UyW.js.map → index-B_KrbzkW.js.map} +1 -1
- package/dist/app/assets/{index-C4T8Gzjs.js → index-BiMhnqOS.js} +3 -3
- package/dist/app/assets/{index-C4T8Gzjs.js.map → index-BiMhnqOS.js.map} +1 -1
- package/dist/app/assets/index-DahTzD09.js +6 -0
- package/dist/app/assets/index-DahTzD09.js.map +1 -0
- package/dist/app/assets/index-Db-zMFvA.js +4 -0
- package/dist/app/assets/index-Db-zMFvA.js.map +1 -0
- package/dist/app/assets/index-Dw1f2idP.js +2 -0
- package/dist/app/assets/{index-_tpcAf-k.js.map → index-Dw1f2idP.js.map} +1 -1
- package/dist/app/assets/index-UPIRvQZS.js +3 -0
- package/dist/app/assets/index-UPIRvQZS.js.map +1 -0
- package/dist/app/assets/main-BuCfycKH.css +1 -0
- package/dist/app/assets/main-CfeIUKG-.js +217 -0
- package/dist/app/assets/main-CfeIUKG-.js.map +1 -0
- package/dist/app/assets/{sidebar-section-DxUjM4Rm.js → sidebar-section-Lss_HMtQ.js} +2 -2
- package/dist/app/assets/{sidebar-section-DxUjM4Rm.js.map → sidebar-section-Lss_HMtQ.js.map} +1 -1
- package/dist/app/index.html +2 -2
- package/dist/app/toolbar.js +7841 -7794
- package/dist/app/toolbar.js.map +1 -1
- package/dist/chunks/{phase-progress.DsBJvd_o.js → phase-progress.BIIDRJmI.js} +2783 -2365
- package/dist/chunks/phase-progress.BIIDRJmI.js.map +1 -0
- package/dist/cli/index.js +9649 -8810
- package/dist/cli/index.js.map +1 -1
- package/dist/core/ci/ci-release.d.ts +25 -0
- package/dist/core/ci/ci-release.d.ts.map +1 -0
- package/dist/core/ci/ci-release.test.d.ts +2 -0
- package/dist/core/ci/ci-release.test.d.ts.map +1 -0
- package/dist/core/ci/index.d.ts +2 -0
- package/dist/core/ci/index.d.ts.map +1 -0
- package/dist/core/doctor/checks/metadata.d.ts +3 -0
- package/dist/core/doctor/checks/metadata.d.ts.map +1 -0
- package/dist/core/doctor/checks/metadata.test.d.ts +2 -0
- package/dist/core/doctor/checks/metadata.test.d.ts.map +1 -0
- package/dist/core/doctor/checks/structural.d.ts +3 -0
- package/dist/core/doctor/checks/structural.d.ts.map +1 -0
- package/dist/core/doctor/checks/structural.test.d.ts +2 -0
- package/dist/core/doctor/checks/structural.test.d.ts.map +1 -0
- package/dist/core/doctor/doctor.d.ts +18 -0
- package/dist/core/doctor/doctor.d.ts.map +1 -0
- package/dist/core/doctor/finding.d.ts +25 -0
- package/dist/core/doctor/finding.d.ts.map +1 -0
- package/dist/core/doctor/finding.test.d.ts +2 -0
- package/dist/core/doctor/finding.test.d.ts.map +1 -0
- package/dist/core/doctor/fix.d.ts +25 -0
- package/dist/core/doctor/fix.d.ts.map +1 -0
- package/dist/core/doctor/fix.test.d.ts +2 -0
- package/dist/core/doctor/fix.test.d.ts.map +1 -0
- package/dist/core/doctor/index.d.ts +5 -0
- package/dist/core/doctor/index.d.ts.map +1 -0
- package/dist/core/doctor/rules.d.ts +52 -0
- package/dist/core/doctor/rules.d.ts.map +1 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +120 -102
- package/dist/core/notifications.d.ts +6 -0
- package/dist/core/notifications.d.ts.map +1 -0
- package/dist/core/notifications.test.d.ts +2 -0
- package/dist/core/notifications.test.d.ts.map +1 -0
- package/dist/core/parse/desk-schema.test.d.ts +2 -0
- package/dist/core/parse/desk-schema.test.d.ts.map +1 -0
- package/dist/core/parse/parser.d.ts +2 -1
- package/dist/core/parse/parser.d.ts.map +1 -1
- package/dist/core/parse/schemas.d.ts +65 -0
- package/dist/core/parse/schemas.d.ts.map +1 -1
- package/dist/types/index.d.ts +96 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/vite/index.d.ts.map +1 -1
- package/dist/vite/index.js +47 -40
- package/dist/vite/index.js.map +1 -1
- package/package.json +2 -3
- package/dist/app/assets/index-BXRfFWnQ.js +0 -4
- package/dist/app/assets/index-BXRfFWnQ.js.map +0 -1
- package/dist/app/assets/index-BrriNOla.js +0 -2
- package/dist/app/assets/index-BrriNOla.js.map +0 -1
- package/dist/app/assets/index-CSl9MOCi.js +0 -6
- package/dist/app/assets/index-CSl9MOCi.js.map +0 -1
- package/dist/app/assets/index-D0gBw6x1.js +0 -3
- package/dist/app/assets/index-D0gBw6x1.js.map +0 -1
- package/dist/app/assets/index-_tpcAf-k.js +0 -2
- package/dist/app/assets/main-Ll-lvqgh.css +0 -1
- package/dist/app/assets/main-Zb7gEID9.js +0 -207
- package/dist/app/assets/main-Zb7gEID9.js.map +0 -1
- package/dist/chunks/phase-progress.DsBJvd_o.js.map +0 -1
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-BiMhnqOS.js","./sidebar-section-Lss_HMtQ.js","./index-Dw1f2idP.js","./tokens-C3C44lLs.js","./index-UPIRvQZS.js","./index-B_KrbzkW.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();var Zl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function qc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var U0={exports:{}},Qc={},W0={exports:{}},ie={};/**
|
|
3
|
+
* @license React
|
|
4
|
+
* react.production.min.js
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
7
|
+
*
|
|
8
|
+
* This source code is licensed under the MIT license found in the
|
|
9
|
+
* LICENSE file in the root directory of this source tree.
|
|
10
|
+
*/var ya=Symbol.for("react.element"),fC=Symbol.for("react.portal"),hC=Symbol.for("react.fragment"),pC=Symbol.for("react.strict_mode"),mC=Symbol.for("react.profiler"),gC=Symbol.for("react.provider"),yC=Symbol.for("react.context"),xC=Symbol.for("react.forward_ref"),vC=Symbol.for("react.suspense"),wC=Symbol.for("react.memo"),bC=Symbol.for("react.lazy"),fg=Symbol.iterator;function kC(e){return e===null||typeof e!="object"?null:(e=fg&&e[fg]||e["@@iterator"],typeof e=="function"?e:null)}var H0={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},G0=Object.assign,K0={};function Li(e,t,n){this.props=e,this.context=t,this.refs=K0,this.updater=n||H0}Li.prototype.isReactComponent={};Li.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")};Li.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function q0(){}q0.prototype=Li.prototype;function tp(e,t,n){this.props=e,this.context=t,this.refs=K0,this.updater=n||H0}var np=tp.prototype=new q0;np.constructor=tp;G0(np,Li.prototype);np.isPureReactComponent=!0;var hg=Array.isArray,Q0=Object.prototype.hasOwnProperty,rp={current:null},Y0={key:!0,ref:!0,__self:!0,__source:!0};function X0(e,t,n){var r,s={},i=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)Q0.call(t,r)&&!Y0.hasOwnProperty(r)&&(s[r]=t[r]);var a=arguments.length-2;if(a===1)s.children=n;else if(1<a){for(var l=Array(a),c=0;c<a;c++)l[c]=arguments[c+2];s.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)s[r]===void 0&&(s[r]=a[r]);return{$$typeof:ya,type:e,key:i,ref:o,props:s,_owner:rp.current}}function _C(e,t){return{$$typeof:ya,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function sp(e){return typeof e=="object"&&e!==null&&e.$$typeof===ya}function SC(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var pg=/\/+/g;function Du(e,t){return typeof e=="object"&&e!==null&&e.key!=null?SC(""+e.key):t.toString(36)}function Sl(e,t,n,r,s){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case ya:case fC:o=!0}}if(o)return o=e,s=s(o),e=r===""?"."+Du(o,0):r,hg(s)?(n="",e!=null&&(n=e.replace(pg,"$&/")+"/"),Sl(s,t,n,"",function(c){return c})):s!=null&&(sp(s)&&(s=_C(s,n+(!s.key||o&&o.key===s.key?"":(""+s.key).replace(pg,"$&/")+"/")+e)),t.push(s)),1;if(o=0,r=r===""?".":r+":",hg(e))for(var a=0;a<e.length;a++){i=e[a];var l=r+Du(i,a);o+=Sl(i,t,n,l,s)}else if(l=kC(e),typeof l=="function")for(e=l.call(e),a=0;!(i=e.next()).done;)i=i.value,l=r+Du(i,a++),o+=Sl(i,t,n,l,s);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function Da(e,t,n){if(e==null)return e;var r=[],s=0;return Sl(e,r,"","",function(i){return t.call(n,i,s++)}),r}function CC(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var ht={current:null},Cl={transition:null},jC={ReactCurrentDispatcher:ht,ReactCurrentBatchConfig:Cl,ReactCurrentOwner:rp};function J0(){throw Error("act(...) is not supported in production builds of React.")}ie.Children={map:Da,forEach:function(e,t,n){Da(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Da(e,function(){t++}),t},toArray:function(e){return Da(e,function(t){return t})||[]},only:function(e){if(!sp(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ie.Component=Li;ie.Fragment=hC;ie.Profiler=mC;ie.PureComponent=tp;ie.StrictMode=pC;ie.Suspense=vC;ie.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=jC;ie.act=J0;ie.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=G0({},e.props),s=e.key,i=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,o=rp.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)Q0.call(t,l)&&!Y0.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var c=0;c<l;c++)a[c]=arguments[c+2];r.children=a}return{$$typeof:ya,type:e.type,key:s,ref:i,props:r,_owner:o}};ie.createContext=function(e){return e={$$typeof:yC,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:gC,_context:e},e.Consumer=e};ie.createElement=X0;ie.createFactory=function(e){var t=X0.bind(null,e);return t.type=e,t};ie.createRef=function(){return{current:null}};ie.forwardRef=function(e){return{$$typeof:xC,render:e}};ie.isValidElement=sp;ie.lazy=function(e){return{$$typeof:bC,_payload:{_status:-1,_result:e},_init:CC}};ie.memo=function(e,t){return{$$typeof:wC,type:e,compare:t===void 0?null:t}};ie.startTransition=function(e){var t=Cl.transition;Cl.transition={};try{e()}finally{Cl.transition=t}};ie.unstable_act=J0;ie.useCallback=function(e,t){return ht.current.useCallback(e,t)};ie.useContext=function(e){return ht.current.useContext(e)};ie.useDebugValue=function(){};ie.useDeferredValue=function(e){return ht.current.useDeferredValue(e)};ie.useEffect=function(e,t){return ht.current.useEffect(e,t)};ie.useId=function(){return ht.current.useId()};ie.useImperativeHandle=function(e,t,n){return ht.current.useImperativeHandle(e,t,n)};ie.useInsertionEffect=function(e,t){return ht.current.useInsertionEffect(e,t)};ie.useLayoutEffect=function(e,t){return ht.current.useLayoutEffect(e,t)};ie.useMemo=function(e,t){return ht.current.useMemo(e,t)};ie.useReducer=function(e,t,n){return ht.current.useReducer(e,t,n)};ie.useRef=function(e){return ht.current.useRef(e)};ie.useState=function(e){return ht.current.useState(e)};ie.useSyncExternalStore=function(e,t,n){return ht.current.useSyncExternalStore(e,t,n)};ie.useTransition=function(){return ht.current.useTransition()};ie.version="18.3.1";W0.exports=ie;var b=W0.exports;const bi=qc(b);/**
|
|
11
|
+
* @license React
|
|
12
|
+
* react-jsx-runtime.production.min.js
|
|
13
|
+
*
|
|
14
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
15
|
+
*
|
|
16
|
+
* This source code is licensed under the MIT license found in the
|
|
17
|
+
* LICENSE file in the root directory of this source tree.
|
|
18
|
+
*/var PC=b,EC=Symbol.for("react.element"),TC=Symbol.for("react.fragment"),NC=Object.prototype.hasOwnProperty,RC=PC.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,IC={key:!0,ref:!0,__self:!0,__source:!0};function Z0(e,t,n){var r,s={},i=null,o=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)NC.call(t,r)&&!IC.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)s[r]===void 0&&(s[r]=t[r]);return{$$typeof:EC,type:e,key:i,ref:o,props:s,_owner:RC.current}}Qc.Fragment=TC;Qc.jsx=Z0;Qc.jsxs=Z0;U0.exports=Qc;var d=U0.exports,ew={exports:{}},zt={},tw={exports:{}},nw={};/**
|
|
19
|
+
* @license React
|
|
20
|
+
* scheduler.production.min.js
|
|
21
|
+
*
|
|
22
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the MIT license found in the
|
|
25
|
+
* LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/(function(e){function t(L,B){var C=L.length;L.push(B);e:for(;0<C;){var $=C-1>>>1,Q=L[$];if(0<s(Q,B))L[$]=B,L[C]=Q,C=$;else break e}}function n(L){return L.length===0?null:L[0]}function r(L){if(L.length===0)return null;var B=L[0],C=L.pop();if(C!==B){L[0]=C;e:for(var $=0,Q=L.length,R=Q>>>1;$<R;){var ce=2*($+1)-1,pe=L[ce],fe=ce+1,Et=L[fe];if(0>s(pe,C))fe<Q&&0>s(Et,pe)?(L[$]=Et,L[fe]=C,$=fe):(L[$]=pe,L[ce]=C,$=ce);else if(fe<Q&&0>s(Et,C))L[$]=Et,L[fe]=C,$=fe;else break e}}return B}function s(L,B){var C=L.sortIndex-B.sortIndex;return C!==0?C:L.id-B.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var l=[],c=[],u=1,f=null,p=3,h=!1,m=!1,y=!1,v=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(L){for(var B=n(c);B!==null;){if(B.callback===null)r(c);else if(B.startTime<=L)r(c),B.sortIndex=B.expirationTime,t(l,B);else break;B=n(c)}}function k(L){if(y=!1,w(L),!m)if(n(l)!==null)m=!0,z(j);else{var B=n(c);B!==null&&V(k,B.startTime-L)}}function j(L,B){m=!1,y&&(y=!1,g(P),P=-1),h=!0;var C=p;try{for(w(B),f=n(l);f!==null&&(!(f.expirationTime>B)||L&&!I());){var $=f.callback;if(typeof $=="function"){f.callback=null,p=f.priorityLevel;var Q=$(f.expirationTime<=B);B=e.unstable_now(),typeof Q=="function"?f.callback=Q:f===n(l)&&r(l),w(B)}else r(l);f=n(l)}if(f!==null)var R=!0;else{var ce=n(c);ce!==null&&V(k,ce.startTime-B),R=!1}return R}finally{f=null,p=C,h=!1}}var _=!1,S=null,P=-1,T=5,E=-1;function I(){return!(e.unstable_now()-E<T)}function A(){if(S!==null){var L=e.unstable_now();E=L;var B=!0;try{B=S(!0,L)}finally{B?O():(_=!1,S=null)}}else _=!1}var O;if(typeof x=="function")O=function(){x(A)};else if(typeof MessageChannel<"u"){var M=new MessageChannel,N=M.port2;M.port1.onmessage=A,O=function(){N.postMessage(null)}}else O=function(){v(A,0)};function z(L){S=L,_||(_=!0,O())}function V(L,B){P=v(function(){L(e.unstable_now())},B)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(L){L.callback=null},e.unstable_continueExecution=function(){m||h||(m=!0,z(j))},e.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<L?Math.floor(1e3/L):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(L){switch(p){case 1:case 2:case 3:var B=3;break;default:B=p}var C=p;p=B;try{return L()}finally{p=C}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(L,B){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var C=p;p=L;try{return B()}finally{p=C}},e.unstable_scheduleCallback=function(L,B,C){var $=e.unstable_now();switch(typeof C=="object"&&C!==null?(C=C.delay,C=typeof C=="number"&&0<C?$+C:$):C=$,L){case 1:var Q=-1;break;case 2:Q=250;break;case 5:Q=1073741823;break;case 4:Q=1e4;break;default:Q=5e3}return Q=C+Q,L={id:u++,callback:B,priorityLevel:L,startTime:C,expirationTime:Q,sortIndex:-1},C>$?(L.sortIndex=C,t(c,L),n(l)===null&&L===n(c)&&(y?(g(P),P=-1):y=!0,V(k,C-$))):(L.sortIndex=Q,t(l,L),m||h||(m=!0,z(j))),L},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(L){var B=p;return function(){var C=p;p=B;try{return L.apply(this,arguments)}finally{p=C}}}})(nw);tw.exports=nw;var AC=tw.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 MC=b,Ot=AC;function U(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var rw=new Set,Wo={};function Is(e,t){ki(e,t),ki(e+"Capture",t)}function ki(e,t){for(Wo[e]=t,e=0;e<t.length;e++)rw.add(t[e])}var Zn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),pf=Object.prototype.hasOwnProperty,LC=/^[: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]*$/,mg={},gg={};function DC(e){return pf.call(gg,e)?!0:pf.call(mg,e)?!1:LC.test(e)?gg[e]=!0:(mg[e]=!0,!1)}function FC(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 OC(e,t,n,r){if(t===null||typeof t>"u"||FC(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function pt(e,t,n,r,s,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var Ze={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ze[e]=new pt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ze[t]=new pt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ze[e]=new pt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ze[e]=new pt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ze[e]=new pt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ze[e]=new pt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ze[e]=new pt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ze[e]=new pt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ze[e]=new pt(e,5,!1,e.toLowerCase(),null,!1,!1)});var ip=/[\-:]([a-z])/g;function op(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(ip,op);Ze[t]=new pt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(ip,op);Ze[t]=new pt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(ip,op);Ze[t]=new pt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ze[e]=new pt(e,1,!1,e.toLowerCase(),null,!1,!1)});Ze.xlinkHref=new pt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ze[e]=new pt(e,1,!1,e.toLowerCase(),null,!0,!0)});function ap(e,t,n,r){var s=Ze.hasOwnProperty(t)?Ze[t]:null;(s!==null?s.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(OC(t,n,s,r)&&(n=null),r||s===null?DC(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):s.mustUseProperty?e[s.propertyName]=n===null?s.type===3?!1:"":n:(t=s.attributeName,r=s.attributeNamespace,n===null?e.removeAttribute(t):(s=s.type,n=s===3||s===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var sr=MC.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Fa=Symbol.for("react.element"),Xs=Symbol.for("react.portal"),Js=Symbol.for("react.fragment"),lp=Symbol.for("react.strict_mode"),mf=Symbol.for("react.profiler"),sw=Symbol.for("react.provider"),iw=Symbol.for("react.context"),cp=Symbol.for("react.forward_ref"),gf=Symbol.for("react.suspense"),yf=Symbol.for("react.suspense_list"),up=Symbol.for("react.memo"),xr=Symbol.for("react.lazy"),ow=Symbol.for("react.offscreen"),yg=Symbol.iterator;function Xi(e){return e===null||typeof e!="object"?null:(e=yg&&e[yg]||e["@@iterator"],typeof e=="function"?e:null)}var Re=Object.assign,Fu;function wo(e){if(Fu===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Fu=t&&t[1]||""}return`
|
|
35
|
+
`+Fu+e}var Ou=!1;function zu(e,t){if(!e||Ou)return"";Ou=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var s=c.stack.split(`
|
|
36
|
+
`),i=r.stack.split(`
|
|
37
|
+
`),o=s.length-1,a=i.length-1;1<=o&&0<=a&&s[o]!==i[a];)a--;for(;1<=o&&0<=a;o--,a--)if(s[o]!==i[a]){if(o!==1||a!==1)do if(o--,a--,0>a||s[o]!==i[a]){var l=`
|
|
38
|
+
`+s[o].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=o&&0<=a);break}}}finally{Ou=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?wo(e):""}function zC(e){switch(e.tag){case 5:return wo(e.type);case 16:return wo("Lazy");case 13:return wo("Suspense");case 19:return wo("SuspenseList");case 0:case 2:case 15:return e=zu(e.type,!1),e;case 11:return e=zu(e.type.render,!1),e;case 1:return e=zu(e.type,!0),e;default:return""}}function xf(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 Js:return"Fragment";case Xs:return"Portal";case mf:return"Profiler";case lp:return"StrictMode";case gf:return"Suspense";case yf:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case iw:return(e.displayName||"Context")+".Consumer";case sw:return(e._context.displayName||"Context")+".Provider";case cp:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case up:return t=e.displayName||null,t!==null?t:xf(e.type)||"Memo";case xr:t=e._payload,e=e._init;try{return xf(e(t))}catch{}}return null}function $C(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 xf(t);case 8:return t===lp?"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 $r(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function aw(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function BC(e){var t=aw(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Oa(e){e._valueTracker||(e._valueTracker=BC(e))}function lw(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=aw(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ec(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 vf(e,t){var n=t.checked;return Re({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function xg(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=$r(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 cw(e,t){t=t.checked,t!=null&&ap(e,"checked",t,!1)}function wf(e,t){cw(e,t);var n=$r(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")?bf(e,t.type,n):t.hasOwnProperty("defaultValue")&&bf(e,t.type,$r(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function vg(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 bf(e,t,n){(t!=="number"||ec(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var bo=Array.isArray;function fi(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&r&&(e[n].defaultSelected=!0)}else{for(n=""+$r(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,r&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function kf(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(U(91));return Re({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function wg(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(U(92));if(bo(n)){if(1<n.length)throw Error(U(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:$r(n)}}function uw(e,t){var n=$r(t.value),r=$r(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 bg(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function dw(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 _f(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?dw(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var za,fw=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,s){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(za=za||document.createElement("div"),za.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=za.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ho(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Po={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},VC=["Webkit","ms","Moz","O"];Object.keys(Po).forEach(function(e){VC.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Po[t]=Po[e]})});function hw(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Po.hasOwnProperty(e)&&Po[e]?(""+t).trim():t+"px"}function pw(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=hw(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var UC=Re({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Sf(e,t){if(t){if(UC[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(U(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(U(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(U(61))}if(t.style!=null&&typeof t.style!="object")throw Error(U(62))}}function Cf(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 jf=null;function dp(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Pf=null,hi=null,pi=null;function kg(e){if(e=wa(e)){if(typeof Pf!="function")throw Error(U(280));var t=e.stateNode;t&&(t=eu(t),Pf(e.stateNode,e.type,t))}}function mw(e){hi?pi?pi.push(e):pi=[e]:hi=e}function gw(){if(hi){var e=hi,t=pi;if(pi=hi=null,kg(e),t)for(e=0;e<t.length;e++)kg(t[e])}}function yw(e,t){return e(t)}function xw(){}var $u=!1;function vw(e,t,n){if($u)return e(t,n);$u=!0;try{return yw(e,t,n)}finally{$u=!1,(hi!==null||pi!==null)&&(xw(),gw())}}function Go(e,t){var n=e.stateNode;if(n===null)return null;var r=eu(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(U(231,t,typeof n));return n}var Ef=!1;if(Zn)try{var Ji={};Object.defineProperty(Ji,"passive",{get:function(){Ef=!0}}),window.addEventListener("test",Ji,Ji),window.removeEventListener("test",Ji,Ji)}catch{Ef=!1}function WC(e,t,n,r,s,i,o,a,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(u){this.onError(u)}}var Eo=!1,tc=null,nc=!1,Tf=null,HC={onError:function(e){Eo=!0,tc=e}};function GC(e,t,n,r,s,i,o,a,l){Eo=!1,tc=null,WC.apply(HC,arguments)}function KC(e,t,n,r,s,i,o,a,l){if(GC.apply(this,arguments),Eo){if(Eo){var c=tc;Eo=!1,tc=null}else throw Error(U(198));nc||(nc=!0,Tf=c)}}function As(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function ww(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function _g(e){if(As(e)!==e)throw Error(U(188))}function qC(e){var t=e.alternate;if(!t){if(t=As(e),t===null)throw Error(U(188));return t!==e?null:e}for(var n=e,r=t;;){var s=n.return;if(s===null)break;var i=s.alternate;if(i===null){if(r=s.return,r!==null){n=r;continue}break}if(s.child===i.child){for(i=s.child;i;){if(i===n)return _g(s),e;if(i===r)return _g(s),t;i=i.sibling}throw Error(U(188))}if(n.return!==r.return)n=s,r=i;else{for(var o=!1,a=s.child;a;){if(a===n){o=!0,n=s,r=i;break}if(a===r){o=!0,r=s,n=i;break}a=a.sibling}if(!o){for(a=i.child;a;){if(a===n){o=!0,n=i,r=s;break}if(a===r){o=!0,r=i,n=s;break}a=a.sibling}if(!o)throw Error(U(189))}}if(n.alternate!==r)throw Error(U(190))}if(n.tag!==3)throw Error(U(188));return n.stateNode.current===n?e:t}function bw(e){return e=qC(e),e!==null?kw(e):null}function kw(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=kw(e);if(t!==null)return t;e=e.sibling}return null}var _w=Ot.unstable_scheduleCallback,Sg=Ot.unstable_cancelCallback,QC=Ot.unstable_shouldYield,YC=Ot.unstable_requestPaint,De=Ot.unstable_now,XC=Ot.unstable_getCurrentPriorityLevel,fp=Ot.unstable_ImmediatePriority,Sw=Ot.unstable_UserBlockingPriority,rc=Ot.unstable_NormalPriority,JC=Ot.unstable_LowPriority,Cw=Ot.unstable_IdlePriority,Yc=null,An=null;function ZC(e){if(An&&typeof An.onCommitFiberRoot=="function")try{An.onCommitFiberRoot(Yc,e,void 0,(e.current.flags&128)===128)}catch{}}var mn=Math.clz32?Math.clz32:nj,ej=Math.log,tj=Math.LN2;function nj(e){return e>>>=0,e===0?32:31-(ej(e)/tj|0)|0}var $a=64,Ba=4194304;function ko(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 sc(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,i=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~s;a!==0?r=ko(a):(i&=o,i!==0&&(r=ko(i)))}else o=n&~s,o!==0?r=ko(o):i!==0&&(r=ko(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,i=t&-t,s>=i||s===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-mn(t),s=1<<n,r|=e[n],t&=~s;return r}function rj(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 sj(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,i=e.pendingLanes;0<i;){var o=31-mn(i),a=1<<o,l=s[o];l===-1?(!(a&n)||a&r)&&(s[o]=rj(a,t)):l<=t&&(e.expiredLanes|=a),i&=~a}}function Nf(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function jw(){var e=$a;return $a<<=1,!($a&4194240)&&($a=64),e}function Bu(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function xa(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-mn(t),e[t]=n}function ij(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var s=31-mn(n),i=1<<s;t[s]=0,r[s]=-1,e[s]=-1,n&=~i}}function hp(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-mn(n),s=1<<r;s&t|e[r]&t&&(e[r]|=t),n&=~s}}var ue=0;function Pw(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Ew,pp,Tw,Nw,Rw,Rf=!1,Va=[],Nr=null,Rr=null,Ir=null,Ko=new Map,qo=new Map,br=[],oj="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 Cg(e,t){switch(e){case"focusin":case"focusout":Nr=null;break;case"dragenter":case"dragleave":Rr=null;break;case"mouseover":case"mouseout":Ir=null;break;case"pointerover":case"pointerout":Ko.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":qo.delete(t.pointerId)}}function Zi(e,t,n,r,s,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[s]},t!==null&&(t=wa(t),t!==null&&pp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function aj(e,t,n,r,s){switch(t){case"focusin":return Nr=Zi(Nr,e,t,n,r,s),!0;case"dragenter":return Rr=Zi(Rr,e,t,n,r,s),!0;case"mouseover":return Ir=Zi(Ir,e,t,n,r,s),!0;case"pointerover":var i=s.pointerId;return Ko.set(i,Zi(Ko.get(i)||null,e,t,n,r,s)),!0;case"gotpointercapture":return i=s.pointerId,qo.set(i,Zi(qo.get(i)||null,e,t,n,r,s)),!0}return!1}function Iw(e){var t=hs(e.target);if(t!==null){var n=As(t);if(n!==null){if(t=n.tag,t===13){if(t=ww(n),t!==null){e.blockedOn=t,Rw(e.priority,function(){Tw(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 jl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=If(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);jf=r,n.target.dispatchEvent(r),jf=null}else return t=wa(n),t!==null&&pp(t),e.blockedOn=n,!1;t.shift()}return!0}function jg(e,t,n){jl(e)&&n.delete(t)}function lj(){Rf=!1,Nr!==null&&jl(Nr)&&(Nr=null),Rr!==null&&jl(Rr)&&(Rr=null),Ir!==null&&jl(Ir)&&(Ir=null),Ko.forEach(jg),qo.forEach(jg)}function eo(e,t){e.blockedOn===t&&(e.blockedOn=null,Rf||(Rf=!0,Ot.unstable_scheduleCallback(Ot.unstable_NormalPriority,lj)))}function Qo(e){function t(s){return eo(s,e)}if(0<Va.length){eo(Va[0],e);for(var n=1;n<Va.length;n++){var r=Va[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Nr!==null&&eo(Nr,e),Rr!==null&&eo(Rr,e),Ir!==null&&eo(Ir,e),Ko.forEach(t),qo.forEach(t),n=0;n<br.length;n++)r=br[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<br.length&&(n=br[0],n.blockedOn===null);)Iw(n),n.blockedOn===null&&br.shift()}var mi=sr.ReactCurrentBatchConfig,ic=!0;function cj(e,t,n,r){var s=ue,i=mi.transition;mi.transition=null;try{ue=1,mp(e,t,n,r)}finally{ue=s,mi.transition=i}}function uj(e,t,n,r){var s=ue,i=mi.transition;mi.transition=null;try{ue=4,mp(e,t,n,r)}finally{ue=s,mi.transition=i}}function mp(e,t,n,r){if(ic){var s=If(e,t,n,r);if(s===null)Xu(e,t,r,oc,n),Cg(e,r);else if(aj(s,e,t,n,r))r.stopPropagation();else if(Cg(e,r),t&4&&-1<oj.indexOf(e)){for(;s!==null;){var i=wa(s);if(i!==null&&Ew(i),i=If(e,t,n,r),i===null&&Xu(e,t,r,oc,n),i===s)break;s=i}s!==null&&r.stopPropagation()}else Xu(e,t,r,null,n)}}var oc=null;function If(e,t,n,r){if(oc=null,e=dp(r),e=hs(e),e!==null)if(t=As(e),t===null)e=null;else if(n=t.tag,n===13){if(e=ww(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return oc=e,null}function Aw(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(XC()){case fp:return 1;case Sw:return 4;case rc:case JC:return 16;case Cw:return 536870912;default:return 16}default:return 16}}var _r=null,gp=null,Pl=null;function Mw(){if(Pl)return Pl;var e,t=gp,n=t.length,r,s="value"in _r?_r.value:_r.textContent,i=s.length;for(e=0;e<n&&t[e]===s[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===s[i-r];r++);return Pl=s.slice(e,1<r?1-r:void 0)}function El(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 Ua(){return!0}function Pg(){return!1}function $t(e){function t(n,r,s,i,o){this._reactName=n,this._targetInst=s,this.type=r,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Ua:Pg,this.isPropagationStopped=Pg,this}return Re(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Ua)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ua)},persist:function(){},isPersistent:Ua}),t}var Di={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},yp=$t(Di),va=Re({},Di,{view:0,detail:0}),dj=$t(va),Vu,Uu,to,Xc=Re({},va,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:xp,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!==to&&(to&&e.type==="mousemove"?(Vu=e.screenX-to.screenX,Uu=e.screenY-to.screenY):Uu=Vu=0,to=e),Vu)},movementY:function(e){return"movementY"in e?e.movementY:Uu}}),Eg=$t(Xc),fj=Re({},Xc,{dataTransfer:0}),hj=$t(fj),pj=Re({},va,{relatedTarget:0}),Wu=$t(pj),mj=Re({},Di,{animationName:0,elapsedTime:0,pseudoElement:0}),gj=$t(mj),yj=Re({},Di,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),xj=$t(yj),vj=Re({},Di,{data:0}),Tg=$t(vj),wj={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},bj={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"},kj={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function _j(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=kj[e])?!!t[e]:!1}function xp(){return _j}var Sj=Re({},va,{key:function(e){if(e.key){var t=wj[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=El(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?bj[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:xp,charCode:function(e){return e.type==="keypress"?El(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?El(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Cj=$t(Sj),jj=Re({},Xc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ng=$t(jj),Pj=Re({},va,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:xp}),Ej=$t(Pj),Tj=Re({},Di,{propertyName:0,elapsedTime:0,pseudoElement:0}),Nj=$t(Tj),Rj=Re({},Xc,{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}),Ij=$t(Rj),Aj=[9,13,27,32],vp=Zn&&"CompositionEvent"in window,To=null;Zn&&"documentMode"in document&&(To=document.documentMode);var Mj=Zn&&"TextEvent"in window&&!To,Lw=Zn&&(!vp||To&&8<To&&11>=To),Rg=" ",Ig=!1;function Dw(e,t){switch(e){case"keyup":return Aj.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Fw(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Zs=!1;function Lj(e,t){switch(e){case"compositionend":return Fw(t);case"keypress":return t.which!==32?null:(Ig=!0,Rg);case"textInput":return e=t.data,e===Rg&&Ig?null:e;default:return null}}function Dj(e,t){if(Zs)return e==="compositionend"||!vp&&Dw(e,t)?(e=Mw(),Pl=gp=_r=null,Zs=!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 Lw&&t.locale!=="ko"?null:t.data;default:return null}}var Fj={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 Ag(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Fj[e.type]:t==="textarea"}function Ow(e,t,n,r){mw(r),t=ac(t,"onChange"),0<t.length&&(n=new yp("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var No=null,Yo=null;function Oj(e){Qw(e,0)}function Jc(e){var t=ni(e);if(lw(t))return e}function zj(e,t){if(e==="change")return t}var zw=!1;if(Zn){var Hu;if(Zn){var Gu="oninput"in document;if(!Gu){var Mg=document.createElement("div");Mg.setAttribute("oninput","return;"),Gu=typeof Mg.oninput=="function"}Hu=Gu}else Hu=!1;zw=Hu&&(!document.documentMode||9<document.documentMode)}function Lg(){No&&(No.detachEvent("onpropertychange",$w),Yo=No=null)}function $w(e){if(e.propertyName==="value"&&Jc(Yo)){var t=[];Ow(t,Yo,e,dp(e)),vw(Oj,t)}}function $j(e,t,n){e==="focusin"?(Lg(),No=t,Yo=n,No.attachEvent("onpropertychange",$w)):e==="focusout"&&Lg()}function Bj(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Jc(Yo)}function Vj(e,t){if(e==="click")return Jc(t)}function Uj(e,t){if(e==="input"||e==="change")return Jc(t)}function Wj(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var xn=typeof Object.is=="function"?Object.is:Wj;function Xo(e,t){if(xn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var s=n[r];if(!pf.call(t,s)||!xn(e[s],t[s]))return!1}return!0}function Dg(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Fg(e,t){var n=Dg(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=Dg(n)}}function Bw(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Bw(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Vw(){for(var e=window,t=ec();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ec(e.document)}return t}function wp(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 Hj(e){var t=Vw(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Bw(n.ownerDocument.documentElement,n)){if(r!==null&&wp(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,i=Math.min(r.start,s);r=r.end===void 0?i:Math.min(r.end,s),!e.extend&&i>r&&(s=r,r=i,i=s),s=Fg(n,i);var o=Fg(n,r);s&&o&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Gj=Zn&&"documentMode"in document&&11>=document.documentMode,ei=null,Af=null,Ro=null,Mf=!1;function Og(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Mf||ei==null||ei!==ec(r)||(r=ei,"selectionStart"in r&&wp(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}),Ro&&Xo(Ro,r)||(Ro=r,r=ac(Af,"onSelect"),0<r.length&&(t=new yp("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=ei)))}function Wa(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ti={animationend:Wa("Animation","AnimationEnd"),animationiteration:Wa("Animation","AnimationIteration"),animationstart:Wa("Animation","AnimationStart"),transitionend:Wa("Transition","TransitionEnd")},Ku={},Uw={};Zn&&(Uw=document.createElement("div").style,"AnimationEvent"in window||(delete ti.animationend.animation,delete ti.animationiteration.animation,delete ti.animationstart.animation),"TransitionEvent"in window||delete ti.transitionend.transition);function Zc(e){if(Ku[e])return Ku[e];if(!ti[e])return e;var t=ti[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Uw)return Ku[e]=t[n];return e}var Ww=Zc("animationend"),Hw=Zc("animationiteration"),Gw=Zc("animationstart"),Kw=Zc("transitionend"),qw=new Map,zg="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 Gr(e,t){qw.set(e,t),Is(t,[e])}for(var qu=0;qu<zg.length;qu++){var Qu=zg[qu],Kj=Qu.toLowerCase(),qj=Qu[0].toUpperCase()+Qu.slice(1);Gr(Kj,"on"+qj)}Gr(Ww,"onAnimationEnd");Gr(Hw,"onAnimationIteration");Gr(Gw,"onAnimationStart");Gr("dblclick","onDoubleClick");Gr("focusin","onFocus");Gr("focusout","onBlur");Gr(Kw,"onTransitionEnd");ki("onMouseEnter",["mouseout","mouseover"]);ki("onMouseLeave",["mouseout","mouseover"]);ki("onPointerEnter",["pointerout","pointerover"]);ki("onPointerLeave",["pointerout","pointerover"]);Is("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Is("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Is("onBeforeInput",["compositionend","keypress","textInput","paste"]);Is("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Is("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Is("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var _o="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(" "),Qj=new Set("cancel close invalid load scroll toggle".split(" ").concat(_o));function $g(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,KC(r,t,void 0,e),e.currentTarget=null}function Qw(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],s=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var o=r.length-1;0<=o;o--){var a=r[o],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==i&&s.isPropagationStopped())break e;$g(s,a,c),i=l}else for(o=0;o<r.length;o++){if(a=r[o],l=a.instance,c=a.currentTarget,a=a.listener,l!==i&&s.isPropagationStopped())break e;$g(s,a,c),i=l}}}if(nc)throw e=Tf,nc=!1,Tf=null,e}function _e(e,t){var n=t[zf];n===void 0&&(n=t[zf]=new Set);var r=e+"__bubble";n.has(r)||(Yw(t,e,2,!1),n.add(r))}function Yu(e,t,n){var r=0;t&&(r|=4),Yw(n,e,r,t)}var Ha="_reactListening"+Math.random().toString(36).slice(2);function Jo(e){if(!e[Ha]){e[Ha]=!0,rw.forEach(function(n){n!=="selectionchange"&&(Qj.has(n)||Yu(n,!1,e),Yu(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ha]||(t[Ha]=!0,Yu("selectionchange",!1,t))}}function Yw(e,t,n,r){switch(Aw(t)){case 1:var s=cj;break;case 4:s=uj;break;default:s=mp}n=s.bind(null,t,n,e),s=void 0,!Ef||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),r?s!==void 0?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):s!==void 0?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}function Xu(e,t,n,r,s){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var a=r.stateNode.containerInfo;if(a===s||a.nodeType===8&&a.parentNode===s)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===s||l.nodeType===8&&l.parentNode===s))return;o=o.return}for(;a!==null;){if(o=hs(a),o===null)return;if(l=o.tag,l===5||l===6){r=i=o;continue e}a=a.parentNode}}r=r.return}vw(function(){var c=i,u=dp(n),f=[];e:{var p=qw.get(e);if(p!==void 0){var h=yp,m=e;switch(e){case"keypress":if(El(n)===0)break e;case"keydown":case"keyup":h=Cj;break;case"focusin":m="focus",h=Wu;break;case"focusout":m="blur",h=Wu;break;case"beforeblur":case"afterblur":h=Wu;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=Eg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=hj;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=Ej;break;case Ww:case Hw:case Gw:h=gj;break;case Kw:h=Nj;break;case"scroll":h=dj;break;case"wheel":h=Ij;break;case"copy":case"cut":case"paste":h=xj;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=Ng}var y=(t&4)!==0,v=!y&&e==="scroll",g=y?p!==null?p+"Capture":null:p;y=[];for(var x=c,w;x!==null;){w=x;var k=w.stateNode;if(w.tag===5&&k!==null&&(w=k,g!==null&&(k=Go(x,g),k!=null&&y.push(Zo(x,k,w)))),v)break;x=x.return}0<y.length&&(p=new h(p,m,null,n,u),f.push({event:p,listeners:y}))}}if(!(t&7)){e:{if(p=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",p&&n!==jf&&(m=n.relatedTarget||n.fromElement)&&(hs(m)||m[er]))break e;if((h||p)&&(p=u.window===u?u:(p=u.ownerDocument)?p.defaultView||p.parentWindow:window,h?(m=n.relatedTarget||n.toElement,h=c,m=m?hs(m):null,m!==null&&(v=As(m),m!==v||m.tag!==5&&m.tag!==6)&&(m=null)):(h=null,m=c),h!==m)){if(y=Eg,k="onMouseLeave",g="onMouseEnter",x="mouse",(e==="pointerout"||e==="pointerover")&&(y=Ng,k="onPointerLeave",g="onPointerEnter",x="pointer"),v=h==null?p:ni(h),w=m==null?p:ni(m),p=new y(k,x+"leave",h,n,u),p.target=v,p.relatedTarget=w,k=null,hs(u)===c&&(y=new y(g,x+"enter",m,n,u),y.target=w,y.relatedTarget=v,k=y),v=k,h&&m)t:{for(y=h,g=m,x=0,w=y;w;w=Bs(w))x++;for(w=0,k=g;k;k=Bs(k))w++;for(;0<x-w;)y=Bs(y),x--;for(;0<w-x;)g=Bs(g),w--;for(;x--;){if(y===g||g!==null&&y===g.alternate)break t;y=Bs(y),g=Bs(g)}y=null}else y=null;h!==null&&Bg(f,p,h,y,!1),m!==null&&v!==null&&Bg(f,v,m,y,!0)}}e:{if(p=c?ni(c):window,h=p.nodeName&&p.nodeName.toLowerCase(),h==="select"||h==="input"&&p.type==="file")var j=zj;else if(Ag(p))if(zw)j=Uj;else{j=Bj;var _=$j}else(h=p.nodeName)&&h.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(j=Vj);if(j&&(j=j(e,c))){Ow(f,j,n,u);break e}_&&_(e,p,c),e==="focusout"&&(_=p._wrapperState)&&_.controlled&&p.type==="number"&&bf(p,"number",p.value)}switch(_=c?ni(c):window,e){case"focusin":(Ag(_)||_.contentEditable==="true")&&(ei=_,Af=c,Ro=null);break;case"focusout":Ro=Af=ei=null;break;case"mousedown":Mf=!0;break;case"contextmenu":case"mouseup":case"dragend":Mf=!1,Og(f,n,u);break;case"selectionchange":if(Gj)break;case"keydown":case"keyup":Og(f,n,u)}var S;if(vp)e:{switch(e){case"compositionstart":var P="onCompositionStart";break e;case"compositionend":P="onCompositionEnd";break e;case"compositionupdate":P="onCompositionUpdate";break e}P=void 0}else Zs?Dw(e,n)&&(P="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(P="onCompositionStart");P&&(Lw&&n.locale!=="ko"&&(Zs||P!=="onCompositionStart"?P==="onCompositionEnd"&&Zs&&(S=Mw()):(_r=u,gp="value"in _r?_r.value:_r.textContent,Zs=!0)),_=ac(c,P),0<_.length&&(P=new Tg(P,e,null,n,u),f.push({event:P,listeners:_}),S?P.data=S:(S=Fw(n),S!==null&&(P.data=S)))),(S=Mj?Lj(e,n):Dj(e,n))&&(c=ac(c,"onBeforeInput"),0<c.length&&(u=new Tg("onBeforeInput","beforeinput",null,n,u),f.push({event:u,listeners:c}),u.data=S))}Qw(f,t)})}function Zo(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ac(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,i=s.stateNode;s.tag===5&&i!==null&&(s=i,i=Go(e,n),i!=null&&r.unshift(Zo(e,i,s)),i=Go(e,t),i!=null&&r.push(Zo(e,i,s))),e=e.return}return r}function Bs(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Bg(e,t,n,r,s){for(var i=t._reactName,o=[];n!==null&&n!==r;){var a=n,l=a.alternate,c=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&c!==null&&(a=c,s?(l=Go(n,i),l!=null&&o.unshift(Zo(n,l,a))):s||(l=Go(n,i),l!=null&&o.push(Zo(n,l,a)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Yj=/\r\n?/g,Xj=/\u0000|\uFFFD/g;function Vg(e){return(typeof e=="string"?e:""+e).replace(Yj,`
|
|
39
|
+
`).replace(Xj,"")}function Ga(e,t,n){if(t=Vg(t),Vg(e)!==t&&n)throw Error(U(425))}function lc(){}var Lf=null,Df=null;function Ff(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 Of=typeof setTimeout=="function"?setTimeout:void 0,Jj=typeof clearTimeout=="function"?clearTimeout:void 0,Ug=typeof Promise=="function"?Promise:void 0,Zj=typeof queueMicrotask=="function"?queueMicrotask:typeof Ug<"u"?function(e){return Ug.resolve(null).then(e).catch(eP)}:Of;function eP(e){setTimeout(function(){throw e})}function Ju(e,t){var n=t,r=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(r===0){e.removeChild(s),Qo(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);Qo(t)}function Ar(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 Wg(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 Fi=Math.random().toString(36).slice(2),Rn="__reactFiber$"+Fi,ea="__reactProps$"+Fi,er="__reactContainer$"+Fi,zf="__reactEvents$"+Fi,tP="__reactListeners$"+Fi,nP="__reactHandles$"+Fi;function hs(e){var t=e[Rn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[er]||n[Rn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Wg(e);e!==null;){if(n=e[Rn])return n;e=Wg(e)}return t}e=n,n=e.parentNode}return null}function wa(e){return e=e[Rn]||e[er],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function ni(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(U(33))}function eu(e){return e[ea]||null}var $f=[],ri=-1;function Kr(e){return{current:e}}function Se(e){0>ri||(e.current=$f[ri],$f[ri]=null,ri--)}function we(e,t){ri++,$f[ri]=e.current,e.current=t}var Br={},it=Kr(Br),wt=Kr(!1),Ps=Br;function _i(e,t){var n=e.type.contextTypes;if(!n)return Br;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in n)s[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function bt(e){return e=e.childContextTypes,e!=null}function cc(){Se(wt),Se(it)}function Hg(e,t,n){if(it.current!==Br)throw Error(U(168));we(it,t),we(wt,n)}function Xw(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(U(108,$C(e)||"Unknown",s));return Re({},n,r)}function uc(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Br,Ps=it.current,we(it,e),we(wt,wt.current),!0}function Gg(e,t,n){var r=e.stateNode;if(!r)throw Error(U(169));n?(e=Xw(e,t,Ps),r.__reactInternalMemoizedMergedChildContext=e,Se(wt),Se(it),we(it,e)):Se(wt),we(wt,n)}var Kn=null,tu=!1,Zu=!1;function Jw(e){Kn===null?Kn=[e]:Kn.push(e)}function rP(e){tu=!0,Jw(e)}function qr(){if(!Zu&&Kn!==null){Zu=!0;var e=0,t=ue;try{var n=Kn;for(ue=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Kn=null,tu=!1}catch(s){throw Kn!==null&&(Kn=Kn.slice(e+1)),_w(fp,qr),s}finally{ue=t,Zu=!1}}return null}var si=[],ii=0,dc=null,fc=0,Qt=[],Yt=0,Es=null,Qn=1,Yn="";function os(e,t){si[ii++]=fc,si[ii++]=dc,dc=e,fc=t}function Zw(e,t,n){Qt[Yt++]=Qn,Qt[Yt++]=Yn,Qt[Yt++]=Es,Es=e;var r=Qn;e=Yn;var s=32-mn(r)-1;r&=~(1<<s),n+=1;var i=32-mn(t)+s;if(30<i){var o=s-s%5;i=(r&(1<<o)-1).toString(32),r>>=o,s-=o,Qn=1<<32-mn(t)+s|n<<s|r,Yn=i+e}else Qn=1<<i|n<<s|r,Yn=e}function bp(e){e.return!==null&&(os(e,1),Zw(e,1,0))}function kp(e){for(;e===dc;)dc=si[--ii],si[ii]=null,fc=si[--ii],si[ii]=null;for(;e===Es;)Es=Qt[--Yt],Qt[Yt]=null,Yn=Qt[--Yt],Qt[Yt]=null,Qn=Qt[--Yt],Qt[Yt]=null}var Dt=null,Mt=null,je=!1,pn=null;function e1(e,t){var n=Jt(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Kg(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Dt=e,Mt=Ar(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Dt=e,Mt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Es!==null?{id:Qn,overflow:Yn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Jt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Dt=e,Mt=null,!0):!1;default:return!1}}function Bf(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Vf(e){if(je){var t=Mt;if(t){var n=t;if(!Kg(e,t)){if(Bf(e))throw Error(U(418));t=Ar(n.nextSibling);var r=Dt;t&&Kg(e,t)?e1(r,n):(e.flags=e.flags&-4097|2,je=!1,Dt=e)}}else{if(Bf(e))throw Error(U(418));e.flags=e.flags&-4097|2,je=!1,Dt=e}}}function qg(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Dt=e}function Ka(e){if(e!==Dt)return!1;if(!je)return qg(e),je=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Ff(e.type,e.memoizedProps)),t&&(t=Mt)){if(Bf(e))throw t1(),Error(U(418));for(;t;)e1(e,t),t=Ar(t.nextSibling)}if(qg(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(U(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Mt=Ar(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Mt=null}}else Mt=Dt?Ar(e.stateNode.nextSibling):null;return!0}function t1(){for(var e=Mt;e;)e=Ar(e.nextSibling)}function Si(){Mt=Dt=null,je=!1}function _p(e){pn===null?pn=[e]:pn.push(e)}var sP=sr.ReactCurrentBatchConfig;function no(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(U(309));var r=n.stateNode}if(!r)throw Error(U(147,e));var s=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(o){var a=s.refs;o===null?delete a[i]:a[i]=o},t._stringRef=i,t)}if(typeof e!="string")throw Error(U(284));if(!n._owner)throw Error(U(290,e))}return e}function qa(e,t){throw e=Object.prototype.toString.call(t),Error(U(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Qg(e){var t=e._init;return t(e._payload)}function n1(e){function t(g,x){if(e){var w=g.deletions;w===null?(g.deletions=[x],g.flags|=16):w.push(x)}}function n(g,x){if(!e)return null;for(;x!==null;)t(g,x),x=x.sibling;return null}function r(g,x){for(g=new Map;x!==null;)x.key!==null?g.set(x.key,x):g.set(x.index,x),x=x.sibling;return g}function s(g,x){return g=Fr(g,x),g.index=0,g.sibling=null,g}function i(g,x,w){return g.index=w,e?(w=g.alternate,w!==null?(w=w.index,w<x?(g.flags|=2,x):w):(g.flags|=2,x)):(g.flags|=1048576,x)}function o(g){return e&&g.alternate===null&&(g.flags|=2),g}function a(g,x,w,k){return x===null||x.tag!==6?(x=od(w,g.mode,k),x.return=g,x):(x=s(x,w),x.return=g,x)}function l(g,x,w,k){var j=w.type;return j===Js?u(g,x,w.props.children,k,w.key):x!==null&&(x.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===xr&&Qg(j)===x.type)?(k=s(x,w.props),k.ref=no(g,x,w),k.return=g,k):(k=Ll(w.type,w.key,w.props,null,g.mode,k),k.ref=no(g,x,w),k.return=g,k)}function c(g,x,w,k){return x===null||x.tag!==4||x.stateNode.containerInfo!==w.containerInfo||x.stateNode.implementation!==w.implementation?(x=ad(w,g.mode,k),x.return=g,x):(x=s(x,w.children||[]),x.return=g,x)}function u(g,x,w,k,j){return x===null||x.tag!==7?(x=ws(w,g.mode,k,j),x.return=g,x):(x=s(x,w),x.return=g,x)}function f(g,x,w){if(typeof x=="string"&&x!==""||typeof x=="number")return x=od(""+x,g.mode,w),x.return=g,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Fa:return w=Ll(x.type,x.key,x.props,null,g.mode,w),w.ref=no(g,null,x),w.return=g,w;case Xs:return x=ad(x,g.mode,w),x.return=g,x;case xr:var k=x._init;return f(g,k(x._payload),w)}if(bo(x)||Xi(x))return x=ws(x,g.mode,w,null),x.return=g,x;qa(g,x)}return null}function p(g,x,w,k){var j=x!==null?x.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return j!==null?null:a(g,x,""+w,k);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Fa:return w.key===j?l(g,x,w,k):null;case Xs:return w.key===j?c(g,x,w,k):null;case xr:return j=w._init,p(g,x,j(w._payload),k)}if(bo(w)||Xi(w))return j!==null?null:u(g,x,w,k,null);qa(g,w)}return null}function h(g,x,w,k,j){if(typeof k=="string"&&k!==""||typeof k=="number")return g=g.get(w)||null,a(x,g,""+k,j);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case Fa:return g=g.get(k.key===null?w:k.key)||null,l(x,g,k,j);case Xs:return g=g.get(k.key===null?w:k.key)||null,c(x,g,k,j);case xr:var _=k._init;return h(g,x,w,_(k._payload),j)}if(bo(k)||Xi(k))return g=g.get(w)||null,u(x,g,k,j,null);qa(x,k)}return null}function m(g,x,w,k){for(var j=null,_=null,S=x,P=x=0,T=null;S!==null&&P<w.length;P++){S.index>P?(T=S,S=null):T=S.sibling;var E=p(g,S,w[P],k);if(E===null){S===null&&(S=T);break}e&&S&&E.alternate===null&&t(g,S),x=i(E,x,P),_===null?j=E:_.sibling=E,_=E,S=T}if(P===w.length)return n(g,S),je&&os(g,P),j;if(S===null){for(;P<w.length;P++)S=f(g,w[P],k),S!==null&&(x=i(S,x,P),_===null?j=S:_.sibling=S,_=S);return je&&os(g,P),j}for(S=r(g,S);P<w.length;P++)T=h(S,g,P,w[P],k),T!==null&&(e&&T.alternate!==null&&S.delete(T.key===null?P:T.key),x=i(T,x,P),_===null?j=T:_.sibling=T,_=T);return e&&S.forEach(function(I){return t(g,I)}),je&&os(g,P),j}function y(g,x,w,k){var j=Xi(w);if(typeof j!="function")throw Error(U(150));if(w=j.call(w),w==null)throw Error(U(151));for(var _=j=null,S=x,P=x=0,T=null,E=w.next();S!==null&&!E.done;P++,E=w.next()){S.index>P?(T=S,S=null):T=S.sibling;var I=p(g,S,E.value,k);if(I===null){S===null&&(S=T);break}e&&S&&I.alternate===null&&t(g,S),x=i(I,x,P),_===null?j=I:_.sibling=I,_=I,S=T}if(E.done)return n(g,S),je&&os(g,P),j;if(S===null){for(;!E.done;P++,E=w.next())E=f(g,E.value,k),E!==null&&(x=i(E,x,P),_===null?j=E:_.sibling=E,_=E);return je&&os(g,P),j}for(S=r(g,S);!E.done;P++,E=w.next())E=h(S,g,P,E.value,k),E!==null&&(e&&E.alternate!==null&&S.delete(E.key===null?P:E.key),x=i(E,x,P),_===null?j=E:_.sibling=E,_=E);return e&&S.forEach(function(A){return t(g,A)}),je&&os(g,P),j}function v(g,x,w,k){if(typeof w=="object"&&w!==null&&w.type===Js&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Fa:e:{for(var j=w.key,_=x;_!==null;){if(_.key===j){if(j=w.type,j===Js){if(_.tag===7){n(g,_.sibling),x=s(_,w.props.children),x.return=g,g=x;break e}}else if(_.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===xr&&Qg(j)===_.type){n(g,_.sibling),x=s(_,w.props),x.ref=no(g,_,w),x.return=g,g=x;break e}n(g,_);break}else t(g,_);_=_.sibling}w.type===Js?(x=ws(w.props.children,g.mode,k,w.key),x.return=g,g=x):(k=Ll(w.type,w.key,w.props,null,g.mode,k),k.ref=no(g,x,w),k.return=g,g=k)}return o(g);case Xs:e:{for(_=w.key;x!==null;){if(x.key===_)if(x.tag===4&&x.stateNode.containerInfo===w.containerInfo&&x.stateNode.implementation===w.implementation){n(g,x.sibling),x=s(x,w.children||[]),x.return=g,g=x;break e}else{n(g,x);break}else t(g,x);x=x.sibling}x=ad(w,g.mode,k),x.return=g,g=x}return o(g);case xr:return _=w._init,v(g,x,_(w._payload),k)}if(bo(w))return m(g,x,w,k);if(Xi(w))return y(g,x,w,k);qa(g,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,x!==null&&x.tag===6?(n(g,x.sibling),x=s(x,w),x.return=g,g=x):(n(g,x),x=od(w,g.mode,k),x.return=g,g=x),o(g)):n(g,x)}return v}var Ci=n1(!0),r1=n1(!1),hc=Kr(null),pc=null,oi=null,Sp=null;function Cp(){Sp=oi=pc=null}function jp(e){var t=hc.current;Se(hc),e._currentValue=t}function Uf(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 gi(e,t){pc=e,Sp=oi=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(xt=!0),e.firstContext=null)}function nn(e){var t=e._currentValue;if(Sp!==e)if(e={context:e,memoizedValue:t,next:null},oi===null){if(pc===null)throw Error(U(308));oi=e,pc.dependencies={lanes:0,firstContext:e}}else oi=oi.next=e;return t}var ps=null;function Pp(e){ps===null?ps=[e]:ps.push(e)}function s1(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,Pp(t)):(n.next=s.next,s.next=n),t.interleaved=n,tr(e,r)}function tr(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 vr=!1;function Ep(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function i1(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 Xn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Mr(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ae&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,tr(e,n)}return s=r.interleaved,s===null?(t.next=t,Pp(r)):(t.next=s.next,s.next=t),r.interleaved=t,tr(e,n)}function Tl(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,hp(e,n)}}function Yg(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?s=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?s=i=t:i=i.next=t}else s=i=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function mc(e,t,n,r){var s=e.updateQueue;vr=!1;var i=s.firstBaseUpdate,o=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var l=a,c=l.next;l.next=null,o===null?i=c:o.next=c,o=l;var u=e.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==o&&(a===null?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(i!==null){var f=s.baseState;o=0,u=c=l=null,a=i;do{var p=a.lane,h=a.eventTime;if((r&p)===p){u!==null&&(u=u.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var m=e,y=a;switch(p=t,h=n,y.tag){case 1:if(m=y.payload,typeof m=="function"){f=m.call(h,f,p);break e}f=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=y.payload,p=typeof m=="function"?m.call(h,f,p):m,p==null)break e;f=Re({},f,p);break e;case 2:vr=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,p=s.effects,p===null?s.effects=[a]:p.push(a))}else h={eventTime:h,lane:p,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(c=u=h,l=f):u=u.next=h,o|=p;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;p=a,a=p.next,p.next=null,s.lastBaseUpdate=p,s.shared.pending=null}}while(!0);if(u===null&&(l=f),s.baseState=l,s.firstBaseUpdate=c,s.lastBaseUpdate=u,t=s.shared.interleaved,t!==null){s=t;do o|=s.lane,s=s.next;while(s!==t)}else i===null&&(s.shared.lanes=0);Ns|=o,e.lanes=o,e.memoizedState=f}}function Xg(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],s=r.callback;if(s!==null){if(r.callback=null,r=n,typeof s!="function")throw Error(U(191,s));s.call(r)}}}var ba={},Mn=Kr(ba),ta=Kr(ba),na=Kr(ba);function ms(e){if(e===ba)throw Error(U(174));return e}function Tp(e,t){switch(we(na,t),we(ta,e),we(Mn,ba),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:_f(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=_f(t,e)}Se(Mn),we(Mn,t)}function ji(){Se(Mn),Se(ta),Se(na)}function o1(e){ms(na.current);var t=ms(Mn.current),n=_f(t,e.type);t!==n&&(we(ta,e),we(Mn,n))}function Np(e){ta.current===e&&(Se(Mn),Se(ta))}var Ee=Kr(0);function gc(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 ed=[];function Rp(){for(var e=0;e<ed.length;e++)ed[e]._workInProgressVersionPrimary=null;ed.length=0}var Nl=sr.ReactCurrentDispatcher,td=sr.ReactCurrentBatchConfig,Ts=0,Ne=null,Ve=null,Ke=null,yc=!1,Io=!1,ra=0,iP=0;function et(){throw Error(U(321))}function Ip(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!xn(e[n],t[n]))return!1;return!0}function Ap(e,t,n,r,s,i){if(Ts=i,Ne=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Nl.current=e===null||e.memoizedState===null?cP:uP,e=n(r,s),Io){i=0;do{if(Io=!1,ra=0,25<=i)throw Error(U(301));i+=1,Ke=Ve=null,t.updateQueue=null,Nl.current=dP,e=n(r,s)}while(Io)}if(Nl.current=xc,t=Ve!==null&&Ve.next!==null,Ts=0,Ke=Ve=Ne=null,yc=!1,t)throw Error(U(300));return e}function Mp(){var e=ra!==0;return ra=0,e}function jn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ke===null?Ne.memoizedState=Ke=e:Ke=Ke.next=e,Ke}function rn(){if(Ve===null){var e=Ne.alternate;e=e!==null?e.memoizedState:null}else e=Ve.next;var t=Ke===null?Ne.memoizedState:Ke.next;if(t!==null)Ke=t,Ve=e;else{if(e===null)throw Error(U(310));Ve=e,e={memoizedState:Ve.memoizedState,baseState:Ve.baseState,baseQueue:Ve.baseQueue,queue:Ve.queue,next:null},Ke===null?Ne.memoizedState=Ke=e:Ke=Ke.next=e}return Ke}function sa(e,t){return typeof t=="function"?t(e):t}function nd(e){var t=rn(),n=t.queue;if(n===null)throw Error(U(311));n.lastRenderedReducer=e;var r=Ve,s=r.baseQueue,i=n.pending;if(i!==null){if(s!==null){var o=s.next;s.next=i.next,i.next=o}r.baseQueue=s=i,n.pending=null}if(s!==null){i=s.next,r=r.baseState;var a=o=null,l=null,c=i;do{var u=c.lane;if((Ts&u)===u)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var f={lane:u,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=f,o=r):l=l.next=f,Ne.lanes|=u,Ns|=u}c=c.next}while(c!==null&&c!==i);l===null?o=r:l.next=a,xn(r,t.memoizedState)||(xt=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){s=e;do i=s.lane,Ne.lanes|=i,Ns|=i,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function rd(e){var t=rn(),n=t.queue;if(n===null)throw Error(U(311));n.lastRenderedReducer=e;var r=n.dispatch,s=n.pending,i=t.memoizedState;if(s!==null){n.pending=null;var o=s=s.next;do i=e(i,o.action),o=o.next;while(o!==s);xn(i,t.memoizedState)||(xt=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function a1(){}function l1(e,t){var n=Ne,r=rn(),s=t(),i=!xn(r.memoizedState,s);if(i&&(r.memoizedState=s,xt=!0),r=r.queue,Lp(d1.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||Ke!==null&&Ke.memoizedState.tag&1){if(n.flags|=2048,ia(9,u1.bind(null,n,r,s,t),void 0,null),qe===null)throw Error(U(349));Ts&30||c1(n,t,s)}return s}function c1(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 u1(e,t,n,r){t.value=n,t.getSnapshot=r,f1(t)&&h1(e)}function d1(e,t,n){return n(function(){f1(t)&&h1(e)})}function f1(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!xn(e,n)}catch{return!0}}function h1(e){var t=tr(e,1);t!==null&&gn(t,e,1,-1)}function Jg(e){var t=jn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:sa,lastRenderedState:e},t.queue=e,e=e.dispatch=lP.bind(null,Ne,e),[t.memoizedState,e]}function ia(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 p1(){return rn().memoizedState}function Rl(e,t,n,r){var s=jn();Ne.flags|=e,s.memoizedState=ia(1|t,n,void 0,r===void 0?null:r)}function nu(e,t,n,r){var s=rn();r=r===void 0?null:r;var i=void 0;if(Ve!==null){var o=Ve.memoizedState;if(i=o.destroy,r!==null&&Ip(r,o.deps)){s.memoizedState=ia(t,n,i,r);return}}Ne.flags|=e,s.memoizedState=ia(1|t,n,i,r)}function Zg(e,t){return Rl(8390656,8,e,t)}function Lp(e,t){return nu(2048,8,e,t)}function m1(e,t){return nu(4,2,e,t)}function g1(e,t){return nu(4,4,e,t)}function y1(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 x1(e,t,n){return n=n!=null?n.concat([e]):null,nu(4,4,y1.bind(null,t,e),n)}function Dp(){}function v1(e,t){var n=rn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Ip(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function w1(e,t){var n=rn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Ip(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function b1(e,t,n){return Ts&21?(xn(n,t)||(n=jw(),Ne.lanes|=n,Ns|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,xt=!0),e.memoizedState=n)}function oP(e,t){var n=ue;ue=n!==0&&4>n?n:4,e(!0);var r=td.transition;td.transition={};try{e(!1),t()}finally{ue=n,td.transition=r}}function k1(){return rn().memoizedState}function aP(e,t,n){var r=Dr(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},_1(e))S1(t,n);else if(n=s1(e,t,n,r),n!==null){var s=ft();gn(n,e,r,s),C1(n,t,r)}}function lP(e,t,n){var r=Dr(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(_1(e))S1(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,a=i(o,n);if(s.hasEagerState=!0,s.eagerState=a,xn(a,o)){var l=t.interleaved;l===null?(s.next=s,Pp(t)):(s.next=l.next,l.next=s),t.interleaved=s;return}}catch{}finally{}n=s1(e,t,s,r),n!==null&&(s=ft(),gn(n,e,r,s),C1(n,t,r))}}function _1(e){var t=e.alternate;return e===Ne||t!==null&&t===Ne}function S1(e,t){Io=yc=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function C1(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,hp(e,n)}}var xc={readContext:nn,useCallback:et,useContext:et,useEffect:et,useImperativeHandle:et,useInsertionEffect:et,useLayoutEffect:et,useMemo:et,useReducer:et,useRef:et,useState:et,useDebugValue:et,useDeferredValue:et,useTransition:et,useMutableSource:et,useSyncExternalStore:et,useId:et,unstable_isNewReconciler:!1},cP={readContext:nn,useCallback:function(e,t){return jn().memoizedState=[e,t===void 0?null:t],e},useContext:nn,useEffect:Zg,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Rl(4194308,4,y1.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Rl(4194308,4,e,t)},useInsertionEffect:function(e,t){return Rl(4,2,e,t)},useMemo:function(e,t){var n=jn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=jn();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=aP.bind(null,Ne,e),[r.memoizedState,e]},useRef:function(e){var t=jn();return e={current:e},t.memoizedState=e},useState:Jg,useDebugValue:Dp,useDeferredValue:function(e){return jn().memoizedState=e},useTransition:function(){var e=Jg(!1),t=e[0];return e=oP.bind(null,e[1]),jn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ne,s=jn();if(je){if(n===void 0)throw Error(U(407));n=n()}else{if(n=t(),qe===null)throw Error(U(349));Ts&30||c1(r,t,n)}s.memoizedState=n;var i={value:n,getSnapshot:t};return s.queue=i,Zg(d1.bind(null,r,i,e),[e]),r.flags|=2048,ia(9,u1.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=jn(),t=qe.identifierPrefix;if(je){var n=Yn,r=Qn;n=(r&~(1<<32-mn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ra++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=iP++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},uP={readContext:nn,useCallback:v1,useContext:nn,useEffect:Lp,useImperativeHandle:x1,useInsertionEffect:m1,useLayoutEffect:g1,useMemo:w1,useReducer:nd,useRef:p1,useState:function(){return nd(sa)},useDebugValue:Dp,useDeferredValue:function(e){var t=rn();return b1(t,Ve.memoizedState,e)},useTransition:function(){var e=nd(sa)[0],t=rn().memoizedState;return[e,t]},useMutableSource:a1,useSyncExternalStore:l1,useId:k1,unstable_isNewReconciler:!1},dP={readContext:nn,useCallback:v1,useContext:nn,useEffect:Lp,useImperativeHandle:x1,useInsertionEffect:m1,useLayoutEffect:g1,useMemo:w1,useReducer:rd,useRef:p1,useState:function(){return rd(sa)},useDebugValue:Dp,useDeferredValue:function(e){var t=rn();return Ve===null?t.memoizedState=e:b1(t,Ve.memoizedState,e)},useTransition:function(){var e=rd(sa)[0],t=rn().memoizedState;return[e,t]},useMutableSource:a1,useSyncExternalStore:l1,useId:k1,unstable_isNewReconciler:!1};function fn(e,t){if(e&&e.defaultProps){t=Re({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Wf(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Re({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var ru={isMounted:function(e){return(e=e._reactInternals)?As(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=ft(),s=Dr(e),i=Xn(r,s);i.payload=t,n!=null&&(i.callback=n),t=Mr(e,i,s),t!==null&&(gn(t,e,s,r),Tl(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=ft(),s=Dr(e),i=Xn(r,s);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Mr(e,i,s),t!==null&&(gn(t,e,s,r),Tl(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=ft(),r=Dr(e),s=Xn(n,r);s.tag=2,t!=null&&(s.callback=t),t=Mr(e,s,r),t!==null&&(gn(t,e,r,n),Tl(t,e,r))}};function ey(e,t,n,r,s,i,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,o):t.prototype&&t.prototype.isPureReactComponent?!Xo(n,r)||!Xo(s,i):!0}function j1(e,t,n){var r=!1,s=Br,i=t.contextType;return typeof i=="object"&&i!==null?i=nn(i):(s=bt(t)?Ps:it.current,r=t.contextTypes,i=(r=r!=null)?_i(e,s):Br),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=ru,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=i),t}function ty(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&&ru.enqueueReplaceState(t,t.state,null)}function Hf(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},Ep(e);var i=t.contextType;typeof i=="object"&&i!==null?s.context=nn(i):(i=bt(t)?Ps:it.current,s.context=_i(e,i)),s.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Wf(e,t,i,n),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&ru.enqueueReplaceState(s,s.state,null),mc(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function Pi(e,t){try{var n="",r=t;do n+=zC(r),r=r.return;while(r);var s=n}catch(i){s=`
|
|
40
|
+
Error generating stack: `+i.message+`
|
|
41
|
+
`+i.stack}return{value:e,source:t,stack:s,digest:null}}function sd(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Gf(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var fP=typeof WeakMap=="function"?WeakMap:Map;function P1(e,t,n){n=Xn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){wc||(wc=!0,nh=r),Gf(e,t)},n}function E1(e,t,n){n=Xn(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var s=t.value;n.payload=function(){return r(s)},n.callback=function(){Gf(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Gf(e,t),typeof r!="function"&&(Lr===null?Lr=new Set([this]):Lr.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function ny(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new fP;var s=new Set;r.set(t,s)}else s=r.get(t),s===void 0&&(s=new Set,r.set(t,s));s.has(n)||(s.add(n),e=jP.bind(null,e,t,n),t.then(e,e))}function ry(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 sy(e,t,n,r,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Xn(-1,1),t.tag=2,Mr(n,t,1))),n.lanes|=1),e)}var hP=sr.ReactCurrentOwner,xt=!1;function lt(e,t,n,r){t.child=e===null?r1(t,null,n,r):Ci(t,e.child,n,r)}function iy(e,t,n,r,s){n=n.render;var i=t.ref;return gi(t,s),r=Ap(e,t,n,r,i,s),n=Mp(),e!==null&&!xt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,nr(e,t,s)):(je&&n&&bp(t),t.flags|=1,lt(e,t,r,s),t.child)}function oy(e,t,n,r,s){if(e===null){var i=n.type;return typeof i=="function"&&!Wp(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,T1(e,t,i,r,s)):(e=Ll(n.type,null,r,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&s)){var o=i.memoizedProps;if(n=n.compare,n=n!==null?n:Xo,n(o,r)&&e.ref===t.ref)return nr(e,t,s)}return t.flags|=1,e=Fr(i,r),e.ref=t.ref,e.return=t,t.child=e}function T1(e,t,n,r,s){if(e!==null){var i=e.memoizedProps;if(Xo(i,r)&&e.ref===t.ref)if(xt=!1,t.pendingProps=r=i,(e.lanes&s)!==0)e.flags&131072&&(xt=!0);else return t.lanes=e.lanes,nr(e,t,s)}return Kf(e,t,n,r,s)}function N1(e,t,n){var r=t.pendingProps,s=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},we(li,At),At|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,we(li,At),At|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,we(li,At),At|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,we(li,At),At|=r;return lt(e,t,s,n),t.child}function R1(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Kf(e,t,n,r,s){var i=bt(n)?Ps:it.current;return i=_i(t,i),gi(t,s),n=Ap(e,t,n,r,i,s),r=Mp(),e!==null&&!xt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,nr(e,t,s)):(je&&r&&bp(t),t.flags|=1,lt(e,t,n,s),t.child)}function ay(e,t,n,r,s){if(bt(n)){var i=!0;uc(t)}else i=!1;if(gi(t,s),t.stateNode===null)Il(e,t),j1(t,n,r),Hf(t,n,r,s),r=!0;else if(e===null){var o=t.stateNode,a=t.memoizedProps;o.props=a;var l=o.context,c=n.contextType;typeof c=="object"&&c!==null?c=nn(c):(c=bt(n)?Ps:it.current,c=_i(t,c));var u=n.getDerivedStateFromProps,f=typeof u=="function"||typeof o.getSnapshotBeforeUpdate=="function";f||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||l!==c)&&ty(t,o,r,c),vr=!1;var p=t.memoizedState;o.state=p,mc(t,r,o,s),l=t.memoizedState,a!==r||p!==l||wt.current||vr?(typeof u=="function"&&(Wf(t,n,u,r),l=t.memoizedState),(a=vr||ey(t,n,a,r,p,l,c))?(f||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),o.props=r,o.state=l,o.context=c,r=a):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,i1(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:fn(t.type,a),o.props=c,f=t.pendingProps,p=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=nn(l):(l=bt(n)?Ps:it.current,l=_i(t,l));var h=n.getDerivedStateFromProps;(u=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==f||p!==l)&&ty(t,o,r,l),vr=!1,p=t.memoizedState,o.state=p,mc(t,r,o,s);var m=t.memoizedState;a!==f||p!==m||wt.current||vr?(typeof h=="function"&&(Wf(t,n,h,r),m=t.memoizedState),(c=vr||ey(t,n,c,r,p,m,l)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,m,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,m,l)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),o.props=r,o.state=m,o.context=l,r=c):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return qf(e,t,n,r,i,s)}function qf(e,t,n,r,s,i){R1(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return s&&Gg(t,n,!1),nr(e,t,i);r=t.stateNode,hP.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Ci(t,e.child,null,i),t.child=Ci(t,null,a,i)):lt(e,t,a,i),t.memoizedState=r.state,s&&Gg(t,n,!0),t.child}function I1(e){var t=e.stateNode;t.pendingContext?Hg(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Hg(e,t.context,!1),Tp(e,t.containerInfo)}function ly(e,t,n,r,s){return Si(),_p(s),t.flags|=256,lt(e,t,n,r),t.child}var Qf={dehydrated:null,treeContext:null,retryLane:0};function Yf(e){return{baseLanes:e,cachePool:null,transitions:null}}function A1(e,t,n){var r=t.pendingProps,s=Ee.current,i=!1,o=(t.flags&128)!==0,a;if((a=o)||(a=e!==null&&e.memoizedState===null?!1:(s&2)!==0),a?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),we(Ee,s&1),e===null)return Vf(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,i?(r=t.mode,i=t.child,o={mode:"hidden",children:o},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=ou(o,r,0,null),e=ws(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Yf(n),t.memoizedState=Qf,e):Fp(t,o));if(s=e.memoizedState,s!==null&&(a=s.dehydrated,a!==null))return pP(e,t,o,r,a,s,n);if(i){i=r.fallback,o=t.mode,s=e.child,a=s.sibling;var l={mode:"hidden",children:r.children};return!(o&1)&&t.child!==s?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=Fr(s,l),r.subtreeFlags=s.subtreeFlags&14680064),a!==null?i=Fr(a,i):(i=ws(i,o,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,o=e.child.memoizedState,o=o===null?Yf(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=e.childLanes&~n,t.memoizedState=Qf,r}return i=e.child,e=i.sibling,r=Fr(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Fp(e,t){return t=ou({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Qa(e,t,n,r){return r!==null&&_p(r),Ci(t,e.child,null,n),e=Fp(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function pP(e,t,n,r,s,i,o){if(n)return t.flags&256?(t.flags&=-257,r=sd(Error(U(422))),Qa(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,s=t.mode,r=ou({mode:"visible",children:r.children},s,0,null),i=ws(i,s,o,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&Ci(t,e.child,null,o),t.child.memoizedState=Yf(o),t.memoizedState=Qf,i);if(!(t.mode&1))return Qa(e,t,o,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(U(419)),r=sd(i,r,void 0),Qa(e,t,o,r)}if(a=(o&e.childLanes)!==0,xt||a){if(r=qe,r!==null){switch(o&-o){case 4:s=2;break;case 16:s=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(r.suspendedLanes|o)?0:s,s!==0&&s!==i.retryLane&&(i.retryLane=s,tr(e,s),gn(r,e,s,-1))}return Up(),r=sd(Error(U(421))),Qa(e,t,o,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=PP.bind(null,e),s._reactRetry=t,null):(e=i.treeContext,Mt=Ar(s.nextSibling),Dt=t,je=!0,pn=null,e!==null&&(Qt[Yt++]=Qn,Qt[Yt++]=Yn,Qt[Yt++]=Es,Qn=e.id,Yn=e.overflow,Es=t),t=Fp(t,r.children),t.flags|=4096,t)}function cy(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Uf(e.return,t,n)}function id(e,t,n,r,s){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=s)}function M1(e,t,n){var r=t.pendingProps,s=r.revealOrder,i=r.tail;if(lt(e,t,r.children,n),r=Ee.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&cy(e,n,t);else if(e.tag===19)cy(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(we(Ee,r),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&gc(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),id(t,!1,s,n,i);break;case"backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&gc(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}id(t,!0,n,null,i);break;case"together":id(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Il(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function nr(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ns|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(U(153));if(t.child!==null){for(e=t.child,n=Fr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Fr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function mP(e,t,n){switch(t.tag){case 3:I1(t),Si();break;case 5:o1(t);break;case 1:bt(t.type)&&uc(t);break;case 4:Tp(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;we(hc,r._currentValue),r._currentValue=s;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(we(Ee,Ee.current&1),t.flags|=128,null):n&t.child.childLanes?A1(e,t,n):(we(Ee,Ee.current&1),e=nr(e,t,n),e!==null?e.sibling:null);we(Ee,Ee.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return M1(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),we(Ee,Ee.current),r)break;return null;case 22:case 23:return t.lanes=0,N1(e,t,n)}return nr(e,t,n)}var L1,Xf,D1,F1;L1=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}};Xf=function(){};D1=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,ms(Mn.current);var i=null;switch(n){case"input":s=vf(e,s),r=vf(e,r),i=[];break;case"select":s=Re({},s,{value:void 0}),r=Re({},r,{value:void 0}),i=[];break;case"textarea":s=kf(e,s),r=kf(e,r),i=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=lc)}Sf(n,r);var o;n=null;for(c in s)if(!r.hasOwnProperty(c)&&s.hasOwnProperty(c)&&s[c]!=null)if(c==="style"){var a=s[c];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Wo.hasOwnProperty(c)?i||(i=[]):(i=i||[]).push(c,null));for(c in r){var l=r[c];if(a=s!=null?s[c]:void 0,r.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(n||(n={}),n[o]=l[o])}else n||(i||(i=[]),i.push(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(i=i||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Wo.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&_e("scroll",e),i||a===l||(i=[])):(i=i||[]).push(c,l))}n&&(i=i||[]).push("style",n);var c=i;(t.updateQueue=c)&&(t.flags|=4)}};F1=function(e,t,n,r){n!==r&&(t.flags|=4)};function ro(e,t){if(!je)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function tt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&14680064,r|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function gP(e,t,n){var r=t.pendingProps;switch(kp(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return tt(t),null;case 1:return bt(t.type)&&cc(),tt(t),null;case 3:return r=t.stateNode,ji(),Se(wt),Se(it),Rp(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Ka(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,pn!==null&&(ih(pn),pn=null))),Xf(e,t),tt(t),null;case 5:Np(t);var s=ms(na.current);if(n=t.type,e!==null&&t.stateNode!=null)D1(e,t,n,r,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(U(166));return tt(t),null}if(e=ms(Mn.current),Ka(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Rn]=t,r[ea]=i,e=(t.mode&1)!==0,n){case"dialog":_e("cancel",r),_e("close",r);break;case"iframe":case"object":case"embed":_e("load",r);break;case"video":case"audio":for(s=0;s<_o.length;s++)_e(_o[s],r);break;case"source":_e("error",r);break;case"img":case"image":case"link":_e("error",r),_e("load",r);break;case"details":_e("toggle",r);break;case"input":xg(r,i),_e("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},_e("invalid",r);break;case"textarea":wg(r,i),_e("invalid",r)}Sf(n,i),s=null;for(var o in i)if(i.hasOwnProperty(o)){var a=i[o];o==="children"?typeof a=="string"?r.textContent!==a&&(i.suppressHydrationWarning!==!0&&Ga(r.textContent,a,e),s=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&Ga(r.textContent,a,e),s=["children",""+a]):Wo.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&_e("scroll",r)}switch(n){case"input":Oa(r),vg(r,i,!0);break;case"textarea":Oa(r),bg(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=lc)}r=s,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=dw(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[Rn]=t,e[ea]=r,L1(e,t,!1,!1),t.stateNode=e;e:{switch(o=Cf(n,r),n){case"dialog":_e("cancel",e),_e("close",e),s=r;break;case"iframe":case"object":case"embed":_e("load",e),s=r;break;case"video":case"audio":for(s=0;s<_o.length;s++)_e(_o[s],e);s=r;break;case"source":_e("error",e),s=r;break;case"img":case"image":case"link":_e("error",e),_e("load",e),s=r;break;case"details":_e("toggle",e),s=r;break;case"input":xg(e,r),s=vf(e,r),_e("invalid",e);break;case"option":s=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=Re({},r,{value:void 0}),_e("invalid",e);break;case"textarea":wg(e,r),s=kf(e,r),_e("invalid",e);break;default:s=r}Sf(n,s),a=s;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?pw(e,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&fw(e,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&Ho(e,l):typeof l=="number"&&Ho(e,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Wo.hasOwnProperty(i)?l!=null&&i==="onScroll"&&_e("scroll",e):l!=null&&ap(e,i,l,o))}switch(n){case"input":Oa(e),vg(e,r,!1);break;case"textarea":Oa(e),bg(e);break;case"option":r.value!=null&&e.setAttribute("value",""+$r(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?fi(e,!!r.multiple,i,!1):r.defaultValue!=null&&fi(e,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=lc)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return tt(t),null;case 6:if(e&&t.stateNode!=null)F1(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(U(166));if(n=ms(na.current),ms(Mn.current),Ka(t)){if(r=t.stateNode,n=t.memoizedProps,r[Rn]=t,(i=r.nodeValue!==n)&&(e=Dt,e!==null))switch(e.tag){case 3:Ga(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Ga(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Rn]=t,t.stateNode=r}return tt(t),null;case 13:if(Se(Ee),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(je&&Mt!==null&&t.mode&1&&!(t.flags&128))t1(),Si(),t.flags|=98560,i=!1;else if(i=Ka(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(U(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(U(317));i[Rn]=t}else Si(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;tt(t),i=!1}else pn!==null&&(ih(pn),pn=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Ee.current&1?Ue===0&&(Ue=3):Up())),t.updateQueue!==null&&(t.flags|=4),tt(t),null);case 4:return ji(),Xf(e,t),e===null&&Jo(t.stateNode.containerInfo),tt(t),null;case 10:return jp(t.type._context),tt(t),null;case 17:return bt(t.type)&&cc(),tt(t),null;case 19:if(Se(Ee),i=t.memoizedState,i===null)return tt(t),null;if(r=(t.flags&128)!==0,o=i.rendering,o===null)if(r)ro(i,!1);else{if(Ue!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=gc(e),o!==null){for(t.flags|=128,ro(i,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,o=i.alternate,o===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,e=o.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return we(Ee,Ee.current&1|2),t.child}e=e.sibling}i.tail!==null&&De()>Ei&&(t.flags|=128,r=!0,ro(i,!1),t.lanes=4194304)}else{if(!r)if(e=gc(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ro(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!je)return tt(t),null}else 2*De()-i.renderingStartTime>Ei&&n!==1073741824&&(t.flags|=128,r=!0,ro(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(n=i.last,n!==null?n.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=De(),t.sibling=null,n=Ee.current,we(Ee,r?n&1|2:n&1),t):(tt(t),null);case 22:case 23:return Vp(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?At&1073741824&&(tt(t),t.subtreeFlags&6&&(t.flags|=8192)):tt(t),null;case 24:return null;case 25:return null}throw Error(U(156,t.tag))}function yP(e,t){switch(kp(t),t.tag){case 1:return bt(t.type)&&cc(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ji(),Se(wt),Se(it),Rp(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Np(t),null;case 13:if(Se(Ee),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(U(340));Si()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Se(Ee),null;case 4:return ji(),null;case 10:return jp(t.type._context),null;case 22:case 23:return Vp(),null;case 24:return null;default:return null}}var Ya=!1,rt=!1,xP=typeof WeakSet=="function"?WeakSet:Set,K=null;function ai(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Me(e,t,r)}else n.current=null}function Jf(e,t,n){try{n()}catch(r){Me(e,t,r)}}var uy=!1;function vP(e,t){if(Lf=ic,e=Vw(),wp(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,a=-1,l=-1,c=0,u=0,f=e,p=null;t:for(;;){for(var h;f!==n||s!==0&&f.nodeType!==3||(a=o+s),f!==i||r!==0&&f.nodeType!==3||(l=o+r),f.nodeType===3&&(o+=f.nodeValue.length),(h=f.firstChild)!==null;)p=f,f=h;for(;;){if(f===e)break t;if(p===n&&++c===s&&(a=o),p===i&&++u===r&&(l=o),(h=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=h}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Df={focusedElem:e,selectionRange:n},ic=!1,K=t;K!==null;)if(t=K,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,K=e;else for(;K!==null;){t=K;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var y=m.memoizedProps,v=m.memoizedState,g=t.stateNode,x=g.getSnapshotBeforeUpdate(t.elementType===t.type?y:fn(t.type,y),v);g.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(U(163))}}catch(k){Me(t,t.return,k)}if(e=t.sibling,e!==null){e.return=t.return,K=e;break}K=t.return}return m=uy,uy=!1,m}function Ao(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var i=s.destroy;s.destroy=void 0,i!==void 0&&Jf(t,n,i)}s=s.next}while(s!==r)}}function su(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 Zf(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 O1(e){var t=e.alternate;t!==null&&(e.alternate=null,O1(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Rn],delete t[ea],delete t[zf],delete t[tP],delete t[nP])),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 z1(e){return e.tag===5||e.tag===3||e.tag===4}function dy(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||z1(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 eh(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=lc));else if(r!==4&&(e=e.child,e!==null))for(eh(e,t,n),e=e.sibling;e!==null;)eh(e,t,n),e=e.sibling}function th(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(th(e,t,n),e=e.sibling;e!==null;)th(e,t,n),e=e.sibling}var Qe=null,hn=!1;function or(e,t,n){for(n=n.child;n!==null;)$1(e,t,n),n=n.sibling}function $1(e,t,n){if(An&&typeof An.onCommitFiberUnmount=="function")try{An.onCommitFiberUnmount(Yc,n)}catch{}switch(n.tag){case 5:rt||ai(n,t);case 6:var r=Qe,s=hn;Qe=null,or(e,t,n),Qe=r,hn=s,Qe!==null&&(hn?(e=Qe,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Qe.removeChild(n.stateNode));break;case 18:Qe!==null&&(hn?(e=Qe,n=n.stateNode,e.nodeType===8?Ju(e.parentNode,n):e.nodeType===1&&Ju(e,n),Qo(e)):Ju(Qe,n.stateNode));break;case 4:r=Qe,s=hn,Qe=n.stateNode.containerInfo,hn=!0,or(e,t,n),Qe=r,hn=s;break;case 0:case 11:case 14:case 15:if(!rt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var i=s,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&Jf(n,t,o),s=s.next}while(s!==r)}or(e,t,n);break;case 1:if(!rt&&(ai(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Me(n,t,a)}or(e,t,n);break;case 21:or(e,t,n);break;case 22:n.mode&1?(rt=(r=rt)||n.memoizedState!==null,or(e,t,n),rt=r):or(e,t,n);break;default:or(e,t,n)}}function fy(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new xP),t.forEach(function(r){var s=EP.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function an(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];try{var i=e,o=t,a=o;e:for(;a!==null;){switch(a.tag){case 5:Qe=a.stateNode,hn=!1;break e;case 3:Qe=a.stateNode.containerInfo,hn=!0;break e;case 4:Qe=a.stateNode.containerInfo,hn=!0;break e}a=a.return}if(Qe===null)throw Error(U(160));$1(i,o,s),Qe=null,hn=!1;var l=s.alternate;l!==null&&(l.return=null),s.return=null}catch(c){Me(s,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)B1(t,e),t=t.sibling}function B1(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(an(t,e),kn(e),r&4){try{Ao(3,e,e.return),su(3,e)}catch(y){Me(e,e.return,y)}try{Ao(5,e,e.return)}catch(y){Me(e,e.return,y)}}break;case 1:an(t,e),kn(e),r&512&&n!==null&&ai(n,n.return);break;case 5:if(an(t,e),kn(e),r&512&&n!==null&&ai(n,n.return),e.flags&32){var s=e.stateNode;try{Ho(s,"")}catch(y){Me(e,e.return,y)}}if(r&4&&(s=e.stateNode,s!=null)){var i=e.memoizedProps,o=n!==null?n.memoizedProps:i,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&cw(s,i),Cf(a,o);var c=Cf(a,i);for(o=0;o<l.length;o+=2){var u=l[o],f=l[o+1];u==="style"?pw(s,f):u==="dangerouslySetInnerHTML"?fw(s,f):u==="children"?Ho(s,f):ap(s,u,f,c)}switch(a){case"input":wf(s,i);break;case"textarea":uw(s,i);break;case"select":var p=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!i.multiple;var h=i.value;h!=null?fi(s,!!i.multiple,h,!1):p!==!!i.multiple&&(i.defaultValue!=null?fi(s,!!i.multiple,i.defaultValue,!0):fi(s,!!i.multiple,i.multiple?[]:"",!1))}s[ea]=i}catch(y){Me(e,e.return,y)}}break;case 6:if(an(t,e),kn(e),r&4){if(e.stateNode===null)throw Error(U(162));s=e.stateNode,i=e.memoizedProps;try{s.nodeValue=i}catch(y){Me(e,e.return,y)}}break;case 3:if(an(t,e),kn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Qo(t.containerInfo)}catch(y){Me(e,e.return,y)}break;case 4:an(t,e),kn(e);break;case 13:an(t,e),kn(e),s=e.child,s.flags&8192&&(i=s.memoizedState!==null,s.stateNode.isHidden=i,!i||s.alternate!==null&&s.alternate.memoizedState!==null||($p=De())),r&4&&fy(e);break;case 22:if(u=n!==null&&n.memoizedState!==null,e.mode&1?(rt=(c=rt)||u,an(t,e),rt=c):an(t,e),kn(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!u&&e.mode&1)for(K=e,u=e.child;u!==null;){for(f=K=u;K!==null;){switch(p=K,h=p.child,p.tag){case 0:case 11:case 14:case 15:Ao(4,p,p.return);break;case 1:ai(p,p.return);var m=p.stateNode;if(typeof m.componentWillUnmount=="function"){r=p,n=p.return;try{t=r,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(y){Me(r,n,y)}}break;case 5:ai(p,p.return);break;case 22:if(p.memoizedState!==null){py(f);continue}}h!==null?(h.return=p,K=h):py(f)}u=u.sibling}e:for(u=null,f=e;;){if(f.tag===5){if(u===null){u=f;try{s=f.stateNode,c?(i=s.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=f.stateNode,l=f.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=hw("display",o))}catch(y){Me(e,e.return,y)}}}else if(f.tag===6){if(u===null)try{f.stateNode.nodeValue=c?"":f.memoizedProps}catch(y){Me(e,e.return,y)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;u===f&&(u=null),f=f.return}u===f&&(u=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:an(t,e),kn(e),r&4&&fy(e);break;case 21:break;default:an(t,e),kn(e)}}function kn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(z1(n)){var r=n;break e}n=n.return}throw Error(U(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&(Ho(s,""),r.flags&=-33);var i=dy(e);th(e,i,s);break;case 3:case 4:var o=r.stateNode.containerInfo,a=dy(e);eh(e,a,o);break;default:throw Error(U(161))}}catch(l){Me(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function wP(e,t,n){K=e,V1(e)}function V1(e,t,n){for(var r=(e.mode&1)!==0;K!==null;){var s=K,i=s.child;if(s.tag===22&&r){var o=s.memoizedState!==null||Ya;if(!o){var a=s.alternate,l=a!==null&&a.memoizedState!==null||rt;a=Ya;var c=rt;if(Ya=o,(rt=l)&&!c)for(K=s;K!==null;)o=K,l=o.child,o.tag===22&&o.memoizedState!==null?my(s):l!==null?(l.return=o,K=l):my(s);for(;i!==null;)K=i,V1(i),i=i.sibling;K=s,Ya=a,rt=c}hy(e)}else s.subtreeFlags&8772&&i!==null?(i.return=s,K=i):hy(e)}}function hy(e){for(;K!==null;){var t=K;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:rt||su(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!rt)if(n===null)r.componentDidMount();else{var s=t.elementType===t.type?n.memoizedProps:fn(t.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&Xg(t,i,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Xg(t,o,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var u=c.memoizedState;if(u!==null){var f=u.dehydrated;f!==null&&Qo(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(U(163))}rt||t.flags&512&&Zf(t)}catch(p){Me(t,t.return,p)}}if(t===e){K=null;break}if(n=t.sibling,n!==null){n.return=t.return,K=n;break}K=t.return}}function py(e){for(;K!==null;){var t=K;if(t===e){K=null;break}var n=t.sibling;if(n!==null){n.return=t.return,K=n;break}K=t.return}}function my(e){for(;K!==null;){var t=K;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{su(4,t)}catch(l){Me(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var s=t.return;try{r.componentDidMount()}catch(l){Me(t,s,l)}}var i=t.return;try{Zf(t)}catch(l){Me(t,i,l)}break;case 5:var o=t.return;try{Zf(t)}catch(l){Me(t,o,l)}}}catch(l){Me(t,t.return,l)}if(t===e){K=null;break}var a=t.sibling;if(a!==null){a.return=t.return,K=a;break}K=t.return}}var bP=Math.ceil,vc=sr.ReactCurrentDispatcher,Op=sr.ReactCurrentOwner,en=sr.ReactCurrentBatchConfig,ae=0,qe=null,$e=null,Je=0,At=0,li=Kr(0),Ue=0,oa=null,Ns=0,iu=0,zp=0,Mo=null,yt=null,$p=0,Ei=1/0,Gn=null,wc=!1,nh=null,Lr=null,Xa=!1,Sr=null,bc=0,Lo=0,rh=null,Al=-1,Ml=0;function ft(){return ae&6?De():Al!==-1?Al:Al=De()}function Dr(e){return e.mode&1?ae&2&&Je!==0?Je&-Je:sP.transition!==null?(Ml===0&&(Ml=jw()),Ml):(e=ue,e!==0||(e=window.event,e=e===void 0?16:Aw(e.type)),e):1}function gn(e,t,n,r){if(50<Lo)throw Lo=0,rh=null,Error(U(185));xa(e,n,r),(!(ae&2)||e!==qe)&&(e===qe&&(!(ae&2)&&(iu|=n),Ue===4&&kr(e,Je)),kt(e,r),n===1&&ae===0&&!(t.mode&1)&&(Ei=De()+500,tu&&qr()))}function kt(e,t){var n=e.callbackNode;sj(e,t);var r=sc(e,e===qe?Je:0);if(r===0)n!==null&&Sg(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Sg(n),t===1)e.tag===0?rP(gy.bind(null,e)):Jw(gy.bind(null,e)),Zj(function(){!(ae&6)&&qr()}),n=null;else{switch(Pw(r)){case 1:n=fp;break;case 4:n=Sw;break;case 16:n=rc;break;case 536870912:n=Cw;break;default:n=rc}n=Y1(n,U1.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function U1(e,t){if(Al=-1,Ml=0,ae&6)throw Error(U(327));var n=e.callbackNode;if(yi()&&e.callbackNode!==n)return null;var r=sc(e,e===qe?Je:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=kc(e,r);else{t=r;var s=ae;ae|=2;var i=H1();(qe!==e||Je!==t)&&(Gn=null,Ei=De()+500,vs(e,t));do try{SP();break}catch(a){W1(e,a)}while(!0);Cp(),vc.current=i,ae=s,$e!==null?t=0:(qe=null,Je=0,t=Ue)}if(t!==0){if(t===2&&(s=Nf(e),s!==0&&(r=s,t=sh(e,s))),t===1)throw n=oa,vs(e,0),kr(e,r),kt(e,De()),n;if(t===6)kr(e,r);else{if(s=e.current.alternate,!(r&30)&&!kP(s)&&(t=kc(e,r),t===2&&(i=Nf(e),i!==0&&(r=i,t=sh(e,i))),t===1))throw n=oa,vs(e,0),kr(e,r),kt(e,De()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(U(345));case 2:as(e,yt,Gn);break;case 3:if(kr(e,r),(r&130023424)===r&&(t=$p+500-De(),10<t)){if(sc(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){ft(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=Of(as.bind(null,e,yt,Gn),t);break}as(e,yt,Gn);break;case 4:if(kr(e,r),(r&4194240)===r)break;for(t=e.eventTimes,s=-1;0<r;){var o=31-mn(r);i=1<<o,o=t[o],o>s&&(s=o),r&=~i}if(r=s,r=De()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*bP(r/1960))-r,10<r){e.timeoutHandle=Of(as.bind(null,e,yt,Gn),r);break}as(e,yt,Gn);break;case 5:as(e,yt,Gn);break;default:throw Error(U(329))}}}return kt(e,De()),e.callbackNode===n?U1.bind(null,e):null}function sh(e,t){var n=Mo;return e.current.memoizedState.isDehydrated&&(vs(e,t).flags|=256),e=kc(e,t),e!==2&&(t=yt,yt=n,t!==null&&ih(t)),e}function ih(e){yt===null?yt=e:yt.push.apply(yt,e)}function kP(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var s=n[r],i=s.getSnapshot;s=s.value;try{if(!xn(i(),s))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function kr(e,t){for(t&=~zp,t&=~iu,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-mn(t),r=1<<n;e[n]=-1,t&=~r}}function gy(e){if(ae&6)throw Error(U(327));yi();var t=sc(e,0);if(!(t&1))return kt(e,De()),null;var n=kc(e,t);if(e.tag!==0&&n===2){var r=Nf(e);r!==0&&(t=r,n=sh(e,r))}if(n===1)throw n=oa,vs(e,0),kr(e,t),kt(e,De()),n;if(n===6)throw Error(U(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,as(e,yt,Gn),kt(e,De()),null}function Bp(e,t){var n=ae;ae|=1;try{return e(t)}finally{ae=n,ae===0&&(Ei=De()+500,tu&&qr())}}function Rs(e){Sr!==null&&Sr.tag===0&&!(ae&6)&&yi();var t=ae;ae|=1;var n=en.transition,r=ue;try{if(en.transition=null,ue=1,e)return e()}finally{ue=r,en.transition=n,ae=t,!(ae&6)&&qr()}}function Vp(){At=li.current,Se(li)}function vs(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Jj(n)),$e!==null)for(n=$e.return;n!==null;){var r=n;switch(kp(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&cc();break;case 3:ji(),Se(wt),Se(it),Rp();break;case 5:Np(r);break;case 4:ji();break;case 13:Se(Ee);break;case 19:Se(Ee);break;case 10:jp(r.type._context);break;case 22:case 23:Vp()}n=n.return}if(qe=e,$e=e=Fr(e.current,null),Je=At=t,Ue=0,oa=null,zp=iu=Ns=0,yt=Mo=null,ps!==null){for(t=0;t<ps.length;t++)if(n=ps[t],r=n.interleaved,r!==null){n.interleaved=null;var s=r.next,i=n.pending;if(i!==null){var o=i.next;i.next=s,r.next=o}n.pending=r}ps=null}return e}function W1(e,t){do{var n=$e;try{if(Cp(),Nl.current=xc,yc){for(var r=Ne.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}yc=!1}if(Ts=0,Ke=Ve=Ne=null,Io=!1,ra=0,Op.current=null,n===null||n.return===null){Ue=1,oa=t,$e=null;break}e:{var i=e,o=n.return,a=n,l=t;if(t=Je,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,u=a,f=u.tag;if(!(u.mode&1)&&(f===0||f===11||f===15)){var p=u.alternate;p?(u.updateQueue=p.updateQueue,u.memoizedState=p.memoizedState,u.lanes=p.lanes):(u.updateQueue=null,u.memoizedState=null)}var h=ry(o);if(h!==null){h.flags&=-257,sy(h,o,a,i,t),h.mode&1&&ny(i,c,t),t=h,l=c;var m=t.updateQueue;if(m===null){var y=new Set;y.add(l),t.updateQueue=y}else m.add(l);break e}else{if(!(t&1)){ny(i,c,t),Up();break e}l=Error(U(426))}}else if(je&&a.mode&1){var v=ry(o);if(v!==null){!(v.flags&65536)&&(v.flags|=256),sy(v,o,a,i,t),_p(Pi(l,a));break e}}i=l=Pi(l,a),Ue!==4&&(Ue=2),Mo===null?Mo=[i]:Mo.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var g=P1(i,l,t);Yg(i,g);break e;case 1:a=l;var x=i.type,w=i.stateNode;if(!(i.flags&128)&&(typeof x.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(Lr===null||!Lr.has(w)))){i.flags|=65536,t&=-t,i.lanes|=t;var k=E1(i,a,t);Yg(i,k);break e}}i=i.return}while(i!==null)}K1(n)}catch(j){t=j,$e===n&&n!==null&&($e=n=n.return);continue}break}while(!0)}function H1(){var e=vc.current;return vc.current=xc,e===null?xc:e}function Up(){(Ue===0||Ue===3||Ue===2)&&(Ue=4),qe===null||!(Ns&268435455)&&!(iu&268435455)||kr(qe,Je)}function kc(e,t){var n=ae;ae|=2;var r=H1();(qe!==e||Je!==t)&&(Gn=null,vs(e,t));do try{_P();break}catch(s){W1(e,s)}while(!0);if(Cp(),ae=n,vc.current=r,$e!==null)throw Error(U(261));return qe=null,Je=0,Ue}function _P(){for(;$e!==null;)G1($e)}function SP(){for(;$e!==null&&!QC();)G1($e)}function G1(e){var t=Q1(e.alternate,e,At);e.memoizedProps=e.pendingProps,t===null?K1(e):$e=t,Op.current=null}function K1(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=yP(n,t),n!==null){n.flags&=32767,$e=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ue=6,$e=null;return}}else if(n=gP(n,t,At),n!==null){$e=n;return}if(t=t.sibling,t!==null){$e=t;return}$e=t=e}while(t!==null);Ue===0&&(Ue=5)}function as(e,t,n){var r=ue,s=en.transition;try{en.transition=null,ue=1,CP(e,t,n,r)}finally{en.transition=s,ue=r}return null}function CP(e,t,n,r){do yi();while(Sr!==null);if(ae&6)throw Error(U(327));n=e.finishedWork;var s=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(U(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(ij(e,i),e===qe&&($e=qe=null,Je=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Xa||(Xa=!0,Y1(rc,function(){return yi(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=en.transition,en.transition=null;var o=ue;ue=1;var a=ae;ae|=4,Op.current=null,vP(e,n),B1(n,e),Hj(Df),ic=!!Lf,Df=Lf=null,e.current=n,wP(n),YC(),ae=a,ue=o,en.transition=i}else e.current=n;if(Xa&&(Xa=!1,Sr=e,bc=s),i=e.pendingLanes,i===0&&(Lr=null),ZC(n.stateNode),kt(e,De()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)s=t[n],r(s.value,{componentStack:s.stack,digest:s.digest});if(wc)throw wc=!1,e=nh,nh=null,e;return bc&1&&e.tag!==0&&yi(),i=e.pendingLanes,i&1?e===rh?Lo++:(Lo=0,rh=e):Lo=0,qr(),null}function yi(){if(Sr!==null){var e=Pw(bc),t=en.transition,n=ue;try{if(en.transition=null,ue=16>e?16:e,Sr===null)var r=!1;else{if(e=Sr,Sr=null,bc=0,ae&6)throw Error(U(331));var s=ae;for(ae|=4,K=e.current;K!==null;){var i=K,o=i.child;if(K.flags&16){var a=i.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(K=c;K!==null;){var u=K;switch(u.tag){case 0:case 11:case 15:Ao(8,u,i)}var f=u.child;if(f!==null)f.return=u,K=f;else for(;K!==null;){u=K;var p=u.sibling,h=u.return;if(O1(u),u===c){K=null;break}if(p!==null){p.return=h,K=p;break}K=h}}}var m=i.alternate;if(m!==null){var y=m.child;if(y!==null){m.child=null;do{var v=y.sibling;y.sibling=null,y=v}while(y!==null)}}K=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,K=o;else e:for(;K!==null;){if(i=K,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Ao(9,i,i.return)}var g=i.sibling;if(g!==null){g.return=i.return,K=g;break e}K=i.return}}var x=e.current;for(K=x;K!==null;){o=K;var w=o.child;if(o.subtreeFlags&2064&&w!==null)w.return=o,K=w;else e:for(o=x;K!==null;){if(a=K,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:su(9,a)}}catch(j){Me(a,a.return,j)}if(a===o){K=null;break e}var k=a.sibling;if(k!==null){k.return=a.return,K=k;break e}K=a.return}}if(ae=s,qr(),An&&typeof An.onPostCommitFiberRoot=="function")try{An.onPostCommitFiberRoot(Yc,e)}catch{}r=!0}return r}finally{ue=n,en.transition=t}}return!1}function yy(e,t,n){t=Pi(n,t),t=P1(e,t,1),e=Mr(e,t,1),t=ft(),e!==null&&(xa(e,1,t),kt(e,t))}function Me(e,t,n){if(e.tag===3)yy(e,e,n);else for(;t!==null;){if(t.tag===3){yy(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Lr===null||!Lr.has(r))){e=Pi(n,e),e=E1(t,e,1),t=Mr(t,e,1),e=ft(),t!==null&&(xa(t,1,e),kt(t,e));break}}t=t.return}}function jP(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=ft(),e.pingedLanes|=e.suspendedLanes&n,qe===e&&(Je&n)===n&&(Ue===4||Ue===3&&(Je&130023424)===Je&&500>De()-$p?vs(e,0):zp|=n),kt(e,t)}function q1(e,t){t===0&&(e.mode&1?(t=Ba,Ba<<=1,!(Ba&130023424)&&(Ba=4194304)):t=1);var n=ft();e=tr(e,t),e!==null&&(xa(e,t,n),kt(e,n))}function PP(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),q1(e,n)}function EP(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(U(314))}r!==null&&r.delete(t),q1(e,n)}var Q1;Q1=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||wt.current)xt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return xt=!1,mP(e,t,n);xt=!!(e.flags&131072)}else xt=!1,je&&t.flags&1048576&&Zw(t,fc,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Il(e,t),e=t.pendingProps;var s=_i(t,it.current);gi(t,n),s=Ap(null,t,r,e,s,n);var i=Mp();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,bt(r)?(i=!0,uc(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Ep(t),s.updater=ru,t.stateNode=s,s._reactInternals=t,Hf(t,r,e,n),t=qf(null,t,r,!0,i,n)):(t.tag=0,je&&i&&bp(t),lt(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Il(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=NP(r),e=fn(r,e),s){case 0:t=Kf(null,t,r,e,n);break e;case 1:t=ay(null,t,r,e,n);break e;case 11:t=iy(null,t,r,e,n);break e;case 14:t=oy(null,t,r,fn(r.type,e),n);break e}throw Error(U(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:fn(r,s),Kf(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:fn(r,s),ay(e,t,r,s,n);case 3:e:{if(I1(t),e===null)throw Error(U(387));r=t.pendingProps,i=t.memoizedState,s=i.element,i1(e,t),mc(t,r,null,n);var o=t.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){s=Pi(Error(U(423)),t),t=ly(e,t,r,n,s);break e}else if(r!==s){s=Pi(Error(U(424)),t),t=ly(e,t,r,n,s);break e}else for(Mt=Ar(t.stateNode.containerInfo.firstChild),Dt=t,je=!0,pn=null,n=r1(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Si(),r===s){t=nr(e,t,n);break e}lt(e,t,r,n)}t=t.child}return t;case 5:return o1(t),e===null&&Vf(t),r=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,o=s.children,Ff(r,s)?o=null:i!==null&&Ff(r,i)&&(t.flags|=32),R1(e,t),lt(e,t,o,n),t.child;case 6:return e===null&&Vf(t),null;case 13:return A1(e,t,n);case 4:return Tp(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ci(t,null,r,n):lt(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:fn(r,s),iy(e,t,r,s,n);case 7:return lt(e,t,t.pendingProps,n),t.child;case 8:return lt(e,t,t.pendingProps.children,n),t.child;case 12:return lt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,i=t.memoizedProps,o=s.value,we(hc,r._currentValue),r._currentValue=o,i!==null)if(xn(i.value,o)){if(i.children===s.children&&!wt.current){t=nr(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){o=i.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=Xn(-1,n&-n),l.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),Uf(i.return,n,t),a.lanes|=n;break}l=l.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(U(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Uf(o,n,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}lt(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,gi(t,n),s=nn(s),r=r(s),t.flags|=1,lt(e,t,r,n),t.child;case 14:return r=t.type,s=fn(r,t.pendingProps),s=fn(r.type,s),oy(e,t,r,s,n);case 15:return T1(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:fn(r,s),Il(e,t),t.tag=1,bt(r)?(e=!0,uc(t)):e=!1,gi(t,n),j1(t,r,s),Hf(t,r,s,n),qf(null,t,r,!0,e,n);case 19:return M1(e,t,n);case 22:return N1(e,t,n)}throw Error(U(156,t.tag))};function Y1(e,t){return _w(e,t)}function TP(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Jt(e,t,n,r){return new TP(e,t,n,r)}function Wp(e){return e=e.prototype,!(!e||!e.isReactComponent)}function NP(e){if(typeof e=="function")return Wp(e)?1:0;if(e!=null){if(e=e.$$typeof,e===cp)return 11;if(e===up)return 14}return 2}function Fr(e,t){var n=e.alternate;return n===null?(n=Jt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Ll(e,t,n,r,s,i){var o=2;if(r=e,typeof e=="function")Wp(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Js:return ws(n.children,s,i,t);case lp:o=8,s|=8;break;case mf:return e=Jt(12,n,t,s|2),e.elementType=mf,e.lanes=i,e;case gf:return e=Jt(13,n,t,s),e.elementType=gf,e.lanes=i,e;case yf:return e=Jt(19,n,t,s),e.elementType=yf,e.lanes=i,e;case ow:return ou(n,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case sw:o=10;break e;case iw:o=9;break e;case cp:o=11;break e;case up:o=14;break e;case xr:o=16,r=null;break e}throw Error(U(130,e==null?e:typeof e,""))}return t=Jt(o,n,t,s),t.elementType=e,t.type=r,t.lanes=i,t}function ws(e,t,n,r){return e=Jt(7,e,r,t),e.lanes=n,e}function ou(e,t,n,r){return e=Jt(22,e,r,t),e.elementType=ow,e.lanes=n,e.stateNode={isHidden:!1},e}function od(e,t,n){return e=Jt(6,e,null,t),e.lanes=n,e}function ad(e,t,n){return t=Jt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function RP(e,t,n,r,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Bu(0),this.expirationTimes=Bu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Bu(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Hp(e,t,n,r,s,i,o,a,l){return e=new RP(e,t,n,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Jt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ep(i),e}function IP(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Xs,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function X1(e){if(!e)return Br;e=e._reactInternals;e:{if(As(e)!==e||e.tag!==1)throw Error(U(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(bt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(U(171))}if(e.tag===1){var n=e.type;if(bt(n))return Xw(e,n,t)}return t}function J1(e,t,n,r,s,i,o,a,l){return e=Hp(n,r,!0,e,s,i,o,a,l),e.context=X1(null),n=e.current,r=ft(),s=Dr(n),i=Xn(r,s),i.callback=t??null,Mr(n,i,s),e.current.lanes=s,xa(e,s,r),kt(e,r),e}function au(e,t,n,r){var s=t.current,i=ft(),o=Dr(s);return n=X1(n),t.context===null?t.context=n:t.pendingContext=n,t=Xn(i,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Mr(s,t,o),e!==null&&(gn(e,s,o,i),Tl(e,s,o)),o}function _c(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 xy(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Gp(e,t){xy(e,t),(e=e.alternate)&&xy(e,t)}function AP(){return null}var Z1=typeof reportError=="function"?reportError:function(e){console.error(e)};function Kp(e){this._internalRoot=e}lu.prototype.render=Kp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(U(409));au(e,t,null,null)};lu.prototype.unmount=Kp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Rs(function(){au(null,e,null,null)}),t[er]=null}};function lu(e){this._internalRoot=e}lu.prototype.unstable_scheduleHydration=function(e){if(e){var t=Nw();e={blockedOn:null,target:e,priority:t};for(var n=0;n<br.length&&t!==0&&t<br[n].priority;n++);br.splice(n,0,e),n===0&&Iw(e)}};function qp(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function cu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function vy(){}function MP(e,t,n,r,s){if(s){if(typeof r=="function"){var i=r;r=function(){var c=_c(o);i.call(c)}}var o=J1(t,r,e,0,null,!1,!1,"",vy);return e._reactRootContainer=o,e[er]=o.current,Jo(e.nodeType===8?e.parentNode:e),Rs(),o}for(;s=e.lastChild;)e.removeChild(s);if(typeof r=="function"){var a=r;r=function(){var c=_c(l);a.call(c)}}var l=Hp(e,0,!1,null,null,!1,!1,"",vy);return e._reactRootContainer=l,e[er]=l.current,Jo(e.nodeType===8?e.parentNode:e),Rs(function(){au(t,l,n,r)}),l}function uu(e,t,n,r,s){var i=n._reactRootContainer;if(i){var o=i;if(typeof s=="function"){var a=s;s=function(){var l=_c(o);a.call(l)}}au(t,o,e,s)}else o=MP(n,t,e,s,r);return _c(o)}Ew=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=ko(t.pendingLanes);n!==0&&(hp(t,n|1),kt(t,De()),!(ae&6)&&(Ei=De()+500,qr()))}break;case 13:Rs(function(){var r=tr(e,1);if(r!==null){var s=ft();gn(r,e,1,s)}}),Gp(e,1)}};pp=function(e){if(e.tag===13){var t=tr(e,134217728);if(t!==null){var n=ft();gn(t,e,134217728,n)}Gp(e,134217728)}};Tw=function(e){if(e.tag===13){var t=Dr(e),n=tr(e,t);if(n!==null){var r=ft();gn(n,e,t,r)}Gp(e,t)}};Nw=function(){return ue};Rw=function(e,t){var n=ue;try{return ue=e,t()}finally{ue=n}};Pf=function(e,t,n){switch(t){case"input":if(wf(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var s=eu(r);if(!s)throw Error(U(90));lw(r),wf(r,s)}}}break;case"textarea":uw(e,n);break;case"select":t=n.value,t!=null&&fi(e,!!n.multiple,t,!1)}};yw=Bp;xw=Rs;var LP={usingClientEntryPoint:!1,Events:[wa,ni,eu,mw,gw,Bp]},so={findFiberByHostInstance:hs,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},DP={bundleType:so.bundleType,version:so.version,rendererPackageName:so.rendererPackageName,rendererConfig:so.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:sr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=bw(e),e===null?null:e.stateNode},findFiberByHostInstance:so.findFiberByHostInstance||AP,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 Ja=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ja.isDisabled&&Ja.supportsFiber)try{Yc=Ja.inject(DP),An=Ja}catch{}}zt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=LP;zt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!qp(t))throw Error(U(200));return IP(e,t,null,n)};zt.createRoot=function(e,t){if(!qp(e))throw Error(U(299));var n=!1,r="",s=Z1;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=Hp(e,1,!1,null,null,n,!1,r,s),e[er]=t.current,Jo(e.nodeType===8?e.parentNode:e),new Kp(t)};zt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(U(188)):(e=Object.keys(e).join(","),Error(U(268,e)));return e=bw(t),e=e===null?null:e.stateNode,e};zt.flushSync=function(e){return Rs(e)};zt.hydrate=function(e,t,n){if(!cu(t))throw Error(U(200));return uu(null,e,t,!0,n)};zt.hydrateRoot=function(e,t,n){if(!qp(e))throw Error(U(405));var r=n!=null&&n.hydratedSources||null,s=!1,i="",o=Z1;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=J1(t,null,e,1,n??null,s,!1,i,o),e[er]=t.current,Jo(e),r)for(e=0;e<r.length;e++)n=r[e],s=n._getVersion,s=s(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,s]:t.mutableSourceEagerHydrationData.push(n,s);return new lu(t)};zt.render=function(e,t,n){if(!cu(t))throw Error(U(200));return uu(null,e,t,!1,n)};zt.unmountComponentAtNode=function(e){if(!cu(e))throw Error(U(40));return e._reactRootContainer?(Rs(function(){uu(null,null,e,!1,function(){e._reactRootContainer=null,e[er]=null})}),!0):!1};zt.unstable_batchedUpdates=Bp;zt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!cu(n))throw Error(U(200));if(e==null||e._reactInternals===void 0)throw Error(U(38));return uu(e,t,n,!1,r)};zt.version="18.3.1-next-f1338f8080-20240426";function eb(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(eb)}catch(e){console.error(e)}}eb(),ew.exports=zt;var Ms=ew.exports,tb,wy=Ms;tb=wy.createRoot,wy.hydrateRoot;var So=typeof window<"u"?b.useLayoutEffect:b.useEffect;function ld(e){const t=b.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function FP(e,t,n={},r={}){b.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const s=new IntersectionObserver(([i])=>{t(i)},n);return s.observe(e.current),()=>{s.disconnect()}},[t,n,r.disabled,e])}function OP(e){const t=b.useRef(null);return b.useImperativeHandle(e,()=>t.current,[]),t}const nb=!1;function aa(e){return e[e.length-1]}function zP(e){return typeof e=="function"}function Cr(e,t){return zP(e)?e(t):e}const $P=Object.prototype.hasOwnProperty,by=Object.prototype.propertyIsEnumerable,BP=()=>Object.create(null),ts=(e,t)=>jr(e,t,BP);function jr(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;const s=t,i=Sy(e)&&Sy(s);if(!i&&!(Ti(e)&&Ti(s)))return s;const o=i?e:ky(e);if(!o)return s;const a=i?s:ky(s);if(!a)return s;const l=o.length,c=a.length,u=i?new Array(c):n();let f=0;for(let p=0;p<c;p++){const h=i?p:a[p],m=e[h],y=s[h];if(m===y){u[h]=m,(i?p<l:$P.call(e,h))&&f++;continue}if(m===null||y===null||typeof m!="object"||typeof y!="object"){u[h]=y;continue}const v=jr(m,y,n,r+1);u[h]=v,v===m&&f++}return l===c&&f===l?e:u}function ky(e){const t=Object.getOwnPropertyNames(e);for(const s of t)if(!by.call(e,s))return!1;const n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;const r=t;for(const s of n){if(!by.call(e,s))return!1;r.push(s)}return r}function Ti(e){if(!_y(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!_y(n)||!n.hasOwnProperty("isPrototypeOf"))}function _y(e){return Object.prototype.toString.call(e)==="[object Object]"}function Sy(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function bs(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,s=e.length;r<s;r++)if(!bs(e[r],t[r],n))return!1;return!0}if(Ti(e)&&Ti(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)&&!bs(e[o],t[o],n))return!1;return!0}let s=0;if(!r)s=Object.keys(e).length;else for(const o in e)e[o]!==void 0&&s++;let i=0;for(const o in t)if((!r||t[o]!==void 0)&&(i++,i>s||!bs(e[o],t[o],n)))return!1;return s===i}return!1}function Ni(e){let t,n;const r=new Promise((s,i)=>{t=s,n=i});return r.status="pending",r.resolve=s=>{r.status="resolved",r.value=s,t(s),e==null||e(s)},r.reject=s=>{r.status="rejected",n(s)},r}function la(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function VP(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function Cy(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 VP(t)}const UP=["http:","https:","mailto:","tel:"];function Sc(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function io(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const t=/%25|%5C/gi;let n=0,r="",s;for(;(s=t.exec(e))!==null;)r+=Cy(e.slice(n,s.index))+s[0],n=t.lastIndex;r=r+Cy(n?e.slice(n):e);let i=!1;return r.startsWith("//")&&(i=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:i}}function WP(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function HP(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 Jn(){throw new Error("Invariant failed")}function ca(e){const t=new Map;let n,r;const s=i=>{i.next&&(i.prev?(i.prev.next=i.next,i.next.prev=i.prev,i.next=void 0,r&&(r.next=i,i.prev=r)):(i.next.prev=void 0,n=i.next,i.next=void 0,r&&(i.prev=r,r.next=i)),r=i)};return{get(i){const o=t.get(i);if(o)return s(o),o.value},set(i,o){if(t.size>=e&&n){const l=n;t.delete(l.key),l.next&&(n=l.next,l.next.prev=void 0),l===r&&(r=void 0)}const a=t.get(i);if(a)a.value=o,s(a);else{const l={key:i,value:o,prev:r};r&&(r.next=l),r=l,n||(n=l),t.set(i,l)}},clear(){t.clear(),n=void 0,r=void 0}}}const Pr=4,rb=5;function GP(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 Qp(e,t,n=new Uint16Array(6)){const r=e.indexOf("/",t),s=r===-1?e.length:r,i=e.substring(t,s);if(!i||!i.includes("$"))return n[0]=0,n[1]=t,n[2]=t,n[3]=s,n[4]=s,n[5]=s,n;if(i==="$"){const a=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=a,n[4]=a,n[5]=a,n}if(i.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=s,n[4]=s,n[5]=s,n;const o=GP(i);if(o){const[a,l]=o,c=i.charCodeAt(a+1);if(c===45){if(a+2<i.length&&i.charCodeAt(a+2)===36){const u=a+3,f=l;if(u<f)return n[0]=3,n[1]=t+a,n[2]=t+u,n[3]=t+f,n[4]=t+l+1,n[5]=s,n}}else if(c===36){const u=a+1,f=a+2;return f===l?(n[0]=2,n[1]=t+a,n[2]=t+u,n[3]=t+f,n[4]=t+l+1,n[5]=e.length,n):(n[0]=1,n[1]=t+a,n[2]=t+f,n[3]=t+l,n[4]=t+l+1,n[5]=s,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=s,n[4]=s,n[5]=s,n}function du(e,t,n,r,s,i,o){var l,c,u,f,p,h,m,y,v,g,x,w,k;o==null||o(n);let a=r;{const j=n.fullPath??n.from,_=j.length,S=((l=n.options)==null?void 0:l.caseSensitive)??e,P=!!((u=(c=n.options)==null?void 0:c.params)!=null&&u.parse&&((p=(f=n.options)==null?void 0:f.skipRouteOnParseError)!=null&&p.params));for(;a<_;){const E=Qp(j,a,t);let I;const A=a,O=E[5];switch(a=O+1,i++,E[0]){case 0:{const M=j.substring(E[2],E[3]);if(S){const N=(h=s.static)==null?void 0:h.get(M);if(N)I=N;else{s.static??(s.static=new Map);const z=gs(n.fullPath??n.from);z.parent=s,z.depth=i,I=z,s.static.set(M,z)}}else{const N=M.toLowerCase(),z=(m=s.staticInsensitive)==null?void 0:m.get(N);if(z)I=z;else{s.staticInsensitive??(s.staticInsensitive=new Map);const V=gs(n.fullPath??n.from);V.parent=s,V.depth=i,I=V,s.staticInsensitive.set(N,V)}}break}case 1:{const M=j.substring(A,E[1]),N=j.substring(E[4],O),z=S&&!!(M||N),V=M?z?M:M.toLowerCase():void 0,L=N?z?N:N.toLowerCase():void 0,B=!P&&((y=s.dynamic)==null?void 0:y.find(C=>!C.skipOnParamError&&C.caseSensitive===z&&C.prefix===V&&C.suffix===L));if(B)I=B;else{const C=ud(1,n.fullPath??n.from,z,V,L);I=C,C.depth=i,C.parent=s,s.dynamic??(s.dynamic=[]),s.dynamic.push(C)}break}case 3:{const M=j.substring(A,E[1]),N=j.substring(E[4],O),z=S&&!!(M||N),V=M?z?M:M.toLowerCase():void 0,L=N?z?N:N.toLowerCase():void 0,B=!P&&((v=s.optional)==null?void 0:v.find(C=>!C.skipOnParamError&&C.caseSensitive===z&&C.prefix===V&&C.suffix===L));if(B)I=B;else{const C=ud(3,n.fullPath??n.from,z,V,L);I=C,C.parent=s,C.depth=i,s.optional??(s.optional=[]),s.optional.push(C)}break}case 2:{const M=j.substring(A,E[1]),N=j.substring(E[4],O),z=S&&!!(M||N),V=M?z?M:M.toLowerCase():void 0,L=N?z?N:N.toLowerCase():void 0,B=ud(2,n.fullPath??n.from,z,V,L);I=B,B.parent=s,B.depth=i,s.wildcard??(s.wildcard=[]),s.wildcard.push(B)}}s=I}if(P&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const E=gs(n.fullPath??n.from);E.kind=rb,E.parent=s,i++,E.depth=i,s.pathless??(s.pathless=[]),s.pathless.push(E),s=E}const T=(n.path||!n.children)&&!n.isRoot;if(T&&j.endsWith("/")){const E=gs(n.fullPath??n.from);E.kind=Pr,E.parent=s,i++,E.depth=i,s.index=E,s=E}s.parse=((x=(g=n.options)==null?void 0:g.params)==null?void 0:x.parse)??null,s.skipOnParamError=P,s.parsingPriority=((k=(w=n.options)==null?void 0:w.skipRouteOnParseError)==null?void 0:k.priority)??0,T&&!s.route&&(s.route=n,s.fullPath=n.fullPath??n.from)}if(n.children)for(const j of n.children)du(e,t,j,a,s,i,o)}function cd(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 wr(e){var t,n,r;if(e.pathless)for(const s of e.pathless)wr(s);if(e.static)for(const s of e.static.values())wr(s);if(e.staticInsensitive)for(const s of e.staticInsensitive.values())wr(s);if((t=e.dynamic)!=null&&t.length){e.dynamic.sort(cd);for(const s of e.dynamic)wr(s)}if((n=e.optional)!=null&&n.length){e.optional.sort(cd);for(const s of e.optional)wr(s)}if((r=e.wildcard)!=null&&r.length){e.wildcard.sort(cd);for(const s of e.wildcard)wr(s)}}function gs(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 ud(e,t,n,r,s){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:n,prefix:r,suffix:s}}function KP(e,t){const n=gs("/"),r=new Uint16Array(6);for(const s of e)du(!1,r,s,1,n,0);wr(n),t.masksTree=n,t.flatCache=ca(1e3)}function qP(e,t){e||(e="/");const n=t.flatCache.get(e);if(n)return n;const r=Yp(e,t.masksTree);return t.flatCache.set(e,r),r}function QP(e,t,n,r,s){e||(e="/"),r||(r="/");const i=t?`case\0${e}`:e;let o=s.singleCache.get(i);return o||(o=gs("/"),du(t,new Uint16Array(6),{from:e},1,o,0),s.singleCache.set(i,o)),Yp(r,o,n)}function YP(e,t,n=!1){const r=n?e:`nofuzz\0${e}`,s=t.matchCache.get(r);if(s!==void 0)return s;e||(e="/");let i;try{i=Yp(e,t.segmentTree,n)}catch(o){if(o instanceof URIError)i=null;else throw o}return i&&(i.branch=ZP(i.route)),t.matchCache.set(r,i),i}function XP(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function JP(e,t=!1,n){const r=gs(e.fullPath),s=new Uint16Array(6),i={},o={};let a=0;return du(t,s,e,1,r,0,l=>{if(n==null||n(l,a),l.id in i&&Jn(),i[l.id]=l,a!==0&&l.path){const c=XP(l.fullPath);(!o[c]||l.fullPath.endsWith("/"))&&(o[c]=l)}a++}),wr(r),{processedTree:{segmentTree:r,singleCache:ca(1e3),matchCache:ca(1e3),flatCache:null,masksTree:null},routesById:i,routesByPath:o}}function Yp(e,t,n=!1){const r=e.split("/"),s=tE(e,r,t,n);if(!s)return null;const[i]=sb(e,r,s);return{route:s.node.route,rawParams:i,parsedParams:s.parsedParams}}function sb(e,t,n){var u,f,p,h,m,y,v,g,x,w;const r=eE(n.node);let s=null;const i=Object.create(null);let o=((u=n.extract)==null?void 0:u.part)??0,a=((f=n.extract)==null?void 0:f.node)??0,l=((p=n.extract)==null?void 0:p.path)??0,c=((h=n.extract)==null?void 0:h.segment)??0;for(;a<r.length;o++,a++,l++,c++){const k=r[a];if(k.kind===Pr)break;if(k.kind===rb){c--,o--,l--;continue}const j=t[o],_=l;if(j&&(l+=j.length),k.kind===1){s??(s=n.node.fullPath.split("/"));const S=s[c],P=((m=k.prefix)==null?void 0:m.length)??0;if(S.charCodeAt(P)===123){const T=((y=k.suffix)==null?void 0:y.length)??0,E=S.substring(P+2,S.length-T-1),I=j.substring(P,j.length-T);i[E]=decodeURIComponent(I)}else{const T=S.substring(1);i[T]=decodeURIComponent(j)}}else if(k.kind===3){if(n.skipped&1<<a){o--,l=_-1;continue}s??(s=n.node.fullPath.split("/"));const S=s[c],P=((v=k.prefix)==null?void 0:v.length)??0,T=((g=k.suffix)==null?void 0:g.length)??0,E=S.substring(P+3,S.length-T-1),I=k.suffix||k.prefix?j.substring(P,j.length-T):j;I&&(i[E]=decodeURIComponent(I))}else if(k.kind===2){const S=k,P=e.substring(_+(((x=S.prefix)==null?void 0:x.length)??0),e.length-(((w=S.suffix)==null?void 0:w.length)??0)),T=decodeURIComponent(P);i["*"]=T,i._splat=T;break}}return n.rawParams&&Object.assign(i,n.rawParams),[i,{part:o,node:a,path:l,segment:c}]}function ZP(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function eE(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function tE(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const s=!aa(t),i=s&&e!=="/",o=t.length-(s?1:0),a=[{node:n,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}];let l=null,c=null;for(;a.length;){const u=a.pop(),{node:f,index:p,skipped:h,depth:m,statics:y,dynamics:v,optionals:g}=u;let{extract:x,rawParams:w,parsedParams:k}=u;if(f.kind===2&&f.route&&!el(c,u))continue;if(f.skipOnParamError){if(!jy(e,t,u))continue;w=u.rawParams,x=u.extract,k=u.parsedParams}r&&f.route&&f.kind!==Pr&&el(l,u)&&(l=u);const j=p===o;if(j&&(f.route&&(!i||f.kind===Pr||f.kind===2)&&el(c,u)&&(c=u),!f.optional&&!f.wildcard&&!f.index&&!f.pathless))continue;const _=j?void 0:t[p];let S;if(j&&f.index){const P={node:f.index,index:p,skipped:h,depth:m+1,statics:y,dynamics:v,optionals:g,extract:x,rawParams:w,parsedParams:k};let T=!0;if(f.index.skipOnParamError&&(jy(e,t,P)||(T=!1)),T){if(!v&&!g&&!h&&nE(y,o))return P;el(c,P)&&(c=P)}}if(f.wildcard)for(let P=f.wildcard.length-1;P>=0;P--){const T=f.wildcard[P],{prefix:E,suffix:I}=T;if(!(E&&(j||!(T.caseSensitive?_:S??(S=_.toLowerCase())).startsWith(E)))){if(I){if(j)continue;const A=t.slice(p).join("/").slice(-I.length);if((T.caseSensitive?A:A.toLowerCase())!==I)continue}a.push({node:T,index:o,skipped:h,depth:m+1,statics:y,dynamics:v,optionals:g,extract:x,rawParams:w,parsedParams:k})}}if(f.optional){const P=h|1<<m,T=m+1;for(let E=f.optional.length-1;E>=0;E--){const I=f.optional[E];a.push({node:I,index:p,skipped:P,depth:T,statics:y,dynamics:v,optionals:g,extract:x,rawParams:w,parsedParams:k})}if(!j)for(let E=f.optional.length-1;E>=0;E--){const I=f.optional[E],{prefix:A,suffix:O}=I;if(A||O){const M=I.caseSensitive?_:S??(S=_.toLowerCase());if(A&&!M.startsWith(A)||O&&!M.endsWith(O))continue}a.push({node:I,index:p+1,skipped:h,depth:T,statics:y,dynamics:v,optionals:g+Za(o,p),extract:x,rawParams:w,parsedParams:k})}}if(!j&&f.dynamic&&_)for(let P=f.dynamic.length-1;P>=0;P--){const T=f.dynamic[P],{prefix:E,suffix:I}=T;if(E||I){const A=T.caseSensitive?_:S??(S=_.toLowerCase());if(E&&!A.startsWith(E)||I&&!A.endsWith(I))continue}a.push({node:T,index:p+1,skipped:h,depth:m+1,statics:y,dynamics:v+Za(o,p),optionals:g,extract:x,rawParams:w,parsedParams:k})}if(!j&&f.staticInsensitive){const P=f.staticInsensitive.get(S??(S=_.toLowerCase()));P&&a.push({node:P,index:p+1,skipped:h,depth:m+1,statics:y+Za(o,p),dynamics:v,optionals:g,extract:x,rawParams:w,parsedParams:k})}if(!j&&f.static){const P=f.static.get(_);P&&a.push({node:P,index:p+1,skipped:h,depth:m+1,statics:y+Za(o,p),dynamics:v,optionals:g,extract:x,rawParams:w,parsedParams:k})}if(f.pathless){const P=m+1;for(let T=f.pathless.length-1;T>=0;T--){const E=f.pathless[T];a.push({node:E,index:p,skipped:h,depth:P,statics:y,dynamics:v,optionals:g,extract:x,rawParams:w,parsedParams:k})}}}if(c)return c;if(r&&l){let u=l.index;for(let p=0;p<l.index;p++)u+=t[p].length;const f=u===e.length?"/":e.slice(u);return l.rawParams??(l.rawParams=Object.create(null)),l.rawParams["**"]=decodeURIComponent(f),l}return null}function Za(e,t){return 2**(e-t-1)}function nE(e,t){return e===2**(t-1)-1}function jy(e,t,n){try{const[r,s]=sb(e,t,n);n.rawParams=r,n.extract=s;const i=n.node.parse(r);return n.parsedParams=Object.assign(Object.create(null),n.parsedParams,i),!0}catch{return null}}function el(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===Pr)>(e.node.kind===Pr)||t.node.kind===Pr==(e.node.kind===Pr)&&t.depth>e.depth))):!0}function Dl(e){return Xp(e.filter(t=>t!==void 0).join("/"))}function Xp(e){return e.replace(/\/{2,}/g,"/")}function ib(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Or(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function ob(e){return Or(ib(e))}function Cc(e,t){return e!=null&&e.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function rE(e,t,n){return Cc(e,n)===Cc(t,n)}function sE({base:e,to:t,trailingSlash:n="never",cache:r}){const s=t.startsWith("/"),i=!s&&t===".";let o;if(r){o=s?t:i?e:e+"\0"+t;const f=r.get(o);if(f)return f}let a;if(i)a=e.split("/");else if(s)a=t.split("/");else{for(a=e.split("/");a.length>1&&aa(a)==="";)a.pop();const f=t.split("/");for(let p=0,h=f.length;p<h;p++){const m=f[p];m===""?p?p===h-1&&a.push(m):a=[m]:m===".."?a.pop():m==="."||a.push(m)}}a.length>1&&(aa(a)===""?n==="never"&&a.pop():n==="always"&&a.push(""));let l,c="";for(let f=0;f<a.length;f++){f>0&&(c+="/");const p=a[f];if(!p)continue;l=Qp(p,0,l);const h=l[0];if(h===0){c+=p;continue}const m=l[5],y=p.substring(0,l[1]),v=p.substring(l[4],m),g=p.substring(l[2],l[3]);h===1?c+=y||v?`${y}{$${g}}${v}`:`$${g}`:h===2?c+=y||v?`${y}{$}${v}`:"$":c+=`${y}{-$${g}}${v}`}c=Xp(c);const u=c||"/";return o&&r&&r.set(o,u),u}function iE(e){const t=new Map(e.map(s=>[encodeURIComponent(s),s])),n=Array.from(t.keys()).map(s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(n,"g");return s=>s.replace(r,i=>t.get(i)??i)}function dd(e,t,n){const r=t[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(s=>Ey(s,n)).join("/"):Ey(r,n)}function Py({path:e,params:t,decoder:n,...r}){let s=!1;const i=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:i,isMissingParams:s};if(!e.includes("$"))return{interpolatedPath:e,usedParams:i,isMissingParams:s};const o=e.length;let a=0,l,c="";for(;a<o;){const u=a;l=Qp(e,u,l);const f=l[5];if(a=f+1,u===f)continue;const p=l[0];if(p===0){c+="/"+e.substring(u,f);continue}if(p===2){const h=t._splat;i._splat=h,i["*"]=h;const m=e.substring(u,l[1]),y=e.substring(l[4],f);if(!h){s=!0,(m||y)&&(c+="/"+m+y);continue}const v=dd("_splat",t,n);c+="/"+m+v+y;continue}if(p===1){const h=e.substring(l[2],l[3]);!s&&!(h in t)&&(s=!0),i[h]=t[h];const m=e.substring(u,l[1]),y=e.substring(l[4],f),v=dd(h,t,n)??"undefined";c+="/"+m+v+y;continue}if(p===3){const h=e.substring(l[2],l[3]),m=t[h];if(m==null)continue;i[h]=m;const y=e.substring(u,l[1]),v=e.substring(l[4],f),g=dd(h,t,n)??"";c+="/"+y+g+v;continue}}return e.endsWith("/")&&(c+="/"),{usedParams:i,interpolatedPath:c||"/",isMissingParams:s}}function Ey(e,t){const n=encodeURIComponent(e);return(t==null?void 0:t(n))??n}function st(e){return(e==null?void 0:e.isNotFound)===!0}function oE(){try{return typeof window<"u"&&typeof window.sessionStorage=="object"?window.sessionStorage:void 0}catch{return}}const aE="tsr-scroll-restoration-v1_3";function lE(){const e=oE();if(!e)return null;let t={};try{const r=JSON.parse(e.getItem("tsr-scroll-restoration-v1_3")||"{}");Ti(r)&&(t=r)}catch{}return{get state(){return t},set:r=>{t=Cr(r,t)||t},persist:()=>{try{e.setItem(aE,JSON.stringify(t))}catch{}}}}const Ty=lE(),cE=e=>e.state.__TSR_key||e.href;function uE(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 tl=!1;const oo="window",Ny="data-scroll-restoration-id";function dE(e,t){if(!Ty)return;const n=Ty;if((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!n)return;e.isScrollRestorationSetup=!0,tl=!1;const r=e.options.getScrollRestorationKey||cE,s=new Map;window.history.scrollRestoration="manual";const i=a=>{if(!(tl||!e.isScrollRestoring))if(a.target===document||a.target===window)s.set(oo,{scrollX:window.scrollX||0,scrollY:window.scrollY||0});else{const l=a.target;s.set(l,{scrollX:l.scrollLeft||0,scrollY:l.scrollTop||0})}},o=a=>{var c;if(!e.isScrollRestoring||!a||s.size===0||!n)return;const l=(c=n.state)[a]||(c[a]={});for(const[u,f]of s){let p;if(u===oo)p=oo;else if(u.isConnected){const h=u.getAttribute(Ny);p=h?`[${Ny}="${h}"]`:uE(u)}p&&(l[p]=f)}};document.addEventListener("scroll",i,!0),e.subscribe("onBeforeLoad",a=>{o(a.fromLocation?r(a.fromLocation):void 0),s.clear()}),window.addEventListener("pagehide",()=>{o(r(e.stores.resolvedLocation.get()??e.stores.location.get())),n.persist()}),e.subscribe("onRendered",a=>{var f;const l=r(a.toLocation),c=e.options.scrollRestorationBehavior,u=e.options.scrollToTopSelectors;if(s.clear(),!e.resetNextScroll){e.resetNextScroll=!0;return}if(!(typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))){tl=!0;try{const p=e.isScrollRestoring?n.state[l]:void 0;let h=!1;if(p)for(const m in p){const y=p[m];if(!Ti(y))continue;const{scrollX:v,scrollY:g}=y;if(!(!Number.isFinite(v)||!Number.isFinite(g))){if(m===oo)window.scrollTo({top:g,left:v,behavior:c}),h=!0;else if(m){let x;try{x=document.querySelector(m)}catch{continue}x&&(x.scrollLeft=v,x.scrollTop=g,h=!0)}}}if(!h){const m=e.history.location.hash.slice(1);if(m){const y=((f=window.history.state)==null?void 0:f.__hashScrollIntoViewOptions)??!0;if(y){const v=document.getElementById(m);v&&v.scrollIntoView(y)}}else{const y={top:0,left:0,behavior:c};if(window.scrollTo(y),u)for(const v of u){if(v===oo)continue;const g=typeof v=="function"?v():document.querySelector(v);g&&g.scrollTo(y)}}}}finally{tl=!1}e.isScrollRestoring&&n.set(p=>(p[l]||(p[l]={}),p))}})}function fE(e,t=String){const n=new URLSearchParams;for(const r in e){const s=e[r];s!==void 0&&n.set(r,t(s))}return n.toString()}function fd(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function hE(e){const t=new URLSearchParams(e),n=Object.create(null);for(const[r,s]of t.entries()){const i=n[r];i==null?n[r]=fd(s):Array.isArray(i)?i.push(fd(s)):n[r]=[i,fd(s)]}return n}const pE=gE(JSON.parse),mE=yE(JSON.stringify,JSON.parse);function gE(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=hE(t);for(const r in n){const s=n[r];if(typeof s=="string")try{n[r]=e(s)}catch{}}return n}}function yE(e,t){const n=typeof t=="function";function r(s){if(typeof s=="object"&&s!==null)try{return e(s)}catch{}else if(n&&typeof s=="string")try{return t(s),e(s)}catch{}return s}return s=>{const i=fE(s,r);return i?`?${i}`:""}}const ks="__root__";function xE(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function vt(e){return e instanceof Response&&!!e.options}function vE(e){return{input:({url:t})=>{for(const n of e)t=oh(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=ab(e[n],t);return t}}}function wE(e){const t=ob(e.basepath),n=`/${t}`,r=`${n}/`,s=e.caseSensitive?n:n.toLowerCase(),i=e.caseSensitive?r:r.toLowerCase();return{input:({url:o})=>{const a=e.caseSensitive?o.pathname:o.pathname.toLowerCase();return a===s?o.pathname="/":a.startsWith(i)&&(o.pathname=o.pathname.slice(n.length)),o},output:({url:o})=>(o.pathname=Dl(["/",t,o.pathname]),o)}}function oh(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 ab(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 bE(e,t){const{createMutableStore:n,createReadonlyStore:r,batch:s,init:i}=t,o=new Map,a=new Map,l=new Map,c=n(e.status),u=n(e.loadedAt),f=n(e.isLoading),p=n(e.isTransitioning),h=n(e.location),m=n(e.resolvedLocation),y=n(e.statusCode),v=n(e.redirect),g=n([]),x=n([]),w=n([]),k=r(()=>hd(o,g.get())),j=r(()=>hd(a,x.get())),_=r(()=>hd(l,w.get())),S=r(()=>g.get()[0]),P=r(()=>g.get().some(V=>{var L;return((L=o.get(V))==null?void 0:L.get().status)==="pending"})),T=r(()=>{var V;return{locationHref:h.get().href,resolvedLocationHref:(V=m.get())==null?void 0:V.href,status:c.get()}}),E=r(()=>({status:c.get(),loadedAt:u.get(),isLoading:f.get(),isTransitioning:p.get(),matches:k.get(),location:h.get(),resolvedLocation:m.get(),statusCode:y.get(),redirect:v.get()})),I=ca(64);function A(V){let L=I.get(V);return L||(L=r(()=>{const B=g.get();for(const C of B){const $=o.get(C);if($&&$.routeId===V)return $.get()}}),I.set(V,L)),L}const O={status:c,loadedAt:u,isLoading:f,isTransitioning:p,location:h,resolvedLocation:m,statusCode:y,redirect:v,matchesId:g,pendingIds:x,cachedIds:w,matches:k,pendingMatches:j,cachedMatches:_,firstId:S,hasPending:P,matchRouteDeps:T,matchStores:o,pendingMatchStores:a,cachedMatchStores:l,__store:E,getRouteMatchStore:A,setMatches:M,setPending:N,setCached:z};M(e.matches),i==null||i(O);function M(V){pd(V,o,g,n,s)}function N(V){pd(V,a,x,n,s)}function z(V){pd(V,l,w,n,s)}return O}function hd(e,t){const n=[];for(const r of t){const s=e.get(r);s&&n.push(s.get())}return n}function pd(e,t,n,r,s){const i=e.map(a=>a.id),o=new Set(i);s(()=>{for(const a of t.keys())o.has(a)||t.delete(a);for(const a of e){const l=t.get(a.id);if(!l){const c=r(a);c.routeId=a.routeId,t.set(a.id,c);continue}l.routeId=a.routeId,l.get()!==a&&l.set(a)}HP(n.get(),i)||n.set(i)})}const ah=e=>{var t;if(!e.rendered)return e.rendered=!0,(t=e.onReady)==null?void 0:t.call(e)},kE=e=>e.stores.matchesId.get().some(t=>{var n;return(n=e.stores.matchStores.get(t))==null?void 0:n.get()._forcePending}),fu=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),_s=(e,t,n=!0)=>{const r={...e.router.options.context??{}},s=n?t:t-1;for(let i=0;i<=s;i++){const o=e.matches[i];if(!o)continue;const a=e.router.getMatch(o.id);a&&Object.assign(r,a.__routeContext,a.__beforeLoadContext)}return r},Ry=(e,t)=>{if(!e.matches.length)return;const n=t.routeId,r=e.matches.findIndex(o=>o.routeId===e.router.routeTree.id),s=r>=0?r:0;let i=n?e.matches.findIndex(o=>o.routeId===n):e.firstBadMatchIndex??e.matches.length-1;i<0&&(i=s);for(let o=i;o>=0;o--){const a=e.matches[o];if(e.router.looseRoutesById[a.routeId].options.notFoundComponent)return o}return n?i:s},Er=(e,t,n)=>{var r,s,i;if(!(!vt(n)&&!st(n)))throw vt(n)&&n.redirectHandled&&!n.options.reloadDocument||(t&&((r=t._nonReactive.beforeLoadPromise)==null||r.resolve(),(s=t._nonReactive.loaderPromise)==null||s.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,o=>({...o,status:vt(n)?"redirected":st(n)?"notFound":o.status==="pending"?"success":o.status,context:_s(e,t.index),isFetching:!1,error:n})),st(n)&&!n.routeId&&(n.routeId=t.routeId),(i=t._nonReactive.loadPromise)==null||i.resolve()),vt(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},lb=(e,t)=>{const n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},Iy=(e,t,n)=>{const r=_s(e,n);e.updateMatch(t,s=>({...s,context:r}))},ao=(e,t,n,r)=>{var a,l;const{id:s,routeId:i}=e.matches[t],o=e.router.looseRoutesById[i];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??(e.firstBadMatchIndex=t),Er(e,e.router.getMatch(s),n);try{(l=(a=o.options).onError)==null||l.call(a,n)}catch(c){n=c,Er(e,e.router.getMatch(s),n)}e.updateMatch(s,c=>{var u,f;return(u=c._nonReactive.beforeLoadPromise)==null||u.resolve(),c._nonReactive.beforeLoadPromise=void 0,(f=c._nonReactive.loadPromise)==null||f.resolve(),{...c,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}}),!e.preload&&!vt(n)&&!st(n)&&(e.serialError??(e.serialError=n))},cb=(e,t,n,r)=>{var i;if(r._nonReactive.pendingTimeout!==void 0)return;const s=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!fu(e,t)&&(n.options.loader||n.options.beforeLoad||db(n))&&typeof s=="number"&&s!==1/0&&(n.options.pendingComponent??((i=e.router.options)==null?void 0:i.defaultPendingComponent))){const o=setTimeout(()=>{ah(e)},s);r._nonReactive.pendingTimeout=o}},_E=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;cb(e,t,n,r);const s=()=>{const i=e.router.getMatch(t);i.preload&&(i.status==="redirected"||i.status==="notFound")&&Er(e,i,i.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(s):s()},SE=(e,t,n,r)=>{const s=e.router.getMatch(t);let i=s._nonReactive.loadPromise;s._nonReactive.loadPromise=Ni(()=>{i==null||i.resolve(),i=void 0});const{paramsError:o,searchError:a}=s;o&&ao(e,n,o,"PARSE_PARAMS"),a&&ao(e,n,a,"VALIDATE_SEARCH"),cb(e,t,r,s);const l=new AbortController;let c=!1;const u=()=>{c||(c=!0,e.updateMatch(t,k=>({...k,isFetching:"beforeLoad",fetchCount:k.fetchCount+1,abortController:l})))},f=()=>{var k;(k=s._nonReactive.beforeLoadPromise)==null||k.resolve(),s._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,j=>({...j,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{u(),f()});return}s._nonReactive.beforeLoadPromise=Ni();const p={..._s(e,n,!1),...s.__routeContext},{search:h,params:m,cause:y}=s,v=fu(e,t),g={search:h,abortController:l,params:m,preload:v,context:p,location:e.location,navigate:k=>e.router.navigate({...k,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:v?"preload":y,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},x=k=>{if(k===void 0){e.router.batch(()=>{u(),f()});return}(vt(k)||st(k))&&(u(),ao(e,n,k,"BEFORE_LOAD")),e.router.batch(()=>{u(),e.updateMatch(t,j=>({...j,__beforeLoadContext:k})),f()})};let w;try{if(w=r.options.beforeLoad(g),la(w))return u(),w.catch(k=>{ao(e,n,k,"BEFORE_LOAD")}).then(x)}catch(k){u(),ao(e,n,k,"BEFORE_LOAD")}x(w)},CE=(e,t)=>{const{id:n,routeId:r}=e.matches[t],s=e.router.looseRoutesById[r],i=()=>a(),o=()=>SE(e,n,t,s),a=()=>{if(lb(e,n))return;const l=_E(e,n,s);return la(l)?l.then(o):o()};return i()},jE=(e,t,n)=>{var i,o,a,l,c,u;const r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const s={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([(o=(i=n.options).head)==null?void 0:o.call(i,s),(l=(a=n.options).scripts)==null?void 0:l.call(a,s),(u=(c=n.options).headers)==null?void 0:u.call(c,s)]).then(([f,p,h])=>({meta:f==null?void 0:f.meta,links:f==null?void 0:f.links,headScripts:f==null?void 0:f.scripts,headers:h,scripts:p,styles:f==null?void 0:f.styles}))},ub=(e,t,n,r,s)=>{const i=t[r-1],{params:o,loaderDeps:a,abortController:l,cause:c}=e.router.getMatch(n),u=_s(e,r),f=fu(e,n);return{params:o,deps:a,preload:!!f,parentMatchPromise:i,abortController:l,context:u,location:e.location,navigate:p=>e.router.navigate({...p,_fromLocation:e.location}),cause:f?"preload":c,route:s,...e.router.options.additionalContext}},Ay=async(e,t,n,r,s)=>{var i,o,a,l,c;try{const u=e.router.getMatch(n);try{(!(nb??e.router.isServer)||u.ssr===!0)&&ua(s);const f=s.options.loader,p=typeof f=="function"?f:f==null?void 0:f.handler,h=p==null?void 0:p(ub(e,t,n,r,s)),m=!!p&&la(h);if((m||s._lazyPromise||s._componentsPromise||s.options.head||s.options.scripts||s.options.headers||u._nonReactive.minPendingPromise)&&e.updateMatch(n,v=>({...v,isFetching:"loader"})),p){const v=m?await h:h;Er(e,e.router.getMatch(n),v),v!==void 0&&e.updateMatch(n,g=>({...g,loaderData:v}))}s._lazyPromise&&await s._lazyPromise;const y=u._nonReactive.minPendingPromise;y&&await y,s._componentsPromise&&await s._componentsPromise,e.updateMatch(n,v=>({...v,error:void 0,context:_s(e,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(f){let p=f;if((p==null?void 0:p.name)==="AbortError"){if(u.abortController.signal.aborted){(i=u._nonReactive.loaderPromise)==null||i.resolve(),u._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,m=>({...m,status:m.status==="pending"?"success":m.status,isFetching:!1,context:_s(e,r)}));return}const h=u._nonReactive.minPendingPromise;h&&await h,st(f)&&await((a=(o=s.options.notFoundComponent)==null?void 0:o.preload)==null?void 0:a.call(o)),Er(e,e.router.getMatch(n),f);try{(c=(l=s.options).onError)==null||c.call(l,f)}catch(m){p=m,Er(e,e.router.getMatch(n),m)}!vt(p)&&!st(p)&&await ua(s,["errorComponent"]),e.updateMatch(n,m=>({...m,error:p,context:_s(e,r),status:"error",isFetching:!1}))}}catch(u){const f=e.router.getMatch(n);f&&(f._nonReactive.loaderPromise=void 0),Er(e,f,u)}},PE=async(e,t,n)=>{var h,m,y,v;async function r(g,x,w,k,j){const _=Date.now()-x.updatedAt,S=g?j.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:j.options.staleTime??e.router.options.defaultStaleTime??0,P=j.options.shouldReload,T=typeof P=="function"?P(ub(e,t,s,n,j)):P,{status:E,invalid:I}=k,A=_>=S&&(!!e.forceStaleReload||k.cause==="enter"||w!==void 0&&w!==k.id);o=E==="success"&&(I||(T??A)),g&&j.options.preload===!1||(o&&!e.sync&&u?(a=!0,(async()=>{var O,M;try{await Ay(e,t,s,n,j);const N=e.router.getMatch(s);(O=N._nonReactive.loaderPromise)==null||O.resolve(),(M=N._nonReactive.loadPromise)==null||M.resolve(),N._nonReactive.loaderPromise=void 0,N._nonReactive.loadPromise=void 0}catch(N){vt(N)&&await e.router.navigate(N.options)}})()):E!=="success"||o?await Ay(e,t,s,n,j):Iy(e,s,n))}const{id:s,routeId:i}=e.matches[n];let o=!1,a=!1;const l=e.router.looseRoutesById[i],c=l.options.loader,u=((typeof c=="function"||c==null?void 0:c.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(lb(e,s)){if(!e.router.getMatch(s))return e.matches[n];Iy(e,s,n)}else{const g=e.router.getMatch(s),x=e.router.stores.matchesId.get()[n],w=((h=x&&e.router.stores.matchStores.get(x)||null)==null?void 0:h.routeId)===i?x:(m=e.router.stores.matches.get().find(j=>j.routeId===i))==null?void 0:m.id,k=fu(e,s);if(g._nonReactive.loaderPromise){if(g.status==="success"&&!e.sync&&!g.preload&&u)return g;await g._nonReactive.loaderPromise;const j=e.router.getMatch(s),_=j._nonReactive.error||j.error;_&&Er(e,j,_),j.status==="pending"&&await r(k,g,w,j,l)}else{const j=k&&!e.router.stores.matchStores.has(s),_=e.router.getMatch(s);_._nonReactive.loaderPromise=Ni(),j!==_.preload&&e.updateMatch(s,S=>({...S,preload:j})),await r(k,g,w,_,l)}}const f=e.router.getMatch(s);a||((y=f._nonReactive.loaderPromise)==null||y.resolve(),(v=f._nonReactive.loadPromise)==null||v.resolve(),f._nonReactive.loadPromise=void 0),clearTimeout(f._nonReactive.pendingTimeout),f._nonReactive.pendingTimeout=void 0,a||(f._nonReactive.loaderPromise=void 0),f._nonReactive.dehydrated=void 0;const p=a?f.isFetching:!1;return p!==f.isFetching||f.invalid!==!1?(e.updateMatch(s,g=>({...g,isFetching:p,invalid:!1})),e.router.getMatch(s)):f};async function My(e){var p,h;const t=e,n=[];kE(t.router)&&ah(t);let r;for(let m=0;m<t.matches.length;m++){try{const y=CE(t,m);la(y)&&await y}catch(y){if(vt(y))throw y;if(st(y))r=y;else if(!t.preload)throw y;break}if(t.serialError||t.firstBadMatchIndex!=null)break}const s=t.firstBadMatchIndex??t.matches.length,i=r&&!t.preload?Ry(t,r):void 0,o=r&&t.preload?0:i!==void 0?Math.min(i+1,s):s;let a,l;for(let m=0;m<o;m++)n.push(PE(t,n,m));try{await Promise.all(n)}catch{const m=await Promise.allSettled(n);for(const y of m){if(y.status!=="rejected")continue;const v=y.reason;if(vt(v))throw v;st(v)?a??(a=v):l??(l=v)}if(l!==void 0)throw l}const c=a??(r&&!t.preload?r:void 0);let u=t.firstBadMatchIndex!==void 0?t.firstBadMatchIndex:t.matches.length-1;if(!c&&r&&t.preload)return t.matches;if(c){const m=Ry(t,c);m===void 0&&Jn();const y=t.matches[m],v=t.router.looseRoutesById[y.routeId],g=(p=t.router.options)==null?void 0:p.defaultNotFoundComponent;!v.options.notFoundComponent&&g&&(v.options.notFoundComponent=g),c.routeId=y.routeId;const x=y.routeId===t.router.routeTree.id;t.updateMatch(y.id,w=>({...w,...x?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:c},isFetching:!1})),u=m,await ua(v,["notFoundComponent"])}else if(!t.preload){const m=t.matches[0];m.globalNotFound||(h=t.router.getMatch(m.id))!=null&&h.globalNotFound&&t.updateMatch(m.id,y=>({...y,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const m=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await ua(m,["errorComponent"])}for(let m=0;m<=u;m++){const{id:y,routeId:v}=t.matches[m],g=t.router.looseRoutesById[v];try{const x=jE(t,y,g);if(x){const w=await x;t.updateMatch(y,k=>({...k,...w}))}}catch(x){console.error(`Error executing head for route ${v}:`,x)}}const f=ah(t);if(la(f)&&await f,c)throw c;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function Ly(e,t){const n=t.map(r=>{var s,i;return(i=(s=e.options[r])==null?void 0:s.preload)==null?void 0:i.call(s)}).filter(Boolean);if(n.length!==0)return Promise.all(n)}function ua(e,t=Fl){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(r=>{const{id:s,...i}=r.options;Object.assign(e.options,i),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);const n=()=>e._componentsLoaded?void 0:t===Fl?(()=>{if(e._componentsPromise===void 0){const r=Ly(e,Fl);r?e._componentsPromise=r.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():Ly(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function db(e){var t;for(const n of Fl)if((t=e.options[n])!=null&&t.preload)return!0;return!1}const Fl=["component","errorComponent","pendingComponent","notFoundComponent"];var zr="__TSR_index",Dy="popstate",Fy="beforeunload";function EE(e){let t=e.getLocation();const n=new Set,r=o=>{t=e.getLocation(),n.forEach(a=>a({location:t,action:o}))},s=o=>{e.notifyOnIndexChange??!0?r(o):t=e.getLocation()},i=async({task:o,navigateOpts:a,...l})=>{var f,p;if((a==null?void 0:a.ignoreBlocker)??!1){o();return}const c=((f=e.getBlockers)==null?void 0:f.call(e))??[],u=l.type==="PUSH"||l.type==="REPLACE";if(typeof document<"u"&&c.length&&u)for(const h of c){const m=jc(l.path,l.state);if(await h.blockerFn({currentLocation:t,nextLocation:m,action:l.type})){(p=e.onBlocked)==null||p.call(e);return}}o()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:o=>(n.add(o),()=>{n.delete(o)}),push:(o,a,l)=>{const c=t.state[zr];a=Oy(c+1,a),i({task:()=>{e.pushState(o,a),r({type:"PUSH"})},navigateOpts:l,type:"PUSH",path:o,state:a})},replace:(o,a,l)=>{const c=t.state[zr];a=Oy(c,a),i({task:()=>{e.replaceState(o,a),r({type:"REPLACE"})},navigateOpts:l,type:"REPLACE",path:o,state:a})},go:(o,a)=>{i({task:()=>{e.go(o),s({type:"GO",index:o})},navigateOpts:a,type:"GO"})},back:o=>{i({task:()=>{e.back((o==null?void 0:o.ignoreBlocker)??!1),s({type:"BACK"})},navigateOpts:o,type:"BACK"})},forward:o=>{i({task:()=>{e.forward((o==null?void 0:o.ignoreBlocker)??!1),s({type:"FORWARD"})},navigateOpts:o,type:"FORWARD"})},canGoBack:()=>t.state[zr]!==0,createHref:o=>e.createHref(o),block:o=>{var l;if(!e.setBlockers)return()=>{};const a=((l=e.getBlockers)==null?void 0:l.call(e))??[];return e.setBlockers([...a,o]),()=>{var u,f;const c=((u=e.getBlockers)==null?void 0:u.call(e))??[];(f=e.setBlockers)==null||f.call(e,c.filter(p=>p!==o))}},flush:()=>{var o;return(o=e.flush)==null?void 0:o.call(e)},destroy:()=>{var o;return(o=e.destroy)==null?void 0:o.call(e)},notify:r}}function Oy(e,t){t||(t={});const n=Jp();return{...t,key:n,__TSR_key:n,[zr]:e}}function TE(e){var P,T;const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let s=[];const i=()=>s,o=E=>s=E,a=E=>E,l=()=>jc(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state);if(!((P=t.history.state)!=null&&P.__TSR_key)&&!((T=t.history.state)!=null&&T.key)){const E=Jp();t.history.replaceState({[zr]:0,key:E,__TSR_key:E},"")}let c=l(),u,f=!1,p=!1,h=!1,m=!1;const y=()=>c;let v,g;const x=()=>{v&&(S._ignoreSubscribers=!0,(v.isPush?t.history.pushState:t.history.replaceState)(v.state,"",v.href),S._ignoreSubscribers=!1,v=void 0,g=void 0,u=void 0)},w=(E,I,A)=>{const O=a(I);g||(u=c),c=jc(I,A),v={href:O,state:A,isPush:(v==null?void 0:v.isPush)||E==="push"},g||(g=Promise.resolve().then(()=>x()))},k=E=>{c=l(),S.notify({type:E})},j=async()=>{if(p){p=!1;return}const E=l(),I=E.state[zr]-c.state[zr],A=I===1,O=I===-1,M=!A&&!O||f;f=!1;const N=M?"GO":O?"BACK":"FORWARD",z=M?{type:"GO",index:I}:{type:O?"BACK":"FORWARD"};if(h)h=!1;else{const V=i();if(typeof document<"u"&&V.length){for(const L of V)if(await L.blockerFn({currentLocation:c,nextLocation:E,action:N})){p=!0,t.history.go(1),S.notify(z);return}}}c=l(),S.notify(z)},_=E=>{if(m){m=!1;return}let I=!1;const A=i();if(typeof document<"u"&&A.length)for(const O of A){const M=O.enableBeforeUnload??!0;if(M===!0){I=!0;break}if(typeof M=="function"&&M()===!0){I=!0;break}}if(I)return E.preventDefault(),E.returnValue=""},S=EE({getLocation:y,getLength:()=>t.history.length,pushState:(E,I)=>w("push",E,I),replaceState:(E,I)=>w("replace",E,I),back:E=>(E&&(h=!0),m=!0,t.history.back()),forward:E=>{E&&(h=!0),m=!0,t.history.forward()},go:E=>{f=!0,t.history.go(E)},createHref:E=>a(E),flush:x,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(Fy,_,{capture:!0}),t.removeEventListener(Dy,j)},onBlocked:()=>{u&&c!==u&&(c=u)},getBlockers:i,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(Fy,_,{capture:!0}),t.addEventListener(Dy,j),t.history.pushState=function(...E){const I=n.apply(t.history,E);return S._ignoreSubscribers||k("PUSH"),I},t.history.replaceState=function(...E){const I=r.apply(t.history,E);return S._ignoreSubscribers||k("REPLACE"),I},S}function NE(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function jc(e,t){const n=NE(e),r=n.indexOf("#"),s=n.indexOf("?"),i=Jp();return{href:n,pathname:n.substring(0,r>0?s>0?Math.min(r,s):r:s>0?s:n.length),hash:r>-1?n.substring(r):"",search:s>-1?n.slice(s,r===-1?void 0:r):"",state:t||{[zr]:0,key:i,__TSR_key:i}}}function Jp(){return(Math.random()+1).toString(36).substring(7)}function xi(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 RE=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=n=>n(),this.update=n=>{var u;const r=this.options,s=this.basepath??(r==null?void 0:r.basepath)??"/",i=this.basepath===void 0,o=r==null?void 0:r.rewrite;if(this.options={...r,...n},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=iE(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=TE()),this.origin=this.options.origin,this.origin||(window!=null&&window.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let f;this.resolvePathCache=ca(1e3),f=this.buildRouteTree(),this.setRoutes(f)}if(!this.stores&&this.latestLocation){const f=this.getStoreConfig(this);this.batch=f.batch,this.stores=bE(AE(this.latestLocation),f),dE(this)}let a=!1;const l=this.options.basepath??"/",c=this.options.rewrite;if(i||s!==l||o!==c){this.basepath=l;const f=[],p=ob(l);p&&p!=="/"&&f.push(wE({basepath:l})),c&&f.push(c),this.rewrite=f.length===0?void 0:f.length===1?f[0]:vE(f),this.history&&this.updateLatestLocation(),a=!0}a&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<"u"&&"CSS"in window&&typeof((u=window.CSS)==null?void 0:u.supports)=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const n=JP(this.routeTree,this.options.caseSensitive,(r,s)=>{r.init({originalIndex:s})});return this.options.routeMasks&&KP(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,r)=>{const s={eventType:n,fn:r};return this.subscribers.add(s),()=>{this.subscribers.delete(s)}},this.emit=n=>{this.subscribers.forEach(r=>{r.eventType===n.type&&r.fn(n)})},this.parseLocation=(n,r)=>{const s=({pathname:l,search:c,hash:u,href:f,state:p})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(l)){const g=this.options.parseSearch(c),x=this.options.stringifySearch(g);return{href:l+x+u,publicHref:l+x+u,pathname:io(l).path,external:!1,searchStr:x,search:ts(r==null?void 0:r.search,g),hash:io(u.slice(1)).path,state:jr(r==null?void 0:r.state,p)}}const h=new URL(f,this.origin),m=oh(this.rewrite,h),y=this.options.parseSearch(m.search),v=this.options.stringifySearch(y);return m.search=v,{href:m.href.replace(m.origin,""),publicHref:f,pathname:io(m.pathname).path,external:!!this.rewrite&&m.origin!==this.origin,searchStr:v,search:ts(r==null?void 0:r.search,y),hash:io(m.hash.slice(1)).path,state:jr(r==null?void 0:r.state,p)}},i=s(n),{__tempLocation:o,__tempKey:a}=i.state;if(o&&(!a||a===this.tempLocationKey)){const l=s(o);return l.state.key=i.state.key,l.state.__TSR_key=i.state.__TSR_key,delete l.state.__tempLocation,{...l,maskedLocation:i}}return i},this.resolvePathWithBase=(n,r)=>sE({base:n,to:Xp(r),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,r,s)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:r},s):this.matchRoutesInternal(n,r),this.getMatchedRoutes=n=>ME({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const r=this.getMatch(n);r&&(r.abortController.abort(),clearTimeout(r._nonReactive.pendingTimeout),r._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(n=>{this.cancelMatch(n)}),this.stores.matchesId.get().forEach(n=>{var s;if(this.stores.pendingMatchStores.has(n))return;const r=(s=this.stores.matchStores.get(n))==null?void 0:s.get();r&&(r.status==="pending"||r.isFetching==="loader")&&this.cancelMatch(n)})},this.buildLocation=n=>{const r=(i={})=>{var E,I;const o=i._fromLocation||this.pendingBuiltLocation||this.latestLocation,a=this.matchRoutesLightweight(o);i.from;const l=i.unsafeRelative==="path"?o.pathname:i.from??a.fullPath,c=this.resolvePathWithBase(l,"."),u=a.search,f=Object.assign(Object.create(null),a.params),p=i.to?this.resolvePathWithBase(c,`${i.to}`):this.resolvePathWithBase(c,"."),h=i.params===!1||i.params===null?Object.create(null):(i.params??!0)===!0?f:Object.assign(f,Cr(i.params,f)),m=this.getMatchedRoutes(p);let y=m.matchedRoutes;if((!m.foundRoute||m.foundRoute.path!=="/"&&m.routeParams["**"])&&this.options.notFoundRoute&&(y=[...y,this.options.notFoundRoute]),Object.keys(h).length>0)for(const A of y){const O=((E=A.options.params)==null?void 0:E.stringify)??A.options.stringifyParams;if(O)try{Object.assign(h,O(h))}catch{}}const v=n.leaveParams?p:io(Py({path:p,params:h,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let g=u;if(n._includeValidateSearch&&((I=this.options.search)!=null&&I.strict)){const A={};y.forEach(O=>{if(O.options.validateSearch)try{Object.assign(A,Ol(O.options.validateSearch,{...A,...g}))}catch{}}),g=A}g=LE({search:g,dest:i,destRoutes:y,_includeValidateSearch:n._includeValidateSearch}),g=ts(u,g);const x=this.options.stringifySearch(g),w=i.hash===!0?o.hash:i.hash?Cr(i.hash,o.hash):void 0,k=w?`#${w}`:"";let j=i.state===!0?o.state:i.state?Cr(i.state,o.state):{};j=jr(o.state,j);const _=`${v}${x}${k}`;let S,P,T=!1;if(this.rewrite){const A=new URL(_,this.origin),O=ab(this.rewrite,A);S=A.href.replace(A.origin,""),O.origin!==this.origin?(P=O.href,T=!0):P=O.pathname+O.search+O.hash}else S=WP(_),P=S;return{publicHref:P,href:S,pathname:v,search:g,searchStr:x,state:j,hash:w??"",external:T,unmaskOnReload:i.unmaskOnReload}},s=(i={},o)=>{const a=r(i);let l=o?r(o):void 0;if(!l){const c=Object.create(null);if(this.options.routeMasks){const u=qP(a.pathname,this.processedTree);if(u){Object.assign(c,u.rawParams);const{from:f,params:p,...h}=u.route,m=p===!1||p===null?Object.create(null):(p??!0)===!0?c:Object.assign(c,Cr(p,c));o={from:n.from,...h,params:m},l=r(o)}}}return l&&(a.maskedLocation=l),a};return n.mask?s(n,{from:n.from,...n.mask}):s(n)},this.commitLocation=async({viewTransition:n,ignoreBlocker:r,...s})=>{const i=()=>{const l=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];l.forEach(u=>{s.state[u]=this.latestLocation.state[u]});const c=bs(s.state,this.latestLocation.state);return l.forEach(u=>{delete s.state[u]}),c},o=Or(this.latestLocation.href)===Or(s.href);let a=this.commitLocationPromise;if(this.commitLocationPromise=Ni(()=>{a==null||a.resolve(),a=void 0}),o&&i())this.load();else{let{maskedLocation:l,hashScrollIntoView:c,...u}=s;l&&(u={...l,state:{...l.state,__tempKey:void 0,__tempLocation:{...u,search:u.searchStr,state:{...u.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(u.unmaskOnReload??this.options.unmaskOnReload??!1)&&(u.state.__tempKey=this.tempLocationKey)),u.state.__hashScrollIntoViewOptions=c??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[s.replace?"replace":"push"](u.publicHref,u.state,{ignoreBlocker:r})}return this.resetNextScroll=s.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:r,hashScrollIntoView:s,viewTransition:i,ignoreBlocker:o,href:a,...l}={})=>{if(a){const f=this.history.location.state.__TSR_index,p=jc(a,{__TSR_index:n?f:f+1}),h=new URL(p.pathname,this.origin);l.to=oh(this.rewrite,h).pathname,l.search=this.options.parseSearch(p.search),l.hash=p.hash.slice(1)}const c=this.buildLocation({...l,_includeValidateSearch:!0});this.pendingBuiltLocation=c;const u=this.commitLocation({...c,viewTransition:i,replace:n,resetScroll:r,hashScrollIntoView:s,ignoreBlocker:o});return Promise.resolve().then(()=>{this.pendingBuiltLocation===c&&(this.pendingBuiltLocation=void 0)}),u},this.navigate=async({to:n,reloadDocument:r,href:s,publicHref:i,...o})=>{var l,c;let a=!1;if(s)try{new URL(`${s}`),a=!0}catch{}if(a&&!r&&(r=!0),r){if(n!==void 0||!s){const f=this.buildLocation({to:n,...o});s=s??f.publicHref,i=i??f.publicHref}const u=!a&&i?i:s;if(Sc(u,this.protocolAllowlist))return Promise.resolve();if(!o.ignoreBlocker){const f=((c=(l=this.history).getBlockers)==null?void 0:c.call(l))??[];for(const p of f)if(p!=null&&p.blockerFn&&await p.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return o.replace?window.location.replace(u):window.location.href=u,Promise.resolve()}return this.buildAndCommitLocation({...o,href:s,to:n,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const n=this.matchRoutes(this.latestLocation),r=this.stores.cachedMatches.get().filter(s=>!n.some(i=>i.id===s.id));this.batch(()=>{this.stores.status.set("pending"),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(n),this.stores.setCached(r)})},this.load=async n=>{let r,s,i;const o=this.stores.resolvedLocation.get()??this.stores.location.get();for(i=new Promise(l=>{this.startTransition(async()=>{var c;try{this.beforeLoad();const u=this.latestLocation,f=xi(u,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:"onBeforeNavigate",...f}),this.emit({type:"onBeforeLoad",...f}),await My({router:this,sync:n==null?void 0:n.sync,forceStaleReload:o.href===u.href,matches:this.stores.pendingMatches.get(),location:u,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{var v,g;let p=null,h=null,m=null,y=null;this.batch(()=>{const x=this.stores.pendingMatches.get(),w=x.length,k=this.stores.matches.get();p=w?k.filter(S=>!this.stores.pendingMatchStores.has(S.id)):null;const j=new Set;for(const S of this.stores.pendingMatchStores.values())S.routeId&&j.add(S.routeId);const _=new Set;for(const S of this.stores.matchStores.values())S.routeId&&_.add(S.routeId);h=w?k.filter(S=>!j.has(S.routeId)):null,m=w?x.filter(S=>!_.has(S.routeId)):null,y=w?x.filter(S=>_.has(S.routeId)):k,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),w&&(this.stores.setMatches(x),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...p.filter(S=>S.status!=="error"&&S.status!=="notFound"&&S.status!=="redirected")]),this.clearExpiredCache())});for(const[x,w]of[[h,"onLeave"],[m,"onEnter"],[y,"onStay"]])if(x)for(const k of x)(g=(v=this.looseRoutesById[k.routeId].options)[w])==null||g.call(v,k)})})}})}catch(u){vt(u)?(r=u,this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):st(u)&&(s=u);const f=r?r.status:s?404:this.stores.matches.get().some(p=>p.status==="error")?500:200;this.batch(()=>{this.stores.statusCode.set(f),this.stores.redirect.set(r)})}this.latestLoadPromise===i&&((c=this.commitLocationPromise)==null||c.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),l()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise;let a;this.hasNotFoundMatch()?a=404:this.stores.matches.get().some(l=>l.status==="error")&&(a=500),a!==void 0&&this.stores.statusCode.set(a)},this.startViewTransition=n=>{const r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let s;if(typeof r=="object"&&this.isViewTransitionTypesSupported){const i=this.latestLocation,o=this.stores.resolvedLocation.get(),a=typeof r.types=="function"?r.types(xi(i,o)):r.types;if(a===!1){n();return}s={update:n,types:a}}else s=n;document.startViewTransition(s)}else n()},this.updateMatch=(n,r)=>{this.startTransition(()=>{const s=this.stores.pendingMatchStores.get(n);if(s){s.set(r);return}const i=this.stores.matchStores.get(n);if(i){i.set(r);return}const o=this.stores.cachedMatchStores.get(n);if(o){const a=r(o.get());a.status==="redirected"?this.stores.cachedMatchStores.delete(n)&&this.stores.cachedIds.set(l=>l.filter(c=>c!==n)):o.set(a)}})},this.getMatch=n=>{var r,s,i;return((r=this.stores.cachedMatchStores.get(n))==null?void 0:r.get())??((s=this.stores.pendingMatchStores.get(n))==null?void 0:s.get())??((i=this.stores.matchStores.get(n))==null?void 0:i.get())},this.invalidate=n=>{const r=s=>{var i;return((i=n==null?void 0:n.filter)==null?void 0:i.call(n,s))??!0?{...s,invalid:!0,...n!=null&&n.forcePending||s.status==="error"||s.status==="notFound"?{status:"pending",error:void 0}:void 0}:s};return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(r)),this.stores.setCached(this.stores.cachedMatches.get().map(r)),this.stores.setPending(this.stores.pendingMatches.get().map(r))}),this.shouldViewTransition=!1,this.load({sync:n==null?void 0:n.sync})},this.getParsedLocationHref=n=>n.publicHref||"/",this.resolveRedirect=n=>{const r=n.headers.get("Location");if(!n.options.href||n.options._builtLocation){const s=n.options._builtLocation??this.buildLocation(n.options),i=this.getParsedLocationHref(s);n.options.href=i,n.headers.set("Location",i)}else if(r)try{const s=new URL(r);if(this.origin&&s.origin===this.origin){const i=s.pathname+s.search+s.hash;n.options.href=i,n.headers.set("Location",i)}}catch{}if(n.options.href&&!n.options._builtLocation&&Sc(n.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const r=n==null?void 0:n.filter;r!==void 0?this.stores.setCached(this.stores.cachedMatches.get().filter(s=>!r(s))):this.stores.setCached([])},this.clearExpiredCache=()=>{const n=Date.now(),r=s=>{const i=this.looseRoutesById[s.routeId];if(!i.options.loader)return!0;const o=(s.preload?i.options.preloadGcTime??this.options.defaultPreloadGcTime:i.options.gcTime??this.options.defaultGcTime)??300*1e3;return s.status==="error"?!0:n-s.updatedAt>=o};this.clearCache({filter:r})},this.loadRouteChunk=ua,this.preloadRoute=async n=>{const r=n._builtLocation??this.buildLocation(n);let s=this.matchRoutes(r,{throwOnError:!0,preload:!0,dest:n});const i=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),o=new Set([...i,...this.stores.cachedIds.get()]),a=s.filter(l=>!o.has(l.id));if(a.length){const l=this.stores.cachedMatches.get();this.stores.setCached([...l,...a])}try{return s=await My({router:this,matches:s,location:r,preload:!0,updateMatch:(l,c)=>{i.has(l)?s=s.map(u=>u.id===l?c(u):u):this.updateMatch(l,c)}}),s}catch(l){if(vt(l))return l.options.reloadDocument?void 0:await this.preloadRoute({...l.options,_fromLocation:r});st(l)||console.error(l);return}},this.matchRoute=(n,r)=>{const s={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},i=this.buildLocation(s);if(r!=null&&r.pending&&this.stores.status.get()!=="pending")return!1;const o=((r==null?void 0:r.pending)===void 0?!this.stores.isLoading.get():r.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),a=QP(i.pathname,(r==null?void 0:r.caseSensitive)??!1,(r==null?void 0:r.fuzzy)??!1,o.pathname,this.processedTree);return!a||n.params&&!bs(a.rawParams,n.params,{partial:!0})?!1:(r==null?void 0:r.includeSearch)??!0?bs(o.search,i.search,{partial:!0})?a.rawParams:!1:a.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(n=>n.status==="notFound"||n.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??mE,parseSearch:e.parseSearch??pE,protocolAllowlist:e.protocolAllowlist??UP}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}get looseRoutesById(){return this.routesById}getParentContext(e){return e!=null&&e.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){var f,p;const n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:s,parsedParams:i}=n;let{matchedRoutes:o}=n,a=!1;(r?r.path!=="/"&&s["**"]:Or(e.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:a=!0);const l=a?FE(this.options.notFoundMode,o):void 0,c=new Array(o.length),u=new Map;for(const h of this.stores.matchStores.values())h.routeId&&u.set(h.routeId,h.get());for(let h=0;h<o.length;h++){const m=o[h],y=c[h-1];let v,g,x;{const N=(y==null?void 0:y.search)??e.search,z=(y==null?void 0:y._strictSearch)??void 0;try{const V=Ol(m.options.validateSearch,{...N})??void 0;v={...N,...V},g={...z,...V},x=void 0}catch(V){let L=V;if(V instanceof Pc||(L=new Pc(V.message,{cause:V})),t!=null&&t.throwOnError)throw L;v=N,g={},x=L}}const w=((p=(f=m.options).loaderDeps)==null?void 0:p.call(f,{search:v}))??"",k=w?JSON.stringify(w):"",{interpolatedPath:j,usedParams:_}=Py({path:m.fullPath,params:s,decoder:this.pathParamsDecoder,server:this.isServer}),S=m.id+j+k,P=this.getMatch(S),T=u.get(m.id),E=(P==null?void 0:P._strictParams)??_;let I;if(!P)try{zy(m,_,i,E)}catch(N){if(st(N)||vt(N)?I=N:I=new IE(N.message,{cause:N}),t!=null&&t.throwOnError)throw I}Object.assign(s,E);const A=T?"stay":"enter";let O;if(P)O={...P,cause:A,params:(T==null?void 0:T.params)??s,_strictParams:E,search:ts(T?T.search:P.search,v),_strictSearch:g};else{const N=m.options.loader||m.options.beforeLoad||m.lazyFn||db(m)?"pending":"success";O={id:S,ssr:m.options.ssr,index:h,routeId:m.id,params:(T==null?void 0:T.params)??s,_strictParams:E,pathname:j,updatedAt:Date.now(),search:T?ts(T.search,v):v,_strictSearch:g,searchError:void 0,status:N,isFetching:!1,error:void 0,paramsError:I,__routeContext:void 0,_nonReactive:{loadPromise:Ni()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:A,loaderDeps:T?jr(T.loaderDeps,w):w,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:m.options.staticData||{},fullPath:m.fullPath}}t!=null&&t.preload||(O.globalNotFound=l===m.id),O.searchError=x;const M=this.getParentContext(y);O.context={...M,...O.__routeContext,...O.__beforeLoadContext},c[h]=O}for(let h=0;h<c.length;h++){const m=c[h],y=this.looseRoutesById[m.routeId],v=this.getMatch(m.id),g=u.get(m.routeId);if(m.params=g?ts(g.params,s):s,!v){const x=c[h-1],w=this.getParentContext(x);if(y.options.context){const k={deps:m.loaderDeps,params:m.params,context:w??{},location:e,navigate:j=>this.navigate({...j,_fromLocation:e}),buildLocation:this.buildLocation,cause:m.cause,abortController:m.abortController,preload:!!m.preload,matches:c,routeId:y.id};m.__routeContext=y.options.context(k)??void 0}m.context={...w,...m.__routeContext,...m.__beforeLoadContext}}}return c}matchRoutesLightweight(e){var u;const{matchedRoutes:t,routeParams:n,parsedParams:r}=this.getMatchedRoutes(e.pathname),s=aa(t),i={...e.search};for(const f of t)try{Object.assign(i,Ol(f.options.validateSearch,i))}catch{}const o=aa(this.stores.matchesId.get()),a=o&&((u=this.stores.matchStores.get(o))==null?void 0:u.get()),l=a&&a.routeId===s.id&&a.pathname===e.pathname;let c;if(l)c=a.params;else{const f=Object.assign(Object.create(null),n);for(const p of t)try{zy(p,n,r??{},f)}catch{}c=f}return{matchedRoutes:t,fullPath:s.fullPath,search:i,params:c}}},Pc=class extends Error{},IE=class extends Error{};function AE(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function Ol(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Pc("Async validation not supported");if(n.issues)throw new Pc(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 ME({pathname:e,routesById:t,processedTree:n}){const r=Object.create(null),s=Or(e);let i,o;const a=YP(s,n,!0);return a&&(i=a.route,Object.assign(r,a.rawParams),o=Object.assign(Object.create(null),a.parsedParams)),{matchedRoutes:(a==null?void 0:a.branch)||[t.__root__],routeParams:r,foundRoute:i,parsedParams:o}}function LE({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return DE(n)(e,t,r??!1)}function DE(e){var s;const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const i of e){if("search"in i.options)(s=i.options.search)!=null&&s.middlewares&&t.middlewares.push(...i.options.search.middlewares);else if(i.options.preSearchFilters||i.options.postSearchFilters){const o=({search:a,next:l})=>{let c=a;"preSearchFilters"in i.options&&i.options.preSearchFilters&&(c=i.options.preSearchFilters.reduce((f,p)=>p(f),a));const u=l(c);return"postSearchFilters"in i.options&&i.options.postSearchFilters?i.options.postSearchFilters.reduce((f,p)=>p(f),u):u};t.middlewares.push(o)}if(i.options.validateSearch){const o=({search:a,next:l})=>{const c=l(a);if(!t._includeValidateSearch)return c;try{return{...c,...Ol(i.options.validateSearch,c)??void 0}}catch{return c}};t.middlewares.push(o)}}const n=({search:i})=>{const o=t.dest;return o.search?o.search===!0?i:Cr(o.search,i):{}};t.middlewares.push(n);const r=(i,o,a)=>{if(i>=a.length)return o;const l=a[i];return l({search:o,next:u=>r(i+1,u,a)})};return function(o,a,l){return t.dest=a,t._includeValidateSearch=l,r(0,o,t.middlewares)}}function FE(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 ks}function zy(e,t,n,r){var i;const s=((i=e.options.params)==null?void 0:i.parse)??e.options.parseParams;if(s)if(e.options.skipRouteOnParseError)for(const o in t)o in n&&(r[o]=n[o]);else{const o=s(r);Object.assign(r,o)}}const OE="Error preloading route! ☝️";var fb=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=t=>{var l,c;this.originalIndex=t.originalIndex;const n=this.options,r=!(n!=null&&n.path)&&!(n!=null&&n.id);this.parentRoute=(c=(l=this.options).getParentRoute)==null?void 0:c.call(l),r?this._path=ks:this.parentRoute||Jn();let s=r?ks:n==null?void 0:n.path;s&&s!=="/"&&(s=ib(s));const i=(n==null?void 0:n.id)||s;let o=r?ks:Dl([this.parentRoute.id==="__root__"?"":this.parentRoute.id,i]);s==="__root__"&&(s="/"),o!=="__root__"&&(o=Dl(["/",o]));const a=o==="__root__"?"/":Dl([this.parentRoute.fullPath,s]);this._path=s,this._id=o,this._fullPath=a,this._to=Or(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=>xE({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.")}},zE=class extends fb{constructor(e){super(e)}};function $E(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 Zp(e){const t=e.errorComponent??em;return d.jsx(BE,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?b.createElement(t,{error:n,reset:r}):e.children})}var BE=class extends b.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,t){const n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function em({error:e}){const[t,n]=b.useState(!1);return d.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[d.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),d.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(r=>!r),children:t?"Hide Error":"Show Error"})]}),d.jsx("div",{style:{height:".25rem"}}),t?d.jsx("div",{children:d.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?d.jsx("code",{children:e.message}):null})}):null]})}function VE({children:e,fallback:t=null}){return hb()?d.jsx(bi.Fragment,{children:e}):d.jsx(bi.Fragment,{children:t})}function hb(){return bi.useSyncExternalStore(UE,()=>!0,()=>!1)}function UE(){return()=>{}}var pb=b.createContext(null);function Bt(e){return b.useContext(pb)}var hu=b.createContext(void 0),WE=b.createContext(void 0),Ce=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(Ce||{});function HE({update:e,notify:t,unwatched:n}){return{link:r,unlink:s,propagate:i,checkDirty:o,shallowPropagate:a};function r(c,u,f){const p=u.depsTail;if(p!==void 0&&p.dep===c)return;const h=p!==void 0?p.nextDep:u.deps;if(h!==void 0&&h.dep===c){h.version=f,u.depsTail=h;return}const m=c.subsTail;if(m!==void 0&&m.version===f&&m.sub===u)return;const y=u.depsTail=c.subsTail={version:f,dep:c,sub:u,prevDep:p,nextDep:h,prevSub:m,nextSub:void 0};h!==void 0&&(h.prevDep=y),p!==void 0?p.nextDep=y:u.deps=y,m!==void 0?m.nextSub=y:c.subs=y}function s(c,u=c.sub){const f=c.dep,p=c.prevDep,h=c.nextDep,m=c.nextSub,y=c.prevSub;return h!==void 0?h.prevDep=p:u.depsTail=p,p!==void 0?p.nextDep=h:u.deps=h,m!==void 0?m.prevSub=y:f.subsTail=y,y!==void 0?y.nextSub=m:(f.subs=m)===void 0&&n(f),h}function i(c){let u=c.nextSub,f;e:do{const p=c.sub;let h=p.flags;if(h&60?h&12?h&4?!(h&48)&&l(c,p)?(p.flags=h|40,h&=1):h=0:p.flags=h&-9|32:h=0:p.flags=h|32,h&2&&t(p),h&1){const m=p.subs;if(m!==void 0){const y=(c=m).nextSub;y!==void 0&&(f={value:u,prev:f},u=y);continue}}if((c=u)!==void 0){u=c.nextSub;continue}for(;f!==void 0;)if(c=f.value,f=f.prev,c!==void 0){u=c.nextSub;continue e}break}while(!0)}function o(c,u){let f,p=0,h=!1;e:do{const m=c.dep,y=m.flags;if(u.flags&16)h=!0;else if((y&17)===17){if(e(m)){const v=m.subs;v.nextSub!==void 0&&a(v),h=!0}}else if((y&33)===33){(c.nextSub!==void 0||c.prevSub!==void 0)&&(f={value:c,prev:f}),c=m.deps,u=m,++p;continue}if(!h){const v=c.nextDep;if(v!==void 0){c=v;continue}}for(;p--;){const v=u.subs,g=v.nextSub!==void 0;if(g?(c=f.value,f=f.prev):c=v,h){if(e(u)){g&&a(v),u=c.sub;continue}h=!1}else u.flags&=-33;u=c.sub;const x=c.nextDep;if(x!==void 0){c=x;continue e}}return h}while(!0)}function a(c){do{const u=c.sub,f=u.flags;(f&48)===32&&(u.flags=f|16,(f&6)===2&&t(u))}while((c=c.nextSub)!==void 0)}function l(c,u){let f=u.depsTail;for(;f!==void 0;){if(f===c)return!0;f=f.prevDep}return!1}}function GE(e,t,n){var i,o,a;const r=typeof e=="object",s=r?e:void 0;return{next:(i=r?e.next:e)==null?void 0:i.bind(s),error:(o=r?e.error:t)==null?void 0:o.bind(s),complete:(a=r?e.complete:n)==null?void 0:a.bind(s)}}const lh=[];let zl=0;const{link:$y,unlink:KE,propagate:qE,checkDirty:mb,shallowPropagate:By}=HE({update(e){return e._update()},notify(e){lh[ch++]=e,e.flags&=~Ce.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=Ce.Mutable|Ce.Dirty,Ec(e))}});let nl=0,ch=0,Tn,uh=0;function gb(e){try{++uh,e()}finally{--uh||yb()}}function Ec(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=KE(n,e)}function yb(){if(!(uh>0)){for(;nl<ch;){const e=lh[nl];lh[nl++]=void 0,e.notify()}nl=0,ch=0}}function Vy(e,t){const n=typeof e=="function",r=e,s={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?Ce.None:Ce.Mutable,get(){return Tn!==void 0&&$y(s,Tn,zl),s._snapshot},subscribe(i){const o=GE(i),a={current:!1},l=QE(()=>{var c;s.get(),a.current?(c=o.next)==null||c.call(o,s._snapshot):a.current=!0});return{unsubscribe:()=>{l.stop()}}},_update(i){const o=Tn,a=(t==null?void 0:t.compare)??Object.is;if(n)Tn=s,++zl,s.depsTail=void 0;else if(i===void 0)return!1;n&&(s.flags=Ce.Mutable|Ce.RecursedCheck);try{const l=s._snapshot,c=typeof i=="function"?i(l):i===void 0&&n?r(l):i;return l===void 0||!a(l,c)?(s._snapshot=c,!0):!1}finally{Tn=o,n&&(s.flags&=~Ce.RecursedCheck),Ec(s)}}};return n?(s.flags=Ce.Mutable|Ce.Dirty,s.get=function(){const i=s.flags;if(i&Ce.Dirty||i&Ce.Pending&&mb(s.deps,s)){if(s._update()){const o=s.subs;o!==void 0&&By(o)}}else i&Ce.Pending&&(s.flags=i&~Ce.Pending);return Tn!==void 0&&$y(s,Tn,zl),s._snapshot}):s.set=function(i){if(s._update(i)){const o=s.subs;o!==void 0&&(qE(o),By(o),yb())}},s}function QE(e){const t=()=>{const r=Tn;Tn=n,++zl,n.depsTail=void 0,n.flags=Ce.Watching|Ce.RecursedCheck;try{return e()}finally{Tn=r,n.flags&=~Ce.RecursedCheck,Ec(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Ce.Watching|Ce.RecursedCheck,notify(){const r=this.flags;r&Ce.Dirty||r&Ce.Pending&&mb(this.deps,this)?t():this.flags=Ce.Watching},stop(){this.flags=Ce.None,this.depsTail=void 0,Ec(this)}};return t(),n}var xb={exports:{}},vb={},wb={exports:{}},bb={};/**
|
|
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 Ri=b;function YE(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var XE=typeof Object.is=="function"?Object.is:YE,JE=Ri.useState,ZE=Ri.useEffect,eT=Ri.useLayoutEffect,tT=Ri.useDebugValue;function nT(e,t){var n=t(),r=JE({inst:{value:n,getSnapshot:t}}),s=r[0].inst,i=r[1];return eT(function(){s.value=n,s.getSnapshot=t,md(s)&&i({inst:s})},[e,n,t]),ZE(function(){return md(s)&&i({inst:s}),e(function(){md(s)&&i({inst:s})})},[e]),tT(n),n}function md(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!XE(e,n)}catch{return!0}}function rT(e,t){return t()}var sT=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?rT:nT;bb.useSyncExternalStore=Ri.useSyncExternalStore!==void 0?Ri.useSyncExternalStore:sT;wb.exports=bb;var iT=wb.exports;/**
|
|
50
|
+
* @license React
|
|
51
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
52
|
+
*
|
|
53
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
54
|
+
*
|
|
55
|
+
* This source code is licensed under the MIT license found in the
|
|
56
|
+
* LICENSE file in the root directory of this source tree.
|
|
57
|
+
*/var pu=b,oT=iT;function aT(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var lT=typeof Object.is=="function"?Object.is:aT,cT=oT.useSyncExternalStore,uT=pu.useRef,dT=pu.useEffect,fT=pu.useMemo,hT=pu.useDebugValue;vb.useSyncExternalStoreWithSelector=function(e,t,n,r,s){var i=uT(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=fT(function(){function l(h){if(!c){if(c=!0,u=h,h=r(h),s!==void 0&&o.hasValue){var m=o.value;if(s(m,h))return f=m}return f=h}if(m=f,lT(u,h))return m;var y=r(h);return s!==void 0&&s(m,y)?(u=h,m):(u=h,f=y)}var c=!1,u,f,p=n===void 0?null:n;return[function(){return l(t())},p===null?void 0:function(){return l(p())}]},[t,n,r,s]);var a=cT(e,i[0],i[1]);return dT(function(){o.hasValue=!0,o.value=a},[a]),hT(a),a};xb.exports=vb;var kb=xb.exports;const pT=qc(kb);function mT(e,t){return e===t}function St(e,t,n=mT){const r=b.useCallback(o=>{if(!e)return()=>{};const{unsubscribe:a}=e.subscribe(o);return a},[e]),s=b.useCallback(()=>e==null?void 0:e.get(),[e]);return kb.useSyncExternalStoreWithSelector(r,s,s,t,n)}var gT={get:()=>{},subscribe:()=>({unsubscribe:()=>{}})};function Ls(e){const t=Bt(),n=b.useContext(e.from?WE:hu),r=e.from??n,s=r?e.from?t.stores.getRouteMatchStore(r):t.stores.matchStores.get(r):void 0,i=b.useRef(void 0);return St(s??gT,o=>{if((e.shouldThrow??!0)&&!o&&Jn(),o===void 0)return;const a=e.select?e.select(o):o;if(e.structuralSharing??t.options.defaultStructuralSharing){const l=jr(i.current,a);return i.current=l,l}return a})}function _b(e){return Ls({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Sb(e){const{select:t,...n}=e;return Ls({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function Ds(e){return Ls({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 tm(e){return Ls({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Vt(e){const t=Bt();return b.useCallback(n=>t.navigate({...n,from:n.from??(e==null?void 0:e.from)}),[e==null?void 0:e.from,t])}function Cb(e){return Ls({...e,select:t=>e.select?e.select(t.context):t.context})}function yT(e,t){const n=Bt(),r=OP(t),{activeProps:s,inactiveProps:i,activeOptions:o,to:a,preload:l,preloadDelay:c,preloadIntentProximity:u,hashScrollIntoView:f,replace:p,startTransition:h,resetScroll:m,viewTransition:y,children:v,target:g,disabled:x,style:w,className:k,onClick:j,onBlur:_,onFocus:S,onMouseEnter:P,onMouseLeave:T,onTouchStart:E,ignoreBlocker:I,params:A,search:O,hash:M,state:N,mask:z,reloadDocument:V,unsafeRelative:L,from:B,_fromLocation:C,...$}=e,Q=hb(),R=b.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ce=St(n.stores.location,he=>he,(he,F)=>he.href===F.href),pe=b.useMemo(()=>{const he={_fromLocation:ce,...R};return n.buildLocation(he)},[n,ce,R]),fe=pe.maskedLocation?pe.maskedLocation.publicHref:pe.publicHref,Et=pe.maskedLocation?pe.maskedLocation.external:pe.external,Ge=b.useMemo(()=>_T(fe,Et,n.history,x),[x,Et,fe,n.history]),Wt=b.useMemo(()=>{if(Ge!=null&&Ge.external)return Sc(Ge.href,n.protocolAllowlist)?void 0:Ge.href;if(!ST(a)&&!(typeof a!="string"||a.indexOf(":")===-1))try{return new URL(a),Sc(a,n.protocolAllowlist)?void 0:a}catch{}},[a,Ge,n.protocolAllowlist]),wn=b.useMemo(()=>{if(Wt)return!1;if(o!=null&&o.exact){if(!rE(ce.pathname,pe.pathname,n.basepath))return!1}else{const he=Cc(ce.pathname,n.basepath),F=Cc(pe.pathname,n.basepath);if(!(he.startsWith(F)&&(he.length===F.length||he[F.length]==="/")))return!1}return((o==null?void 0:o.includeSearch)??!0)&&!bs(ce.search,pe.search,{partial:!(o!=null&&o.exact),ignoreUndefined:!(o!=null&&o.explicitUndefined)})?!1:o!=null&&o.includeHash?Q&&ce.hash===pe.hash:!0},[o==null?void 0:o.exact,o==null?void 0:o.explicitUndefined,o==null?void 0:o.includeHash,o==null?void 0:o.includeSearch,ce,Wt,Q,pe.hash,pe.pathname,pe.search,n.basepath]),zn=wn?Cr(s,{})??xT:gd,Os=wn?gd:Cr(i,{})??gd,Ra=[k,zn.className,Os.className].filter(Boolean).join(" "),Ia=(w||zn.style||Os.style)&&{...w,...zn.style,...Os.style},[Aa,Ki]=b.useState(!1),qi=b.useRef(!1),ir=e.reloadDocument||Wt?!1:l??n.options.defaultPreload,zs=c??n.options.defaultPreloadDelay??0,bn=b.useCallback(()=>{n.preloadRoute({...R,_builtLocation:pe}).catch(he=>{console.warn(he),console.warn(OE)})},[n,R,pe]);FP(r,b.useCallback(he=>{he!=null&&he.isIntersecting&&bn()},[bn]),kT,{disabled:!!x||ir!=="viewport"}),b.useEffect(()=>{qi.current||!x&&ir==="render"&&(bn(),qi.current=!0)},[x,bn,ir]);const Mu=he=>{const F=he.currentTarget.getAttribute("target"),H=g!==void 0?g:F;if(!x&&!CT(he)&&!he.defaultPrevented&&(!H||H==="_self")&&he.button===0){he.preventDefault(),Ms.flushSync(()=>{Ki(!0)});const ee=n.subscribe("onResolved",()=>{ee(),Ki(!1)});n.navigate({...R,replace:p,resetScroll:m,hashScrollIntoView:f,startTransition:h,viewTransition:y,ignoreBlocker:I})}};if(Wt)return{...$,ref:r,href:Wt,...v&&{children:v},...g&&{target:g},...x&&{disabled:x},...w&&{style:w},...k&&{className:k},...j&&{onClick:j},..._&&{onBlur:_},...S&&{onFocus:S},...P&&{onMouseEnter:P},...T&&{onMouseLeave:T},...E&&{onTouchStart:E}};const Ma=he=>{if(x||ir!=="intent")return;if(!zs){bn();return}const F=he.currentTarget;if(lo.has(F))return;const H=setTimeout(()=>{lo.delete(F),bn()},zs);lo.set(F,H)},Lu=he=>{x||ir!=="intent"||bn()},La=he=>{if(x||!ir||!zs)return;const F=he.currentTarget,H=lo.get(F);H&&(clearTimeout(H),lo.delete(F))};return{...$,...zn,...Os,href:Ge==null?void 0:Ge.href,ref:r,onClick:Vs([j,Mu]),onBlur:Vs([_,La]),onFocus:Vs([S,Ma]),onMouseEnter:Vs([P,Ma]),onMouseLeave:Vs([T,La]),onTouchStart:Vs([E,Lu]),disabled:!!x,target:g,...Ia&&{style:Ia},...Ra&&{className:Ra},...x&&vT,...wn&&wT,...Q&&Aa&&bT}}var gd={},xT={className:"active"},vT={role:"link","aria-disabled":!0},wT={"data-status":"active","aria-current":"page"},bT={"data-transitioning":"transitioning"},lo=new WeakMap,kT={rootMargin:"100px"},Vs=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function _T(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function ST(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var jb=b.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:s,...i}=yT(r,t),o=typeof r.children=="function"?r.children({isActive:i["data-status"]==="active"}):r.children;if(!n){const{disabled:a,...l}=i;return b.createElement("a",l,o)}return b.createElement(n,i,o)});function CT(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var jT=class extends fb{constructor(e){super(e),this.useMatch=t=>Ls({select:t==null?void 0:t.select,from:this.id,structuralSharing:t==null?void 0:t.structuralSharing}),this.useRouteContext=t=>Cb({...t,from:this.id}),this.useSearch=t=>tm({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useParams=t=>Ds({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useLoaderDeps=t=>Sb({...t,from:this.id}),this.useLoaderData=t=>_b({...t,from:this.id}),this.useNavigate=()=>Vt({from:this.fullPath}),this.Link=bi.forwardRef((t,n)=>d.jsx(jb,{ref:n,from:this.fullPath,...t}))}};function sn(e){return new jT(e)}var PT=class extends zE{constructor(e){super(e),this.useMatch=t=>Ls({select:t==null?void 0:t.select,from:this.id,structuralSharing:t==null?void 0:t.structuralSharing}),this.useRouteContext=t=>Cb({...t,from:this.id}),this.useSearch=t=>tm({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useParams=t=>Ds({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useLoaderDeps=t=>Sb({...t,from:this.id}),this.useLoaderData=t=>_b({...t,from:this.id}),this.useNavigate=()=>Vt({from:this.fullPath}),this.Link=bi.forwardRef((t,n)=>d.jsx(jb,{ref:n,from:this.fullPath,...t}))}};function ET(e){return new PT(e)}function TT(e){const t=Bt(),n=`not-found-${St(t.stores.location,r=>r.pathname)}-${St(t.stores.status,r=>r)}`;return d.jsx(Zp,{getResetKey:()=>n,onCatch:(r,s)=>{var i;if(st(r))(i=e.onCatch)==null||i.call(e,r,s);else throw r},errorComponent:({error:r})=>{var s;if(st(r))return(s=e.fallback)==null?void 0:s.call(e,r);throw r},children:e.children})}function NT(){return d.jsx("p",{children:"Not Found"})}function qs(e){return d.jsx(d.Fragment,{children:e.children})}function Pb(e,t,n){return t.options.notFoundComponent?d.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?d.jsx(e.options.defaultNotFoundComponent,{...n}):d.jsx(NT,{})}function RT(e){return null}function IT(){return RT(Bt()),null}var Eb=b.memo(function({matchId:t}){const n=Bt(),r=n.stores.matchStores.get(t);r||Jn();const s=St(n.stores.loadedAt,o=>o),i=St(r,o=>o);return d.jsx(AT,{router:n,matchId:t,resetKey:s,matchState:b.useMemo(()=>{var l;const o=i.routeId,a=(l=n.routesById[o].parentRoute)==null?void 0:l.id;return{routeId:o,ssr:i.ssr,_displayPending:i._displayPending,parentRouteId:a}},[i._displayPending,i.routeId,i.ssr,n.routesById])})});function AT({router:e,matchId:t,resetKey:n,matchState:r}){var m,y;const s=e.routesById[r.routeId],i=s.options.pendingComponent??e.options.defaultPendingComponent,o=i?d.jsx(i,{}):null,a=s.options.errorComponent??e.options.defaultErrorComponent,l=s.options.onCatch??e.options.defaultOnCatch,c=s.isRoot?s.options.notFoundComponent??((m=e.options.notFoundRoute)==null?void 0:m.options.component):s.options.notFoundComponent,u=r.ssr===!1||r.ssr==="data-only",f=(!s.isRoot||s.options.wrapInSuspense||u)&&(s.options.wrapInSuspense??i??(((y=s.options.errorComponent)==null?void 0:y.preload)||u))?b.Suspense:qs,p=a?Zp:qs,h=c?TT:qs;return d.jsxs(s.isRoot?s.options.shellComponent??qs:qs,{children:[d.jsx(hu.Provider,{value:t,children:d.jsx(f,{fallback:o,children:d.jsx(p,{getResetKey:()=>n,errorComponent:a||em,onCatch:(v,g)=>{if(st(v))throw v.routeId??(v.routeId=r.routeId),v;l==null||l(v,g)},children:d.jsx(h,{fallback:v=>{if(v.routeId??(v.routeId=r.routeId),!c||v.routeId&&v.routeId!==r.routeId||!v.routeId&&!s.isRoot)throw v;return b.createElement(c,v)},children:u||r._displayPending?d.jsx(VE,{fallback:o,children:d.jsx(Uy,{matchId:t})}):d.jsx(Uy,{matchId:t})})})})}),r.parentRouteId===ks?d.jsxs(d.Fragment,{children:[d.jsx(MT,{resetKey:n}),e.options.scrollRestoration&&nb?d.jsx(IT,{}):null]}):null]})}function MT({resetKey:e}){const t=Bt(),n=b.useRef(void 0);return So(()=>{const r=t.latestLocation.href;(n.current===void 0||n.current!==r)&&(t.emit({type:"onRendered",...xi(t.stores.location.get(),t.stores.resolvedLocation.get())}),n.current=r)},[t.latestLocation.state.__TSR_key,e,t]),null}var Uy=b.memo(function({matchId:t}){const n=Bt(),r=(u,f)=>{var p;return((p=n.getMatch(u.id))==null?void 0:p._nonReactive[f])??u._nonReactive[f]},s=n.stores.matchStores.get(t);s||Jn();const i=St(s,u=>u),o=i.routeId,a=n.routesById[o],l=b.useMemo(()=>{var f;const u=(f=n.routesById[o].options.remountDeps??n.options.defaultRemountDeps)==null?void 0:f({routeId:o,loaderDeps:i.loaderDeps,params:i._strictParams,search:i._strictSearch});return u?JSON.stringify(u):void 0},[o,i.loaderDeps,i._strictParams,i._strictSearch,n.options.defaultRemountDeps,n.routesById]),c=b.useMemo(()=>{const u=a.options.component??n.options.defaultComponent;return u?d.jsx(u,{},l):d.jsx(Tb,{})},[l,a.options.component,n.options.defaultComponent]);if(i._displayPending)throw r(i,"displayPendingPromise");if(i._forcePending)throw r(i,"minPendingPromise");if(i.status==="pending"){const u=a.options.pendingMinMs??n.options.defaultPendingMinMs;if(u){const f=n.getMatch(i.id);if(f&&!f._nonReactive.minPendingPromise){const p=Ni();f._nonReactive.minPendingPromise=p,setTimeout(()=>{p.resolve(),f._nonReactive.minPendingPromise=void 0},u)}}throw r(i,"loadPromise")}if(i.status==="notFound")return st(i.error)||Jn(),Pb(n,a,i.error);if(i.status==="redirected")throw vt(i.error)||Jn(),r(i,"loadPromise");if(i.status==="error")throw i.error;return c}),Tb=b.memo(function(){const t=Bt(),n=b.useContext(hu);let r,s=!1,i;{const c=n?t.stores.matchStores.get(n):void 0;[r,s]=St(c,u=>[u==null?void 0:u.routeId,(u==null?void 0:u.globalNotFound)??!1]),i=St(t.stores.matchesId,u=>u[u.findIndex(f=>f===n)+1])}const o=r?t.routesById[r]:void 0,a=t.options.defaultPendingComponent?d.jsx(t.options.defaultPendingComponent,{}):null;if(s)return o||Jn(),Pb(t,o,void 0);if(!i)return null;const l=d.jsx(Eb,{matchId:i});return r===ks?d.jsx(b.Suspense,{fallback:a,children:l}):l});function LT(){const e=Bt(),t=b.useRef({router:e,mounted:!1}),[n,r]=b.useState(!1),s=St(e.stores.isLoading,f=>f),i=St(e.stores.hasPending,f=>f),o=ld(s),a=s||n||i,l=ld(a),c=s||i,u=ld(c);return e.startTransition=f=>{r(!0),b.startTransition(()=>{f(),r(!1)})},b.useEffect(()=>{const f=e.history.subscribe(e.load),p=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Or(e.latestLocation.publicHref)!==Or(p.publicHref)&&e.commitLocation({...p,replace:!0}),()=>{f()}},[e,e.history]),So(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(p){console.error(p)}})()},[e]),So(()=>{o&&!s&&e.emit({type:"onLoad",...xi(e.stores.location.get(),e.stores.resolvedLocation.get())})},[o,e,s]),So(()=>{u&&!c&&e.emit({type:"onBeforeRouteMount",...xi(e.stores.location.get(),e.stores.resolvedLocation.get())})},[c,u,e]),So(()=>{if(l&&!a){const f=xi(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:"onResolved",...f}),gb(()=>{e.stores.status.set("idle"),e.stores.resolvedLocation.set(e.stores.location.get())}),f.hrefChanged&&$E(e)}},[a,l,e]),null}function DT(){const e=Bt(),t=e.routesById[ks].options.pendingComponent??e.options.defaultPendingComponent,n=t?d.jsx(t,{}):null,r=d.jsxs(typeof document<"u"&&e.ssr?qs:b.Suspense,{fallback:n,children:[d.jsx(LT,{}),d.jsx(FT,{})]});return e.options.InnerWrap?d.jsx(e.options.InnerWrap,{children:r}):r}function FT(){const e=Bt(),t=St(e.stores.firstId,s=>s),n=St(e.stores.loadedAt,s=>s),r=t?d.jsx(Eb,{matchId:t}):null;return d.jsx(hu.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:d.jsx(Zp,{getResetKey:()=>n,errorComponent:em,onCatch:void 0,children:r})})}var OT=e=>({createMutableStore:Vy,createReadonlyStore:Vy,batch:gb}),zT=e=>new $T(e),$T=class extends RE{constructor(e){super(e,OT)}};function BT({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(pb.Provider,{value:e,children:t});return e.options.Wrap?d.jsx(e.options.Wrap,{children:r}):r}function VT({router:e,...t}){return d.jsx(BT,{router:e,...t,children:d.jsx(DT,{})})}function UT(e){const t=Bt({warn:(e==null?void 0:e.router)===void 0}),n=(e==null?void 0:e.router)||t,r=b.useRef(void 0);return St(n.stores.__store,s=>{if(e!=null&&e.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const i=jr(r.current,e.select(s));return r.current=i,i}return e.select(s)}return s})}const WT="modulepreload",HT=function(e,t){return new URL(e,t).href},Wy={},vn=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){const o=document.getElementsByTagName("link"),a=document.querySelector("meta[property=csp-nonce]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));s=Promise.allSettled(n.map(c=>{if(c=HT(c,r),c in Wy)return;Wy[c]=!0;const u=c.endsWith(".css"),f=u?'[rel="stylesheet"]':"";if(!!r)for(let m=o.length-1;m>=0;m--){const y=o[m];if(y.href===c&&(!u||y.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${c}"]${f}`))return;const h=document.createElement("link");if(h.rel=u?"stylesheet":WT,u||(h.as="script"),h.crossOrigin="",h.href=c,l&&h.setAttribute("nonce",l),document.head.appendChild(h),u)return new Promise((m,y)=>{h.addEventListener("load",m),h.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return s.then(o=>{for(const a of o||[])a.status==="rejected"&&i(a.reason);return t().catch(i)})};function GT(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const KT=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,qT=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,QT={};function Hy(e,t){return(QT.jsx?qT:KT).test(e)}const YT=/[ \t\n\f\r]/g;function XT(e){return typeof e=="object"?e.type==="text"?Gy(e.value):!1:Gy(e)}function Gy(e){return e.replace(YT,"")===""}class ka{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}ka.prototype.normal={};ka.prototype.property={};ka.prototype.space=void 0;function Nb(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new ka(n,r,t)}function dh(e){return e.toLowerCase()}class Pt{constructor(t,n){this.attribute=n,this.property=t}}Pt.prototype.attribute="";Pt.prototype.booleanish=!1;Pt.prototype.boolean=!1;Pt.prototype.commaOrSpaceSeparated=!1;Pt.prototype.commaSeparated=!1;Pt.prototype.defined=!1;Pt.prototype.mustUseProperty=!1;Pt.prototype.number=!1;Pt.prototype.overloadedBoolean=!1;Pt.prototype.property="";Pt.prototype.spaceSeparated=!1;Pt.prototype.space=void 0;let JT=0;const te=Fs(),Fe=Fs(),fh=Fs(),W=Fs(),ge=Fs(),Ss=Fs(),It=Fs();function Fs(){return 2**++JT}const hh=Object.freeze(Object.defineProperty({__proto__:null,boolean:te,booleanish:Fe,commaOrSpaceSeparated:It,commaSeparated:Ss,number:W,overloadedBoolean:fh,spaceSeparated:ge},Symbol.toStringTag,{value:"Module"})),yd=Object.keys(hh);class nm extends Pt{constructor(t,n,r,s){let i=-1;if(super(t,n),Ky(this,"space",s),typeof r=="number")for(;++i<yd.length;){const o=yd[i];Ky(this,yd[i],(r&hh[o])===hh[o])}}}nm.prototype.defined=!0;function Ky(e,t,n){n&&(e[t]=n)}function Oi(e){const t={},n={};for(const[r,s]of Object.entries(e.properties)){const i=new nm(r,e.transform(e.attributes||{},r),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[dh(r)]=r,n[dh(i.attribute)]=r}return new ka(t,n,e.space)}const Rb=Oi({properties:{ariaActiveDescendant:null,ariaAtomic:Fe,ariaAutoComplete:null,ariaBusy:Fe,ariaChecked:Fe,ariaColCount:W,ariaColIndex:W,ariaColSpan:W,ariaControls:ge,ariaCurrent:null,ariaDescribedBy:ge,ariaDetails:null,ariaDisabled:Fe,ariaDropEffect:ge,ariaErrorMessage:null,ariaExpanded:Fe,ariaFlowTo:ge,ariaGrabbed:Fe,ariaHasPopup:null,ariaHidden:Fe,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ge,ariaLevel:W,ariaLive:null,ariaModal:Fe,ariaMultiLine:Fe,ariaMultiSelectable:Fe,ariaOrientation:null,ariaOwns:ge,ariaPlaceholder:null,ariaPosInSet:W,ariaPressed:Fe,ariaReadOnly:Fe,ariaRelevant:null,ariaRequired:Fe,ariaRoleDescription:ge,ariaRowCount:W,ariaRowIndex:W,ariaRowSpan:W,ariaSelected:Fe,ariaSetSize:W,ariaSort:null,ariaValueMax:W,ariaValueMin:W,ariaValueNow:W,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Ib(e,t){return t in e?e[t]:t}function Ab(e,t){return Ib(e,t.toLowerCase())}const ZT=Oi({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ss,acceptCharset:ge,accessKey:ge,action:null,allow:null,allowFullScreen:te,allowPaymentRequest:te,allowUserMedia:te,alpha:te,alt:null,as:null,async:te,autoCapitalize:null,autoComplete:ge,autoFocus:te,autoPlay:te,blocking:ge,capture:null,charSet:null,checked:te,cite:null,className:ge,closedBy:null,colorSpace:null,cols:W,colSpan:W,command:null,commandFor:null,content:null,contentEditable:Fe,controls:te,controlsList:ge,coords:W|Ss,crossOrigin:null,data:null,dateTime:null,decoding:null,default:te,defer:te,dir:null,dirName:null,disabled:te,download:fh,draggable:Fe,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:te,formTarget:null,headers:ge,height:W,hidden:fh,high:W,href:null,hrefLang:null,htmlFor:ge,httpEquiv:ge,id:null,imageSizes:null,imageSrcSet:null,inert:te,inputMode:null,integrity:null,is:null,isMap:te,itemId:null,itemProp:ge,itemRef:ge,itemScope:te,itemType:ge,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:te,low:W,manifest:null,max:null,maxLength:W,media:null,method:null,min:null,minLength:W,multiple:te,muted:te,name:null,nonce:null,noModule:te,noValidate:te,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:te,optimum:W,pattern:null,ping:ge,placeholder:null,playsInline:te,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:te,referrerPolicy:null,rel:ge,required:te,reversed:te,rows:W,rowSpan:W,sandbox:ge,scope:null,scoped:te,seamless:te,selected:te,shadowRootClonable:te,shadowRootCustomElementRegistry:te,shadowRootDelegatesFocus:te,shadowRootMode:null,shadowRootSerializable:te,shape:null,size:W,sizes:null,slot:null,span:W,spellCheck:Fe,src:null,srcDoc:null,srcLang:null,srcSet:null,start:W,step:null,style:null,tabIndex:W,target:null,title:null,translate:null,type:null,typeMustMatch:te,useMap:null,value:Fe,width:W,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ge,axis:null,background:null,bgColor:null,border:W,borderColor:null,bottomMargin:W,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:te,declare:te,event:null,face:null,frame:null,frameBorder:null,hSpace:W,leftMargin:W,link:null,longDesc:null,lowSrc:null,marginHeight:W,marginWidth:W,noResize:te,noHref:te,noShade:te,noWrap:te,object:null,profile:null,prompt:null,rev:null,rightMargin:W,rules:null,scheme:null,scrolling:Fe,standby:null,summary:null,text:null,topMargin:W,valueType:null,version:null,vAlign:null,vLink:null,vSpace:W,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:te,disablePictureInPicture:te,disableRemotePlayback:te,exportParts:Ss,part:ge,prefix:null,property:null,results:W,security:null,unselectable:null},space:"html",transform:Ab}),e2=Oi({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:It,accentHeight:W,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:W,amplitude:W,arabicForm:null,ascent:W,attributeName:null,attributeType:null,azimuth:W,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:W,by:null,calcMode:null,capHeight:W,className:ge,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:W,diffuseConstant:W,direction:null,display:null,dur:null,divisor:W,dominantBaseline:null,download:te,dx:null,dy:null,edgeMode:null,editable:null,elevation:W,enableBackground:null,end:null,event:null,exponent:W,externalResourcesRequired:null,fill:null,fillOpacity:W,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Ss,g2:Ss,glyphName:Ss,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:W,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:W,horizOriginX:W,horizOriginY:W,id:null,ideographic:W,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:W,k:W,k1:W,k2:W,k3:W,k4:W,kernelMatrix:It,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:W,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:W,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:W,overlineThickness:W,paintOrder:null,panose1:null,path:null,pathLength:W,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ge,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:W,pointsAtY:W,pointsAtZ:W,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:It,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:It,rev:It,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:It,requiredFeatures:It,requiredFonts:It,requiredFormats:It,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:W,specularExponent:W,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:W,strikethroughThickness:W,string:null,stroke:null,strokeDashArray:It,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:W,strokeOpacity:W,strokeWidth:null,style:null,surfaceScale:W,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:It,tabIndex:W,tableValues:null,target:null,targetX:W,targetY:W,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:It,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:W,underlineThickness:W,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:W,values:null,vAlphabetic:W,vMathematical:W,vectorEffect:null,vHanging:W,vIdeographic:W,version:null,vertAdvY:W,vertOriginX:W,vertOriginY:W,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:W,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Ib}),Mb=Oi({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()}}),Lb=Oi({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Ab}),Db=Oi({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),t2={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"},n2=/[A-Z]/g,qy=/-[a-z]/g,r2=/^data[-\w.:]+$/i;function s2(e,t){const n=dh(t);let r=t,s=Pt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&r2.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(qy,o2);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!qy.test(i)){let o=i.replace(n2,i2);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}s=nm}return new s(r,t)}function i2(e){return"-"+e.toLowerCase()}function o2(e){return e.charAt(1).toUpperCase()}const a2=Nb([Rb,ZT,Mb,Lb,Db],"html"),rm=Nb([Rb,e2,Mb,Lb,Db],"svg");function l2(e){return e.join(" ").trim()}var sm={},Qy=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,c2=/\n/g,u2=/^\s*/,d2=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,f2=/^:\s*/,h2=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,p2=/^[;\s]*/,m2=/^\s+|\s+$/g,g2=`
|
|
58
|
+
`,Yy="/",Xy="*",fs="",y2="comment",x2="declaration";function v2(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function s(m){var y=m.match(c2);y&&(n+=y.length);var v=m.lastIndexOf(g2);r=~v?m.length-v:r+m.length}function i(){var m={line:n,column:r};return function(y){return y.position=new o(m),c(),y}}function o(m){this.start=m,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function a(m){var y=new Error(t.source+":"+n+":"+r+": "+m);if(y.reason=m,y.filename=t.source,y.line=n,y.column=r,y.source=e,!t.silent)throw y}function l(m){var y=m.exec(e);if(y){var v=y[0];return s(v),e=e.slice(v.length),y}}function c(){l(u2)}function u(m){var y;for(m=m||[];y=f();)y!==!1&&m.push(y);return m}function f(){var m=i();if(!(Yy!=e.charAt(0)||Xy!=e.charAt(1))){for(var y=2;fs!=e.charAt(y)&&(Xy!=e.charAt(y)||Yy!=e.charAt(y+1));)++y;if(y+=2,fs===e.charAt(y-1))return a("End of comment missing");var v=e.slice(2,y-2);return r+=2,s(v),e=e.slice(y),r+=2,m({type:y2,comment:v})}}function p(){var m=i(),y=l(d2);if(y){if(f(),!l(f2))return a("property missing ':'");var v=l(h2),g=m({type:x2,property:Jy(y[0].replace(Qy,fs)),value:v?Jy(v[0].replace(Qy,fs)):fs});return l(p2),g}}function h(){var m=[];u(m);for(var y;y=p();)y!==!1&&(m.push(y),u(m));return m}return c(),h()}function Jy(e){return e?e.replace(m2,fs):fs}var w2=v2,b2=Zl&&Zl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(sm,"__esModule",{value:!0});sm.default=_2;const k2=b2(w2);function _2(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,k2.default)(e),s=typeof t=="function";return r.forEach(i=>{if(i.type!=="declaration")return;const{property:o,value:a}=i;s?t(o,a,i):a&&(n=n||{},n[o]=a)}),n}var mu={};Object.defineProperty(mu,"__esModule",{value:!0});mu.camelCase=void 0;var S2=/^--[a-zA-Z0-9_-]+$/,C2=/-([a-z])/g,j2=/^[^-]+$/,P2=/^-(webkit|moz|ms|o|khtml)-/,E2=/^-(ms)-/,T2=function(e){return!e||j2.test(e)||S2.test(e)},N2=function(e,t){return t.toUpperCase()},Zy=function(e,t){return"".concat(t,"-")},R2=function(e,t){return t===void 0&&(t={}),T2(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(E2,Zy):e=e.replace(P2,Zy),e.replace(C2,N2))};mu.camelCase=R2;var I2=Zl&&Zl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},A2=I2(sm),M2=mu;function ph(e,t){var n={};return!e||typeof e!="string"||(0,A2.default)(e,function(r,s){r&&s&&(n[(0,M2.camelCase)(r,t)]=s)}),n}ph.default=ph;var L2=ph;const D2=qc(L2),Fb=Ob("end"),im=Ob("start");function Ob(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 F2(e){const t=im(e),n=Fb(e);if(t&&n)return{start:t,end:n}}function Do(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?ex(e.position):"start"in e||"end"in e?ex(e):"line"in e||"column"in e?mh(e):""}function mh(e){return tx(e&&e.line)+":"+tx(e&&e.column)}function ex(e){return mh(e&&e.start)+"-"+mh(e&&e.end)}function tx(e){return e&&typeof e=="number"?e:1}class at extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",i={},o=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?s=t:!i.cause&&t&&(o=!0,s=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?i.ruleId=r:(i.source=r.slice(0,l),i.ruleId=r.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const a=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=a?a.line:void 0,this.name=Do(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=o&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}at.prototype.file="";at.prototype.name="";at.prototype.reason="";at.prototype.message="";at.prototype.stack="";at.prototype.column=void 0;at.prototype.line=void 0;at.prototype.ancestors=void 0;at.prototype.cause=void 0;at.prototype.fatal=void 0;at.prototype.place=void 0;at.prototype.ruleId=void 0;at.prototype.source=void 0;const om={}.hasOwnProperty,O2=new Map,z2=/[A-Z]/g,$2=new Set(["table","tbody","thead","tfoot","tr"]),B2=new Set(["td","th"]),zb="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function V2(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=Y2(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=Q2(n,t.jsx,t.jsxs)}const s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?rm:a2,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=$b(s,e,void 0);return i&&typeof i!="string"?i:s.create(e,s.Fragment,{children:i||void 0},void 0)}function $b(e,t,n){if(t.type==="element")return U2(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return W2(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return G2(e,t,n);if(t.type==="mdxjsEsm")return H2(e,t);if(t.type==="root")return K2(e,t,n);if(t.type==="text")return q2(e,t)}function U2(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=rm,e.schema=s),e.ancestors.push(t);const i=Vb(e,t.tagName,!1),o=X2(e,t);let a=lm(e,t);return $2.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!XT(l):!0})),Bb(e,o,i,t),am(o,a),e.ancestors.pop(),e.schema=r,e.create(t,i,o,n)}function W2(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)}da(e,t.position)}function H2(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);da(e,t.position)}function G2(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=rm,e.schema=s),e.ancestors.push(t);const i=t.name===null?e.Fragment:Vb(e,t.name,!0),o=J2(e,t),a=lm(e,t);return Bb(e,o,i,t),am(o,a),e.ancestors.pop(),e.schema=r,e.create(t,i,o,n)}function K2(e,t,n){const r={};return am(r,lm(e,t)),e.create(t,e.Fragment,r,n)}function q2(e,t){return t.value}function Bb(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function am(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Q2(e,t,n){return r;function r(s,i,o,a){const c=Array.isArray(o.children)?n:t;return a?c(i,o,a):c(i,o)}}function Y2(e,t){return n;function n(r,s,i,o){const a=Array.isArray(i.children),l=im(r);return t(s,i,o,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function X2(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&om.call(t.properties,s)){const i=Z2(e,s,t.properties[s]);if(i){const[o,a]=i;e.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&B2.has(t.tagName)?r=a:n[o]=a}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function J2(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const o=i.expression;o.type;const a=o.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else da(e,t.position);else{const s=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,i=e.evaluater.evaluateExpression(a.expression)}else da(e,t.position);else i=r.value===null?!0:r.value;n[s]=i}return n}function lm(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:O2;for(;++r<t.children.length;){const i=t.children[r];let o;if(e.passKeys){const l=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(l){const c=s.get(l)||0;o=l+"-"+c,s.set(l,c+1)}}const a=$b(e,i,o);a!==void 0&&n.push(a)}return n}function Z2(e,t,n){const r=s2(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?GT(n):l2(n)),r.property==="style"){let s=typeof n=="object"?n:eN(e,String(n));return e.stylePropertyNameCase==="css"&&(s=tN(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&r.space?t2[r.property]||r.property:r.attribute,n]}}function eN(e,t){try{return D2(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,s=new at("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=zb+"#cannot-parse-style-attribute",s}}function Vb(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let i=-1,o;for(;++i<s.length;){const a=Hy(s[i])?{type:"Identifier",name:s[i]}:{type:"Literal",value:s[i]};o=o?{type:"MemberExpression",object:o,property:a,computed:!!(i&&a.type==="Literal"),optional:!1}:a}r=o}else r=Hy(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const s=r.value;return om.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(r);da(e)}function da(e,t){const n=new at("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=zb+"#cannot-handle-mdx-estrees-without-createevaluater",n}function tN(e){const t={};let n;for(n in e)om.call(e,n)&&(t[nN(n)]=e[n]);return t}function nN(e){let t=e.replace(z2,rN);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function rN(e){return"-"+e.toLowerCase()}const xd={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"]},sN={};function iN(e,t){const n=sN,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Ub(e,r,s)}function Ub(e,t,n){if(oN(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 nx(e.children,t,n)}return Array.isArray(e)?nx(e,t,n):""}function nx(e,t,n){const r=[];let s=-1;for(;++s<e.length;)r[s]=Ub(e[s],t,n);return r.join("")}function oN(e){return!!(e&&typeof e=="object")}const rx=document.createElement("i");function cm(e){const t="&"+e+";";rx.innerHTML=t;const n=rx.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Dn(e,t,n,r){const s=e.length;let i=0,o;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);i<r.length;)o=r.slice(i,i+1e4),o.unshift(t,0),e.splice(...o),i+=1e4,t+=1e4}function Xt(e,t){return e.length>0?(Dn(e,e.length,0,t),e):t}const sx={}.hasOwnProperty;function aN(e){const t={};let n=-1;for(;++n<e.length;)lN(t,e[n]);return t}function lN(e,t){let n;for(n in t){const s=(sx.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let o;if(i)for(o in i){sx.call(s,o)||(s[o]=[]);const a=i[o];cN(s[o],Array.isArray(a)?a:a?[a]:[])}}}function cN(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Dn(e,0,0,r)}function Wb(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 vi(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const In=Qr(/[A-Za-z]/),Lt=Qr(/[\dA-Za-z]/),uN=Qr(/[#-'*+\--9=?A-Z^-~]/);function gh(e){return e!==null&&(e<32||e===127)}const yh=Qr(/\d/),dN=Qr(/[\dA-Fa-f]/),fN=Qr(/[!-/:-@[-`{-~]/);function Z(e){return e!==null&&e<-2}function _t(e){return e!==null&&(e<0||e===32)}function le(e){return e===-2||e===-1||e===32}const hN=Qr(new RegExp("\\p{P}|\\p{S}","u")),pN=Qr(/\s/);function Qr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function zi(e){const t=[];let n=-1,r=0,s=0;for(;++n<e.length;){const i=e.charCodeAt(n);let o="";if(i===37&&Lt(e.charCodeAt(n+1))&&Lt(e.charCodeAt(n+2)))s=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(o=String.fromCharCode(i));else if(i>55295&&i<57344){const a=e.charCodeAt(n+1);i<56320&&a>56319&&a<57344?(o=String.fromCharCode(i,a),s=1):o="�"}else o=String.fromCharCode(i);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+s+1,o=""),s&&(n+=s,s=0)}return t.join("")+e.slice(r)}function be(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return o;function o(l){return le(l)?(e.enter(n),a(l)):t(l)}function a(l){return le(l)&&i++<s?(e.consume(l),a):(e.exit(n),t(l))}}const mN={tokenize:gN};function gN(e){const t=e.attempt(this.parser.constructs.contentInitial,r,s);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),be(e,t,"linePrefix")}function s(a){return e.enter("paragraph"),i(a)}function i(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,o(a)}function o(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return Z(a)?(e.consume(a),e.exit("chunkText"),i):(e.consume(a),o)}}const yN={tokenize:xN},ix={tokenize:vN};function xN(e){const t=this,n=[];let r=0,s,i,o;return a;function a(w){if(r<n.length){const k=n[r];return t.containerState=k[1],e.attempt(k[0].continuation,l,c)(w)}return c(w)}function l(w){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&x();const k=t.events.length;let j=k,_;for(;j--;)if(t.events[j][0]==="exit"&&t.events[j][1].type==="chunkFlow"){_=t.events[j][1].end;break}g(r);let S=k;for(;S<t.events.length;)t.events[S][1].end={..._},S++;return Dn(t.events,j+1,0,t.events.slice(k)),t.events.length=S,c(w)}return a(w)}function c(w){if(r===n.length){if(!s)return p(w);if(s.currentConstruct&&s.currentConstruct.concrete)return m(w);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(ix,u,f)(w)}function u(w){return s&&x(),g(r),p(w)}function f(w){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(w)}function p(w){return t.containerState={},e.attempt(ix,h,m)(w)}function h(w){return r++,n.push([t.currentConstruct,t.containerState]),p(w)}function m(w){if(w===null){s&&x(),g(0),e.consume(w);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:i}),y(w)}function y(w){if(w===null){v(e.exit("chunkFlow"),!0),g(0),e.consume(w);return}return Z(w)?(e.consume(w),v(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(w),y)}function v(w,k){const j=t.sliceStream(w);if(k&&j.push(null),w.previous=i,i&&(i.next=w),i=w,s.defineSkip(w.start),s.write(j),t.parser.lazy[w.start.line]){let _=s.events.length;for(;_--;)if(s.events[_][1].start.offset<o&&(!s.events[_][1].end||s.events[_][1].end.offset>o))return;const S=t.events.length;let P=S,T,E;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){if(T){E=t.events[P][1].end;break}T=!0}for(g(r),_=S;_<t.events.length;)t.events[_][1].end={...E},_++;Dn(t.events,P+1,0,t.events.slice(S)),t.events.length=_}}function g(w){let k=n.length;for(;k-- >w;){const j=n[k];t.containerState=j[1],j[0].exit.call(t,e)}n.length=w}function x(){s.write([null]),i=void 0,s=void 0,t.containerState._closeFlow=void 0}}function vN(e,t,n){return be(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ox(e){if(e===null||_t(e)||pN(e))return 1;if(hN(e))return 2}function um(e,t,n){const r=[];let s=-1;for(;++s<e.length;){const i=e[s].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const xh={name:"attention",resolveAll:wN,tokenize:bN};function wN(e,t){let n=-1,r,s,i,o,a,l,c,u;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[r][1].end},p={...e[n][1].start};ax(f,-l),ax(p,l),o={type:l>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},i={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},s={type:l>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},e[r][1].end={...o.start},e[n][1].start={...a.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=Xt(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Xt(c,[["enter",s,t],["enter",o,t],["exit",o,t],["enter",i,t]]),c=Xt(c,um(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=Xt(c,[["exit",i,t],["enter",a,t],["exit",a,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=Xt(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,Dn(e,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function bN(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=ox(r);let i;return o;function o(l){return i=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===i)return e.consume(l),a;const c=e.exit("attentionSequence"),u=ox(l),f=!u||u===2&&s||n.includes(l),p=!s||s===2&&u||n.includes(r);return c._open=!!(i===42?f:f&&(s||!p)),c._close=!!(i===42?p:p&&(u||!f)),t(l)}}function ax(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const kN={name:"autolink",tokenize:_N};function _N(e,t,n){let r=0;return s;function s(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(h){return In(h)?(e.consume(h),o):h===64?n(h):c(h)}function o(h){return h===43||h===45||h===46||Lt(h)?(r=1,a(h)):c(h)}function a(h){return h===58?(e.consume(h),r=0,l):(h===43||h===45||h===46||Lt(h))&&r++<32?(e.consume(h),a):(r=0,c(h))}function l(h){return h===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):h===null||h===32||h===60||gh(h)?n(h):(e.consume(h),l)}function c(h){return h===64?(e.consume(h),u):uN(h)?(e.consume(h),c):n(h)}function u(h){return Lt(h)?f(h):n(h)}function f(h){return h===46?(e.consume(h),r=0,u):h===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):p(h)}function p(h){if((h===45||Lt(h))&&r++<63){const m=h===45?p:f;return e.consume(h),m}return n(h)}}const gu={partial:!0,tokenize:SN};function SN(e,t,n){return r;function r(i){return le(i)?be(e,s,"linePrefix")(i):s(i)}function s(i){return i===null||Z(i)?t(i):n(i)}}const Hb={continuation:{tokenize:jN},exit:PN,name:"blockQuote",tokenize:CN};function CN(e,t,n){const r=this;return s;function s(o){if(o===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),i}return n(o)}function i(o){return le(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function jN(e,t,n){const r=this;return s;function s(o){return le(o)?be(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):i(o)}function i(o){return e.attempt(Hb,t,n)(o)}}function PN(e){e.exit("blockQuote")}const Gb={name:"characterEscape",tokenize:EN};function EN(e,t,n){return r;function r(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),s}function s(i){return fN(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const Kb={name:"characterReference",tokenize:TN};function TN(e,t,n){const r=this;let s=0,i,o;return a;function a(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),l}function l(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),i=31,o=Lt,u(f))}function c(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,o=dN,u):(e.enter("characterReferenceValue"),i=7,o=yh,u(f))}function u(f){if(f===59&&s){const p=e.exit("characterReferenceValue");return o===Lt&&!cm(r.sliceSerialize(p))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(f)&&s++<i?(e.consume(f),u):n(f)}}const lx={partial:!0,tokenize:RN},cx={concrete:!0,name:"codeFenced",tokenize:NN};function NN(e,t,n){const r=this,s={partial:!0,tokenize:j};let i=0,o=0,a;return l;function l(_){return c(_)}function c(_){const S=r.events[r.events.length-1];return i=S&&S[1].type==="linePrefix"?S[2].sliceSerialize(S[1],!0).length:0,a=_,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(_)}function u(_){return _===a?(o++,e.consume(_),u):o<3?n(_):(e.exit("codeFencedFenceSequence"),le(_)?be(e,f,"whitespace")(_):f(_))}function f(_){return _===null||Z(_)?(e.exit("codeFencedFence"),r.interrupt?t(_):e.check(lx,y,k)(_)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(_))}function p(_){return _===null||Z(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(_)):le(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),be(e,h,"whitespace")(_)):_===96&&_===a?n(_):(e.consume(_),p)}function h(_){return _===null||Z(_)?f(_):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(_))}function m(_){return _===null||Z(_)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(_)):_===96&&_===a?n(_):(e.consume(_),m)}function y(_){return e.attempt(s,k,v)(_)}function v(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),g}function g(_){return i>0&&le(_)?be(e,x,"linePrefix",i+1)(_):x(_)}function x(_){return _===null||Z(_)?e.check(lx,y,k)(_):(e.enter("codeFlowValue"),w(_))}function w(_){return _===null||Z(_)?(e.exit("codeFlowValue"),x(_)):(e.consume(_),w)}function k(_){return e.exit("codeFenced"),t(_)}function j(_,S,P){let T=0;return E;function E(N){return _.enter("lineEnding"),_.consume(N),_.exit("lineEnding"),I}function I(N){return _.enter("codeFencedFence"),le(N)?be(_,A,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):A(N)}function A(N){return N===a?(_.enter("codeFencedFenceSequence"),O(N)):P(N)}function O(N){return N===a?(T++,_.consume(N),O):T>=o?(_.exit("codeFencedFenceSequence"),le(N)?be(_,M,"whitespace")(N):M(N)):P(N)}function M(N){return N===null||Z(N)?(_.exit("codeFencedFence"),S(N)):P(N)}}}function RN(e,t,n){const r=this;return s;function s(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i)}function i(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const vd={name:"codeIndented",tokenize:AN},IN={partial:!0,tokenize:MN};function AN(e,t,n){const r=this;return s;function s(c){return e.enter("codeIndented"),be(e,i,"linePrefix",5)(c)}function i(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?o(c):n(c)}function o(c){return c===null?l(c):Z(c)?e.attempt(IN,o,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||Z(c)?(e.exit("codeFlowValue"),o(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function MN(e,t,n){const r=this;return s;function s(o){return r.parser.lazy[r.now().line]?n(o):Z(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):be(e,i,"linePrefix",5)(o)}function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):Z(o)?s(o):n(o)}}const LN={name:"codeText",previous:FN,resolve:DN,tokenize:ON};function DN(e){let t=e.length-4,n=3,r,s;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)s===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(s=r):(r===t||e[r][1].type==="lineEnding")&&(e[s][1].type="codeTextData",r!==s+2&&(e[s][1].end=e[r-1][1].end,e.splice(s+2,r-s-2),t-=r-s-2,r=s+2),s=void 0);return e}function FN(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function ON(e,t,n){let r=0,s,i;return o;function o(f){return e.enter("codeText"),e.enter("codeTextSequence"),a(f)}function a(f){return f===96?(e.consume(f),r++,a):(e.exit("codeTextSequence"),l(f))}function l(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),l):f===96?(i=e.enter("codeTextSequence"),s=0,u(f)):Z(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(f))}function c(f){return f===null||f===32||f===96||Z(f)?(e.exit("codeTextData"),l(f)):(e.consume(f),c)}function u(f){return f===96?(e.consume(f),s++,u):s===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(i.type="codeTextData",c(f))}}class zN{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const s=n||0;this.setCursor(Math.trunc(t));const i=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&co(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),co(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),co(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);co(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);co(this.left,n.reverse())}}}function co(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 qb(e){const t={};let n=-1,r,s,i,o,a,l,c;const u=new zN(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type==="chunkFlow"&&u.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,i=0,i<l.length&&l[i][1].type==="lineEndingBlank"&&(i+=2),i<l.length&&l[i][1].type==="content"))for(;++i<l.length&&l[i][1].type!=="content";)l[i][1].type==="chunkText"&&(l[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,$N(u,n)),n=t[n],c=!0);else if(r[1]._container){for(i=n,s=void 0;i--;)if(o=u.get(i),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(s&&(u.get(s)[1].type="lineEndingBlank"),o[1].type="lineEnding",s=i);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;s&&(r[1].end={...u.get(s)[1].start},a=u.slice(s,n),a.unshift(r),u.splice(s,n-s+1,a))}}return Dn(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function $N(e,t){const n=e.get(t)[1],r=e.get(t)[2];let s=t-1;const i=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const a=o.events,l=[],c={};let u,f,p=-1,h=n,m=0,y=0;const v=[y];for(;h;){for(;e.get(++s)[1]!==h;);i.push(s),h._tokenizer||(u=r.sliceStream(h),h.next||u.push(null),f&&o.defineSkip(h.start),h._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),h._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),f=h,h=h.next}for(h=n;++p<a.length;)a[p][0]==="exit"&&a[p-1][0]==="enter"&&a[p][1].type===a[p-1][1].type&&a[p][1].start.line!==a[p][1].end.line&&(y=p+1,v.push(y),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(o.events=[],h?(h._tokenizer=void 0,h.previous=void 0):v.pop(),p=v.length;p--;){const g=a.slice(v[p],v[p+1]),x=i.pop();l.push([x,x+g.length-1]),e.splice(x,2,g)}for(l.reverse(),p=-1;++p<l.length;)c[m+l[p][0]]=m+l[p][1],m+=l[p][1]-l[p][0]-1;return c}const BN={resolve:UN,tokenize:WN},VN={partial:!0,tokenize:HN};function UN(e){return qb(e),e}function WN(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(a)}function s(a){return a===null?i(a):Z(a)?e.check(VN,o,i)(a):(e.consume(a),s)}function i(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function o(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function HN(e,t,n){const r=this;return s;function s(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),be(e,i,"linePrefix")}function i(o){if(o===null||Z(o))return n(o);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function Qb(e,t,n,r,s,i,o,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return f;function f(g){return g===60?(e.enter(r),e.enter(s),e.enter(i),e.consume(g),e.exit(i),p):g===null||g===32||g===41||gh(g)?n(g):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),y(g))}function p(g){return g===62?(e.enter(i),e.consume(g),e.exit(i),e.exit(s),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),h(g))}function h(g){return g===62?(e.exit("chunkString"),e.exit(a),p(g)):g===null||g===60||Z(g)?n(g):(e.consume(g),g===92?m:h)}function m(g){return g===60||g===62||g===92?(e.consume(g),h):h(g)}function y(g){return!u&&(g===null||g===41||_t(g))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),t(g)):u<c&&g===40?(e.consume(g),u++,y):g===41?(e.consume(g),u--,y):g===null||g===32||g===40||gh(g)?n(g):(e.consume(g),g===92?v:y)}function v(g){return g===40||g===41||g===92?(e.consume(g),y):y(g)}}function Yb(e,t,n,r,s,i){const o=this;let a=0,l;return c;function c(h){return e.enter(r),e.enter(s),e.consume(h),e.exit(s),e.enter(i),u}function u(h){return a>999||h===null||h===91||h===93&&!l||h===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?n(h):h===93?(e.exit(i),e.enter(s),e.consume(h),e.exit(s),e.exit(r),t):Z(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===null||h===91||h===93||Z(h)||a++>999?(e.exit("chunkString"),u(h)):(e.consume(h),l||(l=!le(h)),h===92?p:f)}function p(h){return h===91||h===92||h===93?(e.consume(h),a++,f):f(h)}}function Xb(e,t,n,r,s,i){let o;return a;function a(p){return p===34||p===39||p===40?(e.enter(r),e.enter(s),e.consume(p),e.exit(s),o=p===40?41:p,l):n(p)}function l(p){return p===o?(e.enter(s),e.consume(p),e.exit(s),e.exit(r),t):(e.enter(i),c(p))}function c(p){return p===o?(e.exit(i),l(o)):p===null?n(p):Z(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),be(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(p))}function u(p){return p===o||p===null||Z(p)?(e.exit("chunkString"),c(p)):(e.consume(p),p===92?f:u)}function f(p){return p===o||p===92?(e.consume(p),u):u(p)}}function Fo(e,t){let n;return r;function r(s){return Z(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):le(s)?be(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const GN={name:"definition",tokenize:qN},KN={partial:!0,tokenize:QN};function qN(e,t,n){const r=this;let s;return i;function i(h){return e.enter("definition"),o(h)}function o(h){return Yb.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return s=vi(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),l):n(h)}function l(h){return _t(h)?Fo(e,c)(h):c(h)}function c(h){return Qb(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function u(h){return e.attempt(KN,f,f)(h)}function f(h){return le(h)?be(e,p,"whitespace")(h):p(h)}function p(h){return h===null||Z(h)?(e.exit("definition"),r.parser.defined.push(s),t(h)):n(h)}}function QN(e,t,n){return r;function r(a){return _t(a)?Fo(e,s)(a):n(a)}function s(a){return Xb(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function i(a){return le(a)?be(e,o,"whitespace")(a):o(a)}function o(a){return a===null||Z(a)?t(a):n(a)}}const YN={name:"hardBreakEscape",tokenize:XN};function XN(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),s}function s(i){return Z(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const JN={name:"headingAtx",resolve:ZN,tokenize:eR};function ZN(e,t){let n=e.length-2,r=3,s,i;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},i={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Dn(e,r,n-r+1,[["enter",s,t],["enter",i,t],["exit",i,t],["exit",s,t]])),e}function eR(e,t,n){let r=0;return s;function s(u){return e.enter("atxHeading"),i(u)}function i(u){return e.enter("atxHeadingSequence"),o(u)}function o(u){return u===35&&r++<6?(e.consume(u),o):u===null||_t(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||Z(u)?(e.exit("atxHeading"),t(u)):le(u)?be(e,a,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),a(u))}function c(u){return u===null||u===35||_t(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const tR=["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"],ux=["pre","script","style","textarea"],nR={concrete:!0,name:"htmlFlow",resolveTo:iR,tokenize:oR},rR={partial:!0,tokenize:lR},sR={partial:!0,tokenize:aR};function iR(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 oR(e,t,n){const r=this;let s,i,o,a,l;return c;function c(R){return u(R)}function u(R){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(R),f}function f(R){return R===33?(e.consume(R),p):R===47?(e.consume(R),i=!0,y):R===63?(e.consume(R),s=3,r.interrupt?t:C):In(R)?(e.consume(R),o=String.fromCharCode(R),v):n(R)}function p(R){return R===45?(e.consume(R),s=2,h):R===91?(e.consume(R),s=5,a=0,m):In(R)?(e.consume(R),s=4,r.interrupt?t:C):n(R)}function h(R){return R===45?(e.consume(R),r.interrupt?t:C):n(R)}function m(R){const ce="CDATA[";return R===ce.charCodeAt(a++)?(e.consume(R),a===ce.length?r.interrupt?t:A:m):n(R)}function y(R){return In(R)?(e.consume(R),o=String.fromCharCode(R),v):n(R)}function v(R){if(R===null||R===47||R===62||_t(R)){const ce=R===47,pe=o.toLowerCase();return!ce&&!i&&ux.includes(pe)?(s=1,r.interrupt?t(R):A(R)):tR.includes(o.toLowerCase())?(s=6,ce?(e.consume(R),g):r.interrupt?t(R):A(R)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(R):i?x(R):w(R))}return R===45||Lt(R)?(e.consume(R),o+=String.fromCharCode(R),v):n(R)}function g(R){return R===62?(e.consume(R),r.interrupt?t:A):n(R)}function x(R){return le(R)?(e.consume(R),x):E(R)}function w(R){return R===47?(e.consume(R),E):R===58||R===95||In(R)?(e.consume(R),k):le(R)?(e.consume(R),w):E(R)}function k(R){return R===45||R===46||R===58||R===95||Lt(R)?(e.consume(R),k):j(R)}function j(R){return R===61?(e.consume(R),_):le(R)?(e.consume(R),j):w(R)}function _(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(e.consume(R),l=R,S):le(R)?(e.consume(R),_):P(R)}function S(R){return R===l?(e.consume(R),l=null,T):R===null||Z(R)?n(R):(e.consume(R),S)}function P(R){return R===null||R===34||R===39||R===47||R===60||R===61||R===62||R===96||_t(R)?j(R):(e.consume(R),P)}function T(R){return R===47||R===62||le(R)?w(R):n(R)}function E(R){return R===62?(e.consume(R),I):n(R)}function I(R){return R===null||Z(R)?A(R):le(R)?(e.consume(R),I):n(R)}function A(R){return R===45&&s===2?(e.consume(R),z):R===60&&s===1?(e.consume(R),V):R===62&&s===4?(e.consume(R),$):R===63&&s===3?(e.consume(R),C):R===93&&s===5?(e.consume(R),B):Z(R)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(rR,Q,O)(R)):R===null||Z(R)?(e.exit("htmlFlowData"),O(R)):(e.consume(R),A)}function O(R){return e.check(sR,M,Q)(R)}function M(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),N}function N(R){return R===null||Z(R)?O(R):(e.enter("htmlFlowData"),A(R))}function z(R){return R===45?(e.consume(R),C):A(R)}function V(R){return R===47?(e.consume(R),o="",L):A(R)}function L(R){if(R===62){const ce=o.toLowerCase();return ux.includes(ce)?(e.consume(R),$):A(R)}return In(R)&&o.length<8?(e.consume(R),o+=String.fromCharCode(R),L):A(R)}function B(R){return R===93?(e.consume(R),C):A(R)}function C(R){return R===62?(e.consume(R),$):R===45&&s===2?(e.consume(R),C):A(R)}function $(R){return R===null||Z(R)?(e.exit("htmlFlowData"),Q(R)):(e.consume(R),$)}function Q(R){return e.exit("htmlFlow"),t(R)}}function aR(e,t,n){const r=this;return s;function s(o){return Z(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):n(o)}function i(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function lR(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(gu,t,n)}}const cR={name:"htmlText",tokenize:uR};function uR(e,t,n){const r=this;let s,i,o;return a;function a(C){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(C),l}function l(C){return C===33?(e.consume(C),c):C===47?(e.consume(C),j):C===63?(e.consume(C),w):In(C)?(e.consume(C),P):n(C)}function c(C){return C===45?(e.consume(C),u):C===91?(e.consume(C),i=0,m):In(C)?(e.consume(C),x):n(C)}function u(C){return C===45?(e.consume(C),h):n(C)}function f(C){return C===null?n(C):C===45?(e.consume(C),p):Z(C)?(o=f,V(C)):(e.consume(C),f)}function p(C){return C===45?(e.consume(C),h):f(C)}function h(C){return C===62?z(C):C===45?p(C):f(C)}function m(C){const $="CDATA[";return C===$.charCodeAt(i++)?(e.consume(C),i===$.length?y:m):n(C)}function y(C){return C===null?n(C):C===93?(e.consume(C),v):Z(C)?(o=y,V(C)):(e.consume(C),y)}function v(C){return C===93?(e.consume(C),g):y(C)}function g(C){return C===62?z(C):C===93?(e.consume(C),g):y(C)}function x(C){return C===null||C===62?z(C):Z(C)?(o=x,V(C)):(e.consume(C),x)}function w(C){return C===null?n(C):C===63?(e.consume(C),k):Z(C)?(o=w,V(C)):(e.consume(C),w)}function k(C){return C===62?z(C):w(C)}function j(C){return In(C)?(e.consume(C),_):n(C)}function _(C){return C===45||Lt(C)?(e.consume(C),_):S(C)}function S(C){return Z(C)?(o=S,V(C)):le(C)?(e.consume(C),S):z(C)}function P(C){return C===45||Lt(C)?(e.consume(C),P):C===47||C===62||_t(C)?T(C):n(C)}function T(C){return C===47?(e.consume(C),z):C===58||C===95||In(C)?(e.consume(C),E):Z(C)?(o=T,V(C)):le(C)?(e.consume(C),T):z(C)}function E(C){return C===45||C===46||C===58||C===95||Lt(C)?(e.consume(C),E):I(C)}function I(C){return C===61?(e.consume(C),A):Z(C)?(o=I,V(C)):le(C)?(e.consume(C),I):T(C)}function A(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(e.consume(C),s=C,O):Z(C)?(o=A,V(C)):le(C)?(e.consume(C),A):(e.consume(C),M)}function O(C){return C===s?(e.consume(C),s=void 0,N):C===null?n(C):Z(C)?(o=O,V(C)):(e.consume(C),O)}function M(C){return C===null||C===34||C===39||C===60||C===61||C===96?n(C):C===47||C===62||_t(C)?T(C):(e.consume(C),M)}function N(C){return C===47||C===62||_t(C)?T(C):n(C)}function z(C){return C===62?(e.consume(C),e.exit("htmlTextData"),e.exit("htmlText"),t):n(C)}function V(C){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),L}function L(C){return le(C)?be(e,B,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):B(C)}function B(C){return e.enter("htmlTextData"),o(C)}}const dm={name:"labelEnd",resolveAll:pR,resolveTo:mR,tokenize:gR},dR={tokenize:yR},fR={tokenize:xR},hR={tokenize:vR};function pR(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const s=r.type==="labelImage"?4:2;r.type="data",t+=s}}return e.length!==n.length&&Dn(e,0,e.length,n),e}function mR(e,t){let n=e.length,r=0,s,i,o,a;for(;n--;)if(s=e[n][1],i){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(i=n,s.type!=="labelLink")){r=2;break}}else s.type==="labelEnd"&&(o=n);const l={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[i][1].start},end:{...e[o][1].end}},u={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[o-2][1].start}};return a=[["enter",l,t],["enter",c,t]],a=Xt(a,e.slice(i+1,i+r+3)),a=Xt(a,[["enter",u,t]]),a=Xt(a,um(t.parser.constructs.insideSpan.null,e.slice(i+r+4,o-3),t)),a=Xt(a,[["exit",u,t],e[o-2],e[o-1],["exit",c,t]]),a=Xt(a,e.slice(o+1)),a=Xt(a,[["exit",l,t]]),Dn(e,i,e.length,a),e}function gR(e,t,n){const r=this;let s=r.events.length,i,o;for(;s--;)if((r.events[s][1].type==="labelImage"||r.events[s][1].type==="labelLink")&&!r.events[s][1]._balanced){i=r.events[s][1];break}return a;function a(p){return i?i._inactive?f(p):(o=r.parser.defined.includes(vi(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),l):n(p)}function l(p){return p===40?e.attempt(dR,u,o?u:f)(p):p===91?e.attempt(fR,u,o?c:f)(p):o?u(p):f(p)}function c(p){return e.attempt(hR,u,f)(p)}function u(p){return t(p)}function f(p){return i._balanced=!0,n(p)}}function yR(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),s}function s(f){return _t(f)?Fo(e,i)(f):i(f)}function i(f){return f===41?u(f):Qb(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function o(f){return _t(f)?Fo(e,l)(f):u(f)}function a(f){return n(f)}function l(f){return f===34||f===39||f===40?Xb(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):u(f)}function c(f){return _t(f)?Fo(e,u)(f):u(f)}function u(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function xR(e,t,n){const r=this;return s;function s(a){return Yb.call(r,e,i,o,"reference","referenceMarker","referenceString")(a)}function i(a){return r.parser.defined.includes(vi(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function o(a){return n(a)}}function vR(e,t,n){return r;function r(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),s}function s(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):n(i)}}const wR={name:"labelStartImage",resolveAll:dm.resolveAll,tokenize:bR};function bR(e,t,n){const r=this;return s;function s(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),i}function i(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),o):n(a)}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const kR={name:"labelStartLink",resolveAll:dm.resolveAll,tokenize:_R};function _R(e,t,n){const r=this;return s;function s(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),i}function i(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const wd={name:"lineEnding",tokenize:SR};function SR(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),be(e,t,"linePrefix")}}const $l={name:"thematicBreak",tokenize:CR};function CR(e,t,n){let r=0,s;return i;function i(c){return e.enter("thematicBreak"),o(c)}function o(c){return s=c,a(c)}function a(c){return c===s?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||Z(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===s?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),le(c)?be(e,a,"whitespace")(c):a(c))}}const gt={continuation:{tokenize:TR},exit:RR,name:"list",tokenize:ER},jR={partial:!0,tokenize:IR},PR={partial:!0,tokenize:NR};function ER(e,t,n){const r=this,s=r.events[r.events.length-1];let i=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,o=0;return a;function a(h){const m=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:yh(h)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check($l,n,c)(h):c(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(h)}return n(h)}function l(h){return yh(h)&&++o<10?(e.consume(h),l):(!r.interrupt||o<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),c(h)):n(h)}function c(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(gu,r.interrupt?n:u,e.attempt(jR,p,f))}function u(h){return r.containerState.initialBlankLine=!0,i++,p(h)}function f(h){return le(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),p):n(h)}function p(h){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function TR(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(gu,s,i);function s(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,be(e,t,"listItemIndent",r.containerState.size+1)(a)}function i(a){return r.containerState.furtherBlankLines||!le(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(PR,t,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,be(e,e.attempt(gt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function NR(e,t,n){const r=this;return be(e,s,"listItemIndent",r.containerState.size+1);function s(i){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(i):n(i)}}function RR(e){e.exit(this.containerState.type)}function IR(e,t,n){const r=this;return be(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(i){const o=r.events[r.events.length-1];return!le(i)&&o&&o[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const dx={name:"setextUnderline",resolveTo:AR,tokenize:MR};function AR(e,t){let n=e.length,r,s,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",i?(e.splice(s,0,["enter",o,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end={...e[i][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function MR(e,t,n){const r=this;let s;return i;function i(c){let u=r.events.length,f;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){f=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),s=c,o(c)):n(c)}function o(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===s?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),le(c)?be(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||Z(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const LR={tokenize:DR};function DR(e){const t=this,n=e.attempt(gu,r,e.attempt(this.parser.constructs.flowInitial,s,be(e,e.attempt(this.parser.constructs.flow,s,e.attempt(BN,s)),"linePrefix")));return n;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const FR={resolveAll:Zb()},OR=Jb("string"),zR=Jb("text");function Jb(e){return{resolveAll:Zb(e==="text"?$R:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],i=n.attempt(s,o,a);return o;function o(u){return c(u)?i(u):a(u)}function a(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),i(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const f=s[u];let p=-1;if(f)for(;++p<f.length;){const h=f[p];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function Zb(e){return t;function t(n,r){let s=-1,i;for(;++s<=n.length;)i===void 0?n[s]&&n[s][1].type==="data"&&(i=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==i+2&&(n[i][1].end=n[s-1][1].end,n.splice(i+2,s-i-2),s=i+2),i=void 0);return e?e(n,r):n}}function $R(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],s=t.sliceStream(r);let i=s.length,o=-1,a=0,l;for(;i--;){const c=s[i];if(typeof c=="string"){for(o=c.length;c.charCodeAt(o-1)===32;)a++,o--;if(o)break;o=-1}else if(c===-2)l=!0,a++;else if(c!==-1){i++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const c={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?o:r.start._bufferIndex+o,_index:r.start._index+i,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const BR={42:gt,43:gt,45:gt,48:gt,49:gt,50:gt,51:gt,52:gt,53:gt,54:gt,55:gt,56:gt,57:gt,62:Hb},VR={91:GN},UR={[-2]:vd,[-1]:vd,32:vd},WR={35:JN,42:$l,45:[dx,$l],60:nR,61:dx,95:$l,96:cx,126:cx},HR={38:Kb,92:Gb},GR={[-5]:wd,[-4]:wd,[-3]:wd,33:wR,38:Kb,42:xh,60:[kN,cR],91:kR,92:[YN,Gb],93:dm,95:xh,96:LN},KR={null:[xh,FR]},qR={null:[42,95]},QR={null:[]},YR=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:qR,contentInitial:VR,disable:QR,document:BR,flow:WR,flowInitial:UR,insideSpan:KR,string:HR,text:GR},Symbol.toStringTag,{value:"Module"}));function XR(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const s={},i=[];let o=[],a=[];const l={attempt:S(j),check:S(_),consume:x,enter:w,exit:k,interrupt:S(_,{interrupt:!0})},c={code:null,containerState:{},defineSkip:y,events:[],now:m,parser:e,previous:null,sliceSerialize:p,sliceStream:h,write:f};let u=t.tokenize.call(c,l);return t.resolveAll&&i.push(t),c;function f(I){return o=Xt(o,I),v(),o[o.length-1]!==null?[]:(P(t,0),c.events=um(i,c.events,c),c.events)}function p(I,A){return ZR(h(I),A)}function h(I){return JR(o,I)}function m(){const{_bufferIndex:I,_index:A,line:O,column:M,offset:N}=r;return{_bufferIndex:I,_index:A,line:O,column:M,offset:N}}function y(I){s[I.line]=I.column,E()}function v(){let I;for(;r._index<o.length;){const A=o[r._index];if(typeof A=="string")for(I=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===I&&r._bufferIndex<A.length;)g(A.charCodeAt(r._bufferIndex));else g(A)}}function g(I){u=u(I)}function x(I){Z(I)?(r.line++,r.column=1,r.offset+=I===-3?2:1,E()):I!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=I}function w(I,A){const O=A||{};return O.type=I,O.start=m(),c.events.push(["enter",O,c]),a.push(O),O}function k(I){const A=a.pop();return A.end=m(),c.events.push(["exit",A,c]),A}function j(I,A){P(I,A.from)}function _(I,A){A.restore()}function S(I,A){return O;function O(M,N,z){let V,L,B,C;return Array.isArray(M)?Q(M):"tokenize"in M?Q([M]):$(M);function $(fe){return Et;function Et(Ge){const Wt=Ge!==null&&fe[Ge],wn=Ge!==null&&fe.null,zn=[...Array.isArray(Wt)?Wt:Wt?[Wt]:[],...Array.isArray(wn)?wn:wn?[wn]:[]];return Q(zn)(Ge)}}function Q(fe){return V=fe,L=0,fe.length===0?z:R(fe[L])}function R(fe){return Et;function Et(Ge){return C=T(),B=fe,fe.partial||(c.currentConstruct=fe),fe.name&&c.parser.constructs.disable.null.includes(fe.name)?pe():fe.tokenize.call(A?Object.assign(Object.create(c),A):c,l,ce,pe)(Ge)}}function ce(fe){return I(B,C),N}function pe(fe){return C.restore(),++L<V.length?R(V[L]):z}}}function P(I,A){I.resolveAll&&!i.includes(I)&&i.push(I),I.resolve&&Dn(c.events,A,c.events.length-A,I.resolve(c.events.slice(A),c)),I.resolveTo&&(c.events=I.resolveTo(c.events,c))}function T(){const I=m(),A=c.previous,O=c.currentConstruct,M=c.events.length,N=Array.from(a);return{from:M,restore:z};function z(){r=I,c.previous=A,c.currentConstruct=O,c.events.length=M,a=N,E()}}function E(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function JR(e,t){const n=t.start._index,r=t.start._bufferIndex,s=t.end._index,i=t.end._bufferIndex;let o;if(n===s)o=[e[n].slice(r,i)];else{if(o=e.slice(n,s),r>-1){const a=o[0];typeof a=="string"?o[0]=a.slice(r):o.shift()}i>0&&o.push(e[s].slice(0,i))}return o}function ZR(e,t){let n=-1;const r=[];let s;for(;++n<e.length;){const i=e[n];let o;if(typeof i=="string")o=i;else switch(i){case-5:{o="\r";break}case-4:{o=`
|
|
59
|
+
`;break}case-3:{o=`\r
|
|
60
|
+
`;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&s)continue;o=" ";break}default:o=String.fromCharCode(i)}s=i===-2,r.push(o)}return r.join("")}function eI(e){const r={constructs:aN([YR,...(e||{}).extensions||[]]),content:s(mN),defined:[],document:s(yN),flow:s(LR),lazy:{},string:s(OR),text:s(zR)};return r;function s(i){return o;function o(a){return XR(r,i,a)}}}function tI(e){for(;!qb(e););return e}const fx=/[\0\t\n\r]/g;function nI(){let e=1,t="",n=!0,r;return s;function s(i,o,a){const l=[];let c,u,f,p,h;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(o||void 0).decode(i)),f=0,t="",n&&(i.charCodeAt(0)===65279&&f++,n=void 0);f<i.length;){if(fx.lastIndex=f,c=fx.exec(i),p=c&&c.index!==void 0?c.index:i.length,h=i.charCodeAt(p),!c){t=i.slice(f);break}if(h===10&&f===p&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),f<p&&(l.push(i.slice(f,p)),e+=p-f),h){case 0:{l.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,l.push(-2);e++<u;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}f=p+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const rI=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function sI(e){return e.replace(rI,iI)}function iI(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),i=s===120||s===88;return Wb(n.slice(i?2:1),i?16:10)}return cm(n)||e}const ek={}.hasOwnProperty;function oI(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),aI(n)(tI(eI(n).document().write(nI()(e,t,!0))))}function aI(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(zs),autolinkProtocol:T,autolinkEmail:T,atxHeading:i(Aa),blockQuote:i(wn),characterEscape:T,characterReference:T,codeFenced:i(zn),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:i(zn,o),codeText:i(Os,o),codeTextData:T,data:T,codeFlowValue:T,definition:i(Ra),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:i(Ia),hardBreakEscape:i(Ki),hardBreakTrailing:i(Ki),htmlFlow:i(qi,o),htmlFlowData:T,htmlText:i(qi,o),htmlTextData:T,image:i(ir),label:o,link:i(zs),listItem:i(Mu),listItemValue:p,listOrdered:i(bn,f),listUnordered:i(bn),paragraph:i(Ma),reference:R,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:i(Aa),strong:i(Lu),thematicBreak:i(he)},exit:{atxHeading:l(),atxHeadingSequence:j,autolink:l(),autolinkEmail:Wt,autolinkProtocol:Ge,blockQuote:l(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:pe,characterReferenceMarkerNumeric:pe,characterReferenceValue:fe,characterReference:Et,codeFenced:l(v),codeFencedFence:y,codeFencedFenceInfo:h,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:l(g),codeText:l(N),codeTextData:E,data:E,definition:l(),definitionDestinationString:k,definitionLabelString:x,definitionTitleString:w,emphasis:l(),hardBreakEscape:l(A),hardBreakTrailing:l(A),htmlFlow:l(O),htmlFlowData:E,htmlText:l(M),htmlTextData:E,image:l(V),label:B,labelText:L,lineEnding:I,link:l(z),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ce,resourceDestinationString:C,resourceTitleString:$,resource:Q,setextHeading:l(P),setextHeadingLineSequence:S,setextHeadingText:_,strong:l(),thematicBreak:l()}};tk(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(F){let H={type:"root",children:[]};const ee={stack:[H],tokenStack:[],config:t,enter:a,exit:c,buffer:o,resume:u,data:n},oe=[];let me=-1;for(;++me<F.length;)if(F[me][1].type==="listOrdered"||F[me][1].type==="listUnordered")if(F[me][0]==="enter")oe.push(me);else{const on=oe.pop();me=s(F,on,me)}for(me=-1;++me<F.length;){const on=t[F[me][0]];ek.call(on,F[me][1].type)&&on[F[me][1].type].call(Object.assign({sliceSerialize:F[me][2].sliceSerialize},ee),F[me][1])}if(ee.tokenStack.length>0){const on=ee.tokenStack[ee.tokenStack.length-1];(on[1]||hx).call(ee,void 0,on[0])}for(H.position={start:ar(F.length>0?F[0][1].start:{line:1,column:1,offset:0}),end:ar(F.length>0?F[F.length-2][1].end:{line:1,column:1,offset:0})},me=-1;++me<t.transforms.length;)H=t.transforms[me](H)||H;return H}function s(F,H,ee){let oe=H-1,me=-1,on=!1,es,$n,Qi,Yi;for(;++oe<=ee;){const Tt=F[oe];switch(Tt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Tt[0]==="enter"?me++:me--,Yi=void 0;break}case"lineEndingBlank":{Tt[0]==="enter"&&(es&&!Yi&&!me&&!Qi&&(Qi=oe),Yi=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Yi=void 0}if(!me&&Tt[0]==="enter"&&Tt[1].type==="listItemPrefix"||me===-1&&Tt[0]==="exit"&&(Tt[1].type==="listUnordered"||Tt[1].type==="listOrdered")){if(es){let $s=oe;for($n=void 0;$s--;){const Bn=F[$s];if(Bn[1].type==="lineEnding"||Bn[1].type==="lineEndingBlank"){if(Bn[0]==="exit")continue;$n&&(F[$n][1].type="lineEndingBlank",on=!0),Bn[1].type="lineEnding",$n=$s}else if(!(Bn[1].type==="linePrefix"||Bn[1].type==="blockQuotePrefix"||Bn[1].type==="blockQuotePrefixWhitespace"||Bn[1].type==="blockQuoteMarker"||Bn[1].type==="listItemIndent"))break}Qi&&(!$n||Qi<$n)&&(es._spread=!0),es.end=Object.assign({},$n?F[$n][1].start:Tt[1].end),F.splice($n||oe,0,["exit",es,Tt[2]]),oe++,ee++}if(Tt[1].type==="listItemPrefix"){const $s={type:"listItem",_spread:!1,start:Object.assign({},Tt[1].start),end:void 0};es=$s,F.splice(oe,0,["enter",$s,Tt[2]]),oe++,ee++,Qi=void 0,Yi=!0}}}return F[H][1]._spread=on,ee}function i(F,H){return ee;function ee(oe){a.call(this,F(oe),oe),H&&H.call(this,oe)}}function o(){this.stack.push({type:"fragment",children:[]})}function a(F,H,ee){this.stack[this.stack.length-1].children.push(F),this.stack.push(F),this.tokenStack.push([H,ee||void 0]),F.position={start:ar(H.start),end:void 0}}function l(F){return H;function H(ee){F&&F.call(this,ee),c.call(this,ee)}}function c(F,H){const ee=this.stack.pop(),oe=this.tokenStack.pop();if(oe)oe[0].type!==F.type&&(H?H.call(this,F,oe[0]):(oe[1]||hx).call(this,F,oe[0]));else throw new Error("Cannot close `"+F.type+"` ("+Do({start:F.start,end:F.end})+"): it’s not open");ee.position.end=ar(F.end)}function u(){return iN(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(F){if(this.data.expectingFirstListItemValue){const H=this.stack[this.stack.length-2];H.start=Number.parseInt(this.sliceSerialize(F),10),this.data.expectingFirstListItemValue=void 0}}function h(){const F=this.resume(),H=this.stack[this.stack.length-1];H.lang=F}function m(){const F=this.resume(),H=this.stack[this.stack.length-1];H.meta=F}function y(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function v(){const F=this.resume(),H=this.stack[this.stack.length-1];H.value=F.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function g(){const F=this.resume(),H=this.stack[this.stack.length-1];H.value=F.replace(/(\r?\n|\r)$/g,"")}function x(F){const H=this.resume(),ee=this.stack[this.stack.length-1];ee.label=H,ee.identifier=vi(this.sliceSerialize(F)).toLowerCase()}function w(){const F=this.resume(),H=this.stack[this.stack.length-1];H.title=F}function k(){const F=this.resume(),H=this.stack[this.stack.length-1];H.url=F}function j(F){const H=this.stack[this.stack.length-1];if(!H.depth){const ee=this.sliceSerialize(F).length;H.depth=ee}}function _(){this.data.setextHeadingSlurpLineEnding=!0}function S(F){const H=this.stack[this.stack.length-1];H.depth=this.sliceSerialize(F).codePointAt(0)===61?1:2}function P(){this.data.setextHeadingSlurpLineEnding=void 0}function T(F){const ee=this.stack[this.stack.length-1].children;let oe=ee[ee.length-1];(!oe||oe.type!=="text")&&(oe=La(),oe.position={start:ar(F.start),end:void 0},ee.push(oe)),this.stack.push(oe)}function E(F){const H=this.stack.pop();H.value+=this.sliceSerialize(F),H.position.end=ar(F.end)}function I(F){const H=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ee=H.children[H.children.length-1];ee.position.end=ar(F.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(H.type)&&(T.call(this,F),E.call(this,F))}function A(){this.data.atHardBreak=!0}function O(){const F=this.resume(),H=this.stack[this.stack.length-1];H.value=F}function M(){const F=this.resume(),H=this.stack[this.stack.length-1];H.value=F}function N(){const F=this.resume(),H=this.stack[this.stack.length-1];H.value=F}function z(){const F=this.stack[this.stack.length-1];if(this.data.inReference){const H=this.data.referenceType||"shortcut";F.type+="Reference",F.referenceType=H,delete F.url,delete F.title}else delete F.identifier,delete F.label;this.data.referenceType=void 0}function V(){const F=this.stack[this.stack.length-1];if(this.data.inReference){const H=this.data.referenceType||"shortcut";F.type+="Reference",F.referenceType=H,delete F.url,delete F.title}else delete F.identifier,delete F.label;this.data.referenceType=void 0}function L(F){const H=this.sliceSerialize(F),ee=this.stack[this.stack.length-2];ee.label=sI(H),ee.identifier=vi(H).toLowerCase()}function B(){const F=this.stack[this.stack.length-1],H=this.resume(),ee=this.stack[this.stack.length-1];if(this.data.inReference=!0,ee.type==="link"){const oe=F.children;ee.children=oe}else ee.alt=H}function C(){const F=this.resume(),H=this.stack[this.stack.length-1];H.url=F}function $(){const F=this.resume(),H=this.stack[this.stack.length-1];H.title=F}function Q(){this.data.inReference=void 0}function R(){this.data.referenceType="collapsed"}function ce(F){const H=this.resume(),ee=this.stack[this.stack.length-1];ee.label=H,ee.identifier=vi(this.sliceSerialize(F)).toLowerCase(),this.data.referenceType="full"}function pe(F){this.data.characterReferenceType=F.type}function fe(F){const H=this.sliceSerialize(F),ee=this.data.characterReferenceType;let oe;ee?(oe=Wb(H,ee==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):oe=cm(H);const me=this.stack[this.stack.length-1];me.value+=oe}function Et(F){const H=this.stack.pop();H.position.end=ar(F.end)}function Ge(F){E.call(this,F);const H=this.stack[this.stack.length-1];H.url=this.sliceSerialize(F)}function Wt(F){E.call(this,F);const H=this.stack[this.stack.length-1];H.url="mailto:"+this.sliceSerialize(F)}function wn(){return{type:"blockquote",children:[]}}function zn(){return{type:"code",lang:null,meta:null,value:""}}function Os(){return{type:"inlineCode",value:""}}function Ra(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ia(){return{type:"emphasis",children:[]}}function Aa(){return{type:"heading",depth:0,children:[]}}function Ki(){return{type:"break"}}function qi(){return{type:"html",value:""}}function ir(){return{type:"image",title:null,url:"",alt:null}}function zs(){return{type:"link",title:null,url:"",children:[]}}function bn(F){return{type:"list",ordered:F.type==="listOrdered",start:null,spread:F._spread,children:[]}}function Mu(F){return{type:"listItem",spread:F._spread,checked:null,children:[]}}function Ma(){return{type:"paragraph",children:[]}}function Lu(){return{type:"strong",children:[]}}function La(){return{type:"text",value:""}}function he(){return{type:"thematicBreak"}}}function ar(e){return{line:e.line,column:e.column,offset:e.offset}}function tk(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?tk(e,r):lI(e,r)}}function lI(e,t){let n;for(n in t)if(ek.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 hx(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Do({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Do({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Do({start:t.start,end:t.end})+") is still open")}function cI(e){const t=this;t.parser=n;function n(r){return oI(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function uI(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 dI(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
61
|
+
`}]}function fI(e,t){const n=t.value?t.value+`
|
|
62
|
+
`:"",r={},s=t.lang?t.lang.split(/\s+/):[];s.length>0&&(r.className=["language-"+s[0]]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function hI(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function pI(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function mI(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=zi(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let o,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=i+1,a+=1,e.footnoteCounts.set(r,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)}function gI(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 yI(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function nk(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const s=e.all(t),i=s[0];i&&i.type==="text"?i.value="["+i.value:s.unshift({type:"text",value:"["});const o=s[s.length-1];return o&&o.type==="text"?o.value+=r:s.push({type:"text",value:r}),s}function xI(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return nk(e,t);const s={src:zi(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,i),e.applyData(t,i)}function vI(e,t){const n={src:zi(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 wI(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 bI(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return nk(e,t);const s={href:zi(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function kI(e,t){const n={href:zi(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 _I(e,t,n){const r=e.all(t),s=n?SI(n):rk(t),i={},o=[];if(typeof t.checked=="boolean"){const u=r[0];let f;u&&u.type==="element"&&u.tagName==="p"?f=u:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const u=r[a];(s||a!==0||u.type!=="element"||u.tagName!=="p")&&o.push({type:"text",value:`
|
|
63
|
+
`}),u.type==="element"&&u.tagName==="p"&&!s?o.push(...u.children):o.push(u)}const l=r[r.length-1];l&&(s||l.type!=="element"||l.tagName!=="p")&&o.push({type:"text",value:`
|
|
64
|
+
`});const c={type:"element",tagName:"li",properties:i,children:o};return e.patch(t,c),e.applyData(t,c)}function SI(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=rk(n[r])}return t}function rk(e){const t=e.spread;return t??e.children.length>1}function CI(e,t){const n={},r=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s<r.length;){const o=r[s];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)}function jI(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function PI(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function EI(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function TI(e,t){const n=e.all(t),r=n.shift(),s=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),s.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=im(t.children[1]),l=Fb(t.children[t.children.length-1]);a&&l&&(o.position={start:a,end:l}),s.push(o)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,i),e.applyData(t,i)}function NI(e,t,n){const r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,a=o?o.length:t.children.length;let l=-1;const c=[];for(;++l<a;){const f=t.children[l],p={},h=o?o[l]:void 0;h&&(p.align=h);let m={type:"element",tagName:i,properties:p,children:[]};f&&(m.children=e.all(f),e.patch(f,m),m=e.applyData(f,m)),c.push(m)}const u={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,u),e.applyData(t,u)}function RI(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const px=9,mx=32;function II(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),s=0;const i=[];for(;r;)i.push(gx(t.slice(s,r.index),s>0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return i.push(gx(t.slice(s),s>0,!1)),i.join("")}function gx(e,t,n){let r=0,s=e.length;if(t){let i=e.codePointAt(r);for(;i===px||i===mx;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(s-1);for(;i===px||i===mx;)s--,i=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function AI(e,t){const n={type:"text",value:II(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function MI(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const LI={blockquote:uI,break:dI,code:fI,delete:hI,emphasis:pI,footnoteReference:mI,heading:gI,html:yI,imageReference:xI,image:vI,inlineCode:wI,linkReference:bI,link:kI,listItem:_I,list:CI,paragraph:jI,root:PI,strong:EI,table:TI,tableCell:RI,tableRow:NI,text:AI,thematicBreak:MI,toml:rl,yaml:rl,definition:rl,footnoteDefinition:rl};function rl(){}const sk=-1,yu=0,Oo=1,Tc=2,fm=3,hm=4,pm=5,mm=6,ik=7,ok=8,DI=typeof self=="object"?self:globalThis,yx=(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 DI[e](t)},FI=(e,t)=>{const n=(s,i)=>(e.set(i,s),s),r=s=>{if(e.has(s))return e.get(s);const[i,o]=t[s];switch(i){case yu:case sk:return n(o,s);case Oo:{const a=n([],s);for(const l of o)a.push(r(l));return a}case Tc:{const a=n({},s);for(const[l,c]of o)a[r(l)]=r(c);return a}case fm:return n(new Date(o),s);case hm:{const{source:a,flags:l}=o;return n(new RegExp(a,l),s)}case pm:{const a=n(new Map,s);for(const[l,c]of o)a.set(r(l),r(c));return a}case mm:{const a=n(new Set,s);for(const l of o)a.add(r(l));return a}case ik:{const{name:a,message:l}=o;return n(yx(a,l),s)}case ok:return n(BigInt(o),s);case"BigInt":return n(Object(BigInt(o)),s);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:a}=new Uint8Array(o);return n(new DataView(a),o)}}return n(yx(i,o),s)};return r},xx=e=>FI(new Map,e)(0),Us="",{toString:OI}={},{keys:zI}=Object,uo=e=>{const t=typeof e;if(t!=="object"||!e)return[yu,t];const n=OI.call(e).slice(8,-1);switch(n){case"Array":return[Oo,Us];case"Object":return[Tc,Us];case"Date":return[fm,Us];case"RegExp":return[hm,Us];case"Map":return[pm,Us];case"Set":return[mm,Us];case"DataView":return[Oo,n]}return n.includes("Array")?[Oo,n]:n.includes("Error")?[ik,n]:[Tc,n]},sl=([e,t])=>e===yu&&(t==="function"||t==="symbol"),$I=(e,t,n,r)=>{const s=(o,a)=>{const l=r.push(o)-1;return n.set(a,l),l},i=o=>{if(n.has(o))return n.get(o);let[a,l]=uo(o);switch(a){case yu:{let u=o;switch(l){case"bigint":a=ok,u=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return s([sk],o)}return s([a,u],o)}case Oo:{if(l){let p=o;return l==="DataView"?p=new Uint8Array(o.buffer):l==="ArrayBuffer"&&(p=new Uint8Array(o)),s([l,[...p]],o)}const u=[],f=s([a,u],o);for(const p of o)u.push(i(p));return f}case Tc:{if(l)switch(l){case"BigInt":return s([l,o.toString()],o);case"Boolean":case"Number":case"String":return s([l,o.valueOf()],o)}if(t&&"toJSON"in o)return i(o.toJSON());const u=[],f=s([a,u],o);for(const p of zI(o))(e||!sl(uo(o[p])))&&u.push([i(p),i(o[p])]);return f}case fm:return s([a,o.toISOString()],o);case hm:{const{source:u,flags:f}=o;return s([a,{source:u,flags:f}],o)}case pm:{const u=[],f=s([a,u],o);for(const[p,h]of o)(e||!(sl(uo(p))||sl(uo(h))))&&u.push([i(p),i(h)]);return f}case mm:{const u=[],f=s([a,u],o);for(const p of o)(e||!sl(uo(p)))&&u.push(i(p));return f}}const{message:c}=o;return s([a,{name:l,message:c}],o)};return i},vx=(e,{json:t,lossy:n}={})=>{const r=[];return $I(!(t||n),!!t,new Map,r)(e),r},Nc=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?xx(vx(e,t)):structuredClone(e):(e,t)=>xx(vx(e,t));function BI(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 VI(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function UI(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||BI,r=e.options.footnoteBackLabel||VI,s=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[l]);if(!c)continue;const u=e.all(c),f=String(c.identifier).toUpperCase(),p=zi(f.toLowerCase());let h=0;const m=[],y=e.footnoteCounts.get(f);for(;y!==void 0&&++h<=y;){m.length>0&&m.push({type:"text",value:" "});let x=typeof n=="string"?n:n(l,h);typeof x=="string"&&(x={type:"text",value:x}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(h>1?"-"+h:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,h),className:["data-footnote-backref"]},children:Array.isArray(x)?x:[x]})}const v=u[u.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const x=v.children[v.children.length-1];x&&x.type==="text"?x.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...m)}else u.push(...m);const g={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(u,!0)};e.patch(c,g),a.push(g)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...Nc(o),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
|
|
65
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
|
|
66
|
+
`}]}}const ak=function(e){if(e==null)return KI;if(typeof e=="function")return xu(e);if(typeof e=="object")return Array.isArray(e)?WI(e):HI(e);if(typeof e=="string")return GI(e);throw new Error("Expected function, string, or object as test")};function WI(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=ak(e[n]);return xu(r);function r(...s){let i=-1;for(;++i<t.length;)if(t[i].apply(this,s))return!0;return!1}}function HI(e){const t=e;return xu(n);function n(r){const s=r;let i;for(i in e)if(s[i]!==t[i])return!1;return!0}}function GI(e){return xu(t);function t(n){return n&&n.type===e}}function xu(e){return t;function t(n,r,s){return!!(qI(n)&&e.call(this,n,typeof r=="number"?r:void 0,s||void 0))}}function KI(){return!0}function qI(e){return e!==null&&typeof e=="object"&&"type"in e}const lk=[],QI=!0,wx=!1,YI="skip";function XI(e,t,n,r){let s;typeof t=="function"&&typeof n!="function"?(r=n,n=t):s=t;const i=ak(s),o=r?-1:1;a(e,void 0,[])();function a(l,c,u){const f=l&&typeof l=="object"?l:{};if(typeof f.type=="string"){const h=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(l.type+(h?"<"+h+">":""))+")"})}return p;function p(){let h=lk,m,y,v;if((!t||i(l,c,u[u.length-1]||void 0))&&(h=JI(n(l,u)),h[0]===wx))return h;if("children"in l&&l.children){const g=l;if(g.children&&h[0]!==YI)for(y=(r?g.children.length:-1)+o,v=u.concat(g);y>-1&&y<g.children.length;){const x=g.children[y];if(m=a(x,y,v)(),m[0]===wx)return m;y=typeof m[1]=="number"?m[1]:y+o}}return h}}}function JI(e){return Array.isArray(e)?e:typeof e=="number"?[QI,e]:e==null?lk:[e]}function ck(e,t,n,r){let s,i,o;typeof t=="function"&&typeof n!="function"?(i=void 0,o=t,s=n):(i=t,o=n,s=r),XI(e,i,a,s);function a(l,c){const u=c[c.length-1],f=u?u.children.indexOf(l):void 0;return o(l,f,u)}}const vh={}.hasOwnProperty,ZI={};function eA(e,t){const n=t||ZI,r=new Map,s=new Map,i=new Map,o={...LI,...n.handlers},a={all:c,applyData:nA,definitionById:r,footnoteById:s,footnoteCounts:i,footnoteOrder:[],handlers:o,one:l,options:n,patch:tA,wrap:sA};return ck(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const f=u.type==="definition"?r:s,p=String(u.identifier).toUpperCase();f.has(p)||f.set(p,u)}}),a;function l(u,f){const p=u.type,h=a.handlers[p];if(vh.call(a.handlers,p)&&h)return h(a,u,f);if(a.options.passThrough&&a.options.passThrough.includes(p)){if("children"in u){const{children:y,...v}=u,g=Nc(v);return g.children=a.all(u),g}return Nc(u)}return(a.options.unknownHandler||rA)(a,u,f)}function c(u){const f=[];if("children"in u){const p=u.children;let h=-1;for(;++h<p.length;){const m=a.one(p[h],u);if(m){if(h&&p[h-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=bx(m.value)),!Array.isArray(m)&&m.type==="element")){const y=m.children[0];y&&y.type==="text"&&(y.value=bx(y.value))}Array.isArray(m)?f.push(...m):f.push(m)}}}return f}}function tA(e,t){e.position&&(t.position=F2(e))}function nA(e,t){let n=t;if(e&&e.data){const r=e.data.hName,s=e.data.hChildren,i=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const o="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:o}}n.type==="element"&&i&&Object.assign(n.properties,Nc(i)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function rA(e,t){const n=t.data||{},r="value"in t&&!(vh.call(n,"hProperties")||vh.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 sA(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 bx(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function kx(e,t){const n=eA(e,t),r=n.one(e,void 0),s=UI(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&i.children.push({type:"text",value:`
|
|
70
|
+
`},s),i}function iA(e,t){return e&&"run"in e?async function(n,r){const s=kx(n,{file:r,...t});await e.run(s,r)}:function(n,r){return kx(n,{file:r,...e||t})}}function _x(e){if(e)throw e}var Bl=Object.prototype.hasOwnProperty,uk=Object.prototype.toString,Sx=Object.defineProperty,Cx=Object.getOwnPropertyDescriptor,jx=function(t){return typeof Array.isArray=="function"?Array.isArray(t):uk.call(t)==="[object Array]"},Px=function(t){if(!t||uk.call(t)!=="[object Object]")return!1;var n=Bl.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Bl.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var s;for(s in t);return typeof s>"u"||Bl.call(t,s)},Ex=function(t,n){Sx&&n.name==="__proto__"?Sx(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Tx=function(t,n){if(n==="__proto__")if(Bl.call(t,n)){if(Cx)return Cx(t,n).value}else return;return t[n]},oA=function e(){var t,n,r,s,i,o,a=arguments[0],l=1,c=arguments.length,u=!1;for(typeof a=="boolean"&&(u=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});l<c;++l)if(t=arguments[l],t!=null)for(n in t)r=Tx(a,n),s=Tx(t,n),a!==s&&(u&&s&&(Px(s)||(i=jx(s)))?(i?(i=!1,o=r&&jx(r)?r:[]):o=r&&Px(r)?r:{},Ex(a,{name:n,newValue:e(u,o,s)})):typeof s<"u"&&Ex(a,{name:n,newValue:s}));return a};const bd=qc(oA);function wh(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 aA(){const e=[],t={run:n,use:r};return t;function n(...s){let i=-1;const o=s.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);a(null,...s);function a(l,...c){const u=e[++i];let f=-1;if(l){o(l);return}for(;++f<s.length;)(c[f]===null||c[f]===void 0)&&(c[f]=s[f]);s=c,u?lA(u,a)(...c):o(null,...c)}}function r(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function lA(e,t){let n;return r;function r(...o){const a=e.length>o.length;let l;a&&o.push(s);try{l=e.apply(this,o)}catch(c){const u=c;if(a&&n)throw u;return s(u)}a||(l&&l.then&&typeof l.then=="function"?l.then(i,s):l instanceof Error?s(l):i(l))}function s(o,...a){n||(n=!0,t(o,...a))}function i(o){s(null,o)}}const Pn={basename:cA,dirname:uA,extname:dA,join:fA,sep:"/"};function cA(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');_a(e);let n=0,r=-1,s=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(i){n=s+1;break}}else r<0&&(i=!0,r=s+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,a=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(i){n=s+1;break}}else o<0&&(i=!0,o=s+1),a>-1&&(e.codePointAt(s)===t.codePointAt(a--)?a<0&&(r=s):(a=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function uA(e){if(_a(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 dA(e){_a(e);let t=e.length,n=-1,r=0,s=-1,i=0,o;for(;t--;){const a=e.codePointAt(t);if(a===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),a===46?s<0?s=t:i!==1&&(i=1):s>-1&&(i=-1)}return s<0||n<0||i===0||i===1&&s===n-1&&s===r+1?"":e.slice(s,n)}function fA(...e){let t=-1,n;for(;++t<e.length;)_a(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":hA(n)}function hA(e){_a(e);const t=e.codePointAt(0)===47;let n=pA(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function pA(e,t){let n="",r=0,s=-1,i=0,o=-1,a,l;for(;++o<=e.length;){if(o<e.length)a=e.codePointAt(o);else{if(a===47)break;a=47}if(a===47){if(!(s===o-1||i===1))if(s!==o-1&&i===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),s=o,i=0;continue}}else if(n.length>0){n="",r=0,s=o,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(s+1,o):n=e.slice(s+1,o),r=o-s-1;s=o,i=0}else a===46&&i>-1?i++:i=-1}return n}function _a(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const mA={cwd:gA};function gA(){return"/"}function bh(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function yA(e){if(typeof e=="string")e=new URL(e);else if(!bh(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 xA(e)}function xA(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(t)}const kd=["history","path","basename","stem","extname","dirname"];class dk{constructor(t){let n;t?bh(t)?n={path:t}:typeof t=="string"||vA(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":mA.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<kd.length;){const i=kd[r];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let s;for(s in n)kd.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?Pn.basename(this.path):void 0}set basename(t){Sd(t,"basename"),_d(t,"basename"),this.path=Pn.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Pn.dirname(this.path):void 0}set dirname(t){Nx(this.basename,"dirname"),this.path=Pn.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Pn.extname(this.path):void 0}set extname(t){if(_d(t,"extname"),Nx(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=Pn.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){bh(t)&&(t=yA(t)),Sd(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Pn.basename(this.path,this.extname):void 0}set stem(t){Sd(t,"stem"),_d(t,"stem"),this.path=Pn.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const s=this.message(t,n,r);throw s.fatal=!0,s}info(t,n,r){const s=this.message(t,n,r);return s.fatal=void 0,s}message(t,n,r){const s=new at(t,n,r);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function _d(e,t){if(e&&e.includes(Pn.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Pn.sep+"`")}function Sd(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Nx(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function vA(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const wA=function(e){const r=this.constructor.prototype,s=r[e],i=function(){return s.apply(i,arguments)};return Object.setPrototypeOf(i,r),i},bA={}.hasOwnProperty;class gm extends wA{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=aA()}copy(){const t=new gm;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(bd(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Pd("data",this.frozen),this.namespace[t]=n,this):bA.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Pd("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const s=n.call(t,...r);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=il(t),r=this.parser||this.Parser;return Cd("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Cd("process",this.parser||this.Parser),jd("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(i,o){const a=il(t),l=r.parse(a);r.run(l,a,function(u,f,p){if(u||!f||!p)return c(u);const h=f,m=r.stringify(h,p);SA(m)?p.value=m:p.result=m,c(u,p)});function c(u,f){u||!f?o(u):i?i(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),Cd("processSync",this.parser||this.Parser),jd("processSync",this.compiler||this.Compiler),this.process(t,s),Ix("processSync","process",n),r;function s(i,o){n=!0,_x(i),r=o}}run(t,n,r){Rx(t),this.freeze();const s=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?i(void 0,r):new Promise(i);function i(o,a){const l=il(n);s.run(t,l,c);function c(u,f,p){const h=f||t;u?a(u):o?o(h):r(void 0,h,p)}}}runSync(t,n){let r=!1,s;return this.run(t,n,i),Ix("runSync","run",r),s;function i(o,a){_x(o),s=a,r=!0}}stringify(t,n){this.freeze();const r=il(n),s=this.compiler||this.Compiler;return jd("stringify",s),Rx(t),s(t,r)}use(t,...n){const r=this.attachers,s=this.namespace;if(Pd("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...f]=c;l(u,f)}else o(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function o(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(c.plugins),c.settings&&(s.settings=bd(!0,s.settings,c.settings))}function a(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const f=c[u];i(f)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let f=-1,p=-1;for(;++f<r.length;)if(r[f][0]===c){p=f;break}if(p===-1)r.push([c,...u]);else if(u.length>0){let[h,...m]=u;const y=r[p][1];wh(y)&&wh(h)&&(h=bd(!0,y,h)),r[p]=[c,h,...m]}}}}const kA=new gm().freeze();function Cd(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function jd(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Pd(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 Rx(e){if(!wh(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Ix(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function il(e){return _A(e)?e:new dk(e)}function _A(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function SA(e){return typeof e=="string"||CA(e)}function CA(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const jA="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Ax=[],Mx={allowDangerousHtml:!0},PA=/^(https?|ircs?|mailto|xmpp)$/i,EA=[{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 TA(e){const t=NA(e),n=RA(e);return IA(t.runSync(t.parse(n),n),e)}function NA(e){const t=e.rehypePlugins||Ax,n=e.remarkPlugins||Ax,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Mx}:Mx;return kA().use(cI).use(n).use(iA,r).use(t)}function RA(e){const t=e.children||"",n=new dk;return typeof t=="string"&&(n.value=t),n}function IA(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,i=t.disallowedElements,o=t.skipHtml,a=t.unwrapDisallowed,l=t.urlTransform||AA;for(const u of EA)Object.hasOwn(t,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+jA+u.id,void 0);return ck(e,c),V2(e,{Fragment:d.Fragment,components:s,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0});function c(u,f,p){if(u.type==="raw"&&p&&typeof f=="number")return o?p.children.splice(f,1):p.children[f]={type:"text",value:u.value},f;if(u.type==="element"){let h;for(h in xd)if(Object.hasOwn(xd,h)&&Object.hasOwn(u.properties,h)){const m=u.properties[h],y=xd[h];(y===null||y.includes(u.tagName))&&(u.properties[h]=l(String(m||""),h,u))}}if(u.type==="element"){let h=n?!n.includes(u.tagName):i?i.includes(u.tagName):!1;if(!h&&r&&typeof f=="number"&&(h=!r(u,f,p)),h&&p&&typeof f=="number")return a&&u.children?p.children.splice(f,1,...u.children):p.children.splice(f,1),f}}}function AA(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),s=e.indexOf("/");return t===-1||s!==-1&&t>s||n!==-1&&t>n||r!==-1&&t>r||PA.test(e.slice(0,t))?e:""}const Ed=e=>`font-display-luminari font-semibold ${e} mt-6 mb-3 leading-tight`,MA={p:({children:e})=>d.jsx("p",{className:"mb-4",children:e}),strong:({children:e})=>d.jsx("strong",{className:"font-bold",children:e}),h1:({children:e})=>d.jsx("h1",{className:Ed("text-lg"),children:e}),h2:({children:e})=>d.jsx("h2",{className:Ed("text-[1.3rem]"),children:e}),h3:({children:e})=>d.jsx("h3",{className:Ed("text-[1.1rem]"),children:e}),a:({children:e,href:t})=>d.jsx("a",{href:t,target:"_blank",rel:"noreferrer",className:"text-watercolor-amber-dark",children:e}),code:({children:e})=>d.jsx("code",{className:"font-mono text-[0.85em] bg-black/[6%] rounded-[3px] py-[0.1em] px-[0.35em]",children:e}),pre:({children:e})=>d.jsx("pre",{className:"font-mono text-[0.85em] bg-black/[6%] rounded-md py-3 px-4 overflow-x-auto mb-4",children:e}),ul:({children:e})=>d.jsx("ul",{className:"list-disc mb-4 pl-[1.4rem]",children:e}),ol:({children:e})=>d.jsx("ol",{className:"list-decimal mb-4 pl-[1.4rem]",children:e}),li:({children:e})=>d.jsx("li",{className:"mb-[0.4rem]",children:e}),blockquote:({children:e})=>d.jsx("blockquote",{className:"mb-4 pl-4 border-l-[3px] border-solid border-black/[15%] opacity-[0.85]",children:e})},fk=({children:e})=>d.jsx(TA,{components:MA,children:e}),LA={},Lx=e=>{let t;const n=new Set,r=(u,f)=>{const p=typeof u=="function"?u(t):u;if(!Object.is(p,t)){const h=t;t=f??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(m=>m(t,h))}},s=()=>t,l={setState:r,getState:s,getInitialState:()=>c,subscribe:u=>(n.add(u),()=>n.delete(u)),destroy:()=>{(LA?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},c=t=e(r,s,l);return l},DA=e=>e?Lx(e):Lx,hk={},{useDebugValue:FA}=bi,{useSyncExternalStoreWithSelector:OA}=pT;let Dx=!1;const zA=e=>e;function $A(e,t=zA,n){(hk?"production":void 0)!=="production"&&n&&!Dx&&(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"),Dx=!0);const r=OA(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return FA(r),r}const BA=e=>{(hk?"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"?DA(e):e,n=(r,s)=>$A(t,r,s);return Object.assign(n,t),n},VA=e=>BA;let pk="";function UA(e){pk=e}function G(e){return`${pk}${e}`}const mk=async()=>{const e=await fetch(G("/api/capabilities"));return e.ok?(await e.json()).capabilities:null},WA=async()=>{const e=await fetch(G("/api/agent/auth-status"));return e.ok?await e.json():null},QH=async()=>{try{const e=await fetch(G("/api/connections"));return e.ok?(await e.json()).connections:null}catch{return null}},YH=async e=>{try{const t=await fetch(G(`/api/connections/connect?id=${encodeURIComponent(e)}`),{method:"POST"});return t.ok?(await t.json()).connection:null}catch{return null}},ym=async()=>{try{const e=await fetch(G("/api/config"));return e.ok?e.json():null}catch{return null}},XH=async e=>{try{const t=await fetch(G("/api/config"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(t.ok)return{ok:!0};const n=await t.json().catch(()=>null);return{ok:!1,error:n==null?void 0:n.error}}catch(t){return{ok:!1,error:t.message}}},HA=async()=>{try{const e=await fetch(G("/api/icon"));if(!e.ok)return null;const t=await e.blob();return new Promise(n=>{const r=new FileReader;r.onloadend=()=>n(r.result),r.readAsDataURL(t)})}catch{return null}},JH=async e=>{try{return(await fetch(G("/api/icon"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({dataUri:e})})).ok}catch{return!1}},GA=async()=>{try{const e=await fetch(G("/api/package-name"));return e.ok?e.json():null}catch{return null}},On=async(e,t="Launch failed")=>{if(!e.ok){const n=await e.json().catch(()=>({error:t}));throw new Error(n.error)}},KA=async()=>(await fetch(G("/api/agent/status"))).json(),qA=async()=>(await fetch(G("/api/agent/reconcile-queue"))).json(),QA=async(e,t)=>{const n=await fetch(G("/api/agent/launch"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,phaseIndex:t})});await On(n)},YA=async(e,t)=>{const n=await fetch(G("/api/agent/launch-audit"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,prompt:t})});await On(n)},XA=async(e,t)=>{const n=await fetch(G("/api/agent/launch-reconcile"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,prompt:t})});await On(n)},JA=async(e,t)=>{const n=await fetch(G("/api/agent/launch-draft"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ideaId:e,prompt:t})});await On(n)},ZA=async(e,t)=>{const n=await fetch(G("/api/agent/launch-extend"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ideaId:e,prompt:t})});await On(n)},eM=async e=>{const t=await fetch(G("/api/agent/launch-suggest"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:e})});await On(t)},tM=async()=>{const e=await fetch(G("/api/agent/launch-reconcile-all"),{method:"POST"});await On(e)},nM=async e=>{const t=await fetch(G("/api/agent/launch-run-all"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e})});await On(t)},rM=async e=>{const t=await fetch(G("/api/agent/launch-fix-review"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e})});await On(t)},sM=async(e,t,n)=>{const r=await fetch(G("/api/agent/feedback-message"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,text:t,context:n})}),s=await r.json();if(!r.ok)throw new Error(s.error??"Failed to send message");return s},Fx=async(e,t,n,r)=>{const s=await fetch(G("/api/agent/feedback-promote"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,index:t,target:n,note:r})});if(!s.ok){const i=await s.json().catch(()=>null);throw new Error((i==null?void 0:i.error)??`Failed to promote message (${s.status})`)}},iM=async e=>{const t=await fetch(G("/api/agent/feedback-summarize"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e})}),n=await t.json().catch(()=>null);if(!t.ok)throw new Error((n==null?void 0:n.error)??`Failed to summarize feedback (${t.status})`);return n},oM=async(e,t)=>{const n=await fetch(G("/api/agent/feedback-undo"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,commitSha:t})}),r=await n.json();if(!n.ok)throw new Error(r.error??"Failed to undo edit");return r},aM=async e=>{const t=await fetch(G("/api/agent/stop"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskId:e})});await On(t,"Stop failed")},lM=async()=>(await fetch(G("/api/agent/login-relay/start"),{method:"POST"})).json(),cM=async()=>(await fetch(G("/api/agent/login-relay/status"))).json(),uM=async()=>{await fetch(G("/api/agent/login-relay/cancel"),{method:"POST"})};function ct(e,t,n,r=()=>({}),s){return async()=>{s&&e({[s]:!0});try{const i=await t();e({...n(i),...s&&{[s]:!1}})}catch(i){e({...r(i),...s&&{[s]:!1}})}}}function lr(e,t){return async(...n)=>{await t(...n),await e().loadAgentStatus()}}let dM=0;const Ox=()=>`preview-${++dM}`;function fM(e,t){return{agentAuthStatus:null,loadAgentAuthStatus:ct(e,WA,n=>({agentAuthStatus:n}),()=>({agentAuthStatus:null})),agentStatus:[],loadAgentStatus:async()=>{try{const n=await KA(),r=t().agentStatus;if(e({agentStatus:n}),n.find(l=>{var u;if(l.status!=="done"||l.taskKind!=="run-all"&&l.taskKind!=="phase")return!1;const c=r.find(f=>f.id===l.id);if(!c||c.status==="done"||c.status==="error")return!1;if(l.taskKind==="phase"){const f=(u=t().plans)==null?void 0:u.entries.find(p=>p.id===l.planId);if(!f||l.phaseIndex!==f.phases.length-1)return!1}return!0})){const{runCheck:l}=t();for(const c of["lint","format","test","consistency"])l(c)}const i=t().pendingReconcile,o=i?n.find(l=>l.taskKind==="reconcile"&&l.planId===i.planId):void 0;i&&o&&(o.status==="done"?(await t().loadPlans(),e(l=>({reconcileQueue:[...l.reconcileQueue,{...i,previewId:Ox()}],pendingReconcile:null}))):o.status==="error"&&e({pendingReconcile:null}));const a=n.find(l=>l.taskKind==="batch-reconcile");if((a==null?void 0:a.status)==="done"&&!t().batchReconcileConsumed){const l=await qA();l&&l.length>0&&(await t().loadPlans(),e(c=>({reconcileQueue:[...c.reconcileQueue,...l.map(u=>({planId:u.planId,before:u.before,previewId:Ox()}))]}))),e({batchReconcileConsumed:!0})}}catch{}},launchAgent:lr(t,QA),launchPlanAudit:lr(t,YA),launchPlanReconcile:async(n,r,s)=>{const i=t().pendingReconcile;if(i)throw new Error(i.planId===n?"A reconcile is already in progress for this plan":"A reconcile is already in progress for another plan");if(t().reconcileQueue.some(o=>o.planId===n))throw new Error("Review the pending reconcile for this plan first");e({pendingReconcile:{planId:n,before:s}});try{await XA(n,r)}catch(o){throw e({pendingReconcile:null}),o}await t().loadAgentStatus()},launchPlanDraft:lr(t,JA),launchIdeaExtend:lr(t,ZA),launchBatchReconcile:lr(t,async()=>{e({batchReconcileConsumed:!1}),await tM()}),launchSuggestIdeas:lr(t,eM),launchRunAll:lr(t,nM),launchFixReview:lr(t,rM),stopAgent:async n=>{try{await aM(n)}finally{await t().loadAgentStatus()}},loginRelay:null,startLoginRelay:async()=>{try{const n=await lM();e({loginRelay:n})}catch(n){e({loginRelay:{phase:"error",authorizeUrl:null,error:n.message}})}},loadLoginRelayStatus:ct(e,cM,n=>({loginRelay:n})),cancelLoginRelay:async()=>{try{await uM()}finally{e({loginRelay:null})}},pendingReconcile:null,reconcileQueue:[],removeFromReconcileQueue:n=>e(r=>({reconcileQueue:r.reconcileQueue.filter(s=>s.previewId!==n)})),batchReconcileConsumed:!1}}async function Yr(e,t){if(e.ok)return;const n=await e.json().catch(()=>({error:t}));throw new Error(n.error)}const hM=async()=>{const e=await fetch(G("/api/git/status"));return await Yr(e,"Failed to load git status"),e.json()},pM=async()=>{const e=await fetch(G("/api/git/diff"));return await Yr(e,"Failed to load diff"),(await e.json()).files},gk=async(e,t,n)=>{const r=await fetch(G("/api/git/commit"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:e,title:t,message:n})});await Yr(r,"Commit failed")},mM=async()=>{const e=await fetch(G("/api/git/push"),{method:"POST"});await Yr(e,"Push failed")},yk=async e=>{const t=await fetch(G("/api/git/suggest-commit-message"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:e})});return await Yr(t,"Failed to suggest a commit message"),t.json()},gM=async()=>{const e=await fetch(G("/api/git/sync"),{method:"POST"});if(e.status===202){const t=await e.json();return t.conflictPrompt?{ok:!1,recovering:!1,conflictPrompt:t.conflictPrompt,message:t.error}:{ok:!1,recovering:t.recovering,message:t.error}}return await Yr(e,"Sync failed"),{ok:!0}},yM=async()=>{const e=await fetch(G("/api/git/pull"),{method:"POST"});await Yr(e,"Pull failed")},xM=async()=>{const e=await fetch(G("/api/git/fix-divergence"),{method:"POST"});if(e.status===202){const t=await e.json();return t.conflictPrompt?{ok:!1,recovering:!1,conflictPrompt:t.conflictPrompt,message:t.error}:{ok:!1,recovering:t.recovering,message:t.error}}return await Yr(e,"Fix failed"),{ok:!0}},vM=async e=>{const t=await fetch(G("/api/git/resolve-conflict"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:e})});try{return await t.json()}catch{return{ok:!1,error:`Unexpected response (status ${t.status})`}}},wM=async e=>{const t=await fetch(G("/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};function bM(e,t){return{diffFiles:null,diffLoadFailed:!1,loadDiffFiles:ct(e,pM,n=>({diffFiles:n,diffLoadFailed:!1}),()=>({diffLoadFailed:!0})),activeDiffPath:null,setActiveDiffPath:n=>{t().activeDiffPath!==n&&e({activeDiffPath:n})}}}const kM=async()=>(await fetch(G("/api/tasks"))).json(),ZH=async e=>{const t=await fetch(G(`/api/tasks/output?id=${encodeURIComponent(e)}`));if(!t.ok)throw new Error(`Failed to fetch task log: ${t.status}`);return t.json()},_M=async()=>(await fetch(G("/api/suggestions"))).json(),SM=async e=>{const t=await fetch(G("/api/suggestions/promote"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({suggestion:e})});if(!t.ok){const n=await t.json().catch(()=>({error:"Failed to promote suggestion"}));throw new Error(n.error)}return t.json()},CM=async e=>{const t=await fetch(G("/api/suggestions/dismiss"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({suggestion:e})});if(!t.ok){const n=await t.json().catch(()=>({error:"Failed to dismiss suggestion"}));throw new Error(n.error)}},jM=async()=>(await fetch(G("/api/docs"))).json(),xk=async()=>{const e=await fetch(G("/api/roadmap"));if(!e.ok)throw new Error(`Failed to fetch roadmap: ${e.status}`);return e.json()},PM=async(e,t,n,r)=>{const s=await fetch(G("/api/roadmap/promote"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({horizonTitle:e,item:t,subject:n,candidateName:r})});if(!s.ok){const i=await s.json().catch(()=>({error:"Failed to promote roadmap item"}));throw new Error(i.error)}return s.json()},e7=async(e,t,n)=>{const r=await fetch(G("/api/roadmap/items"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({horizonTitle:e,name:t,description:n})});if(!r.ok){const s=await r.json().catch(()=>({error:"Failed to add roadmap item"}));throw new Error(s.error)}},t7=async(e,t,n)=>{const r=await fetch(G("/api/roadmap/candidates"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({horizonTitle:e,itemName:t,name:n})});if(!r.ok){const s=await r.json().catch(()=>({error:"Failed to add roadmap candidate"}));throw new Error(s.error)}},EM=async()=>(await fetch(G("/api/consistency"))).json(),TM=async()=>(await fetch(G("/api/doctor"))).json(),vk=async()=>(await fetch(G("/api/ideas"))).json(),NM=async()=>(await fetch(G("/api/archivable-ideas"))).json(),RM=async e=>{const t=await fetch(G("/api/ideas/archive"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:e})}),n=await t.json();if(!t.ok)throw new Error(n.error??"Failed to archive ideas");return n},wk=async e=>{const t=await fetch(G("/api/ideas"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),n=await t.json();if(!t.ok)throw new Error(n.error??"Failed to create idea");return n.id},bk=async(e,t)=>{const n=await fetch(G("/api/ideas/check-overlap"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:e,candidates:t})}),r=await n.json();if(!n.ok)throw new Error(r.error??"Failed to check overlap");return r},IM=async()=>{const e=await fetch(G("/api/ideas/prioritise"),{method:"POST"}),t=await e.json();if(!e.ok)throw new Error(t.error??"Failed to prioritise queue");return t},AM=async()=>{const e=await fetch(G("/api/notifications"));if(!e.ok)throw new Error(`Failed to fetch notifications: ${e.status}`);return e.json()},MM=async e=>{const t=await fetch(G("/api/notifications/mark-read"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e})});if(!t.ok)throw new Error(`Failed to mark notification read: ${t.status}`)},LM=async()=>{const e=await fetch(G("/api/parked-questions"));if(!e.ok)throw new Error(`Failed to fetch parked questions: ${e.status}`);return e.json()},kk=async()=>(await fetch(G("/api/plans"))).json(),DM=async e=>{await fetch(G("/api/plans"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})},FM=async(e,t)=>{const n=await fetch(G(`/api/plans?title=${encodeURIComponent(e)}`),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){const r=await n.json().catch(()=>null);throw new Error((r==null?void 0:r.error)??`Failed to update plan (${n.status})`)}},OM=async()=>{const e=await fetch(G("/api/releases"));if(!e.ok)throw new Error("Failed to load releases");const{versions:t}=await e.json();return t},n7=async e=>{const t=await fetch(G(`/api/release-notes?version=${encodeURIComponent(e)}`));if(!t.ok)throw new Error("Failed to load release notes");return t.json()};function zM(e,t){return{repoDocs:[],repoDocsLoading:!0,loadRepoDocs:async()=>{e({repoDocsLoading:!0});try{const n=await jM();e({repoDocs:n.files,repoDocsLoading:!1});const{activeDocTitle:r}=t();if(!r){const s=["MAIN.md","README.md"].find(i=>n.files.some(o=>o.name===i));s&&e({activeDocTitle:s})}}catch{e({repoDocs:[],repoDocsLoading:!1})}},activeDocTitle:null,setActiveDocTitle:n=>e({activeDocTitle:n}),docSearchQuery:"",setDocSearchQuery:n=>e({docSearchQuery:n}),releaseVersions:[],releaseVersionsLoading:!0,loadReleaseVersions:async()=>{e({releaseVersionsLoading:!0});try{const n=await OM();e({releaseVersions:n,releaseVersionsLoading:!1})}catch{e({releaseVersions:[],releaseVersionsLoading:!1})}},activeReleaseVersion:null,setActiveReleaseVersion:n=>e({activeReleaseVersion:n})}}function $M(e,t){return{ideaEntries:[],loadIdeas:ct(e,vk,n=>({ideaEntries:n.entries}),()=>({ideaEntries:[]})),archivableIdeas:[],loadArchivableIdeas:ct(e,NM,n=>({archivableIdeas:n}),()=>({archivableIdeas:[]})),archiveIdeas:async n=>{await RM(n),await Promise.all([t().loadArchivableIdeas(),t().loadPlans(),t().loadIdeas()])}}}function BM(e,t){return{notifications:null,notificationsLoading:!1,notificationsError:null,loadNotifications:ct(e,AM,n=>({notifications:n,notificationsError:null}),n=>({notificationsError:String(n)}),"notificationsLoading"),markRead:async n=>{const r=t().notifications;if(r){e({notifications:r.map(s=>s.kind!=="question"&&s.id===n?{...s,read:!0}:s)});try{await MM(n)}catch(s){e({notifications:r,notificationsError:String(s)})}}}}}function VM(e){return{parkedQuestions:null,parkedQuestionsLoading:!1,parkedQuestionsError:null,loadParkedQuestions:ct(e,LM,t=>({parkedQuestions:t,parkedQuestionsError:null}),t=>({parkedQuestionsError:String(t)}),"parkedQuestionsLoading")}}const Rc=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`},_k=e=>{if(e.length===0)return null;const t=e.filter(n=>n.done).length;return{done:t,total:e.length,pct:Math.round(t/e.length*100)}},Sk=e=>_k(e.phases),zx=e=>{var t;return((t=Sk(e))==null?void 0:t.pct)??null},UM=e=>_k([...e.phases,...e.fixes??[]]),WM=(e,t)=>{const n=UM(e);if(!n)return null;const r=Math.min(n.total,n.done+t);return{done:n.done,total:n.total,pct:r/n.total*100}},xm=(e,t)=>e?t.find(n=>n.planId===e&&n.status!=="done"&&n.status!=="error"):void 0,vm=(e,t)=>e.status==="done"||e.status==="dropped"?e.status:xm(e.id,t)?"in-progress":e.status,HM=e=>!e.pr&&e.status!=="done"&&e.status!=="dropped"&&e.status!=="review"&&e.phases.length>0&&e.phases.every(t=>t.done)&&(e.fixes??[]).every(t=>t.done);function Td(e,t){const n=e.split(/(\s+)/).filter(u=>u!==""),r=t.split(/(\s+)/).filter(u=>u!==""),s=n.length,i=r.length,o=Array.from({length:s+1},()=>new Array(i+1).fill(0));for(let u=s-1;u>=0;u--)for(let f=i-1;f>=0;f--)o[u][f]=n[u]===r[f]?o[u+1][f+1]+1:Math.max(o[u+1][f],o[u][f+1]);const a=[];let l=0,c=0;for(;l<s&&c<i;)n[l]===r[c]?(a.push({type:"same",text:n[l]}),l++,c++):o[l+1][c]>=o[l][c+1]?(a.push({type:"removed",text:n[l]}),l++):(a.push({type:"added",text:r[c]}),c++);for(;l<s;)a.push({type:"removed",text:n[l]}),l++;for(;c<i;)a.push({type:"added",text:r[c]}),c++;return GM(a)}function GM(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 KM=["idea","planned","in-progress","review","done","dropped"],qM=["feat","fix","chore","docs","refactor"],r7=["claude-code","opencode"],QM={"claude-code":"Claude Code",opencode:"OpenCode"},s7={"claude-code":{model:["opus","sonnet","fable","haiku"],effort:["low","medium","high","xhigh","max"]},opencode:{model:null}},i7={phase:{agent:"opencode"},planDraft:{agent:"claude-code"},ideaExtend:{agent:"claude-code"},commitSuggest:{agent:"claude-code"},feedback:{agent:"claude-code",model:"sonnet",effort:"medium"}},YM=["in-progress","review","planned","idea"],XM=["open"],wm={statuses:YM,tags:[],search:"",sortKey:"order",sortDirection:"asc",noteStatuses:XM,subject:null},$x={"in-progress":0,review:1,planned:2,idea:3,done:4,dropped:5},ol=e=>{const t=new Date(e.updated??e.created).getTime();return Number.isNaN(t)?0:t},Bx=e=>{const t=new Date(e.created).getTime();return Number.isNaN(t)?0:t},Vx=e=>{var n;const t=(n=e.id)==null?void 0:n.match(/(\d+)\s*$/);return t?Number(t[1]):Number.POSITIVE_INFINITY},Nd=(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)),zo=(e,t)=>t===null||e===t,bm=(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:Bx(e)-Bx(t);const s=(()=>{switch(n){case"status":{const i=$x[e.status]-$x[t.status];return i!==0?i:ol(t)-ol(e)}case"updated":return ol(t)-ol(e);case"title":return e.title.localeCompare(t.title);case"id":return Vx(e)-Vx(t);case"progress":return(zx(t)??-1)-(zx(e)??-1);default:return 0}})();return r==="desc"?-s:s},kh=(e,t)=>{const n={};for(const r of e)for(const s of t(r))n[String(s)]=(n[String(s)]??0)+1;return n},Vl=(e,t=wm)=>{const n=new Set(t.tags),r=new Set(t.statuses),s=kh(e.filter(a=>Ux(a,n)&&Nd(a,t.search)&&zo(a.subject,t.subject)),a=>[a.status]);for(const a of KM)s[a]??(s[a]=0);const i=kh(e.filter(a=>r.has(a.status)&&Nd(a,t.search)&&zo(a.subject,t.subject)),a=>a.tags);return{rows:e.filter(a=>r.has(a.status)&&Ux(a,n)&&Nd(a,t.search)&&zo(a.subject,t.subject)).sort((a,l)=>bm(a,l,t.sortKey,t.sortDirection)),statusCounts:s,tagCounts:i}},JM=["open","done","dropped"],ZM={open:"idea",done:"done",dropped:"dropped"},Rd=(e,t)=>{const n=t.trim().toLowerCase();return n?e.title.toLowerCase().includes(n)||e.body.toLowerCase().includes(n):!0},eL=e=>e.type==="plan"?e.plan.subject:e.idea.subject,tL=e=>e.type==="plan"?e.plan.order:e.idea.order,nL=e=>{const t=e.type==="plan"?e.plan.updated??e.plan.created:e.idea.created,n=new Date(t??"").getTime();return Number.isNaN(n)?0:n},Wx=(e,t)=>e.reduce((n,r)=>{const s=tL(r);return s===void 0?n:n===void 0?s:t==="desc"?Math.max(n,s):Math.min(n,s)},void 0),Hx=e=>e.reduce((t,n)=>Math.max(t,nL(n)),0),rL=(e,t="asc",n)=>{var a;const r=new Map,s=[];for(const l of e){const c=eL(l);if(!c||n&&!n.includes(c)){s.push(l);continue}r.has(c)||r.set(c,[]),(a=r.get(c))==null||a.push(l)}const i=t==="desc"?-1:1,o=[...r.entries()].map(([l,c])=>({subject:l,rows:c})).sort((l,c)=>{const u=Wx(l.rows,t),f=Wx(c.rows,t);return u!==void 0&&f!==void 0?i*(u-f):u!==void 0?-1:f!==void 0?1:Hx(c.rows)-Hx(l.rows)});return s.length>0&&o.push({subject:null,rows:s}),o},Gx=e=>e.type==="plan"?e.plan:e.type==="note"?{title:e.idea.title,id:e.idea.id??void 0,status:ZM[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)=>bm(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},sL=(e,t,n=wm)=>{const{statusCounts:r,tagCounts:s}=Vl(e,n),i=t.filter(h=>h.kind==="note"),o=t.filter(h=>h.kind!=="note"),a=new Set(o.map(h=>h.id).filter(h=>!!h)),l=new Map,c=[];for(const h of e)if(h.idea&&a.has(h.idea)){const m=l.get(h.idea)??[];m.push(h),l.set(h.idea,m)}else c.push(h);const u=new Set(n.noteStatuses),f=kh(i.filter(h=>Rd(h,n.search)),h=>[h.status??"open"]);for(const h of JM)f[h]??(f[h]=0);const p=Vl(c,n).rows.map(h=>({type:"plan",plan:h}));for(const h of o){const m=h.id?l.get(h.id)??[]:[],y=Vl(m,n).rows;!zo(h.subject,n.subject)&&y.length===0||y.length===0&&(m.length>0||!Rd(h,n.search))||p.push({type:"idea-group",idea:h,children:y})}for(const h of i)u.has(h.status??"open")&&Rd(h,n.search)&&zo(h.subject,n.subject)&&p.push({type:"note",idea:h});return p.sort((h,m)=>bm(Gx(h),Gx(m),n.sortKey,n.sortDirection)),{rows:p,statusCounts:r,tagCounts:s,noteStatusCounts:f}},iL=.2,oL=5,Ck=3,jk=2,Pk=1,aL=Ck+jk+Pk,lL=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"]),al=e=>{const t=e.toLowerCase().split(/[^a-z0-9]+/).filter(n=>n.length>=2&&!lL.has(n));return new Set(t)},Id=(e,t)=>{let n=0;for(const r of e)t.has(r)&&(n+=1);return n};function cL(e,t,n={}){const{threshold:r=iL,limit:s=oL}=n,i=al(e);if(i.size===0)return[];const o=[];for(const a of t){const l=al(a.title),c=al(a.body),u=al((a.tags??[]).join(" ")),p=(Id(i,l)*Ck+Id(i,u)*jk+Id(i,c)*Pk)/(i.size*aL);p>=r&&o.push({candidate:a,score:p})}return o.sort((a,l)=>l.score-a.score),o.slice(0,s)}const uL=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}`},dL=(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=[uL(e),e.failure_scenario??e.reasoning].filter(Boolean).join(" — ");return{done:!1,text:n.trim(),description:r||void 0,source:"review"}},fL=e=>{let t;try{t=JSON.parse(e)}catch{throw new Error("Not valid JSON")}const n=Array.isArray(t)?t:Array.isArray(t==null?void 0:t.findings)?t.findings:null;if(!n)throw new Error('Expected a JSON array of findings, or an object with a "findings" array');if(n.length===0)throw new Error("No findings to add");return n.map((r,s)=>dL(r,s))},hL=e=>`Fix the failing "${e}" check`,pL=[{name:"Quality",keys:["lint","format"]},{name:"Tests",keys:["test"]},{name:"Consistency",keys:["consistency"]}],mL=({cmd:e,output:t})=>`The command was \`${e}\`.
|
|
71
|
+
|
|
72
|
+
Output from the last run:
|
|
73
|
+
|
|
74
|
+
${t||"(no output captured)"}`,gL=e=>pL.flatMap(({name:t,keys:n})=>{const r=n.map(i=>e[i]).filter(i=>i.status==="fail");if(r.length===0)return[];const s=r.map(mL).join(`
|
|
75
|
+
|
|
76
|
+
`);return[{done:!1,text:hL(t),description:`Fix the failing "${t}" check in this repo.
|
|
77
|
+
|
|
78
|
+
${s}`}]}),yL=(e,t)=>{const n=new Map(gL(t).map(s=>[s.text,s]));return[...e.map(s=>{const i=n.get(s.text);return i?(n.delete(s.text),i):s}),...n.values()]};function xL(e,t){return{plans:null,plansLoading:!1,plansError:null,loadPlans:ct(e,kk,n=>({plans:n,plansError:null}),n=>({plansError:String(n)}),"plansLoading"),planFilters:wm,togglePlanStatus:n=>e(r=>({planFilters:{...r.planFilters,statuses:r.planFilters.statuses.includes(n)?r.planFilters.statuses.filter(s=>s!==n):[...r.planFilters.statuses,n]}})),togglePlanTag:n=>e(r=>({planFilters:{...r.planFilters,tags:r.planFilters.tags.includes(n)?r.planFilters.tags.filter(s=>s!==n):[...r.planFilters.tags,n]}})),toggleNoteStatus:n=>e(r=>({planFilters:{...r.planFilters,noteStatuses:r.planFilters.noteStatuses.includes(n)?r.planFilters.noteStatuses.filter(s=>s!==n):[...r.planFilters.noteStatuses,n]}})),setPlanSearch:n=>e(r=>({planFilters:{...r.planFilters,search:n}})),setSubjectFilter:n=>e(r=>({planFilters:{...r.planFilters,subject:n}})),setPlanSortKey:n=>e(r=>({planFilters:{...r.planFilters,sortKey:n}})),togglePlanSortDirection:()=>e(n=>({planFilters:{...n.planFilters,sortDirection:n.planFilters.sortDirection==="asc"?"desc":"asc"}})),detailView:"details",setDetailView:n=>e({detailView:n})}}const vL={horizons:[],statuses:[]},wL=e=>[...new Set(e.links.map(t=>t.status))],Ek=(e,t)=>t.length===0||e.links.some(n=>t.includes(n.status)),Tk=(e,t)=>t.length===0||t.includes(e),o7=(e,t)=>e.horizons.filter(n=>Tk(n.title,t.horizons)).map(n=>({...n,items:n.items.filter(r=>Ek(r,t.statuses))})),a7=(e,t)=>Object.fromEntries(e.horizons.map(n=>[n.title,n.items.filter(r=>Ek(r,t.statuses)).length])),l7=(e,t)=>{const n={};for(const r of e.horizons)if(Tk(r.title,t.horizons))for(const s of r.items)for(const i of wL(s))n[i]=(n[i]??0)+1;return n};function bL(e,t){return{roadmap:null,roadmapLoading:!1,roadmapError:null,loadRoadmap:ct(e,xk,n=>({roadmap:n,roadmapError:null}),n=>({roadmapError:String(n)}),"roadmapLoading"),roadmapFilters:vL,toggleRoadmapHorizon:n=>e(r=>({roadmapFilters:{...r.roadmapFilters,horizons:r.roadmapFilters.horizons.includes(n)?r.roadmapFilters.horizons.filter(s=>s!==n):[...r.roadmapFilters.horizons,n]}})),toggleRoadmapStatus:n=>e(r=>({roadmapFilters:{...r.roadmapFilters,statuses:r.roadmapFilters.statuses.includes(n)?r.roadmapFilters.statuses.filter(s=>s!==n):[...r.roadmapFilters.statuses,n]}}))}}const kL=async()=>(await fetch(G("/api/status"))).json(),_L=async e=>{await fetch(G(`/api/status/check?name=${e}`),{method:"POST"})},SL=async()=>{await fetch(G("/api/status/fix"),{method:"POST"})},CL=async()=>{const e=await fetch(G("/api/refresh"),{method:"POST"});if(!e.ok)throw new Error(`Failed to drop caches: ${e.statusText}`)};function jL(e,t){return{status:null,refreshing:!1,loadStatus:ct(e,kL,n=>({status:n})),refreshAll:async()=>{e({refreshing:!0});try{await CL().catch(()=>{}),await Promise.all([t().loadPlans(),t().loadIdeas(),t().loadArchivableIdeas(),t().loadSuggestions(),t().loadStatus(),t().loadConsistency(),t().loadDoctor(),t().loadGitStatus(),t().loadAgentStatus(),t().loadAgentAuthStatus()]);const n=t().plansError;return n?{ok:!1,error:n}:{ok:!0}}finally{e({refreshing:!1})}},runCheck:async n=>{try{await _L(n)}catch{}},fixQuality:async()=>{try{await SL()}catch{}},commitInFlight:!1,setCommitInFlight:n=>e({commitInFlight:n}),activeGitAction:null,setActiveGitAction:n=>e({activeGitAction:n}),quickCommit:async()=>{const{gitStatus:n,loadGitStatus:r,commitInFlight:s}=t();if(s)return{ok:!1,error:"A commit is already in progress"};if(!n||n.length===0)return{ok:!1,error:"Nothing to commit"};const i=n.map(o=>o.path);e({commitInFlight:!0});try{const{title:o,message:a}=await yk(i);return await gk(i,o,a||void 0),await r()?{ok:!0,title:o}:{ok:!0,title:o,warning:"Committed, but the git status refresh failed — reload to confirm"}}catch(o){return{ok:!1,error:o.message}}finally{e({commitInFlight:!1})}},consistency:[],loadConsistency:ct(e,EM,n=>({consistency:n})),doctor:{findings:[],errorCount:0,warningCount:0},loadDoctor:ct(e,TM,n=>({doctor:n})),gitStatus:null,gitBranch:null,gitAhead:0,gitBehind:0,gitDiverged:!1,gitBranchHygiene:null,loadGitStatus:async()=>{try{const{branch:n,entries:r,ahead:s,behind:i,diverged:o,branchHygiene:a}=await hM();return e({gitStatus:r,gitBranch:n,gitAhead:s,gitBehind:i,gitDiverged:o,gitBranchHygiene:a}),!0}catch{return!1}},capabilities:[],loadCapabilities:ct(e,mk,n=>({capabilities:n??[]}),()=>({capabilities:[]}))}}function PL(e,t){return{suggestions:[],suggestionsLoading:!0,loadSuggestions:ct(e,_M,n=>({suggestions:n.entries}),()=>({suggestions:[]}),"suggestionsLoading"),promoteSuggestion:async n=>{const{id:r}=await SM(n);return await Promise.all([t().loadSuggestions(),t().loadPlans(),t().loadIdeas()]),r},dismissSuggestion:async n=>{await CM(n),await t().loadSuggestions()},promoteRoadmapItem:async(n,r,s,i)=>{const{id:o}=await PM(n,r,s,i);return await Promise.all([t().loadPlans(),t().loadIdeas()]),o},launchPrioritise:async()=>{const n=await IM();return await t().refreshAll(),n}}}function EL(e){return{taskLog:[],taskLogLoading:!0,loadTaskLog:ct(e,kM,t=>({taskLog:t.entries}),()=>({taskLog:[]}),"taskLogLoading")}}const D=VA()((e,t)=>({...xL(e),...bL(e),...$M(e,t),...PL(e,t),...EL(e),...zM(e,t),...jL(e,t),...fM(e,t),...bM(e,t),...VM(e),...BM(e,t)})),vu=e=>e.agentStatus.some(t=>t.status!=="done"&&t.status!=="error"),Xr=e=>e.capabilities.length===0||e.capabilities.some(t=>t.id.startsWith("agent:")&&t.status==="ok"),TL=e=>{const t=e.capabilities.find(n=>n.id==="gh");return t===void 0||t.status==="ok"},NL=e=>e.capabilities.filter(t=>t.status!=="ok").length,RL=e=>{var t;return((t=e.agentAuthStatus)==null?void 0:t.loggedIn)===!1},IL=e=>{var t;return((t=e.agentStatus.find(n=>n.rateLimit))==null?void 0:t.rateLimit)??null};function AL(e){return e.includes("running")?"running":e.includes("fail")?"fail":e.every(t=>t==="stale")?"stale":"pass"}function km(e){var t,n,r,s;return{qualityStatus:AL([((t=e==null?void 0:e.lint)==null?void 0:t.status)??"stale",((n=e==null?void 0:e.format)==null?void 0:n.status)??"stale"]),testStatus:((r=e==null?void 0:e.test)==null?void 0:r.status)??"stale",consistencyStatus:((s=e==null?void 0:e.consistency)==null?void 0:s.status)??"stale"}}function Nk(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=Nk(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ML(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=Nk(e))&&(r&&(r+=" "),r+=t);return r}const _m="-",LL=e=>{const t=FL(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const a=o.split(_m);return a[0]===""&&a.length!==1&&a.shift(),Rk(a,t)||DL(o)},getConflictingClassGroupIds:(o,a)=>{const l=n[o]||[];return a&&r[o]?[...l,...r[o]]:l}}},Rk=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?Rk(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const i=e.join(_m);return(o=t.validators.find(({validator:a})=>a(i)))==null?void 0:o.classGroupId},Kx=/^\[(.+)\]$/,DL=e=>{if(Kx.test(e)){const t=Kx.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},FL=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return zL(Object.entries(e.classGroups),n).forEach(([i,o])=>{_h(o,r,i,t)}),r},_h=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const i=s===""?t:qx(t,s);i.classGroupId=n;return}if(typeof s=="function"){if(OL(s)){_h(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([i,o])=>{_h(o,qx(t,i),n,r)})})},qx=(e,t)=>{let n=e;return t.split(_m).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},OL=e=>e.isThemeGetter,zL=(e,t)=>t?e.map(([n,r])=>{const s=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,a])=>[t+o,a])):i);return[n,s]}):e,$L=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(i,o)=>{n.set(i,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let o=n.get(i);if(o!==void 0)return o;if((o=r.get(i))!==void 0)return s(i,o),o},set(i,o){n.has(i)?n.set(i,o):s(i,o)}}},Ik="!",BL=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,s=t[0],i=t.length,o=a=>{const l=[];let c=0,u=0,f;for(let v=0;v<a.length;v++){let g=a[v];if(c===0){if(g===s&&(r||a.slice(v,v+i)===t)){l.push(a.slice(u,v)),u=v+i;continue}if(g==="/"){f=v;continue}}g==="["?c++:g==="]"&&c--}const p=l.length===0?a:a.substring(u),h=p.startsWith(Ik),m=h?p.substring(1):p,y=f&&f>u?f-u:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:y}};return n?a=>n({className:a,parseClassName:o}):o},VL=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},UL=e=>({cache:$L(e.cacheSize),parseClassName:BL(e),...LL(e)}),WL=/\s+/,HL=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,i=[],o=e.trim().split(WL);let a="";for(let l=o.length-1;l>=0;l-=1){const c=o[l],{modifiers:u,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:h}=n(c);let m=!!h,y=r(m?p.substring(0,h):p);if(!y){if(!m){a=c+(a.length>0?" "+a:a);continue}if(y=r(p),!y){a=c+(a.length>0?" "+a:a);continue}m=!1}const v=VL(u).join(":"),g=f?v+Ik:v,x=g+y;if(i.includes(x))continue;i.push(x);const w=s(y,m);for(let k=0;k<w.length;++k){const j=w[k];i.push(g+j)}a=c+(a.length>0?" "+a:a)}return a};function GL(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Ak(t))&&(r&&(r+=" "),r+=n);return r}const Ak=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Ak(e[r]))&&(n&&(n+=" "),n+=t);return n};function KL(e,...t){let n,r,s,i=o;function o(l){const c=t.reduce((u,f)=>f(u),e());return n=UL(c),r=n.cache.get,s=n.cache.set,i=a,a(l)}function a(l){const c=r(l);if(c)return c;const u=HL(l,n);return s(l,u),u}return function(){return i(GL.apply(null,arguments))}}const ke=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Mk=/^\[(?:([a-z-]+):)?(.+)\]$/i,qL=/^\d+\/\d+$/,QL=new Set(["px","full","screen"]),YL=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,XL=/\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$/,JL=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ZL=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,eD=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Vn=e=>wi(e)||QL.has(e)||qL.test(e),cr=e=>$i(e,"length",lD),wi=e=>!!e&&!Number.isNaN(Number(e)),Ad=e=>$i(e,"number",wi),fo=e=>!!e&&Number.isInteger(Number(e)),tD=e=>e.endsWith("%")&&wi(e.slice(0,-1)),ne=e=>Mk.test(e),ur=e=>YL.test(e),nD=new Set(["length","size","percentage"]),rD=e=>$i(e,nD,Lk),sD=e=>$i(e,"position",Lk),iD=new Set(["image","url"]),oD=e=>$i(e,iD,uD),aD=e=>$i(e,"",cD),ho=()=>!0,$i=(e,t,n)=>{const r=Mk.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},lD=e=>XL.test(e)&&!JL.test(e),Lk=()=>!1,cD=e=>ZL.test(e),uD=e=>eD.test(e),dD=()=>{const e=ke("colors"),t=ke("spacing"),n=ke("blur"),r=ke("brightness"),s=ke("borderColor"),i=ke("borderRadius"),o=ke("borderSpacing"),a=ke("borderWidth"),l=ke("contrast"),c=ke("grayscale"),u=ke("hueRotate"),f=ke("invert"),p=ke("gap"),h=ke("gradientColorStops"),m=ke("gradientColorStopPositions"),y=ke("inset"),v=ke("margin"),g=ke("opacity"),x=ke("padding"),w=ke("saturate"),k=ke("scale"),j=ke("sepia"),_=ke("skew"),S=ke("space"),P=ke("translate"),T=()=>["auto","contain","none"],E=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto",ne,t],A=()=>[ne,t],O=()=>["",Vn,cr],M=()=>["auto",wi,ne],N=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],z=()=>["solid","dashed","dotted","double","none"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],L=()=>["start","end","center","between","around","evenly","stretch"],B=()=>["","0",ne],C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],$=()=>[wi,ne];return{cacheSize:500,separator:":",theme:{colors:[ho],spacing:[Vn,cr],blur:["none","",ur,ne],brightness:$(),borderColor:[e],borderRadius:["none","","full",ur,ne],borderSpacing:A(),borderWidth:O(),contrast:$(),grayscale:B(),hueRotate:$(),invert:B(),gap:A(),gradientColorStops:[e],gradientColorStopPositions:[tD,cr],inset:I(),margin:I(),opacity:$(),padding:A(),saturate:$(),scale:$(),sepia:B(),skew:$(),space:A(),translate:A()},classGroups:{aspect:[{aspect:["auto","square","video",ne]}],container:["container"],columns:[{columns:[ur]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...N(),ne]}],overflow:[{overflow: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:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",fo,ne]}],basis:[{basis:I()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ne]}],grow:[{grow:B()}],shrink:[{shrink:B()}],order:[{order:["first","last","none",fo,ne]}],"grid-cols":[{"grid-cols":[ho]}],"col-start-end":[{col:["auto",{span:["full",fo,ne]},ne]}],"col-start":[{"col-start":M()}],"col-end":[{"col-end":M()}],"grid-rows":[{"grid-rows":[ho]}],"row-start-end":[{row:["auto",{span:[fo,ne]},ne]}],"row-start":[{"row-start":M()}],"row-end":[{"row-end":M()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ne]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ne]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...L()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...L(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...L(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[S]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[S]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ne,t]}],"min-w":[{"min-w":[ne,t,"min","max","fit"]}],"max-w":[{"max-w":[ne,t,"none","full","min","max","fit","prose",{screen:[ur]},ur]}],h:[{h:[ne,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ne,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ne,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ne,t,"auto","min","max","fit"]}],"font-size":[{text:["base",ur,cr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ad]}],"font-family":[{font:[ho]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ne]}],"line-clamp":[{"line-clamp":["none",wi,Ad]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Vn,ne]}],"list-image":[{"list-image":["none",ne]}],"list-style-type":[{list:["none","disc","decimal",ne]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[g]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[g]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...z(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Vn,cr]}],"underline-offset":[{"underline-offset":["auto",Vn,ne]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ne]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ne]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[g]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...N(),sD]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",rD]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},oD]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[g]}],"border-style":[{border:[...z(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[g]}],"divide-style":[{divide:z()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...z()]}],"outline-offset":[{"outline-offset":[Vn,ne]}],"outline-w":[{outline:[Vn,cr]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:O()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[Vn,cr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ur,aD]}],"shadow-color":[{shadow:[ho]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...V(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":V()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",ur,ne]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[f]}],saturate:[{saturate:[w]}],sepia:[{sepia:[j]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[g]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[j]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ne]}],duration:[{duration:$()}],ease:[{ease:["linear","in","out","in-out",ne]}],delay:[{delay:$()}],animate:[{animate:["none","spin","ping","pulse","bounce",ne]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[k]}],"scale-x":[{"scale-x":[k]}],"scale-y":[{"scale-y":[k]}],rotate:[{rotate:[fo,ne]}],"translate-x":[{"translate-x":[P]}],"translate-y":[{"translate-y":[P]}],"skew-x":[{"skew-x":[_]}],"skew-y":[{"skew-y":[_]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ne]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ne]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ne]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Vn,cr,Ad]}],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"]}}},fD=KL(dD);function Md(e,t,n){if(e&&e.length){const[r,s]=t,i=Math.PI/180*n,o=Math.cos(i),a=Math.sin(i);for(const l of e){const[c,u]=l;l[0]=(c-r)*o-(u-s)*a+r,l[1]=(c-r)*a+(u-s)*o+s}}}function hD(e,t){return e[0]===t[0]&&e[1]===t[1]}function pD(e,t,n,r=1){const s=n,i=Math.max(t,.1),o=e[0]&&e[0][0]&&typeof e[0][0]=="number"?[e]:e,a=[0,0];if(s)for(const c of o)Md(c,a,s);const l=function(c,u,f){const p=[];for(const x of c){const w=[...x];hD(w[0],w[w.length-1])||w.push([w[0][0],w[0][1]]),w.length>2&&p.push(w)}const h=[];u=Math.max(u,.1);const m=[];for(const x of p)for(let w=0;w<x.length-1;w++){const k=x[w],j=x[w+1];if(k[1]!==j[1]){const _=Math.min(k[1],j[1]);m.push({ymin:_,ymax:Math.max(k[1],j[1]),x:_===k[1]?k[0]:j[0],islope:(j[0]-k[0])/(j[1]-k[1])})}}if(m.sort((x,w)=>x.ymin<w.ymin?-1:x.ymin>w.ymin?1:x.x<w.x?-1:x.x>w.x?1:x.ymax===w.ymax?0:(x.ymax-w.ymax)/Math.abs(x.ymax-w.ymax)),!m.length)return h;let y=[],v=m[0].ymin,g=0;for(;y.length||m.length;){if(m.length){let x=-1;for(let w=0;w<m.length&&!(m[w].ymin>v);w++)x=w;m.splice(0,x+1).forEach(w=>{y.push({s:v,edge:w})})}if(y=y.filter(x=>!(x.edge.ymax<=v)),y.sort((x,w)=>x.edge.x===w.edge.x?0:(x.edge.x-w.edge.x)/Math.abs(x.edge.x-w.edge.x)),(f!==1||g%u==0)&&y.length>1)for(let x=0;x<y.length;x+=2){const w=x+1;if(w>=y.length)break;const k=y[x].edge,j=y[w].edge;h.push([[Math.round(k.x),v],[Math.round(j.x),v]])}v+=f,y.forEach(x=>{x.edge.x=x.edge.x+f*x.edge.islope}),g++}return h}(o,i,r);if(s){for(const c of o)Md(c,a,-s);(function(c,u,f){const p=[];c.forEach(h=>p.push(...h)),Md(p,u,f)})(l,a,-s)}return l}function Sa(e,t){var n;const r=t.hachureAngle+90;let s=t.hachureGap;s<0&&(s=4*t.strokeWidth),s=Math.round(Math.max(s,.1));let i=1;return t.roughness>=1&&(((n=t.randomizer)===null||n===void 0?void 0:n.next())||Math.random())>.7&&(i=s),pD(e,s,r,i||1)}class Sm{constructor(t){this.helper=t}fillPolygons(t,n){return this._fillPolygons(t,n)}_fillPolygons(t,n){const r=Sa(t,n);return{type:"fillSketch",ops:this.renderLines(r,n)}}renderLines(t,n){const r=[];for(const s of t)r.push(...this.helper.doubleLineOps(s[0][0],s[0][1],s[1][0],s[1][1],n));return r}}function wu(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 mD extends Sm{fillPolygons(t,n){let r=n.hachureGap;r<0&&(r=4*n.strokeWidth),r=Math.max(r,.1);const s=Sa(t,Object.assign({},n,{hachureGap:r})),i=Math.PI/180*n.hachureAngle,o=[],a=.5*r*Math.cos(i),l=.5*r*Math.sin(i);for(const[c,u]of s)wu([c,u])&&o.push([[c[0]-a,c[1]+l],[...u]],[[c[0]+a,c[1]-l],[...u]]);return{type:"fillSketch",ops:this.renderLines(o,n)}}}class gD extends Sm{fillPolygons(t,n){const r=this._fillPolygons(t,n),s=Object.assign({},n,{hachureAngle:n.hachureAngle+90}),i=this._fillPolygons(t,s);return r.ops=r.ops.concat(i.ops),r}}class yD{constructor(t){this.helper=t}fillPolygons(t,n){const r=Sa(t,n=Object.assign({},n,{hachureAngle:0}));return this.dotsOnLines(r,n)}dotsOnLines(t,n){const r=[];let s=n.hachureGap;s<0&&(s=4*n.strokeWidth),s=Math.max(s,.1);let i=n.fillWeight;i<0&&(i=n.strokeWidth/2);const o=s/4;for(const a of t){const l=wu(a),c=l/s,u=Math.ceil(c)-1,f=l-u*s,p=(a[0][0]+a[1][0])/2-s/4,h=Math.min(a[0][1],a[1][1]);for(let m=0;m<u;m++){const y=h+f+m*s,v=p-o+2*Math.random()*o,g=y-o+2*Math.random()*o,x=this.helper.ellipse(v,g,i,i,n);r.push(...x.ops)}}return{type:"fillSketch",ops:r}}}class xD{constructor(t){this.helper=t}fillPolygons(t,n){const r=Sa(t,n);return{type:"fillSketch",ops:this.dashedLine(r,n)}}dashedLine(t,n){const r=n.dashOffset<0?n.hachureGap<0?4*n.strokeWidth:n.hachureGap:n.dashOffset,s=n.dashGap<0?n.hachureGap<0?4*n.strokeWidth:n.hachureGap:n.dashGap,i=[];return t.forEach(o=>{const a=wu(o),l=Math.floor(a/(r+s)),c=(a+s-l*(r+s))/2;let u=o[0],f=o[1];u[0]>f[0]&&(u=o[1],f=o[0]);const p=Math.atan((f[1]-u[1])/(f[0]-u[0]));for(let h=0;h<l;h++){const m=h*(r+s),y=m+r,v=[u[0]+m*Math.cos(p)+c*Math.cos(p),u[1]+m*Math.sin(p)+c*Math.sin(p)],g=[u[0]+y*Math.cos(p)+c*Math.cos(p),u[1]+y*Math.sin(p)+c*Math.sin(p)];i.push(...this.helper.doubleLineOps(v[0],v[1],g[0],g[1],n))}}),i}}class vD{constructor(t){this.helper=t}fillPolygons(t,n){const r=n.hachureGap<0?4*n.strokeWidth:n.hachureGap,s=n.zigzagOffset<0?r:n.zigzagOffset,i=Sa(t,n=Object.assign({},n,{hachureGap:r+s}));return{type:"fillSketch",ops:this.zigzagLines(i,s,n)}}zigzagLines(t,n,r){const s=[];return t.forEach(i=>{const o=wu(i),a=Math.round(o/(2*n));let l=i[0],c=i[1];l[0]>c[0]&&(l=i[1],c=i[0]);const u=Math.atan((c[1]-l[1])/(c[0]-l[0]));for(let f=0;f<a;f++){const p=2*f*n,h=2*(f+1)*n,m=Math.sqrt(2*Math.pow(n,2)),y=[l[0]+p*Math.cos(u),l[1]+p*Math.sin(u)],v=[l[0]+h*Math.cos(u),l[1]+h*Math.sin(u)],g=[y[0]+m*Math.cos(u+Math.PI/4),y[1]+m*Math.sin(u+Math.PI/4)];s.push(...this.helper.doubleLineOps(y[0],y[1],g[0],g[1],r),...this.helper.doubleLineOps(g[0],g[1],v[0],v[1],r))}}),s}}const mt={};class wD{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const bD=0,Ld=1,Qx=2,ll={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 Dd(e,t){return e.type===t}function Cm(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:bD,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:Ld,text:`${parseFloat(RegExp.$1)}`},o=o.substr(RegExp.$1.length)}return a[a.length]={type:Qx,text:""},a}(e);let r="BOD",s=0,i=n[s];for(;!Dd(i,Qx);){let o=0;const a=[];if(r==="BOD"){if(i.text!=="M"&&i.text!=="m")return Cm("M0,0"+e);s++,o=ll[i.text],r=i.text}else Dd(i,Ld)?o=ll[r]:(s++,o=ll[i.text],r=i.text);if(!(s+o<n.length))throw new Error("Path data ended short");for(let l=s;l<s+o;l++){const c=n[l];if(!Dd(c,Ld))throw new Error("Param not a number: "+r+","+c.text);a[a.length]=+c.text}if(typeof ll[r]!="number")throw new Error("Bad segment: "+r);{const l={key:r,data:a};t.push(l),s+=o,i=n[s],r==="M"&&(r="L"),r==="m"&&(r="l")}}return t}function Dk(e){let t=0,n=0,r=0,s=0;const i=[];for(const{key:o,data:a}of e)switch(o){case"M":i.push({key:"M",data:[...a]}),[t,n]=a,[r,s]=a;break;case"m":t+=a[0],n+=a[1],i.push({key:"M",data:[t,n]}),r=t,s=n;break;case"L":i.push({key:"L",data:[...a]}),[t,n]=a;break;case"l":t+=a[0],n+=a[1],i.push({key:"L",data:[t,n]});break;case"C":i.push({key:"C",data:[...a]}),t=a[4],n=a[5];break;case"c":{const l=a.map((c,u)=>u%2?c+n:c+t);i.push({key:"C",data:l}),t=l[4],n=l[5];break}case"Q":i.push({key:"Q",data:[...a]}),t=a[2],n=a[3];break;case"q":{const l=a.map((c,u)=>u%2?c+n:c+t);i.push({key:"Q",data:l}),t=l[2],n=l[3];break}case"A":i.push({key:"A",data:[...a]}),t=a[5],n=a[6];break;case"a":t+=a[5],n+=a[6],i.push({key:"A",data:[a[0],a[1],a[2],a[3],a[4],t,n]});break;case"H":i.push({key:"H",data:[...a]}),t=a[0];break;case"h":t+=a[0],i.push({key:"H",data:[t]});break;case"V":i.push({key:"V",data:[...a]}),n=a[0];break;case"v":n+=a[0],i.push({key:"V",data:[n]});break;case"S":i.push({key:"S",data:[...a]}),t=a[2],n=a[3];break;case"s":{const l=a.map((c,u)=>u%2?c+n:c+t);i.push({key:"S",data:l}),t=l[2],n=l[3];break}case"T":i.push({key:"T",data:[...a]}),t=a[0],n=a[1];break;case"t":t+=a[0],n+=a[1],i.push({key:"T",data:[t,n]});break;case"Z":case"z":i.push({key:"Z",data:[]}),t=r,n=s}return i}function Fk(e){const t=[];let n="",r=0,s=0,i=0,o=0,a=0,l=0;for(const{key:c,data:u}of e){switch(c){case"M":t.push({key:"M",data:[...u]}),[r,s]=u,[i,o]=u;break;case"C":t.push({key:"C",data:[...u]}),r=u[4],s=u[5],a=u[2],l=u[3];break;case"L":t.push({key:"L",data:[...u]}),[r,s]=u;break;case"H":r=u[0],t.push({key:"L",data:[r,s]});break;case"V":s=u[0],t.push({key:"L",data:[r,s]});break;case"S":{let f=0,p=0;n==="C"||n==="S"?(f=r+(r-a),p=s+(s-l)):(f=r,p=s),t.push({key:"C",data:[f,p,...u]}),a=u[0],l=u[1],r=u[2],s=u[3];break}case"T":{const[f,p]=u;let h=0,m=0;n==="Q"||n==="T"?(h=r+(r-a),m=s+(s-l)):(h=r,m=s);const y=r+2*(h-r)/3,v=s+2*(m-s)/3,g=f+2*(h-f)/3,x=p+2*(m-p)/3;t.push({key:"C",data:[y,v,g,x,f,p]}),a=h,l=m,r=f,s=p;break}case"Q":{const[f,p,h,m]=u,y=r+2*(f-r)/3,v=s+2*(p-s)/3,g=h+2*(f-h)/3,x=m+2*(p-m)/3;t.push({key:"C",data:[y,v,g,x,h,m]}),a=f,l=p,r=h,s=m;break}case"A":{const f=Math.abs(u[0]),p=Math.abs(u[1]),h=u[2],m=u[3],y=u[4],v=u[5],g=u[6];f===0||p===0?(t.push({key:"C",data:[r,s,v,g,v,g]}),r=v,s=g):(r!==v||s!==g)&&(Ok(r,s,v,g,f,p,h,m,y).forEach(function(x){t.push({key:"C",data:x})}),r=v,s=g);break}case"Z":t.push({key:"Z",data:[]}),r=i,s=o}n=c}return t}function po(e,t,n){return[e*Math.cos(n)-t*Math.sin(n),e*Math.sin(n)+t*Math.cos(n)]}function Ok(e,t,n,r,s,i,o,a,l,c){const u=(f=o,Math.PI*f/180);var f;let p=[],h=0,m=0,y=0,v=0;if(c)[h,m,y,v]=c;else{[e,t]=po(e,t,-u),[n,r]=po(n,r,-u);const O=(e-n)/2,M=(t-r)/2;let N=O*O/(s*s)+M*M/(i*i);N>1&&(N=Math.sqrt(N),s*=N,i*=N);const z=s*s,V=i*i,L=z*V-z*M*M-V*O*O,B=z*M*M+V*O*O,C=(a===l?-1:1)*Math.sqrt(Math.abs(L/B));y=C*s*M/i+(e+n)/2,v=C*-i*O/s+(t+r)/2,h=Math.asin(parseFloat(((t-v)/i).toFixed(9))),m=Math.asin(parseFloat(((r-v)/i).toFixed(9))),e<y&&(h=Math.PI-h),n<y&&(m=Math.PI-m),h<0&&(h=2*Math.PI+h),m<0&&(m=2*Math.PI+m),l&&h>m&&(h-=2*Math.PI),!l&&m>h&&(m-=2*Math.PI)}let g=m-h;if(Math.abs(g)>120*Math.PI/180){const O=m,M=n,N=r;m=l&&m>h?h+120*Math.PI/180*1:h+120*Math.PI/180*-1,p=Ok(n=y+s*Math.cos(m),r=v+i*Math.sin(m),M,N,s,i,o,0,l,[m,O,y,v])}g=m-h;const x=Math.cos(h),w=Math.sin(h),k=Math.cos(m),j=Math.sin(m),_=Math.tan(g/4),S=4/3*s*_,P=4/3*i*_,T=[e,t],E=[e+S*w,t-P*x],I=[n+S*j,r-P*k],A=[n,r];if(E[0]=2*T[0]-E[0],E[1]=2*T[1]-E[1],c)return[E,I,A].concat(p);{p=[E,I,A].concat(p);const O=[];for(let M=0;M<p.length;M+=3){const N=po(p[M][0],p[M][1],u),z=po(p[M+1][0],p[M+1][1],u),V=po(p[M+2][0],p[M+2][1],u);O.push([N[0],N[1],z[0],z[1],V[0],V[1]])}return O}}const kD={randOffset:function(e,t){return X(e,t)},randOffsetWithRange:function(e,t,n){return Ic(e,t,n)},ellipse:function(e,t,n,r,s){const i=$k(n,r,s);return Sh(e,t,s,i).opset},doubleLineOps:function(e,t,n,r,s){return Vr(e,t,n,r,s,!0)}};function zk(e,t,n,r,s){return{type:"path",ops:Vr(e,t,n,r,s)}}function Ul(e,t,n){const r=(e||[]).length;if(r>2){const s=[];for(let i=0;i<r-1;i++)s.push(...Vr(e[i][0],e[i][1],e[i+1][0],e[i+1][1],n));return t&&s.push(...Vr(e[r-1][0],e[r-1][1],e[0][0],e[0][1],n)),{type:"path",ops:s}}return r===2?zk(e[0][0],e[0][1],e[1][0],e[1][1],n):{type:"path",ops:[]}}function _D(e,t,n,r,s){return function(i,o){return Ul(i,!0,o)}([[e,t],[e+n,t],[e+n,t+r],[e,t+r]],s)}function Yx(e,t){if(e.length){const n=typeof e[0][0]=="number"?[e]:e,r=cl(n[0],1*(1+.2*t.roughness),t),s=t.disableMultiStroke?[]:cl(n[0],1.5*(1+.22*t.roughness),Zx(t));for(let i=1;i<n.length;i++){const o=n[i];if(o.length){const a=cl(o,1*(1+.2*t.roughness),t),l=t.disableMultiStroke?[]:cl(o,1.5*(1+.22*t.roughness),Zx(t));for(const c of a)c.op!=="move"&&r.push(c);for(const c of l)c.op!=="move"&&s.push(c)}}return{type:"path",ops:r.concat(s)}}return{type:"path",ops:[]}}function $k(e,t,n){const r=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(e/2,2)+Math.pow(t/2,2))/2)),s=Math.ceil(Math.max(n.curveStepCount,n.curveStepCount/Math.sqrt(200)*r)),i=2*Math.PI/s;let o=Math.abs(e/2),a=Math.abs(t/2);const l=1-n.curveFitting;return o+=X(o*l,n),a+=X(a*l,n),{increment:i,rx:o,ry:a}}function Sh(e,t,n,r){const[s,i]=ev(r.increment,e,t,r.rx,r.ry,1,r.increment*Ic(.1,Ic(.4,1,n),n),n);let o=Ac(s,null,n);if(!n.disableMultiStroke&&n.roughness!==0){const[a]=ev(r.increment,e,t,r.rx,r.ry,1.5,0,n),l=Ac(a,null,n);o=o.concat(l)}return{estimatedPoints:i,opset:{type:"path",ops:o}}}function Xx(e,t,n,r,s,i,o,a,l){const c=e,u=t;let f=Math.abs(n/2),p=Math.abs(r/2);f+=X(.01*f,l),p+=X(.01*p,l);let h=s,m=i;for(;h<0;)h+=2*Math.PI,m+=2*Math.PI;m-h>2*Math.PI&&(h=0,m=2*Math.PI);const y=2*Math.PI/l.curveStepCount,v=Math.min(y/2,(m-h)/2),g=tv(v,c,u,f,p,h,m,1,l);if(!l.disableMultiStroke){const x=tv(v,c,u,f,p,h,m,1.5,l);g.push(...x)}return o&&(a?g.push(...Vr(c,u,c+f*Math.cos(h),u+p*Math.sin(h),l),...Vr(c,u,c+f*Math.cos(m),u+p*Math.sin(m),l)):g.push({op:"lineTo",data:[c,u]},{op:"lineTo",data:[c+f*Math.cos(h),u+p*Math.sin(h)]})),{type:"path",ops:g}}function Jx(e,t){const n=Fk(Dk(Cm(e))),r=[];let s=[0,0],i=[0,0];for(const{key:o,data:a}of n)switch(o){case"M":i=[a[0],a[1]],s=[a[0],a[1]];break;case"L":r.push(...Vr(i[0],i[1],a[0],a[1],t)),i=[a[0],a[1]];break;case"C":{const[l,c,u,f,p,h]=a;r.push(...SD(l,c,u,f,p,h,i,t)),i=[p,h];break}case"Z":r.push(...Vr(i[0],i[1],s[0],s[1],t)),i=[s[0],s[1]]}return{type:"path",ops:r}}function Fd(e,t){const n=[];for(const r of e)if(r.length){const s=t.maxRandomnessOffset||0,i=r.length;if(i>2){n.push({op:"move",data:[r[0][0]+X(s,t),r[0][1]+X(s,t)]});for(let o=1;o<i;o++)n.push({op:"lineTo",data:[r[o][0]+X(s,t),r[o][1]+X(s,t)]})}}return{type:"fillPath",ops:n}}function Ws(e,t){return function(n,r){let s=n.fillStyle||"hachure";if(!mt[s])switch(s){case"zigzag":mt[s]||(mt[s]=new mD(r));break;case"cross-hatch":mt[s]||(mt[s]=new gD(r));break;case"dots":mt[s]||(mt[s]=new yD(r));break;case"dashed":mt[s]||(mt[s]=new xD(r));break;case"zigzag-line":mt[s]||(mt[s]=new vD(r));break;default:s="hachure",mt[s]||(mt[s]=new Sm(r))}return mt[s]}(t,kD).fillPolygons(e,t)}function Zx(e){const t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function Bk(e){return e.randomizer||(e.randomizer=new wD(e.seed||0)),e.randomizer.next()}function Ic(e,t,n,r=1){return n.roughness*r*(Bk(n)*(t-e)+e)}function X(e,t,n=1){return Ic(-e,e,t,n)}function Vr(e,t,n,r,s,i=!1){const o=i?s.disableMultiStrokeFill:s.disableMultiStroke,a=Ch(e,t,n,r,s,!0,!1);if(o)return a;const l=Ch(e,t,n,r,s,!0,!0);return a.concat(l)}function Ch(e,t,n,r,s,i,o){const a=Math.pow(e-n,2)+Math.pow(t-r,2),l=Math.sqrt(a);let c=1;c=l<200?1:l>500?.4:-.0016668*l+1.233334;let u=s.maxRandomnessOffset||0;u*u*100>a&&(u=l/10);const f=u/2,p=.2+.2*Bk(s);let h=s.bowing*s.maxRandomnessOffset*(r-t)/200,m=s.bowing*s.maxRandomnessOffset*(e-n)/200;h=X(h,s,c),m=X(m,s,c);const y=[],v=()=>X(f,s,c),g=()=>X(u,s,c),x=s.preserveVertices;return o?y.push({op:"move",data:[e+(x?0:v()),t+(x?0:v())]}):y.push({op:"move",data:[e+(x?0:X(u,s,c)),t+(x?0:X(u,s,c))]}),o?y.push({op:"bcurveTo",data:[h+e+(n-e)*p+v(),m+t+(r-t)*p+v(),h+e+2*(n-e)*p+v(),m+t+2*(r-t)*p+v(),n+(x?0:v()),r+(x?0:v())]}):y.push({op:"bcurveTo",data:[h+e+(n-e)*p+g(),m+t+(r-t)*p+g(),h+e+2*(n-e)*p+g(),m+t+2*(r-t)*p+g(),n+(x?0:g()),r+(x?0:g())]}),y}function cl(e,t,n){if(!e.length)return[];const r=[];r.push([e[0][0]+X(t,n),e[0][1]+X(t,n)]),r.push([e[0][0]+X(t,n),e[0][1]+X(t,n)]);for(let s=1;s<e.length;s++)r.push([e[s][0]+X(t,n),e[s][1]+X(t,n)]),s===e.length-1&&r.push([e[s][0]+X(t,n),e[s][1]+X(t,n)]);return Ac(r,null,n)}function Ac(e,t,n){const r=e.length,s=[];if(r>3){const i=[],o=1-n.curveTightness;s.push({op:"move",data:[e[1][0],e[1][1]]});for(let a=1;a+2<r;a++){const l=e[a];i[0]=[l[0],l[1]],i[1]=[l[0]+(o*e[a+1][0]-o*e[a-1][0])/6,l[1]+(o*e[a+1][1]-o*e[a-1][1])/6],i[2]=[e[a+1][0]+(o*e[a][0]-o*e[a+2][0])/6,e[a+1][1]+(o*e[a][1]-o*e[a+2][1])/6],i[3]=[e[a+1][0],e[a+1][1]],s.push({op:"bcurveTo",data:[i[1][0],i[1][1],i[2][0],i[2][1],i[3][0],i[3][1]]})}}else r===3?(s.push({op:"move",data:[e[1][0],e[1][1]]}),s.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):r===2&&s.push(...Ch(e[0][0],e[0][1],e[1][0],e[1][1],n,!0,!0));return s}function ev(e,t,n,r,s,i,o,a){const l=[],c=[];if(a.roughness===0){e/=4,c.push([t+r*Math.cos(-e),n+s*Math.sin(-e)]);for(let u=0;u<=2*Math.PI;u+=e){const f=[t+r*Math.cos(u),n+s*Math.sin(u)];l.push(f),c.push(f)}c.push([t+r*Math.cos(0),n+s*Math.sin(0)]),c.push([t+r*Math.cos(e),n+s*Math.sin(e)])}else{const u=X(.5,a)-Math.PI/2;c.push([X(i,a)+t+.9*r*Math.cos(u-e),X(i,a)+n+.9*s*Math.sin(u-e)]);const f=2*Math.PI+u-.01;for(let p=u;p<f;p+=e){const h=[X(i,a)+t+r*Math.cos(p),X(i,a)+n+s*Math.sin(p)];l.push(h),c.push(h)}c.push([X(i,a)+t+r*Math.cos(u+2*Math.PI+.5*o),X(i,a)+n+s*Math.sin(u+2*Math.PI+.5*o)]),c.push([X(i,a)+t+.98*r*Math.cos(u+o),X(i,a)+n+.98*s*Math.sin(u+o)]),c.push([X(i,a)+t+.9*r*Math.cos(u+.5*o),X(i,a)+n+.9*s*Math.sin(u+.5*o)])}return[c,l]}function tv(e,t,n,r,s,i,o,a,l){const c=i+X(.1,l),u=[];u.push([X(a,l)+t+.9*r*Math.cos(c-e),X(a,l)+n+.9*s*Math.sin(c-e)]);for(let f=c;f<=o;f+=e)u.push([X(a,l)+t+r*Math.cos(f),X(a,l)+n+s*Math.sin(f)]);return u.push([t+r*Math.cos(o),n+s*Math.sin(o)]),u.push([t+r*Math.cos(o),n+s*Math.sin(o)]),Ac(u,null,l)}function SD(e,t,n,r,s,i,o,a){const l=[],c=[a.maxRandomnessOffset||1,(a.maxRandomnessOffset||1)+.3];let u=[0,0];const f=a.disableMultiStroke?1:2,p=a.preserveVertices;for(let h=0;h<f;h++)h===0?l.push({op:"move",data:[o[0],o[1]]}):l.push({op:"move",data:[o[0]+(p?0:X(c[0],a)),o[1]+(p?0:X(c[0],a))]}),u=p?[s,i]:[s+X(c[h],a),i+X(c[h],a)],l.push({op:"bcurveTo",data:[e+X(c[h],a),t+X(c[h],a),n+X(c[h],a),r+X(c[h],a),u[0],u[1]]});return l}function mo(e){return[...e]}function nv(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(mo(e[0]),mo(e[1]),mo(e[2]),mo(e[2]));else{const s=[];s.push(e[0],e[0]);for(let a=1;a<e.length;a++)s.push(e[a]),a===e.length-1&&s.push(e[a]);const i=[],o=1-t;r.push(mo(s[0]));for(let a=1;a+2<s.length;a++){const l=s[a];i[0]=[l[0],l[1]],i[1]=[l[0]+(o*s[a+1][0]-o*s[a-1][0])/6,l[1]+(o*s[a+1][1]-o*s[a-1][1])/6],i[2]=[s[a+1][0]+(o*s[a][0]-o*s[a+2][0])/6,s[a+1][1]+(o*s[a][1]-o*s[a+2][1])/6],i[3]=[s[a+1][0],s[a+1][1]],r.push(i[1],i[2],i[3])}}return r}function Wl(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function CD(e,t,n){const r=Wl(t,n);if(r===0)return Wl(e,t);let s=((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/r;return s=Math.max(0,Math.min(1,s)),Wl(e,ls(t,n,s))}function ls(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function jh(e,t,n,r){const s=r||[];if(function(a,l){const c=a[l+0],u=a[l+1],f=a[l+2],p=a[l+3];let h=3*u[0]-2*c[0]-p[0];h*=h;let m=3*u[1]-2*c[1]-p[1];m*=m;let y=3*f[0]-2*p[0]-c[0];y*=y;let v=3*f[1]-2*p[1]-c[1];return v*=v,h<y&&(h=y),m<v&&(m=v),h+m}(e,t)<n){const a=e[t+0];s.length?(i=s[s.length-1],o=a,Math.sqrt(Wl(i,o))>1&&s.push(a)):s.push(a),s.push(e[t+3])}else{const l=e[t+0],c=e[t+1],u=e[t+2],f=e[t+3],p=ls(l,c,.5),h=ls(c,u,.5),m=ls(u,f,.5),y=ls(p,h,.5),v=ls(h,m,.5),g=ls(y,v,.5);jh([l,p,y,g],0,n,s),jh([g,v,m,f],0,n,s)}var i,o;return s}function jD(e,t){return Mc(e,0,e.length,t)}function Mc(e,t,n,r,s){const i=s||[],o=e[t],a=e[n-1];let l=0,c=1;for(let u=t+1;u<n-1;++u){const f=CD(e[u],o,a);f>l&&(l=f,c=u)}return Math.sqrt(l)>r?(Mc(e,t,c+1,r,i),Mc(e,c,n,r,i)):(i.length||i.push(o),i.push(a)),i}function Od(e,t=.15,n){const r=[],s=(e.length-1)/3;for(let i=0;i<s;i++)jh(e,3*i,t,r);return n&&n>0?Mc(r,0,r.length,n):r}const Nt="none";let Lc=class{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,n,r){return{shape:t,sets:n||[],options:r||this.defaultOptions}}line(t,n,r,s,i){const o=this._o(i);return this._d("line",[zk(t,n,r,s,o)],o)}rectangle(t,n,r,s,i){const o=this._o(i),a=[],l=_D(t,n,r,s,o);if(o.fill){const c=[[t,n],[t+r,n],[t+r,n+s],[t,n+s]];o.fillStyle==="solid"?a.push(Fd([c],o)):a.push(Ws([c],o))}return o.stroke!==Nt&&a.push(l),this._d("rectangle",a,o)}ellipse(t,n,r,s,i){const o=this._o(i),a=[],l=$k(r,s,o),c=Sh(t,n,o,l);if(o.fill)if(o.fillStyle==="solid"){const u=Sh(t,n,o,l).opset;u.type="fillPath",a.push(u)}else a.push(Ws([c.estimatedPoints],o));return o.stroke!==Nt&&a.push(c.opset),this._d("ellipse",a,o)}circle(t,n,r,s){const i=this.ellipse(t,n,r,r,s);return i.shape="circle",i}linearPath(t,n){const r=this._o(n);return this._d("linearPath",[Ul(t,!1,r)],r)}arc(t,n,r,s,i,o,a=!1,l){const c=this._o(l),u=[],f=Xx(t,n,r,s,i,o,a,!0,c);if(a&&c.fill)if(c.fillStyle==="solid"){const p=Object.assign({},c);p.disableMultiStroke=!0;const h=Xx(t,n,r,s,i,o,!0,!1,p);h.type="fillPath",u.push(h)}else u.push(function(p,h,m,y,v,g,x){const w=p,k=h;let j=Math.abs(m/2),_=Math.abs(y/2);j+=X(.01*j,x),_+=X(.01*_,x);let S=v,P=g;for(;S<0;)S+=2*Math.PI,P+=2*Math.PI;P-S>2*Math.PI&&(S=0,P=2*Math.PI);const T=(P-S)/x.curveStepCount,E=[];for(let I=S;I<=P;I+=T)E.push([w+j*Math.cos(I),k+_*Math.sin(I)]);return E.push([w+j*Math.cos(P),k+_*Math.sin(P)]),E.push([w,k]),Ws([E],x)}(t,n,r,s,i,o,c));return c.stroke!==Nt&&u.push(f),this._d("arc",u,c)}curve(t,n){const r=this._o(n),s=[],i=Yx(t,r);if(r.fill&&r.fill!==Nt)if(r.fillStyle==="solid"){const o=Yx(t,Object.assign(Object.assign({},r),{disableMultiStroke:!0,roughness:r.roughness?r.roughness+r.fillShapeRoughnessGain:0}));s.push({type:"fillPath",ops:this._mergedShape(o.ops)})}else{const o=[],a=t;if(a.length){const l=typeof a[0][0]=="number"?[a]:a;for(const c of l)c.length<3?o.push(...c):c.length===3?o.push(...Od(nv([c[0],c[0],c[1],c[2]]),10,(1+r.roughness)/2)):o.push(...Od(nv(c),10,(1+r.roughness)/2))}o.length&&s.push(Ws([o],r))}return r.stroke!==Nt&&s.push(i),this._d("curve",s,r)}polygon(t,n){const r=this._o(n),s=[],i=Ul(t,!0,r);return r.fill&&(r.fillStyle==="solid"?s.push(Fd([t],r)):s.push(Ws([t],r))),r.stroke!==Nt&&s.push(i),this._d("polygon",s,r)}path(t,n){const r=this._o(n),s=[];if(!t)return this._d("path",s,r);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const i=r.fill&&r.fill!=="transparent"&&r.fill!==Nt,o=r.stroke!==Nt,a=!!(r.simplification&&r.simplification<1),l=function(u,f,p){const h=Fk(Dk(Cm(u))),m=[];let y=[],v=[0,0],g=[];const x=()=>{g.length>=4&&y.push(...Od(g,f)),g=[]},w=()=>{x(),y.length&&(m.push(y),y=[])};for(const{key:j,data:_}of h)switch(j){case"M":w(),v=[_[0],_[1]],y.push(v);break;case"L":x(),y.push([_[0],_[1]]);break;case"C":if(!g.length){const S=y.length?y[y.length-1]:v;g.push([S[0],S[1]])}g.push([_[0],_[1]]),g.push([_[2],_[3]]),g.push([_[4],_[5]]);break;case"Z":x(),y.push([v[0],v[1]])}if(w(),!p)return m;const k=[];for(const j of m){const _=jD(j,p);_.length&&k.push(_)}return k}(t,1,a?4-4*(r.simplification||1):(1+r.roughness)/2),c=Jx(t,r);if(i)if(r.fillStyle==="solid")if(l.length===1){const u=Jx(t,Object.assign(Object.assign({},r),{disableMultiStroke:!0,roughness:r.roughness?r.roughness+r.fillShapeRoughnessGain:0}));s.push({type:"fillPath",ops:this._mergedShape(u.ops)})}else s.push(Fd(l,r));else s.push(Ws(l,r));return o&&(a?l.forEach(u=>{s.push(Ul(u,!1,r))}):s.push(c)),this._d("path",s,r)}opsToPath(t,n){let r="";for(const s of t.ops){const i=typeof n=="number"&&n>=0?s.data.map(o=>+o.toFixed(n)):s.data;switch(s.op){case"move":r+=`M${i[0]} ${i[1]} `;break;case"bcurveTo":r+=`C${i[0]} ${i[1]}, ${i[2]} ${i[3]}, ${i[4]} ${i[5]} `;break;case"lineTo":r+=`L${i[0]} ${i[1]} `}}return r.trim()}toPaths(t){const n=t.sets||[],r=t.options||this.defaultOptions,s=[];for(const i of n){let o=null;switch(i.type){case"path":o={d:this.opsToPath(i),stroke:r.stroke,strokeWidth:r.strokeWidth,fill:Nt};break;case"fillPath":o={d:this.opsToPath(i),stroke:Nt,strokeWidth:0,fill:r.fill||Nt};break;case"fillSketch":o=this.fillSketch(i,r)}o&&s.push(o)}return s}fillSketch(t,n){let r=n.fillWeight;return r<0&&(r=n.strokeWidth/2),{d:this.opsToPath(t),stroke:n.fill||Nt,strokeWidth:r,fill:Nt}}_mergedShape(t){return t.filter((n,r)=>r===0||n.op!=="move")}},PD=class{constructor(t,n){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new Lc(n)}draw(t){const n=t.sets||[],r=t.options||this.getDefaultOptions(),s=this.ctx,i=t.options.fixedDecimalPlaceDigits;for(const o of n)switch(o.type){case"path":s.save(),s.strokeStyle=r.stroke==="none"?"transparent":r.stroke,s.lineWidth=r.strokeWidth,r.strokeLineDash&&s.setLineDash(r.strokeLineDash),r.strokeLineDashOffset&&(s.lineDashOffset=r.strokeLineDashOffset),this._drawToContext(s,o,i),s.restore();break;case"fillPath":{s.save(),s.fillStyle=r.fill||"";const a=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(s,o,i,a),s.restore();break}case"fillSketch":this.fillSketch(s,o,r)}}fillSketch(t,n,r){let s=r.fillWeight;s<0&&(s=r.strokeWidth/2),t.save(),r.fillLineDash&&t.setLineDash(r.fillLineDash),r.fillLineDashOffset&&(t.lineDashOffset=r.fillLineDashOffset),t.strokeStyle=r.fill||"",t.lineWidth=s,this._drawToContext(t,n,r.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,n,r,s="nonzero"){t.beginPath();for(const i of n.ops){const o=typeof r=="number"&&r>=0?i.data.map(a=>+a.toFixed(r)):i.data;switch(i.op){case"move":t.moveTo(o[0],o[1]);break;case"bcurveTo":t.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5]);break;case"lineTo":t.lineTo(o[0],o[1])}}n.type==="fillPath"?t.fill(s):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,n,r,s,i){const o=this.gen.line(t,n,r,s,i);return this.draw(o),o}rectangle(t,n,r,s,i){const o=this.gen.rectangle(t,n,r,s,i);return this.draw(o),o}ellipse(t,n,r,s,i){const o=this.gen.ellipse(t,n,r,s,i);return this.draw(o),o}circle(t,n,r,s){const i=this.gen.circle(t,n,r,s);return this.draw(i),i}linearPath(t,n){const r=this.gen.linearPath(t,n);return this.draw(r),r}polygon(t,n){const r=this.gen.polygon(t,n);return this.draw(r),r}arc(t,n,r,s,i,o,a=!1,l){const c=this.gen.arc(t,n,r,s,i,o,a,l);return this.draw(c),c}curve(t,n){const r=this.gen.curve(t,n);return this.draw(r),r}path(t,n){const r=this.gen.path(t,n);return this.draw(r),r}};const ul="http://www.w3.org/2000/svg";class ED{constructor(t,n){this.svg=t,this.gen=new Lc(n)}draw(t){const n=t.sets||[],r=t.options||this.getDefaultOptions(),s=this.svg.ownerDocument||window.document,i=s.createElementNS(ul,"g"),o=t.options.fixedDecimalPlaceDigits;for(const a of n){let l=null;switch(a.type){case"path":l=s.createElementNS(ul,"path"),l.setAttribute("d",this.opsToPath(a,o)),l.setAttribute("stroke",r.stroke),l.setAttribute("stroke-width",r.strokeWidth+""),l.setAttribute("fill","none"),r.strokeLineDash&&l.setAttribute("stroke-dasharray",r.strokeLineDash.join(" ").trim()),r.strokeLineDashOffset&&l.setAttribute("stroke-dashoffset",`${r.strokeLineDashOffset}`);break;case"fillPath":l=s.createElementNS(ul,"path"),l.setAttribute("d",this.opsToPath(a,o)),l.setAttribute("stroke","none"),l.setAttribute("stroke-width","0"),l.setAttribute("fill",r.fill||""),t.shape!=="curve"&&t.shape!=="polygon"||l.setAttribute("fill-rule","evenodd");break;case"fillSketch":l=this.fillSketch(s,a,r)}l&&i.appendChild(l)}return i}fillSketch(t,n,r){let s=r.fillWeight;s<0&&(s=r.strokeWidth/2);const i=t.createElementNS(ul,"path");return i.setAttribute("d",this.opsToPath(n,r.fixedDecimalPlaceDigits)),i.setAttribute("stroke",r.fill||""),i.setAttribute("stroke-width",s+""),i.setAttribute("fill","none"),r.fillLineDash&&i.setAttribute("stroke-dasharray",r.fillLineDash.join(" ").trim()),r.fillLineDashOffset&&i.setAttribute("stroke-dashoffset",`${r.fillLineDashOffset}`),i}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,n){return this.gen.opsToPath(t,n)}line(t,n,r,s,i){const o=this.gen.line(t,n,r,s,i);return this.draw(o)}rectangle(t,n,r,s,i){const o=this.gen.rectangle(t,n,r,s,i);return this.draw(o)}ellipse(t,n,r,s,i){const o=this.gen.ellipse(t,n,r,s,i);return this.draw(o)}circle(t,n,r,s){const i=this.gen.circle(t,n,r,s);return this.draw(i)}linearPath(t,n){const r=this.gen.linearPath(t,n);return this.draw(r)}polygon(t,n){const r=this.gen.polygon(t,n);return this.draw(r)}arc(t,n,r,s,i,o,a=!1,l){const c=this.gen.arc(t,n,r,s,i,o,a,l);return this.draw(c)}curve(t,n){const r=this.gen.curve(t,n);return this.draw(r)}path(t,n){const r=this.gen.path(t,n);return this.draw(r)}}var TD={canvas:(e,t)=>new PD(e,t),svg:(e,t)=>new ED(e,t),generator:e=>new Lc(e),newSeed:()=>Lc.newSeed()};const jm=b.createContext({});function Pm(e){const t=b.useRef(null);return t.current===null&&(t.current=e()),t.current}const ND=typeof window<"u",Vk=ND?b.useLayoutEffect:b.useEffect,bu=b.createContext(null);function Em(e,t){e.indexOf(t)===-1&&e.push(t)}function Dc(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Fn=(e,t,n)=>n>t?t:n<e?e:n;let Tm=()=>{};const Ur={},Uk=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Wk=e=>typeof e=="object"&&e!==null,Hk=e=>/^0[^.\s]+$/u.test(e);function Gk(e){let t;return()=>(t===void 0&&(t=e()),t)}const tn=e=>e,Ca=(...e)=>e.reduce((t,n)=>r=>n(t(r))),fa=(e,t,n)=>{const r=t-e;return r?(n-e)/r:1};class Nm{constructor(){this.subscriptions=[]}add(t){return Em(this.subscriptions,t),()=>Dc(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let i=0;i<s;i++){const o=this.subscriptions[i];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Ft=e=>e*1e3,Zt=e=>e/1e3,Kk=(e,t)=>t?e*(1e3/t):0,qk=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,RD=1e-7,ID=12;function AD(e,t,n,r,s){let i,o,a=0;do o=t+(n-t)/2,i=qk(o,r,s)-e,i>0?n=o:t=o;while(Math.abs(i)>RD&&++a<ID);return o}function ja(e,t,n,r){if(e===t&&n===r)return tn;const s=i=>AD(i,0,1,e,n);return i=>i===0||i===1?i:qk(s(i),t,r)}const Qk=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Yk=e=>t=>1-e(1-t),Xk=ja(.33,1.53,.69,.99),Rm=Yk(Xk),Jk=Qk(Rm),Zk=e=>e>=1?1:(e*=2)<1?.5*Rm(e):.5*(2-Math.pow(2,-10*(e-1))),Im=e=>1-Math.sin(Math.acos(e)),e_=Yk(Im),t_=Qk(Im),MD=ja(.42,0,1,1),LD=ja(0,0,.58,1),n_=ja(.42,0,.58,1),DD=e=>Array.isArray(e)&&typeof e[0]!="number",r_=e=>Array.isArray(e)&&typeof e[0]=="number",FD={linear:tn,easeIn:MD,easeInOut:n_,easeOut:LD,circIn:Im,circInOut:t_,circOut:e_,backIn:Rm,backInOut:Jk,backOut:Xk,anticipate:Zk},OD=e=>typeof e=="string",rv=e=>{if(r_(e)){Tm(e.length===4);const[t,n,r,s]=e;return ja(t,n,r,s)}else if(OD(e))return FD[e];return e},dl=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function zD(e,t){let n=new Set,r=new Set,s=!1,i=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(u){o.has(u)&&(c.schedule(u),e()),u(a)}const c={schedule:(u,f=!1,p=!1)=>{const m=p&&s?n:r;return f&&o.add(u),m.add(u),u},cancel:u=>{r.delete(u),o.delete(u)},process:u=>{if(a=u,s){i=!0;return}s=!0;const f=n;n=r,r=f,n.forEach(l),n.clear(),s=!1,i&&(i=!1,c.process(u))}};return c}const $D=40;function s_(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=dl.reduce((w,k)=>(w[k]=zD(i),w),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:u,update:f,preRender:p,render:h,postRender:m}=o,y=()=>{const w=Ur.useManualTiming,k=w?s.timestamp:performance.now();n=!1,w||(s.delta=r?1e3/60:Math.max(Math.min(k-s.timestamp,$D),1)),s.timestamp=k,s.isProcessing=!0,a.process(s),l.process(s),c.process(s),u.process(s),f.process(s),p.process(s),h.process(s),m.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(y))},v=()=>{n=!0,r=!0,s.isProcessing||e(y)};return{schedule:dl.reduce((w,k)=>{const j=o[k];return w[k]=(_,S=!1,P=!1)=>(n||v(),j.schedule(_,S,P)),w},{}),cancel:w=>{for(let k=0;k<dl.length;k++)o[dl[k]].cancel(w)},state:s,steps:o}}const{schedule:xe,cancel:Wr,state:Ye,steps:zd}=s_(typeof requestAnimationFrame<"u"?requestAnimationFrame:tn,!0);let Hl;function BD(){Hl=void 0}const ut={now:()=>(Hl===void 0&&ut.set(Ye.isProcessing||Ur.useManualTiming?Ye.timestamp:performance.now()),Hl),set:e=>{Hl=e,queueMicrotask(BD)}},i_=e=>t=>typeof t=="string"&&t.startsWith(e),o_=i_("--"),VD=i_("var(--"),Am=e=>VD(e)?UD.test(e.split("/*")[0].trim()):!1,UD=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function sv(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Bi={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},ha={...Bi,transform:e=>Fn(0,1,e)},fl={...Bi,default:1},$o=e=>Math.round(e*1e5)/1e5,Mm=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function WD(e){return e==null}const HD=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Lm=(e,t)=>n=>!!(typeof n=="string"&&HD.test(n)&&n.startsWith(e)||t&&!WD(n)&&Object.prototype.hasOwnProperty.call(n,t)),a_=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,a]=r.match(Mm);return{[e]:parseFloat(s),[t]:parseFloat(i),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},GD=e=>Fn(0,255,e),$d={...Bi,transform:e=>Math.round(GD(e))},ys={test:Lm("rgb","red"),parse:a_("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+$d.transform(e)+", "+$d.transform(t)+", "+$d.transform(n)+", "+$o(ha.transform(r))+")"};function KD(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const Ph={test:Lm("#"),parse:KD,transform:ys.transform},Pa=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Hn=Pa("deg"),Ln=Pa("%"),q=Pa("px"),qD=Pa("vh"),QD=Pa("vw"),iv={...Ln,parse:e=>Ln.parse(e)/100,transform:e=>Ln.transform(e*100)},ci={test:Lm("hsl","hue"),parse:a_("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Ln.transform($o(t))+", "+Ln.transform($o(n))+", "+$o(ha.transform(r))+")"},ze={test:e=>ys.test(e)||Ph.test(e)||ci.test(e),parse:e=>ys.test(e)?ys.parse(e):ci.test(e)?ci.parse(e):Ph.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?ys.transform(e):ci.transform(e),getAnimatableNone:e=>{const t=ze.parse(e);return t.alpha=0,ze.transform(t)}},YD=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function XD(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Mm))==null?void 0:t.length)||0)+(((n=e.match(YD))==null?void 0:n.length)||0)>0}const l_="number",c_="color",JD="var",ZD="var(",ov="${}",e3=/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 Ii(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const a=t.replace(e3,l=>(ze.test(l)?(r.color.push(i),s.push(c_),n.push(ze.parse(l))):l.startsWith(ZD)?(r.var.push(i),s.push(JD),n.push(l)):(r.number.push(i),s.push(l_),n.push(parseFloat(l))),++i,ov)).split(ov);return{values:n,split:a,indexes:r,types:s}}function t3(e){return Ii(e).values}function u_({split:e,types:t}){const n=e.length;return r=>{let s="";for(let i=0;i<n;i++)if(s+=e[i],r[i]!==void 0){const o=t[i];o===l_?s+=$o(r[i]):o===c_?s+=ze.transform(r[i]):s+=r[i]}return s}}function n3(e){return u_(Ii(e))}const r3=e=>typeof e=="number"?0:ze.test(e)?ze.getAnimatableNone(e):e,s3=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:r3(e);function i3(e){const t=Ii(e);return u_(t)(t.values.map((r,s)=>s3(r,t.split[s])))}const yn={test:XD,parse:t3,createTransformer:n3,getAnimatableNone:i3};function Bd(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 o3({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,i=0,o=0;if(!t)s=i=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;s=Bd(l,a,e+1/3),i=Bd(l,a,e),o=Bd(l,a,e-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function Fc(e,t){return n=>n>0?t:e}const ye=(e,t,n)=>e+(t-e)*n,Vd=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},a3=[Ph,ys,ci],l3=e=>a3.find(t=>t.test(e));function av(e){const t=l3(e);if(!t)return!1;let n=t.parse(e);return t===ci&&(n=o3(n)),n}const lv=(e,t)=>{const n=av(e),r=av(t);if(!n||!r)return Fc(e,t);const s={...n};return i=>(s.red=Vd(n.red,r.red,i),s.green=Vd(n.green,r.green,i),s.blue=Vd(n.blue,r.blue,i),s.alpha=ye(n.alpha,r.alpha,i),ys.transform(s))},Eh=new Set(["none","hidden"]);function c3(e,t){return Eh.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function u3(e,t){return n=>ye(e,t,n)}function Dm(e){return typeof e=="number"?u3:typeof e=="string"?Am(e)?Fc:ze.test(e)?lv:h3:Array.isArray(e)?d_:typeof e=="object"?ze.test(e)?lv:d3:Fc}function d_(e,t){const n=[...e],r=n.length,s=e.map((i,o)=>Dm(i)(i,t[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function d3(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=Dm(e[s])(e[s],t[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function f3(e,t){const n=[],r={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const i=t.types[s],o=e.indexes[i][r[i]],a=e.values[o]??0;n[s]=a,r[i]++}return n}const h3=(e,t)=>{const n=yn.createTransformer(t),r=Ii(e),s=Ii(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?Eh.has(e)&&!s.values.length||Eh.has(t)&&!r.values.length?c3(e,t):Ca(d_(f3(r,s),s.values),n):Fc(e,t)};function f_(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?ye(e,t,n):Dm(e)(e,t)}const p3=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>xe.update(t,n),stop:()=>Wr(t),now:()=>Ye.isProcessing?Ye.timestamp:ut.now()}},h_=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let i=0;i<s;i++)r+=Math.round(e(i/(s-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Oc=2e4;function Fm(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Oc;)t+=n,r=e.next(t);return t>=Oc?1/0:t}function m3(e,t=100,n){const r=n({...e,keyframes:[0,t]}),s=Math.min(Fm(r),Oc);return{type:"keyframes",ease:i=>r.next(s*i).value/t,duration:Zt(s)}}const Ae={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 Th(e,t){return e*Math.sqrt(1-t*t)}const g3=12;function y3(e,t,n){let r=n;for(let s=1;s<g3;s++)r=r-e(r)/t(r);return r}const Ud=.001;function x3({duration:e=Ae.duration,bounce:t=Ae.bounce,velocity:n=Ae.velocity,mass:r=Ae.mass}){let s,i,o=1-t;o=Fn(Ae.minDamping,Ae.maxDamping,o),e=Fn(Ae.minDuration,Ae.maxDuration,Zt(e)),o<1?(s=c=>{const u=c*o,f=u*e,p=u-n,h=Th(c,o),m=Math.exp(-f);return Ud-p/h*m},i=c=>{const f=c*o*e,p=f*n+n,h=Math.pow(o,2)*Math.pow(c,2)*e,m=Math.exp(-f),y=Th(Math.pow(c,2),o);return(-s(c)+Ud>0?-1:1)*((p-h)*m)/y}):(s=c=>{const u=Math.exp(-c*e),f=(c-n)*e+1;return-Ud+u*f},i=c=>{const u=Math.exp(-c*e),f=(n-c)*(e*e);return u*f});const a=5/e,l=y3(s,i,a);if(e=Ft(e),isNaN(l))return{stiffness:Ae.stiffness,damping:Ae.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:o*2*Math.sqrt(r*c),duration:e}}}const v3=["duration","bounce"],w3=["stiffness","damping","mass"];function cv(e,t){return t.some(n=>e[n]!==void 0)}function b3(e){let t={velocity:Ae.velocity,stiffness:Ae.stiffness,damping:Ae.damping,mass:Ae.mass,isResolvedFromDuration:!1,...e};if(!cv(e,w3)&&cv(e,v3))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*Fn(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:Ae.mass,stiffness:s,damping:i}}else{const n=x3({...e,velocity:0});t={...t,...n,mass:Ae.mass},t.isResolvedFromDuration=!0}return t}function zc(e=Ae.visualDuration,t=Ae.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:i},{stiffness:l,damping:c,mass:u,duration:f,velocity:p,isResolvedFromDuration:h}=b3({...n,velocity:-Zt(n.velocity||0)}),m=p||0,y=c/(2*Math.sqrt(l*u)),v=o-i,g=Zt(Math.sqrt(l/u)),x=Math.abs(v)<5;r||(r=x?Ae.restSpeed.granular:Ae.restSpeed.default),s||(s=x?Ae.restDelta.granular:Ae.restDelta.default);let w,k,j,_,S,P;if(y<1)j=Th(g,y),_=(m+y*g*v)/j,w=E=>{const I=Math.exp(-y*g*E);return o-I*(_*Math.sin(j*E)+v*Math.cos(j*E))},S=y*g*_+v*j,P=y*g*v-_*j,k=E=>Math.exp(-y*g*E)*(S*Math.sin(j*E)+P*Math.cos(j*E));else if(y===1){w=I=>o-Math.exp(-g*I)*(v+(m+g*v)*I);const E=m+g*v;k=I=>Math.exp(-g*I)*(g*E*I-m)}else{const E=g*Math.sqrt(y*y-1);w=M=>{const N=Math.exp(-y*g*M),z=Math.min(E*M,300);return o-N*((m+y*g*v)*Math.sinh(z)+E*v*Math.cosh(z))/E};const I=(m+y*g*v)/E,A=y*g*I-v*E,O=y*g*v-I*E;k=M=>{const N=Math.exp(-y*g*M),z=Math.min(E*M,300);return N*(A*Math.sinh(z)+O*Math.cosh(z))}}const T={calculatedDuration:h&&f||null,velocity:E=>Ft(k(E)),next:E=>{if(!h&&y<1){const A=Math.exp(-y*g*E),O=Math.sin(j*E),M=Math.cos(j*E),N=o-A*(_*O+v*M),z=Ft(A*(S*O+P*M));return a.done=Math.abs(z)<=r&&Math.abs(o-N)<=s,a.value=a.done?o:N,a}const I=w(E);if(h)a.done=E>=f;else{const A=Ft(k(E));a.done=Math.abs(A)<=r&&Math.abs(o-I)<=s}return a.value=a.done?o:I,a},toString:()=>{const E=Math.min(Fm(T),Oc),I=h_(A=>T.next(E*A).value,E,30);return E+"ms "+I},toTransition:()=>{}};return T}zc.applyToOptions=e=>{const t=m3(e,100,zc);return e.ease=t.ease,e.duration=Ft(t.duration),e.type="keyframes",e};const k3=5;function p_(e,t,n){const r=Math.max(t-k3,0);return Kk(n-e(r),t-r)}function Nh({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:u}){const f=e[0],p={done:!1,value:f},h=P=>a!==void 0&&P<a||l!==void 0&&P>l,m=P=>a===void 0?l:l===void 0||Math.abs(a-P)<Math.abs(l-P)?a:l;let y=n*t;const v=f+y,g=o===void 0?v:o(v);g!==v&&(y=g-f);const x=P=>-y*Math.exp(-P/r),w=P=>g+x(P),k=P=>{const T=x(P),E=w(P);p.done=Math.abs(T)<=c,p.value=p.done?g:E};let j,_;const S=P=>{h(p.value)&&(j=P,_=zc({keyframes:[p.value,m(p.value)],velocity:p_(w,P,p.value),damping:s,stiffness:i,restDelta:c,restSpeed:u}))};return S(0),{calculatedDuration:null,next:P=>{let T=!1;return!_&&j===void 0&&(T=!0,k(P),S(P)),j!==void 0&&P>=j?_.next(P-j):(!T&&k(P),p)}}}function _3(e,t,n){const r=[],s=n||Ur.mix||f_,i=e.length-1;for(let o=0;o<i;o++){let a=s(e[o],e[o+1]);if(t){const l=Array.isArray(t)?t[o]||tn:t;a=Ca(l,a)}r.push(a)}return r}function S3(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const i=e.length;if(Tm(i===t.length),i===1)return()=>t[0];if(i===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=_3(t,r,s),l=a.length,c=u=>{if(o&&u<e[0])return t[0];let f=0;if(l>1)for(;f<e.length-2&&!(u<e[f+1]);f++);const p=fa(e[f],e[f+1],u);return a[f](p)};return n?u=>c(Fn(e[0],e[i-1],u)):c}function C3(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=fa(0,t,r);e.push(ye(n,1,s))}}function j3(e){const t=[0];return C3(t,e.length-1),t}function P3(e,t){return e.map(n=>n*t)}function E3(e,t){return e.map(()=>t||n_).splice(0,e.length-1)}function Bo({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=DD(r)?r.map(rv):rv(r),i={done:!1,value:t[0]},o=P3(n&&n.length===t.length?n:j3(t),e),a=S3(o,t,{ease:Array.isArray(s)?s:E3(t,s)});return{calculatedDuration:e,next:l=>(i.value=a(l),i.done=l>=e,i)}}const T3=e=>e!==null;function ku(e,{repeat:t,repeatType:n="loop"},r,s=1){const i=e.filter(T3),a=s<0||t&&n!=="loop"&&t%2===1?0:i.length-1;return!a||r===void 0?i[a]:r}const N3={decay:Nh,inertia:Nh,tween:Bo,keyframes:Bo,spring:zc};function m_(e){typeof e.type=="string"&&(e.type=N3[e.type])}class Om{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 R3=e=>e/100;class $c extends Om{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var r,s;const{motionValue:n}=this.options;n&&n.updatedAt!==ut.now()&&this.tick(ut.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(r=this.options).onStop)==null||s.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;m_(t);const{type:n=Bo,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:o=0}=t;let{keyframes:a}=t;const l=n||Bo;l!==Bo&&typeof a[0]!="number"&&(this.mixKeyframes=Ca(R3,f_(a[0],a[1])),a=[0,100]);const c=l({...t,keyframes:a});i==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...a].reverse(),velocity:-o})),c.calculatedDuration===null&&(c.calculatedDuration=Fm(c));const{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=c}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:s,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return r.next(0);const{delay:c=0,keyframes:u,repeat:f,repeatType:p,repeatDelay:h,type:m,onUpdate:y,finalKeyframe:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),x=this.playbackSpeed>=0?g<0:g>s;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let w=this.currentTime,k=r;if(f){const P=Math.min(this.currentTime,s)/a;let T=Math.floor(P),E=P%1;!E&&P>=1&&(E=1),E===1&&T--,T=Math.min(T,f+1),!!(T%2)&&(p==="reverse"?(E=1-E,h&&(E-=h/a)):p==="mirror"&&(k=o)),w=Fn(0,1,E)*a}let j;x?(this.delayState.value=u[0],j=this.delayState):j=k.next(w),i&&!x&&(j.value=i(j.value));let{done:_}=j;!x&&l!==null&&(_=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const S=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&_);return S&&m!==Nh&&(j.value=ku(u,this.options,v,this.speed)),y&&y(j.value),S&&this.finish(),j}then(t,n){return this.finished.then(t,n)}get duration(){return Zt(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Zt(t)}get time(){return Zt(this.currentTime)}set time(t){t=Ft(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const n=this.generator.next(t).value;return p_(r=>this.generator.next(r).value,t,n)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(ut.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=Zt(this.currentTime))}play(){var s,i;if(this.isStopped)return;const{driver:t=p3,startTime:n}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),(i=(s=this.options).onPlay)==null||i.call(s);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(ut.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function I3(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const xs=e=>e*180/Math.PI,Rh=e=>{const t=xs(Math.atan2(e[1],e[0]));return Ih(t)},A3={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Rh,rotateZ:Rh,skewX:e=>xs(Math.atan(e[1])),skewY:e=>xs(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Ih=e=>(e=e%360,e<0&&(e+=360),e),uv=Rh,dv=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),fv=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),M3={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:dv,scaleY:fv,scale:e=>(dv(e)+fv(e))/2,rotateX:e=>Ih(xs(Math.atan2(e[6],e[5]))),rotateY:e=>Ih(xs(Math.atan2(-e[2],e[0]))),rotateZ:uv,rotate:uv,skewX:e=>xs(Math.atan(e[4])),skewY:e=>xs(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Ah(e){return e.includes("scale")?1:0}function Mh(e,t){if(!e||e==="none")return Ah(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=M3,s=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=A3,s=a}if(!s)return Ah(t);const i=r[t],o=s[1].split(",").map(D3);return typeof i=="function"?i(o):o[i]}const L3=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Mh(n,t)};function D3(e){return parseFloat(e.trim())}const Vi=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ui=new Set([...Vi,"pathRotation"]),hv=e=>e===Bi||e===q,F3=new Set(["x","y","z"]),O3=Vi.filter(e=>!F3.has(e));function z3(e){const t=[];return O3.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Tr={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:r})=>{const s=e.max-e.min;return r==="border-box"?s:s-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:r})=>{const s=e.max-e.min;return r==="border-box"?s:s-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Mh(t,"x"),y:(e,{transform:t})=>Mh(t,"y")};Tr.translateX=Tr.x;Tr.translateY=Tr.y;const Cs=new Set;let Lh=!1,Dh=!1,Fh=!1;function g_(){if(Dh){const e=Array.from(Cs).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=z3(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([i,o])=>{var a;(a=r.getValue(i))==null||a.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Dh=!1,Lh=!1,Cs.forEach(e=>e.complete(Fh)),Cs.clear()}function y_(){Cs.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Dh=!0)})}function $3(){Fh=!0,y_(),g_(),Fh=!1}class zm{constructor(t,n,r,s,i,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=i,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(Cs.add(this),Lh||(Lh=!0,xe.read(y_),xe.resolveKeyframes(g_))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;if(t[0]===null){const i=s==null?void 0:s.get(),o=t[t.length-1];if(i!==void 0)t[0]=i;else if(r&&n){const a=r.readValue(n,o);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=o),s&&i===void 0&&s.set(t[0])}I3(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Cs.delete(this)}cancel(){this.state==="scheduled"&&(Cs.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const B3=e=>e.startsWith("--");function x_(e,t,n){B3(t)?e.style.setProperty(t,n):e.style[t]=n}const V3={};function v_(e,t){const n=Gk(e);return()=>V3[t]??n()}const U3=v_(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),w_=v_(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Co=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,pv={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Co([0,.65,.55,1]),circOut:Co([.55,0,1,.45]),backIn:Co([.31,.01,.66,-.59]),backOut:Co([.33,1.53,.69,.99])};function b_(e,t){if(e)return typeof e=="function"?w_()?h_(e,t):"ease-out":r_(e)?Co(e):Array.isArray(e)?e.map(n=>b_(n,t)||pv.easeOut):pv[e]}function W3(e,t,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:o="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[t]:n};l&&(u.offset=l);const f=b_(a,s);Array.isArray(f)&&(u.easing=f);const p={delay:r,duration:s,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"};return c&&(p.pseudoElement=c),e.animate(u,p)}function k_(e){return typeof e=="function"&&"applyToOptions"in e}function H3({type:e,...t}){return k_(e)&&w_()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class __ extends Om{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:r,keyframes:s,pseudoElement:i,allowFlatten:o=!1,finalKeyframe:a,onComplete:l}=t;this.isPseudoElement=!!i,this.allowFlatten=o,this.options=t,Tm(typeof t.type!="string");const c=H3(t);this.animation=W3(n,r,s,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const u=ku(s,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(u),x_(n,r,u),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,r,s;const t=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((s=(r=this.animation).commitStyles)==null||s.call(r))}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return Zt(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Zt(t)}get time(){return Zt(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Ft(t),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:r,observe:s}){var i;return this.allowFlatten&&((i=this.animation.effect)==null||i.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&U3()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),tn):s(this)}}const S_={anticipate:Zk,backInOut:Jk,circInOut:t_};function G3(e){return e in S_}function K3(e){typeof e.ease=="string"&&G3(e.ease)&&(e.ease=S_[e.ease])}const Wd=10;class q3 extends __{constructor(t){K3(t),m_(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:s,element:i,...o}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new $c({...o,autoplay:!1}),l=Math.max(Wd,ut.now()-this.startTime),c=Fn(0,Wd,l-Wd),u=a.sample(l).value,{name:f}=this.options;i&&f&&x_(i,f,u),n.setWithVelocity(a.sample(Math.max(0,l-c)).value,u,c),a.stop()}}const mv=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(yn.test(e)||e==="0")&&!e.startsWith("url("));function Q3(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 Y3(e,t,n,r){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],o=mv(s,t),a=mv(i,t);return!o||!a?!1:Q3(e)||(n==="spring"||k_(n))&&r}function Oh(e){e.duration=0,e.type="keyframes"}const C_=new Set(["opacity","clipPath","filter","transform"]),X3=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function J3(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&X3.test(e[t]))return!0;return!1}const Z3=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),eF=Gk(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function tF(e){var f;const{motionValue:t,name:n,repeatDelay:r,repeatType:s,damping:i,type:o,keyframes:a}=e;if(!(((f=t==null?void 0:t.owner)==null?void 0:f.current)instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=t.owner.getProps();return eF()&&n&&(C_.has(n)||Z3.has(n)&&J3(a))&&(n!=="transform"||!u)&&!c&&!r&&s!=="mirror"&&i!==0&&o!=="inertia"}const nF=40;class rF extends Om{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o="loop",keyframes:a,name:l,motionValue:c,element:u,...f}){var m;super(),this.stop=()=>{var y,v;this._animation&&(this._animation.stop(),(y=this.stopTimeline)==null||y.call(this)),(v=this.keyframeResolver)==null||v.cancel()},this.createdAt=ut.now();const p={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:o,name:l,motionValue:c,element:u,...f},h=(u==null?void 0:u.KeyframeResolver)||zm;this.keyframeResolver=new h(a,(y,v,g)=>this.onKeyframesResolved(y,v,p,!g),l,c,u),(m=this.keyframeResolver)==null||m.scheduleResolve()}onKeyframesResolved(t,n,r,s){var g,x;this.keyframeResolver=void 0;const{name:i,type:o,velocity:a,delay:l,isHandoff:c,onUpdate:u}=r;this.resolvedAt=ut.now();let f=!0;Y3(t,i,o,a)||(f=!1,(Ur.instantAnimations||!l)&&(u==null||u(ku(t,r,n))),t[0]=t[t.length-1],Oh(r),r.repeat=0);const h={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>nF?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},m=f&&!c&&tF(h),y=(x=(g=h.motionValue)==null?void 0:g.owner)==null?void 0:x.current;let v;if(m)try{v=new q3({...h,element:y})}catch{v=new $c(h)}else v=new $c(h);v.finished.then(()=>{this.notifyFinished()}).catch(tn),this.pendingTimeline&&(this.stopTimeline=v.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=v}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),$3()),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 j_(e,t,n,r=0,s=1){const i=Array.from(e).sort((c,u)=>c.sortNodePosition(u)).indexOf(t),o=e.size,a=(o-1)*r;return typeof n=="function"?n(i,o):s===1?i*r:a-i*r}const gv=30,sF=e=>!isNaN(parseFloat(e));class iF{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const s=ut.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((i=this.events.change)==null||i.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=ut.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=sF(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 Nm);const r=this.events[t].add(n);return t==="change"?()=>{r(),xe.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=ut.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>gv)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,gv);return Kk(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 Ai(e,t){return new iF(e,t)}function P_(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function $m(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?P_(n,e):n}const oF={type:"spring",stiffness:500,damping:25,restSpeed:10},aF=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),lF={type:"keyframes",duration:.8},cF={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},uF=(e,{keyframes:t})=>t.length>2?lF:Ui.has(e)?e.startsWith("scale")?aF(t[1]):oF:cF,dF=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function fF(e){for(const t in e)if(!dF.has(t))return!0;return!1}const Bm=(e,t,n,r={},s,i)=>o=>{const a=$m(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-Ft(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:p=>{t.set(p),a.onUpdate&&a.onUpdate(p)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:i?void 0:s};fF(a)||Object.assign(u,uF(e,u)),u.duration&&(u.duration=Ft(u.duration)),u.repeatDelay&&(u.repeatDelay=Ft(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let f=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(Oh(u),u.delay===0&&(f=!0)),(Ur.instantAnimations||Ur.skipAnimations||s!=null&&s.shouldSkipAnimations||a.skipAnimations)&&(f=!0,Oh(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,f&&!i&&t.get()!==void 0){const p=ku(u.keyframes,a);if(p!==void 0){xe.update(()=>{u.onUpdate(p),u.onComplete()});return}}return a.isSync?new $c(u):new rF(u)},hF=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function pF(e){const t=hF.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function E_(e,t,n=1){const[r,s]=pF(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const o=i.trim();return Uk(o)?parseFloat(o):o}return Am(s)?E_(s,t,n+1):s}function yv(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Vm(e,t,n,r){if(typeof t=="function"){const[s,i]=yv(r);t=t(n!==void 0?n:e.custom,s,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,i]=yv(r);t=t(n!==void 0?n:e.custom,s,i)}return t}function js(e,t,n){const r=e.getProps();return Vm(r,t,n!==void 0?n:r.custom,e)}const T_=new Set(["width","height","top","left","right","bottom",...Vi]),zh=e=>Array.isArray(e);function mF(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Ai(n))}function gF(e){return zh(e)?e[e.length-1]||0:e}function yF(e,t){const n=js(e,t);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const a=gF(i[o]);mF(e,o,a)}}const Xe=e=>!!(e&&e.getVelocity);function xF(e){return!!(Xe(e)&&e.add)}function $h(e,t){const n=e.getValue("willChange");if(xF(n))return n.add(t);if(!n&&Ur.WillChange){const r=new Ur.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Um(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const vF="framerAppearId",N_="data-"+Um(vF);function R_(e){return e.props[N_]}function wF({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function I_(e,t,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i,transitionEnd:o,...a}=t;const l=e.getDefaultTransition();i=i?P_(i,l):l;const c=i==null?void 0:i.reduceMotion,u=i==null?void 0:i.skipAnimations;r&&(i=r);const f=[],p=s&&e.animationState&&e.animationState.getState()[s],h=i==null?void 0:i.path;h&&h.animateVisualElement(e,a,i,n,f);for(const m in a){const y=e.getValue(m,e.latestValues[m]??null),v=a[m];if(v===void 0||p&&wF(p,m))continue;const g={delay:n,...$m(i||{},m)};u&&(g.skipAnimations=!0);const x=y.get();if(x!==void 0&&!y.isAnimating()&&!Array.isArray(v)&&v===x&&!g.velocity){xe.update(()=>y.set(v));continue}let w=!1;if(window.MotionHandoffAnimation){const _=R_(e);if(_){const S=window.MotionHandoffAnimation(_,m,xe);S!==null&&(g.startTime=S,w=!0)}}$h(e,m);const k=c??e.shouldReduceMotion;y.start(Bm(m,y,v,k&&T_.has(m)?{type:!1}:g,e,w));const j=y.animation;j&&f.push(j)}if(o){const m=()=>xe.update(()=>{o&&yF(e,o)});f.length?Promise.all(f).then(m):m()}return f}function Bh(e,t,n={}){var l;const r=js(e,t,n.type==="exit"?(l=e.presenceContext)==null?void 0:l.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const i=r?()=>Promise.all(I_(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:f,staggerDirection:p}=s;return bF(e,t,c,u,f,p,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[c,u]=a==="beforeChildren"?[i,o]:[o,i];return c().then(()=>u())}else return Promise.all([i(),o(n.delay)])}function bF(e,t,n=0,r=0,s=0,i=1,o){const a=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),a.push(Bh(l,t,{...o,delay:n+(typeof r=="function"?0:r)+j_(e.variantChildren,l,r,s,i)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(a)}function kF(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(i=>Bh(e,i,n));r=Promise.all(s)}else if(typeof t=="string")r=Bh(e,t,n);else{const s=typeof t=="function"?js(e,t,n.custom):t;r=Promise.all(I_(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const _F={test:e=>e==="auto",parse:e=>e},A_=e=>t=>t.test(e),M_=[Bi,q,Ln,Hn,QD,qD,_F],xv=e=>M_.find(A_(e));function SF(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Hk(e):!0}const CF=new Set(["brightness","contrast","saturate","opacity"]);function jF(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Mm)||[];if(!r)return e;const s=n.replace(r,"");let i=CF.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+s+")"}const PF=/\b([a-z-]*)\(.*?\)/gu,Vh={...yn,getAnimatableNone:e=>{const t=e.match(PF);return t?t.map(jF).join(" "):e}},Uh={...yn,getAnimatableNone:e=>{const t=yn.parse(e);return yn.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},vv={...Bi,transform:Math.round},EF={rotate:Hn,pathRotation:Hn,rotateX:Hn,rotateY:Hn,rotateZ:Hn,scale:fl,scaleX:fl,scaleY:fl,scaleZ:fl,skew:Hn,skewX:Hn,skewY:Hn,distance:q,translateX:q,translateY:q,translateZ:q,x:q,y:q,z:q,perspective:q,transformPerspective:q,opacity:ha,originX:iv,originY:iv,originZ:q},Bc={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,...EF,zIndex:vv,fillOpacity:ha,strokeOpacity:ha,numOctaves:vv},TF={...Bc,color:ze,backgroundColor:ze,outlineColor:ze,fill:ze,stroke:ze,borderColor:ze,borderTopColor:ze,borderRightColor:ze,borderBottomColor:ze,borderLeftColor:ze,filter:Vh,WebkitFilter:Vh,mask:Uh,WebkitMask:Uh},L_=e=>TF[e],NF=new Set([Vh,Uh]);function D_(e,t){let n=L_(e);return NF.has(n)||(n=yn),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const RF=new Set(["auto","none","0"]);function IF(e,t,n){let r=0,s;for(;r<e.length&&!s;){const i=e[r];typeof i=="string"&&!RF.has(i)&&Ii(i).values.length&&(s=e[r]),r++}if(s&&n)for(const i of t)e[i]=D_(n,s)}class AF extends zm{constructor(t,n,r,s,i){super(t,n,r,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let u=0;u<t.length;u++){let f=t[u];if(typeof f=="string"&&(f=f.trim(),Am(f))){const p=E_(f,n.current);p!==void 0&&(t[u]=p),u===t.length-1&&(this.finalKeyframe=f)}}if(this.resolveNoneKeyframes(),!T_.has(r)||t.length!==2)return;const[s,i]=t,o=xv(s),a=xv(i),l=sv(s),c=sv(i);if(l!==c&&Tr[r]){this.needsMeasurement=!0;return}if(o!==a)if(hv(o)&&hv(a))for(let u=0;u<t.length;u++){const f=t[u];typeof f=="string"&&(t[u]=parseFloat(f))}else Tr[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)(t[s]===null||SF(t[s]))&&r.push(s);r.length&&IF(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=Tr[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(r,s).jump(s,!1)}measureEndState(){var a;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const s=t.getValue(n);s&&s.jump(this.measuredOrigin,!1);const i=r.length-1,o=r[i];r[i]=Tr[n](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([l,c])=>{t.getValue(l).set(c)}),this.resolveNoneKeyframes()}}function F_(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const s=(n==null?void 0:n[e])??r.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e).filter(r=>r!=null)}const Wh=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Gl(e){return Wk(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:Wm}=s_(queueMicrotask,!1),dn={x:!1,y:!1};function O_(){return dn.x||dn.y}function MF(e){return e==="x"||e==="y"?dn[e]?null:(dn[e]=!0,()=>{dn[e]=!1}):dn.x||dn.y?null:(dn.x=dn.y=!0,()=>{dn.x=dn.y=!1})}function z_(e,t){const n=F_(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function LF(e){return!(e.pointerType==="touch"||O_())}function DF(e,t,n={}){const[r,s,i]=z_(e,n);return r.forEach(o=>{let a=!1,l=!1,c;const u=()=>{o.removeEventListener("pointerleave",m)},f=v=>{c&&(c(v),c=void 0),u()},p=v=>{a=!1,window.removeEventListener("pointerup",p),window.removeEventListener("pointercancel",p),l&&(l=!1,f(v))},h=()=>{a=!0,window.addEventListener("pointerup",p,s),window.addEventListener("pointercancel",p,s)},m=v=>{if(v.pointerType!=="touch"){if(a){l=!0;return}f(v)}},y=v=>{if(!LF(v))return;l=!1;const g=t(o,v);typeof g=="function"&&(c=g,o.addEventListener("pointerleave",m,s))};o.addEventListener("pointerenter",y,s),o.addEventListener("pointerdown",h,s)}),i}const $_=(e,t)=>t?e===t?!0:$_(e,t.parentElement):!1,Hm=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,FF=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function OF(e){return FF.has(e.tagName)||e.isContentEditable===!0}const zF=new Set(["INPUT","SELECT","TEXTAREA"]);function $F(e){return zF.has(e.tagName)||e.isContentEditable===!0}const Kl=new WeakSet;function wv(e){return t=>{t.key==="Enter"&&e(t)}}function Hd(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const BF=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=wv(()=>{if(Kl.has(n))return;Hd(n,"down");const s=wv(()=>{Hd(n,"up")}),i=()=>Hd(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function bv(e){return Hm(e)&&!O_()}const kv=new WeakSet;function VF(e,t,n={}){const[r,s,i]=z_(e,n),o=a=>{const l=a.currentTarget;if(!bv(a)||kv.has(a))return;Kl.add(l),n.stopPropagation&&kv.add(a);const c=t(l,a),u=(h,m)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",p),Kl.has(l)&&Kl.delete(l),bv(h)&&typeof c=="function"&&c(h,{success:m})},f=h=>{u(h,l===window||l===document||n.useGlobalTarget||$_(l,h.target))},p=h=>{u(h,!1)};window.addEventListener("pointerup",f,s),window.addEventListener("pointercancel",p,s)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,s),Gl(a)&&(a.addEventListener("focus",c=>BF(c,s)),!OF(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),i}function Gm(e){return Wk(e)&&"ownerSVGElement"in e}const ql=new WeakMap;let gr;const B_=(e,t,n)=>(r,s)=>s&&s[0]?s[0][e+"Size"]:Gm(r)&&"getBBox"in r?r.getBBox()[t]:r[n],UF=B_("inline","width","offsetWidth"),WF=B_("block","height","offsetHeight");function HF({target:e,borderBoxSize:t}){var n;(n=ql.get(e))==null||n.forEach(r=>{r(e,{get width(){return UF(e,t)},get height(){return WF(e,t)}})})}function GF(e){e.forEach(HF)}function KF(){typeof ResizeObserver>"u"||(gr=new ResizeObserver(GF))}function qF(e,t){gr||KF();const n=F_(e);return n.forEach(r=>{let s=ql.get(r);s||(s=new Set,ql.set(r,s)),s.add(t),gr==null||gr.observe(r)}),()=>{n.forEach(r=>{const s=ql.get(r);s==null||s.delete(t),s!=null&&s.size||gr==null||gr.unobserve(r)})}}const Ql=new Set;let ui;function QF(){ui=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Ql.forEach(t=>t(e))},window.addEventListener("resize",ui)}function YF(e){return Ql.add(e),ui||QF(),()=>{Ql.delete(e),!Ql.size&&typeof ui=="function"&&(window.removeEventListener("resize",ui),ui=void 0)}}function _v(e,t){return typeof e=="function"?YF(e):qF(e,t)}function XF(e){return Gm(e)&&e.tagName==="svg"}const JF=[...M_,ze,yn],ZF=e=>JF.find(A_(e)),Sv=()=>({translate:0,scale:1,origin:0,originPoint:0}),di=()=>({x:Sv(),y:Sv()}),Cv=()=>({min:0,max:0}),Be=()=>({x:Cv(),y:Cv()}),eO=new WeakMap;function _u(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function pa(e){return typeof e=="string"||Array.isArray(e)}const Km=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],qm=["initial",...Km];function Su(e){return _u(e.animate)||qm.some(t=>pa(e[t]))}function V_(e){return!!(Su(e)||e.variants)}function tO(e,t,n){for(const r in t){const s=t[r],i=n[r];if(Xe(s))e.addValue(r,s);else if(Xe(i))e.addValue(r,Ai(s,{owner:e}));else if(i!==s)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=e.getStaticValue(r);e.addValue(r,Ai(o!==void 0?o:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Vc={current:null},Qm={current:!1},nO=typeof window<"u";function U_(){if(Qm.current=!0,!!nO)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Vc.current=e.matches;e.addEventListener("change",t),t()}else Vc.current=!1}const jv=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Uc={};function W_(e){Uc=e}function rO(){return Uc}class sO{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,skipAnimations:i,blockInitialAnimation:o,visualState:a},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=zm,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const h=ut.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,xe.render(this.render,!1,!0))};const{latestValues:c,renderState:u}=a;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=u,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=i,this.options=l,this.blockInitialAnimation=!!o,this.isControllingVariants=Su(n),this.isVariantNode=V_(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:f,...p}=this.scrapeMotionValuesFromProps(n,{},this);for(const h in p){const m=p[h];c[h]!==void 0&&Xe(m)&&m.set(c[h])}}mount(t){var n,r;if(this.hasBeenMounted)for(const s in this.initialValues)(n=this.values.get(s))==null||n.jump(this.initialValues[s]),this.latestValues[s]=this.initialValues[s];this.current=t,eO.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((s,i)=>this.bindToMotionValue(i,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Qm.current||U_(),this.shouldReduceMotion=Vc.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(),Wr(this.notifyUpdate),Wr(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&&C_.has(t)&&this.current instanceof HTMLElement){const{factory:o,keyframes:a,times:l,ease:c,duration:u}=n.accelerate,f=new __({element:this.current,name:t,keyframes:a,times:l,ease:c,duration:Ft(u)}),p=o(f);this.valueSubscriptions.set(t,()=>{p(),f.cancel()});return}const r=Ui.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&xe.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;typeof window<"u"&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),i&&i()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Uc){const n=Uc[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Be()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<jv.length;r++){const s=jv[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const i="on"+s,o=t[i];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=tO(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=Ai(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"&&(Uk(r)||Hk(r))?r=parseFloat(r):!ZF(r)&&yn.test(n)&&(r=D_(t,n)),this.setBaseTarget(t,Xe(r)?r.get():r)),Xe(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var i;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=Vm(this.props,n,(i=this.presenceContext)==null?void 0:i.custom);o&&(r=o[t])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!Xe(s)?s:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Nm),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Wm.render(this.render)}}class H_ extends sO{constructor(){super(...arguments),this.KeyframeResolver=AF}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const r=t.style;return r?r[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Xe(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Jr{constructor(t){this.isMounted=!1,this.node=t}update(){}}function G_({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function iO({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function oO(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 Gd(e){return e===void 0||e===1}function Hh({scale:e,scaleX:t,scaleY:n}){return!Gd(e)||!Gd(t)||!Gd(n)}function cs(e){return Hh(e)||K_(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function K_(e){return Pv(e.x)||Pv(e.y)}function Pv(e){return e&&e!=="0%"}function Wc(e,t,n){const r=e-n,s=t*r;return n+s}function Ev(e,t,n,r,s){return s!==void 0&&(e=Wc(e,s,r)),Wc(e,n,r)+t}function Gh(e,t=0,n=1,r,s){e.min=Ev(e.min,t,n,r,s),e.max=Ev(e.max,t,n,r,s)}function q_(e,{x:t,y:n}){Gh(e.x,t.translate,t.scale,t.originPoint),Gh(e.y,n.translate,n.scale,n.originPoint)}const Tv=.999999999999,Nv=1.0000000000001;function aO(e,t,n,r=!1){var a;const s=n.length;if(!s)return;t.x=t.y=1;let i,o;for(let l=0;l<s;l++){i=n[l],o=i.projectionDelta;const{visualElement:c}=i.options;c&&c.props.style&&c.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&(Nn(e.x,-i.scroll.offset.x),Nn(e.y,-i.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,q_(e,o)),r&&cs(i.latestValues)&&Yl(e,i.latestValues,(a=i.layout)==null?void 0:a.layoutBox))}t.x<Nv&&t.x>Tv&&(t.x=1),t.y<Nv&&t.y>Tv&&(t.y=1)}function Nn(e,t){e.min+=t,e.max+=t}function Rv(e,t,n,r,s=.5){const i=ye(e.min,e.max,s);Gh(e,t,n,i,r)}function Iv(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function Yl(e,t,n){const r=n??e;Rv(e.x,Iv(t.x,r.x),t.scaleX,t.scale,t.originX),Rv(e.y,Iv(t.y,r.y),t.scaleY,t.scale,t.originY)}function Q_(e,t){return G_(oO(e.getBoundingClientRect(),t))}function lO(e,t,n){const r=Q_(e,n),{scroll:s}=t;return s&&(Nn(r.x,s.offset.x),Nn(r.y,s.offset.y)),r}const cO={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},uO=Vi.length;function dO(e,t,n){let r="",s=!0;for(let o=0;o<uO;o++){const a=Vi[o],l=e[a];if(l===void 0)continue;let c=!0;if(typeof l=="number")c=l===(a.startsWith("scale")?1:0);else{const u=parseFloat(l);c=a.startsWith("scale")?u===1:u===0}if(!c||n){const u=Wh(l,Bc[a]);if(!c){s=!1;const f=cO[a]||a;r+=`${f}(${u}) `}n&&(t[a]=u)}}const i=e.pathRotation;return i&&(s=!1,r+=`rotate(${Wh(i,Bc.pathRotation)}) `),r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function Ym(e,t,n){const{style:r,vars:s,transformOrigin:i}=e;let o=!1,a=!1;for(const l in t){const c=t[l];if(Ui.has(l)){o=!0;continue}else if(o_(l)){s[l]=c;continue}else{const u=Wh(c,Bc[l]);l.startsWith("origin")?(a=!0,i[l]=u):r[l]=u}}if(t.transform||(o||n?r.transform=dO(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=i;r.transformOrigin=`${l} ${c} ${u}`}}function Y_(e,{style:t,vars:n},r,s){const i=e.style;let o;for(o in t)i[o]=t[o];s==null||s.applyProjectionStyles(i,r);for(o in n)i.setProperty(o,n[o])}function Av(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const go={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(q.test(e))e=parseFloat(e);else return e;const n=Av(e,t.target.x),r=Av(e,t.target.y);return`${n}% ${r}%`}},fO={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=yn.parse(e);if(s.length>5)return r;const i=yn.createTransformer(e),o=typeof s[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;s[0+o]/=a,s[1+o]/=l;const c=ye(a,l,.5);return typeof s[2+o]=="number"&&(s[2+o]/=c),typeof s[3+o]=="number"&&(s[3+o]/=c),i(s)}},Kh={borderRadius:{...go,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:go,borderTopRightRadius:go,borderBottomLeftRadius:go,borderBottomRightRadius:go,boxShadow:fO};function X_(e,{layout:t,layoutId:n}){return Ui.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Kh[e]||e==="opacity")}function Xm(e,t,n){var o;const r=e.style,s=t==null?void 0:t.style,i={};if(!r)return i;for(const a in r)(Xe(r[a])||s&&Xe(s[a])||X_(a,e)||((o=n==null?void 0:n.getValue(a))==null?void 0:o.liveStyle)!==void 0)&&(i[a]=r[a]);return i}function hO(e){return window.getComputedStyle(e)}class pO extends H_{constructor(){super(...arguments),this.type="html",this.renderInstance=Y_}readValueFromInstance(t,n){var r;if(Ui.has(n))return(r=this.projection)!=null&&r.isProjecting?Ah(n):L3(t,n);{const s=hO(t),i=(o_(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Q_(t,n)}build(t,n,r){Ym(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Xm(t,n,r)}}const mO={offset:"stroke-dashoffset",array:"stroke-dasharray"},gO={offset:"strokeDashoffset",array:"strokeDasharray"};function yO(e,t,n=1,r=0,s=!0){e.pathLength=1;const i=s?mO:gO;e[i.offset]=`${-r}`,e[i.array]=`${t} ${n}`}const xO=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function J_(e,{attrX:t,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:o=0,...a},l,c,u){if(Ym(e,a,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:p}=e;f.transform&&(p.transform=f.transform,delete f.transform),(p.transform||f.transformOrigin)&&(p.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),p.transform&&(p.transformBox=(u==null?void 0:u.transformBox)??"fill-box",delete f.transformBox);for(const h of xO)f[h]!==void 0&&(p[h]=f[h],delete f[h]);t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),s!==void 0&&yO(f,s,i,o,!1)}const Z_=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"]),eS=e=>typeof e=="string"&&e.toLowerCase()==="svg";function vO(e,t,n,r){Y_(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(Z_.has(s)?s:Um(s),t.attrs[s])}function tS(e,t,n){const r=Xm(e,t,n);for(const s in e)if(Xe(e[s])||Xe(t[s])){const i=Vi.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=e[s]}return r}class wO extends H_{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Be}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Ui.has(n)){const r=L_(n);return r&&r.default||0}return n=Z_.has(n)?n:Um(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return tS(t,n,r)}build(t,n,r){J_(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,s){vO(t,n,r,s)}mount(t){this.isSVGTag=eS(t.tagName),super.mount(t)}}const bO=qm.length;function nS(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?nS(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<bO;n++){const r=qm[n],s=e.props[r];(pa(s)||s===!1)&&(t[r]=s)}return t}function rS(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 kO=[...Km].reverse(),_O=Km.length;function SO(e){return t=>Promise.all(t.map(({animation:n,options:r})=>kF(e,n,r)))}function CO(e){let t=SO(e),n=Mv(),r=!0,s=!1;const i=c=>(u,f)=>{var h;const p=js(e,f,c==="exit"?(h=e.presenceContext)==null?void 0:h.custom:void 0);if(p){const{transition:m,transitionEnd:y,...v}=p;u={...u,...v,...y}}return u};function o(c){t=c(e)}function a(c){const{props:u}=e,f=nS(e.parent)||{},p=[],h=new Set;let m={},y=1/0;for(let g=0;g<_O;g++){const x=kO[g],w=n[x],k=u[x]!==void 0?u[x]:f[x],j=pa(k),_=x===c?w.isActive:null;_===!1&&(y=g);let S=k===f[x]&&k!==u[x]&&j;if(S&&(r||s)&&e.manuallyAnimateOnMount&&(S=!1),w.protectedKeys={...m},!w.isActive&&_===null||!k&&!w.prevProp||_u(k)||typeof k=="boolean")continue;if(x==="exit"&&w.isActive&&_!==!0){w.prevResolvedValues&&(m={...m,...w.prevResolvedValues});continue}const P=jO(w.prevProp,k);let T=P||x===c&&w.isActive&&!S&&j||g>y&&j,E=!1;const I=Array.isArray(k)?k:[k];let A=I.reduce(i(x),{});_===!1&&(A={});const{prevResolvedValues:O={}}=w,M={...O,...A},N=L=>{T=!0,h.has(L)&&(E=!0,h.delete(L)),w.needsAnimating[L]=!0;const B=e.getValue(L);B&&(B.liveStyle=!1)};for(const L in M){const B=A[L],C=O[L];if(m.hasOwnProperty(L))continue;let $=!1;zh(B)&&zh(C)?$=!rS(B,C)||P:$=B!==C,$?B!=null?N(L):h.add(L):B!==void 0&&h.has(L)?N(L):w.protectedKeys[L]=!0}w.prevProp=k,w.prevResolvedValues=A,w.isActive&&(m={...m,...A}),(r||s)&&e.blockInitialAnimation&&(T=!1);const z=S&&P;T&&(!z||E)&&p.push(...I.map(L=>{const B={type:x};if(typeof L=="string"&&(r||s)&&!z&&e.manuallyAnimateOnMount&&e.parent){const{parent:C}=e,$=js(C,L);if(C.enteringChildren&&$){const{delayChildren:Q}=$.transition||{};B.delay=j_(C.enteringChildren,e,Q)}}return{animation:L,options:B}}))}if(h.size){const g={};if(typeof u.initial!="boolean"){const x=js(e,Array.isArray(u.initial)?u.initial[0]:u.initial);x&&x.transition&&(g.transition=x.transition)}h.forEach(x=>{const w=e.getBaseTarget(x),k=e.getValue(x);k&&(k.liveStyle=!0),g[x]=w??null}),p.push({animation:g})}let v=!!p.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(v=!1),r=!1,s=!1,v?t(p):Promise.resolve()}function l(c,u){var p;if(n[c].isActive===u)return Promise.resolve();(p=e.variantChildren)==null||p.forEach(h=>{var m;return(m=h.animationState)==null?void 0:m.setActive(c,u)}),n[c].isActive=u;const f=a(c);for(const h in n)n[h].protectedKeys={};return f}return{animateChanges:a,setActive:l,setAnimateFunction:o,getState:()=>n,reset:()=>{n=Mv(),s=!0}}}function jO(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!rS(t,e):!1}function ns(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Mv(){return{animate:ns(!0),whileInView:ns(),whileHover:ns(),whileTap:ns(),whileDrag:ns(),whileFocus:ns(),exit:ns()}}function qh(e,t){e.min=t.min,e.max=t.max}function ln(e,t){qh(e.x,t.x),qh(e.y,t.y)}function Lv(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const sS=1e-4,PO=1-sS,EO=1+sS,iS=.01,TO=0-iS,NO=0+iS;function dt(e){return e.max-e.min}function RO(e,t,n){return Math.abs(e-t)<=n}function Dv(e,t,n,r=.5){e.origin=r,e.originPoint=ye(t.min,t.max,e.origin),e.scale=dt(n)/dt(t),e.translate=ye(n.min,n.max,e.origin)-e.originPoint,(e.scale>=PO&&e.scale<=EO||isNaN(e.scale))&&(e.scale=1),(e.translate>=TO&&e.translate<=NO||isNaN(e.translate))&&(e.translate=0)}function Vo(e,t,n,r){Dv(e.x,t.x,n.x,r?r.originX:void 0),Dv(e.y,t.y,n.y,r?r.originY:void 0)}function Fv(e,t,n,r=0){const s=r?ye(n.min,n.max,r):n.min;e.min=s+t.min,e.max=e.min+dt(t)}function IO(e,t,n,r){Fv(e.x,t.x,n.x,r==null?void 0:r.x),Fv(e.y,t.y,n.y,r==null?void 0:r.y)}function Ov(e,t,n,r=0){const s=r?ye(n.min,n.max,r):n.min;e.min=t.min-s,e.max=e.min+dt(t)}function Hc(e,t,n,r){Ov(e.x,t.x,n.x,r==null?void 0:r.x),Ov(e.y,t.y,n.y,r==null?void 0:r.y)}function zv(e,t,n,r,s){return e-=t,e=Wc(e,1/n,r),s!==void 0&&(e=Wc(e,1/s,r)),e}function AO(e,t=0,n=1,r=.5,s,i=e,o=e){if(Ln.test(t)&&(t=parseFloat(t),t=ye(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=ye(i.min,i.max,r);e===i&&(a-=t),e.min=zv(e.min,t,n,a,s),e.max=zv(e.max,t,n,a,s)}function $v(e,t,[n,r,s],i,o){AO(e,t[n],t[r],t[s],t.scale,i,o)}const MO=["x","scaleX","originX"],LO=["y","scaleY","originY"];function Bv(e,t,n,r){$v(e.x,t,MO,n?n.x:void 0,r?r.x:void 0),$v(e.y,t,LO,n?n.y:void 0,r?r.y:void 0)}function Vv(e){return e.translate===0&&e.scale===1}function oS(e){return Vv(e.x)&&Vv(e.y)}function Uv(e,t){return e.min===t.min&&e.max===t.max}function DO(e,t){return Uv(e.x,t.x)&&Uv(e.y,t.y)}function Wv(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function aS(e,t){return Wv(e.x,t.x)&&Wv(e.y,t.y)}function Hv(e){return dt(e.x)/dt(e.y)}function Gv(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function En(e){return[e("x"),e("y")]}function FO(e,t,n){let r="";const s=e.x.translate/t.x,i=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((s||i||o)&&(r=`translate3d(${s}px, ${i}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:u,pathRotation:f,rotateX:p,rotateY:h,skewX:m,skewY:y}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),f&&(r+=`rotate(${f}deg) `),p&&(r+=`rotateX(${p}deg) `),h&&(r+=`rotateY(${h}deg) `),m&&(r+=`skewX(${m}deg) `),y&&(r+=`skewY(${y}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const lS=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],OO=lS.length,Kv=e=>typeof e=="string"?parseFloat(e):e,qv=e=>typeof e=="number"||q.test(e);function zO(e,t,n,r,s,i){s?(e.opacity=ye(0,n.opacity??1,$O(r)),e.opacityExit=ye(t.opacity??1,0,BO(r))):i&&(e.opacity=ye(t.opacity??1,n.opacity??1,r));for(let o=0;o<OO;o++){const a=lS[o];let l=Qv(t,a),c=Qv(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||qv(l)===qv(c)?(e[a]=Math.max(ye(Kv(l),Kv(c),r),0),(Ln.test(c)||Ln.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=ye(t.rotate||0,n.rotate||0,r))}function Qv(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const $O=cS(0,.5,e_),BO=cS(.5,.95,tn);function cS(e,t,n){return r=>r<e?0:r>t?1:n(fa(e,t,r))}function VO(e,t,n){const r=Xe(e)?e:Ai(e);return r.start(Bm("",r,t,n)),r.animation}function ma(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const UO=(e,t)=>e.depth-t.depth;class WO{constructor(){this.children=[],this.isDirty=!1}add(t){Em(this.children,t),this.isDirty=!0}remove(t){Dc(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(UO),this.isDirty=!1,this.children.forEach(t)}}function HO(e,t){const n=ut.now(),r=({timestamp:s})=>{const i=s-n;i>=t&&(Wr(r),e(i-t))};return xe.setup(r,!0),()=>Wr(r)}function Xl(e){return Xe(e)?e.get():e}class GO{constructor(){this.members=[]}add(t){Em(this.members,t);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===t||r===this.lead||r===this.prevLead)continue;const s=r.instance;(!s||s.isConnected===!1)&&!r.snapshot&&(Dc(this.members,r),r.unmount())}t.scheduleRender()}remove(t){if(Dc(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){var n;for(let r=this.members.indexOf(t)-1;r>=0;r--){const s=this.members[r];if(s.isPresent!==!1&&((n=s.instance)==null?void 0:n.isConnected)!==!1)return this.promote(s),!0}return!1}promote(t,n){var s;const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.updateSnapshot(),t.scheduleRender();const{layoutDependency:i}=r.options,{layoutDependency:o}=t.options;(i===void 0||i!==o)&&(t.resumeFrom=r,n&&(r.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),(s=t.root)!=null&&s.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var n,r,s,i,o;(r=(n=t.options).onExitComplete)==null||r.call(n),(o=(s=t.resumingFrom)==null?void 0:(i=s.options).onExitComplete)==null||o.call(i)})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){var t;(t=this.lead)!=null&&t.snapshot&&(this.lead.snapshot=void 0)}}const Jl={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Kd=["","X","Y","Z"],KO=1e3;let qO=0;function qd(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function uS(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=R_(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",xe,!(s||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&uS(r)}function dS({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},a=t==null?void 0:t()){this.id=qO++,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(XO),this.nodes.forEach(rz),this.nodes.forEach(sz),this.nodes.forEach(JO)},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 WO)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Nm),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=Gm(o)&&!XF(o),this.instance=o;const{layoutId:a,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),e){let u,f=0;const p=()=>this.root.updateBlockedByResize=!1;xe.read(()=>{f=window.innerWidth}),e(o,()=>{const h=window.innerWidth;h!==f&&(f=h,this.root.updateBlockedByResize=!0,u&&u(),u=HO(p,250),Jl.hasAnimatedSinceResize&&(Jl.hasAnimatedSinceResize=!1,this.nodes.forEach(Jv)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:f,hasRelativeLayoutChanged:p,layout:h})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||c.getDefaultTransition()||cz,{onLayoutAnimationStart:y,onLayoutAnimationComplete:v}=c.getProps(),g=!this.targetLayout||!aS(this.targetLayout,h),x=!f&&p;if(this.options.layoutRoot||this.resumeFrom||x||f&&(g||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const w={...$m(m,"layout"),onPlay:y,onComplete:v};(c.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w),this.setAnimationOrigin(u,x,w.path)}else f||Jv(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=h})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Wr(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(iz),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&&uS(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const f=this.path[u];f.shouldResetTransform=!0,(typeof f.latestValues.x=="string"||typeof f.latestValues.y=="string")&&(f.isLayoutDirty=!0),f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const l=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),l&&this.nodes.forEach(ez),this.nodes.forEach(Yv);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Xv);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(tz),this.nodes.forEach(nz),this.nodes.forEach(QO),this.nodes.forEach(YO)):this.nodes.forEach(Xv),this.clearAllSnapshots();const a=ut.now();Ye.delta=Fn(0,1e3/60,a-Ye.timestamp),Ye.timestamp=a,Ye.isProcessing=!0,zd.update.process(Ye),zd.preRender.process(Ye),zd.render.process(Ye),Ye.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Wm.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ZO),this.sharedNodes.forEach(oz)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,xe.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){xe.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!dt(this.snapshot.measuredBox.x)&&!dt(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=Be()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a&&this.instance){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!oS(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;o&&this.instance&&(a||cs(this.latestValues)||u)&&(s(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),uz(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var c;const{visualElement:o}=this.options;if(!o)return Be();const a=o.measureViewportBox();if(!(((c=this.scroll)==null?void 0:c.wasRoot)||this.path.some(dz))){const{scroll:u}=this.root;u&&(Nn(a.x,u.offset.x),Nn(a.y,u.offset.y))}return a}removeElementScroll(o){var l;const a=Be();if(ln(a,o),(l=this.scroll)!=null&&l.wasRoot)return a;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:f,options:p}=u;u!==this.root&&f&&p.layoutScroll&&(f.wasRoot&&ln(a,o),Nn(a.x,f.offset.x),Nn(a.y,f.offset.y))}return a}applyTransform(o,a=!1,l){var u,f;const c=l||Be();ln(c,o);for(let p=0;p<this.path.length;p++){const h=this.path[p];!a&&h.options.layoutScroll&&h.scroll&&h!==h.root&&(Nn(c.x,-h.scroll.offset.x),Nn(c.y,-h.scroll.offset.y)),cs(h.latestValues)&&Yl(c,h.latestValues,(u=h.layout)==null?void 0:u.layoutBox)}return cs(this.latestValues)&&Yl(c,this.latestValues,(f=this.layout)==null?void 0:f.layoutBox),c}removeTransform(o){var l;const a=Be();ln(a,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!cs(u.latestValues))continue;let f;u.instance&&(Hh(u.latestValues)&&u.updateSnapshot(),f=Be(),ln(f,u.measurePageBox())),Bv(a,u.latestValues,(l=u.snapshot)==null?void 0:l.layoutBox,f)}return cs(this.latestValues)&&Bv(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Ye.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var h;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(o||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(h=this.parent)!=null&&h.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:f}=this.options;if(!this.layout||!(u||f))return;this.resolvedRelativeTargetAt=Ye.timestamp;const p=this.getClosestProjectingParent();p&&this.linkedParentVersion!==p.layoutVersion&&!p.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&p&&p.layout?this.createRelativeTarget(p,this.layout.layoutBox,p.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Be(),this.targetWithTransforms=Be()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),IO(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):ln(this.target,this.layout.layoutBox),q_(this.target,this.targetDelta)):ln(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&p&&!!p.resumingFrom==!!this.resumingFrom&&!p.options.layoutScroll&&p.target&&this.animationProgress!==1?this.createRelativeTarget(p,this.target,p.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Hh(this.parent.latestValues)||K_(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,a,l){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Be(),this.relativeTargetOrigin=Be(),Hc(this.relativeTargetOrigin,a,l,this.options.layoutAnchor||void 0),ln(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var m;const o=this.getLead(),a=!!this.resumingFrom||this!==o;let l=!0;if((this.isProjectionDirty||(m=this.parent)!=null&&m.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===Ye.timestamp&&(l=!1),l)return;const{layout:c,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||u))return;ln(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,p=this.treeScale.y;aO(this.layoutCorrected,this.treeScale,this.path,a),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=Be());const{target:h}=o;if(!h){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Lv(this.prevProjectionDelta.x,this.projectionDelta.x),Lv(this.prevProjectionDelta.y,this.projectionDelta.y)),Vo(this.projectionDelta,this.layoutCorrected,h,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==p||!Gv(this.projectionDelta.x,this.prevProjectionDelta.x)||!Gv(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",h))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=di(),this.projectionDelta=di(),this.projectionDeltaWithTransform=di()}setAnimationOrigin(o,a=!1,l){const c=this.snapshot,u=c?c.latestValues:{},f={...this.latestValues},p=di();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const h=Be(),m=c?c.source:void 0,y=this.layout?this.layout.source:void 0,v=m!==y,g=this.getStack(),x=!g||g.members.length<=1,w=!!(v&&!x&&this.options.crossfade===!0&&!this.path.some(lz));this.animationProgress=0;let k;const j=l==null?void 0:l.interpolateProjection(o);this.mixTargetDelta=_=>{const S=_/1e3,P=j==null?void 0:j(S);P?(p.x.translate=P.x,p.x.scale=ye(o.x.scale,1,S),p.x.origin=o.x.origin,p.x.originPoint=o.x.originPoint,p.y.translate=P.y,p.y.scale=ye(o.y.scale,1,S),p.y.origin=o.y.origin,p.y.originPoint=o.y.originPoint):(Zv(p.x,o.x,S),Zv(p.y,o.y,S)),this.setTargetDelta(p),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Hc(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),az(this.relativeTarget,this.relativeTargetOrigin,h,S),k&&DO(this.relativeTarget,k)&&(this.isProjectionDirty=!1),k||(k=Be()),ln(k,this.relativeTarget)),v&&(this.animationValues=f,zO(f,u,this.latestValues,S,w,x)),P&&P.rotate!==void 0&&(this.animationValues||(this.animationValues=f),this.animationValues.pathRotation=P.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var a,l,c;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(c=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||c.stop(),this.pendingAnimation&&(Wr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=xe.update(()=>{Jl.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Ai(0)),this.motionValue.jump(0,!1),this.currentAnimation=VO(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:u=>{this.mixTargetDelta(u),o.onUpdate&&o.onUpdate(u)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(KO),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&fS(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||Be();const f=dt(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+f;const p=dt(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+p}ln(a,l),Yl(a,u),Vo(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new GO),this.sharedNodes.get(o).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var a;const{layoutId:o}=this.options;return o?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:o}=this.options;return o?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&qd("z",o,c,this.animationValues);for(let u=0;u<Kd.length;u++)qd(`rotate${Kd[u]}`,o,c,this.animationValues),qd(`skew${Kd[u]}`,o,c,this.animationValues);o.render();for(const u in c)o.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);o.scheduleRender()}applyProjectionStyles(o,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=Xl(a==null?void 0:a.pointerEvents)||"",o.transform=l?l(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=Xl(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!cs(this.latestValues)&&(o.transform=l?l({},""):"none",this.hasProjected=!1);return}o.visibility="";const u=c.animationValues||c.latestValues;this.applyTransformsToTarget();let f=FO(this.projectionDeltaWithTransform,this.treeScale,u);l&&(f=l(u,f)),o.transform=f;const{x:p,y:h}=this.projectionDelta;o.transformOrigin=`${p.origin*100}% ${h.origin*100}% 0`,c.animationValues?o.opacity=c===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:o.opacity=c===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const m in Kh){if(u[m]===void 0)continue;const{correct:y,applyTo:v,isCSSVariable:g}=Kh[m],x=f==="none"?u[m]:y(u[m],c);if(v){const w=v.length;for(let k=0;k<w;k++)o[v[k]]=x}else g?this.options.visualElement.renderState.vars[m]=x:o[m]=x}this.options.layoutId&&(o.pointerEvents=c===this?Xl(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(Yv),this.root.sharedNodes.clear()}}}function QO(e){e.updateLayout()}function YO(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=e.layout,{animationType:i}=e.options,o=t.source!==e.layout.source;if(i==="size")En(f=>{const p=o?t.measuredBox[f]:t.layoutBox[f],h=dt(p);p.min=r[f].min,p.max=p.min+h});else if(i==="x"||i==="y"){const f=i==="x"?"y":"x";qh(o?t.measuredBox[f]:t.layoutBox[f],r[f])}else fS(i,t.layoutBox,r)&&En(f=>{const p=o?t.measuredBox[f]:t.layoutBox[f],h=dt(r[f]);p.max=p.min+h,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+h)});const a=di();Vo(a,r,t.layoutBox);const l=di();o?Vo(l,e.applyTransform(s,!0),t.measuredBox):Vo(l,r,t.layoutBox);const c=!oS(a);let u=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:p,layout:h}=f;if(p&&h){const m=e.options.layoutAnchor||void 0,y=Be();Hc(y,t.layoutBox,p.layoutBox,m);const v=Be();Hc(v,r,h.layoutBox,m),aS(y,v)||(u=!0),f.options.layoutRoot&&(e.relativeTarget=v,e.relativeTargetOrigin=y,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function XO(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 JO(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function ZO(e){e.clearSnapshot()}function Yv(e){e.clearMeasurements()}function ez(e){e.isLayoutDirty=!0,e.updateLayout()}function Xv(e){e.isLayoutDirty=!1}function tz(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function nz(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Jv(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function rz(e){e.resolveTargetDelta()}function sz(e){e.calcProjection()}function iz(e){e.resetSkewAndRotation()}function oz(e){e.removeLeadSnapshot()}function Zv(e,t,n){e.translate=ye(t.translate,0,n),e.scale=ye(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function e0(e,t,n,r){e.min=ye(t.min,n.min,r),e.max=ye(t.max,n.max,r)}function az(e,t,n,r){e0(e.x,t.x,n.x,r),e0(e.y,t.y,n.y,r)}function lz(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const cz={duration:.45,ease:[.4,0,.1,1]},t0=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),n0=t0("applewebkit/")&&!t0("chrome/")?Math.round:tn;function r0(e){e.min=n0(e.min),e.max=n0(e.max)}function uz(e){r0(e.x),r0(e.y)}function fS(e,t,n){return e==="position"||e==="preserve-aspect"&&!RO(Hv(t),Hv(n),.2)}function dz(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const fz=dS({attachResizeListener:(e,t)=>ma(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}),Qd={current:void 0},hS=dS({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Qd.current){const e=new fz({});e.mount(window),e.setOptions({layoutScroll:!0}),Qd.current=e}return Qd.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Jm=b.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function s0(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function hz(...e){return t=>{let n=!1;const r=e.map(s=>{const i=s0(s,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():s0(e[s],null)}}}}function pz(...e){return b.useCallback(hz(...e),e)}class mz extends b.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(Gl(n)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,s=Gl(r)&&r.offsetWidth||0,i=Gl(r)&&r.offsetHeight||0,o=getComputedStyle(n),a=this.props.sizeRef.current;a.height=parseFloat(o.height),a.width=parseFloat(o.width),a.top=n.offsetTop,a.left=n.offsetLeft,a.right=s-a.width-a.left,a.bottom=i-a.height-a.top,a.direction=o.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function gz({children:e,isPresent:t,anchorX:n,anchorY:r,root:s,pop:i}){var p;const o=b.useId(),a=b.useRef(null),l=b.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:c}=b.useContext(Jm),u=((p=e.props)==null?void 0:p.ref)??(e==null?void 0:e.ref),f=pz(a,u);return b.useInsertionEffect(()=>{const{width:h,height:m,top:y,left:v,right:g,bottom:x,direction:w}=l.current;if(t||i===!1||!a.current||!h||!m)return;const k=w==="rtl",j=n==="left"?k?`right: ${g}`:`left: ${v}`:k?`left: ${v}`:`right: ${g}`,_=r==="bottom"?`bottom: ${x}`:`top: ${y}`;a.current.dataset.motionPopId=o;const S=document.createElement("style");c&&(S.nonce=c);const P=s??document.head;return P.appendChild(S),S.sheet&&S.sheet.insertRule(`
|
|
79
|
+
[data-motion-pop-id="${o}"] {
|
|
80
|
+
position: absolute !important;
|
|
81
|
+
width: ${h}px !important;
|
|
82
|
+
height: ${m}px !important;
|
|
83
|
+
${j}px !important;
|
|
84
|
+
${_}px !important;
|
|
85
|
+
}
|
|
86
|
+
`),()=>{var T;(T=a.current)==null||T.removeAttribute("data-motion-pop-id"),P.contains(S)&&P.removeChild(S)}},[t]),d.jsx(mz,{isPresent:t,childRef:a,sizeRef:l,pop:i,children:i===!1?e:b.cloneElement(e,{ref:f})})}const yz=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:o,anchorX:a,anchorY:l,root:c})=>{const u=Pm(xz),f=b.useId();let p=!0,h=b.useMemo(()=>(p=!1,{id:f,initial:t,isPresent:n,custom:s,onExitComplete:m=>{u.set(m,!0);for(const y of u.values())if(!y)return;r&&r()},register:m=>(u.set(m,!1),()=>u.delete(m))}),[n,u,r]);return i&&p&&(h={...h}),b.useMemo(()=>{u.forEach((m,y)=>u.set(y,!1))},[n]),b.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=d.jsx(gz,{pop:o==="popLayout",isPresent:n,anchorX:a,anchorY:l,root:c,children:e}),d.jsx(bu.Provider,{value:h,children:e})};function xz(){return new Map}function pS(e=!0){const t=b.useContext(bu);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,i=b.useId();b.useEffect(()=>{if(e)return s(i)},[e]);const o=b.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,o]:[!0]}const hl=e=>e.key||"";function i0(e){const t=[];return b.Children.forEach(e,n=>{b.isValidElement(n)&&t.push(n)}),t}const vz=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:o=!1,anchorX:a="left",anchorY:l="top",root:c})=>{const[u,f]=pS(o),p=b.useMemo(()=>i0(e),[e]),h=o&&!u?[]:p.map(hl),m=b.useRef(!0),y=b.useRef(p),v=Pm(()=>new Map),g=b.useRef(new Set),[x,w]=b.useState(p),[k,j]=b.useState(p);Vk(()=>{m.current=!1,y.current=p;for(let P=0;P<k.length;P++){const T=hl(k[P]);h.includes(T)?(v.delete(T),g.current.delete(T)):v.get(T)!==!0&&v.set(T,!1)}},[k,h.length,h.join("-")]);const _=[];if(p!==x){let P=[...p];for(let T=0;T<k.length;T++){const E=k[T],I=hl(E);h.includes(I)||(P.splice(T,0,E),_.push(E))}return i==="wait"&&_.length&&(P=_),j(i0(P)),w(p),null}const{forceRender:S}=b.useContext(jm);return d.jsx(d.Fragment,{children:k.map(P=>{const T=hl(P),E=o&&!u?!1:p===k||h.includes(T),I=()=>{if(g.current.has(T))return;if(v.has(T))g.current.add(T),v.set(T,!0);else return;let A=!0;v.forEach(O=>{O||(A=!1)}),A&&(S==null||S(),j(y.current),o&&(f==null||f()),r&&r())};return d.jsx(yz,{isPresent:E,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:i,root:c,onExitComplete:E?void 0:I,anchorX:a,anchorY:l,children:P},T)})})},mS=b.createContext({strict:!1}),o0={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 a0=!1;function wz(){if(a0)return;const e={};for(const t in o0)e[t]={isEnabled:n=>o0[t].some(r=>!!n[r])};W_(e),a0=!0}function gS(){return wz(),rO()}function bz(e){const t=gS();for(const n in e)t[n]={...t[n],...e[n]};W_(t)}const kz=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 Gc(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||kz.has(e)}let yS=e=>!Gc(e);function _z(e){typeof e=="function"&&(yS=t=>t.startsWith("on")?!Gc(t):e(t))}try{_z(require("@emotion/is-prop-valid").default)}catch{}function Sz(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||Xe(e[s])||(yS(s)||n===!0&&Gc(s)||!t&&!Gc(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const Cu=b.createContext({});function Cz(e,t){if(Su(e)){const{initial:n,animate:r}=e;return{initial:n===!1||pa(n)?n:void 0,animate:pa(r)?r:void 0}}return e.inherit!==!1?t:{}}function jz(e){const{initial:t,animate:n}=Cz(e,b.useContext(Cu));return b.useMemo(()=>({initial:t,animate:n}),[l0(t),l0(n)])}function l0(e){return Array.isArray(e)?e.join(" "):e}const Zm=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function xS(e,t,n){for(const r in t)!Xe(t[r])&&!X_(r,n)&&(e[r]=t[r])}function Pz({transformTemplate:e},t){return b.useMemo(()=>{const n=Zm();return Ym(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Ez(e,t){const n=e.style||{},r={};return xS(r,n,e),Object.assign(r,Pz(e,t)),r}function Tz(e,t){const n={},r=Ez(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 vS=()=>({...Zm(),attrs:{}});function Nz(e,t,n,r){const s=b.useMemo(()=>{const i=vS();return J_(i,t,eS(r),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};xS(i,e.style,e),s.style={...i,...s.style}}return s}const Rz=["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 eg(e){return typeof e!="string"||e.includes("-")?!1:!!(Rz.indexOf(e)>-1||/[A-Z]/u.test(e))}function Iz(e,t,n,{latestValues:r},s,i=!1,o){const l=(o??eg(e)?Nz:Tz)(t,r,s,e),c=Sz(t,typeof e=="string",i),u=e!==b.Fragment?{...c,...l,ref:n}:{},{children:f}=t,p=b.useMemo(()=>Xe(f)?f.get():f,[f]);return b.createElement(e,{...u,children:p})}function Az({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:Mz(n,r,s,e),renderState:t()}}function Mz(e,t,n,r){const s={},i=r(e,{});for(const p in i)s[p]=Xl(i[p]);let{initial:o,animate:a}=e;const l=Su(e),c=V_(e);t&&c&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||o===!1;const f=u?a:o;if(f&&typeof f!="boolean"&&!_u(f)){const p=Array.isArray(f)?f:[f];for(let h=0;h<p.length;h++){const m=Vm(e,p[h]);if(m){const{transitionEnd:y,transition:v,...g}=m;for(const x in g){let w=g[x];if(Array.isArray(w)){const k=u?w.length-1:0;w=w[k]}w!==null&&(s[x]=w)}for(const x in y)s[x]=y[x]}}}return s}const wS=e=>(t,n)=>{const r=b.useContext(Cu),s=b.useContext(bu),i=()=>Az(e,t,r,s);return n?i():Pm(i)},Lz=wS({scrapeMotionValuesFromProps:Xm,createRenderState:Zm}),Dz=wS({scrapeMotionValuesFromProps:tS,createRenderState:vS}),Fz=Symbol.for("motionComponentSymbol");function Oz(e,t,n){const r=b.useRef(n);b.useInsertionEffect(()=>{r.current=n});const s=b.useRef(null);return b.useCallback(i=>{var a;i&&((a=e.onMount)==null||a.call(e,i)),t&&(i?t.mount(i):t.unmount());const o=r.current;if(typeof o=="function")if(i){const l=o(i);typeof l=="function"&&(s.current=l)}else s.current?(s.current(),s.current=null):o(i);else o&&(o.current=i)},[t])}const bS=b.createContext({});function Qs(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function zz(e,t,n,r,s,i){var w,k;const{visualElement:o}=b.useContext(Cu),a=b.useContext(mS),l=b.useContext(bu),c=b.useContext(Jm),u=c.reducedMotion,f=c.skipAnimations,p=b.useRef(null),h=b.useRef(!1);r=r||a.renderer,!p.current&&r&&(p.current=r(e,{visualState:t,parent:o,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:u,skipAnimations:f,isSVG:i}),h.current&&p.current&&(p.current.manuallyAnimateOnMount=!0));const m=p.current,y=b.useContext(bS);m&&!m.projection&&s&&(m.type==="html"||m.type==="svg")&&$z(p.current,n,s,y);const v=b.useRef(!1);b.useInsertionEffect(()=>{m&&v.current&&m.update(n,l)});const g=n[N_],x=b.useRef(!!g&&typeof window<"u"&&!((w=window.MotionHandoffIsComplete)!=null&&w.call(window,g))&&((k=window.MotionHasOptimisedAnimation)==null?void 0:k.call(window,g)));return Vk(()=>{h.current=!0,m&&(v.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),x.current&&m.animationState&&m.animationState.animateChanges())}),b.useEffect(()=>{m&&(!x.current&&m.animationState&&m.animationState.animateChanges(),x.current&&(queueMicrotask(()=>{var j;(j=window.MotionHandoffMarkAsComplete)==null||j.call(window,g)}),x.current=!1),m.enteringChildren=void 0)}),m}function $z(e,t,n,r){const{layoutId:s,layout:i,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutAnchor:u,layoutCrossfade:f}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:kS(e.parent)),e.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!o||a&&Qs(a),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:f,layoutScroll:l,layoutRoot:c,layoutAnchor:u})}function kS(e){if(e)return e.options.allowProjection!==!1?e.projection:kS(e.parent)}function Yd(e,{forwardMotionProps:t=!1,type:n}={},r,s){r&&bz(r);const i=n?n==="svg":eg(e),o=i?Dz:Lz;function a(c,u){let f;const p={...b.useContext(Jm),...c,layoutId:Bz(c)},{isStatic:h}=p,m=jz(c),y=o(c,h);if(!h&&typeof window<"u"){Vz();const v=Uz(p);f=v.MeasureLayout,m.visualElement=zz(e,y,p,s,v.ProjectionNode,i)}return d.jsxs(Cu.Provider,{value:m,children:[f&&m.visualElement?d.jsx(f,{visualElement:m.visualElement,...p}):null,Iz(e,c,Oz(y,m.visualElement,u),y,h,t,i)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const l=b.forwardRef(a);return l[Fz]=e,l}function Bz({layoutId:e}){const t=b.useContext(jm).id;return t&&e!==void 0?t+"-"+e:e}function Vz(e,t){b.useContext(mS).strict}function Uz(e){const t=gS(),{drag:n,layout:r}=t;if(!n&&!r)return{};const s={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(e)||r!=null&&r.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function Wz(e,t){if(typeof Proxy>"u")return Yd;const n=new Map,r=(i,o)=>Yd(i,o,e,t),s=(i,o)=>r(i,o);return new Proxy(s,{get:(i,o)=>o==="create"?r:(n.has(o)||n.set(o,Yd(o,void 0,e,t)),n.get(o))})}const Hz=(e,t)=>t.isSVG??eg(e)?new wO(t):new pO(t,{allowProjection:e!==b.Fragment});class Gz extends Jr{constructor(t){super(t),t.animationState||(t.animationState=CO(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();_u(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 Kz=0;class qz extends Jr{constructor(){super(...arguments),this.id=Kz++,this.isExitComplete=!1}update(){var i;if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;if(t&&r===!1){if(this.isExitComplete){const{initial:o,custom:a}=this.node.getProps();if(typeof o=="string"||typeof o=="object"&&o!==null&&!Array.isArray(o)){const l=js(this.node,o,a);if(l){const{transition:c,transitionEnd:u,...f}=l;for(const p in f)(i=this.node.getValue(p))==null||i.jump(f[p])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const Qz={animation:{Feature:Gz},exit:{Feature:qz}};function Ea(e){return{point:{x:e.pageX,y:e.pageY}}}const Yz=e=>t=>Hm(t)&&e(t,Ea(t));function Uo(e,t,n,r){return ma(e,t,Yz(n),r)}const _S=({current:e})=>e?e.ownerDocument.defaultView:null,c0=(e,t)=>Math.abs(e-t);function Xz(e,t){const n=c0(e.x,t.x),r=c0(e.y,t.y);return Math.sqrt(n**2+r**2)}const u0=new Set(["auto","scroll"]);class SS{constructor(t,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:i=!1,distanceThreshold:o=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=h=>{this.handleScroll(h.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=pl(this.lastRawMoveEventInfo,this.transformPagePoint));const h=Xd(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,y=Xz(h.offset,{x:0,y:0})>=this.distanceThreshold;if(!m&&!y)return;const{point:v}=h,{timestamp:g}=Ye;this.history.push({...v,timestamp:g});const{onStart:x,onMove:w}=this.handlers;m||(x&&x(this.lastMoveEvent,h),this.startEvent=this.lastMoveEvent),w&&w(this.lastMoveEvent,h)},this.handlePointerMove=(h,m)=>{this.lastMoveEvent=h,this.lastRawMoveEventInfo=m,this.lastMoveEventInfo=pl(m,this.transformPagePoint),xe.update(this.updatePoint,!0)},this.handlePointerUp=(h,m)=>{this.end();const{onEnd:y,onSessionEnd:v,resumeAnimation:g}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&g&&g(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=Xd(h.type==="pointercancel"?this.lastMoveEventInfo:pl(m,this.transformPagePoint),this.history);this.startEvent&&y&&y(h,x),v&&v(h,x)},!Hm(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=s||window;const l=Ea(t),c=pl(l,this.transformPagePoint),{point:u}=c,{timestamp:f}=Ye;this.history=[{...u,timestamp:f}];const{onSessionStart:p}=n;p&&p(t,Xd(c,this.history)),this.removeListeners=Ca(Uo(this.contextWindow,"pointermove",this.handlePointerMove),Uo(this.contextWindow,"pointerup",this.handlePointerUp),Uo(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(u0.has(r.overflowX)||u0.has(r.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const r=t===window,s=r?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},i={x:s.x-n.x,y:s.y-n.y};i.x===0&&i.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(t,s),xe.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Wr(this.updatePoint)}}function pl(e,t){return t?{point:t(e.point)}:e}function d0(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Xd({point:e},t){return{point:e,delta:d0(e,CS(t)),offset:d0(e,Jz(t)),velocity:Zz(t,.1)}}function Jz(e){return e[0]}function CS(e){return e[e.length-1]}function Zz(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=CS(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>Ft(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&s.timestamp-r.timestamp>Ft(t)*2&&(r=e[1]);const i=Zt(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const o={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function e$(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?ye(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?ye(n,e,r.max):Math.min(e,n)),e}function f0(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 t$(e,{top:t,left:n,bottom:r,right:s}){return{x:f0(e.x,n,s),y:f0(e.y,t,r)}}function h0(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 n$(e,t){return{x:h0(e.x,t.x),y:h0(e.y,t.y)}}function r$(e,t){let n=.5;const r=dt(e),s=dt(t);return s>r?n=fa(t.min,t.max-r,e.min):r>s&&(n=fa(e.min,e.max-s,t.min)),Fn(0,1,n)}function s$(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 Qh=.35;function i$(e=Qh){return e===!1?e=0:e===!0&&(e=Qh),{x:p0(e,"left","right"),y:p0(e,"top","bottom")}}function p0(e,t,n){return{min:m0(e,t),max:m0(e,n)}}function m0(e,t){return typeof e=="number"?e:e[t]||0}const o$=new WeakMap;class a${constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Be(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=f=>{n&&this.snapToCursor(Ea(f).point),this.stopAnimation()},o=(f,p)=>{const{drag:h,dragPropagation:m,onDragStart:y}=this.getProps();if(h&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=MF(h),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=p,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),En(g=>{let x=this.getAxisMotionValue(g).get()||0;if(Ln.test(x)){const{projection:w}=this.visualElement;if(w&&w.layout){const k=w.layout.layoutBox[g];k&&(x=dt(k)*(parseFloat(x)/100))}}this.originPoint[g]=x}),y&&xe.update(()=>y(f,p),!1,!0),$h(this.visualElement,"transform");const{animationState:v}=this.visualElement;v&&v.setActive("whileDrag",!0)},a=(f,p)=>{this.latestPointerEvent=f,this.latestPanInfo=p;const{dragPropagation:h,dragDirectionLock:m,onDirectionLock:y,onDrag:v}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:g}=p;if(m&&this.currentDirection===null){this.currentDirection=c$(g),this.currentDirection!==null&&y&&y(this.currentDirection);return}this.updateAxis("x",p.point,g),this.updateAxis("y",p.point,g),this.visualElement.render(),v&&xe.update(()=>v(f,p),!1,!0)},l=(f,p)=>{this.latestPointerEvent=f,this.latestPanInfo=p,this.stop(f,p),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{const{dragSnapToOrigin:f}=this.getProps();(f||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:u}=this.getProps();this.panSession=new SS(t,{onSessionStart:i,onStart:o,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:r,contextWindow:_S(this.visualElement),element:this.visualElement.current})}stop(t,n){const r=t||this.latestPointerEvent,s=n||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!s||!r)return;const{velocity:o}=s;this.startAnimation(o);const{onDragEnd:a}=this.getProps();a&&xe.postRender(()=>a(r,s))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,r){const{drag:s}=this.getProps();if(!r||!ml(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=e$(o,this.constraints[t],this.elastic[t])),i.set(o)}resolveConstraints(){var i;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(i=this.visualElement.projection)==null?void 0:i.layout,s=this.constraints;t&&Qs(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=t$(r.layoutBox,t):this.constraints=!1,this.elastic=i$(n),s!==this.constraints&&!Qs(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&En(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=s$(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Qs(t))return!1;const r=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;s.root&&(s.root.scroll=void 0,s.root.updateScroll());const i=lO(r,s.root,this.visualElement.getTransformPagePoint());let o=n$(s.layout.layoutBox,i);if(n){const a=n(iO(o));this.hasMutatedConstraints=!!a,a&&(o=G_(a))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=En(u=>{if(!ml(u,n,this.currentDirection))return;let f=l&&l[u]||{};(o===!0||o===u)&&(f={min:0,max:0});const p=s?200:1e6,h=s?40:1e7,m={type:"inertia",velocity:r?t[u]:0,bounceStiffness:p,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(u,m)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return $h(this.visualElement,t),r.start(Bm(t,r,0,n,this.visualElement,!1))}stopAnimation(){En(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,s=this.visualElement.getProps()[n];return s||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor(t){En(n=>{const{drag:r}=this.getProps();if(!ml(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:a}=s.layout.layoutBox[n],l=i.get()||0;i.set(t[n]-ye(o,a,.5)+l)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Qs(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};En(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();s[o]=r$({min:l,max:l},this.constraints[o])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),En(o=>{if(!ml(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(ye(l,c,s[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;o$.set(this.visualElement,this);const t=this.visualElement.current,n=Uo(t,"pointerdown",c=>{const{drag:u,dragListener:f=!0}=this.getProps(),p=c.target,h=p!==t&&$F(p);u&&f&&!h&&this.start(c)});let r;const s=()=>{const{dragConstraints:c}=this.getProps();Qs(c)&&c.current&&(this.constraints=this.resolveRefConstraints(),r||(r=l$(t,c.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,o=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),xe.read(s);const a=ma(window,"resize",()=>this.scalePositionWithinConstraints()),l=i.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(En(f=>{const p=this.getAxisMotionValue(f);p&&(this.originPoint[f]+=c[f].translate,p.set(p.get()+c[f].translate))}),this.visualElement.render())});return()=>{a(),n(),o(),l&&l(),r&&r()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=Qh,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:a}}}function g0(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function l$(e,t,n){const r=_v(e,g0(n)),s=_v(t,g0(n));return()=>{r(),s()}}function ml(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function c$(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class u$ extends Jr{constructor(t){super(t),this.removeGroupControls=tn,this.removeListeners=tn,this.controls=new a$(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||tn}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 Jd=e=>(t,n)=>{e&&xe.update(()=>e(t,n),!1,!0)};class d$ extends Jr{constructor(){super(...arguments),this.removePointerDownListener=tn}onPointerDown(t){this.session=new SS(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:_S(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:Jd(t),onStart:Jd(n),onMove:Jd(r),onEnd:(i,o)=>{delete this.session,s&&xe.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=Uo(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 Zd=!1;class f$ extends b.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=t;i&&(n.group&&n.group.add(i),r&&r.register&&s&&r.register(i),Zd&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Jl.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,{projection:o}=r;return o&&(o.isPresent=i,t.layoutDependency!==n&&o.setOptions({...o.options,layoutDependency:n}),Zd=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==i?o.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?o.promote():o.relegate()||xe.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:n}=this.props,{projection:r}=t;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),Wm.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;Zd=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function jS(e){const[t,n]=pS(),r=b.useContext(jm);return d.jsx(f$,{...e,layoutGroup:r,switchLayoutGroup:b.useContext(bS),isPresent:t,safeToRemove:n})}const h$={pan:{Feature:d$},drag:{Feature:u$,ProjectionNode:hS,MeasureLayout:jS}};function y0(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,i=r[s];i&&xe.postRender(()=>i(t,Ea(t)))}class p$ extends Jr{mount(){const{current:t}=this.node;t&&(this.unmount=DF(t,(n,r)=>(y0(this.node,r,"Start"),s=>y0(this.node,s,"End"))))}unmount(){}}class m$ extends Jr{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=Ca(ma(this.node.current,"focus",()=>this.onFocus()),ma(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function x0(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),i=r[s];i&&xe.postRender(()=>i(t,Ea(t)))}class g$ extends Jr{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=VF(t,(s,i)=>(x0(this.node,i,"Start"),(o,{success:a})=>x0(this.node,o,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const Yh=new WeakMap,ef=new WeakMap,y$=e=>{const t=Yh.get(e.target);t&&t(e)},x$=e=>{e.forEach(y$)};function v$({root:e,...t}){const n=e||document;ef.has(n)||ef.set(n,{});const r=ef.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(x$,{root:e,...t})),r[s]}function w$(e,t,n){const r=v$(t);return Yh.set(e,n),r.observe(e),()=>{Yh.delete(e),r.unobserve(e)}}const b$={some:0,all:1};class k$ extends Jr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var l;(l=this.stopObserver)==null||l.call(this);const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:b$[s]},a=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,i&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:f,onViewportLeave:p}=this.node.getProps(),h=u?f:p;h&&h(c)};this.stopObserver=w$(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(_$(t,n))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function _$({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const S$={inView:{Feature:k$},tap:{Feature:g$},focus:{Feature:m$},hover:{Feature:p$}},C$={layout:{ProjectionNode:hS,MeasureLayout:jS}},j$={...Qz,...S$,...h$,...C$},v0=Wz(j$,Hz);function P$(){!Qm.current&&U_();const[e]=b.useState(Vc.current);return e}function ju(e,t){const n=b.useRef(t);n.current=t,b.useEffect(()=>{if(!e)return;const r=s=>{s.key==="Escape"&&n.current()};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e])}const tf={stackPanelWidth:480,navIslandBottom:"1.5rem",navIslandHeight:"4.5rem"},J={bgBase:"#FDFCF8",bgSurface:"#FAF8F0",bgElevated:"#F5F1E6",textPrimary:"#1A1917",textSecondary:"#68635C",accentBlue:"#7C9CC0",accentBlueDark:"#51719B",accentGreen:"#8FB996",accentGreenDark:"#5E8A66",accentAmber:"#D4A373",accentAmberDark:"#A67B4F",accentRose:"#C98B8B",accentRoseDark:"#9E5E5E",accentSlate:"#8A9BA8",accentSlateDark:"#5E7080",canvasBase:"#F0EAD8",canvas300:"#E5DBC4",canvasDark:"#D6C9A8",washBlue:"#DEE4E5",washGreen:"#E3EADC",washAmber:"#F2E5D5",washRose:"#EFE0DA",washSlate:"#E1E4E0",chalkboardBg:"#142e22",chalkboardChalk:"#d4e8cb",chalkboardBorderBase:"#C8D2C3"};function nt(e,t){const n=e.replace("#",""),r=Number.parseInt(n.slice(0,2),16),s=Number.parseInt(n.slice(2,4),16),i=Number.parseInt(n.slice(4,6),16);return`rgba(${r}, ${s}, ${i}, ${t})`}const E$={4:"1rem"};function Y(...e){return fD(ML(e))}const T$={height:32,lineHeight:"32px",padding:"0 16px"},N$={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")`},R$={white:J.bgBase,paper:J.bgSurface,speckle:J.bgSurface,parchment:J.bgElevated,canvas:J.canvasBase,kraft:J.canvas300,chalkboard:J.chalkboardBg},w0={white:J.bgElevated,paper:J.bgElevated,speckle:J.bgElevated,parchment:J.canvasBase,canvas:J.canvas300,kraft:J.canvasDark,chalkboard:J.chalkboardBg},I$={base:J.bgBase,surface:J.bgSurface,elevated:J.bgElevated,canvas:J.canvasBase,canvasDark:J.canvasDark,blue:J.washBlue,green:J.washGreen,amber:J.washAmber,rose:J.washRose,slate:J.washSlate},A$={blue:"rgba(168, 200, 216, 0.35)",brown:"rgba(164, 144, 120, 0.35)",black:"rgba(61, 53, 43, 0.15)"};function PS(e){const t=typeof e=="string"?{texture:e}:e,n=t.texture??"paper",r=t.ruledType??"none",s=t.ruledColor??"blue",i=N$[n],o=t.fill?I$[t.fill]:t.shade?w0[n]:R$[n],a=A$[s],l={"--pui-texture-shade":w0[n],"--pui-texture-image":i};return r==="none"?{...l,backgroundColor:o,backgroundImage:i,backgroundRepeat:"repeat",backgroundSize:"200px 200px"}:r==="lines"?{...l,backgroundColor:o,backgroundImage:`${i}, repeating-linear-gradient(180deg, transparent, transparent 31px, ${a} 31px, ${a} 32px)`,backgroundRepeat:"repeat, repeat",backgroundSize:"200px 200px, 100% 32px"}:{...l,backgroundColor:o,backgroundImage:`${i}, repeating-linear-gradient(180deg, transparent, transparent 31px, ${a} 31px, ${a} 32px), repeating-linear-gradient(90deg, transparent, transparent 31px, ${a} 31px, ${a} 32px)`,backgroundRepeat:"repeat, repeat, repeat",backgroundSize:"200px 200px, 100% 32px, 32px 32px"}}function Mi(e){return PS(e)}function Wi(e,t="paper"){if(e!==!1)return Mi(e===!0?t:e)}function M$(e){const t=Eu((e==null?void 0:e.seed)??Math.random()),n=Math.max(0,Math.min(1,(e==null?void 0:e.wobble)??.5)),r=8+Math.round(n*6),s=50,i=50,o=46,a=2+n*14,l=[];for(let c=0;c<r;c++){const u=c/r*Math.PI*2+(t()-.5)*.15*n,f=o+(t()-.5)*a*2;l.push({x:s+Math.cos(u)*f,y:i+Math.sin(u)*f})}return Pu(l)}function L$(e,t){const n=Eu(`${e}-ring`),r=Math.max(0,Math.min(1,t??.5)),s=8+Math.round(r*6),i=50,o=50,a=49,l=2+r*14,c=[];for(let u=0;u<s;u++){const f=u/s*Math.PI*2+(n()-.5)*.15*r,p=a+(n()-.5)*l*2;c.push({x:i+Math.cos(f)*p,y:o+Math.sin(f)*p})}return Pu(c)}function D$(e){const t=Eu((e==null?void 0:e.seed)??Math.random()),n=Math.max(0,Math.min(1,(e==null?void 0:e.wobble)??.5)),r=3+Math.round(n*3),s=2,i=3+n*10,o=[],a=[{ax:s,ay:s,bx:100-s,by:s},{ax:100-s,ay:s,bx:100-s,by:100-s},{ax:100-s,ay:100-s,bx:s,by:100-s},{ax:s,ay:100-s,bx:s,by:s}];for(const l of a)for(let c=0;c<r;c++){const u=(c+.5)/r,f=l.ax+(l.bx-l.ax)*u,p=l.ay+(l.by-l.ay)*u,h=l.bx-l.ax,m=l.by-l.ay,y=Math.sqrt(h*h+m*m)||1,v=-m/y,g=h/y,x=(t()-.5)*i*2;o.push({x:f+v*x,y:p+g*x})}return Pu(o)}function F$(e,t){const n=Eu(`${e}-ring`),r=Math.max(0,Math.min(1,t??.5)),s=3+Math.round(r*3),i=0,o=3+r*10,a=[],l=[{ax:i,ay:i,bx:100-i,by:i},{ax:100-i,ay:i,bx:100-i,by:100-i},{ax:100-i,ay:100-i,bx:i,by:100-i},{ax:i,ay:100-i,bx:i,by:i}];for(const c of l)for(let u=0;u<s;u++){const f=(u+.5)/s,p=c.ax+(c.bx-c.ax)*f,h=c.ay+(c.by-c.ay)*f,m=c.bx-c.ax,y=c.by-c.ay,v=Math.sqrt(m*m+y*y)||1,g=-y/v,x=m/v,w=(n()-.5)*o*2;a.push({x:p+g*w,y:h+x*w})}return Pu(a)}function Pu(e){const t=e.length;if(t<3)return"";let n=`M ${dr(e[0].x)} ${dr(e[0].y)}`;for(let r=0;r<t;r++){const s=e[(r-1+t)%t],i=e[r],o=e[(r+1)%t],a=e[(r+2)%t],l=i.x+(o.x-s.x)/6,c=i.y+(o.y-s.y)/6,u=o.x-(a.x-i.x)/6,f=o.y-(a.y-i.y)/6;n+=` C ${dr(l)} ${dr(c)}, ${dr(u)} ${dr(f)}, ${dr(o.x)} ${dr(o.y)}`}return n+=" Z",n}function dr(e){return e.toFixed(2)}function Eu(e){let t=typeof e=="string"?O$(e):e;return()=>(t=t*16807%2147483647,(t-1)/2147483646)}function O$(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 Tu(){const e=b.useId();return b.useMemo(()=>{let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)>>>0;return(t+1)/4294967296},[e])}function Hi(e){const t=Tu();return b.useMemo(()=>({blob:M$({seed:t,wobble:e}),ring:L$(t,e)}),[t,e])}const z$="button-module__button___Z331g",$$="button-module__blobBg___QQFzf",B$="button-module__blobFill___XwLjV",V$="button-module__blobRing___567UW",U$="button-module__isActive___FXNSJ",W$="button-module__primary___ppbyq",H$="button-module__secondary___esy5L",G$="button-module__ghost___NisA0",K$="button-module__danger___Wnvuq",q$="button-module__chalkboard___d3Nqb",Q$="button-module__tiny___8ZZ7A",Y$="button-module__small___u7y8a",X$="button-module__medium___HBIAj",J$="button-module__large___RPzNy",Z$="button-module__fullWidth___H0P0F",e4="button-module__iconLeft___s60SZ",t4="button-module__iconRight___75eFu",n4="button-module__label___pXAyM",Ht={button:z$,blobBg:$$,blobFill:B$,blobRing:V$,isActive:U$,primary:W$,secondary:H$,ghost:G$,danger:K$,chalkboard:q$,tiny:Q$,small:Y$,medium:X$,large:J$,fullWidth:Z$,iconLeft:e4,iconRight:t4,label:n4},se=b.forwardRef(function({variant:e="primary",surface:t="paper",size:n="medium",icon:r,iconRight:s,fullWidth:i=!1,wobble:o=.5,isActive:a=!1,children:l,className:c,...u},f){const p=Hi(o);return d.jsxs("button",{ref:f,type:"button",className:Y(Ht.button,Ht[e],Ht[n],t==="chalkboard"&&Ht.chalkboard,a&&Ht.isActive,i&&Ht.fullWidth,c),...u,children:[d.jsxs("svg",{className:Ht.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[d.jsx("path",{d:p.blob,className:Ht.blobFill}),d.jsx("path",{d:p.ring,className:Ht.blobRing})]}),r&&d.jsx("span",{className:Ht.iconLeft,children:r}),d.jsx("span",{className:Ht.label,children:l}),s&&d.jsx("span",{className:Ht.iconRight,children:s})]})});function tg(e){return{blue:e.accentBlue,green:e.accentGreen,amber:e.accentAmber,rose:e.accentRose,slate:e.accentSlate}}const Oe=TD.generator(),r4="sketch-border-module__svg___whV4x",s4="sketch-border-module__behind___lgdYV",i4="sketch-border-module__stroke___vAm-v",o4="sketch-border-module__fill___zlpd6",gl={svg:r4,behind:s4,stroke:i4,fill:o4},a4=1.2,l4=.7;function Ct({shape:e="rect",radius:t=9,roughness:n=1.2,bowing:r=1,strokeWidth:s=1,inset:i=2,fill:o=!1,clip:a=!1,smooth:l=!1,straight:c=!0,strokeInset:u=!0,className:f}){const[p]=b.useState(Math.random),h=b.useRef(null),[m,y]=b.useState(null);b.useEffect(()=>{var x;const w=(x=h.current)==null?void 0:x.parentElement;if(!w)return;const k=new ResizeObserver(()=>{const j=w.offsetWidth,_=w.offsetHeight;y(S=>S&&S.width===j&&S.height===_?S:{width:j,height:_})});return k.observe(w),()=>k.disconnect()},[]);const{parts:v,clipPath:g}=b.useMemo(()=>{if(!m||m.width<8||m.height<8)return{parts:null,clipPath:null};const x=Math.max(1,Math.round(p*1e6)),w=x,k=x*2654435761%2147483647,j=T=>Oe.toPaths(Oe.path(T,{seed:w,roughness:n,bowing:r,preserveVertices:!0,strokeWidth:s})).filter(E=>!E.fill||E.fill==="none").map(E=>({d:E.d,filled:!1}));if(l){const T={seed:w,roughness:n,bowing:r,strokeWidth:s,disableMultiStroke:!0},E=A=>Oe.toPaths(A).filter(O=>!O.fill||O.fill==="none").map(O=>({d:O.d,filled:!1}));if(a){const A=yl(e,m,i,t,rs(k),n*1.1),O=u?b0(s,n):0,M=O?yl(e,m,i+O,t,rs(k),n*1.1):A;return{parts:E(Oe.path(M,{...T,preserveVertices:!0})),clipPath:A}}const I=e==="circle"?Oe.ellipse(m.width/2,m.height/2,m.width-i*2,m.height-i*2,T):Oe.path(nf(m,i,t,rs(w)),{...T,preserveVertices:!0});return{parts:E(I),clipPath:null}}if(a){if(c){const A=nf(m,i,t,rs(k)),O=Oe.toPaths(Oe.path(A,{seed:w,roughness:a4,bowing:l4,preserveVertices:!0,strokeWidth:s})).filter(M=>!M.fill||M.fill==="none").map(M=>({d:M.d,filled:!1}));return{parts:O.length?O:[{d:A,filled:!1}],clipPath:A}}const T=yl(e,m,i,t,rs(k),n*1.1),E=u?b0(s,n):0,I=E?yl(e,m,i+E,t,rs(k),n*1.1):T;return{parts:j(I),clipPath:T}}const _=(T,E)=>{const I=E?{fill:"#000",fillStyle:"solid"}:{},A=e==="circle"?Oe.ellipse(m.width/2,m.height/2,m.width-i*2,m.height-i*2,{seed:T,roughness:n,bowing:r,strokeWidth:s,...I}):Oe.path(nf(m,i,t,rs(T)),{seed:T,roughness:n,bowing:r,preserveVertices:!0,strokeWidth:s,...I});return Oe.toPaths(A)},S=o?_(k,!0).filter(T=>!!T.fill&&T.fill!=="none").map(T=>({d:T.d,filled:!0})):[],P=_(w,!1).filter(T=>!T.fill||T.fill==="none").map(T=>({d:T.d,filled:!1}));return{parts:[...S,...P],clipPath:null}},[m,p,a,l,c,e,t,n,r,s,i,o,u]);return b.useEffect(()=>{var x;const w=(x=h.current)==null?void 0:x.parentElement;if(w)return g?w.style.setProperty("--sketch-clip",`path("${g}")`):w.style.removeProperty("--sketch-clip"),()=>{w.style.removeProperty("--sketch-clip")}},[g]),d.jsx("svg",{ref:h,className:Y(gl.svg,o&&gl.behind,f),viewBox:m?`0 0 ${m.width} ${m.height}`:void 0,"aria-hidden":"true",children:v==null?void 0:v.map((x,w)=>x.filled?d.jsx("path",{className:gl.fill,d:x.d},`f-${w}`):d.jsx("path",{className:gl.stroke,d:x.d,strokeWidth:s},`s-${w}`))})}function b0(e,t){return e/2+t*1.5}function rs(e){let t=e;return()=>(t=t*16807%2147483647,(t-1)/2147483646)}function yl(e,t,n,r,s,i){const o=t.width-n*2,a=t.height-n*2,l=t.width/2,c=t.height/2,u=()=>(s()-.5)*i*2,f=[];if(e==="circle")for(let p=0;p<16;p++){const h=p/16*Math.PI*2;f.push({x:l+Math.cos(h)*o/2+u(),y:c+Math.sin(h)*a/2+u()})}else{const p=Math.max(2,Math.min(r,o/2,a/2)),h=n,m=n,y=(x,w,k)=>{for(const j of[0,45,90]){const _=(k+j)*Math.PI/180;f.push({x:x+Math.cos(_)*p+u(),y:w+Math.sin(_)*p+u()})}},v=(x,w,k,j)=>{const _=Math.hypot(k-x,j-w),S=Math.min(12,Math.max(1,Math.round(_/160)));for(let P=1;P<=S;P++){const T=P/(S+1);f.push({x:x+(k-x)*T+u(),y:w+(j-w)*T+u()})}};y(h+p,m+p,180),v(h+p,m,h+o-p,m),y(h+o-p,m+p,270),v(h+o,m+p,h+o,m+a-p),y(h+o-p,m+a-p,0),v(h+o-p,m+a,h+p,m+a),y(h+p,m+a-p,90),v(h,m+a-p,h,m+p);const g=3;return k0([...f.slice(g),...f.slice(0,g)])}return k0(f)}function k0(e){const t=e.length;if(t<3)return"";const n=(s,i)=>Math.max(.001,Math.hypot(i.x-s.x,i.y-s.y)**.5);let r=`M ${e[0].x.toFixed(2)} ${e[0].y.toFixed(2)}`;for(let s=0;s<t;s++){const i=e[(s-1+t)%t],o=e[s],a=e[(s+1)%t],l=e[(s+2)%t],c=n(i,o),u=n(o,a),f=n(a,l),p=a.x-o.x+u*((o.x-i.x)/c-(a.x-i.x)/(c+u)),h=a.y-o.y+u*((o.y-i.y)/c-(a.y-i.y)/(c+u)),m=a.x-o.x+u*((l.x-a.x)/f-(l.x-o.x)/(u+f)),y=a.y-o.y+u*((l.y-a.y)/f-(l.y-o.y)/(u+f)),v=o.x+p/3,g=o.y+h/3,x=a.x-m/3,w=a.y-y/3;r+=` C ${v.toFixed(2)} ${g.toFixed(2)}, ${x.toFixed(2)} ${w.toFixed(2)}, ${a.x.toFixed(2)} ${a.y.toFixed(2)}`}return`${r} Z`}function nf(e,t,n,r){const s=[0,0,0,0].map(()=>Math.max(2,n+(r()-.5)*3));return c4(t,t,e.width-t*2,e.height-t*2,s)}function c4(e,t,n,r,s){const i=u=>Math.min(u,n/2,r/2),[o,a,l,c]=s.map(i);return[`M ${ve(e+o)} ${ve(t)}`,`L ${ve(e+n-a)} ${ve(t)}`,`Q ${ve(e+n)} ${ve(t)} ${ve(e+n)} ${ve(t+a)}`,`L ${ve(e+n)} ${ve(t+r-l)}`,`Q ${ve(e+n)} ${ve(t+r)} ${ve(e+n-l)} ${ve(t+r)}`,`L ${ve(e+c)} ${ve(t+r)}`,`Q ${ve(e)} ${ve(t+r)} ${ve(e)} ${ve(t+r-c)}`,`L ${ve(e)} ${ve(t+o)}`,`Q ${ve(e)} ${ve(t)} ${ve(e+o)} ${ve(t)}`,"Z"].join(" ")}function ve(e){return e.toFixed(2)}const jt={surface:{radius:12,inset:2.5,roughness:.2,bowing:0,strokeWidth:1.3},field:{radius:8,inset:2,roughness:1.1,strokeWidth:1.3},control:{radius:6,inset:2,roughness:.5,bowing:.6,strokeWidth:1.4},pill:{radius:999,inset:2,roughness:.7,strokeWidth:1}},u4="page-module__page___-uHnG",d4="page-module__outlined___Wwtyg",f4="page-module__surface___sWfI6",h4="page-module__flat___HlOaY",p4="page-module__withAccent___lsv-m",m4="page-module__accentBlue___XxbMV",g4="page-module__accentGreen___Ne6Q8",y4="page-module__accentAmber___kLAwa",x4="page-module__accentRose___O9ZbZ",v4="page-module__accentSlate___xCB66",Ys={page:u4,outlined:d4,surface:f4,flat:h4,withAccent:p4,accentBlue:m4,accentGreen:g4,accentAmber:y4,accentRose:x4,accentSlate:v4},w4=tg(Ys),b4={all:14,top:14,none:2};function ES({children:e,className:t,style:n,texture:r=!0,withAccent:s=!1,accentColor:i="blue",rounded:o="all",outline:a=!1,sketch:l=!1}){const c=Wi(r,{texture:"white",ruledType:"lines",ruledColor:"blue"})??{backgroundColor:"var(--pui-bg-base)"};return d.jsxs("div",{className:Y(Ys.page,a&&Ys.outlined,s&&Ys.withAccent,s&&w4[i],!l&&Ys.flat,t),style:n,children:[d.jsx(Ct,{clip:!0,...jt.surface,radius:b4[o],straight:!l}),d.jsx("div",{className:Ys.surface,style:c,children:e})]})}const k4="layout-module__layout___O1aWi",_4="layout-module__header___I-kxe",S4="layout-module__headerLeft___JChJQ",C4="layout-module__headerTitles___aqSUG",j4="layout-module__headerTitle___wvr39",P4="layout-module__headerSubtitle___6f5BD",E4="layout-module__headerActions___adC12",T4="layout-module__mobileToggle___4WpVG",N4="layout-module__body___tywNf",R4="layout-module__mobileOverlay___tzbBC",I4="layout-module__sidebar___8VKGq",A4="layout-module__sidebarOpen___47rtr",M4="layout-module__sidebarInner___tq2X6",L4="layout-module__logoArea___RLnC0",D4="layout-module__logoText___pAmfV",F4="layout-module__nav___FxcrZ",O4="layout-module__main___9z7bu",z4="layout-module__navIslandFixed___H4TwP",$4="layout-module__content___jL-VB",B4="layout-module__contentWithPage___vVdfN",V4="layout-module__footer___LyakU",U4="layout-module__footerText___8BYxc",Ie={layout:k4,header:_4,headerLeft:S4,headerTitles:C4,headerTitle:j4,headerSubtitle:P4,headerActions:E4,mobileToggle:T4,body:N4,mobileOverlay:R4,sidebar:I4,sidebarOpen:A4,sidebarInner:M4,logoArea:L4,logoText:D4,nav:F4,main:O4,navIslandFixed:z4,content:$4,contentWithPage:B4,footer:V4,footerText:U4};function W4(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"}:Mi(e)}function H4({children:e,showHeader:t=!0,showFooter:n=!1,showSidebar:r=!0,showPage:s=!0,background:i="paper",title:o,subtitle:a,headerActions:l,headerHeight:c,headerTexture:u,navigationItems:f=[],activeItemId:p,onNavigate:h,logo:m,footerContent:y,navigationIsland:v,style:g,bleedBottom:x=!0,routeKey:w,stackOpen:k}){const[j,_]=b.useState(!1),S=P$();ju(j,()=>_(!1));const P=W4(i),T=r&&f.length>0,E=c!==void 0||u!==void 0?{...u!==void 0?Mi(u):{},...c!==void 0?{height:typeof c=="number"?`${c}px`:c}:{}}:void 0;return d.jsxs("div",{className:Ie.layout,style:{...P,...g},children:[t&&d.jsxs("header",{className:Ie.header,style:E,children:[d.jsxs("div",{className:Ie.headerLeft,children:[T&&d.jsx("button",{type:"button",className:Ie.mobileToggle,onClick:()=>_(!0),"aria-label":"Open navigation",children:d.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",children:d.jsx("path",{d:"M3 5h14M3 10h14M3 15h14",strokeLinecap:"round"})})}),d.jsxs("div",{className:Ie.headerTitles,children:[o&&d.jsx("h1",{className:Ie.headerTitle,children:o}),a&&d.jsx("span",{className:Ie.headerSubtitle,children:a})]})]}),l&&d.jsx("div",{className:Ie.headerActions,children:l})]}),d.jsxs("div",{className:Ie.body,children:[j&&d.jsx("button",{type:"button",className:Ie.mobileOverlay,onClick:()=>_(!1),"aria-label":"Close navigation",tabIndex:-1}),T&&d.jsx("aside",{className:Y(Ie.sidebar,j&&Ie.sidebarOpen),children:d.jsxs("div",{className:Ie.sidebarInner,children:[d.jsx("div",{className:Ie.logoArea,children:m||d.jsx("span",{className:Ie.logoText,children:"Paper UI"})}),d.jsx("nav",{className:Ie.nav,"aria-label":"Main navigation",children:f.map(I=>{const A=I.id===p;return d.jsx(se,{variant:"ghost",size:"small",isActive:A,onClick:()=>{h==null||h(I),_(!1)},"aria-current":A?"page":void 0,icon:I.icon,style:T$,children:I.label},I.id)})})]})}),d.jsx("div",{className:Ie.main,children:d.jsx("main",{className:s?Ie.contentWithPage:Ie.content,style:x?{paddingBottom:0}:void 0,children:(()=>{const I=w!==void 0?d.jsx(vz,{mode:"wait",children:d.jsx(v0.div,{initial:S?void 0:{opacity:0,y:8},animate:{opacity:1,y:0},exit:S?void 0:{opacity:0,y:-8},transition:{duration:.2,ease:"easeOut"},style:{height:"100%"},children:e},w)}):e;return s?d.jsx(ES,{rounded:x?"top":"all",style:x&&v?{paddingBottom:`calc(${tf.navIslandBottom} + ${tf.navIslandHeight} + ${E$[4]})`}:void 0,children:I}):I})()})})]}),v&&d.jsx("div",{className:Ie.navIslandFixed,children:k!==void 0?d.jsx(v0.div,{animate:{x:k?`-${tf.stackPanelWidth/2}px`:0},transition:{duration:S?0:.3,ease:[.4,0,.2,1]},children:v}):v}),n&&d.jsx("footer",{className:Ie.footer,children:y||d.jsx("p",{className:Ie.footerText,children:"Paper UI — Natural Materials Component Library"})})]})}const G4="checkbox-module__wrapper___uLYMI",K4="checkbox-module__blobFill___mPJSR",q4="checkbox-module__input___Ptgt7",Q4="checkbox-module__blobBg___bw3sn",Y4="checkbox-module__labelLeft___-vAmH",X4="checkbox-module__box___yAh-r",J4="checkbox-module__checkmark___tTyBz",Z4="checkbox-module__indeterminateLine___IosI-",eB="checkbox-module__boxWrapper___byjoS",tB="checkbox-module__icon___RO-yn",nB="checkbox-module__labelText___bAnLr",rB="checkbox-module__chalkboard___sv6SL",Rt={wrapper:G4,blobFill:K4,input:q4,blobBg:Q4,labelLeft:Y4,box:X4,checkmark:J4,indeterminateLine:Z4,boxWrapper:eB,icon:tB,labelText:nB,chalkboard:rB},sB=b.forwardRef(function({label:e,labelPosition:t="right",indeterminate:n=!1,wobble:r=.4,surface:s="paper",className:i,checked:o,onChange:a,id:l,...c},u){const f=b.useId(),p=l??f,h=Hi(r),m=b.useRef(null);return b.useEffect(()=>{m.current&&(m.current.indeterminate=n)},[n]),d.jsxs("label",{className:Y(Rt.wrapper,t==="left"&&Rt.labelLeft,s==="chalkboard"&&Rt.chalkboard,i),htmlFor:p,children:[d.jsxs("span",{className:Rt.boxWrapper,children:[d.jsx("input",{ref:y=>{m.current=y,typeof u=="function"?u(y):u&&(u.current=y)},id:p,type:"checkbox",className:Rt.input,checked:o,onChange:a,...c}),d.jsx("svg",{className:Rt.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:d.jsx("path",{d:h.blob,className:Rt.blobFill})}),d.jsxs("span",{className:Rt.box,"aria-hidden":"true",children:[d.jsx(Ct,{smooth:!0,...jt.control}),n?d.jsx("svg",{viewBox:"0 0 20 20",fill:"none",className:Rt.icon,children:d.jsx("line",{x1:"4",y1:"10",x2:"16",y2:"10",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",className:Rt.indeterminateLine})}):d.jsx("svg",{viewBox:"0 0 20 20",fill:"none",className:Rt.icon,children:d.jsx("path",{d:"M4 10 L8 14 L16 6",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:Rt.checkmark})})]})]}),e&&d.jsx("span",{className:Rt.labelText,children:e})]})}),iB="icon-button-module__iconButton___avg6i",oB="icon-button-module__blobBg___466Vy",aB="icon-button-module__blobFill___FTN1g",lB="icon-button-module__blobRing___hRdQb",cB="icon-button-module__isActive___XlvtM",uB="icon-button-module__icon___h204x",dB="icon-button-module__ghost___Wbxog",fB="icon-button-module__danger___p0Xz5",hB="icon-button-module__tiny___4WYvA",pB="icon-button-module__small___bPnCU",mB="icon-button-module__medium___nOxPf",gB="icon-button-module__large___UBU5z",yB="icon-button-module__chalkboard___mi0sQ",Un={iconButton:iB,blobBg:oB,blobFill:aB,blobRing:lB,isActive:cB,icon:uB,default:"icon-button-module__default___9frNR",ghost:dB,danger:fB,tiny:hB,small:pB,medium:mB,large:gB,chalkboard:yB},ot=b.forwardRef(function({icon:e,variant:t="default",surface:n="paper",size:r="medium",label:s,wobble:i=.5,isActive:o=!1,className:a,...l},c){const u=Hi(i);return d.jsxs("button",{ref:c,type:"button",className:Y(Un.iconButton,Un[t],n==="chalkboard"&&Un.chalkboard,Un[r],o&&Un.isActive,a),"aria-label":s,title:s,...l,children:[d.jsxs("svg",{className:Un.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[d.jsx("path",{d:u.blob,className:Un.blobFill}),d.jsx("path",{d:u.ring,className:Un.blobRing})]}),d.jsx("span",{className:Un.icon,children:e})]})}),xB="stamp-module__stamp___5qaNY",vB="stamp-module__small___BBlBg",wB="stamp-module__medium___HG2YD",bB="stamp-module__large___aUT0I",kB="stamp-module__blobBg___Mdrdd",_B="stamp-module__blobFill___QyCeB",SB="stamp-module__blobRing___EUDx7",CB="stamp-module__dot___qZyCR",jB="stamp-module__label___T89iH",PB="stamp-module__chalkboard___syI4T",fr={stamp:xB,small:vB,medium:wB,large:bB,blobBg:kB,blobFill:_B,blobRing:SB,dot:CB,label:jB,chalkboard:PB},rf={neutral:{fill:nt(J.accentSlate,.14),text:J.accentSlateDark,ring:nt(J.accentSlateDark,.35)},info:{fill:nt(J.accentBlue,.14),text:J.accentBlueDark,ring:nt(J.accentBlueDark,.35)},success:{fill:nt(J.accentGreen,.16),text:J.accentGreenDark,ring:nt(J.accentGreenDark,.35)},warning:{fill:nt(J.accentAmber,.16),text:J.accentAmberDark,ring:nt(J.accentAmberDark,.4)},error:{fill:nt(J.accentRose,.16),text:J.accentRoseDark,ring:nt(J.accentRoseDark,.35)}},_0={fill:nt(J.chalkboardBorderBase,.1),ring:nt(J.chalkboardBorderBase,.35)};function Pe({children:e,size:t="medium",variant:n,dot:r=!1,fillColor:s,textColor:i,wobble:o=.3,surface:a="paper",className:l}){const c=Hi(o),u=a==="chalkboard",f=n?u?_0.ring:rf[n].ring:void 0,p=s??(n?u?_0.fill:rf[n].fill:"transparent"),h=i??(n&&!u?rf[n].text:void 0);return d.jsxs("span",{className:Y(fr.stamp,fr[t],u&&fr.chalkboard,l),style:h?{color:h}:void 0,children:[d.jsxs("svg",{className:fr.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[d.jsx("path",{d:c.blob,className:fr.blobFill,style:{fill:p}}),f&&d.jsx("path",{d:c.ring,className:fr.blobRing,style:{stroke:f}})]}),r&&d.jsx("span",{className:fr.dot,"aria-hidden":"true"}),d.jsx("span",{className:fr.label,children:e})]})}const EB="copy-button-module__copyButton___-hTo4",TB="copy-button-module__dark___O45N-",NB="copy-button-module__chalkboard___hW4aw",RB="copy-button-module__copied___XlHFr",xl={copyButton:EB,dark:TB,chalkboard:NB,copied:RB};function Xh({text:e,variant:t="light",surface:n="paper",className:r,...s}){const[i,o]=b.useState(!1),a=b.useCallback(async()=>{try{await navigator.clipboard.writeText(e),o(!0),setTimeout(()=>o(!1),1500)}catch(l){console.error("Failed to copy:",l)}},[e]);return d.jsx("button",{type:"button",onClick:a,className:Y(xl.copyButton,t==="dark"&&xl.dark,n==="chalkboard"&&xl.chalkboard,i&&xl.copied,r),...s,children:i?"Copied!":"Copy"})}const IB="code-block-module__codeBlock___dq28o",AB="code-block-module__header___42Fek",MB="code-block-module__relative___oO-zy",LB="code-block-module__copyOverlay___PjAuq",DB="code-block-module__pre___zXzLZ",FB="code-block-module__chalkboard___bdo9J",OB="code-block-module__chalkboardHeader___3RiVd",zB="code-block-module__chalkboardPre___iRBFR",hr={codeBlock:IB,header:AB,relative:MB,copyOverlay:LB,pre:DB,chalkboard:FB,chalkboardHeader:OB,chalkboardPre:zB};function f7({code:e,filename:t,surface:n="paper"}){return d.jsxs("div",{className:Y(hr.codeBlock,n==="chalkboard"&&hr.chalkboard),children:[t&&d.jsxs("div",{className:Y(hr.header,n==="chalkboard"&&hr.chalkboardHeader),children:[d.jsx("span",{children:t}),d.jsx(Xh,{text:e,variant:"light",surface:n})]}),!t&&d.jsx("div",{className:hr.relative,children:d.jsx("div",{className:hr.copyOverlay,children:d.jsx(Xh,{text:e,variant:"dark",surface:n})})}),d.jsx("pre",{className:Y(hr.pre,n==="chalkboard"&&hr.chalkboardPre),children:d.jsx("code",{children:e})})]})}function Nu({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 TS({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 NS({size:e=16}){return d.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:d.jsx("polyline",{points:"20 6 9 17 4 12"})})}function $B({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 BB({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 RS({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 VB="table-module__tableFrame___KP-90",UB="table-module__tableWrapper___gc3Y3",WB="table-module__toolbar___zhCel",HB="table-module__toolbarTitle___D8oH-",GB="table-module__panelFooter___lCCKo",KB="table-module__compact___mG-2Y",qB="table-module__toolbarActions___EX6qS",QB="table-module__search___zIBk2",YB="table-module__searchIcon___ayhK8",XB="table-module__searchInput___PqsEG",JB="table-module__tableScroll___1gvc4",ZB="table-module__table___tdU5g",e5="table-module__th___GQbKk",t5="table-module__td___WktB5",n5="table-module__footerCell___bM-jv",r5="table-module__tr___xeZno",s5="table-module__expandTh___uxkR4",i5="table-module__expandTd___VoBRC",o5="table-module__expandIcon___8V45X",a5="table-module__expandable___R7o2l",l5="table-module__footerRow___ik1DH",c5="table-module__expandedRow___1TbTQ",u5="table-module__expandedCell___sKAaD",d5="table-module__boardScroll___Y1yqm",f5="table-module__board___kFAI-",h5="table-module__boardColumn___-W9bP",p5="table-module__boardColumnHeader___kY3Fj",m5="table-module__accentBlue___PEJ1V",g5="table-module__accentGreen___wJ53r",y5="table-module__accentAmber___Iezjv",x5="table-module__accentRose___W8zxc",v5="table-module__accentSlate___oUZCX",w5="table-module__boardColumnLabel___JBEed",b5="table-module__boardColumnCount___Pkpiq",k5="table-module__boardColumnBody___uAgRF",_5="table-module__boardRow___C1P60",S5="table-module__boardEmpty___IKv2W",C5="table-module__chalkboardFrame___xB3N5",j5="table-module__chalkboardWrapper___KjY5r",P5="table-module__chalkboard___v0m3A",re={tableFrame:VB,tableWrapper:UB,toolbar:WB,toolbarTitle:HB,panelFooter:GB,compact:KB,toolbarActions:qB,search:QB,searchIcon:YB,searchInput:XB,tableScroll:JB,table:ZB,th:e5,td:t5,footerCell:n5,tr:r5,expandTh:s5,expandTd:i5,expandIcon:o5,expandable:a5,footerRow:l5,expandedRow:c5,expandedCell:u5,boardScroll:d5,board:f5,boardColumn:h5,boardColumnHeader:p5,accentBlue:m5,accentGreen:g5,accentAmber:y5,accentRose:x5,accentSlate:v5,boardColumnLabel:w5,boardColumnCount:b5,boardColumnBody:k5,boardRow:_5,boardEmpty:S5,chalkboardFrame:C5,chalkboardWrapper:j5,chalkboard:P5},E5=tg(re);function T5({data:e=[],columns:t=[],board:n,surface:r="paper",texture:s=!0,toolbar:i,expandable:o,showExpandColumn:a=!0,rowKey:l,rowClassName:c,rowTexture:u,rowFooter:f,hideHeader:p=!1,density:h="comfortable",panelFooter:m,className:y}){const v=Wi(s,r==="chalkboard"?"chalkboard":"paper"),g=!!i,[x,w]=b.useState(new Set),k=S=>{w(P=>{const T=new Set(P);return T.has(S)?T.delete(S):T.add(S),T})},j=!!(o&&a),_=j?t.length+1:t.length;return d.jsxs("div",{className:Y(re.tableFrame,r==="chalkboard"&&re.chalkboardFrame,y),children:[d.jsx(Ct,{clip:!0,...jt.surface}),d.jsxs("div",{className:Y(re.tableWrapper,r==="chalkboard"&&re.chalkboardWrapper,h==="compact"&&re.compact),style:v,children:[g&&d.jsxs("div",{className:re.toolbar,children:[i.title&&d.jsx("div",{className:re.toolbarTitle,children:i.title}),i.search&&d.jsxs("div",{className:re.search,children:[d.jsx(N5,{className:re.searchIcon}),d.jsx("input",{type:"text",className:re.searchInput,placeholder:i.search.placeholder??"Search...","aria-label":i.search.placeholder??"Search",value:i.search.value,onChange:S=>{var P,T;return(T=(P=i.search)==null?void 0:P.onChange)==null?void 0:T.call(P,S.target.value)}}),d.jsx(Ct,{fill:!0,...jt.field})]}),i.actions&&d.jsx("div",{className:re.toolbarActions,children:typeof i.actions=="function"?i.actions(r):i.actions})]}),n?d.jsx("div",{className:re.boardScroll,children:d.jsx("div",{className:re.board,children:n.map(S=>d.jsxs("div",{className:re.boardColumn,children:[d.jsxs("div",{className:Y(re.boardColumnHeader,r==="chalkboard"&&re.chalkboard,S.accent&&E5[S.accent]),children:[d.jsx("span",{className:re.boardColumnLabel,children:S.label}),d.jsx("span",{className:re.boardColumnCount,children:S.items.length})]}),d.jsx("div",{className:re.boardColumnBody,children:S.items.length===0?d.jsx("div",{className:re.boardEmpty,children:S.emptyLabel??"empty"}):S.items.map((P,T)=>d.jsx("div",{className:Y(re.boardRow,r==="chalkboard"&&re.chalkboard),children:S.renderItem(P,T,r)},S.getKey?S.getKey(P,T):T))})]},S.key))})}):d.jsx("div",{className:re.tableScroll,children:d.jsxs("table",{className:Y(re.table,r==="chalkboard"&&re.chalkboard,h==="compact"&&re.compact),children:[d.jsxs("colgroup",{children:[j&&d.jsx("col",{style:{width:"48px"}}),t.map(S=>d.jsx("col",{style:S.width?{width:`${S.width*32}px`}:void 0},S.key))]}),!p&&d.jsx("thead",{children:d.jsxs("tr",{children:[j&&d.jsx("th",{className:Y(re.th,re.expandTh),"aria-label":"Expand"}),t.map(S=>d.jsx("th",{className:re.th,style:S.align?{textAlign:S.align}:void 0,children:S.header},S.key))]})}),d.jsx("tbody",{children:e.map((S,P)=>{const T=l?l(S,P):P,E=o==null?void 0:o.render(S,P,r),I=f==null?void 0:f(S,P,r),A=!!E,O=A&&x.has(T),M=u==null?void 0:u(S,P);return d.jsxs(b.Fragment,{children:[d.jsxs("tr",{className:Y(re.tr,A&&re.expandable,c==null?void 0:c(S,P)),style:M?Mi(M):void 0,onClick:()=>A&&k(T),children:[j&&d.jsx("td",{className:Y(re.td,re.expandTd),children:A&&d.jsx("button",{type:"button",className:re.expandIcon,"aria-expanded":O,"aria-label":O?"Collapse row":"Expand row",onClick:N=>{N.stopPropagation(),k(T)},children:d.jsx(RS,{size:14})})}),t.map(N=>d.jsx("td",{className:re.td,style:N.align?{textAlign:N.align}:void 0,children:N.cell(S,P,r)},N.key))]}),I&&d.jsx("tr",{className:re.footerRow,style:M?Mi(M):void 0,children:d.jsx("td",{colSpan:_,className:re.footerCell,children:I})}),O&&d.jsx("tr",{className:re.expandedRow,children:d.jsx("td",{colSpan:_,className:re.expandedCell,children:E})})]},T)})})]})}),m&&d.jsx("div",{className:re.panelFooter,children:m})]})]})}function N5({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 R5="card-module__borderLayer___WSpJq",I5="card-module__elevated___uhWj9",A5="card-module__textureLayer___Kcofz",M5="card-module__flat___KnG5z",L5="card-module__small___HXUTr",D5="card-module__withAccent___2t7bV",F5="card-module__accentBlue___a1KIq",O5="card-module__accentGreen___RNWoA",z5="card-module__accentAmber___uMhom",$5="card-module__accentRose___VPI3t",B5="card-module__accentSlate___-l4jE",V5="card-module__chalkboard___bQ48O",yr={borderLayer:R5,default:"card-module__default___glPy-",elevated:I5,textureLayer:A5,flat:M5,small:L5,withAccent:D5,accentBlue:F5,accentGreen:O5,accentAmber:z5,accentRose:$5,accentSlate:B5,chalkboard:V5},U5=tg(yr);function de({children:e,variant:t="default",surface:n="paper",size:r="medium",texture:s="parchment",fill:i,shade:o=!1,accent:a=!1,accentColor:l="blue",sketch:c=!1,className:u}){const f=n==="chalkboard"||s===!1?void 0:PS({...s===!0||typeof s=="string"?{texture:s===!0?"parchment":s}:s,...i?{fill:i}:{},...o?{shade:o}:{}});return d.jsxs("div",{className:Y(yr.borderLayer,yr[t],n==="chalkboard"&&yr.chalkboard,yr[r],a&&yr.withAccent,a&&U5[l],!c&&yr.flat,u),children:[d.jsx(Ct,{clip:!0,...jt.surface,straight:!c}),d.jsx("div",{className:yr.textureLayer,style:f,children:e})]})}const W5="input-module__wrapper___xaEw6",H5="input-module__label___lu7R1",G5="input-module__field___khFpX",K5="input-module__input___h7K-F",q5="input-module__small___SkByh",Q5="input-module__medium___0QPuV",Y5="input-module__large___zGwRu",X5="input-module__error___QDqga",J5="input-module__disabled___K-5hi",Z5="input-module__helperText___njeLH",eV="input-module__helperError___qDBpD",tV="input-module__chalkboard___Xh-5s",_n={wrapper:W5,label:H5,field:G5,input:K5,small:q5,medium:Q5,large:Y5,error:X5,disabled:J5,helperText:Z5,helperError:eV,chalkboard:tV},Ta=b.forwardRef(function({label:e,helperText:t,error:n=!1,size:r="medium",surface:s="paper",className:i,id:o,...a},l){const c=b.useId(),u=o??c;return d.jsxs("div",{className:Y(_n.wrapper,s==="chalkboard"&&_n.chalkboard,i),children:[e&&d.jsx("label",{htmlFor:u,className:_n.label,children:e}),d.jsxs("span",{className:Y(_n.field,_n[r],n&&_n.error,a.disabled&&_n.disabled),children:[d.jsx("input",{ref:l,id:u,className:_n.input,...a}),d.jsx(Ct,{fill:!0,...jt.field})]}),t&&d.jsx("span",{className:Y(_n.helperText,n&&_n.helperError),children:t})]})}),nV="select-module__wrapper___Hc5F3",rV="select-module__label___ay-3s",sV="select-module__nativeSelect___UA2d-",iV="select-module__trigger___xMYHi",oV="select-module__open___w3mbZ",aV="select-module__triggerLabel___ihpER",lV="select-module__placeholder___0VOFP",cV="select-module__small___iU9W9",uV="select-module__chevron___0dCTg",dV="select-module__medium___B-XBN",fV="select-module__large___iII2c",hV="select-module__chevronOpen___cFOYe",pV="select-module__error___P5RBk",mV="select-module__dropdown___Q-uK3",gV="select-module__slideDown___sT374",yV="select-module__options___HmrQ0",xV="select-module__option___vNnue",vV="select-module__optionDisabled___ex2zq",wV="select-module__optionSelected___tAFjn",bV="select-module__optionHighlighted___zYQLq",kV="select-module__helperText___r5gyn",_V="select-module__helperError___ydSPT",SV="select-module__chalkboard___sXBw8",Le={wrapper:nV,label:rV,nativeSelect:sV,trigger:iV,open:oV,triggerLabel:aV,placeholder:lV,small:cV,chevron:uV,medium:dV,large:fV,chevronOpen:hV,error:pV,dropdown:mV,slideDown:gV,options:yV,option:xV,optionDisabled:vV,optionSelected:wV,optionHighlighted:bV,helperText:kV,helperError:_V,chalkboard:SV};function IS({label:e,helperText:t,error:n=!1,size:r="medium",surface:s="paper",options:i,placeholder:o,value:a,defaultValue:l,onChange:c,name:u,disabled:f=!1,width:p,texture:h=!1,className:m}){const y=b.useId(),[v,g]=b.useState(!1),[x,w]=b.useState(-1),[k,j]=b.useState(l??""),[_,S]=b.useState(null),P=b.useRef(null),T=b.useRef(null),E=a!==void 0,I=E?a:k,A=i.find(C=>C.value===I),O=(A==null?void 0:A.label)??o??"Select...",M=b.useCallback(()=>{if(f)return;g(!0);const C=i.findIndex($=>$.value===I);w(C>=0?C:0)},[f,i,I]),N=b.useCallback(()=>{g(!1),w(-1)},[]),z=b.useCallback(C=>{var $;C.disabled||(E||j(C.value),c==null||c(C.value),N(),($=P.current)==null||$.focus())},[E,c,N]),V=b.useCallback(C=>{if(!f)switch(C.key){case"Enter":case" ":C.preventDefault(),v&&x>=0?z(i[x]):M();break;case"Escape":C.preventDefault(),v&&N();break;case"ArrowDown":C.preventDefault(),v?w($=>{let Q=$+1;for(;Q<i.length&&i[Q].disabled;)Q++;return Q<i.length?Q:$}):M();break;case"ArrowUp":C.preventDefault(),v?w($=>{let Q=$-1;for(;Q>=0&&i[Q].disabled;)Q--;return Q>=0?Q:$}):M();break;case"Home":if(C.preventDefault(),v){let $=0;for(;$<i.length&&i[$].disabled;)$++;$<i.length&&w($)}break;case"End":if(C.preventDefault(),v){let $=i.length-1;for(;$>=0&&i[$].disabled;)$--;$>=0&&w($)}break;case"Tab":v&&N();break}},[f,v,x,i,M,N,z]);b.useEffect(()=>{if(!v)return;const C=$=>{var Q,R;const ce=$.target;(Q=P.current)!=null&&Q.contains(ce)||(R=T.current)!=null&&R.contains(ce)||N()};return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[v,N]),b.useEffect(()=>{if(!v||x<0||!T.current)return;const C=T.current.querySelector(`[data-option-index="${x}"]`);C==null||C.scrollIntoView({block:"nearest"})},[v,x]),b.useEffect(()=>{if(!v){S(null);return}const C=()=>{if(!P.current)return;const $=P.current.getBoundingClientRect();if($.bottom<0||$.top>window.innerHeight){N();return}S($)};return C(),document.addEventListener("scroll",C,{capture:!0,passive:!0}),window.addEventListener("resize",C,{passive:!0}),()=>{document.removeEventListener("scroll",C,{capture:!0}),window.removeEventListener("resize",C)}},[v,N]);const L=Wi(h),B=L?{"--sketch-fill":L.backgroundColor}:void 0;return d.jsxs("div",{className:Y(Le.wrapper,s==="chalkboard"&&Le.chalkboard,m),style:p?{width:typeof p=="number"?`${p}px`:p}:void 0,children:[e&&d.jsx("label",{htmlFor:y,className:Le.label,children:e}),d.jsxs("select",{id:y,name:u,className:Le.nativeSelect,value:I,onChange:C=>c==null?void 0:c(C.target.value),disabled:f,"aria-hidden":"true",tabIndex:-1,children:[o&&d.jsx("option",{value:"",children:o}),i.map(C=>d.jsx("option",{value:C.value,disabled:C.disabled,children:C.label},C.value))]}),d.jsxs("button",{ref:P,type:"button",role:"combobox","aria-expanded":v,"aria-haspopup":"listbox","aria-controls":v?`${y}-listbox`:void 0,"aria-activedescendant":v&&x>=0?`${y}-option-${x}`:void 0,className:Y(Le.trigger,Le[r],n&&Le.error,v&&Le.open,f&&Le.disabled),onClick:()=>v?N():M(),onKeyDown:V,disabled:f,children:[d.jsx("span",{className:Y(Le.triggerLabel,!A&&Le.placeholder),children:O}),d.jsx(CV,{className:Y(Le.chevron,v&&Le.chevronOpen)}),d.jsx(Ct,{fill:!0,...jt.field})]}),v&&_&&Ms.createPortal(d.jsxs("div",{ref:T,id:`${y}-listbox`,role:"listbox",tabIndex:-1,className:Le.dropdown,style:{...B,position:"fixed",top:_.bottom+6,left:_.left,width:_.width},onKeyDown:C=>{var $;C.key==="Escape"&&(C.preventDefault(),N(),($=P.current)==null||$.focus())},children:[d.jsx(Ct,{fill:!0,...jt.surface}),d.jsx("div",{className:Le.options,children:i.map((C,$)=>d.jsx("div",{id:`${y}-option-${$}`,role:"option","aria-selected":C.value===I,tabIndex:-1,"data-option-index":$,className:Y(Le.option,C.value===I&&Le.optionSelected,$===x&&Le.optionHighlighted,C.disabled&&Le.optionDisabled),onClick:Q=>{Q.stopPropagation(),z(C)},onMouseEnter:()=>w($),children:C.label},C.value))})]}),document.body),t&&d.jsx("span",{className:Y(Le.helperText,n&&Le.helperError),children:t})]})}function CV({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 AS({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 jV="alert-module__alert___j7ZRS",PV="alert-module__surface___IaVgU",EV="alert-module__iconWrapper___kLoxT",TV="alert-module__message___klR2U",NV="alert-module__dismiss___f2uoG",RV="alert-module__info___PBo1l",IV="alert-module__success___AVBKS",AV="alert-module__warning___zkMaJ",MV="alert-module__error___cxg96",LV="alert-module__chalkboard___7pgWk",ss={alert:jV,surface:PV,iconWrapper:EV,message:TV,dismiss:NV,info:RV,success:IV,warning:AV,error:MV,chalkboard:LV};function MS({children:e,variant:t="info",surface:n="paper",texture:r="kraft",dismissible:s=!1,onDismiss:i,className:o}){const a=n==="chalkboard";return d.jsxs("div",{className:Y(ss.alert,ss[t],a&&ss.chalkboard,o),role:t==="warning"||t==="error"?"alert":"status",children:[d.jsx(Ct,{clip:!0,...jt.surface}),d.jsx("div",{className:ss.surface,style:a?void 0:Wi(r)}),d.jsx("span",{className:ss.iconWrapper,children:d.jsx(AS,{variant:t})}),d.jsx("div",{className:ss.message,children:e}),s&&d.jsx("button",{type:"button",className:ss.dismiss,onClick:i,"aria-label":"Dismiss alert",children:d.jsx(Nu,{size:16})})]})}const DV="modal-module__overlay___a52Ni",FV="modal-module__fadeIn___5OWd5",OV="modal-module__backdrop___RS4yj",zV="modal-module__modal___ZioOV",$V="modal-module__slideUp___vfFrm",BV="modal-module__small___hcxwF",VV="modal-module__medium___mjbM5",UV="modal-module__large___1dzyf",WV="modal-module__header___iP09B",HV="modal-module__title___nj06m",GV="modal-module__close___gQou9",KV="modal-module__body___Y-EdA",qV="modal-module__chalkboard___qY8qo",Wn={overlay:DV,fadeIn:FV,backdrop:OV,modal:zV,slideUp:$V,small:BV,medium:VV,large:UV,header:WV,title:HV,close:GV,body:KV,chalkboard:qV},QV='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';function Na({open:e,onClose:t,title:n,children:r,size:s="medium",surface:i="paper",texture:o=!1,className:a}){const l=b.useId(),c=b.useRef(null),u=b.useRef(null);if(ju(e,t),b.useEffect(()=>{var p;if(!e)return;u.current=document.activeElement,(p=c.current)==null||p.focus();const h=y=>{var v;if(y.key!=="Tab")return;const g=(v=c.current)==null?void 0:v.querySelectorAll(QV);if(!g||g.length===0){y.preventDefault();return}const x=g[0],w=g[g.length-1];y.shiftKey&&document.activeElement===x?(y.preventDefault(),w.focus()):!y.shiftKey&&document.activeElement===w&&(y.preventDefault(),x.focus())};document.addEventListener("keydown",h);const m=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{var y,v;document.removeEventListener("keydown",h),document.body.style.overflow=m,(v=(y=u.current)==null?void 0:y.focus)==null||v.call(y)}},[e]),!e||typeof document>"u")return null;const f=Wi(o);return Ms.createPortal(d.jsxs("div",{className:Wn.overlay,children:[d.jsx("button",{type:"button",className:Wn.backdrop,"aria-label":"Close modal",onClick:t}),d.jsxs("div",{ref:c,className:Y(Wn.modal,Wn[s],i==="chalkboard"&&Wn.chalkboard,a),style:f,role:"dialog","aria-modal":"true","aria-labelledby":n?l:void 0,tabIndex:-1,children:[d.jsxs("div",{className:Wn.header,children:[n&&d.jsx("h2",{id:l,className:Wn.title,children:n}),d.jsx("button",{type:"button",className:Wn.close,onClick:t,"aria-label":"Close modal",children:d.jsx(Nu,{size:18})})]}),d.jsx("div",{className:Wn.body,children:r})]})]}),document.body)}const YV="textarea-module__wrapper___NbiNO",XV="textarea-module__label___ejhyZ",JV="textarea-module__field___KluQf",ZV="textarea-module__textarea___0y-7v",e6="textarea-module__resizeGrip___lONlE",t6="textarea-module__small___yPyr8",n6="textarea-module__medium___ezQxA",r6="textarea-module__large___xfeKi",s6="textarea-module__error___EkXKJ",i6="textarea-module__disabled___9CKbb",o6="textarea-module__helperText___l1sPh",a6="textarea-module__helperError___VfTLy",l6="textarea-module__chalkboard___zZ0X0",cn={wrapper:YV,label:XV,field:JV,textarea:ZV,resizeGrip:e6,small:t6,medium:n6,large:r6,error:s6,disabled:i6,helperText:o6,helperError:a6,chalkboard:l6},c6=48,Ru=b.forwardRef(function({label:e,helperText:t,error:n=!1,size:r="medium",surface:s="paper",className:i,id:o,...a},l){const c=b.useId(),u=o??c,f=b.useRef(null),p=b.useCallback(m=>{f.current=m,typeof l=="function"?l(m):l&&(l.current=m)},[l]),h=b.useCallback(m=>{const y=f.current;if(!y)return;m.preventDefault();const v=m.clientY,g=y.offsetHeight,x=k=>{y.style.height=`${Math.max(c6,g+k.clientY-v)}px`},w=()=>{window.removeEventListener("pointermove",x),window.removeEventListener("pointerup",w)};window.addEventListener("pointermove",x),window.addEventListener("pointerup",w)},[]);return d.jsxs("div",{className:Y(cn.wrapper,s==="chalkboard"&&cn.chalkboard,i),children:[e&&d.jsx("label",{htmlFor:u,className:cn.label,children:e}),d.jsxs("span",{className:Y(cn.field,cn[r],n&&cn.error,a.disabled&&cn.disabled),children:[d.jsx("textarea",{ref:p,id:u,className:cn.textarea,...a}),d.jsx(Ct,{fill:!0,...jt.field}),!a.disabled&&d.jsx("span",{className:cn.resizeGrip,onPointerDown:h,"aria-hidden":"true",title:"Drag to resize",children:d.jsxs("svg",{viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:[d.jsx("path",{d:"M11 4.5 L4.5 11"}),d.jsx("path",{d:"M11 8.5 L8.5 11"})]})})]}),t&&d.jsx("span",{className:Y(cn.helperText,n&&cn.helperError),children:t})]})}),u6="progress-module__track___a5BMO",d6="progress-module__svg___3U0-E",S0={track:u6,svg:d6},sf=300,pr=1;function f6({value:e,max:t=100,color:n,height:r=6,surface:s="paper",className:i}){const o=t>0?Math.max(0,Math.min(100,Math.round(e/t*100))):0,a=s==="chalkboard",l=Math.max(1,Math.round(Tu()*1e6)),c=a?nt(J.chalkboardBorderBase,.16):nt(J.textPrimary,.12),u=n??(a?J.chalkboardChalk:J.textSecondary),f=b.useMemo(()=>Oe.toPaths(Oe.rectangle(pr,pr,sf-pr*2,r-pr*2,{seed:l,roughness:2.2,fill:c,fillStyle:"solid",stroke:c,strokeWidth:1.5})),[l,c,r]),p=Math.max(o/100*(sf-pr*2),0),h=b.useMemo(()=>p>0?Oe.toPaths(Oe.rectangle(pr,pr,p,r-pr*2,{seed:l+1,roughness:2,fill:u,fillStyle:"solid",stroke:u,strokeWidth:1})):[],[l,u,p,r]);return d.jsx("div",{className:Y(S0.track,i),style:{height:r,borderRadius:r/2},children:d.jsxs("svg",{className:S0.svg,viewBox:`0 0 ${sf} ${r}`,preserveAspectRatio:"none","aria-hidden":"true",children:[f.map((m,y)=>d.jsx("path",{d:m.d,stroke:m.stroke,strokeWidth:m.strokeWidth,fill:m.fill},y)),h.map((m,y)=>d.jsx("path",{d:m.d,stroke:m.stroke,strokeWidth:m.strokeWidth,fill:m.fill},y))]})})}function h6(e){const t=Tu();return b.useMemo(()=>({blob:D$({seed:t,wobble:e}),ring:F$(t,e)}),[t,e])}const p6="list-item-module__listItem___-tw9O",m6="list-item-module__clickable___GLJmd",g6="list-item-module__blobBg___O3Mzh",y6="list-item-module__blobFill___dXHk1",x6="list-item-module__blobRing___S9mas",v6="list-item-module__active___UsL8O",w6="list-item-module__small___9dphK",b6="list-item-module__medium___yGZCr",k6="list-item-module__icon___2b4wU",_6="list-item-module__label___SIzJ4",S6="list-item-module__action___qGh0-",C6="list-item-module__chalkboard___qpWuM",Gt={listItem:p6,static:"list-item-module__static___qtEX6",clickable:m6,blobBg:g6,blobFill:y6,blobRing:x6,active:v6,small:w6,medium:b6,icon:k6,label:_6,action:S6,chalkboard:C6};function qn({active:e=!1,icon:t,action:n,size:r="medium",wobble:s=.5,surface:i="paper",children:o,className:a,...l}){const c=h6(s),u=!!l.onClick;return d.jsxs("button",{type:"button",className:Y(Gt.listItem,Gt[r],u&&Gt.clickable,!u&&!e&&Gt.static,e&&Gt.active,i==="chalkboard"&&Gt.chalkboard,a),"aria-current":e?"page":void 0,...l,children:[d.jsxs("svg",{className:Gt.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[d.jsx("path",{d:c.blob,className:Gt.blobFill}),d.jsx("path",{d:c.ring,className:Gt.blobRing})]}),t&&d.jsx("span",{className:Gt.icon,children:t}),d.jsx("span",{className:Gt.label,children:o}),n&&d.jsx("span",{className:Gt.action,children:n})]})}const j6="accordion-module__accordion___mqGl-",P6="accordion-module__header___mLfbd",E6="accordion-module__icon___Z90NR",T6="accordion-module__title___HusgG",N6="accordion-module__content___1K0td",R6="accordion-module__chalkboard___am8r4",I6="accordion-module__expanded___836xG",is={accordion:j6,header:P6,icon:E6,title:T6,content:N6,chalkboard:R6,expanded:I6};function A6({title:e,children:t,expanded:n=!1,onToggle:r,surface:s="paper",className:i}){return d.jsxs("div",{className:Y(is.accordion,n&&is.expanded,s==="chalkboard"&&is.chalkboard,i),children:[d.jsxs("button",{type:"button",className:is.header,onClick:r,"aria-expanded":n,children:[d.jsx("span",{className:is.icon,"aria-hidden":"true",children:d.jsx(RS,{size:14})}),d.jsx("span",{className:is.title,children:e})]}),n&&d.jsx("div",{className:is.content,children:t})]})}const M6="icon-module__icon___2vrJz",L6="icon-module__blobBg___ENPYJ",D6="icon-module__blobFill___IPbwQ",F6="icon-module__blobRing___1awqV",O6="icon-module__content___TaZR6",z6="icon-module__small___Xp--F",$6="icon-module__medium___tCjMB",B6="icon-module__large___vBtP7",Hs={icon:M6,blobBg:L6,blobFill:D6,blobRing:F6,content:O6,small:z6,medium:$6,large:B6},V6={small:20,medium:24,large:28};function U6({icon:e,size:t="medium",wobble:n=.5,fillColor:r,className:s}){const i=Hi(n),o=V6[t];return d.jsxs("span",{className:Y(Hs.icon,Hs[t],s),children:[d.jsxs("svg",{className:Hs.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[d.jsx("path",{d:i.blob,className:Hs.blobFill,style:r?{fill:r}:void 0}),d.jsx("path",{d:i.ring,className:Hs.blobRing})]}),d.jsx("span",{className:Hs.content,style:{width:o,height:o},children:e})]})}const W6="radio-module__wrapper___BB05E",H6="radio-module__blobFill___p5BX4",G6="radio-module__labelLeft___ijB93",K6="radio-module__input___M2nFJ",q6="radio-module__box___H7ofS",Q6="radio-module__dot___jVJ-d",Y6="radio-module__boxWrapper___Y3qis",X6="radio-module__blobBg___IR-M5",J6="radio-module__labelText___I-nu3",Z6="radio-module__chalkboard___IIBqI",Sn={wrapper:W6,blobFill:H6,labelLeft:G6,input:K6,box:q6,dot:Q6,boxWrapper:Y6,blobBg:X6,labelText:J6,chalkboard:Z6};b.forwardRef(function({label:e,labelPosition:t="right",wobble:n=.4,surface:r="paper",className:s,checked:i,onChange:o,id:a,...l},c){const u=b.useId(),f=a??u,p=Hi(n);return d.jsxs("label",{className:Y(Sn.wrapper,t==="left"&&Sn.labelLeft,r==="chalkboard"&&Sn.chalkboard,s),htmlFor:f,children:[d.jsxs("span",{className:Sn.boxWrapper,children:[d.jsx("input",{ref:c,id:f,type:"radio",className:Sn.input,checked:i,onChange:o,...l}),d.jsx("svg",{className:Sn.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:d.jsx("path",{d:p.blob,className:Sn.blobFill})}),d.jsxs("span",{className:Sn.box,"aria-hidden":"true",children:[d.jsx(Ct,{smooth:!0,shape:"circle",...jt.control}),d.jsx("span",{className:Sn.dot})]})]}),e&&d.jsx("span",{className:Sn.labelText,children:e})]})});const e8="switch-module__wrapper___5-2P1",t8="switch-module__labelLeft___WlT-N",n8="switch-module__input___YKZRj",r8="switch-module__track___QNvnO",s8="switch-module__thumb___cunvF",i8="switch-module__small___WPIxc",o8="switch-module__medium___yPulW",a8="switch-module__large___VlKV1",l8="switch-module__labelText___9Qg39",c8="switch-module__chalkboard___qKTMz",mr={wrapper:e8,labelLeft:t8,input:n8,track:r8,thumb:s8,small:i8,medium:o8,large:a8,labelText:l8,chalkboard:c8},u8=b.forwardRef(function({label:e,labelPosition:t="right",size:n="medium",surface:r="paper",className:s,checked:i,onChange:o,id:a,...l},c){const u=b.useId(),f=a??u;return d.jsxs("label",{className:Y(mr.wrapper,mr[n],t==="left"&&mr.labelLeft,r==="chalkboard"&&mr.chalkboard,s),htmlFor:f,children:[d.jsx("input",{ref:c,id:f,type:"checkbox",className:mr.input,checked:i,onChange:o,...l}),d.jsxs("span",{className:mr.track,"aria-hidden":"true",children:[d.jsx(Ct,{...jt.pill}),d.jsx("span",{className:mr.thumb})]}),e&&d.jsx("span",{className:mr.labelText,children:e})]})}),d8="spinner-module__spinner___FDTk2",f8="spinner-module__chalkboard___DLE1z",h8="spinner-module__svg___JnCWN",p8="spinner-module__track___xbnbo",m8="spinner-module__head___j5dWe",yo={spinner:d8,chalkboard:f8,svg:h8,track:p8,head:m8},g8={small:18,medium:28,large:40},C0=25,y8=18,j0=Oe.toPaths(Oe.circle(C0,C0,y8*2,{seed:7,roughness:1.15,disableMultiStroke:!0})).map(e=>e.d).join(" ");function Hr({size:e="medium",color:t,label:n="Loading",surface:r="paper",className:s}){const i=g8[e];return d.jsx("span",{className:Y(yo.spinner,r==="chalkboard"&&yo.chalkboard,s),role:"status","aria-label":n,children:d.jsxs("svg",{width:i,height:i,viewBox:"0 0 50 50",className:yo.svg,style:t?{color:t}:void 0,"aria-hidden":"true",children:[d.jsx("path",{className:yo.track,d:j0,fill:"none",pathLength:100,strokeLinecap:"round"}),d.jsx("path",{className:yo.head,d:j0,fill:"none",pathLength:100,strokeLinecap:"round"})]})})}const x8="skeleton-module__skeleton___HCSvg",v8="skeleton-module__pulse___6eCq1",w8="skeleton-module__svg___OzxGp",b8="skeleton-module__text___v17Nv",k8="skeleton-module__rect___wqIJy",_8="skeleton-module__circle___RCmyR",of={skeleton:x8,pulse:v8,svg:w8,text:b8,rect:k8,circle:_8},P0={text:[0,0,200,24],rect:[0,0,200,100],circle:[0,0,40,40]},Gs=2;function Kt({variant:e="text",width:t,height:n,surface:r="paper",className:s,style:i}){const o=r==="chalkboard",a=Math.max(1,Math.round(Tu()*1e6)),l=o?nt(J.chalkboardBorderBase,.16):nt(J.textPrimary,.09),c=b.useMemo(()=>{const[,,u,f]=P0[e],p=e==="circle"?Oe.ellipse(u/2,f/2,u-Gs*2,f-Gs*2,{seed:a,roughness:1.5,fill:l,fillStyle:"solid",stroke:l,strokeWidth:1}):Oe.rectangle(Gs,Gs,u-Gs*2,f-Gs*2,{seed:a,roughness:1.4,fill:l,fillStyle:"solid",stroke:l,strokeWidth:1});return Oe.toPaths(p)},[e,a,l]);return d.jsx("span",{className:Y(of.skeleton,of[e],s),style:{width:t,height:n,...i},"aria-hidden":"true",children:d.jsx("svg",{className:of.svg,viewBox:P0[e].join(" "),preserveAspectRatio:"none","aria-hidden":"true",children:c.map((u,f)=>d.jsx("path",{d:u.d,stroke:u.stroke,strokeWidth:u.strokeWidth,fill:u.fill},f))})})}const S8="divider-module__horizontal___tP3rG",C8="divider-module__line___KnBes",j8="divider-module__label___WiUwZ",P8="divider-module__vertical___wBSrT",E8="divider-module__chalkboard___gXTde",Ks={horizontal:S8,line:C8,label:j8,vertical:P8,chalkboard:E8};function ng({orientation:e="horizontal",label:t,surface:n="paper",className:r}){const s=n==="chalkboard"&&Ks.chalkboard;return e==="vertical"?d.jsx("span",{className:Y(Ks.vertical,s,r),role:"separator","aria-orientation":"vertical"}):d.jsxs("div",{className:Y(Ks.horizontal,s,r),role:"separator",children:[d.jsx("span",{className:Ks.line}),t!=null&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:Ks.label,children:t}),d.jsx("span",{className:Ks.line})]})]})}const T8="tooltip-module__wrapper___XeVNe",N8="tooltip-module__tooltip___e-rkz",R8="tooltip-module__tooltipIn___CZbRw",I8="tooltip-module__top___78WWU",A8="tooltip-module__bottom___Irl3O",M8="tooltip-module__left___C1Ec4",L8="tooltip-module__right___oUA-Z",D8="tooltip-module__chalkboard___Um6dx",vl={wrapper:T8,tooltip:N8,tooltipIn:R8,top:I8,bottom:A8,left:M8,right:L8,chalkboard:D8},wl=8,bl=8,F8=typeof window>"u"?b.useEffect:b.useLayoutEffect;function O8(e,t,n){let r,s;switch(t){case"bottom":r=e.bottom+wl,s=e.left+e.width/2-n.width/2;break;case"left":r=e.top+e.height/2-n.height/2,s=e.left-wl-n.width;break;case"right":r=e.top+e.height/2-n.height/2,s=e.right+wl;break;default:r=e.top-wl-n.height,s=e.left+e.width/2-n.width/2}return s=Math.min(Math.max(s,bl),window.innerWidth-n.width-bl),r=Math.min(Math.max(r,bl),window.innerHeight-n.height-bl),{top:r,left:s}}function Te({content:e,children:t,placement:n="top",delay:r=300,disabled:s=!1,surface:i="paper"}){const o=b.useId(),[a,l]=b.useState(!1),[c,u]=b.useState(!1),[f,p]=b.useState(!1),[h,m]=b.useState(null),[y,v]=b.useState(null),g=b.useRef(null),x=b.useRef(null),w=b.useRef(),k=!s&&!!e&&!f&&(a||c),j=()=>{clearTimeout(w.current),w.current=setTimeout(()=>l(!0),r)},_=()=>{clearTimeout(w.current),l(!1),p(!1)},S=()=>{p(!1),u(!0)},P=()=>{u(!1),p(!1)};ju(k,()=>p(!0)),b.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]),F8(()=>{if(!k){v(null);return}const E=x.current;E&&v({width:E.offsetWidth,height:E.offsetHeight})},[k,e,n]),b.useEffect(()=>()=>clearTimeout(w.current),[]);const T=t.props;return d.jsxs("span",{ref:g,className:vl.wrapper,onMouseEnter:j,onMouseLeave:_,onFocus:S,onBlur:P,children:[b.cloneElement(t,{"aria-describedby":k?o:T["aria-describedby"]}),k&&h&&typeof document<"u"&&Ms.createPortal(d.jsx("span",{ref:x,id:o,role:"tooltip",className:Y(vl.tooltip,vl[n],i==="chalkboard"&&vl.chalkboard),style:y?{position:"fixed",...O8(h,n,y)}:{position:"fixed",top:0,left:0,visibility:"hidden"},children:e}),document.body)]})}const z8="toast-module__stack___hDi0s",$8="toast-module__topLeft___Luw-F",B8="toast-module__topCenter___N1DwF",V8="toast-module__topRight___Dtgau",U8="toast-module__bottomLeft___Eb2lo",W8="toast-module__bottomCenter___gs-Yb",H8="toast-module__bottomRight___-0e2j",G8="toast-module__item___RFjtm",K8="toast-module__toastIn___9m9iN",q8="toast-module__card___ZCvJS",Q8="toast-module__surface___mfMl0",Y8="toast-module__iconWrapper___lnjcC",X8="toast-module__content___AlliM",J8="toast-module__title___1Oqh8",Z8="toast-module__description___eiUSB",eU="toast-module__dismiss___tUGx4",tU="toast-module__info___Nh8S9",nU="toast-module__success___hlKLc",rU="toast-module__warning___XUMJt",sU="toast-module__error___pSFFC",iU="toast-module__chalkboard___c49gt",qt={stack:z8,topLeft:$8,topCenter:B8,topRight:V8,bottomLeft:U8,bottomCenter:W8,bottomRight:H8,item:G8,toastIn:K8,card:q8,surface:Q8,iconWrapper:Y8,content:X8,title:J8,description:Z8,dismiss:eU,info:tU,success:nU,warning:rU,error:sU,chalkboard:iU};function oU({record:e,surface:t="paper",onDismiss:n}){const r=b.useRef(e.duration),s=b.useRef(0),i=b.useRef(),o=b.useCallback(f=>{clearTimeout(i.current),!(f<=0)&&(s.current=Date.now(),i.current=setTimeout(()=>n(e.id),f))},[n,e.id]);b.useEffect(()=>(o(e.duration),()=>clearTimeout(i.current)),[o,e.duration]);const a=()=>{i.current&&(clearTimeout(i.current),r.current-=Date.now()-s.current)},l=()=>o(r.current),c=t==="chalkboard",u=e.variant==="warning"||e.variant==="error"?"alert":"status";return d.jsx("div",{className:qt.item,onMouseEnter:a,onMouseLeave:l,children:d.jsxs("div",{className:Y(qt.card,qt[e.variant],c&&qt.chalkboard),role:u,children:[d.jsx(Ct,{clip:!0,...jt.surface}),d.jsx("div",{className:qt.surface,style:c?void 0:Wi("kraft")}),d.jsx("span",{className:qt.iconWrapper,children:d.jsx(AS,{variant:e.variant})}),d.jsxs("div",{className:qt.content,children:[e.title&&d.jsx("div",{className:qt.title,children:e.title}),d.jsx("div",{className:qt.description,children:e.description})]}),d.jsx("button",{type:"button",className:qt.dismiss,onClick:()=>n(e.id),"aria-label":"Dismiss notification",children:d.jsx(Nu,{size:16})})]})})}const LS=b.createContext(null);function aU(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function lU({children:e,position:t="bottom-right",surface:n="paper",defaultDuration:r=5e3}){const[s,i]=b.useState([]),o=b.useRef(0),a=b.useCallback(u=>{i(f=>f.filter(p=>p.id!==u))},[]),l=b.useCallback(u=>{o.current+=1;const f=`toast-${o.current}`;return i(p=>[...p,{id:f,title:u.title,description:u.description,variant:u.variant??"info",duration:u.duration??r}]),f},[r]),c=t.startsWith("top")?[...s].reverse():s;return d.jsxs(LS.Provider,{value:{toast:l,dismiss:a},children:[e,typeof document<"u"&&Ms.createPortal(d.jsx("div",{className:Y(qt.stack,qt[aU(t)]),role:"region","aria-label":"Notifications",children:c.map(u=>d.jsx(oU,{record:u,surface:n,onDismiss:a},u.id))}),document.body)]})}function He(){const e=b.useContext(LS);if(!e)throw new Error("useToast must be used within a <ToastProvider>");return e}const cU="breadcrumb-module__breadcrumb___r-ILp",uU="breadcrumb-module__list___V3YFy",dU="breadcrumb-module__item___dDwYf",fU="breadcrumb-module__link___CHC9k",hU="breadcrumb-module__linkButton___XoMW-",pU="breadcrumb-module__current___dprI9",mU="breadcrumb-module__separator___uLhtn",gU="breadcrumb-module__chalkboard___COJpw",Cn={breadcrumb:cU,list:uU,item:dU,link:fU,linkButton:hU,current:pU,static:"breadcrumb-module__static___affaf",separator:mU,chalkboard:gU};function DS({items:e,surface:t="paper",className:n}){return d.jsx("nav",{"aria-label":"Breadcrumb",className:Y(Cn.breadcrumb,t==="chalkboard"&&Cn.chalkboard,n),children:d.jsx("ol",{className:Cn.list,children:e.map((r,s)=>{const i=s===e.length-1;return d.jsxs("li",{className:Cn.item,children:[i?d.jsx("span",{className:Cn.current,"aria-current":"page",children:r.label}):r.href?d.jsx("a",{href:r.href,className:Cn.link,onClick:r.onClick,children:r.label}):r.onClick?d.jsx("button",{type:"button",className:Y(Cn.link,Cn.linkButton),onClick:r.onClick,children:r.label}):d.jsx("span",{className:Cn.static,children:r.label}),!i&&d.jsx(yU,{className:Cn.separator})]},r.id)})})})}function yU({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 xU="menu-module__wrapper___WCtoy",vU="menu-module__menu___i40Wj",wU="menu-module__surface___SJbaB",bU="menu-module__list___YjCfD",kU="menu-module__item___aqcgg",_U="menu-module__icon___1qUvA",SU="menu-module__label___MtQMh",CU="menu-module__danger___p9oZo",jU="menu-module__itemDisabled___HByLP",PU="menu-module__separator___g2uay",EU="menu-module__chalkboard___5jIwI",un={wrapper:xU,menu:vU,surface:wU,list:bU,item:kU,icon:_U,label:SU,danger:CU,itemDisabled:jU,separator:PU,chalkboard:EU},TU=6;function NU(e){return"type"in e&&e.type==="separator"}function FS({trigger:e,items:t,align:n="start",surface:r="paper",className:s}){const i=b.useId(),[o,a]=b.useState(!1),[l,c]=b.useState(null),u=b.useRef(null),f=b.useRef(null),p=b.useCallback(()=>{var g,x;(x=(g=u.current)==null?void 0:g.querySelector("button, a, [tabindex]"))==null||x.focus()},[]),h=b.useCallback(()=>a(!1),[]);ju(o,()=>{h(),p()}),b.useEffect(()=>{if(!o)return;const g=x=>{var w,k;const j=x.target;(w=u.current)!=null&&w.contains(j)||(k=f.current)!=null&&k.contains(j)||h()};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[o,h]),b.useEffect(()=>{if(!o){c(null);return}const g=()=>{u.current&&c(u.current.getBoundingClientRect())};return g(),document.addEventListener("scroll",g,{capture:!0,passive:!0}),window.addEventListener("resize",g,{passive:!0}),()=>{document.removeEventListener("scroll",g,{capture:!0}),window.removeEventListener("resize",g)}},[o]),b.useEffect(()=>{var g,x;!o||!l||(x=(g=f.current)==null?void 0:g.querySelector('[role="menuitem"]:not(:disabled)'))==null||x.focus()},[o,l]);const m=g=>{var x,w,k,j,_;const S=Array.from(((x=f.current)==null?void 0:x.querySelectorAll('[role="menuitem"]:not(:disabled)'))??[]);if(S.length===0)return;const P=S.indexOf(document.activeElement);switch(g.key){case"ArrowDown":g.preventDefault(),(w=S[(P+1)%S.length])==null||w.focus();break;case"ArrowUp":g.preventDefault(),(k=S[(P-1+S.length)%S.length])==null||k.focus();break;case"Home":g.preventDefault(),(j=S[0])==null||j.focus();break;case"End":g.preventDefault(),(_=S[S.length-1])==null||_.focus();break;case"Tab":h();break}},y=g=>{var x;g.disabled||(h(),p(),(x=g.onSelect)==null||x.call(g))},v=e.props;return d.jsxs("span",{ref:u,className:un.wrapper,children:[b.cloneElement(e,{"aria-haspopup":"menu","aria-expanded":o,onClick:g=>{var x;(x=v.onClick)==null||x.call(v,g),a(w=>!w)}}),o&&l&&typeof document<"u"&&Ms.createPortal(d.jsxs("div",{ref:f,id:i,role:"menu",className:Y(un.menu,r==="chalkboard"&&un.chalkboard,s),style:{position:"fixed",top:l.bottom+TU,minWidth:l.width,...n==="end"?{right:window.innerWidth-l.right}:{left:l.left}},onKeyDown:m,children:[d.jsx(Ct,{clip:!0,...jt.surface}),d.jsx("div",{className:un.surface}),d.jsx("div",{className:un.list,children:t.map(g=>NU(g)?d.jsx("div",{role:"separator",className:un.separator},g.id):d.jsxs("button",{type:"button",role:"menuitem",tabIndex:-1,disabled:g.disabled,className:Y(un.item,g.danger&&un.danger,g.disabled&&un.itemDisabled),onClick:()=>y(g),children:[g.icon&&d.jsx("span",{className:un.icon,children:g.icon}),d.jsx("span",{className:un.label,children:g.label})]},g.id))})]}),document.body)]})}function We(e){const t=e.split(`
|
|
87
|
+
`).map(r=>r.trim()).filter(Boolean);return t.find(r=>r.startsWith("!")||r.startsWith("error:")||r.startsWith("fatal:"))??t.at(-1)??e}const OS="font-display-luminari text-base font-semibold text-desk-text-muted mb-3",rg="font-display-luminari text-xs font-semibold uppercase tracking-wide text-desk-text-muted mb-2",us={pass:"#2d5a3b",fail:"#5a2d2d",running:"#5a4a2d"},ds={pass:"#b5d6b5",fail:"#d6a0a0",running:"#d6c4a0"},RU=3,IU="basis-[9.25rem]",AU=e=>{switch(e.taskKind){case"phase":return e.phaseIndex!==void 0?` — phase ${e.phaseIndex+1}`:"";case"audit":return" — audit";case"batch-reconcile":return" — batch reconcile";case"reconcile":return" — reconcile";case"fix-review":return" — fixing review comments";case"draft":return" — drafting";case"extend":return" — extending";case"commit-suggest":return" — suggesting commit message";case"overlap-check":return" — checking overlap";case"sync":return" — syncing to main";case"resolve-conflict":return" — resolving conflict";case"run-all":return" — run all phases";default:return""}},MU=({task:e,onStop:t})=>{const n=Vt(),{toast:r}=He(),s=()=>n({to:"/tasks",search:{taskId:e.id}}),i=async l=>{l.stopPropagation();try{await t(e.id)}catch(c){r({title:"Failed to stop agent",description:We(c.message),variant:"error"})}},o={starting:us.running,running:us.running,stopping:us.running,done:us.pass,error:us.fail,superseded:us.running},a={starting:ds.running,running:ds.running,stopping:ds.running,done:ds.pass,error:ds.fail,superseded:ds.running};return d.jsx(de,{surface:"chalkboard",size:"small",className:"stack-task-card",children:d.jsxs("div",{role:"button",tabIndex:0,onClick:s,onKeyDown:l=>{l.target===l.currentTarget&&(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),s())},className:"flex cursor-pointer items-center justify-between gap-2 rounded-[10px]",children:[d.jsxs("span",{className:"min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-display-luminari text-sm font-semibold text-desk-chalk",children:[e.planTitle,AU(e)," · ",QM[e.agentId]]}),d.jsxs("div",{className:"flex items-center gap-2",children:[e.status==="error"&&e.errorKind==="auth"?d.jsx("button",{type:"button",onClick:l=>{l.stopPropagation(),n({to:"/settings/$section",params:{section:"setup"}})},className:"bg-none bg-transparent border-none p-0 cursor-pointer",children:d.jsx(Pe,{surface:"chalkboard",size:"small",fillColor:o.error,textColor:a.error,children:"stopped — agent signed out"})}):d.jsx(Pe,{surface:"chalkboard",size:"small",fillColor:o[e.status],textColor:a[e.status],children:e.status}),(e.status==="running"||e.status==="starting"||e.status==="stopping")&&d.jsx(ot,{icon:d.jsx(Nu,{}),variant:"ghost",size:"small",label:"Stop agent",onClick:i,disabled:e.status==="stopping"})]})]})})},LU=()=>{const e=D(r=>r.agentStatus),t=D(r=>r.stopAgent),n=e.slice(0,RU);return d.jsxs("div",{className:"flex min-h-0 flex-none flex-col p-6",children:[d.jsx("div",{className:OS,children:"Agent"}),d.jsx("div",{className:`flex min-h-0 flex-auto flex-col gap-2 overflow-y-auto ${IU} ${n.length>0?"justify-start":"justify-center"}`,children:n.length>0?n.map(r=>d.jsx(MU,{task:r,onStop:t},r.id)):d.jsx(de,{surface:"chalkboard",size:"small",children:d.jsx("p",{className:"m-0 text-center text-xs opacity-50",children:"No agent running."})})})]})},DU=()=>{const[e,t]=b.useState(null),[n,r]=b.useState(!0);return b.useEffect(()=>{let s=!1;return ym().then(i=>{s||(t((i==null?void 0:i.desk)??null),r(!1))}),()=>{s=!0}},[]),{desk:e,loading:n}},FU=async()=>{const e=await fetch(G("/api/checks"));return e.ok?(await e.json()).checks??[]:[]},OU=async e=>{const t=await fetch(G(`/api/checks/run?name=${encodeURIComponent(e)}`),{method:"POST"});if(!t.ok){const n=await t.json().catch(()=>({error:"Failed to run check"}));throw new Error(n.error??"Failed to run check")}};function zU(){const[e,t]=b.useState([]),n=b.useCallback(async()=>{try{t(await FU())}catch{}},[]);b.useEffect(()=>{n()},[n]),b.useEffect(()=>{const s=new EventSource(G("/api/activity/stream"));let i;const o=()=>{i&&clearTimeout(i),i=setTimeout(n,80)};return s.onmessage=a=>{let l;try{l=JSON.parse(a.data)}catch{return}(l.type==="check"||l.message==="changed")&&o()},()=>{i&&clearTimeout(i),s.close()}},[n]);const r=b.useCallback(async s=>{await OU(s),await n()},[n]);return{checks:e,run:r,refresh:n}}const $U={...us,stale:"transparent"},BU={...ds,stale:void 0},VU=e=>`Fix the failing "${e.name}" check in this repo. The command was \`${e.cmd}\`.
|
|
88
|
+
|
|
89
|
+
Output from the last run:
|
|
90
|
+
|
|
91
|
+
${e.output||"(no output captured)"}`,UU=({check:e,onRun:t})=>{const n=e.status==="running";return d.jsx(Te,{content:`${e.cmd} — click to run.`,surface:"chalkboard",children:d.jsx("button",{type:"button",className:`inline-flex border-none bg-transparent bg-none p-0 ${n?"cursor-not-allowed":"cursor-pointer enabled:hover:-translate-y-px enabled:hover:brightness-[1.15]"}`,onClick:()=>{n||t(e.name)},disabled:n,children:d.jsxs(Pe,{surface:"chalkboard",size:"small",fillColor:$U[e.status],textColor:BU[e.status],children:[e.name,d.jsx("span",{className:n?"visible":"invisible",children:"…"})]})})})},WU=()=>{const{checks:e,run:t}=zU(),n=e.find(r=>r.status==="fail");return d.jsxs("div",{children:[d.jsx("div",{className:rg,children:"Checks"}),e.length>0?d.jsxs("div",{className:"flex flex-col gap-3",children:[d.jsx("div",{className:"flex flex-wrap gap-2",children:e.map(r=>d.jsx(UU,{check:r,onRun:t},r.name))}),n&&d.jsxs("div",{className:"flex flex-col gap-1 text-center font-handwritten text-sm",children:[d.jsxs("span",{className:"text-desk-text-muted",children:["The ",n.name," check failed."]}),d.jsxs("span",{className:"text-desk-chalk",children:["Suggested fix: ",d.jsx(Xh,{text:VU(n),surface:"chalkboard"})]})]})]}):d.jsx(de,{surface:"chalkboard",size:"small",children:d.jsx("p",{className:"m-0 text-center text-xs opacity-50",children:"No checks declared."})})]})},HU=async()=>{try{const e=await fetch(G("/api/ci"));return e.ok?e.json():null}catch{return null}};function GU(){const[e,t]=b.useState(null),[n,r]=b.useState(!0),s=b.useCallback(async()=>{try{t(await HU())}finally{r(!1)}},[]);return b.useEffect(()=>{s()},[s]),b.useEffect(()=>{const i=new EventSource(G("/api/activity/stream"));let o;i.onmessage=l=>{let c;try{c=JSON.parse(l.data)}catch{return}c.message==="changed"&&(o&&clearTimeout(o),o=setTimeout(s,250))};const a=()=>s();return window.addEventListener("focus",a),()=>{o&&clearTimeout(o),window.removeEventListener("focus",a),i.close()}},[s]),{ci:e,loading:n,refresh:s}}const KU={success:"bg-chalk-pass-text",failure:"bg-chalk-fail-text",in_progress:"bg-chalk-running-text",queued:"bg-chalk-running-text",cancelled:"bg-desk-text-muted",unknown:"bg-desk-text-muted"},af="text-desk-chalk underline decoration-desk-border hover:decoration-desk-chalk",qU=({run:e})=>{const t=d.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[d.jsx("span",{"aria-hidden":"true",className:`h-2 w-2 shrink-0 rounded-full ${KU[e.status]}`}),d.jsx("span",{className:"min-w-0 overflow-hidden text-ellipsis whitespace-nowrap text-desk-chalk",children:e.workflow}),d.jsx("span",{className:"shrink-0 font-mono text-2xs text-desk-text-muted",children:e.status})]});return e.url?d.jsx("a",{href:e.url,target:"_blank",rel:"noreferrer",className:"no-underline",children:t}):t},QU=()=>{const{ci:e,loading:t}=GU(),n=()=>{var s;if(!e)return d.jsx(de,{surface:"chalkboard",size:"small",children:d.jsx("p",{className:"m-0 text-center text-xs opacity-50",children:t?"Checking CI…":"No CI source declared."})});const r=`https://github.com/${e.repo}/actions`;return e.available?d.jsx(de,{surface:"chalkboard",size:"small",children:d.jsxs("div",{className:"flex flex-col gap-2 text-sm",children:[e.runs.length>0?e.runs.map(i=>d.jsx(qU,{run:i},i.workflow)):d.jsxs("span",{className:"text-xs text-desk-text-muted opacity-70",children:["No recent runs on ",e.branch,"."]}),d.jsxs("div",{className:"font-mono text-2xs text-desk-text-muted",children:["Released ",e.releasedVersion??"—"," · Queued ",((s=e.releasePr)==null?void 0:s.version)??"none"]}),d.jsxs("div",{className:"flex flex-wrap gap-x-3 text-2xs",children:[e.releasePr&&d.jsxs("a",{href:e.releasePr.url,target:"_blank",rel:"noreferrer",className:af,children:["Release PR #",e.releasePr.number]}),d.jsx("a",{href:r,target:"_blank",rel:"noreferrer",className:af,children:"Open Actions"})]})]})}):d.jsx(de,{surface:"chalkboard",size:"small",children:d.jsxs("p",{className:"m-0 text-center text-xs opacity-70",children:["CI status unavailable —"," ",d.jsx("a",{href:r,target:"_blank",rel:"noreferrer",className:af,children:"open Actions"})]})})};return d.jsxs("div",{children:[d.jsx("div",{className:rg,children:"CI & release"}),n()]})},zS=async(e,t)=>{if(!e.ok){const n=await e.json().catch(()=>({error:t}));throw new Error(n.error??t)}},YU=async()=>{const e=await fetch(G("/api/services"));return e.ok?(await e.json()).services??[]:[]},XU=async e=>{const t=await fetch(G(`/api/services/start?name=${encodeURIComponent(e)}`),{method:"POST"});await zS(t,"Failed to start service")},JU=async e=>{const t=await fetch(G(`/api/services/stop?name=${encodeURIComponent(e)}`),{method:"POST"});await zS(t,"Failed to stop service")},ZU=async e=>{const t=await fetch(G(`/api/services/logs?name=${encodeURIComponent(e)}`));return t.ok?(await t.json()).log??"":""};function eW(){const[e,t]=b.useState([]),[n,r]=b.useState(!0),s=b.useCallback(async()=>{try{t(await YU())}catch{}finally{r(!1)}},[]);b.useEffect(()=>{s()},[s]),b.useEffect(()=>{const a=new EventSource(G("/api/activity/stream"));let l;const c=()=>{l&&clearTimeout(l),l=setTimeout(s,80)};return a.onmessage=u=>{let f;try{f=JSON.parse(u.data)}catch{return}(f.type==="service"||f.message==="changed")&&c()},()=>{l&&clearTimeout(l),a.close()}},[s]);const i=b.useCallback(async a=>{await XU(a),await s()},[s]),o=b.useCallback(async a=>{await JU(a),await s()},[s]);return{services:e,loading:n,start:i,stop:o,refresh:s}}const $S=({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"})]}),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:"M12 19V5"}),d.jsx("path",{d:"m5 12 7-7 7 7"})]}),nW=({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"})]}),BS=({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"})]}),rW=({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"})]}),VS=({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"})]}),sW=({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"})]}),iW=({size:e=12})=>d.jsx("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:d.jsx("path",{d:"M6 4l11 6-11 6z"})}),oW=({size:e=12})=>d.jsx("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:d.jsx("rect",{x:"5",y:"5",width:"10",height:"10",rx:"1.5"})}),aW=({size:e=16})=>d.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("path",{d:"M18 8a6 6 0 0 0-12 0c0 7-3 9-3 9h18s-3-2-3-9"}),d.jsx("path",{d:"M13.73 21a2 2 0 0 1-3.46 0"})]}),lW=({size:e=16})=>d.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("path",{d:"M6 3v12"}),d.jsx("circle",{cx:"18",cy:"6",r:"3"}),d.jsx("circle",{cx:"6",cy:"18",r:"3"}),d.jsx("path",{d:"M18 9a9 9 0 0 1-9 9"})]}),cW=({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"})}),sg=({size:e=14})=>d.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"opacity-[0.55] shrink-0",children:[d.jsx("title",{children:"Idea"}),d.jsx("path",{d:"M9 18h6M10 22h4M12 2a6 6 0 0 0-3.5 10.9c.53.4.9 1.03.9 1.72V15h5.2v-.38c0-.69.37-1.32.9-1.72A6 6 0 0 0 12 2Z"})]}),US=({size:e=14})=>d.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"opacity-[0.55] shrink-0",children:[d.jsx("title",{children:"Note"}),d.jsx("path",{d:"M15 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9Z"}),d.jsx("path",{d:"M15 3v6h6"})]}),uW=1500,dW=e=>e.status==="crashed"?"bg-chalk-fail-text":e.status==="running"?e.health==="up"?"bg-chalk-pass-text":"bg-chalk-running-text":e.status==="stopping"?"bg-chalk-running-text":"bg-desk-text-muted",fW=({service:e})=>d.jsx("span",{"aria-hidden":"true",className:`h-2 w-2 shrink-0 rounded-full ${dW(e)}`,title:e.status==="running"?`running · ${e.health}`:e.status}),hW=({name:e,running:t})=>{const[n,r]=b.useState(""),s=b.useRef(null);return b.useEffect(()=>{let i=!1;const o=async()=>{const l=await ZU(e);i||r(l)};if(o(),!t)return;const a=setInterval(o,uW);return()=>{i=!0,clearInterval(a)}},[e,t]),b.useEffect(()=>{const i=s.current;i&&n&&(i.scrollTop=i.scrollHeight)},[n]),d.jsx("pre",{ref:s,className:"m-0 mt-2 max-h-40 overflow-auto whitespace-pre-wrap break-words rounded-[8px] bg-desk-bg/60 p-2 font-mono text-2xs leading-relaxed text-desk-text-muted",children:n||"No output yet."})},pW=({service:e,onStart:t,onStop:n})=>{const{toast:r}=He(),[s,i]=b.useState(!1),[o,a]=b.useState(!1),l=e.status==="running"||e.status==="stopping",c=async()=>{if(!s){i(!0);try{await(l?n:t)(e.name)}catch(u){r({title:l?"Failed to stop service":"Failed to start service",description:u.message,variant:"error"})}finally{i(!1)}}};return d.jsxs(de,{surface:"chalkboard",size:"small",children:[d.jsxs("div",{className:"flex items-center justify-between gap-2",children:[d.jsxs("button",{type:"button",onClick:()=>a(u=>!u),className:"flex min-w-0 cursor-pointer items-center gap-2 border-none bg-transparent p-0 text-left",children:[d.jsx(fW,{service:e}),d.jsx("span",{className:"min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-display-luminari text-sm font-semibold text-desk-chalk",children:e.name}),e.port&&d.jsxs("span",{className:"shrink-0 font-mono text-2xs text-desk-text-muted",children:[":",e.port]})]}),d.jsx("div",{className:"flex shrink-0 items-center gap-1",children:s?d.jsx(Hr,{size:"small",surface:"chalkboard",label:"Working"}):d.jsx(ot,{icon:l?d.jsx(oW,{}):d.jsx(iW,{}),surface:"chalkboard",size:"small",variant:"ghost",label:l?`Stop ${e.name}`:`Start ${e.name}`,onClick:c})})]}),o&&d.jsx(hW,{name:e.name,running:l})]})},mW=()=>{const{services:e,start:t,stop:n}=eW(),r=b.useCallback(i=>t(i),[t]),s=b.useCallback(i=>n(i),[n]);return d.jsxs("div",{children:[d.jsx("div",{className:rg,children:"Services"}),d.jsx("div",{className:"flex flex-col gap-2",children:e.length>0?e.map(i=>d.jsx(pW,{service:i,onStart:r,onStop:s},i.name)):d.jsx(de,{surface:"chalkboard",size:"small",children:d.jsx("p",{className:"m-0 text-center text-xs opacity-50",children:"No services declared."})})})]})},gW=()=>{const{desk:e,loading:t}=DU();return t||!e?null:d.jsxs(d.Fragment,{children:[d.jsx(ng,{surface:"chalkboard"}),d.jsxs("div",{className:"min-h-0 flex-1 p-6",children:[d.jsx("div",{className:OS,children:"Desk"}),d.jsxs("div",{className:"flex flex-col gap-4",children:[d.jsx(mW,{}),d.jsx(WU,{}),d.jsx(QU,{})]})]})]})},yW=({open:e,onToggle:t,pinned:n=!1})=>{const r=e||n,s=D(S=>S.loadPlans),i=D(S=>S.status),o=D(S=>S.loadStatus),a=D(S=>S.consistency),l=D(S=>S.loadConsistency),c=D(S=>S.doctor),u=D(S=>S.loadDoctor),f=D(S=>S.loadGitStatus),p=D(S=>S.agentStatus),h=D(S=>S.loadAgentStatus),m=D(S=>S.loadSuggestions),y=D(S=>S.loadArchivableIdeas),v=b.useRef({loadPlans:s,loadStatus:o,loadConsistency:l,loadDoctor:u,loadGitStatus:f,loadAgentStatus:h,loadSuggestions:m,loadArchivableIdeas:y});b.useEffect(()=>{v.current={loadPlans:s,loadStatus:o,loadConsistency:l,loadDoctor:u,loadGitStatus:f,loadAgentStatus:h,loadSuggestions:m,loadArchivableIdeas:y}}),b.useEffect(()=>{v.current.loadStatus(),v.current.loadConsistency(),v.current.loadDoctor(),v.current.loadGitStatus(),v.current.loadAgentStatus(),v.current.loadArchivableIdeas()},[]),b.useEffect(()=>{const S=()=>{v.current.loadPlans(),v.current.loadGitStatus()};return window.addEventListener("focus",S),()=>window.removeEventListener("focus",S)},[]),b.useEffect(()=>{const S=new EventSource("/api/activity/stream"),P={},T=(E,I,A)=>{P[E]&&clearTimeout(P[E]),P[E]=setTimeout(I,A)};return S.onmessage=E=>{const I=JSON.parse(E.data);if(I.type==="status"){T("status",()=>v.current.loadStatus(),80);return}if(I.type==="agent"){T("agent",()=>v.current.loadAgentStatus(),120);return}I.message==="changed"&&T("activity",()=>{v.current.loadPlans(),v.current.loadSuggestions(),v.current.loadStatus(),v.current.loadConsistency(),v.current.loadDoctor(),v.current.loadGitStatus(),v.current.loadAgentStatus(),v.current.loadArchivableIdeas()},250)},()=>{for(const E of Object.values(P))E&&clearTimeout(E);S.close()}},[]);const{qualityStatus:g,testStatus:x,consistencyStatus:w}=b.useMemo(()=>km(i),[i]),k=a.length>0,j=g==="fail"||x==="fail"||w==="fail"||k||c.errorCount>0,_=p.some(S=>S.status==="running"||S.status==="starting"||S.status==="stopping");return d.jsxs(d.Fragment,{children:[!r&&d.jsx("div",{className:"fixed right-0 top-[var(--pc-stack-toggle-top,50%)] z-[300] rounded-l-md shadow-[-2px_0_8px_rgba(0,0,0,0.15)] bg-desk-bg bg-chalkboard [background-repeat:repeat,no-repeat] [background-size:200px_200px,auto]",style:{transform:"translateY(-50%)"},children:d.jsx(ot,{icon:_?d.jsx(Hr,{size:"small",surface:"chalkboard",label:"Agent running"}):j?d.jsx("span",{"aria-hidden":"true",className:"h-2 w-2 rounded-full bg-chalk-fail-text shadow-[0_0_6px_rgba(214,160,160,0.9)]"}):d.jsx("span",{className:"text-2xs",children:"S"}),surface:"chalkboard",size:"small",label:_?"Open stack panel — agent running":j?"Open stack panel — checks failing":"Open stack panel",onClick:t,className:`w-7 h-[64px] rounded-l-md ${_?"shadow-[inset_0_0_0_1px_rgba(214,196,160,0.6)]":j?"shadow-[inset_0_0_0_1px_rgba(214,160,160,0.6)]":""}`})}),d.jsxs("div",{className:"fixed inset-y-0 right-0 z-[300] flex w-[min(480px,100vw)] flex-col overflow-hidden border-l-4 border-paper-950/[12%] text-desk-text bg-desk-bg bg-chalkboard [background-repeat:repeat,no-repeat] [background-size:200px_200px,auto]",style:{transform:r?"translateX(0)":"translateX(100%)"},children:[d.jsxs("div",{className:"flex h-20 shrink-0 items-center justify-between px-6",children:[d.jsx("span",{className:"font-display-luminari text-base font-bold text-desk-chalk",children:"Stack"}),!n&&d.jsx(ot,{icon:d.jsx("span",{className:"text-sm leading-none",children:"×"}),surface:"chalkboard",size:"small",label:"Close stack panel",onClick:t,className:"h-7 w-7 border border-desk-border"})]}),d.jsx(ng,{surface:"chalkboard"}),d.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[d.jsx(LU,{}),d.jsx(gW,{})]})]})]})},xW=e=>e.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,t=>t.toUpperCase()),vW=()=>{const[e,t]=b.useState(null),[n,r]=b.useState(null),[s,i]=b.useState(!0);return b.useEffect(()=>{let o=!1;return i(!0),Promise.all([GA().then(a=>{!o&&a&&t(xW(a))}),HA().then(a=>{o||r(a)})]).finally(()=>{o||i(!1)}),()=>{o=!0}},[]),{projectName:e,iconDataUri:n,loading:s}},wW=["repo-docs","release-notes"],bW=["subjects","setup","merge-policy"];function WS(e){var t;return((t=e==null?void 0:e.match(/\d+$/))==null?void 0:t[0])??null}function HS(e,t){return e.find(n=>WS(n.id)===t)??e.find(n=>!n.id&&n.title===t)??null}function ga(e,t){return WS(e)??encodeURIComponent(t)}function ig(){const{planId:e}=Ds({strict:!1}),t=D(n=>n.plans);return typeof e!="string"||!t?null:HS(t.entries,decodeURIComponent(e))}function kW(){const{ideaId:e}=Ds({strict:!1}),t=D(n=>n.ideaEntries);return typeof e!="string"?null:HS(t,decodeURIComponent(e))}function _W(){const{section:e}=Ds({strict:!1});return wW.includes(e)?e:null}function h7(){const{section:e}=Ds({strict:!1});return bW.includes(e)?e:null}function p7(){const e=_W(),t=D(r=>r.activeDocTitle),n=D(r=>r.repoDocs);return e??(t&&n.some(r=>r.name===t)?"repo-docs":null)}const SW=250;function GS(e,t,n={}){const{debounceMs:r=SW,...s}=n,[i,o]=b.useState(e);b.useEffect(()=>{const c=setTimeout(()=>o(e),r);return()=>clearTimeout(c)},[e,r]);const{threshold:a,limit:l}=s;return b.useMemo(()=>cL(i,t,{threshold:a,limit:l}),[i,t,a,l])}const KS=()=>{const[e,t]=b.useState([]),[n,r]=b.useState(!0),[s,i]=b.useState(!0);return b.useEffect(()=>{let o=!1;return ym().then(a=>{o||(t((a==null?void 0:a.subjects)??[]),i(a!==null),r(!1))}),()=>{o=!0}},[]),{subjects:e,loading:n,available:s}},CW=({size:e="md"})=>{const{projectName:t,iconDataUri:n,loading:r}=vW();return d.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[n?d.jsx("img",{src:n,alt:"",className:`object-contain shrink-0 ${e==="sm"?"w-[18px] h-[18px]":"w-[20px] h-[20px]"}`}):d.jsx(U6,{icon:d.jsx($B,{}),size:"small"}),d.jsx("span",{className:`font-display-luminari font-semibold whitespace-nowrap overflow-hidden text-ellipsis min-w-0 ${e==="sm"?"text-sm":"text-md"}`,children:r?"Loading…":t??"Paper Camp"})]})},jW=()=>{const[e,t]=b.useState(null);return b.useEffect(()=>{},[]),e?d.jsxs("div",{role:"alert",className:"bg-watercolor-rose-dark text-desk-text py-2 px-4 text-2xs font-mono shrink-0",children:["Server failed to reload — restart `pnpm dev` to pick up the change. ",e]}):null},PW=({routeKey:e,children:t,mobileOpen:n,onMobileClose:r})=>{const s=b.useRef(null);return b.useEffect(()=>{if(!n)return;const i=o=>{o.key==="Escape"&&r()};return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[n,r]),b.useEffect(()=>{var o;if(!n)return;const i=document.activeElement;return(o=s.current)==null||o.focus(),()=>{var a;return(a=i==null?void 0:i.focus)==null?void 0:a.call(i)}},[n]),d.jsxs(d.Fragment,{children:[n&&d.jsx("button",{type:"button",className:"lg:hidden fixed inset-0 z-[290] cursor-default border-none p-0 bg-ink-900/[40%] backdrop-blur-sm",onClick:r,"aria-label":"Close sidebar",tabIndex:-1}),d.jsx("aside",{ref:s,role:n?"dialog":void 0,"aria-modal":n||void 0,"aria-label":"Sidebar navigation",tabIndex:-1,className:`fixed inset-y-0 left-0 z-[300] w-[224px] shrink-0 flex flex-col overflow-hidden lg:sticky lg:inset-auto lg:top-0 lg:z-auto lg:translate-x-0 h-[var(--pc-sidebar-h,100%)] ${n?"translate-x-0":"-translate-x-full"} ${n?"bg-[var(--pui-bg-base)] shadow-[2px_0_12px_rgba(0,0,0,0.15)]":"bg-transparent"}`,children:d.jsx("div",{className:"flex-1 overflow-y-auto pt-5 relative",children:d.jsx("div",{children:t},e)})})]})};function lf(e){return e==="allowed"?"allowed":/reject|block|exceed|denied/i.test(e)?"rejected":"warning"}function EW(e){return e<1e12?e*1e3:e}function TW(e){const t=[`Claude usage: ${e.status}`];return e.rateLimitType&&t.push(e.rateLimitType),e.resetsAt!==void 0&&t.push(`resets ${new Date(EW(e.resetsAt)).toLocaleTimeString()}`),e.overage&&t.push("overage on"),t.join(" · ")}const NW={...Mi("kraft"),display:"flex",alignItems:"center",gap:"0.75rem",height:"2rem",paddingLeft:"1rem",paddingRight:"1rem",borderBottom:"1px solid rgba(0, 0, 0, 0.08)",fontSize:"0.75rem",flexShrink:0,boxSizing:"border-box",overflowX:"auto",overflowY:"hidden",whiteSpace:"nowrap"},RW={display:"flex",alignItems:"center",gap:"0.75rem",flexShrink:0},IW={display:"flex",alignItems:"center",gap:"0.25rem"},AW={opacity:.5},MW={color:"var(--pui-text-primary)"},E0={opacity:.6},LW={flex:1},T0={display:"flex",alignItems:"center",gap:"0.5rem",flexShrink:0},N0={background:"none",backgroundColor:"transparent",border:"none",padding:0,cursor:"pointer"},DW={position:"relative",display:"inline-flex"},FW={position:"absolute",top:"-0.25rem",right:"-0.25rem",pointerEvents:"none"},OW=({gitBranch:e,gitAhead:t,changedFileCount:n,agentActive:r,activeTaskStatus:s,agentNotSignedIn:i,capabilityGapCount:o,rateLimit:a,unreadNotificationCount:l,onOpenSetup:c,onOpenGit:u,onOpenNotifications:f,trailing:p})=>d.jsxs("div",{style:NW,children:[d.jsxs("div",{style:RW,children:[d.jsxs("span",{style:IW,children:[d.jsx("span",{style:AW,children:"⌥"}),d.jsx("code",{style:MW,children:e??"no branch"})]}),t>0&&d.jsxs("span",{style:E0,children:["↑",t]}),d.jsx("span",{style:E0,children:n>0?`${n} changed`:"clean"}),r&&d.jsx(Hr,{size:"small",label:`Agent ${s}…`}),i&&d.jsx(Te,{content:"Sign in from Settings → Connections so agent tasks can run",children:d.jsx("button",{type:"button",onClick:c,style:N0,children:d.jsx(Pe,{size:"small",variant:"warning",children:"Agent not signed in"})})}),o>0&&d.jsx(Te,{content:"Some features are disabled — open Setup to fix",children:d.jsx("button",{type:"button",onClick:c,style:N0,children:d.jsxs(Pe,{size:"small",variant:"warning",children:["Setup (",o,")"]})})}),a&&lf(a.status)!=="allowed"&&d.jsx(Te,{content:TW(a),children:d.jsx(Pe,{size:"small",variant:lf(a.status)==="rejected"?"error":"warning",children:lf(a.status)==="rejected"?"Claude limit reached":"Claude usage warning"})})]}),d.jsx("div",{style:LW}),p&&d.jsx("div",{style:T0,children:p}),d.jsxs("div",{style:T0,children:[d.jsx(Te,{content:"Git",children:d.jsx(ot,{variant:"ghost",size:"small",icon:d.jsx(lW,{}),label:"Git",onClick:u})}),d.jsx(Te,{content:"Notifications",children:d.jsxs("span",{style:DW,children:[d.jsx(ot,{variant:"ghost",size:"small",icon:d.jsx(aW,{}),label:"Notifications",onClick:f}),l>0&&d.jsx("span",{style:FW,children:d.jsx(Pe,{size:"small",variant:"warning",children:l})})]})})]})]}),zW=()=>{const e=D(y=>y.agentStatus),t=D(y=>y.gitStatus),n=D(y=>y.gitBranch),r=D(y=>y.gitAhead),s=D(NL),i=D(RL),o=D(IL),a=D(y=>{var v;return((v=y.notifications)==null?void 0:v.filter(g=>g.kind==="question"||!g.read).length)??0}),l=Vt(),c=e.find(y=>y.status==="running"||y.status==="starting"||y.status==="stopping"),u=c!==void 0,f=(t==null?void 0:t.length)??0,p=()=>l({to:"/settings/$section",params:{section:"setup"}}),h=()=>l({to:"/git"}),m=()=>l({to:"/inbox"});return d.jsx(OW,{gitBranch:n,gitAhead:r,changedFileCount:f,agentActive:u,activeTaskStatus:c==null?void 0:c.status,agentNotSignedIn:i,capabilityGapCount:s,rateLimit:o,unreadNotificationCount:a,onOpenSetup:p,onOpenGit:h,onOpenNotifications:m})},$W=({children:e})=>d.jsx("h1",{className:"text-4xl font-display-luminari font-semibold text-ink-900 mb-6 leading-[1.1]",children:e}),BW=3*6e4,VW=(e,t)=>{const n=D(o=>o.loadPlans),r=e.thread??[],s=r[r.length-1],i=e.id;b.useEffect(()=>{if(!i||!s||s.kind!=="chat")return;const o=setTimeout(()=>{iM(i).then(a=>{if(!a.skipped)return n()}).catch(()=>{})},BW);return()=>clearTimeout(o)},[t,i,s,n])},Gi=()=>{const e=D(i=>i.loadPlans),{toast:t}=He(),[n,r]=b.useState(!1);return{patch:async(i,o,a)=>{r(!0);try{return await FM(i,o),await e(),!0}catch(l){return t({title:(a==null?void 0:a.errorTitle)??"Update failed",description:l.message,variant:"error"}),!1}finally{r(!1)}},updating:n}},UW=e=>{const t=D(a=>a.loadPlans),{toast:n}=He(),[r,s]=b.useState(null);return{promotingIndex:r,promoteToDurable:async(a,l)=>{if(!(!e.id||r!==null)){s(a);try{await Fx(e.id,a,l),await t()}catch(c){n({title:"Promote failed",description:We(c.message),variant:"error"})}finally{s(null)}}},promoteToIdea:async(a,l)=>{if(!e.id||r!==null)return!1;s(a);try{const c=await wk(l);return await Fx(e.id,a,"log",`Captured as ${c}: ${l.title}`).catch(()=>{}),await t(),!0}catch(c){return n({title:"Promote failed",description:We(c.message),variant:"error"}),!1}finally{s(null)}}}},Jh=.95,WW=3e4,Zh={implement:{from:0,to:.6},verify:{from:.6,to:.9},checkbox:{from:.95,to:.95}};function HW(e){const t=[...e].sort((r,s)=>r-s),n=Math.floor(t.length/2);return t.length%2===0?(t[n-1]+t[n])/2:t[n]}function GW(e){const t=e.filter(s=>s.taskKind==="phase"&&s.outcome==="done").map(s=>Date.parse(s.endedAt)-Date.parse(s.startedAt)).filter(s=>Number.isFinite(s)&&s>0);if(t.length===0)return{};const n=HW(t),r={};for(const s of["implement","verify"]){const i=Zh[s].to-Zh[s].from;r[s]=n*i/Jh}return r}function KW({anchor:e,anchorEnteredAt:t,lastStreamAt:n,now:r,medians:s}){if(!e)return 0;const i=Zh[e],o=Math.min(i.from,Jh),a=s==null?void 0:s[e];if(!a||a<=0||t===void 0||i.to===i.from)return o;const l=n===void 0?r:Math.min(r,n+WW),c=Math.min(1,Math.max(0,l-t)/a);return Math.min(i.from+c*(i.to-i.from),Jh)}const qW=new Set(["starting","running","stopping"]),QW=1e3;function YW(e,t){const n=e!==void 0&&e.phaseIndex!==void 0&&qW.has(e.status),[r,s]=b.useState(()=>Date.now());return b.useEffect(()=>{if(!n)return;const i=setInterval(()=>s(Date.now()),QW);return()=>clearInterval(i)},[n]),!n||(e==null?void 0:e.phaseIndex)===void 0?null:{index:e.phaseIndex,fraction:KW({anchor:e.phaseAnchor,anchorEnteredAt:e.anchorEnteredAt,lastStreamAt:e.lastStreamAt,now:r,medians:GW(t)})}}const XW=(e,{reload:t,notify:n})=>{const[r,s]=b.useState(!1),[i,o]=b.useState(!1),[a,l]=b.useState(null);return b.useEffect(()=>{l(null)},[e.id]),{sending:r,send:async f=>{if(!e.id)return!1;s(!0),l(null);try{const p={route:window.location.pathname,focusedIdeaId:e.id,viewport:{width:window.innerWidth,height:window.innerHeight}},{error:h,undo:m}=await sM(e.id,f,p);return await t(),m&&l(m),h&&n({title:"Agent did not reply",description:We(h),variant:"error"}),!0}catch(p){return n({title:"Message failed to send",description:We(p.message),variant:"error"}),!1}finally{s(!1)}},undo:a,undoing:i,undoEdit:async()=>{if(!(!e.id||!a)){o(!0);try{const{error:f}=await oM(e.id,a.commitSha);if(f){n({title:"Undo failed",description:We(f),variant:"error"});return}l(null),await t()}catch(f){n({title:"Undo failed",description:We(f.message),variant:"error"})}finally{o(!1)}}}}},JW=async e=>{const t=await fetch(G(`/api/trail?id=${encodeURIComponent(e)}`));if(!t.ok)throw new Error("Failed to load the provenance trail");return t.json()},ZW=e=>{const[t,n]=b.useState(null);return b.useEffect(()=>{if(n(null),!e)return;let r=!1;return JW(e).then(s=>{r||n(s)}).catch(()=>{}),()=>{r=!0}},[e]),t};function qS(){const[e,t]=b.useState("idle"),[n,r]=b.useState(null),s=b.useRef(null),i=b.useCallback(async a=>{s.current&&clearTimeout(s.current),t("loading"),r(null);try{await a(),t("success"),s.current=setTimeout(()=>{t("idle")},2e3)}catch(l){t("error"),r(l.message),s.current=setTimeout(()=>{t("idle"),r(null)},4e3)}},[]),o=b.useCallback(()=>{s.current&&clearTimeout(s.current),t("idle"),r(null)},[]);return{state:e,errorMessage:n,run:i,reset:o,loading:e==="loading",success:e==="success"}}const og="Keep phases short: 3-7 phases, each a one-line imperative title. Add a description only when the phase isn't self-explanatory, and keep it to one sentence. Never restate the idea's body and never summarise the work you did.",QS="A title is a noun/verb phrase, at most 40 characters (roughly 3-6 words), no em-dash subtitles or trailing clauses — the symptom, mechanism, and detail belong in the body's first paragraph, not the title.";function e9(e){const t=e.phases.map((s,i)=>`${i+1}. [${s.done?"x":" "}] ${s.text}`).join(`
|
|
92
|
+
`),n=e.log&&e.log.length>0?e.log.map(s=>`- ${s.date}: ${s.text}`).join(`
|
|
93
|
+
`):"(none)",r=e.clarifications&&e.clarifications.length>0?e.clarifications.map(s=>`- ${s.date}: ${s.text}`).join(`
|
|
94
|
+
`):"(none)";return`You are auditing the plan "${e.title}" (${e.id??"no id"}) for missing phases. The plan is a single file at papercamp/ideas/${e.id??"<ID>"}.md — if it is not there, it is archived at papercamp/ideas/archive/${e.id??"<ID>"}.md. Edit only that file.
|
|
95
|
+
|
|
96
|
+
Plan body: ${e.body}
|
|
97
|
+
|
|
98
|
+
Current phases:
|
|
99
|
+
${t}
|
|
100
|
+
|
|
101
|
+
Log entries (issues, bugs, and review notes recorded so far):
|
|
102
|
+
${n}
|
|
103
|
+
|
|
104
|
+
Clarifications (answered scope/design questions):
|
|
105
|
+
${r}
|
|
106
|
+
|
|
107
|
+
${og}
|
|
108
|
+
|
|
109
|
+
Task:
|
|
110
|
+
1. Read the plan above, then inspect the relevant code in this repo.
|
|
111
|
+
2. Identify work that is clearly required to fulfil this plan but is covered by no existing phase. The Log entries are the best source — they often record bugs or gaps that were never turned into phases.
|
|
112
|
+
3. If you found missing work: append one \`- [ ] <short phase title>\` line per item at the end of the \`### Phases\` list. You may add detail below a checkbox line as continuation lines indented with 6 spaces. Then append exactly one line to the \`### Log\` section, formatted \`- YYYY-MM-DD: <what was found and appended>\`, creating that section after the Phases list if it does not exist.
|
|
113
|
+
4. If nothing is missing: make no edits at all — no Log line, no empty heading, no "nothing found" note. This audit re-runs regularly and must leave no trace when there is nothing to add.
|
|
114
|
+
|
|
115
|
+
Rules:
|
|
116
|
+
- Never modify, reorder, check, uncheck, or delete any existing line, even if it looks stale, wrong, or redundant.
|
|
117
|
+
- Never touch the YAML frontmatter.
|
|
118
|
+
- Append only: new unchecked phases at the end of the list, plus the single Log line.`}function t9(e){const t=e.phases.length>0,n=t?"plan":"idea",r=t?e.phases.map((s,i)=>`${i+1}. [${s.done?"x":" "}] ${s.text}`).join(`
|
|
119
|
+
`):"(none — this is a backlog idea with no phases yet)";return`You are reconciling the ${n} "${e.title}" (${e.id??"no id"}), stored as a single file at papercamp/ideas/${e.id??"<ID>"}.md — if it is not there, it is archived at papercamp/ideas/archive/${e.id??"<ID>"}.md. Edit only that file.
|
|
120
|
+
|
|
121
|
+
${t?"Plan":"Idea"} body: ${e.body}
|
|
122
|
+
|
|
123
|
+
Current phases:
|
|
124
|
+
${r}
|
|
125
|
+
|
|
126
|
+
Task: this ${n} has drifted from the codebase — some ${t?"phase descriptions and body prose":"body prose"} may reference file paths that moved, code symbols that were renamed or removed, or approaches that were superseded during implementation. Find and fix only that drift.
|
|
127
|
+
|
|
128
|
+
1. Read the ${n} above, then inspect the relevant code in this repo to find what has actually changed since the prose was written.
|
|
129
|
+
2. Reword only the sentences or phrases that are now stale: fix references and superseded approaches. Leave everything else byte-identical.
|
|
130
|
+
3. Do not summarize, restructure, or "improve" prose that is still accurate — an unnecessary rewrite is a failure of this task, not a bonus.
|
|
131
|
+
|
|
132
|
+
Hard guardrails, never violate these:
|
|
133
|
+
- Never touch the YAML frontmatter (id, title, kind, status, created, idea, tags, or any other field).
|
|
134
|
+
- Never un-check, check, delete, or reorder any phase line, checked or unchecked.
|
|
135
|
+
- Never add or remove phases.
|
|
136
|
+
- Never touch the Log or Clarifications sections.
|
|
137
|
+
- If nothing is stale, make no edits at all.`}function ag(e,t,n,r){return`You are ${t} the idea ${e.id??"no id"} ("${e.title}"), stored as a single file at papercamp/ideas/${e.id??"<ID>"}.md. Edit only that file, and within it only the \`### Log\` section.
|
|
138
|
+
|
|
139
|
+
${n}
|
|
140
|
+
|
|
141
|
+
${og}
|
|
142
|
+
|
|
143
|
+
Task:
|
|
144
|
+
1. Explore this codebase and find what is relevant to the idea: the files it would touch, existing helpers or patterns it should build on, and constraints visible in the code.
|
|
145
|
+
2. Write up what you found as a single dated entry — name specific files and symbols, describe a workable approach, and include the architectural context you found. Sharpen the idea's original intent, do not redirect it.
|
|
146
|
+
3. Append exactly one line to the \`### Log\` section, formatted \`- YYYY-MM-DD: <what you found>\`, creating that section at the end of the file if it does not exist. Use today's date, and keep the entry to that single physical line (no literal line breaks).
|
|
147
|
+
|
|
148
|
+
Keep unchanged:
|
|
149
|
+
${r}
|
|
150
|
+
|
|
151
|
+
Append only — never rewrite or delete the idea's existing body or prior Log lines.`}function n9(e){const t=e.log&&e.log.length>0?e.log.map(s=>`- ${s.date}: ${s.text}`).join(`
|
|
152
|
+
`):"(none)",n=`Current idea body, in full (do not modify this):
|
|
153
|
+
${e.body}
|
|
154
|
+
|
|
155
|
+
Prior Log entries:
|
|
156
|
+
${t}`,r=`- the YAML frontmatter (id, title)
|
|
157
|
+
- the \`## ${e.id??"IDEA-N"}: ${e.title}\` heading line and the original body prose beneath it`;return ag(e,"expanding",n,r)}const YS=`- the YAML frontmatter (id, title, status)
|
|
158
|
+
- the original body prose beneath the frontmatter`;function r9(e){const t=`This idea was just promoted from an AI-generated one-liner suggestion — its current body is only that one-liner, with no deeper context yet:
|
|
159
|
+
${e.body}`;return ag(e,"fleshing out",t,YS)}function m7(e,t){const n=`This idea was just promoted from a roadmap item under "${t}" in ROADMAP.md — its current body is only that item's one-line description plus a provenance note, with no deeper context yet:
|
|
160
|
+
${e.body}`;return ag(e,"fleshing out",n,YS)}function s9(e,t){const n=t.filter(s=>s.status!=="done"),r=n.length?n.map(s=>`${s.id??"no id"}: ${s.title} (${s.phases.length} phases)`).join(`
|
|
161
|
+
`):"(no other open plans exist yet)";return`You are drafting a plan for the idea ${e.id??"no id"} ("${e.title}"), stored as a single file at papercamp/ideas/${e.id??"<ID>"}.md. The idea and its plan are ONE file: you draft the plan by editing that existing file in place — never create a new file.
|
|
162
|
+
|
|
163
|
+
Idea body, in full:
|
|
164
|
+
${e.body}
|
|
165
|
+
|
|
166
|
+
## What drafting adds to the file (see papercamp/about.md)
|
|
167
|
+
|
|
168
|
+
The file already has YAML frontmatter (id, title, status, created, …) and the prose body above. Drafting means:
|
|
169
|
+
|
|
170
|
+
1. Add a \`type\` field to the frontmatter: the Conventional Commits type that best fits (\`feat | fix | chore | docs | refactor\` — most are \`feat\`).
|
|
171
|
+
2. Add 1-4 short subsystem \`tags\` to the frontmatter if it has none.
|
|
172
|
+
3. Append a \`### Phases\` checklist at the end of the file (after any \`### Log\` section move it below the phases — Phases, then Log):
|
|
173
|
+
|
|
174
|
+
\`\`\`
|
|
175
|
+
### Phases
|
|
176
|
+
- [ ] Short phase title
|
|
177
|
+
Optional description of the phase, indented with 6 spaces.
|
|
178
|
+
\`\`\`
|
|
179
|
+
|
|
180
|
+
${og}
|
|
181
|
+
|
|
182
|
+
Hard rules:
|
|
183
|
+
- Never change the \`id\`, \`title\`, \`status\`, or \`created\` fields — \`status\` stays exactly \`idea\`; a human promotes it after reviewing your draft. (${QS} Leave the existing title as-is even if it breaks this; never expand it into a symptom-sentence.)
|
|
184
|
+
- Never rewrite or delete the existing prose body or \`### Log\` entries — the idea's history stays intact.
|
|
185
|
+
- Phases: actionable steps a future agent or human could pick up one at a time, not one giant phase.
|
|
186
|
+
|
|
187
|
+
## Every other open (non-done) plan, for scope context
|
|
188
|
+
|
|
189
|
+
${r}
|
|
190
|
+
|
|
191
|
+
Use the open entities above only to avoid duplicating in-flight scope and to match phase granularity. Edit only papercamp/ideas/${e.id??"<ID>"}.md — never create, edit, move, or rename any other file.`}function i9(e,t){const n=e.length?e.map(s=>s.status==="done"||s.status==="dropped"?`- ${s.id??"no id"}: ${s.title} (status: ${s.status})`:`### ${s.id??"no id"}: ${s.title}
|
|
192
|
+
${s.body}`).join(`
|
|
193
|
+
|
|
194
|
+
`):"(no ideas yet)",r=t.length?t.map(s=>`- ${s.date}: ${s.title} — ${s.description}`).join(`
|
|
195
|
+
`):"(none yet)";return`You are scanning this repository for ideas worth suggesting, to append to papercamp/suggestions.md — a lightweight holding pen. Edit only that one file.
|
|
196
|
+
|
|
197
|
+
Existing ideas (do not repeat anything already covered here):
|
|
198
|
+
${n}
|
|
199
|
+
|
|
200
|
+
Existing suggestions already in the holding pen (do not repeat these either):
|
|
201
|
+
${r}
|
|
202
|
+
|
|
203
|
+
Task:
|
|
204
|
+
1. Explore this codebase for gaps, rough edges, or "you might want to do X" hunches that aren't already an idea or an existing suggestion above — things like missing error handling, an obvious follow-up to recent work, a TODO left in code, or a UX gap you notice while reading the app.
|
|
205
|
+
2. For each genuinely new one you find (0 to a handful — do not force a quota), append one line to papercamp/suggestions.md formatted exactly \`- YYYY-MM-DD: Title — one-line description\`, using today's date. ${QS} Keep the description to a single physical line (no literal line breaks).
|
|
206
|
+
3. If you find nothing worth suggesting, make no edits at all — no empty line, no placeholder.
|
|
207
|
+
|
|
208
|
+
Rules:
|
|
209
|
+
- Append only — never modify, reorder, or delete any existing line in suggestions.md.
|
|
210
|
+
- Never create papercamp/ideas/ files or touch ideas/index.md — a suggestion is not an idea until a human promotes it.
|
|
211
|
+
- Never touch any other file in the repo.`}const Iu=({idea:e,otherPlans:t})=>{const n=D(f=>f.launchPlanDraft),r=D(Xr),{state:s,errorMessage:i,run:o}=qS(),{toast:a}=He(),l=()=>{const f=e.id;f&&o(async()=>{try{await n(f,s9(e,t))}catch(p){throw a({title:"Draft failed",description:We(p.message),variant:"error"}),p}})},c=s==="loading"?"Drafting…":s==="success"?"Draft sent!":s==="error"?"Draft failed":"Draft plan",u=s==="error"?i??"Draft failed":e.id?r?void 0:"No agent CLI found — set up in Settings":"Idea needs an ID before an agent can run";return d.jsx(Te,{content:u,children:d.jsx(se,{variant:"ghost",size:"small",onClick:l,disabled:s==="loading"||!e.id||!r,className:s==="error"?"text-watercolor-rose-dark":"text-ink-500",children:c})})},o9=({children:e,collapsedLines:t=3,resetKey:n})=>{const r=b.useRef(null),[s,i]=b.useState(!1),[o,a]=b.useState(!1);return b.useLayoutEffect(()=>i(!1),[n]),b.useLayoutEffect(()=>{if(s)return;const l=r.current;if(!l)return;const c=()=>a(l.scrollHeight-l.clientHeight>1);c();const u=new ResizeObserver(c);return u.observe(l),()=>u.disconnect()},[s,n]),d.jsxs("div",{children:[d.jsx("div",{ref:r,className:s?void 0:`line-clamp-[${t}]`,children:e}),o&&d.jsx("button",{type:"button",onClick:()=>i(l=>!l),"aria-expanded":s,className:"self-start bg-none bg-transparent border-none py-1 px-0 [font:inherit] text-xs opacity-60 cursor-pointer underline",children:s?"Show less":"Show more"})]})};function kl(e,t){const{toast:n}=He(),r=D(o=>o.activeGitAction),s=D(o=>o.setActiveGitAction),i=b.useCallback(async o=>{if(!D.getState().activeGitAction){s(e);try{await o()}catch(a){n({title:t,description:We(a.message),variant:"error"})}finally{s(null)}}},[n,t,e,s]);return[r===e,i]}function a9(){const e=D(k=>k.loadGitStatus),t=D(k=>k.loadPlans),n=D(k=>k.loadIdeas),r=D(k=>k.activeGitAction!==null),{toast:s,dismiss:i}=He(),o=()=>Promise.all([e(),t(),n()]),[a,l]=kl("push","Push failed"),[c,u]=kl("sync","Sync failed"),[f,p]=kl("pull","Pull failed"),[h,m]=kl("fix-divergence","Fix failed"),y=b.useCallback((k,j)=>{if(j.recovering)return s({title:`${k} needs help`,description:"Handed off to a recovery agent — see Stack for progress",variant:"warning"}),!0;if("conflictPrompt"in j){const{conflictPrompt:_,message:S}=j,P=s({title:`${k} hit a conflict`,description:d.jsxs("div",{className:"flex flex-col items-start gap-2",children:[d.jsx("span",{children:We(S)}),d.jsx(se,{size:"small",onClick:async()=>{const T=await vM(_).catch(E=>({ok:!1,error:We(E.message)}));T.ok&&i(P),s({title:T.ok?"Resolving conflict":"Could not start the agent",description:T.ok?"Handed off to the agent — see Stack for progress":T.error??"The agent did not start.",variant:T.ok?"warning":"error"})},children:"Ask the agent to resolve"})]}),variant:"error",duration:0});return!0}return!1},[s,i]);return{pushing:a,syncing:c,pulling:f,fixingDivergence:h,gitActionBusy:r,handlePush:()=>l(async()=>{await mM(),await e()}),handleSync:()=>u(async()=>{const k=await gM();if(!k.ok){if(y("Sync",k)){await e();return}throw new Error(k.message)}await o()}),handlePull:()=>p(async()=>{await yM(),await o()}),handleFixDivergence:()=>m(async()=>{const k=await xM();if(!k.ok){if(y("Fix",k)){await e();return}throw new Error(k.message)}await o()})}}const l9=["core","cli","app","server","agent","plans","ideas","docs","settings","stack","ui","ci","config","deps","repo"];function c9(e){var r;if(!e||e.phases.length>0&&e.phases.every(s=>s.done))return{title:""};const t=((r=e.tags)==null?void 0:r.find(s=>l9.includes(s)))??"repo";return{title:`${e.kind??"feat"}(${t}): ${e.title}`}}const u9={pass:"success",fail:"error",running:"warning",stale:"neutral"},cf=({label:e,status:t,title:n,anyRunning:r,onClick:s})=>d.jsx(Te,{content:n,children:d.jsx("button",{type:"button",className:`inline-flex bg-none bg-transparent border-none p-0 enabled:hover:-translate-y-px enabled:hover:brightness-[1.15] enabled:active:translate-y-0 enabled:active:brightness-[0.95] ${r?"cursor-not-allowed":"cursor-pointer"} ${r&&t!=="running"?"opacity-50":"opacity-100"}`,onClick:()=>{r||s()},disabled:r,children:d.jsxs(Pe,{size:"small",variant:u9[t],children:[e,d.jsx("span",{className:t==="running"?"visible":"invisible",children:"…"})]})})}),d9=()=>{const e=D(h=>h.status),t=D(h=>h.runCheck),n=D(h=>h.consistency),r=D(h=>h.plans),s=Vt(),[i,o]=b.useState(!1),{qualityStatus:a,testStatus:l,consistencyStatus:c}=b.useMemo(()=>km(e),[e]),u=a==="running"||l==="running"||c==="running",f=n.length>0,p=b.useCallback(h=>h.planId?r==null?void 0:r.entries.find(m=>m.id===h.planId):void 0,[r==null?void 0:r.entries]);return d.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[d.jsx(cf,{label:"Quality",status:a,title:"Code style & formatting (Biome lint + format). Click to run.",anyRunning:u,onClick:()=>{t("lint"),t("format")}}),d.jsx(cf,{label:"Tests",status:l,title:"Unit tests (Vitest). Click to run.",anyRunning:u,onClick:()=>t("test")}),d.jsx(cf,{label:"Consistency",status:c,title:"Dead code & architecture (Knip + dependency-cruiser). Click to run.",anyRunning:u,onClick:()=>t("consistency")}),d.jsxs("div",{children:[d.jsx(Te,{content:f?"Plan/idea doc findings — orphan subjects, title style & stale references. Click to show.":"Plan/idea docs — no findings (orphan subjects, title style, stale references).",children:d.jsx("button",{type:"button",className:`inline-flex bg-none bg-transparent border-none p-0 ${f?"enabled:hover:-translate-y-px enabled:hover:brightness-[1.15] enabled:active:translate-y-0 enabled:active:brightness-[0.95] cursor-pointer":"cursor-default"}`,disabled:!f,"aria-expanded":f?i:void 0,"aria-controls":"deliver-doc-findings",onClick:()=>{f&&o(h=>!h)},children:d.jsx(Pe,{size:"small",variant:f?"error":"success",children:"Docs"})})}),i&&f&&d.jsx("div",{id:"deliver-doc-findings",className:"mt-2 flex flex-col gap-2",children:n.map((h,m)=>{const y=p(h);return d.jsx("div",{className:"font-mono text-2xs opacity-70",children:y?d.jsx("button",{type:"button",onClick:()=>s({to:"/plans/$planId",params:{planId:ga(y.id,y.title)}}),className:"bg-none bg-transparent border-none p-0 underline cursor-pointer [font:inherit] text-left",children:h.message}):d.jsx("span",{className:"text-left",children:h.message})},`${h.kind}-${h.title}-${m}`)})})]})]})},f9=({count:e})=>{const t=Vt();return d.jsxs("button",{type:"button",onClick:()=>t({to:"/git"}),className:"bg-none bg-transparent border-none p-0 font-handwritten text-xs opacity-[0.6] underline cursor-pointer",children:[e," file",e===1?"":"s"," changed"]})},h9=(e,t)=>{const n=D(M=>M.agentStatus),r=D(M=>M.loadGitStatus),s=D(M=>M.commitInFlight),i=D(M=>M.setCommitInFlight),o=D(M=>M.status),a=D(vu),l=D(M=>M.launchRunAll),{patch:c}=Gi(),{toast:u}=He(),[f,p]=b.useState(""),[h,m]=b.useState(""),[y,v]=b.useState(!1),[g,x]=b.useState(!1),[w,k]=b.useState(null),[j,_]=b.useState(!1),{title:S}=b.useMemo(()=>c9(e),[e]);b.useEffect(()=>{S&&!f&&p(S)},[S,f]);const P=b.useRef(null),T=b.useRef(null);b.useEffect(()=>{if(!e)return;if(P.current===null){if(n.length===0)return;P.current=new Set(n.filter(N=>N.suggestedCommit).map(N=>N.id))}const M=n.find(N=>{var z;return N.planId===e.id&&N.suggestedCommit&&!((z=P.current)!=null&&z.has(N.id))});!(M!=null&&M.suggestedCommit)||T.current===M.id||(T.current=M.id,p(M.suggestedCommit.title),m(M.suggestedCommit.message))},[n,e]);const E=b.useCallback(async()=>{if(!(!f.trim()||s)){v(!0),i(!0);try{await gk(t,f.trim(),h.trim()||void 0),p(""),m(""),await r()}catch(M){u({title:"Commit failed",description:We(M.message),variant:"error"}),await r()}finally{v(!1),i(!1)}}},[f,h,t,r,s,i,u]),I=b.useCallback(async()=>{if(t.length!==0){x(!0),k(null);try{const M=await yk(t);p(M.title),m(M.message)}catch(M){k(M.message)}finally{x(!1)}}},[t]),A=!!(e!=null&&e.id)&&!a,O=b.useCallback(async()=>{if(!(!(e!=null&&e.id)||!o||j||a)){_(!0);try{const M=yL(e.fixes??[],o);await c(e.title,{fixes:M})&&await l(e.id)}finally{_(!1)}}},[e,j,a,o,c,l]);return{commitTitle:f,setCommitTitle:p,committing:y,commitInFlight:s,suggesting:g,suggestError:w,setSuggestError:k,handleCommit:E,handleSuggestFromChanges:I,canFix:A,fixing:j,handleFix:O}},p9=({state:e,filesEmpty:t})=>d.jsxs("div",{className:"flex flex-col gap-2",children:[e.suggestError&&d.jsx(MS,{dismissible:!0,onDismiss:()=>e.setSuggestError(null),children:e.suggestError}),d.jsxs("div",{className:"flex gap-2 items-center",children:[d.jsx("div",{className:"flex-1",children:d.jsx(Ta,{size:"small",placeholder:"Commit title",value:e.commitTitle,onChange:n=>e.setCommitTitle(n.currentTarget.value)})}),d.jsx(ot,{icon:d.jsx($S,{size:16}),size:"small",label:"Suggest title and message from the diff",disabled:t||e.suggesting,onClick:e.handleSuggestFromChanges,wobble:e.suggesting?1:0})]})]}),m9=({state:e,filesEmpty:t})=>{const n=D(a=>a.status),{qualityStatus:r,testStatus:s,consistencyStatus:i}=b.useMemo(()=>km(n),[n]);return r==="fail"||s==="fail"||i==="fail"?d.jsx(se,{size:"small",disabled:!e.canFix||e.fixing,onClick:e.handleFix,children:e.fixing?"Fixing…":"Fix"}):d.jsx(se,{size:"small",disabled:t||!e.commitTitle.trim()||e.committing||e.commitInFlight,onClick:e.handleCommit,children:e.committing||e.commitInFlight?"Committing…":"Commit"})},g9=()=>{const e=D(c=>c.gitAhead),t=D(c=>c.gitBranchHygiene),{pushing:n,syncing:r,pulling:s,gitActionBusy:i,handlePush:o,handleSync:a,handlePull:l}=a9();return e>0?d.jsxs("div",{className:"flex flex-col items-start gap-3",children:[d.jsxs("p",{className:"m-0 text-xs opacity-50",children:["All changes committed — ",e," commit",e===1?"":"s"," ready to push."]}),d.jsx(se,{size:"small",icon:d.jsx(tW,{size:14}),disabled:i,onClick:o,children:n?"Pushing…":`Push ${e} commit${e===1?"":"s"}`})]}):d.jsxs("div",{className:"flex flex-col items-start gap-3",children:[d.jsx("p",{className:"m-0 text-xs opacity-50",children:"No changed files."}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Te,{content:t==="clean-on-main"?"Already on clean main":void 0,children:d.jsx(se,{size:"small",icon:d.jsx(BS,{size:14}),disabled:i||t==="clean-on-main",onClick:a,children:r?"Syncing…":"Sync to main"})}),d.jsx(se,{size:"small",icon:d.jsx(nW,{size:14}),disabled:i,onClick:l,children:s?"Pulling…":"Pull"})]})]})},y9={review:"review",note:"note",decision:"decision",question:"question",clarification:"clarification"},x9=({messages:e,undo:t,undoing:n,onUndo:r,onPromote:s,promotingIndex:i})=>d.jsx(d.Fragment,{children:e.map((o,a)=>{const l=y9[o.kind],c=o.from==="agent",u=a===e.length-1,f=[{id:"decision",label:"Promote to decision",icon:d.jsx(NS,{size:16}),onSelect:()=>s==null?void 0:s(a,"decision")},{id:"log",label:"Promote to log",icon:d.jsx(US,{size:16}),onSelect:()=>s==null?void 0:s(a,"log")},{id:"idea",label:"Promote to idea",icon:d.jsx(TS,{size:16}),onSelect:()=>s==null?void 0:s(a,"idea")}];return d.jsxs("div",{className:`flex flex-col gap-1 ${c?"items-start":"items-end"}`,children:[d.jsx("div",{className:"max-w-[85%]",children:d.jsx(de,{size:"small",surface:"paper",texture:c?"kraft":l?"canvas":"parchment",shade:c,accent:!c,accentColor:l?"rose":"blue",children:d.jsx(o9,{collapsedLines:o.kind==="chat"?1:3,resetKey:`${o.kind}-${o.date??""}-${a}`,children:o.text})})}),d.jsxs("div",{className:"flex items-center gap-2",children:[c&&d.jsx(Pe,{size:"small",fillColor:"rgba(0,0,0,0.06)",children:"agent"}),c&&u&&t&&d.jsx(Te,{content:"Revert this run's plan edit",children:d.jsx(se,{size:"small",variant:"ghost",onClick:r,disabled:n,children:n?"Undoing…":"Undo"})}),o.date&&d.jsx("span",{className:"text-sm font-semibold opacity-[0.45]",children:o.date}),l&&d.jsx(Pe,{size:"small",fillColor:"rgba(0,0,0,0.06)",children:l}),s&&o.kind==="chat"&&(i===a?d.jsx(Hr,{size:"small",label:"Promoting…"}):d.jsx(FS,{align:"end",trigger:d.jsx(ot,{icon:d.jsx(VS,{size:14}),label:"Promote this message",size:"small",variant:"ghost"}),items:f}))]})]},`${o.kind}-${o.date??""}-${a}`)})}),Zr=({id:e})=>e?d.jsx(Pe,{size:"small",fillColor:"rgba(0,0,0,0.08)",children:e}):null,XS={"in-progress":"#C89A5A",planned:"#6A9B72",idea:"#8A9BAA",review:"#9B7AB5",done:"#8A7A8A",dropped:"#A06060"},lg={idea:"Idea",planned:"Planned","in-progress":"In progress",review:"Review",done:"Done",dropped:"Dropped"},rr={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"}},JS={open:"Open",done:"Done",dropped:"Dropped"},Kc={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"}},v9={draft:"Draft",open:"Open",closed:"Closed",merged:"Merged"},R0={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"}},w9={approved:"Approved","changes-requested":"Changes requested","review-required":"Review required"},I0={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"}},b9=({pr:e})=>d.jsx("a",{href:e.url,target:"_blank",rel:"noreferrer",onClick:t=>t.stopPropagation(),className:"no-underline inline-flex",children:d.jsx(Pe,{size:"small",fillColor:R0[e.state].fill,textColor:R0[e.state].text,children:d.jsxs("span",{className:"inline-flex items-center gap-1",children:[d.jsx(cW,{}),"#",e.number," ",v9[e.state]]})})}),ZS=({pct:e,color:t,height:n=6})=>d.jsx(f6,{value:e,color:t,height:n}),A0={fill:"rgba(143, 185, 150, 0.25)",text:"#5E8A66"},M0={fill:"rgba(0, 0, 0, 0.05)",text:"rgba(0, 0, 0, 0.35)"},_l=({reached:e,label:t,tooltip:n,href:r})=>{const s=d.jsx(Pe,{size:"small",fillColor:e?A0.fill:M0.fill,textColor:e?A0.text:M0.text,children:t}),i=r?d.jsx("a",{href:r,target:"_blank",rel:"noreferrer",onClick:o=>o.stopPropagation(),className:"no-underline inline-flex",children:s}):s;return n?d.jsx(Te,{content:n,children:i}):i},uf=()=>d.jsx("span",{className:"opacity-30","aria-hidden":"true",children:"→"}),L0=(e,t)=>`${e} ${t}${e===1?"":"s"}`;function k9(e){const t=e.match(/\(\[([0-9a-f]+)\]\((\S+)\)\)\s*$/);return t?{hash:t[1],url:t[2]}:void 0}const _9=({trail:e,released:t})=>{var l,c;const{taskRuns:n,commits:r,pr:s,releaseLine:i}=e,o=i.data?k9(i.data):void 0,a=t?`Released ${t}`:o?`Released ${o.hash}`:"Release";return d.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[d.jsx(_l,{reached:n.reached,label:n.data?L0(n.data.length,"task run"):"Tasks",tooltip:(l=n.data)==null?void 0:l.map(u=>u.taskKind).join(", ")}),d.jsx(uf,{}),d.jsx(_l,{reached:r.reached,label:r.data?L0(r.data.length,"commit"):"Commits",tooltip:(c=r.data)==null?void 0:c.join(`
|
|
212
|
+
`)}),d.jsx(uf,{}),s.data?d.jsx(b9,{pr:s.data}):d.jsx(_l,{reached:!1,label:"PR"}),d.jsx(uf,{}),d.jsx(_l,{reached:i.reached||!!t,label:a,tooltip:i.data,href:o==null?void 0:o.url})]})},S9=({pr:e})=>{const{reviewDecision:t,unresolvedThreadCount:n,hasNewCommentsSincePush:r}=e;return!t&&!n?null:d.jsxs("span",{className:"inline-flex items-center gap-2",children:[t&&d.jsx(Pe,{size:"small",fillColor:I0[t].fill,textColor:I0[t].text,children:w9[t]}),!!n&&d.jsxs(Pe,{size:"small",fillColor:rr["in-progress"].fill,textColor:rr["in-progress"].text,children:[n," unaddressed comment",n===1?"":"s",r?" · new":""]})]})},eC=({open:e,onClose:t,onAdd:n,initialContent:r})=>{const[s,i]=b.useState(""),[o,a]=b.useState(""),[l,c]=b.useState(!1),[u,f]=b.useState(!1),[p,h]=b.useState(null),[m,y]=b.useState(null),[v,g]=b.useState(!1),[x,w]=b.useState(null),[k,j]=b.useState(null),_=D(N=>{var z;return((z=N.plans)==null?void 0:z.entries)??[]}),{patch:S}=Gi(),P=Vt(),T=GS(s,_.map(N=>({id:N.id,title:N.title,body:N.body,tags:N.tags,log:N.log})));b.useEffect(()=>{e&&(i(""),a(r??""),c(!1),f(!1),h(null),g(!1),w(null),j(null))},[e,r]);const E=(N,z)=>{t(),P({to:"/plans/$planId",params:{planId:ga(N,z)}})},I=async()=>{const N=`${s.trim()}${o.trim()?`
|
|
213
|
+
|
|
214
|
+
${o.trim()}`:""}`;if(N){g(!0),j(null),w(null);try{const z=_.map(V=>({id:V.id,title:V.title,body:V.body,tags:V.tags}));w(await bk(N,z))}catch(z){j(z.message)}finally{g(!1)}}},A=N=>{const z=_.find(V=>V.id===N);z&&E(z.id,z.title)},O=async(N,z,V)=>{y(N);const B={date:new Date().toISOString().slice(0,10),text:s.trim()},C=await S(z,{log:[...V??[],B]},{errorTitle:"Extend failed"});y(null),C&&t()},M=async N=>{if(N.preventDefault(),!(!s.trim()||u)){h(null),f(!0);try{await n({title:s.trim(),content:o.trim()||void 0,kind:l?"note":void 0}),t()}catch(z){h(z.message)}finally{f(!1)}}};return d.jsx(Na,{open:e,onClose:t,title:"New idea",size:"small",children:d.jsxs("form",{onSubmit:M,className:"flex flex-col gap-4",children:[d.jsx(Ta,{label:"Title",value:s,onChange:N=>i(N.target.value),placeholder:"Idea title…",helperText:"Noun/verb phrase, ≤40 chars — no subtitle; the detail goes in the description below.",disabled:u,autoFocus:!0,required:!0}),T.length>0&&d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsx("span",{className:"text-sm opacity-60 font-semibold",children:"Similar ideas"}),T.map(({candidate:N})=>{const z={id:N.id??null,title:N.title,body:N.body,log:N.log},V=_.filter(L=>L.id!==N.id);return d.jsx(de,{size:"small",texture:"canvas",children:d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[d.jsx(Zr,{id:N.id}),d.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:N.title})]}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(se,{type:"button",variant:"ghost",size:"small",onClick:()=>E(N.id,N.title),children:"Open it"}),d.jsx(se,{type:"button",variant:"ghost",size:"small",disabled:!N.id||!s.trim()||m!==null,onClick:()=>N.id&&O(N.id,N.title,N.log),children:m===N.id?"Extending…":"Extend it instead"}),d.jsx(Iu,{idea:z,otherPlans:V})]})]})},N.id??N.title)})]}),d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsx("div",{children:d.jsx(se,{type:"button",variant:"ghost",size:"small",disabled:!s.trim()||v,onClick:I,children:v?"Checking overlap…":"Check overlap"})}),k&&d.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:k}),x&&d.jsx(de,{size:"small",texture:"canvas",children:d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsx("span",{className:"font-semibold",children:x.verdict==="new"?"Looks genuinely new":x.verdict==="extend"?`Extends ${x.targetId??"an existing idea"}`:`Belongs inside ${x.targetId??"an existing idea"}`}),d.jsx("span",{className:"text-sm opacity-80",children:x.reasoning}),x.targetId&&d.jsx("div",{className:"flex justify-end",children:d.jsx(se,{type:"button",variant:"ghost",size:"small",onClick:()=>A(x.targetId),children:"Open it"})})]})})]}),d.jsx(Ru,{label:"Description",value:o,onChange:N=>a(N.target.value),placeholder:"Optional details…",disabled:u,rows:4}),d.jsx(u8,{label:"Just a note (no plan needed)",checked:l,onChange:N=>c(N.target.checked),disabled:u}),p&&d.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:p}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(se,{type:"button",variant:"ghost",onClick:t,disabled:u,children:"Cancel"}),d.jsx(se,{type:"submit",variant:"primary",disabled:!s.trim()||u,children:"Add"})]})]})})},C9=({suggestion:e,onClose:t})=>{const n=D(u=>u.promoteSuggestion),r=D(u=>u.launchIdeaExtend),[s,i]=b.useState(!1),[o,a]=b.useState(null),{toast:l}=He();b.useEffect(()=>{e&&(i(!1),a(null))},[e]);const c=async()=>{if(e){i(!0),a(null);try{const u=await n(e),f=D.getState().ideaEntries.find(p=>p.id===u);if(f)try{await r(u,r9(f))}catch(p){l({title:"Idea created, but the refine agent failed to launch",description:We(p.message),variant:"error"})}t()}catch(u){a(u.message)}finally{i(!1)}}};return d.jsx(Na,{open:e!==null,onClose:t,title:(e==null?void 0:e.title)??"",size:"small",children:d.jsxs("div",{className:"flex flex-col gap-4",children:[d.jsx("p",{className:"m-0 opacity-80",children:e==null?void 0:e.description}),o&&d.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:o}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(se,{type:"button",variant:"ghost",onClick:t,disabled:s,children:"Cancel"}),d.jsx(se,{type:"button",variant:"primary",onClick:c,disabled:s,children:s?"Moving…":"Move to ideas"})]})]})})},df=({tokens:e})=>d.jsx(d.Fragment,{children:e.map((t,n)=>{if(t.type==="same")return d.jsx("span",{children:t.text},`${t.type}-${n}`);const r=t.type==="added";return d.jsx("span",{className:r?"bg-watercolor-green/[30%] text-watercolor-green-dark no-underline":"bg-watercolor-rose/[30%] text-watercolor-rose-dark line-through",children:t.text},`${t.type}-${n}`)})}),D0=e=>d.jsx("h4",{className:"font-display-luminari text-xs font-semibold mb-2 opacity-[0.65]",children:e}),j9=({plan:e,before:t,onApprove:n,onDiscard:r,queuePosition:s})=>{const[i,o]=b.useState(!1),[a,l]=b.useState(!1),c=e.body!==t.body,u=e.phases.map((m,y)=>({phase:m,before:t.phases[y],index:y})).filter(({phase:m,before:y})=>y!==void 0&&(m.text!==y.text||(m.description??"")!==(y.description??""))),f=i||a,p=async()=>{if(!f){o(!0);try{await r()}finally{o(!1)}}},h=async()=>{l(!0);try{await n()}finally{l(!1)}};return d.jsx(Na,{open:!0,title:s?`Review reconcile changes (${s.index} of ${s.total})`:"Review reconcile changes",size:"large",onClose:f?()=>{}:p,children:d.jsxs("div",{className:"flex flex-col gap-5",children:[d.jsxs("p",{className:"text-sm m-0 opacity-70",children:['The reconcile agent proposed the rewrite below for "',e.title,'". Approve to keep it, or discard to revert to the prior wording.']}),!c&&u.length===0&&d.jsx("p",{className:"text-sm m-0 opacity-60",children:"No wording changed."}),c&&d.jsxs("div",{children:[D0("Body"),d.jsx("p",{className:"text-base m-0 leading-normal",children:d.jsx(df,{tokens:Td(t.body,e.body)})})]}),u.length>0&&d.jsxs("div",{children:[D0("Phases"),d.jsx("div",{className:"flex flex-col gap-3",children:u.map(({phase:m,before:y,index:v})=>d.jsxs("div",{className:"text-sm leading-normal",children:[d.jsx(df,{tokens:Td(y.text,m.text)}),(m.description||y.description)&&d.jsx("div",{className:"opacity-[0.85] mt-1",children:d.jsx(df,{tokens:Td(y.description??"",m.description??"")})})]},v))})]}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(se,{variant:"danger",size:"small",onClick:p,disabled:f,children:"Discard"}),d.jsx(se,{variant:"primary",size:"small",onClick:h,disabled:f,children:"Approve"})]})]})})},P9=({onOpenIdea:e})=>{const t=D(f=>f.archivableIdeas),n=D(f=>f.archiveIdeas),[r,s]=b.useState(null),[i,o]=b.useState(!1),{toast:a}=He(),l=b.useCallback(async f=>{try{await n(f)}catch(p){a({title:"Archive failed",description:p.message,variant:"error"})}},[n,a]),c=b.useCallback(async f=>{s(f.id);try{await l([f.id])}finally{s(null)}},[l]),u=b.useCallback(async()=>{o(!0);try{await l(t.map(f=>f.id))}finally{o(!1)}},[l,t]);return t.length===0?null:d.jsxs("div",{className:"mt-5",children:[d.jsxs("div",{className:"flex items-center justify-between gap-2 mb-2",children:[d.jsxs("h2",{className:"text-sm m-0 opacity-60",children:["Ready to archive (",t.length,")"]}),d.jsx(se,{variant:"ghost",size:"small",disabled:i||r!==null,onClick:u,children:i?"Archiving…":"Archive all"})]}),d.jsx("div",{className:"flex flex-col gap-1",children:t.map(f=>d.jsx("div",{className:"rounded-[10px]",children:d.jsx(de,{size:"small",texture:"canvas",className:"plan-row-card",children:d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs("div",{role:e?"button":void 0,tabIndex:e?0:void 0,onClick:e?()=>e(f.title):void 0,onKeyDown:e?p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),e(f.title))}:void 0,className:`flex items-center gap-2 flex-1 min-w-0 ${e?"cursor-pointer":""}`,children:[d.jsx(Zr,{id:f.id}),d.jsx("span",{className:"font-semibold overflow-hidden text-ellipsis whitespace-nowrap",children:f.title})]}),d.jsx(se,{variant:"ghost",size:"small",disabled:r===f.id||i,onClick:()=>c(f),children:r===f.id?"Archiving…":"Archive"})]})})},f.id))})]})},E9="font-display-luminari font-semibold text-[1.75rem] leading-[1.2]";function F0(e,t){return e.toFixed(t).replace(/\.0+$/,"").replace(/(\.\d*?)0+$/,"$1")}function tC(e){const t=Math.round(e/1e3),n=Math.floor(t/3600),r=Math.floor(t%3600/60),s=t%60;return n>0?r>0?`${n}h${r}m`:`${n}h`:r>0?s>0?`${r}m${s}s`:`${r}m`:`${s}s`}function jo(e){return e>=1e6?`${F0(e/1e6,1)}M`:e>=1e3?`${F0(e/1e3,1)}k`:`${Math.round(e)}`}function T9(e,t){var s;const n={runs:0,durationMs:0,inputTokens:0,outputTokens:0,cacheCreationTokens:0,cacheReadTokens:0},r=i=>{n.runs+=1,n.durationMs+=i.durationMs,n.inputTokens+=i.inputTokens,n.outputTokens+=i.outputTokens,n.cacheCreationTokens+=i.cacheCreationTokens,n.cacheReadTokens+=i.cacheReadTokens};for(const i of e)if(!(t&&i.planId!==t))if((s=i.phaseRuns)!=null&&s.length)for(const o of i.phaseRuns)r(o.usage);else i.usage&&r(i.usage);return n}const N9=({onAdd:e,disabled:t})=>{const[n,r]=b.useState(!1),[s,i]=b.useState(""),[o,a]=b.useState(null),[l,c]=b.useState(!1),u=()=>{r(!1),i(""),a(null)},f=async()=>{let p;try{p=fL(s)}catch(h){a(h instanceof Error?h.message:"Could not parse findings");return}c(!0),a(null);try{await e(p),u()}finally{c(!1)}};return d.jsxs(d.Fragment,{children:[d.jsx(Te,{content:"Add code-review findings as phases",children:d.jsx(ot,{variant:"ghost",size:"small",onClick:()=>r(!0),disabled:t,"aria-label":"Add code-review findings as phases",icon:d.jsx(BB,{size:16})})}),d.jsx(Na,{open:n,onClose:u,title:"Add code-review findings",size:"small",children:d.jsxs("div",{className:"flex flex-col gap-4",children:[d.jsxs("p",{className:"text-sm m-0 opacity-70",children:["Paste the JSON findings from a ",d.jsx("code",{children:"/code-review"})," run. Each finding becomes a new, unchecked phase on this plan."]}),d.jsx(Ru,{value:s,onChange:p=>i(p.target.value),placeholder:'[{ "description": "...", "file": "src/foo.ts", "line_start": 12, "failure_scenario": "..." }]',rows:10,disabled:l}),o&&d.jsxs(MS,{variant:"warning",children:["Could not add phases — ",o]}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(se,{type:"button",variant:"ghost",onClick:u,disabled:l,children:"Cancel"}),d.jsx(se,{type:"button",variant:"primary",onClick:f,disabled:l||!s.trim(),children:"Add phases"})]})]})})]})},R9=qM.map(e=>({value:e,label:e})),I9=({open:e,onClose:t,onAdd:n})=>{const[r,s]=b.useState(""),[i,o]=b.useState(""),[a,l]=b.useState("feat"),[c,u]=b.useState(!1),[f,p]=b.useState(null),[h,m]=b.useState(null),[y,v]=b.useState(!1),[g,x]=b.useState(null),[w,k]=b.useState(null),j=D(N=>{var z;return((z=N.plans)==null?void 0:z.entries)??[]}),{patch:_}=Gi(),S=Vt(),{toast:P}=He(),T=GS(r,j.map(N=>({id:N.id,title:N.title,body:N.body,tags:N.tags,log:N.log})));b.useEffect(()=>{e&&(s(""),o(""),l("feat"),u(!1),p(null),v(!1),x(null),k(null))},[e]),b.useEffect(()=>{x(null),k(null)},[r,i]);const E=(N,z)=>{t(),S({to:"/plans/$planId",params:{planId:ga(N,z)}})},I=async()=>{const N=`${r.trim()}${i.trim()?`
|
|
215
|
+
|
|
216
|
+
${i.trim()}`:""}`;if(N){v(!0),k(null),x(null);try{const z=j.map(V=>({id:V.id,title:V.title,body:V.body,tags:V.tags}));x(await bk(N,z))}catch(z){k(z.message)}finally{v(!1)}}},A=N=>{const z=j.find(V=>V.id===N);z?E(z.id,z.title):P({title:"Plan not found",description:`No plan with id ${N}`,variant:"error"})},O=async(N,z,V)=>{m(N);const B={date:new Date().toISOString().slice(0,10),text:r.trim()},C=await _(z,{log:[...V??[],B]},{errorTitle:"Extend failed"});m(null),C&&t()},M=async N=>{if(N.preventDefault(),!(!r.trim()||c)){p(null),u(!0);try{await n({title:r.trim(),content:i.trim()||void 0,kind:a}),t()}catch(z){p(z.message)}finally{u(!1)}}};return d.jsx(Na,{open:e,onClose:t,title:"Quick plan",size:"small",children:d.jsxs("form",{onSubmit:M,className:"flex flex-col gap-4",children:[d.jsx(Ta,{label:"Title",value:r,onChange:N=>s(N.target.value),placeholder:"Backlog item title…",helperText:"Noun/verb phrase, ≤40 chars — no subtitle; the detail goes in the description below.",disabled:c,autoFocus:!0,required:!0}),T.length>0&&d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsx("span",{className:"text-sm opacity-60 font-semibold",children:"Similar ideas"}),T.map(({candidate:N})=>{const z={id:N.id??null,title:N.title,body:N.body,log:N.log},V=j.filter(L=>L.id!==N.id);return d.jsx(de,{size:"small",texture:"canvas",children:d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[d.jsx(Zr,{id:N.id}),d.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:N.title})]}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(se,{type:"button",variant:"ghost",size:"small",onClick:()=>E(N.id,N.title),children:"Open it"}),d.jsx(se,{type:"button",variant:"ghost",size:"small",disabled:!N.id||!r.trim()||h!==null,onClick:()=>N.id&&O(N.id,N.title,N.log),children:h===N.id?"Extending…":"Extend it instead"}),d.jsx(Iu,{idea:z,otherPlans:V})]})]})},N.id??N.title)})]}),d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsx("div",{children:d.jsx(se,{type:"button",variant:"ghost",size:"small",disabled:!r.trim()||y,onClick:I,children:y?"Checking overlap…":"Check overlap"})}),w&&d.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:w}),g&&d.jsx(de,{size:"small",texture:"canvas",children:d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsx("span",{className:"font-semibold",children:g.verdict==="new"?"Looks genuinely new":g.verdict==="extend"?`Extends ${g.targetId??"an existing idea"}`:`Belongs inside ${g.targetId??"an existing idea"}`}),d.jsx("span",{className:"text-sm opacity-80",children:g.reasoning}),g.targetId&&d.jsx("div",{className:"flex justify-end",children:d.jsx(se,{type:"button",variant:"ghost",size:"small",onClick:()=>A(g.targetId),children:"Open it"})})]})})]}),d.jsx(IS,{label:"Kind",value:a,onChange:N=>l(N),options:R9,disabled:c}),d.jsx(Ru,{label:"Description",value:i,onChange:N=>o(N.target.value),placeholder:"Optional details…",disabled:c,rows:4}),f&&d.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:f}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(se,{type:"button",variant:"ghost",onClick:t,disabled:c,children:"Cancel"}),d.jsx(se,{type:"submit",variant:"primary",disabled:!r.trim()||c,children:"Add"})]})]})})},A9=()=>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"})]}),M9=()=>{const e=D(o=>o.loadPlans),t=D(o=>o.gitBranchHygiene),[n,r]=b.useState(!1),s=t==="stale-merged",i=async o=>{await DM(o),await e(),r(!1)};return d.jsxs(d.Fragment,{children:[d.jsx(Te,{content:s?"Switch to main first":void 0,children:d.jsx(ot,{icon:d.jsx(A9,{}),variant:"ghost",size:"small",label:s?"Switch to main first":"Quick plan",disabled:s,onClick:()=>r(!0)})}),d.jsx(I9,{open:n,onClose:()=>r(!1),onAdd:i})]})},L9=({planId:e,phaseIndex:t,disabled:n})=>{const r=D(u=>u.launchAgent),s=D(Xr),{toast:i}=He(),[o,a]=b.useState(!1),l=async u=>{if(u.stopPropagation(),!!e){a(!0);try{await r(e,t)}catch(f){i({title:"Failed to start agent",description:We(f.message),variant:"error"})}finally{a(!1)}}},c=e?s?"Start agent on this phase":"No agent CLI found — set up in Settings":"Plan needs an ID before an agent can run";return d.jsx(ot,{icon:d.jsx("span",{className:"text-xs leading-none",children:"▶"}),variant:"ghost",size:"small",label:c,onClick:l,disabled:n||o||!e||!s,className:"text-ink-500"})},D9=({plan:e,disabled:t})=>{const n=D(l=>l.launchPlanAudit),r=D(Xr),[s,i]=b.useState(!1),o=async()=>{if(e.id){i(!0);try{await n(e.id,e9(e))}catch(l){alert(l.message)}finally{i(!1)}}},a=e.id?r?void 0:"No agent CLI found — set up in Settings":"Plan needs an ID before an agent can run";return d.jsx(Te,{content:a,children:d.jsx(se,{variant:"ghost",size:"small",onClick:o,disabled:t||s||!e.id||!r,children:"Audit"})})},cg=({idea:e,compact:t})=>{const n=D(p=>p.launchIdeaExtend),r=D(Xr),{state:s,errorMessage:i,run:o}=qS(),{toast:a}=He(),l=e.id,c=()=>{l&&o(async()=>{const p=D.getState().ideaEntries.find(h=>h.id===l);if(!p)throw new Error(`Idea ${l} not found`);try{await n(l,n9(p))}catch(h){throw a({title:"Extension failed",description:We(h.message),variant:"error"}),h}})},u=s==="loading"?"Extending…":s==="success"?t?"Sent!":"Extension sent!":s==="error"?"Extension failed":t?"Extend":"Extend with AI",f=s==="error"?i??"Extension failed":l?r?void 0:"No agent CLI found — set up in Settings":"Idea needs an ID before an agent can run";return d.jsx(Te,{content:f,children:d.jsx(se,{variant:"ghost",size:"small",onClick:c,disabled:s==="loading"||!l||!r,className:s==="error"?"text-watercolor-rose-dark":void 0,children:u})})},F9=({plan:e,disabled:t})=>{const n=D(u=>u.launchFixReview),r=D(Xr),s=D(TL),[i,o]=b.useState(!1),a=async()=>{if(e.id){o(!0);try{await n(e.id)}catch(u){alert(u.message)}finally{o(!1)}}},l=t||i||!e.id||!r||!s,c=e.id?s?r?void 0:"No agent CLI found — set up in Settings":"GitHub CLI needs authentication — set up in Settings":"Plan needs an ID before an agent can run";return d.jsx(Te,{content:c,children:d.jsx(qn,{size:"small",icon:d.jsx("span",{className:"text-watercolor-amber-dark",children:"⚑"}),onClick:a,disabled:l,className:`text-xs leading-4 py-2 ${l?"opacity-50":""}`,children:i?"Starting…":"Fix review comments"})})},O9=()=>{const e=D(s=>s.loadIdeas),[t,n]=b.useState(!1),r=async s=>{await wk(s),await e(),n(!1)};return d.jsxs(d.Fragment,{children:[d.jsx(se,{icon:d.jsx(TS,{size:16}),size:"small",onClick:()=>n(!0),children:"New idea"}),d.jsx(eC,{open:t,onClose:()=>n(!1),onAdd:r})]})},z9=({plan:e,disabled:t})=>{const n=D(l=>l.launchPlanReconcile),r=D(Xr),[s,i]=b.useState(!1),o=async()=>{if(e.id){i(!0);try{await n(e.id,t9(e),{body:e.body,phases:e.phases})}catch(l){alert(l.message)}finally{i(!1)}}},a=e.id?r?void 0:"No agent CLI found — set up in Settings":"Plan needs an ID before an agent can run";return d.jsx(Te,{content:a,children:d.jsx(se,{variant:"ghost",size:"small",onClick:o,disabled:t||s||!e.id||!r,children:"Refresh"})})},$9=()=>{const e=D(s=>s.refreshAll),t=D(s=>s.refreshing),{toast:n}=He(),r=async()=>{if(t)return;const s=await e();s.ok?n({title:"Up to date",description:"Plans, ideas, checks and PR review state re-read.",variant:"success"}):n({title:"Couldn't refresh",description:s.error??"The read failed — is the dev server running?",variant:"error"})};return d.jsx(ot,{icon:d.jsx("span",{className:"inline-flex",children:d.jsx(rW,{size:16})}),label:t?"Refreshing…":"Refresh data",size:"small",variant:"ghost",disabled:t,onClick:r})},B9=({plan:e,disabled:t})=>{const n=D(c=>c.launchRunAll),r=D(Xr),[s,i]=b.useState(!1),o=async()=>{if(e.id){i(!0);try{await n(e.id)}catch(c){alert(c.message)}finally{i(!1)}}},a=t||s||!e.id||!r,l=e.id?r?void 0:"No agent CLI found — set up in Settings":"Plan needs an ID before an agent can run";return d.jsx(Te,{content:l,children:d.jsx(qn,{size:"small",icon:d.jsx("span",{className:"text-ink-500",children:"▶"}),onClick:o,disabled:a,className:`text-xs leading-4 py-2 ${a?"opacity-50":""}`,children:s?"Starting…":"Run all phases"})})},V9=()=>{const e=D(y=>y.launchSuggestIdeas),t=D(y=>y.launchBatchReconcile),n=D(y=>y.launchPrioritise),r=D(y=>y.ideaEntries),s=D(y=>y.suggestions),i=D(vu),o=D(Xr),{toast:a}=He(),[l,c]=b.useState(null),u=async()=>{c("suggest");try{await e(i9(r,s))}catch(y){a({title:"Failed to launch",description:We(y.message),variant:"error"})}finally{c(null)}},f=async()=>{c("reconcile");try{await t()}catch(y){a({title:"Failed to launch",description:We(y.message),variant:"error"})}finally{c(null)}},p=async()=>{c("prioritise");try{const y=await n();a({title:y.moved.length>0?"Queue reordered":"Already in order",description:y.why||void 0,variant:"success"})}catch(y){a({title:"Failed to prioritise",description:We(y.message),variant:"error"})}finally{c(null)}},h=l!==null||i,m=[{id:"suggest-ideas",label:l==="suggest"?"Starting…":"Suggest ideas",icon:d.jsx($S,{size:16}),disabled:h||!o,onSelect:u},{id:"reconcile-all",label:l==="reconcile"?"Starting…":"Reconcile all",icon:d.jsx(NS,{size:16}),disabled:h||!o,onSelect:f},{id:"prioritise",label:l==="prioritise"?"Prioritising…":"Prioritise queue",icon:d.jsx(sW,{size:16}),disabled:h||!o,onSelect:p}];return d.jsx(FS,{align:"end",trigger:d.jsx(ot,{icon:d.jsx(VS,{size:16}),label:"More actions",size:"small",variant:"ghost"}),items:m})};function U9(e){const t=e==null?void 0:e.match(/^[a-z]+\/([a-z]+-\d+)-/);return t?t[1].toUpperCase():null}const Au="font-display-luminari text-sm font-semibold opacity-[0.65]",W9=({rollup:e})=>e.runs===0?null:d.jsxs("div",{className:"flex items-center gap-2 text-xs opacity-[0.55] flex-wrap flex-shrink-0 ml-auto",children:[d.jsx("span",{className:"font-semibold opacity-[0.85]",children:"Run cost"}),d.jsx("span",{"aria-hidden":!0,children:"·"}),d.jsxs("span",{children:[e.runs," ",e.runs===1?"run":"runs"]}),d.jsx("span",{"aria-hidden":!0,children:"·"}),d.jsx("span",{children:tC(e.durationMs)}),d.jsx("span",{"aria-hidden":!0,children:"·"}),d.jsx(Te,{content:`Cache: ${jo(e.cacheCreationTokens)} write · ${jo(e.cacheReadTokens)} read`,children:d.jsxs("span",{children:[jo(e.inputTokens)," in · ",jo(e.outputTokens)," out"]})})]}),H9=({plan:e,auditRunning:t,agentBusy:n,runningFill:r,updating:s,onTogglePhase:i,onToggleFix:o,onAddReviewPhases:a})=>{const l=D(h=>h.launchRunAll),c=e.fixes??[],u=c.some(h=>!h.done),f=[...e.phases.map((h,m)=>({kind:"phase",item:h,index:m})),...c.map((h,m)=>({kind:"fix",item:h,index:m}))],p=h=>h.kind==="phase"&&!h.item.done&&(r==null?void 0:r.index)===h.index;return d.jsx("div",{className:"mb-8",style:r?{"--phase-fill":`${r.fraction*100}%`}:void 0,children:d.jsx(T5,{data:f,toolbar:{title:d.jsx("h3",{className:`${Au} m-0`,children:"Phases"}),actions:d.jsxs(d.Fragment,{children:[t&&d.jsx(Hr,{size:"small",label:"Audit running…"}),(e.status==="review"||e.status==="done")&&d.jsx(D9,{plan:e}),e.status!=="done"&&d.jsx(z9,{plan:e}),d.jsx(N9,{onAdd:a,disabled:s}),e.id&&u&&d.jsx(Te,{content:"Run the open fixes with an agent",children:d.jsx(se,{size:"small",onClick:()=>e.id&&l(e.id),disabled:n,children:n?"Running…":"Run fixes"})})]})},panelFooter:d.jsx(nC,{plan:e}),columns:[{key:"checkbox",header:"",cell:h=>p(h)?d.jsx(Hr,{size:"small"}):d.jsx(sB,{checked:h.item.done,onChange:()=>h.kind==="phase"?i(h.index):o(h.index),disabled:s}),width:1},{key:"title",header:"Title",cell:h=>d.jsxs("span",{className:`inline-flex min-w-0 max-w-full items-center gap-2 ${h.item.done?"line-through opacity-[0.45]":"no-underline"}`,children:[d.jsx("span",{title:h.item.text,className:"overflow-hidden text-ellipsis whitespace-nowrap font-handwritten text-base leading-tight",children:h.item.text}),p(h)&&d.jsxs("span",{className:"text-xs opacity-[0.55]",children:[Math.round(((r==null?void 0:r.fraction)??0)*100),"%"]}),h.kind==="phase"&&h.item.source==="review"&&d.jsx(Pe,{size:"small",fillColor:rr.review.fill,textColor:rr.review.text,children:"review"}),h.kind==="fix"&&d.jsx(Pe,{size:"small",variant:"warning",children:"fix"})]})},{key:"actions",header:"",align:"end",cell:h=>p(h)?null:h.item.done?h.item.run?d.jsx("div",{className:"flex justify-end",children:d.jsx(Pe,{size:"small",fillColor:"var(--pui-texture-shade, rgba(0,0,0,0.06))",textColor:"inherit",children:d.jsxs("span",{className:"whitespace-nowrap font-mono text-3xs font-normal opacity-[0.7]",children:[jo(h.item.run.inputTokens+h.item.run.outputTokens)," tokens · ",tC(h.item.run.durationMs),h.item.run.attempts>1&&` ×${h.item.run.attempts}`,h.item.run.model&&` · ${h.item.run.model}`]})})}):null:h.kind!=="phase"?null:d.jsx("div",{className:"flex justify-end",children:d.jsx(L9,{planId:e.id,phaseIndex:h.index,disabled:n})}),width:5}],expandable:{render:h=>h.item.description||null},hideHeader:!0,density:"compact",showExpandColumn:!1,rowTexture:h=>{if(h.kind==="fix")return"kraft";if(h.kind==="phase"&&h.item.done)return"canvas"},rowClassName:h=>{if(p(h))return"phase-running-row";if(h.kind==="phase"&&h.item.source==="review")return"bg-[rgba(155,122,181,0.08)]"},className:"phase-table-phone"})})},G9=({plan:e,gitBranch:t,onOwnBranch:n,branching:r,onCreateBranch:s})=>{const i=e.status==="planned"||e.status==="in-progress"||e.status==="review";return!i&&!e.pr?null:d.jsxs("div",{className:"flex items-center gap-3 flex-wrap mb-3 min-h-8",children:[i&&!n&&d.jsx(de,{size:"small",accent:!0,accentColor:"amber",texture:"kraft",children:d.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[d.jsxs("span",{className:"text-xs",children:[d.jsx("code",{children:t??"unknown"})," — not this plan's branch."]}),e.id&&d.jsx(Te,{content:`Creates ${(e.kind??"feat").toLowerCase()}/${e.id.toLowerCase()}-… from main, or switches to it if it already exists`,children:d.jsx(se,{size:"small",onClick:s,disabled:r,children:r?"Switching…":"Create branch"})})]})}),i&&n&&d.jsx(de,{size:"small",texture:"paper",children:d.jsx("span",{className:"text-xs opacity-[0.6]",children:d.jsx("code",{children:t})})}),e.pr&&d.jsx(S9,{pr:e.pr})]})},K9=({progress:e,color:t,rollup:n})=>e===null&&n.runs===0?null:d.jsxs("div",{className:"flex items-center gap-3 mb-3 flex-wrap",children:[e!==null&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"flex-1 min-w-24",children:d.jsx(ZS,{pct:e.pct,color:t})}),d.jsxs("span",{className:"text-sm opacity-50 flex-shrink-0",children:[Math.round(e.pct),"%"]})]}),d.jsx(W9,{rollup:n})]}),q9=({plan:e})=>{const[t,n]=b.useState(!1);return b.useEffect(()=>n(!1),[e.id,e.title]),e.body?d.jsx("div",{className:"mb-4",children:d.jsx(A6,{title:d.jsx("span",{className:Au,children:"Description"}),expanded:t,onToggle:()=>n(r=>!r),children:d.jsx("div",{className:"opacity-[0.85]",children:d.jsx(fk,{children:e.body})})})}):null},Q9=({clarifications:e})=>e.length===0?null:d.jsxs("div",{className:"mb-5",children:[d.jsx("h3",{className:`${Au} mb-3`,children:"Clarifications"}),d.jsx("div",{className:"flex flex-col gap-2 mb-3",children:e.map((t,n)=>d.jsx("div",{className:"text-sm flex items-start justify-between gap-3 opacity-75",children:d.jsxs("span",{children:[d.jsx("span",{className:"font-semibold mr-2",children:t.date}),t.text]})},`clar-${t.date}-${n}`))})]}),nC=({plan:e})=>{const t=D(i=>i.gitStatus),n=b.useMemo(()=>(t==null?void 0:t.map(i=>i.path))??[],[t]),r=h9(e,n),s=n.length>0;return d.jsxs("div",{className:"grid grid-cols-1 items-start gap-x-6 gap-y-2 md:grid-cols-[minmax(0,1fr)_auto_16rem]",children:[d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsx(d9,{}),s&&d.jsx(p9,{state:r,filesEmpty:!s})]}),d.jsx(ng,{orientation:"vertical",className:"hidden md:block"}),d.jsx("div",{className:"flex flex-col gap-2",children:s?d.jsxs(d.Fragment,{children:[d.jsx(f9,{count:n.length}),d.jsx(m9,{state:r,filesEmpty:!s})]}):d.jsx(g9,{})})]})},Y9=({planId:e,released:t})=>{const n=ZW(e);return e?d.jsx("div",{className:"mb-3 text-xs opacity-80",children:n?d.jsx(_9,{trail:n,released:t}):d.jsx("div",{className:"max-w-xs","aria-hidden":"true",children:d.jsx(Kt,{variant:"text",height:32})})}):null},X9=({plan:e,updating:t,onSend:n,undo:r,undoing:s,onUndo:i})=>{var w;const[o,a]=b.useState(""),[l,c]=b.useState(null),[u,f]=b.useState(null),p=e.thread??[],{promotingIndex:h,promoteToDurable:m,promoteToIdea:y}=UW(e);VW(e,!0);const v=async()=>{const k=o.trim();k&&(c(k),a(""),await n(k)||a(j=>j||k),c(null))},g=(k,j)=>{j==="idea"?f(k):m(k,j)},x=async k=>{u!==null&&await y(u,k)&&f(null)};return d.jsxs("div",{className:"mb-8",children:[d.jsx("h3",{className:`${Au} mb-3`,children:"Feedback"}),d.jsxs(de,{size:"small",accent:!0,accentColor:"slate",texture:"kraft",children:[d.jsx("div",{className:"flex flex-col gap-3 mb-4",children:p.length>0||l?d.jsxs(d.Fragment,{children:[d.jsx(x9,{messages:p,undo:r,undoing:s,onUndo:i,onPromote:g,promotingIndex:h}),l&&d.jsx("div",{className:"flex flex-col gap-1 items-end",children:d.jsx("div",{className:"max-w-[85%]",children:d.jsx(de,{size:"small",surface:"paper",texture:"parchment",accent:!0,accentColor:"blue",children:l})})}),t&&d.jsx("div",{className:"flex flex-col gap-1 items-start",children:d.jsx(de,{size:"small",surface:"paper",texture:"kraft",shade:!0,children:d.jsx(Hr,{size:"small",label:"Agent thinking…"})})})]}):d.jsx("p",{className:"text-sm m-0 text-ink-500",children:"Jot a comment, ask a question, or say what's wrong with this plan."})}),d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsx(Ru,{value:o,onChange:k=>a(k.target.value),"aria-label":"Feedback message",placeholder:"Write a message…",rows:3}),d.jsx("div",{className:"flex justify-end items-center gap-3",children:d.jsx(se,{size:"small",onClick:v,disabled:t||!o.trim(),children:"Send"})})]})]}),d.jsx(eC,{open:u!==null,onClose:()=>f(null),onAdd:x,initialContent:u!==null?(w=p[u])==null?void 0:w.text:void 0})]})},J9=({plan:e})=>{const t=D(L=>L.plans),n=D(L=>L.gitBranch),r=D(L=>L.loadGitStatus),s=D(L=>L.loadPlans),{toast:i}=He(),{patch:o,updating:a}=Gi(),[l,c]=b.useState(!1),u=D(L=>L.agentStatus),f=D(vu),p=D(L=>L.detailView),h=D(L=>L.taskLog),m=D(L=>L.loadTaskLog),y=xm(e.id,u),v=YW(y,h),g=b.useMemo(()=>T9(h,e.id),[h,e.id]),x=(y==null?void 0:y.taskKind)==="audit",w=WM(e,(v==null?void 0:v.fraction)??0),k=e.phases.length>0,j=p==="feedback",_={id:e.id??null,title:e.title,body:e.body,log:e.log},S=((t==null?void 0:t.entries)??[]).filter(L=>L.id!==e.id),P=e.id!==void 0&&U9(n)===e.id;b.useEffect(()=>{m()},[m]);const T=async()=>{if(e.id){c(!0);try{const L=await wM(e.id);i({title:"Branch ready",description:`Now on ${L}`,variant:"success"}),await r()}catch(L){i({title:"Branch failed",description:We(L.message),variant:"error"})}finally{c(!1)}}},E=async L=>{const B=e.phases.map(($,Q)=>Q===L?{...$,done:!$.done}:$);B.every($=>$.done)&&e.status==="in-progress"?await o(e.title,{phases:B,status:"review"}):await o(e.title,{phases:B})},I=async L=>{await o(e.title,{phases:[...e.phases,...L]})},A=async L=>{const B=(e.fixes??[]).map(($,Q)=>Q===L?{...$,done:!$.done}:$);B.every($=>$.done)&&e.status==="in-progress"?await o(e.title,{fixes:B,status:"review"}):await o(e.title,{fixes:B})},{sending:O,send:M,undo:N,undoing:z,undoEdit:V}=XW(e,{reload:s,notify:i});return d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-baseline justify-between gap-3 mb-2 flex-wrap",children:[d.jsxs("h2",{className:`${E9} m-0 flex items-center gap-3 min-w-0 flex-wrap`,children:[d.jsx(Zr,{id:e.id}),e.title]}),d.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[d.jsx("span",{className:"text-sm opacity-[0.45] whitespace-nowrap",children:e.updated?`updated ${Rc(e.updated)}`:`created ${Rc(e.created)}`}),d.jsx($9,{})]})]}),d.jsx(Y9,{planId:e.id,released:e.released}),j?d.jsx(X9,{plan:e,updating:O,onSend:M,undo:N,undoing:z,onUndo:V}):d.jsxs(d.Fragment,{children:[d.jsx(G9,{plan:e,gitBranch:n,onOwnBranch:P,branching:l,onCreateBranch:T}),d.jsx(K9,{progress:w,color:XS[vm(e,u)],rollup:g}),d.jsx(q9,{plan:e}),d.jsx(Q9,{clarifications:e.clarifications??[]}),!k&&d.jsxs("div",{className:"flex items-center gap-3 mb-8",children:[d.jsx(Iu,{idea:_,otherPlans:S}),d.jsx(cg,{idea:_})]}),!k&&d.jsx(nC,{plan:e}),k&&d.jsx(H9,{plan:e,auditRunning:x,agentBusy:f,runningFill:v,updating:a,onTogglePhase:E,onToggleFix:A,onAddReviewPhases:I})]})]})},Z9=()=>{const[e,t]=b.useState(new Set);return b.useEffect(()=>{let n=!1;return xk().then(r=>{n||!r||t(new Set(r.horizons.flatMap(s=>s.items.map(i=>i.name))))}).catch(()=>{}),()=>{n=!0}},[]),e},xo="text-sm font-semibold opacity-60 whitespace-nowrap overflow-hidden",ug=({order:e,done:t,running:n,status:r})=>d.jsx("span",{className:"flex-[0_0_36px] flex items-center justify-center",children:n?d.jsx(Hr,{size:"small",label:"Agent running"}):t?d.jsx("span",{"aria-label":"Done",className:"text-watercolor-green-dark text-sm",children:"✓"}):e!==void 0?d.jsx(Pe,{size:"small",fillColor:"rgba(0,0,0,0.06)",children:d.jsx("span",{className:"font-handwritten text-xs leading-none",children:e})}):r==="idea"?d.jsx("span",{"aria-label":"Backlog — not planned yet",className:"inline-flex text-ink-300",children:d.jsx(sg,{size:14})}):null}),ep="grid grid-cols-[76px_minmax(0,1fr)_84px_96px_112px] gap-2.5 items-center max-lg:grid-cols-[76px_minmax(0,1fr)_96px_112px] max-[480px]:grid-cols-1 max-[480px]:gap-1",rC=({plans:e,activePlanTitle:t,onOpen:n,showHeader:r=!0})=>{const s=ep,i=D(o=>o.agentStatus);return d.jsxs("div",{className:"flex flex-col gap-1",children:[r&&d.jsxs("div",{className:"flex items-center",children:[d.jsx("span",{className:"flex-[0_0_36px]"}),d.jsx("div",{className:"flex-1 min-w-0",children:d.jsx(de,{size:"small",texture:"kraft",className:"plan-row-card",children:d.jsxs("div",{className:s,children:[d.jsx("span",{className:xo,children:"Id"}),d.jsx("span",{className:xo,children:"Title"}),d.jsx("span",{className:`max-lg:hidden ${xo}`,children:"Updated"}),d.jsx("span",{className:xo,children:"Progress"}),d.jsx("span",{className:xo,children:"Status"})]})})})]}),e.map(o=>{var c;const a=Sk(o),l=vm(o,i);return d.jsxs("div",{className:"flex items-center",children:[d.jsx(ug,{order:o.order,done:o.status==="done",status:o.status,running:!!xm(o.id,i)}),d.jsx("div",{role:n?"button":void 0,tabIndex:n?0:void 0,onClick:n?()=>n(o.title):void 0,onKeyDown:n?u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),n(o.title))}:void 0,className:`${n?"cursor-pointer":""} rounded-[10px] flex-1 min-w-0 ${o.title===t?"plan-row-highlighted outline outline-2 outline-offset-[-2px] outline-[rgba(200,154,90,0.5)]":""}`,children:d.jsx(de,{size:"small",texture:"canvas",className:"plan-row-card",children:d.jsxs("div",{className:s,children:[d.jsx(Zr,{id:o.id}),d.jsx("span",{className:"font-semibold overflow-hidden text-ellipsis whitespace-nowrap",children:o.title}),d.jsx("span",{className:"max-lg:hidden text-sm opacity-[0.45] whitespace-nowrap",children:o.updated?Rc(o.updated):Rc(o.created)}),a?d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx("div",{className:"flex-1 min-w-0",children:d.jsx(ZS,{pct:a.pct,color:XS[l]})}),d.jsxs("span",{className:"text-sm opacity-50 shrink-0",children:[a.done,"/",a.total]})]}):d.jsx("span",{className:"text-sm opacity-30",children:"—"}),d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx(Pe,{size:"small",fillColor:rr[l].fill,textColor:rr[l].text,children:lg[l]}),((c=o.pr)==null?void 0:c.state)==="merged"&&d.jsx(Te,{content:`Merged in #${o.pr.number}`,children:d.jsx("span",{className:"inline-flex text-[#7B5E9E]",children:d.jsx(BS,{size:14})})})]})]})})})]},o.title)})]})},eH=5,tH="text-sm font-semibold opacity-60 whitespace-nowrap overflow-hidden",sC="grid grid-cols-[76px_minmax(0,1fr)_84px_96px_112px] gap-2.5 items-center max-lg:grid-cols-[76px_minmax(0,1fr)_96px_112px] max-[480px]:grid-cols-1 max-[480px]:gap-1",O0="font-handwritten text-xs font-semibold opacity-55 leading-none pt-2 pr-1 pb-0 pl-1",z0=`${tH} bg-none bg-transparent border-none p-0 cursor-pointer [font:inherit] text-inherit text-left`,nH=[{key:"id",label:"Id"},{key:"title",label:"Title"},{key:"updated",label:"Updated"},{key:"progress",label:"Progress"},{key:"status",label:"Status"}],iC="flex items-center gap-2 min-w-0 bg-none bg-transparent border-none p-0 cursor-pointer text-left [font:inherit] text-inherit font-semibold",oC="overflow-hidden text-ellipsis whitespace-nowrap",rH=({rows:e,plans:t,activePlanTitle:n,onOpenPlan:r,onOpenIdea:s})=>{const[i,o]=b.useState(new Set),{subjects:a,loading:l,available:c}=KS(),u=Z9(),f=Vt(),p=sC,h=D(_=>_.planFilters.sortKey),m=D(_=>_.planFilters.sortDirection),y=D(_=>_.setPlanSortKey),v=D(_=>_.togglePlanSortDirection),g=_=>{_===h?v():y(_)},x=_=>{o(S=>{const P=new Set(S);return P.has(_)?P.delete(_):P.add(_),P})},w=_=>_.type==="plan"?d.jsx(rC,{plans:[_.plan],activePlanTitle:n,onOpen:r,showHeader:!1},_.plan.title):_.type==="note"?d.jsx(sH,{row:_,onOpen:s},_.idea.title):d.jsx(iH,{row:_,plans:t,activePlanTitle:n,onOpenPlan:r,onOpenIdea:s,expanded:i.has(_.idea.title),onToggleExpanded:()=>x(_.idea.title)},_.idea.title),k=rL(e,m,l||!c?void 0:a),j=k.length>1;return d.jsxs("div",{className:"flex flex-col gap-1",children:[d.jsxs("div",{className:"flex items-center",children:[d.jsx("span",{role:"columnheader",className:"flex-[0_0_36px] flex justify-center","aria-sort":h==="order"?m==="asc"?"ascending":"descending":void 0,children:d.jsxs("button",{type:"button",className:z0,"aria-label":"Sort by run order",onClick:()=>g("order"),children:["#",h==="order"&&(m==="asc"?"▲":"▼")]})}),d.jsx("div",{className:"flex-1 min-w-0",children:d.jsx(de,{size:"small",texture:"kraft",className:"plan-row-card",children:d.jsx("div",{className:p,children:nH.map(({key:_,label:S})=>{const P=_===h;return d.jsx("span",{role:"columnheader",className:_==="updated"?"max-lg:hidden":void 0,"aria-sort":P?m==="asc"?"ascending":"descending":void 0,children:d.jsxs("button",{type:"button",className:z0,onClick:()=>g(_),children:[S,P&&(m==="asc"?" ▲":" ▼")]})},_)})})})})]}),j?k.map(_=>{const S=_.subject;return d.jsxs("div",{className:"flex flex-col gap-1",children:[d.jsx("div",{className:"flex items-baseline gap-2",children:S&&u.has(S)?d.jsx("button",{type:"button",className:`${O0} bg-none bg-transparent border-none cursor-pointer text-left hover:underline`,title:"View in roadmap",onClick:()=>f({to:"/roadmap",search:{item:S}}),children:S}):d.jsx("div",{className:O0,children:S??"No subject"})}),_.rows.map(P=>w(P))]},S??"__no-subject__")}):e.map(_=>w(_))]})},sH=({row:e,onOpen:t})=>{const n=e.idea,r=n.status??"open";return d.jsxs("div",{className:"flex items-center",children:[d.jsx(ug,{order:n.order,done:r==="done",status:r}),d.jsx("div",{role:t?"button":void 0,tabIndex:t?0:void 0,onClick:t?()=>t(n.title):void 0,onKeyDown:t?s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),t(n.title))}:void 0,className:`${t?"cursor-pointer":""} rounded-[10px] flex-1 min-w-0`,children:d.jsx(de,{size:"small",texture:"canvas",className:"plan-row-card",children:d.jsxs("div",{className:sC,children:[n.id?d.jsx(Zr,{id:n.id}):d.jsx("span",{}),d.jsxs("span",{className:`${iC} [cursor:inherit]`,children:[d.jsx(US,{}),d.jsx("span",{className:oC,children:n.title})]}),d.jsx("span",{className:"max-lg:hidden text-sm opacity-[0.45]",children:"—"}),d.jsx("span",{className:"text-sm opacity-30",children:"—"}),d.jsx(Pe,{size:"small",fillColor:Kc[r].fill,textColor:Kc[r].text,children:JS[r]})]})})})]})},iH=({row:e,plans:t,activePlanTitle:n,onOpenPlan:r,onOpenIdea:s,expanded:i,onToggleExpanded:o})=>{const a=e.idea,l=e.children,c=l.filter(h=>h.status==="done"),u=l.filter(h=>h.status!=="done"),f=l.length>eH,p=f&&!i?u:l;return d.jsxs("div",{className:"flex flex-col gap-1",children:[d.jsxs("div",{className:"flex items-center",children:[d.jsx(ug,{order:a.order,done:a.status==="done",status:a.status}),d.jsx("div",{className:"flex-1 min-w-0",children:d.jsx(de,{size:"small",texture:"canvas",className:"plan-row-card",children:d.jsxs("div",{className:"grid grid-cols-[76px_minmax(0,1fr)_84px_1fr] gap-2 items-center max-[480px]:grid-cols-1 max-[480px]:gap-1",children:[a.id?d.jsx(Zr,{id:a.id}):d.jsx("span",{}),d.jsxs("button",{type:"button",onClick:()=>s==null?void 0:s(a.title),className:iC,children:[d.jsx(sg,{}),d.jsx("span",{className:oC,children:a.title})]}),d.jsx("span",{className:"max-lg:hidden text-sm opacity-[0.45]",children:"—"}),d.jsxs("div",{className:"flex items-center justify-end gap-2",children:[d.jsx("span",{className:`text-sm ${l.length>0?"opacity-60":"opacity-30"}`,children:l.length>0?`${c.length}/${l.length} plans done`:"—"}),d.jsx(cg,{idea:a,compact:!0}),d.jsx(Iu,{idea:a,otherPlans:t})]})]})})})]}),l.length>0&&d.jsxs("div",{className:"ml-5 pl-3 border-l-2 border-black/[8%] flex flex-col gap-1",children:[d.jsx(rC,{plans:p,activePlanTitle:n,onOpen:r,showHeader:!1}),f&&d.jsx("button",{type:"button",onClick:o,className:"self-start bg-none bg-transparent border-none py-1 px-0 opacity-60 cursor-pointer underline text-xs [font:inherit]",children:i?"Show less":`+${c.length} done`})]})]})},oH=({plans:e,rows:t,activePlanTitle:n,onOpenPlan:r,onOpenIdea:s})=>{const i=b.useRef(null);return b.useEffect(()=>{var a;if(!n)return;const o=(a=i.current)==null?void 0:a.querySelector(".plan-row-highlighted");o==null||o.scrollIntoView({behavior:"smooth",block:"center"})},[n]),d.jsx("div",{ref:i,children:t.length>0?d.jsx(rH,{rows:t,plans:e,activePlanTitle:n,onOpenPlan:r,onOpenIdea:s}):d.jsx("p",{className:"opacity-50 py-6 px-0 text-center",children:"Nothing matches these filters — clear one, or check back once something moves into this status."})})},aH=({idea:e})=>d.jsxs("div",{className:"text-base leading-[1.7] text-ink-900",children:[d.jsxs("h2",{className:"font-display-luminari font-semibold text-[1.75rem] leading-tight mt-0 mr-0 mb-4 ml-0 flex items-center gap-3 flex-wrap",children:[d.jsx(Zr,{id:e.id??void 0}),e.title,e.status&&d.jsx(Pe,{size:"small",fillColor:Kc[e.status].fill,textColor:Kc[e.status].text,children:JS[e.status]})]}),d.jsx(fk,{children:e.body.replace(/^#{1,3}\s+.+(\n|$)/,"").replace(/^\s*-{3,}\s*(\n|$)/,"").trim()}),d.jsx("div",{className:"mt-6",children:d.jsx(cg,{idea:e})})]}),ff="__no-subject__",vo="text-2xs font-semibold tracking-[0.08em] uppercase text-ink-300",lH=()=>{const e=ig(),t=D(vu),n=D(M=>M.agentStatus),{patch:r,updating:s}=Gi(),{subjects:i,available:o}=KS(),a=D(M=>M.detailView),l=D(M=>M.setDetailView),c=D(M=>M.archiveIdeas),{toast:u}=He(),f=Vt(),[p,h]=b.useState(""),[m,y]=b.useState(!1);if(b.useEffect(()=>{h((e==null?void 0:e.order)!==void 0?String(e==null?void 0:e.order):"")},[e==null?void 0:e.order]),!e)return null;const v=vm(e,n),g=e.status==="in-progress",x=e.status==="review",w=e.status==="dropped",k=e.status==="done",j=e.phases.some(M=>!M.done),_=(e.status==="planned"||g)&&j,S=HM(e),P=!!(e.pr&&(e.pr.state==="open"||e.pr.state==="draft")&&e.pr.unresolvedThreadCount),T=o&&e.subject&&!i.includes(e.subject)?e.subject:void 0,E=M=>r(e.title,M),I=async()=>{if(e.id){y(!0);try{await c([e.id])}catch(M){u({title:"Archive failed",description:M.message,variant:"error"})}finally{y(!1)}}},A=g||x||e.status==="planned",O=async()=>{const M=p.trim(),N=Number(M);if(M===""||!Number.isInteger(N)||N<1){h(e.order!==void 0?String(e.order):"");return}N!==e.order&&await E({order:N})};return d.jsxs("div",{className:"flex flex-col gap-4 -mt-5",children:[d.jsx(DS,{items:[{id:"plans",label:"Plans",onClick:()=>f({to:"/"})},{id:"plan",label:e.title}]}),d.jsxs("div",{children:[d.jsx("div",{className:`${vo} mb-1.5`,children:"Show"}),d.jsxs("div",{className:"flex flex-col gap-1",children:[d.jsx(qn,{size:"small",active:a==="details",onClick:()=>l("details"),className:"text-xs leading-4 py-2",children:"Details"}),d.jsx(qn,{size:"small",active:a==="feedback",onClick:()=>l("feedback"),className:"text-xs leading-4 py-2",children:"Feedback"})]})]}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("div",{className:vo,children:"Status"}),d.jsx(Pe,{size:"small",fillColor:rr[v].fill,textColor:rr[v].text,children:lg[v]})]}),d.jsxs("div",{children:[d.jsx("div",{className:`${vo} mb-1.5`,children:"Subject"}),d.jsx(IS,{size:"small",value:e.subject??ff,onChange:M=>E({subject:M===ff?null:M}),disabled:s||!o,options:[{value:ff,label:"No subject"},...T?[{value:T,label:`${T} (orphan)`}]:[],...!o&&e.subject&&!T?[{value:e.subject,label:e.subject}]:[],...i.map(M=>({value:M,label:M}))]})]}),A&&d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("div",{className:vo,children:"Order"}),d.jsx(Ta,{type:"number",size:"small","aria-label":"Run order",min:1,value:p,onChange:M=>h(M.target.value),onBlur:O,disabled:s,className:"w-20"})]}),d.jsxs("div",{children:[d.jsx("div",{className:`${vo} mb-1.5`,children:"Actions"}),d.jsxs("div",{className:"flex flex-col gap-1",children:[_&&d.jsx(B9,{plan:e,disabled:t||s}),P&&d.jsx(F9,{plan:e,disabled:t||s}),x&&d.jsx(qn,{size:"small",icon:d.jsx("span",{className:"text-watercolor-green-dark",children:"✓"}),onClick:()=>E({status:"done"}),disabled:s,className:`text-xs leading-4 py-2 ${s?"opacity-50":""}`,children:"Approve & close"}),k&&d.jsx(qn,{size:"small",icon:d.jsx("span",{className:"text-ink-300",children:"▣"}),onClick:I,disabled:m||!e.id,className:`text-xs leading-4 py-2 ${m||!e.id?"opacity-50":""}`,children:m?"Archiving…":"Archive"}),S&&d.jsx(qn,{size:"small",icon:d.jsx("span",{className:"text-watercolor-green-dark",children:"✓"}),onClick:I,disabled:m||!e.id,className:`text-xs leading-4 py-2 ${m||!e.id?"opacity-50":""}`,children:m?"Marking done…":"Mark done"}),!k&&d.jsx(qn,{size:"small",icon:d.jsx("span",{className:w?"text-watercolor-green-dark":"text-watercolor-rose-dark",children:w?"↺":"⊘"}),onClick:()=>E({status:w?null:"dropped"}),disabled:s,className:`text-xs leading-4 py-2 ${s?"opacity-50":""}`,children:w?"Reopen plan":"Mark dropped"})]})]})]})},cH=["in-progress","review","planned","idea","done","dropped"],uH="text-2xs font-semibold tracking-[0.08em] uppercase text-ink-300 mb-2",dH=()=>{const e=D(f=>f.plans),t=ig(),n=D(f=>f.planFilters),r=D(f=>f.togglePlanStatus),s=D(f=>f.setPlanSearch),i=D(f=>f.setSubjectFilter),o=Vt();if(!e||t)return null;const{statusCounts:a}=Vl(e.entries,n),l=new Set(n.statuses),c="bg-none bg-transparent border-none p-0 cursor-pointer opacity-70 underline text-2xs",u=cH.filter(f=>a[f]>0||l.has(f));return d.jsxs("div",{className:"flex flex-col gap-8 -mt-5",children:[d.jsx(Ta,{type:"search",size:"small",placeholder:"Search plans…","aria-label":"Search plans",value:n.search,onChange:f=>s(f.target.value)}),n.subject!==null&&d.jsxs("div",{className:"flex items-center gap-2","data-testid":"subject-filter-chip",children:[d.jsxs("span",{className:"text-2xs opacity-70",children:["Subject: ",n.subject]}),d.jsx("button",{type:"button",onClick:()=>{i(null),o({to:"/",search:{}})},className:c,children:"Clear"})]}),d.jsxs("div",{children:[d.jsx("div",{className:uH,children:"Status"}),d.jsx("div",{className:"flex flex-col gap-1",children:u.map(f=>{const p=l.has(f);return d.jsx(qn,{size:"small",active:p,onClick:()=>r(f),className:"text-xs leading-4 py-2",icon:d.jsx("span",{className:"w-[9px] h-[9px] rounded-full shrink-0",style:{background:rr[f].text}}),action:d.jsx("span",{className:"text-2xs text-ink-500",children:a[f]}),children:lg[f]},f)})})]})]})},$0=()=>d.jsxs("div",{className:"flex items-center gap-3 mb-6 flex-wrap",children:[d.jsx("h1",{className:"text-4xl flex-1 font-display-luminari font-semibold text-ink-900 m-0 leading-[1.1]",children:"Plans"}),d.jsx(O9,{}),d.jsx(M9,{}),d.jsx(V9,{})]}),fH=[{key:"a",title:"72%"},{key:"b",title:"54%"},{key:"c",title:"83%"},{key:"d",title:"46%"},{key:"e",title:"66%"},{key:"f",title:"58%"}],hH=()=>d.jsxs("div",{className:"flex flex-col gap-1","aria-hidden":"true",children:[d.jsxs("div",{className:"flex items-center",children:[d.jsx("span",{className:"flex-[0_0_36px]"}),d.jsx("div",{className:"flex-1 min-w-0",children:d.jsx(de,{size:"small",texture:"kraft",className:"plan-row-card",children:d.jsxs("div",{className:ep,children:[d.jsx(Kt,{variant:"text",width:28}),d.jsx(Kt,{variant:"text",width:44}),d.jsx("span",{className:"max-lg:hidden",children:d.jsx(Kt,{variant:"text",width:56})}),d.jsx(Kt,{variant:"text",width:64}),d.jsx(Kt,{variant:"text",width:48})]})})})]}),fH.map(e=>d.jsxs("div",{className:"flex items-center",children:[d.jsx("span",{className:"flex-[0_0_36px] flex items-center justify-center",children:d.jsx(Kt,{variant:"text",width:16})}),d.jsx("div",{className:"flex-1 min-w-0",children:d.jsx(de,{size:"small",className:"plan-row-card",children:d.jsxs("div",{className:ep,children:[d.jsx(Kt,{variant:"rect",width:44,height:18}),d.jsx(Kt,{variant:"text",width:e.title}),d.jsx("span",{className:"max-lg:hidden",children:d.jsx(Kt,{variant:"text",width:52})}),d.jsx(Kt,{variant:"rect",width:80,height:8}),d.jsx(Kt,{variant:"rect",width:64,height:20})]})})})]},e.key))]}),pH=()=>{const e=D(u=>u.reconcileQueue),t=D(u=>u.removeFromReconcileQueue),n=D(u=>u.plans),{patch:r}=Gi(),{toast:s}=He(),i=b.useRef(0),o=e[0]??null,a=o?(n==null?void 0:n.entries.find(u=>u.id===o.planId))??null:null;if(b.useEffect(()=>{o&&!a&&t(o.previewId)},[o,a,t]),b.useEffect(()=>{e.length===0&&(i.current=0)},[e.length]),!o||!a)return null;const l=async()=>{t(o.previewId),i.current+=1,s({title:"Kept the merged version",description:`"${a.title}" keeps the agent's rewrite.`})},c=async()=>{await r(a.title,{body:o.before.body,phases:o.before.phases},{errorTitle:"Discard failed"})&&(t(o.previewId),i.current+=1)};return d.jsx(j9,{plan:a,before:o.before,onApprove:l,onDiscard:c,queuePosition:{index:i.current+1,total:i.current+e.length}})},mH=({suggestions:e,onOpen:t,onDismiss:n})=>e.length===0?null:d.jsxs("div",{className:"mt-5",children:[d.jsx("h2",{className:"text-sm mb-2 opacity-60",children:"Suggested from AI"}),d.jsx("div",{className:"flex flex-col gap-1",children:e.map(r=>d.jsx("div",{className:"rounded-[10px]",children:d.jsx(de,{size:"small",texture:"canvas",className:"plan-row-card",children:d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs("button",{type:"button",onClick:()=>t(r),className:"flex-1 min-w-0 flex items-center gap-2 bg-none bg-transparent border-none p-0 cursor-pointer text-left [font:inherit] text-inherit",children:[d.jsx(sg,{}),d.jsx("span",{className:"font-semibold overflow-hidden text-ellipsis whitespace-nowrap",children:r.title})]}),d.jsx(ot,{icon:d.jsx("span",{children:"×"}),variant:"ghost",size:"small",label:"Dismiss",className:"w-[28px] h-[28px]",onClick:()=>n(r)})]})})},`${r.date}-${r.title}`))})]}),dg=()=>{const e=D(_=>_.plans),t=D(_=>_.plansError),n=D(_=>_.ideaEntries),r=D(_=>_.suggestions);D(_=>_.loadPlans);const s=D(_=>_.setDetailView),i=D(_=>_.planFilters),o=D(_=>_.setSubjectFilter),a=ig(),l=kW(),{planId:c,ideaId:u}=Ds({strict:!1}),f=D(_=>_.dismissSuggestion),p=Vt(),{toast:h}=He(),{subject:m}=tm({strict:!1});b.useEffect(()=>{o(m??null)},[m,o]),b.useEffect(()=>{s("details")},[a,l,s]);const y=()=>{p({to:"/"})},v=_=>{var P;const S=(P=e==null?void 0:e.entries.find(T=>T.title===_))==null?void 0:P.id;p({to:"/plans/$planId",params:{planId:ga(S,_)}})},g=_=>{var P;const S=(P=n.find(T=>T.title===_))==null?void 0:P.id;p({to:"/ideas/$ideaId",params:{ideaId:ga(S,_)}})},[x,w]=b.useState(null),k=async _=>{try{await f(_)}catch(S){h({title:"Failed to dismiss suggestion",description:S.message,variant:"error"})}};if(t)return d.jsxs("div",{children:[d.jsx($W,{children:"Plans"}),d.jsxs(de,{size:"small",accent:!0,accentColor:"rose",children:[d.jsx("p",{className:"m-0 font-semibold",children:"Couldn't load plans.md"}),d.jsx("p",{className:"m-0 opacity-75",children:t})]})]});if(!e)return c||u?d.jsxs("div",{children:[d.jsx("output",{"aria-live":"polite",className:"sr-only",children:"Loading…"}),d.jsx("p",{className:"opacity-50",children:"Loading…"})]}):d.jsxs("div",{children:[d.jsx($0,{}),d.jsx("output",{"aria-live":"polite",className:"sr-only",children:"Loading plans…"}),d.jsx(hH,{})]});const{rows:j}=sL(e.entries,n,i);return d.jsxs(d.Fragment,{children:[d.jsx(pH,{}),a?d.jsx("div",{children:d.jsx(J9,{plan:a})}):l?d.jsxs("div",{children:[d.jsx("div",{className:"mb-4",children:d.jsx(DS,{items:[{id:"plans",label:"Plans",onClick:y},{id:"idea",label:l.title}]})}),d.jsx(aH,{idea:l})]}):d.jsxs("div",{children:[d.jsx($0,{}),e.warnings.length>0&&d.jsxs(de,{size:"small",accent:!0,accentColor:"amber",children:[d.jsx("p",{className:"m-0 font-semibold",children:"Some entries couldn't be parsed"}),d.jsx("ul",{className:"m-0 pl-5",children:e.warnings.map(_=>d.jsxs("li",{children:[_.title,": ",_.message]},_.title))})]}),e.entries.length===0?d.jsxs("p",{className:"opacity-50",children:["No ideas yet — capture one with ",d.jsx("strong",{children:"New idea"})," above, or click"," ",d.jsx("strong",{children:"Suggest ideas"})," to have an agent propose some."]}):d.jsx(oH,{plans:e.entries,rows:j,activePlanTitle:null,onOpenPlan:v,onOpenIdea:g}),d.jsx(P9,{onOpenIdea:g}),d.jsx(mH,{suggestions:r,onOpen:w,onDismiss:k}),d.jsx(C9,{suggestion:x,onClose:()=>w(null)})]})]})};function gH(e){return e.filter(t=>t.kind!=="question")}function yH(e,t){return t?e.filter(n=>!t.has(n.id)):[]}function xH(){const e=D(r=>r.notifications),t=D(r=>r.loadNotifications),n=b.useRef(null);b.useEffect(()=>{typeof Notification<"u"&&Notification.permission==="default"&&Notification.requestPermission()},[]),b.useEffect(()=>{if(!e)return;const r=gH(e),s=yH(r,n.current);if(n.current=new Set(r.map(i=>i.id)),s.length!==0&&!(typeof Notification>"u"||Notification.permission!=="granted")&&!document.hasFocus())for(const i of s)new Notification(i.entityTitle,{body:i.text})},[e]),b.useEffect(()=>{const r=new EventSource(G("/api/activity/stream"));let s;return r.onmessage=i=>{let o;try{o=JSON.parse(i.data)}catch{return}o.message==="changed"&&(s&&clearTimeout(s),s=setTimeout(t,250))},()=>{s&&clearTimeout(s),r.close()}},[t])}const vH="data-paper-camp-mount";function wH(e){return(e==null?void 0:e.getAttribute(vH))??""}const aC=typeof document>"u"?"":wH(document.getElementById("root")),lC=b.lazy(()=>vn(()=>import("./index-BiMhnqOS.js"),__vite__mapDeps([0,1]),import.meta.url).then(e=>({default:e.DocsPage}))),bH=b.lazy(()=>vn(()=>import("./index-BiMhnqOS.js"),__vite__mapDeps([0,1]),import.meta.url).then(e=>({default:e.DocsSidebar}))),cC=b.lazy(()=>vn(()=>import("./index-Dw1f2idP.js"),__vite__mapDeps([2,3,1]),import.meta.url).then(e=>({default:e.SettingsPage}))),kH=b.lazy(()=>vn(()=>import("./index-Dw1f2idP.js"),__vite__mapDeps([2,3,1]),import.meta.url).then(e=>({default:e.SettingsSidebar}))),_H=b.lazy(()=>vn(()=>import("./index-UPIRvQZS.js"),__vite__mapDeps([4,3]),import.meta.url).then(e=>({default:e.TasksPage}))),SH=b.lazy(()=>vn(()=>import("./index-Db-zMFvA.js"),[],import.meta.url).then(e=>({default:e.RoadmapPage}))),CH=b.lazy(()=>vn(()=>import("./index-Db-zMFvA.js"),[],import.meta.url).then(e=>({default:e.RoadmapSidebar}))),jH=b.lazy(()=>vn(()=>import("./index-B_KrbzkW.js"),__vite__mapDeps([5,3]),import.meta.url).then(e=>({default:e.StatsPage}))),PH=b.lazy(()=>vn(()=>import("./index-DahTzD09.js"),[],import.meta.url).then(e=>({default:e.GitPage}))),EH=b.lazy(()=>vn(()=>import("./index-DahTzD09.js"),[],import.meta.url).then(e=>({default:e.GitFileList}))),TH=b.lazy(()=>vn(()=>import("./index-2KbxO2gv.js"),[],import.meta.url).then(e=>({default:e.InboxPage}))),hf=[{id:"plans",label:"Plans",path:"/"},{id:"roadmap",label:"Roadmap",path:"/roadmap"},{id:"docs",label:"Docs",path:"/docs"},{id:"tasks",label:"Tasks",path:"/tasks"},{id:"stats",label:"Stats",path:"/stats"},{id:"settings",label:"Settings",path:"/settings"}],B0=({item:e})=>d.jsx("span",{className:"inline-flex items-center gap-1.5",children:e.label}),V0=()=>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"})}),uC="stack-open";function NH(){try{return localStorage.getItem(uC)==="true"}catch{return!1}}function RH(e){try{localStorage.setItem(uC,String(e))}catch{}}const IH="(min-width: 1440px)";function AH(e){const[t,n]=b.useState(()=>typeof window<"u"?window.matchMedia(e).matches:!1);return b.useEffect(()=>{const r=window.matchMedia(e),s=i=>n(i.matches);return n(r.matches),r.addEventListener("change",s),()=>r.removeEventListener("change",s)},[e]),t}const MH=()=>{var P;const e=Vt(),t=UT({select:T=>T.location.pathname}),n=D(T=>T.loadPlans),r=D(T=>T.loadIdeas),s=D(T=>T.loadSuggestions),i=D(T=>T.loadCapabilities),o=D(T=>T.loadAgentAuthStatus),a=D(T=>T.loadParkedQuestions),l=D(T=>T.loadNotifications),c=D(T=>T.setActiveDocTitle),u=t==="/"||t.startsWith("/plans/")||t.startsWith("/ideas/"),f=t==="/docs"||t.startsWith("/docs/"),p=t==="/settings"||t.startsWith("/settings/"),h=t==="/roadmap",m=t==="/git",y=u?"plans":f?"docs":p?"settings":(P=hf.find(T=>T.path===t))==null?void 0:P.id,v=u||f||p||h||m,g=u?"plans":f?"docs":p?"settings":h?"roadmap":"git",[x,w]=b.useState(NH),[k,j]=b.useState(!1),_=AH(IH),S=b.useRef(!1);return xH(),b.useEffect(()=>{n(),r(),s(),i(),o(),a(),l()},[n,r,s,i,o,a,l]),b.useEffect(()=>{S.current||t!=="/"||(S.current=!0,Promise.all([ym(),mk()]).then(([T,E])=>{if(!(T!=null&&T.setupDismissed)&&E!==null&&!E.every(I=>I.status==="ok")){e({to:"/settings/$section",params:{section:"setup"}});return}Promise.all([vk(),kk()]).then(([I,A])=>{I.entries.length>1||A.entries.length>0||(c("USAGE.md"),e({to:"/docs"}))})}))},[t,e,c]),b.useEffect(()=>{j(!1)},[t]),d.jsxs(lU,{position:"bottom-left",children:[d.jsxs("div",{className:"h-screen box-border min-[1440px]:pr-[480px] flex flex-col",children:[d.jsx(jW,{}),d.jsx(zW,{}),d.jsx(H4,{style:{flex:"1 1 0%",minHeight:0,height:"auto"},background:{texture:"speckle",ruledType:"grid",ruledColor:"blue"},showHeader:!0,showSidebar:!1,showPage:!1,bleedBottom:!0,headerActions:d.jsxs(d.Fragment,{children:[v&&d.jsx(ot,{variant:"ghost",size:"small",className:"lg:hidden max-[480px]:hidden",label:"Open sidebar",onClick:()=>j(!0),icon:d.jsx(V0,{})}),d.jsx(CW,{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:hf.map(T=>d.jsx(se,{variant:"ghost",size:"small",isActive:T.id===y,onClick:()=>e({to:T.path}),"aria-current":T.id===y?"page":void 0,children:d.jsx(B0,{item:T})},T.id))})]}),children:d.jsx("div",{className:"flex flex-col h-full min-h-0",children:d.jsx("div",{className:"flex flex-1 min-h-0 justify-center items-start box-border overflow-y-auto [scrollbar-gutter:stable] -mt-8 -ml-8 -mr-8 pt-0 pl-8 pr-8 pb-[var(--pc-content-pad-bottom,32px)]",children:d.jsxs("div",{className:"flex min-w-0 justify-center lg:[--pc-sidebar-h:calc(100vh-160px)] gap-6 w-full",children:[v&&d.jsxs(PW,{routeKey:g,mobileOpen:k,onMobileClose:()=>j(!1),children:[u&&d.jsxs(d.Fragment,{children:[d.jsx(dH,{}),d.jsx(lH,{})]}),f&&d.jsx(b.Suspense,{fallback:null,children:d.jsx(bH,{})}),p&&d.jsx(b.Suspense,{fallback:null,children:d.jsx(kH,{})}),h&&d.jsx(b.Suspense,{fallback:null,children:d.jsx(CH,{})}),m&&d.jsx(b.Suspense,{fallback:null,children:d.jsx(EH,{})})]}),d.jsx("div",{className:`flex flex-col min-w-0 ${_?"flex-[1_1_0%]":"flex-[0_1_800px]"}`,children:d.jsx("div",{className:"flex flex-col flex-1 min-w-0",children:d.jsx(ES,{texture:{texture:"parchment"},outline:!0,className:`min-h-[calc(100vh-160px)] w-full ${_?"max-w-none":""}`,children:d.jsx(b.Suspense,{fallback:null,children:d.jsx(Tb,{})})})})})]})})})})]}),d.jsx(yW,{open:x,pinned:_,onToggle:()=>{const T=!x;RH(T),w(T)}}),d.jsxs("nav",{"aria-label":"Main navigation",className:"hidden max-[480px]:flex max-[480px]:fixed max-[480px]:left-0 max-[480px]:right-0 max-[480px]:bottom-0 max-[480px]:z-[250] max-[480px]:items-stretch max-[480px]:justify-around max-[480px]:gap-1 max-[480px]:py-2 max-[480px]:px-2 max-[480px]:[padding-bottom:calc(0.5rem+env(safe-area-inset-bottom))] max-[480px]:bg-[var(--pui-bg-base,#fff)] max-[480px]:border-t max-[480px]:border-black/10 max-[480px]:shadow-[0_-2px_8px_rgba(0,0,0,0.08)]",children:[v&&d.jsx(ot,{variant:"ghost",size:"small",label:"Open sidebar",onClick:()=>j(!0),icon:d.jsx(V0,{}),className:"min-h-11"}),hf.map(T=>d.jsx(se,{variant:"ghost",size:"small",isActive:T.id===y,onClick:()=>e({to:T.path}),"aria-current":T.id===y?"page":void 0,className:"min-h-11",children:d.jsx(B0,{item:T})},T.id))]})]})},Ut=ET({component:MH}),LH=sn({getParentRoute:()=>Ut,path:"/",component:dg,validateSearch:e=>({subject:typeof e.subject=="string"?e.subject:void 0})}),DH=sn({getParentRoute:()=>Ut,path:"/plans/$planId",component:dg}),FH=sn({getParentRoute:()=>Ut,path:"/ideas/$ideaId",component:dg}),OH=sn({getParentRoute:()=>Ut,path:"/docs",component:lC}),zH=sn({getParentRoute:()=>Ut,path:"/docs/$section",component:lC}),$H=sn({getParentRoute:()=>Ut,path:"/settings",component:cC}),BH=sn({getParentRoute:()=>Ut,path:"/settings/$section",component:cC}),VH=sn({getParentRoute:()=>Ut,path:"/roadmap",component:SH,validateSearch:e=>({item:typeof e.item=="string"?e.item:void 0})}),UH=sn({getParentRoute:()=>Ut,path:"/inbox",component:TH}),WH=sn({getParentRoute:()=>Ut,path:"/stats",component:jH}),HH=sn({getParentRoute:()=>Ut,path:"/git",component:PH}),GH=sn({getParentRoute:()=>Ut,path:"/tasks",component:_H,validateSearch:e=>({taskId:typeof e.taskId=="string"?e.taskId:void 0})}),KH=Ut.addChildren([LH,DH,FH,OH,zH,$H,BH,GH,VH,WH,UH,HH]),qH=zT({routeTree:KH,basepath:aC||"/"});UA(aC);const dC=document.getElementById("root");if(!dC)throw new Error("#root element not found");tb(dC).render(d.jsx(b.StrictMode,{children:d.jsx(VT,{router:qH})}));export{Te as $,s7 as A,ZH as B,He as C,i7 as D,DS as E,Na as F,m7 as G,We as H,o7 as I,se as J,ga as K,t7 as L,fk as M,b9 as N,lg as O,$W as P,e7 as Q,de as R,rr as S,a7 as T,l7 as U,Z9 as V,f6 as W,KM as X,jo as Y,tC as Z,lf as _,Vt as a,EW as a0,h9 as a1,p9 as a2,m9 as a3,a9 as a4,BS as a5,tW as a6,nW as a7,Zr as a8,XW as a9,x9 as aa,Ru as ab,Hr as ac,p7 as b,G as c,E9 as d,MS as e,n7 as f,Pe as g,QH as h,Ta as i,d as j,ym as k,YH as l,KS as m,h7 as n,vW as o,qn as p,JH as q,b as r,XH as s,f7 as t,D as u,IS as v,ng as w,r7 as x,QM as y,tm as z};
|
|
217
|
+
//# sourceMappingURL=main-CfeIUKG-.js.map
|